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