ftp.nice.ch/pub/next/database/apps/Stopwatch.2.5.s.tar.gz#/Stopwatch2.5/AppIconView.m

This is AppIconView.m in view mode; [Download] [Up]

/*
 * For legal stuff see the file COPYRIGHT
 */
#import "AppIconView.h"

@implementation AppIconView


/* Pass in a size and a subclass of View */
- initFrame:(const NXRect *)frameRect sourceView:obj 
{
	[super initFrame:frameRect];
 	sourceWindow = [obj window];
	[obj getFrame:&sourceRect];
	return self;
}
    
- drawSelf:(const NXRect *)rects :(int)count
{
	NXPoint	point = {9.0, 3.0};
	id bitmap, image;
    
#ifdef ERASE_BACKGROUND
	NXPoint	origin = {0.0, 0.0};
	[[NXImage findImageNamed:"NXAppTile"] composite:NX_SOVER toPoint:&origin];
#endif
	
	/* Read the bits from the window */
	[[sourceWindow contentView] lockFocus];
	bitmap = [[NXBitmapImageRep alloc] initData:NULL fromRect:&sourceRect];
	[[sourceWindow contentView] unlockFocus];
	[sourceWindow display];

	if (bitmap)
	{
		image=[[NXImage alloc] initSize:&sourceRect.size];		
		[image useRepresentation:bitmap];
		[image composite:NX_SOVER toPoint:&point];
		[image free];
	}
	else
		[bitmap free];
	return self;
}

@end

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.