anchor.diff:          (values t (mem-ref opcode :int) (mem-ref event :int) (mem-ref error :int))
           (values nil 0 0 0))))
   
  +(defcfun ("XGetWindowAttributes" %x-get-window-attributes) x-status
  +  (display :pointer)
  +  (window window)
  +  (window-attributes-return (:pointer (:struct x-window-attributes))))
  +
  +(defun x-get-window-attributes (display win)
  +  (with-foreign-object (attr '(:struct x-window-attributes))
  +    (%x-get-window-attributes display win attr)
  +    (mem-aref attr '(:struct x-window-attributes))))
  +
   
   (defconstant +status-success+ 0)
   (defconstant +status-bad-request+ 1)
  
positive.code:   (red :ushort) (green :ushort) (blue :ushort)
    (flags :char) (pad :char))
  
  (defcstruct visual-info
      (visual :pointer) (visual-id visualid) (screen :int)
      (depth :int) (class :int)
      (red-mask :ulong) (green-mask :ulong) (blue-mask :ulong)
      (colormap-size :int) (bpp :int))
  
  (defcstruct set-window-attributes
    (bg-pixmap pixmap) (bg-pixel :unsigned-long)
  
negative.code: 
  (defctype x-queued-mode :int)
  
  (defcstruct x-window-attributes
    ;; fixme: figure out better types for fields that are enums/bits
    (x :int)
    (y :int)
    (width :int)
    (height :int)
    (depth :int)
    (visual (:pointer (:struct visual)))
    (root window)
    (class :int)
    (bit-gravity :int)
    (win-gravity :int)
    (backing-store :int)
    (backing-planes :unsigned-long)
    (backing-pixel :unsigned-long)
    (save-under :boolean)
    (colormap colormap)
    (map-installed :boolean)
    (map-state :int)
    (all-event-masks :long)
    (your-event-mask :long)
    (override-redirect :boolean)
    (screen :pointer))
  
  ;; X11 bindings
  (define-foreign-library xlib
    (t (:default "libX11")))
  