This is UserPath.h in view mode; [Download] [Up]
/* * UserPath.h by Bruce Blumberg, NeXT Computer, Inc. * * You may freely copy,distribute and re-use the code in this example. NeXT * disclaims any warranty of any kind, expressed or implied, as to its fitness * for any particular purpose * * This file and its associated .m file define a data structure and set of * functions aimed at facilitating the use of user paths. Here is a simple * example: * * UserPath *arect; * arect = newUserPath(); // creates an empty user path * beginUserPath(arect,YES); // initialize user path and cache * UPmoveto(arect,0.0,0.0); // add moveto to userpath; update bounding box * UPrlineto(arect,0.0,100.0); // add rlineto to path; update bounding box * UPrlineto(arect,100.0,0.0); // add rlineto to path; update bounding box * UPrlineto(arect,0.0,-100.0); // add rlineto to path; update bounding box * closePath(arect); // close path * endUserPath(arect,dps_stroke); // close user path and specify operator * sendUserPath(arect); * * As you will note, the set of routines manage the allocation and growth of * the operator and operand arrays, as well as the calculation of the bounding * box. A user path created via these functions may be optionally cached down * at the window server, or repeatedly sent down. The user paths created by * this set of functions are all allocated in a unique zone. * * Note: the associated file is a .m file because it pulls in some .h files * which reference objective C methods. */ #import <objc/Object.h> #import <objc/objc.h> #import <dpsclient/dpsclient.h> @interface UserPath : Object { float *points; int numberOfPoints; char *ops; NXPoint cp; int numberOfOps; int max; float bbox[4]; int opForUserPath; BOOL ping; } - init; - free; - debug:(BOOL)shouldPing; - grow; - begin:(BOOL)cache; - end:(int)op; - (int)send; - moveTo:(float)x :(float)y; - moveTo:(NXPoint *)p; - rmoveTo:(float)x :(float)y; - rmoveTo:(NXPoint *)p; - lineTo:(float)x :(float)y; - lineTo:(NXPoint *)p; - rlineTo:(float)x :(float)y; - rlineTo:(NXPoint *)p; - curveTo:(float)x1 :(float)y1 :(float)x2 :(float)y2 :(float)x3 :(float)y3; - rcurveTo:(float)x1 :(float)y1 :(float)x2 :(float)y2 :(float)x3 :(float)y3; - arc:(float)x :(float)y :(float)r :(float)ang1 :(float)ang2; - arcn:(float)x :(float)y :(float)r :(float)ang1 :(float)ang2; - arct:(float)x1 :(float)y1 :(float)x2 :(float)y2 :(float)r; - close; - addPts:(float)x :(float)y; - addPts:(NXPoint *)p; - addOp:(int)op; - addOp:(int)op point:(NXPoint *)p; - addOp:(int)op :(float)x :(float)y; - checkBBox:(float)x :(float)y; @end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.