
/* Generated by Interface Builder */

#import <gamekit/GrayView2.h>
#import <dpsclient/psops.h>	// PSxxx functions
#import <dpsclient/wraps.h>	// PSxxx functions

@implementation GrayView2

- aroundFrame:(const NXRect *)aRect :(float)y;
{
	NXRect rects[4];
	
	[self lockFocus];
	PSsetgray(NX_LTGRAY);
	rects[0].size.width = aRect->origin.x ;//- 1;
	rects[1].size.width = bounds.size.width - aRect->origin.x - aRect->size.width ;//- 1;
	rects[2].size.width = aRect->size.width;
	rects[3].size.width = aRect->size.width;
	rects[0].size.height = bounds.size.height;
	rects[1].size.height = bounds.size.height;
	rects[2].size.height = bounds.size.height - aRect->origin.y - aRect->size.height - 1 + y;
	rects[3].size.height = aRect->origin.y - y - 1;
	rects[0].origin.x = 0;
	rects[1].origin.x = aRect->size.width + aRect->origin.x ;//+ 1;
	rects[2].origin.x = aRect->origin.x;
	rects[3].origin.x = aRect->origin.x;
	rects[0].origin.y = 0;
	rects[1].origin.y = 0;
	rects[2].origin.y = aRect->origin.y + aRect->size.height - y;
	rects[3].origin.y = 0;
	NXRectFillList(&rects[0], 4);
    [self unlockFocus];
	return self;
}

- drawSelf:(NXRect *)rects :(int)rectCount	// redraws the screen.
{		// right now, it's stupid and always redraws the whole view.

    if ([self window] == nil)
        return self;	// exit if no window to draw in
    
    [self lockFocus];
    PSsetgray(NX_LTGRAY);
    NXRectFill(&bounds);
    //[[self window] flushWindow];
    [self unlockFocus];
    return self;
}

@end
