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

#import "BezierView.h"
#import <appkit/Application.h>
#import "BezierWraps.h"
#import <dpsclient/wraps.h>

@implementation BezierView

+ initialize
{
    if ( self == [BezierView class] )
	{
		// load PostScript procedures SpaceView needs
		// must be careful these are loaded into the correct context
		PSWbezierCreate();
    }
    return self;
}

- oneStep
{
	PSWbezierOneStep();
	return self;
}

- initFrame:(NXRect *)frameRect
{
	[super initFrame:frameRect];
	[self allocateGState];		// For faster lock/unlockFocus
	[self setClipping:NO];		// even faster...

	[self newSize];
	return self;
}

- sizeTo:(NXCoord)width :(NXCoord)height
{
	[super sizeTo:width :height];
	[self newSize];
	return self;
}

- drawSelf:(const NXRect *)rects :(int)rectCount
{
	if (!rects || !rectCount) return self;
	
	PSsetgray(0);
	//NXRectFill(rects);

	return self;
}

- newSize
{
	//this keeps the bezier size legal
	PSWbezierInit(bounds.size.width, bounds.size.height);
	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.