VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/1.6/X11/Xproto.h@ 17242

最後變更 在這個檔案從17242是 17242,由 vboxsync 提交於 16 年 前

Additions/x11/x11include: removed svn:keywords properties from all files under this directory as per SvnKeywords on the wiki. Hopefully this is finally correct

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

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette