[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: screensaver question



On Fri Mar 25, Philip Jackson asks:
  I am wondering if there is some relatively
  easy way for my MCL application to programmatically blank out my entire
  screen while it's running, then restore my entire screen when it's done..?
I've written code that I've stored in /pub/MCL2/contrib in 
menu-enhancements.sit.hqx to support marking menus that does exactly
what you want. You can retrieve it by anonymous ftp from cambridge.apple.com.

The with-saved-screen macro (in the file oou-utils.lisp in the archive
file above.  Here's the documentation for the macro


(defmacro with-saved-screen-map ((view clip-rect1 &key (saved-picture (gensym))
                                       keep) &rest body)
  ;; Executes the body which may change a portion of the screen within the
  ;; the clip-rection clip-rect1 rectangular portion of the screen 
  ;; (expressed in global coordinates)
  ;; Within the body of the form, saved-picture is bound to the picture
  ;; corresponding to the clipped image of the bit map.
  ;; Upon normal or abnormal termination of the form, restores the screen image
  ;; and either deletes the saved-picture (default) or returns the 
saved-picture.
  ;; The value of the body is not returned.

There are other routines that are of interest are
(defun get-gport (view)
  ;; retrieves the underlying port-pixmap, and the two corners of
  ;; the port-rect for a view which possibly straddles screens

You could use the two to blank the screen containing the view, but you'd
also have to blank all of the other screens. (The do-screems macro 
might be useful, discussed in this list). Just fill the screen with 
black pixels.

mark