xinput: UngrabDevice-request: add pad at end
[free-sw/xcb/proto] / src / xproto.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <!--
3 Copyright (C) 2001-2004 Bart Massey, Jamey Sharp, and Josh Triplett.
4 All Rights Reserved.
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to deal
8 in the Software without restriction, including without limitation the rights
9 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in all
14 copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
23 Except as contained in this notice, the names of the authors or their
24 institutions shall not be used in advertising or otherwise to promote the
25 sale, use or other dealings in this Software without prior written
26 authorization from the authors.
27 -->
28 <xcb header="xproto">
29   <!-- Core protocol types -->
30   
31   <struct name="CHAR2B">
32     <field type="CARD8" name="byte1" />
33     <field type="CARD8" name="byte2" />
34   </struct>
35   
36   <xidtype name="WINDOW" />
37   
38   <xidtype name="PIXMAP" />
39   
40   <xidtype name="CURSOR" />
41   
42   <xidtype name="FONT" />
43   
44   <xidtype name="GCONTEXT" />
45   
46   <xidtype name="COLORMAP" />
47   
48   <xidtype name="ATOM" />
49   
50   <xidunion name="DRAWABLE">
51     <type>WINDOW</type>
52     <type>PIXMAP</type>
53   </xidunion>
54   
55   <xidunion name="FONTABLE">
56     <type>FONT</type>
57     <type>GCONTEXT</type>
58   </xidunion>
59   
60   <typedef oldname="CARD32" newname="VISUALID" />
61
62   <typedef oldname="CARD32" newname="TIMESTAMP" />
63
64   <typedef oldname="CARD32" newname="KEYSYM" />
65
66   <typedef oldname="CARD8" newname="KEYCODE" />
67
68   <typedef oldname="CARD8" newname="BUTTON" />
69
70   <struct name="POINT">
71     <field type="INT16" name="x" />
72     <field type="INT16" name="y" />
73   </struct>
74
75   <struct name="RECTANGLE">
76     <field type="INT16" name="x" />
77     <field type="INT16" name="y" />
78     <field type="CARD16" name="width" />
79     <field type="CARD16" name="height" />
80   </struct>
81
82   <struct name="ARC">
83     <field type="INT16" name="x" />
84     <field type="INT16" name="y" />
85     <field type="CARD16" name="width" />
86     <field type="CARD16" name="height" />
87     <field type="INT16" name="angle1" />
88     <field type="INT16" name="angle2" />
89   </struct>
90
91   <!-- Connection setup-related types -->
92
93   <struct name="FORMAT">
94     <field type="CARD8" name="depth" />
95     <field type="CARD8" name="bits_per_pixel" />
96     <field type="CARD8" name="scanline_pad" />
97     <pad bytes="5" />
98   </struct>
99
100   <enum name="VisualClass">
101     <item name="StaticGray"> <value>0</value></item>
102     <item name="GrayScale">  <value>1</value></item>
103     <item name="StaticColor"><value>2</value></item>
104     <item name="PseudoColor"><value>3</value></item>
105     <item name="TrueColor">  <value>4</value></item>
106     <item name="DirectColor"><value>5</value></item>
107   </enum>
108
109   <struct name="VISUALTYPE">
110     <field type="VISUALID" name="visual_id" />
111     <field type="CARD8" name="class" enum="VisualClass" />
112     <field type="CARD8" name="bits_per_rgb_value" />
113     <field type="CARD16" name="colormap_entries" />
114     <field type="CARD32" name="red_mask" />
115     <field type="CARD32" name="green_mask" />
116     <field type="CARD32" name="blue_mask" />
117     <pad bytes="4" />
118   </struct>
119
120   <struct name="DEPTH">
121     <field type="CARD8" name="depth" />
122     <pad bytes="1" />
123     <field type="CARD16" name="visuals_len" />
124     <pad bytes="4" />
125     <list type="VISUALTYPE" name="visuals">
126       <fieldref>visuals_len</fieldref>
127     </list>
128   </struct>
129
130   <enum name="EventMask">
131     <item name="NoEvent">           <value>0</value></item>
132     <item name="KeyPress">            <bit>0</bit></item>
133     <item name="KeyRelease">          <bit>1</bit></item>
134     <item name="ButtonPress">         <bit>2</bit></item>
135     <item name="ButtonRelease">       <bit>3</bit></item>
136     <item name="EnterWindow">         <bit>4</bit></item>
137     <item name="LeaveWindow">         <bit>5</bit></item>
138     <item name="PointerMotion">       <bit>6</bit></item>
139     <item name="PointerMotionHint">   <bit>7</bit></item>
140     <item name="Button1Motion">       <bit>8</bit></item>
141     <item name="Button2Motion">       <bit>9</bit></item>
142     <item name="Button3Motion">       <bit>10</bit></item>
143     <item name="Button4Motion">       <bit>11</bit></item>
144     <item name="Button5Motion">       <bit>12</bit></item>
145     <item name="ButtonMotion">        <bit>13</bit></item>
146     <item name="KeymapState">         <bit>14</bit></item>
147     <item name="Exposure">            <bit>15</bit></item>
148     <item name="VisibilityChange">    <bit>16</bit></item>
149     <item name="StructureNotify">     <bit>17</bit></item>
150     <item name="ResizeRedirect">      <bit>18</bit></item>
151     <item name="SubstructureNotify">  <bit>19</bit></item>
152     <item name="SubstructureRedirect"><bit>20</bit></item>
153     <item name="FocusChange">         <bit>21</bit></item>
154     <item name="PropertyChange">      <bit>22</bit></item>
155     <item name="ColorMapChange">      <bit>23</bit></item>
156     <item name="OwnerGrabButton">     <bit>24</bit></item>
157   </enum>
158
159   <enum name="BackingStore">
160     <item name="NotUseful"> <value>0</value></item>
161     <item name="WhenMapped"><value>1</value></item>
162     <item name="Always">    <value>2</value></item>
163   </enum>
164
165   <struct name="SCREEN">
166     <field type="WINDOW" name="root" />
167     <field type="COLORMAP" name="default_colormap" />
168     <field type="CARD32" name="white_pixel" />
169     <field type="CARD32" name="black_pixel" />
170     <field type="CARD32" name="current_input_masks" mask="EventMask" />
171     <field type="CARD16" name="width_in_pixels" />
172     <field type="CARD16" name="height_in_pixels" />
173     <field type="CARD16" name="width_in_millimeters" />
174     <field type="CARD16" name="height_in_millimeters" />
175     <field type="CARD16" name="min_installed_maps" />
176     <field type="CARD16" name="max_installed_maps" />
177     <field type="VISUALID" name="root_visual" />
178     <field type="BYTE" name="backing_stores" enum="BackingStore" />
179     <field type="BOOL" name="save_unders" />
180     <field type="CARD8" name="root_depth" />
181     <field type="CARD8" name="allowed_depths_len" />
182     <list type="DEPTH" name="allowed_depths">
183       <fieldref>allowed_depths_len</fieldref>
184     </list>
185   </struct>
186
187   <struct name="SetupRequest">
188     <field type="CARD8" name="byte_order" />
189     <pad bytes="1" />
190     <field type="CARD16" name="protocol_major_version" />
191     <field type="CARD16" name="protocol_minor_version" />
192     <field type="CARD16" name="authorization_protocol_name_len" />
193     <field type="CARD16" name="authorization_protocol_data_len" />
194     <pad bytes="2" />
195     <list type="char" name="authorization_protocol_name">
196       <fieldref>authorization_protocol_name_len</fieldref>
197     </list>
198     <list type="char" name="authorization_protocol_data">
199       <fieldref>authorization_protocol_data_len</fieldref>
200     </list>
201   </struct>
202
203   <struct name="SetupFailed">
204     <field type="CARD8" name="status" /> <!-- always 0 -> Failed -->
205     <field type="CARD8" name="reason_len" />
206     <field type="CARD16" name="protocol_major_version" />
207     <field type="CARD16" name="protocol_minor_version" />
208     <field type="CARD16" name="length" />
209     <list type="char" name="reason">
210       <fieldref>reason_len</fieldref>
211     </list>
212   </struct>
213
214   <struct name="SetupAuthenticate">
215     <field type="CARD8" name="status" /> <!-- always 2 -> Authenticate -->
216     <pad bytes="5" />
217     <field type="CARD16" name="length" />
218     <list type="char" name="reason">
219       <op op="*">
220         <fieldref>length</fieldref>
221         <value>4</value>
222       </op>
223     </list>
224   </struct>
225
226   <enum name="ImageOrder">
227     <item name="LSBFirst"><value>0</value></item>
228     <item name="MSBFirst"><value>1</value></item>
229   </enum>
230
231   <struct name="Setup">
232     <field type="CARD8" name="status" /> <!-- always 1 -> Success -->
233     <pad bytes="1" />
234     <field type="CARD16" name="protocol_major_version" />
235     <field type="CARD16" name="protocol_minor_version" />
236     <field type="CARD16" name="length" />
237     <field type="CARD32" name="release_number" />
238     <field type="CARD32" name="resource_id_base" />
239     <field type="CARD32" name="resource_id_mask" />
240     <field type="CARD32" name="motion_buffer_size" />
241     <field type="CARD16" name="vendor_len" />
242     <field type="CARD16" name="maximum_request_length" />
243     <field type="CARD8" name="roots_len" />
244     <field type="CARD8" name="pixmap_formats_len" />
245     <field type="CARD8" name="image_byte_order" enum="ImageOrder" />
246     <field type="CARD8" name="bitmap_format_bit_order" enum="ImageOrder" />
247     <field type="CARD8" name="bitmap_format_scanline_unit" />
248     <field type="CARD8" name="bitmap_format_scanline_pad" />
249     <field type="KEYCODE" name="min_keycode" />
250     <field type="KEYCODE" name="max_keycode" />
251     <pad bytes="4" />
252     <list type="char" name="vendor">
253       <fieldref>vendor_len</fieldref>
254     </list>
255     <list type="FORMAT" name="pixmap_formats">
256       <fieldref>pixmap_formats_len</fieldref>
257     </list>
258     <list type="SCREEN" name="roots">
259       <fieldref>roots_len</fieldref>
260     </list>
261   </struct>
262
263   <!-- Core event types -->
264   
265   <enum name="ModMask">
266     <item name="Shift">  <bit>0</bit></item>
267     <item name="Lock">   <bit>1</bit></item>
268     <item name="Control"><bit>2</bit></item>
269     <item name="1">      <bit>3</bit></item>
270     <item name="2">      <bit>4</bit></item>
271     <item name="3">      <bit>5</bit></item>
272     <item name="4">      <bit>6</bit></item>
273     <item name="5">      <bit>7</bit></item>
274     <item name="Any">    <bit>15</bit></item>
275   </enum>
276
277   <enum name="KeyButMask">
278     <item name="Shift">  <bit>0</bit></item>
279     <item name="Lock">   <bit>1</bit></item>
280     <item name="Control"><bit>2</bit></item>
281     <item name="Mod1">   <bit>3</bit></item>
282     <item name="Mod2">   <bit>4</bit></item>
283     <item name="Mod3">   <bit>5</bit></item>
284     <item name="Mod4">   <bit>6</bit></item>
285     <item name="Mod5">   <bit>7</bit></item>
286     <item name="Button1"><bit>8</bit></item>
287     <item name="Button2"><bit>9</bit></item>
288     <item name="Button3"><bit>10</bit></item>
289     <item name="Button4"><bit>11</bit></item>
290     <item name="Button5"><bit>12</bit></item>
291   </enum>
292
293   <enum name="Window">
294     <item name="None"> <value>0</value></item>
295   </enum>
296
297   <event name="KeyPress" number="2">
298     <field type="KEYCODE" name="detail" />
299     <field type="TIMESTAMP" name="time" />
300     <field type="WINDOW" name="root" />
301     <field type="WINDOW" name="event" />
302     <field type="WINDOW" name="child" altenum="Window" />
303     <field type="INT16" name="root_x" />
304     <field type="INT16" name="root_y" />
305     <field type="INT16" name="event_x" />
306     <field type="INT16" name="event_y" />
307     <field type="CARD16" name="state" mask="KeyButMask" />
308     <field type="BOOL" name="same_screen" />
309     <pad bytes="1" />
310     <doc>
311       <brief>a key was pressed/released</brief>
312       <field name="detail"><![CDATA[
313 The keycode (a number representing a physical key on the keyboard) of the key
314 which was pressed.
315       ]]></field>
316       <field name="time"><![CDATA[
317 Time when the event was generated (in milliseconds).
318       ]]></field>
319       <field name="root"><![CDATA[
320 The root window of `child`.
321       ]]></field>
322       <field name="same_screen"><![CDATA[
323 Whether the `event` window is on the same screen as the `root` window.
324       ]]></field>
325       <field name="event_x"><![CDATA[
326 If `same_screen` is true, this is the X coordinate relative to the `event`
327 window's origin. Otherwise, `event_x` will be set to zero.
328       ]]></field>
329       <field name="event_y"><![CDATA[
330 If `same_screen` is true, this is the Y coordinate relative to the `event`
331 window's origin. Otherwise, `event_y` will be set to zero.
332       ]]></field>
333       <field name="root_x"><![CDATA[
334 The X coordinate of the pointer relative to the `root` window at the time of
335 the event.
336       ]]></field>
337       <field name="root_y"><![CDATA[
338 The Y coordinate of the pointer relative to the `root` window at the time of
339 the event.
340       ]]></field>
341       <field name="state"><![CDATA[
342 The logical state of the pointer buttons and modifier keys just prior to the
343 event.
344       ]]></field>
345       <see type="request" name="GrabKey" />
346       <see type="request" name="GrabKeyboard" />
347     </doc>
348   </event>
349
350   <eventcopy name="KeyRelease" number="3" ref="KeyPress" />
351
352   <enum name="ButtonMask">
353     <item name="1">      <bit>8</bit></item>
354     <item name="2">      <bit>9</bit></item>
355     <item name="3">      <bit>10</bit></item>
356     <item name="4">      <bit>11</bit></item>
357     <item name="5">      <bit>12</bit></item>
358     <item name="Any">    <bit>15</bit></item>
359   </enum>
360
361   <event name="ButtonPress" number="4">
362     <field type="BUTTON" name="detail" />
363     <field type="TIMESTAMP" name="time" />
364     <field type="WINDOW" name="root" />
365     <field type="WINDOW" name="event" />
366     <field type="WINDOW" name="child" altenum="Window" />
367     <field type="INT16" name="root_x" />
368     <field type="INT16" name="root_y" />
369     <field type="INT16" name="event_x" />
370     <field type="INT16" name="event_y" />
371     <field type="CARD16" name="state" mask="KeyButMask" />
372     <field type="BOOL" name="same_screen" />
373     <pad bytes="1" />
374     <doc>
375       <brief>a mouse button was pressed/released</brief>
376       <field name="detail"><![CDATA[
377 The keycode (a number representing a physical key on the keyboard) of the key
378 which was pressed.
379       ]]></field>
380       <field name="time"><![CDATA[
381 Time when the event was generated (in milliseconds).
382       ]]></field>
383       <field name="root"><![CDATA[
384 The root window of `child`.
385       ]]></field>
386       <field name="same_screen"><![CDATA[
387 Whether the `event` window is on the same screen as the `root` window.
388       ]]></field>
389       <field name="event_x"><![CDATA[
390 If `same_screen` is true, this is the X coordinate relative to the `event`
391 window's origin. Otherwise, `event_x` will be set to zero.
392       ]]></field>
393       <field name="event_y"><![CDATA[
394 If `same_screen` is true, this is the Y coordinate relative to the `event`
395 window's origin. Otherwise, `event_y` will be set to zero.
396       ]]></field>
397       <field name="root_x"><![CDATA[
398 The X coordinate of the pointer relative to the `root` window at the time of
399 the event.
400       ]]></field>
401       <field name="root_y"><![CDATA[
402 The Y coordinate of the pointer relative to the `root` window at the time of
403 the event.
404       ]]></field>
405       <field name="state"><![CDATA[
406 The logical state of the pointer buttons and modifier keys just prior to the
407 event.
408       ]]></field>
409       <see type="request" name="GrabButton" />
410       <see type="request" name="GrabPointer" />
411     </doc>
412   </event>
413
414   <eventcopy name="ButtonRelease" number="5" ref="ButtonPress" />
415
416   <!-- MotionNotify detail -->
417   <enum name="Motion">
418     <item name="Normal"><value>0</value></item>
419     <item name="Hint">  <value>1</value></item>
420   </enum>
421
422   <event name="MotionNotify" number="6">
423     <field type="BYTE" name="detail" enum="Motion" />
424     <field type="TIMESTAMP" name="time" />
425     <field type="WINDOW" name="root" />
426     <field type="WINDOW" name="event" />
427     <field type="WINDOW" name="child" altenum="Window" />
428     <field type="INT16" name="root_x" />
429     <field type="INT16" name="root_y" />
430     <field type="INT16" name="event_x" />
431     <field type="INT16" name="event_y" />
432     <field type="CARD16" name="state" mask="KeyButMask" />
433     <field type="BOOL" name="same_screen" />
434     <pad bytes="1" />
435     <doc>
436       <brief>a key was pressed</brief>
437       <field name="detail"><![CDATA[
438 The keycode (a number representing a physical key on the keyboard) of the key
439 which was pressed.
440       ]]></field>
441       <field name="time"><![CDATA[
442 Time when the event was generated (in milliseconds).
443       ]]></field>
444       <field name="root"><![CDATA[
445 The root window of `child`.
446       ]]></field>
447       <field name="same_screen"><![CDATA[
448 Whether the `event` window is on the same screen as the `root` window.
449       ]]></field>
450       <field name="event_x"><![CDATA[
451 If `same_screen` is true, this is the X coordinate relative to the `event`
452 window's origin. Otherwise, `event_x` will be set to zero.
453       ]]></field>
454       <field name="event_y"><![CDATA[
455 If `same_screen` is true, this is the Y coordinate relative to the `event`
456 window's origin. Otherwise, `event_y` will be set to zero.
457       ]]></field>
458       <field name="root_x"><![CDATA[
459 The X coordinate of the pointer relative to the `root` window at the time of
460 the event.
461       ]]></field>
462       <field name="root_y"><![CDATA[
463 The Y coordinate of the pointer relative to the `root` window at the time of
464 the event.
465       ]]></field>
466       <field name="state"><![CDATA[
467 The logical state of the pointer buttons and modifier keys just prior to the
468 event.
469       ]]></field>
470       <see type="request" name="GrabKey" />
471       <see type="request" name="GrabKeyboard" />
472     </doc>
473   </event>
474
475   <enum name="NotifyDetail">
476     <item name="Ancestor">        <value>0</value></item>
477     <item name="Virtual">         <value>1</value></item>
478     <item name="Inferior">        <value>2</value></item>
479     <item name="Nonlinear">       <value>3</value></item>
480     <item name="NonlinearVirtual"><value>4</value></item>
481     <item name="Pointer">         <value>5</value></item>
482     <item name="PointerRoot">     <value>6</value></item>
483     <item name="None">            <value>7</value></item>
484   </enum>
485
486   <enum name="NotifyMode">
487     <item name="Normal">      <value>0</value></item>
488     <item name="Grab">        <value>1</value></item>
489     <item name="Ungrab">      <value>2</value></item>
490     <item name="WhileGrabbed"><value>3</value></item>
491   </enum>
492
493   <event name="EnterNotify" number="7">
494     <field type="BYTE" name="detail" enum="NotifyDetail" />
495     <field type="TIMESTAMP" name="time" />
496     <field type="WINDOW" name="root" />
497     <field type="WINDOW" name="event" />
498     <field type="WINDOW" name="child" altenum="Window" />
499     <field type="INT16" name="root_x" />
500     <field type="INT16" name="root_y" />
501     <field type="INT16" name="event_x" />
502     <field type="INT16" name="event_y" />
503     <field type="CARD16" name="state" mask="KeyButMask" />
504     <field type="BYTE" name="mode" enum="NotifyMode" />
505     <field type="BYTE" name="same_screen_focus" />
506     <doc>
507       <brief>the pointer is in a different window</brief>
508       <field name="event"><![CDATA[
509 The window on which the event was generated.
510       ]]></field>
511       <field name="child"><![CDATA[
512 If the `event` window has subwindows and the final pointer position is in one
513 of them, then `child` is set to that subwindow, `XCB_WINDOW_NONE` otherwise.
514       ]]></field>
515       <field name="root"><![CDATA[
516 The root window for the final cursor position.
517       ]]></field>
518       <field name="root_x"><![CDATA[
519 The pointer X coordinate relative to `root`'s origin at the time of the event.
520       ]]></field>
521       <field name="root_y"><![CDATA[
522 The pointer Y coordinate relative to `root`'s origin at the time of the event.
523       ]]></field>
524       <field name="event_x"><![CDATA[
525 If `event` is on the same screen as `root`, this is the pointer X coordinate
526 relative to the event window's origin.
527       ]]></field>
528       <field name="event_y"><![CDATA[
529 If `event` is on the same screen as `root`, this is the pointer Y coordinate
530 relative to the event window's origin.
531       ]]></field>
532       <field name="mode" />
533     </doc>
534   </event>
535
536   <eventcopy name="LeaveNotify" number="8" ref="EnterNotify" />
537
538   <event name="FocusIn" number="9">
539     <field type="BYTE" name="detail" enum="NotifyDetail" />
540     <field type="WINDOW" name="event" />
541     <field type="BYTE" name="mode" enum="NotifyMode" />
542     <pad bytes="3" />
543     <doc>
544       <brief>NOT YET DOCUMENTED</brief>
545       <field name="event"><![CDATA[
546 The window on which the focus event was generated. This is the window used by
547 the X server to report the event.
548       ]]></field>
549       <!-- enum documentation is sufficient -->
550       <field name="detail" />
551       <field name="mode" />
552     </doc>
553   </event>
554
555   <eventcopy name="FocusOut" number="10" ref="FocusIn" />
556
557   <event name="KeymapNotify" number="11" no-sequence-number="true">
558     <list type="CARD8" name="keys"><value>31</value></list>
559   </event>
560
561   <event name="Expose" number="12">
562     <pad bytes="1" />
563     <field type="WINDOW" name="window" />
564     <field type="CARD16" name="x" />
565     <field type="CARD16" name="y" />
566     <field type="CARD16" name="width" />
567     <field type="CARD16" name="height" />
568     <field type="CARD16" name="count" />
569     <pad bytes="2" />
570     <doc>
571       <brief>NOT YET DOCUMENTED</brief>
572       <field name="window"><![CDATA[
573 The exposed (damaged) window.
574       ]]></field>
575       <field name="x"><![CDATA[
576 The X coordinate of the left-upper corner of the exposed rectangle, relative to
577 the `window`'s origin.
578       ]]></field>
579       <field name="y"><![CDATA[
580 The Y coordinate of the left-upper corner of the exposed rectangle, relative to
581 the `window`'s origin.
582       ]]></field>
583       <field name="width"><![CDATA[
584 The width of the exposed rectangle.
585       ]]></field>
586       <field name="height"><![CDATA[
587 The height of the exposed rectangle.
588       ]]></field>
589       <field name="count"><![CDATA[
590 The amount of `Expose` events following this one. Simple applications that do
591 not want to optimize redisplay by distinguishing between subareas of its window
592 can just ignore all Expose events with nonzero counts and perform full
593 redisplays on events with zero counts.
594       ]]></field>
595     </doc>
596   </event>
597
598   <event name="GraphicsExposure" number="13">
599     <pad bytes="1" />
600     <field type="DRAWABLE" name="drawable" />
601     <field type="CARD16" name="x" />
602     <field type="CARD16" name="y" />
603     <field type="CARD16" name="width" />
604     <field type="CARD16" name="height" />
605     <field type="CARD16" name="minor_opcode" />
606     <field type="CARD16" name="count" />
607     <field type="CARD8" name="major_opcode" />
608     <pad bytes="3" />
609   </event>
610
611   <event name="NoExposure" number="14">
612     <pad bytes="1" />
613     <field type="DRAWABLE" name="drawable" />
614     <field type="CARD16" name="minor_opcode" />
615     <field type="CARD8" name="major_opcode" />
616     <pad bytes="1" />
617   </event>
618
619   <enum name="Visibility">
620     <item name="Unobscured">       <value>0</value></item>
621     <item name="PartiallyObscured"><value>1</value></item>
622     <item name="FullyObscured">    <value>2</value></item>
623   </enum>
624
625   <event name="VisibilityNotify" number="15">
626     <pad bytes="1" />
627     <field type="WINDOW" name="window" />
628     <field type="BYTE" name="state" enum="Visibility" />
629     <pad bytes="3" />
630   </event>
631
632   <event name="CreateNotify" number="16">
633     <pad bytes="1" />
634     <field type="WINDOW" name="parent" />
635     <field type="WINDOW" name="window" />
636     <field type="INT16" name="x" />
637     <field type="INT16" name="y" />
638     <field type="CARD16" name="width" />
639     <field type="CARD16" name="height" />
640     <field type="CARD16" name="border_width" />
641     <field type="BOOL" name="override_redirect" />
642     <pad bytes="1" />
643   </event>
644
645   <event name="DestroyNotify" number="17">
646     <pad bytes="1" />
647     <field type="WINDOW" name="event" />
648     <field type="WINDOW" name="window" />
649     <doc>
650       <brief>a window is destroyed</brief>
651       <field name="event"><![CDATA[
652 The reconfigured window or its parent, depending on whether `StructureNotify`
653 or `SubstructureNotify` was selected.
654       ]]></field>
655       <field name="window"><![CDATA[
656 The window that is destroyed.
657       ]]></field>
658       <see type="request" name="DestroyWindow" />
659     </doc>
660   </event>
661
662   <event name="UnmapNotify" number="18">
663     <pad bytes="1" />
664     <field type="WINDOW" name="event" />
665     <field type="WINDOW" name="window" />
666     <field type="BOOL" name="from_configure" />
667     <pad bytes="3" />
668     <doc>
669       <brief>a window is unmapped</brief>
670       <field name="event"><![CDATA[
671 The reconfigured window or its parent, depending on whether `StructureNotify`
672 or `SubstructureNotify` was selected.
673       ]]></field>
674       <field name="window"><![CDATA[
675 The window that was unmapped.
676       ]]></field>
677       <field name="from_configure"><![CDATA[
678 Set to 1 if the event was generated as a result of a resizing of the window's
679 parent when `window` had a win_gravity of `UnmapGravity`.
680       ]]></field>
681       <see type="request" name="UnmapWindow" />
682     </doc>
683   </event>
684
685   <event name="MapNotify" number="19">
686     <pad bytes="1" />
687     <field type="WINDOW" name="event" />
688     <field type="WINDOW" name="window" />
689     <field type="BOOL" name="override_redirect" />
690     <pad bytes="3" />
691     <doc>
692       <brief>a window was mapped</brief>
693       <field name="event"><![CDATA[
694 The window which was mapped or its parent, depending on whether
695 `StructureNotify` or `SubstructureNotify` was selected.
696       ]]></field>
697       <field name="window"><![CDATA[
698 The window that was mapped.
699       ]]></field>
700       <field name="override_redirect"><![CDATA[
701 Window managers should ignore this window if `override_redirect` is 1.
702       ]]></field>
703       <see type="request" name="MapWindow" />
704     </doc>
705   </event>
706
707   <event name="MapRequest" number="20">
708     <pad bytes="1" />
709     <field type="WINDOW" name="parent" />
710     <field type="WINDOW" name="window" />
711     <doc>
712       <brief>window wants to be mapped</brief>
713       <field name="parent"><![CDATA[
714 The parent of `window`.
715       ]]></field>
716       <field name="window"><![CDATA[
717 The window to be mapped.
718       ]]></field>
719       <see type="request" name="MapWindow" />
720     </doc>
721   </event>
722
723   <event name="ReparentNotify" number="21">
724     <pad bytes="1" />
725     <field type="WINDOW" name="event" />
726     <field type="WINDOW" name="window" />
727     <field type="WINDOW" name="parent" />
728     <field type="INT16" name="x" />
729     <field type="INT16" name="y" />
730     <field type="BOOL" name="override_redirect" />
731     <pad bytes="3" />
732   </event>
733
734   <event name="ConfigureNotify" number="22">
735     <pad bytes="1" />
736     <field type="WINDOW" name="event" />
737     <field type="WINDOW" name="window" />
738     <field type="WINDOW" name="above_sibling" altenum="Window" />
739     <field type="INT16" name="x" />
740     <field type="INT16" name="y" />
741     <field type="CARD16" name="width" />
742     <field type="CARD16" name="height" />
743     <field type="CARD16" name="border_width" />
744     <field type="BOOL" name="override_redirect" />
745     <pad bytes="1" />
746     <doc>
747       <brief>NOT YET DOCUMENTED</brief>
748       <field name="event"><![CDATA[
749 The reconfigured window or its parent, depending on whether `StructureNotify`
750 or `SubstructureNotify` was selected.
751       ]]></field>
752       <field name="window"><![CDATA[
753 The window whose size, position, border, and/or stacking order was changed.
754       ]]></field>
755       <field name="above_sibling"><![CDATA[
756 If `XCB_NONE`, the `window` is on the bottom of the stack with respect to
757 sibling windows. However, if set to a sibling window, the `window` is placed on
758 top of this sibling window.
759       ]]></field>
760       <field name="x"><![CDATA[
761 The X coordinate of the upper-left outside corner of `window`, relative to the
762 parent window's origin.
763       ]]></field>
764       <field name="y"><![CDATA[
765 The Y coordinate of the upper-left outside corner of `window`, relative to the
766 parent window's origin.
767       ]]></field>
768       <field name="width"><![CDATA[
769 The inside width of `window`, not including the border.
770       ]]></field>
771       <field name="height"><![CDATA[
772 The inside height of `window`, not including the border.
773       ]]></field>
774       <field name="border_width"><![CDATA[
775 The border width of `window`.
776       ]]></field>
777       <field name="override_redirect"><![CDATA[
778 Window managers should ignore this window if `override_redirect` is 1.
779       ]]></field>
780       <see type="request" name="FreeColormap" />
781     </doc>
782   </event>
783
784   <event name="ConfigureRequest" number="23">
785     <field type="BYTE" name="stack_mode" enum="StackMode" />
786     <field type="WINDOW" name="parent" />
787     <field type="WINDOW" name="window" />
788     <field type="WINDOW" name="sibling" altenum="Window" />
789     <field type="INT16" name="x" />
790     <field type="INT16" name="y" />
791     <field type="CARD16" name="width" />
792     <field type="CARD16" name="height" />
793     <field type="CARD16" name="border_width" />
794     <field type="CARD16" name="value_mask" mask="ConfigWindow" />
795   </event>
796
797   <event name="GravityNotify" number="24">
798     <pad bytes="1" />
799     <field type="WINDOW" name="event" />
800     <field type="WINDOW" name="window" />
801     <field type="INT16" name="x" />
802     <field type="INT16" name="y" />
803   </event>
804
805   <event name="ResizeRequest" number="25">
806     <pad bytes="1" />
807     <field type="WINDOW" name="window" />
808     <field type="CARD16" name="width" />
809     <field type="CARD16" name="height" />
810   </event>
811
812   <enum name="Place">
813     <item name="OnTop">   <value>0</value></item>
814     <item name="OnBottom"><value>1</value></item>
815     <doc>
816       <field name="OnTop"><![CDATA[
817 The window is now on top of all siblings.
818       ]]></field>
819       <field name="OnBottom"><![CDATA[
820 The window is now below all siblings.
821       ]]></field>
822     </doc>
823   </enum>
824
825   <event name="CirculateNotify" number="26">
826     <pad bytes="1" />
827     <field type="WINDOW" name="event" />
828     <field type="WINDOW" name="window" />
829     <pad bytes="4" />
830     <field type="BYTE" name="place" enum="Place" />
831     <pad bytes="3" />
832     <doc>
833       <brief>NOT YET DOCUMENTED</brief>
834       <field name="event"><![CDATA[
835 Either the restacked window or its parent, depending on whether
836 `StructureNotify` or `SubstructureNotify` was selected.
837       ]]></field>
838       <field name="window"><![CDATA[
839 The restacked window.
840       ]]></field>
841       <!-- the enum doc is sufficient -->
842       <field name="place" />
843       <see type="request" name="CirculateWindow" />
844     </doc>
845   </event>
846
847   <eventcopy name="CirculateRequest" number="27" ref="CirculateNotify" />
848
849   <enum name="Property">
850     <item name="NewValue"><value>0</value></item>
851     <item name="Delete">  <value>1</value></item>
852   </enum>
853
854   <event name="PropertyNotify" number="28">
855     <pad bytes="1" />
856     <field type="WINDOW" name="window" />
857     <field type="ATOM" name="atom" />
858     <field type="TIMESTAMP" name="time" />
859     <field type="BYTE" name="state" enum="Property" />
860     <pad bytes="3" />
861     <doc>
862       <brief>a window property changed</brief>
863       <field name="window"><![CDATA[
864 The window whose associated property was changed.
865       ]]></field>
866       <field name="atom"><![CDATA[
867 The property's atom, to indicate which property was changed.
868       ]]></field>
869       <field name="time"><![CDATA[
870 A timestamp of the server time when the property was changed.
871       ]]></field>
872       <!-- enum documentation is sufficient -->
873       <field name="state" />
874       <see type="request" name="ChangeProperty" />
875     </doc>
876   </event>
877
878   <event name="SelectionClear" number="29">
879     <pad bytes="1" />
880     <field type="TIMESTAMP" name="time" />
881     <field type="WINDOW" name="owner" />
882     <field type="ATOM" name="selection" />
883   </event>
884
885   <enum name="Time">
886     <item name="CurrentTime"> <value>0</value> </item>
887   </enum>
888
889   <enum name="Atom">
890     <item name="None"> <value>0</value></item>
891     <item name="Any">  <value>0</value></item>
892     <item name="PRIMARY">              <value>1</value> </item>
893     <item name="SECONDARY">            <value>2</value> </item>
894     <item name="ARC">                  <value>3</value> </item>
895     <item name="ATOM">                 <value>4</value> </item>
896     <item name="BITMAP">               <value>5</value> </item>
897     <item name="CARDINAL">             <value>6</value> </item>
898     <item name="COLORMAP">             <value>7</value> </item>
899     <item name="CURSOR">               <value>8</value> </item>
900     <item name="CUT_BUFFER0">          <value>9</value> </item>
901     <item name="CUT_BUFFER1">          <value>10</value> </item>
902     <item name="CUT_BUFFER2">          <value>11</value> </item>
903     <item name="CUT_BUFFER3">          <value>12</value> </item>
904     <item name="CUT_BUFFER4">          <value>13</value> </item>
905     <item name="CUT_BUFFER5">          <value>14</value> </item>
906     <item name="CUT_BUFFER6">          <value>15</value> </item>
907     <item name="CUT_BUFFER7">          <value>16</value> </item>
908     <item name="DRAWABLE">             <value>17</value> </item>
909     <item name="FONT">                 <value>18</value> </item>
910     <item name="INTEGER">              <value>19</value> </item>
911     <item name="PIXMAP">               <value>20</value> </item>
912     <item name="POINT">                <value>21</value> </item>
913     <item name="RECTANGLE">            <value>22</value> </item>
914     <item name="RESOURCE_MANAGER">     <value>23</value> </item>
915     <item name="RGB_COLOR_MAP">        <value>24</value> </item>
916     <item name="RGB_BEST_MAP">         <value>25</value> </item>
917     <item name="RGB_BLUE_MAP">         <value>26</value> </item>
918     <item name="RGB_DEFAULT_MAP">      <value>27</value> </item>
919     <item name="RGB_GRAY_MAP">         <value>28</value> </item>
920     <item name="RGB_GREEN_MAP">        <value>29</value> </item>
921     <item name="RGB_RED_MAP">          <value>30</value> </item>
922     <item name="STRING">               <value>31</value> </item>
923     <item name="VISUALID">             <value>32</value> </item>
924     <item name="WINDOW">               <value>33</value> </item>
925     <item name="WM_COMMAND">           <value>34</value> </item>
926     <item name="WM_HINTS">             <value>35</value> </item>
927     <item name="WM_CLIENT_MACHINE">    <value>36</value> </item>
928     <item name="WM_ICON_NAME">         <value>37</value> </item>
929     <item name="WM_ICON_SIZE">         <value>38</value> </item>
930     <item name="WM_NAME">              <value>39</value> </item>
931     <item name="WM_NORMAL_HINTS">      <value>40</value> </item>
932     <item name="WM_SIZE_HINTS">        <value>41</value> </item>
933     <item name="WM_ZOOM_HINTS">        <value>42</value> </item>
934     <item name="MIN_SPACE">            <value>43</value> </item>
935     <item name="NORM_SPACE">           <value>44</value> </item>
936     <item name="MAX_SPACE">            <value>45</value> </item>
937     <item name="END_SPACE">            <value>46</value> </item>
938     <item name="SUPERSCRIPT_X">        <value>47</value> </item>
939     <item name="SUPERSCRIPT_Y">        <value>48</value> </item>
940     <item name="SUBSCRIPT_X">          <value>49</value> </item>
941     <item name="SUBSCRIPT_Y">          <value>50</value> </item>
942     <item name="UNDERLINE_POSITION">   <value>51</value> </item>
943     <item name="UNDERLINE_THICKNESS">  <value>52</value> </item>
944     <item name="STRIKEOUT_ASCENT">     <value>53</value> </item>
945     <item name="STRIKEOUT_DESCENT">    <value>54</value> </item>
946     <item name="ITALIC_ANGLE">         <value>55</value> </item>
947     <item name="X_HEIGHT">             <value>56</value> </item>
948     <item name="QUAD_WIDTH">           <value>57</value> </item>
949     <item name="WEIGHT">               <value>58</value> </item>
950     <item name="POINT_SIZE">           <value>59</value> </item>
951     <item name="RESOLUTION">           <value>60</value> </item>
952     <item name="COPYRIGHT">            <value>61</value> </item>
953     <item name="NOTICE">               <value>62</value> </item>
954     <item name="FONT_NAME">            <value>63</value> </item>
955     <item name="FAMILY_NAME">          <value>64</value> </item>
956     <item name="FULL_NAME">            <value>65</value> </item>
957     <item name="CAP_HEIGHT">           <value>66</value> </item>
958     <item name="WM_CLASS">             <value>67</value> </item>
959     <item name="WM_TRANSIENT_FOR">     <value>68</value> </item>
960   </enum>
961
962   <event name="SelectionRequest" number="30">
963     <pad bytes="1" />
964     <field type="TIMESTAMP" name="time" altenum="Time" />
965     <field type="WINDOW" name="owner" />
966     <field type="WINDOW" name="requestor" />
967     <field type="ATOM" name="selection" />
968     <field type="ATOM" name="target" />
969     <field type="ATOM" name="property" altenum="Atom" />
970   </event>
971
972   <event name="SelectionNotify" number="31">
973     <pad bytes="1" />
974     <field type="TIMESTAMP" name="time" altenum="Time" />
975     <field type="WINDOW" name="requestor" />
976     <field type="ATOM" name="selection" />
977     <field type="ATOM" name="target" />
978     <field type="ATOM" name="property" altenum="Atom" />
979   </event>
980
981   <enum name="ColormapState">
982     <item name="Uninstalled"><value>0</value></item>
983     <item name="Installed">  <value>1</value></item>
984     <doc>
985       <field name="Uninstalled"><![CDATA[
986 The colormap was uninstalled.
987       ]]></field>
988       <field name="Installed"><![CDATA[
989 The colormap was installed.
990       ]]></field>
991     </doc>
992   </enum>
993
994   <enum name="Colormap">
995     <item name="None"> <value>0</value></item>
996   </enum>
997
998   <event name="ColormapNotify" number="32">
999     <pad bytes="1" />
1000     <field type="WINDOW" name="window" />
1001     <field type="COLORMAP" name="colormap" altenum="Colormap" />
1002     <field type="BOOL" name="new" />
1003     <field type="BYTE" name="state" enum="ColormapState" />
1004     <pad bytes="2" />
1005     <doc>
1006       <brief>the colormap for some window changed</brief>
1007       <field name="window"><![CDATA[
1008 The window whose associated colormap is changed, installed or uninstalled.
1009       ]]></field>
1010       <field name="colormap"><![CDATA[
1011 The colormap which is changed, installed or uninstalled. This is `XCB_NONE`
1012 when the colormap is changed by a call to `FreeColormap`.
1013       ]]></field>
1014       <field name="_new"><![CDATA[
1015 Indicates whether the colormap was changed (1) or installed/uninstalled (0).
1016       ]]></field>
1017       <!-- enum doc is sufficient -->
1018       <field name="state" />
1019       <see type="request" name="FreeColormap" />
1020     </doc>
1021   </event>
1022
1023   <union name="ClientMessageData">
1024     <!-- The format member of the ClientMessage event determines which array
1025          to use. -->
1026     <list type="CARD8"  name="data8" ><value>20</value></list> <!--  8 -->
1027     <list type="CARD16" name="data16"><value>10</value></list> <!-- 16 -->
1028     <list type="CARD32" name="data32"><value>5</value></list>  <!-- 32 -->
1029   </union>
1030
1031   <event name="ClientMessage" number="33">
1032     <field type="CARD8" name="format" /> <!-- 8, 16, or 32. -->
1033     <field type="WINDOW" name="window" />
1034     <field type="ATOM" name="type" />
1035     <field type="ClientMessageData" name="data" />
1036     <doc>
1037       <brief>NOT YET DOCUMENTED</brief>
1038       <description><![CDATA[
1039 This event represents a ClientMessage, sent by another X11 client. An example
1040 is a client sending the `_NET_WM_STATE` ClientMessage to the root window
1041 to indicate the fullscreen window state, effectively requesting that the window
1042 manager puts it into fullscreen mode.
1043       ]]></description>
1044       <field name="format"><![CDATA[
1045 Specifies how to interpret `data`. Can be either 8, 16 or 32.
1046       ]]></field>
1047       <field name="type"><![CDATA[
1048 An atom which indicates how the data should be interpreted by the receiving
1049 client.
1050       ]]></field>
1051       <field name="data"><![CDATA[
1052 The data itself (20 bytes max).
1053       ]]></field>
1054       <see type="request" name="SendEvent" />
1055     </doc>
1056   </event>
1057
1058   <enum name="Mapping">
1059     <item name="Modifier"><value>0</value></item>
1060     <item name="Keyboard"><value>1</value></item>
1061     <item name="Pointer"> <value>2</value></item>
1062   </enum>
1063
1064   <event name="MappingNotify" number="34">
1065     <pad bytes="1" />
1066     <field type="BYTE" name="request" enum="Mapping" />
1067     <field type="KEYCODE" name="first_keycode" />
1068     <field type="CARD8" name="count" />
1069     <pad bytes="1" />
1070     <doc>
1071       <brief>keyboard mapping changed</brief>
1072       <!-- enum documentation is sufficient -->
1073       <field name="request" />
1074       <field name="first_keycode"><![CDATA[
1075 The first number in the range of the altered mapping.
1076       ]]></field>
1077       <field name="count"><![CDATA[
1078 The number of keycodes altered.
1079       ]]></field>
1080     </doc>
1081   </event>
1082
1083   <event name="GeGeneric" number="35" xge="true">
1084     <pad bytes="22" />
1085     <doc>
1086       <brief>generic event (with length)</brief>
1087       <field name="extension"><![CDATA[
1088 The major opcode of the extension creating this event
1089       ]]></field>
1090       <field name="length"><![CDATA[
1091 The amount (in 4-byte units) of data beyond 32 bytes
1092       ]]></field>
1093       <field name="evtype"><![CDATA[
1094 The extension-specific event type
1095       ]]></field>
1096     </doc>
1097   </event>
1098
1099   <!-- Core error types -->
1100
1101
1102
1103   <error name="Request" number="1">
1104     <field type="CARD32" name="bad_value" />
1105     <field type="CARD16" name="minor_opcode" />
1106     <field type="CARD8" name="major_opcode" />
1107     <pad bytes="1" />
1108   </error>
1109
1110   <error name="Value" number="2">
1111     <field type="CARD32" name="bad_value" />
1112     <field type="CARD16" name="minor_opcode" />
1113     <field type="CARD8" name="major_opcode" />
1114     <pad bytes="1" />
1115   </error>
1116
1117   <errorcopy name="Window" number="3" ref="Value" />
1118   <errorcopy name="Pixmap" number="4" ref="Value" />
1119   <errorcopy name="Atom" number="5" ref="Value" />
1120   <errorcopy name="Cursor" number="6" ref="Value" />
1121   <errorcopy name="Font" number="7" ref="Value" />
1122   <errorcopy name="Match" number="8" ref="Request" />
1123   <errorcopy name="Drawable" number="9" ref="Value" />
1124   <errorcopy name="Access" number="10" ref="Request" />
1125   <errorcopy name="Alloc" number="11" ref="Request" />
1126   <errorcopy name="Colormap" number="12" ref="Value" />
1127   <errorcopy name="GContext" number="13" ref="Value" />
1128   <errorcopy name="IDChoice" number="14" ref="Value" />
1129   <errorcopy name="Name" number="15" ref="Request" />
1130   <errorcopy name="Length" number="16" ref="Request" />
1131   <errorcopy name="Implementation" number="17" ref="Request" />
1132
1133
1134
1135   <!-- The core requests, in major number order. -->
1136   <!-- It is the caller's responsibility to free returned XCB*Rep objects. -->
1137
1138
1139
1140   <enum name="WindowClass">
1141     <item name="CopyFromParent"><value>0</value></item>
1142     <item name="InputOutput">   <value>1</value></item>
1143     <item name="InputOnly">     <value>2</value></item>
1144   </enum>
1145
1146   <!-- Window attributes for CreateWindow and ChangeWindowAttributes. -->
1147   <enum name="CW">
1148     <item name="BackPixmap">      <bit>0</bit></item>
1149     <item name="BackPixel">       <bit>1</bit></item>
1150     <item name="BorderPixmap">    <bit>2</bit></item>
1151     <item name="BorderPixel">     <bit>3</bit></item>
1152     <item name="BitGravity">      <bit>4</bit></item>
1153     <item name="WinGravity">      <bit>5</bit></item>
1154     <item name="BackingStore">    <bit>6</bit></item>
1155     <item name="BackingPlanes">   <bit>7</bit></item>
1156     <item name="BackingPixel">    <bit>8</bit></item>
1157     <item name="OverrideRedirect"><bit>9</bit></item>
1158     <item name="SaveUnder">       <bit>10</bit></item>
1159     <item name="EventMask">       <bit>11</bit></item>
1160     <item name="DontPropagate">   <bit>12</bit></item>
1161     <item name="Colormap">        <bit>13</bit></item>
1162     <item name="Cursor">          <bit>14</bit></item>
1163     <doc>
1164       <field name="BackPixmap"><![CDATA[
1165 Overrides the default background-pixmap. The background pixmap and window must
1166 have the same root and same depth. Any size pixmap can be used, although some
1167 sizes may be faster than others.
1168
1169 If `XCB_BACK_PIXMAP_NONE` is specified, the window has no defined background.
1170 The server may fill the contents with the previous screen contents or with
1171 contents of its own choosing.
1172
1173 If `XCB_BACK_PIXMAP_PARENT_RELATIVE` is specified, the parent's background is
1174 used, but the window must have the same depth as the parent (or a Match error
1175 results).   The parent's background is tracked, and the current version is
1176 used each time the window background is required.
1177       ]]></field>
1178       <field name="BackPixel"><![CDATA[
1179 Overrides `BackPixmap`. A pixmap of undefined size filled with the specified
1180 background pixel is used for the background. Range-checking is not performed,
1181 the background pixel is truncated to the appropriate number of bits.
1182       ]]></field>
1183       <field name="BorderPixmap"><![CDATA[
1184 Overrides the default border-pixmap. The border pixmap and window must have the
1185 same root and the same depth. Any size pixmap can be used, although some sizes
1186 may be faster than others.
1187
1188 The special value `XCB_COPY_FROM_PARENT` means the parent's border pixmap is
1189 copied (subsequent changes to the parent's border attribute do not affect the
1190 child), but the window must have the same depth as the parent.
1191       ]]></field>
1192       <field name="BorderPixel"><![CDATA[
1193 Overrides `BorderPixmap`. A pixmap of undefined size filled with the specified
1194 border pixel is used for the border. Range checking is not performed on the
1195 border-pixel value, it is truncated to the appropriate number of bits.
1196       ]]></field>
1197       <field name="BitGravity"><![CDATA[
1198 Defines which region of the window should be retained if the window is resized.
1199       ]]></field>
1200       <field name="WinGravity"><![CDATA[
1201 Defines how the window should be repositioned if the parent is resized (see
1202 `ConfigureWindow`).
1203       ]]></field>
1204       <field name="BackingStore"><![CDATA[
1205 A backing-store of `WhenMapped` advises the server that maintaining contents of
1206 obscured regions when the window is mapped would be beneficial. A backing-store
1207 of `Always` advises the server that maintaining contents even when the window
1208 is unmapped would be beneficial. In this case, the server may generate an
1209 exposure event when the window is created. A value of `NotUseful` advises the
1210 server that maintaining contents is unnecessary, although a server may still
1211 choose to maintain contents while the window is mapped. Note that if the server
1212 maintains contents, then the server should maintain complete contents not just
1213 the region within the parent boundaries, even if the window is larger than its
1214 parent. While the server maintains contents, exposure events will not normally
1215 be generated, but the server may stop maintaining contents at any time.
1216       ]]></field>
1217       <field name="BackingPlanes"><![CDATA[
1218 The backing-planes indicates (with bits set to 1) which bit planes of the
1219 window hold dynamic data that must be preserved in backing-stores and during
1220 save-unders.
1221       ]]></field>
1222       <field name="BackingPixel"><![CDATA[
1223 The backing-pixel specifies what value to use in planes not covered by
1224 backing-planes. The server is free to save only the specified bit planes in the
1225 backing-store or save-under and regenerate the remaining planes with the
1226 specified pixel value. Any bits beyond the specified depth of the window in
1227 these values are simply ignored.
1228       ]]></field>
1229       <field name="OverrideRedirect"><![CDATA[
1230 The override-redirect specifies whether map and configure requests on this
1231 window should override a SubstructureRedirect on the parent, typically to
1232 inform a window manager not to tamper with the window.
1233       ]]></field>
1234       <field name="SaveUnder"><![CDATA[
1235 If 1, the server is advised that when this window is mapped, saving the
1236 contents of windows it obscures would be beneficial.
1237       ]]></field>
1238       <field name="EventMask"><![CDATA[
1239 The event-mask defines which events the client is interested in for this window
1240 (or for some event types, inferiors of the window).
1241       ]]></field>
1242       <field name="DontPropagate"><![CDATA[
1243 The do-not-propagate-mask defines which events should not be propagated to
1244 ancestor windows when no client has the event type selected in this window.
1245       ]]></field>
1246       <field name="Colormap"><![CDATA[
1247 The colormap specifies the colormap that best reflects the true colors of the window. Servers
1248 capable of supporting multiple hardware colormaps may use this information, and window man-
1249 agers may use it for InstallColormap requests. The colormap must have the same visual type
1250 and root as the window (or a Match error results). If CopyFromParent is specified, the parent's
1251 colormap is copied (subsequent changes to the parent's colormap attribute do not affect the child).
1252 However, the window must have the same visual type as the parent (or a Match error results),
1253 and the parent must not have a colormap of None (or a Match error results). For an explanation
1254 of None, see FreeColormap request. The colormap is copied by sharing the colormap object
1255 between the child and the parent, not by making a complete copy of the colormap contents.
1256       ]]></field>
1257       <field name="Cursor"><![CDATA[
1258 If a cursor is specified, it will be used whenever the pointer is in the window. If None is speci-
1259 fied, the parent's cursor will be used when the pointer is in the window, and any change in the
1260 parent's cursor will cause an immediate change in the displayed cursor.
1261       ]]></field>
1262     </doc>
1263   </enum>
1264   
1265   <enum name="BackPixmap">
1266     <item name="None">          <value>0</value></item>
1267     <item name="ParentRelative"><value>1</value></item>
1268   </enum>
1269
1270   <enum name="Gravity">
1271     <item name="BitForget"><value>0</value></item>
1272     <item name="WinUnmap"> <value>0</value></item>
1273     <item name="NorthWest"><value>1</value></item>
1274     <item name="North">    <value>2</value></item>
1275     <item name="NorthEast"><value>3</value></item>
1276     <item name="West">     <value>4</value></item>
1277     <item name="Center">   <value>5</value></item>
1278     <item name="East">     <value>6</value></item>
1279     <item name="SouthWest"><value>7</value></item>
1280     <item name="South">    <value>8</value></item>
1281     <item name="SouthEast"><value>9</value></item>
1282     <item name="Static">   <value>10</value></item>
1283   </enum>
1284
1285   <request name="CreateWindow" opcode="1">
1286     <field type="CARD8" name="depth" />
1287     <field type="WINDOW" name="wid" />
1288     <field type="WINDOW" name="parent" />
1289     <field type="INT16" name="x" />
1290     <field type="INT16" name="y" />
1291     <field type="CARD16" name="width" />
1292     <field type="CARD16" name="height" />
1293     <field type="CARD16" name="border_width" />
1294     <field type="CARD16" name="class" enum="WindowClass" />
1295     <field type="VISUALID" name="visual" />
1296     <valueparam value-mask-type="CARD32"
1297                 value-mask-name="value_mask"
1298                 value-list-name="value_list" />
1299     <doc>
1300       <brief>Creates a window</brief>
1301       <description><![CDATA[
1302 Creates an unmapped window as child of the specified `parent` window. A
1303 CreateNotify event will be generated. The new window is placed on top in the
1304 stacking order with respect to siblings.
1305
1306 The coordinate system has the X axis horizontal and the Y axis vertical with
1307 the origin [0, 0] at the upper-left corner. Coordinates are integral, in terms
1308 of pixels, and coincide with pixel centers. Each window and pixmap has its own
1309 coordinate system. For a window, the origin is inside the border at the inside,
1310 upper-left corner.
1311
1312 The created window is not yet displayed (mapped), call `xcb_map_window` to
1313 display it.
1314
1315 The created window will initially use the same cursor as its parent.
1316       ]]></description>
1317       <field name="wid"><![CDATA[
1318 The ID with which you will refer to the new window, created by
1319 `xcb_generate_id`.
1320       ]]></field>
1321       <field name="depth"><![CDATA[
1322 Specifies the new window's depth (TODO: what unit?).
1323
1324 The special value `XCB_COPY_FROM_PARENT` means the depth is taken from the
1325 `parent` window.
1326       ]]></field>
1327       <field name="visual"><![CDATA[
1328 Specifies the id for the new window's visual.
1329
1330 The special value `XCB_COPY_FROM_PARENT` means the visual is taken from the
1331 `parent` window.
1332       ]]></field>
1333       <field name="class"></field>
1334       <field name="parent"><![CDATA[
1335 The parent window of the new window.
1336       ]]></field>
1337       <field name="border_width"><![CDATA[
1338       TODO:
1339
1340 Must be zero if the `class` is `InputOnly` or a `xcb_match_error_t` occurs.
1341       ]]></field>
1342       <field name="x"><![CDATA[The X coordinate of the new window.]]></field>
1343       <field name="y"><![CDATA[The Y coordinate of the new window.]]></field>
1344       <field name="width"><![CDATA[The width of the new window.]]></field>
1345       <field name="height"><![CDATA[The height of the new window.]]></field>
1346       <error type="Colormap"><![CDATA[
1347 TODO: reasons?
1348       ]]></error>
1349       <error type="Match"><![CDATA[
1350 TODO: reasons?
1351       ]]></error>
1352       <error type="Cursor"><![CDATA[
1353 TODO: reasons?
1354       ]]></error>
1355       <error type="Pixmap"><![CDATA[
1356 TODO: reasons?
1357       ]]></error>
1358       <error type="Value"><![CDATA[
1359 TODO: reasons?
1360       ]]></error>
1361       <error type="Window"><![CDATA[
1362 TODO: reasons?
1363       ]]></error>
1364       <error type="Alloc"><![CDATA[
1365 The X server could not allocate the requested resources (no memory?).
1366       ]]></error>
1367       <see type="function" name="xcb_generate_id" />
1368       <see type="request" name="MapWindow" />
1369       <see type="event" name="CreateNotify" />
1370     </doc>
1371
1372   </request>
1373
1374   <request name="ChangeWindowAttributes" opcode="2">
1375     <pad bytes="1" />
1376     <field type="WINDOW" name="window" />
1377     <valueparam value-mask-type="CARD32"
1378                 value-mask-name="value_mask"
1379                 value-list-name="value_list" />
1380     <doc>
1381       <brief>change window attributes</brief>
1382       <description><![CDATA[
1383 Changes the attributes specified by `value_mask` for the specified `window`.
1384       ]]></description>
1385       <field name="window"><![CDATA[
1386 The window to change.
1387       ]]></field>
1388       <!-- the enum documentation is good enough. -->
1389       <field name="value_mask" />
1390       <field name="value_list"><![CDATA[
1391 Values for each of the attributes specified in the bitmask `value_mask`. The
1392 order has to correspond to the order of possible `value_mask` bits. See the
1393 example.
1394       ]]></field>
1395       <error type="Access"><![CDATA[
1396 TODO: reasons?
1397       ]]></error>
1398       <error type="Colormap"><![CDATA[
1399 TODO: reasons?
1400       ]]></error>
1401       <error type="Cursor"><![CDATA[
1402 TODO: reasons?
1403       ]]></error>
1404       <error type="Match"><![CDATA[
1405 TODO: reasons?
1406       ]]></error>
1407       <error type="Pixmap"><![CDATA[
1408 TODO: reasons?
1409       ]]></error>
1410       <error type="Value"><![CDATA[
1411 TODO: reasons?
1412       ]]></error>
1413       <error type="Window"><![CDATA[
1414 The specified `window` does not exist.
1415       ]]></error>
1416     </doc>
1417   </request>
1418   
1419   <enum name="MapState">
1420     <item name="Unmapped">  <value>0</value></item>
1421     <item name="Unviewable"><value>1</value></item>
1422     <item name="Viewable">  <value>2</value></item>
1423   </enum>
1424
1425   <request name="GetWindowAttributes" opcode="3">
1426     <pad bytes="1" />
1427     <field type="WINDOW" name="window" />
1428     <reply>
1429       <field type="CARD8" name="backing_store" enum="BackingStore" />
1430       <field type="VISUALID" name="visual" />
1431       <field type="CARD16" name="class" enum="WindowClass" />
1432       <field type="CARD8" name="bit_gravity" enum="Gravity" />
1433       <field type="CARD8" name="win_gravity" enum="Gravity" />
1434       <field type="CARD32" name="backing_planes" />
1435       <field type="CARD32" name="backing_pixel" />
1436       <field type="BOOL" name="save_under" />
1437       <field type="BOOL" name="map_is_installed" />
1438       <field type="CARD8" name="map_state" enum="MapState" />
1439       <field type="BOOL" name="override_redirect" />
1440       <field type="COLORMAP" name="colormap" altenum="Colormap" />
1441       <field type="CARD32" name="all_event_masks" mask="EventMask" />
1442       <field type="CARD32" name="your_event_mask" mask="EventMask" />
1443       <field type="CARD16" name="do_not_propagate_mask" mask="EventMask" />
1444       <pad bytes="2" />
1445       <doc>
1446         <field name="override_redirect"><![CDATA[
1447 Window managers should ignore this window if `override_redirect` is 1.
1448         ]]></field>
1449         <field name="visual"><![CDATA[
1450 The associated visual structure of `window`.
1451         ]]></field>
1452         <field name="backing_planes"><![CDATA[
1453 Planes to be preserved if possible.
1454         ]]></field>
1455         <field name="backing_pixel"><![CDATA[
1456 Value to be used when restoring planes.
1457         ]]></field>
1458         <field name="save_under"><![CDATA[
1459 Boolean, should bits under be saved?
1460         ]]></field>
1461         <field name="colormap"><![CDATA[
1462 Color map to be associated with window.
1463         ]]></field>
1464         <field name="all_event_masks"><![CDATA[
1465 Set of events all people have interest in.
1466         ]]></field>
1467         <field name="your_event_mask"><![CDATA[
1468 My event mask.
1469         ]]></field>
1470         <field name="do_not_propagate_mask"><![CDATA[
1471 Set of events that should not propagate.
1472         ]]></field>
1473         <!-- enum documentation is sufficient for these fields -->
1474         <field name="backing_store" />
1475         <field name="class" />
1476         <field name="bit_gravity" />
1477         <field name="win_gravity" />
1478         <field name="map_state" />
1479       </doc>
1480     </reply>
1481     <doc>
1482       <brief>Gets window attributes</brief>
1483       <description><![CDATA[
1484 Gets the current attributes for the specified `window`.
1485       ]]></description>
1486       <field name="window"><![CDATA[The window to get the attributes from.]]></field>
1487       <error type="Window"><![CDATA[
1488 The specified `window` does not exist.
1489       ]]></error>
1490       <error type="Drawable"><![CDATA[
1491 TODO: reasons?
1492       ]]></error>
1493     </doc>
1494
1495   </request>
1496
1497   <request name="DestroyWindow" opcode="4">
1498     <pad bytes="1" />
1499     <field type="WINDOW" name="window" />
1500     <doc>
1501       <brief>Destroys a window</brief>
1502       <description><![CDATA[
1503 Destroys the specified window and all of its subwindows. A DestroyNotify event
1504 is generated for each destroyed window (a DestroyNotify event is first generated
1505 for any given window's inferiors). If the window was mapped, it will be
1506 automatically unmapped before destroying.
1507
1508 Calling DestroyWindow on the root window will do nothing.
1509       ]]></description>
1510       <field name="window"><![CDATA[The window to destroy.]]></field>
1511       <error type="Window"><![CDATA[
1512 The specified window does not exist.
1513       ]]></error>
1514       <see type="event" name="DestroyNotify" />
1515       <see type="request" name="MapWindow" />
1516       <see type="request" name="UnmapWindow" />
1517     </doc>
1518   </request>
1519
1520   <request name="DestroySubwindows" opcode="5">
1521     <pad bytes="1" />
1522     <field type="WINDOW" name="window" />
1523   </request>
1524   
1525   <enum name="SetMode">
1526     <item name="Insert"><value>0</value></item>
1527     <item name="Delete"><value>1</value></item>
1528   </enum>
1529
1530   <request name="ChangeSaveSet" opcode="6">
1531     <field type="BYTE" name="mode" enum="SetMode" />
1532     <field type="WINDOW" name="window" />
1533     <doc>
1534       <brief>Changes a client's save set</brief>
1535       <description><![CDATA[
1536 TODO: explain what the save set is for.
1537
1538 This function either adds or removes the specified window to the client's (your
1539 application's) save set.
1540       ]]></description>
1541       <field name="mode"><![CDATA[Insert to add the specified window to the save set or Delete to delete it from the save set.]]></field>
1542       <field name="window"><![CDATA[The window to add or delete to/from your save set.]]></field>
1543       <error type="Match"><![CDATA[
1544 You created the specified window. This does not make sense, you can only add
1545 windows created by other clients to your save set.
1546       ]]></error>
1547       <error type="Value"><![CDATA[
1548 You specified an invalid mode.
1549       ]]></error>
1550       <error type="Window"><![CDATA[
1551 The specified window does not exist.
1552       ]]></error>
1553       <see type="request" name="ReparentWindow" />
1554     </doc>
1555   </request>
1556
1557   <request name="ReparentWindow" opcode="7">
1558     <pad bytes="1" />
1559     <field type="WINDOW" name="window" />
1560     <field type="WINDOW" name="parent" />
1561     <field type="INT16" name="x" />
1562     <field type="INT16" name="y" />
1563     <doc>
1564       <brief>Reparents a window</brief>
1565       <description><![CDATA[
1566 Makes the specified window a child of the specified parent window. If the
1567 window is mapped, it will automatically be unmapped before reparenting and
1568 re-mapped after reparenting. The window is placed in the stacking order on top
1569 with respect to sibling windows.
1570
1571 After reparenting, a ReparentNotify event is generated.
1572       ]]></description>
1573       <field name="window"><![CDATA[The window to reparent.]]></field>
1574       <field name="parent"><![CDATA[The new parent of the window.]]></field>
1575       <field name="x"><![CDATA[
1576 The X position of the window within its new parent.
1577       ]]></field>
1578       <field name="y"><![CDATA[
1579 The Y position of the window within its new parent.
1580       ]]></field>
1581       <error type="Match"><![CDATA[
1582 The new parent window is not on the same screen as the old parent window.
1583
1584 The new parent window is the specified window or an inferior of the specified window.
1585
1586 The new parent is InputOnly and the window is not.
1587
1588 The specified window has a ParentRelative background and the new parent window is not the same depth as the specified window.
1589       ]]></error>
1590       <error type="Window"><![CDATA[
1591 The specified window does not exist.
1592       ]]></error>
1593       <see type="event" name="ReparentNotify" />
1594       <see type="request" name="MapWindow" />
1595       <see type="request" name="UnmapWindow" />
1596     </doc>
1597   </request>
1598
1599   <request name="MapWindow" opcode="8">
1600     <pad bytes="1" />
1601     <field type="WINDOW" name="window" />
1602     <doc>
1603       <brief>Makes a window visible</brief>
1604       <description><![CDATA[
1605 Maps the specified window. This means making the window visible (as long as its
1606 parent is visible).
1607
1608 This MapWindow request will be translated to a MapRequest request if a window
1609 manager is running. The window manager then decides to either map the window or
1610 not. Set the override-redirect window attribute to true if you want to bypass
1611 this mechanism.
1612
1613 If the window manager decides to map the window (or if no window manager is
1614 running), a MapNotify event is generated.
1615
1616 If the window becomes viewable and no earlier contents for it are remembered,
1617 the X server tiles the window with its background. If the window's background
1618 is undefined, the existing screen contents are not altered, and the X server
1619 generates zero or more Expose events.
1620
1621 If the window type is InputOutput, an Expose event will be generated when the
1622 window becomes visible. The normal response to an Expose event should be to
1623 repaint the window.
1624       ]]></description>
1625       <field name="window"><![CDATA[
1626 The window to make visible.
1627 ]]></field>
1628       <error type="Match"><![CDATA[
1629 The specified window does not exist.
1630       ]]></error>
1631       <see type="event" name="MapNotify" />
1632       <see type="event" name="Expose" />
1633       <see type="request" name="UnmapWindow" />
1634     </doc>
1635   </request>
1636
1637   <request name="MapSubwindows" opcode="9">
1638     <pad bytes="1" />
1639     <field type="WINDOW" name="window" />
1640   </request>
1641
1642   <request name="UnmapWindow" opcode="10">
1643     <pad bytes="1" />
1644     <field type="WINDOW" name="window" />
1645     <doc>
1646       <brief>Makes a window invisible</brief>
1647       <description><![CDATA[
1648 Unmaps the specified window. This means making the window invisible (and all
1649 its child windows).
1650
1651 Unmapping a window leads to the `UnmapNotify` event being generated. Also,
1652 `Expose` events are generated for formerly obscured windows.
1653       ]]></description>
1654       <field name="window"><![CDATA[
1655 The window to make invisible.
1656 ]]></field>
1657       <error type="Window"><![CDATA[
1658 The specified window does not exist.
1659       ]]></error>
1660       <see type="event" name="UnmapNotify" />
1661       <see type="event" name="Expose" />
1662       <see type="request" name="MapWindow" />
1663     </doc>
1664   </request>
1665
1666   <request name="UnmapSubwindows" opcode="11">
1667     <pad bytes="1" />
1668     <field type="WINDOW" name="window" />
1669   </request>
1670   
1671   <enum name="ConfigWindow">
1672     <item name="X">          <bit>0</bit></item>
1673     <item name="Y">          <bit>1</bit></item>
1674     <item name="Width">      <bit>2</bit></item>
1675     <item name="Height">     <bit>3</bit></item>
1676     <item name="BorderWidth"><bit>4</bit></item>
1677     <item name="Sibling">    <bit>5</bit></item>
1678     <item name="StackMode">  <bit>6</bit></item>
1679   </enum>
1680   
1681   <enum name="StackMode">
1682     <item name="Above">   <value>0</value></item>
1683     <item name="Below">   <value>1</value></item>
1684     <item name="TopIf">   <value>2</value></item>
1685     <item name="BottomIf"><value>3</value></item>
1686     <item name="Opposite"><value>4</value></item>
1687   </enum>
1688
1689   <request name="ConfigureWindow" opcode="12">
1690     <pad bytes="1" />
1691     <field type="WINDOW" name="window" />
1692     <field type="CARD16" name="value_mask" />
1693     <pad bytes="2" />
1694     <valueparam value-mask-type="CARD16"
1695                 value-mask-name="value_mask"
1696                 value-list-name="value_list" />
1697     <doc>
1698       <brief>Configures window attributes</brief>
1699       <description><![CDATA[
1700 Configures a window's size, position, border width and stacking order.
1701       ]]></description>
1702       <example><![CDATA[
1703 /*
1704  * Configures the given window to the left upper corner
1705  * with a size of 1024x768 pixels.
1706  *
1707  */
1708 void my_example(xcb_connection *c, xcb_window_t window) {
1709     uint16_t mask = 0;
1710
1711     mask |= XCB_CONFIG_WINDOW_X;
1712     mask |= XCB_CONFIG_WINDOW_Y;
1713     mask |= XCB_CONFIG_WINDOW_WIDTH;
1714     mask |= XCB_CONFIG_WINDOW_HEIGHT;
1715
1716     const uint32_t values[] = {
1717         0,    /* x */
1718         0,    /* y */
1719         1024, /* width */
1720         768   /* height */
1721     };
1722
1723     xcb_configure_window(c, window, mask, values);
1724     xcb_flush(c);
1725 }
1726       ]]></example>
1727       <field name="window"><![CDATA[The window to configure.]]></field>
1728       <field name="value_mask"><![CDATA[Bitmask of attributes to change.]]></field>
1729       <field name="value_list"><![CDATA[
1730 New values, corresponding to the attributes in value_mask. The order has to
1731 correspond to the order of possible `value_mask` bits. See the example.
1732       ]]></field>
1733       <error type="Match"><![CDATA[
1734 You specified a Sibling without also specifying StackMode or the window is not
1735 actually a Sibling.
1736       ]]></error>
1737       <error type="Window"><![CDATA[
1738 The specified window does not exist. TODO: any other reason?
1739       ]]></error>
1740       <error type="Value"><![CDATA[
1741 TODO: reasons?
1742       ]]></error>
1743       <see type="event" name="MapNotify" />
1744       <see type="event" name="Expose" />
1745     </doc>
1746   </request>
1747
1748   <enum name="Circulate">
1749     <item name="RaiseLowest"> <value>0</value></item>
1750     <item name="LowerHighest"><value>1</value></item>
1751   </enum>
1752
1753   <request name="CirculateWindow" opcode="13">
1754     <field type="CARD8" name="direction" enum="Circulate" />
1755     <field type="WINDOW" name="window" />
1756     <doc>
1757       <brief>Change window stacking order</brief>
1758       <description><![CDATA[
1759 If `direction` is `XCB_CIRCULATE_RAISE_LOWEST`, the lowest mapped child (if
1760 any) will be raised to the top of the stack.
1761
1762 If `direction` is `XCB_CIRCULATE_LOWER_HIGHEST`, the highest mapped child will
1763 be lowered to the bottom of the stack.
1764       ]]></description>
1765       <!-- The enums are documented, we have nothing to add. -->
1766       <field name="direction" />
1767       <field name="window"><![CDATA[
1768 The window to raise/lower (depending on `direction`).
1769       ]]></field>
1770       <error type="Window"><![CDATA[
1771 The specified `window` does not exist.
1772       ]]></error>
1773       <error type="Value"><![CDATA[
1774 The specified `direction` is invalid.
1775       ]]></error>
1776     </doc>
1777   </request>
1778
1779   <request name="GetGeometry" opcode="14">
1780     <pad bytes="1" />
1781     <field type="DRAWABLE" name="drawable" />
1782     <reply>
1783       <field type="CARD8" name="depth" />
1784       <field type="WINDOW" name="root" />
1785       <field type="INT16" name="x" />
1786       <field type="INT16" name="y" />
1787       <field type="CARD16" name="width" />
1788       <field type="CARD16" name="height" />
1789       <field type="CARD16" name="border_width" />
1790       <pad bytes="2" />
1791       <doc>
1792       <field name="root"><![CDATA[
1793 Root window of the screen containing `drawable`.
1794       ]]></field>
1795       <field name="x"><![CDATA[
1796 The X coordinate of `drawable`. If `drawable` is a window, the coordinate
1797 specifies the upper-left outer corner relative to its parent's origin. If
1798 `drawable` is a pixmap, the X coordinate is always 0.
1799       ]]></field>
1800       <field name="y"><![CDATA[
1801 The Y coordinate of `drawable`. If `drawable` is a window, the coordinate
1802 specifies the upper-left outer corner relative to its parent's origin. If
1803 `drawable` is a pixmap, the Y coordinate is always 0.
1804       ]]></field>
1805       <field name="width"><![CDATA[
1806 The width of `drawable`.
1807       ]]></field>
1808       <field name="height"><![CDATA[
1809 The height of `drawable`.
1810       ]]></field>
1811       <field name="border_width"><![CDATA[
1812 The border width (in pixels).
1813       ]]></field>
1814       <field name="depth"><![CDATA[
1815 The depth of the drawable (bits per pixel for the object).
1816       ]]></field>
1817       </doc>
1818     </reply>
1819     <doc>
1820       <brief>Get current window geometry</brief>
1821       <description><![CDATA[
1822 Gets the current geometry of the specified drawable (either `Window` or `Pixmap`).
1823       ]]></description>
1824       <example><![CDATA[
1825 /*
1826  * Displays the x and y position of the given window.
1827  *
1828  */
1829 void my_example(xcb_connection *c, xcb_window_t window) {
1830     xcb_get_geometry_cookie_t cookie;
1831     xcb_get_geometry_reply_t *reply;
1832
1833     cookie = xcb_get_geometry(c, window);
1834     /* ... do other work here if possible ... */
1835     if ((reply = xcb_get_geometry_reply(c, cookie, NULL))) {
1836         printf("This window is at %d, %d\\n", reply->x, reply->y);
1837     }
1838     free(reply);
1839 }
1840       ]]></example>
1841       <field name="drawable"><![CDATA[
1842 The drawable (`Window` or `Pixmap`) of which the geometry will be received.
1843       ]]></field>
1844       <error type="Drawable"><![CDATA[
1845 TODO: reasons?
1846       ]]></error>
1847       <error type="Window"><![CDATA[
1848 TODO: reasons?
1849       ]]></error>
1850       <see type="program" name="xwininfo" />
1851     </doc>
1852   </request>
1853
1854   <request name="QueryTree" opcode="15">
1855     <pad bytes="1" />
1856     <field type="WINDOW" name="window" />
1857     <reply>
1858       <pad bytes="1" />
1859       <field type="WINDOW" name="root" />
1860       <field type="WINDOW" name="parent" altenum="Window" />
1861       <field type="CARD16" name="children_len" />
1862       <pad bytes="14" />
1863       <list type="WINDOW" name="children">
1864         <fieldref>children_len</fieldref>
1865       </list>
1866       <doc>
1867         <field name="root"><![CDATA[
1868 The root window of `window`.
1869         ]]></field>
1870         <field name="parent"><![CDATA[
1871 The parent window of `window`.
1872         ]]></field>
1873         <field name="children_len"><![CDATA[
1874 The number of child windows.
1875         ]]></field>
1876       </doc>
1877     </reply>
1878     <doc>
1879       <brief>query the window tree</brief>
1880       <description><![CDATA[
1881 Gets the root window ID, parent window ID and list of children windows for the
1882 specified `window`. The children are listed in bottom-to-top stacking order.
1883       ]]></description>
1884       <example><![CDATA[
1885 /*
1886  * Displays the root, parent and children of the specified window.
1887  *
1888  */
1889 void my_example(xcb_connection *conn, xcb_window_t window) {
1890     xcb_query_tree_cookie_t cookie;
1891     xcb_query_tree_reply_t *reply;
1892
1893     cookie = xcb_query_tree(conn, window);
1894     if ((reply = xcb_query_tree_reply(conn, cookie, NULL))) {
1895         printf("root = 0x%08x\\n", reply->root);
1896         printf("parent = 0x%08x\\n", reply->parent);
1897
1898         xcb_window_t *children = xcb_query_tree_children(reply);
1899         for (int i = 0; i < xcb_query_tree_children_length(reply); i++)
1900             printf("child window = 0x%08x\\n", children[i]);
1901
1902         free(reply);
1903     }
1904 }
1905       ]]></example>
1906       <field name="window"><![CDATA[
1907 The `window` to query.
1908       ]]></field>
1909       <see type="program" name="xwininfo" />
1910     </doc>
1911   </request>
1912
1913   <request name="InternAtom" opcode="16">
1914     <field type="BOOL" name="only_if_exists" />
1915     <field type="CARD16" name="name_len" />
1916     <pad bytes="2" />
1917     <list type="char" name="name">
1918       <fieldref>name_len</fieldref>
1919     </list>
1920     <reply>
1921       <pad bytes="1" />
1922       <field type="ATOM" name="atom" altenum="Atom" />
1923     </reply>
1924     <doc>
1925       <brief>Get atom identifier by name</brief>
1926       <description><![CDATA[
1927 Retrieves the identifier (xcb_atom_t TODO) for the atom with the specified
1928 name. Atoms are used in protocols like EWMH, for example to store window titles
1929 (`_NET_WM_NAME` atom) as property of a window.
1930
1931 If `only_if_exists` is 0, the atom will be created if it does not already exist.
1932 If `only_if_exists` is 1, `XCB_ATOM_NONE` will be returned if the atom does
1933 not yet exist.
1934       ]]></description>
1935       <example><![CDATA[
1936 /*
1937  * Resolves the _NET_WM_NAME atom.
1938  *
1939  */
1940 void my_example(xcb_connection *c) {
1941     xcb_intern_atom_cookie_t cookie;
1942     xcb_intern_atom_reply_t *reply;
1943
1944     cookie = xcb_intern_atom(c, 0, strlen("_NET_WM_NAME"), "_NET_WM_NAME");
1945     /* ... do other work here if possible ... */
1946     if ((reply = xcb_intern_atom_reply(c, cookie, NULL))) {
1947         printf("The _NET_WM_NAME atom has ID %u\n", reply->atom);
1948         free(reply);
1949     }
1950 }
1951       ]]></example>
1952       <field name="name_len"><![CDATA[
1953 The length of the following `name`.
1954       ]]></field>
1955       <field name="name"><![CDATA[
1956 The name of the atom.
1957       ]]></field>
1958       <field name="only_if_exists"><![CDATA[
1959 Return a valid atom id only if the atom already exists.
1960       ]]></field>
1961       <error type="Alloc"><![CDATA[
1962 TODO: reasons?
1963       ]]></error>
1964       <error type="Value"><![CDATA[
1965 A value other than 0 or 1 was specified for `only_if_exists`.
1966       ]]></error>
1967       <see type="program" name="xlsatoms" />
1968       <see type="request" name="GetAtomName" />
1969     </doc>
1970
1971   </request>
1972
1973   <request name="GetAtomName" opcode="17">
1974     <pad bytes="1" />
1975     <field type="ATOM" name="atom" />
1976     <reply>
1977       <pad bytes="1" />
1978       <field type="CARD16" name="name_len" />
1979       <pad bytes="22" />
1980       <list type="char" name="name">
1981         <fieldref>name_len</fieldref>
1982       </list>
1983     </reply>
1984   </request>
1985   
1986   <enum name="PropMode">
1987     <item name="Replace"><value>0</value></item>
1988     <item name="Prepend"><value>1</value></item>
1989     <item name="Append"> <value>2</value></item>
1990     <doc>
1991       <field name="Replace"><![CDATA[
1992 Discard the previous property value and store the new data.
1993       ]]></field>
1994       <field name="Prepend"><![CDATA[
1995 Insert the new data before the beginning of existing data. The `format` must
1996 match existing property value. If the property is undefined, it is treated as
1997 defined with the correct type and format with zero-length data.
1998       ]]></field>
1999       <field name="Append"><![CDATA[
2000 Insert the new data after the beginning of existing data. The `format` must
2001 match existing property value. If the property is undefined, it is treated as
2002 defined with the correct type and format with zero-length data.
2003       ]]></field>
2004     </doc>
2005   </enum>
2006
2007   <request name="ChangeProperty" opcode="18">
2008     <field type="CARD8" name="mode" enum="PropMode" />
2009     <field type="WINDOW" name="window" />
2010     <field type="ATOM" name="property" />
2011     <field type="ATOM" name="type" />
2012     <field type="CARD8" name="format" />
2013     <pad bytes="3" />
2014     <field type="CARD32" name="data_len" />
2015     <list type="void" name="data">
2016       <op op="/">
2017         <op op="*">
2018           <fieldref>data_len</fieldref>
2019           <fieldref>format</fieldref>
2020         </op>
2021         <value>8</value>
2022       </op>
2023     </list>
2024     <doc>
2025       <brief>Changes a window property</brief>
2026       <description><![CDATA[
2027 Sets or updates a property on the specified `window`. Properties are for
2028 example the window title (`WM_NAME`) or its minimum size (`WM_NORMAL_HINTS`).
2029 Protocols such as EWMH also use properties - for example EWMH defines the
2030 window title, encoded as UTF-8 string, in the `_NET_WM_NAME` property.
2031       ]]></description>
2032       <example><![CDATA[
2033 /*
2034  * Sets the WM_NAME property of the window to "XCB Example".
2035  *
2036  */
2037 void my_example(xcb_connection *conn, xcb_window_t window) {
2038     xcb_change_property(conn,
2039         XCB_PROP_MODE_REPLACE,
2040         window,
2041         XCB_ATOM_WM_NAME,
2042         XCB_ATOM_STRING,
2043         8,
2044         strlen("XCB Example"),
2045         "XCB Example");
2046     xcb_flush(conn);
2047 }
2048       ]]></example>
2049       <field name="window"><![CDATA[
2050 The window whose property you want to change.
2051       ]]></field>
2052       <!-- the enum doc is sufficient. -->
2053       <field name="mode" />
2054       <field name="property"><![CDATA[
2055 The property you want to change (an atom).
2056       ]]></field>
2057       <field name="type"><![CDATA[
2058 The type of the property you want to change (an atom).
2059       ]]></field>
2060       <field name="format"><![CDATA[
2061 Specifies whether the data should be viewed as a list of 8-bit, 16-bit or
2062 32-bit quantities. Possible values are 8, 16 and 32. This information allows
2063 the X server to correctly perform byte-swap operations as necessary.
2064       ]]></field>
2065       <field name="data_len"><![CDATA[
2066 Specifies the number of elements (see `format`).
2067       ]]></field>
2068       <field name="data"><![CDATA[
2069 The property data.
2070       ]]></field>
2071       <error type="Match"><![CDATA[
2072 TODO: reasons?
2073       ]]></error>
2074       <error type="Value"><![CDATA[
2075 TODO: reasons?
2076       ]]></error>
2077       <error type="Window"><![CDATA[
2078 The specified `window` does not exist.
2079       ]]></error>
2080       <error type="Atom"><![CDATA[
2081 `property` or `type` do not refer to a valid atom.
2082       ]]></error>
2083       <error type="Alloc"><![CDATA[
2084 The X server could not store the property (no memory?).
2085       ]]></error>
2086       <see type="request" name="InternAtom" />
2087       <see type="program" name="xprop" />
2088     </doc>
2089   </request>
2090
2091   <request name="DeleteProperty" opcode="19">
2092     <pad bytes="1" />
2093     <field type="WINDOW" name="window" />
2094     <field type="ATOM" name="property" />
2095   </request>
2096   
2097   <enum name="GetPropertyType">
2098     <item name="Any"><value>0</value></item>
2099   </enum>
2100
2101   <request name="GetProperty" opcode="20">
2102     <field type="BOOL" name="delete" />
2103     <field type="WINDOW" name="window" />
2104     <field type="ATOM" name="property" />
2105     <field type="ATOM" name="type" altenum="GetPropertyType" />
2106     <field type="CARD32" name="long_offset" />
2107     <field type="CARD32" name="long_length" />
2108     <reply>
2109       <field type="CARD8" name="format" />
2110       <field type="ATOM" name="type" />
2111       <field type="CARD32" name="bytes_after" />
2112       <field type="CARD32" name="value_len" />
2113       <pad bytes="12" />
2114       <list type="void" name="value">
2115         <op op="*">
2116           <fieldref>value_len</fieldref>
2117           <op op="/">
2118             <fieldref>format</fieldref>
2119             <value>8</value>
2120           </op>
2121         </op>
2122       </list>
2123       <doc>
2124       <field name="format"><![CDATA[
2125 Specifies whether the data should be viewed as a list of 8-bit, 16-bit, or
2126 32-bit quantities. Possible values are 8, 16, and 32. This information allows
2127 the X server to correctly perform byte-swap operations as necessary.
2128       ]]></field>
2129       <field name="type"><![CDATA[
2130 The actual type of the property (an atom).
2131       ]]></field>
2132       <field name="bytes_after"><![CDATA[
2133 The number of bytes remaining to be read in the property if a partial read was
2134 performed.
2135       ]]></field>
2136       <field name="value_len"><![CDATA[
2137 The length of value. You should use the corresponding accessor instead of this
2138 field.
2139       ]]></field>
2140       </doc>
2141     </reply>
2142     <doc>
2143       <brief>Gets a window property</brief>
2144       <description><![CDATA[
2145 Gets the specified `property` from the specified `window`. Properties are for
2146 example the window title (`WM_NAME`) or its minimum size (`WM_NORMAL_HINTS`).
2147 Protocols such as EWMH also use properties - for example EWMH defines the
2148 window title, encoded as UTF-8 string, in the `_NET_WM_NAME` property.
2149
2150 TODO: talk about `type`
2151
2152 TODO: talk about `delete`
2153
2154 TODO: talk about the offset/length thing. what's a valid use case?
2155       ]]></description>
2156       <example><![CDATA[
2157 /*
2158  * Prints the WM_NAME property of the window.
2159  *
2160  */
2161 void my_example(xcb_connection *c, xcb_window_t window) {
2162     xcb_get_property_cookie_t cookie;
2163     xcb_get_property_reply_t *reply;
2164
2165     /* These atoms are predefined in the X11 protocol. */
2166     xcb_atom_t property = XCB_ATOM_WM_NAME;
2167     xcb_atom_t type = XCB_ATOM_STRING;
2168
2169     // TODO: a reasonable long_length for WM_NAME?
2170     cookie = xcb_get_property(c, 0, window, property, type, 0, 0);
2171     if ((reply = xcb_get_property_reply(c, cookie, NULL))) {
2172         int len = xcb_get_property_value_length(reply);
2173         if (len == 0) {
2174             printf("TODO\\n");
2175             free(reply);
2176             return;
2177         }
2178         printf("WM_NAME is %.*s\\n", len,
2179                (char*)xcb_get_property_value(reply));
2180     }
2181     free(reply);
2182 }
2183       ]]></example>
2184       <field name="window"><![CDATA[
2185 The window whose property you want to get.
2186       ]]></field>
2187       <field name="delete"><![CDATA[
2188 Whether the property should actually be deleted. For deleting a property, the
2189 specified `type` has to match the actual property type.
2190       ]]></field>
2191       <field name="property"><![CDATA[
2192 The property you want to get (an atom).
2193       ]]></field>
2194       <field name="type"><![CDATA[
2195 The type of the property you want to get (an atom).
2196       ]]></field>
2197       <field name="long_offset"><![CDATA[
2198 Specifies the offset (in 32-bit multiples) in the specified property where the
2199 data is to be retrieved.
2200       ]]></field>
2201       <field name="long_length"><![CDATA[
2202 Specifies how many 32-bit multiples of data should be retrieved (e.g. if you
2203 set `long_length` to 4, you will receive 16 bytes of data).
2204       ]]></field>
2205       <error type="Window"><![CDATA[
2206 The specified `window` does not exist.
2207       ]]></error>
2208       <error type="Atom"><![CDATA[
2209 `property` or `type` do not refer to a valid atom.
2210       ]]></error>
2211       <error type="Value"><![CDATA[
2212 The specified `long_offset` is beyond the actual property length (e.g. the
2213 property has a length of 3 bytes and you are setting `long_offset` to 1,
2214 resulting in a byte offset of 4).
2215       ]]></error>
2216       <see type="request" name="InternAtom" />
2217       <see type="program" name="xprop" />
2218     </doc>
2219   </request>
2220
2221   <request name="ListProperties" opcode="21">
2222     <pad bytes="1" />
2223     <field type="WINDOW" name="window" />
2224     <reply>
2225       <pad bytes="1" />
2226       <field type="CARD16" name="atoms_len" />
2227       <pad bytes="22" />
2228       <list type="ATOM" name="atoms">
2229         <fieldref>atoms_len</fieldref>
2230       </list>
2231     </reply>
2232   </request>
2233
2234   <request name="SetSelectionOwner" opcode="22">
2235     <pad bytes="1" />
2236     <field type="WINDOW" name="owner" altenum="Window" />
2237     <field type="ATOM" name="selection" />
2238     <field type="TIMESTAMP" name="time" altenum="Time" />
2239     <doc>
2240       <brief>Sets the owner of a selection</brief>
2241       <description><![CDATA[
2242 Makes `window` the owner of the selection `selection` and updates the
2243 last-change time of the specified selection.
2244
2245 TODO: briefly explain what a selection is.
2246       ]]></description>
2247       <field name="selection"><![CDATA[
2248 The selection.
2249       ]]></field>
2250       <field name="owner"><![CDATA[
2251 The new owner of the selection.
2252
2253 The special value `XCB_NONE` means that the selection will have no owner.
2254       ]]></field>
2255       <field name="time"><![CDATA[
2256 Timestamp to avoid race conditions when running X over the network.
2257
2258 The selection will not be changed if `time` is earlier than the current
2259 last-change time of the `selection` or is later than the current X server time.
2260 Otherwise, the last-change time is set to the specified time.
2261
2262 The special value `XCB_CURRENT_TIME` will be replaced with the current server
2263 time.
2264       ]]></field>
2265       <error type="Atom"><![CDATA[
2266 `selection` does not refer to a valid atom.
2267       ]]></error>
2268       <see type="request" name="SetSelectionOwner" />
2269     </doc>
2270
2271   </request>
2272
2273   <request name="GetSelectionOwner" opcode="23">
2274     <pad bytes="1" />
2275     <field type="ATOM" name="selection" />
2276     <reply>
2277       <pad bytes="1" />
2278       <field type="WINDOW" name="owner" altenum="Window" />
2279       <doc>
2280         <field name="owner"><![CDATA[
2281 The current selection owner window.
2282         ]]></field>
2283       </doc>
2284     </reply>
2285     <doc>
2286       <brief>Gets the owner of a selection</brief>
2287       <description><![CDATA[
2288 Gets the owner of the specified selection.
2289
2290 TODO: briefly explain what a selection is.
2291       ]]></description>
2292       <field name="selection"><![CDATA[
2293 The selection.
2294       ]]></field>
2295       <error type="Atom"><![CDATA[
2296 `selection` does not refer to a valid atom.
2297       ]]></error>
2298       <see type="request" name="SetSelectionOwner" />
2299     </doc>
2300   </request>
2301
2302   <request name="ConvertSelection" opcode="24">
2303     <pad bytes="1" />
2304     <field type="WINDOW" name="requestor" />
2305     <field type="ATOM" name="selection" />
2306     <field type="ATOM" name="target" />
2307     <field type="ATOM" name="property" altenum="Atom" />
2308     <field type="TIMESTAMP" name="time" altenum="Time" />
2309   </request>
2310
2311   <enum name="SendEventDest">
2312     <item name="PointerWindow"><value>0</value></item>
2313     <item name="ItemFocus">    <value>1</value></item>
2314   </enum>
2315
2316   <request name="SendEvent" opcode="25">
2317     <field type="BOOL" name="propagate" />
2318     <field type="WINDOW" name="destination" altenum="SendEventDest" />
2319     <field type="CARD32" name="event_mask" mask="EventMask" />
2320     <list type="char" name="event"><value>32</value></list>
2321     <doc>
2322       <brief>send an event</brief>
2323       <description><![CDATA[
2324 Identifies the `destination` window, determines which clients should receive
2325 the specified event and ignores any active grabs.
2326
2327 The `event` must be one of the core events or an event defined by an extension,
2328 so that the X server can correctly byte-swap the contents as necessary. The
2329 contents of `event` are otherwise unaltered and unchecked except for the
2330 `send_event` field which is forced to 'true'.
2331       ]]></description>
2332       <example><![CDATA[
2333 /*
2334  * Tell the given window that it was configured to a size of 800x600 pixels.
2335  *
2336  */
2337 void my_example(xcb_connection_t *conn, xcb_window_t window) {
2338     /* Every X11 event is 32 bytes long. Therefore, XCB will copy 32 bytes.
2339      * In order to properly initialize these bytes, we allocate 32 bytes even
2340      * though we only need less for an xcb_configure_notify_event_t */
2341     xcb_configure_notify_event_t *event = calloc(32, 1);
2342
2343     event->event = window;
2344     event->window = window;
2345     event->response_type = XCB_CONFIGURE_NOTIFY;
2346
2347     event->x = 0;
2348     event->y = 0;
2349     event->width = 800;
2350     event->height = 600;
2351
2352     event->border_width = 0;
2353     event->above_sibling = XCB_NONE;
2354     event->override_redirect = false;
2355
2356     xcb_send_event(conn, false, window, XCB_EVENT_MASK_STRUCTURE_NOTIFY,
2357                    (char*)event);
2358     xcb_flush(conn);
2359     free(event);
2360 }
2361       ]]></example>
2362       <field name="destination"><![CDATA[
2363 The window to send this event to. Every client which selects any event within
2364 `event_mask` on `destination` will get the event.
2365
2366 The special value `XCB_SEND_EVENT_DEST_POINTER_WINDOW` refers to the window
2367 that contains the mouse pointer.
2368
2369 The special value `XCB_SEND_EVENT_DEST_ITEM_FOCUS` refers to the window which
2370 has the keyboard focus.
2371       ]]></field>
2372       <field name="event_mask"><![CDATA[
2373 Event_mask for determining which clients should receive the specified event.
2374 See `destination` and `propagate`.
2375       ]]></field>
2376       <field name="propagate"><![CDATA[
2377 If `propagate` is true and no clients have selected any event on `destination`,
2378 the destination is replaced with the closest ancestor of `destination` for
2379 which some client has selected a type in `event_mask` and for which no
2380 intervening window has that type in its do-not-propagate-mask. If no such
2381 window exists or if the window is an ancestor of the focus window and
2382 `InputFocus` was originally specified as the destination, the event is not sent
2383 to any clients. Otherwise, the event is reported to every client selecting on
2384 the final destination any of the types specified in `event_mask`.
2385       ]]></field>
2386       <field name="event"><![CDATA[
2387 The event to send to the specified `destination`.
2388       ]]></field>
2389       <error type="Window"><![CDATA[
2390 The specified `destination` window does not exist.
2391       ]]></error>
2392       <error type="Value"><![CDATA[
2393 The given `event` is neither a core event nor an event defined by an extension.
2394       ]]></error>
2395       <see type="event" name="ConfigureNotify" />
2396     </doc>
2397   </request>
2398
2399   <enum name="GrabMode">
2400     <item name="Sync"> <value>0</value></item>
2401     <item name="Async"><value>1</value></item>
2402     <doc>
2403       <field name="Sync"><![CDATA[
2404 The state of the keyboard appears to freeze: No further keyboard events are
2405 generated by the server until the grabbing client issues a releasing
2406 `AllowEvents` request or until the keyboard grab is released.
2407       ]]></field>
2408       <field name="Async"><![CDATA[
2409 Keyboard event processing continues normally.
2410       ]]></field>
2411     </doc>
2412   </enum>
2413
2414   <enum name="GrabStatus">
2415     <item name="Success">       <value>0</value></item>
2416     <item name="AlreadyGrabbed"><value>1</value></item>
2417     <item name="InvalidTime">   <value>2</value></item>
2418     <item name="NotViewable">   <value>3</value></item>
2419     <item name="Frozen">        <value>4</value></item>
2420   </enum>
2421
2422   <enum name="Cursor">
2423     <item name="None"> <value>0</value></item>
2424   </enum>
2425
2426   <request name="GrabPointer" opcode="26">
2427     <field type="BOOL" name="owner_events" />
2428     <field type="WINDOW" name="grab_window" />
2429     <field type="CARD16" name="event_mask" mask="EventMask" />
2430     <field type="BYTE" name="pointer_mode" enum="GrabMode" />
2431     <field type="BYTE" name="keyboard_mode" enum="GrabMode" />
2432     <field type="WINDOW" name="confine_to" altenum="Window" />
2433     <field type="CURSOR" name="cursor" altenum="Cursor" />
2434     <field type="TIMESTAMP" name="time" altenum="Time" />
2435     <reply>
2436       <field type="BYTE" name="status" enum="GrabStatus" />
2437     </reply>
2438     <doc>
2439       <brief>Grab the pointer</brief>
2440       <description><![CDATA[
2441 Actively grabs control of the pointer. Further pointer events are reported only to the grabbing client. Overrides any active pointer grab by this client.
2442
2443       ]]></description>
2444       <example><![CDATA[
2445 /*
2446  * Grabs the pointer actively
2447  *
2448  */
2449 void my_example(xcb_connection *conn, xcb_screen_t *screen, xcb_cursor_t cursor) {
2450     xcb_grab_pointer_cookie_t cookie;
2451     xcb_grab_pointer_reply_t *reply;
2452
2453     cookie = xcb_grab_pointer(
2454         conn,
2455         false,               /* get all pointer events specified by the following mask */
2456         screen->root,        /* grab the root window */
2457         XCB_NONE,            /* which events to let through */
2458         XCB_GRAB_MODE_ASYNC, /* pointer events should continue as normal */
2459         XCB_GRAB_MODE_ASYNC, /* keyboard mode */
2460         XCB_NONE,            /* confine_to = in which window should the cursor stay */
2461         cursor,              /* we change the cursor to whatever the user wanted */
2462         XCB_CURRENT_TIME
2463     );
2464
2465     if ((reply = xcb_grab_pointer_reply(conn, cookie, NULL))) {
2466         if (reply->status == XCB_GRAB_STATUS_SUCCESS)
2467             printf("successfully grabbed the pointer\\n");
2468         free(preply);
2469     }
2470 }
2471       ]]></example>
2472       <field name="event_mask"><![CDATA[
2473 Specifies which pointer events are reported to the client.
2474
2475 TODO: which values?
2476       ]]></field>
2477       <field name="confine_to"><![CDATA[
2478 Specifies the window to confine the pointer in (the user will not be able to
2479 move the pointer out of that window).
2480
2481 The special value `XCB_NONE` means don't confine the pointer.
2482       ]]></field>
2483       <field name="cursor"><![CDATA[
2484 Specifies the cursor that should be displayed or `XCB_NONE` to not change the
2485 cursor.
2486       ]]></field>
2487       <field name="owner_events"><![CDATA[
2488 If 1, the `grab_window` will still get the pointer events. If 0, events are not
2489 reported to the `grab_window`.
2490       ]]></field>
2491       <field name="grab_window"><![CDATA[
2492 Specifies the window on which the pointer should be grabbed.
2493       ]]></field>
2494       <field name="time"><![CDATA[
2495 The time argument allows you to avoid certain circumstances that come up if
2496 applications take a long time to respond or if there are long network delays.
2497 Consider a situation where you have two applications, both of which normally
2498 grab the pointer when clicked on. If both applications specify the timestamp
2499 from the event, the second application may wake up faster and successfully grab
2500 the pointer before the first application. The first application then will get
2501 an indication that the other application grabbed the pointer before its request
2502 was processed.
2503
2504 The special value `XCB_CURRENT_TIME` will be replaced with the current server
2505 time.
2506       ]]></field>
2507       <!-- the enum doc is sufficient. -->
2508       <field name="pointer_mode" />
2509       <field name="keyboard_mode" />
2510       <error type="Value"><![CDATA[
2511 TODO: reasons?
2512       ]]></error>
2513       <error type="Window"><![CDATA[
2514 The specified `window` does not exist.
2515       ]]></error>
2516
2517       <see type="request" name="GrabKeyboard" />
2518     </doc>
2519   </request>
2520
2521   <request name="UngrabPointer" opcode="27">
2522     <pad bytes="1" />
2523     <field type="TIMESTAMP" name="time" altenum="Time" />
2524     <doc>
2525       <brief>release the pointer</brief>
2526       <description><![CDATA[
2527 Releases the pointer and any queued events if you actively grabbed the pointer
2528 before using `xcb_grab_pointer`, `xcb_grab_button` or within a normal button
2529 press.
2530
2531 EnterNotify and LeaveNotify events are generated.
2532       ]]></description>
2533       <field name="time"><![CDATA[
2534 Timestamp to avoid race conditions when running X over the network.
2535
2536 The pointer will not be released if `time` is earlier than the
2537 last-pointer-grab time or later than the current X server time.
2538       ]]></field>
2539       <field name="name_len"><![CDATA[
2540 Length (in bytes) of `name`.
2541       ]]></field>
2542       <field name="name"><![CDATA[
2543 A pattern describing an X core font.
2544       ]]></field>
2545       <see type="request" name="GrabPointer" />
2546       <see type="request" name="GrabButton" />
2547       <see type="event" name="EnterNotify" />
2548       <see type="event" name="LeaveNotify" />
2549     </doc>
2550   </request>
2551
2552   <enum name="ButtonIndex">
2553      <item name="Any"><value>0</value></item>
2554      <item name="1">  <value>1</value></item>
2555      <item name="2">  <value>2</value></item>
2556      <item name="3">  <value>3</value></item>
2557      <item name="4">  <value>4</value></item>
2558      <item name="5">  <value>5</value></item>
2559     <doc>
2560       <field name="Any"><![CDATA[
2561 Any of the following (or none):
2562       ]]></field>
2563       <field name="1"><![CDATA[
2564 The left mouse button.
2565       ]]></field>
2566       <field name="2"><![CDATA[
2567 The right mouse button.
2568       ]]></field>
2569       <field name="3"><![CDATA[
2570 The middle mouse button.
2571       ]]></field>
2572       <field name="4"><![CDATA[
2573 Scroll wheel. TODO: direction?
2574       ]]></field>
2575       <field name="5"><![CDATA[
2576 Scroll wheel. TODO: direction?
2577       ]]></field>
2578     </doc>
2579   </enum>
2580
2581   <request name="GrabButton" opcode="28">
2582     <field type="BOOL" name="owner_events" />
2583     <field type="WINDOW" name="grab_window" />
2584     <field type="CARD16" name="event_mask" mask="EventMask" />
2585     <field type="CARD8" name="pointer_mode" enum="GrabMode" />
2586     <field type="CARD8" name="keyboard_mode" enum="GrabMode" />
2587     <field type="WINDOW" name="confine_to" altenum="Window" />
2588     <field type="CURSOR" name="cursor" altenum="Cursor" />
2589     <field type="CARD8" name="button" enum="ButtonIndex" />
2590     <pad bytes="1" />
2591     <field type="CARD16" name="modifiers" mask="ModMask" />
2592     <doc>
2593       <brief>Grab pointer button(s)</brief>
2594       <description><![CDATA[
2595 This request establishes a passive grab. The pointer is actively grabbed as
2596 described in GrabPointer, the last-pointer-grab time is set to the time at
2597 which the button was pressed (as transmitted in the ButtonPress event), and the
2598 ButtonPress event is reported if all of the following conditions are true:
2599
2600 The pointer is not grabbed and the specified button is logically pressed when
2601 the specified modifier keys are logically down, and no other buttons or
2602 modifier keys are logically down.
2603
2604 The grab-window contains the pointer.
2605
2606 The confine-to window (if any) is viewable.
2607
2608 A passive grab on the same button/key combination does not exist on any
2609 ancestor of grab-window.
2610
2611 The interpretation of the remaining arguments is the same as for GrabPointer.
2612 The active grab is terminated automatically when the logical state of the
2613 pointer has all buttons released, independent of the logical state of modifier
2614 keys. Note that the logical state of a device (as seen by means of the
2615 protocol) may lag the physical state if device event processing is frozen. This
2616 request overrides all previous passive grabs by the same client on the same
2617 button/key combinations on the same window. A modifier of AnyModifier is
2618 equivalent to issuing the request for all possible modifier combinations
2619 (including the combination of no modifiers). It is not required that all
2620 specified modifiers have currently assigned keycodes. A button of AnyButton is
2621 equivalent to issuing the request for all possible buttons. Otherwise, it is
2622 not required that the button specified currently be assigned to a physical
2623 button.
2624
2625 An Access error is generated if some other client has already issued a
2626 GrabButton request with the same button/key combination on the same window.
2627 When using AnyModifier or AnyButton, the request fails completely (no grabs are
2628 established), and an Access error is generated if there is a conflicting grab
2629 for any combination. The request has no effect on an active grab.
2630
2631       ]]></description>
2632       <field name="owner_events"><![CDATA[
2633 If 1, the `grab_window` will still get the pointer events. If 0, events are not
2634 reported to the `grab_window`.
2635       ]]></field>
2636       <field name="grab_window"><![CDATA[
2637 Specifies the window on which the pointer should be grabbed.
2638       ]]></field>
2639       <field name="event_mask"><![CDATA[
2640 Specifies which pointer events are reported to the client.
2641
2642 TODO: which values?
2643       ]]></field>
2644       <field name="confine_to"><![CDATA[
2645 Specifies the window to confine the pointer in (the user will not be able to
2646 move the pointer out of that window).
2647
2648 The special value `XCB_NONE` means don't confine the pointer.
2649       ]]></field>
2650       <field name="cursor"><![CDATA[
2651 Specifies the cursor that should be displayed or `XCB_NONE` to not change the
2652 cursor.
2653       ]]></field>
2654       <field name="modifiers"><![CDATA[
2655 The modifiers to grab.
2656
2657 Using the special value `XCB_MOD_MASK_ANY` means grab the pointer with all
2658 possible modifier combinations.
2659       ]]></field>
2660       <!-- the enum doc is sufficient. -->
2661       <field name="pointer_mode" />
2662       <field name="keyboard_mode" />
2663       <field name="button" />
2664       <error type="Access"><![CDATA[
2665 Another client has already issued a GrabButton with the same button/key
2666 combination on the same window.
2667       ]]></error>
2668       <error type="Value"><![CDATA[
2669 TODO: reasons?
2670       ]]></error>
2671       <error type="Cursor"><![CDATA[
2672 The specified `cursor` does not exist.
2673       ]]></error>
2674       <error type="Window"><![CDATA[
2675 The specified `window` does not exist.
2676       ]]></error>
2677     </doc>
2678   </request>
2679
2680   <request name="UngrabButton" opcode="29">
2681     <field type="CARD8" name="button" enum="ButtonIndex" />
2682     <field type="WINDOW" name="grab_window" />
2683     <field type="CARD16" name="modifiers" mask="ModMask" />
2684     <pad bytes="2" />
2685   </request>
2686
2687   <request name="ChangeActivePointerGrab" opcode="30">
2688     <pad bytes="1" />
2689     <field type="CURSOR" name="cursor" altenum="Cursor" />
2690     <field type="TIMESTAMP" name="time" altenum="Time" />
2691     <field type="CARD16" name="event_mask" mask="EventMask" />
2692     <pad bytes="2" />
2693   </request>
2694
2695   <request name="GrabKeyboard" opcode="31">
2696     <field type="BOOL" name="owner_events" />
2697     <field type="WINDOW" name="grab_window" />
2698     <field type="TIMESTAMP" name="time" altenum="Time" />
2699     <field type="BYTE" name="pointer_mode" enum="GrabMode" />
2700     <field type="BYTE" name="keyboard_mode" enum="GrabMode" />
2701     <pad bytes="2" />
2702     <reply>
2703       <field type="BYTE" name="status" enum="GrabStatus" />
2704     </reply>
2705     <doc>
2706       <brief>Grab the keyboard</brief>
2707       <description><![CDATA[
2708 Actively grabs control of the keyboard and generates FocusIn and FocusOut
2709 events. Further key events are reported only to the grabbing client.
2710
2711 Any active keyboard grab by this client is overridden. If the keyboard is
2712 actively grabbed by some other client, `AlreadyGrabbed` is returned. If
2713 `grab_window` is not viewable, `GrabNotViewable` is returned. If the keyboard
2714 is frozen by an active grab of another client, `GrabFrozen` is returned. If the
2715 specified `time` is earlier than the last-keyboard-grab time or later than the
2716 current X server time, `GrabInvalidTime` is returned. Otherwise, the
2717 last-keyboard-grab time is set to the specified time.
2718       ]]></description>
2719       <example><![CDATA[
2720 /*
2721  * Grabs the keyboard actively
2722  *
2723  */
2724 void my_example(xcb_connection *conn, xcb_screen_t *screen) {
2725     xcb_grab_keyboard_cookie_t cookie;
2726     xcb_grab_keyboard_reply_t *reply;
2727
2728     cookie = xcb_grab_keyboard(
2729         conn,
2730         true,                /* report events */
2731         screen->root,        /* grab the root window */
2732         XCB_CURRENT_TIME,
2733         XCB_GRAB_MODE_ASYNC, /* process events as normal, do not require sync */
2734         XCB_GRAB_MODE_ASYNC
2735     );
2736
2737     if ((reply = xcb_grab_keyboard_reply(conn, cookie, NULL))) {
2738         if (reply->status == XCB_GRAB_STATUS_SUCCESS)
2739             printf("successfully grabbed the keyboard\\n");
2740
2741         free(reply);
2742     }
2743 }
2744       ]]></example>
2745       <field name="owner_events"><![CDATA[
2746 If 1, the `grab_window` will still get the pointer events. If 0, events are not
2747 reported to the `grab_window`.
2748       ]]></field>
2749       <field name="grab_window"><![CDATA[
2750 Specifies the window on which the pointer should be grabbed.
2751       ]]></field>
2752       <field name="time"><![CDATA[
2753 Timestamp to avoid race conditions when running X over the network.
2754
2755 The special value `XCB_CURRENT_TIME` will be replaced with the current server
2756 time.
2757       ]]></field>
2758       <!-- the enum doc is sufficient. -->
2759       <field name="pointer_mode" />
2760       <field name="keyboard_mode" />
2761       <error type="Value"><![CDATA[
2762 TODO: reasons?
2763       ]]></error>
2764       <error type="Window"><![CDATA[
2765 The specified `window` does not exist.
2766       ]]></error>
2767       <see type="request" name="GrabPointer" />
2768     </doc>
2769   </request>
2770
2771   <request name="UngrabKeyboard" opcode="32">
2772     <pad bytes="1" />
2773     <field type="TIMESTAMP" name="time" altenum="Time" />
2774   </request>
2775
2776   <!-- Use KEYCODE any = { XCBGrabAny }; to grab any key -->
2777   <enum name="Grab">
2778     <item name="Any"><value>0</value></item>
2779   </enum>
2780
2781   <request name="GrabKey" opcode="33">
2782     <field type="BOOL" name="owner_events" />
2783     <field type="WINDOW" name="grab_window" />
2784     <field type="CARD16" name="modifiers" mask="ModMask" />
2785     <field type="KEYCODE" name="key" altenum="Grab" />
2786     <field type="CARD8" name="pointer_mode" enum="GrabMode" />
2787     <field type="CARD8" name="keyboard_mode" enum="GrabMode" />
2788     <pad bytes="3" />
2789     <doc>
2790       <brief>Grab keyboard key(s)</brief>
2791       <description><![CDATA[
2792 Establishes a passive grab on the keyboard. In the future, the keyboard is
2793 actively grabbed (as for `GrabKeyboard`), the last-keyboard-grab time is set to
2794 the time at which the key was pressed (as transmitted in the KeyPress event),
2795 and the KeyPress event is reported if all of the following conditions are true:
2796
2797 The keyboard is not grabbed and the specified key (which can itself be a
2798 modifier key) is logically pressed when the specified modifier keys are
2799 logically down, and no other modifier keys are logically down.
2800
2801 Either the grab_window is an ancestor of (or is) the focus window, or the
2802 grab_window is a descendant of the focus window and contains the pointer.
2803
2804 A passive grab on the same key combination does not exist on any ancestor of
2805 grab_window.
2806
2807 The interpretation of the remaining arguments is as for XGrabKeyboard.  The active grab is terminated
2808 automatically when the logical state of the keyboard has the specified key released (independent of the
2809 logical state of the modifier keys), at which point a KeyRelease event is reported to the grabbing window.
2810
2811 Note that the logical state of a device (as seen by client applications) may lag the physical state if
2812 device event processing is frozen.
2813
2814 A modifiers argument of AnyModifier is equivalent to issuing the request for all possible modifier combinations (including the combination of no modifiers).  It is not required that all modifiers specified
2815 have currently assigned KeyCodes.  A keycode argument of AnyKey is equivalent to issuing the request for
2816 all possible KeyCodes.  Otherwise, the specified keycode must be in the range specified by min_keycode
2817 and max_keycode in the connection setup, or a BadValue error results.
2818
2819 If some other client has issued a XGrabKey with the same key combination on the same window, a BadAccess
2820 error results.  When using AnyModifier or AnyKey, the request fails completely, and a BadAccess error
2821 results (no grabs are established) if there is a conflicting grab for any combination.
2822
2823       ]]></description>
2824       <field name="owner_events"><![CDATA[
2825 If 1, the `grab_window` will still get the pointer events. If 0, events are not
2826 reported to the `grab_window`.
2827       ]]></field>
2828       <field name="grab_window"><![CDATA[
2829 Specifies the window on which the pointer should be grabbed.
2830       ]]></field>
2831       <field name="key"><![CDATA[
2832 The keycode of the key to grab.
2833
2834 The special value `XCB_GRAB_ANY` means grab any key.
2835       ]]></field>
2836       <field name="cursor"><![CDATA[
2837 Specifies the cursor that should be displayed or `XCB_NONE` to not change the
2838 cursor.
2839       ]]></field>
2840       <field name="modifiers"><![CDATA[
2841 The modifiers to grab.
2842
2843 Using the special value `XCB_MOD_MASK_ANY` means grab the pointer with all
2844 possible modifier combinations.
2845       ]]></field>
2846       <!-- the enum doc is sufficient. -->
2847       <field name="pointer_mode" />
2848       <field name="keyboard_mode" />
2849       <error type="Access"><![CDATA[
2850 Another client has already issued a GrabKey with the same button/key
2851 combination on the same window.
2852       ]]></error>
2853       <error type="Value"><![CDATA[
2854 TODO: reasons?
2855       ]]></error>
2856       <error type="Window"><![CDATA[
2857 The specified `window` does not exist.
2858       ]]></error>
2859       <see type="request" name="GrabKeyboard" />
2860     </doc>
2861   </request>
2862
2863   <request name="UngrabKey" opcode="34">
2864     <field type="KEYCODE" name="key" altenum="Grab" />
2865     <field type="WINDOW" name="grab_window" />
2866     <field type="CARD16" name="modifiers" mask="ModMask" />
2867     <pad bytes="2" />
2868     <doc>
2869       <brief>release a key combination</brief>
2870       <description><![CDATA[
2871 Releases the key combination on `grab_window` if you grabbed it using
2872 `xcb_grab_key` before.
2873       ]]></description>
2874       <field name="key"><![CDATA[
2875 The keycode of the specified key combination.
2876
2877 Using the special value `XCB_GRAB_ANY` means releasing all possible key codes.
2878       ]]></field>
2879       <field name="grab_window"><![CDATA[
2880 The window on which the grabbed key combination will be released.
2881       ]]></field>
2882       <field name="modifiers"><![CDATA[
2883 The modifiers of the specified key combination.
2884
2885 Using the special value `XCB_MOD_MASK_ANY` means releasing the key combination
2886 with every possible modifier combination.
2887       ]]></field>
2888       <error type="Window"><![CDATA[
2889 The specified `grab_window` does not exist.
2890       ]]></error>
2891       <error type="Value"><![CDATA[
2892 TODO: reasons?
2893       ]]></error>
2894       <see type="request" name="GrabKey" />
2895       <see type="program" name="xev" />
2896     </doc>
2897   </request>
2898
2899   <enum name="Allow">
2900     <item name="AsyncPointer">  <value>0</value></item>
2901     <item name="SyncPointer">   <value>1</value></item>
2902     <item name="ReplayPointer"> <value>2</value></item>
2903     <item name="AsyncKeyboard"> <value>3</value></item>
2904     <item name="SyncKeyboard">  <value>4</value></item>
2905     <item name="ReplayKeyboard"><value>5</value></item>
2906     <item name="AsyncBoth">     <value>6</value></item>
2907     <item name="SyncBoth">      <value>7</value></item>
2908     <doc>
2909       <field name="AsyncPointer"><![CDATA[
2910 For AsyncPointer, if the pointer is frozen by the client, pointer event
2911 processing continues normally. If the pointer is frozen twice by the client on
2912 behalf of two separate grabs, AsyncPointer thaws for both. AsyncPointer has no
2913 effect if the pointer is not frozen by the client, but the pointer need not be
2914 grabbed by the client.
2915
2916 TODO: rewrite this in more understandable terms.
2917       ]]></field>
2918       <field name="SyncPointer"><![CDATA[
2919 For SyncPointer, if the pointer is frozen and actively grabbed by the client,
2920 pointer event processing continues normally until the next ButtonPress or
2921 ButtonRelease event is reported to the client, at which time the pointer again
2922 appears to freeze. However, if the reported event causes the pointer grab to be
2923 released, then the pointer does not freeze. SyncPointer has no effect if the
2924 pointer is not frozen by the client or if the pointer is not grabbed by the
2925 client.
2926       ]]></field>
2927       <field name="ReplayPointer"><![CDATA[
2928 For ReplayPointer, if the pointer is actively grabbed by the client and is
2929 frozen as the result of an event having been sent to the client (either from
2930 the activation of a GrabButton or from a previous AllowEvents with mode
2931 SyncPointer but not from a GrabPointer), then the pointer grab is released and
2932 that event is completely reprocessed, this time ignoring any passive grabs at
2933 or above (towards the root) the grab-window of the grab just released. The
2934 request has no effect if the pointer is not grabbed by the client or if the
2935 pointer is not frozen as the result of an event.
2936       ]]></field>
2937       <field name="AsyncKeyboard"><![CDATA[
2938 For AsyncKeyboard, if the keyboard is frozen by the client, keyboard event
2939 processing continues normally. If the keyboard is frozen twice by the client on
2940 behalf of two separate grabs, AsyncKeyboard thaws for both. AsyncKeyboard has
2941 no effect if the keyboard is not frozen by the client, but the keyboard need
2942 not be grabbed by the client.
2943       ]]></field>
2944       <field name="SyncKeyboard"><![CDATA[
2945 For SyncKeyboard, if the keyboard is frozen and actively grabbed by the client,
2946 keyboard event processing continues normally until the next KeyPress or
2947 KeyRelease event is reported to the client, at which time the keyboard again
2948 appears to freeze. However, if the reported event causes the keyboard grab to
2949 be released, then the keyboard does not freeze. SyncKeyboard has no effect if
2950 the keyboard is not frozen by the client or if the keyboard is not grabbed by
2951 the client.
2952       ]]></field>
2953       <field name="ReplayKeyboard"><![CDATA[
2954 For ReplayKeyboard, if the keyboard is actively grabbed by the client and is
2955 frozen as the result of an event having been sent to the client (either from
2956 the activation of a GrabKey or from a previous AllowEvents with mode
2957 SyncKeyboard but not from a GrabKeyboard), then the keyboard grab is released
2958 and that event is completely reprocessed, this time ignoring any passive grabs
2959 at or above (towards the root) the grab-window of the grab just released. The
2960 request has no effect if the keyboard is not grabbed by the client or if the
2961 keyboard is not frozen as the result of an event.
2962       ]]></field>
2963       <field name="SyncBoth"><![CDATA[
2964 For SyncBoth, if both pointer and keyboard are frozen by the client, event
2965 processing (for both devices) continues normally until the next ButtonPress,
2966 ButtonRelease, KeyPress, or KeyRelease event is reported to the client for a
2967 grabbed device (button event for the pointer, key event for the keyboard), at
2968 which time the devices again appear to freeze. However, if the reported event
2969 causes the grab to be released, then the devices do not freeze (but if the
2970 other device is still grabbed, then a subsequent event for it will still cause
2971 both devices to freeze). SyncBoth has no effect unless both pointer and
2972 keyboard are frozen by the client. If the pointer or keyboard is frozen twice
2973 by the client on behalf of two separate grabs, SyncBoth thaws for both (but a
2974 subsequent freeze for SyncBoth will only freeze each device once).
2975       ]]></field>
2976       <field name="AsyncBoth"><![CDATA[
2977 For AsyncBoth, if the pointer and the keyboard are frozen by the client, event
2978 processing for both devices continues normally. If a device is frozen twice by
2979 the client on behalf of two separate grabs, AsyncBoth thaws for both. AsyncBoth
2980 has no effect unless both pointer and keyboard are frozen by the client.
2981       ]]></field>
2982     </doc>
2983   </enum>
2984
2985   <request name="AllowEvents" opcode="35">
2986     <field type="CARD8" name="mode" enum="Allow" />
2987     <field type="TIMESTAMP" name="time" altenum="Time" />
2988     <doc>
2989       <brief>release queued events</brief>
2990       <description><![CDATA[
2991 Releases queued events if the client has caused a device (pointer/keyboard) to
2992 freeze due to grabbing it actively. This request has no effect if `time` is
2993 earlier than the last-grab time of the most recent active grab for this client
2994 or if `time` is later than the current X server time.
2995       ]]></description>
2996       <!-- the enum doc is sufficient. -->
2997       <field name="mode" />
2998       <field name="time"><![CDATA[
2999 Timestamp to avoid race conditions when running X over the network.
3000
3001 The special value `XCB_CURRENT_TIME` will be replaced with the current server
3002 time.
3003       ]]></field>
3004       <error type="Value"><![CDATA[
3005 You specified an invalid `mode`.
3006       ]]></error>
3007     </doc>
3008   </request>
3009
3010   <request name="GrabServer" opcode="36" />
3011
3012   <request name="UngrabServer" opcode="37" />
3013
3014   <request name="QueryPointer" opcode="38">
3015     <pad bytes="1" />
3016     <field type="WINDOW" name="window" />
3017     <reply>
3018       <field type="BOOL" name="same_screen" />
3019       <field type="WINDOW" name="root" />
3020       <field type="WINDOW" name="child" altenum="Window" />
3021       <field type="INT16" name="root_x" />
3022       <field type="INT16" name="root_y" />
3023       <field type="INT16" name="win_x" />
3024       <field type="INT16" name="win_y" />
3025       <field type="CARD16" name="mask" mask="KeyButMask" />
3026       <pad bytes="2" />
3027       <doc>
3028         <field name="same_screen"><![CDATA[
3029 If `same_screen` is False, then the pointer is not on the same screen as the
3030 argument window, `child` is None, and `win_x` and `win_y` are zero. If
3031 `same_screen` is True, then `win_x` and `win_y` are the pointer coordinates
3032 relative to the argument window's origin, and child is the child containing the
3033 pointer, if any.
3034         ]]></field>
3035         <field name="root"><![CDATA[
3036 The root window the pointer is logically on.
3037         ]]></field>
3038         <field name="child"><![CDATA[
3039 The child window containing the pointer, if any, if `same_screen` is true. If
3040 `same_screen` is false, `XCB_NONE` is returned.
3041         ]]></field>
3042         <field name="root_x"><![CDATA[
3043 The pointer X position, relative to `root`.
3044         ]]></field>
3045         <field name="root_y"><![CDATA[
3046 The pointer Y position, relative to `root`.
3047         ]]></field>
3048         <field name="win_x"><![CDATA[
3049 The pointer X coordinate, relative to `child`, if `same_screen` is true. Zero
3050 otherwise.
3051         ]]></field>
3052         <field name="win_y"><![CDATA[
3053 The pointer Y coordinate, relative to `child`, if `same_screen` is true. Zero
3054 otherwise.
3055         ]]></field>
3056         <field name="mask"><![CDATA[
3057 The current logical state of the modifier keys and the buttons. Note that the
3058 logical state of a device (as seen by means of the protocol) may lag the
3059 physical state if device event processing is frozen.
3060         ]]></field>
3061       </doc>
3062     </reply>
3063     <doc>
3064       <brief>get pointer coordinates</brief>
3065       <description><![CDATA[
3066 Gets the root window the pointer is logically on and the pointer coordinates
3067 relative to the root window's origin.
3068       ]]></description>
3069       <field name="window"><![CDATA[
3070 A window to check if the pointer is on the same screen as `window` (see the
3071 `same_screen` field in the reply).
3072       ]]></field>
3073       <error type="Window"><![CDATA[
3074 The specified `window` does not exist.
3075       ]]></error>
3076     </doc>
3077   </request>
3078
3079   <struct name="TIMECOORD">
3080     <field type="TIMESTAMP" name="time" />
3081     <field type="INT16" name="x" />
3082     <field type="INT16" name="y" />
3083   </struct>
3084
3085   <request name="GetMotionEvents" opcode="39">
3086     <pad bytes="1" />
3087     <field type="WINDOW" name="window" />
3088     <field type="TIMESTAMP" name="start" altenum="Time" />
3089     <field type="TIMESTAMP" name="stop" altenum="Time" />
3090     <reply>
3091       <pad bytes="1" />
3092       <field type="CARD32" name="events_len" />
3093       <pad bytes="20" />
3094       <list type="TIMECOORD" name="events">
3095         <fieldref>events_len</fieldref>
3096       </list>
3097     </reply>
3098   </request>
3099
3100   <request name="TranslateCoordinates" opcode="40">
3101     <pad bytes="1" />
3102     <field type="WINDOW" name="src_window" />
3103     <field type="WINDOW" name="dst_window" />
3104     <field type="INT16" name="src_x" />
3105     <field type="INT16" name="src_y" />
3106     <reply>
3107       <field type="BOOL" name="same_screen" />
3108       <field type="WINDOW" name="child" altenum="Window" />
3109       <field type="INT16" name="dst_x" />
3110       <field type="INT16" name="dst_y" />
3111     </reply>
3112   </request>
3113
3114   <request name="WarpPointer" opcode="41">
3115     <pad bytes="1" />
3116     <field type="WINDOW" name="src_window" altenum="Window" />
3117     <field type="WINDOW" name="dst_window" altenum="Window" />
3118     <field type="INT16" name="src_x" />
3119     <field type="INT16" name="src_y" />
3120     <field type="CARD16" name="src_width" />
3121     <field type="CARD16" name="src_height" />
3122     <field type="INT16" name="dst_x" />
3123     <field type="INT16" name="dst_y" />
3124     <doc>
3125       <brief>move mouse pointer</brief>
3126       <description><![CDATA[
3127 Moves the mouse pointer to the specified position.
3128
3129 If `src_window` is not `XCB_NONE` (TODO), the move will only take place if the
3130 pointer is inside `src_window` and within the rectangle specified by (`src_x`,
3131 `src_y`, `src_width`, `src_height`). The rectangle coordinates are relative to
3132 `src_window`.
3133
3134 If `dst_window` is not `XCB_NONE` (TODO), the pointer will be moved to the
3135 offsets (`dst_x`, `dst_y`) relative to `dst_window`. If `dst_window` is
3136 `XCB_NONE` (TODO), the pointer will be moved by the offsets (`dst_x`, `dst_y`)
3137 relative to the current position of the pointer.
3138       ]]></description>
3139       <field name="src_window"><![CDATA[
3140 If `src_window` is not `XCB_NONE` (TODO), the move will only take place if the
3141 pointer is inside `src_window` and within the rectangle specified by (`src_x`,
3142 `src_y`, `src_width`, `src_height`). The rectangle coordinates are relative to
3143 `src_window`.
3144       ]]></field>
3145       <field name="dst_window"><![CDATA[
3146 If `dst_window` is not `XCB_NONE` (TODO), the pointer will be moved to the
3147 offsets (`dst_x`, `dst_y`) relative to `dst_window`. If `dst_window` is
3148 `XCB_NONE` (TODO), the pointer will be moved by the offsets (`dst_x`, `dst_y`)
3149 relative to the current position of the pointer.
3150       ]]></field>
3151       <error type="Window"><![CDATA[
3152 TODO: reasons?
3153       ]]></error>
3154       <see type="request" name="SetInputFocus" />
3155     </doc>
3156   </request>
3157
3158   <!-- used for revert_to and focus -->
3159   <enum name="InputFocus">
3160     <item name="None">       <value>0</value></item>
3161     <item name="PointerRoot"><value>1</value></item>
3162     <item name="Parent">     <value>2</value></item>  <!-- revert_to only -->
3163     <item name="FollowKeyboard"><value>3</value></item>  <!-- xinput extension only -->
3164     <doc>
3165       <field name="None"><![CDATA[
3166 The focus reverts to `XCB_NONE`, so no window will have the input focus.
3167       ]]></field>
3168       <field name="PointerRoot"><![CDATA[
3169 The focus reverts to `XCB_POINTER_ROOT` respectively. When the focus reverts,
3170 FocusIn and FocusOut events are generated, but the last-focus-change time is
3171 not changed.
3172       ]]></field>
3173       <field name="Parent"><![CDATA[
3174 The focus reverts to the parent (or closest viewable ancestor) and the new
3175 revert_to value is `XCB_INPUT_FOCUS_NONE`.
3176       ]]></field>
3177       <field name="FollowKeyboard"><![CDATA[
3178 NOT YET DOCUMENTED. Only relevant for the xinput extension.
3179       ]]></field>
3180     </doc>
3181   </enum>
3182
3183   <request name="SetInputFocus" opcode="42">
3184     <field type="CARD8" name="revert_to" enum="InputFocus" />
3185     <field type="WINDOW" name="focus" altenum="InputFocus" />
3186     <field type="TIMESTAMP" name="time" altenum="Time" />
3187     <doc>
3188       <brief>Sets input focus</brief>
3189       <description><![CDATA[
3190 Changes the input focus and the last-focus-change time. If the specified `time`
3191 is earlier than the current last-focus-change time, the request is ignored (to
3192 avoid race conditions when running X over the network).
3193
3194 A FocusIn and FocusOut event is generated when focus is changed.
3195       ]]></description>
3196       <field name="focus"><![CDATA[
3197 The window to focus. All keyboard events will be reported to this window. The
3198 window must be viewable (TODO), or a `xcb_match_error_t` occurs (TODO).
3199
3200 If `focus` is `XCB_NONE` (TODO), all keyboard events are
3201 discarded until a new focus window is set.
3202
3203 If `focus` is `XCB_POINTER_ROOT` (TODO), focus is on the root window of the
3204 screen on which the pointer is on currently.
3205       ]]></field>
3206       <field name="time"><![CDATA[
3207 Timestamp to avoid race conditions when running X over the network.
3208
3209 The special value `XCB_CURRENT_TIME` will be replaced with the current server
3210 time.
3211       ]]></field>
3212       <field name="revert_to"><![CDATA[
3213 Specifies what happens when the `focus` window becomes unviewable (if `focus`
3214 is neither `XCB_NONE` nor `XCB_POINTER_ROOT`).
3215       ]]></field>
3216       <error type="Window"><![CDATA[
3217 The specified `focus` window does not exist.
3218       ]]></error>
3219       <error type="Match"><![CDATA[
3220 The specified `focus` window is not viewable.
3221       ]]></error>
3222       <error type="Value"><![CDATA[
3223 TODO: Reasons?
3224       ]]></error>
3225       <see type="event" name="FocusIn" />
3226       <see type="event" name="FocusOut" />
3227     </doc>
3228
3229   </request>
3230
3231   <request name="GetInputFocus" opcode="43">
3232     <reply>
3233       <field type="CARD8" name="revert_to" enum="InputFocus" />
3234       <field type="WINDOW" name="focus" altenum="InputFocus" />
3235     </reply>
3236   </request>
3237
3238   <request name="QueryKeymap" opcode="44">
3239     <reply>
3240       <pad bytes="1" />
3241       <list type="CARD8" name="keys"><value>32</value></list>
3242     </reply>
3243   </request>
3244
3245   <request name="OpenFont" opcode="45">
3246     <pad bytes="1" />
3247     <field type="FONT" name="fid" />
3248     <field type="CARD16" name="name_len" />
3249     <pad bytes="2" />
3250     <list type="char" name="name">
3251       <fieldref>name_len</fieldref>
3252     </list>
3253     <doc>
3254       <brief>opens a font</brief>
3255       <description><![CDATA[
3256 Opens any X core font matching the given `name` (for example "-misc-fixed-*").
3257
3258 Note that X core fonts are deprecated (but still supported) in favor of
3259 client-side rendering using Xft.
3260       ]]></description>
3261       <field name="fid"><![CDATA[
3262 The ID with which you will refer to the font, created by `xcb_generate_id`.
3263       ]]></field>
3264       <field name="name_len"><![CDATA[
3265 Length (in bytes) of `name`.
3266       ]]></field>
3267       <field name="name"><![CDATA[
3268 A pattern describing an X core font.
3269       ]]></field>
3270       <error type="Name"><![CDATA[
3271 No font matches the given `name`.
3272       ]]></error>
3273       <see type="function" name="xcb_generate_id" />
3274     </doc>
3275   </request>
3276
3277   <request name="CloseFont" opcode="46">
3278     <pad bytes="1" />
3279     <field type="FONT" name="font" />
3280   </request>
3281
3282   <enum name="FontDraw">
3283     <item name="LeftToRight"><value>0</value></item>
3284     <item name="RightToLeft"><value>1</value></item>
3285   </enum>
3286
3287   <struct name="FONTPROP">
3288     <field type="ATOM" name="name" />
3289     <field type="CARD32" name="value" />
3290   </struct>
3291
3292   <struct name="CHARINFO">
3293     <field type="INT16" name="left_side_bearing" />
3294     <field type="INT16" name="right_side_bearing" />
3295     <field type="INT16" name="character_width" />
3296     <field type="INT16" name="ascent" />
3297     <field type="INT16" name="descent" />
3298     <field type="CARD16" name="attributes" />
3299   </struct>
3300
3301   <request name="QueryFont" opcode="47">
3302     <pad bytes="1" />
3303     <field type="FONTABLE" name="font" />
3304     <reply>
3305       <pad bytes="1" />
3306       <field type="CHARINFO" name="min_bounds" />
3307       <pad bytes="4" />
3308       <field type="CHARINFO" name="max_bounds" />
3309       <pad bytes="4" />
3310       <field type="CARD16" name="min_char_or_byte2" />
3311       <field type="CARD16" name="max_char_or_byte2" />
3312       <field type="CARD16" name="default_char" />
3313       <field type="CARD16" name="properties_len" />
3314       <field type="BYTE" name="draw_direction" enum="FontDraw" />
3315       <field type="CARD8" name="min_byte1" />
3316       <field type="CARD8" name="max_byte1" />
3317       <field type="BOOL" name="all_chars_exist" />
3318       <field type="INT16" name="font_ascent" />
3319       <field type="INT16" name="font_descent" />
3320       <field type="CARD32" name="char_infos_len" />
3321       <list type="FONTPROP" name="properties">
3322         <fieldref>properties_len</fieldref>
3323       </list>
3324       <list type="CHARINFO" name="char_infos">
3325         <fieldref>char_infos_len</fieldref>
3326       </list>
3327       <doc>
3328         <field name="min_bounds"><![CDATA[
3329 minimum bounds over all existing char
3330         ]]></field>
3331         <field name="max_bounds"><![CDATA[
3332 maximum bounds over all existing char
3333         ]]></field>
3334         <field name="min_char_or_byte2"><![CDATA[
3335 first character
3336         ]]></field>
3337         <field name="max_char_or_byte2"><![CDATA[
3338 last character
3339         ]]></field>
3340         <field name="default_char"><![CDATA[
3341 char to print for undefined character
3342         ]]></field>
3343         <field name="properties_len"><![CDATA[
3344 how many properties there are
3345         ]]></field>
3346         <field name="all_chars_exist"><![CDATA[
3347 flag if all characters have nonzero size
3348         ]]></field>
3349         <field name="font_ascent"><![CDATA[
3350 baseline to top edge of raster
3351         ]]></field>
3352         <field name="font_descent"><![CDATA[
3353 baseline to bottom edge of raster
3354         ]]></field>
3355         <!-- enum doc is sufficient -->
3356         <field name="draw_direction" />
3357       </doc>
3358     </reply>
3359     <doc>
3360       <brief>query font metrics</brief>
3361       <description><![CDATA[
3362 Queries information associated with the font.
3363       ]]></description>
3364       <field name="font"><![CDATA[
3365 The fontable (Font or Graphics Context) to query.
3366       ]]></field>
3367       <!-- TODO: example -->
3368     </doc>
3369   </request>
3370
3371   <request name="QueryTextExtents" opcode="48">
3372     <exprfield type="BOOL" name="odd_length">
3373       <op op="&amp;"><fieldref>string_len</fieldref><value>1</value></op>
3374     </exprfield>
3375     <field type="FONTABLE" name="font" />
3376     <list type="CHAR2B" name="string" />
3377     <reply>
3378       <field type="BYTE" name="draw_direction" enum="FontDraw" />
3379       <field type="INT16" name="font_ascent" />
3380       <field type="INT16" name="font_descent" />
3381       <field type="INT16" name="overall_ascent" />
3382       <field type="INT16" name="overall_descent" />
3383       <field type="INT32" name="overall_width" />
3384       <field type="INT32" name="overall_left" />
3385       <field type="INT32" name="overall_right" />
3386     </reply>
3387     <doc>
3388       <brief>get text extents</brief>
3389       <description><![CDATA[
3390 Query text extents from the X11 server. This request returns the bounding box
3391 of the specified 16-bit character string in the specified `font` or the font
3392 contained in the specified graphics context.
3393
3394 `font_ascent` is set to the maximum of the ascent metrics of all characters in
3395 the string. `font_descent` is set to the maximum of the descent metrics.
3396 `overall_width` is set to the sum of the character-width metrics of all
3397 characters in the string. For each character in the string, let W be the sum of
3398 the character-width metrics of all characters preceding it in the string. Let L
3399 be the left-side-bearing metric of the character plus W. Let R be the
3400 right-side-bearing metric of the character plus W. The lbearing member is set
3401 to the minimum L of all characters in the string. The rbearing member is set to
3402 the maximum R.
3403
3404 For fonts defined with linear indexing rather than 2-byte matrix indexing, each
3405 `xcb_char2b_t` structure is interpreted as a 16-bit number with byte1 as the
3406 most significant byte. If the font has no defined default character, undefined
3407 characters in the string are taken to have all zero metrics.
3408
3409 Characters with all zero metrics are ignored. If the font has no defined
3410 default_char, the undefined characters in the string are also ignored.
3411       ]]></description>
3412       <field name="font"><![CDATA[
3413 The `font` to calculate text extents in. You can also pass a graphics context.
3414       ]]></field>
3415       <field name="string_len"><![CDATA[
3416 The number of characters in `string`.
3417       ]]></field>
3418       <field name="string"><![CDATA[
3419 The text to get text extents for.
3420       ]]></field>
3421       <error type="GContext"><![CDATA[
3422 The specified graphics context does not exist.
3423       ]]></error>
3424       <error type="Font"><![CDATA[
3425 The specified `font` does not exist.
3426       ]]></error>
3427     </doc>
3428   </request>
3429
3430   <struct name="STR">
3431     <field type="CARD8" name="name_len" />
3432     <list type="char" name="name">
3433       <fieldref>name_len</fieldref>
3434     </list>
3435   </struct>
3436
3437   <request name="ListFonts" opcode="49">
3438     <pad bytes="1" />
3439     <field type="CARD16" name="max_names" />
3440     <field type="CARD16" name="pattern_len" />
3441     <list type="char" name="pattern">
3442       <fieldref>pattern_len</fieldref>
3443     </list>
3444     <reply>
3445       <pad bytes="1" />
3446       <field type="CARD16" name="names_len" />
3447       <pad bytes="22" />
3448       <list type="STR" name="names">
3449         <fieldref>names_len</fieldref>
3450       </list>
3451       <doc>
3452         <field name="names_len"><![CDATA[
3453 The number of font names.
3454         ]]></field>
3455       </doc>
3456     </reply>
3457     <doc>
3458       <brief>get matching font names</brief>
3459       <description><![CDATA[
3460 Gets a list of available font names which match the given `pattern`.
3461       ]]></description>
3462       <field name="pattern_len"><![CDATA[
3463 The length (in bytes) of `pattern`.
3464       ]]></field>
3465       <field name="pattern"><![CDATA[
3466 A font pattern, for example "-misc-fixed-*".
3467
3468 The asterisk (*) is a wildcard for any number of characters. The question mark
3469 (?) is a wildcard for a single character. Use of uppercase or lowercase does
3470 not matter.
3471       ]]></field>
3472       <field name="max_names"><![CDATA[
3473 The maximum number of fonts to be returned.
3474       ]]></field>
3475     </doc>
3476   </request>
3477
3478   <request name="ListFontsWithInfo" opcode="50">
3479     <pad bytes="1" />
3480     <field type="CARD16" name="max_names" />
3481     <field type="CARD16" name="pattern_len" />
3482     <list type="char" name="pattern">
3483       <fieldref>pattern_len</fieldref>
3484     </list>
3485     <reply>
3486       <field type="CARD8" name="name_len" />
3487       <field type="CHARINFO" name="min_bounds" />
3488       <pad bytes="4" />
3489       <field type="CHARINFO" name="max_bounds" />
3490       <pad bytes="4" />
3491       <field type="CARD16" name="min_char_or_byte2" />
3492       <field type="CARD16" name="max_char_or_byte2" />
3493       <field type="CARD16" name="default_char" />
3494       <field type="CARD16" name="properties_len" />
3495       <field type="BYTE" name="draw_direction" enum="FontDraw" />
3496       <field type="CARD8" name="min_byte1" />
3497       <field type="CARD8" name="max_byte1" />
3498       <field type="BOOL" name="all_chars_exist" />
3499       <field type="INT16" name="font_ascent" />
3500       <field type="INT16" name="font_descent" />
3501       <field type="CARD32" name="replies_hint" />
3502       <list type="FONTPROP" name="properties">
3503         <fieldref>properties_len</fieldref>
3504       </list>
3505       <list type="char" name="name">
3506         <fieldref>name_len</fieldref>
3507       </list>
3508       <doc>
3509         <field name="name_len"><![CDATA[
3510 The number of matched font names.
3511         ]]></field>
3512         <field name="min_bounds"><![CDATA[
3513 minimum bounds over all existing char
3514         ]]></field>
3515         <field name="max_bounds"><![CDATA[
3516 maximum bounds over all existing char
3517         ]]></field>
3518         <field name="min_char_or_byte2"><![CDATA[
3519 first character
3520         ]]></field>
3521         <field name="max_char_or_byte2"><![CDATA[
3522 last character
3523         ]]></field>
3524         <field name="default_char"><![CDATA[
3525 char to print for undefined character
3526         ]]></field>
3527         <field name="properties_len"><![CDATA[
3528 how many properties there are
3529         ]]></field>
3530         <field name="all_chars_exist"><![CDATA[
3531 flag if all characters have nonzero size
3532         ]]></field>
3533         <field name="font_ascent"><![CDATA[
3534 baseline to top edge of raster
3535         ]]></field>
3536         <field name="font_descent"><![CDATA[
3537 baseline to bottom edge of raster
3538         ]]></field>
3539         <field name="replies_hint"><![CDATA[
3540 An indication of how many more fonts will be returned. This is only a hint and
3541 may be larger or smaller than the number of fonts actually returned. A zero
3542 value does not guarantee that no more fonts will be returned.
3543         ]]></field>
3544         <!-- enum doc is sufficient -->
3545         <field name="draw_direction" />
3546       </doc>
3547     </reply>
3548     <doc>
3549       <brief>get matching font names and information</brief>
3550       <description><![CDATA[
3551 Gets a list of available font names which match the given `pattern`.
3552       ]]></description>
3553       <field name="pattern_len"><![CDATA[
3554 The length (in bytes) of `pattern`.
3555       ]]></field>
3556       <field name="pattern"><![CDATA[
3557 A font pattern, for example "-misc-fixed-*".
3558
3559 The asterisk (*) is a wildcard for any number of characters. The question mark
3560 (?) is a wildcard for a single character. Use of uppercase or lowercase does
3561 not matter.
3562       ]]></field>
3563       <field name="max_names"><![CDATA[
3564 The maximum number of fonts to be returned.
3565       ]]></field>
3566     </doc>
3567
3568   </request>
3569
3570   <request name="SetFontPath" opcode="51">
3571     <pad bytes="1" />
3572     <field type="CARD16" name="font_qty" />
3573     <pad bytes="2" />
3574     <list type="STR" name="font">
3575       <fieldref>font_qty</fieldref>
3576     </list>
3577   </request>
3578
3579   <request name="GetFontPath" opcode="52">
3580     <reply>
3581       <pad bytes="1" />
3582       <field type="CARD16" name="path_len" />
3583       <pad bytes="22" />
3584       <list type="STR" name="path">
3585         <fieldref>path_len</fieldref>
3586       </list>
3587     </reply>
3588   </request>
3589
3590   <request name="CreatePixmap" opcode="53">
3591     <field type="CARD8" name="depth" />
3592     <field type="PIXMAP" name="pid" />
3593     <field type="DRAWABLE" name="drawable" />
3594     <field type="CARD16" name="width" />
3595     <field type="CARD16" name="height" />
3596     <doc>
3597       <brief>Creates a pixmap</brief>
3598       <description><![CDATA[
3599 Creates a pixmap. The pixmap can only be used on the same screen as `drawable`
3600 is on and only with drawables of the same `depth`.
3601       ]]></description>
3602       <field name="depth"><![CDATA[
3603 TODO
3604       ]]></field>
3605       <field name="pid"><![CDATA[
3606 The ID with which you will refer to the new pixmap, created by
3607 `xcb_generate_id`.
3608       ]]></field>
3609       <field name="drawable"><![CDATA[
3610 Drawable to get the screen from.
3611       ]]></field>
3612       <field name="width"><![CDATA[
3613 The width of the new pixmap.
3614       ]]></field>
3615       <field name="height"><![CDATA[
3616 The height of the new pixmap.
3617       ]]></field>
3618       <error type="Value"><![CDATA[
3619 TODO: reasons?
3620       ]]></error>
3621       <error type="Drawable"><![CDATA[
3622 The specified `drawable` (Window or Pixmap) does not exist.
3623       ]]></error>
3624       <error type="Alloc"><![CDATA[
3625 The X server could not allocate the requested resources (no memory?).
3626       ]]></error>
3627       <see type="function" name="xcb_generate_id" />
3628     </doc>
3629   </request>
3630
3631   <request name="FreePixmap" opcode="54">
3632     <pad bytes="1" />
3633     <field type="PIXMAP" name="pixmap" />
3634     <doc>
3635       <brief>Destroys a pixmap</brief>
3636       <description><![CDATA[
3637 Deletes the association between the pixmap ID and the pixmap. The pixmap
3638 storage will be freed when there are no more references to it.
3639       ]]></description>
3640       <field name="pixmap"><![CDATA[The pixmap to destroy.]]></field>
3641       <error type="Pixmap"><![CDATA[
3642 The specified pixmap does not exist.
3643       ]]></error>
3644     </doc>
3645   </request>
3646   
3647   <enum name="GC">
3648     <item name="Function">          <bit>0</bit></item>
3649     <item name="PlaneMask">         <bit>1</bit></item>
3650     <item name="Foreground">        <bit>2</bit></item>
3651     <item name="Background">        <bit>3</bit></item>
3652     <item name="LineWidth">         <bit>4</bit></item>
3653     <item name="LineStyle">         <bit>5</bit></item>
3654     <item name="CapStyle">          <bit>6</bit></item>
3655     <item name="JoinStyle">         <bit>7</bit></item>
3656     <item name="FillStyle">         <bit>8</bit></item>
3657     <item name="FillRule">          <bit>9</bit></item>
3658     <item name="Tile">              <bit>10</bit></item>
3659     <item name="Stipple">           <bit>11</bit></item>
3660     <item name="TileStippleOriginX"><bit>12</bit></item>
3661     <item name="TileStippleOriginY"><bit>13</bit></item>
3662     <item name="Font">              <bit>14</bit></item>
3663     <item name="SubwindowMode">     <bit>15</bit></item>
3664     <item name="GraphicsExposures"> <bit>16</bit></item>
3665     <item name="ClipOriginX">       <bit>17</bit></item>
3666     <item name="ClipOriginY">       <bit>18</bit></item>
3667     <item name="ClipMask">          <bit>19</bit></item>
3668     <item name="DashOffset">        <bit>20</bit></item>
3669     <item name="DashList">          <bit>21</bit></item>
3670     <item name="ArcMode">           <bit>22</bit></item>
3671     <doc>
3672       <field name="Function"><![CDATA[
3673 TODO: Refer to GX
3674       ]]></field>
3675       <field name="PlaneMask"><![CDATA[
3676 In graphics operations, given a source and destination pixel, the result is
3677 computed bitwise on corresponding bits of the pixels; that is, a Boolean
3678 operation is performed in each bit plane. The plane-mask restricts the
3679 operation to a subset of planes, so the result is:
3680
3681         ((src FUNC dst) AND plane-mask) OR (dst AND (NOT plane-mask))
3682       ]]></field>
3683       <field name="Foreground"><![CDATA[
3684 Foreground colorpixel.
3685       ]]></field>
3686       <field name="Background"><![CDATA[
3687 Background colorpixel.
3688       ]]></field>
3689       <field name="LineWidth"><![CDATA[
3690 The line-width is measured in pixels and can be greater than or equal to one, a wide line, or the
3691 special value zero, a thin line.
3692       ]]></field>
3693       <field name="LineStyle"><![CDATA[
3694 The line-style defines which sections of a line are drawn:
3695 Solid                The full path of the line is drawn.
3696 DoubleDash           The full path of the line is drawn, but the even dashes are filled differently
3697                      than the odd dashes (see fill-style), with Butt cap-style used where even and
3698                      odd dashes meet.
3699 OnOffDash            Only the even dashes are drawn, and cap-style applies to all internal ends of
3700                      the individual dashes (except NotLast is treated as Butt).
3701       ]]></field>
3702       <field name="CapStyle"><![CDATA[
3703 The cap-style defines how the endpoints of a path are drawn:
3704 NotLast    The result is equivalent to Butt, except that for a line-width of zero the final
3705            endpoint is not drawn.
3706 Butt       The result is square at the endpoint (perpendicular to the slope of the line)
3707            with no projection beyond.
3708 Round      The result is a circular arc with its diameter equal to the line-width, centered
3709            on the endpoint; it is equivalent to Butt for line-width zero.
3710 Projecting The result is square at the end, but the path continues beyond the endpoint for
3711            a distance equal to half the line-width; it is equivalent to Butt for line-width
3712            zero.
3713       ]]></field>
3714       <field name="JoinStyle"><![CDATA[
3715 The join-style defines how corners are drawn for wide lines:
3716 Miter               The outer edges of the two lines extend to meet at an angle. However, if the
3717                     angle is less than 11 degrees, a Bevel join-style is used instead.
3718 Round               The result is a circular arc with a diameter equal to the line-width, centered
3719                     on the joinpoint.
3720 Bevel               The result is Butt endpoint styles, and then the triangular notch is filled.
3721       ]]></field>
3722       <field name="FillStyle"><![CDATA[
3723 The fill-style defines the contents of the source for line, text, and fill requests. For all text and fill
3724 requests (for example, PolyText8, PolyText16, PolyFillRectangle, FillPoly, and PolyFillArc)
3725 as well as for line requests with line-style Solid, (for example, PolyLine, PolySegment,
3726 PolyRectangle, PolyArc) and for the even dashes for line requests with line-style OnOffDash
3727 or DoubleDash:
3728 Solid                     Foreground
3729 Tiled                     Tile
3730 OpaqueStippled            A tile with the same width and height as stipple but with background
3731                           everywhere stipple has a zero and with foreground everywhere stipple
3732                           has a one
3733 Stippled                  Foreground masked by stipple
3734 For the odd dashes for line requests with line-style DoubleDash:
3735 Solid                     Background
3736 Tiled                     Same as for even dashes
3737 OpaqueStippled            Same as for even dashes
3738 Stippled                  Background masked by stipple
3739       ]]></field>
3740       <field name="FillRule"><![CDATA[
3741       ]]></field>
3742       <field name="Tile"><![CDATA[
3743 The tile/stipple represents an infinite two-dimensional plane with the tile/stipple replicated in all
3744 dimensions. When that plane is superimposed on the drawable for use in a graphics operation,
3745 the upper-left corner of some instance of the tile/stipple is at the coordinates within the drawable
3746 specified by the tile/stipple origin. The tile/stipple and clip origins are interpreted relative to the
3747 origin of whatever destination drawable is specified in a graphics request.
3748 The tile pixmap must have the same root and depth as the gcontext (or a Match error results).
3749 The stipple pixmap must have depth one and must have the same root as the gcontext (or a
3750 Match error results). For fill-style Stippled (but not fill-style
3751 OpaqueStippled), the stipple pattern is tiled in a single plane and acts as an
3752 additional clip mask to be ANDed with the clip-mask.
3753 Any size pixmap can be used for tiling or stippling, although some sizes may be faster to use than
3754 others.
3755       ]]></field>
3756       <field name="Stipple"><![CDATA[
3757 The tile/stipple represents an infinite two-dimensional plane with the tile/stipple replicated in all
3758 dimensions. When that plane is superimposed on the drawable for use in a graphics operation,
3759 the upper-left corner of some instance of the tile/stipple is at the coordinates within the drawable
3760 specified by the tile/stipple origin. The tile/stipple and clip origins are interpreted relative to the
3761 origin of whatever destination drawable is specified in a graphics request.
3762 The tile pixmap must have the same root and depth as the gcontext (or a Match error results).
3763 The stipple pixmap must have depth one and must have the same root as the gcontext (or a
3764 Match error results). For fill-style Stippled (but not fill-style
3765 OpaqueStippled), the stipple pattern is tiled in a single plane and acts as an
3766 additional clip mask to be ANDed with the clip-mask.
3767 Any size pixmap can be used for tiling or stippling, although some sizes may be faster to use than
3768 others.
3769       ]]></field>
3770       <field name="TileStippleOriginX"><![CDATA[
3771 TODO
3772       ]]></field>
3773       <field name="TileStippleOriginY"><![CDATA[
3774 TODO
3775       ]]></field>
3776       <field name="Font"><![CDATA[
3777 Which font to use for the `ImageText8` and `ImageText16` requests.
3778       ]]></field>
3779       <field name="SubwindowMode"><![CDATA[
3780 For ClipByChildren, both source and destination windows are additionally
3781 clipped by all viewable InputOutput children. For IncludeInferiors, neither
3782 source nor destination window is
3783 clipped by inferiors. This will result in including subwindow contents in the source and drawing
3784 through subwindow boundaries of the destination. The use of IncludeInferiors with a source or
3785 destination window of one depth with mapped inferiors of differing depth is not illegal, but the
3786 semantics is undefined by the core protocol.
3787       ]]></field>
3788       <field name="GraphicsExposures"><![CDATA[
3789 Whether ExposureEvents should be generated (1) or not (0).
3790
3791 The default is 1.
3792       ]]></field>
3793       <field name="ClipOriginX"><![CDATA[
3794 TODO
3795       ]]></field>
3796       <field name="ClipOriginY"><![CDATA[
3797 TODO
3798       ]]></field>
3799       <field name="ClipMask"><![CDATA[
3800 The clip-mask restricts writes to the destination drawable. Only pixels where the clip-mask has
3801 bits set to 1 are drawn. Pixels are not drawn outside the area covered by the clip-mask or where
3802 the clip-mask has bits set to 0. The clip-mask affects all graphics requests, but it does not clip
3803 sources. The clip-mask origin is interpreted relative to the origin of whatever destination drawable is specified in a graphics request. If a pixmap is specified as the clip-mask, it must have
3804 depth 1 and have the same root as the gcontext (or a Match error results). If clip-mask is None,
3805 then pixels are always drawn, regardless of the clip origin. The clip-mask can also be set with the
3806 SetClipRectangles request.
3807       ]]></field>
3808       <field name="DashOffset"><![CDATA[
3809 TODO
3810       ]]></field>
3811       <field name="DashList"><![CDATA[
3812 TODO
3813       ]]></field>
3814       <field name="ArcMode"><![CDATA[
3815 TODO
3816       ]]></field>
3817     </doc>
3818
3819   </enum>
3820
3821   <!-- GC Function values -->
3822   <enum name="GX">
3823     <item name="clear">       <value>0</value></item>
3824     <item name="and">         <value>1</value></item>
3825     <item name="andReverse">  <value>2</value></item>
3826     <item name="copy">        <value>3</value></item>
3827     <item name="andInverted"> <value>4</value></item>
3828     <item name="noop">        <value>5</value></item>
3829     <item name="xor">         <value>6</value></item>
3830     <item name="or">          <value>7</value></item>
3831     <item name="nor">         <value>8</value></item>
3832     <item name="equiv">       <value>9</value></item>
3833     <item name="invert">      <value>10</value></item>
3834     <item name="orReverse">   <value>11</value></item>
3835     <item name="copyInverted"><value>12</value></item>
3836     <item name="orInverted">  <value>13</value></item>
3837     <item name="nand">        <value>14</value></item>
3838     <item name="set">         <value>15</value></item>
3839   </enum>
3840
3841   <enum name="LineStyle">
3842     <item name="Solid">     <value>0</value></item>
3843     <item name="OnOffDash"> <value>1</value></item>
3844     <item name="DoubleDash"><value>2</value></item>
3845   </enum>
3846
3847   <enum name="CapStyle">
3848     <item name="NotLast">   <value>0</value></item>
3849     <item name="Butt">      <value>1</value></item>
3850     <item name="Round">     <value>2</value></item>
3851     <item name="Projecting"><value>3</value></item>
3852   </enum>
3853
3854   <enum name="JoinStyle">
3855     <item name="Miter">     <value>0</value></item>
3856     <item name="Round">     <value>1</value></item>
3857     <item name="Bevel">     <value>2</value></item>
3858   </enum>
3859
3860   <enum name="FillStyle">
3861     <item name="Solid">         <value>0</value></item>
3862     <item name="Tiled">         <value>1</value></item>
3863     <item name="Stippled">      <value>2</value></item>
3864     <item name="OpaqueStippled"><value>3</value></item>
3865   </enum>
3866
3867   <enum name="FillRule">
3868     <item name="EvenOdd"><value>0</value></item>
3869     <item name="Winding"><value>1</value></item>
3870   </enum>
3871
3872   <enum name="SubwindowMode">
3873     <item name="ClipByChildren">  <value>0</value></item>
3874     <item name="IncludeInferiors"><value>1</value></item>
3875   </enum>
3876
3877   <enum name="ArcMode">
3878     <item name="Chord">   <value>0</value></item>
3879     <item name="PieSlice"><value>1</value></item>
3880   </enum>
3881
3882   <request name="CreateGC" opcode="55">
3883     <pad bytes="1" />
3884     <field type="GCONTEXT" name="cid" />
3885     <field type="DRAWABLE" name="drawable" />
3886     <valueparam value-mask-type="CARD32"
3887                 value-mask-name="value_mask"
3888                 value-list-name="value_list" />
3889     <doc>
3890       <brief>Creates a graphics context</brief>
3891       <description><![CDATA[
3892 Creates a graphics context. The graphics context can be used with any drawable
3893 that has the same root and depth as the specified drawable.
3894       ]]></description>
3895       <field name="cid"><![CDATA[
3896 The ID with which you will refer to the graphics context, created by
3897 `xcb_generate_id`.
3898       ]]></field>
3899       <field name="drawable"><![CDATA[
3900 Drawable to get the root/depth from.
3901       ]]></field>
3902       <error type="Drawable"><![CDATA[
3903 The specified `drawable` (Window or Pixmap) does not exist.
3904       ]]></error>
3905       <error type="Match"><![CDATA[
3906 TODO: reasons?
3907       ]]></error>
3908       <error type="Font"><![CDATA[
3909 TODO: reasons?
3910       ]]></error>
3911       <error type="Pixmap"><![CDATA[
3912 TODO: reasons?
3913       ]]></error>
3914       <error type="Value"><![CDATA[
3915 TODO: reasons?
3916       ]]></error>
3917       <error type="Alloc"><![CDATA[
3918 The X server could not allocate the requested resources (no memory?).
3919       ]]></error>
3920       <see type="function" name="xcb_generate_id" />
3921     </doc>
3922   </request>
3923
3924   <request name="ChangeGC" opcode="56">
3925     <pad bytes="1" />
3926     <field type="GCONTEXT" name="gc" />
3927     <valueparam value-mask-type="CARD32"
3928                 value-mask-name="value_mask"
3929                 value-list-name="value_list" />
3930     <doc>
3931       <brief>change graphics context components</brief>
3932       <description><![CDATA[
3933 Changes the components specified by `value_mask` for the specified graphics context.
3934       ]]></description>
3935       <example><![CDATA[
3936 /*
3937  * Changes the foreground color component of the specified graphics context.
3938  *
3939  */
3940 void my_example(xcb_connection *conn, xcb_gcontext_t gc, uint32_t fg, uint32_t bg) {
3941     /* C99 allows us to use a compact way of changing a single component: */
3942     xcb_change_gc(conn, gc, XCB_GC_FOREGROUND, (uint32_t[]){ fg });
3943
3944     /* The more explicit way. Beware that the order of values is important! */
3945     uint32_t mask = 0;
3946     mask |= XCB_GC_FOREGROUND;
3947     mask |= XCB_GC_BACKGROUND;
3948
3949     uint32_t values[] = {
3950         fg,
3951         bg
3952     };
3953     xcb_change_gc(conn, gc, mask, values);
3954     xcb_flush(conn);
3955 }
3956       ]]></example>
3957       <field name="gc"><![CDATA[
3958 The graphics context to change.
3959       ]]></field>
3960       <!-- the enum documentation is good enough. -->
3961       <field name="value_mask" />
3962       <field name="value_list"><![CDATA[
3963 Values for each of the components specified in the bitmask `value_mask`. The
3964 order has to correspond to the order of possible `value_mask` bits. See the
3965 example.
3966       ]]></field>
3967       <error type="Font"><![CDATA[
3968 TODO: reasons?
3969       ]]></error>
3970       <error type="GContext"><![CDATA[
3971 TODO: reasons?
3972       ]]></error>
3973       <error type="Match"><![CDATA[
3974 TODO: reasons?
3975       ]]></error>
3976       <error type="Pixmap"><![CDATA[
3977 TODO: reasons?
3978       ]]></error>
3979       <error type="Value"><![CDATA[
3980 TODO: reasons?
3981       ]]></error>
3982       <error type="Alloc"><![CDATA[
3983 The X server could not allocate the requested resources (no memory?).
3984       ]]></error>
3985     </doc>
3986   </request>
3987
3988   <request name="CopyGC" opcode="57">
3989     <pad bytes="1" />
3990     <field type="GCONTEXT" name="src_gc" />
3991     <field type="GCONTEXT" name="dst_gc" />
3992     <field type="CARD32" name="value_mask" mask="GC" />
3993   </request>
3994
3995   <request name="SetDashes" opcode="58">
3996     <pad bytes="1" />
3997     <field type="GCONTEXT" name="gc" />
3998     <field type="CARD16" name="dash_offset" />
3999     <field type="CARD16" name="dashes_len" />
4000     <list type="CARD8" name="dashes">
4001       <fieldref>dashes_len</fieldref>
4002     </list>
4003   </request>
4004
4005   <enum name="ClipOrdering">
4006     <item name="Unsorted"><value>0</value></item>
4007     <item name="YSorted"> <value>1</value></item>
4008     <item name="YXSorted"><value>2</value></item>
4009     <item name="YXBanded"><value>3</value></item>
4010   </enum>
4011
4012   <request name="SetClipRectangles" opcode="59">
4013     <field type="BYTE" name="ordering" enum="ClipOrdering" />
4014     <field type="GCONTEXT" name="gc" />
4015     <field type="INT16" name="clip_x_origin" />
4016     <field type="INT16" name="clip_y_origin" />
4017     <list type="RECTANGLE" name="rectangles" />
4018   </request>
4019
4020   <request name="FreeGC" opcode="60">
4021     <pad bytes="1" />
4022     <field type="GCONTEXT" name="gc" />
4023     <doc>
4024       <brief>Destroys a graphics context</brief>
4025       <description><![CDATA[
4026 Destroys the specified `gc` and all associated storage.
4027       ]]></description>
4028       <field name="gc"><![CDATA[The graphics context to destroy.]]></field>
4029       <error type="GContext"><![CDATA[
4030 The specified graphics context does not exist.
4031       ]]></error>
4032     </doc>
4033   </request>
4034
4035   <request name="ClearArea" opcode="61">
4036     <field type="BOOL" name="exposures" />
4037     <field type="WINDOW" name="window" />
4038     <field type="INT16" name="x" />
4039     <field type="INT16" name="y" />
4040     <field type="CARD16" name="width" />
4041     <field type="CARD16" name="height" />
4042   </request>
4043
4044   <request name="CopyArea" opcode="62">
4045     <pad bytes="1" />
4046     <field type="DRAWABLE" name="src_drawable" />
4047     <field type="DRAWABLE" name="dst_drawable" />
4048     <field type="GCONTEXT" name="gc" />
4049     <field type="INT16" name="src_x" />
4050     <field type="INT16" name="src_y" />
4051     <field type="INT16" name="dst_x" />
4052     <field type="INT16" name="dst_y" />
4053     <field type="CARD16" name="width" />
4054     <field type="CARD16" name="height" />
4055     <doc>
4056       <brief>copy areas</brief>
4057       <description><![CDATA[
4058 Copies the specified rectangle from `src_drawable` to `dst_drawable`.
4059       ]]></description>
4060       <field name="dst_drawable"><![CDATA[
4061 The destination drawable (Window or Pixmap).
4062       ]]></field>
4063       <field name="src_drawable"><![CDATA[
4064 The source drawable (Window or Pixmap).
4065       ]]></field>
4066       <field name="gc"><![CDATA[
4067 The graphics context to use.
4068       ]]></field>
4069       <field name="src_x"><![CDATA[
4070 The source X coordinate.
4071       ]]></field>
4072       <field name="src_y"><![CDATA[
4073 The source Y coordinate.
4074       ]]></field>
4075       <field name="dst_x"><![CDATA[
4076 The destination X coordinate.
4077       ]]></field>
4078       <field name="dst_y"><![CDATA[
4079 The destination Y coordinate.
4080       ]]></field>
4081       <field name="width"><![CDATA[
4082 The width of the area to copy (in pixels).
4083       ]]></field>
4084       <field name="height"><![CDATA[
4085 The height of the area to copy (in pixels).
4086       ]]></field>
4087       <error type="Drawable"><![CDATA[
4088 The specified `drawable` (Window or Pixmap) does not exist.
4089       ]]></error>
4090       <error type="GContext"><![CDATA[
4091 The specified graphics context does not exist.
4092       ]]></error>
4093       <error type="Match"><![CDATA[
4094 `src_drawable` has a different root or depth than `dst_drawable`.
4095       ]]></error>
4096     </doc>
4097   </request>
4098
4099   <request name="CopyPlane" opcode="63">
4100     <pad bytes="1" />
4101     <field type="DRAWABLE" name="src_drawable" />
4102     <field type="DRAWABLE" name="dst_drawable" />
4103     <field type="GCONTEXT" name="gc" />
4104     <field type="INT16" name="src_x" />
4105     <field type="INT16" name="src_y" />
4106     <field type="INT16" name="dst_x" />
4107     <field type="INT16" name="dst_y" />
4108     <field type="CARD16" name="width" />
4109     <field type="CARD16" name="height" />
4110     <field type="CARD32" name="bit_plane" />
4111   </request>
4112   
4113   <enum name="CoordMode">
4114     <item name="Origin">  <value>0</value></item>
4115     <item name="Previous"><value>1</value></item>
4116     <doc>
4117       <field name="Origin"><![CDATA[
4118 Treats all coordinates as relative to the origin.
4119       ]]></field>
4120       <field name="Previous"><![CDATA[
4121 Treats all coordinates after the first as relative to the previous coordinate.
4122       ]]></field>
4123     </doc>
4124   </enum>
4125
4126   <!-- combine-adjacent doesn't work for mode==Relative -->
4127   <request name="PolyPoint" opcode="64">
4128     <field type="BYTE" name="coordinate_mode" enum="CoordMode" />
4129     <field type="DRAWABLE" name="drawable" />
4130     <field type="GCONTEXT" name="gc" />
4131     <list type="POINT" name="points" />
4132   </request>
4133
4134   <request name="PolyLine" opcode="65" combine-adjacent="true">
4135     <field type="BYTE" name="coordinate_mode" enum="CoordMode" />
4136     <field type="DRAWABLE" name="drawable" />
4137     <field type="GCONTEXT" name="gc" />
4138     <list type="POINT" name="points" />
4139     <doc>
4140       <brief>draw lines</brief>
4141       <description><![CDATA[
4142 Draws `points_len`-1 lines between each pair of points (point[i], point[i+1])
4143 in the `points` array. The lines are drawn in the order listed in the array.
4144 They join correctly at all intermediate points, and if the first and last
4145 points coincide, the first and last lines also join correctly. For any given
4146 line, a pixel is not drawn more than once. If thin (zero line-width) lines
4147 intersect, the intersecting pixels are drawn multiple times. If wide lines
4148 intersect, the intersecting pixels are drawn only once, as though the entire
4149 request were a single, filled shape.
4150       ]]></description>
4151       <example><![CDATA[
4152 /*
4153  * Draw a straight line.
4154  *
4155  */
4156 void my_example(xcb_connection *conn, xcb_drawable_t drawable, xcb_gcontext_t gc) {
4157     xcb_poly_line(conn, XCB_COORD_MODE_ORIGIN, drawable, gc, 2,
4158                   (xcb_point_t[]) { {10, 10}, {100, 10} });
4159     xcb_flush(conn);
4160 }
4161       ]]></example>
4162       <field name="drawable"><![CDATA[
4163 The drawable to draw the line(s) on.
4164       ]]></field>
4165       <field name="gc"><![CDATA[
4166 The graphics context to use.
4167       ]]></field>
4168       <field name="points_len"><![CDATA[
4169 The number of `xcb_point_t` structures in `points`.
4170       ]]></field>
4171       <field name="points"><![CDATA[
4172 An array of points.
4173       ]]></field>
4174       <!-- the enum doc is sufficient. -->
4175       <field name="coordinate_mode" />
4176       <error type="Drawable"><![CDATA[
4177 TODO: reasons?
4178       ]]></error>
4179       <error type="GContext"><![CDATA[
4180 TODO: reasons?
4181       ]]></error>
4182       <error type="Match"><![CDATA[
4183 TODO: reasons?
4184       ]]></error>
4185       <error type="Value"><![CDATA[
4186 TODO: reasons?
4187       ]]></error>
4188     </doc>
4189   </request>
4190
4191   <struct name="SEGMENT">
4192     <field type="INT16" name="x1" />
4193     <field type="INT16" name="y1" />
4194     <field type="INT16" name="x2" />
4195     <field type="INT16" name="y2" />
4196   </struct>
4197
4198   <request name="PolySegment" opcode="66" combine-adjacent="true">
4199     <pad bytes="1" />
4200     <field type="DRAWABLE" name="drawable" />
4201     <field type="GCONTEXT" name="gc" />
4202     <list type="SEGMENT" name="segments" />
4203     <doc>
4204       <brief>draw lines</brief>
4205       <description><![CDATA[
4206 Draws multiple, unconnected lines. For each segment, a line is drawn between
4207 (x1, y1) and (x2, y2). The lines are drawn in the order listed in the array of
4208 `xcb_segment_t` structures and does not perform joining at coincident
4209 endpoints. For any given line, a pixel is not drawn more than once. If lines
4210 intersect, the intersecting pixels are drawn multiple times.
4211
4212 TODO: include the xcb_segment_t data structure
4213
4214 TODO: an example
4215       ]]></description>
4216       <field name="drawable"><![CDATA[
4217 A drawable (Window or Pixmap) to draw on.
4218       ]]></field>
4219       <field name="gc"><![CDATA[
4220 The graphics context to use.
4221
4222 TODO: document which attributes of a gc are used
4223       ]]></field>
4224       <field name="segments_len"><![CDATA[
4225 The number of `xcb_segment_t` structures in `segments`.
4226       ]]></field>
4227       <field name="segments"><![CDATA[
4228 An array of `xcb_segment_t` structures.
4229       ]]></field>
4230       <error type="Drawable"><![CDATA[
4231 The specified `drawable` does not exist.
4232       ]]></error>
4233       <error type="GContext"><![CDATA[
4234 The specified `gc` does not exist.
4235       ]]></error>
4236       <error type="Match"><![CDATA[
4237 TODO: reasons?
4238       ]]></error>
4239     </doc>
4240   </request>
4241
4242   <request name="PolyRectangle" opcode="67" combine-adjacent="true">
4243     <pad bytes="1" />
4244     <field type="DRAWABLE" name="drawable" />
4245     <field type="GCONTEXT" name="gc" />
4246     <list type="RECTANGLE" name="rectangles" />
4247   </request>
4248
4249   <!--
4250     The semantics of PolyArc change after the first arc: the GC's
4251     join style may be applied to successive arcs under some circumstances.
4252     So using combine-adjacent here is bad.
4253   -->
4254   <request name="PolyArc" opcode="68">
4255     <pad bytes="1" />
4256     <field type="DRAWABLE" name="drawable" />
4257     <field type="GCONTEXT" name="gc" />
4258     <list type="ARC" name="arcs" />
4259   </request>
4260
4261   <enum name="PolyShape">
4262     <item name="Complex">  <value>0</value></item>
4263     <item name="Nonconvex"><value>1</value></item>
4264     <item name="Convex">   <value>2</value></item>
4265   </enum>
4266
4267   <request name="FillPoly" opcode="69">
4268     <pad bytes="1" />
4269     <field type="DRAWABLE" name="drawable" />
4270     <field type="GCONTEXT" name="gc" />
4271     <field type="CARD8" name="shape" enum="PolyShape" />
4272     <field type="CARD8" name="coordinate_mode" enum="CoordMode" />
4273     <pad bytes="2" />
4274     <list type="POINT" name="points" />
4275   </request>
4276
4277   <request name="PolyFillRectangle" opcode="70" combine-adjacent="true">
4278     <pad bytes="1" />
4279     <field type="DRAWABLE" name="drawable" />
4280     <field type="GCONTEXT" name="gc" />
4281     <list type="RECTANGLE" name="rectangles" />
4282     <doc>
4283       <brief>Fills rectangles</brief>
4284       <description><![CDATA[
4285 Fills the specified rectangle(s) in the order listed in the array. For any
4286 given rectangle, each pixel is not drawn more than once. If rectangles
4287 intersect, the intersecting pixels are drawn multiple times.
4288       ]]></description>
4289       <field name="drawable"><![CDATA[
4290 The drawable (Window or Pixmap) to draw on.
4291       ]]></field>
4292       <field name="gc"><![CDATA[
4293 The graphics context to use.
4294
4295 The following graphics context components are used: function, plane-mask,
4296 fill-style, subwindow-mode, clip-x-origin, clip-y-origin, and clip-mask.
4297
4298 The following graphics context mode-dependent components are used:
4299 foreground, background, tile, stipple, tile-stipple-x-origin, and
4300 tile-stipple-y-origin.
4301       ]]></field>
4302       <field name="rectangles_len"><![CDATA[
4303 The number of `xcb_rectangle_t` structures in `rectangles`.
4304       ]]></field>
4305       <field name="rectangles"><![CDATA[
4306 The rectangles to fill.
4307       ]]></field>
4308       <error type="Drawable"><![CDATA[
4309 The specified `drawable` (Window or Pixmap) does not exist.
4310       ]]></error>
4311       <error type="GContext"><![CDATA[
4312 The specified graphics context does not exist.
4313       ]]></error>
4314       <error type="Match"><![CDATA[
4315 TODO: reasons?
4316       ]]></error>
4317     </doc>
4318   </request>
4319
4320   <request name="PolyFillArc" opcode="71" combine-adjacent="true">
4321     <pad bytes="1" />
4322     <field type="DRAWABLE" name="drawable" />
4323     <field type="GCONTEXT" name="gc" />
4324     <list type="ARC" name="arcs" />
4325   </request>
4326   
4327   <enum name="ImageFormat">
4328     <item name="XYBitmap"><value>0</value></item>
4329     <item name="XYPixmap"><value>1</value></item>
4330     <item name="ZPixmap"> <value>2</value></item>
4331   </enum>
4332
4333   <request name="PutImage" opcode="72">
4334     <field type="CARD8" name="format" enum="ImageFormat" />
4335     <field type="DRAWABLE" name="drawable" />
4336     <field type="GCONTEXT" name="gc" />
4337     <field type="CARD16" name="width" />
4338     <field type="CARD16" name="height" />
4339     <field type="INT16" name="dst_x" />
4340     <field type="INT16" name="dst_y" />
4341     <field type="CARD8" name="left_pad" />
4342     <field type="CARD8" name="depth" />
4343     <pad bytes="2" />
4344     <list type="BYTE" name="data" />
4345   </request>
4346
4347   <!-- FIXME: data array in reply will include padding, but ought not to. -->
4348   <request name="GetImage" opcode="73">
4349     <field type="CARD8" name="format" enum="ImageFormat" />
4350     <field type="DRAWABLE" name="drawable" />
4351     <field type="INT16" name="x" />
4352     <field type="INT16" name="y" />
4353     <field type="CARD16" name="width" />
4354     <field type="CARD16" name="height" />
4355     <field type="CARD32" name="plane_mask" />
4356     <reply>
4357       <field type="CARD8" name="depth" />
4358       <field type="VISUALID" name="visual" />
4359       <pad bytes="20" />
4360       <list type="BYTE" name="data">
4361         <op op="*">
4362           <fieldref>length</fieldref>
4363           <value>4</value>
4364         </op>
4365       </list>
4366     </reply>
4367   </request>
4368
4369   <request name="PolyText8" opcode="74">
4370     <pad bytes="1" />
4371     <field type="DRAWABLE" name="drawable" />
4372     <field type="GCONTEXT" name="gc" />
4373     <field type="INT16" name="x" />
4374     <field type="INT16" name="y" />
4375     <list type="BYTE" name="items" />
4376   </request>
4377
4378   <request name="PolyText16" opcode="75">
4379     <pad bytes="1" />
4380     <field type="DRAWABLE" name="drawable" />
4381     <field type="GCONTEXT" name="gc" />
4382     <field type="INT16" name="x" />
4383     <field type="INT16" name="y" />
4384     <list type="BYTE" name="items" />
4385   </request>
4386
4387   <request name="ImageText8" opcode="76">
4388     <field type="BYTE" name="string_len" />
4389     <field type="DRAWABLE" name="drawable" />
4390     <field type="GCONTEXT" name="gc" />
4391     <field type="INT16" name="x" />
4392     <field type="INT16" name="y" />
4393     <list type="char" name="string">
4394       <fieldref>string_len</fieldref>
4395     </list>
4396     <doc>
4397       <brief>Draws text</brief>
4398       <description><![CDATA[
4399 Fills the destination rectangle with the background pixel from `gc`, then
4400 paints the text with the foreground pixel from `gc`. The upper-left corner of
4401 the filled rectangle is at [x, y - font-ascent]. The width is overall-width,
4402 the height is font-ascent + font-descent. The overall-width, font-ascent and
4403 font-descent are as returned by `xcb_query_text_extents` (TODO).
4404
4405 Note that using X core fonts is deprecated (but still supported) in favor of
4406 client-side rendering using Xft.
4407       ]]></description>
4408       <field name="drawable"><![CDATA[
4409 The drawable (Window or Pixmap) to draw text on.
4410       ]]></field>
4411       <field name="string_len"><![CDATA[
4412 The length of the `string`. Note that this parameter limited by 255 due to
4413 using 8 bits!
4414       ]]></field>
4415       <field name="string"><![CDATA[
4416 The string to draw. Only the first 255 characters are relevant due to the data
4417 type of `string_len`.
4418       ]]></field>
4419       <field name="x"><![CDATA[
4420 The x coordinate of the first character, relative to the origin of `drawable`.
4421       ]]></field>
4422       <field name="y"><![CDATA[
4423 The y coordinate of the first character, relative to the origin of `drawable`.
4424       ]]></field>
4425       <field name="gc"><![CDATA[
4426 The graphics context to use.
4427
4428 The following graphics context components are used: plane-mask, foreground,
4429 background, font, subwindow-mode, clip-x-origin, clip-y-origin, and clip-mask.
4430       ]]></field>
4431       <error type="Drawable"><![CDATA[
4432 The specified `drawable` (Window or Pixmap) does not exist.
4433       ]]></error>
4434       <error type="GContext"><![CDATA[
4435 The specified graphics context does not exist.
4436       ]]></error>
4437       <error type="Match"><![CDATA[
4438 TODO: reasons?
4439       ]]></error>
4440       <see type="request" name="ImageText16" />
4441     </doc>
4442   </request>
4443
4444   <request name="ImageText16" opcode="77">
4445     <field type="BYTE" name="string_len" />
4446     <field type="DRAWABLE" name="drawable" />
4447     <field type="GCONTEXT" name="gc" />
4448     <field type="INT16" name="x" />
4449     <field type="INT16" name="y" />
4450     <list type="CHAR2B" name="string">
4451       <fieldref>string_len</fieldref>
4452     </list>
4453     <doc>
4454       <brief>Draws text</brief>
4455       <description><![CDATA[
4456 Fills the destination rectangle with the background pixel from `gc`, then
4457 paints the text with the foreground pixel from `gc`. The upper-left corner of
4458 the filled rectangle is at [x, y - font-ascent]. The width is overall-width,
4459 the height is font-ascent + font-descent. The overall-width, font-ascent and
4460 font-descent are as returned by `xcb_query_text_extents` (TODO).
4461
4462 Note that using X core fonts is deprecated (but still supported) in favor of
4463 client-side rendering using Xft.
4464       ]]></description>
4465       <field name="drawable"><![CDATA[
4466 The drawable (Window or Pixmap) to draw text on.
4467       ]]></field>
4468       <field name="string_len"><![CDATA[
4469 The length of the `string` in characters. Note that this parameter limited by
4470 255 due to using 8 bits!
4471       ]]></field>
4472       <field name="string"><![CDATA[
4473 The string to draw. Only the first 255 characters are relevant due to the data
4474 type of `string_len`. Every character uses 2 bytes (hence the 16 in this
4475 request's name).
4476       ]]></field>
4477       <field name="x"><![CDATA[
4478 The x coordinate of the first character, relative to the origin of `drawable`.
4479       ]]></field>
4480       <field name="y"><![CDATA[
4481 The y coordinate of the first character, relative to the origin of `drawable`.
4482       ]]></field>
4483       <field name="gc"><![CDATA[
4484 The graphics context to use.
4485
4486 The following graphics context components are used: plane-mask, foreground,
4487 background, font, subwindow-mode, clip-x-origin, clip-y-origin, and clip-mask.
4488       ]]></field>
4489       <error type="Drawable"><![CDATA[
4490 The specified `drawable` (Window or Pixmap) does not exist.
4491       ]]></error>
4492       <error type="GContext"><![CDATA[
4493 The specified graphics context does not exist.
4494       ]]></error>
4495       <error type="Match"><![CDATA[
4496 TODO: reasons?
4497       ]]></error>
4498       <see type="request" name="ImageText8" />
4499     </doc>
4500   </request>
4501
4502   <enum name= "ColormapAlloc">
4503     <item name="None"><value>0</value></item>
4504     <item name="All"> <value>1</value></item>
4505   </enum>
4506
4507   <request name="CreateColormap" opcode="78">
4508     <field type="BYTE" name="alloc" enum="ColormapAlloc" />
4509     <field type="COLORMAP" name="mid" />
4510     <field type="WINDOW" name="window" />
4511     <field type="VISUALID" name="visual" />
4512   </request>
4513
4514   <request name="FreeColormap" opcode="79">
4515     <pad bytes="1" />
4516     <field type="COLORMAP" name="cmap" />
4517   </request>
4518
4519   <request name="CopyColormapAndFree" opcode="80">
4520     <pad bytes="1" />
4521     <field type="COLORMAP" name="mid" />
4522     <field type="COLORMAP" name="src_cmap" />
4523   </request>
4524
4525   <request name="InstallColormap" opcode="81">
4526     <pad bytes="1" />
4527     <field type="COLORMAP" name="cmap" />
4528   </request>
4529
4530   <request name="UninstallColormap" opcode="82">
4531     <pad bytes="1" />
4532     <field type="COLORMAP" name="cmap" />
4533   </request>
4534
4535   <request name="ListInstalledColormaps" opcode="83">
4536     <pad bytes="1" />
4537     <field type="WINDOW" name="window" />
4538     <reply>
4539       <pad bytes="1" />
4540       <field type="CARD16" name="cmaps_len" />
4541       <pad bytes="22" />
4542       <list type="COLORMAP" name="cmaps">
4543         <fieldref>cmaps_len</fieldref>
4544       </list>
4545     </reply>
4546   </request>
4547
4548   <request name="AllocColor" opcode="84">
4549     <pad bytes="1" />
4550     <field type="COLORMAP" name="cmap" />
4551     <field type="CARD16" name="red" />
4552     <field type="CARD16" name="green" />
4553     <field type="CARD16" name="blue" />
4554     <pad bytes="2" />
4555     <reply>
4556       <pad bytes="1" />
4557       <field type="CARD16" name="red" />
4558       <field type="CARD16" name="green" />
4559       <field type="CARD16" name="blue" />
4560       <pad bytes="2" />
4561       <field type="CARD32" name="pixel" />
4562     </reply>
4563     <doc>
4564       <brief>Allocate a color</brief>
4565       <description><![CDATA[
4566 Allocates a read-only colormap entry corresponding to the closest RGB value
4567 supported by the hardware. If you are using TrueColor, you can take a shortcut
4568 and directly calculate the color pixel value to avoid the round trip. But, for
4569 example, on 16-bit color setups (VNC), you can easily get the closest supported
4570 RGB value to the RGB value you are specifying.
4571       ]]></description>
4572       <field name="cmap"><![CDATA[
4573 TODO
4574       ]]></field>
4575       <field name="red"><![CDATA[
4576 The red value of your color.
4577       ]]></field>
4578       <field name="green"><![CDATA[
4579 The green value of your color.
4580       ]]></field>
4581       <field name="blue"><![CDATA[
4582 The blue value of your color.
4583       ]]></field>
4584       <error type="Colormap"><![CDATA[
4585 The specified colormap `cmap` does not exist.
4586       ]]></error>
4587     </doc>
4588   </request>
4589
4590   <request name="AllocNamedColor" opcode="85">
4591     <pad bytes="1" />
4592     <field type="COLORMAP" name="cmap" />
4593     <field type="CARD16" name="name_len" />
4594     <pad bytes="2" />
4595     <list type="char" name="name">
4596       <fieldref>name_len</fieldref>
4597     </list>
4598     <reply>
4599       <pad bytes="1" />
4600       <field type="CARD32" name="pixel" />
4601       <field type="CARD16" name="exact_red" />
4602       <field type="CARD16" name="exact_green" />
4603       <field type="CARD16" name="exact_blue" />
4604       <field type="CARD16" name="visual_red" />
4605       <field type="CARD16" name="visual_green" />
4606       <field type="CARD16" name="visual_blue" />
4607     </reply>
4608   </request>
4609
4610   <request name="AllocColorCells" opcode="86">
4611     <field type="BOOL" name="contiguous" />
4612     <field type="COLORMAP" name="cmap" />
4613     <field type="CARD16" name="colors" />
4614     <field type="CARD16" name="planes" />
4615     <reply>
4616       <pad bytes="1" />
4617       <field type="CARD16" name="pixels_len" />
4618       <field type="CARD16" name="masks_len" />
4619       <pad bytes="20" />
4620       <list type="CARD32" name="pixels">
4621         <fieldref>pixels_len</fieldref>
4622       </list>
4623       <list type="CARD32" name="masks">
4624         <fieldref>masks_len</fieldref>
4625       </list>
4626     </reply>
4627   </request>
4628
4629   <request name="AllocColorPlanes" opcode="87">
4630     <field type="BOOL" name="contiguous" />
4631     <field type="COLORMAP" name="cmap" />
4632     <field type="CARD16" name="colors" />
4633     <field type="CARD16" name="reds" />
4634     <field type="CARD16" name="greens" />
4635     <field type="CARD16" name="blues" />
4636     <reply>
4637       <pad bytes="1" />
4638       <field type="CARD16" name="pixels_len" />
4639       <pad bytes="2" />
4640       <field type="CARD32" name="red_mask" />
4641       <field type="CARD32" name="green_mask" />
4642       <field type="CARD32" name="blue_mask" />
4643       <pad bytes="8" />
4644       <list type="CARD32" name="pixels">
4645         <fieldref>pixels_len</fieldref>
4646       </list>
4647     </reply>
4648   </request>
4649
4650   <request name="FreeColors" opcode="88">
4651     <pad bytes="1" />
4652     <field type="COLORMAP" name="cmap" />
4653     <field type="CARD32" name="plane_mask" />
4654     <list type="CARD32" name="pixels" />
4655   </request>
4656
4657   <enum name="ColorFlag">
4658     <item name="Red">  <bit>0</bit></item>
4659     <item name="Green"><bit>1</bit></item>
4660     <item name="Blue"> <bit>2</bit></item>
4661   </enum>
4662
4663   <struct name="COLORITEM">
4664     <field type="CARD32" name="pixel" />
4665     <field type="CARD16" name="red" />
4666     <field type="CARD16" name="green" />
4667     <field type="CARD16" name="blue" />
4668     <field type="BYTE" name="flags" mask="ColorFlag" />
4669     <pad bytes="1" />
4670   </struct>
4671   
4672   <request name="StoreColors" opcode="89" combine-adjacent="true">
4673     <pad bytes="1" />
4674     <field type="COLORMAP" name="cmap" />
4675     <list type="COLORITEM" name="items" />
4676   </request>
4677
4678   <request name="StoreNamedColor" opcode="90">
4679     <field type="CARD8" name="flags" mask="ColorFlag" />
4680     <field type="COLORMAP" name="cmap" />
4681     <field type="CARD32" name="pixel" />
4682     <field type="CARD16" name="name_len" />
4683     <pad bytes="2" />
4684     <list type="char" name="name">
4685       <fieldref>name_len</fieldref>
4686     </list>
4687   </request>
4688
4689   <struct name="RGB">
4690     <field type="CARD16" name="red" />
4691     <field type="CARD16" name="green" />
4692     <field type="CARD16" name="blue" />
4693     <pad bytes="2" />
4694   </struct>
4695
4696   <request name="QueryColors" opcode="91">
4697     <pad bytes="1" />
4698     <field type="COLORMAP" name="cmap" />
4699     <list type="CARD32" name="pixels" />
4700     <reply>
4701       <pad bytes="1" />
4702       <field type="CARD16" name="colors_len" />
4703       <pad bytes="22" />
4704       <list type="RGB" name="colors">
4705         <fieldref>colors_len</fieldref>
4706       </list>
4707     </reply>
4708   </request>
4709
4710   <request name="LookupColor" opcode="92">
4711     <pad bytes="1" />
4712     <field type="COLORMAP" name="cmap" />
4713     <field type="CARD16" name="name_len" />
4714     <pad bytes="2" />
4715     <list type="char" name="name">
4716       <fieldref>name_len</fieldref>
4717     </list>
4718     <reply>
4719       <pad bytes="1" />
4720       <field type="CARD16" name="exact_red" />
4721       <field type="CARD16" name="exact_green" />
4722       <field type="CARD16" name="exact_blue" />
4723       <field type="CARD16" name="visual_red" />
4724       <field type="CARD16" name="visual_green" />
4725       <field type="CARD16" name="visual_blue" />
4726     </reply>
4727   </request>
4728
4729   <enum name="Pixmap">
4730     <item name="None"> <value>0</value></item>
4731   </enum>
4732
4733   <request name="CreateCursor" opcode="93">
4734     <pad bytes="1" />
4735     <field type="CURSOR" name="cid" />
4736     <field type="PIXMAP" name="source" />
4737     <field type="PIXMAP" name="mask" altenum="Pixmap" />
4738     <field type="CARD16" name="fore_red" />
4739     <field type="CARD16" name="fore_green" />
4740     <field type="CARD16" name="fore_blue" />
4741     <field type="CARD16" name="back_red" />
4742     <field type="CARD16" name="back_green" />
4743     <field type="CARD16" name="back_blue" />
4744     <field type="CARD16" name="x" />
4745     <field type="CARD16" name="y" />
4746   </request>
4747
4748   <enum name="Font">
4749     <item name="None"> <value>0</value></item>
4750   </enum>
4751
4752   <request name="CreateGlyphCursor" opcode="94">
4753     <pad bytes="1" />
4754     <field type="CURSOR" name="cid" />
4755     <field type="FONT" name="source_font" />
4756     <field type="FONT" name="mask_font" altenum="Font" />
4757     <field type="CARD16" name="source_char" />
4758     <field type="CARD16" name="mask_char" />
4759     <field type="CARD16" name="fore_red" />
4760     <field type="CARD16" name="fore_green" />
4761     <field type="CARD16" name="fore_blue" />
4762     <field type="CARD16" name="back_red" />
4763     <field type="CARD16" name="back_green" />
4764     <field type="CARD16" name="back_blue" />
4765     <doc>
4766       <brief>create cursor</brief>
4767       <description><![CDATA[
4768 Creates a cursor from a font glyph. X provides a set of standard cursor shapes
4769 in a special font named cursor. Applications are encouraged to use this
4770 interface for their cursors because the font can be customized for the
4771 individual display type.
4772
4773 All pixels which are set to 1 in the source will use the foreground color (as
4774 specified by `fore_red`, `fore_green` and `fore_blue`). All pixels set to 0
4775 will use the background color (as specified by `back_red`, `back_green` and
4776 `back_blue`).
4777       ]]></description>
4778       <field name="cid"><![CDATA[
4779 The ID with which you will refer to the cursor, created by `xcb_generate_id`.
4780       ]]></field>
4781       <field name="source_font"><![CDATA[
4782 In which font to look for the cursor glyph.
4783       ]]></field>
4784       <field name="mask_font"><![CDATA[
4785 In which font to look for the mask glyph.
4786       ]]></field>
4787       <field name="source_char"><![CDATA[
4788 The glyph of `source_font` to use.
4789       ]]></field>
4790       <field name="mask_char"><![CDATA[
4791 The glyph of `mask_font` to use as a mask: Pixels which are set to 1 define
4792 which source pixels are displayed. All pixels which are set to 0 are not
4793 displayed.
4794       ]]></field>
4795       <field name="fore_red"><![CDATA[
4796 The red value of the foreground color.
4797       ]]></field>
4798       <field name="fore_green"><![CDATA[
4799 The green value of the foreground color.
4800       ]]></field>
4801       <field name="fore_blue"><![CDATA[
4802 The blue value of the foreground color.
4803       ]]></field>
4804       <field name="back_red"><![CDATA[
4805 The red value of the background color.
4806       ]]></field>
4807       <field name="back_green"><![CDATA[
4808 The green value of the background color.
4809       ]]></field>
4810       <field name="back_blue"><![CDATA[
4811 The blue value of the background color.
4812       ]]></field>
4813       <error type="Alloc"><![CDATA[
4814 The X server could not allocate the requested resources (no memory?).
4815       ]]></error>
4816       <error type="Font"><![CDATA[
4817 The specified `source_font` or `mask_font` does not exist.
4818       ]]></error>
4819       <error type="Value"><![CDATA[
4820 Either `source_char` or `mask_char` are not defined in `source_font` or `mask_font`, respectively.
4821       ]]></error>
4822       <!-- TODO: example -->
4823     </doc>
4824   </request>
4825
4826   <request name="FreeCursor" opcode="95">
4827     <pad bytes="1" />
4828     <field type="CURSOR" name="cursor" />
4829     <doc>
4830       <brief>Deletes a cursor</brief>
4831       <description><![CDATA[
4832 Deletes the association between the cursor resource ID and the specified
4833 cursor. The cursor is freed when no other resource references it.
4834       ]]></description>
4835       <field name="cursor"><![CDATA[The cursor to destroy.]]></field>
4836       <error type="Cursor"><![CDATA[
4837 The specified cursor does not exist.
4838       ]]></error>
4839     </doc>
4840
4841   </request>
4842
4843   <request name="RecolorCursor" opcode="96">
4844     <pad bytes="1" />
4845     <field type="CURSOR" name="cursor" />
4846     <field type="CARD16" name="fore_red" />
4847     <field type="CARD16" name="fore_green" />
4848     <field type="CARD16" name="fore_blue" />
4849     <field type="CARD16" name="back_red" />
4850     <field type="CARD16" name="back_green" />
4851     <field type="CARD16" name="back_blue" />
4852   </request>
4853
4854   <enum name="QueryShapeOf">
4855     <item name="LargestCursor"> <value>0</value></item>
4856     <item name="FastestTile">   <value>1</value></item>
4857     <item name="FastestStipple"><value>2</value></item>    
4858   </enum>
4859
4860   <request name="QueryBestSize" opcode="97">
4861     <field type="CARD8" name="class" enum="QueryShapeOf" />
4862     <field type="DRAWABLE" name="drawable" />
4863     <field type="CARD16" name="width" />
4864     <field type="CARD16" name="height" />
4865     <reply>
4866       <pad bytes="1" />
4867       <field type="CARD16" name="width" />
4868       <field type="CARD16" name="height" />
4869     </reply>
4870   </request>
4871
4872   <request name="QueryExtension" opcode="98">
4873     <pad bytes="1" />
4874     <field type="CARD16" name="name_len" />
4875     <pad bytes="2" />
4876     <list type="char" name="name">
4877       <fieldref>name_len</fieldref>
4878     </list>
4879     <reply>
4880       <pad bytes="1" />
4881       <field type="BOOL" name="present" />
4882       <field type="CARD8" name="major_opcode" />
4883       <field type="CARD8" name="first_event" />
4884       <field type="CARD8" name="first_error" />
4885       <doc>
4886         <field name="present"><![CDATA[
4887 Whether the extension is present on this X11 server.
4888         ]]></field>
4889         <field name="major_opcode"><![CDATA[
4890 The major opcode for requests.
4891         ]]></field>
4892         <field name="first_event"><![CDATA[
4893 The first event code, if any.
4894         ]]></field>
4895         <field name="first_error"><![CDATA[
4896 The first error code, if any.
4897         ]]></field>
4898       </doc>
4899     </reply>
4900     <doc>
4901       <brief>check if extension is present</brief>
4902       <description><![CDATA[
4903 Determines if the specified extension is present on this X11 server.
4904
4905 Every extension has a unique `major_opcode` to identify requests, the minor
4906 opcodes and request formats are extension-specific. If the extension provides
4907 events and errors, the `first_event` and `first_error` fields in the reply are
4908 set accordingly.
4909
4910 There should rarely be a need to use this request directly, XCB provides the
4911 `xcb_get_extension_data` function instead.
4912       ]]></description>
4913       <field name="name_len"><![CDATA[
4914 The length of `name` in bytes.
4915       ]]></field>
4916       <field name="name"><![CDATA[
4917 The name of the extension to query, for example "RANDR". This is case
4918 sensitive!
4919       ]]></field>
4920       <see type="program" name="xdpyinfo" />
4921       <see type="function" name="xcb_get_extension_data" />
4922     </doc>
4923   </request>
4924
4925   <request name="ListExtensions" opcode="99">
4926     <reply>
4927       <field type="CARD8" name="names_len" />
4928       <pad bytes="24" />
4929       <list type="STR" name="names">
4930         <fieldref>names_len</fieldref>
4931       </list>
4932     </reply>
4933   </request>
4934
4935   <request name="ChangeKeyboardMapping" opcode="100">
4936     <field type="CARD8" name="keycode_count" />
4937     <field type="KEYCODE" name="first_keycode" />
4938     <field type="CARD8" name="keysyms_per_keycode" />
4939     <pad bytes="2" />
4940     <list type="KEYSYM" name="keysyms">
4941       <op op="*">
4942         <fieldref>keycode_count</fieldref>
4943         <fieldref>keysyms_per_keycode</fieldref>
4944       </op>
4945     </list>
4946   </request>
4947
4948   <request name="GetKeyboardMapping" opcode="101">
4949     <pad bytes="1" />
4950     <field type="KEYCODE" name="first_keycode" />
4951     <field type="CARD8" name="count" />
4952     <reply>
4953       <field type="BYTE" name="keysyms_per_keycode" />
4954       <pad bytes="24" />
4955       <list type="KEYSYM" name="keysyms">
4956         <fieldref>length</fieldref>
4957       </list>
4958     </reply>
4959   </request>
4960
4961   <enum name="KB">
4962     <item name="KeyClickPercent"><bit>0</bit></item>
4963     <item name="BellPercent">    <bit>1</bit></item>
4964     <item name="BellPitch">      <bit>2</bit></item>
4965     <item name="BellDuration">   <bit>3</bit></item>
4966     <item name="Led">            <bit>4</bit></item>
4967     <item name="LedMode">        <bit>5</bit></item>
4968     <item name="Key">            <bit>6</bit></item>
4969     <item name="AutoRepeatMode"> <bit>7</bit></item>
4970   </enum>
4971
4972   <enum name="LedMode">
4973     <item name="Off"><value>0</value></item>
4974     <item name="On"> <value>1</value></item>
4975   </enum>
4976
4977   <enum name="AutoRepeatMode">
4978     <item name="Off">    <value>0</value></item>
4979     <item name="On">     <value>1</value></item>
4980     <item name="Default"><value>2</value></item>
4981   </enum>
4982
4983   <request name="ChangeKeyboardControl" opcode="102">
4984     <pad bytes="1" />
4985     <valueparam value-mask-type="CARD32"
4986                 value-mask-name="value_mask"
4987                 value-list-name="value_list" />
4988   </request>
4989
4990   <request name="GetKeyboardControl" opcode="103">
4991     <reply>
4992       <field type="BYTE" name="global_auto_repeat" enum="AutoRepeatMode" />
4993       <field type="CARD32" name="led_mask" />
4994       <field type="CARD8" name="key_click_percent" />
4995       <field type="CARD8" name="bell_percent" />
4996       <field type="CARD16" name="bell_pitch" />
4997       <field type="CARD16" name="bell_duration" />
4998       <pad bytes="2" />
4999       <list type="CARD8" name="auto_repeats"><value>32</value></list>
5000     </reply>
5001   </request>
5002
5003   <request name="Bell" opcode="104">
5004     <field type="INT8" name="percent" />
5005   </request>
5006
5007   <request name="ChangePointerControl" opcode="105">
5008     <pad bytes="1" />
5009     <field type="INT16" name="acceleration_numerator" />
5010     <field type="INT16" name="acceleration_denominator" />
5011     <field type="INT16" name="threshold" />
5012     <field type="BOOL" name="do_acceleration" />
5013     <field type="BOOL" name="do_threshold" />
5014   </request>
5015
5016   <request name="GetPointerControl" opcode="106">
5017     <reply>
5018       <pad bytes="1" />
5019       <field type="CARD16" name="acceleration_numerator" />
5020       <field type="CARD16" name="acceleration_denominator" />
5021       <field type="CARD16" name="threshold" />
5022       <pad bytes="18" />
5023     </reply>
5024   </request>
5025
5026   <!-- Screen saver timeout and interval can be set to -1 to restore defaults
5027        and set to 0 to disable the screen saver. -->
5028
5029   <enum name="Blanking">
5030     <item name="NotPreferred"><value>0</value></item>
5031     <item name="Preferred">   <value>1</value></item>
5032     <item name="Default">     <value>2</value></item>
5033   </enum>
5034
5035   <enum name="Exposures">
5036     <item name="NotAllowed"><value>0</value></item>
5037     <item name="Allowed">   <value>1</value></item>
5038     <item name="Default">   <value>2</value></item>
5039   </enum>
5040
5041   <request name="SetScreenSaver" opcode="107">
5042     <pad bytes="1" />
5043     <field type="INT16" name="timeout" />
5044     <field type="INT16" name="interval" />
5045     <field type="CARD8" name="prefer_blanking" enum="Blanking" />
5046     <field type="CARD8" name="allow_exposures" enum="Exposures" />
5047   </request>
5048
5049   <request name="GetScreenSaver" opcode="108">
5050     <reply>
5051       <pad bytes="1" />
5052       <field type="CARD16" name="timeout" />
5053       <field type="CARD16" name="interval" />
5054       <field type="BYTE" name="prefer_blanking" enum="Blanking" />
5055       <field type="BYTE" name="allow_exposures" enum="Exposures" />
5056       <pad bytes="18" />
5057     </reply>
5058   </request>
5059
5060   <enum name="HostMode">
5061     <item name="Insert"><value>0</value></item>
5062     <item name="Delete"><value>1</value></item>
5063   </enum>
5064
5065   <!-- also used and extended for Xau authentication -->
5066   <enum name="Family">
5067     <item name="Internet">         <value>0</value></item>
5068     <item name="DECnet">           <value>1</value></item>
5069     <item name="Chaos">            <value>2</value></item>
5070     <item name="ServerInterpreted"><value>5</value></item>
5071     <item name="Internet6">        <value>6</value></item>
5072   </enum>
5073
5074   <request name="ChangeHosts" opcode="109">
5075     <field type="CARD8" name="mode" enum="HostMode" />
5076     <field type="CARD8" name="family" enum="Family" />
5077     <pad bytes="1" />
5078     <field type="CARD16" name="address_len" />
5079     <list type="BYTE" name="address">
5080       <fieldref>address_len</fieldref>
5081     </list>
5082   </request>
5083
5084   <struct name="HOST">
5085     <field type="CARD8" name="family" enum="Family" />
5086     <pad bytes="1" />
5087     <field type="CARD16" name="address_len" />
5088     <list type="BYTE" name="address">
5089       <fieldref>address_len</fieldref>
5090     </list>
5091   </struct>
5092
5093   <request name="ListHosts" opcode="110">
5094     <reply>
5095       <field type="BYTE" name="mode" enum="AccessControl" />
5096       <field type="CARD16" name="hosts_len" />
5097       <pad bytes="22" />
5098       <list type="HOST" name="hosts">
5099         <fieldref>hosts_len</fieldref>
5100       </list>
5101     </reply>
5102   </request>
5103
5104   <enum name="AccessControl">
5105     <item name="Disable"><value>0</value></item>
5106     <item name="Enable"> <value>1</value></item>
5107   </enum>
5108
5109   <request name="SetAccessControl" opcode="111">
5110     <field type="CARD8" name="mode" enum="AccessControl" />
5111   </request>
5112
5113   <enum name="CloseDown">
5114     <item name="DestroyAll">     <value>0</value></item>
5115     <item name="RetainPermanent"><value>1</value></item>
5116     <item name="RetainTemporary"><value>2</value></item>
5117   </enum>
5118
5119   <request name="SetCloseDownMode" opcode="112">
5120     <field type="CARD8" name="mode" enum="CloseDown" />
5121   </request>
5122
5123   <enum name="Kill">
5124     <item name="AllTemporary"><value>0</value></item>
5125   </enum>
5126
5127   <request name="KillClient" opcode="113">
5128     <pad bytes="1" />
5129     <field type="CARD32" name="resource" altenum="Kill" />
5130     <doc>
5131       <brief>kills a client</brief>
5132       <description><![CDATA[
5133 Forces a close down of the client that created the specified `resource`.
5134       ]]></description>
5135       <field name="resource"><![CDATA[
5136 Any resource belonging to the client (for example a Window), used to identify
5137 the client connection.
5138
5139 The special value of `XCB_KILL_ALL_TEMPORARY`, the resources of all clients
5140 that have terminated in `RetainTemporary` (TODO) are destroyed.
5141       ]]></field>
5142       <error type="Value"><![CDATA[
5143 The specified `resource` does not exist.
5144       ]]></error>
5145       <see type="program" name="xkill" />
5146     </doc>
5147
5148   </request>
5149
5150   <request name="RotateProperties" opcode="114">
5151     <pad bytes="1" />
5152     <field type="WINDOW" name="window" />
5153     <field type="CARD16" name="atoms_len" />
5154     <field type="INT16" name="delta" />
5155     <list type="ATOM" name="atoms">
5156       <fieldref>atoms_len</fieldref>
5157     </list>
5158   </request>
5159
5160   <enum name="ScreenSaver">
5161     <item name="Reset"> <value>0</value></item>
5162     <item name="Active"><value>1</value></item>
5163   </enum>
5164
5165   <request name="ForceScreenSaver" opcode="115">
5166     <field type="CARD8" name="mode" enum="ScreenSaver" />
5167   </request>
5168
5169   <!-- Reply from SetPointerMapping or SetModifierMapping -->
5170   <enum name="MappingStatus">
5171     <item name="Success"><value>0</value></item>
5172     <item name="Busy">   <value>1</value></item>
5173     <item name="Failure"><value>2</value></item>
5174   </enum>
5175
5176   <request name="SetPointerMapping" opcode="116">
5177     <field type="CARD8" name="map_len" />
5178     <list type="CARD8" name="map">
5179       <fieldref>map_len</fieldref>
5180     </list>
5181     <reply>
5182       <field type="BYTE" name="status" enum="MappingStatus" />
5183     </reply>
5184   </request>
5185
5186   <request name="GetPointerMapping" opcode="117">
5187     <reply>
5188       <field type="CARD8" name="map_len" />
5189       <pad bytes="24" />
5190       <list type="CARD8" name="map">
5191         <fieldref>map_len</fieldref>
5192       </list>
5193     </reply>
5194   </request>
5195   
5196   <enum name="MapIndex">
5197     <item name="Shift">  <value>0</value></item>
5198     <item name="Lock">   <value>1</value></item>
5199     <item name="Control"><value>2</value></item>
5200     <item name="1">      <value>3</value></item>
5201     <item name="2">      <value>4</value></item>
5202     <item name="3">      <value>5</value></item>
5203     <item name="4">      <value>6</value></item>
5204     <item name="5">      <value>7</value></item>
5205   </enum>
5206
5207   <request name="SetModifierMapping" opcode="118">
5208     <field type="CARD8" name="keycodes_per_modifier" />
5209     <list type="KEYCODE" name="keycodes">
5210       <op op="*">
5211         <fieldref>keycodes_per_modifier</fieldref>
5212         <value>8</value>
5213       </op>
5214     </list>
5215     <reply>
5216       <field type="BYTE" name="status" enum="MappingStatus" />
5217     </reply>
5218   </request>
5219
5220   <request name="GetModifierMapping" opcode="119">
5221     <reply>
5222       <field type="CARD8" name="keycodes_per_modifier" />
5223       <pad bytes="24" />
5224       <list type="KEYCODE" name="keycodes">
5225         <op op="*">
5226           <fieldref>keycodes_per_modifier</fieldref>
5227           <value>8</value>
5228         </op>
5229       </list>
5230     </reply>
5231   </request>
5232
5233   <!--
5234     FIXME: NoOperation should allow specifying payload length
5235     but geez, malloc()ing a 262140 byte buffer just so I have something
5236     to hand to write(2) seems silly...!
5237   -->
5238   <request name="NoOperation" opcode="127" />
5239
5240 </xcb>