1
<appendix id="protocol_encoding">
2
<title>Protocol Encoding</title>
4
The sections in this appendix correspond to their
5
number counterparts in the protocol document.
7
<sect1 id="syntactic_conventions_b">
8
<title>Syntactic Conventions</title>
11
All numbers are in decimal,
12
unless prefixed with #x, in which case they are in hexadecimal (base 16).
16
The general syntax used to describe requests, replies, errors, events, and
20
<literallayout class="monospaced">
21
<emphasis role='bold'>NameofThing</emphasis>
28
Each encode-form describes a single component.
31
For components described in the protocol as:
33
<literallayout class="monospaced">
41
<literallayout class="monospaced">
46
N is the number of bytes occupied in the data stream,
47
and TYPE is the interpretation of those bytes.
51
<literallayout class="monospaced">
59
<literallayout class="monospaced">
64
For components with a static numeric value the encode-form is:
67
<literallayout class="monospaced">
72
The value is always interpreted as an N-byte unsigned integer.
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>
82
<literallayout class="monospaced">
88
For components described in the protocol as:
93
<emphasis role='bold'>{ Name1 ,..., </emphasis>
94
<emphasis role='bold'>NameI }</emphasis>
101
<literallayout class="monospaced">
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.
117
{ <emphasis role='bold'>InputOutput</emphasis>,
118
<emphasis role='bold'>InputOnly</emphasis>,
119
<emphasis role='bold'>CopyFromParent</emphasis> }
126
<literallayout class="monospaced">
134
For components described in the protocol as:
139
<emphasis role='bold'>Alternative1 ...or</emphasis>
140
<emphasis role='bold'>AlternativeI</emphasis>
147
<literallayout class="monospaced">
155
The alternative values are guaranteed not to conflict with the encoding
161
destination: WINDOW or
162
<emphasis role='bold'>PointerWindow </emphasis>
164
<emphasis role='bold'>InputFocus</emphasis>
171
<literallayout class="monospaced">
178
For components described in the protocol as:
181
<literallayout class="monospaced">
189
<literallayout class="monospaced">
197
The individual bits in the mask are specified and named,
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,
206
interpreted in stream order, and with the overall mask being byte-swapped
207
in individual N-byte units.
211
For LISTofVALUE encodings, the request is followed by a section of the form:
214
<literallayout class="monospaced">
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.
231
In various cases, the number of bytes occupied by a component will be
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.
243
<literallayout class="monospaced">
245
4n LISTofPOINT points
249
For unused bytes (the values of the bytes are undefined and do no matter),
253
<literallayout class="monospaced">
259
If the number of unused bytes is variable, the encode-form typically is:
262
<literallayout class="monospaced">
267
where E is some expression,
268
and pad(E) is the number of bytes needed to round E up to a multiple of four.
271
<literallayout class="monospaced">
272
pad(E) = (4 - (E mod 4)) mod 4
276
<sect1 id="common_types_2">
277
<title>Common Types</title>
281
<term>LISTofFOO</term>
284
In this document the LISTof notation strictly means some number of repetitions
286
the actual length of the list is encoded elsewhere.
291
<term>SETofFOO</term>
294
A set is always represented by a bitmask, with a 1-bit indicating presence in
301
<informaltable frame='none'>
302
<tgroup cols='1' align='left'>
303
<colspec colname='c1' colsep="0"/>
367
INT8: 8-bit signed integer
372
INT16: 16-bit signed integer
377
INT32: 32-bit signed integer
382
CARD8: 8-bit unsigned integer
387
CARD16: 16-bit unsigned integer
392
CARD32: 32-bit unsigned integer
405
<literallayout class="monospaced">
438
#x00000002 KeyRelease
439
#x00000004 ButtonPress
440
#x00000008 ButtonRelease
441
#x00000010 EnterWindow
442
#x00000020 LeaveWindow
443
#x00000040 PointerMotion
444
#x00000080 PointerMotionHint
445
#x00000100 Button1Motion
446
#x00000200 Button2Motion
447
#x00000400 Button3Motion
448
#x00000800 Button4Motion
449
#x00001000 Button5Motion
450
#x00002000 ButtonMotion
451
#x00004000 KeymapState
453
#x00010000 VisibilityChange
454
#x00020000 StructureNotify
455
#x00040000 ResizeRedirect
456
#x00080000 SubstructureNotify
457
#x00100000 SubstructureRedirect
458
#x00200000 FocusChange
459
#x00400000 PropertyChange
460
#x00800000 ColormapChange
461
#x01000000 OwnerGrabButton
462
#xFE000000 unused but must be zero
465
encodings are the same as for SETofEVENT, except with
466
#xFFFF8003 unused but must be zero
469
encodings are the same as for SETofEVENT, except with
470
#xFFFFC0B0 unused but must be zero
490
#xE000 unused but must be zero
493
encodings are the same as for SETofKEYBUTMASK, except with
494
#xFF00 unused but must be zero
496
STRING16: LISTofCHAR2B
528
2 n length of address
533
1 n length of name in bytes
539
<sect1 id="errors_2">
540
<title>Errors</title>
542
<literallayout class="monospaced">
543
<emphasis role='bold'>Request</emphasis>
546
2 CARD16 sequence number
548
2 CARD16 minor opcode
552
<emphasis role='bold'>Value</emphasis>
555
2 CARD16 sequence number
556
4 <32-bits> bad value
557
2 CARD16 minor opcode
561
<emphasis role='bold'>Window</emphasis>
564
2 CARD16 sequence number
565
4 CARD32 bad resource id
566
2 CARD16 minor opcode
570
<emphasis role='bold'>Pixmap</emphasis>
573
2 CARD16 sequence number
574
4 CARD32 bad resource id
575
2 CARD16 minor opcode
579
<emphasis role='bold'>Atom</emphasis>
582
2 CARD16 sequence number
584
2 CARD16 minor opcode
588
<emphasis role='bold'>Cursor</emphasis>
591
2 CARD16 sequence number
592
4 CARD32 bad resource id
593
2 CARD16 minor opcode
597
<emphasis role='bold'>Font</emphasis>
600
2 CARD16 sequence number
601
4 CARD32 bad resource id
602
2 CARD16 minor opcode
606
<emphasis role='bold'>Match</emphasis>
609
2 CARD16 sequence number
611
2 CARD16 minor opcode
615
<emphasis role='bold'>Drawable</emphasis>
618
2 CARD16 sequence number
619
4 CARD32 bad resource id
620
2 CARD16 minor opcode
624
<emphasis role='bold'>Access</emphasis>
627
2 CARD16 sequence number
629
2 CARD16 minor opcode
633
<emphasis role='bold'>Alloc</emphasis>
636
2 CARD16 sequence number
638
2 CARD16 minor opcode
642
<emphasis role='bold'>Colormap</emphasis>
645
2 CARD16 sequence number
646
4 CARD32 bad resource id
647
2 CARD16 minor opcode
651
<emphasis role='bold'>GContext</emphasis>
654
2 CARD16 sequence number
655
4 CARD32 bad resource id
656
2 CARD16 minor opcode
660
<emphasis role='bold'>IDChoice</emphasis>
663
2 CARD16 sequence number
664
4 CARD32 bad resource id
665
2 CARD16 minor opcode
669
<emphasis role='bold'>Name</emphasis>
672
2 CARD16 sequence number
674
2 CARD16 minor opcode
678
<emphasis role='bold'>Length</emphasis>
681
2 CARD16 sequence number
683
2 CARD16 minor opcode
687
<emphasis role='bold'>Implementation</emphasis>
690
2 CARD16 sequence number
692
2 CARD16 minor opcode
698
<sect1 id="keyboards_2">
699
<title>Keyboards</title>
702
KEYCODE values are always greater than 7 (and less than 256).
706
KEYSYM values with the bit #x10000000 set are reserved as vendor-specific.
710
The names and encodings of the standard KEYSYM values are contained in
711
Appendix A, Keysym Encoding. <!-- xref -->
715
<sect1 id="pointers_2">
716
<title>Pointers</title>
719
BUTTON values are numbered starting with one.
723
<sect1 id="predefined">
724
<title>Predefined Atoms</title>
726
<literallayout class="monospaced">
727
PRIMARY 1 WM_NORMAL_HINTS 40
728
SECONDARY 2 WM_SIZE_HINTS 41
729
ARC 3 WM_ZOOM_HINTS 42
731
BITMAP 5 NORM_SPACE 44
732
CARDINAL 6 MAX_SPACE 45
733
COLORMAP 7 END_SPACE 46
734
CURSOR 8 SUPERSCRIPT_X 47
735
CUT_BUFFER0 9 SUPERSCRIPT_Y 48
736
CUT_BUFFER1 10 SUBSCRIPT_X 49
737
CUT_BUFFER2 11 SUBSCRIPT_Y 50
738
CUT_BUFFER3 12 UNDERLINE_POSITION 51
739
CUT_BUFFER4 13 UNDERLINE_THICKNESS 52
740
CUT_BUFFER5 14 STRIKEOUT_ASCENT 53
741
CUT_BUFFER6 15 STRIKEOUT_DESCENT 54
742
CUT_BUFFER7 16 ITALIC_ANGLE 55
743
DRAWABLE 17 X_HEIGHT 56
744
FONT 18 QUAD_WIDTH 57
746
PIXMAP 20 POINT_SIZE 59
747
POINT 21 RESOLUTION 60
748
RECTANGLE 22 COPYRIGHT 61
749
RESOURCE_MANAGER 23 NOTICE 62
750
RGB_COLOR_MAP 24 FONT_NAME 63
751
RGB_BEST_MAP 25 FAMILY_NAME 64
752
RGB_BLUE_MAP 26 FULL_NAME 65
753
RGB_DEFAULT_MAP 27 CAP_HEIGHT 66
754
RGB_GRAY_MAP 28 WM_CLASS 67
755
RGB_GREEN_MAP 29 WM_TRANSIENT_FOR 68
769
<sect1 id="connection_setup_2">
770
<title>Connection Setup</title>
774
displays on a given host are numbered starting from 0,
775
and the server for display N listens and accepts connections on port 6000 + N.
776
For DECnet connections,
777
displays on a given host are numbered starting from 0,
778
and the server for display N listens and accepts connections on the object
779
name obtained by concatenating "X$X" with the decimal representation of N,
780
for example, X$X0 and X$X1.
784
Information sent by the client at connection setup:
787
<literallayout class="monospaced">
792
2 CARD16 protocol-major-version
793
2 CARD16 protocol-minor-version
794
2 n length of authorization-protocol-name
795
2 d length of authorization-protocol-data
797
n STRING8 authorization-protocol-name
799
d STRING8 authorization-protocol-data
804
Except where explicitly noted in the protocol,
805
all 16-bit and 32-bit quantities sent by the client must be transmitted
806
with the specified byte order,
807
and all 16-bit and 32-bit quantities returned by the server will be transmitted
808
with this byte order.
812
Information received by the client if the connection is refused:
815
<literallayout class="monospaced">
817
1 n length of reason in bytes
818
2 CARD16 protocol-major-version
819
2 CARD16 protocol-minor-version
820
2 (n+p)/4 length in 4-byte units of "additional data"
826
Information received by the client if further authentication is required:
829
<literallayout class="monospaced">
832
2 (n+p)/4 length in 4-byte units of "additional data"
838
Information received by the client if the connection is accepted:
841
<literallayout class="monospaced">
844
2 CARD16 protocol-major-version
845
2 CARD16 protocol-minor-version
846
2 8+2n+(v+p+m)/4 length in 4-byte units of
848
4 CARD32 release-number
849
4 CARD32 resource-id-base
850
4 CARD32 resource-id-mask
851
4 CARD32 motion-buffer-size
853
2 CARD16 maximum-request-length
854
1 CARD8 number of SCREENs in roots
855
1 n number for FORMATs in
860
1 bitmap-format-bit-order
863
1 CARD8 bitmap-format-scanline-unit
864
1 CARD8 bitmap-format-scanline-pad
865
1 KEYCODE min-keycode
866
1 KEYCODE max-keycode
870
8n LISTofFORMAT pixmap-formats
871
m LISTofSCREEN roots (m is always a multiple of 4)
874
<literallayout class="monospaced">
877
1 CARD8 bits-per-pixel
882
<literallayout class="monospaced">
885
4 COLORMAP default-colormap
888
4 SETofEVENT current-input-masks
889
2 CARD16 width-in-pixels
890
2 CARD16 height-in-pixels
891
2 CARD16 width-in-millimeters
892
2 CARD16 height-in-millimeters
893
2 CARD16 min-installed-maps
894
2 CARD16 max-installed-maps
895
4 VISUALID root-visual
902
1 CARD8 number of DEPTHs in allowed-depths
903
n LISTofDEPTH allowed-depths (n is always a
907
<literallayout class="monospaced">
911
2 n number of VISUALTYPES in visuals
913
24n LISTofVISUALTYPE visuals
916
<literallayout class="monospaced">
926
1 CARD8 bits-per-rgb-value
927
2 CARD16 colormap-entries
935
<sect1 id="requests_2">
936
<title>Requests</title>
938
<literallayout class="monospaced">
939
<emphasis role='bold'>CreateWindow</emphasis>
949
2 CARD16 border-width
956
4 BITMASK value-mask (has n bits set to 1)
957
#x00000001 background-pixmap
958
#x00000002 background-pixel
959
#x00000004 border-pixmap
960
#x00000008 border-pixel
961
#x00000010 bit-gravity
962
#x00000020 win-gravity
963
#x00000040 backing-store
964
#x00000080 backing-planes
965
#x00000100 backing-pixel
966
#x00000200 override-redirect
967
#x00000400 save-under
968
#x00000800 event-mask
969
#x00001000 do-not-propagate-mask
972
4n LISTofVALUE value-list
975
4 PIXMAP background-pixmap
978
4 CARD32 background-pixel
979
4 PIXMAP border-pixmap
981
4 CARD32 border-pixel
982
1 BITGRAVITY bit-gravity
983
1 WINGRAVITY win-gravity
988
4 CARD32 backing-planes
989
4 CARD32 backing-pixel
990
1 BOOL override-redirect
992
4 SETofEVENT event-mask
993
4 SETofDEVICEEVENT do-not-propagate-mask
999
<emphasis role='bold'>ChangeWindowAttributes</emphasis>
1002
2 3+n request length
1004
4 BITMASK value-mask (has n bits set to 1)
1005
encodings are the same as for CreateWindow
1006
4n LISTofVALUE value-list
1007
encodings are the same as for CreateWindow
1009
<emphasis role='bold'>GetWindowAttributes</emphasis>
1021
2 CARD16 sequence number
1027
1 BITGRAVITY bit-gravity
1028
1 WINGRAVITY win-gravity
1029
4 CARD32 backing-planes
1030
4 CARD32 backing-pixel
1032
1 BOOL map-is-installed
1037
1 BOOL override-redirect
1040
4 SETofEVENT all-event-masks
1041
4 SETofEVENT your-event-mask
1042
2 SETofDEVICEEVENT do-not-propagate-mask
1045
<emphasis role='bold'>DestroyWindow</emphasis>
1051
<emphasis role='bold'>DestroySubwindows</emphasis>
1057
<emphasis role='bold'>ChangeSaveSet</emphasis>
1065
<emphasis role='bold'>ReparentWindow</emphasis>
1074
<emphasis role='bold'>MapWindow</emphasis>
1080
<emphasis role='bold'>MapSubwindows</emphasis>
1086
<emphasis role='bold'>UnmapWindow</emphasis>
1092
<emphasis role='bold'>UnmapSubwindows</emphasis>
1098
<emphasis role='bold'>ConfigureWindow</emphasis>
1101
2 3+n request length
1103
2 BITMASK value-mask (has n bits set to 1)
1112
4n LISTofVALUE value-list
1119
2 CARD16 border-width
1128
<emphasis role='bold'>CirculateWindow</emphasis>
1136
<emphasis role='bold'>GetGeometry</emphasis>
1145
2 CARD16 sequence number
1152
2 CARD16 border-width
1155
<emphasis role='bold'>QueryTree</emphasis>
1164
2 CARD16 sequence number
1169
2 n number of WINDOWs in children
1171
4n LISTofWINDOW children
1173
<emphasis role='bold'>InternAtom</emphasis>
1175
1 BOOL only-if-exists
1176
2 2+(n+p)/4 request length
1185
2 CARD16 sequence number
1191
<emphasis role='bold'>GetAtomName</emphasis>
1200
2 CARD16 sequence number
1201
4 (n+p)/4 reply length
1207
<emphasis role='bold'>ChangeProperty</emphasis>
1213
2 6+(n+p)/4 request length
1219
4 CARD32 length of data in format units
1220
(= n for format = 8)
1221
(= n/2 for format = 16)
1222
(= n/4 for format = 32)
1224
(n is a multiple of 2 for format = 16)
1225
(n is a multiple of 4 for format = 32)
1229
<emphasis role='bold'>DeleteProperty</emphasis>
1236
<emphasis role='bold'>GetProperty</emphasis>
1244
4 CARD32 long-offset
1245
4 CARD32 long-length
1250
2 CARD16 sequence number
1251
4 (n+p)/4 reply length
1254
4 CARD32 bytes-after
1255
4 CARD32 length of value in format units
1256
(= 0 for format = 0)
1257
(= n for format = 8)
1258
(= n/2 for format = 16)
1259
(= n/4 for format = 32)
1262
(n is zero for format = 0)
1263
(n is a multiple of 2 for format = 16)
1264
(n is a multiple of 4 for format = 32)
1267
<emphasis role='bold'>ListProperties</emphasis>
1276
2 CARD16 sequence number
1278
2 n number of ATOMs in atoms
1282
<emphasis role='bold'>SetSelectionOwner</emphasis>
1292
<emphasis role='bold'>GetSelectionOwner</emphasis>
1301
2 CARD16 sequence number
1307
<emphasis role='bold'>ConvertSelection</emphasis>
1319
<emphasis role='bold'>SendEvent</emphasis>
1323
4 WINDOW destination
1326
4 SETofEVENT event-mask
1328
standard event format (see the Events section)
1330
<emphasis role='bold'>GrabPointer</emphasis>
1334
4 WINDOW grab-window
1335
2 SETofPOINTEREVENT event-mask
1357
2 CARD16 sequence number
1361
<emphasis role='bold'>UngrabPointer</emphasis>
1368
<emphasis role='bold'>GrabButton</emphasis>
1372
4 WINDOW grab-window
1373
2 SETofPOINTEREVENT event-mask
1387
2 SETofKEYMASK modifiers
1390
<emphasis role='bold'>UngrabButton</emphasis>
1395
4 WINDOW grab-window
1396
2 SETofKEYMASK modifiers
1400
<emphasis role='bold'>ChangeActivePointerGrab</emphasis>
1408
2 SETofPOINTEREVENT event-mask
1411
<emphasis role='bold'>GrabKeyboard</emphasis>
1415
4 WINDOW grab-window
1434
2 CARD16 sequence number
1438
<emphasis role='bold'>UngrabKeyboard</emphasis>
1445
<emphasis role='bold'>GrabKey</emphasis>
1449
4 WINDOW grab-window
1450
2 SETofKEYMASK modifiers
1462
<emphasis role='bold'>UngrabKey</emphasis>
1467
4 WINDOW grab-window
1468
2 SETofKEYMASK modifiers
1472
<emphasis role='bold'>AllowEvents</emphasis>
1487
<emphasis role='bold'>GrabServer</emphasis>
1492
<emphasis role='bold'>UngrabServer</emphasis>
1497
<emphasis role='bold'>QueryPointer</emphasis>
1506
2 CARD16 sequence number
1515
2 SETofKEYBUTMASK mask
1518
<emphasis role='bold'>GetMotionEvents</emphasis>
1531
2 CARD16 sequence number
1533
4 n number of TIMECOORDs in events
1535
8n LISTofTIMECOORD events
1542
<emphasis role='bold'>TranslateCoordinates</emphasis>
1553
2 CARD16 sequence number
1561
<emphasis role='bold'>WarpPointer</emphasis>
1576
<emphasis role='bold'>SetInputFocus</emphasis>
1589
<emphasis role='bold'>GetInputFocus</emphasis>
1600
2 CARD16 sequence number
1607
<emphasis role='bold'>QueryKeymap</emphasis>
1615
2 CARD16 sequence number
1619
<emphasis role='bold'>OpenFont</emphasis>
1622
2 3+(n+p)/4 request length
1629
<emphasis role='bold'>CloseFont</emphasis>
1635
<emphasis role='bold'>QueryFont</emphasis>
1644
2 CARD16 sequence number
1645
4 7+2n+3m reply length
1646
12 CHARINFO min-bounds
1648
12 CHARINFO max-bounds
1650
2 CARD16 min-char-or-byte2
1651
2 CARD16 max-char-or-byte2
1652
2 CARD16 default-char
1653
2 n number of FONTPROPs in properties
1659
1 BOOL all-chars-exist
1661
2 INT16 font-descent
1662
4 m number of CHARINFOs in char-infos
1663
8n LISTofFONTPROP properties
1664
12m LISTofCHARINFO char-infos
1668
4 <32-bits> value
1671
2 INT16 left-side-bearing
1672
2 INT16 right-side-bearing
1673
2 INT16 character-width
1678
<emphasis role='bold'>QueryTextExtents</emphasis>
1680
1 BOOL odd length, True if p = 2
1681
2 2+(2n+p)/4 request length
1691
2 CARD16 sequence number
1694
2 INT16 font-descent
1695
2 INT16 overall-ascent
1696
2 INT16 overall-descent
1697
4 INT32 overall-width
1698
4 INT32 overall-left
1699
4 INT32 overall-right
1702
<emphasis role='bold'>ListFonts</emphasis>
1705
2 2+(n+p)/4 request length
1707
2 n length of pattern
1714
2 CARD16 sequence number
1715
4 (n+p)/4 reply length
1716
2 CARD16 number of STRs in names
1721
<emphasis role='bold'>ListFontsWithInfo</emphasis>
1724
2 2+(n+p)/4 request length
1726
2 n length of pattern
1730
-> (except for last in series)
1732
1 n length of name in bytes
1733
2 CARD16 sequence number
1734
4 7+2m+(n+p)/4 reply length
1735
12 CHARINFO min-bounds
1737
12 CHARINFO max-bounds
1739
2 CARD16 min-char-or-byte2
1740
2 CARD16 max-char-or-byte2
1741
2 CARD16 default-char
1742
2 m number of FONTPROPs in properties
1748
1 BOOL all-chars-exist
1750
2 INT16 font-descent
1751
4 CARD32 replies-hint
1752
8m LISTofFONTPROP properties
1757
encodings are the same as for QueryFont
1760
encodings are the same as for QueryFont
1762
-> (last in series)
1764
1 0 last-reply indicator
1765
2 CARD16 sequence number
1769
<emphasis role='bold'>SetFontPath</emphasis>
1772
2 2+(n+p)/4 request length
1773
2 CARD16 number of STRs in path
1778
<emphasis role='bold'>GetFontPath</emphasis>
1786
2 CARD16 sequence number
1787
4 (n+p)/4 reply length
1788
2 CARD16 number of STRs in path
1793
<emphasis role='bold'>CreatePixmap</emphasis>
1802
<emphasis role='bold'>FreePixmap</emphasis>
1808
<emphasis role='bold'>CreateGC</emphasis>
1811
2 4+n request length
1814
4 BITMASK value-mask (has n bits set to 1)
1816
#x00000002 plane-mask
1817
#x00000004 foreground
1818
#x00000008 background
1819
#x00000010 line-width
1820
#x00000020 line-style
1821
#x00000040 cap-style
1822
#x00000080 join-style
1823
#x00000100 fill-style
1824
#x00000200 fill-rule
1827
#x00001000 tile-stipple-x-origin
1828
#x00002000 tile-stipple-y-origin
1830
#x00008000 subwindow-mode
1831
#x00010000 graphics-exposures
1832
#x00020000 clip-x-origin
1833
#x00040000 clip-y-origin
1834
#x00080000 clip-mask
1835
#x00100000 dash-offset
1838
4n LISTofVALUE value-list
1885
2 INT16 tile-stipple-x-origin
1886
2 INT16 tile-stipple-y-origin
1891
1 BOOL graphics-exposures
1892
2 INT16 clip-x-origin
1893
2 INT16 clip-y-origin
1896
2 CARD16 dash-offset
1902
<emphasis role='bold'>ChangeGC</emphasis>
1905
2 3+n request length
1907
4 BITMASK value-mask (has n bits set to 1)
1908
encodings are the same as for CreateGC
1909
4n LISTofVALUE value-list
1910
encodings are the same as for CreateGC
1912
<emphasis role='bold'>CopyGC</emphasis>
1918
4 BITMASK value-mask
1919
encodings are the same as for CreateGC
1921
<emphasis role='bold'>SetDashes</emphasis>
1924
2 3+(n+p)/4 request length
1926
2 CARD16 dash-offset
1927
2 n length of dashes
1928
n LISTofCARD8 dashes
1931
<emphasis role='bold'>SetClipRectangles</emphasis>
1938
2 3+2n request length
1940
2 INT16 clip-x-origin
1941
2 INT16 clip-y-origin
1942
8n LISTofRECTANGLE rectangles
1944
<emphasis role='bold'>FreeGC</emphasis>
1950
<emphasis role='bold'>ClearArea</emphasis>
1960
<emphasis role='bold'>CopyArea</emphasis>
1964
4 DRAWABLE src-drawable
1965
4 DRAWABLE dst-drawable
1974
<emphasis role='bold'>CopyPlane</emphasis>
1978
4 DRAWABLE src-drawable
1979
4 DRAWABLE dst-drawable
1989
<emphasis role='bold'>PolyPoint</emphasis>
1994
2 3+n request length
1997
4n LISTofPOINT points
1999
<emphasis role='bold'>PolyLine</emphasis>
2004
2 3+n request length
2007
4n LISTofPOINT points
2009
<emphasis role='bold'>PolySegment</emphasis>
2012
2 3+2n request length
2015
8n LISTofSEGMENT segments
2023
<emphasis role='bold'>PolyRectangle</emphasis>
2026
2 3+2n request length
2029
8n LISTofRECTANGLE rectangles
2031
<emphasis role='bold'>PolyArc</emphasis>
2034
2 3+3n request length
2039
<emphasis role='bold'>FillPoly</emphasis>
2042
2 4+n request length
2053
4n LISTofPOINT points
2055
<emphasis role='bold'>PolyFillRectangle</emphasis>
2058
2 3+2n request length
2061
8n LISTofRECTANGLE rectangles
2063
<emphasis role='bold'>PolyFillArc</emphasis>
2066
2 3+3n request length
2071
<emphasis role='bold'>PutImage</emphasis>
2077
2 6+(n+p)/4 request length
2090
<emphasis role='bold'>GetImage</emphasis>
2106
2 CARD16 sequence number
2107
4 (n+p)/4 reply length
2114
<emphasis role='bold'>PolyText8</emphasis>
2117
2 4+(n+p)/4 request length
2122
n LISTofTEXTITEM8 items
2123
p unused, p=pad(n) (p is always 0
2127
1 m length of string (cannot be 255)
2131
1 255 font-shift indicator
2132
1 font byte 3 (most-significant)
2135
1 font byte 0 (least-significant)
2137
<emphasis role='bold'>PolyText16</emphasis>
2140
2 4+(n+p)/4 request length
2145
n LISTofTEXTITEM16 items
2146
p unused, p=pad(n) (p must be 0 or
2150
1 m number of CHAR2Bs in string
2155
1 255 font-shift indicator
2156
1 font byte 3 (most-significant)
2159
1 font byte 0 (least-significant)
2161
<emphasis role='bold'>ImageText8</emphasis>
2163
1 n length of string
2164
2 4+(n+p)/4 request length
2172
<emphasis role='bold'>ImageText16</emphasis>
2174
1 n number of CHAR2Bs in string
2175
2 4+(2n+p)/4 request length
2183
<emphasis role='bold'>CreateColormap</emphasis>
2193
<emphasis role='bold'>FreeColormap</emphasis>
2199
<emphasis role='bold'>CopyColormapAndFree</emphasis>
2206
<emphasis role='bold'>InstallColormap</emphasis>
2212
<emphasis role='bold'>UninstallColormap</emphasis>
2218
<emphasis role='bold'>ListInstalledColormaps</emphasis>
2227
2 CARD16 sequence number
2229
2 n number of COLORMAPs in cmaps
2231
4n LISTofCOLORMAP cmaps
2233
<emphasis role='bold'>AllocColor</emphasis>
2246
2 CARD16 sequence number
2255
<emphasis role='bold'>AllocNamedColor</emphasis>
2258
2 3+(n+p)/4 request length
2268
2 CARD16 sequence number
2272
2 CARD16 exact-green
2275
2 CARD16 visual-green
2276
2 CARD16 visual-blue
2279
<emphasis role='bold'>AllocColorCells</emphasis>
2290
2 CARD16 sequence number
2292
2 n number of CARD32s in pixels
2293
2 m number of CARD32s in masks
2295
4n LISTofCARD32 pixels
2296
4m LISTofCARD32 masks
2298
<emphasis role='bold'>AllocColorPlanes</emphasis>
2311
2 CARD16 sequence number
2313
2 n number of CARD32s in pixels
2319
4n LISTofCARD32 pixels
2321
<emphasis role='bold'>FreeColors</emphasis>
2324
2 3+n request length
2327
4n LISTofCARD32 pixels
2329
<emphasis role='bold'>StoreColors</emphasis>
2332
2 2+3n request length
2334
12n LISTofCOLORITEM items
2341
1 do-red, do-green, do-blue
2342
#x01 do-red (1 is True, 0 is False)
2343
#x02 do-green (1 is True, 0 is False)
2344
#x04 do-blue (1 is True, 0 is False)
2348
<emphasis role='bold'>StoreNamedColor</emphasis>
2350
1 do-red, do-green, do-blue
2351
#x01 do-red (1 is True, 0 is False)
2352
#x02 do-green (1 is True, 0 is False)
2353
#x04 do-blue (1 is True, 0 is False)
2355
2 4+(n+p)/4 request length
2363
<emphasis role='bold'>QueryColors</emphasis>
2366
2 2+n request length
2368
4n LISTofCARD32 pixels
2373
2 CARD16 sequence number
2375
2 n number of RGBs in colors
2385
<emphasis role='bold'>LookupColor</emphasis>
2388
2 3+(n+p)/4 request length
2398
2 CARD16 sequence number
2401
2 CARD16 exact-green
2404
2 CARD16 visual-green
2405
2 CARD16 visual-blue
2408
<emphasis role='bold'>CreateCursor</emphasis>
2425
<emphasis role='bold'>CreateGlyphCursor</emphasis>
2433
2 CARD16 source-char
2442
<emphasis role='bold'>FreeCursor</emphasis>
2448
<emphasis role='bold'>RecolorCursor</emphasis>
2460
<emphasis role='bold'>QueryBestSize</emphasis>
2474
2 CARD16 sequence number
2480
<emphasis role='bold'>QueryExtension</emphasis>
2483
2 2+(n+p)/4 request length
2492
2 CARD16 sequence number
2495
1 CARD8 major-opcode
2500
<emphasis role='bold'>ListExtensions</emphasis>
2507
1 CARD8 number of STRs in names
2508
2 CARD16 sequence number
2509
4 (n+p)/4 reply length
2514
<emphasis role='bold'>ChangeKeyboardMapping</emphasis>
2517
2 2+nm request length
2518
1 KEYCODE first-keycode
2519
1 m keysyms-per-keycode
2521
4nm LISTofKEYSYM keysyms
2523
<emphasis role='bold'>GetKeyboardMapping</emphasis>
2527
1 KEYCODE first-keycode
2533
1 n keysyms-per-keycode
2534
2 CARD16 sequence number
2535
4 nm reply length (m = count field
2538
4nm LISTofKEYSYM keysyms
2540
<emphasis role='bold'>ChangeKeyboardControl</emphasis>
2543
2 2+n request length
2544
4 BITMASK value-mask (has n bits set to 1)
2545
#x0001 key-click-percent
2548
#x0008 bell-duration
2552
#x0080 auto-repeat-mode
2553
4n LISTofVALUE value-list
2556
1 INT8 key-click-percent
2559
2 INT16 bell-duration
2570
<emphasis role='bold'>GetKeyboardControl</emphasis>
2577
1 global-auto-repeat
2580
2 CARD16 sequence number
2583
1 CARD8 key-click-percent
2584
1 CARD8 bell-percent
2586
2 CARD16 bell-duration
2588
32 LISTofCARD8 auto-repeats
2590
<emphasis role='bold'>Bell</emphasis>
2595
<emphasis role='bold'>ChangePointerControl</emphasis>
2599
2 INT16 acceleration-numerator
2600
2 INT16 acceleration-denominator
2602
1 BOOL do-acceleration
2605
<emphasis role='bold'>GetPointerControl</emphasis>
2613
2 CARD16 sequence number
2615
2 CARD16 acceleration-numerator
2616
2 CARD16 acceleration-denominator
2620
<emphasis role='bold'>SetScreenSaver</emphasis>
2636
<emphasis role='bold'>GetScreenSaver</emphasis>
2644
2 CARD16 sequence number
2656
<emphasis role='bold'>ChangeHosts</emphasis>
2661
2 2+(n+p)/4 request length
2667
2 n length of address
2668
n LISTofCARD8 address
2671
<emphasis role='bold'>ListHosts</emphasis>
2681
2 CARD16 sequence number
2683
2 CARD16 number of HOSTs in hosts
2685
n LISTofHOST hosts (n always a multiple of 4)
2687
<emphasis role='bold'>SetAccessControl</emphasis>
2694
<emphasis role='bold'>SetCloseDownMode</emphasis>
2702
<emphasis role='bold'>KillClient</emphasis>
2709
<emphasis role='bold'>RotateProperties</emphasis>
2712
2 3+n request length
2714
2 n number of properties
2716
4n LISTofATOM properties
2718
<emphasis role='bold'>ForceScreenSaver</emphasis>
2725
<emphasis role='bold'>SetPointerMapping</emphasis>
2728
2 1+(n+p)/4 request length
2737
2 CARD16 sequence number
2741
<emphasis role='bold'>GetPointerMapping</emphasis>
2749
2 CARD16 sequence number
2750
4 (n+p)/4 reply length
2755
<emphasis role='bold'>SetModifierMapping</emphasis>
2757
1 n keycodes-per-modifier
2758
2 1+2n request length
2759
8n LISTofKEYCODE keycodes
2767
2 CARD16 sequence number
2771
<emphasis role='bold'>GetModifierMapping</emphasis>
2778
1 n keycodes-per-modifier
2779
2 CARD16 sequence number
2782
8n LISTofKEYCODE keycodes
2784
<emphasis role='bold'>NoOperation</emphasis>
2787
2 1+n request length
2792
<sect1 id="events_2">
2793
<title>Events</title>
2795
<literallayout class="monospaced">
2796
<emphasis role='bold'>KeyPress</emphasis>
2799
2 CARD16 sequence number
2809
2 SETofKEYBUTMASK state
2813
<emphasis role='bold'>KeyRelease</emphasis>
2816
2 CARD16 sequence number
2826
2 SETofKEYBUTMASK state
2830
<emphasis role='bold'>ButtonPress</emphasis>
2833
2 CARD16 sequence number
2843
2 SETofKEYBUTMASK state
2847
<emphasis role='bold'>ButtonRelease</emphasis>
2850
2 CARD16 sequence number
2860
2 SETofKEYBUTMASK state
2864
<emphasis role='bold'>MotionNotify</emphasis>
2869
2 CARD16 sequence number
2879
2 SETofKEYBUTMASK state
2883
<emphasis role='bold'>EnterNotify</emphasis>
2891
2 CARD16 sequence number
2901
2 SETofKEYBUTMASK state
2906
1 same-screen, focus
2907
#x01 focus (1 is True, 0 is False)
2908
#x02 same-screen (1 is True, 0 is False)
2911
<emphasis role='bold'>LeaveNotify</emphasis>
2919
2 CARD16 sequence number
2929
2 SETofKEYBUTMASK state
2934
1 same-screen, focus
2935
#x01 focus (1 is True, 0 is False)
2936
#x02 same-screen (1 is True, 0 is False)
2939
<emphasis role='bold'>FocusIn</emphasis>
2950
2 CARD16 sequence number
2959
<emphasis role='bold'>FocusOut</emphasis>
2970
2 CARD16 sequence number
2979
<emphasis role='bold'>KeymapNotify</emphasis>
2981
31 LISTofCARD8 keys (byte for keycodes 0-7 is
2984
<emphasis role='bold'>Expose</emphasis>
2987
2 CARD16 sequence number
2996
<emphasis role='bold'>GraphicsExposure</emphasis>
2999
2 CARD16 sequence number
3005
2 CARD16 minor-opcode
3007
1 CARD8 major-opcode
3010
<emphasis role='bold'>NoExposure</emphasis>
3013
2 CARD16 sequence number
3015
2 CARD16 minor-opcode
3016
1 CARD8 major-opcode
3019
<emphasis role='bold'>VisibilityNotify</emphasis>
3022
2 CARD16 sequence number
3030
<emphasis role='bold'>CreateNotify</emphasis>
3033
2 CARD16 sequence number
3040
2 CARD16 border-width
3041
1 BOOL override-redirect
3044
<emphasis role='bold'>DestroyNotify</emphasis>
3047
2 CARD16 sequence number
3052
<emphasis role='bold'>UnmapNotify</emphasis>
3055
2 CARD16 sequence number
3058
1 BOOL from-configure
3061
<emphasis role='bold'>MapNotify</emphasis>
3064
2 CARD16 sequence number
3067
1 BOOL override-redirect
3070
<emphasis role='bold'>MapRequest</emphasis>
3073
2 CARD16 sequence number
3078
<emphasis role='bold'>ReparentNotify</emphasis>
3081
2 CARD16 sequence number
3087
1 BOOL override-redirect
3090
<emphasis role='bold'>ConfigureNotify</emphasis>
3093
2 CARD16 sequence number
3096
4 WINDOW above-sibling
3102
2 CARD16 border-width
3103
1 BOOL override-redirect
3106
<emphasis role='bold'>ConfigureRequest</emphasis>
3114
2 CARD16 sequence number
3123
2 CARD16 border-width
3124
2 BITMASK value-mask
3134
<emphasis role='bold'>GravityNotify</emphasis>
3137
2 CARD16 sequence number
3144
<emphasis role='bold'>ResizeRequest</emphasis>
3147
2 CARD16 sequence number
3153
<emphasis role='bold'>CirculateNotify</emphasis>
3156
2 CARD16 sequence number
3165
<emphasis role='bold'>CirculateRequest</emphasis>
3168
2 CARD16 sequence number
3177
<emphasis role='bold'>PropertyNotify</emphasis>
3180
2 CARD16 sequence number
3189
<emphasis role='bold'>SelectionClear</emphasis>
3192
2 CARD16 sequence number
3198
<emphasis role='bold'>SelectionRequest</emphasis>
3201
2 CARD16 sequence number
3212
<emphasis role='bold'>SelectionNotify</emphasis>
3215
2 CARD16 sequence number
3225
<emphasis role='bold'>ColormapNotify</emphasis>
3228
2 CARD16 sequence number
3238
<emphasis role='bold'>ClientMessage</emphasis>
3241
2 CARD16 sequence number
3246
<emphasis role='bold'>MappingNotify</emphasis>
3249
2 CARD16 sequence number
3254
1 KEYCODE first-keycode