branch: externals/xelb commit c37b769c52156f34e729a7517cdaa21958c45073 Author: Chris Feng <chris.w.f...@gmail.com> Commit: Chris Feng <chris.w.f...@gmail.com>
Add support for <required_start_align> and drop implicit padding * el_client.el (xelb-parse-required_start_align): New function for parsing <required_start_align>. (xelb-parse-structure-content): Use it. (xelb-parse-list): Drop implicit padding after <list>. * xcb-types.el (xcb:-marshal-field, xcb:unmarshal, xcb:-unmarshal-field): Make adaptions for <required_start_align>. --- el_client.el | 23 +++++++++------- xcb-dri2.el | 2 -- xcb-dri3.el | 20 +++++++------- xcb-glx.el | 30 ++++++++++----------- xcb-present.el | 12 ++++++--- xcb-randr.el | 23 +--------------- xcb-record.el | 2 -- xcb-render.el | 8 ------ xcb-types.el | 50 +++++++++++++++++++++++----------- xcb-xf86dri.el | 1 - xcb-xf86vidmode.el | 8 ------ xcb-xfixes.el | 1 - xcb-xinput.el | 78 ++++++++++++++++++++++++++---------------------------- xcb-xkb.el | 30 ++++++--------------- xcb-xprint.el | 4 --- xcb-xproto.el | 4 --- xcb-xv.el | 3 --- 17 files changed, 128 insertions(+), 171 deletions(-) diff --git a/el_client.el b/el_client.el index dadcc39..9f1dc0c 100644 --- a/el_client.el +++ b/el_client.el @@ -513,12 +513,13 @@ The `combine-adjacent' attribute is simply ignored." "Parse a structure content node NODE." (pcase (xelb-node-name node) (`pad (xelb-parse-pad node)) + (`required_start_align (xelb-parse-required_start_align node)) (`field (xelb-parse-field node)) (`fd (xelb-parse-fd node)) (`list (xelb-parse-list node)) (`exprfield (xelb-parse-exprfield node)) (`switch (xelb-parse-switch node)) - ((or `comment `doc `required_start_align)) ;simply ignored + ((or `comment `doc)) ;simply ignored (x (error "Unsupported structure content: <%s>" x)))) ;; The car of the result shall be renamed to prevent duplication of slot names @@ -534,6 +535,17 @@ The `combine-adjacent' attribute is simply ignored." :initform ,(string-to-number align) :type xcb:-pad-align)) (error "Invalid <pad> field"))))) +(defun xelb-parse-required_start_align (node) + "Parse <required_start_align>." + (let ((align (xelb-node-attr node 'align)) + (offset (xelb-node-attr node 'offset))) + `((,(xelb-generate-pad-name) + :initform ,(if offset + (vector (string-to-number align) + (string-to-number offset)) + (string-to-number align)) + :type xcb:-pad-align)))) + (defun xelb-parse-field (node) "Parse <field>." (let* ((name (intern (xelb-node-attr-escape node 'name))) @@ -554,13 +566,7 @@ The `combine-adjacent' attribute is simply ignored." `((,name :initarg ,(intern (concat ":" (symbol-name name))) :type xcb:-ignore) (,name-alt :initform '(name ,name type ,type size ,size) - :type xcb:-list) - ;; Auto padding after variable-length list - ;; FIXME: according to the definition of `XCB_TYPE_PAD' in xcb.h, it does - ;; not always padding to 4 bytes. - ,@(when (and (xelb-node-attr node 'xelb-auto-padding) - (not (integerp size))) - `((,(xelb-generate-pad-name) :initform 4 :type xcb:-pad-align)))))) + :type xcb:-list)))) ;; The car of result is the field declaration, and the cadr is the expression ;; to be evaluated. @@ -606,7 +612,6 @@ The `combine-adjacent' attribute is simply ignored." (when (or (eq case-name 'bitcase) (eq case-name 'case)) (dolist (j (xelb-node-subnodes i t)) (pcase (xelb-node-name j) - (`required_start_align) (`enumref (setq condition (nconc condition diff --git a/xcb-dri2.el b/xcb-dri2.el index 21f3059..62c7619 100644 --- a/xcb-dri2.el +++ b/xcb-dri2.el @@ -96,7 +96,6 @@ '(name driver-name type xcb:char size (xcb:-fieldref 'driver-name-length)) :type xcb:-list) - (pad~2 :initform 4 :type xcb:-pad-align) (alignment-pad :initarg :alignment-pad :type xcb:-ignore) (alignment-pad~ :initform '(name alignment-pad type xcb:void size @@ -108,7 +107,6 @@ (lognot 3)) (xcb:-fieldref 'driver-name-length))) :type xcb:-list) - (pad~3 :initform 4 :type xcb:-pad-align) (device-name :initarg :device-name :type xcb:-ignore) (device-name~ :initform '(name device-name type xcb:char size diff --git a/xcb-dri3.el b/xcb-dri3.el index 6fd34f3..ad69b43 100644 --- a/xcb-dri3.el +++ b/xcb-dri3.el @@ -121,18 +121,18 @@ (pad~0 :initform 2 :type xcb:-pad))) (defclass xcb:dri3:GetSupportedModifiers~reply (xcb:-reply) - ((pad~0 :initform 1 :type xcb:-pad) + ((pad~0 :initform 8 :type xcb:-pad-align) (~sequence :type xcb:CARD16) (length :type xcb:CARD32) + (pad~1 :initform 1 :type xcb:-pad) (num-window-modifiers :initarg :num-window-modifiers :type xcb:CARD32) (num-screen-modifiers :initarg :num-screen-modifiers :type xcb:CARD32) - (pad~1 :initform 16 :type xcb:-pad) + (pad~2 :initform 16 :type xcb:-pad) (window-modifiers :initarg :window-modifiers :type xcb:-ignore) (window-modifiers~ :initform '(name window-modifiers type xcb:CARD64 size (xcb:-fieldref 'num-window-modifiers)) :type xcb:-list) - (pad~2 :initform 4 :type xcb:-pad-align) (screen-modifiers :initarg :screen-modifiers :type xcb:-ignore) (screen-modifiers~ :initform '(name screen-modifiers type xcb:CARD64 size @@ -142,10 +142,11 @@ (defclass xcb:dri3:PixmapFromBuffers (xcb:-request) ((~opcode :initform 7 :type xcb:-u1) + (pad~0 :initform 8 :type xcb:-pad-align) (pixmap :initarg :pixmap :type xcb:PIXMAP) (window :initarg :window :type xcb:WINDOW) (num-buffers :initarg :num-buffers :type xcb:CARD8) - (pad~0 :initform 3 :type xcb:-pad) + (pad~1 :initform 3 :type xcb:-pad) (width :initarg :width :type xcb:CARD16) (height :initarg :height :type xcb:CARD16) (stride0 :initarg :stride0 :type xcb:CARD32) @@ -158,7 +159,7 @@ (offset3 :initarg :offset3 :type xcb:CARD32) (depth :initarg :depth :type xcb:CARD8) (bpp :initarg :bpp :type xcb:CARD8) - (pad~1 :initform 2 :type xcb:-pad) + (pad~2 :initform 2 :type xcb:-pad) (modifier :initarg :modifier :type xcb:CARD64) (buffers :initarg :buffers :type xcb:-ignore) (buffers~ :initform @@ -172,28 +173,27 @@ (pixmap :initarg :pixmap :type xcb:PIXMAP))) (defclass xcb:dri3:BuffersFromPixmap~reply (xcb:-reply) - ((nfd :initarg :nfd :type xcb:CARD8) + ((pad~0 :initform 8 :type xcb:-pad-align) (~sequence :type xcb:CARD16) (length :type xcb:CARD32) + (nfd :initarg :nfd :type xcb:CARD8) (width :initarg :width :type xcb:CARD16) (height :initarg :height :type xcb:CARD16) - (pad~0 :initform 4 :type xcb:-pad) + (pad~1 :initform 4 :type xcb:-pad) (modifier :initarg :modifier :type xcb:CARD64) (depth :initarg :depth :type xcb:CARD8) (bpp :initarg :bpp :type xcb:CARD8) - (pad~1 :initform 6 :type xcb:-pad) + (pad~2 :initform 6 :type xcb:-pad) (strides :initarg :strides :type xcb:-ignore) (strides~ :initform '(name strides type xcb:CARD32 size (xcb:-fieldref 'nfd)) :type xcb:-list) - (pad~2 :initform 4 :type xcb:-pad-align) (offsets :initarg :offsets :type xcb:-ignore) (offsets~ :initform '(name offsets type xcb:CARD32 size (xcb:-fieldref 'nfd)) :type xcb:-list) - (pad~3 :initform 4 :type xcb:-pad-align) (buffers :initarg :buffers :type xcb:-ignore) (buffers~ :initform '(name buffers type xcb:fd size diff --git a/xcb-glx.el b/xcb-glx.el index d1e9309..c6348b3 100644 --- a/xcb-glx.el +++ b/xcb-glx.el @@ -570,13 +570,11 @@ (xcb:-fieldref 'num-versions) 2)) :type xcb:-list) - (pad~0 :initform 4 :type xcb:-pad-align) (gl-extension-string :initarg :gl-extension-string :type xcb:-ignore) (gl-extension-string~ :initform '(name gl-extension-string type xcb:char size (xcb:-fieldref 'gl-str-len)) :type xcb:-list) - (pad~1 :initform 4 :type xcb:-pad-align) (glx-extension-string :initarg :glx-extension-string :type xcb:-ignore) (glx-extension-string~ :initform '(name glx-extension-string type xcb:char size @@ -616,13 +614,11 @@ (xcb:-fieldref 'num-versions) 3)) :type xcb:-list) - (pad~0 :initform 4 :type xcb:-pad-align) (gl-extension-string :initarg :gl-extension-string :type xcb:-ignore) (gl-extension-string~ :initform '(name gl-extension-string type xcb:char size (xcb:-fieldref 'gl-str-len)) :type xcb:-list) - (pad~1 :initform 4 :type xcb:-pad-align) (glx-extension-string :initarg :glx-extension-string :type xcb:-ignore) (glx-extension-string~ :initform '(name glx-extension-string type xcb:char size @@ -774,10 +770,11 @@ (plane :initarg :plane :type xcb:INT32))) (defclass xcb:glx:GetClipPlane~reply (xcb:-reply) - ((pad~0 :initform 1 :type xcb:-pad) + ((pad~0 :initform 8 :type xcb:-pad-align) (~sequence :type xcb:CARD16) (length :type xcb:CARD32) - (pad~1 :initform 24 :type xcb:-pad) + (pad~1 :initform 1 :type xcb:-pad) + (pad~2 :initform 24 :type xcb:-pad) (data :initarg :data :type xcb:-ignore) (data~ :initform '(name data type xcb:glx:FLOAT64 size @@ -793,13 +790,14 @@ (pname :initarg :pname :type xcb:CARD32))) (defclass xcb:glx:GetDoublev~reply (xcb:-reply) - ((pad~0 :initform 1 :type xcb:-pad) + ((pad~0 :initform 8 :type xcb:-pad-align) (~sequence :type xcb:CARD16) (length :type xcb:CARD32) - (pad~1 :initform 4 :type xcb:-pad) + (pad~1 :initform 1 :type xcb:-pad) + (pad~2 :initform 4 :type xcb:-pad) (n :initarg :n :type xcb:CARD32) (datum :initarg :datum :type xcb:glx:FLOAT64) - (pad~2 :initform 8 :type xcb:-pad) + (pad~3 :initform 8 :type xcb:-pad) (data :initarg :data :type xcb:-ignore) (data~ :initform '(name data type xcb:glx:FLOAT64 size @@ -907,13 +905,14 @@ (query :initarg :query :type xcb:CARD32))) (defclass xcb:glx:GetMapdv~reply (xcb:-reply) - ((pad~0 :initform 1 :type xcb:-pad) + ((pad~0 :initform 8 :type xcb:-pad-align) (~sequence :type xcb:CARD16) (length :type xcb:CARD32) - (pad~1 :initform 4 :type xcb:-pad) + (pad~1 :initform 1 :type xcb:-pad) + (pad~2 :initform 4 :type xcb:-pad) (n :initarg :n :type xcb:CARD32) (datum :initarg :datum :type xcb:glx:FLOAT64) - (pad~2 :initform 8 :type xcb:-pad) + (pad~3 :initform 8 :type xcb:-pad) (data :initarg :data :type xcb:-ignore) (data~ :initform '(name data type xcb:glx:FLOAT64 size @@ -1152,13 +1151,14 @@ (pname :initarg :pname :type xcb:CARD32))) (defclass xcb:glx:GetTexGendv~reply (xcb:-reply) - ((pad~0 :initform 1 :type xcb:-pad) + ((pad~0 :initform 8 :type xcb:-pad-align) (~sequence :type xcb:CARD16) (length :type xcb:CARD32) - (pad~1 :initform 4 :type xcb:-pad) + (pad~1 :initform 1 :type xcb:-pad) + (pad~2 :initform 4 :type xcb:-pad) (n :initarg :n :type xcb:CARD32) (datum :initarg :datum :type xcb:glx:FLOAT64) - (pad~2 :initform 8 :type xcb:-pad) + (pad~3 :initform 8 :type xcb:-pad) (data :initarg :data :type xcb:-ignore) (data~ :initform '(name data type xcb:glx:FLOAT64 size diff --git a/xcb-present.el b/xcb-present.el index 92472b5..0425dbe 100644 --- a/xcb-present.el +++ b/xcb-present.el @@ -90,6 +90,7 @@ (defclass xcb:present:Pixmap (xcb:-request) ((~opcode :initform 1 :type xcb:-u1) + (pad~0 :initform 8 :type xcb:-pad-align) (window :initarg :window :type xcb:WINDOW) (pixmap :initarg :pixmap :type xcb:PIXMAP) (serial :initarg :serial :type xcb:CARD32) @@ -101,7 +102,7 @@ (wait-fence :initarg :wait-fence :type xcb:sync:FENCE) (idle-fence :initarg :idle-fence :type xcb:sync:FENCE) (options :initarg :options :type xcb:CARD32) - (pad~0 :initform 4 :type xcb:-pad) + (pad~1 :initform 4 :type xcb:-pad) (target-msc :initarg :target-msc :type xcb:CARD64) (divisor :initarg :divisor :type xcb:CARD64) (remainder :initarg :remainder :type xcb:CARD64) @@ -113,9 +114,10 @@ (defclass xcb:present:NotifyMSC (xcb:-request) ((~opcode :initform 2 :type xcb:-u1) + (pad~0 :initform 8 :type xcb:-pad-align) (window :initarg :window :type xcb:WINDOW) (serial :initarg :serial :type xcb:CARD32) - (pad~0 :initform 4 :type xcb:-pad) + (pad~1 :initform 4 :type xcb:-pad) (target-msc :initarg :target-msc :type xcb:CARD64) (divisor :initarg :divisor :type xcb:CARD64) (remainder :initarg :remainder :type xcb:CARD64))) @@ -169,6 +171,7 @@ (defclass xcb:present:CompleteNotify (xcb:-generic-event) ((~evtype :initform 1) + (pad~0 :initform 8 :type xcb:-pad-align) (kind :initarg :kind :type xcb:CARD8) (mode :initarg :mode :type xcb:CARD8) (event :initarg :event :type xcb:present:EVENT) @@ -190,8 +193,9 @@ (defclass xcb:present:RedirectNotify (xcb:-generic-event) ((~evtype :initform 3) + (pad~0 :initform 8 :type xcb:-pad-align) (update-window :initarg :update-window :type xcb:BOOL) - (pad~0 :initform 1 :type xcb:-pad) + (pad~1 :initform 1 :type xcb:-pad) (event :initarg :event :type xcb:present:EVENT) (event-window :initarg :event-window :type xcb:WINDOW) (window :initarg :window :type xcb:WINDOW) @@ -207,7 +211,7 @@ (wait-fence :initarg :wait-fence :type xcb:sync:FENCE) (idle-fence :initarg :idle-fence :type xcb:sync:FENCE) (options :initarg :options :type xcb:CARD32) - (pad~1 :initform 4 :type xcb:-pad) + (pad~2 :initform 4 :type xcb:-pad) (target-msc :initarg :target-msc :type xcb:CARD64) (divisor :initarg :divisor :type xcb:CARD64) (remainder :initarg :remainder :type xcb:CARD64) diff --git a/xcb-randr.el b/xcb-randr.el index 9cbc8b9..81ea15e 100644 --- a/xcb-randr.el +++ b/xcb-randr.el @@ -163,7 +163,6 @@ '(name sizes type xcb:randr:ScreenSize size (xcb:-fieldref 'nSizes)) :type xcb:-list) - (pad~1 :initform 4 :type xcb:-pad-align) (rates :initarg :rates :type xcb:-ignore) (rates~ :initform '(name rates type xcb:randr:RefreshRates size @@ -248,19 +247,16 @@ '(name crtcs type xcb:randr:CRTC size (xcb:-fieldref 'num-crtcs)) :type xcb:-list) - (pad~2 :initform 4 :type xcb:-pad-align) (outputs :initarg :outputs :type xcb:-ignore) (outputs~ :initform '(name outputs type xcb:randr:OUTPUT size (xcb:-fieldref 'num-outputs)) :type xcb:-list) - (pad~3 :initform 4 :type xcb:-pad-align) (modes :initarg :modes :type xcb:-ignore) (modes~ :initform '(name modes type xcb:randr:ModeInfo size (xcb:-fieldref 'num-modes)) :type xcb:-list) - (pad~4 :initform 4 :type xcb:-pad-align) (names :initarg :names :type xcb:-ignore) (names~ :initform '(name names type xcb:BYTE size @@ -297,19 +293,16 @@ '(name crtcs type xcb:randr:CRTC size (xcb:-fieldref 'num-crtcs)) :type xcb:-list) - (pad~0 :initform 4 :type xcb:-pad-align) (modes :initarg :modes :type xcb:-ignore) (modes~ :initform '(name modes type xcb:randr:MODE size (xcb:-fieldref 'num-modes)) :type xcb:-list) - (pad~1 :initform 4 :type xcb:-pad-align) (clones :initarg :clones :type xcb:-ignore) (clones~ :initform '(name clones type xcb:randr:OUTPUT size (xcb:-fieldref 'num-clones)) :type xcb:-list) - (pad~2 :initform 4 :type xcb:-pad-align) (name :initarg :name :type xcb:-ignore) (name~ :initform '(name name type xcb:BYTE size @@ -481,7 +474,6 @@ '(name outputs type xcb:randr:OUTPUT size (xcb:-fieldref 'num-outputs)) :type xcb:-list) - (pad~0 :initform 4 :type xcb:-pad-align) (possible :initarg :possible :type xcb:-ignore) (possible~ :initform '(name possible type xcb:randr:OUTPUT size @@ -539,13 +531,11 @@ '(name red type xcb:CARD16 size (xcb:-fieldref 'size)) :type xcb:-list) - (pad~2 :initform 4 :type xcb:-pad-align) (green :initarg :green :type xcb:-ignore) (green~ :initform '(name green type xcb:CARD16 size (xcb:-fieldref 'size)) :type xcb:-list) - (pad~3 :initform 4 :type xcb:-pad-align) (blue :initarg :blue :type xcb:-ignore) (blue~ :initform '(name blue type xcb:CARD16 size @@ -563,13 +553,11 @@ '(name red type xcb:CARD16 size (xcb:-fieldref 'size)) :type xcb:-list) - (pad~1 :initform 4 :type xcb:-pad-align) (green :initarg :green :type xcb:-ignore) (green~ :initform '(name green type xcb:CARD16 size (xcb:-fieldref 'size)) :type xcb:-list) - (pad~2 :initform 4 :type xcb:-pad-align) (blue :initarg :blue :type xcb:-ignore) (blue~ :initform '(name blue type xcb:CARD16 size @@ -597,19 +585,16 @@ '(name crtcs type xcb:randr:CRTC size (xcb:-fieldref 'num-crtcs)) :type xcb:-list) - (pad~2 :initform 4 :type xcb:-pad-align) (outputs :initarg :outputs :type xcb:-ignore) (outputs~ :initform '(name outputs type xcb:randr:OUTPUT size (xcb:-fieldref 'num-outputs)) :type xcb:-list) - (pad~3 :initform 4 :type xcb:-pad-align) (modes :initarg :modes :type xcb:-ignore) (modes~ :initform '(name modes type xcb:randr:ModeInfo size (xcb:-fieldref 'num-modes)) :type xcb:-list) - (pad~4 :initform 4 :type xcb:-pad-align) (names :initarg :names :type xcb:-ignore) (names~ :initform '(name names type xcb:BYTE size @@ -668,13 +653,12 @@ '(name pending-params type xcb:render:FIXED size (xcb:-fieldref 'pending-nparams)) :type xcb:-list) - (pad~4 :initform 4 :type xcb:-pad-align) (current-filter-name :initarg :current-filter-name :type xcb:-ignore) (current-filter-name~ :initform '(name current-filter-name type xcb:char size (xcb:-fieldref 'current-len)) :type xcb:-list) - (pad~5 :initform 4 :type xcb:-pad-align) + (pad~4 :initform 4 :type xcb:-pad-align) (current-params :initarg :current-params :type xcb:-ignore) (current-params~ :initform '(name current-params type xcb:render:FIXED size @@ -790,25 +774,21 @@ '(name crtcs type xcb:randr:CRTC size (xcb:-fieldref 'num-crtcs)) :type xcb:-list) - (pad~1 :initform 4 :type xcb:-pad-align) (outputs :initarg :outputs :type xcb:-ignore) (outputs~ :initform '(name outputs type xcb:randr:OUTPUT size (xcb:-fieldref 'num-outputs)) :type xcb:-list) - (pad~2 :initform 4 :type xcb:-pad-align) (associated-providers :initarg :associated-providers :type xcb:-ignore) (associated-providers~ :initform '(name associated-providers type xcb:randr:PROVIDER size (xcb:-fieldref 'num-associated-providers)) :type xcb:-list) - (pad~3 :initform 4 :type xcb:-pad-align) (associated-capability :initarg :associated-capability :type xcb:-ignore) (associated-capability~ :initform '(name associated-capability type xcb:CARD32 size (xcb:-fieldref 'num-associated-providers)) :type xcb:-list) - (pad~4 :initform 4 :type xcb:-pad-align) (name :initarg :name :type xcb:-ignore) (name~ :initform '(name name type xcb:char size @@ -1077,7 +1057,6 @@ '(name crtcs type xcb:randr:CRTC size (xcb:-fieldref 'num-crtcs)) :type xcb:-list) - (pad~0 :initform 4 :type xcb:-pad-align) (outputs :initarg :outputs :type xcb:-ignore) (outputs~ :initform '(name outputs type xcb:randr:OUTPUT size diff --git a/xcb-record.el b/xcb-record.el index 0308c8f..3996ae6 100644 --- a/xcb-record.el +++ b/xcb-record.el @@ -113,7 +113,6 @@ '(name client-specs type xcb:record:ClientSpec size (xcb:-fieldref 'num-client-specs)) :type xcb:-list) - (pad~1 :initform 4 :type xcb:-pad-align) (ranges :initarg :ranges :type xcb:-ignore) (ranges~ :initform '(name ranges type xcb:record:Range size @@ -133,7 +132,6 @@ '(name client-specs type xcb:record:ClientSpec size (xcb:-fieldref 'num-client-specs)) :type xcb:-list) - (pad~1 :initform 4 :type xcb:-pad-align) (ranges :initarg :ranges :type xcb:-ignore) (ranges~ :initform '(name ranges type xcb:record:Range size diff --git a/xcb-render.el b/xcb-render.el index 21095c7..423f6cd 100644 --- a/xcb-render.el +++ b/xcb-render.el @@ -281,13 +281,11 @@ '(name formats type xcb:render:PICTFORMINFO size (xcb:-fieldref 'num-formats)) :type xcb:-list) - (pad~2 :initform 4 :type xcb:-pad-align) (screens :initarg :screens :type xcb:-ignore) (screens~ :initform '(name screens type xcb:render:PICTSCREEN size (xcb:-fieldref 'num-screens)) :type xcb:-list) - (pad~3 :initform 4 :type xcb:-pad-align) (subpixels :initarg :subpixels :type xcb:-ignore) (subpixels~ :initform '(name subpixels type xcb:CARD32 size @@ -507,13 +505,11 @@ '(name glyphids type xcb:CARD32 size (xcb:-fieldref 'glyphs-len)) :type xcb:-list) - (pad~0 :initform 4 :type xcb:-pad-align) (glyphs :initarg :glyphs :type xcb:-ignore) (glyphs~ :initform '(name glyphs type xcb:render:GLYPHINFO size (xcb:-fieldref 'glyphs-len)) :type xcb:-list) - (pad~1 :initform 4 :type xcb:-pad-align) (data :initarg :data :type xcb:-ignore) (data~ :initform '(name data type xcb:BYTE size nil) @@ -631,7 +627,6 @@ '(name aliases type xcb:CARD16 size (xcb:-fieldref 'num-aliases)) :type xcb:-list) - (pad~2 :initform 4 :type xcb:-pad-align) (filters :initarg :filters :type xcb:-ignore) (filters~ :initform '(name filters type xcb:STR size @@ -709,7 +704,6 @@ '(name stops type xcb:render:FIXED size (xcb:-fieldref 'num-stops)) :type xcb:-list) - (pad~0 :initform 4 :type xcb:-pad-align) (colors :initarg :colors :type xcb:-ignore) (colors~ :initform '(name colors type xcb:render:COLOR size @@ -730,7 +724,6 @@ '(name stops type xcb:render:FIXED size (xcb:-fieldref 'num-stops)) :type xcb:-list) - (pad~0 :initform 4 :type xcb:-pad-align) (colors :initarg :colors :type xcb:-ignore) (colors~ :initform '(name colors type xcb:render:COLOR size @@ -749,7 +742,6 @@ '(name stops type xcb:render:FIXED size (xcb:-fieldref 'num-stops)) :type xcb:-list) - (pad~0 :initform 4 :type xcb:-pad-align) (colors :initarg :colors :type xcb:-ignore) (colors~ :initform '(name colors type xcb:render:COLOR size diff --git a/xcb-types.el b/xcb-types.el index 0c172b6..6e3547d 100644 --- a/xcb-types.el +++ b/xcb-types.el @@ -492,10 +492,14 @@ The optional POS argument indicates current byte index of the field (used by (setq value (eval value `((obj . ,obj))))) (make-vector value 0)) (`xcb:-pad-align - (unless (integerp value) - (setq value (eval value `((obj . ,obj))))) ;; The length slot in xcb:-request is left out (let ((len (if (object-of-class-p obj 'xcb:-request) (+ pos 2) pos))) + (when (vectorp value) + ;; Alignment with offset. + (setq len (- len (aref value 1)) + value (aref value 0))) + (unless (integerp value) + (setq value (eval value `((obj . ,obj))))) (make-vector (% (- value (% len value)) value) 0))) (`xcb:-list (let* ((list-name (plist-get value 'name)) @@ -546,10 +550,13 @@ The optional POS argument indicates current byte index of the field (used by (xcb:marshal value)) (x (error "[XCB] Unsupported type for marshalling: %s" x)))) -(cl-defmethod xcb:unmarshal ((obj xcb:-struct) byte-array &optional ctx) +(cl-defmethod xcb:unmarshal ((obj xcb:-struct) byte-array &optional ctx + total-length) "Fill in fields of struct OBJ according to its byte-array representation. The optional argument CTX is for <paramref>." + (unless total-length + (setq total-length (length byte-array))) (let ((slots (eieio-class-slots (eieio-object-class obj))) (result 0) slot-name tmp type) @@ -560,14 +567,14 @@ The optional argument CTX is for <paramref>." tmp (xcb:-unmarshal-field obj type byte-array 0 (when (slot-boundp obj slot-name) (eieio-oref-default obj slot-name)) - ctx)) + ctx total-length)) (setf (slot-value obj slot-name) (car tmp)) (setq byte-array (substring byte-array (cadr tmp))) (setq result (+ result (cadr tmp))))) result)) (cl-defmethod xcb:-unmarshal-field ((obj xcb:-struct) type data offset - initform &optional ctx) + initform &optional ctx total-length) "Return the value of a field in struct OBJ of type TYPE, byte-array representation DATA, and default value INITFORM. @@ -606,12 +613,17 @@ and the second the consumed length." (setq initform (cadr initform))) (setq initform (eval initform `((obj . ,obj) (ctx . ,ctx))))) (list initform initform)) - (`xcb:-pad-align ;assume the whole data is aligned - (unless (integerp initform) - (when (eq 'quote (car initform)) - (setq initform (cadr initform))) - (setq initform (eval initform `((obj . ,obj) (ctx . ,ctx))))) - (list initform (% (- (length data) offset) initform))) + (`xcb:-pad-align + (let ((len (- total-length (- (length data) offset)))) + (if (vectorp initform) + ;; Alignment with offset. + (setq len (- len (aref initform 1)) + initform (aref initform 0)) + (unless (integerp initform) + (when (eq 'quote (car initform)) + (setq initform (cadr initform))) + (setq initform (eval initform `((obj . ,obj) (ctx . ,ctx)))))) + (list initform (% (- initform (% len initform)) initform)))) (`xcb:-list (when (eq 'quote (car initform)) ;unquote the form (setq initform (cadr initform))) @@ -637,7 +649,8 @@ and the second the consumed length." (let ((count 0) result tmp) (dotimes (_ list-size) - (setq tmp (xcb:-unmarshal-field obj x data (+ offset count) nil)) + (setq tmp (xcb:-unmarshal-field obj x data (+ offset count) nil + nil total-length)) (setq result (nconc result (list (car tmp)))) (setq count (+ count (cadr tmp)))) (setf (slot-value obj list-name) result) @@ -672,14 +685,16 @@ and the second the consumed length." (throw 'break nil)))) (unless (eq slot-type 'xcb:-ignore) (setq tmp (xcb:-unmarshal-field obj slot-type data offset - (eieio-oref-default obj name))) + (eieio-oref-default obj name) + nil total-length)) (setf (slot-value obj name) (car tmp)) (setq count (+ count (cadr tmp))) (setq data (substring data (cadr tmp))))))) (list initform count))) ((and x (guard (child-of-class-p x 'xcb:-struct))) (let* ((struct-obj (make-instance x)) - (tmp (xcb:unmarshal struct-obj (substring data offset) obj))) + (tmp (xcb:unmarshal struct-obj (substring data offset) obj + total-length))) (list struct-obj tmp))) (x (error "[XCB] Unsupported type for unmarshalling: %s" x)))) @@ -771,10 +786,13 @@ This result is converted from the first bounded slot." (setq result (vconcat result (make-vector (- size (length result)) 0)))) result)) ;; -(cl-defmethod xcb:unmarshal ((obj xcb:-union) byte-array &optional ctx) +(cl-defmethod xcb:unmarshal ((obj xcb:-union) byte-array &optional ctx + total-length) "Fill in every field in union OBJ, according to BYTE-ARRAY. The optional argument CTX is for <paramref>." + (unless total-length + (setq total-length (length byte-array))) (let ((slots (eieio-class-slots (eieio-object-class obj))) slot-name tmp type) (dolist (slot slots) @@ -784,7 +802,7 @@ The optional argument CTX is for <paramref>." tmp (xcb:-unmarshal-field obj type byte-array 0 (when (slot-boundp obj slot-name) (eieio-oref-default obj slot-name)) - ctx)) + ctx total-length)) (setf (slot-value obj (eieio-slot-descriptor-name slot)) (car tmp)))) (slot-value obj '~size))) diff --git a/xcb-xf86dri.el b/xcb-xf86dri.el index ee2c366..b007010 100644 --- a/xcb-xf86dri.el +++ b/xcb-xf86dri.el @@ -167,7 +167,6 @@ '(name clip-rects type xcb:xf86dri:DrmClipRect size (xcb:-fieldref 'num-clip-rects)) :type xcb:-list) - (pad~1 :initform 4 :type xcb:-pad-align) (back-clip-rects :initarg :back-clip-rects :type xcb:-ignore) (back-clip-rects~ :initform '(name back-clip-rects type xcb:xf86dri:DrmClipRect size diff --git a/xcb-xf86vidmode.el b/xcb-xf86vidmode.el index 60618e9..d429888 100644 --- a/xcb-xf86vidmode.el +++ b/xcb-xf86vidmode.el @@ -161,19 +161,16 @@ '(name hsync type xcb:xf86vidmode:SYNCRANGE size (xcb:-fieldref 'num-hsync)) :type xcb:-list) - (pad~2 :initform 4 :type xcb:-pad-align) (vsync :initarg :vsync :type xcb:-ignore) (vsync~ :initform '(name vsync type xcb:xf86vidmode:SYNCRANGE size (xcb:-fieldref 'num-vsync)) :type xcb:-list) - (pad~3 :initform 4 :type xcb:-pad-align) (vendor :initarg :vendor :type xcb:-ignore) (vendor~ :initform '(name vendor type xcb:char size (xcb:-fieldref 'vendor-length)) :type xcb:-list) - (pad~4 :initform 4 :type xcb:-pad-align) (alignment-pad :initarg :alignment-pad :type xcb:-ignore) (alignment-pad~ :initform '(name alignment-pad type xcb:void size @@ -185,7 +182,6 @@ (lognot 3)) (xcb:-fieldref 'vendor-length))) :type xcb:-list) - (pad~5 :initform 4 :type xcb:-pad-align) (model :initarg :model :type xcb:-ignore) (model~ :initform '(name model type xcb:char size @@ -431,7 +427,6 @@ 1) (lognot 1))) :type xcb:-list) - (pad~2 :initform 4 :type xcb:-pad-align) (green :initarg :green :type xcb:-ignore) (green~ :initform '(name green type xcb:CARD16 size @@ -441,7 +436,6 @@ 1) (lognot 1))) :type xcb:-list) - (pad~3 :initform 4 :type xcb:-pad-align) (blue :initarg :blue :type xcb:-ignore) (blue~ :initform '(name blue type xcb:CARD16 size @@ -466,7 +460,6 @@ 1) (lognot 1))) :type xcb:-list) - (pad~0 :initform 4 :type xcb:-pad-align) (green :initarg :green :type xcb:-ignore) (green~ :initform '(name green type xcb:CARD16 size @@ -476,7 +469,6 @@ 1) (lognot 1))) :type xcb:-list) - (pad~1 :initform 4 :type xcb:-pad-align) (blue :initarg :blue :type xcb:-ignore) (blue~ :initform '(name blue type xcb:CARD16 size diff --git a/xcb-xfixes.el b/xcb-xfixes.el index 7973d0b..db2b25a 100644 --- a/xcb-xfixes.el +++ b/xcb-xfixes.el @@ -345,7 +345,6 @@ (xcb:-fieldref 'width) (xcb:-fieldref 'height))) :type xcb:-list) - (pad~2 :initform 4 :type xcb:-pad-align) (name :initarg :name :type xcb:-ignore) (name~ :initform '(name name type xcb:char size diff --git a/xcb-xinput.el b/xcb-xinput.el index f4da64e..ae38b67 100644 --- a/xcb-xinput.el +++ b/xcb-xinput.el @@ -137,13 +137,16 @@ cases ((0 min-keycode max-keycode num-keys pad~0) (1 num-buttons) - (2 axes-len mode motion-size axes))) + (2 pad~1 axes-len mode motion-size axes))) :type xcb:-switch) (min-keycode :initarg :min-keycode :type xcb:xinput:KeyCode) (max-keycode :initarg :max-keycode :type xcb:xinput:KeyCode) (num-keys :initarg :num-keys :type xcb:CARD16) (pad~0 :initform 2 :type xcb:-pad) (num-buttons :initarg :num-buttons :type xcb:CARD16) + (pad~1 :initform + [4 2] + :type xcb:-pad-align) (axes-len :initarg :axes-len :type xcb:CARD8) (mode :initarg :mode :type xcb:CARD8) (motion-size :initarg :motion-size :type xcb:CARD32) @@ -177,7 +180,6 @@ '(name devices type xcb:xinput:DeviceInfo size (xcb:-fieldref 'devices-len)) :type xcb:-list) - (pad~1 :initform 4 :type xcb:-pad-align) (infos :initarg :infos :type xcb:-ignore) (infos~ :initform '(name infos type xcb:xinput:InputInfo size @@ -193,13 +195,12 @@ i)))) (slot-value obj 'devices)))) :type xcb:-list) - (pad~2 :initform 4 :type xcb:-pad-align) (names :initarg :names :type xcb:-ignore) (names~ :initform '(name names type xcb:STR size (xcb:-fieldref 'devices-len)) :type xcb:-list) - (pad~3 :initform 4 :type xcb:-pad-align))) + (pad~1 :initform 4 :type xcb:-pad-align))) (xcb:deftypealias 'xcb:xinput:EventTypeBase 'xcb:CARD8) @@ -276,7 +277,6 @@ '(name this-classes type xcb:xinput:EventClass size (xcb:-fieldref 'num-this-classes)) :type xcb:-list) - (pad~1 :initform 4 :type xcb:-pad-align) (all-classes :initarg :all-classes :type xcb:-ignore) (all-classes~ :initform '(name all-classes type xcb:xinput:EventClass size @@ -933,22 +933,28 @@ '(expression (xcb:-fieldref 'class-id) cases - ((0 num-keys pad~0 keys) - (1 num-buttons pad~1 buttons) - (2 num-valuators mode valuators))) + ((0 pad~0 num-keys pad~1 keys) + (1 num-buttons pad~2 buttons) + (2 pad~3 num-valuators mode valuators))) :type xcb:-switch) + (pad~0 :initform + [4 2] + :type xcb:-pad-align) (num-keys :initarg :num-keys :type xcb:CARD8) - (pad~0 :initform 1 :type xcb:-pad) + (pad~1 :initform 1 :type xcb:-pad) (keys :initarg :keys :type xcb:-ignore) (keys~ :initform '(name keys type xcb:CARD8 size 32) :type xcb:-list) (num-buttons :initarg :num-buttons :type xcb:CARD8) - (pad~1 :initform 1 :type xcb:-pad) + (pad~2 :initform 1 :type xcb:-pad) (buttons :initarg :buttons :type xcb:-ignore) (buttons~ :initform '(name buttons type xcb:CARD8 size 32) :type xcb:-list) + (pad~3 :initform + [4 2] + :type xcb:-pad-align) (num-valuators :initarg :num-valuators :type xcb:CARD8) (mode :initarg :mode :type xcb:CARD8) (valuators :initarg :valuators :type xcb:-ignore) @@ -1019,13 +1025,11 @@ '(name resolution-values type xcb:CARD32 size (xcb:-fieldref 'num-valuators)) :type xcb:-list) - (pad~0 :initform 4 :type xcb:-pad-align) (resolution-min :initarg :resolution-min :type xcb:-ignore) (resolution-min~ :initform '(name resolution-min type xcb:CARD32 size (xcb:-fieldref 'num-valuators)) :type xcb:-list) - (pad~1 :initform 4 :type xcb:-pad-align) (resolution-max :initarg :resolution-max :type xcb:-ignore) (resolution-max~ :initform '(name resolution-max type xcb:CARD32 size @@ -1081,8 +1085,8 @@ cases ((1 num-valuators resolution-values resolution-min resolution-max) (2 min-x max-x min-y max-y flip-x flip-y rotation button-threshold) - (3 status iscore pad~2) - (4 enable pad~3) + (3 status iscore pad~0) + (4 enable pad~1) (5 offset-x offset-y width height screen following))) :type xcb:-switch) (num-valuators :initarg :num-valuators :type xcb:CARD32) @@ -1091,13 +1095,11 @@ '(name resolution-values type xcb:CARD32 size (xcb:-fieldref 'num-valuators)) :type xcb:-list) - (pad~0 :initform 4 :type xcb:-pad-align) (resolution-min :initarg :resolution-min :type xcb:-ignore) (resolution-min~ :initform '(name resolution-min type xcb:CARD32 size (xcb:-fieldref 'num-valuators)) :type xcb:-list) - (pad~1 :initform 4 :type xcb:-pad-align) (resolution-max :initarg :resolution-max :type xcb:-ignore) (resolution-max~ :initform '(name resolution-max type xcb:CARD32 size @@ -1113,9 +1115,9 @@ (button-threshold :initarg :button-threshold :type xcb:CARD32) (status :initarg :status :type xcb:CARD8) (iscore :initarg :iscore :type xcb:CARD8) - (pad~2 :initform 2 :type xcb:-pad) + (pad~0 :initform 2 :type xcb:-pad) (enable :initarg :enable :type xcb:CARD8) - (pad~3 :initform 3 :type xcb:-pad) + (pad~1 :initform 3 :type xcb:-pad) (offset-x :initarg :offset-x :type xcb:CARD32) (offset-y :initarg :offset-y :type xcb:CARD32) (width :initarg :width :type xcb:CARD32) @@ -1633,7 +1635,6 @@ 31) 32)) :type xcb:-list) - (pad~0 :initform 4 :type xcb:-pad-align) (labels :initarg :labels :type xcb:-ignore) (labels~ :initform '(name labels type xcb:ATOM size @@ -1694,18 +1695,24 @@ '(expression (xcb:-fieldref 'type) cases - ((0 num-keys keys) - (1 num-buttons state labels) - (2 number label min max value resolution mode pad~1) - (3 number* scroll-type pad~2 flags increment) + ((0 pad~0 num-keys keys) + (1 pad~1 num-buttons state labels) + (2 pad~2 number label min max value resolution mode pad~3) + (3 pad~4 number* scroll-type pad~5 flags increment) (8 mode* num-touches))) :type xcb:-switch) + (pad~0 :initform + [4 2] + :type xcb:-pad-align) (num-keys :initarg :num-keys :type xcb:CARD16) (keys :initarg :keys :type xcb:-ignore) (keys~ :initform '(name keys type xcb:CARD32 size (xcb:-fieldref 'num-keys)) :type xcb:-list) + (pad~1 :initform + [4 2] + :type xcb:-pad-align) (num-buttons :initarg :num-buttons :type xcb:CARD16) (state :initarg :state :type xcb:-ignore) (state~ :initform @@ -1716,12 +1723,14 @@ 31) 32)) :type xcb:-list) - (pad~0 :initform 4 :type xcb:-pad-align) (labels :initarg :labels :type xcb:-ignore) (labels~ :initform '(name labels type xcb:ATOM size (xcb:-fieldref 'num-buttons)) :type xcb:-list) + (pad~2 :initform + [4 2] + :type xcb:-pad-align) (number :initarg :number :type xcb:CARD16) (label :initarg :label :type xcb:ATOM) (min :initarg :min :type xcb:xinput:FP3232) @@ -1729,10 +1738,13 @@ (value :initarg :value :type xcb:xinput:FP3232) (resolution :initarg :resolution :type xcb:CARD32) (mode :initarg :mode :type xcb:CARD8) - (pad~1 :initform 3 :type xcb:-pad) + (pad~3 :initform 3 :type xcb:-pad) + (pad~4 :initform + [4 2] + :type xcb:-pad-align) (number* :initarg :number* :type xcb:CARD16) (scroll-type :initarg :scroll-type :type xcb:CARD16) - (pad~2 :initform 2 :type xcb:-pad) + (pad~5 :initform 2 :type xcb:-pad) (flags :initarg :flags :type xcb:CARD32) (increment :initarg :increment :type xcb:xinput:FP3232) (mode* :initarg :mode* :type xcb:CARD8) @@ -1888,7 +1900,6 @@ '(name mask type xcb:CARD32 size (xcb:-fieldref 'mask-len)) :type xcb:-list) - (pad~1 :initform 4 :type xcb:-pad-align) (modifiers :initarg :modifiers :type xcb:-ignore) (modifiers~ :initform '(name modifiers type xcb:CARD32 size @@ -2279,13 +2290,11 @@ '(name button-mask type xcb:CARD32 size (xcb:-fieldref 'buttons-len)) :type xcb:-list) - (pad~1 :initform 4 :type xcb:-pad-align) (valuator-mask :initarg :valuator-mask :type xcb:-ignore) (valuator-mask~ :initform '(name valuator-mask type xcb:CARD32 size (xcb:-fieldref 'valuators-len)) :type xcb:-list) - (pad~2 :initform 4 :type xcb:-pad-align) (axisvalues :initarg :axisvalues :type xcb:-ignore) (axisvalues~ :initform '(name axisvalues type xcb:xinput:FP3232 size @@ -2333,13 +2342,11 @@ '(name button-mask type xcb:CARD32 size (xcb:-fieldref 'buttons-len)) :type xcb:-list) - (pad~1 :initform 4 :type xcb:-pad-align) (valuator-mask :initarg :valuator-mask :type xcb:-ignore) (valuator-mask~ :initform '(name valuator-mask type xcb:CARD32 size (xcb:-fieldref 'valuators-len)) :type xcb:-list) - (pad~2 :initform 4 :type xcb:-pad-align) (axisvalues :initarg :axisvalues :type xcb:-ignore) (axisvalues~ :initform '(name axisvalues type xcb:xinput:FP3232 size @@ -2478,7 +2485,6 @@ '(name valuator-mask type xcb:CARD32 size (xcb:-fieldref 'valuators-len)) :type xcb:-list) - (pad~1 :initform 4 :type xcb:-pad-align) (axisvalues :initarg :axisvalues :type xcb:-ignore) (axisvalues~ :initform '(name axisvalues type xcb:xinput:FP3232 size @@ -2494,7 +2500,6 @@ i)))) (slot-value obj 'valuator-mask)))) :type xcb:-list) - (pad~2 :initform 4 :type xcb:-pad-align) (axisvalues-raw :initarg :axisvalues-raw :type xcb:-ignore) (axisvalues-raw~ :initform '(name axisvalues-raw type xcb:xinput:FP3232 size @@ -2530,7 +2535,6 @@ '(name valuator-mask type xcb:CARD32 size (xcb:-fieldref 'valuators-len)) :type xcb:-list) - (pad~1 :initform 4 :type xcb:-pad-align) (axisvalues :initarg :axisvalues :type xcb:-ignore) (axisvalues~ :initform '(name axisvalues type xcb:xinput:FP3232 size @@ -2546,7 +2550,6 @@ i)))) (slot-value obj 'valuator-mask)))) :type xcb:-list) - (pad~2 :initform 4 :type xcb:-pad-align) (axisvalues-raw :initarg :axisvalues-raw :type xcb:-ignore) (axisvalues-raw~ :initform '(name axisvalues-raw type xcb:xinput:FP3232 size @@ -2599,13 +2602,11 @@ '(name button-mask type xcb:CARD32 size (xcb:-fieldref 'buttons-len)) :type xcb:-list) - (pad~1 :initform 4 :type xcb:-pad-align) (valuator-mask :initarg :valuator-mask :type xcb:-ignore) (valuator-mask~ :initform '(name valuator-mask type xcb:CARD32 size (xcb:-fieldref 'valuators-len)) :type xcb:-list) - (pad~2 :initform 4 :type xcb:-pad-align) (axisvalues :initarg :axisvalues :type xcb:-ignore) (axisvalues~ :initform '(name axisvalues type xcb:xinput:FP3232 size @@ -2661,7 +2662,6 @@ '(name valuator-mask type xcb:CARD32 size (xcb:-fieldref 'valuators-len)) :type xcb:-list) - (pad~1 :initform 4 :type xcb:-pad-align) (axisvalues :initarg :axisvalues :type xcb:-ignore) (axisvalues~ :initform '(name axisvalues type xcb:xinput:FP3232 size @@ -2677,7 +2677,6 @@ i)))) (slot-value obj 'valuator-mask)))) :type xcb:-list) - (pad~2 :initform 4 :type xcb:-pad-align) (axisvalues-raw :initarg :axisvalues-raw :type xcb:-ignore) (axisvalues-raw~ :initform '(name axisvalues-raw type xcb:xinput:FP3232 size @@ -2745,7 +2744,6 @@ '(name events type xcb:xinput:EventForSend size (xcb:-fieldref 'num-events)) :type xcb:-list) - (pad~1 :initform 4 :type xcb:-pad-align) (classes :initarg :classes :type xcb:-ignore) (classes~ :initform '(name classes type xcb:xinput:EventClass size diff --git a/xcb-xkb.el b/xcb-xkb.el index 1f26deb..1ffcce4 100644 --- a/xcb-xkb.el +++ b/xcb-xkb.el @@ -320,7 +320,6 @@ '(name string type xcb:char size (xcb:-fieldref 'length)) :type xcb:-list) - (pad~0 :initform 4 :type xcb:-pad-align) (alignment-pad :initarg :alignment-pad :type xcb:-ignore) (alignment-pad~ :initform '(name alignment-pad type xcb:void size @@ -358,7 +357,6 @@ '(name map type xcb:xkb:KTMapEntry size (xcb:-fieldref 'nMapEntries)) :type xcb:-list) - (pad~1 :initform 4 :type xcb:-pad-align) (preserve :initarg :preserve :type xcb:-ignore) (preserve~ :initform '(name preserve type xcb:xkb:ModDef size @@ -477,7 +475,6 @@ '(name entries type xcb:xkb:KTSetMapEntry size (xcb:-fieldref 'nMapEntries)) :type xcb:-list) - (pad~1 :initform 4 :type xcb:-pad-align) (preserve-entries :initarg :preserve-entries :type xcb:-ignore) (preserve-entries~ :initform '(name preserve-entries type xcb:xkb:KTSetMapEntry size @@ -599,7 +596,6 @@ (xcb:-popcount (xcb:-fieldref 'namesPresent))) :type xcb:-list) - (pad~0 :initform 4 :type xcb:-pad-align) (maps :initarg :maps :type xcb:-ignore) (maps~ :initform '(name maps type xcb:xkb:IndicatorMap size @@ -1323,7 +1319,6 @@ '(name si-rtrn type xcb:xkb:SymInterpret size (xcb:-fieldref 'nSIRtrn)) :type xcb:-list) - (pad~2 :initform 4 :type xcb:-pad-align) (group-rtrn :initarg :group-rtrn :type xcb:-ignore) (group-rtrn~ :initform '(name group-rtrn type xcb:xkb:ModDef size @@ -1347,7 +1342,6 @@ '(name si type xcb:xkb:SymInterpret size (xcb:-fieldref 'nSI)) :type xcb:-list) - (pad~2 :initform 4 :type xcb:-pad-align) (groupMaps :initarg :groupMaps :type xcb:-ignore) (groupMaps~ :initform '(name groupMaps type xcb:xkb:ModDef size @@ -1691,31 +1685,26 @@ '(name keymaps type xcb:xkb:Listing size (xcb:-fieldref 'nKeymaps)) :type xcb:-list) - (pad~1 :initform 4 :type xcb:-pad-align) (keycodes :initarg :keycodes :type xcb:-ignore) (keycodes~ :initform '(name keycodes type xcb:xkb:Listing size (xcb:-fieldref 'nKeycodes)) :type xcb:-list) - (pad~2 :initform 4 :type xcb:-pad-align) (types :initarg :types :type xcb:-ignore) (types~ :initform '(name types type xcb:xkb:Listing size (xcb:-fieldref 'nTypes)) :type xcb:-list) - (pad~3 :initform 4 :type xcb:-pad-align) (compatMaps :initarg :compatMaps :type xcb:-ignore) (compatMaps~ :initform '(name compatMaps type xcb:xkb:Listing size (xcb:-fieldref 'nCompatMaps)) :type xcb:-list) - (pad~4 :initform 4 :type xcb:-pad-align) (symbols :initarg :symbols :type xcb:-ignore) (symbols~ :initform '(name symbols type xcb:xkb:Listing size (xcb:-fieldref 'nSymbols)) :type xcb:-list) - (pad~5 :initform 4 :type xcb:-pad-align) (geometries :initarg :geometries :type xcb:-ignore) (geometries~ :initform '(name geometries type xcb:xkb:Listing size @@ -1755,9 +1744,9 @@ cases ((13 getmap-type typeDeviceID getmap-sequence getmap-length pad~1 typeMinKeyCode typeMaxKeyCode present firstType nTypes totalTypes firstKeySym totalSyms nKeySyms firstKeyAction totalActions nKeyActions firstKeyBehavior nKeyBehaviors totalKeyBehaviors firstKeyExplicit nKeyExplicit totalKeyExplicit firstModMapKey nModMapKeys totalModMapKeys firstVModMapKey nVModMapKeys totalVModMapKeys pad~2 virtualMods map) (2 compatmap-type compatDeviceID compatmap-sequence compatmap-length groupsRtrn pad~7 firstSIRtrn nSIRtrn nTotalSI pad~8 si-rtrn group-rtrn) - (16 indicatormap-type indicatorDeviceID indicatormap-sequence indicatormap-length which realIndicators nIndicators pad~10 maps) - (160 keyname-type keyDeviceID keyname-sequence keyname-length which* keyMinKeyCode keyMaxKeyCode nTypes* groupNames virtualMods* firstKey nKeys indicators nRadioGroups nKeyAliases nKTLevels pad~11 valueList) - (64 geometry-type geometryDeviceID geometry-sequence geometry-length name geometryFound pad~13 widthMM heightMM nProperties nColors nShapes nSections nDoodads nKeyAliases* baseColorNdx labelColorNdx labelFont))) + (16 indicatormap-type indicatorDeviceID indicatormap-sequence indicatormap-length which realIndicators nIndicators pad~9 maps) + (160 keyname-type keyDeviceID keyname-sequence keyname-length which* keyMinKeyCode keyMaxKeyCode nTypes* groupNames virtualMods* firstKey nKeys indicators nRadioGroups nKeyAliases nKTLevels pad~10 valueList) + (64 geometry-type geometryDeviceID geometry-sequence geometry-length name geometryFound pad~12 widthMM heightMM nProperties nColors nShapes nSections nDoodads nKeyAliases* baseColorNdx labelColorNdx labelFont))) :type xcb:-switch) (getmap-type :initarg :getmap-type :type xcb:CARD8) (typeDeviceID :initarg :typeDeviceID :type xcb:CARD8) @@ -1868,7 +1857,6 @@ '(name si-rtrn type xcb:xkb:SymInterpret size (xcb:-fieldref 'nSIRtrn)) :type xcb:-list) - (pad~9 :initform 4 :type xcb:-pad-align) (group-rtrn :initarg :group-rtrn :type xcb:-ignore) (group-rtrn~ :initform '(name group-rtrn type xcb:xkb:ModDef size @@ -1882,7 +1870,7 @@ (which :initarg :which :type xcb:CARD32) (realIndicators :initarg :realIndicators :type xcb:CARD32) (nIndicators :initarg :nIndicators :type xcb:CARD8) - (pad~10 :initform 15 :type xcb:-pad) + (pad~9 :initform 15 :type xcb:-pad) (maps :initarg :maps :type xcb:-ignore) (maps~ :initform '(name maps type xcb:xkb:IndicatorMap size @@ -1904,7 +1892,7 @@ (nRadioGroups :initarg :nRadioGroups :type xcb:CARD8) (nKeyAliases :initarg :nKeyAliases :type xcb:CARD8) (nKTLevels :initarg :nKTLevels :type xcb:CARD16) - (pad~11 :initform 4 :type xcb:-pad) + (pad~10 :initform 4 :type xcb:-pad) (valueList :initform '(expression (xcb:-fieldref 'which) @@ -1916,7 +1904,7 @@ (16 typesName) (32 compatName) (64 typeNames) - (128 nLevelsPerType pad~12 ktLevelNames) + (128 nLevelsPerType pad~11 ktLevelNames) (256 indicatorNames) (2048 virtualModNames) (4096 groups) @@ -1940,7 +1928,7 @@ '(name nLevelsPerType type xcb:CARD8 size (xcb:-fieldref 'nTypes)) :type xcb:-list) - (pad~12 :initform 4 :type xcb:-pad-align) + (pad~11 :initform 4 :type xcb:-pad-align) (ktLevelNames :initarg :ktLevelNames :type xcb:-ignore) (ktLevelNames~ :initform '(name ktLevelNames type xcb:ATOM size @@ -1986,7 +1974,7 @@ (geometry-length :initarg :geometry-length :type xcb:CARD32) (name :initarg :name :type xcb:ATOM) (geometryFound :initarg :geometryFound :type xcb:BOOL) - (pad~13 :initform 1 :type xcb:-pad) + (pad~12 :initform 1 :type xcb:-pad) (widthMM :initarg :widthMM :type xcb:CARD16) (heightMM :initarg :heightMM :type xcb:CARD16) (nProperties :initarg :nProperties :type xcb:CARD16) @@ -2046,7 +2034,6 @@ '(name btnActions type xcb:xkb:Action size (xcb:-fieldref 'nBtnsRtrn)) :type xcb:-list) - (pad~2 :initform 4 :type xcb:-pad-align) (leds :initarg :leds :type xcb:-ignore) (leds~ :initform '(name leds type xcb:xkb:DeviceLedInfo size @@ -2066,7 +2053,6 @@ '(name btnActions type xcb:xkb:Action size (xcb:-fieldref 'nBtns)) :type xcb:-list) - (pad~0 :initform 4 :type xcb:-pad-align) (leds :initarg :leds :type xcb:-ignore) (leds~ :initform '(name leds type xcb:xkb:DeviceLedInfo size diff --git a/xcb-xprint.el b/xcb-xprint.el index 94fbe86..bc77c6b 100644 --- a/xcb-xprint.el +++ b/xcb-xprint.el @@ -97,7 +97,6 @@ '(name printer-name type xcb:xprint:STRING8 size (xcb:-fieldref 'printerNameLen)) :type xcb:-list) - (pad~0 :initform 4 :type xcb:-pad-align) (locale :initarg :locale :type xcb:-ignore) (locale~ :initform '(name locale type xcb:xprint:STRING8 size @@ -131,7 +130,6 @@ '(name printerName type xcb:xprint:STRING8 size (xcb:-fieldref 'printerNameLen)) :type xcb:-list) - (pad~0 :initform 4 :type xcb:-pad-align) (locale :initarg :locale :type xcb:-ignore) (locale~ :initform '(name locale type xcb:xprint:STRING8 size @@ -200,13 +198,11 @@ '(name data type xcb:BYTE size (xcb:-fieldref 'len-data)) :type xcb:-list) - (pad~0 :initform 4 :type xcb:-pad-align) (doc-format :initarg :doc-format :type xcb:-ignore) (doc-format~ :initform '(name doc-format type xcb:xprint:STRING8 size (xcb:-fieldref 'len-fmt)) :type xcb:-list) - (pad~1 :initform 4 :type xcb:-pad-align) (options :initarg :options :type xcb:-ignore) (options~ :initform '(name options type xcb:xprint:STRING8 size diff --git a/xcb-xproto.el b/xcb-xproto.el index 4cab4e6..1b6ddb2 100644 --- a/xcb-xproto.el +++ b/xcb-xproto.el @@ -260,7 +260,6 @@ '(name pixmap-formats type xcb:FORMAT size (xcb:-fieldref 'pixmap-formats-len)) :type xcb:-list) - (pad~3 :initform 4 :type xcb:-pad-align) (roots :initarg :roots :type xcb:-ignore) (roots~ :initform '(name roots type xcb:SCREEN size @@ -1627,7 +1626,6 @@ '(name properties type xcb:FONTPROP size (xcb:-fieldref 'properties-len)) :type xcb:-list) - (pad~3 :initform 4 :type xcb:-pad-align) (char-infos :initarg :char-infos :type xcb:-ignore) (char-infos~ :initform '(name char-infos type xcb:CHARINFO size @@ -1735,7 +1733,6 @@ '(name properties type xcb:FONTPROP size (xcb:-fieldref 'properties-len)) :type xcb:-list) - (pad~2 :initform 4 :type xcb:-pad-align) (name :initarg :name :type xcb:-ignore) (name~ :initform '(name name type xcb:char size @@ -2378,7 +2375,6 @@ '(name pixels type xcb:CARD32 size (xcb:-fieldref 'pixels-len)) :type xcb:-list) - (pad~2 :initform 4 :type xcb:-pad-align) (masks :initarg :masks :type xcb:-ignore) (masks~ :initform '(name masks type xcb:CARD32 size diff --git a/xcb-xv.el b/xcb-xv.el index 1524745..e820718 100644 --- a/xcb-xv.el +++ b/xcb-xv.el @@ -128,13 +128,11 @@ '(name pitches type xcb:CARD32 size (xcb:-fieldref 'num-planes)) :type xcb:-list) - (pad~0 :initform 4 :type xcb:-pad-align) (offsets :initarg :offsets :type xcb:-ignore) (offsets~ :initform '(name offsets type xcb:CARD32 size (xcb:-fieldref 'num-planes)) :type xcb:-list) - (pad~1 :initform 4 :type xcb:-pad-align) (data :initarg :data :type xcb:-ignore) (data~ :initform '(name data type xcb:CARD8 size @@ -457,7 +455,6 @@ '(name pitches type xcb:CARD32 size (xcb:-fieldref 'num-planes)) :type xcb:-list) - (pad~2 :initform 4 :type xcb:-pad-align) (offsets :initarg :offsets :type xcb:-ignore) (offsets~ :initform '(name offsets type xcb:CARD32 size