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

Re: Monitor Locations



At  8:21 AM 8/17/93 +0000, Ranson wrote:
>You also need to test each device's attributes to make sure it is a screen
>and it is active.
>     Daniel.

Which, I forgot to say, is exactly what ccl::do-screens does by default:

(in-package :ccl)

(defmacro do-screens ((s &optional (active-only? t)) &body body)
  `(with-macptrs ((,s (require-trap #_GetDeviceList)))
     (loop
       (if (%null-ptr-p ,s) (return))
       (when ,(if active-only? `(screen-active-p ,s) t)
         ,@body)
       (%setf-macptr ,s (require-trap #_GetNextDevice ,s)))))

(defun screen-active-p (screen)
  (and (screen-attribute screen #$screenDevice)
       (screen-attribute screen #$screenActive)))

(defun screen-attribute (screen attribute)
  (#_TestDeviceAttribute screen attribute))