Skip to content

Commit 4509a33

Browse files
committed
Fix `xcb:unmarshal' for <switch>
* el_client.el (xelb-parse-list): Place list placeholder after the real one so that to be correctly referred by <switch>. (xelb-parse-switch): Never flatten the condition list for <case>. * xcb-types.el (xcb:unmarshal of xcb:-struct): Stop after processing <switch>. * xcb-types.el (xcb:--struct): New common super class for all classes in XELB. Currently it's used to override `slot-unbound'. (xcb:-struct): * xcb-ewmh.el (xcb:ewmh:-_NET_DESKTOP_GEOMETRY) (xcb:ewmh:-_NET_DESKTOP_LAYOUT, xcb:ewmh:-_NET_WM_STRUT) (xcb:ewmh:-_NET_WM_STRUT_PARTIAL, xcb:ewmh:-_NET_WM_ICON_GEOMETRY) (xcb:ewmh:-_NET_FRAME_EXTENTS, xcb:ewmh:-_NET_WM_SYNC_REQUEST_COUNTER) (xcb:ewmh:-_NET_WM_FULLSCREEN_MONITORS): * xcb-icccm.el (xcb:icccm:--ClientMessage, xcb:icccm:-WM_SIZE_HINTS) (xcb:icccm:-WM_HINTS, xcb:icccm:-WM_STATE, xcb:icccm:-WM_ICON_SIZE): * xcb-keysyms.el (xcb:keysyms:-device): * xcb.el (xcb:connection, xcb:auth-info): Use it.
1 parent c37b769 commit 4509a33

28 files changed

+1165
-1109
lines changed

el_client.el

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -563,10 +563,10 @@ The `combine-adjacent' attribute is simply ignored."
563563
(name-alt (intern (concat (xelb-node-attr-escape node 'name) "~")))
564564
(type (xelb-node-type node))
565565
(size (xelb-parse-expression (xelb-node-subnode node))))
566-
`((,name :initarg ,(intern (concat ":" (symbol-name name)))
567-
:type xcb:-ignore)
568-
(,name-alt :initform '(name ,name type ,type size ,size)
569-
:type xcb:-list))))
566+
`((,name-alt :initform '(name ,name type ,type size ,size)
567+
:type xcb:-list)
568+
(,name :initarg ,(intern (concat ":" (symbol-name name)))
569+
:type xcb:-ignore))))
570570

571571
;; The car of result is the field declaration, and the cadr is the expression
572572
;; to be evaluated.
@@ -621,10 +621,7 @@ The `combine-adjacent' attribute is simply ignored."
621621
(setq fields (nconc fields tmp))
622622
(setq name-list
623623
(nconc name-list (list (caar tmp)))))))
624-
(if (eq case-name 'case)
625-
(when (= 1 (length condition))
626-
;; Flatten 1-element list.
627-
(setq condition (car condition)))
624+
(when (eq case-name 'bitcase)
628625
(setq condition (if (= 1 (length condition))
629626
;; Flatten 1-element list.
630627
(car condition)

xcb-dri2.el

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,11 @@
9191
(driver-name-length :initarg :driver-name-length :type xcb:CARD32)
9292
(device-name-length :initarg :device-name-length :type xcb:CARD32)
9393
(pad~1 :initform 16 :type xcb:-pad)
94-
(driver-name :initarg :driver-name :type xcb:-ignore)
9594
(driver-name~ :initform
9695
'(name driver-name type xcb:char size
9796
(xcb:-fieldref 'driver-name-length))
9897
:type xcb:-list)
99-
(alignment-pad :initarg :alignment-pad :type xcb:-ignore)
98+
(driver-name :initarg :driver-name :type xcb:-ignore)
10099
(alignment-pad~ :initform
101100
'(name alignment-pad type xcb:void size
102101
(-
@@ -107,11 +106,12 @@
107106
(lognot 3))
108107
(xcb:-fieldref 'driver-name-length)))
109108
:type xcb:-list)
110-
(device-name :initarg :device-name :type xcb:-ignore)
109+
(alignment-pad :initarg :alignment-pad :type xcb:-ignore)
111110
(device-name~ :initform
112111
'(name device-name type xcb:char size
113112
(xcb:-fieldref 'device-name-length))
114-
:type xcb:-list)))
113+
:type xcb:-list)
114+
(device-name :initarg :device-name :type xcb:-ignore)))
115115

116116
(defclass xcb:dri2:Authenticate
117117
(xcb:-request)
@@ -140,10 +140,10 @@
140140
((~opcode :initform 5 :type xcb:-u1)
141141
(drawable :initarg :drawable :type xcb:DRAWABLE)
142142
(count :initarg :count :type xcb:CARD32)
143-
(attachments :initarg :attachments :type xcb:-ignore)
144143
(attachments~ :initform
145144
'(name attachments type xcb:CARD32 size nil)
146-
:type xcb:-list)))
145+
:type xcb:-list)
146+
(attachments :initarg :attachments :type xcb:-ignore)))
147147
(defclass xcb:dri2:GetBuffers~reply
148148
(xcb:-reply)
149149
((pad~0 :initform 1 :type xcb:-pad)
@@ -153,11 +153,11 @@
153153
(height :initarg :height :type xcb:CARD32)
154154
(count :initarg :count :type xcb:CARD32)
155155
(pad~1 :initform 12 :type xcb:-pad)
156-
(buffers :initarg :buffers :type xcb:-ignore)
157156
(buffers~ :initform
158157
'(name buffers type xcb:dri2:DRI2Buffer size
159158
(xcb:-fieldref 'count))
160-
:type xcb:-list)))
159+
:type xcb:-list)
160+
(buffers :initarg :buffers :type xcb:-ignore)))
161161

162162
(defclass xcb:dri2:CopyRegion
163163
(xcb:-request)
@@ -177,10 +177,10 @@
177177
((~opcode :initform 7 :type xcb:-u1)
178178
(drawable :initarg :drawable :type xcb:DRAWABLE)
179179
(count :initarg :count :type xcb:CARD32)
180-
(attachments :initarg :attachments :type xcb:-ignore)
181180
(attachments~ :initform
182181
'(name attachments type xcb:dri2:AttachFormat size nil)
183-
:type xcb:-list)))
182+
:type xcb:-list)
183+
(attachments :initarg :attachments :type xcb:-ignore)))
184184
(defclass xcb:dri2:GetBuffersWithFormat~reply
185185
(xcb:-reply)
186186
((pad~0 :initform 1 :type xcb:-pad)
@@ -190,11 +190,11 @@
190190
(height :initarg :height :type xcb:CARD32)
191191
(count :initarg :count :type xcb:CARD32)
192192
(pad~1 :initform 12 :type xcb:-pad)
193-
(buffers :initarg :buffers :type xcb:-ignore)
194193
(buffers~ :initform
195194
'(name buffers type xcb:dri2:DRI2Buffer size
196195
(xcb:-fieldref 'count))
197-
:type xcb:-list)))
196+
:type xcb:-list)
197+
(buffers :initarg :buffers :type xcb:-ignore)))
198198

199199
(defclass xcb:dri2:SwapBuffers
200200
(xcb:-request)

xcb-dri3.el

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -128,16 +128,16 @@
128128
(num-window-modifiers :initarg :num-window-modifiers :type xcb:CARD32)
129129
(num-screen-modifiers :initarg :num-screen-modifiers :type xcb:CARD32)
130130
(pad~2 :initform 16 :type xcb:-pad)
131-
(window-modifiers :initarg :window-modifiers :type xcb:-ignore)
132131
(window-modifiers~ :initform
133132
'(name window-modifiers type xcb:CARD64 size
134133
(xcb:-fieldref 'num-window-modifiers))
135134
:type xcb:-list)
136-
(screen-modifiers :initarg :screen-modifiers :type xcb:-ignore)
135+
(window-modifiers :initarg :window-modifiers :type xcb:-ignore)
137136
(screen-modifiers~ :initform
138137
'(name screen-modifiers type xcb:CARD64 size
139138
(xcb:-fieldref 'num-screen-modifiers))
140-
:type xcb:-list)))
139+
:type xcb:-list)
140+
(screen-modifiers :initarg :screen-modifiers :type xcb:-ignore)))
141141

142142
(defclass xcb:dri3:PixmapFromBuffers
143143
(xcb:-request)
@@ -161,11 +161,11 @@
161161
(bpp :initarg :bpp :type xcb:CARD8)
162162
(pad~2 :initform 2 :type xcb:-pad)
163163
(modifier :initarg :modifier :type xcb:CARD64)
164-
(buffers :initarg :buffers :type xcb:-ignore)
165164
(buffers~ :initform
166165
'(name buffers type xcb:fd size
167166
(xcb:-fieldref 'num-buffers))
168-
:type xcb:-list)))
167+
:type xcb:-list)
168+
(buffers :initarg :buffers :type xcb:-ignore)))
169169

170170
(defclass xcb:dri3:BuffersFromPixmap
171171
(xcb:-request)
@@ -184,21 +184,21 @@
184184
(depth :initarg :depth :type xcb:CARD8)
185185
(bpp :initarg :bpp :type xcb:CARD8)
186186
(pad~2 :initform 6 :type xcb:-pad)
187-
(strides :initarg :strides :type xcb:-ignore)
188187
(strides~ :initform
189188
'(name strides type xcb:CARD32 size
190189
(xcb:-fieldref 'nfd))
191190
:type xcb:-list)
192-
(offsets :initarg :offsets :type xcb:-ignore)
191+
(strides :initarg :strides :type xcb:-ignore)
193192
(offsets~ :initform
194193
'(name offsets type xcb:CARD32 size
195194
(xcb:-fieldref 'nfd))
196195
:type xcb:-list)
197-
(buffers :initarg :buffers :type xcb:-ignore)
196+
(offsets :initarg :offsets :type xcb:-ignore)
198197
(buffers~ :initform
199198
'(name buffers type xcb:fd size
200199
(xcb:-fieldref 'nfd))
201-
:type xcb:-list)))
200+
:type xcb:-list)
201+
(buffers :initarg :buffers :type xcb:-ignore)))
202202

203203

204204

xcb-ewmh.el

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ EWMH")
224224
(type :initform xcb:Atom:CARDINAL)))
225225

226226
;; _NET_DESKTOP_GEOMETRY
227-
(defclass xcb:ewmh:-_NET_DESKTOP_GEOMETRY ()
227+
(defclass xcb:ewmh:-_NET_DESKTOP_GEOMETRY (xcb:--struct)
228228
((width :initarg :width :type xcb:-ignore)
229229
(height :initarg :height :type xcb:-ignore)))
230230
;;
@@ -340,7 +340,7 @@ EWMH")
340340
(defconst xcb:ewmh:_NET_WM_BOTTOMRIGHT 2)
341341
(defconst xcb:ewmh:_NET_WM_BOTTOMLEFT 3)
342342
;;
343-
(defclass xcb:ewmh:-_NET_DESKTOP_LAYOUT ()
343+
(defclass xcb:ewmh:-_NET_DESKTOP_LAYOUT (xcb:--struct)
344344
((orientation :initarg :orientation :type xcb:-ignore)
345345
(columns :initarg :columns :type xcb:-ignore)
346346
(rows :initarg :rows :type xcb:-ignore)
@@ -517,7 +517,7 @@ EWMH")
517517
(type :initform xcb:Atom:ATOM)))
518518

519519
;; _NET_WM_STRUT
520-
(defclass xcb:ewmh:-_NET_WM_STRUT ()
520+
(defclass xcb:ewmh:-_NET_WM_STRUT (xcb:--struct)
521521
((left :initarg :left :type xcb:-ignore)
522522
(right :initarg :right :type xcb:-ignore)
523523
(top :initarg :top :type xcb:-ignore)
@@ -536,7 +536,7 @@ EWMH")
536536
(type :initform xcb:Atom:CARDINAL)))
537537

538538
;; _NET_WM_STRUT_PARTIAL
539-
(defclass xcb:ewmh:-_NET_WM_STRUT_PARTIAL ()
539+
(defclass xcb:ewmh:-_NET_WM_STRUT_PARTIAL (xcb:--struct)
540540
((left :initarg :left :type xcb:-ignore)
541541
(right :initarg :right :type xcb:-ignore)
542542
(top :initarg :top :type xcb:-ignore)
@@ -563,7 +563,7 @@ EWMH")
563563
(type :initform xcb:Atom:CARDINAL)))
564564

565565
;; _NET_WM_ICON_GEOMETRY
566-
(defclass xcb:ewmh:-_NET_WM_ICON_GEOMETRY ()
566+
(defclass xcb:ewmh:-_NET_WM_ICON_GEOMETRY (xcb:--struct)
567567
((x :initarg :x :type xcb:-ignore)
568568
(y :initarg :y :type xcb:-ignore)
569569
(width :initarg :width :type xcb:-ignore)
@@ -636,7 +636,7 @@ EWMH")
636636
(type :initform xcb:Atom:CARDINAL)))
637637

638638
;; _NET_FRAME_EXTENTS
639-
(defclass xcb:ewmh:-_NET_FRAME_EXTENTS ()
639+
(defclass xcb:ewmh:-_NET_FRAME_EXTENTS (xcb:--struct)
640640
((left :initarg :left :type xcb:-ignore)
641641
(right :initarg :right :type xcb:-ignore)
642642
(top :initarg :top :type xcb:-ignore)
@@ -696,7 +696,7 @@ EWMH")
696696
(high :initarg :high :type xcb:CARD32)))
697697

698698
;; _NET_WM_SYNC_REQUEST_COUNTER
699-
(defclass xcb:ewmh:-_NET_WM_SYNC_REQUEST_COUNTER ()
699+
(defclass xcb:ewmh:-_NET_WM_SYNC_REQUEST_COUNTER (xcb:--struct)
700700
((low :initarg :low :type xcb:-ignore)
701701
(high :initarg :hight :type xcb:-ignore)))
702702
;;
@@ -715,7 +715,7 @@ EWMH")
715715
(type :initform xcb:Atom:CARDINAL)))
716716

717717
;; _NET_WM_FULLSCREEN_MONITORS
718-
(defclass xcb:ewmh:-_NET_WM_FULLSCREEN_MONITORS ()
718+
(defclass xcb:ewmh:-_NET_WM_FULLSCREEN_MONITORS (xcb:--struct)
719719
((top :initarg :top :type xcb:-ignore)
720720
(bottom :initarg :bottom :type xcb:-ignore)
721721
(left :initarg :left :type xcb:-ignore)

0 commit comments

Comments
 (0)