anchor.diff:    (mode :int)
     (detail :int))
   
  +(defcstruct x-generic-event-cookie
  +  (type :int)
  +  (serial :unsigned-long)
  +  (send-event :boolean)
  +  (display-ptr :pointer)
  +  (extension :int)
  +  (evtype :int)
  +  (cookie :unsigned-int)
  +  (data :pointer))
  +
   (defcunion x-event
     (type :int)
     (pad :long :count 24))
  
positive.code: (defcfun ("XOpenDisplay" %x-open-display) :pointer
    (display-name :string))
  
  (defcfun ("XCloseDisplay" x-close-display) :pointer
    (display-ptr :pointer))
  
  (defcfun ("XDefaultRootWindow" x-default-root-window) window
  
negative.code: (defcfun ("XProcessInternalConnection" process-internal-connection) :void
    (display :pointer)
    (fd :int))
  
  (defcfun ("XGetEventData" x-get-event-data) :boolean
    (display-ptr :pointer)
    (cookie (:pointer x-generic-event-cookie)))
  
  (defcfun ("XFreeEventData" x-free-event-data) :void
    (display-ptr :pointer)
    (cookie (:pointer x-generic-event-cookie)))
  
  
  (defcfun ("XQueryExtension" %x-query-extension) :boolean
    (display-ptr :pointer)
    (name :string)
    (major-opcode-return (:pointer :int))
    (first-event-return (:pointer :int))
    (first-error-return (:pointer :int)))
  (defun x-query-extension (display name)
    (with-foreign-objects ((opcode :int) (event :int) (error :int))
      (if (%x-query-extension display name opcode event error)
          (values t (mem-ref opcode :int) (mem-ref event :int) (mem-ref error :int))
          (values nil 0 0 0))))
  
  
  (defconstant +status-success+ 0)
  (defconstant +status-bad-request+ 1)
  (defconstant +status-bad-value+ 2)
  (defconstant +status-bad-window+ 3)
  ;; bad-pixmap bad-atom bad-cursor bad-font bad-match bad-drawable bad-access bad-alloc bad-color bad-gc bad-id-choice bad-name bad-length bad-implementation=17
  