1 | /* Definitions for the X window system used by server and c bindings */ |
2 | |
3 | /* |
4 | * This packet-construction scheme makes the following assumptions: |
5 | * |
6 | * 1. The compiler is able |
7 | * to generate code which addresses one- and two-byte quantities. |
8 | * In the worst case, this would be done with bit-fields. If bit-fields |
9 | * are used it may be necessary to reorder the request fields in this file, |
10 | * depending on the order in which the machine assigns bit fields to |
11 | * machine words. There may also be a problem with sign extension, |
12 | * as K+R specify that bitfields are always unsigned. |
13 | * |
14 | * 2. 2- and 4-byte fields in packet structures must be ordered by hand |
15 | * such that they are naturally-aligned, so that no compiler will ever |
16 | * insert padding bytes. |
17 | * |
18 | * 3. All packets are hand-padded to a multiple of 4 bytes, for |
19 | * the same reason. |
20 | */ |
21 | |
22 | #ifndef XPROTO_H |
23 | #define XPROTO_H |
24 | |
25 | /*********************************************************** |
26 | |
27 | Copyright 1987, 1998 The Open Group |
28 | |
29 | Permission to use, copy, modify, distribute, and sell this software and its |
30 | documentation for any purpose is hereby granted without fee, provided that |
31 | the above copyright notice appear in all copies and that both that |
32 | copyright notice and this permission notice appear in supporting |
33 | documentation. |
34 | |
35 | The above copyright notice and this permission notice shall be included in |
36 | all copies or substantial portions of the Software. |
37 | |
38 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
39 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
40 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
41 | OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN |
42 | AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
43 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
44 | |
45 | Except as contained in this notice, the name of The Open Group shall not be |
46 | used in advertising or otherwise to promote the sale, use or other dealings |
47 | in this Software without prior written authorization from The Open Group. |
48 | |
49 | |
50 | Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. |
51 | |
52 | All Rights Reserved |
53 | |
54 | Permission to use, copy, modify, and distribute this software and its |
55 | documentation for any purpose and without fee is hereby granted, |
56 | provided that the above copyright notice appear in all copies and that |
57 | both that copyright notice and this permission notice appear in |
58 | supporting documentation, and that the name of Digital not be |
59 | used in advertising or publicity pertaining to distribution of the |
60 | software without specific, written prior permission. |
61 | |
62 | DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING |
63 | ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL |
64 | DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR |
65 | ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, |
66 | WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, |
67 | ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS |
68 | SOFTWARE. |
69 | |
70 | ******************************************************************/ |
71 | |
72 | #include <X11/Xmd.h> |
73 | #include <X11/Xprotostr.h> |
74 | |
75 | /* |
76 | * Define constants for the sizes of the network packets. The sz_ prefix is |
77 | * used instead of something more descriptive so that the symbols are no more |
78 | * than 32 characters in length (which causes problems for some compilers). |
79 | */ |
80 | #define sz_xSegment 8 |
81 | #define sz_xPoint 4 |
82 | #define sz_xRectangle 8 |
83 | #define sz_xArc 12 |
84 | #define sz_xConnClientPrefix 12 |
85 | #define sz_xConnSetupPrefix 8 |
86 | #define sz_xConnSetup 32 |
87 | #define sz_xPixmapFormat 8 |
88 | #define sz_xDepth 8 |
89 | #define sz_xVisualType 24 |
90 | #define sz_xWindowRoot 40 |
91 | #define sz_xTimecoord 8 |
92 | #define sz_xHostEntry 4 |
93 | #define sz_xCharInfo 12 |
94 | #define sz_xFontProp 8 |
95 | #define sz_xTextElt 2 |
96 | #define sz_xColorItem 12 |
97 | #define sz_xrgb 8 |
98 | #define sz_xGenericReply 32 |
99 | #define sz_xGetWindowAttributesReply 44 |
100 | #define sz_xGetGeometryReply 32 |
101 | #define sz_xQueryTreeReply 32 |
102 | #define sz_xInternAtomReply 32 |
103 | #define sz_xGetAtomNameReply 32 |
104 | #define sz_xGetPropertyReply 32 |
105 | #define sz_xListPropertiesReply 32 |
106 | #define sz_xGetSelectionOwnerReply 32 |
107 | #define sz_xGrabPointerReply 32 |
108 | #define sz_xQueryPointerReply 32 |
109 | #define sz_xGetMotionEventsReply 32 |
110 | #define sz_xTranslateCoordsReply 32 |
111 | #define sz_xGetInputFocusReply 32 |
112 | #define sz_xQueryKeymapReply 40 |
113 | #define sz_xQueryFontReply 60 |
114 | #define sz_xQueryTextExtentsReply 32 |
115 | #define sz_xListFontsReply 32 |
116 | #define sz_xGetFontPathReply 32 |
117 | #define sz_xGetImageReply 32 |
118 | #define sz_xListInstalledColormapsReply 32 |
119 | #define sz_xAllocColorReply 32 |
120 | #define sz_xAllocNamedColorReply 32 |
121 | #define sz_xAllocColorCellsReply 32 |
122 | #define sz_xAllocColorPlanesReply 32 |
123 | #define sz_xQueryColorsReply 32 |
124 | #define sz_xLookupColorReply 32 |
125 | #define sz_xQueryBestSizeReply 32 |
126 | #define sz_xQueryExtensionReply 32 |
127 | #define sz_xListExtensionsReply 32 |
128 | #define sz_xSetMappingReply 32 |
129 | #define sz_xGetKeyboardControlReply 52 |
130 | #define sz_xGetPointerControlReply 32 |
131 | #define sz_xGetScreenSaverReply 32 |
132 | #define sz_xListHostsReply 32 |
133 | #define sz_xSetModifierMappingReply 32 |
134 | #define sz_xError 32 |
135 | #define sz_xEvent 32 |
136 | #define sz_xKeymapEvent 32 |
137 | #define sz_xReq 4 |
138 | #define sz_xResourceReq 8 |
139 | #define sz_xCreateWindowReq 32 |
140 | #define sz_xChangeWindowAttributesReq 12 |
141 | #define sz_xChangeSaveSetReq 8 |
142 | #define sz_xReparentWindowReq 16 |
143 | #define sz_xConfigureWindowReq 12 |
144 | #define sz_xCirculateWindowReq 8 |
145 | #define sz_xInternAtomReq 8 |
146 | #define sz_xChangePropertyReq 24 |
147 | #define sz_xDeletePropertyReq 12 |
148 | #define sz_xGetPropertyReq 24 |
149 | #define sz_xSetSelectionOwnerReq 16 |
150 | #define sz_xConvertSelectionReq 24 |
151 | #define sz_xSendEventReq 44 |
152 | #define sz_xGrabPointerReq 24 |
153 | #define sz_xGrabButtonReq 24 |
154 | #define sz_xUngrabButtonReq 12 |
155 | #define sz_xChangeActivePointerGrabReq 16 |
156 | #define sz_xGrabKeyboardReq 16 |
157 | #define sz_xGrabKeyReq 16 |
158 | #define sz_xUngrabKeyReq 12 |
159 | #define sz_xAllowEventsReq 8 |
160 | #define sz_xGetMotionEventsReq 16 |
161 | #define sz_xTranslateCoordsReq 16 |
162 | #define sz_xWarpPointerReq 24 |
163 | #define sz_xSetInputFocusReq 12 |
164 | #define sz_xOpenFontReq 12 |
165 | #define sz_xQueryTextExtentsReq 8 |
166 | #define sz_xListFontsReq 8 |
167 | #define sz_xSetFontPathReq 8 |
168 | #define sz_xCreatePixmapReq 16 |
169 | #define sz_xCreateGCReq 16 |
170 | #define sz_xChangeGCReq 12 |
171 | #define sz_xCopyGCReq 16 |
172 | #define sz_xSetDashesReq 12 |
173 | #define sz_xSetClipRectanglesReq 12 |
174 | #define sz_xCopyAreaReq 28 |
175 | #define sz_xCopyPlaneReq 32 |
176 | #define sz_xPolyPointReq 12 |
177 | #define sz_xPolySegmentReq 12 |
178 | #define sz_xFillPolyReq 16 |
179 | #define sz_xPutImageReq 24 |
180 | #define sz_xGetImageReq 20 |
181 | #define sz_xPolyTextReq 16 |
182 | #define sz_xImageTextReq 16 |
183 | #define sz_xCreateColormapReq 16 |
184 | #define sz_xCopyColormapAndFreeReq 12 |
185 | #define sz_xAllocColorReq 16 |
186 | #define sz_xAllocNamedColorReq 12 |
187 | #define sz_xAllocColorCellsReq 12 |
188 | #define sz_xAllocColorPlanesReq 16 |
189 | #define sz_xFreeColorsReq 12 |
190 | #define sz_xStoreColorsReq 8 |
191 | #define sz_xStoreNamedColorReq 16 |
192 | #define sz_xQueryColorsReq 8 |
193 | #define sz_xLookupColorReq 12 |
194 | #define sz_xCreateCursorReq 32 |
195 | #define sz_xCreateGlyphCursorReq 32 |
196 | #define sz_xRecolorCursorReq 20 |
197 | #define sz_xQueryBestSizeReq 12 |
198 | #define sz_xQueryExtensionReq 8 |
199 | #define sz_xChangeKeyboardControlReq 8 |
200 | #define sz_xBellReq 4 |
201 | #define sz_xChangePointerControlReq 12 |
202 | #define sz_xSetScreenSaverReq 12 |
203 | #define sz_xChangeHostsReq 8 |
204 | #define sz_xListHostsReq 4 |
205 | #define sz_xChangeModeReq 4 |
206 | #define sz_xRotatePropertiesReq 12 |
207 | #define sz_xReply 32 |
208 | #define sz_xGrabKeyboardReply 32 |
209 | #define sz_xListFontsWithInfoReply 60 |
210 | #define sz_xSetPointerMappingReply 32 |
211 | #define sz_xGetKeyboardMappingReply 32 |
212 | #define sz_xGetPointerMappingReply 32 |
213 | #define sz_xGetModifierMappingReply 32 |
214 | #define sz_xListFontsWithInfoReq 8 |
215 | #define sz_xPolyLineReq 12 |
216 | #define sz_xPolyArcReq 12 |
217 | #define sz_xPolyRectangleReq 12 |
218 | #define sz_xPolyFillRectangleReq 12 |
219 | #define sz_xPolyFillArcReq 12 |
220 | #define sz_xPolyText8Req 16 |
221 | #define sz_xPolyText16Req 16 |
222 | #define sz_xImageText8Req 16 |
223 | #define sz_xImageText16Req 16 |
224 | #define sz_xSetPointerMappingReq 4 |
225 | #define sz_xForceScreenSaverReq 4 |
226 | #define sz_xSetCloseDownModeReq 4 |
227 | #define sz_xClearAreaReq 16 |
228 | #define sz_xSetAccessControlReq 4 |
229 | #define sz_xGetKeyboardMappingReq 8 |
230 | #define sz_xSetModifierMappingReq 4 |
231 | #define sz_xPropIconSize 24 |
232 | #define sz_xChangeKeyboardMappingReq 8 |
233 | |
234 | |
235 | /* For the purpose of the structure definitions in this file, |
236 | we must redefine the following types in terms of Xmd.h's types, which may |
237 | include bit fields. All of these are #undef'd at the end of this file, |
238 | restoring the definitions in X.h. */ |
239 | |
240 | #define Window CARD32 |
241 | #define Drawable CARD32 |
242 | #define Font CARD32 |
243 | #define Pixmap CARD32 |
244 | #define Cursor CARD32 |
245 | #define Colormap CARD32 |
246 | #define GContext CARD32 |
247 | #define Atom CARD32 |
248 | #define VisualID CARD32 |
249 | #define Time CARD32 |
250 | #define KeyCode CARD8 |
251 | #define KeySym CARD32 |
252 | |
253 | #define X_TCP_PORT 6000 /* add display number */ |
254 | |
255 | #define xTrue 1 |
256 | #define xFalse 0 |
257 | |
258 | |
259 | typedef CARD16 KeyButMask; |
260 | |
261 | /***************** |
262 | Connection setup structures. See Chapter 8: Connection Setup |
263 | of the X Window System Protocol specification for details. |
264 | *****************/ |
265 | |
266 | /* Client initiates handshake with this data, followed by the strings |
267 | * for the auth protocol & data. |
268 | */ |
269 | typedef struct { |
270 | CARD8 byteOrder; |
271 | BYTE pad; |
272 | CARD16 majorVersion B16, minorVersion B16; |
273 | CARD16 nbytesAuthProto B16; /* Authorization protocol */ |
274 | CARD16 nbytesAuthString B16; /* Authorization string */ |
275 | CARD16 pad2 B16; |
276 | } xConnClientPrefix; |
277 | |
278 | /* Server response to xConnClientPrefix. |
279 | * |
280 | * If success == Success, this is followed by xConnSetup and |
281 | * numRoots xWindowRoot structs. |
282 | * |
283 | * If success == Failure, this is followed by a reason string. |
284 | * |
285 | * The protocol also defines a case of success == Authenticate, but |
286 | * that doesn't seem to have ever been implemented by the X Consortium. |
287 | */ |
288 | typedef struct { |
289 | CARD8 success; |
290 | BYTE lengthReason; /*num bytes in string following if failure */ |
291 | CARD16 majorVersion B16, |
292 | minorVersion B16; |
293 | CARD16 length B16; /* 1/4 additional bytes in setup info */ |
294 | } xConnSetupPrefix; |
295 | |
296 | |
297 | typedef struct { |
298 | CARD32 release B32; |
299 | CARD32 ridBase B32, |
300 | ridMask B32; |
301 | CARD32 motionBufferSize B32; |
302 | CARD16 nbytesVendor B16; /* number of bytes in vendor string */ |
303 | CARD16 maxRequestSize B16; |
304 | CARD8 numRoots; /* number of roots structs to follow */ |
305 | CARD8 numFormats; /* number of pixmap formats */ |
306 | CARD8 imageByteOrder; /* LSBFirst, MSBFirst */ |
307 | CARD8 bitmapBitOrder; /* LeastSignificant, MostSign...*/ |
308 | CARD8 bitmapScanlineUnit, /* 8, 16, 32 */ |
309 | bitmapScanlinePad; /* 8, 16, 32 */ |
310 | KeyCode minKeyCode, maxKeyCode; |
311 | CARD32 pad2 B32; |
312 | } xConnSetup; |
313 | |
314 | typedef struct { |
315 | CARD8 depth; |
316 | CARD8 bitsPerPixel; |
317 | CARD8 scanLinePad; |
318 | CARD8 pad1; |
319 | CARD32 pad2 B32; |
320 | } xPixmapFormat; |
321 | |
322 | /* window root */ |
323 | |
324 | typedef struct { |
325 | CARD8 depth; |
326 | CARD8 pad1; |
327 | CARD16 nVisuals B16; /* number of xVisualType structures following */ |
328 | CARD32 pad2 B32; |
329 | } xDepth; |
330 | |
331 | typedef struct { |
332 | VisualID visualID B32; |
333 | #if defined(__cplusplus) || defined(c_plusplus) |
334 | CARD8 c_class; |
335 | #else |
336 | CARD8 class; |
337 | #endif |
338 | CARD8 bitsPerRGB; |
339 | CARD16 colormapEntries B16; |
340 | CARD32 redMask B32, greenMask B32, blueMask B32; |
341 | CARD32 pad B32; |
342 | } xVisualType; |
343 | |
344 | typedef struct { |
345 | Window windowId B32; |
346 | Colormap defaultColormap B32; |
347 | CARD32 whitePixel B32, blackPixel B32; |
348 | CARD32 currentInputMask B32; |
349 | CARD16 pixWidth B16, pixHeight B16; |
350 | CARD16 mmWidth B16, mmHeight B16; |
351 | CARD16 minInstalledMaps B16, maxInstalledMaps B16; |
352 | VisualID rootVisualID B32; |
353 | CARD8 backingStore; |
354 | BOOL saveUnders; |
355 | CARD8 rootDepth; |
356 | CARD8 nDepths; /* number of xDepth structures following */ |
357 | } xWindowRoot; |
358 | |
359 | |
360 | /***************************************************************** |
361 | * Structure Defns |
362 | * Structures needed for replies |
363 | *****************************************************************/ |
364 | |
365 | /* Used in GetMotionEvents */ |
366 | |
367 | typedef struct { |
368 | CARD32 time B32; |
369 | INT16 x B16, y B16; |
370 | } xTimecoord; |
371 | |
372 | typedef struct { |
373 | CARD8 family; |
374 | BYTE pad; |
375 | CARD16 length B16; |
376 | } xHostEntry; |
377 | |
378 | typedef struct { |
379 | INT16 leftSideBearing B16, |
380 | rightSideBearing B16, |
381 | characterWidth B16, |
382 | ascent B16, |
383 | descent B16; |
384 | CARD16 attributes B16; |
385 | } xCharInfo; |
386 | |
387 | typedef struct { |
388 | Atom name B32; |
389 | CARD32 value B32; |
390 | } xFontProp; |
391 | |
392 | /* |
393 | * non-aligned big-endian font ID follows this struct |
394 | */ |
395 | typedef struct { /* followed by string */ |
396 | CARD8 len; /* number of *characters* in string, or FontChange (255) |
397 | for font change, or 0 if just delta given */ |
398 | INT8 delta; |
399 | } xTextElt; |
400 | |
401 | |
402 | typedef struct { |
403 | CARD32 pixel B32; |
404 | CARD16 red B16, green B16, blue B16; |
405 | CARD8 flags; /* DoRed, DoGreen, DoBlue booleans */ |
406 | CARD8 pad; |
407 | } xColorItem; |
408 | |
409 | |
410 | typedef struct { |
411 | CARD16 red B16, green B16, blue B16, pad B16; |
412 | } xrgb; |
413 | |
414 | typedef CARD8 KEYCODE; |
415 | |
416 | |
417 | /***************** |
418 | * XRep: |
419 | * meant to be 32 byte quantity |
420 | *****************/ |
421 | |
422 | /* GenericReply is the common format of all replies. The "data" items |
423 | are specific to each individual reply type. */ |
424 | |
425 | typedef struct { |
426 | BYTE type; /* X_Reply */ |
427 | BYTE data1; /* depends on reply type */ |
428 | CARD16 sequenceNumber B16; /* of last request received by server */ |
429 | CARD32 length B32; /* 4 byte quantities beyond size of GenericReply */ |
430 | CARD32 data00 B32; |
431 | CARD32 data01 B32; |
432 | CARD32 data02 B32; |
433 | CARD32 data03 B32; |
434 | CARD32 data04 B32; |
435 | CARD32 data05 B32; |
436 | } xGenericReply; |
437 | |
438 | /* Individual reply formats. */ |
439 | |
440 | typedef struct { |
441 | BYTE type; /* X_Reply */ |
442 | CARD8 backingStore; |
443 | CARD16 sequenceNumber B16; |
444 | CARD32 length B32; /* NOT 0; this is an extra-large reply */ |
445 | VisualID visualID B32; |
446 | #if defined(__cplusplus) || defined(c_plusplus) |
447 | CARD16 c_class B16; |
448 | #else |
449 | CARD16 class B16; |
450 | #endif |
451 | CARD8 bitGravity; |
452 | CARD8 winGravity; |
453 | CARD32 backingBitPlanes B32; |
454 | CARD32 backingPixel B32; |
455 | BOOL saveUnder; |
456 | BOOL mapInstalled; |
457 | CARD8 mapState; |
458 | BOOL override; |
459 | Colormap colormap B32; |
460 | CARD32 allEventMasks B32; |
461 | CARD32 yourEventMask B32; |
462 | CARD16 doNotPropagateMask B16; |
463 | CARD16 pad B16; |
464 | } xGetWindowAttributesReply; |
465 | |
466 | typedef struct { |
467 | BYTE type; /* X_Reply */ |
468 | CARD8 depth; |
469 | CARD16 sequenceNumber B16; |
470 | CARD32 length B32; /* 0 */ |
471 | Window root B32; |
472 | INT16 x B16, y B16; |
473 | CARD16 width B16, height B16; |
474 | CARD16 borderWidth B16; |
475 | CARD16 pad1 B16; |
476 | CARD32 pad2 B32; |
477 | CARD32 pad3 B32; |
478 | } xGetGeometryReply; |
479 | |
480 | typedef struct { |
481 | BYTE type; /* X_Reply */ |
482 | BYTE pad1; |
483 | CARD16 sequenceNumber B16; |
484 | CARD32 length B32; |
485 | Window root B32, parent B32; |
486 | CARD16 nChildren B16; |
487 | CARD16 pad2 B16; |
488 | CARD32 pad3 B32; |
489 | CARD32 pad4 B32; |
490 | CARD32 pad5 B32; |
491 | } xQueryTreeReply; |
492 | |
493 | typedef struct { |
494 | BYTE type; /* X_Reply */ |
495 | BYTE pad1; |
496 | CARD16 sequenceNumber B16; |
497 | CARD32 length B32; /* 0 */ |
498 | Atom atom B32; |
499 | CARD32 pad2 B32; |
500 | CARD32 pad3 B32; |
501 | CARD32 pad4 B32; |
502 | CARD32 pad5 B32; |
503 | CARD32 pad6 B32; |
504 | } xInternAtomReply; |
505 | |
506 | typedef struct { |
507 | BYTE type; /* X_Reply */ |
508 | BYTE pad1; |
509 | CARD16 sequenceNumber B16; |
510 | CARD32 length B32; /* of additional bytes */ |
511 | CARD16 nameLength B16; /* # of characters in name */ |
512 | CARD16 pad2 B16; |
513 | CARD32 pad3 B32; |
514 | CARD32 pad4 B32; |
515 | CARD32 pad5 B32; |
516 | CARD32 pad6 B32; |
517 | CARD32 pad7 B32; |
518 | } xGetAtomNameReply; |
519 | |
520 | typedef struct { |
521 | BYTE type; /* X_Reply */ |
522 | CARD8 format; |
523 | CARD16 sequenceNumber B16; |
524 | CARD32 length B32; /* of additional bytes */ |
525 | Atom propertyType B32; |
526 | CARD32 bytesAfter B32; |
527 | CARD32 nItems B32; /* # of 8, 16, or 32-bit entities in reply */ |
528 | CARD32 pad1 B32; |
529 | CARD32 pad2 B32; |
530 | CARD32 pad3 B32; |
531 | } xGetPropertyReply; |
532 | |
533 | typedef struct { |
534 | BYTE type; /* X_Reply */ |
535 | BYTE pad1; |
536 | CARD16 sequenceNumber B16; |
537 | CARD32 length B32; |
538 | CARD16 nProperties B16; |
539 | CARD16 pad2 B16; |
540 | CARD32 pad3 B32; |
541 | CARD32 pad4 B32; |
542 | CARD32 pad5 B32; |
543 | CARD32 pad6 B32; |
544 | CARD32 pad7 B32; |
545 | } xListPropertiesReply; |
546 | |
547 | typedef struct { |
548 | BYTE type; /* X_Reply */ |
549 | BYTE pad1; |
550 | CARD16 sequenceNumber B16; |
551 | CARD32 length B32; /* 0 */ |
552 | Window owner B32; |
553 | CARD32 pad2 B32; |
554 | CARD32 pad3 B32; |
555 | CARD32 pad4 B32; |
556 | CARD32 pad5 B32; |
557 | CARD32 pad6 B32; |
558 | } xGetSelectionOwnerReply; |
559 | |
560 | typedef struct { |
561 | BYTE type; /* X_Reply */ |
562 | BYTE status; |
563 | CARD16 sequenceNumber B16; |
564 | CARD32 length B32; /* 0 */ |
565 | CARD32 pad1 B32; |
566 | CARD32 pad2 B32; |
567 | CARD32 pad3 B32; |
568 | CARD32 pad4 B32; |
569 | CARD32 pad5 B32; |
570 | CARD32 pad6 B32; |
571 | } xGrabPointerReply; |
572 | |
573 | typedef xGrabPointerReply xGrabKeyboardReply; |
574 | |
575 | typedef struct { |
576 | BYTE type; /* X_Reply */ |
577 | BOOL sameScreen; |
578 | CARD16 sequenceNumber B16; |
579 | CARD32 length B32; /* 0 */ |
580 | Window root B32, child B32; |
581 | INT16 rootX B16, rootY B16, winX B16, winY B16; |
582 | CARD16 mask B16; |
583 | CARD16 pad1 B16; |
584 | CARD32 pad B32; |
585 | } xQueryPointerReply; |
586 | |
587 | typedef struct { |
588 | BYTE type; /* X_Reply */ |
589 | BYTE pad1; |
590 | CARD16 sequenceNumber B16; |
591 | CARD32 length B32; |
592 | CARD32 nEvents B32; |
593 | CARD32 pad2 B32; |
594 | CARD32 pad3 B32; |
595 | CARD32 pad4 B32; |
596 | CARD32 pad5 B32; |
597 | CARD32 pad6 B32; |
598 | } xGetMotionEventsReply; |
599 | |
600 | typedef struct { |
601 | BYTE type; /* X_Reply */ |
602 | BOOL sameScreen; |
603 | CARD16 sequenceNumber B16; |
604 | CARD32 length B32; /* 0 */ |
605 | Window child B32; |
606 | INT16 dstX B16, dstY B16; |
607 | CARD32 pad2 B32; |
608 | CARD32 pad3 B32; |
609 | CARD32 pad4 B32; |
610 | CARD32 pad5 B32; |
611 | } xTranslateCoordsReply; |
612 | |
613 | typedef struct { |
614 | BYTE type; /* X_Reply */ |
615 | CARD8 revertTo; |
616 | CARD16 sequenceNumber B16; |
617 | CARD32 length B32; /* 0 */ |
618 | Window focus B32; |
619 | CARD32 pad1 B32; |
620 | CARD32 pad2 B32; |
621 | CARD32 pad3 B32; |
622 | CARD32 pad4 B32; |
623 | CARD32 pad5 B32; |
624 | } xGetInputFocusReply; |
625 | |
626 | typedef struct { |
627 | BYTE type; /* X_Reply */ |
628 | BYTE pad1; |
629 | CARD16 sequenceNumber B16; |
630 | CARD32 length B32; /* 2, NOT 0; this is an extra-large reply */ |
631 | BYTE map[32]; |
632 | } xQueryKeymapReply; |
633 | |
634 | /* Warning: this MUST match (up to component renaming) xListFontsWithInfoReply */ |
635 | typedef struct _xQueryFontReply { |
636 | BYTE type; /* X_Reply */ |
637 | BYTE pad1; |
638 | CARD16 sequenceNumber B16; |
639 | CARD32 length B32; /* definitely > 0, even if "nCharInfos" is 0 */ |
640 | xCharInfo minBounds; |
641 | CARD32 walign1 B32; |
642 | xCharInfo maxBounds; |
643 | CARD32 walign2 B32; |
644 | CARD16 minCharOrByte2 B16, maxCharOrByte2 B16; |
645 | CARD16 defaultChar B16; |
646 | CARD16 nFontProps B16; /* followed by this many xFontProp structures */ |
647 | CARD8 drawDirection; |
648 | CARD8 minByte1, maxByte1; |
649 | BOOL allCharsExist; |
650 | INT16 fontAscent B16, fontDescent B16; |
651 | CARD32 nCharInfos B32; /* followed by this many xCharInfo structures */ |
652 | } xQueryFontReply; |
653 | |
654 | typedef struct { |
655 | BYTE type; /* X_Reply */ |
656 | CARD8 drawDirection; |
657 | CARD16 sequenceNumber B16; |
658 | CARD32 length B32; /* 0 */ |
659 | INT16 fontAscent B16, fontDescent B16; |
660 | INT16 overallAscent B16, overallDescent B16; |
661 | INT32 overallWidth B32, overallLeft B32, overallRight B32; |
662 | CARD32 pad B32; |
663 | } xQueryTextExtentsReply; |
664 | |
665 | typedef struct { |
666 | BYTE type; /* X_Reply */ |
667 | BYTE pad1; |
668 | CARD16 sequenceNumber B16; |
669 | CARD32 length B32; |
670 | CARD16 nFonts B16; |
671 | CARD16 pad2 B16; |
672 | CARD32 pad3 B32; |
673 | CARD32 pad4 B32; |
674 | CARD32 pad5 B32; |
675 | CARD32 pad6 B32; |
676 | CARD32 pad7 B32; |
677 | } xListFontsReply; |
678 | |
679 | /* Warning: this MUST match (up to component renaming) xQueryFontReply */ |
680 | typedef struct { |
681 | BYTE type; /* X_Reply */ |
682 | CARD8 nameLength; /* 0 indicates end-of-reply-sequence */ |
683 | CARD16 sequenceNumber B16; |
684 | CARD32 length B32; /* definitely > 0, even if "nameLength" is 0 */ |
685 | xCharInfo minBounds; |
686 | CARD32 walign1 B32; |
687 | xCharInfo maxBounds; |
688 | CARD32 walign2 B32; |
689 | CARD16 minCharOrByte2 B16, maxCharOrByte2 B16; |
690 | CARD16 defaultChar B16; |
691 | CARD16 nFontProps B16; /* followed by this many xFontProp structures */ |
692 | CARD8 drawDirection; |
693 | CARD8 minByte1, maxByte1; |
694 | BOOL allCharsExist; |
695 | INT16 fontAscent B16, fontDescent B16; |
696 | CARD32 nReplies B32; /* hint as to how many more replies might be coming */ |
697 | } xListFontsWithInfoReply; |
698 | |
699 | typedef struct { |
700 | BYTE type; /* X_Reply */ |
701 | BYTE pad1; |
702 | CARD16 sequenceNumber B16; |
703 | CARD32 length B32; |
704 | CARD16 nPaths B16; |
705 | CARD16 pad2 B16; |
706 | CARD32 pad3 B32; |
707 | CARD32 pad4 B32; |
708 | CARD32 pad5 B32; |
709 | CARD32 pad6 B32; |
710 | CARD32 pad7 B32; |
711 | } xGetFontPathReply; |
712 | |
713 | typedef struct { |
714 | BYTE type; /* X_Reply */ |
715 | CARD8 depth; |
716 | CARD16 sequenceNumber B16; |
717 | CARD32 length B32; |
718 | VisualID visual B32; |
719 | CARD32 pad3 B32; |
720 | CARD32 pad4 B32; |
721 | CARD32 pad5 B32; |
722 | CARD32 pad6 B32; |
723 | CARD32 pad7 B32; |
724 | } xGetImageReply; |
725 | |
726 | typedef struct { |
727 | BYTE type; /* X_Reply */ |
728 | BYTE pad1; |
729 | CARD16 sequenceNumber B16; |
730 | CARD32 length B32; |
731 | CARD16 nColormaps B16; |
732 | CARD16 pad2 B16; |
733 | CARD32 pad3 B32; |
734 | CARD32 pad4 B32; |
735 | CARD32 pad5 B32; |
736 | CARD32 pad6 B32; |
737 | CARD32 pad7 B32; |
738 | } xListInstalledColormapsReply; |
739 | |
740 | typedef struct { |
741 | BYTE type; /* X_Reply */ |
742 | BYTE pad1; |
743 | CARD16 sequenceNumber B16; |
744 | CARD32 length B32; /* 0 */ |
745 | CARD16 red B16, green B16, blue B16; |
746 | CARD16 pad2 B16; |
747 | CARD32 pixel B32; |
748 | CARD32 pad3 B32; |
749 | CARD32 pad4 B32; |
750 | CARD32 pad5 B32; |
751 | } xAllocColorReply; |
752 | |
753 | typedef struct { |
754 | BYTE type; /* X_Reply */ |
755 | BYTE pad1; |
756 | CARD16 sequenceNumber B16; |
757 | CARD32 length B32; /* 0 */ |
758 | CARD32 pixel B32; |
759 | CARD16 exactRed B16, exactGreen B16, exactBlue B16; |
760 | CARD16 screenRed B16, screenGreen B16, screenBlue B16; |
761 | CARD32 pad2 B32; |
762 | CARD32 pad3 B32; |
763 | } xAllocNamedColorReply; |
764 | |
765 | typedef struct { |
766 | BYTE type; /* X_Reply */ |
767 | BYTE pad1; |
768 | CARD16 sequenceNumber B16; |
769 | CARD32 length B32; |
770 | CARD16 nPixels B16, nMasks B16; |
771 | CARD32 pad3 B32; |
772 | CARD32 pad4 B32; |
773 | CARD32 pad5 B32; |
774 | CARD32 pad6 B32; |
775 | CARD32 pad7 B32; |
776 | } xAllocColorCellsReply; |
777 | |
778 | typedef struct { |
779 | BYTE type; /* X_Reply */ |
780 | BYTE pad1; |
781 | CARD16 sequenceNumber B16; |
782 | CARD32 length B32; |
783 | CARD16 nPixels B16; |
784 | CARD16 pad2 B16; |
785 | CARD32 redMask B32, greenMask B32, blueMask B32; |
786 | CARD32 pad3 B32; |
787 | CARD32 pad4 B32; |
788 | } xAllocColorPlanesReply; |
789 | |
790 | typedef struct { |
791 | BYTE type; /* X_Reply */ |
792 | BYTE pad1; |
793 | CARD16 sequenceNumber B16; |
794 | CARD32 length B32; |
795 | CARD16 nColors B16; |
796 | CARD16 pad2 B16; |
797 | CARD32 pad3 B32; |
798 | CARD32 pad4 B32; |
799 | CARD32 pad5 B32; |
800 | CARD32 pad6 B32; |
801 | CARD32 pad7 B32; |
802 | } xQueryColorsReply; |
803 | |
804 | typedef struct { |
805 | BYTE type; /* X_Reply */ |
806 | BYTE pad1; |
807 | CARD16 sequenceNumber B16; |
808 | CARD32 length B32; /* 0 */ |
809 | CARD16 exactRed B16, exactGreen B16, exactBlue B16; |
810 | CARD16 screenRed B16, screenGreen B16, screenBlue B16; |
811 | CARD32 pad3 B32; |
812 | CARD32 pad4 B32; |
813 | CARD32 pad5 B32; |
814 | } xLookupColorReply; |
815 | |
816 | typedef struct { |
817 | BYTE type; /* X_Reply */ |
818 | BYTE pad1; |
819 | CARD16 sequenceNumber B16; |
820 | CARD32 length B32; /* 0 */ |
821 | CARD16 width B16, height B16; |
822 | CARD32 pad3 B32; |
823 | CARD32 pad4 B32; |
824 | CARD32 pad5 B32; |
825 | CARD32 pad6 B32; |
826 | CARD32 pad7 B32; |
827 | } xQueryBestSizeReply; |
828 | |
829 | typedef struct { |
830 | BYTE type; /* X_Reply */ |
831 | BYTE pad1; |
832 | CARD16 sequenceNumber B16; |
833 | CARD32 length B32; /* 0 */ |
834 | BOOL present; |
835 | CARD8 major_opcode; |
836 | CARD8 first_event; |
837 | CARD8 first_error; |
838 | CARD32 pad3 B32; |
839 | CARD32 pad4 B32; |
840 | CARD32 pad5 B32; |
841 | CARD32 pad6 B32; |
842 | CARD32 pad7 B32; |
843 | } xQueryExtensionReply; |
844 | |
845 | typedef struct { |
846 | BYTE type; /* X_Reply */ |
847 | CARD8 nExtensions; |
848 | CARD16 sequenceNumber B16; |
849 | CARD32 length B32; |
850 | CARD32 pad2 B32; |
851 | CARD32 pad3 B32; |
852 | CARD32 pad4 B32; |
853 | CARD32 pad5 B32; |
854 | CARD32 pad6 B32; |
855 | CARD32 pad7 B32; |
856 | } xListExtensionsReply; |
857 | |
858 | |
859 | typedef struct { |
860 | BYTE type; /* X_Reply */ |
861 | CARD8 success; |
862 | CARD16 sequenceNumber B16; |
863 | CARD32 length B32; |
864 | CARD32 pad2 B32; |
865 | CARD32 pad3 B32; |
866 | CARD32 pad4 B32; |
867 | CARD32 pad5 B32; |
868 | CARD32 pad6 B32; |
869 | CARD32 pad7 B32; |
870 | } xSetMappingReply; |
871 | typedef xSetMappingReply xSetPointerMappingReply; |
872 | typedef xSetMappingReply xSetModifierMappingReply; |
873 | |
874 | typedef struct { |
875 | BYTE type; /* X_Reply */ |
876 | CARD8 nElts; /* how many elements does the map have */ |
877 | CARD16 sequenceNumber B16; |
878 | CARD32 length B32; |
879 | CARD32 pad2 B32; |
880 | CARD32 pad3 B32; |
881 | CARD32 pad4 B32; |
882 | CARD32 pad5 B32; |
883 | CARD32 pad6 B32; |
884 | CARD32 pad7 B32; |
885 | } xGetPointerMappingReply; |
886 | |
887 | typedef struct { |
888 | BYTE type; |
889 | CARD8 keySymsPerKeyCode; |
890 | CARD16 sequenceNumber B16; |
891 | CARD32 length B32; |
892 | CARD32 pad2 B32; |
893 | CARD32 pad3 B32; |
894 | CARD32 pad4 B32; |
895 | CARD32 pad5 B32; |
896 | CARD32 pad6 B32; |
897 | CARD32 pad7 B32; |
898 | } xGetKeyboardMappingReply; |
899 | |
900 | typedef struct { |
901 | BYTE type; |
902 | CARD8 numKeyPerModifier; |
903 | CARD16 sequenceNumber B16; |
904 | CARD32 length B32; |
905 | CARD32 pad1 B32; |
906 | CARD32 pad2 B32; |
907 | CARD32 pad3 B32; |
908 | CARD32 pad4 B32; |
909 | CARD32 pad5 B32; |
910 | CARD32 pad6 B32; |
911 | } xGetModifierMappingReply; |
912 | |
913 | typedef struct { |
914 | BYTE type; /* X_Reply */ |
915 | BOOL globalAutoRepeat; |
916 | CARD16 sequenceNumber B16; |
917 | CARD32 length B32; /* 5 */ |
918 | CARD32 ledMask B32; |
919 | CARD8 keyClickPercent, bellPercent; |
920 | CARD16 bellPitch B16, bellDuration B16; |
921 | CARD16 pad B16; |
922 | BYTE map[32]; /* bit masks start here */ |
923 | } xGetKeyboardControlReply; |
924 | |
925 | typedef struct { |
926 | BYTE type; /* X_Reply */ |
927 | BYTE pad1; |
928 | CARD16 sequenceNumber B16; |
929 | CARD32 length B32; /* 0 */ |
930 | CARD16 accelNumerator B16, accelDenominator B16; |
931 | CARD16 threshold B16; |
932 | CARD16 pad2 B16; |
933 | CARD32 pad3 B32; |
934 | CARD32 pad4 B32; |
935 | CARD32 pad5 B32; |
936 | CARD32 pad6 B32; |
937 | } xGetPointerControlReply; |
938 | |
939 | typedef struct { |
940 | BYTE type; /* X_Reply */ |
941 | BYTE pad1; |
942 | CARD16 sequenceNumber B16; |
943 | CARD32 length B32; /* 0 */ |
944 | CARD16 timeout B16, interval B16; |
945 | BOOL preferBlanking; |
946 | BOOL allowExposures; |
947 | CARD16 pad2 B16; |
948 | CARD32 pad3 B32; |
949 | CARD32 pad4 B32; |
950 | CARD32 pad5 B32; |
951 | CARD32 pad6 B32; |
952 | } xGetScreenSaverReply; |
953 | |
954 | typedef struct { |
955 | BYTE type; /* X_Reply */ |
956 | BOOL enabled; |
957 | CARD16 sequenceNumber B16; |
958 | CARD32 length B32; |
959 | CARD16 nHosts B16; |
960 | CARD16 pad1 B16; |
961 | CARD32 pad3 B32; |
962 | CARD32 pad4 B32; |
963 | CARD32 pad5 B32; |
964 | CARD32 pad6 B32; |
965 | CARD32 pad7 B32; |
966 | } xListHostsReply; |
967 | |
968 | |
969 | |
970 | |
971 | /***************************************************************** |
972 | * Xerror |
973 | * All errors are 32 bytes |
974 | *****************************************************************/ |
975 | |
976 | typedef struct { |
977 | BYTE type; /* X_Error */ |
978 | BYTE errorCode; |
979 | CARD16 sequenceNumber B16; /* the nth request from this client */ |
980 | CARD32 resourceID B32; |
981 | CARD16 minorCode B16; |
982 | CARD8 majorCode; |
983 | BYTE pad1; |
984 | CARD32 pad3 B32; |
985 | CARD32 pad4 B32; |
986 | CARD32 pad5 B32; |
987 | CARD32 pad6 B32; |
988 | CARD32 pad7 B32; |
989 | } xError; |
990 | |
991 | /***************************************************************** |
992 | * xEvent |
993 | * All events are 32 bytes |
994 | *****************************************************************/ |
995 | |
996 | typedef struct _xEvent { |
997 | union { |
998 | struct { |
999 | BYTE type; |
1000 | BYTE detail; |
1001 | CARD16 sequenceNumber B16; |
1002 | } u; |
1003 | struct { |
1004 | CARD32 pad00 B32; |
1005 | Time time B32; |
1006 | Window root B32, event B32, child B32; |
1007 | INT16 rootX B16, rootY B16, eventX B16, eventY B16; |
1008 | KeyButMask state B16; |
1009 | BOOL sameScreen; |
1010 | BYTE pad1; |
1011 | } keyButtonPointer; |
1012 | struct { |
1013 | CARD32 pad00 B32; |
1014 | Time time B32; |
1015 | Window root B32, event B32, child B32; |
1016 | INT16 rootX B16, rootY B16, eventX B16, eventY B16; |
1017 | KeyButMask state B16; |
1018 | BYTE mode; /* really XMode */ |
1019 | BYTE flags; /* sameScreen and focus booleans, packed together */ |
1020 | #define ELFlagFocus (1<<0) |
1021 | #define ELFlagSameScreen (1<<1) |
1022 | } enterLeave; |
1023 | struct { |
1024 | CARD32 pad00 B32; |
1025 | Window window B32; |
1026 | BYTE mode; /* really XMode */ |
1027 | BYTE pad1, pad2, pad3; |
1028 | } focus; |
1029 | struct { |
1030 | CARD32 pad00 B32; |
1031 | Window window B32; |
1032 | CARD16 x B16, y B16, width B16, height B16; |
1033 | CARD16 count B16; |
1034 | CARD16 pad2 B16; |
1035 | } expose; |
1036 | struct { |
1037 | CARD32 pad00 B32; |
1038 | Drawable drawable B32; |
1039 | CARD16 x B16, y B16, width B16, height B16; |
1040 | CARD16 minorEvent B16; |
1041 | CARD16 count B16; |
1042 | BYTE majorEvent; |
1043 | BYTE pad1, pad2, pad3; |
1044 | } graphicsExposure; |
1045 | struct { |
1046 | CARD32 pad00 B32; |
1047 | Drawable drawable B32; |
1048 | CARD16 minorEvent B16; |
1049 | BYTE majorEvent; |
1050 | BYTE bpad; |
1051 | } noExposure; |
1052 | struct { |
1053 | CARD32 pad00 B32; |
1054 | Window window B32; |
1055 | CARD8 state; |
1056 | BYTE pad1, pad2, pad3; |
1057 | } visibility; |
1058 | struct { |
1059 | CARD32 pad00 B32; |
1060 | Window parent B32, window B32; |
1061 | INT16 x B16, y B16; |
1062 | CARD16 width B16, height B16, borderWidth B16; |
1063 | BOOL override; |
1064 | BYTE bpad; |
1065 | } createNotify; |
1066 | /* |
1067 | * The event fields in the structures for DestroyNotify, UnmapNotify, |
1068 | * MapNotify, ReparentNotify, ConfigureNotify, CirculateNotify, GravityNotify, |
1069 | * must be at the same offset because server internal code is depending upon |
1070 | * this to patch up the events before they are delivered. |
1071 | * Also note that MapRequest, ConfigureRequest and CirculateRequest have |
1072 | * the same offset for the event window. |
1073 | */ |
1074 | struct { |
1075 | CARD32 pad00 B32; |
1076 | Window event B32, window B32; |
1077 | } destroyNotify; |
1078 | struct { |
1079 | CARD32 pad00 B32; |
1080 | Window event B32, window B32; |
1081 | BOOL fromConfigure; |
1082 | BYTE pad1, pad2, pad3; |
1083 | } unmapNotify; |
1084 | struct { |
1085 | CARD32 pad00 B32; |
1086 | Window event B32, window B32; |
1087 | BOOL override; |
1088 | BYTE pad1, pad2, pad3; |
1089 | } mapNotify; |
1090 | struct { |
1091 | CARD32 pad00 B32; |
1092 | Window parent B32, window B32; |
1093 | } mapRequest; |
1094 | struct { |
1095 | CARD32 pad00 B32; |
1096 | Window event B32, window B32, parent B32; |
1097 | INT16 x B16, y B16; |
1098 | BOOL override; |
1099 | BYTE pad1, pad2, pad3; |
1100 | } reparent; |
1101 | struct { |
1102 | CARD32 pad00 B32; |
1103 | Window event B32, window B32, aboveSibling B32; |
1104 | INT16 x B16, y B16; |
1105 | CARD16 width B16, height B16, borderWidth B16; |
1106 | BOOL override; |
1107 | BYTE bpad; |
1108 | } configureNotify; |
1109 | struct { |
1110 | CARD32 pad00 B32; |
1111 | Window parent B32, window B32, sibling B32; |
1112 | INT16 x B16, y B16; |
1113 | CARD16 width B16, height B16, borderWidth B16; |
1114 | CARD16 valueMask B16; |
1115 | CARD32 pad1 B32; |
1116 | } configureRequest; |
1117 | struct { |
1118 | CARD32 pad00 B32; |
1119 | Window event B32, window B32; |
1120 | INT16 x B16, y B16; |
1121 | CARD32 pad1 B32, pad2 B32, pad3 B32, pad4 B32; |
1122 | } gravity; |
1123 | struct { |
1124 | CARD32 pad00 B32; |
1125 | Window window B32; |
1126 | CARD16 width B16, height B16; |
1127 | } resizeRequest; |
1128 | struct { |
1129 | /* The event field in the circulate record is really the parent when this |
1130 | is used as a CirculateRequest instead of a CirculateNotify */ |
1131 | CARD32 pad00 B32; |
1132 | Window event B32, window B32, parent B32; |
1133 | BYTE place; /* Top or Bottom */ |
1134 | BYTE pad1, pad2, pad3; |
1135 | } circulate; |
1136 | struct { |
1137 | CARD32 pad00 B32; |
1138 | Window window B32; |
1139 | Atom atom B32; |
1140 | Time time B32; |
1141 | BYTE state; /* NewValue or Deleted */ |
1142 | BYTE pad1; |
1143 | CARD16 pad2 B16; |
1144 | } property; |
1145 | struct { |
1146 | CARD32 pad00 B32; |
1147 | Time time B32; |
1148 | Window window B32; |
1149 | Atom atom B32; |
1150 | } selectionClear; |
1151 | struct { |
1152 | CARD32 pad00 B32; |
1153 | Time time B32; |
1154 | Window owner B32, requestor B32; |
1155 | Atom selection B32, target B32, property B32; |
1156 | } selectionRequest; |
1157 | struct { |
1158 | CARD32 pad00 B32; |
1159 | Time time B32; |
1160 | Window requestor B32; |
1161 | Atom selection B32, target B32, property B32; |
1162 | } selectionNotify; |
1163 | struct { |
1164 | CARD32 pad00 B32; |
1165 | Window window B32; |
1166 | Colormap colormap B32; |
1167 | #if defined(__cplusplus) || defined(c_plusplus) |
1168 | BOOL c_new; |
1169 | #else |
1170 | BOOL new; |
1171 | #endif |
1172 | BYTE state; /* Installed or UnInstalled */ |
1173 | BYTE pad1, pad2; |
1174 | } colormap; |
1175 | struct { |
1176 | CARD32 pad00 B32; |
1177 | CARD8 request; |
1178 | KeyCode firstKeyCode; |
1179 | CARD8 count; |
1180 | BYTE pad1; |
1181 | } mappingNotify; |
1182 | struct { |
1183 | CARD32 pad00 B32; |
1184 | Window window B32; |
1185 | union { |
1186 | struct { |
1187 | Atom type B32; |
1188 | INT32 longs0 B32; |
1189 | INT32 longs1 B32; |
1190 | INT32 longs2 B32; |
1191 | INT32 longs3 B32; |
1192 | INT32 longs4 B32; |
1193 | } l; |
1194 | struct { |
1195 | Atom type B32; |
1196 | INT16 shorts0 B16; |
1197 | INT16 shorts1 B16; |
1198 | INT16 shorts2 B16; |
1199 | INT16 shorts3 B16; |
1200 | INT16 shorts4 B16; |
1201 | INT16 shorts5 B16; |
1202 | INT16 shorts6 B16; |
1203 | INT16 shorts7 B16; |
1204 | INT16 shorts8 B16; |
1205 | INT16 shorts9 B16; |
1206 | } s; |
1207 | struct { |
1208 | Atom type B32; |
1209 | INT8 bytes[20]; |
1210 | } b; |
1211 | } u; |
1212 | } clientMessage; |
1213 | } u; |
1214 | } xEvent; |
1215 | |
1216 | /********************************************************* |
1217 | * |
1218 | * Generic event |
1219 | * |
1220 | * Those events are not part of the core protocol spec and can be used by |
1221 | * various extensions. |
1222 | * type is always GenericEvent |
1223 | * extension is the minor opcode of the extension the event belongs to. |
1224 | * evtype is the actual event type, unique __per extension__. |
1225 | * |
1226 | * GenericEvents can be longer than 32 bytes, with the length field |
1227 | * specifying the number of 4 byte blocks after the first 32 bytes. |
1228 | * |
1229 | * |
1230 | */ |
1231 | typedef struct |
1232 | { |
1233 | BYTE type; |
1234 | CARD8 extension; |
1235 | CARD16 sequenceNumber B16; |
1236 | CARD32 length B32; |
1237 | CARD16 evtype B16; |
1238 | CARD16 pad2 B16; |
1239 | CARD32 pad3 B32; |
1240 | CARD32 pad4 B32; |
1241 | CARD32 pad5 B32; |
1242 | CARD32 pad6 B32; |
1243 | CARD32 pad7 B32; |
1244 | } xGenericEvent; |
1245 | |
1246 | |
1247 | |
1248 | /* KeymapNotify events are not included in the above union because they |
1249 | are different from all other events: they do not have a "detail" |
1250 | or "sequenceNumber", so there is room for a 248-bit key mask. */ |
1251 | |
1252 | typedef struct { |
1253 | BYTE type; |
1254 | BYTE map[31]; |
1255 | } xKeymapEvent; |
1256 | |
1257 | #define XEventSize (sizeof(xEvent)) |
1258 | |
1259 | /* XReply is the union of all the replies above whose "fixed part" |
1260 | fits in 32 bytes. It does NOT include GetWindowAttributesReply, |
1261 | QueryFontReply, QueryKeymapReply, or GetKeyboardControlReply |
1262 | ListFontsWithInfoReply */ |
1263 | |
1264 | typedef union { |
1265 | xGenericReply generic; |
1266 | xGetGeometryReply geom; |
1267 | xQueryTreeReply tree; |
1268 | xInternAtomReply atom; |
1269 | xGetAtomNameReply atomName; |
1270 | xGetPropertyReply property; |
1271 | xListPropertiesReply listProperties; |
1272 | xGetSelectionOwnerReply selection; |
1273 | xGrabPointerReply grabPointer; |
1274 | xGrabKeyboardReply grabKeyboard; |
1275 | xQueryPointerReply pointer; |
1276 | xGetMotionEventsReply motionEvents; |
1277 | xTranslateCoordsReply coords; |
1278 | xGetInputFocusReply inputFocus; |
1279 | xQueryTextExtentsReply textExtents; |
1280 | xListFontsReply fonts; |
1281 | xGetFontPathReply fontPath; |
1282 | xGetImageReply image; |
1283 | xListInstalledColormapsReply colormaps; |
1284 | xAllocColorReply allocColor; |
1285 | xAllocNamedColorReply allocNamedColor; |
1286 | xAllocColorCellsReply colorCells; |
1287 | xAllocColorPlanesReply colorPlanes; |
1288 | xQueryColorsReply colors; |
1289 | xLookupColorReply lookupColor; |
1290 | xQueryBestSizeReply bestSize; |
1291 | xQueryExtensionReply extension; |
1292 | xListExtensionsReply extensions; |
1293 | xSetModifierMappingReply setModifierMapping; |
1294 | xGetModifierMappingReply getModifierMapping; |
1295 | xSetPointerMappingReply setPointerMapping; |
1296 | xGetKeyboardMappingReply getKeyboardMapping; |
1297 | xGetPointerMappingReply getPointerMapping; |
1298 | xGetPointerControlReply pointerControl; |
1299 | xGetScreenSaverReply screenSaver; |
1300 | xListHostsReply hosts; |
1301 | xError error; |
1302 | xEvent event; |
1303 | } xReply; |
1304 | |
1305 | |
1306 | |
1307 | /***************************************************************** |
1308 | * REQUESTS |
1309 | *****************************************************************/ |
1310 | |
1311 | |
1312 | /* Request structure */ |
1313 | |
1314 | typedef struct _xReq { |
1315 | CARD8 reqType; |
1316 | CARD8 data; /* meaning depends on request type */ |
1317 | CARD16 length B16; /* length in 4 bytes quantities |
1318 | of whole request, including this header */ |
1319 | } xReq; |
1320 | |
1321 | /***************************************************************** |
1322 | * structures that follow request. |
1323 | *****************************************************************/ |
1324 | |
1325 | /* ResourceReq is used for any request which has a resource ID |
1326 | (or Atom or Time) as its one and only argument. */ |
1327 | |
1328 | typedef struct { |
1329 | CARD8 reqType; |
1330 | BYTE pad; |
1331 | CARD16 length B16; |
1332 | CARD32 id B32; /* a Window, Drawable, Font, GContext, Pixmap, etc. */ |
1333 | } xResourceReq; |
1334 | |
1335 | typedef struct { |
1336 | CARD8 reqType; |
1337 | CARD8 depth; |
1338 | CARD16 length B16; |
1339 | Window wid B32, parent B32; |
1340 | INT16 x B16, y B16; |
1341 | CARD16 width B16, height B16, borderWidth B16; |
1342 | #if defined(__cplusplus) || defined(c_plusplus) |
1343 | CARD16 c_class B16; |
1344 | #else |
1345 | CARD16 class B16; |
1346 | #endif |
1347 | VisualID visual B32; |
1348 | CARD32 mask B32; |
1349 | } xCreateWindowReq; |
1350 | |
1351 | typedef struct { |
1352 | CARD8 reqType; |
1353 | BYTE pad; |
1354 | CARD16 length B16; |
1355 | Window window B32; |
1356 | CARD32 valueMask B32; |
1357 | } xChangeWindowAttributesReq; |
1358 | |
1359 | typedef struct { |
1360 | CARD8 reqType; |
1361 | BYTE mode; |
1362 | CARD16 length B16; |
1363 | Window window B32; |
1364 | } xChangeSaveSetReq; |
1365 | |
1366 | typedef struct { |
1367 | CARD8 reqType; |
1368 | BYTE pad; |
1369 | CARD16 length B16; |
1370 | Window window B32, parent B32; |
1371 | INT16 x B16, y B16; |
1372 | } xReparentWindowReq; |
1373 | |
1374 | typedef struct { |
1375 | CARD8 reqType; |
1376 | CARD8 pad; |
1377 | CARD16 length B16; |
1378 | Window window B32; |
1379 | CARD16 mask B16; |
1380 | CARD16 pad2 B16; |
1381 | } xConfigureWindowReq; |
1382 | |
1383 | typedef struct { |
1384 | CARD8 reqType; |
1385 | CARD8 direction; |
1386 | CARD16 length B16; |
1387 | Window window B32; |
1388 | } xCirculateWindowReq; |
1389 | |
1390 | typedef struct { /* followed by padded string */ |
1391 | CARD8 reqType; |
1392 | BOOL onlyIfExists; |
1393 | CARD16 length B16; |
1394 | CARD16 nbytes B16; /* number of bytes in string */ |
1395 | CARD16 pad B16; |
1396 | } xInternAtomReq; |
1397 | |
1398 | typedef struct { |
1399 | CARD8 reqType; |
1400 | CARD8 mode; |
1401 | CARD16 length B16; |
1402 | Window window B32; |
1403 | Atom property B32, type B32; |
1404 | CARD8 format; |
1405 | BYTE pad[3]; |
1406 | CARD32 nUnits B32; /* length of stuff following, depends on format */ |
1407 | } xChangePropertyReq; |
1408 | |
1409 | typedef struct { |
1410 | CARD8 reqType; |
1411 | BYTE pad; |
1412 | CARD16 length B16; |
1413 | Window window B32; |
1414 | Atom property B32; |
1415 | } xDeletePropertyReq; |
1416 | |
1417 | typedef struct { |
1418 | CARD8 reqType; |
1419 | #if defined(__cplusplus) || defined(c_plusplus) |
1420 | BOOL c_delete; |
1421 | #else |
1422 | BOOL delete; |
1423 | #endif |
1424 | CARD16 length B16; |
1425 | Window window B32; |
1426 | Atom property B32, type B32; |
1427 | CARD32 longOffset B32; |
1428 | CARD32 longLength B32; |
1429 | } xGetPropertyReq; |
1430 | |
1431 | typedef struct { |
1432 | CARD8 reqType; |
1433 | BYTE pad; |
1434 | CARD16 length B16; |
1435 | Window window B32; |
1436 | Atom selection B32; |
1437 | Time time B32; |
1438 | } xSetSelectionOwnerReq; |
1439 | |
1440 | typedef struct { |
1441 | CARD8 reqType; |
1442 | BYTE pad; |
1443 | CARD16 length B16; |
1444 | Window requestor B32; |
1445 | Atom selection B32, target B32, property B32; |
1446 | Time time B32; |
1447 | } xConvertSelectionReq; |
1448 | |
1449 | typedef struct { |
1450 | CARD8 reqType; |
1451 | BOOL propagate; |
1452 | CARD16 length B16; |
1453 | Window destination B32; |
1454 | CARD32 eventMask B32; |
1455 | xEvent event; |
1456 | } xSendEventReq; |
1457 | |
1458 | typedef struct { |
1459 | CARD8 reqType; |
1460 | BOOL ownerEvents; |
1461 | CARD16 length B16; |
1462 | Window grabWindow B32; |
1463 | CARD16 eventMask B16; |
1464 | BYTE pointerMode, keyboardMode; |
1465 | Window confineTo B32; |
1466 | Cursor cursor B32; |
1467 | Time time B32; |
1468 | } xGrabPointerReq; |
1469 | |
1470 | typedef struct { |
1471 | CARD8 reqType; |
1472 | BOOL ownerEvents; |
1473 | CARD16 length B16; |
1474 | Window grabWindow B32; |
1475 | CARD16 eventMask B16; |
1476 | BYTE pointerMode, keyboardMode; |
1477 | Window confineTo B32; |
1478 | Cursor cursor B32; |
1479 | CARD8 button; |
1480 | BYTE pad; |
1481 | CARD16 modifiers B16; |
1482 | } xGrabButtonReq; |
1483 | |
1484 | typedef struct { |
1485 | CARD8 reqType; |
1486 | CARD8 button; |
1487 | CARD16 length B16; |
1488 | Window grabWindow B32; |
1489 | CARD16 modifiers B16; |
1490 | CARD16 pad B16; |
1491 | } xUngrabButtonReq; |
1492 | |
1493 | typedef struct { |
1494 | CARD8 reqType; |
1495 | BYTE pad; |
1496 | CARD16 length B16; |
1497 | Cursor cursor B32; |
1498 | Time time B32; |
1499 | CARD16 eventMask B16; |
1500 | CARD16 pad2 B16; |
1501 | } xChangeActivePointerGrabReq; |
1502 | |
1503 | typedef struct { |
1504 | CARD8 reqType; |
1505 | BOOL ownerEvents; |
1506 | CARD16 length B16; |
1507 | Window grabWindow B32; |
1508 | Time time B32; |
1509 | BYTE pointerMode, keyboardMode; |
1510 | CARD16 pad B16; |
1511 | } xGrabKeyboardReq; |
1512 | |
1513 | typedef struct { |
1514 | CARD8 reqType; |
1515 | BOOL ownerEvents; |
1516 | CARD16 length B16; |
1517 | Window grabWindow B32; |
1518 | CARD16 modifiers B16; |
1519 | CARD8 key; |
1520 | BYTE pointerMode, keyboardMode; |
1521 | BYTE pad1, pad2, pad3; |
1522 | } xGrabKeyReq; |
1523 | |
1524 | typedef struct { |
1525 | CARD8 reqType; |
1526 | CARD8 key; |
1527 | CARD16 length B16; |
1528 | Window grabWindow B32; |
1529 | CARD16 modifiers B16; |
1530 | CARD16 pad B16; |
1531 | } xUngrabKeyReq; |
1532 | |
1533 | typedef struct { |
1534 | CARD8 reqType; |
1535 | CARD8 mode; |
1536 | CARD16 length B16; |
1537 | Time time B32; |
1538 | } xAllowEventsReq; |
1539 | |
1540 | typedef struct { |
1541 | CARD8 reqType; |
1542 | BYTE pad; |
1543 | CARD16 length B16; |
1544 | Window window B32; |
1545 | Time start B32, stop B32; |
1546 | } xGetMotionEventsReq; |
1547 | |
1548 | typedef struct { |
1549 | CARD8 reqType; |
1550 | BYTE pad; |
1551 | CARD16 length B16; |
1552 | Window srcWid B32, dstWid B32; |
1553 | INT16 srcX B16, srcY B16; |
1554 | } xTranslateCoordsReq; |
1555 | |
1556 | typedef struct { |
1557 | CARD8 reqType; |
1558 | BYTE pad; |
1559 | CARD16 length B16; |
1560 | Window srcWid B32, dstWid B32; |
1561 | INT16 srcX B16, srcY B16; |
1562 | CARD16 srcWidth B16, srcHeight B16; |
1563 | INT16 dstX B16, dstY B16; |
1564 | } xWarpPointerReq; |
1565 | |
1566 | typedef struct { |
1567 | CARD8 reqType; |
1568 | CARD8 revertTo; |
1569 | CARD16 length B16; |
1570 | Window focus B32; |
1571 | Time time B32; |
1572 | } xSetInputFocusReq; |
1573 | |
1574 | typedef struct { |
1575 | CARD8 reqType; |
1576 | BYTE pad; |
1577 | CARD16 length B16; |
1578 | Font fid B32; |
1579 | CARD16 nbytes B16; |
1580 | BYTE pad1, pad2; /* string follows on word boundary */ |
1581 | } xOpenFontReq; |
1582 | |
1583 | typedef struct { |
1584 | CARD8 reqType; |
1585 | BOOL oddLength; |
1586 | CARD16 length B16; |
1587 | Font fid B32; |
1588 | } xQueryTextExtentsReq; |
1589 | |
1590 | typedef struct { |
1591 | CARD8 reqType; |
1592 | BYTE pad; |
1593 | CARD16 length B16; |
1594 | CARD16 maxNames B16; |
1595 | CARD16 nbytes B16; /* followed immediately by string bytes */ |
1596 | } xListFontsReq; |
1597 | |
1598 | typedef xListFontsReq xListFontsWithInfoReq; |
1599 | |
1600 | typedef struct { |
1601 | CARD8 reqType; |
1602 | BYTE pad; |
1603 | CARD16 length B16; |
1604 | CARD16 nFonts B16; |
1605 | BYTE pad1, pad2; /* LISTofSTRING8 follows on word boundary */ |
1606 | } xSetFontPathReq; |
1607 | |
1608 | typedef struct { |
1609 | CARD8 reqType; |
1610 | CARD8 depth; |
1611 | CARD16 length B16; |
1612 | Pixmap pid B32; |
1613 | Drawable drawable B32; |
1614 | CARD16 width B16, height B16; |
1615 | } xCreatePixmapReq; |
1616 | |
1617 | typedef struct { |
1618 | CARD8 reqType; |
1619 | BYTE pad; |
1620 | CARD16 length B16; |
1621 | GContext gc B32; |
1622 | Drawable drawable B32; |
1623 | CARD32 mask B32; |
1624 | } xCreateGCReq; |
1625 | |
1626 | typedef struct { |
1627 | CARD8 reqType; |
1628 | BYTE pad; |
1629 | CARD16 length B16; |
1630 | GContext gc B32; |
1631 | CARD32 mask B32; |
1632 | } xChangeGCReq; |
1633 | |
1634 | typedef struct { |
1635 | CARD8 reqType; |
1636 | BYTE pad; |
1637 | CARD16 length B16; |
1638 | GContext srcGC B32, dstGC B32; |
1639 | CARD32 mask B32; |
1640 | } xCopyGCReq; |
1641 | |
1642 | typedef struct { |
1643 | CARD8 reqType; |
1644 | BYTE pad; |
1645 | CARD16 length B16; |
1646 | GContext gc B32; |
1647 | CARD16 dashOffset B16; |
1648 | CARD16 nDashes B16; /* length LISTofCARD8 of values following */ |
1649 | } xSetDashesReq; |
1650 | |
1651 | typedef struct { |
1652 | CARD8 reqType; |
1653 | BYTE ordering; |
1654 | CARD16 length B16; |
1655 | GContext gc B32; |
1656 | INT16 xOrigin B16, yOrigin B16; |
1657 | } xSetClipRectanglesReq; |
1658 | |
1659 | typedef struct { |
1660 | CARD8 reqType; |
1661 | BOOL exposures; |
1662 | CARD16 length B16; |
1663 | Window window B32; |
1664 | INT16 x B16, y B16; |
1665 | CARD16 width B16, height B16; |
1666 | } xClearAreaReq; |
1667 | |
1668 | typedef struct { |
1669 | CARD8 reqType; |
1670 | BYTE pad; |
1671 | CARD16 length B16; |
1672 | Drawable srcDrawable B32, dstDrawable B32; |
1673 | GContext gc B32; |
1674 | INT16 srcX B16, srcY B16, dstX B16, dstY B16; |
1675 | CARD16 width B16, height B16; |
1676 | } xCopyAreaReq; |
1677 | |
1678 | typedef struct { |
1679 | CARD8 reqType; |
1680 | BYTE pad; |
1681 | CARD16 length B16; |
1682 | Drawable srcDrawable B32, dstDrawable B32; |
1683 | GContext gc B32; |
1684 | INT16 srcX B16, srcY B16, dstX B16, dstY B16; |
1685 | CARD16 width B16, height B16; |
1686 | CARD32 bitPlane B32; |
1687 | } xCopyPlaneReq; |
1688 | |
1689 | typedef struct { |
1690 | CARD8 reqType; |
1691 | BYTE coordMode; |
1692 | CARD16 length B16; |
1693 | Drawable drawable B32; |
1694 | GContext gc B32; |
1695 | } xPolyPointReq; |
1696 | |
1697 | typedef xPolyPointReq xPolyLineReq; /* same request structure */ |
1698 | |
1699 | /* The following used for PolySegment, PolyRectangle, PolyArc, PolyFillRectangle, PolyFillArc */ |
1700 | |
1701 | typedef struct { |
1702 | CARD8 reqType; |
1703 | BYTE pad; |
1704 | CARD16 length B16; |
1705 | Drawable drawable B32; |
1706 | GContext gc B32; |
1707 | } xPolySegmentReq; |
1708 | |
1709 | typedef xPolySegmentReq xPolyArcReq; |
1710 | typedef xPolySegmentReq xPolyRectangleReq; |
1711 | typedef xPolySegmentReq xPolyFillRectangleReq; |
1712 | typedef xPolySegmentReq xPolyFillArcReq; |
1713 | |
1714 | typedef struct _FillPolyReq { |
1715 | CARD8 reqType; |
1716 | BYTE pad; |
1717 | CARD16 length B16; |
1718 | Drawable drawable B32; |
1719 | GContext gc B32; |
1720 | BYTE shape; |
1721 | BYTE coordMode; |
1722 | CARD16 pad1 B16; |
1723 | } xFillPolyReq; |
1724 | |
1725 | |
1726 | typedef struct _PutImageReq { |
1727 | CARD8 reqType; |
1728 | CARD8 format; |
1729 | CARD16 length B16; |
1730 | Drawable drawable B32; |
1731 | GContext gc B32; |
1732 | CARD16 width B16, height B16; |
1733 | INT16 dstX B16, dstY B16; |
1734 | CARD8 leftPad; |
1735 | CARD8 depth; |
1736 | CARD16 pad B16; |
1737 | } xPutImageReq; |
1738 | |
1739 | typedef struct { |
1740 | CARD8 reqType; |
1741 | CARD8 format; |
1742 | CARD16 length B16; |
1743 | Drawable drawable B32; |
1744 | INT16 x B16, y B16; |
1745 | CARD16 width B16, height B16; |
1746 | CARD32 planeMask B32; |
1747 | } xGetImageReq; |
1748 | |
1749 | /* the following used by PolyText8 and PolyText16 */ |
1750 | |
1751 | typedef struct { |
1752 | CARD8 reqType; |
1753 | CARD8 pad; |
1754 | CARD16 length B16; |
1755 | Drawable drawable B32; |
1756 | GContext gc B32; |
1757 | INT16 x B16, y B16; /* items (xTextElt) start after struct */ |
1758 | } xPolyTextReq; |
1759 | |
1760 | typedef xPolyTextReq xPolyText8Req; |
1761 | typedef xPolyTextReq xPolyText16Req; |
1762 | |
1763 | typedef struct { |
1764 | CARD8 reqType; |
1765 | BYTE nChars; |
1766 | CARD16 length B16; |
1767 | Drawable drawable B32; |
1768 | GContext gc B32; |
1769 | INT16 x B16, y B16; |
1770 | } xImageTextReq; |
1771 | |
1772 | typedef xImageTextReq xImageText8Req; |
1773 | typedef xImageTextReq xImageText16Req; |
1774 | |
1775 | typedef struct { |
1776 | CARD8 reqType; |
1777 | BYTE alloc; |
1778 | CARD16 length B16; |
1779 | Colormap mid B32; |
1780 | Window window B32; |
1781 | VisualID visual B32; |
1782 | } xCreateColormapReq; |
1783 | |
1784 | typedef struct { |
1785 | CARD8 reqType; |
1786 | BYTE pad; |
1787 | CARD16 length B16; |
1788 | Colormap mid B32; |
1789 | Colormap srcCmap B32; |
1790 | } xCopyColormapAndFreeReq; |
1791 | |
1792 | typedef struct { |
1793 | CARD8 reqType; |
1794 | BYTE pad; |
1795 | CARD16 length B16; |
1796 | Colormap cmap B32; |
1797 | CARD16 red B16, green B16, blue B16; |
1798 | CARD16 pad2 B16; |
1799 | } xAllocColorReq; |
1800 | |
1801 | typedef struct { |
1802 | CARD8 reqType; |
1803 | BYTE pad; |
1804 | CARD16 length B16; |
1805 | Colormap cmap B32; |
1806 | CARD16 nbytes B16; /* followed by structure */ |
1807 | BYTE pad1, pad2; |
1808 | } xAllocNamedColorReq; |
1809 | |
1810 | typedef struct { |
1811 | CARD8 reqType; |
1812 | BOOL contiguous; |
1813 | CARD16 length B16; |
1814 | Colormap cmap B32; |
1815 | CARD16 colors B16, planes B16; |
1816 | } xAllocColorCellsReq; |
1817 | |
1818 | typedef struct { |
1819 | CARD8 reqType; |
1820 | BOOL contiguous; |
1821 | CARD16 length B16; |
1822 | Colormap cmap B32; |
1823 | CARD16 colors B16, red B16, green B16, blue B16; |
1824 | } xAllocColorPlanesReq; |
1825 | |
1826 | typedef struct { |
1827 | CARD8 reqType; |
1828 | BYTE pad; |
1829 | CARD16 length B16; |
1830 | Colormap cmap B32; |
1831 | CARD32 planeMask B32; |
1832 | } xFreeColorsReq; |
1833 | |
1834 | typedef struct { |
1835 | CARD8 reqType; |
1836 | BYTE pad; |
1837 | CARD16 length B16; |
1838 | Colormap cmap B32; |
1839 | } xStoreColorsReq; |
1840 | |
1841 | typedef struct { |
1842 | CARD8 reqType; |
1843 | CARD8 flags; /* DoRed, DoGreen, DoBlue, as in xColorItem */ |
1844 | CARD16 length B16; |
1845 | Colormap cmap B32; |
1846 | CARD32 pixel B32; |
1847 | CARD16 nbytes B16; /* number of name string bytes following structure */ |
1848 | BYTE pad1, pad2; |
1849 | } xStoreNamedColorReq; |
1850 | |
1851 | typedef struct { |
1852 | CARD8 reqType; |
1853 | BYTE pad; |
1854 | CARD16 length B16; |
1855 | Colormap cmap B32; |
1856 | } xQueryColorsReq; |
1857 | |
1858 | typedef struct { /* followed by string of length len */ |
1859 | CARD8 reqType; |
1860 | BYTE pad; |
1861 | CARD16 length B16; |
1862 | Colormap cmap B32; |
1863 | CARD16 nbytes B16; /* number of string bytes following structure*/ |
1864 | BYTE pad1, pad2; |
1865 | } xLookupColorReq; |
1866 | |
1867 | typedef struct { |
1868 | CARD8 reqType; |
1869 | BYTE pad; |
1870 | CARD16 length B16; |
1871 | Cursor cid B32; |
1872 | Pixmap source B32, mask B32; |
1873 | CARD16 foreRed B16, foreGreen B16, foreBlue B16; |
1874 | CARD16 backRed B16, backGreen B16, backBlue B16; |
1875 | CARD16 x B16, y B16; |
1876 | } xCreateCursorReq; |
1877 | |
1878 | typedef struct { |
1879 | CARD8 reqType; |
1880 | BYTE pad; |
1881 | CARD16 length B16; |
1882 | Cursor cid B32; |
1883 | Font source B32, mask B32; |
1884 | CARD16 sourceChar B16, maskChar B16; |
1885 | CARD16 foreRed B16, foreGreen B16, foreBlue B16; |
1886 | CARD16 backRed B16, backGreen B16, backBlue B16; |
1887 | } xCreateGlyphCursorReq; |
1888 | |
1889 | typedef struct { |
1890 | CARD8 reqType; |
1891 | BYTE pad; |
1892 | CARD16 length B16; |
1893 | Cursor cursor B32; |
1894 | CARD16 foreRed B16, foreGreen B16, foreBlue B16; |
1895 | CARD16 backRed B16, backGreen B16, backBlue B16; |
1896 | } xRecolorCursorReq; |
1897 | |
1898 | typedef struct { |
1899 | CARD8 reqType; |
1900 | #if defined(__cplusplus) || defined(c_plusplus) |
1901 | CARD8 c_class; |
1902 | #else |
1903 | CARD8 class; |
1904 | #endif |
1905 | CARD16 length B16; |
1906 | Drawable drawable B32; |
1907 | CARD16 width B16, height B16; |
1908 | } xQueryBestSizeReq; |
1909 | |
1910 | typedef struct { |
1911 | CARD8 reqType; |
1912 | BYTE pad; |
1913 | CARD16 length B16; |
1914 | CARD16 nbytes B16; /* number of string bytes following structure */ |
1915 | BYTE pad1, pad2; |
1916 | } xQueryExtensionReq; |
1917 | |
1918 | typedef struct { |
1919 | CARD8 reqType; |
1920 | CARD8 numKeyPerModifier; |
1921 | CARD16 length B16; |
1922 | } xSetModifierMappingReq; |
1923 | |
1924 | typedef struct { |
1925 | CARD8 reqType; |
1926 | CARD8 nElts; /* how many elements in the map */ |
1927 | CARD16 length B16; |
1928 | } xSetPointerMappingReq; |
1929 | |
1930 | typedef struct { |
1931 | CARD8 reqType; |
1932 | BYTE pad; |
1933 | CARD16 length B16; |
1934 | KeyCode firstKeyCode; |
1935 | CARD8 count; |
1936 | CARD16 pad1 B16; |
1937 | } xGetKeyboardMappingReq; |
1938 | |
1939 | typedef struct { |
1940 | CARD8 reqType; |
1941 | CARD8 keyCodes; |
1942 | CARD16 length B16; |
1943 | KeyCode firstKeyCode; |
1944 | CARD8 keySymsPerKeyCode; |
1945 | CARD16 pad1 B16; |
1946 | } xChangeKeyboardMappingReq; |
1947 | |
1948 | typedef struct { |
1949 | CARD8 reqType; |
1950 | BYTE pad; |
1951 | CARD16 length B16; |
1952 | CARD32 mask B32; |
1953 | } xChangeKeyboardControlReq; |
1954 | |
1955 | typedef struct { |
1956 | CARD8 reqType; |
1957 | INT8 percent; /* -100 to 100 */ |
1958 | CARD16 length B16; |
1959 | } xBellReq; |
1960 | |
1961 | typedef struct { |
1962 | CARD8 reqType; |
1963 | BYTE pad; |
1964 | CARD16 length B16; |
1965 | INT16 accelNum B16, accelDenum B16; |
1966 | INT16 threshold B16; |
1967 | BOOL doAccel, doThresh; |
1968 | } xChangePointerControlReq; |
1969 | |
1970 | typedef struct { |
1971 | CARD8 reqType; |
1972 | BYTE pad; |
1973 | CARD16 length B16; |
1974 | INT16 timeout B16, interval B16; |
1975 | BYTE preferBlank, allowExpose; |
1976 | CARD16 pad2 B16; |
1977 | } xSetScreenSaverReq; |
1978 | |
1979 | typedef struct { |
1980 | CARD8 reqType; |
1981 | BYTE mode; |
1982 | CARD16 length B16; |
1983 | CARD8 hostFamily; |
1984 | BYTE pad; |
1985 | CARD16 hostLength B16; |
1986 | } xChangeHostsReq; |
1987 | |
1988 | typedef struct { |
1989 | CARD8 reqType; |
1990 | BYTE pad; |
1991 | CARD16 length B16; |
1992 | } xListHostsReq; |
1993 | |
1994 | typedef struct { |
1995 | CARD8 reqType; |
1996 | BYTE mode; |
1997 | CARD16 length B16; |
1998 | } xChangeModeReq; |
1999 | |
2000 | typedef xChangeModeReq xSetAccessControlReq; |
2001 | typedef xChangeModeReq xSetCloseDownModeReq; |
2002 | typedef xChangeModeReq xForceScreenSaverReq; |
2003 | |
2004 | typedef struct { /* followed by LIST of ATOM */ |
2005 | CARD8 reqType; |
2006 | BYTE pad; |
2007 | CARD16 length B16; |
2008 | Window window B32; |
2009 | CARD16 nAtoms B16; |
2010 | INT16 nPositions B16; |
2011 | } xRotatePropertiesReq; |
2012 | |
2013 | |
2014 | |
2015 | /* Reply codes */ |
2016 | |
2017 | #define X_Reply 1 /* Normal reply */ |
2018 | #define X_Error 0 /* Error */ |
2019 | |
2020 | /* Request codes */ |
2021 | |
2022 | #define X_CreateWindow 1 |
2023 | #define X_ChangeWindowAttributes 2 |
2024 | #define X_GetWindowAttributes 3 |
2025 | #define X_DestroyWindow 4 |
2026 | #define X_DestroySubwindows 5 |
2027 | #define X_ChangeSaveSet 6 |
2028 | #define X_ReparentWindow 7 |
2029 | #define X_MapWindow 8 |
2030 | #define X_MapSubwindows 9 |
2031 | #define X_UnmapWindow 10 |
2032 | #define X_UnmapSubwindows 11 |
2033 | #define X_ConfigureWindow 12 |
2034 | #define X_CirculateWindow 13 |
2035 | #define X_GetGeometry 14 |
2036 | #define X_QueryTree 15 |
2037 | #define X_InternAtom 16 |
2038 | #define X_GetAtomName 17 |
2039 | #define X_ChangeProperty 18 |
2040 | #define X_DeleteProperty 19 |
2041 | #define X_GetProperty 20 |
2042 | #define X_ListProperties 21 |
2043 | #define X_SetSelectionOwner 22 |
2044 | #define X_GetSelectionOwner 23 |
2045 | #define X_ConvertSelection 24 |
2046 | #define X_SendEvent 25 |
2047 | #define X_GrabPointer 26 |
2048 | #define X_UngrabPointer 27 |
2049 | #define X_GrabButton 28 |
2050 | #define X_UngrabButton 29 |
2051 | #define X_ChangeActivePointerGrab 30 |
2052 | #define X_GrabKeyboard 31 |
2053 | #define X_UngrabKeyboard 32 |
2054 | #define X_GrabKey 33 |
2055 | #define X_UngrabKey 34 |
2056 | #define X_AllowEvents 35 |
2057 | #define X_GrabServer 36 |
2058 | #define X_UngrabServer 37 |
2059 | #define X_QueryPointer 38 |
2060 | #define X_GetMotionEvents 39 |
2061 | #define X_TranslateCoords 40 |
2062 | #define X_WarpPointer 41 |
2063 | #define X_SetInputFocus 42 |
2064 | #define X_GetInputFocus 43 |
2065 | #define X_QueryKeymap 44 |
2066 | #define X_OpenFont 45 |
2067 | #define X_CloseFont 46 |
2068 | #define X_QueryFont 47 |
2069 | #define X_QueryTextExtents 48 |
2070 | #define X_ListFonts 49 |
2071 | #define X_ListFontsWithInfo 50 |
2072 | #define X_SetFontPath 51 |
2073 | #define X_GetFontPath 52 |
2074 | #define X_CreatePixmap 53 |
2075 | #define X_FreePixmap 54 |
2076 | #define X_CreateGC 55 |
2077 | #define X_ChangeGC 56 |
2078 | #define X_CopyGC 57 |
2079 | #define X_SetDashes 58 |
2080 | #define X_SetClipRectangles 59 |
2081 | #define X_FreeGC 60 |
2082 | #define X_ClearArea 61 |
2083 | #define X_CopyArea 62 |
2084 | #define X_CopyPlane 63 |
2085 | #define X_PolyPoint 64 |
2086 | #define X_PolyLine 65 |
2087 | #define X_PolySegment 66 |
2088 | #define X_PolyRectangle 67 |
2089 | #define X_PolyArc 68 |
2090 | #define X_FillPoly 69 |
2091 | #define X_PolyFillRectangle 70 |
2092 | #define X_PolyFillArc 71 |
2093 | #define X_PutImage 72 |
2094 | #define X_GetImage 73 |
2095 | #define X_PolyText8 74 |
2096 | #define X_PolyText16 75 |
2097 | #define X_ImageText8 76 |
2098 | #define X_ImageText16 77 |
2099 | #define X_CreateColormap 78 |
2100 | #define X_FreeColormap 79 |
2101 | #define X_CopyColormapAndFree 80 |
2102 | #define X_InstallColormap 81 |
2103 | #define X_UninstallColormap 82 |
2104 | #define X_ListInstalledColormaps 83 |
2105 | #define X_AllocColor 84 |
2106 | #define X_AllocNamedColor 85 |
2107 | #define X_AllocColorCells 86 |
2108 | #define X_AllocColorPlanes 87 |
2109 | #define X_FreeColors 88 |
2110 | #define X_StoreColors 89 |
2111 | #define X_StoreNamedColor 90 |
2112 | #define X_QueryColors 91 |
2113 | #define X_LookupColor 92 |
2114 | #define X_CreateCursor 93 |
2115 | #define X_CreateGlyphCursor 94 |
2116 | #define X_FreeCursor 95 |
2117 | #define X_RecolorCursor 96 |
2118 | #define X_QueryBestSize 97 |
2119 | #define X_QueryExtension 98 |
2120 | #define X_ListExtensions 99 |
2121 | #define X_ChangeKeyboardMapping 100 |
2122 | #define X_GetKeyboardMapping 101 |
2123 | #define X_ChangeKeyboardControl 102 |
2124 | #define X_GetKeyboardControl 103 |
2125 | #define X_Bell 104 |
2126 | #define X_ChangePointerControl 105 |
2127 | #define X_GetPointerControl 106 |
2128 | #define X_SetScreenSaver 107 |
2129 | #define X_GetScreenSaver 108 |
2130 | #define X_ChangeHosts 109 |
2131 | #define X_ListHosts 110 |
2132 | #define X_SetAccessControl 111 |
2133 | #define X_SetCloseDownMode 112 |
2134 | #define X_KillClient 113 |
2135 | #define X_RotateProperties 114 |
2136 | #define X_ForceScreenSaver 115 |
2137 | #define X_SetPointerMapping 116 |
2138 | #define X_GetPointerMapping 117 |
2139 | #define X_SetModifierMapping 118 |
2140 | #define X_GetModifierMapping 119 |
2141 | #define X_NoOperation 127 |
2142 | |
2143 | /* restore these definitions back to the typedefs in X.h */ |
2144 | #undef Window |
2145 | #undef Drawable |
2146 | #undef Font |
2147 | #undef Pixmap |
2148 | #undef Cursor |
2149 | #undef Colormap |
2150 | #undef GContext |
2151 | #undef Atom |
2152 | #undef VisualID |
2153 | #undef Time |
2154 | #undef KeyCode |
2155 | #undef KeySym |
2156 | |
2157 | #endif /* XPROTO_H */ |
2158 | |