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"> <value>1</value> </item>
893 <item name="SECONDARY"> <value>2</value> </item>
894 <item name="ARC"> <value>3</value> </item>
895 <item name="ATOM"> <value>4</value> </item>
896 <item name="BITMAP"> <value>5</value> </item>
897 <item name="CARDINAL"> <value>6</value> </item>
898 <item name="COLORMAP"> <value>7</value> </item>
899 <item name="CURSOR"> <value>8</value> </item>
900 <item name="CUT_BUFFER0"> <value>9</value> </item>
901 <item name="CUT_BUFFER1"> <value>10</value> </item>
902 <item name="CUT_BUFFER2"> <value>11</value> </item>
903 <item name="CUT_BUFFER3"> <value>12</value> </item>
904 <item name="CUT_BUFFER4"> <value>13</value> </item>
905 <item name="CUT_BUFFER5"> <value>14</value> </item>
906 <item name="CUT_BUFFER6"> <value>15</value> </item>
907 <item name="CUT_BUFFER7"> <value>16</value> </item>
908 <item name="DRAWABLE"> <value>17</value> </item>
909 <item name="FONT"> <value>18</value> </item>
910 <item name="INTEGER"> <value>19</value> </item>
911 <item name="PIXMAP"> <value>20</value> </item>
912 <item name="POINT"> <value>21</value> </item>
913 <item name="RECTANGLE"> <value>22</value> </item>
914 <item name="RESOURCE_MANAGER"> <value>23</value> </item>
915 <item name="RGB_COLOR_MAP"> <value>24</value> </item>
916 <item name="RGB_BEST_MAP"> <value>25</value> </item>
917 <item name="RGB_BLUE_MAP"> <value>26</value> </item>
918 <item name="RGB_DEFAULT_MAP"> <value>27</value> </item>
919 <item name="RGB_GRAY_MAP"> <value>28</value> </item>
920 <item name="RGB_GREEN_MAP"> <value>29</value> </item>
921 <item name="RGB_RED_MAP"> <value>30</value> </item>
922 <item name="STRING"> <value>31</value> </item>
923 <item name="VISUALID"> <value>32</value> </item>
924 <item name="WINDOW"> <value>33</value> </item>
925 <item name="WM_COMMAND"> <value>34</value> </item>
926 <item name="WM_HINTS"> <value>35</value> </item>
927 <item name="WM_CLIENT_MACHINE"> <value>36</value> </item>
928 <item name="WM_ICON_NAME"> <value>37</value> </item>
929 <item name="WM_ICON_SIZE"> <value>38</value> </item>
930 <item name="WM_NAME"> <value>39</value> </item>
931 <item name="WM_NORMAL_HINTS"> <value>40</value> </item>
932 <item name="WM_SIZE_HINTS"> <value>41</value> </item>
933 <item name="WM_ZOOM_HINTS"> <value>42</value> </item>
934 <item name="MIN_SPACE"> <value>43</value> </item>
935 <item name="NORM_SPACE"> <value>44</value> </item>
936 <item name="MAX_SPACE"> <value>45</value> </item>
937 <item name="END_SPACE"> <value>46</value> </item>
938 <item name="SUPERSCRIPT_X"> <value>47</value> </item>
939 <item name="SUPERSCRIPT_Y"> <value>48</value> </item>
940 <item name="SUBSCRIPT_X"> <value>49</value> </item>
941 <item name="SUBSCRIPT_Y"> <value>50</value> </item>
942 <item name="UNDERLINE_POSITION"> <value>51</value> </item>
943 <item name="UNDERLINE_THICKNESS"> <value>52</value> </item>
944 <item name="STRIKEOUT_ASCENT"> <value>53</value> </item>
945 <item name="STRIKEOUT_DESCENT"> <value>54</value> </item>
946 <item name="ITALIC_ANGLE"> <value>55</value> </item>
947 <item name="X_HEIGHT"> <value>56</value> </item>
948 <item name="QUAD_WIDTH"> <value>57</value> </item>
949 <item name="WEIGHT"> <value>58</value> </item>
950 <item name="POINT_SIZE"> <value>59</value> </item>
951 <item name="RESOLUTION"> <value>60</value> </item>
952 <item name="COPYRIGHT"> <value>61</value> </item>
953 <item name="NOTICE"> <value>62</value> </item>
954 <item name="FONT_NAME"> <value>63</value> </item>
955 <item name="FAMILY_NAME"> <value>64</value> </item>
956 <item name="FULL_NAME"> <value>65</value> </item>
957 <item name="CAP_HEIGHT"> <value>66</value> </item>
958 <item name="WM_CLASS"> <value>67</value> </item>
959 <item name="WM_TRANSIENT_FOR"> <value>68</value> </item>
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.
1083 <event name="ge" number="35" xge="true">
1086 <brief>generic event (with length)</brief>
1087 <field name="extension"><![CDATA[
1088 The major opcode of the extension creating this event
1090 <field name="length"><![CDATA[
1091 The amount (in 4-byte units) of data beyond 32 bytes
1093 <field name="evtype"><![CDATA[
1094 The extension-specific event type
1099 <!-- Core error types -->
1103 <error name="Request" number="1">
1104 <field type="CARD32" name="bad_value" />
1105 <field type="CARD16" name="minor_opcode" />
1106 <field type="CARD8" name="major_opcode" />
1110 <error name="Value" number="2">
1111 <field type="CARD32" name="bad_value" />
1112 <field type="CARD16" name="minor_opcode" />
1113 <field type="CARD8" name="major_opcode" />
1117 <errorcopy name="Window" number="3" ref="Value" />
1118 <errorcopy name="Pixmap" number="4" ref="Value" />
1119 <errorcopy name="Atom" number="5" ref="Value" />
1120 <errorcopy name="Cursor" number="6" ref="Value" />
1121 <errorcopy name="Font" number="7" ref="Value" />
1122 <errorcopy name="Match" number="8" ref="Request" />
1123 <errorcopy name="Drawable" number="9" ref="Value" />
1124 <errorcopy name="Access" number="10" ref="Request" />
1125 <errorcopy name="Alloc" number="11" ref="Request" />
1126 <errorcopy name="Colormap" number="12" ref="Value" />
1127 <errorcopy name="GContext" number="13" ref="Value" />
1128 <errorcopy name="IDChoice" number="14" ref="Value" />
1129 <errorcopy name="Name" number="15" ref="Request" />
1130 <errorcopy name="Length" number="16" ref="Request" />
1131 <errorcopy name="Implementation" number="17" ref="Request" />
1135 <!-- The core requests, in major number order. -->
1136 <!-- It is the caller's responsibility to free returned XCB*Rep objects. -->
1140 <enum name="WindowClass">
1141 <item name="CopyFromParent"><value>0</value></item>
1142 <item name="InputOutput"> <value>1</value></item>
1143 <item name="InputOnly"> <value>2</value></item>
1146 <!-- Window attributes for CreateWindow and ChangeWindowAttributes. -->
1148 <item name="BackPixmap"> <bit>0</bit></item>
1149 <item name="BackPixel"> <bit>1</bit></item>
1150 <item name="BorderPixmap"> <bit>2</bit></item>
1151 <item name="BorderPixel"> <bit>3</bit></item>
1152 <item name="BitGravity"> <bit>4</bit></item>
1153 <item name="WinGravity"> <bit>5</bit></item>
1154 <item name="BackingStore"> <bit>6</bit></item>
1155 <item name="BackingPlanes"> <bit>7</bit></item>
1156 <item name="BackingPixel"> <bit>8</bit></item>
1157 <item name="OverrideRedirect"><bit>9</bit></item>
1158 <item name="SaveUnder"> <bit>10</bit></item>
1159 <item name="EventMask"> <bit>11</bit></item>
1160 <item name="DontPropagate"> <bit>12</bit></item>
1161 <item name="Colormap"> <bit>13</bit></item>
1162 <item name="Cursor"> <bit>14</bit></item>
1164 <field name="BackPixmap"><![CDATA[
1165 Overrides the default background-pixmap. The background pixmap and window must
1166 have the same root and same depth. Any size pixmap can be used, although some
1167 sizes may be faster than others.
1169 If `XCB_BACK_PIXMAP_NONE` is specified, the window has no defined background.
1170 The server may fill the contents with the previous screen contents or with
1171 contents of its own choosing.
1173 If `XCB_BACK_PIXMAP_PARENT_RELATIVE` is specified, the parent's background is
1174 used, but the window must have the same depth as the parent (or a Match error
1175 results). The parent's background is tracked, and the current version is
1176 used each time the window background is required.
1178 <field name="BackPixel"><![CDATA[
1179 Overrides `BackPixmap`. A pixmap of undefined size filled with the specified
1180 background pixel is used for the background. Range-checking is not performed,
1181 the background pixel is truncated to the appropriate number of bits.
1183 <field name="BorderPixmap"><![CDATA[
1184 Overrides the default border-pixmap. The border pixmap and window must have the
1185 same root and the same depth. Any size pixmap can be used, although some sizes
1186 may be faster than others.
1188 The special value `XCB_COPY_FROM_PARENT` means the parent's border pixmap is
1189 copied (subsequent changes to the parent's border attribute do not affect the
1190 child), but the window must have the same depth as the parent.
1192 <field name="BorderPixel"><![CDATA[
1193 Overrides `BorderPixmap`. A pixmap of undefined size filled with the specified
1194 border pixel is used for the border. Range checking is not performed on the
1195 border-pixel value, it is truncated to the appropriate number of bits.
1197 <field name="BitGravity"><![CDATA[
1198 Defines which region of the window should be retained if the window is resized.
1200 <field name="WinGravity"><![CDATA[
1201 Defines how the window should be repositioned if the parent is resized (see
1204 <field name="BackingStore"><![CDATA[
1205 A backing-store of `WhenMapped` advises the server that maintaining contents of
1206 obscured regions when the window is mapped would be beneficial. A backing-store
1207 of `Always` advises the server that maintaining contents even when the window
1208 is unmapped would be beneficial. In this case, the server may generate an
1209 exposure event when the window is created. A value of `NotUseful` advises the
1210 server that maintaining contents is unnecessary, although a server may still
1211 choose to maintain contents while the window is mapped. Note that if the server
1212 maintains contents, then the server should maintain complete contents not just
1213 the region within the parent boundaries, even if the window is larger than its
1214 parent. While the server maintains contents, exposure events will not normally
1215 be generated, but the server may stop maintaining contents at any time.
1217 <field name="BackingPlanes"><![CDATA[
1218 The backing-planes indicates (with bits set to 1) which bit planes of the
1219 window hold dynamic data that must be preserved in backing-stores and during
1222 <field name="BackingPixel"><![CDATA[
1223 The backing-pixel specifies what value to use in planes not covered by
1224 backing-planes. The server is free to save only the specified bit planes in the
1225 backing-store or save-under and regenerate the remaining planes with the
1226 specified pixel value. Any bits beyond the specified depth of the window in
1227 these values are simply ignored.
1229 <field name="OverrideRedirect"><![CDATA[
1230 The override-redirect specifies whether map and configure requests on this
1231 window should override a SubstructureRedirect on the parent, typically to
1232 inform a window manager not to tamper with the window.
1234 <field name="SaveUnder"><![CDATA[
1235 If 1, the server is advised that when this window is mapped, saving the
1236 contents of windows it obscures would be beneficial.
1238 <field name="EventMask"><![CDATA[
1239 The event-mask defines which events the client is interested in for this window
1240 (or for some event types, inferiors of the window).
1242 <field name="DontPropagate"><![CDATA[
1243 The do-not-propagate-mask defines which events should not be propagated to
1244 ancestor windows when no client has the event type selected in this window.
1246 <field name="Colormap"><![CDATA[
1247 The colormap specifies the colormap that best reflects the true colors of the window. Servers
1248 capable of supporting multiple hardware colormaps may use this information, and window man-
1249 agers may use it for InstallColormap requests. The colormap must have the same visual type
1250 and root as the window (or a Match error results). If CopyFromParent is specified, the parent's
1251 colormap is copied (subsequent changes to the parent's colormap attribute do not affect the child).
1252 However, the window must have the same visual type as the parent (or a Match error results),
1253 and the parent must not have a colormap of None (or a Match error results). For an explanation
1254 of None, see FreeColormap request. The colormap is copied by sharing the colormap object
1255 between the child and the parent, not by making a complete copy of the colormap contents.
1257 <field name="Cursor"><![CDATA[
1258 If a cursor is specified, it will be used whenever the pointer is in the window. If None is speci-
1259 fied, the parent's cursor will be used when the pointer is in the window, and any change in the
1260 parent's cursor will cause an immediate change in the displayed cursor.
1265 <enum name="BackPixmap">
1266 <item name="None"> <value>0</value></item>
1267 <item name="ParentRelative"><value>1</value></item>
1270 <enum name="Gravity">
1271 <item name="BitForget"><value>0</value></item>
1272 <item name="WinUnmap"> <value>0</value></item>
1273 <item name="NorthWest"><value>1</value></item>
1274 <item name="North"> <value>2</value></item>
1275 <item name="NorthEast"><value>3</value></item>
1276 <item name="West"> <value>4</value></item>
1277 <item name="Center"> <value>5</value></item>
1278 <item name="East"> <value>6</value></item>
1279 <item name="SouthWest"><value>7</value></item>
1280 <item name="South"> <value>8</value></item>
1281 <item name="SouthEast"><value>9</value></item>
1282 <item name="Static"> <value>10</value></item>
1285 <request name="CreateWindow" opcode="1">
1286 <field type="CARD8" name="depth" />
1287 <field type="WINDOW" name="wid" />
1288 <field type="WINDOW" name="parent" />
1289 <field type="INT16" name="x" />
1290 <field type="INT16" name="y" />
1291 <field type="CARD16" name="width" />
1292 <field type="CARD16" name="height" />
1293 <field type="CARD16" name="border_width" />
1294 <field type="CARD16" name="class" enum="WindowClass" />
1295 <field type="VISUALID" name="visual" />
1296 <valueparam value-mask-type="CARD32"
1297 value-mask-name="value_mask"
1298 value-list-name="value_list" />
1300 <brief>Creates a window</brief>
1301 <description><![CDATA[
1302 Creates an unmapped window as child of the specified `parent` window. A
1303 CreateNotify event will be generated. The new window is placed on top in the
1304 stacking order with respect to siblings.
1306 The coordinate system has the X axis horizontal and the Y axis vertical with
1307 the origin [0, 0] at the upper-left corner. Coordinates are integral, in terms
1308 of pixels, and coincide with pixel centers. Each window and pixmap has its own
1309 coordinate system. For a window, the origin is inside the border at the inside,
1312 The created window is not yet displayed (mapped), call `xcb_map_window` to
1315 The created window will initially use the same cursor as its parent.
1317 <field name="wid"><![CDATA[
1318 The ID with which you will refer to the new window, created by
1321 <field name="depth"><![CDATA[
1322 Specifies the new window's depth (TODO: what unit?).
1324 The special value `XCB_COPY_FROM_PARENT` means the depth is taken from the
1327 <field name="visual"><![CDATA[
1328 Specifies the id for the new window's visual.
1330 The special value `XCB_COPY_FROM_PARENT` means the visual is taken from the
1333 <field name="class"></field>
1334 <field name="parent"><![CDATA[
1335 The parent window of the new window.
1337 <field name="border_width"><![CDATA[
1340 Must be zero if the `class` is `InputOnly` or a `xcb_match_error_t` occurs.
1342 <field name="x"><![CDATA[The X coordinate of the new window.]]></field>
1343 <field name="y"><![CDATA[The Y coordinate of the new window.]]></field>
1344 <field name="width"><![CDATA[The width of the new window.]]></field>
1345 <field name="height"><![CDATA[The height of the new window.]]></field>
1346 <error type="Colormap"><![CDATA[
1349 <error type="Match"><![CDATA[
1352 <error type="Cursor"><![CDATA[
1355 <error type="Pixmap"><![CDATA[
1358 <error type="Value"><![CDATA[
1361 <error type="Window"><![CDATA[
1364 <error type="Alloc"><![CDATA[
1365 The X server could not allocate the requested resources (no memory?).
1367 <see type="function" name="xcb_generate_id" />
1368 <see type="request" name="MapWindow" />
1369 <see type="event" name="CreateNotify" />
1374 <request name="ChangeWindowAttributes" opcode="2">
1376 <field type="WINDOW" name="window" />
1377 <valueparam value-mask-type="CARD32"
1378 value-mask-name="value_mask"
1379 value-list-name="value_list" />
1381 <brief>change window attributes</brief>
1382 <description><![CDATA[
1383 Changes the attributes specified by `value_mask` for the specified `window`.
1385 <field name="window"><![CDATA[
1386 The window to change.
1388 <!-- the enum documentation is good enough. -->
1389 <field name="value_mask" />
1390 <field name="value_list"><![CDATA[
1391 Values for each of the attributes specified in the bitmask `value_mask`. The
1392 order has to correspond to the order of possible `value_mask` bits. See the
1395 <error type="Access"><![CDATA[
1398 <error type="Colormap"><![CDATA[
1401 <error type="Cursor"><![CDATA[
1404 <error type="Match"><![CDATA[
1407 <error type="Pixmap"><![CDATA[
1410 <error type="Value"><![CDATA[
1413 <error type="Window"><![CDATA[
1414 The specified `window` does not exist.
1419 <enum name="MapState">
1420 <item name="Unmapped"> <value>0</value></item>
1421 <item name="Unviewable"><value>1</value></item>
1422 <item name="Viewable"> <value>2</value></item>
1425 <request name="GetWindowAttributes" opcode="3">
1427 <field type="WINDOW" name="window" />
1429 <field type="CARD8" name="backing_store" enum="BackingStore" />
1430 <field type="VISUALID" name="visual" />
1431 <field type="CARD16" name="class" enum="WindowClass" />
1432 <field type="CARD8" name="bit_gravity" enum="Gravity" />
1433 <field type="CARD8" name="win_gravity" enum="Gravity" />
1434 <field type="CARD32" name="backing_planes" />
1435 <field type="CARD32" name="backing_pixel" />
1436 <field type="BOOL" name="save_under" />
1437 <field type="BOOL" name="map_is_installed" />
1438 <field type="CARD8" name="map_state" enum="MapState" />
1439 <field type="BOOL" name="override_redirect" />
1440 <field type="COLORMAP" name="colormap" altenum="Colormap" />
1441 <field type="CARD32" name="all_event_masks" mask="EventMask" />
1442 <field type="CARD32" name="your_event_mask" mask="EventMask" />
1443 <field type="CARD16" name="do_not_propagate_mask" mask="EventMask" />
1446 <field name="override_redirect"><![CDATA[
1447 Window managers should ignore this window if `override_redirect` is 1.
1449 <field name="visual"><![CDATA[
1450 The associated visual structure of `window`.
1452 <field name="backing_planes"><![CDATA[
1453 Planes to be preserved if possible.
1455 <field name="backing_pixel"><![CDATA[
1456 Value to be used when restoring planes.
1458 <field name="save_under"><![CDATA[
1459 Boolean, should bits under be saved?
1461 <field name="colormap"><![CDATA[
1462 Color map to be associated with window.
1464 <field name="all_event_masks"><![CDATA[
1465 Set of events all people have interest in.
1467 <field name="your_event_mask"><![CDATA[
1470 <field name="do_not_propagate_mask"><![CDATA[
1471 Set of events that should not propagate.
1473 <!-- enum documentation is sufficient for these fields -->
1474 <field name="backing_store" />
1475 <field name="class" />
1476 <field name="bit_gravity" />
1477 <field name="win_gravity" />
1478 <field name="map_state" />
1482 <brief>Gets window attributes</brief>
1483 <description><![CDATA[
1484 Gets the current attributes for the specified `window`.
1486 <field name="window"><![CDATA[The window to get the attributes from.]]></field>
1487 <error type="Window"><![CDATA[
1488 The specified `window` does not exist.
1490 <error type="Drawable"><![CDATA[
1497 <request name="DestroyWindow" opcode="4">
1499 <field type="WINDOW" name="window" />
1501 <brief>Destroys a window</brief>
1502 <description><![CDATA[
1503 Destroys the specified window and all of its subwindows. A DestroyNotify event
1504 is generated for each destroyed window (a DestroyNotify event is first generated
1505 for any given window's inferiors). If the window was mapped, it will be
1506 automatically unmapped before destroying.
1508 Calling DestroyWindow on the root window will do nothing.
1510 <field name="window"><![CDATA[The window to destroy.]]></field>
1511 <error type="Window"><![CDATA[
1512 The specified window does not exist.
1514 <see type="event" name="DestroyNotify" />
1515 <see type="request" name="MapWindow" />
1516 <see type="request" name="UnmapWindow" />
1520 <request name="DestroySubwindows" opcode="5">
1522 <field type="WINDOW" name="window" />
1525 <enum name="SetMode">
1526 <item name="Insert"><value>0</value></item>
1527 <item name="Delete"><value>1</value></item>
1530 <request name="ChangeSaveSet" opcode="6">
1531 <field type="BYTE" name="mode" enum="SetMode" />
1532 <field type="WINDOW" name="window" />
1534 <brief>Changes a client's save set</brief>
1535 <description><![CDATA[
1536 TODO: explain what the save set is for.
1538 This function either adds or removes the specified window to the client's (your
1539 application's) save set.
1541 <field name="mode"><![CDATA[Insert to add the specified window to the save set or Delete to delete it from the save set.]]></field>
1542 <field name="window"><![CDATA[The window to add or delete to/from your save set.]]></field>
1543 <error type="Match"><![CDATA[
1544 You created the specified window. This does not make sense, you can only add
1545 windows created by other clients to your save set.
1547 <error type="Value"><![CDATA[
1548 You specified an invalid mode.
1550 <error type="Window"><![CDATA[
1551 The specified window does not exist.
1553 <see type="request" name="ReparentWindow" />
1557 <request name="ReparentWindow" opcode="7">
1559 <field type="WINDOW" name="window" />
1560 <field type="WINDOW" name="parent" />
1561 <field type="INT16" name="x" />
1562 <field type="INT16" name="y" />
1564 <brief>Reparents a window</brief>
1565 <description><![CDATA[
1566 Makes the specified window a child of the specified parent window. If the
1567 window is mapped, it will automatically be unmapped before reparenting and
1568 re-mapped after reparenting. The window is placed in the stacking order on top
1569 with respect to sibling windows.
1571 After reparenting, a ReparentNotify event is generated.
1573 <field name="window"><![CDATA[The window to reparent.]]></field>
1574 <field name="parent"><![CDATA[The new parent of the window.]]></field>
1575 <field name="x"><![CDATA[
1576 The X position of the window within its new parent.
1578 <field name="y"><![CDATA[
1579 The Y position of the window within its new parent.
1581 <error type="Match"><![CDATA[
1582 The new parent window is not on the same screen as the old parent window.
1584 The new parent window is the specified window or an inferior of the specified window.
1586 The new parent is InputOnly and the window is not.
1588 The specified window has a ParentRelative background and the new parent window is not the same depth as the specified window.
1590 <error type="Window"><![CDATA[
1591 The specified window does not exist.
1593 <see type="event" name="ReparentNotify" />
1594 <see type="request" name="MapWindow" />
1595 <see type="request" name="UnmapWindow" />
1599 <request name="MapWindow" opcode="8">
1601 <field type="WINDOW" name="window" />
1603 <brief>Makes a window visible</brief>
1604 <description><![CDATA[
1605 Maps the specified window. This means making the window visible (as long as its
1608 This MapWindow request will be translated to a MapRequest request if a window
1609 manager is running. The window manager then decides to either map the window or
1610 not. Set the override-redirect window attribute to true if you want to bypass
1613 If the window manager decides to map the window (or if no window manager is
1614 running), a MapNotify event is generated.
1616 If the window becomes viewable and no earlier contents for it are remembered,
1617 the X server tiles the window with its background. If the window's background
1618 is undefined, the existing screen contents are not altered, and the X server
1619 generates zero or more Expose events.
1621 If the window type is InputOutput, an Expose event will be generated when the
1622 window becomes visible. The normal response to an Expose event should be to
1625 <field name="window"><![CDATA[
1626 The window to make visible.
1628 <error type="Match"><![CDATA[
1629 The specified window does not exist.
1631 <see type="event" name="MapNotify" />
1632 <see type="event" name="Expose" />
1633 <see type="request" name="UnmapWindow" />
1637 <request name="MapSubwindows" opcode="9">
1639 <field type="WINDOW" name="window" />
1642 <request name="UnmapWindow" opcode="10">
1644 <field type="WINDOW" name="window" />
1646 <brief>Makes a window invisible</brief>
1647 <description><![CDATA[
1648 Unmaps the specified window. This means making the window invisible (and all
1651 Unmapping a window leads to the `UnmapNotify` event being generated. Also,
1652 `Expose` events are generated for formerly obscured windows.
1654 <field name="window"><![CDATA[
1655 The window to make invisible.
1657 <error type="Window"><![CDATA[
1658 The specified window does not exist.
1660 <see type="event" name="UnmapNotify" />
1661 <see type="event" name="Expose" />
1662 <see type="request" name="MapWindow" />
1666 <request name="UnmapSubwindows" opcode="11">
1668 <field type="WINDOW" name="window" />
1671 <enum name="ConfigWindow">
1672 <item name="X"> <bit>0</bit></item>
1673 <item name="Y"> <bit>1</bit></item>
1674 <item name="Width"> <bit>2</bit></item>
1675 <item name="Height"> <bit>3</bit></item>
1676 <item name="BorderWidth"><bit>4</bit></item>
1677 <item name="Sibling"> <bit>5</bit></item>
1678 <item name="StackMode"> <bit>6</bit></item>
1681 <enum name="StackMode">
1682 <item name="Above"> <value>0</value></item>
1683 <item name="Below"> <value>1</value></item>
1684 <item name="TopIf"> <value>2</value></item>
1685 <item name="BottomIf"><value>3</value></item>
1686 <item name="Opposite"><value>4</value></item>
1689 <request name="ConfigureWindow" opcode="12">
1691 <field type="WINDOW" name="window" />
1692 <field type="CARD16" name="value_mask" />
1694 <valueparam value-mask-type="CARD16"
1695 value-mask-name="value_mask"
1696 value-list-name="value_list" />
1698 <brief>Configures window attributes</brief>
1699 <description><![CDATA[
1700 Configures a window's size, position, border width and stacking order.
1704 * Configures the given window to the left upper corner
1705 * with a size of 1024x768 pixels.
1708 void my_example(xcb_connection *c, xcb_window_t window) {
1711 mask |= XCB_CONFIG_WINDOW_X;
1712 mask |= XCB_CONFIG_WINDOW_Y;
1713 mask |= XCB_CONFIG_WINDOW_WIDTH;
1714 mask |= XCB_CONFIG_WINDOW_HEIGHT;
1716 const uint32_t values[] = {
1723 xcb_configure_window(c, window, mask, values);
1727 <field name="window"><![CDATA[The window to configure.]]></field>
1728 <field name="value_mask"><![CDATA[Bitmask of attributes to change.]]></field>
1729 <field name="value_list"><![CDATA[
1730 New values, corresponding to the attributes in value_mask. The order has to
1731 correspond to the order of possible `value_mask` bits. See the example.
1733 <error type="Match"><![CDATA[
1734 You specified a Sibling without also specifying StackMode or the window is not
1737 <error type="Window"><![CDATA[
1738 The specified window does not exist. TODO: any other reason?
1740 <error type="Value"><![CDATA[
1743 <see type="event" name="MapNotify" />
1744 <see type="event" name="Expose" />
1748 <enum name="Circulate">
1749 <item name="RaiseLowest"> <value>0</value></item>
1750 <item name="LowerHighest"><value>1</value></item>
1753 <request name="CirculateWindow" opcode="13">
1754 <field type="CARD8" name="direction" enum="Circulate" />
1755 <field type="WINDOW" name="window" />
1757 <brief>Change window stacking order</brief>
1758 <description><![CDATA[
1759 If `direction` is `XCB_CIRCULATE_RAISE_LOWEST`, the lowest mapped child (if
1760 any) will be raised to the top of the stack.
1762 If `direction` is `XCB_CIRCULATE_LOWER_HIGHEST`, the highest mapped child will
1763 be lowered to the bottom of the stack.
1765 <!-- The enums are documented, we have nothing to add. -->
1766 <field name="direction" />
1767 <field name="window"><![CDATA[
1768 The window to raise/lower (depending on `direction`).
1770 <error type="Window"><![CDATA[
1771 The specified `window` does not exist.
1773 <error type="Value"><![CDATA[
1774 The specified `direction` is invalid.
1779 <request name="GetGeometry" opcode="14">
1781 <field type="DRAWABLE" name="drawable" />
1783 <field type="CARD8" name="depth" />
1784 <field type="WINDOW" name="root" />
1785 <field type="INT16" name="x" />
1786 <field type="INT16" name="y" />
1787 <field type="CARD16" name="width" />
1788 <field type="CARD16" name="height" />
1789 <field type="CARD16" name="border_width" />
1792 <field name="root"><![CDATA[
1793 Root window of the screen containing `drawable`.
1795 <field name="x"><![CDATA[
1796 The X coordinate of `drawable`. If `drawable` is a window, the coordinate
1797 specifies the upper-left outer corner relative to its parent's origin. If
1798 `drawable` is a pixmap, the X coordinate is always 0.
1800 <field name="y"><![CDATA[
1801 The Y coordinate of `drawable`. If `drawable` is a window, the coordinate
1802 specifies the upper-left outer corner relative to its parent's origin. If
1803 `drawable` is a pixmap, the Y coordinate is always 0.
1805 <field name="width"><![CDATA[
1806 The width of `drawable`.
1808 <field name="height"><![CDATA[
1809 The height of `drawable`.
1811 <field name="border_width"><![CDATA[
1812 The border width (in pixels).
1814 <field name="depth"><![CDATA[
1815 The depth of the drawable (bits per pixel for the object).
1820 <brief>Get current window geometry</brief>
1821 <description><![CDATA[
1822 Gets the current geometry of the specified drawable (either `Window` or `Pixmap`).
1826 * Displays the x and y position of the given window.
1829 void my_example(xcb_connection *c, xcb_window_t window) {
1830 xcb_get_geometry_cookie_t cookie;
1831 xcb_get_geometry_reply_t *reply;
1833 cookie = xcb_get_geometry(c, window);
1834 /* ... do other work here if possible ... */
1835 if ((reply = xcb_get_geometry_reply(c, cookie, NULL))) {
1836 printf("This window is at %d, %d\\n", reply->x, reply->y);
1841 <field name="drawable"><![CDATA[
1842 The drawable (`Window` or `Pixmap`) of which the geometry will be received.
1844 <error type="Drawable"><![CDATA[
1847 <error type="Window"><![CDATA[
1850 <see type="program" name="xwininfo" />
1854 <request name="QueryTree" opcode="15">
1856 <field type="WINDOW" name="window" />
1859 <field type="WINDOW" name="root" />
1860 <field type="WINDOW" name="parent" altenum="Window" />
1861 <field type="CARD16" name="children_len" />
1863 <list type="WINDOW" name="children">
1864 <fieldref>children_len</fieldref>
1867 <field name="root"><![CDATA[
1868 The root window of `window`.
1870 <field name="parent"><![CDATA[
1871 The parent window of `window`.
1873 <field name="children_len"><![CDATA[
1874 The number of child windows.
1879 <brief>query the window tree</brief>
1880 <description><![CDATA[
1881 Gets the root window ID, parent window ID and list of children windows for the
1882 specified `window`. The children are listed in bottom-to-top stacking order.
1886 * Displays the root, parent and children of the specified window.
1889 void my_example(xcb_connection *conn, xcb_window_t window) {
1890 xcb_query_tree_cookie_t cookie;
1891 xcb_query_tree_reply_t *reply;
1893 cookie = xcb_query_tree(conn, window);
1894 if ((reply = xcb_query_tree_reply(conn, cookie, NULL))) {
1895 printf("root = 0x%08x\\n", reply->root);
1896 printf("parent = 0x%08x\\n", reply->parent);
1898 xcb_window_t *children = xcb_query_tree_children(reply);
1899 for (int i = 0; i < xcb_query_tree_children_length(reply); i++)
1900 printf("child window = 0x%08x\\n", children[i]);
1906 <field name="window"><![CDATA[
1907 The `window` to query.
1909 <see type="program" name="xwininfo" />
1913 <request name="InternAtom" opcode="16">
1914 <field type="BOOL" name="only_if_exists" />
1915 <field type="CARD16" name="name_len" />
1917 <list type="char" name="name">
1918 <fieldref>name_len</fieldref>
1922 <field type="ATOM" name="atom" altenum="Atom" />
1925 <brief>Get atom identifier by name</brief>
1926 <description><![CDATA[
1927 Retrieves the identifier (xcb_atom_t TODO) for the atom with the specified
1928 name. Atoms are used in protocols like EWMH, for example to store window titles
1929 (`_NET_WM_NAME` atom) as property of a window.
1931 If `only_if_exists` is 0, the atom will be created if it does not already exist.
1932 If `only_if_exists` is 1, `XCB_ATOM_NONE` will be returned if the atom does
1937 * Resolves the _NET_WM_NAME atom.
1940 void my_example(xcb_connection *c) {
1941 xcb_intern_atom_cookie_t cookie;
1942 xcb_intern_atom_reply_t *reply;
1944 cookie = xcb_intern_atom(c, 0, strlen("_NET_WM_NAME"), "_NET_WM_NAME");
1945 /* ... do other work here if possible ... */
1946 if ((reply = xcb_intern_atom_reply(c, cookie, NULL))) {
1947 printf("The _NET_WM_NAME atom has ID %u\n", reply->atom);
1952 <field name="name_len"><![CDATA[
1953 The length of the following `name`.
1955 <field name="name"><![CDATA[
1956 The name of the atom.
1958 <field name="only_if_exists"><![CDATA[
1959 Return a valid atom id only if the atom already exists.
1961 <error type="Alloc"><![CDATA[
1964 <error type="Value"><![CDATA[
1965 A value other than 0 or 1 was specified for `only_if_exists`.
1967 <see type="program" name="xlsatoms" />
1968 <see type="request" name="GetAtomName" />
1973 <request name="GetAtomName" opcode="17">
1975 <field type="ATOM" name="atom" />
1978 <field type="CARD16" name="name_len" />
1980 <list type="char" name="name">
1981 <fieldref>name_len</fieldref>
1986 <enum name="PropMode">
1987 <item name="Replace"><value>0</value></item>
1988 <item name="Prepend"><value>1</value></item>
1989 <item name="Append"> <value>2</value></item>
1991 <field name="Replace"><![CDATA[
1992 Discard the previous property value and store the new data.
1994 <field name="Prepend"><![CDATA[
1995 Insert the new data before the beginning of existing data. The `format` must
1996 match existing property value. If the property is undefined, it is treated as
1997 defined with the correct type and format with zero-length data.
1999 <field name="Append"><![CDATA[
2000 Insert the new data after the beginning of existing data. The `format` must
2001 match existing property value. If the property is undefined, it is treated as
2002 defined with the correct type and format with zero-length data.
2007 <request name="ChangeProperty" opcode="18">
2008 <field type="CARD8" name="mode" enum="PropMode" />
2009 <field type="WINDOW" name="window" />
2010 <field type="ATOM" name="property" />
2011 <field type="ATOM" name="type" />
2012 <field type="CARD8" name="format" />
2014 <field type="CARD32" name="data_len" />
2015 <list type="void" name="data">
2018 <fieldref>data_len</fieldref>
2019 <fieldref>format</fieldref>
2025 <brief>Changes a window property</brief>
2026 <description><![CDATA[
2027 Sets or updates a property on the specified `window`. Properties are for
2028 example the window title (`WM_NAME`) or its minimum size (`WM_NORMAL_HINTS`).
2029 Protocols such as EWMH also use properties - for example EWMH defines the
2030 window title, encoded as UTF-8 string, in the `_NET_WM_NAME` property.
2034 * Sets the WM_NAME property of the window to "XCB Example".
2037 void my_example(xcb_connection *conn, xcb_window_t window) {
2038 xcb_change_property(conn,
2039 XCB_PROP_MODE_REPLACE,
2044 strlen("XCB Example"),
2049 <field name="window"><![CDATA[
2050 The window whose property you want to change.
2052 <!-- the enum doc is sufficient. -->
2053 <field name="mode" />
2054 <field name="property"><![CDATA[
2055 The property you want to change (an atom).
2057 <field name="type"><![CDATA[
2058 The type of the property you want to change (an atom).
2060 <field name="format"><![CDATA[
2061 Specifies whether the data should be viewed as a list of 8-bit, 16-bit or
2062 32-bit quantities. Possible values are 8, 16 and 32. This information allows
2063 the X server to correctly perform byte-swap operations as necessary.
2065 <field name="data_len"><![CDATA[
2066 Specifies the number of elements (see `format`).
2068 <field name="data"><![CDATA[
2071 <error type="Match"><![CDATA[
2074 <error type="Value"><![CDATA[
2077 <error type="Window"><![CDATA[
2078 The specified `window` does not exist.
2080 <error type="Atom"><![CDATA[
2081 `property` or `type` do not refer to a valid atom.
2083 <error type="Alloc"><![CDATA[
2084 The X server could not store the property (no memory?).
2086 <see type="request" name="InternAtom" />
2087 <see type="program" name="xprop" />
2091 <request name="DeleteProperty" opcode="19">
2093 <field type="WINDOW" name="window" />
2094 <field type="ATOM" name="property" />
2097 <enum name="GetPropertyType">
2098 <item name="Any"><value>0</value></item>
2101 <request name="GetProperty" opcode="20">
2102 <field type="BOOL" name="delete" />
2103 <field type="WINDOW" name="window" />
2104 <field type="ATOM" name="property" />
2105 <field type="ATOM" name="type" altenum="GetPropertyType" />
2106 <field type="CARD32" name="long_offset" />
2107 <field type="CARD32" name="long_length" />
2109 <field type="CARD8" name="format" />
2110 <field type="ATOM" name="type" />
2111 <field type="CARD32" name="bytes_after" />
2112 <field type="CARD32" name="value_len" />
2114 <list type="void" name="value">
2116 <fieldref>value_len</fieldref>
2118 <fieldref>format</fieldref>
2124 <field name="format"><![CDATA[
2125 Specifies whether the data should be viewed as a list of 8-bit, 16-bit, or
2126 32-bit quantities. Possible values are 8, 16, and 32. This information allows
2127 the X server to correctly perform byte-swap operations as necessary.
2129 <field name="type"><![CDATA[
2130 The actual type of the property (an atom).
2132 <field name="bytes_after"><![CDATA[
2133 The number of bytes remaining to be read in the property if a partial read was
2136 <field name="value_len"><![CDATA[
2137 The length of value. You should use the corresponding accessor instead of this
2143 <brief>Gets a window property</brief>
2144 <description><![CDATA[
2145 Gets the specified `property` from the specified `window`. Properties are for
2146 example the window title (`WM_NAME`) or its minimum size (`WM_NORMAL_HINTS`).
2147 Protocols such as EWMH also use properties - for example EWMH defines the
2148 window title, encoded as UTF-8 string, in the `_NET_WM_NAME` property.
2150 TODO: talk about `type`
2152 TODO: talk about `delete`
2154 TODO: talk about the offset/length thing. what's a valid use case?
2158 * Prints the WM_NAME property of the window.
2161 void my_example(xcb_connection *c, xcb_window_t window) {
2162 xcb_get_property_cookie_t cookie;
2163 xcb_get_property_reply_t *reply;
2165 /* These atoms are predefined in the X11 protocol. */
2166 xcb_atom_t property = XCB_ATOM_WM_NAME;
2167 xcb_atom_t type = XCB_ATOM_STRING;
2169 // TODO: a reasonable long_length for WM_NAME?
2170 cookie = xcb_get_property(c, 0, window, property, type, 0, 0);
2171 if ((reply = xcb_get_property_reply(c, cookie, NULL))) {
2172 int len = xcb_get_property_value_length(reply);
2178 printf("WM_NAME is %.*s\\n", len,
2179 (char*)xcb_get_property_value(reply));
2184 <field name="window"><![CDATA[
2185 The window whose property you want to get.
2187 <field name="delete"><![CDATA[
2188 Whether the property should actually be deleted. For deleting a property, the
2189 specified `type` has to match the actual property type.
2191 <field name="property"><![CDATA[
2192 The property you want to get (an atom).
2194 <field name="type"><![CDATA[
2195 The type of the property you want to get (an atom).
2197 <field name="long_offset"><![CDATA[
2198 Specifies the offset (in 32-bit multiples) in the specified property where the
2199 data is to be retrieved.
2201 <field name="long_length"><![CDATA[
2202 Specifies how many 32-bit multiples of data should be retrieved (e.g. if you
2203 set `long_length` to 4, you will receive 16 bytes of data).
2205 <error type="Window"><![CDATA[
2206 The specified `window` does not exist.
2208 <error type="Atom"><![CDATA[
2209 `property` or `type` do not refer to a valid atom.
2211 <error type="Value"><![CDATA[
2212 The specified `long_offset` is beyond the actual property length (e.g. the
2213 property has a length of 3 bytes and you are setting `long_offset` to 1,
2214 resulting in a byte offset of 4).
2216 <see type="request" name="InternAtom" />
2217 <see type="program" name="xprop" />
2221 <request name="ListProperties" opcode="21">
2223 <field type="WINDOW" name="window" />
2226 <field type="CARD16" name="atoms_len" />
2228 <list type="ATOM" name="atoms">
2229 <fieldref>atoms_len</fieldref>
2234 <request name="SetSelectionOwner" opcode="22">
2236 <field type="WINDOW" name="owner" altenum="Window" />
2237 <field type="ATOM" name="selection" />
2238 <field type="TIMESTAMP" name="time" altenum="Time" />
2240 <brief>Sets the owner of a selection</brief>
2241 <description><![CDATA[
2242 Makes `window` the owner of the selection `selection` and updates the
2243 last-change time of the specified selection.
2245 TODO: briefly explain what a selection is.
2247 <field name="selection"><![CDATA[
2250 <field name="owner"><![CDATA[
2251 The new owner of the selection.
2253 The special value `XCB_NONE` means that the selection will have no owner.
2255 <field name="time"><![CDATA[
2256 Timestamp to avoid race conditions when running X over the network.
2258 The selection will not be changed if `time` is earlier than the current
2259 last-change time of the `selection` or is later than the current X server time.
2260 Otherwise, the last-change time is set to the specified time.
2262 The special value `XCB_CURRENT_TIME` will be replaced with the current server
2265 <error type="Atom"><![CDATA[
2266 `selection` does not refer to a valid atom.
2268 <see type="request" name="SetSelectionOwner" />
2273 <request name="GetSelectionOwner" opcode="23">
2275 <field type="ATOM" name="selection" />
2278 <field type="WINDOW" name="owner" altenum="Window" />
2280 <field name="owner"><![CDATA[
2281 The current selection owner window.
2286 <brief>Gets the owner of a selection</brief>
2287 <description><![CDATA[
2288 Gets the owner of the specified selection.
2290 TODO: briefly explain what a selection is.
2292 <field name="selection"><![CDATA[
2295 <error type="Atom"><![CDATA[
2296 `selection` does not refer to a valid atom.
2298 <see type="request" name="SetSelectionOwner" />
2302 <request name="ConvertSelection" opcode="24">
2304 <field type="WINDOW" name="requestor" />
2305 <field type="ATOM" name="selection" />
2306 <field type="ATOM" name="target" />
2307 <field type="ATOM" name="property" altenum="Atom" />
2308 <field type="TIMESTAMP" name="time" altenum="Time" />
2311 <enum name="SendEventDest">
2312 <item name="PointerWindow"><value>0</value></item>
2313 <item name="ItemFocus"> <value>1</value></item>
2316 <request name="SendEvent" opcode="25">
2317 <field type="BOOL" name="propagate" />
2318 <field type="WINDOW" name="destination" altenum="SendEventDest" />
2319 <field type="CARD32" name="event_mask" mask="EventMask" />
2320 <list type="char" name="event"><value>32</value></list>
2322 <brief>send an event</brief>
2323 <description><![CDATA[
2324 Identifies the `destination` window, determines which clients should receive
2325 the specified event and ignores any active grabs.
2327 The `event` must be one of the core events or an event defined by an extension,
2328 so that the X server can correctly byte-swap the contents as necessary. The
2329 contents of `event` are otherwise unaltered and unchecked except for the
2330 `send_event` field which is forced to 'true'.
2334 * Tell the given window that it was configured to a size of 800x600 pixels.
2337 void my_example(xcb_connection_t *conn, xcb_window_t window) {
2338 /* Every X11 event is 32 bytes long. Therefore, XCB will copy 32 bytes.
2339 * In order to properly initialize these bytes, we allocate 32 bytes even
2340 * though we only need less for an xcb_configure_notify_event_t */
2341 xcb_configure_notify_event_t *event = calloc(32, 1);
2343 event->event = window;
2344 event->window = window;
2345 event->response_type = XCB_CONFIGURE_NOTIFY;
2350 event->height = 600;
2352 event->border_width = 0;
2353 event->above_sibling = XCB_NONE;
2354 event->override_redirect = false;
2356 xcb_send_event(conn, false, window, XCB_EVENT_MASK_STRUCTURE_NOTIFY,
2362 <field name="destination"><![CDATA[
2363 The window to send this event to. Every client which selects any event within
2364 `event_mask` on `destination` will get the event.
2366 The special value `XCB_SEND_EVENT_DEST_POINTER_WINDOW` refers to the window
2367 that contains the mouse pointer.
2369 The special value `XCB_SEND_EVENT_DEST_ITEM_FOCUS` refers to the window which
2370 has the keyboard focus.
2372 <field name="event_mask"><![CDATA[
2373 Event_mask for determining which clients should receive the specified event.
2374 See `destination` and `propagate`.
2376 <field name="propagate"><![CDATA[
2377 If `propagate` is true and no clients have selected any event on `destination`,
2378 the destination is replaced with the closest ancestor of `destination` for
2379 which some client has selected a type in `event_mask` and for which no
2380 intervening window has that type in its do-not-propagate-mask. If no such
2381 window exists or if the window is an ancestor of the focus window and
2382 `InputFocus` was originally specified as the destination, the event is not sent
2383 to any clients. Otherwise, the event is reported to every client selecting on
2384 the final destination any of the types specified in `event_mask`.
2386 <field name="event"><![CDATA[
2387 The event to send to the specified `destination`.
2389 <error type="Window"><![CDATA[
2390 The specified `destination` window does not exist.
2392 <error type="Value"><![CDATA[
2393 The given `event` is neither a core event nor an event defined by an extension.
2395 <see type="event" name="ConfigureNotify" />
2399 <enum name="GrabMode">
2400 <item name="Sync"> <value>0</value></item>
2401 <item name="Async"><value>1</value></item>
2403 <field name="Sync"><![CDATA[
2404 The state of the keyboard appears to freeze: No further keyboard events are
2405 generated by the server until the grabbing client issues a releasing
2406 `AllowEvents` request or until the keyboard grab is released.
2408 <field name="Async"><![CDATA[
2409 Keyboard event processing continues normally.
2414 <enum name="GrabStatus">
2415 <item name="Success"> <value>0</value></item>
2416 <item name="AlreadyGrabbed"><value>1</value></item>
2417 <item name="InvalidTime"> <value>2</value></item>
2418 <item name="NotViewable"> <value>3</value></item>
2419 <item name="Frozen"> <value>4</value></item>
2422 <enum name="Cursor">
2423 <item name="None"> <value>0</value></item>
2426 <request name="GrabPointer" opcode="26">
2427 <field type="BOOL" name="owner_events" />
2428 <field type="WINDOW" name="grab_window" />
2429 <field type="CARD16" name="event_mask" mask="EventMask" />
2430 <field type="BYTE" name="pointer_mode" enum="GrabMode" />
2431 <field type="BYTE" name="keyboard_mode" enum="GrabMode" />
2432 <field type="WINDOW" name="confine_to" altenum="Window" />
2433 <field type="CURSOR" name="cursor" altenum="Cursor" />
2434 <field type="TIMESTAMP" name="time" altenum="Time" />
2436 <field type="BYTE" name="status" enum="GrabStatus" />
2439 <brief>Grab the pointer</brief>
2440 <description><![CDATA[
2441 Actively grabs control of the pointer. Further pointer events are reported only to the grabbing client. Overrides any active pointer grab by this client.
2446 * Grabs the pointer actively
2449 void my_example(xcb_connection *conn, xcb_screen_t *screen, xcb_cursor_t cursor) {
2450 xcb_grab_pointer_cookie_t cookie;
2451 xcb_grab_pointer_reply_t *reply;
2453 cookie = xcb_grab_pointer(
2455 false, /* get all pointer events specified by the following mask */
2456 screen->root, /* grab the root window */
2457 XCB_NONE, /* which events to let through */
2458 XCB_GRAB_MODE_ASYNC, /* pointer events should continue as normal */
2459 XCB_GRAB_MODE_ASYNC, /* keyboard mode */
2460 XCB_NONE, /* confine_to = in which window should the cursor stay */
2461 cursor, /* we change the cursor to whatever the user wanted */
2465 if ((reply = xcb_grab_pointer_reply(conn, cookie, NULL))) {
2466 if (reply->status == XCB_GRAB_STATUS_SUCCESS)
2467 printf("successfully grabbed the pointer\\n");
2472 <field name="event_mask"><![CDATA[
2473 Specifies which pointer events are reported to the client.
2477 <field name="confine_to"><![CDATA[
2478 Specifies the window to confine the pointer in (the user will not be able to
2479 move the pointer out of that window).
2481 The special value `XCB_NONE` means don't confine the pointer.
2483 <field name="cursor"><![CDATA[
2484 Specifies the cursor that should be displayed or `XCB_NONE` to not change the
2487 <field name="owner_events"><![CDATA[
2488 If 1, the `grab_window` will still get the pointer events. If 0, events are not
2489 reported to the `grab_window`.
2491 <field name="grab_window"><![CDATA[
2492 Specifies the window on which the pointer should be grabbed.
2494 <field name="time"><![CDATA[
2495 The time argument allows you to avoid certain circumstances that come up if
2496 applications take a long time to respond or if there are long network delays.
2497 Consider a situation where you have two applications, both of which normally
2498 grab the pointer when clicked on. If both applications specify the timestamp
2499 from the event, the second application may wake up faster and successfully grab
2500 the pointer before the first application. The first application then will get
2501 an indication that the other application grabbed the pointer before its request
2504 The special value `XCB_CURRENT_TIME` will be replaced with the current server
2507 <!-- the enum doc is sufficient. -->
2508 <field name="pointer_mode" />
2509 <field name="keyboard_mode" />
2510 <error type="Value"><![CDATA[
2513 <error type="Window"><![CDATA[
2514 The specified `window` does not exist.
2517 <see type="request" name="GrabKeyboard" />
2521 <request name="UngrabPointer" opcode="27">
2523 <field type="TIMESTAMP" name="time" altenum="Time" />
2525 <brief>release the pointer</brief>
2526 <description><![CDATA[
2527 Releases the pointer and any queued events if you actively grabbed the pointer
2528 before using `xcb_grab_pointer`, `xcb_grab_button` or within a normal button
2531 EnterNotify and LeaveNotify events are generated.
2533 <field name="time"><![CDATA[
2534 Timestamp to avoid race conditions when running X over the network.
2536 The pointer will not be released if `time` is earlier than the
2537 last-pointer-grab time or later than the current X server time.
2539 <field name="name_len"><![CDATA[
2540 Length (in bytes) of `name`.
2542 <field name="name"><![CDATA[
2543 A pattern describing an X core font.
2545 <see type="request" name="GrabPointer" />
2546 <see type="request" name="GrabButton" />
2547 <see type="event" name="EnterNotify" />
2548 <see type="event" name="LeaveNotify" />
2552 <enum name="ButtonIndex">
2553 <item name="Any"><value>0</value></item>
2554 <item name="1"> <value>1</value></item>
2555 <item name="2"> <value>2</value></item>
2556 <item name="3"> <value>3</value></item>
2557 <item name="4"> <value>4</value></item>
2558 <item name="5"> <value>5</value></item>
2560 <field name="Any"><![CDATA[
2561 Any of the following (or none):
2563 <field name="1"><![CDATA[
2564 The left mouse button.
2566 <field name="2"><![CDATA[
2567 The right mouse button.
2569 <field name="3"><![CDATA[
2570 The middle mouse button.
2572 <field name="4"><![CDATA[
2573 Scroll wheel. TODO: direction?
2575 <field name="5"><![CDATA[
2576 Scroll wheel. TODO: direction?
2581 <request name="GrabButton" opcode="28">
2582 <field type="BOOL" name="owner_events" />
2583 <field type="WINDOW" name="grab_window" />
2584 <field type="CARD16" name="event_mask" mask="EventMask" />
2585 <field type="CARD8" name="pointer_mode" enum="GrabMode" />
2586 <field type="CARD8" name="keyboard_mode" enum="GrabMode" />
2587 <field type="WINDOW" name="confine_to" altenum="Window" />
2588 <field type="CURSOR" name="cursor" altenum="Cursor" />
2589 <field type="CARD8" name="button" enum="ButtonIndex" />
2591 <field type="CARD16" name="modifiers" mask="ModMask" />
2593 <brief>Grab pointer button(s)</brief>
2594 <description><![CDATA[
2595 This request establishes a passive grab. The pointer is actively grabbed as
2596 described in GrabPointer, the last-pointer-grab time is set to the time at
2597 which the button was pressed (as transmitted in the ButtonPress event), and the
2598 ButtonPress event is reported if all of the following conditions are true:
2600 The pointer is not grabbed and the specified button is logically pressed when
2601 the specified modifier keys are logically down, and no other buttons or
2602 modifier keys are logically down.
2604 The grab-window contains the pointer.
2606 The confine-to window (if any) is viewable.
2608 A passive grab on the same button/key combination does not exist on any
2609 ancestor of grab-window.
2611 The interpretation of the remaining arguments is the same as for GrabPointer.
2612 The active grab is terminated automatically when the logical state of the
2613 pointer has all buttons released, independent of the logical state of modifier
2614 keys. Note that the logical state of a device (as seen by means of the
2615 protocol) may lag the physical state if device event processing is frozen. This
2616 request overrides all previous passive grabs by the same client on the same
2617 button/key combinations on the same window. A modifier of AnyModifier is
2618 equivalent to issuing the request for all possible modifier combinations
2619 (including the combination of no modifiers). It is not required that all
2620 specified modifiers have currently assigned keycodes. A button of AnyButton is
2621 equivalent to issuing the request for all possible buttons. Otherwise, it is
2622 not required that the button specified currently be assigned to a physical
2625 An Access error is generated if some other client has already issued a
2626 GrabButton request with the same button/key combination on the same window.
2627 When using AnyModifier or AnyButton, the request fails completely (no grabs are
2628 established), and an Access error is generated if there is a conflicting grab
2629 for any combination. The request has no effect on an active grab.
2632 <field name="owner_events"><![CDATA[
2633 If 1, the `grab_window` will still get the pointer events. If 0, events are not
2634 reported to the `grab_window`.
2636 <field name="grab_window"><![CDATA[
2637 Specifies the window on which the pointer should be grabbed.
2639 <field name="event_mask"><![CDATA[
2640 Specifies which pointer events are reported to the client.
2644 <field name="confine_to"><![CDATA[
2645 Specifies the window to confine the pointer in (the user will not be able to
2646 move the pointer out of that window).
2648 The special value `XCB_NONE` means don't confine the pointer.
2650 <field name="cursor"><![CDATA[
2651 Specifies the cursor that should be displayed or `XCB_NONE` to not change the
2654 <field name="modifiers"><![CDATA[
2655 The modifiers to grab.
2657 Using the special value `XCB_MOD_MASK_ANY` means grab the pointer with all
2658 possible modifier combinations.
2660 <!-- the enum doc is sufficient. -->
2661 <field name="pointer_mode" />
2662 <field name="keyboard_mode" />
2663 <field name="button" />
2664 <error type="Access"><![CDATA[
2665 Another client has already issued a GrabButton with the same button/key
2666 combination on the same window.
2668 <error type="Value"><![CDATA[
2671 <error type="Cursor"><![CDATA[
2672 The specified `cursor` does not exist.
2674 <error type="Window"><![CDATA[
2675 The specified `window` does not exist.
2680 <request name="UngrabButton" opcode="29">
2681 <field type="CARD8" name="button" enum="ButtonIndex" />
2682 <field type="WINDOW" name="grab_window" />
2683 <field type="CARD16" name="modifiers" mask="ModMask" />
2687 <request name="ChangeActivePointerGrab" opcode="30">
2689 <field type="CURSOR" name="cursor" altenum="Cursor" />
2690 <field type="TIMESTAMP" name="time" altenum="Time" />
2691 <field type="CARD16" name="event_mask" mask="EventMask" />
2695 <request name="GrabKeyboard" opcode="31">
2696 <field type="BOOL" name="owner_events" />
2697 <field type="WINDOW" name="grab_window" />
2698 <field type="TIMESTAMP" name="time" altenum="Time" />
2699 <field type="BYTE" name="pointer_mode" enum="GrabMode" />
2700 <field type="BYTE" name="keyboard_mode" enum="GrabMode" />
2703 <field type="BYTE" name="status" enum="GrabStatus" />
2706 <brief>Grab the keyboard</brief>
2707 <description><![CDATA[
2708 Actively grabs control of the keyboard and generates FocusIn and FocusOut
2709 events. Further key events are reported only to the grabbing client.
2711 Any active keyboard grab by this client is overridden. If the keyboard is
2712 actively grabbed by some other client, `AlreadyGrabbed` is returned. If
2713 `grab_window` is not viewable, `GrabNotViewable` is returned. If the keyboard
2714 is frozen by an active grab of another client, `GrabFrozen` is returned. If the
2715 specified `time` is earlier than the last-keyboard-grab time or later than the
2716 current X server time, `GrabInvalidTime` is returned. Otherwise, the
2717 last-keyboard-grab time is set to the specified time.
2721 * Grabs the keyboard actively
2724 void my_example(xcb_connection *conn, xcb_screen_t *screen) {
2725 xcb_grab_keyboard_cookie_t cookie;
2726 xcb_grab_keyboard_reply_t *reply;
2728 cookie = xcb_grab_keyboard(
2730 true, /* report events */
2731 screen->root, /* grab the root window */
2733 XCB_GRAB_MODE_ASYNC, /* process events as normal, do not require sync */
2737 if ((reply = xcb_grab_keyboard_reply(conn, cookie, NULL))) {
2738 if (reply->status == XCB_GRAB_STATUS_SUCCESS)
2739 printf("successfully grabbed the keyboard\\n");
2745 <field name="owner_events"><![CDATA[
2746 If 1, the `grab_window` will still get the pointer events. If 0, events are not
2747 reported to the `grab_window`.
2749 <field name="grab_window"><![CDATA[
2750 Specifies the window on which the pointer should be grabbed.
2752 <field name="time"><![CDATA[
2753 Timestamp to avoid race conditions when running X over the network.
2755 The special value `XCB_CURRENT_TIME` will be replaced with the current server
2758 <!-- the enum doc is sufficient. -->
2759 <field name="pointer_mode" />
2760 <field name="keyboard_mode" />
2761 <error type="Value"><![CDATA[
2764 <error type="Window"><![CDATA[
2765 The specified `window` does not exist.
2767 <see type="request" name="GrabPointer" />
2771 <request name="UngrabKeyboard" opcode="32">
2773 <field type="TIMESTAMP" name="time" altenum="Time" />
2776 <!-- Use KEYCODE any = { XCBGrabAny }; to grab any key -->
2778 <item name="Any"><value>0</value></item>
2781 <request name="GrabKey" opcode="33">
2782 <field type="BOOL" name="owner_events" />
2783 <field type="WINDOW" name="grab_window" />
2784 <field type="CARD16" name="modifiers" mask="ModMask" />
2785 <field type="KEYCODE" name="key" altenum="Grab" />
2786 <field type="CARD8" name="pointer_mode" enum="GrabMode" />
2787 <field type="CARD8" name="keyboard_mode" enum="GrabMode" />
2790 <brief>Grab keyboard key(s)</brief>
2791 <description><![CDATA[
2792 Establishes a passive grab on the keyboard. In the future, the keyboard is
2793 actively grabbed (as for `GrabKeyboard`), the last-keyboard-grab time is set to
2794 the time at which the key was pressed (as transmitted in the KeyPress event),
2795 and the KeyPress event is reported if all of the following conditions are true:
2797 The keyboard is not grabbed and the specified key (which can itself be a
2798 modifier key) is logically pressed when the specified modifier keys are
2799 logically down, and no other modifier keys are logically down.
2801 Either the grab_window is an ancestor of (or is) the focus window, or the
2802 grab_window is a descendant of the focus window and contains the pointer.
2804 A passive grab on the same key combination does not exist on any ancestor of
2807 The interpretation of the remaining arguments is as for XGrabKeyboard. The active grab is terminated
2808 automatically when the logical state of the keyboard has the specified key released (independent of the
2809 logical state of the modifier keys), at which point a KeyRelease event is reported to the grabbing window.
2811 Note that the logical state of a device (as seen by client applications) may lag the physical state if
2812 device event processing is frozen.
2814 A modifiers argument of AnyModifier is equivalent to issuing the request for all possible modifier combinations (including the combination of no modifiers). It is not required that all modifiers specified
2815 have currently assigned KeyCodes. A keycode argument of AnyKey is equivalent to issuing the request for
2816 all possible KeyCodes. Otherwise, the specified keycode must be in the range specified by min_keycode
2817 and max_keycode in the connection setup, or a BadValue error results.
2819 If some other client has issued a XGrabKey with the same key combination on the same window, a BadAccess
2820 error results. When using AnyModifier or AnyKey, the request fails completely, and a BadAccess error
2821 results (no grabs are established) if there is a conflicting grab for any combination.
2824 <field name="owner_events"><![CDATA[
2825 If 1, the `grab_window` will still get the pointer events. If 0, events are not
2826 reported to the `grab_window`.
2828 <field name="grab_window"><![CDATA[
2829 Specifies the window on which the pointer should be grabbed.
2831 <field name="key"><![CDATA[
2832 The keycode of the key to grab.
2834 The special value `XCB_GRAB_ANY` means grab any key.
2836 <field name="cursor"><![CDATA[
2837 Specifies the cursor that should be displayed or `XCB_NONE` to not change the
2840 <field name="modifiers"><![CDATA[
2841 The modifiers to grab.
2843 Using the special value `XCB_MOD_MASK_ANY` means grab the pointer with all
2844 possible modifier combinations.
2846 <!-- the enum doc is sufficient. -->
2847 <field name="pointer_mode" />
2848 <field name="keyboard_mode" />
2849 <error type="Access"><![CDATA[
2850 Another client has already issued a GrabKey with the same button/key
2851 combination on the same window.
2853 <error type="Value"><![CDATA[
2856 <error type="Window"><![CDATA[
2857 The specified `window` does not exist.
2859 <see type="request" name="GrabKeyboard" />
2863 <request name="UngrabKey" opcode="34">
2864 <field type="KEYCODE" name="key" altenum="Grab" />
2865 <field type="WINDOW" name="grab_window" />
2866 <field type="CARD16" name="modifiers" mask="ModMask" />
2869 <brief>release a key combination</brief>
2870 <description><![CDATA[
2871 Releases the key combination on `grab_window` if you grabbed it using
2872 `xcb_grab_key` before.
2874 <field name="key"><![CDATA[
2875 The keycode of the specified key combination.
2877 Using the special value `XCB_GRAB_ANY` means releasing all possible key codes.
2879 <field name="grab_window"><![CDATA[
2880 The window on which the grabbed key combination will be released.
2882 <field name="modifiers"><![CDATA[
2883 The modifiers of the specified key combination.
2885 Using the special value `XCB_MOD_MASK_ANY` means releasing the key combination
2886 with every possible modifier combination.
2888 <error type="Window"><![CDATA[
2889 The specified `grab_window` does not exist.
2891 <error type="Value"><![CDATA[
2894 <see type="request" name="GrabKey" />
2895 <see type="program" name="xev" />
2900 <item name="AsyncPointer"> <value>0</value></item>
2901 <item name="SyncPointer"> <value>1</value></item>
2902 <item name="ReplayPointer"> <value>2</value></item>
2903 <item name="AsyncKeyboard"> <value>3</value></item>
2904 <item name="SyncKeyboard"> <value>4</value></item>
2905 <item name="ReplayKeyboard"><value>5</value></item>
2906 <item name="AsyncBoth"> <value>6</value></item>
2907 <item name="SyncBoth"> <value>7</value></item>
2909 <field name="AsyncPointer"><![CDATA[
2910 For AsyncPointer, if the pointer is frozen by the client, pointer event
2911 processing continues normally. If the pointer is frozen twice by the client on
2912 behalf of two separate grabs, AsyncPointer thaws for both. AsyncPointer has no
2913 effect if the pointer is not frozen by the client, but the pointer need not be
2914 grabbed by the client.
2916 TODO: rewrite this in more understandable terms.
2918 <field name="SyncPointer"><![CDATA[
2919 For SyncPointer, if the pointer is frozen and actively grabbed by the client,
2920 pointer event processing continues normally until the next ButtonPress or
2921 ButtonRelease event is reported to the client, at which time the pointer again
2922 appears to freeze. However, if the reported event causes the pointer grab to be
2923 released, then the pointer does not freeze. SyncPointer has no effect if the
2924 pointer is not frozen by the client or if the pointer is not grabbed by the
2927 <field name="ReplayPointer"><![CDATA[
2928 For ReplayPointer, if the pointer is actively grabbed by the client and is
2929 frozen as the result of an event having been sent to the client (either from
2930 the activation of a GrabButton or from a previous AllowEvents with mode
2931 SyncPointer but not from a GrabPointer), then the pointer grab is released and
2932 that event is completely reprocessed, this time ignoring any passive grabs at
2933 or above (towards the root) the grab-window of the grab just released. The
2934 request has no effect if the pointer is not grabbed by the client or if the
2935 pointer is not frozen as the result of an event.
2937 <field name="AsyncKeyboard"><![CDATA[
2938 For AsyncKeyboard, if the keyboard is frozen by the client, keyboard event
2939 processing continues normally. If the keyboard is frozen twice by the client on
2940 behalf of two separate grabs, AsyncKeyboard thaws for both. AsyncKeyboard has
2941 no effect if the keyboard is not frozen by the client, but the keyboard need
2942 not be grabbed by the client.
2944 <field name="SyncKeyboard"><![CDATA[
2945 For SyncKeyboard, if the keyboard is frozen and actively grabbed by the client,
2946 keyboard event processing continues normally until the next KeyPress or
2947 KeyRelease event is reported to the client, at which time the keyboard again
2948 appears to freeze. However, if the reported event causes the keyboard grab to
2949 be released, then the keyboard does not freeze. SyncKeyboard has no effect if
2950 the keyboard is not frozen by the client or if the keyboard is not grabbed by
2953 <field name="ReplayKeyboard"><![CDATA[
2954 For ReplayKeyboard, if the keyboard is actively grabbed by the client and is
2955 frozen as the result of an event having been sent to the client (either from
2956 the activation of a GrabKey or from a previous AllowEvents with mode
2957 SyncKeyboard but not from a GrabKeyboard), then the keyboard grab is released
2958 and that event is completely reprocessed, this time ignoring any passive grabs
2959 at or above (towards the root) the grab-window of the grab just released. The
2960 request has no effect if the keyboard is not grabbed by the client or if the
2961 keyboard is not frozen as the result of an event.
2963 <field name="SyncBoth"><![CDATA[
2964 For SyncBoth, if both pointer and keyboard are frozen by the client, event
2965 processing (for both devices) continues normally until the next ButtonPress,
2966 ButtonRelease, KeyPress, or KeyRelease event is reported to the client for a
2967 grabbed device (button event for the pointer, key event for the keyboard), at
2968 which time the devices again appear to freeze. However, if the reported event
2969 causes the grab to be released, then the devices do not freeze (but if the
2970 other device is still grabbed, then a subsequent event for it will still cause
2971 both devices to freeze). SyncBoth has no effect unless both pointer and
2972 keyboard are frozen by the client. If the pointer or keyboard is frozen twice
2973 by the client on behalf of two separate grabs, SyncBoth thaws for both (but a
2974 subsequent freeze for SyncBoth will only freeze each device once).
2976 <field name="AsyncBoth"><![CDATA[
2977 For AsyncBoth, if the pointer and the keyboard are frozen by the client, event
2978 processing for both devices continues normally. If a device is frozen twice by
2979 the client on behalf of two separate grabs, AsyncBoth thaws for both. AsyncBoth
2980 has no effect unless both pointer and keyboard are frozen by the client.
2985 <request name="AllowEvents" opcode="35">
2986 <field type="CARD8" name="mode" enum="Allow" />
2987 <field type="TIMESTAMP" name="time" altenum="Time" />
2989 <brief>release queued events</brief>
2990 <description><![CDATA[
2991 Releases queued events if the client has caused a device (pointer/keyboard) to
2992 freeze due to grabbing it actively. This request has no effect if `time` is
2993 earlier than the last-grab time of the most recent active grab for this client
2994 or if `time` is later than the current X server time.
2996 <!-- the enum doc is sufficient. -->
2997 <field name="mode" />
2998 <field name="time"><![CDATA[
2999 Timestamp to avoid race conditions when running X over the network.
3001 The special value `XCB_CURRENT_TIME` will be replaced with the current server
3004 <error type="Value"><![CDATA[
3005 You specified an invalid `mode`.
3010 <request name="GrabServer" opcode="36" />
3012 <request name="UngrabServer" opcode="37" />
3014 <request name="QueryPointer" opcode="38">
3016 <field type="WINDOW" name="window" />
3018 <field type="BOOL" name="same_screen" />
3019 <field type="WINDOW" name="root" />
3020 <field type="WINDOW" name="child" altenum="Window" />
3021 <field type="INT16" name="root_x" />
3022 <field type="INT16" name="root_y" />
3023 <field type="INT16" name="win_x" />
3024 <field type="INT16" name="win_y" />
3025 <field type="CARD16" name="mask" mask="KeyButMask" />
3028 <field name="same_screen"><![CDATA[
3029 If `same_screen` is False, then the pointer is not on the same screen as the
3030 argument window, `child` is None, and `win_x` and `win_y` are zero. If
3031 `same_screen` is True, then `win_x` and `win_y` are the pointer coordinates
3032 relative to the argument window's origin, and child is the child containing the
3035 <field name="root"><![CDATA[
3036 The root window the pointer is logically on.
3038 <field name="child"><![CDATA[
3039 The child window containing the pointer, if any, if `same_screen` is true. If
3040 `same_screen` is false, `XCB_NONE` is returned.
3042 <field name="root_x"><![CDATA[
3043 The pointer X position, relative to `root`.
3045 <field name="root_y"><![CDATA[
3046 The pointer Y position, relative to `root`.
3048 <field name="win_x"><![CDATA[
3049 The pointer X coordinate, relative to `child`, if `same_screen` is true. Zero
3052 <field name="win_y"><![CDATA[
3053 The pointer Y coordinate, relative to `child`, if `same_screen` is true. Zero
3056 <field name="mask"><![CDATA[
3057 The current logical state of the modifier keys and the buttons. Note that the
3058 logical state of a device (as seen by means of the protocol) may lag the
3059 physical state if device event processing is frozen.
3064 <brief>get pointer coordinates</brief>
3065 <description><![CDATA[
3066 Gets the root window the pointer is logically on and the pointer coordinates
3067 relative to the root window's origin.
3069 <field name="window"><![CDATA[
3070 A window to check if the pointer is on the same screen as `window` (see the
3071 `same_screen` field in the reply).
3073 <error type="Window"><![CDATA[
3074 The specified `window` does not exist.
3079 <struct name="TIMECOORD">
3080 <field type="TIMESTAMP" name="time" />
3081 <field type="INT16" name="x" />
3082 <field type="INT16" name="y" />
3085 <request name="GetMotionEvents" opcode="39">
3087 <field type="WINDOW" name="window" />
3088 <field type="TIMESTAMP" name="start" altenum="Time" />
3089 <field type="TIMESTAMP" name="stop" altenum="Time" />
3092 <field type="CARD32" name="events_len" />
3094 <list type="TIMECOORD" name="events">
3095 <fieldref>events_len</fieldref>
3100 <request name="TranslateCoordinates" opcode="40">
3102 <field type="WINDOW" name="src_window" />
3103 <field type="WINDOW" name="dst_window" />
3104 <field type="INT16" name="src_x" />
3105 <field type="INT16" name="src_y" />
3107 <field type="BOOL" name="same_screen" />
3108 <field type="WINDOW" name="child" altenum="Window" />
3109 <field type="INT16" name="dst_x" />
3110 <field type="INT16" name="dst_y" />
3114 <request name="WarpPointer" opcode="41">
3116 <field type="WINDOW" name="src_window" altenum="Window" />
3117 <field type="WINDOW" name="dst_window" altenum="Window" />
3118 <field type="INT16" name="src_x" />
3119 <field type="INT16" name="src_y" />
3120 <field type="CARD16" name="src_width" />
3121 <field type="CARD16" name="src_height" />
3122 <field type="INT16" name="dst_x" />
3123 <field type="INT16" name="dst_y" />
3125 <brief>move mouse pointer</brief>
3126 <description><![CDATA[
3127 Moves the mouse pointer to the specified position.
3129 If `src_window` is not `XCB_NONE` (TODO), the move will only take place if the
3130 pointer is inside `src_window` and within the rectangle specified by (`src_x`,
3131 `src_y`, `src_width`, `src_height`). The rectangle coordinates are relative to
3134 If `dst_window` is not `XCB_NONE` (TODO), the pointer will be moved to the
3135 offsets (`dst_x`, `dst_y`) relative to `dst_window`. If `dst_window` is
3136 `XCB_NONE` (TODO), the pointer will be moved by the offsets (`dst_x`, `dst_y`)
3137 relative to the current position of the pointer.
3139 <field name="src_window"><![CDATA[
3140 If `src_window` is not `XCB_NONE` (TODO), the move will only take place if the
3141 pointer is inside `src_window` and within the rectangle specified by (`src_x`,
3142 `src_y`, `src_width`, `src_height`). The rectangle coordinates are relative to
3145 <field name="dst_window"><![CDATA[
3146 If `dst_window` is not `XCB_NONE` (TODO), the pointer will be moved to the
3147 offsets (`dst_x`, `dst_y`) relative to `dst_window`. If `dst_window` is
3148 `XCB_NONE` (TODO), the pointer will be moved by the offsets (`dst_x`, `dst_y`)
3149 relative to the current position of the pointer.
3151 <error type="Window"><![CDATA[
3154 <see type="request" name="SetInputFocus" />
3158 <!-- used for revert_to and focus -->
3159 <enum name="InputFocus">
3160 <item name="None"> <value>0</value></item>
3161 <item name="PointerRoot"><value>1</value></item>
3162 <item name="Parent"> <value>2</value></item> <!-- revert_to only -->
3163 <item name="FollowKeyboard"><value>3</value></item> <!-- xinput extension only -->
3165 <field name="None"><![CDATA[
3166 The focus reverts to `XCB_NONE`, so no window will have the input focus.
3168 <field name="PointerRoot"><![CDATA[
3169 The focus reverts to `XCB_POINTER_ROOT` respectively. When the focus reverts,
3170 FocusIn and FocusOut events are generated, but the last-focus-change time is
3173 <field name="Parent"><![CDATA[
3174 The focus reverts to the parent (or closest viewable ancestor) and the new
3175 revert_to value is `XCB_INPUT_FOCUS_NONE`.
3177 <field name="FollowKeyboard"><![CDATA[
3178 NOT YET DOCUMENTED. Only relevant for the xinput extension.
3183 <request name="SetInputFocus" opcode="42">
3184 <field type="CARD8" name="revert_to" enum="InputFocus" />
3185 <field type="WINDOW" name="focus" altenum="InputFocus" />
3186 <field type="TIMESTAMP" name="time" altenum="Time" />
3188 <brief>Sets input focus</brief>
3189 <description><![CDATA[
3190 Changes the input focus and the last-focus-change time. If the specified `time`
3191 is earlier than the current last-focus-change time, the request is ignored (to
3192 avoid race conditions when running X over the network).
3194 A FocusIn and FocusOut event is generated when focus is changed.
3196 <field name="focus"><![CDATA[
3197 The window to focus. All keyboard events will be reported to this window. The
3198 window must be viewable (TODO), or a `xcb_match_error_t` occurs (TODO).
3200 If `focus` is `XCB_NONE` (TODO), all keyboard events are
3201 discarded until a new focus window is set.
3203 If `focus` is `XCB_POINTER_ROOT` (TODO), focus is on the root window of the
3204 screen on which the pointer is on currently.
3206 <field name="time"><![CDATA[
3207 Timestamp to avoid race conditions when running X over the network.
3209 The special value `XCB_CURRENT_TIME` will be replaced with the current server
3212 <field name="revert_to"><![CDATA[
3213 Specifies what happens when the `focus` window becomes unviewable (if `focus`
3214 is neither `XCB_NONE` nor `XCB_POINTER_ROOT`).
3216 <error type="Window"><![CDATA[
3217 The specified `focus` window does not exist.
3219 <error type="Match"><![CDATA[
3220 The specified `focus` window is not viewable.
3222 <error type="Value"><![CDATA[
3225 <see type="event" name="FocusIn" />
3226 <see type="event" name="FocusOut" />
3231 <request name="GetInputFocus" opcode="43">
3233 <field type="CARD8" name="revert_to" enum="InputFocus" />
3234 <field type="WINDOW" name="focus" altenum="InputFocus" />
3238 <request name="QueryKeymap" opcode="44">
3241 <list type="CARD8" name="keys"><value>32</value></list>
3245 <request name="OpenFont" opcode="45">
3247 <field type="FONT" name="fid" />
3248 <field type="CARD16" name="name_len" />
3250 <list type="char" name="name">
3251 <fieldref>name_len</fieldref>
3254 <brief>opens a font</brief>
3255 <description><![CDATA[
3256 Opens any X core font matching the given `name` (for example "-misc-fixed-*").
3258 Note that X core fonts are deprecated (but still supported) in favor of
3259 client-side rendering using Xft.
3261 <field name="fid"><![CDATA[
3262 The ID with which you will refer to the font, created by `xcb_generate_id`.
3264 <field name="name_len"><![CDATA[
3265 Length (in bytes) of `name`.
3267 <field name="name"><![CDATA[
3268 A pattern describing an X core font.
3270 <error type="Name"><![CDATA[
3271 No font matches the given `name`.
3273 <see type="function" name="xcb_generate_id" />
3277 <request name="CloseFont" opcode="46">
3279 <field type="FONT" name="font" />
3282 <enum name="FontDraw">
3283 <item name="LeftToRight"><value>0</value></item>
3284 <item name="RightToLeft"><value>1</value></item>
3287 <struct name="FONTPROP">
3288 <field type="ATOM" name="name" />
3289 <field type="CARD32" name="value" />
3292 <struct name="CHARINFO">
3293 <field type="INT16" name="left_side_bearing" />
3294 <field type="INT16" name="right_side_bearing" />
3295 <field type="INT16" name="character_width" />
3296 <field type="INT16" name="ascent" />
3297 <field type="INT16" name="descent" />
3298 <field type="CARD16" name="attributes" />
3301 <request name="QueryFont" opcode="47">
3303 <field type="FONTABLE" name="font" />
3306 <field type="CHARINFO" name="min_bounds" />
3308 <field type="CHARINFO" name="max_bounds" />
3310 <field type="CARD16" name="min_char_or_byte2" />
3311 <field type="CARD16" name="max_char_or_byte2" />
3312 <field type="CARD16" name="default_char" />
3313 <field type="CARD16" name="properties_len" />
3314 <field type="BYTE" name="draw_direction" enum="FontDraw" />
3315 <field type="CARD8" name="min_byte1" />
3316 <field type="CARD8" name="max_byte1" />
3317 <field type="BOOL" name="all_chars_exist" />
3318 <field type="INT16" name="font_ascent" />
3319 <field type="INT16" name="font_descent" />
3320 <field type="CARD32" name="char_infos_len" />
3321 <list type="FONTPROP" name="properties">
3322 <fieldref>properties_len</fieldref>
3324 <list type="CHARINFO" name="char_infos">
3325 <fieldref>char_infos_len</fieldref>
3328 <field name="min_bounds"><![CDATA[
3329 minimum bounds over all existing char
3331 <field name="max_bounds"><![CDATA[
3332 maximum bounds over all existing char
3334 <field name="min_char_or_byte2"><![CDATA[
3337 <field name="max_char_or_byte2"><![CDATA[
3340 <field name="default_char"><![CDATA[
3341 char to print for undefined character
3343 <field name="properties_len"><![CDATA[
3344 how many properties there are
3346 <field name="all_chars_exist"><![CDATA[
3347 flag if all characters have nonzero size
3349 <field name="font_ascent"><![CDATA[
3350 baseline to top edge of raster
3352 <field name="font_descent"><![CDATA[
3353 baseline to bottom edge of raster
3355 <!-- enum doc is sufficient -->
3356 <field name="draw_direction" />
3360 <brief>query font metrics</brief>
3361 <description><![CDATA[
3362 Queries information associated with the font.
3364 <field name="font"><![CDATA[
3365 The fontable (Font or Graphics Context) to query.
3367 <!-- TODO: example -->
3371 <request name="QueryTextExtents" opcode="48">
3372 <exprfield type="BOOL" name="odd_length">
3373 <op op="&"><fieldref>string_len</fieldref><value>1</value></op>
3375 <field type="FONTABLE" name="font" />
3376 <list type="CHAR2B" name="string" />
3378 <field type="BYTE" name="draw_direction" enum="FontDraw" />
3379 <field type="INT16" name="font_ascent" />
3380 <field type="INT16" name="font_descent" />
3381 <field type="INT16" name="overall_ascent" />
3382 <field type="INT16" name="overall_descent" />
3383 <field type="INT32" name="overall_width" />
3384 <field type="INT32" name="overall_left" />
3385 <field type="INT32" name="overall_right" />
3388 <brief>get text extents</brief>
3389 <description><![CDATA[
3390 Query text extents from the X11 server. This request returns the bounding box
3391 of the specified 16-bit character string in the specified `font` or the font
3392 contained in the specified graphics context.
3394 `font_ascent` is set to the maximum of the ascent metrics of all characters in
3395 the string. `font_descent` is set to the maximum of the descent metrics.
3396 `overall_width` is set to the sum of the character-width metrics of all
3397 characters in the string. For each character in the string, let W be the sum of
3398 the character-width metrics of all characters preceding it in the string. Let L
3399 be the left-side-bearing metric of the character plus W. Let R be the
3400 right-side-bearing metric of the character plus W. The lbearing member is set
3401 to the minimum L of all characters in the string. The rbearing member is set to
3404 For fonts defined with linear indexing rather than 2-byte matrix indexing, each
3405 `xcb_char2b_t` structure is interpreted as a 16-bit number with byte1 as the
3406 most significant byte. If the font has no defined default character, undefined
3407 characters in the string are taken to have all zero metrics.
3409 Characters with all zero metrics are ignored. If the font has no defined
3410 default_char, the undefined characters in the string are also ignored.
3412 <field name="font"><![CDATA[
3413 The `font` to calculate text extents in. You can also pass a graphics context.
3415 <field name="string_len"><![CDATA[
3416 The number of characters in `string`.
3418 <field name="string"><![CDATA[
3419 The text to get text extents for.
3421 <error type="GContext"><![CDATA[
3422 The specified graphics context does not exist.
3424 <error type="Font"><![CDATA[
3425 The specified `font` does not exist.
3431 <field type="CARD8" name="name_len" />
3432 <list type="char" name="name">
3433 <fieldref>name_len</fieldref>
3437 <request name="ListFonts" opcode="49">
3439 <field type="CARD16" name="max_names" />
3440 <field type="CARD16" name="pattern_len" />
3441 <list type="char" name="pattern">
3442 <fieldref>pattern_len</fieldref>
3446 <field type="CARD16" name="names_len" />
3448 <list type="STR" name="names">
3449 <fieldref>names_len</fieldref>
3452 <field name="names_len"><![CDATA[
3453 The number of font names.
3458 <brief>get matching font names</brief>
3459 <description><![CDATA[
3460 Gets a list of available font names which match the given `pattern`.
3462 <field name="pattern_len"><![CDATA[
3463 The length (in bytes) of `pattern`.
3465 <field name="pattern"><![CDATA[
3466 A font pattern, for example "-misc-fixed-*".
3468 The asterisk (*) is a wildcard for any number of characters. The question mark
3469 (?) is a wildcard for a single character. Use of uppercase or lowercase does
3472 <field name="max_names"><![CDATA[
3473 The maximum number of fonts to be returned.
3478 <request name="ListFontsWithInfo" opcode="50">
3480 <field type="CARD16" name="max_names" />
3481 <field type="CARD16" name="pattern_len" />
3482 <list type="char" name="pattern">
3483 <fieldref>pattern_len</fieldref>
3486 <field type="CARD8" name="name_len" />
3487 <field type="CHARINFO" name="min_bounds" />
3489 <field type="CHARINFO" name="max_bounds" />
3491 <field type="CARD16" name="min_char_or_byte2" />
3492 <field type="CARD16" name="max_char_or_byte2" />
3493 <field type="CARD16" name="default_char" />
3494 <field type="CARD16" name="properties_len" />
3495 <field type="BYTE" name="draw_direction" enum="FontDraw" />
3496 <field type="CARD8" name="min_byte1" />
3497 <field type="CARD8" name="max_byte1" />
3498 <field type="BOOL" name="all_chars_exist" />
3499 <field type="INT16" name="font_ascent" />
3500 <field type="INT16" name="font_descent" />
3501 <field type="CARD32" name="replies_hint" />
3502 <list type="FONTPROP" name="properties">
3503 <fieldref>properties_len</fieldref>
3505 <list type="char" name="name">
3506 <fieldref>name_len</fieldref>
3509 <field name="name_len"><![CDATA[
3510 The number of matched font names.
3512 <field name="min_bounds"><![CDATA[
3513 minimum bounds over all existing char
3515 <field name="max_bounds"><![CDATA[
3516 maximum bounds over all existing char
3518 <field name="min_char_or_byte2"><![CDATA[
3521 <field name="max_char_or_byte2"><![CDATA[
3524 <field name="default_char"><![CDATA[
3525 char to print for undefined character
3527 <field name="properties_len"><![CDATA[
3528 how many properties there are
3530 <field name="all_chars_exist"><![CDATA[
3531 flag if all characters have nonzero size
3533 <field name="font_ascent"><![CDATA[
3534 baseline to top edge of raster
3536 <field name="font_descent"><![CDATA[
3537 baseline to bottom edge of raster
3539 <field name="replies_hint"><![CDATA[
3540 An indication of how many more fonts will be returned. This is only a hint and
3541 may be larger or smaller than the number of fonts actually returned. A zero
3542 value does not guarantee that no more fonts will be returned.
3544 <!-- enum doc is sufficient -->
3545 <field name="draw_direction" />
3549 <brief>get matching font names and information</brief>
3550 <description><![CDATA[
3551 Gets a list of available font names which match the given `pattern`.
3553 <field name="pattern_len"><![CDATA[
3554 The length (in bytes) of `pattern`.
3556 <field name="pattern"><![CDATA[
3557 A font pattern, for example "-misc-fixed-*".
3559 The asterisk (*) is a wildcard for any number of characters. The question mark
3560 (?) is a wildcard for a single character. Use of uppercase or lowercase does
3563 <field name="max_names"><![CDATA[
3564 The maximum number of fonts to be returned.
3570 <request name="SetFontPath" opcode="51">
3572 <field type="CARD16" name="font_qty" />
3574 <list type="STR" name="font">
3575 <fieldref>font_qty</fieldref>
3579 <request name="GetFontPath" opcode="52">
3582 <field type="CARD16" name="path_len" />
3584 <list type="STR" name="path">
3585 <fieldref>path_len</fieldref>
3590 <request name="CreatePixmap" opcode="53">
3591 <field type="CARD8" name="depth" />
3592 <field type="PIXMAP" name="pid" />
3593 <field type="DRAWABLE" name="drawable" />
3594 <field type="CARD16" name="width" />
3595 <field type="CARD16" name="height" />
3597 <brief>Creates a pixmap</brief>
3598 <description><![CDATA[
3599 Creates a pixmap. The pixmap can only be used on the same screen as `drawable`
3600 is on and only with drawables of the same `depth`.
3602 <field name="depth"><![CDATA[
3605 <field name="pid"><![CDATA[
3606 The ID with which you will refer to the new pixmap, created by
3609 <field name="drawable"><![CDATA[
3610 Drawable to get the screen from.
3612 <field name="width"><![CDATA[
3613 The width of the new pixmap.
3615 <field name="height"><![CDATA[
3616 The height of the new pixmap.
3618 <error type="Value"><![CDATA[
3621 <error type="Drawable"><![CDATA[
3622 The specified `drawable` (Window or Pixmap) does not exist.
3624 <error type="Alloc"><![CDATA[
3625 The X server could not allocate the requested resources (no memory?).
3627 <see type="function" name="xcb_generate_id" />
3631 <request name="FreePixmap" opcode="54">
3633 <field type="PIXMAP" name="pixmap" />
3635 <brief>Destroys a pixmap</brief>
3636 <description><![CDATA[
3637 Deletes the association between the pixmap ID and the pixmap. The pixmap
3638 storage will be freed when there are no more references to it.
3640 <field name="pixmap"><![CDATA[The pixmap to destroy.]]></field>
3641 <error type="Pixmap"><![CDATA[
3642 The specified pixmap does not exist.
3648 <item name="Function"> <bit>0</bit></item>
3649 <item name="PlaneMask"> <bit>1</bit></item>
3650 <item name="Foreground"> <bit>2</bit></item>
3651 <item name="Background"> <bit>3</bit></item>
3652 <item name="LineWidth"> <bit>4</bit></item>
3653 <item name="LineStyle"> <bit>5</bit></item>
3654 <item name="CapStyle"> <bit>6</bit></item>
3655 <item name="JoinStyle"> <bit>7</bit></item>
3656 <item name="FillStyle"> <bit>8</bit></item>
3657 <item name="FillRule"> <bit>9</bit></item>
3658 <item name="Tile"> <bit>10</bit></item>
3659 <item name="Stipple"> <bit>11</bit></item>
3660 <item name="TileStippleOriginX"><bit>12</bit></item>
3661 <item name="TileStippleOriginY"><bit>13</bit></item>
3662 <item name="Font"> <bit>14</bit></item>
3663 <item name="SubwindowMode"> <bit>15</bit></item>
3664 <item name="GraphicsExposures"> <bit>16</bit></item>
3665 <item name="ClipOriginX"> <bit>17</bit></item>
3666 <item name="ClipOriginY"> <bit>18</bit></item>
3667 <item name="ClipMask"> <bit>19</bit></item>
3668 <item name="DashOffset"> <bit>20</bit></item>
3669 <item name="DashList"> <bit>21</bit></item>
3670 <item name="ArcMode"> <bit>22</bit></item>
3672 <field name="Function"><![CDATA[
3675 <field name="PlaneMask"><![CDATA[
3676 In graphics operations, given a source and destination pixel, the result is
3677 computed bitwise on corresponding bits of the pixels; that is, a Boolean
3678 operation is performed in each bit plane. The plane-mask restricts the
3679 operation to a subset of planes, so the result is:
3681 ((src FUNC dst) AND plane-mask) OR (dst AND (NOT plane-mask))
3683 <field name="Foreground"><![CDATA[
3684 Foreground colorpixel.
3686 <field name="Background"><![CDATA[
3687 Background colorpixel.
3689 <field name="LineWidth"><![CDATA[
3690 The line-width is measured in pixels and can be greater than or equal to one, a wide line, or the
3691 special value zero, a thin line.
3693 <field name="LineStyle"><![CDATA[
3694 The line-style defines which sections of a line are drawn:
3695 Solid The full path of the line is drawn.
3696 DoubleDash The full path of the line is drawn, but the even dashes are filled differently
3697 than the odd dashes (see fill-style), with Butt cap-style used where even and
3699 OnOffDash Only the even dashes are drawn, and cap-style applies to all internal ends of
3700 the individual dashes (except NotLast is treated as Butt).
3702 <field name="CapStyle"><![CDATA[
3703 The cap-style defines how the endpoints of a path are drawn:
3704 NotLast The result is equivalent to Butt, except that for a line-width of zero the final
3705 endpoint is not drawn.
3706 Butt The result is square at the endpoint (perpendicular to the slope of the line)
3707 with no projection beyond.
3708 Round The result is a circular arc with its diameter equal to the line-width, centered
3709 on the endpoint; it is equivalent to Butt for line-width zero.
3710 Projecting The result is square at the end, but the path continues beyond the endpoint for
3711 a distance equal to half the line-width; it is equivalent to Butt for line-width
3714 <field name="JoinStyle"><![CDATA[
3715 The join-style defines how corners are drawn for wide lines:
3716 Miter The outer edges of the two lines extend to meet at an angle. However, if the
3717 angle is less than 11 degrees, a Bevel join-style is used instead.
3718 Round The result is a circular arc with a diameter equal to the line-width, centered
3720 Bevel The result is Butt endpoint styles, and then the triangular notch is filled.
3722 <field name="FillStyle"><![CDATA[
3723 The fill-style defines the contents of the source for line, text, and fill requests. For all text and fill
3724 requests (for example, PolyText8, PolyText16, PolyFillRectangle, FillPoly, and PolyFillArc)
3725 as well as for line requests with line-style Solid, (for example, PolyLine, PolySegment,
3726 PolyRectangle, PolyArc) and for the even dashes for line requests with line-style OnOffDash
3730 OpaqueStippled A tile with the same width and height as stipple but with background
3731 everywhere stipple has a zero and with foreground everywhere stipple
3733 Stippled Foreground masked by stipple
3734 For the odd dashes for line requests with line-style DoubleDash:
3736 Tiled Same as for even dashes
3737 OpaqueStippled Same as for even dashes
3738 Stippled Background masked by stipple
3740 <field name="FillRule"><![CDATA[
3742 <field name="Tile"><![CDATA[
3743 The tile/stipple represents an infinite two-dimensional plane with the tile/stipple replicated in all
3744 dimensions. When that plane is superimposed on the drawable for use in a graphics operation,
3745 the upper-left corner of some instance of the tile/stipple is at the coordinates within the drawable
3746 specified by the tile/stipple origin. The tile/stipple and clip origins are interpreted relative to the
3747 origin of whatever destination drawable is specified in a graphics request.
3748 The tile pixmap must have the same root and depth as the gcontext (or a Match error results).
3749 The stipple pixmap must have depth one and must have the same root as the gcontext (or a
3750 Match error results). For fill-style Stippled (but not fill-style
3751 OpaqueStippled), the stipple pattern is tiled in a single plane and acts as an
3752 additional clip mask to be ANDed with the clip-mask.
3753 Any size pixmap can be used for tiling or stippling, although some sizes may be faster to use than
3756 <field name="Stipple"><![CDATA[
3757 The tile/stipple represents an infinite two-dimensional plane with the tile/stipple replicated in all
3758 dimensions. When that plane is superimposed on the drawable for use in a graphics operation,
3759 the upper-left corner of some instance of the tile/stipple is at the coordinates within the drawable
3760 specified by the tile/stipple origin. The tile/stipple and clip origins are interpreted relative to the
3761 origin of whatever destination drawable is specified in a graphics request.
3762 The tile pixmap must have the same root and depth as the gcontext (or a Match error results).
3763 The stipple pixmap must have depth one and must have the same root as the gcontext (or a
3764 Match error results). For fill-style Stippled (but not fill-style
3765 OpaqueStippled), the stipple pattern is tiled in a single plane and acts as an
3766 additional clip mask to be ANDed with the clip-mask.
3767 Any size pixmap can be used for tiling or stippling, although some sizes may be faster to use than
3770 <field name="TileStippleOriginX"><![CDATA[
3773 <field name="TileStippleOriginY"><![CDATA[
3776 <field name="Font"><![CDATA[
3777 Which font to use for the `ImageText8` and `ImageText16` requests.
3779 <field name="SubwindowMode"><![CDATA[
3780 For ClipByChildren, both source and destination windows are additionally
3781 clipped by all viewable InputOutput children. For IncludeInferiors, neither
3782 source nor destination window is
3783 clipped by inferiors. This will result in including subwindow contents in the source and drawing
3784 through subwindow boundaries of the destination. The use of IncludeInferiors with a source or
3785 destination window of one depth with mapped inferiors of differing depth is not illegal, but the
3786 semantics is undefined by the core protocol.
3788 <field name="GraphicsExposures"><![CDATA[
3789 Whether ExposureEvents should be generated (1) or not (0).
3793 <field name="ClipOriginX"><![CDATA[
3796 <field name="ClipOriginY"><![CDATA[
3799 <field name="ClipMask"><![CDATA[
3800 The clip-mask restricts writes to the destination drawable. Only pixels where the clip-mask has
3801 bits set to 1 are drawn. Pixels are not drawn outside the area covered by the clip-mask or where
3802 the clip-mask has bits set to 0. The clip-mask affects all graphics requests, but it does not clip
3803 sources. The clip-mask origin is interpreted relative to the origin of whatever destination drawable is specified in a graphics request. If a pixmap is specified as the clip-mask, it must have
3804 depth 1 and have the same root as the gcontext (or a Match error results). If clip-mask is None,
3805 then pixels are always drawn, regardless of the clip origin. The clip-mask can also be set with the
3806 SetClipRectangles request.
3808 <field name="DashOffset"><![CDATA[
3811 <field name="DashList"><![CDATA[
3814 <field name="ArcMode"><![CDATA[
3821 <!-- GC Function values -->
3823 <item name="clear"> <value>0</value></item>
3824 <item name="and"> <value>1</value></item>
3825 <item name="andReverse"> <value>2</value></item>
3826 <item name="copy"> <value>3</value></item>
3827 <item name="andInverted"> <value>4</value></item>
3828 <item name="noop"> <value>5</value></item>
3829 <item name="xor"> <value>6</value></item>
3830 <item name="or"> <value>7</value></item>
3831 <item name="nor"> <value>8</value></item>
3832 <item name="equiv"> <value>9</value></item>
3833 <item name="invert"> <value>10</value></item>
3834 <item name="orReverse"> <value>11</value></item>
3835 <item name="copyInverted"><value>12</value></item>
3836 <item name="orInverted"> <value>13</value></item>
3837 <item name="nand"> <value>14</value></item>
3838 <item name="set"> <value>15</value></item>
3841 <enum name="LineStyle">
3842 <item name="Solid"> <value>0</value></item>
3843 <item name="OnOffDash"> <value>1</value></item>
3844 <item name="DoubleDash"><value>2</value></item>
3847 <enum name="CapStyle">
3848 <item name="NotLast"> <value>0</value></item>
3849 <item name="Butt"> <value>1</value></item>
3850 <item name="Round"> <value>2</value></item>
3851 <item name="Projecting"><value>3</value></item>
3854 <enum name="JoinStyle">
3855 <item name="Miter"> <value>0</value></item>
3856 <item name="Round"> <value>1</value></item>
3857 <item name="Bevel"> <value>2</value></item>
3860 <enum name="FillStyle">
3861 <item name="Solid"> <value>0</value></item>
3862 <item name="Tiled"> <value>1</value></item>
3863 <item name="Stippled"> <value>2</value></item>
3864 <item name="OpaqueStippled"><value>3</value></item>
3867 <enum name="FillRule">
3868 <item name="EvenOdd"><value>0</value></item>
3869 <item name="Winding"><value>1</value></item>
3872 <enum name="SubwindowMode">
3873 <item name="ClipByChildren"> <value>0</value></item>
3874 <item name="IncludeInferiors"><value>1</value></item>
3877 <enum name="ArcMode">
3878 <item name="Chord"> <value>0</value></item>
3879 <item name="PieSlice"><value>1</value></item>
3882 <request name="CreateGC" opcode="55">
3884 <field type="GCONTEXT" name="cid" />
3885 <field type="DRAWABLE" name="drawable" />
3886 <valueparam value-mask-type="CARD32"
3887 value-mask-name="value_mask"
3888 value-list-name="value_list" />
3890 <brief>Creates a graphics context</brief>
3891 <description><![CDATA[
3892 Creates a graphics context. The graphics context can be used with any drawable
3893 that has the same root and depth as the specified drawable.
3895 <field name="cid"><![CDATA[
3896 The ID with which you will refer to the graphics context, created by
3899 <field name="drawable"><![CDATA[
3900 Drawable to get the root/depth from.
3902 <error type="Drawable"><![CDATA[
3903 The specified `drawable` (Window or Pixmap) does not exist.
3905 <error type="Match"><![CDATA[
3908 <error type="Font"><![CDATA[
3911 <error type="Pixmap"><![CDATA[
3914 <error type="Value"><![CDATA[
3917 <error type="Alloc"><![CDATA[
3918 The X server could not allocate the requested resources (no memory?).
3920 <see type="function" name="xcb_generate_id" />
3924 <request name="ChangeGC" opcode="56">
3926 <field type="GCONTEXT" name="gc" />
3927 <valueparam value-mask-type="CARD32"
3928 value-mask-name="value_mask"
3929 value-list-name="value_list" />
3931 <brief>change graphics context components</brief>
3932 <description><![CDATA[
3933 Changes the components specified by `value_mask` for the specified graphics context.
3937 * Changes the foreground color component of the specified graphics context.
3940 void my_example(xcb_connection *conn, xcb_gcontext_t gc, uint32_t fg, uint32_t bg) {
3941 /* C99 allows us to use a compact way of changing a single component: */
3942 xcb_change_gc(conn, gc, XCB_GC_FOREGROUND, (uint32_t[]){ fg });
3944 /* The more explicit way. Beware that the order of values is important! */
3946 mask |= XCB_GC_FOREGROUND;
3947 mask |= XCB_GC_BACKGROUND;
3949 uint32_t values[] = {
3953 xcb_change_gc(conn, gc, mask, values);
3957 <field name="gc"><![CDATA[
3958 The graphics context to change.
3960 <!-- the enum documentation is good enough. -->
3961 <field name="value_mask" />
3962 <field name="value_list"><![CDATA[
3963 Values for each of the components specified in the bitmask `value_mask`. The
3964 order has to correspond to the order of possible `value_mask` bits. See the
3967 <error type="Font"><![CDATA[
3970 <error type="GContext"><![CDATA[
3973 <error type="Match"><![CDATA[
3976 <error type="Pixmap"><![CDATA[
3979 <error type="Value"><![CDATA[
3982 <error type="Alloc"><![CDATA[
3983 The X server could not allocate the requested resources (no memory?).
3988 <request name="CopyGC" opcode="57">
3990 <field type="GCONTEXT" name="src_gc" />
3991 <field type="GCONTEXT" name="dst_gc" />
3992 <field type="CARD32" name="value_mask" mask="GC" />
3995 <request name="SetDashes" opcode="58">
3997 <field type="GCONTEXT" name="gc" />
3998 <field type="CARD16" name="dash_offset" />
3999 <field type="CARD16" name="dashes_len" />
4000 <list type="CARD8" name="dashes">
4001 <fieldref>dashes_len</fieldref>
4005 <enum name="ClipOrdering">
4006 <item name="Unsorted"><value>0</value></item>
4007 <item name="YSorted"> <value>1</value></item>
4008 <item name="YXSorted"><value>2</value></item>
4009 <item name="YXBanded"><value>3</value></item>
4012 <request name="SetClipRectangles" opcode="59">
4013 <field type="BYTE" name="ordering" enum="ClipOrdering" />
4014 <field type="GCONTEXT" name="gc" />
4015 <field type="INT16" name="clip_x_origin" />
4016 <field type="INT16" name="clip_y_origin" />
4017 <list type="RECTANGLE" name="rectangles" />
4020 <request name="FreeGC" opcode="60">
4022 <field type="GCONTEXT" name="gc" />
4024 <brief>Destroys a graphics context</brief>
4025 <description><![CDATA[
4026 Destroys the specified `gc` and all associated storage.
4028 <field name="gc"><![CDATA[The graphics context to destroy.]]></field>
4029 <error type="GContext"><![CDATA[
4030 The specified graphics context does not exist.
4035 <request name="ClearArea" opcode="61">
4036 <field type="BOOL" name="exposures" />
4037 <field type="WINDOW" name="window" />
4038 <field type="INT16" name="x" />
4039 <field type="INT16" name="y" />
4040 <field type="CARD16" name="width" />
4041 <field type="CARD16" name="height" />
4044 <request name="CopyArea" opcode="62">
4046 <field type="DRAWABLE" name="src_drawable" />
4047 <field type="DRAWABLE" name="dst_drawable" />
4048 <field type="GCONTEXT" name="gc" />
4049 <field type="INT16" name="src_x" />
4050 <field type="INT16" name="src_y" />
4051 <field type="INT16" name="dst_x" />
4052 <field type="INT16" name="dst_y" />
4053 <field type="CARD16" name="width" />
4054 <field type="CARD16" name="height" />
4056 <brief>copy areas</brief>
4057 <description><![CDATA[
4058 Copies the specified rectangle from `src_drawable` to `dst_drawable`.
4060 <field name="dst_drawable"><![CDATA[
4061 The destination drawable (Window or Pixmap).
4063 <field name="src_drawable"><![CDATA[
4064 The source drawable (Window or Pixmap).
4066 <field name="gc"><![CDATA[
4067 The graphics context to use.
4069 <field name="src_x"><![CDATA[
4070 The source X coordinate.
4072 <field name="src_y"><![CDATA[
4073 The source Y coordinate.
4075 <field name="dst_x"><![CDATA[
4076 The destination X coordinate.
4078 <field name="dst_y"><![CDATA[
4079 The destination Y coordinate.
4081 <field name="width"><![CDATA[
4082 The width of the area to copy (in pixels).
4084 <field name="height"><![CDATA[
4085 The height of the area to copy (in pixels).
4087 <error type="Drawable"><![CDATA[
4088 The specified `drawable` (Window or Pixmap) does not exist.
4090 <error type="GContext"><![CDATA[
4091 The specified graphics context does not exist.
4093 <error type="Match"><![CDATA[
4094 `src_drawable` has a different root or depth than `dst_drawable`.
4099 <request name="CopyPlane" opcode="63">
4101 <field type="DRAWABLE" name="src_drawable" />
4102 <field type="DRAWABLE" name="dst_drawable" />
4103 <field type="GCONTEXT" name="gc" />
4104 <field type="INT16" name="src_x" />
4105 <field type="INT16" name="src_y" />
4106 <field type="INT16" name="dst_x" />
4107 <field type="INT16" name="dst_y" />
4108 <field type="CARD16" name="width" />
4109 <field type="CARD16" name="height" />
4110 <field type="CARD32" name="bit_plane" />
4113 <enum name="CoordMode">
4114 <item name="Origin"> <value>0</value></item>
4115 <item name="Previous"><value>1</value></item>
4117 <field name="Origin"><![CDATA[
4118 Treats all coordinates as relative to the origin.
4120 <field name="Previous"><![CDATA[
4121 Treats all coordinates after the first as relative to the previous coordinate.
4126 <!-- combine-adjacent doesn't work for mode==Relative -->
4127 <request name="PolyPoint" opcode="64">
4128 <field type="BYTE" name="coordinate_mode" enum="CoordMode" />
4129 <field type="DRAWABLE" name="drawable" />
4130 <field type="GCONTEXT" name="gc" />
4131 <list type="POINT" name="points" />
4134 <request name="PolyLine" opcode="65" combine-adjacent="true">
4135 <field type="BYTE" name="coordinate_mode" enum="CoordMode" />
4136 <field type="DRAWABLE" name="drawable" />
4137 <field type="GCONTEXT" name="gc" />
4138 <list type="POINT" name="points" />
4140 <brief>draw lines</brief>
4141 <description><![CDATA[
4142 Draws `points_len`-1 lines between each pair of points (point[i], point[i+1])
4143 in the `points` array. The lines are drawn in the order listed in the array.
4144 They join correctly at all intermediate points, and if the first and last
4145 points coincide, the first and last lines also join correctly. For any given
4146 line, a pixel is not drawn more than once. If thin (zero line-width) lines
4147 intersect, the intersecting pixels are drawn multiple times. If wide lines
4148 intersect, the intersecting pixels are drawn only once, as though the entire
4149 request were a single, filled shape.
4153 * Draw a straight line.
4156 void my_example(xcb_connection *conn, xcb_drawable_t drawable, xcb_gcontext_t gc) {
4157 xcb_poly_line(conn, XCB_COORD_MODE_ORIGIN, drawable, gc, 2,
4158 (xcb_point_t[]) { {10, 10}, {100, 10} });
4162 <field name="drawable"><![CDATA[
4163 The drawable to draw the line(s) on.
4165 <field name="gc"><![CDATA[
4166 The graphics context to use.
4168 <field name="points_len"><![CDATA[
4169 The number of `xcb_point_t` structures in `points`.
4171 <field name="points"><![CDATA[
4174 <!-- the enum doc is sufficient. -->
4175 <field name="coordinate_mode" />
4176 <error type="Drawable"><![CDATA[
4179 <error type="GContext"><![CDATA[
4182 <error type="Match"><![CDATA[
4185 <error type="Value"><![CDATA[
4191 <struct name="SEGMENT">
4192 <field type="INT16" name="x1" />
4193 <field type="INT16" name="y1" />
4194 <field type="INT16" name="x2" />
4195 <field type="INT16" name="y2" />
4198 <request name="PolySegment" opcode="66" combine-adjacent="true">
4200 <field type="DRAWABLE" name="drawable" />
4201 <field type="GCONTEXT" name="gc" />
4202 <list type="SEGMENT" name="segments" />
4204 <brief>draw lines</brief>
4205 <description><![CDATA[
4206 Draws multiple, unconnected lines. For each segment, a line is drawn between
4207 (x1, y1) and (x2, y2). The lines are drawn in the order listed in the array of
4208 `xcb_segment_t` structures and does not perform joining at coincident
4209 endpoints. For any given line, a pixel is not drawn more than once. If lines
4210 intersect, the intersecting pixels are drawn multiple times.
4212 TODO: include the xcb_segment_t data structure
4216 <field name="drawable"><![CDATA[
4217 A drawable (Window or Pixmap) to draw on.
4219 <field name="gc"><![CDATA[
4220 The graphics context to use.
4222 TODO: document which attributes of a gc are used
4224 <field name="segments_len"><![CDATA[
4225 The number of `xcb_segment_t` structures in `segments`.
4227 <field name="segments"><![CDATA[
4228 An array of `xcb_segment_t` structures.
4230 <error type="Drawable"><![CDATA[
4231 The specified `drawable` does not exist.
4233 <error type="GContext"><![CDATA[
4234 The specified `gc` does not exist.
4236 <error type="Match"><![CDATA[
4242 <request name="PolyRectangle" opcode="67" combine-adjacent="true">
4244 <field type="DRAWABLE" name="drawable" />
4245 <field type="GCONTEXT" name="gc" />
4246 <list type="RECTANGLE" name="rectangles" />
4250 The semantics of PolyArc change after the first arc: the GC's
4251 join style may be applied to successive arcs under some circumstances.
4252 So using combine-adjacent here is bad.
4254 <request name="PolyArc" opcode="68">
4256 <field type="DRAWABLE" name="drawable" />
4257 <field type="GCONTEXT" name="gc" />
4258 <list type="ARC" name="arcs" />
4261 <enum name="PolyShape">
4262 <item name="Complex"> <value>0</value></item>
4263 <item name="Nonconvex"><value>1</value></item>
4264 <item name="Convex"> <value>2</value></item>
4267 <request name="FillPoly" opcode="69">
4269 <field type="DRAWABLE" name="drawable" />
4270 <field type="GCONTEXT" name="gc" />
4271 <field type="CARD8" name="shape" enum="PolyShape" />
4272 <field type="CARD8" name="coordinate_mode" enum="CoordMode" />
4274 <list type="POINT" name="points" />
4277 <request name="PolyFillRectangle" opcode="70" combine-adjacent="true">
4279 <field type="DRAWABLE" name="drawable" />
4280 <field type="GCONTEXT" name="gc" />
4281 <list type="RECTANGLE" name="rectangles" />
4283 <brief>Fills rectangles</brief>
4284 <description><![CDATA[
4285 Fills the specified rectangle(s) in the order listed in the array. For any
4286 given rectangle, each pixel is not drawn more than once. If rectangles
4287 intersect, the intersecting pixels are drawn multiple times.
4289 <field name="drawable"><![CDATA[
4290 The drawable (Window or Pixmap) to draw on.
4292 <field name="gc"><![CDATA[
4293 The graphics context to use.
4295 The following graphics context components are used: function, plane-mask,
4296 fill-style, subwindow-mode, clip-x-origin, clip-y-origin, and clip-mask.
4298 The following graphics context mode-dependent components are used:
4299 foreground, background, tile, stipple, tile-stipple-x-origin, and
4300 tile-stipple-y-origin.
4302 <field name="rectangles_len"><![CDATA[
4303 The number of `xcb_rectangle_t` structures in `rectangles`.
4305 <field name="rectangles"><![CDATA[
4306 The rectangles to fill.
4308 <error type="Drawable"><![CDATA[
4309 The specified `drawable` (Window or Pixmap) does not exist.
4311 <error type="GContext"><![CDATA[
4312 The specified graphics context does not exist.
4314 <error type="Match"><![CDATA[
4320 <request name="PolyFillArc" opcode="71" combine-adjacent="true">
4322 <field type="DRAWABLE" name="drawable" />
4323 <field type="GCONTEXT" name="gc" />
4324 <list type="ARC" name="arcs" />
4327 <enum name="ImageFormat">
4328 <item name="XYBitmap"><value>0</value></item>
4329 <item name="XYPixmap"><value>1</value></item>
4330 <item name="ZPixmap"> <value>2</value></item>
4333 <request name="PutImage" opcode="72">
4334 <field type="CARD8" name="format" enum="ImageFormat" />
4335 <field type="DRAWABLE" name="drawable" />
4336 <field type="GCONTEXT" name="gc" />
4337 <field type="CARD16" name="width" />
4338 <field type="CARD16" name="height" />
4339 <field type="INT16" name="dst_x" />
4340 <field type="INT16" name="dst_y" />
4341 <field type="CARD8" name="left_pad" />
4342 <field type="CARD8" name="depth" />
4344 <list type="BYTE" name="data" />
4347 <!-- FIXME: data array in reply will include padding, but ought not to. -->
4348 <request name="GetImage" opcode="73">
4349 <field type="CARD8" name="format" enum="ImageFormat" />
4350 <field type="DRAWABLE" name="drawable" />
4351 <field type="INT16" name="x" />
4352 <field type="INT16" name="y" />
4353 <field type="CARD16" name="width" />
4354 <field type="CARD16" name="height" />
4355 <field type="CARD32" name="plane_mask" />
4357 <field type="CARD8" name="depth" />
4358 <field type="VISUALID" name="visual" />
4360 <list type="BYTE" name="data">
4362 <fieldref>length</fieldref>
4369 <request name="PolyText8" opcode="74">
4371 <field type="DRAWABLE" name="drawable" />
4372 <field type="GCONTEXT" name="gc" />
4373 <field type="INT16" name="x" />
4374 <field type="INT16" name="y" />
4375 <list type="BYTE" name="items" />
4378 <request name="PolyText16" opcode="75">
4380 <field type="DRAWABLE" name="drawable" />
4381 <field type="GCONTEXT" name="gc" />
4382 <field type="INT16" name="x" />
4383 <field type="INT16" name="y" />
4384 <list type="BYTE" name="items" />
4387 <request name="ImageText8" opcode="76">
4388 <field type="BYTE" name="string_len" />
4389 <field type="DRAWABLE" name="drawable" />
4390 <field type="GCONTEXT" name="gc" />
4391 <field type="INT16" name="x" />
4392 <field type="INT16" name="y" />
4393 <list type="char" name="string">
4394 <fieldref>string_len</fieldref>
4397 <brief>Draws text</brief>
4398 <description><![CDATA[
4399 Fills the destination rectangle with the background pixel from `gc`, then
4400 paints the text with the foreground pixel from `gc`. The upper-left corner of
4401 the filled rectangle is at [x, y - font-ascent]. The width is overall-width,
4402 the height is font-ascent + font-descent. The overall-width, font-ascent and
4403 font-descent are as returned by `xcb_query_text_extents` (TODO).
4405 Note that using X core fonts is deprecated (but still supported) in favor of
4406 client-side rendering using Xft.
4408 <field name="drawable"><![CDATA[
4409 The drawable (Window or Pixmap) to draw text on.
4411 <field name="string_len"><![CDATA[
4412 The length of the `string`. Note that this parameter limited by 255 due to
4415 <field name="string"><![CDATA[
4416 The string to draw. Only the first 255 characters are relevant due to the data
4417 type of `string_len`.
4419 <field name="x"><![CDATA[
4420 The x coordinate of the first character, relative to the origin of `drawable`.
4422 <field name="y"><![CDATA[
4423 The y coordinate of the first character, relative to the origin of `drawable`.
4425 <field name="gc"><![CDATA[
4426 The graphics context to use.
4428 The following graphics context components are used: plane-mask, foreground,
4429 background, font, subwindow-mode, clip-x-origin, clip-y-origin, and clip-mask.
4431 <error type="Drawable"><![CDATA[
4432 The specified `drawable` (Window or Pixmap) does not exist.
4434 <error type="GContext"><![CDATA[
4435 The specified graphics context does not exist.
4437 <error type="Match"><![CDATA[
4440 <see type="request" name="ImageText16" />
4444 <request name="ImageText16" opcode="77">
4445 <field type="BYTE" name="string_len" />
4446 <field type="DRAWABLE" name="drawable" />
4447 <field type="GCONTEXT" name="gc" />
4448 <field type="INT16" name="x" />
4449 <field type="INT16" name="y" />
4450 <list type="CHAR2B" name="string">
4451 <fieldref>string_len</fieldref>
4454 <brief>Draws text</brief>
4455 <description><![CDATA[
4456 Fills the destination rectangle with the background pixel from `gc`, then
4457 paints the text with the foreground pixel from `gc`. The upper-left corner of
4458 the filled rectangle is at [x, y - font-ascent]. The width is overall-width,
4459 the height is font-ascent + font-descent. The overall-width, font-ascent and
4460 font-descent are as returned by `xcb_query_text_extents` (TODO).
4462 Note that using X core fonts is deprecated (but still supported) in favor of
4463 client-side rendering using Xft.
4465 <field name="drawable"><![CDATA[
4466 The drawable (Window or Pixmap) to draw text on.
4468 <field name="string_len"><![CDATA[
4469 The length of the `string` in characters. Note that this parameter limited by
4470 255 due to using 8 bits!
4472 <field name="string"><![CDATA[
4473 The string to draw. Only the first 255 characters are relevant due to the data
4474 type of `string_len`. Every character uses 2 bytes (hence the 16 in this
4477 <field name="x"><![CDATA[
4478 The x coordinate of the first character, relative to the origin of `drawable`.
4480 <field name="y"><![CDATA[
4481 The y coordinate of the first character, relative to the origin of `drawable`.
4483 <field name="gc"><![CDATA[
4484 The graphics context to use.
4486 The following graphics context components are used: plane-mask, foreground,
4487 background, font, subwindow-mode, clip-x-origin, clip-y-origin, and clip-mask.
4489 <error type="Drawable"><![CDATA[
4490 The specified `drawable` (Window or Pixmap) does not exist.
4492 <error type="GContext"><![CDATA[
4493 The specified graphics context does not exist.
4495 <error type="Match"><![CDATA[
4498 <see type="request" name="ImageText8" />
4502 <enum name= "ColormapAlloc">
4503 <item name="None"><value>0</value></item>
4504 <item name="All"> <value>1</value></item>
4507 <request name="CreateColormap" opcode="78">
4508 <field type="BYTE" name="alloc" enum="ColormapAlloc" />
4509 <field type="COLORMAP" name="mid" />
4510 <field type="WINDOW" name="window" />
4511 <field type="VISUALID" name="visual" />
4514 <request name="FreeColormap" opcode="79">
4516 <field type="COLORMAP" name="cmap" />
4519 <request name="CopyColormapAndFree" opcode="80">
4521 <field type="COLORMAP" name="mid" />
4522 <field type="COLORMAP" name="src_cmap" />
4525 <request name="InstallColormap" opcode="81">
4527 <field type="COLORMAP" name="cmap" />
4530 <request name="UninstallColormap" opcode="82">
4532 <field type="COLORMAP" name="cmap" />
4535 <request name="ListInstalledColormaps" opcode="83">
4537 <field type="WINDOW" name="window" />
4540 <field type="CARD16" name="cmaps_len" />
4542 <list type="COLORMAP" name="cmaps">
4543 <fieldref>cmaps_len</fieldref>
4548 <request name="AllocColor" opcode="84">
4550 <field type="COLORMAP" name="cmap" />
4551 <field type="CARD16" name="red" />
4552 <field type="CARD16" name="green" />
4553 <field type="CARD16" name="blue" />
4557 <field type="CARD16" name="red" />
4558 <field type="CARD16" name="green" />
4559 <field type="CARD16" name="blue" />
4561 <field type="CARD32" name="pixel" />
4564 <brief>Allocate a color</brief>
4565 <description><![CDATA[
4566 Allocates a read-only colormap entry corresponding to the closest RGB value
4567 supported by the hardware. If you are using TrueColor, you can take a shortcut
4568 and directly calculate the color pixel value to avoid the round trip. But, for
4569 example, on 16-bit color setups (VNC), you can easily get the closest supported
4570 RGB value to the RGB value you are specifying.
4572 <field name="cmap"><![CDATA[
4575 <field name="red"><![CDATA[
4576 The red value of your color.
4578 <field name="green"><![CDATA[
4579 The green value of your color.
4581 <field name="blue"><![CDATA[
4582 The blue value of your color.
4584 <error type="Colormap"><![CDATA[
4585 The specified colormap `cmap` does not exist.
4590 <request name="AllocNamedColor" opcode="85">
4592 <field type="COLORMAP" name="cmap" />
4593 <field type="CARD16" name="name_len" />
4595 <list type="char" name="name">
4596 <fieldref>name_len</fieldref>
4600 <field type="CARD32" name="pixel" />
4601 <field type="CARD16" name="exact_red" />
4602 <field type="CARD16" name="exact_green" />
4603 <field type="CARD16" name="exact_blue" />
4604 <field type="CARD16" name="visual_red" />
4605 <field type="CARD16" name="visual_green" />
4606 <field type="CARD16" name="visual_blue" />
4610 <request name="AllocColorCells" opcode="86">
4611 <field type="BOOL" name="contiguous" />
4612 <field type="COLORMAP" name="cmap" />
4613 <field type="CARD16" name="colors" />
4614 <field type="CARD16" name="planes" />
4617 <field type="CARD16" name="pixels_len" />
4618 <field type="CARD16" name="masks_len" />
4620 <list type="CARD32" name="pixels">
4621 <fieldref>pixels_len</fieldref>
4623 <list type="CARD32" name="masks">
4624 <fieldref>masks_len</fieldref>
4629 <request name="AllocColorPlanes" opcode="87">
4630 <field type="BOOL" name="contiguous" />
4631 <field type="COLORMAP" name="cmap" />
4632 <field type="CARD16" name="colors" />
4633 <field type="CARD16" name="reds" />
4634 <field type="CARD16" name="greens" />
4635 <field type="CARD16" name="blues" />
4638 <field type="CARD16" name="pixels_len" />
4640 <field type="CARD32" name="red_mask" />
4641 <field type="CARD32" name="green_mask" />
4642 <field type="CARD32" name="blue_mask" />
4644 <list type="CARD32" name="pixels">
4645 <fieldref>pixels_len</fieldref>
4650 <request name="FreeColors" opcode="88">
4652 <field type="COLORMAP" name="cmap" />
4653 <field type="CARD32" name="plane_mask" />
4654 <list type="CARD32" name="pixels" />
4657 <enum name="ColorFlag">
4658 <item name="Red"> <bit>0</bit></item>
4659 <item name="Green"><bit>1</bit></item>
4660 <item name="Blue"> <bit>2</bit></item>
4663 <struct name="COLORITEM">
4664 <field type="CARD32" name="pixel" />
4665 <field type="CARD16" name="red" />
4666 <field type="CARD16" name="green" />
4667 <field type="CARD16" name="blue" />
4668 <field type="BYTE" name="flags" mask="ColorFlag" />
4672 <request name="StoreColors" opcode="89" combine-adjacent="true">
4674 <field type="COLORMAP" name="cmap" />
4675 <list type="COLORITEM" name="items" />
4678 <request name="StoreNamedColor" opcode="90">
4679 <field type="CARD8" name="flags" mask="ColorFlag" />
4680 <field type="COLORMAP" name="cmap" />
4681 <field type="CARD32" name="pixel" />
4682 <field type="CARD16" name="name_len" />
4684 <list type="char" name="name">
4685 <fieldref>name_len</fieldref>
4690 <field type="CARD16" name="red" />
4691 <field type="CARD16" name="green" />
4692 <field type="CARD16" name="blue" />
4696 <request name="QueryColors" opcode="91">
4698 <field type="COLORMAP" name="cmap" />
4699 <list type="CARD32" name="pixels" />
4702 <field type="CARD16" name="colors_len" />
4704 <list type="RGB" name="colors">
4705 <fieldref>colors_len</fieldref>
4710 <request name="LookupColor" opcode="92">
4712 <field type="COLORMAP" name="cmap" />
4713 <field type="CARD16" name="name_len" />
4715 <list type="char" name="name">
4716 <fieldref>name_len</fieldref>
4720 <field type="CARD16" name="exact_red" />
4721 <field type="CARD16" name="exact_green" />
4722 <field type="CARD16" name="exact_blue" />
4723 <field type="CARD16" name="visual_red" />
4724 <field type="CARD16" name="visual_green" />
4725 <field type="CARD16" name="visual_blue" />
4729 <enum name="Pixmap">
4730 <item name="None"> <value>0</value></item>
4733 <request name="CreateCursor" opcode="93">
4735 <field type="CURSOR" name="cid" />
4736 <field type="PIXMAP" name="source" />
4737 <field type="PIXMAP" name="mask" altenum="Pixmap" />
4738 <field type="CARD16" name="fore_red" />
4739 <field type="CARD16" name="fore_green" />
4740 <field type="CARD16" name="fore_blue" />
4741 <field type="CARD16" name="back_red" />
4742 <field type="CARD16" name="back_green" />
4743 <field type="CARD16" name="back_blue" />
4744 <field type="CARD16" name="x" />
4745 <field type="CARD16" name="y" />
4749 <item name="None"> <value>0</value></item>
4752 <request name="CreateGlyphCursor" opcode="94">
4754 <field type="CURSOR" name="cid" />
4755 <field type="FONT" name="source_font" />
4756 <field type="FONT" name="mask_font" altenum="Font" />
4757 <field type="CARD16" name="source_char" />
4758 <field type="CARD16" name="mask_char" />
4759 <field type="CARD16" name="fore_red" />
4760 <field type="CARD16" name="fore_green" />
4761 <field type="CARD16" name="fore_blue" />
4762 <field type="CARD16" name="back_red" />
4763 <field type="CARD16" name="back_green" />
4764 <field type="CARD16" name="back_blue" />
4766 <brief>create cursor</brief>
4767 <description><![CDATA[
4768 Creates a cursor from a font glyph. X provides a set of standard cursor shapes
4769 in a special font named cursor. Applications are encouraged to use this
4770 interface for their cursors because the font can be customized for the
4771 individual display type.
4773 All pixels which are set to 1 in the source will use the foreground color (as
4774 specified by `fore_red`, `fore_green` and `fore_blue`). All pixels set to 0
4775 will use the background color (as specified by `back_red`, `back_green` and
4778 <field name="cid"><![CDATA[
4779 The ID with which you will refer to the cursor, created by `xcb_generate_id`.
4781 <field name="source_font"><![CDATA[
4782 In which font to look for the cursor glyph.
4784 <field name="mask_font"><![CDATA[
4785 In which font to look for the mask glyph.
4787 <field name="source_char"><![CDATA[
4788 The glyph of `source_font` to use.
4790 <field name="mask_char"><![CDATA[
4791 The glyph of `mask_font` to use as a mask: Pixels which are set to 1 define
4792 which source pixels are displayed. All pixels which are set to 0 are not
4795 <field name="fore_red"><![CDATA[
4796 The red value of the foreground color.
4798 <field name="fore_green"><![CDATA[
4799 The green value of the foreground color.
4801 <field name="fore_blue"><![CDATA[
4802 The blue value of the foreground color.
4804 <field name="back_red"><![CDATA[
4805 The red value of the background color.
4807 <field name="back_green"><![CDATA[
4808 The green value of the background color.
4810 <field name="back_blue"><![CDATA[
4811 The blue value of the background color.
4813 <error type="Alloc"><![CDATA[
4814 The X server could not allocate the requested resources (no memory?).
4816 <error type="Font"><![CDATA[
4817 The specified `source_font` or `mask_font` does not exist.
4819 <error type="Value"><![CDATA[
4820 Either `source_char` or `mask_char` are not defined in `source_font` or `mask_font`, respectively.
4822 <!-- TODO: example -->
4826 <request name="FreeCursor" opcode="95">
4828 <field type="CURSOR" name="cursor" />
4830 <brief>Deletes a cursor</brief>
4831 <description><![CDATA[
4832 Deletes the association between the cursor resource ID and the specified
4833 cursor. The cursor is freed when no other resource references it.
4835 <field name="cursor"><![CDATA[The cursor to destroy.]]></field>
4836 <error type="Cursor"><![CDATA[
4837 The specified cursor does not exist.
4843 <request name="RecolorCursor" opcode="96">
4845 <field type="CURSOR" name="cursor" />
4846 <field type="CARD16" name="fore_red" />
4847 <field type="CARD16" name="fore_green" />
4848 <field type="CARD16" name="fore_blue" />
4849 <field type="CARD16" name="back_red" />
4850 <field type="CARD16" name="back_green" />
4851 <field type="CARD16" name="back_blue" />
4854 <enum name="QueryShapeOf">
4855 <item name="LargestCursor"> <value>0</value></item>
4856 <item name="FastestTile"> <value>1</value></item>
4857 <item name="FastestStipple"><value>2</value></item>
4860 <request name="QueryBestSize" opcode="97">
4861 <field type="CARD8" name="class" enum="QueryShapeOf" />
4862 <field type="DRAWABLE" name="drawable" />
4863 <field type="CARD16" name="width" />
4864 <field type="CARD16" name="height" />
4867 <field type="CARD16" name="width" />
4868 <field type="CARD16" name="height" />
4872 <request name="QueryExtension" opcode="98">
4874 <field type="CARD16" name="name_len" />
4876 <list type="char" name="name">
4877 <fieldref>name_len</fieldref>
4881 <field type="BOOL" name="present" />
4882 <field type="CARD8" name="major_opcode" />
4883 <field type="CARD8" name="first_event" />
4884 <field type="CARD8" name="first_error" />
4886 <field name="present"><![CDATA[
4887 Whether the extension is present on this X11 server.
4889 <field name="major_opcode"><![CDATA[
4890 The major opcode for requests.
4892 <field name="first_event"><![CDATA[
4893 The first event code, if any.
4895 <field name="first_error"><![CDATA[
4896 The first error code, if any.
4901 <brief>check if extension is present</brief>
4902 <description><![CDATA[
4903 Determines if the specified extension is present on this X11 server.
4905 Every extension has a unique `major_opcode` to identify requests, the minor
4906 opcodes and request formats are extension-specific. If the extension provides
4907 events and errors, the `first_event` and `first_error` fields in the reply are
4910 There should rarely be a need to use this request directly, XCB provides the
4911 `xcb_get_extension_data` function instead.
4913 <field name="name_len"><![CDATA[
4914 The length of `name` in bytes.
4916 <field name="name"><![CDATA[
4917 The name of the extension to query, for example "RANDR". This is case
4920 <see type="program" name="xdpyinfo" />
4921 <see type="function" name="xcb_get_extension_data" />
4925 <request name="ListExtensions" opcode="99">
4927 <field type="CARD8" name="names_len" />
4929 <list type="STR" name="names">
4930 <fieldref>names_len</fieldref>
4935 <request name="ChangeKeyboardMapping" opcode="100">
4936 <field type="CARD8" name="keycode_count" />
4937 <field type="KEYCODE" name="first_keycode" />
4938 <field type="CARD8" name="keysyms_per_keycode" />
4940 <list type="KEYSYM" name="keysyms">
4942 <fieldref>keycode_count</fieldref>
4943 <fieldref>keysyms_per_keycode</fieldref>
4948 <request name="GetKeyboardMapping" opcode="101">
4950 <field type="KEYCODE" name="first_keycode" />
4951 <field type="CARD8" name="count" />
4953 <field type="BYTE" name="keysyms_per_keycode" />
4955 <list type="KEYSYM" name="keysyms">
4956 <fieldref>length</fieldref>
4962 <item name="KeyClickPercent"><bit>0</bit></item>
4963 <item name="BellPercent"> <bit>1</bit></item>
4964 <item name="BellPitch"> <bit>2</bit></item>
4965 <item name="BellDuration"> <bit>3</bit></item>
4966 <item name="Led"> <bit>4</bit></item>
4967 <item name="LedMode"> <bit>5</bit></item>
4968 <item name="Key"> <bit>6</bit></item>
4969 <item name="AutoRepeatMode"> <bit>7</bit></item>
4972 <enum name="LedMode">
4973 <item name="Off"><value>0</value></item>
4974 <item name="On"> <value>1</value></item>
4977 <enum name="AutoRepeatMode">
4978 <item name="Off"> <value>0</value></item>
4979 <item name="On"> <value>1</value></item>
4980 <item name="Default"><value>2</value></item>
4983 <request name="ChangeKeyboardControl" opcode="102">
4985 <valueparam value-mask-type="CARD32"
4986 value-mask-name="value_mask"
4987 value-list-name="value_list" />
4990 <request name="GetKeyboardControl" opcode="103">
4992 <field type="BYTE" name="global_auto_repeat" enum="AutoRepeatMode" />
4993 <field type="CARD32" name="led_mask" />
4994 <field type="CARD8" name="key_click_percent" />
4995 <field type="CARD8" name="bell_percent" />
4996 <field type="CARD16" name="bell_pitch" />
4997 <field type="CARD16" name="bell_duration" />
4999 <list type="CARD8" name="auto_repeats"><value>32</value></list>
5003 <request name="Bell" opcode="104">
5004 <field type="INT8" name="percent" />
5007 <request name="ChangePointerControl" opcode="105">
5009 <field type="INT16" name="acceleration_numerator" />
5010 <field type="INT16" name="acceleration_denominator" />
5011 <field type="INT16" name="threshold" />
5012 <field type="BOOL" name="do_acceleration" />
5013 <field type="BOOL" name="do_threshold" />
5016 <request name="GetPointerControl" opcode="106">
5019 <field type="CARD16" name="acceleration_numerator" />
5020 <field type="CARD16" name="acceleration_denominator" />
5021 <field type="CARD16" name="threshold" />
5026 <!-- Screen saver timeout and interval can be set to -1 to restore defaults
5027 and set to 0 to disable the screen saver. -->
5029 <enum name="Blanking">
5030 <item name="NotPreferred"><value>0</value></item>
5031 <item name="Preferred"> <value>1</value></item>
5032 <item name="Default"> <value>2</value></item>
5035 <enum name="Exposures">
5036 <item name="NotAllowed"><value>0</value></item>
5037 <item name="Allowed"> <value>1</value></item>
5038 <item name="Default"> <value>2</value></item>
5041 <request name="SetScreenSaver" opcode="107">
5043 <field type="INT16" name="timeout" />
5044 <field type="INT16" name="interval" />
5045 <field type="CARD8" name="prefer_blanking" enum="Blanking" />
5046 <field type="CARD8" name="allow_exposures" enum="Exposures" />
5049 <request name="GetScreenSaver" opcode="108">
5052 <field type="CARD16" name="timeout" />
5053 <field type="CARD16" name="interval" />
5054 <field type="BYTE" name="prefer_blanking" enum="Blanking" />
5055 <field type="BYTE" name="allow_exposures" enum="Exposures" />
5060 <enum name="HostMode">
5061 <item name="Insert"><value>0</value></item>
5062 <item name="Delete"><value>1</value></item>
5065 <!-- also used and extended for Xau authentication -->
5066 <enum name="Family">
5067 <item name="Internet"> <value>0</value></item>
5068 <item name="DECnet"> <value>1</value></item>
5069 <item name="Chaos"> <value>2</value></item>
5070 <item name="ServerInterpreted"><value>5</value></item>
5071 <item name="Internet6"> <value>6</value></item>
5074 <request name="ChangeHosts" opcode="109">
5075 <field type="CARD8" name="mode" enum="HostMode" />
5076 <field type="CARD8" name="family" enum="Family" />
5078 <field type="CARD16" name="address_len" />
5079 <list type="BYTE" name="address">
5080 <fieldref>address_len</fieldref>
5084 <struct name="HOST">
5085 <field type="CARD8" name="family" enum="Family" />
5087 <field type="CARD16" name="address_len" />
5088 <list type="BYTE" name="address">
5089 <fieldref>address_len</fieldref>
5093 <request name="ListHosts" opcode="110">
5095 <field type="BYTE" name="mode" enum="AccessControl" />
5096 <field type="CARD16" name="hosts_len" />
5098 <list type="HOST" name="hosts">
5099 <fieldref>hosts_len</fieldref>
5104 <enum name="AccessControl">
5105 <item name="Disable"><value>0</value></item>
5106 <item name="Enable"> <value>1</value></item>
5109 <request name="SetAccessControl" opcode="111">
5110 <field type="CARD8" name="mode" enum="AccessControl" />
5113 <enum name="CloseDown">
5114 <item name="DestroyAll"> <value>0</value></item>
5115 <item name="RetainPermanent"><value>1</value></item>
5116 <item name="RetainTemporary"><value>2</value></item>
5119 <request name="SetCloseDownMode" opcode="112">
5120 <field type="CARD8" name="mode" enum="CloseDown" />
5124 <item name="AllTemporary"><value>0</value></item>
5127 <request name="KillClient" opcode="113">
5129 <field type="CARD32" name="resource" altenum="Kill" />
5131 <brief>kills a client</brief>
5132 <description><![CDATA[
5133 Forces a close down of the client that created the specified `resource`.
5135 <field name="resource"><![CDATA[
5136 Any resource belonging to the client (for example a Window), used to identify
5137 the client connection.
5139 The special value of `XCB_KILL_ALL_TEMPORARY`, the resources of all clients
5140 that have terminated in `RetainTemporary` (TODO) are destroyed.
5142 <error type="Value"><![CDATA[
5143 The specified `resource` does not exist.
5145 <see type="program" name="xkill" />
5150 <request name="RotateProperties" opcode="114">
5152 <field type="WINDOW" name="window" />
5153 <field type="CARD16" name="atoms_len" />
5154 <field type="INT16" name="delta" />
5155 <list type="ATOM" name="atoms">
5156 <fieldref>atoms_len</fieldref>
5160 <enum name="ScreenSaver">
5161 <item name="Reset"> <value>0</value></item>
5162 <item name="Active"><value>1</value></item>
5165 <request name="ForceScreenSaver" opcode="115">
5166 <field type="CARD8" name="mode" enum="ScreenSaver" />
5169 <!-- Reply from SetPointerMapping or SetModifierMapping -->
5170 <enum name="MappingStatus">
5171 <item name="Success"><value>0</value></item>
5172 <item name="Busy"> <value>1</value></item>
5173 <item name="Failure"><value>2</value></item>
5176 <request name="SetPointerMapping" opcode="116">
5177 <field type="CARD8" name="map_len" />
5178 <list type="CARD8" name="map">
5179 <fieldref>map_len</fieldref>
5182 <field type="BYTE" name="status" enum="MappingStatus" />
5186 <request name="GetPointerMapping" opcode="117">
5188 <field type="CARD8" name="map_len" />
5190 <list type="CARD8" name="map">
5191 <fieldref>map_len</fieldref>
5196 <enum name="MapIndex">
5197 <item name="Shift"> <value>0</value></item>
5198 <item name="Lock"> <value>1</value></item>
5199 <item name="Control"><value>2</value></item>
5200 <item name="1"> <value>3</value></item>
5201 <item name="2"> <value>4</value></item>
5202 <item name="3"> <value>5</value></item>
5203 <item name="4"> <value>6</value></item>
5204 <item name="5"> <value>7</value></item>
5207 <request name="SetModifierMapping" opcode="118">
5208 <field type="CARD8" name="keycodes_per_modifier" />
5209 <list type="KEYCODE" name="keycodes">
5211 <fieldref>keycodes_per_modifier</fieldref>
5216 <field type="BYTE" name="status" enum="MappingStatus" />
5220 <request name="GetModifierMapping" opcode="119">
5222 <field type="CARD8" name="keycodes_per_modifier" />
5224 <list type="KEYCODE" name="keycodes">
5226 <fieldref>keycodes_per_modifier</fieldref>
5234 FIXME: NoOperation should allow specifying payload length
5235 but geez, malloc()ing a 262140 byte buffer just so I have something
5236 to hand to write(2) seems silly...!
5238 <request name="NoOperation" opcode="127" />