File:  [NeXTSTEP 3.3 examples] / Examples / AppKit / Backspace / PanelImageView.m
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:48:30 2018 UTC (8 years, 1 month ago) by root
Branches: NeXT, MAIN
CVS tags: NeXTSTEP33, HEAD
Sample Programs from NeXSTEP 3.3

//  PanelImageView.m
//  implements the view that places an image in BackSpace's image inspector.
//
//  You may freely copy, distribute, and reuse the code in this example.
//  NeXT disclaims any warranty of any kind, expressed or  implied, as to its
//  fitness for any particular use.


#import "PanelImageView.h"
#import <dpsclient/wraps.h>
#import <appkit/graphics.h>
#import <appkit/NXImage.h>

@implementation PanelImageView

- setImage: anImage
{
	image = anImage;
	return self;
}

- image
{
	return image;
}

- drawSelf: (const NXRect *) rects: (int) rectCount
{
	BOOL wasScalable;
	NXSize wasSize;


	PSsetgray(0);
	NXRectFill(rects);
	if (image)
	{
		wasScalable = [image isScalable];
		[image getSize: &wasSize];

		[image setScalable: YES];
		[image setSize: &rects->size];
		[image composite: NX_SOVER toPoint: &rects->origin];
		[image setScalable: wasScalable];
		[image setSize: &wasSize];
	}

	return self;
}

@end

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.