This is CrosshairView.m in view mode; [Download] [Up]
#import "CrosshairView.h" #import <dpsclient/psops.h> @implementation CrosshairView - drawSelf:(NXRect *)rects :(int)rectCount { float x0,y0,x1,y1,yScale; x0 = rects[0].origin.x; y0 = rects[0].origin.y; x1 = x0 + rects[0].size.width; y1 = y0 + rects[0].size.height; PSsetgray(NX_BLACK); PSsetlinewidth(0.0); yScale = bounds.size.height / bounds.size.width; PSscale(1,yScale); PSarc(bounds.size.width/2, bounds.size.height/yScale/2, bounds.size.width/2, 0,360); PSclip(); PSmoveto(0,0); PSlineto(bounds.size.width, bounds.size.height/yScale); PSmoveto(0, bounds.size.height/yScale); PSlineto(bounds.size.width, 0); PSmoveto(bounds.size.width/2,0); PSrlineto(0, bounds.size.height/yScale); PSmoveto(0, bounds.size.height/yScale/2); PSrlineto(bounds.size.width, 0); PSstroke(); return self; } @end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.