This is BlackView.m in view mode; [Download] [Up]
#import "BlackView.h"
#import <math.h>
#import <libc.h>
#import <dpsclient/wraps.h>
@implementation BlackView
// This is a really simple View that makes the screen totally black
// BackSpace wasn't really designed for this, so oneStep still gets
// invoked. By sleeping, we insure that this doesn't suck too
// many cycles. Has to wake often enough to remain moderately
// responsive to events.
- oneStep
{
usleep(1000000 * 11/68 ); //sleep a while (yuck!)
// this time should be short enough that we wake to notice an
// event before the screen goes dim again
return self;
}
- drawSelf:(const NXRect *)rects :(int)rectCount
{
if (!rects || !rectCount) return self;
//Actually, I don't even need to fill in black if I have a black window...
PSsetgray(0);
//NXRectFill(rects);
return self;
}
- (BOOL)isBoringScreenSaver
{
return YES;
}
@end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.