[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: screensaver question
- To: info-mcl@cambridge.apple.com, pjackson@rcsuna.gmr.com (Philip Jackson )
- Subject: Re: screensaver question
- From: Michael Burks <mb1i+@andrew.cmu.edu>
- Date: Sat, 26 Mar 1994 02:33:32 -0500 (EST)
- Cc:
- In-reply-to: <9403251848.AA18876@rcsuna.gmr.com>
This total hack will only blank the main screen.
blank-screen blanks the screen and unblank-screen unblanks it.
Blaine.
--------------------------------------------------------------------
(require 'quickdraw)
;;; Blank the screen by drawing into the Window Manager Port with black.
(defun blank-screen ()
(rlet ((old-port :pointer)
(screen-port :pointer)
(old-back-color :pointer))
(#_GetPort old-port)
(#_GetCWMgrPort screen-port)
(#_SetPort (%get-ptr screen-port))
(#_GetBackColor old-back-color)
(#_RGBBackColor *black-rgb*)
(ccl::with-rectangle-arg (r 0 0 *screen-width* *screen-height*)
(#_ClipRect r)
(#_EraseRect r))
(#_RGBBackColor old-back-color)
(#_SetPort (%get-ptr old-port))))
;;; TOTAL HACK STARTS HERE.
;;; Keep a big black window around and fool the OS into redrawing
;;; the screen by momentarily obscuring everything.
;;;
(defvar *cover-window* (make-instance 'window
:window-show nil
:view-size (make-point *screen-width*
*screen-height*)
:view-position (make-point 0 0)))
(set-back-color *cover-window* *black-color*)
(defun unblank-screen ()
(window-select *cover-window*)
(window-hide *cover-window*)
(#_drawmenubar))