1 <?xml version="1.0" encoding="utf-8"?>
3 Copyright (C) 2001-2004 Bart Massey, Jamey Sharp, and Josh Triplett.
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:
13 The above copyright notice and this permission notice shall be included in all
14 copies or substantial portions of the Software.
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.
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.
29 <!-- Core protocol types -->
31 <struct name="CHAR2B">
32 <field type="CARD8" name="byte1" />
33 <field type="CARD8" name="byte2" />
36 <xidtype name="WINDOW" />
38 <xidtype name="PIXMAP" />
40 <xidtype name="CURSOR" />
42 <xidtype name="FONT" />
44 <xidtype name="GCONTEXT" />
46 <xidtype name="COLORMAP" />
48 <xidtype name="ATOM" />
50 <xidunion name="DRAWABLE">
55 <xidunion name="FONTABLE">
60 <typedef oldname="CARD32" newname="VISUALID" />
62 <typedef oldname="CARD32" newname="TIMESTAMP" />
64 <typedef oldname="CARD32" newname="KEYSYM" />
66 <typedef oldname="CARD8" newname="KEYCODE" />
68 <typedef oldname="CARD8" newname="BUTTON" />
71 <field type="INT16" name="x" />
72 <field type="INT16" name="y" />
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" />
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" />
91 <!-- Connection setup-related types -->
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" />
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>
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" />
120 <struct name="DEPTH">
121 <field type="CARD8" name="depth" />
123 <field type="CARD16" name="visuals_len" />
125 <list type="VISUALTYPE" name="visuals">
126 <fieldref>visuals_len</fieldref>
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>
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>
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>
187 <struct name="SetupRequest">
188 <field type="CARD8" name="byte_order" />
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" />
195 <list type="char" name="authorization_protocol_name">
196 <fieldref>authorization_protocol_name_len</fieldref>
198 <list type="char" name="authorization_protocol_data">
199 <fieldref>authorization_protocol_data_len</fieldref>
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>
214 <struct name="SetupAuthenticate">
215 <field type="CARD8" name="status" /> <!-- always 2 -> Authenticate -->
217 <field type="CARD16" name="length" />
218 <list type="char" name="reason">
220 <fieldref>length</fieldref>
226 <enum name="ImageOrder">
227 <item name="LSBFirst"><value>0</value></item>
228 <item name="MSBFirst"><value>1</value></item>
231 <struct name="Setup">
232 <field type="CARD8" name="status" /> <!-- always 1 -> Success -->
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" />
252 <list type="char" name="vendor">
253 <fieldref>vendor_len</fieldref>
255 <list type="FORMAT" name="pixmap_formats">
256 <fieldref>pixmap_formats_len</fieldref>
258 <list type="SCREEN" name="roots">
259 <fieldref>roots_len</fieldref>
263 <!-- Core event types -->
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>
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>
294 <item name="None"> <value>0</value></item>
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" />
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
316 <field name="time"><![CDATA[
317 Time when the event was generated (in milliseconds).
319 <field name="root"><![CDATA[
320 The root window of `child`.
322 <field name="same_screen"><![CDATA[
323 Whether the `event` window is on the same screen as the `root` window.
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.
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.
333 <field name="root_x"><![CDATA[
334 The X coordinate of the pointer relative to the `root` window at the time of
337 <field name="root_y"><![CDATA[
338 The Y coordinate of the pointer relative to the `root` window at the time of
341 <field name="state"><![CDATA[
342 The logical state of the pointer buttons and modifier keys just prior to the
345 <see type="request" name="GrabKey" />
346 <see type="request" name="GrabKeyboard" />
350 <eventcopy name="KeyRelease" number="3" ref="KeyPress" />
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>
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" />
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
380 <field name="time"><![CDATA[
381 Time when the event was generated (in milliseconds).
383 <field name="root"><![CDATA[
384 The root window of `child`.
386 <field name="same_screen"><![CDATA[
387 Whether the `event` window is on the same screen as the `root` window.
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.
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.
397 <field name="root_x"><![CDATA[
398 The X coordinate of the pointer relative to the `root` window at the time of
401 <field name="root_y"><![CDATA[
402 The Y coordinate of the pointer relative to the `root` window at the time of
405 <field name="state"><![CDATA[
406 The logical state of the pointer buttons and modifier keys just prior to the
409 <see type="request" name="GrabButton" />
410 <see type="request" name="GrabPointer" />
414 <eventcopy name="ButtonRelease" number="5" ref="ButtonPress" />
416 <!-- MotionNotify detail -->
418 <item name="Normal"><value>0</value></item>
419 <item name="Hint"> <value>1</value></item>
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" />
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
441 <field name="time"><![CDATA[
442 Time when the event was generated (in milliseconds).
444 <field name="root"><![CDATA[
445 The root window of `child`.
447 <field name="same_screen"><![CDATA[
448 Whether the `event` window is on the same screen as the `root` window.
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.
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.
458 <field name="root_x"><![CDATA[
459 The X coordinate of the pointer relative to the `root` window at the time of
462 <field name="root_y"><![CDATA[
463 The Y coordinate of the pointer relative to the `root` window at the time of
466 <field name="state"><![CDATA[
467 The logical state of the pointer buttons and modifier keys just prior to the
470 <see type="request" name="GrabKey" />
471 <see type="request" name="GrabKeyboard" />
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>
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>
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" />
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.
512 <field name="window"><![CDATA[
513 The window that was unmapped.
515 <field name="root"><![CDATA[
516 The root window for the final cursor position.
518 <field name="root_x"><![CDATA[
519 The pointer X coordinate relative to `root`'s origin at the time of the event.
521 <field name="root_y"><![CDATA[
522 The pointer Y coordinate relative to `root`'s origin at the time of the event.
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.
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.
532 <field name="mode" />
536 <eventcopy name="LeaveNotify" number="8" ref="EnterNotify" />
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" />
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.
549 <!-- enum documentation is sufficient -->
550 <field name="detail" />
551 <field name="mode" />
555 <eventcopy name="FocusOut" number="10" ref="FocusIn" />
557 <event name="KeymapNotify" number="11" no-sequence-number="true">
558 <list type="CARD8" name="keys"><value>31</value></list>
561 <event name="Expose" number="12">
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" />
571 <brief>NOT YET DOCUMENTED</brief>
572 <field name="window"><![CDATA[
573 The exposed (damaged) window.
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.
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.
583 <field name="width"><![CDATA[
584 The width of the exposed rectangle.
586 <field name="height"><![CDATA[
587 The height of the exposed rectangle.
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.
598 <event name="GraphicsExposure" number="13">
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" />
611 <event name="NoExposure" number="14">
613 <field type="DRAWABLE" name="drawable" />
614 <field type="CARD16" name="minor_opcode" />
615 <field type="CARD8" name="major_opcode" />
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>
625 <event name="VisibilityNotify" number="15">
627 <field type="WINDOW" name="window" />
628 <field type="BYTE" name="state" enum="Visibility" />
632 <event name="CreateNotify" number="16">
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" />
645 <event name="DestroyNotify" number="17">
647 <field type="WINDOW" name="event" />
648 <field type="WINDOW" name="window" />
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.
655 <field name="window"><![CDATA[
656 The window that is destroyed.
658 <see type="request" name="DestroyWindow" />
662 <event name="UnmapNotify" number="18">
664 <field type="WINDOW" name="event" />
665 <field type="WINDOW" name="window" />
666 <field type="BOOL" name="from_configure" />
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.
674 <field name="window"><![CDATA[
675 The window that was unmapped.
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`.
681 <see type="request" name="UnmapWindow" />
685 <event name="MapNotify" number="19">
687 <field type="WINDOW" name="event" />
688 <field type="WINDOW" name="window" />
689 <field type="BOOL" name="override_redirect" />
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.
697 <field name="window"><![CDATA[
698 The window that was mapped.
700 <field name="override_redirect"><![CDATA[
701 Window managers should ignore this window if `override_redirect` is 1.
703 <see type="request" name="MapWindow" />
707 <event name="MapRequest" number="20">
709 <field type="WINDOW" name="parent" />
710 <field type="WINDOW" name="window" />
712 <brief>window wants to be mapped</brief>
713 <field name="parent"><![CDATA[
714 The parent of `window`.
716 <field name="window"><![CDATA[
717 The window to be mapped.
719 <see type="request" name="MapWindow" />
723 <event name="ReparentNotify" number="21">
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" />
734 <event name="ConfigureNotify" number="22">
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" />
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.
752 <field name="window"><![CDATA[
753 The window whose size, position, border, and/or stacking order was changed.
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.
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.
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.
768 <field name="width"><![CDATA[
769 The inside width of `window`, not including the border.
771 <field name="height"><![CDATA[
772 The inside height of `window`, not including the border.
774 <field name="border_width"><![CDATA[
775 The border width of `window`.
777 <field name="override_redirect"><![CDATA[
778 Window managers should ignore this window if `override_redirect` is 1.
780 <see type="request" name="FreeColormap" />
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" />
797 <event name="GravityNotify" number="24">
799 <field type="WINDOW" name="event" />
800 <field type="WINDOW" name="window" />
801 <field type="INT16" name="x" />
802 <field type="INT16" name="y" />
805 <event name="ResizeRequest" number="25">
807 <field type="WINDOW" name="window" />
808 <field type="CARD16" name="width" />
809 <field type="CARD16" name="height" />
813 <item name="OnTop"> <value>0</value></item>
814 <item name="OnBottom"><value>1</value></item>
816 <field name="OnTop"><![CDATA[
817 The window is now on top of all siblings.
819 <field name="OnBottom"><![CDATA[
820 The window is now below all siblings.
825 <event name="CirculateNotify" number="26">
827 <field type="WINDOW" name="event" />
828 <field type="WINDOW" name="window" />
830 <field type="BYTE" name="place" enum="Place" />
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.
838 <field name="window"><![CDATA[
839 The restacked window.
841 <!-- the enum doc is sufficient -->
842 <field name="place" />
843 <see type="request" name="CirculateWindow" />
847 <eventcopy name="CirculateRequest" number="27" ref="CirculateNotify" />
849 <enum name="Property">
850 <item name="NewValue"><value>0</value></item>
851 <item name="Delete"> <value>1</value></item>
854 <event name="PropertyNotify" number="28">
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" />
862 <brief>a window property changed</brief>
863 <field name="window"><![CDATA[
864 The window whose associated property was changed.
866 <field name="atom"><![CDATA[
867 The property's atom, to indicate which property was changed.
869 <field name="time"><![CDATA[
870 A timestamp of the server time when the property was changed.
872 <!-- enum documentation is sufficient -->
873 <field name="state" />
874 <see type="request" name="ChangeProperty" />
878 <event name="SelectionClear" number="29">
880 <field type="TIMESTAMP" name="time" />
881 <field type="WINDOW" name="owner" />
882 <field type="ATOM" name="selection" />
886 <item name="CurrentTime"> <value>0</value> </item>
890 <item name="None"> <value>0</value></item>
891 <item name="Any"> <value>0</value></item>
892 <item name="PRIMARY" />
893 <item name="SECONDARY" />
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" />
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" />
962 <event name="SelectionRequest" number="30">
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" />
972 <event name="SelectionNotify" number="31">
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" />
981 <enum name="ColormapState">
982 <item name="Uninstalled"><value>0</value></item>
983 <item name="Installed"> <value>1</value></item>
985 <field name="Uninstalled"><![CDATA[
986 The colormap was uninstalled.
988 <field name="Installed"><![CDATA[
989 The colormap was installed.
994 <enum name="Colormap">
995 <item name="None"> <value>0</value></item>
998 <event name="ColormapNotify" number="32">
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" />
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.
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`.
1014 <field name="_new"><![CDATA[
1015 Indicates whether the colormap was changed (1) or installed/uninstalled (0).
1017 <!-- enum doc is sufficient -->
1018 <field name="state" />
1019 <see type="request" name="FreeColormap" />
1023 <union name="ClientMessageData">
1024 <!-- The format member of the ClientMessage event determines which array
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 -->
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" />
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.
1044 <field name="format"><![CDATA[
1045 Specifies how to interpret `data`. Can be either 8, 16 or 32.
1047 <field name="type"><![CDATA[
1048 An atom which indicates how the data should be interpreted by the receiving
1051 <field name="data"><![CDATA[
1052 The data itself (20 bytes max).
1054 <see type="request" name="SendEvent" />
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>
1064 <event name="MappingNotify" number="34">
1066 <field type="BYTE" name="request" enum="Mapping" />
1067 <field type="KEYCODE" name="first_keycode" />
1068 <field type="CARD8" name="count" />
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.
1077 <field name="count"><![CDATA[
1078 The number of keycodes altered.
1085 <!-- Core error types -->
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" />
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" />
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" />
1121 <!-- The core requests, in major number order. -->
1122 <!-- It is the caller's responsibility to free returned XCB*Rep objects. -->
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>
1132 <!-- Window attributes for CreateWindow and ChangeWindowAttributes. -->
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>
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.
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.
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.
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.
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.
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.
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.
1183 <field name="BitGravity"><![CDATA[
1184 Defines which region of the window should be retained if the window is resized.
1186 <field name="WinGravity"><![CDATA[
1187 Defines how the window should be repositioned if the parent is resized (see
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.
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
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.
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.
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.
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).
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.
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.
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.
1251 <enum name="BackPixmap">
1252 <item name="None"> <value>0</value></item>
1253 <item name="ParentRelative"><value>1</value></item>
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>
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" />
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.
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,
1298 The created window is not yet displayed (mapped), call `xcb_map_window` to
1301 The created window will initially use the same cursor as its parent.
1303 <field name="wid"><![CDATA[
1304 The ID with which you will refer to the new window, created by
1307 <field name="depth"><![CDATA[
1308 Specifies the new window's depth (TODO: what unit?).
1310 The special value `XCB_COPY_FROM_PARENT` means the depth is taken from the
1313 <field name="visual"><![CDATA[
1314 Specifies the id for the new window's visual.
1316 The special value `XCB_COPY_FROM_PARENT` means the visual is taken from the
1319 <field name="class"></field>
1320 <field name="parent"><![CDATA[
1321 The parent window of the new window.
1323 <field name="border_width"><![CDATA[
1326 Must be zero if the `class` is `InputOnly` or a `xcb_match_error_t` occurs.
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[
1335 <error type="Match"><![CDATA[
1338 <error type="Cursor"><![CDATA[
1341 <error type="Pixmap"><![CDATA[
1344 <error type="Value"><![CDATA[
1347 <error type="Window"><![CDATA[
1350 <error type="Alloc"><![CDATA[
1351 The X server could not allocate the requested resources (no memory?).
1353 <see type="function" name="xcb_generate_id" />
1354 <see type="request" name="MapWindow" />
1355 <see type="event" name="CreateNotify" />
1360 <request name="ChangeWindowAttributes" opcode="2">
1362 <field type="WINDOW" name="window" />
1363 <valueparam value-mask-type="CARD32"
1364 value-mask-name="value_mask"
1365 value-list-name="value_list" />
1367 <brief>change window attributes</brief>
1368 <description><![CDATA[
1369 Changes the attributes specified by `value_mask` for the specified `window`.
1371 <field name="window"><![CDATA[
1372 The window to change.
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
1381 <error type="Access"><![CDATA[
1384 <error type="Colormap"><![CDATA[
1387 <error type="Cursor"><![CDATA[
1390 <error type="Match"><![CDATA[
1393 <error type="Pixmap"><![CDATA[
1396 <error type="Value"><![CDATA[
1399 <error type="Window"><![CDATA[
1400 The specified `window` does not exist.
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>
1411 <request name="GetWindowAttributes" opcode="3">
1413 <field type="WINDOW" name="window" />
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" />
1432 <field name="override_redirect"><![CDATA[
1433 Window managers should ignore this window if `override_redirect` is 1.
1435 <field name="visual"><![CDATA[
1436 The associated visual structure of `window`.
1438 <field name="backing_planes"><![CDATA[
1439 Planes to be preserved if possible.
1441 <field name="backing_pixel"><![CDATA[
1442 Value to be used when restoring planes.
1444 <field name="save_under"><![CDATA[
1445 Boolean, should bits under be saved?
1447 <field name="colormap"><![CDATA[
1448 Color map to be associated with window.
1450 <field name="all_event_masks"><![CDATA[
1451 Set of events all people have interest in.
1453 <field name="your_event_mask"><![CDATA[
1456 <field name="do_not_propagate_mask"><![CDATA[
1457 Set of events that should not propagate.
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" />
1468 <brief>Gets window attributes</brief>
1469 <description><![CDATA[
1470 Gets the current attributes for the specified `window`.
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.
1476 <error type="Drawable"><![CDATA[
1483 <request name="DestroyWindow" opcode="4">
1485 <field type="WINDOW" name="window" />
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.
1494 Calling DestroyWindow on the root window will do nothing.
1496 <field name="window"><![CDATA[The window to destroy.]]></field>
1497 <error type="Window"><![CDATA[
1498 The specified window does not exist.
1500 <see type="event" name="DestroyNotify" />
1501 <see type="request" name="MapWindow" />
1502 <see type="request" name="UnmapWindow" />
1506 <request name="DestroySubwindows" opcode="5">
1508 <field type="WINDOW" name="window" />
1511 <enum name="SetMode">
1512 <item name="Insert"><value>0</value></item>
1513 <item name="Delete"><value>1</value></item>
1516 <request name="ChangeSaveSet" opcode="6">
1517 <field type="BYTE" name="mode" enum="SetMode" />
1518 <field type="WINDOW" name="window" />
1520 <brief>Changes a client's save set</brief>
1521 <description><![CDATA[
1522 TODO: explain what the save set is for.
1524 This function either adds or removes the specified window to the client's (your
1525 application's) save set.
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.
1533 <error type="Value"><![CDATA[
1534 You specified an invalid mode.
1536 <error type="Window"><![CDATA[
1537 The specified window does not exist.
1539 <see type="request" name="ReparentWindow" />
1543 <request name="ReparentWindow" opcode="7">
1545 <field type="WINDOW" name="window" />
1546 <field type="WINDOW" name="parent" />
1547 <field type="INT16" name="x" />
1548 <field type="INT16" name="y" />
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.
1557 After reparenting, a ReparentNotify event is generated.
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.
1564 <field name="y"><![CDATA[
1565 The Y position of the window within its new parent.
1567 <error type="Match"><![CDATA[
1568 The new parent window is not on the same screen as the old parent window.
1570 The new parent window is the specified window or an inferior of the specified window.
1572 The new parent is InputOnly and the window is not.
1574 The specified window has a ParentRelative background and the new parent window is not the same depth as the specified window.
1576 <error type="Window"><![CDATA[
1577 The specified window does not exist.
1579 <see type="event" name="ReparentNotify" />
1580 <see type="request" name="MapWindow" />
1581 <see type="request" name="UnmapWindow" />
1585 <request name="MapWindow" opcode="8">
1587 <field type="WINDOW" name="window" />
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
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
1599 If the window manager decides to map the window (or if no window manager is
1600 running), a MapNotify event is generated.
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.
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
1611 <field name="window"><![CDATA[
1612 The window to make visible.
1614 <error type="Match"><![CDATA[
1615 The specified window does not exist.
1617 <see type="event" name="MapNotify" />
1618 <see type="event" name="Expose" />
1619 <see type="request" name="UnmapWindow" />
1623 <request name="MapSubwindows" opcode="9">
1625 <field type="WINDOW" name="window" />
1628 <request name="UnmapWindow" opcode="10">
1630 <field type="WINDOW" name="window" />
1632 <brief>Makes a window invisible</brief>
1633 <description><![CDATA[
1634 Unmaps the specified window. This means making the window invisible (and all
1637 Unmapping a window leads to the `UnmapNotify` event being generated. Also,
1638 `Expose` events are generated for formerly obscured windows.
1640 <field name="window"><![CDATA[
1641 The window to make invisible.
1643 <error type="Window"><![CDATA[
1644 The specified window does not exist.
1646 <see type="event" name="UnmapNotify" />
1647 <see type="event" name="Expose" />
1648 <see type="request" name="MapWindow" />
1652 <request name="UnmapSubwindows" opcode="11">
1654 <field type="WINDOW" name="window" />
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>
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>
1675 <request name="ConfigureWindow" opcode="12">
1677 <field type="WINDOW" name="window" />
1678 <field type="CARD16" name="value_mask" />
1680 <valueparam value-mask-type="CARD16"
1681 value-mask-name="value_mask"
1682 value-list-name="value_list" />
1684 <brief>Configures window attributes</brief>
1685 <description><![CDATA[
1686 Configures a window's size, position, border width and stacking order.
1690 * Configures the given window to the left upper corner
1691 * with a size of 1024x768 pixels.
1694 void my_example(xcb_connection *c, xcb_window_t window) {
1697 mask |= XCB_CONFIG_WINDOW_X;
1698 mask |= XCB_CONFIG_WINDOW_Y;
1699 mask |= XCB_CONFIG_WINDOW_WIDTH;
1700 mask |= XCB_CONFIG_WINDOW_HEIGHT;
1702 const uint32_t values[] = {
1709 xcb_configure_window(c, window, mask, values);
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.
1719 <error type="Match"><![CDATA[
1720 You specified a Sibling without also specifying StackMode or the window is not
1723 <error type="Window"><![CDATA[
1724 The specified window does not exist. TODO: any other reason?
1726 <error type="Value"><![CDATA[
1729 <see type="event" name="MapNotify" />
1730 <see type="event" name="Expose" />
1734 <enum name="Circulate">
1735 <item name="RaiseLowest"> <value>0</value></item>
1736 <item name="LowerHighest"><value>1</value></item>
1739 <request name="CirculateWindow" opcode="13">
1740 <field type="CARD8" name="direction" enum="Circulate" />
1741 <field type="WINDOW" name="window" />
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.
1748 If `direction` is `XCB_CIRCULATE_LOWER_HIGHEST`, the highest mapped child will
1749 be lowered to the bottom of the stack.
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`).
1756 <error type="Window"><![CDATA[
1757 The specified `window` does not exist.
1759 <error type="Value"><![CDATA[
1760 The specified `direction` is invalid.
1765 <request name="GetGeometry" opcode="14">
1767 <field type="DRAWABLE" name="drawable" />
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" />
1778 <field name="root"><![CDATA[
1779 Root window of the screen containing `drawable`.
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.
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.
1791 <field name="width"><![CDATA[
1792 The width of `drawable`.
1794 <field name="height"><![CDATA[
1795 The height of `drawable`.
1797 <field name="border_width"><![CDATA[
1798 The border width (in pixels).
1800 <field name="depth"><![CDATA[
1801 The depth of the drawable (bits per pixel for the object).
1806 <brief>Get current window geometry</brief>
1807 <description><![CDATA[
1808 Gets the current geometry of the specified drawable (either `Window` or `Pixmap`).
1812 * Displays the x and y position of the given window.
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;
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);
1827 <field name="drawable"><![CDATA[
1828 The drawable (`Window` or `Pixmap`) of which the geometry will be received.
1830 <error type="Drawable"><![CDATA[
1833 <error type="Window"><![CDATA[
1836 <see type="program" name="xwininfo" />
1840 <request name="QueryTree" opcode="15">
1842 <field type="WINDOW" name="window" />
1845 <field type="WINDOW" name="root" />
1846 <field type="WINDOW" name="parent" altenum="Window" />
1847 <field type="CARD16" name="children_len" />
1849 <list type="WINDOW" name="children">
1850 <fieldref>children_len</fieldref>
1853 <field name="root"><![CDATA[
1854 The root window of `window`.
1856 <field name="parent"><![CDATA[
1857 The parent window of `window`.
1859 <field name="children_len"><![CDATA[
1860 The number of child windows.
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.
1872 * Displays the root, parent and children of the specified window.
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;
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);
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]);
1892 <field name="window"><![CDATA[
1893 The `window` to query.
1895 <see type="program" name="xwininfo" />
1899 <request name="InternAtom" opcode="16">
1900 <field type="BOOL" name="only_if_exists" />
1901 <field type="CARD16" name="name_len" />
1903 <list type="char" name="name">
1904 <fieldref>name_len</fieldref>
1908 <field type="ATOM" name="atom" altenum="Atom" />
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.
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
1923 * Resolves the _NET_WM_NAME atom.
1926 void my_example(xcb_connection *c) {
1927 xcb_intern_atom_cookie_t cookie;
1928 xcb_intern_atom_reply_t *reply;
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);
1938 <field name="name_len"><![CDATA[
1939 The length of the following `name`.
1941 <field name="name"><![CDATA[
1942 The name of the atom.
1944 <field name="only_if_exists"><![CDATA[
1945 Return a valid atom id only if the atom already exists.
1947 <error type="Alloc"><![CDATA[
1950 <error type="Value"><![CDATA[
1951 A value other than 0 or 1 was specified for `only_if_exists`.
1953 <see type="program" name="xlsatoms" />
1954 <see type="request" name="GetAtomName" />
1959 <request name="GetAtomName" opcode="17">
1961 <field type="ATOM" name="atom" />
1964 <field type="CARD16" name="name_len" />
1966 <list type="char" name="name">
1967 <fieldref>name_len</fieldref>
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>
1977 <field name="Replace"><![CDATA[
1978 Discard the previous property value and store the new data.
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.
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.
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" />
2000 <field type="CARD32" name="data_len" />
2001 <list type="void" name="data">
2004 <fieldref>data_len</fieldref>
2005 <fieldref>format</fieldref>
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.
2020 * Sets the WM_NAME property of the window to "XCB Example".
2023 void my_example(xcb_connection *conn, xcb_window_t window) {
2024 xcb_change_property(conn,
2025 XCB_PROP_MODE_REPLACE,
2030 strlen("XCB Example"),
2035 <field name="window"><![CDATA[
2036 The window whose property you want to change.
2038 <!-- the enum doc is sufficient. -->
2039 <field name="mode" />
2040 <field name="property"><![CDATA[
2041 The property you want to change (an atom).
2043 <field name="type"><![CDATA[
2044 The type of the property you want to change (an atom).
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.
2051 <field name="data_len"><![CDATA[
2052 Specifies the number of elements (see `format`).
2054 <field name="data"><![CDATA[
2057 <error type="Match"><![CDATA[
2060 <error type="Value"><![CDATA[
2063 <error type="Window"><![CDATA[
2064 The specified `window` does not exist.
2066 <error type="Atom"><![CDATA[
2067 `property` or `type` do not refer to a valid atom.
2069 <error type="Alloc"><![CDATA[
2070 The X server could not store the property (no memory?).
2072 <see type="request" name="InternAtom" />
2073 <see type="program" name="xprop" />
2077 <request name="DeleteProperty" opcode="19">
2079 <field type="WINDOW" name="window" />
2080 <field type="ATOM" name="property" />
2083 <enum name="GetPropertyType">
2084 <item name="Any"><value>0</value></item>
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" />
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" />
2100 <list type="void" name="value">
2102 <fieldref>value_len</fieldref>
2104 <fieldref>format</fieldref>
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.
2115 <field name="type"><![CDATA[
2116 The actual type of the property (an atom).
2118 <field name="bytes_after"><![CDATA[
2119 The number of bytes remaining to be read in the property if a partial read was
2122 <field name="value_len"><![CDATA[
2123 The length of value. You should use the corresponding accessor instead of this
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.
2136 TODO: talk about `type`
2138 TODO: talk about `delete`
2140 TODO: talk about the offset/length thing. what's a valid use case?
2144 * Prints the WM_NAME property of the window.
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;
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;
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);
2164 printf("WM_NAME is %.*s\\n", len,
2165 (char*)xcb_get_property_value(reply));
2170 <field name="window"><![CDATA[
2171 The window whose property you want to get.
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.
2177 <field name="property"><![CDATA[
2178 The property you want to get (an atom).
2180 <field name="type"><![CDATA[
2181 The type of the property you want to get (an atom).
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.
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).
2191 <error type="Window"><![CDATA[
2192 The specified `window` does not exist.
2194 <error type="Atom"><![CDATA[
2195 `property` or `type` do not refer to a valid atom.
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).
2202 <see type="request" name="InternAtom" />
2203 <see type="program" name="xprop" />
2207 <request name="ListProperties" opcode="21">
2209 <field type="WINDOW" name="window" />
2212 <field type="CARD16" name="atoms_len" />
2214 <list type="ATOM" name="atoms">
2215 <fieldref>atoms_len</fieldref>
2220 <request name="SetSelectionOwner" opcode="22">
2222 <field type="WINDOW" name="owner" altenum="Window" />
2223 <field type="ATOM" name="selection" />
2224 <field type="TIMESTAMP" name="time" altenum="Time" />
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.
2231 TODO: briefly explain what a selection is.
2233 <field name="selection"><![CDATA[
2236 <field name="owner"><![CDATA[
2237 The new owner of the selection.
2239 The special value `XCB_NONE` means that the selection will have no owner.
2241 <field name="time"><![CDATA[
2242 Timestamp to avoid race conditions when running X over the network.
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.
2248 The special value `XCB_CURRENT_TIME` will be replaced with the current server
2251 <error type="Atom"><![CDATA[
2252 `selection` does not refer to a valid atom.
2254 <see type="request" name="SetSelectionOwner" />
2259 <request name="GetSelectionOwner" opcode="23">
2261 <field type="ATOM" name="selection" />
2264 <field type="WINDOW" name="owner" altenum="Window" />
2266 <field name="owner"><![CDATA[
2267 The current selection owner window.
2272 <brief>Gets the owner of a selection</brief>
2273 <description><![CDATA[
2274 Gets the owner of the specified selection.
2276 TODO: briefly explain what a selection is.
2278 <field name="selection"><![CDATA[
2281 <error type="Atom"><![CDATA[
2282 `selection` does not refer to a valid atom.
2284 <see type="request" name="SetSelectionOwner" />
2288 <request name="ConvertSelection" opcode="24">
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" />
2297 <enum name="SendEventDest">
2298 <item name="PointerWindow"><value>0</value></item>
2299 <item name="ItemFocus"> <value>1</value></item>
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>
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.
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'.
2320 * Tell the given window that it was configured to a size of 800x600 pixels.
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);
2329 event->event = window;
2330 event->window = window;
2331 event->response_type = XCB_CONFIGURE_NOTIFY;
2336 event->height = 600;
2338 event->border_width = 0;
2339 event->above_sibling = XCB_NONE;
2340 event->override_redirect = false;
2342 xcb_send_event(conn, false, window, XCB_EVENT_MASK_STRUCTURE_NOTIFY,
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.
2352 The special value `XCB_SEND_EVENT_DEST_POINTER_WINDOW` refers to the window
2353 that contains the mouse pointer.
2355 The special value `XCB_SEND_EVENT_DEST_ITEM_FOCUS` refers to the window which
2356 has the keyboard focus.
2358 <field name="event_mask"><![CDATA[
2359 Event_mask for determining which clients should receive the specified event.
2360 See `destination` and `propagate`.
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`.
2372 <field name="event"><![CDATA[
2373 The event to send to the specified `destination`.
2375 <error type="Window"><![CDATA[
2376 The specified `destination` window does not exist.
2378 <error type="Value"><![CDATA[
2379 The given `event` is neither a core event nor an event defined by an extension.
2381 <see type="event" name="ConfigureNotify" />
2385 <enum name="GrabMode">
2386 <item name="Sync"> <value>0</value></item>
2387 <item name="Async"><value>1</value></item>
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.
2394 <field name="Async"><![CDATA[
2395 Keyboard event processing continues normally.
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>
2408 <enum name="Cursor">
2409 <item name="None"> <value>0</value></item>
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" />
2422 <field type="BYTE" name="status" enum="GrabStatus" />
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.
2432 * Grabs the pointer actively
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;
2439 cookie = xcb_grab_pointer(
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 */
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");
2458 <field name="event_mask"><![CDATA[
2459 Specifies which pointer events are reported to the client.
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).
2467 The special value `XCB_NONE` means don't confine the pointer.
2469 <field name="cursor"><![CDATA[
2470 Specifies the cursor that should be displayed or `XCB_NONE` to not change the
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`.
2477 <field name="grab_window"><![CDATA[
2478 Specifies the window on which the pointer should be grabbed.
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
2490 The special value `XCB_CURRENT_TIME` will be replaced with the current server
2493 <!-- the enum doc is sufficient. -->
2494 <field name="pointer_mode" />
2495 <field name="keyboard_mode" />
2496 <error type="Value"><![CDATA[
2499 <error type="Window"><![CDATA[
2500 The specified `window` does not exist.
2503 <see type="request" name="GrabKeyboard" />
2507 <request name="UngrabPointer" opcode="27">
2509 <field type="TIMESTAMP" name="time" altenum="Time" />
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
2517 EnterNotify and LeaveNotify events are generated.
2519 <field name="time"><![CDATA[
2520 Timestamp to avoid race conditions when running X over the network.
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.
2525 <field name="name_len"><![CDATA[
2526 Length (in bytes) of `name`.
2528 <field name="name"><![CDATA[
2529 A pattern describing an X core font.
2531 <see type="request" name="GrabPointer" />
2532 <see type="request" name="GrabButton" />
2533 <see type="event" name="EnterNotify" />
2534 <see type="event" name="LeaveNotify" />
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>
2546 <field name="Any"><![CDATA[
2547 Any of the following (or none):
2549 <field name="1"><![CDATA[
2550 The left mouse button.
2552 <field name="2"><![CDATA[
2553 The right mouse button.
2555 <field name="3"><![CDATA[
2556 The middle mouse button.
2558 <field name="4"><![CDATA[
2559 Scroll wheel. TODO: direction?
2561 <field name="5"><![CDATA[
2562 Scroll wheel. TODO: direction?
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" />
2577 <field type="CARD16" name="modifiers" mask="ModMask" />
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:
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.
2590 The grab-window contains the pointer.
2592 The confine-to window (if any) is viewable.
2594 A passive grab on the same button/key combination does not exist on any
2595 ancestor of grab-window.
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
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.
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`.
2622 <field name="grab_window"><![CDATA[
2623 Specifies the window on which the pointer should be grabbed.
2625 <field name="event_mask"><![CDATA[
2626 Specifies which pointer events are reported to the client.
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).
2634 The special value `XCB_NONE` means don't confine the pointer.
2636 <field name="cursor"><![CDATA[
2637 Specifies the cursor that should be displayed or `XCB_NONE` to not change the
2640 <field name="modifiers"><![CDATA[
2641 The modifiers to grab.
2643 Using the special value `XCB_MOD_MASK_ANY` means grab the pointer with all
2644 possible modifier combinations.
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.
2654 <error type="Value"><![CDATA[
2657 <error type="Cursor"><![CDATA[
2658 The specified `cursor` does not exist.
2660 <error type="Window"><![CDATA[
2661 The specified `window` does not exist.
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" />
2673 <request name="ChangeActivePointerGrab" opcode="30">
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" />
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" />
2689 <field type="BYTE" name="status" enum="GrabStatus" />
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.
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.
2707 * Grabs the keyboard actively
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;
2714 cookie = xcb_grab_keyboard(
2716 true, /* report events */
2717 screen->root, /* grab the root window */
2719 XCB_GRAB_MODE_ASYNC, /* process events as normal, do not require sync */
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");
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`.
2735 <field name="grab_window"><![CDATA[
2736 Specifies the window on which the pointer should be grabbed.
2738 <field name="time"><![CDATA[
2739 Timestamp to avoid race conditions when running X over the network.
2741 The special value `XCB_CURRENT_TIME` will be replaced with the current server
2744 <!-- the enum doc is sufficient. -->
2745 <field name="pointer_mode" />
2746 <field name="keyboard_mode" />
2747 <error type="Value"><![CDATA[
2750 <error type="Window"><![CDATA[
2751 The specified `window` does not exist.
2753 <see type="request" name="GrabPointer" />
2757 <request name="UngrabKeyboard" opcode="32">
2759 <field type="TIMESTAMP" name="time" altenum="Time" />
2762 <!-- Use KEYCODE any = { XCBGrabAny }; to grab any key -->
2764 <item name="Any"><value>0</value></item>
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" />
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:
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.
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.
2790 A passive grab on the same key combination does not exist on any ancestor of
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.
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.
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.
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.
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`.
2814 <field name="grab_window"><![CDATA[
2815 Specifies the window on which the pointer should be grabbed.
2817 <field name="key"><![CDATA[
2818 The keycode of the key to grab.
2820 The special value `XCB_GRAB_ANY` means grab any key.
2822 <field name="cursor"><![CDATA[
2823 Specifies the cursor that should be displayed or `XCB_NONE` to not change the
2826 <field name="modifiers"><![CDATA[
2827 The modifiers to grab.
2829 Using the special value `XCB_MOD_MASK_ANY` means grab the pointer with all
2830 possible modifier combinations.
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.
2839 <error type="Value"><![CDATA[
2842 <error type="Window"><![CDATA[
2843 The specified `window` does not exist.
2845 <see type="request" name="GrabKeyboard" />
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" />
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.
2860 <field name="key"><![CDATA[
2861 The keycode of the specified key combination.
2863 Using the special value `XCB_GRAB_ANY` means releasing all possible key codes.
2865 <field name="grab_window"><![CDATA[
2866 The window on which the grabbed key combination will be released.
2868 <field name="modifiers"><![CDATA[
2869 The modifiers of the specified key combination.
2871 Using the special value `XCB_MOD_MASK_ANY` means releasing the key combination
2872 with every possible modifier combination.
2874 <error type="Window"><![CDATA[
2875 The specified `grab_window` does not exist.
2877 <error type="Value"><![CDATA[
2880 <see type="request" name="GrabKey" />
2881 <see type="program" name="xev" />
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>
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.
2902 TODO: rewrite this in more understandable terms.
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
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.
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.
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
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.
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).
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.
2971 <request name="AllowEvents" opcode="35">
2972 <field type="CARD8" name="mode" enum="Allow" />
2973 <field type="TIMESTAMP" name="time" altenum="Time" />
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.
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.
2987 The special value `XCB_CURRENT_TIME` will be replaced with the current server
2990 <error type="Value"><![CDATA[
2991 You specified an invalid `mode`.
2996 <request name="GrabServer" opcode="36" />
2998 <request name="UngrabServer" opcode="37" />
3000 <request name="QueryPointer" opcode="38">
3002 <field type="WINDOW" name="window" />
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" />
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
3021 <field name="root"><![CDATA[
3022 The root window the pointer is logically on.
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.
3028 <field name="root_x"><![CDATA[
3029 The pointer X position, relative to `root`.
3031 <field name="root_y"><![CDATA[
3032 The pointer Y position, relative to `root`.
3034 <field name="win_x"><![CDATA[
3035 The pointer X coordinate, relative to `child`, if `same_screen` is true. Zero
3038 <field name="win_y"><![CDATA[
3039 The pointer Y coordinate, relative to `child`, if `same_screen` is true. Zero
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.
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.
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).
3059 <error type="Window"><![CDATA[
3060 The specified `window` does not exist.
3065 <struct name="TIMECOORD">
3066 <field type="TIMESTAMP" name="time" />
3067 <field type="INT16" name="x" />
3068 <field type="INT16" name="y" />
3071 <request name="GetMotionEvents" opcode="39">
3073 <field type="WINDOW" name="window" />
3074 <field type="TIMESTAMP" name="start" altenum="Time" />
3075 <field type="TIMESTAMP" name="stop" altenum="Time" />
3078 <field type="CARD32" name="events_len" />
3080 <list type="TIMECOORD" name="events">
3081 <fieldref>events_len</fieldref>
3086 <request name="TranslateCoordinates" opcode="40">
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" />
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" />
3100 <request name="WarpPointer" opcode="41">
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" />
3111 <brief>move mouse pointer</brief>
3112 <description><![CDATA[
3113 Moves the mouse pointer to the specified position.
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
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.
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
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.
3137 <error type="Window"><![CDATA[
3140 <see type="request" name="SetInputFocus" />
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 -->
3151 <field name="None"><![CDATA[
3152 The focus reverts to `XCB_NONE`, so no window will have the input focus.
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
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`.
3163 <field name="FollowKeyboard"><![CDATA[
3164 NOT YET DOCUMENTED. Only relevant for the xinput extension.
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" />
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).
3180 A FocusIn and FocusOut event is generated when focus is changed.
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).
3186 If `focus` is `XCB_NONE` (TODO), all keyboard events are
3187 discarded until a new focus window is set.
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.
3192 <field name="time"><![CDATA[
3193 Timestamp to avoid race conditions when running X over the network.
3195 The special value `XCB_CURRENT_TIME` will be replaced with the current server
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`).
3202 <error type="Window"><![CDATA[
3203 The specified `focus` window does not exist.
3205 <error type="Match"><![CDATA[
3206 The specified `focus` window is not viewable.
3208 <error type="Value"><![CDATA[
3211 <see type="event" name="FocusIn" />
3212 <see type="event" name="FocusOut" />
3217 <request name="GetInputFocus" opcode="43">
3219 <field type="CARD8" name="revert_to" enum="InputFocus" />
3220 <field type="WINDOW" name="focus" altenum="InputFocus" />
3224 <request name="QueryKeymap" opcode="44">
3227 <list type="CARD8" name="keys"><value>32</value></list>
3231 <request name="OpenFont" opcode="45">
3233 <field type="FONT" name="fid" />
3234 <field type="CARD16" name="name_len" />
3236 <list type="char" name="name">
3237 <fieldref>name_len</fieldref>
3240 <brief>opens a font</brief>
3241 <description><![CDATA[
3242 Opens any X core font matching the given `name` (for example "-misc-fixed-*").
3244 Note that X core fonts are deprecated (but still supported) in favor of
3245 client-side rendering using Xft.
3247 <field name="fid"><![CDATA[
3248 The ID with which you will refer to the font, created by `xcb_generate_id`.
3250 <field name="name_len"><![CDATA[
3251 Length (in bytes) of `name`.
3253 <field name="name"><![CDATA[
3254 A pattern describing an X core font.
3256 <error type="Name"><![CDATA[
3257 No font matches the given `name`.
3259 <see type="function" name="xcb_generate_id" />
3263 <request name="CloseFont" opcode="46">
3265 <field type="FONT" name="font" />
3268 <enum name="FontDraw">
3269 <item name="LeftToRight"><value>0</value></item>
3270 <item name="RightToLeft"><value>1</value></item>
3273 <struct name="FONTPROP">
3274 <field type="ATOM" name="name" />
3275 <field type="CARD32" name="value" />
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" />
3287 <request name="QueryFont" opcode="47">
3289 <field type="FONTABLE" name="font" />
3292 <field type="CHARINFO" name="min_bounds" />
3294 <field type="CHARINFO" name="max_bounds" />
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>
3310 <list type="CHARINFO" name="char_infos">
3311 <fieldref>char_infos_len</fieldref>
3314 <field name="min_bounds"><![CDATA[
3315 minimum bounds over all existing char
3317 <field name="max_bounds"><![CDATA[
3318 maximum bounds over all existing char
3320 <field name="min_char_or_byte2"><![CDATA[
3323 <field name="max_char_or_byte2"><![CDATA[
3326 <field name="default_char"><![CDATA[
3327 char to print for undefined character
3329 <field name="properties_len"><![CDATA[
3330 how many properties there are
3332 <field name="all_chars_exist"><![CDATA[
3333 flag if all characters have nonzero size
3335 <field name="font_ascent"><![CDATA[
3336 baseline to top edge of raster
3338 <field name="font_descent"><![CDATA[
3339 baseline to bottom edge of raster
3341 <!-- enum doc is sufficient -->
3342 <field name="draw_direction" />
3346 <brief>query font metrics</brief>
3347 <description><![CDATA[
3348 Queries information associated with the font.
3350 <field name="font"><![CDATA[
3351 The fontable (Font or Graphics Context) to query.
3353 <!-- TODO: example -->
3357 <request name="QueryTextExtents" opcode="48">
3358 <exprfield type="BOOL" name="odd_length">
3359 <op op="&"><fieldref>string_len</fieldref><value>1</value></op>
3361 <field type="FONTABLE" name="font" />
3362 <list type="CHAR2B" name="string" />
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" />
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.
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
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.
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.
3398 <field name="font"><![CDATA[
3399 The `font` to calculate text extents in. You can also pass a graphics context.
3401 <field name="string_len"><![CDATA[
3402 The number of characters in `string`.
3404 <field name="string"><![CDATA[
3405 The text to get text extents for.
3407 <error type="GContext"><![CDATA[
3408 The specified graphics context does not exist.
3410 <error type="Font"><![CDATA[
3411 The specified `font` does not exist.
3417 <field type="CARD8" name="name_len" />
3418 <list type="char" name="name">
3419 <fieldref>name_len</fieldref>
3423 <request name="ListFonts" opcode="49">
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>
3432 <field type="CARD16" name="names_len" />
3434 <list type="STR" name="names">
3435 <fieldref>names_len</fieldref>
3438 <field name="names_len"><![CDATA[
3439 The number of font names.
3444 <brief>get matching font names</brief>
3445 <description><![CDATA[
3446 Gets a list of available font names which match the given `pattern`.
3448 <field name="pattern_len"><![CDATA[
3449 The length (in bytes) of `pattern`.
3451 <field name="pattern"><![CDATA[
3452 A font pattern, for example "-misc-fixed-*".
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
3458 <field name="max_names"><![CDATA[
3459 The maximum number of fonts to be returned.
3464 <request name="ListFontsWithInfo" opcode="50">
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>
3472 <field type="CARD8" name="name_len" />
3473 <field type="CHARINFO" name="min_bounds" />
3475 <field type="CHARINFO" name="max_bounds" />
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>
3491 <list type="char" name="name">
3492 <fieldref>name_len</fieldref>
3495 <field name="name_len"><![CDATA[
3496 The number of matched font names.
3498 <field name="min_bounds"><![CDATA[
3499 minimum bounds over all existing char
3501 <field name="max_bounds"><![CDATA[
3502 maximum bounds over all existing char
3504 <field name="min_char_or_byte2"><![CDATA[
3507 <field name="max_char_or_byte2"><![CDATA[
3510 <field name="default_char"><![CDATA[
3511 char to print for undefined character
3513 <field name="properties_len"><![CDATA[
3514 how many properties there are
3516 <field name="all_chars_exist"><![CDATA[
3517 flag if all characters have nonzero size
3519 <field name="font_ascent"><![CDATA[
3520 baseline to top edge of raster
3522 <field name="font_descent"><![CDATA[
3523 baseline to bottom edge of raster
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.
3530 <!-- enum doc is sufficient -->
3531 <field name="draw_direction" />
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`.
3539 <field name="pattern_len"><![CDATA[
3540 The length (in bytes) of `pattern`.
3542 <field name="pattern"><![CDATA[
3543 A font pattern, for example "-misc-fixed-*".
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
3549 <field name="max_names"><![CDATA[
3550 The maximum number of fonts to be returned.
3556 <request name="SetFontPath" opcode="51">
3558 <field type="CARD16" name="font_qty" />
3560 <list type="STR" name="font">
3561 <fieldref>font_qty</fieldref>
3565 <request name="GetFontPath" opcode="52">
3568 <field type="CARD16" name="path_len" />
3570 <list type="STR" name="path">
3571 <fieldref>path_len</fieldref>
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" />
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`.
3588 <field name="depth"><![CDATA[
3591 <field name="pid"><![CDATA[
3592 The ID with which you will refer to the new pixmap, created by
3595 <field name="drawable"><![CDATA[
3596 Drawable to get the screen from.
3598 <field name="width"><![CDATA[
3599 The width of the new pixmap.
3601 <field name="height"><![CDATA[
3602 The height of the new pixmap.
3604 <error type="Value"><![CDATA[
3607 <error type="Drawable"><![CDATA[
3608 The specified `drawable` (Window or Pixmap) does not exist.
3610 <error type="Alloc"><![CDATA[
3611 The X server could not allocate the requested resources (no memory?).
3613 <see type="function" name="xcb_generate_id" />
3617 <request name="FreePixmap" opcode="54">
3619 <field type="PIXMAP" name="pixmap" />
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.
3626 <field name="pixmap"><![CDATA[The pixmap to destroy.]]></field>
3627 <error type="Pixmap"><![CDATA[
3628 The specified pixmap does not exist.
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>
3658 <field name="Function"><![CDATA[
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:
3667 ((src FUNC dst) AND plane-mask) OR (dst AND (NOT plane-mask))
3669 <field name="Foreground"><![CDATA[
3670 Foreground colorpixel.
3672 <field name="Background"><![CDATA[
3673 Background colorpixel.
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.
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
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).
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
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
3706 Bevel The result is Butt endpoint styles, and then the triangular notch is filled.
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
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
3719 Stippled Foreground masked by stipple
3720 For the odd dashes for line requests with line-style DoubleDash:
3722 Tiled Same as for even dashes
3723 OpaqueStippled Same as for even dashes
3724 Stippled Background masked by stipple
3726 <field name="FillRule"><![CDATA[
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
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
3756 <field name="TileStippleOriginX"><![CDATA[
3759 <field name="TileStippleOriginY"><![CDATA[
3762 <field name="Font"><![CDATA[
3763 Which font to use for the `ImageText8` and `ImageText16` requests.
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.
3774 <field name="GraphicsExposures"><![CDATA[
3775 Whether ExposureEvents should be generated (1) or not (0).
3779 <field name="ClipOriginX"><![CDATA[
3782 <field name="ClipOriginY"><![CDATA[
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.
3794 <field name="DashOffset"><![CDATA[
3797 <field name="DashList"><![CDATA[
3800 <field name="ArcMode"><![CDATA[
3807 <!-- GC Function values -->
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>
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>
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>
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>
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>
3853 <enum name="FillRule">
3854 <item name="EvenOdd"><value>0</value></item>
3855 <item name="Winding"><value>1</value></item>
3858 <enum name="SubwindowMode">
3859 <item name="ClipByChildren"> <value>0</value></item>
3860 <item name="IncludeInferiors"><value>1</value></item>
3863 <enum name="ArcMode">
3864 <item name="Chord"> <value>0</value></item>
3865 <item name="PieSlice"><value>1</value></item>
3868 <request name="CreateGC" opcode="55">
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" />
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.
3881 <field name="cid"><![CDATA[
3882 The ID with which you will refer to the graphics context, created by
3885 <field name="drawable"><![CDATA[
3886 Drawable to get the root/depth from.
3888 <error type="Drawable"><![CDATA[
3889 The specified `drawable` (Window or Pixmap) does not exist.
3891 <error type="Match"><![CDATA[
3894 <error type="Font"><![CDATA[
3897 <error type="Pixmap"><![CDATA[
3900 <error type="Value"><![CDATA[
3903 <error type="Alloc"><![CDATA[
3904 The X server could not allocate the requested resources (no memory?).
3906 <see type="function" name="xcb_generate_id" />
3910 <request name="ChangeGC" opcode="56">
3912 <field type="GCONTEXT" name="gc" />
3913 <valueparam value-mask-type="CARD32"
3914 value-mask-name="value_mask"
3915 value-list-name="value_list" />
3917 <brief>change graphics context components</brief>
3918 <description><![CDATA[
3919 Changes the components specified by `value_mask` for the specified graphics context.
3923 * Changes the foreground color component of the specified graphics context.
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 });
3930 /* The more explicit way. Beware that the order of values is important! */
3932 mask |= XCB_GC_FOREGROUND;
3933 mask |= XCB_GC_BACKGROUND;
3935 uint32_t values[] = {
3939 xcb_change_gc(conn, gc, mask, values);
3943 <field name="gc"><![CDATA[
3944 The graphics context to change.
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
3953 <error type="Font"><![CDATA[
3956 <error type="GContext"><![CDATA[
3959 <error type="Match"><![CDATA[
3962 <error type="Pixmap"><![CDATA[
3965 <error type="Value"><![CDATA[
3968 <error type="Alloc"><![CDATA[
3969 The X server could not allocate the requested resources (no memory?).
3974 <request name="CopyGC" opcode="57">
3976 <field type="GCONTEXT" name="src_gc" />
3977 <field type="GCONTEXT" name="dst_gc" />
3978 <field type="CARD32" name="value_mask" mask="GC" />
3981 <request name="SetDashes" opcode="58">
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>
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>
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" />
4006 <request name="FreeGC" opcode="60">
4008 <field type="GCONTEXT" name="gc" />
4010 <brief>Destroys a graphics context</brief>
4011 <description><![CDATA[
4012 Destroys the specified `gc` and all associated storage.
4014 <field name="gc"><![CDATA[The graphics context to destroy.]]></field>
4015 <error type="GContext"><![CDATA[
4016 The specified graphics context does not exist.
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" />
4030 <request name="CopyArea" opcode="62">
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" />
4042 <brief>copy areas</brief>
4043 <description><![CDATA[
4044 Copies the specified rectangle from `src_drawable` to `dst_drawable`.
4046 <field name="dst_drawable"><![CDATA[
4047 The destination drawable (Window or Pixmap).
4049 <field name="src_drawable"><![CDATA[
4050 The source drawable (Window or Pixmap).
4052 <field name="gc"><![CDATA[
4053 The graphics context to use.
4055 <field name="src_x"><![CDATA[
4056 The source X coordinate.
4058 <field name="src_y"><![CDATA[
4059 The source Y coordinate.
4061 <field name="dst_x"><![CDATA[
4062 The destination X coordinate.
4064 <field name="dst_y"><![CDATA[
4065 The destination Y coordinate.
4067 <field name="width"><![CDATA[
4068 The width of the area to copy (in pixels).
4070 <field name="height"><![CDATA[
4071 The height of the area to copy (in pixels).
4073 <error type="Drawable"><![CDATA[
4074 The specified `drawable` (Window or Pixmap) does not exist.
4076 <error type="GContext"><![CDATA[
4077 The specified graphics context does not exist.
4079 <error type="Match"><![CDATA[
4080 `src_drawable` has a different root or depth than `dst_drawable`.
4085 <request name="CopyPlane" opcode="63">
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" />
4099 <enum name="CoordMode">
4100 <item name="Origin"> <value>0</value></item>
4101 <item name="Previous"><value>1</value></item>
4103 <field name="Origin"><![CDATA[
4104 Treats all coordinates as relative to the origin.
4106 <field name="Previous"><![CDATA[
4107 Treats all coordinates after the first as relative to the previous coordinate.
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" />
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" />
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.
4139 * Draw a straight line.
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} });
4148 <field name="drawable"><![CDATA[
4149 The drawable to draw the line(s) on.
4151 <field name="gc"><![CDATA[
4152 The graphics context to use.
4154 <field name="points_len"><![CDATA[
4155 The number of `xcb_point_t` structures in `points`.
4157 <field name="points"><![CDATA[
4160 <!-- the enum doc is sufficient. -->
4161 <field name="coordinate_mode" />
4162 <error type="Drawable"><![CDATA[
4165 <error type="GContext"><![CDATA[
4168 <error type="Match"><![CDATA[
4171 <error type="Value"><![CDATA[
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" />
4184 <request name="PolySegment" opcode="66" combine-adjacent="true">
4186 <field type="DRAWABLE" name="drawable" />
4187 <field type="GCONTEXT" name="gc" />
4188 <list type="SEGMENT" name="segments" />
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.
4198 TODO: include the xcb_segment_t data structure
4202 <field name="drawable"><![CDATA[
4203 A drawable (Window or Pixmap) to draw on.
4205 <field name="gc"><![CDATA[
4206 The graphics context to use.
4208 TODO: document which attributes of a gc are used
4210 <field name="segments_len"><![CDATA[
4211 The number of `xcb_segment_t` structures in `segments`.
4213 <field name="segments"><![CDATA[
4214 An array of `xcb_segment_t` structures.
4216 <error type="Drawable"><![CDATA[
4217 The specified `drawable` does not exist.
4219 <error type="GContext"><![CDATA[
4220 The specified `gc` does not exist.
4222 <error type="Match"><![CDATA[
4228 <request name="PolyRectangle" opcode="67" combine-adjacent="true">
4230 <field type="DRAWABLE" name="drawable" />
4231 <field type="GCONTEXT" name="gc" />
4232 <list type="RECTANGLE" name="rectangles" />
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.
4240 <request name="PolyArc" opcode="68">
4242 <field type="DRAWABLE" name="drawable" />
4243 <field type="GCONTEXT" name="gc" />
4244 <list type="ARC" name="arcs" />
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>
4253 <request name="FillPoly" opcode="69">
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" />
4260 <list type="POINT" name="points" />
4263 <request name="PolyFillRectangle" opcode="70" combine-adjacent="true">
4265 <field type="DRAWABLE" name="drawable" />
4266 <field type="GCONTEXT" name="gc" />
4267 <list type="RECTANGLE" name="rectangles" />
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.
4275 <field name="drawable"><![CDATA[
4276 The drawable (Window or Pixmap) to draw on.
4278 <field name="gc"><![CDATA[
4279 The graphics context to use.
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.
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.
4288 <field name="rectangles_len"><![CDATA[
4289 The number of `xcb_rectangle_t` structures in `rectangles`.
4291 <field name="rectangles"><![CDATA[
4292 The rectangles to fill.
4294 <error type="Drawable"><![CDATA[
4295 The specified `drawable` (Window or Pixmap) does not exist.
4297 <error type="GContext"><![CDATA[
4298 The specified graphics context does not exist.
4300 <error type="Match"><![CDATA[
4306 <request name="PolyFillArc" opcode="71" combine-adjacent="true">
4308 <field type="DRAWABLE" name="drawable" />
4309 <field type="GCONTEXT" name="gc" />
4310 <list type="ARC" name="arcs" />
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>
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" />
4330 <list type="BYTE" name="data" />
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" />
4343 <field type="CARD8" name="depth" />
4344 <field type="VISUALID" name="visual" />
4346 <list type="BYTE" name="data">
4348 <fieldref>length</fieldref>
4355 <request name="PolyText8" opcode="74">
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" />
4364 <request name="PolyText16" opcode="75">
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" />
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>
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).
4391 Note that using X core fonts is deprecated (but still supported) in favor of
4392 client-side rendering using Xft.
4394 <field name="drawable"><![CDATA[
4395 The drawable (Window or Pixmap) to draw text on.
4397 <field name="string_len"><![CDATA[
4398 The length of the `string`. Note that this parameter limited by 255 due to
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`.
4405 <field name="x"><![CDATA[
4406 The x coordinate of the first character, relative to the origin of `drawable`.
4408 <field name="y"><![CDATA[
4409 The y coordinate of the first character, relative to the origin of `drawable`.
4411 <field name="gc"><![CDATA[
4412 The graphics context to use.
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.
4417 <error type="Drawable"><![CDATA[
4418 The specified `drawable` (Window or Pixmap) does not exist.
4420 <error type="GContext"><![CDATA[
4421 The specified graphics context does not exist.
4423 <error type="Match"><![CDATA[
4426 <see type="request" name="ImageText16" />
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>
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).
4448 Note that using X core fonts is deprecated (but still supported) in favor of
4449 client-side rendering using Xft.
4451 <field name="drawable"><![CDATA[
4452 The drawable (Window or Pixmap) to draw text on.
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!
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
4463 <field name="x"><![CDATA[
4464 The x coordinate of the first character, relative to the origin of `drawable`.
4466 <field name="y"><![CDATA[
4467 The y coordinate of the first character, relative to the origin of `drawable`.
4469 <field name="gc"><![CDATA[
4470 The graphics context to use.
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.
4475 <error type="Drawable"><![CDATA[
4476 The specified `drawable` (Window or Pixmap) does not exist.
4478 <error type="GContext"><![CDATA[
4479 The specified graphics context does not exist.
4481 <error type="Match"><![CDATA[
4484 <see type="request" name="ImageText8" />
4488 <enum name= "ColormapAlloc">
4489 <item name="None"><value>0</value></item>
4490 <item name="All"> <value>1</value></item>
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" />
4500 <request name="FreeColormap" opcode="79">
4502 <field type="COLORMAP" name="cmap" />
4505 <request name="CopyColormapAndFree" opcode="80">
4507 <field type="COLORMAP" name="mid" />
4508 <field type="COLORMAP" name="src_cmap" />
4511 <request name="InstallColormap" opcode="81">
4513 <field type="COLORMAP" name="cmap" />
4516 <request name="UninstallColormap" opcode="82">
4518 <field type="COLORMAP" name="cmap" />
4521 <request name="ListInstalledColormaps" opcode="83">
4523 <field type="WINDOW" name="window" />
4526 <field type="CARD16" name="cmaps_len" />
4528 <list type="COLORMAP" name="cmaps">
4529 <fieldref>cmaps_len</fieldref>
4534 <request name="AllocColor" opcode="84">
4536 <field type="COLORMAP" name="cmap" />
4537 <field type="CARD16" name="red" />
4538 <field type="CARD16" name="green" />
4539 <field type="CARD16" name="blue" />
4543 <field type="CARD16" name="red" />
4544 <field type="CARD16" name="green" />
4545 <field type="CARD16" name="blue" />
4547 <field type="CARD32" name="pixel" />
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.
4558 <field name="cmap"><![CDATA[
4561 <field name="red"><![CDATA[
4562 The red value of your color.
4564 <field name="green"><![CDATA[
4565 The green value of your color.
4567 <field name="blue"><![CDATA[
4568 The blue value of your color.
4570 <error type="Colormap"><![CDATA[
4571 The specified colormap `cmap` does not exist.
4576 <request name="AllocNamedColor" opcode="85">
4578 <field type="COLORMAP" name="cmap" />
4579 <field type="CARD16" name="name_len" />
4581 <list type="char" name="name">
4582 <fieldref>name_len</fieldref>
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" />
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" />
4603 <field type="CARD16" name="pixels_len" />
4604 <field type="CARD16" name="masks_len" />
4606 <list type="CARD32" name="pixels">
4607 <fieldref>pixels_len</fieldref>
4609 <list type="CARD32" name="masks">
4610 <fieldref>masks_len</fieldref>
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" />
4624 <field type="CARD16" name="pixels_len" />
4626 <field type="CARD32" name="red_mask" />
4627 <field type="CARD32" name="green_mask" />
4628 <field type="CARD32" name="blue_mask" />
4630 <list type="CARD32" name="pixels">
4631 <fieldref>pixels_len</fieldref>
4636 <request name="FreeColors" opcode="88">
4638 <field type="COLORMAP" name="cmap" />
4639 <field type="CARD32" name="plane_mask" />
4640 <list type="CARD32" name="pixels" />
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>
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" />
4658 <request name="StoreColors" opcode="89" combine-adjacent="true">
4660 <field type="COLORMAP" name="cmap" />
4661 <list type="COLORITEM" name="items" />
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" />
4670 <list type="char" name="name">
4671 <fieldref>name_len</fieldref>
4676 <field type="CARD16" name="red" />
4677 <field type="CARD16" name="green" />
4678 <field type="CARD16" name="blue" />
4682 <request name="QueryColors" opcode="91">
4684 <field type="COLORMAP" name="cmap" />
4685 <list type="CARD32" name="pixels" />
4688 <field type="CARD16" name="colors_len" />
4690 <list type="RGB" name="colors">
4691 <fieldref>colors_len</fieldref>
4696 <request name="LookupColor" opcode="92">
4698 <field type="COLORMAP" name="cmap" />
4699 <field type="CARD16" name="name_len" />
4701 <list type="char" name="name">
4702 <fieldref>name_len</fieldref>
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" />
4715 <enum name="Pixmap">
4716 <item name="None"> <value>0</value></item>
4719 <request name="CreateCursor" opcode="93">
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" />
4735 <item name="None"> <value>0</value></item>
4738 <request name="CreateGlyphCursor" opcode="94">
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" />
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.
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
4764 <field name="cid"><![CDATA[
4765 The ID with which you will refer to the cursor, created by `xcb_generate_id`.
4767 <field name="source_font"><![CDATA[
4768 In which font to look for the cursor glyph.
4770 <field name="mask_font"><![CDATA[
4771 In which font to look for the mask glyph.
4773 <field name="source_char"><![CDATA[
4774 The glyph of `source_font` to use.
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
4781 <field name="fore_red"><![CDATA[
4782 The red value of the foreground color.
4784 <field name="fore_green"><![CDATA[
4785 The green value of the foreground color.
4787 <field name="fore_blue"><![CDATA[
4788 The blue value of the foreground color.
4790 <field name="back_red"><![CDATA[
4791 The red value of the background color.
4793 <field name="back_green"><![CDATA[
4794 The green value of the background color.
4796 <field name="back_blue"><![CDATA[
4797 The blue value of the background color.
4799 <error type="Alloc"><![CDATA[
4800 The X server could not allocate the requested resources (no memory?).
4802 <error type="Font"><![CDATA[
4803 The specified `source_font` or `mask_font` does not exist.
4805 <error type="Value"><![CDATA[
4806 Either `source_char` or `mask_char` are not defined in `source_font` or `mask_font`, respectively.
4808 <!-- TODO: example -->
4812 <request name="FreeCursor" opcode="95">
4814 <field type="CURSOR" name="cursor" />
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.
4821 <field name="cursor"><![CDATA[The cursor to destroy.]]></field>
4822 <error type="Cursor"><![CDATA[
4823 The specified cursor does not exist.
4829 <request name="RecolorCursor" opcode="96">
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" />
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>
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" />
4853 <field type="CARD16" name="width" />
4854 <field type="CARD16" name="height" />
4858 <request name="QueryExtension" opcode="98">
4860 <field type="CARD16" name="name_len" />
4862 <list type="char" name="name">
4863 <fieldref>name_len</fieldref>
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" />
4872 <field name="present"><![CDATA[
4873 Whether the extension is present on this X11 server.
4875 <field name="major_opcode"><![CDATA[
4876 The major opcode for requests.
4878 <field name="first_event"><![CDATA[
4879 The first event code, if any.
4881 <field name="first_error"><![CDATA[
4882 The first error code, if any.
4887 <brief>check if extension is present</brief>
4888 <description><![CDATA[
4889 Determines if the specified extension is present on this X11 server.
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
4896 There should rarely be a need to use this request directly, XCB provides the
4897 `xcb_get_extension_data` function instead.
4899 <field name="name_len"><![CDATA[
4900 The length of `name` in bytes.
4902 <field name="name"><![CDATA[
4903 The name of the extension to query, for example "RANDR". This is case
4906 <see type="program" name="xdpyinfo" />
4907 <see type="function" name="xcb_get_extension_data" />
4911 <request name="ListExtensions" opcode="99">
4913 <field type="CARD8" name="names_len" />
4915 <list type="STR" name="names">
4916 <fieldref>names_len</fieldref>
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" />
4926 <list type="KEYSYM" name="keysyms">
4928 <fieldref>keycode_count</fieldref>
4929 <fieldref>keysyms_per_keycode</fieldref>
4934 <request name="GetKeyboardMapping" opcode="101">
4936 <field type="KEYCODE" name="first_keycode" />
4937 <field type="CARD8" name="count" />
4939 <field type="BYTE" name="keysyms_per_keycode" />
4941 <list type="KEYSYM" name="keysyms">
4942 <fieldref>length</fieldref>
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>
4958 <enum name="LedMode">
4959 <item name="Off"><value>0</value></item>
4960 <item name="On"> <value>1</value></item>
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>
4969 <request name="ChangeKeyboardControl" opcode="102">
4971 <valueparam value-mask-type="CARD32"
4972 value-mask-name="value_mask"
4973 value-list-name="value_list" />
4976 <request name="GetKeyboardControl" opcode="103">
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" />
4985 <list type="CARD8" name="auto_repeats"><value>32</value></list>
4989 <request name="Bell" opcode="104">
4990 <field type="INT8" name="percent" />
4993 <request name="ChangePointerControl" opcode="105">
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" />
5002 <request name="GetPointerControl" opcode="106">
5005 <field type="CARD16" name="acceleration_numerator" />
5006 <field type="CARD16" name="acceleration_denominator" />
5007 <field type="CARD16" name="threshold" />
5012 <!-- Screen saver timeout and interval can be set to -1 to restore defaults
5013 and set to 0 to disable the screen saver. -->
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>
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>
5027 <request name="SetScreenSaver" opcode="107">
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" />
5035 <request name="GetScreenSaver" opcode="108">
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" />
5046 <enum name="HostMode">
5047 <item name="Insert"><value>0</value></item>
5048 <item name="Delete"><value>1</value></item>
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>
5060 <request name="ChangeHosts" opcode="109">
5061 <field type="CARD8" name="mode" enum="HostMode" />
5062 <field type="CARD8" name="family" enum="Family" />
5064 <field type="CARD16" name="address_len" />
5065 <list type="BYTE" name="address">
5066 <fieldref>address_len</fieldref>
5070 <struct name="HOST">
5071 <field type="CARD8" name="family" enum="Family" />
5073 <field type="CARD16" name="address_len" />
5074 <list type="BYTE" name="address">
5075 <fieldref>address_len</fieldref>
5079 <request name="ListHosts" opcode="110">
5081 <field type="BYTE" name="mode" enum="AccessControl" />
5082 <field type="CARD16" name="hosts_len" />
5084 <list type="HOST" name="hosts">
5085 <fieldref>hosts_len</fieldref>
5090 <enum name="AccessControl">
5091 <item name="Disable"><value>0</value></item>
5092 <item name="Enable"> <value>1</value></item>
5095 <request name="SetAccessControl" opcode="111">
5096 <field type="CARD8" name="mode" enum="AccessControl" />
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>
5105 <request name="SetCloseDownMode" opcode="112">
5106 <field type="CARD8" name="mode" enum="CloseDown" />
5110 <item name="AllTemporary"><value>0</value></item>
5113 <request name="KillClient" opcode="113">
5115 <field type="CARD32" name="resource" altenum="Kill" />
5117 <brief>kills a client</brief>
5118 <description><![CDATA[
5119 Forces a close down of the client that created the specified `resource`.
5121 <field name="resource"><![CDATA[
5122 Any resource belonging to the client (for example a Window), used to identify
5123 the client connection.
5125 The special value of `XCB_KILL_ALL_TEMPORARY`, the resources of all clients
5126 that have terminated in `RetainTemporary` (TODO) are destroyed.
5128 <error type="Value"><![CDATA[
5129 The specified `resource` does not exist.
5131 <see type="program" name="xkill" />
5136 <request name="RotateProperties" opcode="114">
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>
5146 <enum name="ScreenSaver">
5147 <item name="Reset"> <value>0</value></item>
5148 <item name="Active"><value>1</value></item>
5151 <request name="ForceScreenSaver" opcode="115">
5152 <field type="CARD8" name="mode" enum="ScreenSaver" />
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>
5162 <request name="SetPointerMapping" opcode="116">
5163 <field type="CARD8" name="map_len" />
5164 <list type="CARD8" name="map">
5165 <fieldref>map_len</fieldref>
5168 <field type="BYTE" name="status" enum="MappingStatus" />
5172 <request name="GetPointerMapping" opcode="117">
5174 <field type="CARD8" name="map_len" />
5176 <list type="CARD8" name="map">
5177 <fieldref>map_len</fieldref>
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>
5193 <request name="SetModifierMapping" opcode="118">
5194 <field type="CARD8" name="keycodes_per_modifier" />
5195 <list type="KEYCODE" name="keycodes">
5197 <fieldref>keycodes_per_modifier</fieldref>
5202 <field type="BYTE" name="status" enum="MappingStatus" />
5206 <request name="GetModifierMapping" opcode="119">
5208 <field type="CARD8" name="keycodes_per_modifier" />
5210 <list type="KEYCODE" name="keycodes">
5212 <fieldref>keycodes_per_modifier</fieldref>
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...!
5224 <request name="NoOperation" opcode="127" />