ftp.nice.ch/pub/next/graphics/video/NDCamera.0.21.N.bsd.tar.gz#/NDCamera.0.21.N.bsd/Source/SimpleImageView.m

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

//		Written by Thomas Engel Copyright (c) 1995 by Thomas Engel.
//				Version 1.0.  All rights reserved.
//
//		This notice may not be removed from this source code.
//
//	This object is included in the MiscKit by permission from the author
//	and its use is governed by the MiscKit license, found in the file
//	"LICENSE.rtf" in the MiscKit distribution.  Please refer to that file
//	for a list of all applicable permissions and restrictions.
//	

#import "SimpleImageView.h"

#define SIMPLEIMAGEVIEW_VERSION 0
#define SIMPLEIMAGEVIEW_CLASSNAME "SimpleImageView"


@implementation  SimpleImageView

+ initialize
{
	// Initialize the current version number which is used when archiving 
	// objects. This way we will be able to read all versions if we are 
	// careful.

	if( self == [SimpleImageView class] )
		[self setVersion:SIMPLEIMAGEVIEW_VERSION];
		
	return self;
}

- setImage:anImage
{
	theImage = anImage;
	[self display];
	return self;
}

- drawSelf:(const NXRect *)rects :(int)rectCount
{
	NXPoint	lowerLeft = {0, 0};

	if( theImage )
		[theImage composite:NX_COPY toPoint:&lowerLeft];

	return self;
}

- read:(NXTypedStream *)stream
{
	int  version;
  
	[super read:stream];
/*		
	version = NXTypedStreamClassVersion( stream, SIMPLEIMAGEVIEW_CLASSNAME );

	switch( version )
	{
		case 0:
			backgroundColor = NXReadColor( stream );
			NXReadType( stream, "c", &sameColorAsDesktop );
			break;
		
		default:
			break;
	}
*/
	return self;
}

- write:(NXTypedStream *)stream
{
	[super write:stream];
/*
	NXWriteColor( stream, backgroundColor );
	NXWriteType( stream, "c", &sameColorAsDesktop );
*/
	return self;
}

@end

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