emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/xelb 8197598 3/3: Fix XGE and XKB events support


From: Chris Feng
Subject: [elpa] externals/xelb 8197598 3/3: Fix XGE and XKB events support
Date: Sat, 6 Aug 2016 13:43:48 +0000 (UTC)

branch: externals/xelb
commit 8197598e5c6a3a26a488fbf7f85a40e5204f150f
Author: Chris Feng <address@hidden>
Commit: Chris Feng <address@hidden>

    Fix XGE and XKB events support
    
    * el_client.el (xelb-xge-alist nil): New variable for recording X
    generic events (XGE).
    (xelb-parse): Output XGE list.
    (xelb-parse-event, xelb-parse-eventcopy): Set XGE list.
    * xcb-types.el (xcb:marshal for xcb:-event): Rewritten to take XGE and
    XKB into consideration.
    (xcb:-generic-event): New type representing XGE.
    * xcb.el (xcb:-connection-filter, xcb:+event)
    (xcb:-error-or-event-class->number): Fix XGE and XKB events support.
    
    * el_client.el (xelb-parse-request): Insert slots for sequence number
    and reply length.
    (xelb-parse-event, xelb-parse-eventcopy): Insert slots for sequence
    number and event code.
    (xelb-parse-error, xelb-parse-errorcopy): Insert slot for error code.
    * xcb-types.el (xcb:-reply): Remove 'length' slot; add '~reply' slot.
    (xcb:-event): Add '~code' slot.
    (xcb:-error): Add '~error', '~code' and '~sequence' slots.
    * xcb.el (xcb:-+reply): Do not manipulate the length.
    (xcb:unmarshal for xcb:-reply, xcb:-event and xcb:-error): Removed.
    
    * el_client.el (xelb-node-type, xelb-parse-typedef)
    (xelb-parse-eventcopy, xelb-parse-errorcopy, xelb-parse-enumref):
    Prefer module-local names to global ones.
---
 el_client.el       |   83 ++++++++++-------
 xcb-bigreq.el      |    2 +
 xcb-composite.el   |    4 +
 xcb-damage.el      |    8 +-
 xcb-dpms.el        |    8 ++
 xcb-dri2.el        |   32 ++++++-
 xcb-dri3.el        |    8 ++
 xcb-ge.el          |    2 +
 xcb-glx.el         |  185 +++++++++++++++++++++++++++++++++-----
 xcb-present.el     |   41 ++++-----
 xcb-randr.el       |   66 ++++++++++++--
 xcb-record.el      |    9 +-
 xcb-render.el      |   18 ++--
 xcb-res.el         |   12 +++
 xcb-screensaver.el |    8 +-
 xcb-shape.el       |   14 ++-
 xcb-shm.el         |   12 ++-
 xcb-sync.el        |   26 +++++-
 xcb-types.el       |   80 ++++++++---------
 xcb-xc_misc.el     |    6 ++
 xcb-xevie.el       |   10 +++
 xcb-xf86dri.el     |   18 ++++
 xcb-xf86vidmode.el |   36 ++++++--
 xcb-xfixes.el      |   20 ++++-
 xcb-xinerama.el    |   12 +++
 xcb-xinput.el      |  245 +++++++++++++++++++++++++++++++-------------------
 xcb-xkb.el         |   79 +++++++++++++---
 xcb-xprint.el      |   36 +++++++-
 xcb-xproto.el      |  252 ++++++++++++++++++++++++++++++++++++++++------------
 xcb-xselinux.el    |   32 +++++++
 xcb-xtest.el       |    6 +-
 xcb-xv.el          |   34 +++++--
 xcb-xvmc.el        |   12 +++
 xcb.el             |  134 +++++++++++++++++++++-------
 34 files changed, 1192 insertions(+), 358 deletions(-)

diff --git a/el_client.el b/el_client.el
index cdeb82d..702cd0c 100644
--- a/el_client.el
+++ b/el_client.el
@@ -53,22 +53,18 @@
   "Excluded replies for Emacs < 25 (they're too long to load/compile).")
 
 (defvar xelb-prefix "xcb:" "Namespace of this module.")
-(make-variable-buffer-local 'xelb-prefix)
 
 (defvar xelb-error-alist nil "Record X errors in this module.")
-(make-variable-buffer-local 'xelb-error-alist)
 
 (defvar xelb-event-alist nil "Record X events in this module.")
-(make-variable-buffer-local 'xelb-event-alist)
+
+(defvar xelb-xge-alist nil "Record X generic events in this module.")
 
 (defvar xelb-imports nil "Record imported libraries.")
-(make-variable-buffer-local 'xelb-imports)
 
 (defvar xelb-pad-count -1 "<pad> node counter.")
-(make-variable-buffer-local 'xelb-pad-count)
 
 (defvar xelb-request-fields nil "Fields in the current request.")
-(make-variable-buffer-local 'xelb-request-fields)
 
 ;;;; Helper functions
 
@@ -92,8 +88,8 @@
                                                                  type-name))))
             type
           (error "Undefined type :%s" type-name))
-      (if (setq type (or (intern-soft (concat "xcb:" type-name))
-                         (intern-soft (concat xelb-prefix type-name))))
+      (if (setq type (or (intern-soft (concat xelb-prefix type-name))
+                         (intern-soft (concat "xcb:" type-name))))
           ;; Defined by the core protocol or this extension.
           type
         (catch 'break
@@ -274,6 +270,11 @@ an `xelb-auto-padding' attribute."
          `(defconst ,(intern (concat xelb-prefix "event-number-class-alist"))
             ',xelb-event-alist "(event-number . event-class) alist"))
         (princ "\n"))
+      (when xelb-xge-alist
+        (pp
+         `(defconst ,(intern (concat xelb-prefix "xge-number-class-alist"))
+            ',xelb-xge-alist "(xge-number . event-class) alist"))
+        (princ "\n"))
       ;; Print footer
       (princ (format "\
 
@@ -355,7 +356,8 @@ an `xelb-auto-padding' attribute."
 (defun xelb-parse-typedef (node)
   "Parse <typedef>."
   (let* ((oldname (xelb-node-attr node 'oldname))
-         (oldname (or (intern-soft (concat "xcb:" oldname))
+         (oldname (or (intern-soft (concat xelb-prefix oldname))
+                      (intern-soft (concat "xcb:" oldname))
                       (intern (concat xelb-prefix oldname))))
          (newname (intern (concat xelb-prefix
                                   (xelb-node-attr node 'newname)))))
@@ -415,6 +417,10 @@ The `combine-adjacent' attribute is simply ignored."
             ;; The optional reply body
             ,(when reply-name
                (delq nil reply-contents)
+               ;; Insert slots for sequence number and reply length.
+               (setcdr reply-contents (append '((~sequence :type xcb:CARD16)
+                                                (length :type xcb:CARD32))
+                                              (cdr reply-contents)))
                `(defclass ,reply-name (xcb:-reply) ,reply-contents))
             ,(when (memq reply-name xelb-excluded-replies<25)
                ;; Bring back the original defination of `defclass'.
@@ -423,25 +429,28 @@ The `combine-adjacent' attribute is simply ignored."
                     (fset 'defclass (symbol-function 'xcb:-defclass)))))))))
 
 (defun xelb-parse-event (node)
-  "Parse <event>.
-
-The `no-sequence-number' is ignored here since it's only used for
-KeymapNotify event; instead, we handle this case in `xcb:unmarshal'."
+  "Parse <event>."
   (let ((name (intern (concat xelb-prefix (xelb-node-attr node 'name))))
         (event-number (string-to-number (xelb-node-attr node 'number)))
+        (no-sequence-number (xelb-node-attr node 'no-sequence-number))
         (xge (xelb-node-attr node 'xge))
-        (contents (xelb-node-subnodes node t)))
+        (contents (xelb-node-subnodes node t))
+        xge-extension)
+    (setq xge-extension (and xge (not (eq name 'xcb:GeGeneric))))
     (setq contents
           (apply #'nconc (mapcar #'xelb-parse-structure-content contents)))
-    (when xge                           ;generic event
-      (setq contents
-            (append
-             '((extension :type xcb:CARD8)
-               (length :type xcb:CARD32)
-               (evtype :type xcb:CARD16))
-             contents)))
-    (setq xelb-event-alist (nconc xelb-event-alist `((,event-number . ,name))))
-    `((defclass ,name (xcb:-event) ,contents))))
+    (unless (or no-sequence-number xge)
+      (setcdr contents (append '((~sequence :type xcb:CARD16))
+                               (cdr contents))))
+    ;; Add the event code.
+    (unless (and xge (not xge-extension))
+      (push `(,(if xge '~evtype '~code) :initform ,event-number) contents))
+    (if xge-extension
+        (setq xelb-xge-alist
+              (nconc xelb-xge-alist `((,event-number . ,name))))
+      (setq xelb-event-alist
+            (nconc xelb-event-alist `((,event-number . ,name)))))
+    `((defclass ,name (,(if xge 'xcb:-generic-event 'xcb:-event)) ,contents))))
 
 (defun xelb-parse-error (node)
   "Parse <error>."
@@ -450,27 +459,40 @@ KeymapNotify event; instead, we handle this case in 
`xcb:unmarshal'."
         (contents (xelb-node-subnodes node t)))
     (setq xelb-error-alist (nconc xelb-error-alist `((,error-number . ,name))))
     `((defclass ,name (xcb:-error)
-        ,(apply #'nconc (mapcar #'xelb-parse-structure-content contents))))))
+        ,(append
+          ;; The error code.
+          `((~code :initform ,error-number))
+          ;; The contents.
+          (apply #'nconc (mapcar #'xelb-parse-structure-content contents)))))))
 
 (defun xelb-parse-eventcopy (node)
   "Parse <eventcopy>."
   (let* ((name (intern (concat xelb-prefix (xelb-node-attr node 'name))))
          (refname (xelb-node-attr node 'ref))
-         (refname (or (intern-soft (concat "xcb:" refname))
+         (refname (or (intern-soft (concat xelb-prefix refname))
+                      (intern-soft (concat "xcb:" refname))
                       (intern (concat xelb-prefix refname))))
+         (xge (child-of-class-p refname 'xcb:-generic-event))
          (event-number (string-to-number (xelb-node-attr node 'number))))
-    (setq xelb-event-alist (nconc xelb-event-alist `((,event-number . ,name))))
-    `((defclass ,name (xcb:-event ,refname) nil)))) ;shadow the method of ref
+    (if xge
+        (setq xelb-xge-alist
+              (nconc xelb-xge-alist `((,event-number . ,name))))
+      (setq xelb-event-alist
+            (nconc xelb-event-alist `((,event-number . ,name)))))
+    `((defclass ,name (xcb:-event ,refname) ;Shadow the method of ref.
+        ((,(if xge '~evtype '~code) :initform ,event-number))))))
 
 (defun xelb-parse-errorcopy (node)
   "Parse <errorcopy>."
   (let* ((name (intern (concat xelb-prefix (xelb-node-attr node 'name))))
          (refname (xelb-node-attr node 'ref))
-         (refname (or (intern-soft (concat "xcb:" refname))
+         (refname (or (intern-soft (concat xelb-prefix refname))
+                      (intern-soft (concat "xcb:" refname))
                       (intern (concat xelb-prefix refname))))
          (error-number (string-to-number (xelb-node-attr node 'number))))
     (setq xelb-error-alist (nconc xelb-error-alist `((,error-number . ,name))))
-    `((defclass ,name (xcb:-error ,refname) nil)))) ;shadow the method of ref
+    `((defclass ,name (xcb:-error ,refname) ;Shadow the method of ref
+        ((~code :initform ,error-number))))))
 
 ;;;; XCB: structure contents
 
@@ -659,7 +681,8 @@ KeymapNotify event; instead, we handle this case in 
`xcb:unmarshal'."
   "Parse <enumref>."
   (let ((name (concat (xelb-node-attr node 'ref) ":"
                       (xelb-node-subnode node))))
-    (symbol-value (or (intern-soft (concat "xcb:" name))
+    (symbol-value (or (intern-soft (concat xelb-prefix name))
+                      (intern-soft (concat "xcb:" name))
                       (intern (concat xelb-prefix name))))))
 
 (defun xelb-parse-unop (node)
diff --git a/xcb-bigreq.el b/xcb-bigreq.el
index 2ad0fe0..5cf6215 100644
--- a/xcb-bigreq.el
+++ b/xcb-bigreq.el
@@ -37,6 +37,8 @@
 (defclass xcb:bigreq:Enable~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (maximum-request-length :initarg :maximum-request-length :type xcb:CARD32)))
 
 
diff --git a/xcb-composite.el b/xcb-composite.el
index e0eabc6..10a4772 100644
--- a/xcb-composite.el
+++ b/xcb-composite.el
@@ -46,6 +46,8 @@
 (defclass xcb:composite:QueryVersion~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (major-version :initarg :major-version :type xcb:CARD32)
    (minor-version :initarg :minor-version :type xcb:CARD32)
    (pad~1 :initform 16 :type xcb:-pad)))
@@ -97,6 +99,8 @@
 (defclass xcb:composite:GetOverlayWindow~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (overlay-win :initarg :overlay-win :type xcb:WINDOW)
    (pad~1 :initform 20 :type xcb:-pad)))
 
diff --git a/xcb-damage.el b/xcb-damage.el
index 085178d..563b6ae 100644
--- a/xcb-damage.el
+++ b/xcb-damage.el
@@ -44,7 +44,7 @@
 
 (defclass xcb:damage:BadDamage
   (xcb:-error)
-  nil)
+  ((~code :initform 0)))
 
 (defclass xcb:damage:QueryVersion
   (xcb:-request)
@@ -54,6 +54,8 @@
 (defclass xcb:damage:QueryVersion~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (major-version :initarg :major-version :type xcb:CARD32)
    (minor-version :initarg :minor-version :type xcb:CARD32)
    (pad~1 :initform 16 :type xcb:-pad)))
@@ -86,7 +88,9 @@
 
 (defclass xcb:damage:Notify
   (xcb:-event)
-  ((level :initarg :level :type xcb:CARD8)
+  ((~code :initform 0)
+   (level :initarg :level :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
    (drawable :initarg :drawable :type xcb:DRAWABLE)
    (damage :initarg :damage :type xcb:damage:DAMAGE)
    (timestamp :initarg :timestamp :type xcb:TIMESTAMP)
diff --git a/xcb-dpms.el b/xcb-dpms.el
index a2050d4..406b6fe 100644
--- a/xcb-dpms.el
+++ b/xcb-dpms.el
@@ -39,6 +39,8 @@
 (defclass xcb:dpms:GetVersion~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (server-major-version :initarg :server-major-version :type xcb:CARD16)
    (server-minor-version :initarg :server-minor-version :type xcb:CARD16)))
 
@@ -48,6 +50,8 @@
 (defclass xcb:dpms:Capable~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (capable :initarg :capable :type xcb:BOOL)
    (pad~1 :initform 23 :type xcb:-pad)))
 
@@ -57,6 +61,8 @@
 (defclass xcb:dpms:GetTimeouts~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (standby-timeout :initarg :standby-timeout :type xcb:CARD16)
    (suspend-timeout :initarg :suspend-timeout :type xcb:CARD16)
    (off-timeout :initarg :off-timeout :type xcb:CARD16)
@@ -93,6 +99,8 @@
 (defclass xcb:dpms:Info~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (power-level :initarg :power-level :type xcb:CARD16)
    (state :initarg :state :type xcb:BOOL)
    (pad~1 :initform 21 :type xcb:-pad)))
diff --git a/xcb-dri2.el b/xcb-dri2.el
index b967349..20671a3 100644
--- a/xcb-dri2.el
+++ b/xcb-dri2.el
@@ -73,6 +73,8 @@
 (defclass xcb:dri2:QueryVersion~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (major-version :initarg :major-version :type xcb:CARD32)
    (minor-version :initarg :minor-version :type xcb:CARD32)))
 
@@ -84,6 +86,8 @@
 (defclass xcb:dri2:Connect~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (driver-name-length :initarg :driver-name-length :type xcb:CARD32)
    (device-name-length :initarg :device-name-length :type xcb:CARD32)
    (pad~1 :initform 16 :type xcb:-pad)
@@ -119,6 +123,8 @@
 (defclass xcb:dri2:Authenticate~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (authenticated :initarg :authenticated :type xcb:CARD32)))
 
 (defclass xcb:dri2:CreateDrawable
@@ -143,6 +149,8 @@
 (defclass xcb:dri2:GetBuffers~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (width :initarg :width :type xcb:CARD32)
    (height :initarg :height :type xcb:CARD32)
    (count :initarg :count :type xcb:CARD32)
@@ -162,7 +170,9 @@
    (src :initarg :src :type xcb:CARD32)))
 (defclass xcb:dri2:CopyRegion~reply
   (xcb:-reply)
-  ((pad~0 :initform 1 :type xcb:-pad)))
+  ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)))
 
 (defclass xcb:dri2:GetBuffersWithFormat
   (xcb:-request)
@@ -176,6 +186,8 @@
 (defclass xcb:dri2:GetBuffersWithFormat~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (width :initarg :width :type xcb:CARD32)
    (height :initarg :height :type xcb:CARD32)
    (count :initarg :count :type xcb:CARD32)
@@ -199,6 +211,8 @@
 (defclass xcb:dri2:SwapBuffers~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (swap-hi :initarg :swap-hi :type xcb:CARD32)
    (swap-lo :initarg :swap-lo :type xcb:CARD32)))
 
@@ -209,6 +223,8 @@
 (defclass xcb:dri2:GetMSC~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (ust-hi :initarg :ust-hi :type xcb:CARD32)
    (ust-lo :initarg :ust-lo :type xcb:CARD32)
    (msc-hi :initarg :msc-hi :type xcb:CARD32)
@@ -229,6 +245,8 @@
 (defclass xcb:dri2:WaitMSC~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (ust-hi :initarg :ust-hi :type xcb:CARD32)
    (ust-lo :initarg :ust-lo :type xcb:CARD32)
    (msc-hi :initarg :msc-hi :type xcb:CARD32)
@@ -245,6 +263,8 @@
 (defclass xcb:dri2:WaitSBC~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (ust-hi :initarg :ust-hi :type xcb:CARD32)
    (ust-lo :initarg :ust-lo :type xcb:CARD32)
    (msc-hi :initarg :msc-hi :type xcb:CARD32)
@@ -266,12 +286,16 @@
 (defclass xcb:dri2:GetParam~reply
   (xcb:-reply)
   ((is-param-recognized :initarg :is-param-recognized :type xcb:BOOL)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (value-hi :initarg :value-hi :type xcb:CARD32)
    (value-lo :initarg :value-lo :type xcb:CARD32)))
 
 (defclass xcb:dri2:BufferSwapComplete
   (xcb:-event)
-  ((pad~0 :initform 1 :type xcb:-pad)
+  ((~code :initform 0)
+   (pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
    (event-type :initarg :event-type :type xcb:CARD16)
    (pad~1 :initform 2 :type xcb:-pad)
    (drawable :initarg :drawable :type xcb:DRAWABLE)
@@ -283,7 +307,9 @@
 
 (defclass xcb:dri2:InvalidateBuffers
   (xcb:-event)
-  ((pad~0 :initform 1 :type xcb:-pad)
+  ((~code :initform 1)
+   (pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
    (drawable :initarg :drawable :type xcb:DRAWABLE)))
 
 (defconst xcb:dri2:event-number-class-alist
diff --git a/xcb-dri3.el b/xcb-dri3.el
index f3c5690..b9bd790 100644
--- a/xcb-dri3.el
+++ b/xcb-dri3.el
@@ -41,6 +41,8 @@
 (defclass xcb:dri3:QueryVersion~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (major-version :initarg :major-version :type xcb:CARD32)
    (minor-version :initarg :minor-version :type xcb:CARD32)))
 
@@ -52,6 +54,8 @@
 (defclass xcb:dri3:Open~reply
   (xcb:-reply)
   ((nfd :initarg :nfd :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (device-fd :type xcb:-fd)
    (pad~0 :initform 24 :type xcb:-pad)))
 
@@ -75,6 +79,8 @@
 (defclass xcb:dri3:BufferFromPixmap~reply
   (xcb:-reply)
   ((nfd :initarg :nfd :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (size :initarg :size :type xcb:CARD32)
    (width :initarg :width :type xcb:CARD16)
    (height :initarg :height :type xcb:CARD16)
@@ -101,6 +107,8 @@
 (defclass xcb:dri3:FDFromFence~reply
   (xcb:-reply)
   ((nfd :initarg :nfd :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (fence-fd :type xcb:-fd)
    (pad~0 :initform 24 :type xcb:-pad)))
 
diff --git a/xcb-ge.el b/xcb-ge.el
index 27b4389..7df8f13 100644
--- a/xcb-ge.el
+++ b/xcb-ge.el
@@ -39,6 +39,8 @@
 (defclass xcb:ge:QueryVersion~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (major-version :initarg :major-version :type xcb:CARD16)
    (minor-version :initarg :minor-version :type xcb:CARD16)
    (pad~1 :initform 20 :type xcb:-pad)))
diff --git a/xcb-glx.el b/xcb-glx.el
index 524441c..4e0a3ed 100644
--- a/xcb-glx.el
+++ b/xcb-glx.el
@@ -55,70 +55,73 @@
 
 (defclass xcb:glx:Generic
   (xcb:-error)
-  ((bad-value :initarg :bad-value :type xcb:CARD32)
+  ((~code :initform -1)
+   (bad-value :initarg :bad-value :type xcb:CARD32)
    (minor-opcode :initarg :minor-opcode :type xcb:CARD16)
    (major-opcode :initarg :major-opcode :type xcb:CARD8)
    (pad~0 :initform 21 :type xcb:-pad)))
 
 (defclass xcb:glx:BadContext
   (xcb:-error xcb:glx:Generic)
-  nil)
+  ((~code :initform 0)))
 
 (defclass xcb:glx:BadContextState
   (xcb:-error xcb:glx:Generic)
-  nil)
+  ((~code :initform 1)))
 
 (defclass xcb:glx:BadDrawable
   (xcb:-error xcb:glx:Generic)
-  nil)
+  ((~code :initform 2)))
 
 (defclass xcb:glx:BadPixmap
   (xcb:-error xcb:glx:Generic)
-  nil)
+  ((~code :initform 3)))
 
 (defclass xcb:glx:BadContextTag
   (xcb:-error xcb:glx:Generic)
-  nil)
+  ((~code :initform 4)))
 
 (defclass xcb:glx:BadCurrentWindow
   (xcb:-error xcb:glx:Generic)
-  nil)
+  ((~code :initform 5)))
 
 (defclass xcb:glx:BadRenderRequest
   (xcb:-error xcb:glx:Generic)
-  nil)
+  ((~code :initform 6)))
 
 (defclass xcb:glx:BadLargeRequest
   (xcb:-error xcb:glx:Generic)
-  nil)
+  ((~code :initform 7)))
 
 (defclass xcb:glx:UnsupportedPrivateRequest
   (xcb:-error xcb:glx:Generic)
-  nil)
+  ((~code :initform 8)))
 
 (defclass xcb:glx:BadFBConfig
   (xcb:-error xcb:glx:Generic)
-  nil)
+  ((~code :initform 9)))
 
 (defclass xcb:glx:BadPbuffer
   (xcb:-error xcb:glx:Generic)
-  nil)
+  ((~code :initform 10)))
 
 (defclass xcb:glx:BadCurrentDrawable
   (xcb:-error xcb:glx:Generic)
-  nil)
+  ((~code :initform 11)))
 
 (defclass xcb:glx:BadWindow
   (xcb:-error xcb:glx:Generic)
-  nil)
+  ((~code :initform 12)))
 
 (defclass xcb:glx:GLXBadProfileARB
   (xcb:-error xcb:glx:Generic)
-  nil)
+  ((~code :initform 13)))
 
 (defclass xcb:glx:PbufferClobber
   (xcb:-event)
-  ((pad~0 :initform 1 :type xcb:-pad)
+  ((~code :initform 0)
+   (pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
    (event-type :initarg :event-type :type xcb:CARD16)
    (draw-type :initarg :draw-type :type xcb:CARD16)
    (drawable :initarg :drawable :type xcb:glx:DRAWABLE)
@@ -133,7 +136,9 @@
 
 (defclass xcb:glx:BufferSwapComplete
   (xcb:-event)
-  ((pad~0 :initform 1 :type xcb:-pad)
+  ((~code :initform 1)
+   (pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
    (event-type :initarg :event-type :type xcb:CARD16)
    (pad~1 :initform 2 :type xcb:-pad)
    (drawable :initarg :drawable :type xcb:glx:DRAWABLE)
@@ -195,6 +200,8 @@
 (defclass xcb:glx:MakeCurrent~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (context-tag :initarg :context-tag :type xcb:glx:CONTEXT_TAG)
    (pad~1 :initform 20 :type xcb:-pad)))
 
@@ -205,6 +212,8 @@
 (defclass xcb:glx:IsDirect~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (is-direct :initarg :is-direct :type xcb:BOOL)
    (pad~1 :initform 23 :type xcb:-pad)))
 
@@ -216,6 +225,8 @@
 (defclass xcb:glx:QueryVersion~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (major-version :initarg :major-version :type xcb:CARD32)
    (minor-version :initarg :minor-version :type xcb:CARD32)
    (pad~1 :initform 16 :type xcb:-pad)))
@@ -290,6 +301,8 @@
 (defclass xcb:glx:GetVisualConfigs~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (num-visuals :initarg :num-visuals :type xcb:CARD32)
    (num-properties :initarg :num-properties :type xcb:CARD32)
    (pad~1 :initform 16 :type xcb:-pad)
@@ -326,6 +339,8 @@
 (defclass xcb:glx:VendorPrivateWithReply~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (retval :initarg :retval :type xcb:CARD32)
    (data1 :initarg :data1 :type xcb:-ignore)
    (data1~ :initform
@@ -346,6 +361,8 @@
 (defclass xcb:glx:QueryExtensionsString~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 4 :type xcb:-pad)
    (n :initarg :n :type xcb:CARD32)
    (pad~2 :initform 16 :type xcb:-pad)))
@@ -358,6 +375,8 @@
 (defclass xcb:glx:QueryServerString~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 4 :type xcb:-pad)
    (str-len :initarg :str-len :type xcb:CARD32)
    (pad~2 :initform 16 :type xcb:-pad)
@@ -386,6 +405,8 @@
 (defclass xcb:glx:GetFBConfigs~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (num-FB-configs :initarg :num-FB-configs :type xcb:CARD32)
    (num-properties :initarg :num-properties :type xcb:CARD32)
    (pad~1 :initform 16 :type xcb:-pad)
@@ -434,6 +455,8 @@
 (defclass xcb:glx:QueryContext~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (num-attribs :initarg :num-attribs :type xcb:CARD32)
    (pad~1 :initform 20 :type xcb:-pad)
    (attribs :initarg :attribs :type xcb:-ignore)
@@ -454,6 +477,8 @@
 (defclass xcb:glx:MakeContextCurrent~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (context-tag :initarg :context-tag :type xcb:glx:CONTEXT_TAG)
    (pad~1 :initform 20 :type xcb:-pad)))
 
@@ -484,6 +509,8 @@
 (defclass xcb:glx:GetDrawableAttributes~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (num-attribs :initarg :num-attribs :type xcb:CARD32)
    (pad~1 :initform 20 :type xcb:-pad)
    (attribs :initarg :attribs :type xcb:-ignore)
@@ -629,6 +656,8 @@
 (defclass xcb:glx:GenLists~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (ret-val :initarg :ret-val :type xcb:CARD32)))
 
 (defclass xcb:glx:FeedbackBuffer
@@ -652,6 +681,8 @@
 (defclass xcb:glx:RenderMode~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (ret-val :initarg :ret-val :type xcb:CARD32)
    (n :initarg :n :type xcb:CARD32)
    (new-mode :initarg :new-mode :type xcb:CARD32)
@@ -672,7 +703,9 @@
    (context-tag :initarg :context-tag :type xcb:glx:CONTEXT_TAG)))
 (defclass xcb:glx:Finish~reply
   (xcb:-reply)
-  ((pad~0 :initform 1 :type xcb:-pad)))
+  ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)))
 
 (defclass xcb:glx:PixelStoref
   (xcb:-request)
@@ -703,6 +736,8 @@
 (defclass xcb:glx:ReadPixels~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 24 :type xcb:-pad)
    (data :initarg :data :type xcb:-ignore)
    (data~ :initform
@@ -720,6 +755,8 @@
 (defclass xcb:glx:GetBooleanv~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 4 :type xcb:-pad)
    (n :initarg :n :type xcb:CARD32)
    (datum :initarg :datum :type xcb:BOOL)
@@ -738,6 +775,8 @@
 (defclass xcb:glx:GetClipPlane~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 24 :type xcb:-pad)
    (data :initarg :data :type xcb:-ignore)
    (data~ :initform
@@ -755,6 +794,8 @@
 (defclass xcb:glx:GetDoublev~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 4 :type xcb:-pad)
    (n :initarg :n :type xcb:CARD32)
    (datum :initarg :datum :type xcb:glx:FLOAT64)
@@ -772,6 +813,8 @@
 (defclass xcb:glx:GetError~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (error :initarg :error :type xcb:INT32)))
 
 (defclass xcb:glx:GetFloatv
@@ -782,6 +825,8 @@
 (defclass xcb:glx:GetFloatv~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 4 :type xcb:-pad)
    (n :initarg :n :type xcb:CARD32)
    (datum :initarg :datum :type xcb:glx:FLOAT32)
@@ -800,6 +845,8 @@
 (defclass xcb:glx:GetIntegerv~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 4 :type xcb:-pad)
    (n :initarg :n :type xcb:CARD32)
    (datum :initarg :datum :type xcb:INT32)
@@ -819,6 +866,8 @@
 (defclass xcb:glx:GetLightfv~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 4 :type xcb:-pad)
    (n :initarg :n :type xcb:CARD32)
    (datum :initarg :datum :type xcb:glx:FLOAT32)
@@ -838,6 +887,8 @@
 (defclass xcb:glx:GetLightiv~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 4 :type xcb:-pad)
    (n :initarg :n :type xcb:CARD32)
    (datum :initarg :datum :type xcb:INT32)
@@ -857,6 +908,8 @@
 (defclass xcb:glx:GetMapdv~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 4 :type xcb:-pad)
    (n :initarg :n :type xcb:CARD32)
    (datum :initarg :datum :type xcb:glx:FLOAT64)
@@ -876,6 +929,8 @@
 (defclass xcb:glx:GetMapfv~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 4 :type xcb:-pad)
    (n :initarg :n :type xcb:CARD32)
    (datum :initarg :datum :type xcb:glx:FLOAT32)
@@ -895,6 +950,8 @@
 (defclass xcb:glx:GetMapiv~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 4 :type xcb:-pad)
    (n :initarg :n :type xcb:CARD32)
    (datum :initarg :datum :type xcb:INT32)
@@ -914,6 +971,8 @@
 (defclass xcb:glx:GetMaterialfv~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 4 :type xcb:-pad)
    (n :initarg :n :type xcb:CARD32)
    (datum :initarg :datum :type xcb:glx:FLOAT32)
@@ -933,6 +992,8 @@
 (defclass xcb:glx:GetMaterialiv~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 4 :type xcb:-pad)
    (n :initarg :n :type xcb:CARD32)
    (datum :initarg :datum :type xcb:INT32)
@@ -951,6 +1012,8 @@
 (defclass xcb:glx:GetPixelMapfv~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 4 :type xcb:-pad)
    (n :initarg :n :type xcb:CARD32)
    (datum :initarg :datum :type xcb:glx:FLOAT32)
@@ -969,6 +1032,8 @@
 (defclass xcb:glx:GetPixelMapuiv~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 4 :type xcb:-pad)
    (n :initarg :n :type xcb:CARD32)
    (datum :initarg :datum :type xcb:CARD32)
@@ -987,6 +1052,8 @@
 (defclass xcb:glx:GetPixelMapusv~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 4 :type xcb:-pad)
    (n :initarg :n :type xcb:CARD32)
    (datum :initarg :datum :type xcb:CARD16)
@@ -1005,6 +1072,8 @@
 (defclass xcb:glx:GetPolygonStipple~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 24 :type xcb:-pad)
    (data :initarg :data :type xcb:-ignore)
    (data~ :initform
@@ -1022,6 +1091,8 @@
 (defclass xcb:glx:GetString~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 4 :type xcb:-pad)
    (n :initarg :n :type xcb:CARD32)
    (pad~2 :initform 16 :type xcb:-pad)
@@ -1040,6 +1111,8 @@
 (defclass xcb:glx:GetTexEnvfv~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 4 :type xcb:-pad)
    (n :initarg :n :type xcb:CARD32)
    (datum :initarg :datum :type xcb:glx:FLOAT32)
@@ -1059,6 +1132,8 @@
 (defclass xcb:glx:GetTexEnviv~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 4 :type xcb:-pad)
    (n :initarg :n :type xcb:CARD32)
    (datum :initarg :datum :type xcb:INT32)
@@ -1078,6 +1153,8 @@
 (defclass xcb:glx:GetTexGendv~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 4 :type xcb:-pad)
    (n :initarg :n :type xcb:CARD32)
    (datum :initarg :datum :type xcb:glx:FLOAT64)
@@ -1097,6 +1174,8 @@
 (defclass xcb:glx:GetTexGenfv~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 4 :type xcb:-pad)
    (n :initarg :n :type xcb:CARD32)
    (datum :initarg :datum :type xcb:glx:FLOAT32)
@@ -1116,6 +1195,8 @@
 (defclass xcb:glx:GetTexGeniv~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 4 :type xcb:-pad)
    (n :initarg :n :type xcb:CARD32)
    (datum :initarg :datum :type xcb:INT32)
@@ -1138,6 +1219,8 @@
 (defclass xcb:glx:GetTexImage~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 8 :type xcb:-pad)
    (width :initarg :width :type xcb:INT32)
    (height :initarg :height :type xcb:INT32)
@@ -1160,6 +1243,8 @@
 (defclass xcb:glx:GetTexParameterfv~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 4 :type xcb:-pad)
    (n :initarg :n :type xcb:CARD32)
    (datum :initarg :datum :type xcb:glx:FLOAT32)
@@ -1179,6 +1264,8 @@
 (defclass xcb:glx:GetTexParameteriv~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 4 :type xcb:-pad)
    (n :initarg :n :type xcb:CARD32)
    (datum :initarg :datum :type xcb:INT32)
@@ -1199,6 +1286,8 @@
 (defclass xcb:glx:GetTexLevelParameterfv~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 4 :type xcb:-pad)
    (n :initarg :n :type xcb:CARD32)
    (datum :initarg :datum :type xcb:glx:FLOAT32)
@@ -1219,6 +1308,8 @@
 (defclass xcb:glx:GetTexLevelParameteriv~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 4 :type xcb:-pad)
    (n :initarg :n :type xcb:CARD32)
    (datum :initarg :datum :type xcb:INT32)
@@ -1237,7 +1328,9 @@
 (defclass xcb:glx:IsEnabled~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
-   (ret-val :initarg :ret-val :type xcb:BOOL32)))
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
+   (ret-val :initarg :ret-val :type xcb:glx:BOOL32)))
 
 (defclass xcb:glx:IsList
   (xcb:-request)
@@ -1247,7 +1340,9 @@
 (defclass xcb:glx:IsList~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
-   (ret-val :initarg :ret-val :type xcb:BOOL32)))
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
+   (ret-val :initarg :ret-val :type xcb:glx:BOOL32)))
 
 (defclass xcb:glx:Flush
   (xcb:-request)
@@ -1267,7 +1362,9 @@
 (defclass xcb:glx:AreTexturesResident~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
-   (ret-val :initarg :ret-val :type xcb:BOOL32)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
+   (ret-val :initarg :ret-val :type xcb:glx:BOOL32)
    (pad~1 :initform 20 :type xcb:-pad)
    (data :initarg :data :type xcb:-ignore)
    (data~ :initform
@@ -1296,6 +1393,8 @@
 (defclass xcb:glx:GenTextures~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 24 :type xcb:-pad)
    (data :initarg :data :type xcb:-ignore)
    (data~ :initform
@@ -1311,7 +1410,9 @@
 (defclass xcb:glx:IsTexture~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
-   (ret-val :initarg :ret-val :type xcb:BOOL32)))
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
+   (ret-val :initarg :ret-val :type xcb:glx:BOOL32)))
 
 (defclass xcb:glx:GetColorTable
   (xcb:-request)
@@ -1324,6 +1425,8 @@
 (defclass xcb:glx:GetColorTable~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 8 :type xcb:-pad)
    (width :initarg :width :type xcb:INT32)
    (pad~2 :initform 12 :type xcb:-pad)
@@ -1344,6 +1447,8 @@
 (defclass xcb:glx:GetColorTableParameterfv~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 4 :type xcb:-pad)
    (n :initarg :n :type xcb:CARD32)
    (datum :initarg :datum :type xcb:glx:FLOAT32)
@@ -1363,6 +1468,8 @@
 (defclass xcb:glx:GetColorTableParameteriv~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 4 :type xcb:-pad)
    (n :initarg :n :type xcb:CARD32)
    (datum :initarg :datum :type xcb:INT32)
@@ -1384,6 +1491,8 @@
 (defclass xcb:glx:GetConvolutionFilter~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 8 :type xcb:-pad)
    (width :initarg :width :type xcb:INT32)
    (height :initarg :height :type xcb:INT32)
@@ -1405,6 +1514,8 @@
 (defclass xcb:glx:GetConvolutionParameterfv~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 4 :type xcb:-pad)
    (n :initarg :n :type xcb:CARD32)
    (datum :initarg :datum :type xcb:glx:FLOAT32)
@@ -1424,6 +1535,8 @@
 (defclass xcb:glx:GetConvolutionParameteriv~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 4 :type xcb:-pad)
    (n :initarg :n :type xcb:CARD32)
    (datum :initarg :datum :type xcb:INT32)
@@ -1445,6 +1558,8 @@
 (defclass xcb:glx:GetSeparableFilter~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 8 :type xcb:-pad)
    (row-w :initarg :row-w :type xcb:INT32)
    (col-h :initarg :col-h :type xcb:INT32)
@@ -1469,6 +1584,8 @@
 (defclass xcb:glx:GetHistogram~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 8 :type xcb:-pad)
    (width :initarg :width :type xcb:INT32)
    (pad~2 :initform 12 :type xcb:-pad)
@@ -1489,6 +1606,8 @@
 (defclass xcb:glx:GetHistogramParameterfv~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 4 :type xcb:-pad)
    (n :initarg :n :type xcb:CARD32)
    (datum :initarg :datum :type xcb:glx:FLOAT32)
@@ -1508,6 +1627,8 @@
 (defclass xcb:glx:GetHistogramParameteriv~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 4 :type xcb:-pad)
    (n :initarg :n :type xcb:CARD32)
    (datum :initarg :datum :type xcb:INT32)
@@ -1530,6 +1651,8 @@
 (defclass xcb:glx:GetMinmax~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 24 :type xcb:-pad)
    (data :initarg :data :type xcb:-ignore)
    (data~ :initform
@@ -1548,6 +1671,8 @@
 (defclass xcb:glx:GetMinmaxParameterfv~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 4 :type xcb:-pad)
    (n :initarg :n :type xcb:CARD32)
    (datum :initarg :datum :type xcb:glx:FLOAT32)
@@ -1567,6 +1692,8 @@
 (defclass xcb:glx:GetMinmaxParameteriv~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 4 :type xcb:-pad)
    (n :initarg :n :type xcb:CARD32)
    (datum :initarg :datum :type xcb:INT32)
@@ -1586,6 +1713,8 @@
 (defclass xcb:glx:GetCompressedTexImageARB~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 8 :type xcb:-pad)
    (size :initarg :size :type xcb:INT32)
    (pad~2 :initform 12 :type xcb:-pad)
@@ -1616,6 +1745,8 @@
 (defclass xcb:glx:GenQueriesARB~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 24 :type xcb:-pad)
    (data :initarg :data :type xcb:-ignore)
    (data~ :initform
@@ -1631,7 +1762,9 @@
 (defclass xcb:glx:IsQueryARB~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
-   (ret-val :initarg :ret-val :type xcb:BOOL32)))
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
+   (ret-val :initarg :ret-val :type xcb:glx:BOOL32)))
 
 (defclass xcb:glx:GetQueryivARB
   (xcb:-request)
@@ -1642,6 +1775,8 @@
 (defclass xcb:glx:GetQueryivARB~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 4 :type xcb:-pad)
    (n :initarg :n :type xcb:CARD32)
    (datum :initarg :datum :type xcb:INT32)
@@ -1661,6 +1796,8 @@
 (defclass xcb:glx:GetQueryObjectivARB~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 4 :type xcb:-pad)
    (n :initarg :n :type xcb:CARD32)
    (datum :initarg :datum :type xcb:INT32)
@@ -1680,6 +1817,8 @@
 (defclass xcb:glx:GetQueryObjectuivARB~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 4 :type xcb:-pad)
    (n :initarg :n :type xcb:CARD32)
    (datum :initarg :datum :type xcb:CARD32)
diff --git a/xcb-present.el b/xcb-present.el
index 056be3c..c5c06c7 100644
--- a/xcb-present.el
+++ b/xcb-present.el
@@ -80,6 +80,8 @@
 (defclass xcb:present:QueryVersion~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (major-version :initarg :major-version :type xcb:CARD32)
    (minor-version :initarg :minor-version :type xcb:CARD32)))
 
@@ -132,21 +134,23 @@
 (defclass xcb:present:QueryCapabilities~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (capabilities :initarg :capabilities :type xcb:CARD32)))
 
 (defclass xcb:present:Generic
   (xcb:-event)
-  ((extension :initarg :extension :type xcb:CARD8)
+  ((~code :initform 0)
+   (extension :initarg :extension :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
    (length :initarg :length :type xcb:CARD32)
    (evtype :initarg :evtype :type xcb:CARD16)
    (pad~0 :initform 2 :type xcb:-pad)
    (event :initarg :event :type xcb:present:EVENT)))
 
 (defclass xcb:present:ConfigureNotify
-  (xcb:-event)
-  ((extension :type xcb:CARD8)
-   (length :type xcb:CARD32)
-   (evtype :type xcb:CARD16)
+  (xcb:-generic-event)
+  ((~evtype :initform 0)
    (pad~0 :initform 2 :type xcb:-pad)
    (event :initarg :event :type xcb:present:EVENT)
    (window :initarg :window :type xcb:WINDOW)
@@ -161,10 +165,8 @@
    (pixmap-flags :initarg :pixmap-flags :type xcb:CARD32)))
 
 (defclass xcb:present:CompleteNotify
-  (xcb:-event)
-  ((extension :type xcb:CARD8)
-   (length :type xcb:CARD32)
-   (evtype :type xcb:CARD16)
+  (xcb:-generic-event)
+  ((~evtype :initform 1)
    (kind :initarg :kind :type xcb:CARD8)
    (mode :initarg :mode :type xcb:CARD8)
    (event :initarg :event :type xcb:present:EVENT)
@@ -174,10 +176,8 @@
    (msc :initarg :msc :type xcb:CARD64)))
 
 (defclass xcb:present:IdleNotify
-  (xcb:-event)
-  ((extension :type xcb:CARD8)
-   (length :type xcb:CARD32)
-   (evtype :type xcb:CARD16)
+  (xcb:-generic-event)
+  ((~evtype :initform 2)
    (pad~0 :initform 2 :type xcb:-pad)
    (event :initarg :event :type xcb:present:EVENT)
    (window :initarg :window :type xcb:WINDOW)
@@ -186,10 +186,8 @@
    (idle-fence :initarg :idle-fence :type xcb:sync:FENCE)))
 
 (defclass xcb:present:RedirectNotify
-  (xcb:-event)
-  ((extension :type xcb:CARD8)
-   (length :type xcb:CARD32)
-   (evtype :type xcb:CARD16)
+  (xcb:-generic-event)
+  ((~evtype :initform 3)
    (update-window :initarg :update-window :type xcb:BOOL)
    (pad~0 :initform 1 :type xcb:-pad)
    (event :initarg :event :type xcb:present:EVENT)
@@ -217,12 +215,15 @@
              :type xcb:-list)))
 
 (defconst xcb:present:event-number-class-alist
-  '((0 . xcb:present:Generic)
-    (0 . xcb:present:ConfigureNotify)
+  '((0 . xcb:present:Generic))
+  "(event-number . event-class) alist")
+
+(defconst xcb:present:xge-number-class-alist
+  '((0 . xcb:present:ConfigureNotify)
     (1 . xcb:present:CompleteNotify)
     (2 . xcb:present:IdleNotify)
     (3 . xcb:present:RedirectNotify))
-  "(event-number . event-class) alist")
+  "(xge-number . event-class) alist")
 
 
 
diff --git a/xcb-randr.el b/xcb-randr.el
index 8d2c7c0..c7b8643 100644
--- a/xcb-randr.el
+++ b/xcb-randr.el
@@ -45,19 +45,19 @@
 
 (defclass xcb:randr:BadOutput
   (xcb:-error)
-  nil)
+  ((~code :initform 0)))
 
 (defclass xcb:randr:BadCrtc
   (xcb:-error)
-  nil)
+  ((~code :initform 1)))
 
 (defclass xcb:randr:BadMode
   (xcb:-error)
-  nil)
+  ((~code :initform 2)))
 
 (defclass xcb:randr:BadProvider
   (xcb:-error)
-  nil)
+  ((~code :initform 3)))
 
 (defconst xcb:randr:Rotation:Rotate_0 1)
 (defconst xcb:randr:Rotation:Rotate_90 2)
@@ -90,6 +90,8 @@
 (defclass xcb:randr:QueryVersion~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (major-version :initarg :major-version :type xcb:CARD32)
    (minor-version :initarg :minor-version :type xcb:CARD32)
    (pad~1 :initform 16 :type xcb:-pad)))
@@ -112,6 +114,8 @@
 (defclass xcb:randr:SetScreenConfig~reply
   (xcb:-reply)
   ((status :initarg :status :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (new-timestamp :initarg :new-timestamp :type xcb:TIMESTAMP)
    (config-timestamp :initarg :config-timestamp :type xcb:TIMESTAMP)
    (root :initarg :root :type xcb:WINDOW)
@@ -140,6 +144,8 @@
 (defclass xcb:randr:GetScreenInfo~reply
   (xcb:-reply)
   ((rotations :initarg :rotations :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (root :initarg :root :type xcb:WINDOW)
    (timestamp :initarg :timestamp :type xcb:TIMESTAMP)
    (config-timestamp :initarg :config-timestamp :type xcb:TIMESTAMP)
@@ -170,6 +176,8 @@
 (defclass xcb:randr:GetScreenSizeRange~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (min-width :initarg :min-width :type xcb:CARD16)
    (min-height :initarg :min-height :type xcb:CARD16)
    (max-width :initarg :max-width :type xcb:CARD16)
@@ -223,6 +231,8 @@
 (defclass xcb:randr:GetScreenResources~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (timestamp :initarg :timestamp :type xcb:TIMESTAMP)
    (config-timestamp :initarg :config-timestamp :type xcb:TIMESTAMP)
    (num-crtcs :initarg :num-crtcs :type xcb:CARD16)
@@ -266,6 +276,8 @@
 (defclass xcb:randr:GetOutputInfo~reply
   (xcb:-reply)
   ((status :initarg :status :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (timestamp :initarg :timestamp :type xcb:TIMESTAMP)
    (crtc :initarg :crtc :type xcb:randr:CRTC)
    (mm-width :initarg :mm-width :type xcb:CARD32)
@@ -308,6 +320,8 @@
 (defclass xcb:randr:ListOutputProperties~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (num-atoms :initarg :num-atoms :type xcb:CARD16)
    (pad~1 :initform 22 :type xcb:-pad)
    (atoms :initarg :atoms :type xcb:-ignore)
@@ -324,6 +338,8 @@
 (defclass xcb:randr:QueryOutputProperty~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pending :initarg :pending :type xcb:BOOL)
    (range :initarg :range :type xcb:BOOL)
    (immutable :initarg :immutable :type xcb:BOOL)
@@ -387,6 +403,8 @@
 (defclass xcb:randr:GetOutputProperty~reply
   (xcb:-reply)
   ((format :initarg :format :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (type :initarg :type :type xcb:ATOM)
    (bytes-after :initarg :bytes-after :type xcb:CARD32)
    (num-items :initarg :num-items :type xcb:CARD32)
@@ -413,6 +431,8 @@
 (defclass xcb:randr:CreateMode~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (mode :initarg :mode :type xcb:randr:MODE)
    (pad~1 :initform 20 :type xcb:-pad)))
 
@@ -441,6 +461,8 @@
 (defclass xcb:randr:GetCrtcInfo~reply
   (xcb:-reply)
   ((status :initarg :status :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (timestamp :initarg :timestamp :type xcb:TIMESTAMP)
    (x :initarg :x :type xcb:INT16)
    (y :initarg :y :type xcb:INT16)
@@ -481,6 +503,8 @@
 (defclass xcb:randr:SetCrtcConfig~reply
   (xcb:-reply)
   ((status :initarg :status :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (timestamp :initarg :timestamp :type xcb:TIMESTAMP)
    (pad~0 :initform 20 :type xcb:-pad)))
 
@@ -491,6 +515,8 @@
 (defclass xcb:randr:GetCrtcGammaSize~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (size :initarg :size :type xcb:CARD16)
    (pad~1 :initform 22 :type xcb:-pad)))
 
@@ -501,6 +527,8 @@
 (defclass xcb:randr:GetCrtcGamma~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (size :initarg :size :type xcb:CARD16)
    (pad~1 :initform 22 :type xcb:-pad)
    (red :initarg :red :type xcb:-ignore)
@@ -552,6 +580,8 @@
 (defclass xcb:randr:GetScreenResourcesCurrent~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (timestamp :initarg :timestamp :type xcb:TIMESTAMP)
    (config-timestamp :initarg :config-timestamp :type xcb:TIMESTAMP)
    (num-crtcs :initarg :num-crtcs :type xcb:CARD16)
@@ -613,6 +643,8 @@
 (defclass xcb:randr:GetCrtcTransform~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pending-transform :initarg :pending-transform :type xcb:render:TRANSFORM)
    (has-transforms :initarg :has-transforms :type xcb:BOOL)
    (pad~1 :initform 3 :type xcb:-pad)
@@ -653,6 +685,8 @@
 (defclass xcb:randr:GetPanning~reply
   (xcb:-reply)
   ((status :initarg :status :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (timestamp :initarg :timestamp :type xcb:TIMESTAMP)
    (left :initarg :left :type xcb:CARD16)
    (top :initarg :top :type xcb:CARD16)
@@ -687,6 +721,8 @@
 (defclass xcb:randr:SetPanning~reply
   (xcb:-reply)
   ((status :initarg :status :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (timestamp :initarg :timestamp :type xcb:TIMESTAMP)))
 
 (defclass xcb:randr:SetOutputPrimary
@@ -702,6 +738,8 @@
 (defclass xcb:randr:GetOutputPrimary~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (output :initarg :output :type xcb:randr:OUTPUT)))
 
 (defclass xcb:randr:GetProviders
@@ -711,6 +749,8 @@
 (defclass xcb:randr:GetProviders~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (timestamp :initarg :timestamp :type xcb:TIMESTAMP)
    (num-providers :initarg :num-providers :type xcb:CARD16)
    (pad~1 :initform 18 :type xcb:-pad)
@@ -733,6 +773,8 @@
 (defclass xcb:randr:GetProviderInfo~reply
   (xcb:-reply)
   ((status :initarg :status :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (timestamp :initarg :timestamp :type xcb:TIMESTAMP)
    (capabilities :initarg :capabilities :type xcb:CARD32)
    (num-crtcs :initarg :num-crtcs :type xcb:CARD16)
@@ -791,6 +833,8 @@
 (defclass xcb:randr:ListProviderProperties~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (num-atoms :initarg :num-atoms :type xcb:CARD16)
    (pad~1 :initform 22 :type xcb:-pad)
    (atoms :initarg :atoms :type xcb:-ignore)
@@ -807,6 +851,8 @@
 (defclass xcb:randr:QueryProviderProperty~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pending :initarg :pending :type xcb:BOOL)
    (range :initarg :range :type xcb:BOOL)
    (immutable :initarg :immutable :type xcb:BOOL)
@@ -870,6 +916,8 @@
 (defclass xcb:randr:GetProviderProperty~reply
   (xcb:-reply)
   ((format :initarg :format :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (type :initarg :type :type xcb:ATOM)
    (bytes-after :initarg :bytes-after :type xcb:CARD32)
    (num-items :initarg :num-items :type xcb:CARD32)
@@ -886,7 +934,9 @@
 
 (defclass xcb:randr:ScreenChangeNotify
   (xcb:-event)
-  ((rotation :initarg :rotation :type xcb:CARD8)
+  ((~code :initform 0)
+   (rotation :initarg :rotation :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
    (timestamp :initarg :timestamp :type xcb:TIMESTAMP)
    (config-timestamp :initarg :config-timestamp :type xcb:TIMESTAMP)
    (root :initarg :root :type xcb:WINDOW)
@@ -973,7 +1023,9 @@
 
 (defclass xcb:randr:Notify
   (xcb:-event)
-  ((subCode :initarg :subCode :type xcb:CARD8)
+  ((~code :initform 1)
+   (subCode :initarg :subCode :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
    (u :initarg :u :type xcb:randr:NotifyData)))
 
 (defclass xcb:randr:MonitorInfo
@@ -1002,6 +1054,8 @@
 (defclass xcb:randr:GetMonitors~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (timestamp :initarg :timestamp :type xcb:TIMESTAMP)
    (nMonitors :initarg :nMonitors :type xcb:CARD32)
    (nOutputs :initarg :nOutputs :type xcb:CARD32)
diff --git a/xcb-record.el b/xcb-record.el
index 627da8f..9e1f3f4 100644
--- a/xcb-record.el
+++ b/xcb-record.el
@@ -84,7 +84,8 @@
 
 (defclass xcb:record:BadContext
   (xcb:-error)
-  ((invalid-record :initarg :invalid-record :type xcb:CARD32)))
+  ((~code :initform 0)
+   (invalid-record :initarg :invalid-record :type xcb:CARD32)))
 
 (defclass xcb:record:QueryVersion
   (xcb:-request)
@@ -94,6 +95,8 @@
 (defclass xcb:record:QueryVersion~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (major-version :initarg :major-version :type xcb:CARD16)
    (minor-version :initarg :minor-version :type xcb:CARD16)))
 
@@ -155,6 +158,8 @@
 (defclass xcb:record:GetContext~reply
   (xcb:-reply)
   ((enabled :initarg :enabled :type xcb:BOOL)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (element-header :initarg :element-header :type xcb:record:ElementHeader)
    (pad~0 :initform 3 :type xcb:-pad)
    (num-intercepted-clients :initarg :num-intercepted-clients :type xcb:CARD32)
@@ -172,6 +177,8 @@
 (defclass xcb:record:EnableContext~reply
   (xcb:-reply)
   ((category :initarg :category :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (element-header :initarg :element-header :type xcb:record:ElementHeader)
    (client-swapped :initarg :client-swapped :type xcb:BOOL)
    (pad~0 :initform 2 :type xcb:-pad)
diff --git a/xcb-render.el b/xcb-render.el
index 4be4fc1..081841d 100644
--- a/xcb-render.el
+++ b/xcb-render.el
@@ -136,23 +136,23 @@
 
 (defclass xcb:render:PictFormat
   (xcb:-error)
-  nil)
+  ((~code :initform 0)))
 
 (defclass xcb:render:Picture
   (xcb:-error)
-  nil)
+  ((~code :initform 1)))
 
 (defclass xcb:render:PictOp
   (xcb:-error)
-  nil)
+  ((~code :initform 2)))
 
 (defclass xcb:render:GlyphSet
   (xcb:-error)
-  nil)
+  ((~code :initform 3)))
 
 (defclass xcb:render:Glyph
   (xcb:-error)
-  nil)
+  ((~code :initform 4)))
 
 (defclass xcb:render:DIRECTFORMAT
   (xcb:-struct)
@@ -256,6 +256,8 @@
 (defclass xcb:render:QueryVersion~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (major-version :initarg :major-version :type xcb:CARD32)
    (minor-version :initarg :minor-version :type xcb:CARD32)
    (pad~1 :initform 16 :type xcb:-pad)))
@@ -266,6 +268,8 @@
 (defclass xcb:render:QueryPictFormats~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (num-formats :initarg :num-formats :type xcb:CARD32)
    (num-screens :initarg :num-screens :type xcb:CARD32)
    (num-depths :initarg :num-depths :type xcb:CARD32)
@@ -297,6 +301,8 @@
 (defclass xcb:render:QueryPictIndexValues~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (num-values :initarg :num-values :type xcb:CARD32)
    (pad~1 :initform 20 :type xcb:-pad)
    (values :initarg :values :type xcb:-ignore)
@@ -615,6 +621,8 @@
 (defclass xcb:render:QueryFilters~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (num-aliases :initarg :num-aliases :type xcb:CARD32)
    (num-filters :initarg :num-filters :type xcb:CARD32)
    (pad~1 :initform 16 :type xcb:-pad)
diff --git a/xcb-res.el b/xcb-res.el
index 6216b92..cc7e787 100644
--- a/xcb-res.el
+++ b/xcb-res.el
@@ -93,6 +93,8 @@
 (defclass xcb:res:QueryVersion~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (server-major :initarg :server-major :type xcb:CARD16)
    (server-minor :initarg :server-minor :type xcb:CARD16)))
 
@@ -102,6 +104,8 @@
 (defclass xcb:res:QueryClients~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (num-clients :initarg :num-clients :type xcb:CARD32)
    (pad~1 :initform 20 :type xcb:-pad)
    (clients :initarg :clients :type xcb:-ignore)
@@ -117,6 +121,8 @@
 (defclass xcb:res:QueryClientResources~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (num-types :initarg :num-types :type xcb:CARD32)
    (pad~1 :initform 20 :type xcb:-pad)
    (types :initarg :types :type xcb:-ignore)
@@ -132,6 +138,8 @@
 (defclass xcb:res:QueryClientPixmapBytes~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (bytes :initarg :bytes :type xcb:CARD32)
    (bytes-overflow :initarg :bytes-overflow :type xcb:CARD32)))
 
@@ -147,6 +155,8 @@
 (defclass xcb:res:QueryClientIds~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (num-ids :initarg :num-ids :type xcb:CARD32)
    (pad~1 :initform 20 :type xcb:-pad)
    (ids :initarg :ids :type xcb:-ignore)
@@ -168,6 +178,8 @@
 (defclass xcb:res:QueryResourceBytes~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (num-sizes :initarg :num-sizes :type xcb:CARD32)
    (pad~1 :initform 20 :type xcb:-pad)
    (sizes :initarg :sizes :type xcb:-ignore)
diff --git a/xcb-screensaver.el b/xcb-screensaver.el
index b7645f1..dcf184d 100644
--- a/xcb-screensaver.el
+++ b/xcb-screensaver.el
@@ -54,6 +54,8 @@
 (defclass xcb:screensaver:QueryVersion~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (server-major-version :initarg :server-major-version :type xcb:CARD16)
    (server-minor-version :initarg :server-minor-version :type xcb:CARD16)
    (pad~1 :initform 20 :type xcb:-pad)))
@@ -65,6 +67,8 @@
 (defclass xcb:screensaver:QueryInfo~reply
   (xcb:-reply)
   ((state :initarg :state :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (saver-window :initarg :saver-window :type xcb:WINDOW)
    (ms-until-server :initarg :ms-until-server :type xcb:CARD32)
    (ms-since-user-input :initarg :ms-since-user-input :type xcb:CARD32)
@@ -140,7 +144,9 @@
 
 (defclass xcb:screensaver:Notify
   (xcb:-event)
-  ((state :initarg :state :type xcb:BYTE)
+  ((~code :initform 0)
+   (state :initarg :state :type xcb:BYTE)
+   (~sequence :type xcb:CARD16)
    (time :initarg :time :type xcb:TIMESTAMP)
    (root :initarg :root :type xcb:WINDOW)
    (window :initarg :window :type xcb:WINDOW)
diff --git a/xcb-shape.el b/xcb-shape.el
index eb261f6..2b12280 100644
--- a/xcb-shape.el
+++ b/xcb-shape.el
@@ -49,7 +49,9 @@
 
 (defclass xcb:shape:Notify
   (xcb:-event)
-  ((shape-kind :initarg :shape-kind :type xcb:shape:KIND)
+  ((~code :initform 0)
+   (shape-kind :initarg :shape-kind :type xcb:shape:KIND)
+   (~sequence :type xcb:CARD16)
    (affected-window :initarg :affected-window :type xcb:WINDOW)
    (extents-x :initarg :extents-x :type xcb:INT16)
    (extents-y :initarg :extents-y :type xcb:INT16)
@@ -65,6 +67,8 @@
 (defclass xcb:shape:QueryVersion~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (major-version :initarg :major-version :type xcb:CARD16)
    (minor-version :initarg :minor-version :type xcb:CARD16)))
 
@@ -122,6 +126,8 @@
 (defclass xcb:shape:QueryExtents~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (bounding-shaped :initarg :bounding-shaped :type xcb:BOOL)
    (clip-shaped :initarg :clip-shaped :type xcb:BOOL)
    (pad~1 :initform 2 :type xcb:-pad)
@@ -147,7 +153,9 @@
    (destination-window :initarg :destination-window :type xcb:WINDOW)))
 (defclass xcb:shape:InputSelected~reply
   (xcb:-reply)
-  ((enabled :initarg :enabled :type xcb:BOOL)))
+  ((enabled :initarg :enabled :type xcb:BOOL)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)))
 
 (defclass xcb:shape:GetRectangles
   (xcb:-request)
@@ -158,6 +166,8 @@
 (defclass xcb:shape:GetRectangles~reply
   (xcb:-reply)
   ((ordering :initarg :ordering :type xcb:BYTE)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (rectangles-len :initarg :rectangles-len :type xcb:CARD32)
    (pad~0 :initform 20 :type xcb:-pad)
    (rectangles :initarg :rectangles :type xcb:-ignore)
diff --git a/xcb-shm.el b/xcb-shm.el
index b1098bc..96fc69d 100644
--- a/xcb-shm.el
+++ b/xcb-shm.el
@@ -37,7 +37,9 @@
 
 (defclass xcb:shm:Completion
   (xcb:-event)
-  ((pad~0 :initform 1 :type xcb:-pad)
+  ((~code :initform 0)
+   (pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
    (drawable :initarg :drawable :type xcb:DRAWABLE)
    (minor-event :initarg :minor-event :type xcb:CARD16)
    (major-event :initarg :major-event :type xcb:BYTE)
@@ -47,7 +49,7 @@
 
 (defclass xcb:shm:BadSeg
   (xcb:-error xcb:Value)
-  nil)
+  ((~code :initform 0)))
 
 (defclass xcb:shm:QueryVersion
   (xcb:-request)
@@ -55,6 +57,8 @@
 (defclass xcb:shm:QueryVersion~reply
   (xcb:-reply)
   ((shared-pixmaps :initarg :shared-pixmaps :type xcb:BOOL)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (major-version :initarg :major-version :type xcb:CARD16)
    (minor-version :initarg :minor-version :type xcb:CARD16)
    (uid :initarg :uid :type xcb:CARD16)
@@ -111,6 +115,8 @@
 (defclass xcb:shm:GetImage~reply
   (xcb:-reply)
   ((depth :initarg :depth :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (visual :initarg :visual :type xcb:VISUALID)
    (size :initarg :size :type xcb:CARD32)))
 
@@ -144,6 +150,8 @@
 (defclass xcb:shm:CreateSegment~reply
   (xcb:-reply)
   ((nfd :initarg :nfd :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (shm-fd :type xcb:-fd)
    (pad~0 :initform 24 :type xcb:-pad)))
 
diff --git a/xcb-sync.el b/xcb-sync.el
index 96f627d..2d19b98 100644
--- a/xcb-sync.el
+++ b/xcb-sync.el
@@ -89,13 +89,15 @@
 
 (defclass xcb:sync:Counter
   (xcb:-error)
-  ((bad-counter :initarg :bad-counter :type xcb:CARD32)
+  ((~code :initform 0)
+   (bad-counter :initarg :bad-counter :type xcb:CARD32)
    (minor-opcode :initarg :minor-opcode :type xcb:CARD16)
    (major-opcode :initarg :major-opcode :type xcb:CARD8)))
 
 (defclass xcb:sync:Alarm
   (xcb:-error)
-  ((bad-alarm :initarg :bad-alarm :type xcb:CARD32)
+  ((~code :initform 1)
+   (bad-alarm :initarg :bad-alarm :type xcb:CARD32)
    (minor-opcode :initarg :minor-opcode :type xcb:CARD16)
    (major-opcode :initarg :major-opcode :type xcb:CARD8)))
 
@@ -107,6 +109,8 @@
 (defclass xcb:sync:Initialize~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (major-version :initarg :major-version :type xcb:CARD8)
    (minor-version :initarg :minor-version :type xcb:CARD8)
    (pad~1 :initform 22 :type xcb:-pad)))
@@ -117,6 +121,8 @@
 (defclass xcb:sync:ListSystemCounters~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (counters-len :initarg :counters-len :type xcb:CARD32)
    (pad~1 :initform 20 :type xcb:-pad)
    (counters :initarg :counters :type xcb:-ignore)
@@ -143,6 +149,8 @@
 (defclass xcb:sync:QueryCounter~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (counter-value :initarg :counter-value :type xcb:sync:INT64)))
 
 (defclass xcb:sync:Await
@@ -223,6 +231,8 @@
 (defclass xcb:sync:QueryAlarm~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (trigger :initarg :trigger :type xcb:sync:TRIGGER)
    (delta :initarg :delta :type xcb:sync:INT64)
    (events :initarg :events :type xcb:BOOL)
@@ -242,6 +252,8 @@
 (defclass xcb:sync:GetPriority~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (priority :initarg :priority :type xcb:INT32)))
 
 (defclass xcb:sync:CreateFence
@@ -273,6 +285,8 @@
 (defclass xcb:sync:QueryFence~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (triggered :initarg :triggered :type xcb:BOOL)
    (pad~1 :initform 23 :type xcb:-pad)))
 
@@ -286,7 +300,9 @@
 
 (defclass xcb:sync:CounterNotify
   (xcb:-event)
-  ((kind :initarg :kind :type xcb:CARD8)
+  ((~code :initform 0)
+   (kind :initarg :kind :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
    (counter :initarg :counter :type xcb:sync:COUNTER)
    (wait-value :initarg :wait-value :type xcb:sync:INT64)
    (counter-value :initarg :counter-value :type xcb:sync:INT64)
@@ -297,7 +313,9 @@
 
 (defclass xcb:sync:AlarmNotify
   (xcb:-event)
-  ((kind :initarg :kind :type xcb:CARD8)
+  ((~code :initform 1)
+   (kind :initarg :kind :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
    (alarm :initarg :alarm :type xcb:sync:ALARM)
    (counter-value :initarg :counter-value :type xcb:sync:INT64)
    (alarm-value :initarg :alarm-value :type xcb:sync:INT64)
diff --git a/xcb-types.el b/xcb-types.el
index 8d4e9a2..6440403 100644
--- a/xcb-types.el
+++ b/xcb-types.el
@@ -690,17 +690,11 @@ and the second the consumed length."
   :documentation "X request type.")
 
 (defclass xcb:-reply (xcb:-struct)
-  ((length :initarg :length ;reply length, used in e.g. GetKeyboardMapping
-           :type xcb:-ignore))
+  ((~reply :initform 1 :type xcb:-u1))
   :documentation "X reply type.")
-;;
-(cl-defmethod xcb:unmarshal ((obj xcb:-reply) byte-array)
-  "Fill in fields in a reply OBJ according to its byte-array representation."
-  (cl-call-next-method obj (vconcat (substring byte-array 1 2)
-                                    (substring byte-array 8))))
 
 (defclass xcb:-event (xcb:-struct)
-  nil
+  ((~code :type xcb:-u1))
   :documentation "Event type.")
 ;; Implemented in 'xcb.el'
 (cl-defgeneric xcb:-error-or-event-class->number ((obj xcb:connection) class))
@@ -708,43 +702,45 @@ and the second the consumed length."
 (cl-defmethod xcb:marshal ((obj xcb:-event) connection &optional sequence)
   "Return the byte-array representation of event OBJ.
 
-This method is mainly designed for `xcb:SendEvent', where it's used to generate
-synthetic events. The CONNECTION argument is used to retrieve the event number
-for extensions. If SEQUENCE is non-nil, it is used as the sequence number in
-the synthetic event. Otherwise, 0 is assumed.
-
-Note that this method auto pads the result to 32 bytes, as is always the case."
-  (let ((result (cl-call-next-method obj)))
-    (setq result (vconcat
-                  `[,(xcb:-error-or-event-class->number ;defined in 'xcb.el'
-                      connection (eieio-object-class obj))]
-                  result))
-    (unless (same-class-p obj 'xcb:KeymapNotify)
-      (setq result
-            (vconcat (substring result 0 2)
-                     (funcall (if (slot-value obj '~lsb) #'xcb:-pack-u2-lsb
-                                #'xcb:-pack-u2)
-                              (or sequence 0))
-                     (substring result 2))))
-    (cl-assert (>= 32 (length result)))
-    (setq result (vconcat result (make-vector (- 32 (length result)) 0)))))
-;;
-(cl-defmethod xcb:unmarshal ((obj xcb:-event) byte-array)
-  "Fill in event OBJ according to its byte-array representation BYTE-ARRAY."
-  (cl-call-next-method obj
-                       (if (same-class-p obj 'xcb:KeymapNotify)
-                           (substring byte-array 1) ;strip event code
-                         ;; Strip event code & sequence number
-                         (vconcat (substring byte-array 1 2)
-                                  (substring byte-array 4)))))
+This method is mainly designed for `xcb:SendEvent', where it's used to
+generate synthetic events.  The CONNECTION argument is used to retrieve
+the event number of extensions.  If SEQUENCE is non-nil, it is used as
+the sequence number of the synthetic event (if the event uses sequence
+number); otherwise, 0 is assumed.
+
+This method auto-pads short results to 32 bytes."
+  (let ((event-number
+         (xcb:-error-or-event-class->number connection
+                                            (eieio-object-class obj)))
+        result)
+    (when (consp event-number)
+      (setq event-number (cdr event-number))
+      (if (= 1 (length event-number))
+          ;; XKB event.
+          (setf (slot-value obj 'xkbType) (aref event-number 0))
+        ;; Generic event.
+        (setf (slot-value obj 'extensions) (aref event-number 0)
+              (slot-value obj 'evtype) (aref event-number 1))))
+    (when (slot-exists-p obj '~sequence)
+      (setf (slot-value obj '~sequence) (or sequence 0)))
+    (setq result (cl-call-next-method obj))
+    (when (> 32 (length result))
+      (setq result (vconcat result (make-vector (- 32 (length result)) 0))))
+    result))
+
+(defclass xcb:-generic-event (xcb:-event)
+  ((~code :initform 35)
+   (~extension :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (~length :type xcb:CARD32)
+   (~evtype :type xcb:CARD16))
+  :documentation "Generic event type.")
 
 (defclass xcb:-error (xcb:-struct)
-  nil
+  ((~error :initform 0 :type xcb:-u1)
+   (~code :type xcb:-u1)
+   (~sequence :type xcb:CARD16))
   :documentation "X error type.")
-;;
-(cl-defmethod xcb:unmarshal ((obj xcb:-error) byte-array)
-  "Fill in error OBJ according to its byte-array representation BYTE-ARRAY."
-  (cl-call-next-method obj (substring byte-array 4))) ;skip the first 4 bytes
 
 (defclass xcb:-union (xcb:-struct)
   ((~size :initarg :~size :type xcb:-ignore)) ;Size of the largest member.
diff --git a/xcb-xc_misc.el b/xcb-xc_misc.el
index 86e2624..c46236a 100644
--- a/xcb-xc_misc.el
+++ b/xcb-xc_misc.el
@@ -39,6 +39,8 @@
 (defclass xcb:xc_misc:GetVersion~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (server-major-version :initarg :server-major-version :type xcb:CARD16)
    (server-minor-version :initarg :server-minor-version :type xcb:CARD16)))
 
@@ -48,6 +50,8 @@
 (defclass xcb:xc_misc:GetXIDRange~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (start-id :initarg :start-id :type xcb:CARD32)
    (count :initarg :count :type xcb:CARD32)))
 
@@ -58,6 +62,8 @@
 (defclass xcb:xc_misc:GetXIDList~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (ids-len :initarg :ids-len :type xcb:CARD32)
    (pad~1 :initform 20 :type xcb:-pad)
    (ids :initarg :ids :type xcb:-ignore)
diff --git a/xcb-xevie.el b/xcb-xevie.el
index ef9c1aa..008946e 100644
--- a/xcb-xevie.el
+++ b/xcb-xevie.el
@@ -39,6 +39,8 @@
 (defclass xcb:xevie:QueryVersion~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (server-major-version :initarg :server-major-version :type xcb:CARD16)
    (server-minor-version :initarg :server-minor-version :type xcb:CARD16)
    (pad~1 :initform 20 :type xcb:-pad)))
@@ -50,6 +52,8 @@
 (defclass xcb:xevie:Start~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 24 :type xcb:-pad)))
 
 (defclass xcb:xevie:End
@@ -59,6 +63,8 @@
 (defclass xcb:xevie:End~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 24 :type xcb:-pad)))
 
 (defconst xcb:xevie:Datatype:Unmodified 0)
@@ -77,6 +83,8 @@
 (defclass xcb:xevie:Send~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 24 :type xcb:-pad)))
 
 (defclass xcb:xevie:SelectInput
@@ -86,6 +94,8 @@
 (defclass xcb:xevie:SelectInput~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 24 :type xcb:-pad)))
 
 
diff --git a/xcb-xf86dri.el b/xcb-xf86dri.el
index d1de7e3..863114f 100644
--- a/xcb-xf86dri.el
+++ b/xcb-xf86dri.el
@@ -44,6 +44,8 @@
 (defclass xcb:xf86dri:QueryVersion~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (dri-major-version :initarg :dri-major-version :type xcb:CARD16)
    (dri-minor-version :initarg :dri-minor-version :type xcb:CARD16)
    (dri-minor-patch :initarg :dri-minor-patch :type xcb:CARD32)))
@@ -55,6 +57,8 @@
 (defclass xcb:xf86dri:QueryDirectRenderingCapable~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (is-capable :initarg :is-capable :type xcb:BOOL)))
 
 (defclass xcb:xf86dri:OpenConnection
@@ -64,6 +68,8 @@
 (defclass xcb:xf86dri:OpenConnection~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (sarea-handle-low :initarg :sarea-handle-low :type xcb:CARD32)
    (sarea-handle-high :initarg :sarea-handle-high :type xcb:CARD32)
    (bus-id-len :initarg :bus-id-len :type xcb:CARD32)
@@ -86,6 +92,8 @@
 (defclass xcb:xf86dri:GetClientDriverName~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (client-driver-major-version :initarg :client-driver-major-version :type 
xcb:CARD32)
    (client-driver-minor-version :initarg :client-driver-minor-version :type 
xcb:CARD32)
    (client-driver-patch-version :initarg :client-driver-patch-version :type 
xcb:CARD32)
@@ -106,6 +114,8 @@
 (defclass xcb:xf86dri:CreateContext~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (hw-context :initarg :hw-context :type xcb:CARD32)))
 
 (defclass xcb:xf86dri:DestroyContext
@@ -122,6 +132,8 @@
 (defclass xcb:xf86dri:CreateDrawable~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (hw-drawable-handle :initarg :hw-drawable-handle :type xcb:CARD32)))
 
 (defclass xcb:xf86dri:DestroyDrawable
@@ -138,6 +150,8 @@
 (defclass xcb:xf86dri:GetDrawableInfo~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (drawable-table-index :initarg :drawable-table-index :type xcb:CARD32)
    (drawable-table-stamp :initarg :drawable-table-stamp :type xcb:CARD32)
    (drawable-origin-X :initarg :drawable-origin-X :type xcb:INT16)
@@ -167,6 +181,8 @@
 (defclass xcb:xf86dri:GetDeviceInfo~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (framebuffer-handle-low :initarg :framebuffer-handle-low :type xcb:CARD32)
    (framebuffer-handle-high :initarg :framebuffer-handle-high :type xcb:CARD32)
    (framebuffer-origin-offset :initarg :framebuffer-origin-offset :type 
xcb:CARD32)
@@ -187,6 +203,8 @@
 (defclass xcb:xf86dri:AuthConnection~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (authenticated :initarg :authenticated :type xcb:CARD32)))
 
 
diff --git a/xcb-xf86vidmode.el b/xcb-xf86vidmode.el
index c07aa32..8c3c6c4 100644
--- a/xcb-xf86vidmode.el
+++ b/xcb-xf86vidmode.el
@@ -77,6 +77,8 @@
 (defclass xcb:xf86vidmode:QueryVersion~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (major-version :initarg :major-version :type xcb:CARD16)
    (minor-version :initarg :minor-version :type xcb:CARD16)))
 
@@ -88,6 +90,8 @@
 (defclass xcb:xf86vidmode:GetModeLine~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (dotclock :initarg :dotclock :type xcb:xf86vidmode:DOTCLOCK)
    (hdisplay :initarg :hdisplay :type xcb:CARD16)
    (hsyncstart :initarg :hsyncstart :type xcb:CARD16)
@@ -145,6 +149,8 @@
 (defclass xcb:xf86vidmode:GetMonitor~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (vendor-length :initarg :vendor-length :type xcb:CARD8)
    (model-length :initarg :model-length :type xcb:CARD8)
    (num-hsync :initarg :num-hsync :type xcb:CARD8)
@@ -200,6 +206,8 @@
 (defclass xcb:xf86vidmode:GetAllModeLines~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (modecount :initarg :modecount :type xcb:CARD32)
    (pad~1 :initform 20 :type xcb:-pad)
    (modeinfo :initarg :modeinfo :type xcb:-ignore)
@@ -295,6 +303,8 @@
 (defclass xcb:xf86vidmode:ValidateModeLine~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (status :initarg :status :type xcb:CARD32)
    (pad~1 :initform 20 :type xcb:-pad)))
 
@@ -330,6 +340,8 @@
 (defclass xcb:xf86vidmode:GetViewPort~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (x :initarg :x :type xcb:CARD32)
    (y :initarg :y :type xcb:CARD32)
    (pad~1 :initform 16 :type xcb:-pad)))
@@ -350,6 +362,8 @@
 (defclass xcb:xf86vidmode:GetDotClocks~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (flags :initarg :flags :type xcb:CARD32)
    (clocks :initarg :clocks :type xcb:CARD32)
    (maxclocks :initarg :maxclocks :type xcb:CARD32)
@@ -389,6 +403,8 @@
 (defclass xcb:xf86vidmode:GetGamma~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (red :initarg :red :type xcb:CARD32)
    (green :initarg :green :type xcb:CARD32)
    (blue :initarg :blue :type xcb:CARD32)
@@ -402,6 +418,8 @@
 (defclass xcb:xf86vidmode:GetGammaRamp~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (size :initarg :size :type xcb:CARD16)
    (pad~1 :initform 22 :type xcb:-pad)
    (red :initarg :red :type xcb:-ignore)
@@ -477,6 +495,8 @@
 (defclass xcb:xf86vidmode:GetGammaRampSize~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (size :initarg :size :type xcb:CARD16)
    (pad~1 :initform 22 :type xcb:-pad)))
 
@@ -488,36 +508,38 @@
 (defclass xcb:xf86vidmode:GetPermissions~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (permissions :initarg :permissions :type xcb:CARD32)
    (pad~1 :initform 20 :type xcb:-pad)))
 
 (defclass xcb:xf86vidmode:BadClock
   (xcb:-error)
-  nil)
+  ((~code :initform 0)))
 
 (defclass xcb:xf86vidmode:BadHTimings
   (xcb:-error)
-  nil)
+  ((~code :initform 1)))
 
 (defclass xcb:xf86vidmode:BadVTimings
   (xcb:-error)
-  nil)
+  ((~code :initform 2)))
 
 (defclass xcb:xf86vidmode:ModeUnsuitable
   (xcb:-error)
-  nil)
+  ((~code :initform 3)))
 
 (defclass xcb:xf86vidmode:ExtensionDisabled
   (xcb:-error)
-  nil)
+  ((~code :initform 4)))
 
 (defclass xcb:xf86vidmode:ClientNotLocal
   (xcb:-error)
-  nil)
+  ((~code :initform 5)))
 
 (defclass xcb:xf86vidmode:ZoomLocked
   (xcb:-error)
-  nil)
+  ((~code :initform 6)))
 
 (defconst xcb:xf86vidmode:error-number-class-alist
   '((0 . xcb:xf86vidmode:BadClock)
diff --git a/xcb-xfixes.el b/xcb-xfixes.el
index 26220f6..b327023 100644
--- a/xcb-xfixes.el
+++ b/xcb-xfixes.el
@@ -45,6 +45,8 @@
 (defclass xcb:xfixes:QueryVersion~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (major-version :initarg :major-version :type xcb:CARD32)
    (minor-version :initarg :minor-version :type xcb:CARD32)
    (pad~1 :initform 16 :type xcb:-pad)))
@@ -77,7 +79,9 @@
 
 (defclass xcb:xfixes:SelectionNotify
   (xcb:-event)
-  ((subtype :initarg :subtype :type xcb:CARD8)
+  ((~code :initform 0)
+   (subtype :initarg :subtype :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
    (window :initarg :window :type xcb:WINDOW)
    (owner :initarg :owner :type xcb:WINDOW)
    (selection :initarg :selection :type xcb:ATOM)
@@ -98,7 +102,9 @@
 
 (defclass xcb:xfixes:CursorNotify
   (xcb:-event)
-  ((subtype :initarg :subtype :type xcb:CARD8)
+  ((~code :initform 1)
+   (subtype :initarg :subtype :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
    (window :initarg :window :type xcb:WINDOW)
    (cursor-serial :initarg :cursor-serial :type xcb:CARD32)
    (timestamp :initarg :timestamp :type xcb:TIMESTAMP)
@@ -117,6 +123,8 @@
 (defclass xcb:xfixes:GetCursorImage~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (x :initarg :x :type xcb:INT16)
    (y :initarg :y :type xcb:INT16)
    (width :initarg :width :type xcb:CARD16)
@@ -137,7 +145,7 @@
 
 (defclass xcb:xfixes:BadRegion
   (xcb:-error)
-  nil)
+  ((~code :initform 0)))
 
 (defconst xcb:xfixes:Region:None 0)
 
@@ -244,6 +252,8 @@
 (defclass xcb:xfixes:FetchRegion~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (extents :initarg :extents :type xcb:RECTANGLE)
    (pad~1 :initform 16 :type xcb:-pad)
    (rectangles :initarg :rectangles :type xcb:-ignore)
@@ -299,6 +309,8 @@
 (defclass xcb:xfixes:GetCursorName~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (atom :initarg :atom :type xcb:ATOM)
    (nbytes :initarg :nbytes :type xcb:CARD16)
    (pad~1 :initform 18 :type xcb:-pad)
@@ -314,6 +326,8 @@
 (defclass xcb:xfixes:GetCursorImageAndName~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (x :initarg :x :type xcb:INT16)
    (y :initarg :y :type xcb:INT16)
    (width :initarg :width :type xcb:CARD16)
diff --git a/xcb-xinerama.el b/xcb-xinerama.el
index a8a6310..0656c48 100644
--- a/xcb-xinerama.el
+++ b/xcb-xinerama.el
@@ -48,6 +48,8 @@
 (defclass xcb:xinerama:QueryVersion~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (major :initarg :major :type xcb:CARD16)
    (minor :initarg :minor :type xcb:CARD16)))
 
@@ -58,6 +60,8 @@
 (defclass xcb:xinerama:GetState~reply
   (xcb:-reply)
   ((state :initarg :state :type xcb:BYTE)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (window :initarg :window :type xcb:WINDOW)))
 
 (defclass xcb:xinerama:GetScreenCount
@@ -67,6 +71,8 @@
 (defclass xcb:xinerama:GetScreenCount~reply
   (xcb:-reply)
   ((screen-count :initarg :screen-count :type xcb:BYTE)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (window :initarg :window :type xcb:WINDOW)))
 
 (defclass xcb:xinerama:GetScreenSize
@@ -77,6 +83,8 @@
 (defclass xcb:xinerama:GetScreenSize~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (width :initarg :width :type xcb:CARD32)
    (height :initarg :height :type xcb:CARD32)
    (window :initarg :window :type xcb:WINDOW)
@@ -88,6 +96,8 @@
 (defclass xcb:xinerama:IsActive~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (state :initarg :state :type xcb:CARD32)))
 
 (defclass xcb:xinerama:QueryScreens
@@ -96,6 +106,8 @@
 (defclass xcb:xinerama:QueryScreens~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (number :initarg :number :type xcb:CARD32)
    (pad~1 :initform 20 :type xcb:-pad)
    (screen-info :initarg :screen-info :type xcb:-ignore)
diff --git a/xcb-xinput.el b/xcb-xinput.el
index d33d9ca..cd90e69 100644
--- a/xcb-xinput.el
+++ b/xcb-xinput.el
@@ -61,6 +61,8 @@
 (defclass xcb:xinput:GetExtensionVersion~reply
   (xcb:-reply)
   ((xi-reply-type :initarg :xi-reply-type :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (server-major :initarg :server-major :type xcb:CARD16)
    (server-minor :initarg :server-minor :type xcb:CARD16)
    (present :initarg :present :type xcb:BOOL)
@@ -166,6 +168,8 @@
 (defclass xcb:xinput:ListInputDevices~reply
   (xcb:-reply)
   ((xi-reply-type :initarg :xi-reply-type :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (devices-len :initarg :devices-len :type xcb:CARD8)
    (pad~0 :initform 23 :type xcb:-pad)
    (devices :initarg :devices :type xcb:-ignore)
@@ -210,6 +214,8 @@
 (defclass xcb:xinput:OpenDevice~reply
   (xcb:-reply)
   ((xi-reply-type :initarg :xi-reply-type :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (num-classes :initarg :num-classes :type xcb:CARD8)
    (pad~0 :initform 23 :type xcb:-pad)
    (class-info :initarg :class-info :type xcb:-ignore)
@@ -234,6 +240,8 @@
 (defclass xcb:xinput:SetDeviceMode~reply
   (xcb:-reply)
   ((xi-reply-type :initarg :xi-reply-type :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (status :initarg :status :type xcb:CARD8)
    (pad~0 :initform 23 :type xcb:-pad)))
 
@@ -256,6 +264,8 @@
 (defclass xcb:xinput:GetSelectedExtensionEvents~reply
   (xcb:-reply)
   ((xi-reply-type :initarg :xi-reply-type :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (num-this-classes :initarg :num-this-classes :type xcb:CARD16)
    (num-all-classes :initarg :num-all-classes :type xcb:CARD16)
    (pad~0 :initform 20 :type xcb:-pad)
@@ -294,6 +304,8 @@
 (defclass xcb:xinput:GetDeviceDontPropagateList~reply
   (xcb:-reply)
   ((xi-reply-type :initarg :xi-reply-type :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (num-classes :initarg :num-classes :type xcb:CARD16)
    (pad~0 :initform 22 :type xcb:-pad)
    (classes :initarg :classes :type xcb:-ignore)
@@ -321,6 +333,8 @@
 (defclass xcb:xinput:GetDeviceMotionEvents~reply
   (xcb:-reply)
   ((xi-reply-type :initarg :xi-reply-type :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (num-events :initarg :num-events :type xcb:CARD32)
    (num-axes :initarg :num-axes :type xcb:CARD8)
    (device-mode :initarg :device-mode :type xcb:CARD8)
@@ -339,6 +353,8 @@
 (defclass xcb:xinput:ChangeKeyboardDevice~reply
   (xcb:-reply)
   ((xi-reply-type :initarg :xi-reply-type :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (status :initarg :status :type xcb:CARD8)
    (pad~0 :initform 23 :type xcb:-pad)))
 
@@ -352,6 +368,8 @@
 (defclass xcb:xinput:ChangePointerDevice~reply
   (xcb:-reply)
   ((xi-reply-type :initarg :xi-reply-type :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (status :initarg :status :type xcb:CARD8)
    (pad~0 :initform 23 :type xcb:-pad)))
 
@@ -374,6 +392,8 @@
 (defclass xcb:xinput:GrabDevice~reply
   (xcb:-reply)
   ((xi-reply-type :initarg :xi-reply-type :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (status :initarg :status :type xcb:CARD8)
    (pad~0 :initform 23 :type xcb:-pad)))
 
@@ -466,6 +486,8 @@
 (defclass xcb:xinput:GetDeviceFocus~reply
   (xcb:-reply)
   ((xi-reply-type :initarg :xi-reply-type :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (focus :initarg :focus :type xcb:WINDOW)
    (time :initarg :time :type xcb:TIMESTAMP)
    (revert-to :initarg :revert-to :type xcb:CARD8)
@@ -612,6 +634,8 @@
 (defclass xcb:xinput:GetFeedbackControl~reply
   (xcb:-reply)
   ((xi-reply-type :initarg :xi-reply-type :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (num-feedbacks :initarg :num-feedbacks :type xcb:CARD16)
    (pad~0 :initform 22 :type xcb:-pad)
    (feedbacks :initarg :feedbacks :type xcb:-ignore)
@@ -758,6 +782,8 @@
 (defclass xcb:xinput:GetDeviceKeyMapping~reply
   (xcb:-reply)
   ((xi-reply-type :initarg :xi-reply-type :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (keysyms-per-keycode :initarg :keysyms-per-keycode :type xcb:CARD8)
    (pad~0 :initform 23 :type xcb:-pad)
    (keysyms :initarg :keysyms :type xcb:-ignore)
@@ -789,6 +815,8 @@
 (defclass xcb:xinput:GetDeviceModifierMapping~reply
   (xcb:-reply)
   ((xi-reply-type :initarg :xi-reply-type :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (keycodes-per-modifier :initarg :keycodes-per-modifier :type xcb:CARD8)
    (pad~0 :initform 23 :type xcb:-pad)
    (keymaps :initarg :keymaps :type xcb:-ignore)
@@ -815,6 +843,8 @@
 (defclass xcb:xinput:SetDeviceModifierMapping~reply
   (xcb:-reply)
   ((xi-reply-type :initarg :xi-reply-type :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (status :initarg :status :type xcb:CARD8)
    (pad~0 :initform 23 :type xcb:-pad)))
 
@@ -826,6 +856,8 @@
 (defclass xcb:xinput:GetDeviceButtonMapping~reply
   (xcb:-reply)
   ((xi-reply-type :initarg :xi-reply-type :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (map-size :initarg :map-size :type xcb:CARD8)
    (pad~0 :initform 23 :type xcb:-pad)
    (map :initarg :map :type xcb:-ignore)
@@ -849,6 +881,8 @@
 (defclass xcb:xinput:SetDeviceButtonMapping~reply
   (xcb:-reply)
   ((xi-reply-type :initarg :xi-reply-type :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (status :initarg :status :type xcb:CARD8)
    (pad~0 :initform 23 :type xcb:-pad)))
 
@@ -929,6 +963,8 @@
 (defclass xcb:xinput:QueryDeviceState~reply
   (xcb:-reply)
   ((xi-reply-type :initarg :xi-reply-type :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (num-classes :initarg :num-classes :type xcb:CARD8)
    (pad~0 :initform 23 :type xcb:-pad)
    (classes :initarg :classes :type xcb:-ignore)
@@ -983,6 +1019,8 @@
 (defclass xcb:xinput:SetDeviceValuators~reply
   (xcb:-reply)
   ((xi-reply-type :initarg :xi-reply-type :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (status :initarg :status :type xcb:CARD8)
    (pad~0 :initform 23 :type xcb:-pad)))
 
@@ -1115,6 +1153,8 @@
 (defclass xcb:xinput:GetDeviceControl~reply
   (xcb:-reply)
   ((xi-reply-type :initarg :xi-reply-type :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (status :initarg :status :type xcb:CARD8)
    (pad~0 :initform 23 :type xcb:-pad)
    (control :initarg :control :type xcb:xinput:DeviceState)))
@@ -1221,6 +1261,8 @@
 (defclass xcb:xinput:ChangeDeviceControl~reply
   (xcb:-reply)
   ((xi-reply-type :initarg :xi-reply-type :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (status :initarg :status :type xcb:CARD8)
    (pad~0 :initform 23 :type xcb:-pad)))
 
@@ -1232,6 +1274,8 @@
 (defclass xcb:xinput:ListDeviceProperties~reply
   (xcb:-reply)
   ((xi-reply-type :initarg :xi-reply-type :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (num-atoms :initarg :num-atoms :type xcb:CARD16)
    (pad~0 :initform 22 :type xcb:-pad)
    (atoms :initarg :atoms :type xcb:-ignore)
@@ -1300,6 +1344,8 @@
 (defclass xcb:xinput:GetDeviceProperty~reply
   (xcb:-reply)
   ((xi-reply-type :initarg :xi-reply-type :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (type :initarg :type :type xcb:ATOM)
    (bytes-after :initarg :bytes-after :type xcb:CARD32)
    (num-items :initarg :num-items :type xcb:CARD32)
@@ -1358,6 +1404,8 @@
 (defclass xcb:xinput:XIQueryPointer~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (root :initarg :root :type xcb:WINDOW)
    (child :initarg :child :type xcb:WINDOW)
    (root-x :initarg :root-x :type xcb:xinput:FP1616)
@@ -1500,6 +1548,8 @@
 (defclass xcb:xinput:XIGetClientPointer~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (set :initarg :set :type xcb:BOOL)
    (pad~1 :initform 1 :type xcb:-pad)
    (deviceid :initarg :deviceid :type xcb:xinput:DeviceId)
@@ -1562,6 +1612,8 @@
 (defclass xcb:xinput:XIQueryVersion~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (major-version :initarg :major-version :type xcb:CARD16)
    (minor-version :initarg :minor-version :type xcb:CARD16)
    (pad~1 :initform 20 :type xcb:-pad)))
@@ -1736,6 +1788,8 @@
 (defclass xcb:xinput:XIQueryDevice~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (num-infos :initarg :num-infos :type xcb:CARD16)
    (pad~1 :initform 22 :type xcb:-pad)
    (infos :initarg :infos :type xcb:-ignore)
@@ -1760,6 +1814,8 @@
 (defclass xcb:xinput:XIGetFocus~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (focus :initarg :focus :type xcb:WINDOW)
    (pad~1 :initform 20 :type xcb:-pad)))
 
@@ -1786,6 +1842,8 @@
 (defclass xcb:xinput:XIGrabDevice~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (status :initarg :status :type xcb:CARD8)
    (pad~1 :initform 23 :type xcb:-pad)))
 
@@ -1862,6 +1920,8 @@
 (defclass xcb:xinput:XIPassiveGrabDevice~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (num-modifiers :initarg :num-modifiers :type xcb:CARD16)
    (pad~1 :initform 22 :type xcb:-pad)
    (modifiers :initarg :modifiers :type xcb:-ignore)
@@ -1893,6 +1953,8 @@
 (defclass xcb:xinput:XIListProperties~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (num-properties :initarg :num-properties :type xcb:CARD16)
    (pad~1 :initform 22 :type xcb:-pad)
    (properties :initarg :properties :type xcb:-ignore)
@@ -1956,6 +2018,8 @@
 (defclass xcb:xinput:XIGetProperty~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (type :initarg :type :type xcb:ATOM)
    (bytes-after :initarg :bytes-after :type xcb:CARD32)
    (num-items :initarg :num-items :type xcb:CARD32)
@@ -1994,6 +2058,8 @@
 (defclass xcb:xinput:XIGetSelectedEvents~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (num-masks :initarg :num-masks :type xcb:CARD16)
    (pad~1 :initform 22 :type xcb:-pad)
    (masks :initarg :masks :type xcb:-ignore)
@@ -2021,7 +2087,9 @@
 
 (defclass xcb:xinput:DeviceValuator
   (xcb:-event)
-  ((device-id :initarg :device-id :type xcb:CARD8)
+  ((~code :initform 0)
+   (device-id :initarg :device-id :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
    (device-state :initarg :device-state :type xcb:CARD16)
    (num-valuators :initarg :num-valuators :type xcb:CARD8)
    (first-valuator :initarg :first-valuator :type xcb:CARD8)
@@ -2034,7 +2102,9 @@
 
 (defclass xcb:xinput:DeviceKeyPress
   (xcb:-event)
-  ((detail :initarg :detail :type xcb:BYTE)
+  ((~code :initform 1)
+   (detail :initarg :detail :type xcb:BYTE)
+   (~sequence :type xcb:CARD16)
    (time :initarg :time :type xcb:TIMESTAMP)
    (root :initarg :root :type xcb:WINDOW)
    (event :initarg :event :type xcb:WINDOW)
@@ -2049,23 +2119,25 @@
 
 (defclass xcb:xinput:DeviceKeyRelease
   (xcb:-event xcb:xinput:DeviceKeyPress)
-  nil)
+  ((~code :initform 2)))
 
 (defclass xcb:xinput:DeviceButtonPress
   (xcb:-event xcb:xinput:DeviceKeyPress)
-  nil)
+  ((~code :initform 3)))
 
 (defclass xcb:xinput:DeviceButtonRelease
   (xcb:-event xcb:xinput:DeviceKeyPress)
-  nil)
+  ((~code :initform 4)))
 
 (defclass xcb:xinput:DeviceMotionNotify
   (xcb:-event xcb:xinput:DeviceKeyPress)
-  nil)
+  ((~code :initform 5)))
 
 (defclass xcb:xinput:DeviceFocusIn
   (xcb:-event)
-  ((detail :initarg :detail :type xcb:BYTE)
+  ((~code :initform 6)
+   (detail :initarg :detail :type xcb:BYTE)
+   (~sequence :type xcb:CARD16)
    (time :initarg :time :type xcb:TIMESTAMP)
    (window :initarg :window :type xcb:WINDOW)
    (mode :initarg :mode :type xcb:BYTE)
@@ -2074,15 +2146,15 @@
 
 (defclass xcb:xinput:DeviceFocusOut
   (xcb:-event xcb:xinput:DeviceFocusIn)
-  nil)
+  ((~code :initform 7)))
 
 (defclass xcb:xinput:ProximityIn
   (xcb:-event xcb:xinput:DeviceKeyPress)
-  nil)
+  ((~code :initform 8)))
 
 (defclass xcb:xinput:ProximityOut
   (xcb:-event xcb:xinput:DeviceKeyPress)
-  nil)
+  ((~code :initform 9)))
 
 (defconst xcb:xinput:ClassesReportedMask:OutOfProximity 128)
 (defconst xcb:xinput:ClassesReportedMask:DeviceModeAbsolute 64)
@@ -2092,7 +2164,9 @@
 
 (defclass xcb:xinput:DeviceStateNotify
   (xcb:-event)
-  ((device-id :initarg :device-id :type xcb:BYTE)
+  ((~code :initform 10)
+   (device-id :initarg :device-id :type xcb:BYTE)
+   (~sequence :type xcb:CARD16)
    (time :initarg :time :type xcb:TIMESTAMP)
    (num-keys :initarg :num-keys :type xcb:CARD8)
    (num-buttons :initarg :num-buttons :type xcb:CARD8)
@@ -2113,7 +2187,9 @@
 
 (defclass xcb:xinput:DeviceMappingNotify
   (xcb:-event)
-  ((device-id :initarg :device-id :type xcb:BYTE)
+  ((~code :initform 11)
+   (device-id :initarg :device-id :type xcb:BYTE)
+   (~sequence :type xcb:CARD16)
    (request :initarg :request :type xcb:CARD8)
    (first-keycode :initarg :first-keycode :type xcb:xinput:KeyCode)
    (count :initarg :count :type xcb:CARD8)
@@ -2126,14 +2202,18 @@
 
 (defclass xcb:xinput:ChangeDeviceNotify
   (xcb:-event)
-  ((device-id :initarg :device-id :type xcb:BYTE)
+  ((~code :initform 12)
+   (device-id :initarg :device-id :type xcb:BYTE)
+   (~sequence :type xcb:CARD16)
    (time :initarg :time :type xcb:TIMESTAMP)
    (request :initarg :request :type xcb:CARD8)
    (pad~0 :initform 23 :type xcb:-pad)))
 
 (defclass xcb:xinput:DeviceKeyStateNotify
   (xcb:-event)
-  ((device-id :initarg :device-id :type xcb:BYTE)
+  ((~code :initform 13)
+   (device-id :initarg :device-id :type xcb:BYTE)
+   (~sequence :type xcb:CARD16)
    (keys :initarg :keys :type xcb:-ignore)
    (keys~ :initform
          '(name keys type xcb:CARD8 size 28)
@@ -2141,7 +2221,9 @@
 
 (defclass xcb:xinput:DeviceButtonStateNotify
   (xcb:-event)
-  ((device-id :initarg :device-id :type xcb:BYTE)
+  ((~code :initform 14)
+   (device-id :initarg :device-id :type xcb:BYTE)
+   (~sequence :type xcb:CARD16)
    (buttons :initarg :buttons :type xcb:-ignore)
    (buttons~ :initform
             '(name buttons type xcb:CARD8 size 28)
@@ -2156,7 +2238,9 @@
 
 (defclass xcb:xinput:DevicePresenceNotify
   (xcb:-event)
-  ((pad~0 :initform 1 :type xcb:-pad)
+  ((~code :initform 15)
+   (pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
    (time :initarg :time :type xcb:TIMESTAMP)
    (devchange :initarg :devchange :type xcb:BYTE)
    (device-id :initarg :device-id :type xcb:BYTE)
@@ -2165,7 +2249,9 @@
 
 (defclass xcb:xinput:DevicePropertyNotify
   (xcb:-event)
-  ((state :initarg :state :type xcb:BYTE)
+  ((~code :initform 16)
+   (state :initarg :state :type xcb:BYTE)
+   (~sequence :type xcb:CARD16)
    (time :initarg :time :type xcb:TIMESTAMP)
    (property :initarg :property :type xcb:ATOM)
    (pad~0 :initform 19 :type xcb:-pad)
@@ -2175,10 +2261,8 @@
 (defconst xcb:xinput:ChangeReason:DeviceChange 2)
 
 (defclass xcb:xinput:DeviceChanged
-  (xcb:-event)
-  ((extension :type xcb:CARD8)
-   (length :type xcb:CARD32)
-   (evtype :type xcb:CARD16)
+  (xcb:-generic-event)
+  ((~evtype :initform 1)
    (deviceid :initarg :deviceid :type xcb:xinput:DeviceId)
    (time :initarg :time :type xcb:TIMESTAMP)
    (num-classes :initarg :num-classes :type xcb:CARD16)
@@ -2194,10 +2278,8 @@
 (defconst xcb:xinput:KeyEventFlags:KeyRepeat 65536)
 
 (defclass xcb:xinput:KeyPress
-  (xcb:-event)
-  ((extension :type xcb:CARD8)
-   (length :type xcb:CARD32)
-   (evtype :type xcb:CARD16)
+  (xcb:-generic-event)
+  ((~evtype :initform 2)
    (deviceid :initarg :deviceid :type xcb:xinput:DeviceId)
    (time :initarg :time :type xcb:TIMESTAMP)
    (detail :initarg :detail :type xcb:CARD32)
@@ -2244,16 +2326,14 @@
                :type xcb:-list)))
 
 (defclass xcb:xinput:KeyRelease
-  (xcb:-event xcb:KeyPress)
-  nil)
+  (xcb:-event xcb:xinput:KeyPress)
+  ((~evtype :initform 3)))
 
 (defconst xcb:xinput:PointerEventFlags:PointerEmulated 65536)
 
 (defclass xcb:xinput:ButtonPress
-  (xcb:-event)
-  ((extension :type xcb:CARD8)
-   (length :type xcb:CARD32)
-   (evtype :type xcb:CARD16)
+  (xcb:-generic-event)
+  ((~evtype :initform 4)
    (deviceid :initarg :deviceid :type xcb:xinput:DeviceId)
    (time :initarg :time :type xcb:TIMESTAMP)
    (detail :initarg :detail :type xcb:CARD32)
@@ -2300,12 +2380,12 @@
                :type xcb:-list)))
 
 (defclass xcb:xinput:ButtonRelease
-  (xcb:-event xcb:ButtonPress)
-  nil)
+  (xcb:-event xcb:xinput:ButtonPress)
+  ((~evtype :initform 5)))
 
 (defclass xcb:xinput:Motion
-  (xcb:-event xcb:ButtonPress)
-  nil)
+  (xcb:-event xcb:xinput:ButtonPress)
+  ((~evtype :initform 6)))
 
 (defconst xcb:xinput:NotifyMode:Normal 0)
 (defconst xcb:xinput:NotifyMode:Grab 1)
@@ -2324,10 +2404,8 @@
 (defconst xcb:xinput:NotifyDetail:None 7)
 
 (defclass xcb:xinput:Enter
-  (xcb:-event)
-  ((extension :type xcb:CARD8)
-   (length :type xcb:CARD32)
-   (evtype :type xcb:CARD16)
+  (xcb:-generic-event)
+  ((~evtype :initform 7)
    (deviceid :initarg :deviceid :type xcb:xinput:DeviceId)
    (time :initarg :time :type xcb:TIMESTAMP)
    (sourceid :initarg :sourceid :type xcb:xinput:DeviceId)
@@ -2353,15 +2431,15 @@
 
 (defclass xcb:xinput:Leave
   (xcb:-event xcb:xinput:Enter)
-  nil)
+  ((~evtype :initform 8)))
 
 (defclass xcb:xinput:FocusIn
   (xcb:-event xcb:xinput:Enter)
-  nil)
+  ((~evtype :initform 9)))
 
 (defclass xcb:xinput:FocusOut
   (xcb:-event xcb:xinput:Enter)
-  nil)
+  ((~evtype :initform 10)))
 
 (defconst xcb:xinput:HierarchyMask:MasterAdded 1)
 (defconst xcb:xinput:HierarchyMask:MasterRemoved 2)
@@ -2382,10 +2460,8 @@
    (flags :initarg :flags :type xcb:CARD32)))
 
 (defclass xcb:xinput:Hierarchy
-  (xcb:-event)
-  ((extension :type xcb:CARD8)
-   (length :type xcb:CARD32)
-   (evtype :type xcb:CARD16)
+  (xcb:-generic-event)
+  ((~evtype :initform 11)
    (deviceid :initarg :deviceid :type xcb:xinput:DeviceId)
    (time :initarg :time :type xcb:TIMESTAMP)
    (flags :initarg :flags :type xcb:CARD32)
@@ -2402,10 +2478,8 @@
 (defconst xcb:xinput:PropertyFlag:Modified 2)
 
 (defclass xcb:xinput:Property
-  (xcb:-event)
-  ((extension :type xcb:CARD8)
-   (length :type xcb:CARD32)
-   (evtype :type xcb:CARD16)
+  (xcb:-generic-event)
+  ((~evtype :initform 12)
    (deviceid :initarg :deviceid :type xcb:xinput:DeviceId)
    (time :initarg :time :type xcb:TIMESTAMP)
    (property :initarg :property :type xcb:ATOM)
@@ -2413,10 +2487,8 @@
    (pad~0 :initform 11 :type xcb:-pad)))
 
 (defclass xcb:xinput:RawKeyPress
-  (xcb:-event)
-  ((extension :type xcb:CARD8)
-   (length :type xcb:CARD32)
-   (evtype :type xcb:CARD16)
+  (xcb:-generic-event)
+  ((~evtype :initform 13)
    (deviceid :initarg :deviceid :type xcb:xinput:DeviceId)
    (time :initarg :time :type xcb:TIMESTAMP)
    (detail :initarg :detail :type xcb:CARD32)
@@ -2464,13 +2536,11 @@
 
 (defclass xcb:xinput:RawKeyRelease
   (xcb:-event xcb:xinput:RawKeyPress)
-  nil)
+  ((~evtype :initform 14)))
 
 (defclass xcb:xinput:RawButtonPress
-  (xcb:-event)
-  ((extension :type xcb:CARD8)
-   (length :type xcb:CARD32)
-   (evtype :type xcb:CARD16)
+  (xcb:-generic-event)
+  ((~evtype :initform 15)
    (deviceid :initarg :deviceid :type xcb:xinput:DeviceId)
    (time :initarg :time :type xcb:TIMESTAMP)
    (detail :initarg :detail :type xcb:CARD32)
@@ -2518,20 +2588,18 @@
 
 (defclass xcb:xinput:RawButtonRelease
   (xcb:-event xcb:xinput:RawButtonPress)
-  nil)
+  ((~evtype :initform 16)))
 
 (defclass xcb:xinput:RawMotion
   (xcb:-event xcb:xinput:RawButtonPress)
-  nil)
+  ((~evtype :initform 17)))
 
 (defconst xcb:xinput:TouchEventFlags:TouchPendingEnd 65536)
 (defconst xcb:xinput:TouchEventFlags:TouchEmulatingPointer 131072)
 
 (defclass xcb:xinput:TouchBegin
-  (xcb:-event)
-  ((extension :type xcb:CARD8)
-   (length :type xcb:CARD32)
-   (evtype :type xcb:CARD16)
+  (xcb:-generic-event)
+  ((~evtype :initform 18)
    (deviceid :initarg :deviceid :type xcb:xinput:DeviceId)
    (time :initarg :time :type xcb:TIMESTAMP)
    (detail :initarg :detail :type xcb:CARD32)
@@ -2579,19 +2647,17 @@
 
 (defclass xcb:xinput:TouchUpdate
   (xcb:-event xcb:xinput:TouchBegin)
-  nil)
+  ((~evtype :initform 19)))
 
 (defclass xcb:xinput:TouchEnd
   (xcb:-event xcb:xinput:TouchBegin)
-  nil)
+  ((~evtype :initform 20)))
 
 (defconst xcb:xinput:TouchOwnershipFlags:None 0)
 
 (defclass xcb:xinput:TouchOwnership
-  (xcb:-event)
-  ((extension :type xcb:CARD8)
-   (length :type xcb:CARD32)
-   (evtype :type xcb:CARD16)
+  (xcb:-generic-event)
+  ((~evtype :initform 21)
    (deviceid :initarg :deviceid :type xcb:xinput:DeviceId)
    (time :initarg :time :type xcb:TIMESTAMP)
    (touchid :initarg :touchid :type xcb:CARD32)
@@ -2604,10 +2670,8 @@
    (pad~1 :initform 8 :type xcb:-pad)))
 
 (defclass xcb:xinput:RawTouchBegin
-  (xcb:-event)
-  ((extension :type xcb:CARD8)
-   (length :type xcb:CARD32)
-   (evtype :type xcb:CARD16)
+  (xcb:-generic-event)
+  ((~evtype :initform 22)
    (deviceid :initarg :deviceid :type xcb:xinput:DeviceId)
    (time :initarg :time :type xcb:TIMESTAMP)
    (detail :initarg :detail :type xcb:CARD32)
@@ -2655,20 +2719,18 @@
 
 (defclass xcb:xinput:RawTouchUpdate
   (xcb:-event xcb:xinput:RawTouchBegin)
-  nil)
+  ((~evtype :initform 23)))
 
 (defclass xcb:xinput:RawTouchEnd
   (xcb:-event xcb:xinput:RawTouchBegin)
-  nil)
+  ((~evtype :initform 24)))
 
 (defconst xcb:xinput:BarrierFlags:PointerReleased 1)
 (defconst xcb:xinput:BarrierFlags:DeviceIsGrabbed 2)
 
 (defclass xcb:xinput:BarrierHit
-  (xcb:-event)
-  ((extension :type xcb:CARD8)
-   (length :type xcb:CARD32)
-   (evtype :type xcb:CARD16)
+  (xcb:-generic-event)
+  ((~evtype :initform 25)
    (deviceid :initarg :deviceid :type xcb:xinput:DeviceId)
    (time :initarg :time :type xcb:TIMESTAMP)
    (eventid :initarg :eventid :type xcb:CARD32)
@@ -2686,27 +2748,27 @@
 
 (defclass xcb:xinput:BarrierLeave
   (xcb:-event xcb:xinput:BarrierHit)
-  nil)
+  ((~evtype :initform 26)))
 
 (defclass xcb:xinput:Device
   (xcb:-error)
-  nil)
+  ((~code :initform 0)))
 
 (defclass xcb:xinput:Event
   (xcb:-error)
-  nil)
+  ((~code :initform 1)))
 
 (defclass xcb:xinput:Mode
   (xcb:-error)
-  nil)
+  ((~code :initform 2)))
 
 (defclass xcb:xinput:DeviceBusy
   (xcb:-error)
-  nil)
+  ((~code :initform 3)))
 
 (defclass xcb:xinput:Class
   (xcb:-error)
-  nil)
+  ((~code :initform 4)))
 
 (defconst xcb:xinput:error-number-class-alist
   '((0 . xcb:xinput:Device)
@@ -2733,8 +2795,11 @@
     (13 . xcb:xinput:DeviceKeyStateNotify)
     (14 . xcb:xinput:DeviceButtonStateNotify)
     (15 . xcb:xinput:DevicePresenceNotify)
-    (16 . xcb:xinput:DevicePropertyNotify)
-    (1 . xcb:xinput:DeviceChanged)
+    (16 . xcb:xinput:DevicePropertyNotify))
+  "(event-number . event-class) alist")
+
+(defconst xcb:xinput:xge-number-class-alist
+  '((1 . xcb:xinput:DeviceChanged)
     (2 . xcb:xinput:KeyPress)
     (3 . xcb:xinput:KeyRelease)
     (4 . xcb:xinput:ButtonPress)
@@ -2760,7 +2825,7 @@
     (24 . xcb:xinput:RawTouchEnd)
     (25 . xcb:xinput:BarrierHit)
     (26 . xcb:xinput:BarrierLeave))
-  "(event-number . event-class) alist")
+  "(xge-number . event-class) alist")
 
 
 
diff --git a/xcb-xkb.el b/xcb-xkb.el
index 3f315db..bd8d854 100644
--- a/xcb-xkb.el
+++ b/xcb-xkb.el
@@ -616,7 +616,8 @@
 
 (defclass xcb:xkb:Keyboard
   (xcb:-error)
-  ((value :initarg :value :type xcb:CARD32)
+  ((~code :initform 0)
+   (value :initarg :value :type xcb:CARD32)
    (minorOpcode :initarg :minorOpcode :type xcb:CARD16)
    (majorOpcode :initarg :majorOpcode :type xcb:CARD8)
    (pad~0 :initform 21 :type xcb:-pad)))
@@ -895,6 +896,8 @@
 (defclass xcb:xkb:UseExtension~reply
   (xcb:-reply)
   ((supported :initarg :supported :type xcb:BOOL)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (serverMajor :initarg :serverMajor :type xcb:CARD16)
    (serverMinor :initarg :serverMinor :type xcb:CARD16)
    (pad~0 :initform 20 :type xcb:-pad)))
@@ -977,6 +980,8 @@
 (defclass xcb:xkb:GetState~reply
   (xcb:-reply)
   ((deviceID :initarg :deviceID :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (mods :initarg :mods :type xcb:CARD8)
    (baseMods :initarg :baseMods :type xcb:CARD8)
    (latchedMods :initarg :latchedMods :type xcb:CARD8)
@@ -1016,6 +1021,8 @@
 (defclass xcb:xkb:GetControls~reply
   (xcb:-reply)
   ((deviceID :initarg :deviceID :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (mouseKeysDfltBtn :initarg :mouseKeysDfltBtn :type xcb:CARD8)
    (numGroups :initarg :numGroups :type xcb:CARD8)
    (groupsWrap :initarg :groupsWrap :type xcb:CARD8)
@@ -1111,6 +1118,8 @@
 (defclass xcb:xkb:GetMap~reply
   (xcb:-reply)
   ((deviceID :initarg :deviceID :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~0 :initform 2 :type xcb:-pad)
    (minKeyCode :initarg :minKeyCode :type xcb:KEYCODE)
    (maxKeyCode :initarg :maxKeyCode :type xcb:KEYCODE)
@@ -1304,6 +1313,8 @@
 (defclass xcb:xkb:GetCompatMap~reply
   (xcb:-reply)
   ((deviceID :initarg :deviceID :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (groupsRtrn :initarg :groupsRtrn :type xcb:CARD8)
    (pad~0 :initform 1 :type xcb:-pad)
    (firstSIRtrn :initarg :firstSIRtrn :type xcb:CARD16)
@@ -1355,6 +1366,8 @@
 (defclass xcb:xkb:GetIndicatorState~reply
   (xcb:-reply)
   ((deviceID :initarg :deviceID :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (state :initarg :state :type xcb:CARD32)
    (pad~0 :initform 20 :type xcb:-pad)))
 
@@ -1367,6 +1380,8 @@
 (defclass xcb:xkb:GetIndicatorMap~reply
   (xcb:-reply)
   ((deviceID :initarg :deviceID :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (which :initarg :which :type xcb:CARD32)
    (realIndicators :initarg :realIndicators :type xcb:CARD32)
    (nIndicators :initarg :nIndicators :type xcb:CARD8)
@@ -1402,6 +1417,8 @@
 (defclass xcb:xkb:GetNamedIndicator~reply
   (xcb:-reply)
   ((deviceID :initarg :deviceID :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (indicator :initarg :indicator :type xcb:ATOM)
    (found :initarg :found :type xcb:BOOL)
    (on :initarg :on :type xcb:BOOL)
@@ -1448,6 +1465,8 @@
 (defclass xcb:xkb:GetNames~reply
   (xcb:-reply)
   ((deviceID :initarg :deviceID :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (which :initarg :which :type xcb:CARD32)
    (minKeyCode :initarg :minKeyCode :type xcb:KEYCODE)
    (maxKeyCode :initarg :maxKeyCode :type xcb:KEYCODE)
@@ -1644,6 +1663,8 @@
 (defclass xcb:xkb:PerClientFlags~reply
   (xcb:-reply)
   ((deviceID :initarg :deviceID :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (supported :initarg :supported :type xcb:CARD32)
    (value :initarg :value :type xcb:CARD32)
    (autoCtrls :initarg :autoCtrls :type xcb:CARD32)
@@ -1658,6 +1679,8 @@
 (defclass xcb:xkb:ListComponents~reply
   (xcb:-reply)
   ((deviceID :initarg :deviceID :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (nKeymaps :initarg :nKeymaps :type xcb:CARD16)
    (nKeycodes :initarg :nKeycodes :type xcb:CARD16)
    (nTypes :initarg :nTypes :type xcb:CARD16)
@@ -1720,6 +1743,8 @@
 (defclass xcb:xkb:GetKbdByName~reply
   (xcb:-reply)
   ((deviceID :initarg :deviceID :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (minKeyCode :initarg :minKeyCode :type xcb:KEYCODE)
    (maxKeyCode :initarg :maxKeyCode :type xcb:KEYCODE)
    (loaded :initarg :loaded :type xcb:BOOL)
@@ -1996,6 +2021,8 @@
 (defclass xcb:xkb:GetDeviceInfo~reply
   (xcb:-reply)
   ((deviceID :initarg :deviceID :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (present :initarg :present :type xcb:CARD16)
    (supported :initarg :supported :type xcb:CARD16)
    (unsupported :initarg :unsupported :type xcb:CARD16)
@@ -2066,6 +2093,8 @@
 (defclass xcb:xkb:SetDebuggingFlags~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (currentFlags :initarg :currentFlags :type xcb:CARD32)
    (currentCtrls :initarg :currentCtrls :type xcb:CARD32)
    (supportedFlags :initarg :supportedFlags :type xcb:CARD32)
@@ -2074,7 +2103,9 @@
 
 (defclass xcb:xkb:NewKeyboardNotify
   (xcb:-event)
-  ((xkbType :initarg :xkbType :type xcb:CARD8)
+  ((~code :initform 0)
+   (xkbType :initarg :xkbType :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
    (time :initarg :time :type xcb:TIMESTAMP)
    (deviceID :initarg :deviceID :type xcb:CARD8)
    (oldDeviceID :initarg :oldDeviceID :type xcb:CARD8)
@@ -2089,7 +2120,9 @@
 
 (defclass xcb:xkb:MapNotify
   (xcb:-event)
-  ((xkbType :initarg :xkbType :type xcb:CARD8)
+  ((~code :initform 1)
+   (xkbType :initarg :xkbType :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
    (time :initarg :time :type xcb:TIMESTAMP)
    (deviceID :initarg :deviceID :type xcb:CARD8)
    (ptrBtnActions :initarg :ptrBtnActions :type xcb:CARD8)
@@ -2115,7 +2148,9 @@
 
 (defclass xcb:xkb:StateNotify
   (xcb:-event)
-  ((xkbType :initarg :xkbType :type xcb:CARD8)
+  ((~code :initform 2)
+   (xkbType :initarg :xkbType :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
    (time :initarg :time :type xcb:TIMESTAMP)
    (deviceID :initarg :deviceID :type xcb:CARD8)
    (mods :initarg :mods :type xcb:CARD8)
@@ -2140,7 +2175,9 @@
 
 (defclass xcb:xkb:ControlsNotify
   (xcb:-event)
-  ((xkbType :initarg :xkbType :type xcb:CARD8)
+  ((~code :initform 3)
+   (xkbType :initarg :xkbType :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
    (time :initarg :time :type xcb:TIMESTAMP)
    (deviceID :initarg :deviceID :type xcb:CARD8)
    (numGroups :initarg :numGroups :type xcb:CARD8)
@@ -2156,7 +2193,9 @@
 
 (defclass xcb:xkb:IndicatorStateNotify
   (xcb:-event)
-  ((xkbType :initarg :xkbType :type xcb:CARD8)
+  ((~code :initform 4)
+   (xkbType :initarg :xkbType :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
    (time :initarg :time :type xcb:TIMESTAMP)
    (deviceID :initarg :deviceID :type xcb:CARD8)
    (pad~0 :initform 3 :type xcb:-pad)
@@ -2166,7 +2205,9 @@
 
 (defclass xcb:xkb:IndicatorMapNotify
   (xcb:-event)
-  ((xkbType :initarg :xkbType :type xcb:CARD8)
+  ((~code :initform 5)
+   (xkbType :initarg :xkbType :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
    (time :initarg :time :type xcb:TIMESTAMP)
    (deviceID :initarg :deviceID :type xcb:CARD8)
    (pad~0 :initform 3 :type xcb:-pad)
@@ -2176,7 +2217,9 @@
 
 (defclass xcb:xkb:NamesNotify
   (xcb:-event)
-  ((xkbType :initarg :xkbType :type xcb:CARD8)
+  ((~code :initform 6)
+   (xkbType :initarg :xkbType :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
    (time :initarg :time :type xcb:TIMESTAMP)
    (deviceID :initarg :deviceID :type xcb:CARD8)
    (pad~0 :initform 1 :type xcb:-pad)
@@ -2197,7 +2240,9 @@
 
 (defclass xcb:xkb:CompatMapNotify
   (xcb:-event)
-  ((xkbType :initarg :xkbType :type xcb:CARD8)
+  ((~code :initform 7)
+   (xkbType :initarg :xkbType :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
    (time :initarg :time :type xcb:TIMESTAMP)
    (deviceID :initarg :deviceID :type xcb:CARD8)
    (changedGroups :initarg :changedGroups :type xcb:CARD8)
@@ -2208,7 +2253,9 @@
 
 (defclass xcb:xkb:BellNotify
   (xcb:-event)
-  ((xkbType :initarg :xkbType :type xcb:CARD8)
+  ((~code :initform 8)
+   (xkbType :initarg :xkbType :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
    (time :initarg :time :type xcb:TIMESTAMP)
    (deviceID :initarg :deviceID :type xcb:CARD8)
    (bellClass :initarg :bellClass :type xcb:CARD8)
@@ -2223,7 +2270,9 @@
 
 (defclass xcb:xkb:ActionMessage
   (xcb:-event)
-  ((xkbType :initarg :xkbType :type xcb:CARD8)
+  ((~code :initform 9)
+   (xkbType :initarg :xkbType :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
    (time :initarg :time :type xcb:TIMESTAMP)
    (deviceID :initarg :deviceID :type xcb:CARD8)
    (keycode :initarg :keycode :type xcb:KEYCODE)
@@ -2239,7 +2288,9 @@
 
 (defclass xcb:xkb:AccessXNotify
   (xcb:-event)
-  ((xkbType :initarg :xkbType :type xcb:CARD8)
+  ((~code :initform 10)
+   (xkbType :initarg :xkbType :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
    (time :initarg :time :type xcb:TIMESTAMP)
    (deviceID :initarg :deviceID :type xcb:CARD8)
    (keycode :initarg :keycode :type xcb:KEYCODE)
@@ -2250,7 +2301,9 @@
 
 (defclass xcb:xkb:ExtensionDeviceNotify
   (xcb:-event)
-  ((xkbType :initarg :xkbType :type xcb:CARD8)
+  ((~code :initform 11)
+   (xkbType :initarg :xkbType :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
    (time :initarg :time :type xcb:TIMESTAMP)
    (deviceID :initarg :deviceID :type xcb:CARD8)
    (pad~0 :initform 1 :type xcb:-pad)
diff --git a/xcb-xprint.el b/xcb-xprint.el
index 3314983..7ef805b 100644
--- a/xcb-xprint.el
+++ b/xcb-xprint.el
@@ -82,6 +82,8 @@
 (defclass xcb:xprint:PrintQueryVersion~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (major-version :initarg :major-version :type xcb:CARD16)
    (minor-version :initarg :minor-version :type xcb:CARD16)))
 
@@ -104,6 +106,8 @@
 (defclass xcb:xprint:PrintGetPrinterList~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (listCount :initarg :listCount :type xcb:CARD32)
    (pad~1 :initform 20 :type xcb:-pad)
    (printers :initarg :printers :type xcb:-ignore)
@@ -145,6 +149,8 @@
 (defclass xcb:xprint:PrintGetContext~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (context :initarg :context :type xcb:CARD32)))
 
 (defclass xcb:xprint:PrintDestroyContext
@@ -158,6 +164,8 @@
 (defclass xcb:xprint:PrintGetScreenOfContext~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (root :initarg :root :type xcb:WINDOW)))
 
 (defclass xcb:xprint:PrintStartJob
@@ -213,6 +221,8 @@
 (defclass xcb:xprint:PrintGetDocumentData~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (status-code :initarg :status-code :type xcb:CARD32)
    (finished-flag :initarg :finished-flag :type xcb:CARD32)
    (dataLen :initarg :dataLen :type xcb:CARD32)
@@ -247,6 +257,8 @@
 (defclass xcb:xprint:PrintInputSelected~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (event-mask :initarg :event-mask :type xcb:CARD32)
    (all-events-mask :initarg :all-events-mask :type xcb:CARD32)))
 
@@ -259,6 +271,8 @@
 (defclass xcb:xprint:PrintGetAttributes~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (stringLen :initarg :stringLen :type xcb:CARD32)
    (pad~1 :initform 20 :type xcb:-pad)
    (attributes :initarg :attributes :type xcb:-ignore)
@@ -282,6 +296,8 @@
 (defclass xcb:xprint:PrintGetOneAttributes~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (valueLen :initarg :valueLen :type xcb:CARD32)
    (pad~1 :initform 20 :type xcb:-pad)
    (value :initarg :value :type xcb:-ignore)
@@ -310,6 +326,8 @@
 (defclass xcb:xprint:PrintGetPageDimensions~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (width :initarg :width :type xcb:CARD16)
    (height :initarg :height :type xcb:CARD16)
    (offset-x :initarg :offset-x :type xcb:CARD16)
@@ -323,6 +341,8 @@
 (defclass xcb:xprint:PrintQueryScreens~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (listCount :initarg :listCount :type xcb:CARD32)
    (pad~1 :initform 20 :type xcb:-pad)
    (roots :initarg :roots :type xcb:-ignore)
@@ -339,6 +359,8 @@
 (defclass xcb:xprint:PrintSetImageResolution~reply
   (xcb:-reply)
   ((status :initarg :status :type xcb:BOOL)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (previous-resolutions :initarg :previous-resolutions :type xcb:CARD16)))
 
 (defclass xcb:xprint:PrintGetImageResolution
@@ -348,26 +370,32 @@
 (defclass xcb:xprint:PrintGetImageResolution~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (image-resolution :initarg :image-resolution :type xcb:CARD16)))
 
 (defclass xcb:xprint:Notify
   (xcb:-event)
-  ((detail :initarg :detail :type xcb:CARD8)
+  ((~code :initform 0)
+   (detail :initarg :detail :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
    (context :initarg :context :type xcb:xprint:PCONTEXT)
    (cancel :initarg :cancel :type xcb:BOOL)))
 
 (defclass xcb:xprint:AttributNotify
   (xcb:-event)
-  ((detail :initarg :detail :type xcb:CARD8)
+  ((~code :initform 1)
+   (detail :initarg :detail :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
    (context :initarg :context :type xcb:xprint:PCONTEXT)))
 
 (defclass xcb:xprint:BadContext
   (xcb:-error)
-  nil)
+  ((~code :initform 0)))
 
 (defclass xcb:xprint:BadSequence
   (xcb:-error)
-  nil)
+  ((~code :initform 1)))
 
 (defconst xcb:xprint:error-number-class-alist
   '((0 . xcb:xprint:BadContext)
diff --git a/xcb-xproto.el b/xcb-xproto.el
index 58d55b8..48698ff 100644
--- a/xcb-xproto.el
+++ b/xcb-xproto.el
@@ -294,7 +294,9 @@
 
 (defclass xcb:KeyPress
   (xcb:-event)
-  ((detail :initarg :detail :type xcb:KEYCODE)
+  ((~code :initform 2)
+   (detail :initarg :detail :type xcb:KEYCODE)
+   (~sequence :type xcb:CARD16)
    (time :initarg :time :type xcb:TIMESTAMP)
    (root :initarg :root :type xcb:WINDOW)
    (event :initarg :event :type xcb:WINDOW)
@@ -309,7 +311,7 @@
 
 (defclass xcb:KeyRelease
   (xcb:-event xcb:KeyPress)
-  nil)
+  ((~code :initform 3)))
 
 (defconst xcb:ButtonMask:1 256)
 (defconst xcb:ButtonMask:2 512)
@@ -320,7 +322,9 @@
 
 (defclass xcb:ButtonPress
   (xcb:-event)
-  ((detail :initarg :detail :type xcb:BUTTON)
+  ((~code :initform 4)
+   (detail :initarg :detail :type xcb:BUTTON)
+   (~sequence :type xcb:CARD16)
    (time :initarg :time :type xcb:TIMESTAMP)
    (root :initarg :root :type xcb:WINDOW)
    (event :initarg :event :type xcb:WINDOW)
@@ -335,14 +339,16 @@
 
 (defclass xcb:ButtonRelease
   (xcb:-event xcb:ButtonPress)
-  nil)
+  ((~code :initform 5)))
 
 (defconst xcb:Motion:Normal 0)
 (defconst xcb:Motion:Hint 1)
 
 (defclass xcb:MotionNotify
   (xcb:-event)
-  ((detail :initarg :detail :type xcb:BYTE)
+  ((~code :initform 6)
+   (detail :initarg :detail :type xcb:BYTE)
+   (~sequence :type xcb:CARD16)
    (time :initarg :time :type xcb:TIMESTAMP)
    (root :initarg :root :type xcb:WINDOW)
    (event :initarg :event :type xcb:WINDOW)
@@ -371,7 +377,9 @@
 
 (defclass xcb:EnterNotify
   (xcb:-event)
-  ((detail :initarg :detail :type xcb:BYTE)
+  ((~code :initform 7)
+   (detail :initarg :detail :type xcb:BYTE)
+   (~sequence :type xcb:CARD16)
    (time :initarg :time :type xcb:TIMESTAMP)
    (root :initarg :root :type xcb:WINDOW)
    (event :initarg :event :type xcb:WINDOW)
@@ -386,29 +394,34 @@
 
 (defclass xcb:LeaveNotify
   (xcb:-event xcb:EnterNotify)
-  nil)
+  ((~code :initform 8)))
 
 (defclass xcb:FocusIn
   (xcb:-event)
-  ((detail :initarg :detail :type xcb:BYTE)
+  ((~code :initform 9)
+   (detail :initarg :detail :type xcb:BYTE)
+   (~sequence :type xcb:CARD16)
    (event :initarg :event :type xcb:WINDOW)
    (mode :initarg :mode :type xcb:BYTE)
    (pad~0 :initform 3 :type xcb:-pad)))
 
 (defclass xcb:FocusOut
   (xcb:-event xcb:FocusIn)
-  nil)
+  ((~code :initform 10)))
 
 (defclass xcb:KeymapNotify
   (xcb:-event)
-  ((keys :initarg :keys :type xcb:-ignore)
+  ((~code :initform 11)
+   (keys :initarg :keys :type xcb:-ignore)
    (keys~ :initform
          '(name keys type xcb:CARD8 size 31)
          :type xcb:-list)))
 
 (defclass xcb:Expose
   (xcb:-event)
-  ((pad~0 :initform 1 :type xcb:-pad)
+  ((~code :initform 12)
+   (pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
    (window :initarg :window :type xcb:WINDOW)
    (x :initarg :x :type xcb:CARD16)
    (y :initarg :y :type xcb:CARD16)
@@ -419,7 +432,9 @@
 
 (defclass xcb:GraphicsExposure
   (xcb:-event)
-  ((pad~0 :initform 1 :type xcb:-pad)
+  ((~code :initform 13)
+   (pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
    (drawable :initarg :drawable :type xcb:DRAWABLE)
    (x :initarg :x :type xcb:CARD16)
    (y :initarg :y :type xcb:CARD16)
@@ -432,7 +447,9 @@
 
 (defclass xcb:NoExposure
   (xcb:-event)
-  ((pad~0 :initform 1 :type xcb:-pad)
+  ((~code :initform 14)
+   (pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
    (drawable :initarg :drawable :type xcb:DRAWABLE)
    (minor-opcode :initarg :minor-opcode :type xcb:CARD16)
    (major-opcode :initarg :major-opcode :type xcb:CARD8)
@@ -444,14 +461,18 @@
 
 (defclass xcb:VisibilityNotify
   (xcb:-event)
-  ((pad~0 :initform 1 :type xcb:-pad)
+  ((~code :initform 15)
+   (pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
    (window :initarg :window :type xcb:WINDOW)
    (state :initarg :state :type xcb:BYTE)
    (pad~1 :initform 3 :type xcb:-pad)))
 
 (defclass xcb:CreateNotify
   (xcb:-event)
-  ((pad~0 :initform 1 :type xcb:-pad)
+  ((~code :initform 16)
+   (pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
    (parent :initarg :parent :type xcb:WINDOW)
    (window :initarg :window :type xcb:WINDOW)
    (x :initarg :x :type xcb:INT16)
@@ -464,13 +485,17 @@
 
 (defclass xcb:DestroyNotify
   (xcb:-event)
-  ((pad~0 :initform 1 :type xcb:-pad)
+  ((~code :initform 17)
+   (pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
    (event :initarg :event :type xcb:WINDOW)
    (window :initarg :window :type xcb:WINDOW)))
 
 (defclass xcb:UnmapNotify
   (xcb:-event)
-  ((pad~0 :initform 1 :type xcb:-pad)
+  ((~code :initform 18)
+   (pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
    (event :initarg :event :type xcb:WINDOW)
    (window :initarg :window :type xcb:WINDOW)
    (from-configure :initarg :from-configure :type xcb:BOOL)
@@ -478,7 +503,9 @@
 
 (defclass xcb:MapNotify
   (xcb:-event)
-  ((pad~0 :initform 1 :type xcb:-pad)
+  ((~code :initform 19)
+   (pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
    (event :initarg :event :type xcb:WINDOW)
    (window :initarg :window :type xcb:WINDOW)
    (override-redirect :initarg :override-redirect :type xcb:BOOL)
@@ -486,13 +513,17 @@
 
 (defclass xcb:MapRequest
   (xcb:-event)
-  ((pad~0 :initform 1 :type xcb:-pad)
+  ((~code :initform 20)
+   (pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
    (parent :initarg :parent :type xcb:WINDOW)
    (window :initarg :window :type xcb:WINDOW)))
 
 (defclass xcb:ReparentNotify
   (xcb:-event)
-  ((pad~0 :initform 1 :type xcb:-pad)
+  ((~code :initform 21)
+   (pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
    (event :initarg :event :type xcb:WINDOW)
    (window :initarg :window :type xcb:WINDOW)
    (parent :initarg :parent :type xcb:WINDOW)
@@ -503,7 +534,9 @@
 
 (defclass xcb:ConfigureNotify
   (xcb:-event)
-  ((pad~0 :initform 1 :type xcb:-pad)
+  ((~code :initform 22)
+   (pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
    (event :initarg :event :type xcb:WINDOW)
    (window :initarg :window :type xcb:WINDOW)
    (above-sibling :initarg :above-sibling :type xcb:WINDOW)
@@ -517,7 +550,9 @@
 
 (defclass xcb:ConfigureRequest
   (xcb:-event)
-  ((stack-mode :initarg :stack-mode :type xcb:BYTE)
+  ((~code :initform 23)
+   (stack-mode :initarg :stack-mode :type xcb:BYTE)
+   (~sequence :type xcb:CARD16)
    (parent :initarg :parent :type xcb:WINDOW)
    (window :initarg :window :type xcb:WINDOW)
    (sibling :initarg :sibling :type xcb:WINDOW)
@@ -530,7 +565,9 @@
 
 (defclass xcb:GravityNotify
   (xcb:-event)
-  ((pad~0 :initform 1 :type xcb:-pad)
+  ((~code :initform 24)
+   (pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
    (event :initarg :event :type xcb:WINDOW)
    (window :initarg :window :type xcb:WINDOW)
    (x :initarg :x :type xcb:INT16)
@@ -538,7 +575,9 @@
 
 (defclass xcb:ResizeRequest
   (xcb:-event)
-  ((pad~0 :initform 1 :type xcb:-pad)
+  ((~code :initform 25)
+   (pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
    (window :initarg :window :type xcb:WINDOW)
    (width :initarg :width :type xcb:CARD16)
    (height :initarg :height :type xcb:CARD16)))
@@ -548,7 +587,9 @@
 
 (defclass xcb:CirculateNotify
   (xcb:-event)
-  ((pad~0 :initform 1 :type xcb:-pad)
+  ((~code :initform 26)
+   (pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
    (event :initarg :event :type xcb:WINDOW)
    (window :initarg :window :type xcb:WINDOW)
    (pad~1 :initform 4 :type xcb:-pad)
@@ -557,14 +598,16 @@
 
 (defclass xcb:CirculateRequest
   (xcb:-event xcb:CirculateNotify)
-  nil)
+  ((~code :initform 27)))
 
 (defconst xcb:Property:NewValue 0)
 (defconst xcb:Property:Delete 1)
 
 (defclass xcb:PropertyNotify
   (xcb:-event)
-  ((pad~0 :initform 1 :type xcb:-pad)
+  ((~code :initform 28)
+   (pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
    (window :initarg :window :type xcb:WINDOW)
    (atom :initarg :atom :type xcb:ATOM)
    (time :initarg :time :type xcb:TIMESTAMP)
@@ -573,7 +616,9 @@
 
 (defclass xcb:SelectionClear
   (xcb:-event)
-  ((pad~0 :initform 1 :type xcb:-pad)
+  ((~code :initform 29)
+   (pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
    (time :initarg :time :type xcb:TIMESTAMP)
    (owner :initarg :owner :type xcb:WINDOW)
    (selection :initarg :selection :type xcb:ATOM)))
@@ -653,7 +698,9 @@
 
 (defclass xcb:SelectionRequest
   (xcb:-event)
-  ((pad~0 :initform 1 :type xcb:-pad)
+  ((~code :initform 30)
+   (pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
    (time :initarg :time :type xcb:TIMESTAMP)
    (owner :initarg :owner :type xcb:WINDOW)
    (requestor :initarg :requestor :type xcb:WINDOW)
@@ -663,7 +710,9 @@
 
 (defclass xcb:SelectionNotify
   (xcb:-event)
-  ((pad~0 :initform 1 :type xcb:-pad)
+  ((~code :initform 31)
+   (pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
    (time :initarg :time :type xcb:TIMESTAMP)
    (requestor :initarg :requestor :type xcb:WINDOW)
    (selection :initarg :selection :type xcb:ATOM)
@@ -677,7 +726,9 @@
 
 (defclass xcb:ColormapNotify
   (xcb:-event)
-  ((pad~0 :initform 1 :type xcb:-pad)
+  ((~code :initform 32)
+   (pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
    (window :initarg :window :type xcb:WINDOW)
    (colormap :initarg :colormap :type xcb:COLORMAP)
    (new :initarg :new :type xcb:BOOL)
@@ -702,7 +753,9 @@
 
 (defclass xcb:ClientMessage
   (xcb:-event)
-  ((format :initarg :format :type xcb:CARD8)
+  ((~code :initform 33)
+   (format :initarg :format :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
    (window :initarg :window :type xcb:WINDOW)
    (type :initarg :type :type xcb:ATOM)
    (data :initarg :data :type xcb:ClientMessageData)))
@@ -713,92 +766,93 @@
 
 (defclass xcb:MappingNotify
   (xcb:-event)
-  ((pad~0 :initform 1 :type xcb:-pad)
+  ((~code :initform 34)
+   (pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
    (request :initarg :request :type xcb:BYTE)
    (first-keycode :initarg :first-keycode :type xcb:KEYCODE)
    (count :initarg :count :type xcb:CARD8)
    (pad~1 :initform 1 :type xcb:-pad)))
 
 (defclass xcb:GeGeneric
-  (xcb:-event)
-  ((extension :type xcb:CARD8)
-   (length :type xcb:CARD32)
-   (evtype :type xcb:CARD16)
-   (pad~0 :initform 22 :type xcb:-pad)))
+  (xcb:-generic-event)
+  ((pad~0 :initform 22 :type xcb:-pad)))
 
 (defclass xcb:Request
   (xcb:-error)
-  ((bad-value :initarg :bad-value :type xcb:CARD32)
+  ((~code :initform 1)
+   (bad-value :initarg :bad-value :type xcb:CARD32)
    (minor-opcode :initarg :minor-opcode :type xcb:CARD16)
    (major-opcode :initarg :major-opcode :type xcb:CARD8)
    (pad~0 :initform 1 :type xcb:-pad)))
 
 (defclass xcb:Value
   (xcb:-error)
-  ((bad-value :initarg :bad-value :type xcb:CARD32)
+  ((~code :initform 2)
+   (bad-value :initarg :bad-value :type xcb:CARD32)
    (minor-opcode :initarg :minor-opcode :type xcb:CARD16)
    (major-opcode :initarg :major-opcode :type xcb:CARD8)
    (pad~0 :initform 1 :type xcb:-pad)))
 
 (defclass xcb:Window
   (xcb:-error xcb:Value)
-  nil)
+  ((~code :initform 3)))
 
 (defclass xcb:Pixmap
   (xcb:-error xcb:Value)
-  nil)
+  ((~code :initform 4)))
 
 (defclass xcb:Atom
   (xcb:-error xcb:Value)
-  nil)
+  ((~code :initform 5)))
 
 (defclass xcb:Cursor
   (xcb:-error xcb:Value)
-  nil)
+  ((~code :initform 6)))
 
 (defclass xcb:Font
   (xcb:-error xcb:Value)
-  nil)
+  ((~code :initform 7)))
 
 (defclass xcb:Match
   (xcb:-error xcb:Request)
-  nil)
+  ((~code :initform 8)))
 
 (defclass xcb:Drawable
   (xcb:-error xcb:Value)
-  nil)
+  ((~code :initform 9)))
 
 (defclass xcb:Access
   (xcb:-error xcb:Request)
-  nil)
+  ((~code :initform 10)))
 
 (defclass xcb:Alloc
   (xcb:-error xcb:Request)
-  nil)
+  ((~code :initform 11)))
 
 (defclass xcb:Colormap
   (xcb:-error xcb:Value)
-  nil)
+  ((~code :initform 12)))
 
 (defclass xcb:GContext
   (xcb:-error xcb:Value)
-  nil)
+  ((~code :initform 13)))
 
 (defclass xcb:IDChoice
   (xcb:-error xcb:Value)
-  nil)
+  ((~code :initform 14)))
 
 (defclass xcb:Name
   (xcb:-error xcb:Request)
-  nil)
+  ((~code :initform 15)))
 
 (defclass xcb:Length
   (xcb:-error xcb:Request)
-  nil)
+  ((~code :initform 16)))
 
 (defclass xcb:Implementation
   (xcb:-error xcb:Request)
-  nil)
+  ((~code :initform 17)))
 
 (defconst xcb:WindowClass:CopyFromParent 0)
 (defconst xcb:WindowClass:InputOutput 1)
@@ -940,6 +994,8 @@
 (defclass xcb:GetWindowAttributes~reply
   (xcb:-reply)
   ((backing-store :initarg :backing-store :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (visual :initarg :visual :type xcb:VISUALID)
    (class :initarg :class :type xcb:CARD16)
    (bit-gravity :initarg :bit-gravity :type xcb:CARD8)
@@ -1068,6 +1124,8 @@
 (defclass xcb:GetGeometry~reply
   (xcb:-reply)
   ((depth :initarg :depth :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (root :initarg :root :type xcb:WINDOW)
    (x :initarg :x :type xcb:INT16)
    (y :initarg :y :type xcb:INT16)
@@ -1084,6 +1142,8 @@
 (defclass xcb:QueryTree~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (root :initarg :root :type xcb:WINDOW)
    (parent :initarg :parent :type xcb:WINDOW)
    (children-len :initarg :children-len :type xcb:CARD16)
@@ -1108,6 +1168,8 @@
 (defclass xcb:InternAtom~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (atom :initarg :atom :type xcb:ATOM)))
 
 (defclass xcb:GetAtomName
@@ -1118,6 +1180,8 @@
 (defclass xcb:GetAtomName~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (name-len :initarg :name-len :type xcb:CARD16)
    (pad~1 :initform 22 :type xcb:-pad)
    (name :initarg :name :type xcb:-ignore)
@@ -1171,6 +1235,8 @@
 (defclass xcb:GetProperty~reply
   (xcb:-reply)
   ((format :initarg :format :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (type :initarg :type :type xcb:ATOM)
    (bytes-after :initarg :bytes-after :type xcb:CARD32)
    (value-len :initarg :value-len :type xcb:CARD32)
@@ -1193,6 +1259,8 @@
 (defclass xcb:ListProperties~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (atoms-len :initarg :atoms-len :type xcb:CARD16)
    (pad~1 :initform 22 :type xcb:-pad)
    (atoms :initarg :atoms :type xcb:-ignore)
@@ -1217,6 +1285,8 @@
 (defclass xcb:GetSelectionOwner~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (owner :initarg :owner :type xcb:WINDOW)))
 
 (defclass xcb:ConvertSelection
@@ -1267,7 +1337,9 @@
    (time :initarg :time :type xcb:TIMESTAMP)))
 (defclass xcb:GrabPointer~reply
   (xcb:-reply)
-  ((status :initarg :status :type xcb:BYTE)))
+  ((status :initarg :status :type xcb:BYTE)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)))
 
 (defclass xcb:UngrabPointer
   (xcb:-request)
@@ -1324,7 +1396,9 @@
    (pad~0 :initform 2 :type xcb:-pad)))
 (defclass xcb:GrabKeyboard~reply
   (xcb:-reply)
-  ((status :initarg :status :type xcb:BYTE)))
+  ((status :initarg :status :type xcb:BYTE)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)))
 
 (defclass xcb:UngrabKeyboard
   (xcb:-request)
@@ -1384,6 +1458,8 @@
 (defclass xcb:QueryPointer~reply
   (xcb:-reply)
   ((same-screen :initarg :same-screen :type xcb:BOOL)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (root :initarg :root :type xcb:WINDOW)
    (child :initarg :child :type xcb:WINDOW)
    (root-x :initarg :root-x :type xcb:INT16)
@@ -1409,6 +1485,8 @@
 (defclass xcb:GetMotionEvents~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (events-len :initarg :events-len :type xcb:CARD32)
    (pad~1 :initform 20 :type xcb:-pad)
    (events :initarg :events :type xcb:-ignore)
@@ -1428,6 +1506,8 @@
 (defclass xcb:TranslateCoordinates~reply
   (xcb:-reply)
   ((same-screen :initarg :same-screen :type xcb:BOOL)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (child :initarg :child :type xcb:WINDOW)
    (dst-x :initarg :dst-x :type xcb:INT16)
    (dst-y :initarg :dst-y :type xcb:INT16)))
@@ -1463,6 +1543,8 @@
 (defclass xcb:GetInputFocus~reply
   (xcb:-reply)
   ((revert-to :initarg :revert-to :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (focus :initarg :focus :type xcb:WINDOW)))
 
 (defclass xcb:QueryKeymap
@@ -1471,6 +1553,8 @@
 (defclass xcb:QueryKeymap~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (keys :initarg :keys :type xcb:-ignore)
    (keys~ :initform
          '(name keys type xcb:CARD8 size 32)
@@ -1520,6 +1604,8 @@
 (defclass xcb:QueryFont~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (min-bounds :initarg :min-bounds :type xcb:CHARINFO)
    (pad~1 :initform 4 :type xcb:-pad)
    (max-bounds :initarg :max-bounds :type xcb:CHARINFO)
@@ -1569,6 +1655,8 @@
 (defclass xcb:QueryTextExtents~reply
   (xcb:-reply)
   ((draw-direction :initarg :draw-direction :type xcb:BYTE)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (font-ascent :initarg :font-ascent :type xcb:INT16)
    (font-descent :initarg :font-descent :type xcb:INT16)
    (overall-ascent :initarg :overall-ascent :type xcb:INT16)
@@ -1600,6 +1688,8 @@
 (defclass xcb:ListFonts~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (names-len :initarg :names-len :type xcb:CARD16)
    (pad~1 :initform 22 :type xcb:-pad)
    (names :initarg :names :type xcb:-ignore)
@@ -1622,6 +1712,8 @@
 (defclass xcb:ListFontsWithInfo~reply
   (xcb:-reply)
   ((name-len :initarg :name-len :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (min-bounds :initarg :min-bounds :type xcb:CHARINFO)
    (pad~0 :initform 4 :type xcb:-pad)
    (max-bounds :initarg :max-bounds :type xcb:CHARINFO)
@@ -1667,6 +1759,8 @@
 (defclass xcb:GetFontPath~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (path-len :initarg :path-len :type xcb:CARD16)
    (pad~1 :initform 22 :type xcb:-pad)
    (path :initarg :path :type xcb:-ignore)
@@ -2098,6 +2192,8 @@
 (defclass xcb:GetImage~reply
   (xcb:-reply)
   ((depth :initarg :depth :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (visual :initarg :visual :type xcb:VISUALID)
    (pad~0 :initform 20 :type xcb:-pad)
    (data :initarg :data :type xcb:-ignore)
@@ -2206,6 +2302,8 @@
 (defclass xcb:ListInstalledColormaps~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (cmaps-len :initarg :cmaps-len :type xcb:CARD16)
    (pad~1 :initform 22 :type xcb:-pad)
    (cmaps :initarg :cmaps :type xcb:-ignore)
@@ -2226,6 +2324,8 @@
 (defclass xcb:AllocColor~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (red :initarg :red :type xcb:CARD16)
    (green :initarg :green :type xcb:CARD16)
    (blue :initarg :blue :type xcb:CARD16)
@@ -2247,6 +2347,8 @@
 (defclass xcb:AllocNamedColor~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pixel :initarg :pixel :type xcb:CARD32)
    (exact-red :initarg :exact-red :type xcb:CARD16)
    (exact-green :initarg :exact-green :type xcb:CARD16)
@@ -2265,6 +2367,8 @@
 (defclass xcb:AllocColorCells~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pixels-len :initarg :pixels-len :type xcb:CARD16)
    (masks-len :initarg :masks-len :type xcb:CARD16)
    (pad~1 :initform 20 :type xcb:-pad)
@@ -2292,6 +2396,8 @@
 (defclass xcb:AllocColorPlanes~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pixels-len :initarg :pixels-len :type xcb:CARD16)
    (pad~1 :initform 2 :type xcb:-pad)
    (red-mask :initarg :red-mask :type xcb:CARD32)
@@ -2371,6 +2477,8 @@
 (defclass xcb:QueryColors~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (colors-len :initarg :colors-len :type xcb:CARD16)
    (pad~1 :initform 22 :type xcb:-pad)
    (colors :initarg :colors :type xcb:-ignore)
@@ -2394,6 +2502,8 @@
 (defclass xcb:LookupColor~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (exact-red :initarg :exact-red :type xcb:CARD16)
    (exact-green :initarg :exact-green :type xcb:CARD16)
    (exact-blue :initarg :exact-blue :type xcb:CARD16)
@@ -2469,6 +2579,8 @@
 (defclass xcb:QueryBestSize~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (width :initarg :width :type xcb:CARD16)
    (height :initarg :height :type xcb:CARD16)))
 
@@ -2486,6 +2598,8 @@
 (defclass xcb:QueryExtension~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (present :initarg :present :type xcb:BOOL)
    (major-opcode :initarg :major-opcode :type xcb:CARD8)
    (first-event :initarg :first-event :type xcb:CARD8)
@@ -2497,6 +2611,8 @@
 (defclass xcb:ListExtensions~reply
   (xcb:-reply)
   ((names-len :initarg :names-len :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~0 :initform 24 :type xcb:-pad)
    (names :initarg :names :type xcb:-ignore)
    (names~ :initform
@@ -2528,6 +2644,8 @@
 (defclass xcb:GetKeyboardMapping~reply
   (xcb:-reply)
   ((keysyms-per-keycode :initarg :keysyms-per-keycode :type xcb:BYTE)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~0 :initform 24 :type xcb:-pad)
    (keysyms :initarg :keysyms :type xcb:-ignore)
    (keysyms~ :initform
@@ -2584,6 +2702,8 @@
 (defclass xcb:GetKeyboardControl~reply
   (xcb:-reply)
   ((global-auto-repeat :initarg :global-auto-repeat :type xcb:BYTE)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (led-mask :initarg :led-mask :type xcb:CARD32)
    (key-click-percent :initarg :key-click-percent :type xcb:CARD8)
    (bell-percent :initarg :bell-percent :type xcb:CARD8)
@@ -2616,6 +2736,8 @@
 (defclass xcb:GetPointerControl~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (acceleration-numerator :initarg :acceleration-numerator :type xcb:CARD16)
    (acceleration-denominator :initarg :acceleration-denominator :type 
xcb:CARD16)
    (threshold :initarg :threshold :type xcb:CARD16)
@@ -2644,6 +2766,8 @@
 (defclass xcb:GetScreenSaver~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (timeout :initarg :timeout :type xcb:CARD16)
    (interval :initarg :interval :type xcb:CARD16)
    (prefer-blanking :initarg :prefer-blanking :type xcb:BYTE)
@@ -2690,6 +2814,8 @@
 (defclass xcb:ListHosts~reply
   (xcb:-reply)
   ((mode :initarg :mode :type xcb:BYTE)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (hosts-len :initarg :hosts-len :type xcb:CARD16)
    (pad~0 :initform 22 :type xcb:-pad)
    (hosts :initarg :hosts :type xcb:-ignore)
@@ -2759,7 +2885,9 @@
         :type xcb:-list)))
 (defclass xcb:SetPointerMapping~reply
   (xcb:-reply)
-  ((status :initarg :status :type xcb:BYTE)))
+  ((status :initarg :status :type xcb:BYTE)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)))
 
 (defclass xcb:GetPointerMapping
   (xcb:-request)
@@ -2767,6 +2895,8 @@
 (defclass xcb:GetPointerMapping~reply
   (xcb:-reply)
   ((map-len :initarg :map-len :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~0 :initform 24 :type xcb:-pad)
    (map :initarg :map :type xcb:-ignore)
    (map~ :initform
@@ -2796,7 +2926,9 @@
              :type xcb:-list)))
 (defclass xcb:SetModifierMapping~reply
   (xcb:-reply)
-  ((status :initarg :status :type xcb:BYTE)))
+  ((status :initarg :status :type xcb:BYTE)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)))
 
 (defclass xcb:GetModifierMapping
   (xcb:-request)
@@ -2804,6 +2936,8 @@
 (defclass xcb:GetModifierMapping~reply
   (xcb:-reply)
   ((keycodes-per-modifier :initarg :keycodes-per-modifier :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~0 :initform 24 :type xcb:-pad)
    (keycodes :initarg :keycodes :type xcb:-ignore)
    (keycodes~ :initform
diff --git a/xcb-xselinux.el b/xcb-xselinux.el
index 1bac30c..8cc80b2 100644
--- a/xcb-xselinux.el
+++ b/xcb-xselinux.el
@@ -41,6 +41,8 @@
 (defclass xcb:xselinux:QueryVersion~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (server-major :initarg :server-major :type xcb:CARD16)
    (server-minor :initarg :server-minor :type xcb:CARD16)))
 
@@ -60,6 +62,8 @@
 (defclass xcb:xselinux:GetDeviceCreateContext~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (context-len :initarg :context-len :type xcb:CARD32)
    (pad~1 :initform 20 :type xcb:-pad)
    (context :initarg :context :type xcb:-ignore)
@@ -86,6 +90,8 @@
 (defclass xcb:xselinux:GetDeviceContext~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (context-len :initarg :context-len :type xcb:CARD32)
    (pad~1 :initform 20 :type xcb:-pad)
    (context :initarg :context :type xcb:-ignore)
@@ -110,6 +116,8 @@
 (defclass xcb:xselinux:GetWindowCreateContext~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (context-len :initarg :context-len :type xcb:CARD32)
    (pad~1 :initform 20 :type xcb:-pad)
    (context :initarg :context :type xcb:-ignore)
@@ -125,6 +133,8 @@
 (defclass xcb:xselinux:GetWindowContext~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (context-len :initarg :context-len :type xcb:CARD32)
    (pad~1 :initform 20 :type xcb:-pad)
    (context :initarg :context :type xcb:-ignore)
@@ -167,6 +177,8 @@
 (defclass xcb:xselinux:GetPropertyCreateContext~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (context-len :initarg :context-len :type xcb:CARD32)
    (pad~1 :initform 20 :type xcb:-pad)
    (context :initarg :context :type xcb:-ignore)
@@ -191,6 +203,8 @@
 (defclass xcb:xselinux:GetPropertyUseContext~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (context-len :initarg :context-len :type xcb:CARD32)
    (pad~1 :initform 20 :type xcb:-pad)
    (context :initarg :context :type xcb:-ignore)
@@ -207,6 +221,8 @@
 (defclass xcb:xselinux:GetPropertyContext~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (context-len :initarg :context-len :type xcb:CARD32)
    (pad~1 :initform 20 :type xcb:-pad)
    (context :initarg :context :type xcb:-ignore)
@@ -223,6 +239,8 @@
 (defclass xcb:xselinux:GetPropertyDataContext~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (context-len :initarg :context-len :type xcb:CARD32)
    (pad~1 :initform 20 :type xcb:-pad)
    (context :initarg :context :type xcb:-ignore)
@@ -238,6 +256,8 @@
 (defclass xcb:xselinux:ListProperties~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (properties-len :initarg :properties-len :type xcb:CARD32)
    (pad~1 :initform 20 :type xcb:-pad)
    (properties :initarg :properties :type xcb:-ignore)
@@ -262,6 +282,8 @@
 (defclass xcb:xselinux:GetSelectionCreateContext~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (context-len :initarg :context-len :type xcb:CARD32)
    (pad~1 :initform 20 :type xcb:-pad)
    (context :initarg :context :type xcb:-ignore)
@@ -286,6 +308,8 @@
 (defclass xcb:xselinux:GetSelectionUseContext~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (context-len :initarg :context-len :type xcb:CARD32)
    (pad~1 :initform 20 :type xcb:-pad)
    (context :initarg :context :type xcb:-ignore)
@@ -301,6 +325,8 @@
 (defclass xcb:xselinux:GetSelectionContext~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (context-len :initarg :context-len :type xcb:CARD32)
    (pad~1 :initform 20 :type xcb:-pad)
    (context :initarg :context :type xcb:-ignore)
@@ -316,6 +342,8 @@
 (defclass xcb:xselinux:GetSelectionDataContext~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (context-len :initarg :context-len :type xcb:CARD32)
    (pad~1 :initform 20 :type xcb:-pad)
    (context :initarg :context :type xcb:-ignore)
@@ -330,6 +358,8 @@
 (defclass xcb:xselinux:ListSelections~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (selections-len :initarg :selections-len :type xcb:CARD32)
    (pad~1 :initform 20 :type xcb:-pad)
    (selections :initarg :selections :type xcb:-ignore)
@@ -345,6 +375,8 @@
 (defclass xcb:xselinux:GetClientContext~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (context-len :initarg :context-len :type xcb:CARD32)
    (pad~1 :initform 20 :type xcb:-pad)
    (context :initarg :context :type xcb:-ignore)
diff --git a/xcb-xtest.el b/xcb-xtest.el
index 19134fb..4a9f3ab 100644
--- a/xcb-xtest.el
+++ b/xcb-xtest.el
@@ -42,6 +42,8 @@
 (defclass xcb:xtest:GetVersion~reply
   (xcb:-reply)
   ((major-version :initarg :major-version :type xcb:CARD8)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (minor-version :initarg :minor-version :type xcb:CARD16)))
 
 (defconst xcb:xtest:Cursor:None 0)
@@ -54,7 +56,9 @@
    (cursor :initarg :cursor :type xcb:CURSOR)))
 (defclass xcb:xtest:CompareCursor~reply
   (xcb:-reply)
-  ((same :initarg :same :type xcb:BOOL)))
+  ((same :initarg :same :type xcb:BOOL)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)))
 
 (defclass xcb:xtest:FakeInput
   (xcb:-request)
diff --git a/xcb-xv.el b/xcb-xv.el
index 8a37682..f308b63 100644
--- a/xcb-xv.el
+++ b/xcb-xv.el
@@ -192,26 +192,30 @@
 
 (defclass xcb:xv:BadPort
   (xcb:-error)
-  nil)
+  ((~code :initform 0)))
 
 (defclass xcb:xv:BadEncoding
   (xcb:-error)
-  nil)
+  ((~code :initform 1)))
 
 (defclass xcb:xv:BadControl
   (xcb:-error)
-  nil)
+  ((~code :initform 2)))
 
 (defclass xcb:xv:VideoNotify
   (xcb:-event)
-  ((reason :initarg :reason :type xcb:BYTE)
+  ((~code :initform 0)
+   (reason :initarg :reason :type xcb:BYTE)
+   (~sequence :type xcb:CARD16)
    (time :initarg :time :type xcb:TIMESTAMP)
    (drawable :initarg :drawable :type xcb:DRAWABLE)
    (port :initarg :port :type xcb:xv:PORT)))
 
 (defclass xcb:xv:PortNotify
   (xcb:-event)
-  ((pad~0 :initform 1 :type xcb:-pad)
+  ((~code :initform 1)
+   (pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
    (time :initarg :time :type xcb:TIMESTAMP)
    (port :initarg :port :type xcb:xv:PORT)
    (attribute :initarg :attribute :type xcb:ATOM)
@@ -223,6 +227,8 @@
 (defclass xcb:xv:QueryExtension~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (major :initarg :major :type xcb:CARD16)
    (minor :initarg :minor :type xcb:CARD16)))
 
@@ -233,6 +239,8 @@
 (defclass xcb:xv:QueryAdaptors~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (num-adaptors :initarg :num-adaptors :type xcb:CARD16)
    (pad~1 :initform 22 :type xcb:-pad)
    (info :initarg :info :type xcb:-ignore)
@@ -248,6 +256,8 @@
 (defclass xcb:xv:QueryEncodings~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (num-encodings :initarg :num-encodings :type xcb:CARD16)
    (pad~1 :initform 22 :type xcb:-pad)
    (info :initarg :info :type xcb:-ignore)
@@ -263,7 +273,9 @@
    (time :initarg :time :type xcb:TIMESTAMP)))
 (defclass xcb:xv:GrabPort~reply
   (xcb:-reply)
-  ((result :initarg :result :type xcb:BYTE)))
+  ((result :initarg :result :type xcb:BYTE)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)))
 
 (defclass xcb:xv:UngrabPort
   (xcb:-request)
@@ -364,6 +376,8 @@
 (defclass xcb:xv:QueryBestSize~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (actual-width :initarg :actual-width :type xcb:CARD16)
    (actual-height :initarg :actual-height :type xcb:CARD16)))
 
@@ -382,6 +396,8 @@
 (defclass xcb:xv:GetPortAttribute~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (value :initarg :value :type xcb:INT32)))
 
 (defclass xcb:xv:QueryPortAttributes
@@ -391,6 +407,8 @@
 (defclass xcb:xv:QueryPortAttributes~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (num-attributes :initarg :num-attributes :type xcb:CARD32)
    (text-size :initarg :text-size :type xcb:CARD32)
    (pad~1 :initform 16 :type xcb:-pad)
@@ -407,6 +425,8 @@
 (defclass xcb:xv:ListImageFormats~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (num-formats :initarg :num-formats :type xcb:CARD32)
    (pad~1 :initform 20 :type xcb:-pad)
    (format :initarg :format :type xcb:-ignore)
@@ -425,6 +445,8 @@
 (defclass xcb:xv:QueryImageAttributes~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (num-planes :initarg :num-planes :type xcb:CARD32)
    (data-size :initarg :data-size :type xcb:CARD32)
    (width :initarg :width :type xcb:CARD16)
diff --git a/xcb-xvmc.el b/xcb-xvmc.el
index e3471c6..c616f6e 100644
--- a/xcb-xvmc.el
+++ b/xcb-xvmc.el
@@ -57,6 +57,8 @@
 (defclass xcb:xvmc:QueryVersion~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (major :initarg :major :type xcb:CARD32)
    (minor :initarg :minor :type xcb:CARD32)))
 
@@ -67,6 +69,8 @@
 (defclass xcb:xvmc:ListSurfaceTypes~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (num :initarg :num :type xcb:CARD32)
    (pad~1 :initform 20 :type xcb:-pad)
    (surfaces :initarg :surfaces :type xcb:-ignore)
@@ -87,6 +91,8 @@
 (defclass xcb:xvmc:CreateContext~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (width-actual :initarg :width-actual :type xcb:CARD16)
    (height-actual :initarg :height-actual :type xcb:CARD16)
    (flags-return :initarg :flags-return :type xcb:CARD32)
@@ -110,6 +116,8 @@
 (defclass xcb:xvmc:CreateSurface~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (pad~1 :initform 24 :type xcb:-pad)
    (priv-data :initarg :priv-data :type xcb:-ignore)
    (priv-data~ :initform
@@ -133,6 +141,8 @@
 (defclass xcb:xvmc:CreateSubpicture~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (width-actual :initarg :width-actual :type xcb:CARD16)
    (height-actual :initarg :height-actual :type xcb:CARD16)
    (num-palette-entries :initarg :num-palette-entries :type xcb:CARD16)
@@ -161,6 +171,8 @@
 (defclass xcb:xvmc:ListSubpictureTypes~reply
   (xcb:-reply)
   ((pad~0 :initform 1 :type xcb:-pad)
+   (~sequence :type xcb:CARD16)
+   (length :type xcb:CARD32)
    (num :initarg :num :type xcb:CARD32)
    (pad~1 :initform 20 :type xcb:-pad)
    (types :initarg :types :type xcb:-ignore)
diff --git a/xcb.el b/xcb.el
index 712d4c2..a0c601a 100644
--- a/xcb.el
+++ b/xcb.el
@@ -327,23 +327,43 @@ Concurrency is disabled as it breaks the orders of 
errors, replies and events."
                (setq cache (substring cache reply-length))
                (setf (slot-value connection 'reply-sequence) sequence)))
             (x                          ;event
-             (xcb:-log "Event received: %s" (substring cache 0 32))
-             (let (synthetic listener)
+             (let (synthetic listener event-length)
                (when (/= 0 (logand x #x80)) ;synthetic event
                  (setq synthetic t
                        x (logand x #x7f))) ;low 7 bits is the event number
-               (when (<= 64 x 127)
-                 ;; Extension event; add the second byte.
-                 (cl-incf x (aref cache 1)))
                (setq listener
                      (plist-get (slot-value connection 'event-plist) x))
+               (pcase listener
+                 (`xge
+                  (setq event-length (funcall (if xcb:lsb
+                                                  #'xcb:-unpack-u4-lsb
+                                                #'xcb:-unpack-u4)
+                                              cache 4))
+                  (when (< (length cache) event-length)
+                    ;; Too short.
+                    (throw 'break nil))
+                  (setq listener
+                        (lax-plist-get (slot-value connection 'event-plist)
+                                       (vector (aref cache 1)
+                                               (funcall
+                                                (if xcb:lsb
+                                                    #'xcb:-unpack-u2-lsb
+                                                  #'xcb:-unpack-u2)
+                                                cache 8)))))
+                 (`xkb
+                  (setq listener
+                        (lax-plist-get (slot-value connection 'event-plist)
+                                       (vector (aref cache 1))))))
                (when listener
                  (with-slots (event-queue) connection
                    (setf event-queue (nconc event-queue
                                             `([,listener
                                                ,(substring cache 0 32)
-                                               ,synthetic]))))))
-             (setq cache (substring cache 32))))))
+                                               ,synthetic])))))
+               (unless event-length
+                 (setq event-length 32))
+               (xcb:-log "Event received: %s" (substring cache 0 event-length))
+               (setq cache (substring cache event-length)))))))
       (setf (slot-value connection 'lock) nil))
     (unless (slot-value connection 'lock)
       (with-slots (message-cache) connection
@@ -391,15 +411,26 @@ Concurrency is disabled as it breaks the orders of 
errors, replies and events."
   (slot-value (xcb:get-setup obj) 'maximum-request-length))
 
 (cl-defmethod xcb:+event ((obj xcb:connection) event listener)
-  "attach EVENT LISTENER
+  "Attach function LISTENER to event EVENT.
 
 Note that event listeners attached this way are shared with the super- and sub-
 classes of EVENT (since they have the same event number)."
   (let* ((event-number (xcb:-error-or-event-class->number obj event))
          (plist (slot-value obj 'event-plist))
-         (listeners (plist-get plist event-number)))
+         key listeners)
+    (when (consp event-number)
+      (setq key (car event-number)
+            event-number (cdr event-number)
+            listeners (plist-get plist key))
+      ;; Add a placeholder.
+      (setf (slot-value obj 'event-plist)
+            (plist-put plist key
+                       (if (child-of-class-p event 'xcb:-generic-event)
+                           'xge 'xkb))))
+    (setq listeners (lax-plist-get plist event-number))
     (setf (slot-value obj 'event-plist)
-          (plist-put plist event-number (append listeners (list listener))))))
+          (lax-plist-put plist event-number (append listeners
+                                                    (list listener))))))
 
 (cl-defmethod xcb:flush ((obj xcb:connection))
   "Flush request data to X server."
@@ -588,14 +619,12 @@ Otherwise no error will ever be reported."
       (if multiple
           ;; Multiple replies
           (dolist (i (cdr reply-data))
-            (setq reply (make-instance class-name
-                                       :length (/ (- (length i) 32) 4)))
+            (setq reply (make-instance class-name))
             (xcb:unmarshal reply i)
             (setq replies (nconc replies (list reply))))
         ;; Single reply
         (setq reply-data (cadr reply-data)
-              replies (make-instance class-name
-                                     :length (/ (- (length reply-data) 32) 4)))
+              replies (make-instance class-name))
         (xcb:unmarshal replies reply-data)))
     (setq errors
           (mapcar (lambda (i)
@@ -695,32 +724,69 @@ Sync by sending a GetInputFocus request and waiting until 
it's processed."
     (cl-decf (slot-value obj 'event-lock))))
 
 (cl-defmethod xcb:-error-or-event-class->number ((obj xcb:connection) class)
-  "Return the error/event number of a error/event class CLASS."
+  "Return the error/event number of a error/event class CLASS.
+
+If CLASS is a generic event, return (XGE-CODE . [EXTENSION EVTYPE]);
+Or if it's an XKB event, return (XKB-EVENT-CODE [XKB-CODE])."
   (unless (symbolp class) (setq class (eieio-class-name class)))
-  (let* ((is-error (child-of-class-p class 'xcb:-error))
-         (prefix (replace-regexp-in-string ":[^:]+$" ":" (symbol-name class)))
-         (first (when (string= prefix "xcb:") 0))
-         (alist (intern-soft (concat prefix (if is-error
-                                                "error-number-class-alist"
-                                              "event-number-class-alist"))))
-         result parents)
-    (unless first
-      (setq first (cdr (assoc (intern (substring prefix 0 -1))
-                              (slot-value obj
-                                          (if is-error
-                                              'extension-first-error-alist
-                                            'extension-first-event-alist))))))
-    (when alist
-      (setq result (+ (or first 0) (car (rassoc class (symbol-value alist))))))
-    (if result
-        result
+  (let ((prefix (replace-regexp-in-string ":[^:]+$" ":" (symbol-name class)))
+        first-code alist result parents)
+    (cond
+     ((child-of-class-p class 'xcb:-error)
+      ;; Error.
+      (if (string= prefix "xcb:")
+          (setq first-code 0
+                alist xcb:error-number-class-alist)
+        (setq first-code
+              (cdr (assq (intern (substring prefix 0 -1))
+                         (slot-value obj
+                                     'extension-first-error-alist)))
+              alist (symbol-value
+                     (intern-soft (concat prefix
+                                          "error-number-class-alist")))))
+      (setq result (car (rassq class alist)))
+      (when result
+        (setq result (+ first-code result))))
+     ((child-of-class-p class 'xcb:-generic-event)
+      ;; Generic event.
+      (setq alist (symbol-value
+                   (intern-soft (concat prefix "xge-number-class-alist")))
+            result (plist-get (slot-value obj 'extension-opcode-plist) class))
+      ;; Ensure the extension has been initialized.
+      (when result
+        (setq result `(35 . [,result ,(cdr (rassq class alist))]))))
+     ((string= prefix "xcb:xkb:")
+      ;; XKB event.
+      (eval-and-compile (require 'xcb-xkb))
+      ;; XKB uses a single event code for all events.
+      (setq result (cdr (assq 'xcb:xkb
+                              (slot-value obj 'extension-first-event-alist))))
+      ;; Ensure the XKB extension has been initialized.
+      (when result
+        (setq alist xcb:xkb:event-number-class-alist
+              result `(,result . [,(car (rassq class alist))]))))
+     (t
+      ;; Other event.
+      (if (string= prefix "xcb:")
+          (setq first-code 0
+                alist xcb:event-number-class-alist)
+        (setq first-code
+              (cdr (assq (intern (substring prefix 0 -1))
+                         (slot-value obj 'extension-first-event-alist)))
+              alist (symbol-value
+                     (intern-soft (concat prefix
+                                          "event-number-class-alist")))))
+      (setq result (car (rassq class alist)))
+      (when result
+        (setq result (+ first-code result)))))
+    (unless result
       ;; Fallback to use the error/event number of one superclass. Thus if the
       ;; error/event number of a subclass differs from that of its parent, it
       ;; must be explicitly pointed out.
       (setq parents (eieio-class-parents class))
       (while (and parents (not result))
-        (setq result (xcb:-error-or-event-class->number obj (pop parents))))
-      result)))
+        (setq result (xcb:-error-or-event-class->number obj (pop parents)))))
+    result))
 
 (cl-defmethod xcb:-event-number->class ((obj xcb:connection) number)
   "Return the event class that has the event number NUMBER.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]