home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / Utilities / Fiend-1.4.1-src / BlackView.m < prev    next >
Encoding:
Text File  |  1994-10-21  |  1.2 KB  |  47 lines

  1. //  BlackView.m
  2. //
  3. //  You may freely copy, distribute, and reuse the code in this example.
  4. //  NeXT disclaims any warranty of any kind, expressed or  implied, as to its
  5. //  fitness for any particular use.
  6.  
  7.  
  8. #import "BlackView.h"
  9. #import <math.h>
  10. #import <libc.h>
  11. #import <mach/mach.h>
  12. #import <dpsclient/wraps.h>
  13.  
  14. @implementation BlackView
  15.  
  16. // This is a really simple View that makes the screen totally black
  17. // BackSpace wasn't really designed for this, so oneStep still gets
  18. // invoked.  By sleeping, we insure that this doesn't suck too
  19. // many cycles.  Has to wake often enough to remain moderately
  20. // responsive to events.
  21.  
  22. - oneStep
  23. {
  24.     thread_switch(THREAD_NULL, SWITCH_OPTION_WAIT, 500); // better way to sleep
  25. //    usleep(1000000 * 1/2 );            //sleep a while (yuck!)
  26.     // this time should be short enough that BackSpace remains
  27.     // somewhat responsive if an event does occur.  Unfortunately,
  28.     // waking up keeps BackSpace hotter than I would prefer (ie paged in)
  29.  
  30.     return self;
  31. }
  32.  
  33. - drawSelf:(const NXRect *)rects :(int)rectCount
  34. {
  35.     //Actually, this method doesn't have to do anything at all since
  36.     // the view is placed in a black window...
  37.  
  38.     return self;
  39. }
  40.  
  41. - (BOOL)isBoringScreenSaver
  42. {
  43.     return YES;
  44. }
  45.  
  46. @end
  47.