Package version up
[platform/upstream/xproto.git] / specs / encoding.xml
1 <appendix id="protocol_encoding">
2 <title>Protocol Encoding</title>
3 <!--
4      The sections in this appendix correspond to their
5      number counterparts in the protocol document.
6 -->
7 <sect1 id='Syntactic_Conventions_b'>
8 <title>Syntactic Conventions</title>
9
10 <para>
11 All numbers are in decimal,
12 unless prefixed with #x, in which case they are in hexadecimal (base 16).
13 </para>
14
15 <para>
16 The general syntax used to describe requests, replies, errors, events, and
17 compound types is:
18 </para>
19
20 <literallayout class="monospaced">
21    <emphasis role='bold'>NameofThing</emphasis>
22    encode-form
23    ...
24    encode-form
25 </literallayout>
26
27 <para>
28 Each encode-form describes a single component.
29 </para>
30 <para>
31 For components described in the protocol as:
32 </para>
33 <literallayout class="monospaced">
34    name: TYPE
35 </literallayout>
36
37 <para>
38 the encode-form is:
39 </para>
40
41 <literallayout class="monospaced">
42    N     TYPE     name
43 </literallayout>
44
45 <para>
46 N is the number of bytes occupied in the data stream,
47 and TYPE is the interpretation of those bytes.
48 For example,
49 </para>
50
51 <literallayout class="monospaced">
52    depth: CARD8
53 </literallayout>
54
55 <para>
56 becomes:
57 </para>
58
59 <literallayout class="monospaced">
60    1     CARD8     depth
61 </literallayout>
62
63 <para>
64 For components with a static numeric value the encode-form is:
65 </para>
66
67 <literallayout class="monospaced">
68    N     value     name
69 </literallayout>
70
71 <para>
72 The value is always interpreted as an N-byte unsigned integer.
73 For example,
74 the first two bytes of a
75 <emphasis role='bold'>Window</emphasis>
76 error are always zero (indicating an
77 error in general) and three (indicating the
78 <emphasis role='bold'>Window</emphasis>
79 error in particular):
80 </para>
81
82 <literallayout class="monospaced">
83    1      0      Error
84    1      3      code
85 </literallayout>
86
87 <para>
88 For components described in the protocol as:
89 </para>
90
91 <para>
92 name:
93 { <emphasis role='bold'>Name1</emphasis>,...,
94 <emphasis role='bold'>NameI</emphasis>}
95 </para>
96
97 <para>
98 the encode-form is:
99 </para>
100
101 <literallayout class="monospaced">
102    N          name
103         value1 Name1
104         ...
105         valueI NameI
106 </literallayout>
107
108 <para>
109 The value is always interpreted as an N-byte unsigned integer.
110 Note that the size of N is sometimes larger than that strictly required
111 to encode the values.
112 For example:
113 </para>
114
115 <para>
116 class:
117 { <emphasis role='bold'>InputOutput</emphasis>,
118 <emphasis role='bold'>InputOnly</emphasis>,
119 <emphasis role='bold'>CopyFromParent</emphasis> }
120 </para>
121
122 <para>
123 becomes:
124 </para>
125
126 <literallayout class="monospaced">
127 2               class
128      0     CopyFromParent
129      1     InputOutput
130      2     InputOnly
131 </literallayout>
132
133 <para>
134 For components described in the protocol as:
135 </para>
136
137 <para>
138 NAME: TYPE or
139 <emphasis role='bold'>Alternative1 ...or</emphasis>
140 <emphasis role='bold'>AlternativeI</emphasis>
141 </para>
142
143 <para>
144 the encode-form is:
145 </para>
146
147 <literallayout class="monospaced">
148 N     TYPE               NAME
149      value1     Alternative1
150      ...
151      valueI     AlternativeI
152 </literallayout>
153
154 <para>
155 The alternative values are guaranteed not to conflict with the encoding
156 of TYPE.
157 For example:
158 </para>
159
160 <para>
161 destination: WINDOW or
162 <emphasis role='bold'>PointerWindow</emphasis>
163 or
164 <emphasis role='bold'>InputFocus</emphasis>
165 </para>
166
167 <para>
168 becomes:
169 </para>
170
171 <literallayout class="monospaced">
172 4     WINDOW          destination
173      0     PointerWindow
174      1     InputFocus
175 </literallayout>
176
177 <para>
178 For components described in the protocol as:
179 </para>
180
181 <literallayout class="monospaced">
182    value-mask: BITMASK
183 </literallayout>
184
185 <para>
186 the encode-form is:
187 </para>
188
189 <literallayout class="monospaced">
190 N     BITMASK               value-mask
191      mask1     mask-name1
192      ...
193      maskI     mask-nameI
194 </literallayout>
195
196 <para>
197 The individual bits in the mask are specified and named,
198 and N is 2 or 4.
199 The most-significant bit in a BITMASK is reserved for use in defining
200 chained (multiword) bitmasks, as extensions augment existing core requests.
201 The precise interpretation of this bit is not yet defined here,
202 although a probable mechanism is that a 1-bit indicates that another N bytes
203 of bitmask follows, with bits within the overall mask still interpreted
204 from least-significant to most-significant with an N-byte unit,
205 with N-byte units
206 interpreted in stream order, and with the overall mask being byte-swapped
207 in individual N-byte units.
208 </para>
209
210 <para>
211 For LISTofVALUE encodings, the request is followed by a section of the form:
212 </para>
213
214 <literallayout class="monospaced">
215    VALUEs
216    encode-form
217    ...
218    encode-form
219 </literallayout>
220
221 <para>
222 listing an encode-form for each VALUE.
223 The NAME in each encode-form keys to the corresponding BITMASK bit.
224 The encoding of a VALUE always occupies four bytes,
225 but the number of bytes specified in the encoding-form indicates how
226 many of the least-significant bytes are actually used;
227 the remaining bytes are unused and their values do not matter.
228 </para>
229
230 <para>
231 In various cases, the number of bytes occupied by a component will be
232 specified
233 by a lowercase single-letter variable name instead of a specific numeric
234 value, and often some other component will have its value specified as a
235 simple numeric expression involving these variables.
236 Components specified with such expressions are always interpreted
237 as unsigned integers.
238 The scope of such variables is always just the enclosing request, reply,
239 error, event, or compound type structure.
240 For example:
241 </para>
242
243 <literallayout class="monospaced">
244 2      3+n                  request length
245 4n     LISTofPOINT          points
246 </literallayout>
247
248 <para>
249 For unused bytes (the values of the bytes are undefined and do no matter),
250 the encode-form is:
251 </para>
252
253 <literallayout class="monospaced">
254    N               unused
255 </literallayout>
256
257 <para>
258 <!-- .LP -->
259 If the number of unused bytes is variable, the encode-form typically is:
260 </para>
261
262 <literallayout class="monospaced">
263    p               unused, p=pad(E)
264 </literallayout>
265
266 <para>
267 where E is some expression,
268 <phrase id="encoding:pad">
269 <indexterm zone="encoding:pad" significance="preferred"><primary>Padding</primary></indexterm>
270 and pad(E) is the number of bytes needed to round E up to a multiple of four.
271 </phrase>
272 </para>
273
274 <literallayout class="monospaced">
275    pad(E) = (4 - (E mod 4)) mod 4
276 </literallayout>
277 </sect1>
278
279 <sect1 id='Encoding::Common_Types'>
280 <title>Common Types</title>
281 <indexterm zone="Encoding::Common_Types"><primary>Types</primary><secondary>encoding</secondary></indexterm>
282
283 <variablelist>
284   <varlistentry>
285     <term>LISTofFOO</term>
286     <listitem>
287       <para>
288 In this document the LISTof notation strictly means some number of repetitions
289 of the FOO encoding;
290 the actual length of the list is encoded elsewhere.
291       </para>
292     </listitem>
293   </varlistentry>
294   <varlistentry>
295     <term>SETofFOO</term>
296     <listitem>
297       <para>
298 A set is always represented by a bitmask, with a 1-bit indicating presence in
299 the set.
300       </para>
301     </listitem>
302   </varlistentry>
303 </variablelist>
304
305 <informaltable frame='none'>
306   <tgroup cols='1' align='left' colsep='0' rowsep='0'>
307   <colspec colname='c1' colwidth='1.0*'/>
308   <tbody>
309     <row>
310       <entry>
311 BITMASK: CARD32
312       </entry>
313     </row>
314     <row>
315       <entry>
316 WINDOW: CARD32
317       </entry>
318     </row>
319     <row>
320       <entry>
321 PIXMAP: CARD32
322       </entry>
323     </row>
324     <row>
325       <entry>
326 CURSOR: CARD32
327       </entry>
328     </row>
329     <row>
330       <entry>
331 FONT: CARD32
332       </entry>
333     </row>
334     <row>
335       <entry>
336 GCONTEXT: CARD32
337       </entry>
338     </row>
339     <row>
340       <entry>
341 COLORMAP: CARD32
342       </entry>
343     </row>
344     <row>
345       <entry>
346 DRAWABLE: CARD32
347       </entry>
348     </row>
349     <row>
350       <entry>
351 FONTABLE: CARD32
352       </entry>
353     </row>
354     <row>
355       <entry>
356 ATOM: CARD32
357       </entry>
358     </row>
359     <row>
360       <entry>
361 VISUALID: CARD32
362       </entry>
363     </row>
364     <row>
365       <entry>
366 BYTE: 8-bit value
367       </entry>
368     </row>
369     <row>
370       <entry>
371 INT8: 8-bit signed integer
372       </entry>
373     </row>
374     <row>
375       <entry>
376 INT16: 16-bit signed integer
377       </entry>
378     </row>
379     <row>
380       <entry>
381 INT32: 32-bit signed integer
382       </entry>
383     </row>
384     <row>
385       <entry>
386 CARD8: 8-bit unsigned integer
387       </entry>
388     </row>
389     <row>
390       <entry>
391 CARD16: 16-bit unsigned integer
392       </entry>
393     </row>
394     <row>
395       <entry>
396 CARD32: 32-bit unsigned integer
397       </entry>
398     </row>
399     <row>
400       <entry>
401 TIMESTAMP: CARD32
402       </entry>
403     </row>
404   </tbody>
405   </tgroup>
406 </informaltable>
407
408
409 <literallayout class="monospaced">
410 BITGRAVITY
411      0     Forget
412      1     NorthWest
413      2     North
414      3     NorthEast
415      4     West
416      5     Center
417      6     East
418      7     SouthWest
419      8     South
420      9     SouthEast
421      10     Static
422
423 WINGRAVITY
424      0     Unmap
425      1     NorthWest
426      2     North
427      3     NorthEast
428      4     West
429      5     Center
430      6     East
431      7     SouthWest
432      8     South
433      9     SouthEast
434      10     Static
435
436 BOOL
437      0     False
438      1     True
439
440 SETofEVENT
441      #x00000001     KeyPress
442      #x00000002     KeyRelease
443      #x00000004     ButtonPress
444      #x00000008     ButtonRelease
445      #x00000010     EnterWindow
446      #x00000020     LeaveWindow
447      #x00000040     PointerMotion
448      #x00000080     PointerMotionHint
449      #x00000100     Button1Motion
450      #x00000200     Button2Motion
451      #x00000400     Button3Motion
452      #x00000800     Button4Motion
453      #x00001000     Button5Motion
454      #x00002000     ButtonMotion
455      #x00004000     KeymapState
456      #x00008000     Exposure
457      #x00010000     VisibilityChange
458      #x00020000     StructureNotify
459      #x00040000     ResizeRedirect
460      #x00080000     SubstructureNotify
461      #x00100000     SubstructureRedirect
462      #x00200000     FocusChange
463      #x00400000     PropertyChange
464      #x00800000     ColormapChange
465      #x01000000     OwnerGrabButton
466      #xFE000000     unused but must be zero
467
468 SETofPOINTEREVENT
469      encodings are the same as for SETofEVENT, except with
470      #xFFFF8003     unused but must be zero
471
472 SETofDEVICEEVENT
473      encodings are the same as for SETofEVENT, except with
474      #xFFFFC0B0     unused but must be zero
475
476 KEYSYM: CARD32
477 KEYCODE: CARD8
478 BUTTON: CARD8
479
480 SETofKEYBUTMASK
481      #x0001     Shift
482      #x0002     Lock
483      #x0004     Control
484      #x0008     Mod1
485      #x0010     Mod2
486      #x0020     Mod3
487      #x0040     Mod4
488      #x0080     Mod5
489      #x0100     Button1
490      #x0200     Button2
491      #x0400     Button3
492      #x0800     Button4
493      #x1000     Button5
494      #xE000     unused but must be zero
495
496 SETofKEYMASK
497      encodings are the same as for SETofKEYBUTMASK, except with
498      #xFF00          unused but must be zero
499 STRING8: LISTofCARD8
500 STRING16: LISTofCHAR2B
501
502 CHAR2B
503      1     CARD8     byte1
504      1     CARD8     byte2
505
506 POINT
507      2     INT16     x
508      2     INT16     y
509
510 RECTANGLE
511      2     INT16     x
512      2     INT16     y
513      2     CARD16    width
514      2     CARD16    height
515
516 ARC
517      2     INT16     x
518      2     INT16     y
519      2     CARD16    width
520      2     CARD16    height
521      2     INT16     angle1
522      2     INT16     angle2
523
524 HOST
525      1                         family
526            0         Internet
527            1         DECnet
528            2         Chaos
529            5         ServerInterpreted
530            6         InternetV6
531      1                         unused
532      2      n                  length of address
533      n      LISTofBYTE         address
534      p                         unused, p=pad(n)
535
536 STR
537      1      n                  length of name in bytes
538      n      STRING8            name
539
540 </literallayout>
541 </sect1>
542
543 <sect1 id='Encoding::Errors'>
544 <title>Errors</title>
545 <indexterm zone="Encoding::Errors"><primary>Error report</primary><secondary>encoding</secondary></indexterm>
546
547 <literallayout class="monospaced">
548 <emphasis role='bold'>Request</emphasis>
549      1     0                               Error
550      1     1                               code
551      2     CARD16                          sequence number
552      4                                     unused
553      2     CARD16                          minor opcode
554      1     CARD8                           major opcode
555      21                                    unused
556
557 <emphasis role='bold'>Value</emphasis>
558      1     0                               Error
559      1     2                               code
560      2     CARD16                          sequence number
561      4     &lt;32-bits&gt;                 bad value
562      2     CARD16                          minor opcode
563      1     CARD8                           major opcode
564      21                                    unused
565
566 <emphasis role='bold'>Window</emphasis>
567      1     0                               Error
568      1     3                               code
569      2     CARD16                          sequence number
570      4     CARD32                          bad resource id
571      2     CARD16                          minor opcode
572      1     CARD8                           major opcode
573      21                                    unused
574
575 <emphasis role='bold'>Pixmap</emphasis>
576      1     0                               Error
577      1     4                               code
578      2     CARD16                          sequence number
579      4     CARD32                          bad resource id
580      2     CARD16                          minor opcode
581      1     CARD8                           major opcode
582      21                                    unused
583
584 <emphasis role='bold'>Atom</emphasis>
585      1     0                               Error
586      1     5                               code
587      2     CARD16                          sequence number
588      4     CARD32                          bad atom id
589      2     CARD16                          minor opcode
590      1     CARD8                           major opcode
591      21                                    unused
592
593 <emphasis role='bold'>Cursor</emphasis>
594      1     0                               Error
595      1     6                               code
596      2     CARD16                          sequence number
597      4     CARD32                          bad resource id
598      2     CARD16                          minor opcode
599      1     CARD8                           major opcode
600      21                                    unused
601
602 <emphasis role='bold'>Font</emphasis>
603      1     0                               Error
604      1     7                               code
605      2     CARD16                          sequence number
606      4     CARD32                          bad resource id
607      2     CARD16                          minor opcode
608      1     CARD8                           major opcode
609      21                                    unused
610
611 <emphasis role='bold'>Match</emphasis>
612      1     0                               Error
613      1     8                               code
614      2     CARD16                          sequence number
615      4                                     unused
616      2     CARD16                          minor opcode
617      1     CARD8                           major opcode
618      21                                    unused
619
620 <emphasis role='bold'>Drawable</emphasis>
621      1     0                               Error
622      1     9                               code
623      2     CARD16                          sequence number
624      4     CARD32                          bad resource id
625      2     CARD16                          minor opcode
626      1     CARD8                           major opcode
627      21                                    unused
628
629 <emphasis role='bold'>Access</emphasis>
630      1     0                               Error
631      1     10                              code
632      2     CARD16                          sequence number
633      4                                     unused
634      2     CARD16                          minor opcode
635      1     CARD8                           major opcode
636      21                                    unused
637
638 <emphasis role='bold'>Alloc</emphasis>
639      1     0                               Error
640      1     11                              code
641      2     CARD16                          sequence number
642      4                                     unused
643      2     CARD16                          minor opcode
644      1     CARD8                           major opcode
645      21                                    unused
646
647 <emphasis role='bold'>Colormap</emphasis>
648      1     0                               Error
649      1     12                              code
650      2     CARD16                          sequence number
651      4     CARD32                          bad resource id
652      2     CARD16                          minor opcode
653      1     CARD8                           major opcode
654      21                                    unused
655
656 <emphasis role='bold'>GContext</emphasis>
657      1     0                               Error
658      1     13                              code
659      2     CARD16                          sequence number
660      4     CARD32                          bad resource id
661      2     CARD16                          minor opcode
662      1     CARD8                           major opcode
663      21                                    unused
664
665 <emphasis role='bold'>IDChoice</emphasis>
666      1     0                               Error
667      1     14                              code
668      2     CARD16                          sequence number
669      4     CARD32                          bad resource id
670      2     CARD16                          minor opcode
671      1     CARD8                           major opcode
672      21                                    unused
673
674 <emphasis role='bold'>Name</emphasis>
675      1     0                               Error
676      1     15                              code
677      2     CARD16                          sequence number
678      4                                     unused
679      2     CARD16                          minor opcode
680      1     CARD8                           major opcode
681      21                                    unused
682
683 <emphasis role='bold'>Length</emphasis>
684      1     0                               Error
685      1     16                              code
686      2     CARD16                          sequence number
687      4                                     unused
688      2     CARD16                          minor opcode
689      1     CARD8                           major opcode
690      21                                    unused
691
692 <emphasis role='bold'>Implementation</emphasis>
693      1     0                               Error
694      1     17                              code
695      2     CARD16                          sequence number
696      4                                     unused
697      2     CARD16                          minor opcode
698      1     CARD8                           major opcode
699      21                                    unused
700 </literallayout>
701 </sect1>
702
703 <sect1 id='Encoding::Keyboards'>
704 <title>Keyboards</title>
705
706 <para>
707 KEYCODE values are always greater than 7 (and less than 256).
708 </para>
709
710 <para>
711 KEYSYM values with the bit #x10000000 set are reserved as vendor-specific.
712 </para>
713
714 <para>
715 The names and encodings of the standard KEYSYM values are contained in
716 <link linkend="keysym_encoding">Appendix A, Keysym Encoding</link>.
717 </para>
718 </sect1>
719
720 <sect1 id='Encoding::Pointers'>
721 <title>Pointers</title>
722
723 <para>
724 BUTTON values are numbered starting with one.
725 </para>
726
727 </sect1>
728 <sect1 id='Encoding::Predefined_Atoms'>
729 <title>Predefined Atoms</title>
730 <indexterm zone="Encoding::Predefined_Atoms"><primary>Atom</primary><secondary>predefined</secondary></indexterm>
731
732 <literallayout class="monospaced">
733 PRIMARY           1      WM_NORMAL_HINTS     40
734 SECONDARY         2      WM_SIZE_HINTS       41
735 ARC               3      WM_ZOOM_HINTS       42
736 ATOM              4      MIN_SPACE           43
737 BITMAP            5      NORM_SPACE          44
738 CARDINAL          6      MAX_SPACE           45
739 COLORMAP          7      END_SPACE           46
740 CURSOR            8      SUPERSCRIPT_X       47
741 CUT_BUFFER0       9      SUPERSCRIPT_Y       48
742 CUT_BUFFER1       10     SUBSCRIPT_X         49
743 CUT_BUFFER2       11     SUBSCRIPT_Y         50
744 CUT_BUFFER3       12     UNDERLINE_POSITION  51
745 CUT_BUFFER4       13     UNDERLINE_THICKNESS 52
746 CUT_BUFFER5       14     STRIKEOUT_ASCENT    53
747 CUT_BUFFER6       15     STRIKEOUT_DESCENT   54
748 CUT_BUFFER7       16     ITALIC_ANGLE        55
749 DRAWABLE          17     X_HEIGHT            56
750 FONT              18     QUAD_WIDTH          57
751 INTEGER           19     WEIGHT              58
752 PIXMAP            20     POINT_SIZE          59
753 POINT             21     RESOLUTION          60
754 RECTANGLE         22     COPYRIGHT           61
755 RESOURCE_MANAGER  23     NOTICE              62
756 RGB_COLOR_MAP     24     FONT_NAME           63
757 RGB_BEST_MAP      25     FAMILY_NAME         64
758 RGB_BLUE_MAP      26     FULL_NAME           65
759 RGB_DEFAULT_MAP   27     CAP_HEIGHT          66
760 RGB_GRAY_MAP      28     WM_CLASS            67
761 RGB_GREEN_MAP     29     WM_TRANSIENT_FOR    68
762 RGB_RED_MAP       30
763 STRING            31
764 VISUALID          32
765 WINDOW            33
766 WM_COMMAND        34
767 WM_HINTS          35
768 WM_CLIENT_MACHINE 36
769 WM_ICON_NAME      37
770 WM_ICON_SIZE      38
771 WM_NAME           39
772 </literallayout>
773 </sect1>
774
775 <sect1 id='Encoding::Connection_Setup'>
776 <title>Connection Setup</title>
777
778 <para>
779 For TCP connections,
780 displays on a given host are numbered starting from 0,
781 and the server for display N listens and accepts connections on port 6000 + N.
782 For DECnet connections,
783 displays on a given host are numbered starting from 0,
784 and the server for display N listens and accepts connections on the object
785 name obtained by concatenating "X$X" with the decimal representation of N,
786 for example, X$X0 and X$X1.
787 </para>
788
789 <para>
790 Information sent by the client at connection setup:
791 </para>
792
793 <literallayout class="monospaced">
794      1                       byte-order
795           #x42     MSB first
796           #x6C     LSB first
797      1                       unused
798      2     CARD16            protocol-major-version
799      2     CARD16            protocol-minor-version
800      2     n                 length of authorization-protocol-name
801      2     d                 length of authorization-protocol-data
802      2                       unused
803      n     STRING8           authorization-protocol-name
804      p                       unused, p=pad(n)
805      d     STRING8           authorization-protocol-data
806      q                       unused, q=pad(d)
807 </literallayout>
808
809 <para>
810 Except where explicitly noted in the protocol,
811 all 16-bit and 32-bit quantities sent by the client must be transmitted
812 with the specified byte order,
813 and all 16-bit and 32-bit quantities returned by the server will be transmitted
814 with this byte order.
815 </para>
816
817 <para>
818 Information received by the client if the connection is refused:
819 </para>
820
821 <literallayout class="monospaced">
822      1     0                 Failed
823      1     n                 length of reason in bytes
824      2     CARD16            protocol-major-version
825      2     CARD16            protocol-minor-version
826      2     (n+p)/4           length in 4-byte units of "additional data"
827      n     STRING8           reason
828      p                       unused, p=pad(n)
829 </literallayout>
830
831 <para>
832 Information received by the client if further authentication is required:
833 </para>
834
835 <literallayout class="monospaced">
836      1     2                 Authenticate
837      5                       unused
838      2     (n+p)/4           length in 4-byte units of "additional data"
839      n     STRING8           reason
840      p                       unused, p=pad(n)
841 </literallayout>
842
843 <para>
844 Information received by the client if the connection is accepted:
845 </para>
846
847 <literallayout class="monospaced">
848      1     1                               Success
849      1                                     unused
850      2     CARD16                          protocol-major-version
851      2     CARD16                          protocol-minor-version
852      2     8+2n+(v+p+m)/4                  length in 4-byte units of
853                                            "additional data"
854      4     CARD32                          release-number
855      4     CARD32                          resource-id-base
856      4     CARD32                          resource-id-mask
857      4     CARD32                          motion-buffer-size
858      2     v                               length of vendor
859      2     CARD16                          maximum-request-length
860      1     CARD8                           number of SCREENs in roots
861      1     n                               number for FORMATs in
862                                            pixmap-formats
863      1                                     image-byte-order
864           0     LSBFirst
865           1     MSBFirst
866      1                                     bitmap-format-bit-order
867           0     LeastSignificant
868           1     MostSignificant
869      1     CARD8                           bitmap-format-scanline-unit
870      1     CARD8                           bitmap-format-scanline-pad
871      1     KEYCODE                         min-keycode
872      1     KEYCODE                         max-keycode
873      4                                     unused
874      v     STRING8                         vendor
875      p                                     unused, p=pad(v)
876      8n     LISTofFORMAT                   pixmap-formats
877      m     LISTofSCREEN                    roots (m is always a multiple of 4)
878 </literallayout>
879
880 <literallayout class="monospaced">
881 FORMAT
882      1     CARD8                           depth
883      1     CARD8                           bits-per-pixel
884      1     CARD8                           scanline-pad
885      5                                     unused
886 </literallayout>
887
888 <literallayout class="monospaced">
889 SCREEN
890      4     WINDOW                          root
891      4     COLORMAP                        default-colormap
892      4     CARD32                          white-pixel
893      4     CARD32                          black-pixel
894      4     SETofEVENT                      current-input-masks
895      2     CARD16                          width-in-pixels
896      2     CARD16                          height-in-pixels
897      2     CARD16                          width-in-millimeters
898      2     CARD16                          height-in-millimeters
899      2     CARD16                          min-installed-maps
900      2     CARD16                          max-installed-maps
901      4     VISUALID                        root-visual
902      1                                     backing-stores
903           0     Never
904           1     WhenMapped
905           2     Always
906      1     BOOL                            save-unders
907      1     CARD8                           root-depth
908      1     CARD8                           number of DEPTHs in allowed-depths
909      n     LISTofDEPTH                     allowed-depths (n is always a
910                                            multiple of 4)
911 </literallayout>
912
913 <literallayout class="monospaced">
914 DEPTH
915      1     CARD8                           depth
916      1                                     unused
917      2     n                               number of VISUALTYPES in visuals
918      4                                     unused
919      24n     LISTofVISUALTYPE              visuals
920 </literallayout>
921
922 <literallayout class="monospaced">
923 VISUALTYPE
924      4     VISUALID                        visual-id
925      1                                     class
926           0     StaticGray
927           1     GrayScale
928           2     StaticColor
929           3     PseudoColor
930           4     TrueColor
931           5     DirectColor
932      1     CARD8                           bits-per-rgb-value
933      2     CARD16                          colormap-entries
934      4     CARD32                          red-mask
935      4     CARD32                          green-mask
936      4     CARD32                          blue-mask
937      4                                     unused
938 </literallayout>
939 </sect1>
940
941 <sect1 id='Encoding::Requests'>
942 <title>Requests</title>
943 <indexterm zone="Encoding::Requests"><primary>Request</primary><secondary>encoding</secondary></indexterm>
944
945 <literallayout class="monospaced">
946 <link linkend="requests:CreateWindow"><emphasis role='bold'>CreateWindow</emphasis></link>
947      1     1                               opcode
948      1     CARD8                           depth
949      2     8+n                             request length
950      4     WINDOW                          wid
951      4     WINDOW                          parent
952      2     INT16                           x
953      2     INT16                           y
954      2     CARD16                          width
955      2     CARD16                          height
956      2     CARD16                          border-width
957      2                                     class
958           0     CopyFromParent
959           1     InputOutput
960           2     InputOnly
961      4     VISUALID                        visual
962           0     CopyFromParent
963      4     BITMASK                         value-mask (has n bits set to 1)
964           #x00000001     background-pixmap
965           #x00000002     background-pixel
966           #x00000004     border-pixmap
967           #x00000008     border-pixel
968           #x00000010     bit-gravity
969           #x00000020     win-gravity
970           #x00000040     backing-store
971           #x00000080     backing-planes
972           #x00000100     backing-pixel
973           #x00000200     override-redirect
974           #x00000400     save-under
975           #x00000800     event-mask
976           #x00001000     do-not-propagate-mask
977           #x00002000     colormap
978           #x00004000     cursor
979      4n     LISTofVALUE                    value-list
980
981   VALUEs
982      4     PIXMAP                          background-pixmap
983           0     None
984           1     ParentRelative
985      4     CARD32                          background-pixel
986      4     PIXMAP                          border-pixmap
987           0     CopyFromParent
988      4     CARD32                          border-pixel
989      1     BITGRAVITY                      bit-gravity
990      1     WINGRAVITY                      win-gravity
991      1                                     backing-store
992           0     NotUseful
993           1     WhenMapped
994           2     Always
995      4     CARD32                          backing-planes
996      4     CARD32                          backing-pixel
997      1     BOOL                            override-redirect
998      1     BOOL                            save-under
999      4     SETofEVENT                      event-mask
1000      4     SETofDEVICEEVENT                do-not-propagate-mask
1001      4     COLORMAP                        colormap
1002           0     CopyFromParent
1003      4     CURSOR                          cursor
1004           0     None
1005
1006 <link linkend="requests:ChangeWindowAttributes"><emphasis role='bold'>ChangeWindowAttributes</emphasis></link>
1007      1     2                               opcode
1008      1                                     unused
1009      2     3+n                             request length
1010      4     WINDOW                          window
1011      4     BITMASK                         value-mask (has n bits set to 1)
1012           encodings are the same as for CreateWindow
1013      4n     LISTofVALUE                    value-list
1014           encodings are the same as for CreateWindow
1015
1016 <link linkend="requests:GetWindowAttributes"><emphasis role='bold'>GetWindowAttributes</emphasis></link>
1017      1     3                               opcode
1018      1                                     unused
1019      2     2                               request length
1020      4     WINDOW                          window
1021
1022 â–¶
1023      1     1                               Reply
1024      1                                     backing-store
1025           0     NotUseful
1026           1     WhenMapped
1027           2     Always
1028      2     CARD16                          sequence number
1029      4     3                               reply length
1030      4     VISUALID                        visual
1031      2                                     class
1032           1     InputOutput
1033           2     InputOnly
1034      1     BITGRAVITY                      bit-gravity
1035      1     WINGRAVITY                      win-gravity
1036      4     CARD32                          backing-planes
1037      4     CARD32                          backing-pixel
1038      1     BOOL                            save-under
1039      1     BOOL                            map-is-installed
1040      1                                     map-state
1041           0     Unmapped
1042           1     Unviewable
1043           2     Viewable
1044      1     BOOL                            override-redirect
1045      4     COLORMAP                        colormap
1046           0     None
1047      4     SETofEVENT                      all-event-masks
1048      4     SETofEVENT                      your-event-mask
1049      2     SETofDEVICEEVENT                do-not-propagate-mask
1050      2                                     unused
1051
1052 <link linkend="requests:DestroyWindow"><emphasis role='bold'>DestroyWindow</emphasis></link>
1053      1     4                               opcode
1054      1                                     unused
1055      2     2                               request length
1056      4     WINDOW                          window
1057
1058 <link linkend="requests:DestroySubwindows"><emphasis role='bold'>DestroySubwindows</emphasis></link>
1059      1     5                               opcode
1060      1                                     unused
1061      2     2                               request length
1062      4     WINDOW                          window
1063
1064 <link linkend="requests:ChangeSaveSet"><emphasis role='bold'>ChangeSaveSet</emphasis></link>
1065      1     6                               opcode
1066      1                                     mode
1067           0     Insert
1068           1     Delete
1069      2     2                               request length
1070      4     WINDOW                          window
1071
1072 <link linkend="requests:ReparentWindow"><emphasis role='bold'>ReparentWindow</emphasis></link>
1073      1     7                               opcode
1074      1                                     unused
1075      2     4                               request length
1076      4     WINDOW                          window
1077      4     WINDOW                          parent
1078      2     INT16                           x
1079      2     INT16                           y
1080
1081 <link linkend="requests:MapWindow"><emphasis role='bold'>MapWindow</emphasis></link>
1082      1     8                               opcode
1083      1                                     unused
1084      2     2                               request length
1085      4     WINDOW                          window
1086
1087 <link linkend="requests:MapSubwindows"><emphasis role='bold'>MapSubwindows</emphasis></link>
1088      1     9                               opcode
1089      1                                     unused
1090      2     2                               request length
1091      4     WINDOW                          window
1092
1093 <link linkend="requests:UnmapWindow"><emphasis role='bold'>UnmapWindow</emphasis></link>
1094      1     10                              opcode
1095      1                                     unused
1096      2     2                               request length
1097      4     WINDOW                          window
1098
1099 <link linkend="requests:UnmapSubwindows"><emphasis role='bold'>UnmapSubwindows</emphasis></link>
1100      1     11                              opcode
1101      1                                     unused
1102      2     2                               request length
1103      4     WINDOW                          window
1104
1105 <link linkend="requests:ConfigureWindow"><emphasis role='bold'>ConfigureWindow</emphasis></link>
1106      1     12                              opcode
1107      1                                     unused
1108      2     3+n                             request length
1109      4     WINDOW                          window
1110      2     BITMASK                         value-mask (has n bits set to 1)
1111           #x0001     x
1112           #x0002     y
1113           #x0004     width
1114           #x0008     height
1115           #x0010     border-width
1116           #x0020     sibling
1117           #x0040     stack-mode
1118      2               unused
1119      4n     LISTofVALUE                    value-list
1120
1121   VALUEs
1122      2     INT16                           x
1123      2     INT16                           y
1124      2     CARD16                          width
1125      2     CARD16                          height
1126      2     CARD16                          border-width
1127      4     WINDOW                          sibling
1128      1                                     stack-mode
1129           0     Above
1130           1     Below
1131           2     TopIf
1132           3     BottomIf
1133           4     Opposite
1134
1135 <link linkend="requests:CirculateWindow"><emphasis role='bold'>CirculateWindow</emphasis></link>
1136      1     13                              opcode
1137      1                                     direction
1138           0     RaiseLowest
1139           1     LowerHighest
1140      2     2                               request length
1141      4     WINDOW                          window
1142
1143 <link linkend="requests:GetGeometry"><emphasis role='bold'>GetGeometry</emphasis></link>
1144      1     14                              opcode
1145      1                                     unused
1146      2     2                               request length
1147      4     DRAWABLE                        drawable
1148
1149 â–¶
1150      1     1                               Reply
1151      1     CARD8                           depth
1152      2     CARD16                          sequence number
1153      4     0                               reply length
1154      4     WINDOW                          root
1155      2     INT16                           x
1156      2     INT16                           y
1157      2     CARD16                          width
1158      2     CARD16                          height
1159      2     CARD16                          border-width
1160      10                                    unused
1161
1162 <link linkend="requests:QueryTree"><emphasis role='bold'>QueryTree</emphasis></link>
1163      1     15                              opcode
1164      1                                     unused
1165      2     2                               request length
1166      4     WINDOW                          window
1167
1168 â–¶
1169      1     1                               Reply
1170      1                                     unused
1171      2     CARD16                          sequence number
1172      4     n                               reply length
1173      4     WINDOW                          root
1174      4     WINDOW                          parent
1175           0     None
1176      2     n                               number of WINDOWs in children
1177      14                                    unused
1178      4n     LISTofWINDOW                   children
1179
1180 <link linkend="requests:InternAtom"><emphasis role='bold'>InternAtom</emphasis></link>
1181      1     16                              opcode
1182      1     BOOL                            only-if-exists
1183      2     2+(n+p)/4                       request length
1184      2     n                               length of name
1185      2                                     unused
1186      n     STRING8                         name
1187      p                                     unused, p=pad(n)
1188
1189 â–¶
1190      1     1                               Reply
1191      1                                     unused
1192      2     CARD16                          sequence number
1193      4     0                               reply length
1194      4     ATOM                            atom
1195            0     None
1196      20                                    unused
1197
1198 <link linkend="requests:GetAtomName"><emphasis role='bold'>GetAtomName</emphasis></link>
1199      1     17                              opcode
1200      1                                     unused
1201      2     2                               request length
1202      4     ATOM                            atom
1203
1204 â–¶
1205      1     1                               Reply
1206      1                                     unused
1207      2     CARD16                          sequence number
1208      4     (n+p)/4                         reply length
1209      2     n                               length of name
1210      22                                    unused
1211      n     STRING8                         name
1212      p                                     unused, p=pad(n)
1213
1214 <link linkend="requests:ChangeProperty"><emphasis role='bold'>ChangeProperty</emphasis></link>
1215      1     18                              opcode
1216      1                                     mode
1217           0     Replace
1218           1     Prepend
1219           2     Append
1220      2     6+(n+p)/4                       request length
1221      4     WINDOW                          window
1222      4     ATOM                            property
1223      4     ATOM                            type
1224      1     CARD8                           format
1225      3                                     unused
1226      4     CARD32                          length of data in format units
1227                     (= n for format = 8)
1228                     (= n/2 for format = 16)
1229                     (= n/4 for format = 32)
1230      n     LISTofBYTE                      data
1231                     (n is a multiple of 2 for format = 16)
1232                     (n is a multiple of 4 for format = 32)
1233      p                                     unused, p=pad(n)
1234
1235
1236 <link linkend="requests:DeleteProperty"><emphasis role='bold'>DeleteProperty</emphasis></link>
1237      1     19                              opcode
1238      1                                     unused
1239      2     3                               request length
1240      4     WINDOW                          window
1241      4     ATOM                            property
1242
1243 <link linkend="requests:GetProperty"><emphasis role='bold'>GetProperty</emphasis></link>
1244      1     20                              opcode
1245      1     BOOL                            delete
1246      2     6                               request length
1247      4     WINDOW                          window
1248      4     ATOM                            property
1249      4     ATOM                            type
1250           0     AnyPropertyType
1251      4     CARD32                          long-offset
1252      4     CARD32                          long-length
1253
1254 â–¶
1255      1     1                               Reply
1256      1     CARD8                           format
1257      2     CARD16                          sequence number
1258      4     (n+p)/4                         reply length
1259      4     ATOM                            type
1260           0     None
1261      4     CARD32                          bytes-after
1262      4     CARD32                          length of value in format units
1263                     (= 0 for format = 0)
1264                     (= n for format = 8)
1265                     (= n/2 for format = 16)
1266                     (= n/4 for format = 32)
1267      12                                    unused
1268      n     LISTofBYTE                      value
1269                     (n is zero for format = 0)
1270                     (n is a multiple of 2 for format = 16)
1271                     (n is a multiple of 4 for format = 32)
1272      p                                     unused, p=pad(n)
1273
1274 <link linkend="requests:ListProperties"><emphasis role='bold'>ListProperties</emphasis></link>
1275      1     21                              opcode
1276      1                                     unused
1277      2     2                               request length
1278      4     WINDOW                          window
1279
1280 â–¶
1281      1     1                               Reply
1282      1                                     unused
1283      2     CARD16                          sequence number
1284      4     n                               reply length
1285      2     n                               number of ATOMs in atoms
1286      22                                    unused
1287      4n     LISTofATOM                     atoms
1288
1289 <link linkend="requests:SetSelectionOwner"><emphasis role='bold'>SetSelectionOwner</emphasis></link>
1290      1     22                              opcode
1291      1                                     unused
1292      2     4                               request length
1293      4     WINDOW                          owner
1294           0     None
1295      4     ATOM                            selection
1296      4     TIMESTAMP                       time
1297           0     CurrentTime
1298
1299 <link linkend="requests:GetSelectionOwner"><emphasis role='bold'>GetSelectionOwner</emphasis></link>
1300      1     23                              opcode
1301      1                                     unused
1302      2     2                               request length
1303      4     ATOM                            selection
1304
1305 â–¶
1306      1     1                               Reply
1307      1                                     unused
1308      2     CARD16                          sequence number
1309      4     0                               reply length
1310      4     WINDOW                          owner
1311           0     None
1312      20                                    unused
1313
1314 <link linkend="requests:ConvertSelection"><emphasis role='bold'>ConvertSelection</emphasis></link>
1315      1     24                              opcode
1316      1                                     unused
1317      2     6                               request length
1318      4     WINDOW                          requestor
1319      4     ATOM                            selection
1320      4     ATOM                            target
1321      4     ATOM                            property
1322           0     None
1323      4     TIMESTAMP                       time
1324           0     CurrentTime
1325
1326 <link linkend="requests:SendEvent"><emphasis role='bold'>SendEvent</emphasis></link>
1327      1     25                              opcode
1328      1     BOOL                            propagate
1329      2     11                              requestlength
1330      4     WINDOW                          destination
1331           0     PointerWindow
1332           1     InputFocus
1333      4     SETofEVENT                      event-mask
1334      32                                    event
1335           standard event format (see <link linkend='Events'>the Events section</link>)
1336
1337 <link linkend="requests:GrabPointer"><emphasis role='bold'>GrabPointer</emphasis></link>
1338      1     26                              opcode
1339      1     BOOL                            owner-events
1340      2     6                               request length
1341      4     WINDOW                          grab-window
1342      2     SETofPOINTEREVENT               event-mask
1343      1                                     pointer-mode
1344           0     Synchronous
1345           1     Asynchronous
1346      1                                     keyboard-mode
1347           0     Synchronous
1348           1     Asynchronous
1349      4     WINDOW                          confine-to
1350           0     None
1351      4     CURSOR                          cursor
1352           0     None
1353      4     TIMESTAMP                       time
1354           0     CurrentTime
1355
1356 â–¶
1357      1     1                               Reply
1358      1                                     status
1359           0     Success
1360           1     AlreadyGrabbed
1361           2     InvalidTime
1362           3     NotViewable
1363           4     Frozen
1364      2     CARD16                          sequence number
1365      4     0                               reply length
1366      24                                    unused
1367
1368 <link linkend="requests:UngrabPointer"><emphasis role='bold'>UngrabPointer</emphasis></link>
1369      1     27                              opcode
1370      1                                     unused
1371      2     2                               request length
1372      4     TIMESTAMP                       time
1373           0     CurrentTime
1374
1375 <link linkend="requests:GrabButton"><emphasis role='bold'>GrabButton</emphasis></link>
1376      1     28                              opcode
1377      1     BOOL                            owner-events
1378      2     6                               request length
1379      4     WINDOW                          grab-window
1380      2     SETofPOINTEREVENT               event-mask
1381      1                                     pointer-mode
1382           0     Synchronous
1383           1     Asynchronous
1384      1                                     keyboard-mode
1385           0     Synchronous
1386           1     Asynchronous
1387      4     WINDOW                          confine-to
1388           0     None
1389      4     CURSOR                          cursor
1390           0     None
1391      1     BUTTON                          button
1392           0     AnyButton
1393      1                                     unused
1394      2     SETofKEYMASK                    modifiers
1395           #x8000                           AnyModifier
1396
1397 <link linkend="requests:UngrabButton"><emphasis role='bold'>UngrabButton</emphasis></link>
1398      1     29                              opcode
1399      1     BUTTON                          button
1400           0     AnyButton
1401      2     3                               request length
1402      4     WINDOW                          grab-window
1403      2     SETofKEYMASK                    modifiers
1404           #x8000                           AnyModifier
1405      2                                     unused
1406
1407 <link linkend="requests:ChangeActivePointerGrab"><emphasis role='bold'>ChangeActivePointerGrab</emphasis></link>
1408      1     30                              opcode
1409      1                                     unused
1410      2     4                               request length
1411      4     CURSOR                          cursor
1412           0     None
1413      4     TIMESTAMP                       time
1414           0     CurrentTime
1415      2     SETofPOINTEREVENT               event-mask
1416      2                                     unused
1417
1418 <link linkend="requests:GrabKeyboard"><emphasis role='bold'>GrabKeyboard</emphasis></link>
1419      1     31                              opcode
1420      1     BOOL                            owner-events
1421      2     4                               request length
1422      4     WINDOW                          grab-window
1423      4     TIMESTAMP                       time
1424           0     CurrentTime
1425      1                                     pointer-mode
1426           0     Synchronous
1427           1     Asynchronous
1428      1                                     keyboard-mode
1429           0     Synchronous
1430           1     Asynchronous
1431      2                                     unused
1432
1433 â–¶
1434      1     1                               Reply
1435      1                                     status
1436           0     Success
1437           1     AlreadyGrabbed
1438           2     InvalidTime
1439           3     NotViewable
1440           4     Frozen
1441      2     CARD16                          sequence number
1442      4     0                               reply length
1443      24                                    unused
1444
1445 <link linkend="requests:UngrabKeyboard"><emphasis role='bold'>UngrabKeyboard</emphasis></link>
1446      1     32                              opcode
1447      1                                     unused
1448      2     2                               request length
1449      4     TIMESTAMP                       time
1450           0     CurrentTime
1451
1452 <link linkend="requests:GrabKey"><emphasis role='bold'>GrabKey</emphasis></link>
1453      1     33                              opcode
1454      1     BOOL                            owner-events
1455      2     4                               request length
1456      4     WINDOW                          grab-window
1457      2     SETofKEYMASK                    modifiers
1458           #x8000     AnyModifier
1459      1     KEYCODE                         key
1460           0     AnyKey
1461      1                                     pointer-mode
1462           0     Synchronous
1463           1     Asynchronous
1464      1                                     keyboard-mode
1465           0     Synchronous
1466           1     Asynchronous
1467      3                                     unused
1468
1469 <link linkend="requests:UngrabKey"><emphasis role='bold'>UngrabKey</emphasis></link>
1470      1     34                              opcode
1471      1     KEYCODE                         key
1472           0     AnyKey
1473      2     3                               request length
1474      4     WINDOW                          grab-window
1475      2     SETofKEYMASK                    modifiers
1476           #x8000     AnyModifier
1477      2                                     unused
1478
1479 <link linkend="requests:AllowEvents"><emphasis role='bold'>AllowEvents</emphasis></link>
1480      1     35                              opcode
1481      1                                     mode
1482           0     AsyncPointer
1483           1     SyncPointer
1484           2     ReplayPointer
1485           3     AsyncKeyboard
1486           4     SyncKeyboard
1487           5     ReplayKeyboard
1488           6     AsyncBoth
1489           7     SyncBoth
1490      2     2                               request length
1491      4     TIMESTAMP                       time
1492           0     CurrentTime
1493
1494 <link linkend="requests:GrabServer"><emphasis role='bold'>GrabServer</emphasis></link>
1495      1     36                              opcode
1496      1                                     unused
1497      2     1                               request length
1498
1499 <link linkend="requests:UngrabServer"><emphasis role='bold'>UngrabServer</emphasis></link>
1500      1     37                              opcode
1501      1                                     unused
1502      2     1                               request length
1503
1504 <link linkend="requests:QueryPointer"><emphasis role='bold'>QueryPointer</emphasis></link>
1505      1     38                              opcode
1506      1                                     unused
1507      2     2                               request length
1508      4     WINDOW                          window
1509
1510 â–¶
1511      1     1                               Reply
1512      1     BOOL                            same-screen
1513      2     CARD16                          sequence number
1514      4     0                               reply length
1515      4     WINDOW                          root
1516      4     WINDOW                          child
1517           0     None
1518      2     INT16                           root-x
1519      2     INT16                           root-y
1520      2     INT16                           win-x
1521      2     INT16                           win-y
1522      2     SETofKEYBUTMASK                 mask
1523      6                                     unused
1524
1525 <link linkend="requests:GetMotionEvents"><emphasis role='bold'>GetMotionEvents</emphasis></link>
1526      1     39                              opcode
1527      1                                     unused
1528      2     4                               request length
1529      4     WINDOW                          window
1530      4     TIMESTAMP                       start
1531           0     CurrentTime
1532      4     TIMESTAMP                       stop
1533           0     CurrentTime
1534
1535 â–¶
1536      1     1                               Reply
1537      1                                     unused
1538      2     CARD16                          sequence number
1539      4     2n                              reply length
1540      4     n                               number of TIMECOORDs in events
1541      20                                    unused
1542      8n     LISTofTIMECOORD                events
1543
1544   TIMECOORD
1545      4     TIMESTAMP                       time
1546      2     INT16                           x
1547      2     INT16                           y
1548
1549 <link linkend="requests:TranslateCoordinates"><emphasis role='bold'>TranslateCoordinates</emphasis></link>
1550      1     40                              opcode
1551      1                                     unused
1552      2     4                               request length
1553      4     WINDOW                          src-window
1554      4     WINDOW                          dst-window
1555      2     INT16                           src-x
1556      2     INT16                           src-y
1557 â–¶
1558      1     1                               Reply
1559      1     BOOL                            same-screen
1560      2     CARD16                          sequence number
1561      4     0                               reply length
1562      4     WINDOW                          child
1563           0     None
1564      2     INT16                           dst-x
1565      2     INT16                           dst-y
1566      16                                    unused
1567
1568 <link linkend="requests:WarpPointer"><emphasis role='bold'>WarpPointer</emphasis></link>
1569      1     41                              opcode
1570      1                                     unused
1571      2     6                               request length
1572      4     WINDOW                          src-window
1573           0     None
1574      4     WINDOW                          dst-window
1575           0     None
1576      2     INT16                           src-x
1577      2     INT16                           src-y
1578      2     CARD16                          src-width
1579      2     CARD16                          src-height
1580      2     INT16                           dst-x
1581      2     INT16                           dst-y
1582
1583 <link linkend="requests:SetInputFocus"><emphasis role='bold'>SetInputFocus</emphasis></link>
1584      1     42                              opcode
1585      1                                     revert-to
1586           0     None
1587           1     PointerRoot
1588           2     Parent
1589      2     3                               request length
1590      4     WINDOW                          focus
1591           0     None
1592           1     PointerRoot
1593      4     TIMESTAMP                       time
1594           0     CurrentTime
1595
1596 <link linkend="requests:GetInputFocus"><emphasis role='bold'>GetInputFocus</emphasis></link>
1597      1     43                              opcode
1598      1                                     unused
1599      2     1                               request length
1600
1601 â–¶
1602      1     1                               Reply
1603      1                                     revert-to
1604           0     None
1605           1     PointerRoot
1606           2     Parent
1607      2     CARD16                          sequence number
1608      4     0                               reply length
1609      4     WINDOW                          focus
1610           0     None
1611           1     PointerRoot
1612      20                                    unused
1613
1614 <link linkend="requests:QueryKeymap"><emphasis role='bold'>QueryKeymap</emphasis></link>
1615      1     44                              opcode
1616      1                                     unused
1617      2     1                               request length
1618
1619 â–¶
1620      1     1                               Reply
1621      1                                     unused
1622      2     CARD16                          sequence number
1623      4     2                               reply length
1624      32     LISTofCARD8                    keys
1625
1626 <link linkend="requests:OpenFont"><emphasis role='bold'>OpenFont</emphasis></link>
1627      1     45                              opcode
1628      1                                     unused
1629      2     3+(n+p)/4                       request length
1630      4     FONT                            fid
1631      2     n                               length of name
1632      2                                     unused
1633      n     STRING8                         name
1634      p                                     unused, p=pad(n)
1635
1636 <link linkend="requests:CloseFont"><emphasis role='bold'>CloseFont</emphasis></link>
1637      1     46                              opcode
1638      1                                     unused
1639      2     2                               request length
1640      4     FONT                            font
1641
1642 <link linkend="requests:QueryFont"><emphasis role='bold'>QueryFont</emphasis></link>
1643      1     47                              opcode
1644      1                                     unused
1645      2     2                               request length
1646      4     FONTABLE                        font
1647
1648 â–¶
1649      1     1                               Reply
1650      1                                     unused
1651      2     CARD16                          sequence number
1652      4     7+2n+3m                         reply length
1653      12     CHARINFO                       min-bounds
1654      4                                     unused
1655      12     CHARINFO                       max-bounds
1656      4                                     unused
1657      2     CARD16                          min-char-or-byte2
1658      2     CARD16                          max-char-or-byte2
1659      2     CARD16                          default-char
1660      2     n                               number of FONTPROPs in properties
1661      1                                     draw-direction
1662           0     LeftToRight
1663           1     RightToLeft
1664      1     CARD8                           min-byte1
1665      1     CARD8                           max-byte1
1666      1     BOOL                            all-chars-exist
1667      2     INT16                           font-ascent
1668      2     INT16                           font-descent
1669      4     m                               number of CHARINFOs in char-infos
1670      8n     LISTofFONTPROP                 properties
1671      12m     LISTofCHARINFO                char-infos
1672
1673   FONTPROP
1674      4     ATOM                            name
1675      4     &lt;32-bits&gt;                 value
1676
1677   CHARINFO
1678      2     INT16                           left-side-bearing
1679      2     INT16                           right-side-bearing
1680      2     INT16                           character-width
1681      2     INT16                           ascent
1682      2     INT16                           descent
1683      2     CARD16                          attributes
1684
1685 <link linkend="requests:QueryTextExtents"><emphasis role='bold'>QueryTextExtents</emphasis></link>
1686      1     48                              opcode
1687      1     BOOL                            odd length, True if p = 2
1688      2     2+(2n+p)/4                      request length
1689      4     FONTABLE                        font
1690      2n     STRING16                       string
1691      p                                     unused, p=pad(2n)
1692
1693 â–¶
1694      1     1                               Reply
1695      1                                     draw-direction
1696           0     LeftToRight
1697           1     RightToLeft
1698      2     CARD16                          sequence number
1699      4     0                               reply length
1700      2     INT16                           font-ascent
1701      2     INT16                           font-descent
1702      2     INT16                           overall-ascent
1703      2     INT16                           overall-descent
1704      4     INT32                           overall-width
1705      4     INT32                           overall-left
1706      4     INT32                           overall-right
1707      4                                     unused
1708
1709 <link linkend="requests:ListFonts"><emphasis role='bold'>ListFonts</emphasis></link>
1710      1     49                              opcode
1711      1                                     unused
1712      2     2+(n+p)/4                       request length
1713      2     CARD16                          max-names
1714      2     n                               length of pattern
1715      n     STRING8                         pattern
1716      p                                     unused, p=pad(n)
1717
1718 â–¶
1719      1     1                               Reply
1720      1                                     unused
1721      2     CARD16                          sequence number
1722      4     (n+p)/4                         reply length
1723      2     CARD16                          number of STRs in names
1724      22                                    unused
1725      n     LISTofSTR                       names
1726      p                                     unused, p=pad(n)
1727
1728 <link linkend="requests:ListFontsWithInfo"><emphasis role='bold'>ListFontsWithInfo</emphasis></link>
1729      1     50                              opcode
1730      1                                     unused
1731      2     2+(n+p)/4                       request length
1732      2     CARD16                          max-names
1733      2     n                               length of pattern
1734      n     STRING8                         pattern
1735      p                                     unused, p=pad(n)
1736
1737 â–¶ (except for last in series)
1738      1     1                               Reply
1739      1     n                               length of name in bytes
1740      2     CARD16                          sequence number
1741      4     7+2m+(n+p)/4                    reply length
1742      12     CHARINFO                       min-bounds
1743      4                                     unused
1744      12     CHARINFO                       max-bounds
1745      4                                     unused
1746      2     CARD16                          min-char-or-byte2
1747      2     CARD16                          max-char-or-byte2
1748      2     CARD16                          default-char
1749      2     m                               number of FONTPROPs in properties
1750      1                                     draw-direction
1751           0     LeftToRight
1752           1     RightToLeft
1753      1     CARD8                           min-byte1
1754      1     CARD8                           max-byte1
1755      1     BOOL                            all-chars-exist
1756      2     INT16                           font-ascent
1757      2     INT16                           font-descent
1758      4     CARD32                          replies-hint
1759      8m     LISTofFONTPROP                 properties
1760      n     STRING8                         name
1761      p                                     unused, p=pad(n)
1762
1763   FONTPROP
1764      encodings are the same as for QueryFont
1765
1766   CHARINFO
1767      encodings are the same as for QueryFont
1768
1769 â–¶ (last in series)
1770      1     1                               Reply
1771      1     0                               last-reply indicator
1772      2     CARD16                          sequence number
1773      4     7                               reply length
1774      52                                    unused
1775
1776 <link linkend="requests:SetFontPath"><emphasis role='bold'>SetFontPath</emphasis></link>
1777      1     51                              opcode
1778      1                                     unused
1779      2     2+(n+p)/4                       request length
1780      2     CARD16                          number of STRs in path
1781      2                                     unused
1782      n     LISTofSTR                       path
1783      p                                     unused, p=pad(n)
1784
1785 <link linkend="requests:GetFontPath"><emphasis role='bold'>GetFontPath</emphasis></link>
1786      1     52                              opcode
1787      1                                     unused
1788      2     1                               request list
1789
1790 â–¶
1791      1     1                               Reply
1792      1                                     unused
1793      2     CARD16                          sequence number
1794      4     (n+p)/4                         reply length
1795      2     CARD16                          number of STRs in path
1796      22                                    unused
1797      n     LISTofSTR                       path
1798      p                                     unused, p=pad(n)
1799
1800 <link linkend="requests:CreatePixmap"><emphasis role='bold'>CreatePixmap</emphasis></link>
1801      1     53                              opcode
1802      1     CARD8                           depth
1803      2     4                               request length
1804      4     PIXMAP                          pid
1805      4     DRAWABLE                        drawable
1806      2     CARD16                          width
1807      2     CARD16                          height
1808
1809 <link linkend="requests:FreePixmap"><emphasis role='bold'>FreePixmap</emphasis></link>
1810      1     54                              opcode
1811      1                                     unused
1812      2     2                               request length
1813      4     PIXMAP                          pixmap
1814
1815 <link linkend="requests:CreateGC"><emphasis role='bold'>CreateGC</emphasis></link>
1816      1     55                              opcode
1817      1                                     unused
1818      2     4+n                             request length
1819      4     GCONTEXT                        cid
1820      4     DRAWABLE                        drawable
1821      4     BITMASK                         value-mask (has n bits set to 1)
1822           #x00000001     function
1823           #x00000002     plane-mask
1824           #x00000004     foreground
1825           #x00000008     background
1826           #x00000010     line-width
1827           #x00000020     line-style
1828           #x00000040     cap-style
1829           #x00000080     join-style
1830           #x00000100     fill-style
1831           #x00000200     fill-rule
1832           #x00000400     tile
1833           #x00000800     stipple
1834           #x00001000     tile-stipple-x-origin
1835           #x00002000     tile-stipple-y-origin
1836           #x00004000     font
1837           #x00008000     subwindow-mode
1838           #x00010000     graphics-exposures
1839           #x00020000     clip-x-origin
1840           #x00040000     clip-y-origin
1841           #x00080000     clip-mask
1842           #x00100000     dash-offset
1843           #x00200000     dashes
1844           #x00400000     arc-mode
1845      4n     LISTofVALUE                    value-list
1846
1847   VALUEs
1848      1                                     function
1849            0     Clear
1850            1     And
1851            2     AndReverse
1852            3     Copy
1853            4     AndInverted
1854            5     NoOp
1855            6     Xor
1856            7     Or
1857            8     Nor
1858            9     Equiv
1859           10     Invert
1860           11     OrReverse
1861           12     CopyInverted
1862           13     OrInverted
1863           14     Nand
1864           15     Set
1865      4     CARD32                          plane-mask
1866      4     CARD32                          foreground
1867      4     CARD32                          background
1868      2     CARD16                          line-width
1869      1                                     line-style
1870           0     Solid
1871           1     OnOffDash
1872           2     DoubleDash
1873      1                                     cap-style
1874           0     NotLast
1875           1     Butt
1876           2     Round
1877           3     Projecting
1878      1                                     join-style
1879           0     Miter
1880           1     Round
1881           2     Bevel
1882      1                                     fill-style
1883           0     Solid
1884           1     Tiled
1885           2     Stippled
1886           3     OpaqueStippled
1887      1                                     fill-rule
1888           0     EvenOdd
1889           1     Winding
1890      4     PIXMAP                          tile
1891      4     PIXMAP                          stipple
1892      2     INT16                           tile-stipple-x-origin
1893      2     INT16                           tile-stipple-y-origin
1894      4     FONT                            font
1895      1                                     subwindow-mode
1896           0     ClipByChildren
1897           1     IncludeInferiors
1898      1     BOOL                            graphics-exposures
1899      2     INT16                           clip-x-origin
1900      2     INT16                           clip-y-origin
1901      4     PIXMAP                          clip-mask
1902           0     None
1903      2     CARD16                          dash-offset
1904      1     CARD8                           dashes
1905      1                                     arc-mode
1906           0     Chord
1907           1     PieSlice
1908
1909 <link linkend="requests:ChangeGC"><emphasis role='bold'>ChangeGC</emphasis></link>
1910      1     56                              opcode
1911      1                                     unused
1912      2     3+n                             request length
1913      4     GCONTEXT                        gc
1914      4     BITMASK                         value-mask (has n bits set to 1)
1915           encodings are the same as for CreateGC
1916      4n     LISTofVALUE                    value-list
1917           encodings are the same as for CreateGC
1918
1919 <link linkend="requests:CopyGC"><emphasis role='bold'>CopyGC</emphasis></link>
1920      1     57                              opcode
1921      1                                     unused
1922      2     4                               request length
1923      4     GCONTEXT                        src-gc
1924      4     GCONTEXT                        dst-gc
1925      4     BITMASK                         value-mask
1926           encodings are the same as for CreateGC
1927
1928 <link linkend="requests:SetDashes"><emphasis role='bold'>SetDashes</emphasis></link>
1929      1     58                              opcode
1930      1                                     unused
1931      2     3+(n+p)/4                       request length
1932      4     GCONTEXT                        gc
1933      2     CARD16                          dash-offset
1934      2     n                               length of dashes
1935      n     LISTofCARD8                     dashes
1936      p                                     unused, p=pad(n)
1937
1938 <link linkend="requests:SetClipRectangles"><emphasis role='bold'>SetClipRectangles</emphasis></link>
1939      1     59                              opcode
1940      1                                     ordering
1941           0     UnSorted
1942           1     YSorted
1943           2     YXSorted
1944           3     YXBanded
1945      2     3+2n                            request length
1946      4     GCONTEXT                        gc
1947      2     INT16                           clip-x-origin
1948      2     INT16                           clip-y-origin
1949      8n     LISTofRECTANGLE                rectangles
1950
1951 <link linkend="requests:FreeGC"><emphasis role='bold'>FreeGC</emphasis></link>
1952      1     60                              opcode
1953      1                                     unused
1954      2     2                               request length
1955      4     GCONTEXT                        gc
1956
1957 <link linkend="requests:ClearArea"><emphasis role='bold'>ClearArea</emphasis></link>
1958      1     61                              opcode
1959      1     BOOL                            exposures
1960      2     4                               request length
1961      4     WINDOW                          window
1962      2     INT16                           x
1963      2     INT16                           y
1964      2     CARD16                          width
1965      2     CARD16                          height
1966
1967 <link linkend="requests:CopyArea"><emphasis role='bold'>CopyArea</emphasis></link>
1968      1     62                              opcode
1969      1                                     unused
1970      2     7                               request length
1971      4     DRAWABLE                        src-drawable
1972      4     DRAWABLE                        dst-drawable
1973      4     GCONTEXT                        gc
1974      2     INT16                           src-x
1975      2     INT16                           src-y
1976      2     INT16                           dst-x
1977      2     INT16                           dst-y
1978      2     CARD16                          width
1979      2     CARD16                          height
1980
1981 <link linkend="requests:CopyPlane"><emphasis role='bold'>CopyPlane</emphasis></link>
1982      1     63                              opcode
1983      1                                     unused
1984      2     8                               request length
1985      4     DRAWABLE                        src-drawable
1986      4     DRAWABLE                        dst-drawable
1987      4     GCONTEXT                        gc
1988      2     INT16                           src-x
1989      2     INT16                           src-y
1990      2     INT16                           dst-x
1991      2     INT16                           dst-y
1992      2     CARD16                          width
1993      2     CARD16                          height
1994      4     CARD32                          bit-plane
1995
1996 <link linkend="requests:PolyPoint"><emphasis role='bold'>PolyPoint</emphasis></link>
1997      1     64                              opcode
1998      1                                     coordinate-mode
1999           0     Origin
2000           1     Previous
2001      2     3+n                             request length
2002      4     DRAWABLE                        drawable
2003      4     GCONTEXT                        gc
2004      4n     LISTofPOINT                    points
2005
2006 <link linkend="requests:PolyLine"><emphasis role='bold'>PolyLine</emphasis></link>
2007      1     65                              opcode
2008      1                                     coordinate-mode
2009           0     Origin
2010           1     Previous
2011      2     3+n                             request length
2012      4     DRAWABLE                        drawable
2013      4     GCONTEXT                        gc
2014      4n     LISTofPOINT                    points
2015
2016 <link linkend="requests:PolySegment"><emphasis role='bold'>PolySegment</emphasis></link>
2017      1     66                              opcode
2018      1                                     unused
2019      2     3+2n                            request length
2020      4     DRAWABLE                        drawable
2021      4     GCONTEXT                        gc
2022      8n     LISTofSEGMENT                  segments
2023
2024   SEGMENT
2025      2     INT16                           x1
2026      2     INT16                           y1
2027      2     INT16                           x2
2028      2     INT16                           y2
2029
2030 <link linkend="requests:PolyRectangle"><emphasis role='bold'>PolyRectangle</emphasis></link>
2031      1     67                              opcode
2032      1                                     unused
2033      2     3+2n                            request length
2034      4     DRAWABLE                        drawable
2035      4     GCONTEXT                        gc
2036      8n     LISTofRECTANGLE                rectangles
2037
2038 <link linkend="requests:PolyArc"><emphasis role='bold'>PolyArc</emphasis></link>
2039      1     68                              opcode
2040      1                                     unused
2041      2     3+3n                            request length
2042      4     DRAWABLE                        drawable
2043      4     GCONTEXT                        gc
2044      12n     LISTofARC                     arcs
2045
2046 <link linkend="requests:FillPoly"><emphasis role='bold'>FillPoly</emphasis></link>
2047      1     69                              opcode
2048      1                                     unused
2049      2     4+n                             request length
2050      4     DRAWABLE                        drawable
2051      4     GCONTEXT                        gc
2052      1                                     shape
2053           0     Complex
2054           1     Nonconvex
2055           2     Convex
2056      1                                     coordinate-mode
2057           0     Origin
2058           1     Previous
2059      2                                     unused
2060      4n     LISTofPOINT                    points
2061
2062 <link linkend="requests:PolyFillRectangle"><emphasis role='bold'>PolyFillRectangle</emphasis></link>
2063      1     70                              opcode
2064      1                                     unused
2065      2     3+2n                            request length
2066      4     DRAWABLE                        drawable
2067      4     GCONTEXT                        gc
2068      8n     LISTofRECTANGLE                rectangles
2069
2070 <link linkend="requests:PolyFillArc"><emphasis role='bold'>PolyFillArc</emphasis></link>
2071      1     71                              opcode
2072      1                                     unused
2073      2     3+3n                            request length
2074      4     DRAWABLE                        drawable
2075      4     GCONTEXT                        gc
2076      12n     LISTofARC                     arcs
2077
2078 <link linkend="requests:PutImage"><emphasis role='bold'>PutImage</emphasis></link>
2079      1     72                              opcode
2080      1                                     format
2081           0     Bitmap
2082           1     XYPixmap
2083           2     ZPixmap
2084      2     6+(n+p)/4                       request length
2085      4     DRAWABLE                        drawable
2086      4     GCONTEXT                        gc
2087      2     CARD16                          width
2088      2     CARD16                          height
2089      2     INT16                           dst-x
2090      2     INT16                           dst-y
2091      1     CARD8                           left-pad
2092      1     CARD8                           depth
2093      2                                     unused
2094      n     LISTofBYTE                      data
2095      p                                     unused, p=pad(n)
2096
2097 <link linkend="requests:GetImage"><emphasis role='bold'>GetImage</emphasis></link>
2098      1     73                              opcode
2099      1                                     format
2100           1     XYPixmap
2101           2     ZPixmap
2102      2     5                               request length
2103      4     DRAWABLE                        drawable
2104      2     INT16                           x
2105      2     INT16                           y
2106      2     CARD16                          width
2107      2     CARD16                          height
2108      4     CARD32                          plane-mask
2109
2110 â–¶
2111      1     1                               Reply
2112      1     CARD8                           depth
2113      2     CARD16                          sequence number
2114      4     (n+p)/4                         reply length
2115      4     VISUALID                        visual
2116           0     None
2117      20                                    unused
2118      n     LISTofBYTE                      data
2119      p                                     unused, p=pad(n)
2120
2121 <link linkend="requests:PolyText8"><emphasis role='bold'>PolyText8</emphasis></link>
2122      1     74                              opcode
2123      1                                     unused
2124      2     4+(n+p)/4                       request length
2125      4     DRAWABLE                        drawable
2126      4     GCONTEXT                        gc
2127      2     INT16                           x
2128      2     INT16                           y
2129      n     LISTofTEXTITEM8                 items
2130      p                                     unused, p=pad(n)  (p is always 0
2131                                            or 1)
2132
2133   TEXTITEM8
2134      1     m                               length of string (cannot be 255)
2135      1     INT8                            delta
2136      m     STRING8                         string
2137   or
2138      1     255                             font-shift indicator
2139      1                                     font byte 3 (most-significant)
2140      1                                     font byte 2
2141      1                                     font byte 1
2142      1                                     font byte 0 (least-significant)
2143
2144 <link linkend="requests:PolyText16"><emphasis role='bold'>PolyText16</emphasis></link>
2145      1     75                              opcode
2146      1                                     unused
2147      2     4+(n+p)/4                       request length
2148      4     DRAWABLE                        drawable
2149      4     GCONTEXT                        gc
2150      2     INT16                           x
2151      2     INT16                           y
2152      n     LISTofTEXTITEM16                items
2153      p                                     unused, p=pad(n)  (p must be 0 or
2154                                            1)
2155
2156   TEXTITEM16
2157      1     m                               number of CHAR2Bs in string
2158                                            (cannot be 255)
2159      1     INT8                            delta
2160      2m     STRING16                       string
2161   or
2162      1     255                             font-shift indicator
2163      1                                     font byte 3 (most-significant)
2164      1                                     font byte 2
2165      1                                     font byte 1
2166      1                                     font byte 0 (least-significant)
2167
2168 <link linkend="requests:ImageText8"><emphasis role='bold'>ImageText8</emphasis></link>
2169      1     76                              opcode
2170      1     n                               length of string
2171      2     4+(n+p)/4                       request length
2172      4     DRAWABLE                        drawable
2173      4     GCONTEXT                        gc
2174      2     INT16                           x
2175      2     INT16                           y
2176      n     STRING8                         string
2177      p                                     unused, p=pad(n)
2178
2179 <link linkend="requests:ImageText16"><emphasis role='bold'>ImageText16</emphasis></link>
2180      1     77                              opcode
2181      1     n                               number of CHAR2Bs in string
2182      2     4+(2n+p)/4                      request length
2183      4     DRAWABLE                        drawable
2184      4     GCONTEXT                        gc
2185      2     INT16                           x
2186      2     INT16                           y
2187      2n     STRING16                       string
2188      p                                     unused, p=pad(2n)
2189
2190 <link linkend="requests:CreateColormap"><emphasis role='bold'>CreateColormap</emphasis></link>
2191      1     78                              opcode
2192      1                                     alloc
2193           0     None
2194           1     All
2195      2     4                               request length
2196      4     COLORMAP                        mid
2197      4     WINDOW                          window
2198      4     VISUALID                        visual
2199
2200 <link linkend="requests:FreeColormap"><emphasis role='bold'>FreeColormap</emphasis></link>
2201      1     79                              opcode
2202      1                                     unused
2203      2     2                               request length
2204      4     COLORMAP                        cmap
2205
2206 <link linkend="requests:CopyColormapAndFree"><emphasis role='bold'>CopyColormapAndFree</emphasis></link>
2207      1     80                              opcode
2208      1                                     unused
2209      2     3                               request length
2210      4     COLORMAP                        mid
2211      4     COLORMAP                        src-cmap
2212
2213 <link linkend="requests:InstallColormap"><emphasis role='bold'>InstallColormap</emphasis></link>
2214      1     81                              opcode
2215      1                                     unused
2216      2     2                               request length
2217      4     COLORMAP                        cmap
2218
2219 <link linkend="requests:UninstallColormap"><emphasis role='bold'>UninstallColormap</emphasis></link>
2220      1     82                              opcode
2221      1                                     unused
2222      2     2                               request length
2223      4     COLORMAP                        cmap
2224
2225 <link linkend="requests:ListInstalledColormaps"><emphasis role='bold'>ListInstalledColormaps</emphasis></link>
2226      1     83                              opcode
2227      1                                     unused
2228      2     2                               request length
2229      4     WINDOW                          window
2230
2231 â–¶
2232      1     1                               Reply
2233      1                                     unused
2234      2     CARD16                          sequence number
2235      4     n                               reply length
2236      2     n                               number of COLORMAPs in cmaps
2237      22                                    unused
2238      4n     LISTofCOLORMAP                 cmaps
2239
2240 <link linkend="requests:AllocColor"><emphasis role='bold'>AllocColor</emphasis></link>
2241      1     84                              opcode
2242      1                                     unused
2243      2     4                               request length
2244      4     COLORMAP                        cmap
2245      2     CARD16                          red
2246      2     CARD16                          green
2247      2     CARD16                          blue
2248      2                                     unused
2249
2250 â–¶
2251      1     1                               Reply
2252      1                                     unused
2253      2     CARD16                          sequence number
2254      4     0                               reply length
2255      2     CARD16                          red
2256      2     CARD16                          green
2257      2     CARD16                          blue
2258      2                                     unused
2259      4     CARD32                          pixel
2260      12                                    unused
2261
2262 <link linkend="requests:AllocNamedColor"><emphasis role='bold'>AllocNamedColor</emphasis></link>
2263      1     85                              opcode
2264      1                                     unused
2265      2     3+(n+p)/4                       request length
2266      4     COLORMAP                        cmap
2267      2     n                               length of name
2268      2                                     unused
2269      n     STRING8                         name
2270      p                                     unused, p=pad(n)
2271
2272 â–¶
2273      1     1                               Reply
2274      1                                     unused
2275      2     CARD16                          sequence number
2276      4     0                               reply length
2277      4     CARD32                          pixel
2278      2     CARD16                          exact-red
2279      2     CARD16                          exact-green
2280      2     CARD16                          exact-blue
2281      2     CARD16                          visual-red
2282      2     CARD16                          visual-green
2283      2     CARD16                          visual-blue
2284      8                                     unused
2285
2286 <link linkend="requests:AllocColorCells"><emphasis role='bold'>AllocColorCells</emphasis></link>
2287      1     86                              opcode
2288      1     BOOL                            contiguous
2289      2     3                               request length
2290      4     COLORMAP                        cmap
2291      2     CARD16                          colors
2292      2     CARD16                          planes
2293
2294 â–¶
2295      1     1                               Reply
2296      1                                     unused
2297      2     CARD16                          sequence number
2298      4     n+m                             reply length
2299      2     n                               number of CARD32s in pixels
2300      2     m                               number of CARD32s in masks
2301      20                                    unused
2302      4n     LISTofCARD32                   pixels
2303      4m     LISTofCARD32                   masks
2304
2305 <link linkend="requests:AllocColorPlanes"><emphasis role='bold'>AllocColorPlanes</emphasis></link>
2306      1     87                              opcode
2307      1     BOOL                            contiguous
2308      2     4                               request length
2309      4     COLORMAP                        cmap
2310      2     CARD16                          colors
2311      2     CARD16                          reds
2312      2     CARD16                          greens
2313      2     CARD16                          blues
2314
2315 â–¶
2316      1     1                               Reply
2317      1                                     unused
2318      2     CARD16                          sequence number
2319      4     n                               reply length
2320      2     n                               number of CARD32s in pixels
2321      2                                     unused
2322      4     CARD32                          red-mask
2323      4     CARD32                          green-mask
2324      4     CARD32                          blue-mask
2325      8                                     unused
2326      4n     LISTofCARD32                   pixels
2327
2328 <link linkend="requests:FreeColors"><emphasis role='bold'>FreeColors</emphasis></link>
2329      1     88                              opcode
2330      1                                     unused
2331      2     3+n                             request length
2332      4     COLORMAP                        cmap
2333      4     CARD32                          plane-mask
2334      4n     LISTofCARD32                   pixels
2335
2336 <link linkend="requests:StoreColors"><emphasis role='bold'>StoreColors</emphasis></link>
2337      1     89                              opcode
2338      1                                     unused
2339      2     2+3n                            request length
2340      4     COLORMAP                        cmap
2341      12n     LISTofCOLORITEM               items
2342
2343   COLORITEM
2344      4     CARD32                          pixel
2345      2     CARD16                          red
2346      2     CARD16                          green
2347      2     CARD16                          blue
2348      1                                     do-red, do-green, do-blue
2349           #x01     do-red (1 is True, 0 is False)
2350           #x02     do-green (1 is True, 0 is False)
2351           #x04     do-blue (1 is True, 0 is False)
2352           #xF8     unused
2353      1                                     unused
2354
2355 <link linkend="requests:StoreNamedColor"><emphasis role='bold'>StoreNamedColor</emphasis></link>
2356      1     90                              opcode
2357      1                                     do-red, do-green, do-blue
2358           #x01     do-red (1 is True, 0 is False)
2359           #x02     do-green (1 is True, 0 is False)
2360           #x04     do-blue (1 is True, 0 is False)
2361           #xF8     unused
2362      2     4+(n+p)/4                       request length
2363      4     COLORMAP                        cmap
2364      4     CARD32                          pixel
2365      2     n                               length of name
2366      2                                     unused
2367      n     STRING8                         name
2368      p                                     unused, p=pad(n)
2369
2370 <link linkend="requests:QueryColors"><emphasis role='bold'>QueryColors</emphasis></link>
2371      1     91                              opcode
2372      1                                     unused
2373      2     2+n                             request length
2374      4     COLORMAP                        cmap
2375      4n     LISTofCARD32                   pixels
2376
2377 â–¶
2378      1     1                               Reply
2379      1                                     unused
2380      2     CARD16                          sequence number
2381      4     2n                              reply length
2382      2     n                               number of RGBs in colors
2383      22                                    unused
2384      8n     LISTofRGB                      colors
2385
2386   RGB
2387      2     CARD16                          red
2388      2     CARD16                          green
2389      2     CARD16                          blue
2390      2                                     unused
2391
2392 <link linkend="requests:LookupColor"><emphasis role='bold'>LookupColor</emphasis></link>
2393      1     92                              opcode
2394      1                                     unused
2395      2     3+(n+p)/4                       request length
2396      4     COLORMAP                        cmap
2397      2     n                               length of name
2398      2                                     unused
2399      n     STRING8                         name
2400      p                                     unused, p=pad(n)
2401
2402 â–¶
2403      1     1                               Reply
2404      1                                     unused
2405      2     CARD16                          sequence number
2406      4     0                               reply length
2407      2     CARD16                          exact-red
2408      2     CARD16                          exact-green
2409      2     CARD16                          exact-blue
2410      2     CARD16                          visual-red
2411      2     CARD16                          visual-green
2412      2     CARD16                          visual-blue
2413      12                                    unused
2414
2415 <link linkend="requests:CreateCursor"><emphasis role='bold'>CreateCursor</emphasis></link>
2416      1     93                              opcode
2417      1                                     unused
2418      2     8                               request length
2419      4     CURSOR                          cid
2420      4     PIXMAP                          source
2421      4     PIXMAP                          mask
2422           0     None
2423      2     CARD16                          fore-red
2424      2     CARD16                          fore-green
2425      2     CARD16                          fore-blue
2426      2     CARD16                          back-red
2427      2     CARD16                          back-green
2428      2     CARD16                          back-blue
2429      2     CARD16                          x
2430      2     CARD16                          y
2431
2432 <link linkend="requests:CreateGlyphCursor"><emphasis role='bold'>CreateGlyphCursor</emphasis></link>
2433      1     94                              opcode
2434      1                                     unused
2435      2     8                               request length
2436      4     CURSOR                          cid
2437      4     FONT                            source-font
2438      4     FONT                            mask-font
2439           0     None
2440      2     CARD16                          source-char
2441      2     CARD16                          mask-char
2442      2     CARD16                          fore-red
2443      2     CARD16                          fore-green
2444      2     CARD16                          fore-blue
2445      2     CARD16                          back-red
2446      2     CARD16                          back-green
2447      2     CARD16                          back-blue
2448
2449 <link linkend="requests:FreeCursor"><emphasis role='bold'>FreeCursor</emphasis></link>
2450      1     95                              opcode
2451      1                                     unused
2452      2     2                               request length
2453      4     CURSOR                          cursor
2454
2455 <link linkend="requests:RecolorCursor"><emphasis role='bold'>RecolorCursor</emphasis></link>
2456      1     96                              opcode
2457      1                                     unused
2458      2     5                               request length
2459      4     CURSOR                          cursor
2460      2     CARD16                          fore-red
2461      2     CARD16                          fore-green
2462      2     CARD16                          fore-blue
2463      2     CARD16                          back-red
2464      2     CARD16                          back-green
2465      2     CARD16                          back-blue
2466
2467 <link linkend="requests:QueryBestSize"><emphasis role='bold'>QueryBestSize</emphasis></link>
2468      1     97                              opcode
2469      1                                     class
2470           0     Cursor
2471           1     Tile
2472           2     Stipple
2473      2     3                               request length
2474      4     DRAWABLE                        drawable
2475      2     CARD16                          width
2476      2     CARD16                          height
2477
2478 â–¶
2479      1     1                               Reply
2480      1                                     unused
2481      2     CARD16                          sequence number
2482      4     0                               reply length
2483      2     CARD16                          width
2484      2     CARD16                          height
2485      20                                    unused
2486
2487 <link linkend="requests:QueryExtension"><emphasis role='bold'>QueryExtension</emphasis></link>
2488      1     98                              opcode
2489      1                                     unused
2490      2     2+(n+p)/4                       request length
2491      2     n                               length of name
2492      2                                     unused
2493      n     STRING8                         name
2494      p                                     unused, p=pad(n)
2495
2496 â–¶
2497      1     1                               Reply
2498      1                                     unused
2499      2     CARD16                          sequence number
2500      4     0                               reply length
2501      1     BOOL                            present
2502      1     CARD8                           major-opcode
2503      1     CARD8                           first-event
2504      1     CARD8                           first-error
2505      20                                    unused
2506
2507 <link linkend="requests:ListExtensions"><emphasis role='bold'>ListExtensions</emphasis></link>
2508      1     99                              opcode
2509      1                                     unused
2510      2     1                               request length
2511
2512 â–¶
2513      1     1                               Reply
2514      1     CARD8                           number of STRs in names
2515      2     CARD16                          sequence number
2516      4     (n+p)/4                         reply length
2517      24                                    unused
2518      n     LISTofSTR                       names
2519      p                                     unused, p=pad(n)
2520
2521 <link linkend="requests:ChangeKeyboardMapping"><emphasis role='bold'>ChangeKeyboardMapping</emphasis></link>
2522      1     100                             opcode
2523      1     n                               keycode-count
2524      2     2+nm                            request length
2525      1     KEYCODE                         first-keycode
2526      1     m                               keysyms-per-keycode
2527      2                                     unused
2528      4nm     LISTofKEYSYM                  keysyms
2529
2530 <link linkend="requests:GetKeyboardMapping"><emphasis role='bold'>GetKeyboardMapping</emphasis></link>
2531      1     101                             opcode
2532      1                                     unused
2533      2     2                               request length
2534      1     KEYCODE                         first-keycode
2535      1     m                               count
2536      2                                     unused
2537
2538 â–¶
2539      1     1                               Reply
2540      1     n                               keysyms-per-keycode
2541      2     CARD16                          sequence number
2542      4     nm                              reply length (m = count field
2543                                            from the request)
2544      24                                    unused
2545      4nm     LISTofKEYSYM                  keysyms
2546
2547 <link linkend="requests:ChangeKeyboardControl"><emphasis role='bold'>ChangeKeyboardControl</emphasis></link>
2548      1     102                             opcode
2549      1                                     unused
2550      2     2+n                             request length
2551      4     BITMASK                         value-mask (has n bits set to 1)
2552           #x0001     key-click-percent
2553           #x0002     bell-percent
2554           #x0004     bell-pitch
2555           #x0008     bell-duration
2556           #x0010     led
2557           #x0020     led-mode
2558           #x0040     key
2559           #x0080     auto-repeat-mode
2560      4n     LISTofVALUE                    value-list
2561
2562   VALUEs
2563      1     INT8                            key-click-percent
2564      1     INT8                            bell-percent
2565      2     INT16                           bell-pitch
2566      2     INT16                           bell-duration
2567      1     CARD8                           led
2568      1                                     led-mode
2569           0     Off
2570           1     On
2571      1     KEYCODE                         key
2572      1                                     auto-repeat-mode
2573           0     Off
2574           1     On
2575           2     Default
2576
2577 <link linkend="requests:GetKeyboardControl"><emphasis role='bold'>GetKeyboardControl</emphasis></link>
2578      1     103                             opcode
2579      1                                     unused
2580      2     1                               request length
2581
2582 â–¶
2583      1     1                               Reply
2584      1                                     global-auto-repeat
2585           0     Off
2586           1     On
2587      2     CARD16                          sequence number
2588      4     5                               reply length
2589      4     CARD32                          led-mask
2590      1     CARD8                           key-click-percent
2591      1     CARD8                           bell-percent
2592      2     CARD16                          bell-pitch
2593      2     CARD16                          bell-duration
2594      2                                     unused
2595      32     LISTofCARD8                    auto-repeats
2596
2597 <link linkend="requests:Bell"><emphasis role='bold'>Bell</emphasis></link>
2598      1     104                             opcode
2599      1     INT8                            percent
2600      2     1                               request length
2601
2602 <link linkend="requests:ChangePointerControl"><emphasis role='bold'>ChangePointerControl</emphasis></link>
2603      1     105                             opcode
2604      1                                     unused
2605      2     3                               request length
2606      2     INT16                           acceleration-numerator
2607      2     INT16                           acceleration-denominator
2608      2     INT16                           threshold
2609      1     BOOL                            do-acceleration
2610      1     BOOL                            do-threshold
2611
2612 <link linkend="requests:GetPointerControl"><emphasis role='bold'>GetPointerControl</emphasis></link>
2613      1     106                             opcode
2614      1                                     unused
2615      2     1                               request length
2616
2617 â–¶
2618      1     1                               Reply
2619      1                                     unused
2620      2     CARD16                          sequence number
2621      4     0                               reply length
2622      2     CARD16                          acceleration-numerator
2623      2     CARD16                          acceleration-denominator
2624      2     CARD16                          threshold
2625      18                                    unused
2626
2627 <link linkend="requests:SetScreenSaver"><emphasis role='bold'>SetScreenSaver</emphasis></link>
2628      1     107                             opcode
2629      1                                     unused
2630      2     3                               request length
2631      2     INT16                           timeout
2632      2     INT16                           interval
2633      1                                     prefer-blanking
2634           0     No
2635           1     Yes
2636           2     Default
2637      1                                     allow-exposures
2638           0     No
2639           1     Yes
2640           2     Default
2641      2                                     unused
2642
2643 <link linkend="requests:GetScreenSaver"><emphasis role='bold'>GetScreenSaver</emphasis></link>
2644      1     108                             opcode
2645      1                                     unused
2646      2     1                               request length
2647
2648 â–¶
2649      1     1                               Reply
2650      1                                     unused
2651      2     CARD16                          sequence number
2652      4     0                               reply length
2653      2     CARD16                          timeout
2654      2     CARD16                          interval
2655      1                                     prefer-blanking
2656           0     No
2657           1     Yes
2658      1                                     allow-exposures
2659           0     No
2660           1     Yes
2661      18                                    unused
2662
2663 <link linkend="requests:ChangeHosts"><emphasis role='bold'>ChangeHosts</emphasis></link>
2664      1     109                             opcode
2665      1                                     mode
2666           0     Insert
2667           1     Delete
2668      2     2+(n+p)/4                       request length
2669      1                                     family
2670           0     Internet
2671           1     DECnet
2672           2     Chaos
2673      1                                     unused
2674      2     n                               length of address
2675      n     LISTofCARD8                     address
2676      p                                     unused, p=pad(n)
2677
2678 <link linkend="requests:ListHosts"><emphasis role='bold'>ListHosts</emphasis></link>
2679      1     110                             opcode
2680      1                                     unused
2681      2     1                               request length
2682
2683 â–¶
2684      1     1                               Reply
2685      1                                     mode
2686           0     Disabled
2687           1     Enabled
2688      2     CARD16                          sequence number
2689      4     n/4                             reply length
2690      2     CARD16                          number of HOSTs in hosts
2691      22                                    unused
2692      n     LISTofHOST                      hosts (n always a multiple of 4)
2693
2694 <link linkend="requests:SetAccessControl"><emphasis role='bold'>SetAccessControl</emphasis></link>
2695      1     111                             opcode
2696      1                                     mode
2697           0     Disable
2698           1     Enable
2699      2     1                               request length
2700
2701 <link linkend="requests:SetCloseDownMode"><emphasis role='bold'>SetCloseDownMode</emphasis></link>
2702      1     112                             opcode
2703      1                                     mode
2704           0     Destroy
2705           1     RetainPermanent
2706           2     RetainTemporary
2707      2     1                               request length
2708
2709 <link linkend="requests:KillClient"><emphasis role='bold'>KillClient</emphasis></link>
2710      1     113                             opcode
2711      1                                     unused
2712      2     2                               request length
2713      4     CARD32                          resource
2714           0     AllTemporary
2715
2716 <link linkend="requests:RotateProperties"><emphasis role='bold'>RotateProperties</emphasis></link>
2717      1     114                             opcode
2718      1                                     unused
2719      2     3+n                             request length
2720      4     WINDOW                          window
2721      2     n                               number of properties
2722      2     INT16                           delta
2723      4n    LISTofATOM                      properties
2724
2725 <link linkend="requests:ForceScreenSaver"><emphasis role='bold'>ForceScreenSaver</emphasis></link>
2726      1     115                             opcode
2727      1                                     mode
2728           0     Reset
2729           1     Activate
2730      2     1                               request length
2731
2732 <link linkend="requests:SetPointerMapping"><emphasis role='bold'>SetPointerMapping</emphasis></link>
2733      1     116                             opcode
2734      1     n                               length of map
2735      2     1+(n+p)/4                       request length
2736      n     LISTofCARD8                     map
2737      p                                     unused, p=pad(n)
2738
2739 â–¶
2740      1     1                               Reply
2741      1                                     status
2742           0     Success
2743           1     Busy
2744      2     CARD16                          sequence number
2745      4     0                               reply length
2746      24                                    unused
2747
2748 <link linkend="requests:GetPointerMapping"><emphasis role='bold'>GetPointerMapping</emphasis></link>
2749      1     117                             opcode
2750      1                                     unused
2751      2     1                               request length
2752
2753 â–¶
2754      1     1                               Reply
2755      1     n                               length of map
2756      2     CARD16                          sequence number
2757      4     (n+p)/4                         reply length
2758      24                                    unused
2759      n     LISTofCARD8                     map
2760      p                                     unused, p=pad(n)
2761
2762 <link linkend="requests:SetModifierMapping"><emphasis role='bold'>SetModifierMapping</emphasis></link>
2763      1     118                             opcode
2764      1     n                               keycodes-per-modifier
2765      2     1+2n                            request length
2766      8n    LISTofKEYCODE                   keycodes
2767
2768 â–¶
2769      1     1                               Reply
2770      1                                     status
2771           0     Success
2772           1     Busy
2773           2     Failed
2774      2     CARD16                          sequence number
2775      4     0                               reply length
2776      24                                    unused
2777
2778 <link linkend="requests:GetModifierMapping"><emphasis role='bold'>GetModifierMapping</emphasis></link>
2779      1     119                             opcode
2780      1                                     unused
2781      2     1                               request length
2782
2783 â–¶
2784      1     1                               Reply
2785      1     n                               keycodes-per-modifier
2786      2     CARD16                          sequence number
2787      4     2n                              reply length
2788      24                                    unused
2789      8n     LISTofKEYCODE                  keycodes
2790
2791 <link linkend="requests:NoOperation"><emphasis role='bold'>NoOperation</emphasis></link>
2792      1     127                             opcode
2793      1                                     unused
2794      2     1+n                             request length
2795      4n                                    unused
2796 </literallayout>
2797 </sect1>
2798
2799 <sect1 id='Encoding::Events'>
2800 <title>Events</title>
2801 <indexterm zone="Encoding::Events"><primary>Event</primary><secondary>encoding</secondary></indexterm>
2802
2803 <literallayout class="monospaced">
2804 <link linkend="events:KeyPress"><emphasis role='bold'>KeyPress</emphasis></link>
2805      1     2                               code
2806      1     KEYCODE                         detail
2807      2     CARD16                          sequence number
2808      4     TIMESTAMP                       time
2809      4     WINDOW                          root
2810      4     WINDOW                          event
2811      4     WINDOW                          child
2812           0     None
2813      2     INT16                           root-x
2814      2     INT16                           root-y
2815      2     INT16                           event-x
2816      2     INT16                           event-y
2817      2     SETofKEYBUTMASK                 state
2818      1     BOOL                            same-screen
2819      1                                     unused
2820
2821 <link linkend="events:KeyRelease"><emphasis role='bold'>KeyRelease</emphasis></link>
2822      1     3                               code
2823      1     KEYCODE                         detail
2824      2     CARD16                          sequence number
2825      4     TIMESTAMP                       time
2826      4     WINDOW                          root
2827      4     WINDOW                          event
2828      4     WINDOW                          child
2829           0     None
2830      2     INT16                           root-x
2831      2     INT16                           root-y
2832      2     INT16                           event-x
2833      2     INT16                           event-y
2834      2     SETofKEYBUTMASK                 state
2835      1     BOOL                            same-screen
2836      1                                     unused
2837
2838 <link linkend="events:ButtonPress"><emphasis role='bold'>ButtonPress</emphasis></link>
2839      1     4                               code
2840      1     BUTTON                          detail
2841      2     CARD16                          sequence number
2842      4     TIMESTAMP                       time
2843      4     WINDOW                          root
2844      4     WINDOW                          event
2845      4     WINDOW                          child
2846           0     None
2847      2     INT16                           root-x
2848      2     INT16                           root-y
2849      2     INT16                           event-x
2850      2     INT16                           event-y
2851      2     SETofKEYBUTMASK                 state
2852      1     BOOL                            same-screen
2853      1                                     unused
2854
2855 <link linkend="events:ButtonRelease"><emphasis role='bold'>ButtonRelease</emphasis></link>
2856      1     5                               code
2857      1     BUTTON                          detail
2858      2     CARD16                          sequence number
2859      4     TIMESTAMP                       time
2860      4     WINDOW                          root
2861      4     WINDOW                          event
2862      4     WINDOW                          child
2863           0     None
2864      2     INT16                           root-x
2865      2     INT16                           root-y
2866      2     INT16                           event-x
2867      2     INT16                           event-y
2868      2     SETofKEYBUTMASK                 state
2869      1     BOOL                            same-screen
2870      1                                     unused
2871
2872 <link linkend="events:MotionNotify"><emphasis role='bold'>MotionNotify</emphasis></link>
2873      1     6                               code
2874      1                                     detail
2875           0     Normal
2876           1     Hint
2877      2     CARD16                          sequence number
2878      4     TIMESTAMP                       time
2879      4     WINDOW                          root
2880      4     WINDOW                          event
2881      4     WINDOW                          child
2882            0     None
2883      2     INT16                           root-x
2884      2     INT16                           root-y
2885      2     INT16                           event-x
2886      2     INT16                           event-y
2887      2     SETofKEYBUTMASK                 state
2888      1     BOOL                            same-screen
2889      1                                     unused
2890
2891 <link linkend="events:EnterNotify"><emphasis role='bold'>EnterNotify</emphasis></link>
2892      1     7                               code
2893      1                                     detail
2894           0     Ancestor
2895           1     Virtual
2896           2     Inferior
2897           3     Nonlinear
2898           4     NonlinearVirtual
2899      2     CARD16                          sequence number
2900      4     TIMESTAMP                       time
2901      4     WINDOW                          root
2902      4     WINDOW                          event
2903      4     WINDOW                          child
2904           0     None
2905      2     INT16                           root-x
2906      2     INT16                           root-y
2907      2     INT16                           event-x
2908      2     INT16                           event-y
2909      2     SETofKEYBUTMASK                 state
2910      1                                     mode
2911           0     Normal
2912           1     Grab
2913           2     Ungrab
2914      1                                     same-screen, focus
2915           #x01     focus (1 is True, 0 is False)
2916           #x02     same-screen (1 is True, 0 is False)
2917           #xFC     unused
2918
2919 <link linkend="events:LeaveNotify"><emphasis role='bold'>LeaveNotify</emphasis></link>
2920      1     8                               code
2921      1                                     detail
2922           0     Ancestor
2923           1     Virtual
2924           2     Inferior
2925           3     Nonlinear
2926           4     NonlinearVirtual
2927      2     CARD16                          sequence number
2928      4     TIMESTAMP                       time
2929      4     WINDOW                          root
2930      4     WINDOW                          event
2931      4     WINDOW                          child
2932           0     None
2933      2     INT16                           root-x
2934      2     INT16                           root-y
2935      2     INT16                           event-x
2936      2     INT16                           event-y
2937      2     SETofKEYBUTMASK                 state
2938      1                                     mode
2939           0     Normal
2940           1     Grab
2941           2     Ungrab
2942      1                                     same-screen, focus
2943           #x01     focus (1 is True, 0 is False)
2944           #x02     same-screen (1 is True, 0 is False)
2945           #xFC     unused
2946
2947 <link linkend="events:FocusIn"><emphasis role='bold'>FocusIn</emphasis></link>
2948      1     9                               code
2949      1                                     detail
2950           0     Ancestor
2951           1     Virtual
2952           2     Inferior
2953           3     Nonlinear
2954           4     NonlinearVirtual
2955           5     Pointer
2956           6     PointerRoot
2957           7     None
2958      2     CARD16                          sequence number
2959      4     WINDOW                          event
2960      1                                     mode
2961           0     Normal
2962           1     Grab
2963           2     Ungrab
2964           3     WhileGrabbed
2965      23                                    unused
2966
2967 <link linkend="events:FocusOut"><emphasis role='bold'>FocusOut</emphasis></link>
2968      1     10                              code
2969      1                                     detail
2970           0     Ancestor
2971           1     Virtual
2972           2     Inferior
2973           3     Nonlinear
2974           4     NonlinearVirtual
2975           5     Pointer
2976           6     PointerRoot
2977           7     None
2978      2     CARD16                          sequence number
2979      4     WINDOW                          event
2980      1                                     mode
2981           0     Normal
2982           1     Grab
2983           2     Ungrab
2984           3     WhileGrabbed
2985      23                                    unused
2986
2987 <link linkend="events:KeymapNotify"><emphasis role='bold'>KeymapNotify</emphasis></link>
2988      1     11                              code
2989      31    LISTofCARD8                     keys (byte for keycodes 0-7 is
2990                                            omitted)
2991
2992 <link linkend="events:Expose"><emphasis role='bold'>Expose</emphasis></link>
2993      1     12                              code
2994      1                                     unused
2995      2     CARD16                          sequence number
2996      4     WINDOW                          window
2997      2     CARD16                          x
2998      2     CARD16                          y
2999      2     CARD16                          width
3000      2     CARD16                          height
3001      2     CARD16                          count
3002      14                                    unused
3003
3004 <link linkend="events:GraphicsExposure"><emphasis role='bold'>GraphicsExposure</emphasis></link>
3005      1     13                              code
3006      1                                     unused
3007      2     CARD16                          sequence number
3008      4     DRAWABLE                        drawable
3009      2     CARD16                          x
3010      2     CARD16                          y
3011      2     CARD16                          width
3012      2     CARD16                          height
3013      2     CARD16                          minor-opcode
3014      2     CARD16                          count
3015      1     CARD8                           major-opcode
3016      11                                    unused
3017
3018 <link linkend="events:NoExposure"><emphasis role='bold'>NoExposure</emphasis></link>
3019      1     14                              code
3020      1                                     unused
3021      2     CARD16                          sequence number
3022      4     DRAWABLE                        drawable
3023      2     CARD16                          minor-opcode
3024      1     CARD8                           major-opcode
3025      21                                    unused
3026
3027 <link linkend="events:VisibilityNotify"><emphasis role='bold'>VisibilityNotify</emphasis></link>
3028      1     15                              code
3029      1                                     unused
3030      2     CARD16                          sequence number
3031      4     WINDOW                          window
3032      1                                     state
3033           0     Unobscured
3034           1     PartiallyObscured
3035           2     FullyObscured
3036      23                                    unused
3037
3038 <link linkend="events:CreateNotify"><emphasis role='bold'>CreateNotify</emphasis></link>
3039      1     16                              code
3040      1                                     unused
3041      2     CARD16                          sequence number
3042      4     WINDOW                          parent
3043      4     WINDOW                          window
3044      2     INT16                           x
3045      2     INT16                           y
3046      2     CARD16                          width
3047      2     CARD16                          height
3048      2     CARD16                          border-width
3049      1     BOOL                            override-redirect
3050      9                                     unused
3051
3052 <link linkend="events:DestroyNotify"><emphasis role='bold'>DestroyNotify</emphasis></link>
3053      1     17                              code
3054      1                                     unused
3055      2     CARD16                          sequence number
3056      4     WINDOW                          event
3057      4     WINDOW                          window
3058      20                                    unused
3059
3060 <link linkend="events:UnmapNotify"><emphasis role='bold'>UnmapNotify</emphasis></link>
3061      1     18                              code
3062      1                                     unused
3063      2     CARD16                          sequence number
3064      4     WINDOW                          event
3065      4     WINDOW                          window
3066      1     BOOL                            from-configure
3067      19                                    unused
3068
3069 <link linkend="events:MapNotify"><emphasis role='bold'>MapNotify</emphasis></link>
3070      1     19                              code
3071      1                                     unused
3072      2     CARD16                          sequence number
3073      4     WINDOW                          event
3074      4     WINDOW                          window
3075      1     BOOL                            override-redirect
3076      19                                    unused
3077
3078 <link linkend="events:MapRequest"><emphasis role='bold'>MapRequest</emphasis></link>
3079      1     20                              code
3080      1                                     unused
3081      2     CARD16                          sequence number
3082      4     WINDOW                          parent
3083      4     WINDOW                          window
3084      20                                    unused
3085
3086 <link linkend="events:ReparentNotify"><emphasis role='bold'>ReparentNotify</emphasis></link>
3087      1     21                              code
3088      1                                     unused
3089      2     CARD16                          sequence number
3090      4     WINDOW                          event
3091      4     WINDOW                          window
3092      4     WINDOW                          parent
3093      2     INT16                           x
3094      2     INT16                           y
3095      1     BOOL                            override-redirect
3096      11                                    unused
3097
3098 <link linkend="events:ConfigureNotify"><emphasis role='bold'>ConfigureNotify</emphasis></link>
3099      1     22                              code
3100      1                                     unused
3101      2     CARD16                          sequence number
3102      4     WINDOW                          event
3103      4     WINDOW                          window
3104      4     WINDOW                          above-sibling
3105           0     None
3106      2     INT16                           x
3107      2     INT16                           y
3108      2     CARD16                          width
3109      2     CARD16                          height
3110      2     CARD16                          border-width
3111      1     BOOL                            override-redirect
3112      5                                     unused
3113
3114 <link linkend="events:ConfigureRequest"><emphasis role='bold'>ConfigureRequest</emphasis></link>
3115      1     23                              code
3116      1                                     stack-mode
3117           0     Above
3118           1     Below
3119           2     TopIf
3120           3     BottomIf
3121           4     Opposite
3122      2     CARD16                          sequence number
3123      4     WINDOW                          parent
3124      4     WINDOW                          window
3125      4     WINDOW                          sibling
3126           0     None
3127      2     INT16                           x
3128      2     INT16                           y
3129      2     CARD16                          width
3130      2     CARD16                          height
3131      2     CARD16                          border-width
3132      2     BITMASK                         value-mask
3133           #x0001     x
3134           #x0002     y
3135           #x0004     width
3136           #x0008     height
3137           #x0010     border-width
3138           #x0020     sibling
3139           #x0040     stack-mode
3140      4                                     unused
3141
3142 <link linkend="events:GravityNotify"><emphasis role='bold'>GravityNotify</emphasis></link>
3143      1     24                              code
3144      1                                     unused
3145      2     CARD16                          sequence number
3146      4     WINDOW                          event
3147      4     WINDOW                          window
3148      2     INT16                           x
3149      2     INT16                           y
3150      16                                    unused
3151
3152 <link linkend="events:ResizeRequest"><emphasis role='bold'>ResizeRequest</emphasis></link>
3153      1     25                              code
3154      1                                     unused
3155      2     CARD16                          sequence number
3156      4     WINDOW                          window
3157      2     CARD16                          width
3158      2     CARD16                          height
3159      20                                    unused
3160
3161 <link linkend="events:CirculateNotify"><emphasis role='bold'>CirculateNotify</emphasis></link>
3162      1     26                              code
3163      1                                     unused
3164      2     CARD16                          sequence number
3165      4     WINDOW                          event
3166      4     WINDOW                          window
3167      4     WINDOW                          unused
3168      1                                     place
3169           0     Top
3170           1     Bottom
3171      15                                    unused
3172
3173 <link linkend="events:CirculateRequest"><emphasis role='bold'>CirculateRequest</emphasis></link>
3174      1     27                              code
3175      1                                     unused
3176      2     CARD16                          sequence number
3177      4     WINDOW                          parent
3178      4     WINDOW                          window
3179      4                                     unused
3180      1                                     place
3181           0     Top
3182           1     Bottom
3183      15                                    unused
3184
3185 <link linkend="events:PropertyNotify"><emphasis role='bold'>PropertyNotify</emphasis></link>
3186      1     28                              code
3187      1                                     unused
3188      2     CARD16                          sequence number
3189      4     WINDOW                          window
3190      4     ATOM                            atom
3191      4     TIMESTAMP                       time
3192      1                                     state
3193           0     NewValue
3194           1     Deleted
3195      15                                    unused
3196
3197 <link linkend="events:SelectionClear"><emphasis role='bold'>SelectionClear</emphasis></link>
3198      1     29                              code
3199      1                                     unused
3200      2     CARD16                          sequence number
3201      4     TIMESTAMP                       time
3202      4     WINDOW                          owner
3203      4     ATOM                            selection
3204      16                                    unused
3205
3206 <link linkend="events:SelectionRequest"><emphasis role='bold'>SelectionRequest</emphasis></link>
3207      1     30                              code
3208      1                                     unused
3209      2     CARD16                          sequence number
3210      4     TIMESTAMP                       time
3211           0     CurrentTime
3212      4     WINDOW                          owner
3213      4     WINDOW                          requestor
3214      4     ATOM                            selection
3215      4     ATOM                            target
3216      4     ATOM                            property
3217           0     None
3218      4                                     unused
3219
3220 <link linkend="events:SelectionNotify"><emphasis role='bold'>SelectionNotify</emphasis></link>
3221      1     31                              code
3222      1                                     unused
3223      2     CARD16                          sequence number
3224      4     TIMESTAMP                       time
3225           0     CurrentTime
3226      4     WINDOW                          requestor
3227      4     ATOM                            selection
3228      4     ATOM                            target
3229      4     ATOM                            property
3230           0     None
3231      8                                     unused
3232
3233 <link linkend="events:ColormapNotify"><emphasis role='bold'>ColormapNotify</emphasis></link>
3234      1     32                              code
3235      1                                     unused
3236      2     CARD16                          sequence number
3237      4     WINDOW                          window
3238      4     COLORMAP                        colormap
3239           0     None
3240      1     BOOL                            new
3241      1                                     state
3242           0     Uninstalled
3243           1     Installed
3244      18                                    unused
3245
3246 <link linkend="events:ClientMessage"><emphasis role='bold'>ClientMessage</emphasis></link>
3247      1     33                              code
3248      1     CARD8                           format
3249      2     CARD16                          sequence number
3250      4     WINDOW                          window
3251      4     ATOM                            type
3252      20                                    data
3253
3254 <link linkend="events:MappingNotify"><emphasis role='bold'>MappingNotify</emphasis></link>
3255      1     34                              code
3256      1                                     unused
3257      2     CARD16                          sequence number
3258      1                                     request
3259           0     Modifier
3260           1     Keyboard
3261           2     Pointer
3262      1     KEYCODE                         first-keycode
3263      1     CARD8                           count
3264      25                                    unused
3265 </literallayout>
3266
3267 </sect1>
3268 </appendix>