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