2 * $XConsortium: X.h,v 1.69 94/04/17 20:10:48 dpw Exp $
5 /* Definitions for the X window system likely to be used by applications */
10 /***********************************************************
12 Copyright (c) 1987 X Consortium
14 Permission is hereby granted, free of charge, to any person obtaining a copy
15 of this software and associated documentation files (the "Software"), to deal
16 in the Software without restriction, including without limitation the rights
17 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18 copies of the Software, and to permit persons to whom the Software is
19 furnished to do so, subject to the following conditions:
21 The above copyright notice and this permission notice shall be included in
22 all copies or substantial portions of the Software.
24 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
28 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 Except as contained in this notice, the name of the X Consortium shall not be
32 used in advertising or otherwise to promote the sale, use or other dealings
33 in this Software without prior written authorization from the X Consortium.
36 Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
40 Permission to use, copy, modify, and distribute this software and its
41 documentation for any purpose and without fee is hereby granted,
42 provided that the above copyright notice appear in all copies and that
43 both that copyright notice and this permission notice appear in
44 supporting documentation, and that the name of Digital not be
45 used in advertising or publicity pertaining to distribution of the
46 software without specific, written prior permission.
48 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
49 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
50 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
51 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
52 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
53 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
56 ******************************************************************/
57 #define X_PROTOCOL 11 /* current protocol version */
58 #define X_PROTOCOL_REVISION 0 /* current minor version */
63 * _XSERVER64 must ONLY be defined when compiling X server sources on
64 * systems where unsigned long is not 32 bits, must NOT be used in
65 * client or library code.
68 typedef unsigned long XID;
69 typedef unsigned long Mask;
70 typedef unsigned long Atom;
71 typedef unsigned long VisualID;
72 typedef unsigned long Time;
78 typedef CARD32 VisualID;
91 typedef unsigned char KeyCode;
93 /*****************************************************************
94 * RESERVED RESOURCE AND CONSTANT DEFINITIONS
95 *****************************************************************/
97 #define None 0L /* universal null resource or null atom */
99 #define ParentRelative 1L /* background pixmap in CreateWindow
100 and ChangeWindowAttributes */
102 #define CopyFromParent 0L /* border pixmap in CreateWindow
103 and ChangeWindowAttributes
104 special VisualID and special window
105 class passed to CreateWindow */
107 #define PointerWindow 0L /* destination window in SendEvent */
108 #define InputFocus 1L /* destination window in SendEvent */
110 #define PointerRoot 1L /* focus window in SetInputFocus */
112 #define AnyPropertyType 0L /* special Atom, passed to GetProperty */
114 #define AnyKey 0L /* special Key Code, passed to GrabKey */
116 #define AnyButton 0L /* special Button Code, passed to GrabButton */
118 #define AllTemporary 0L /* special Resource ID passed to KillClient */
120 #define CurrentTime 0L /* special Time */
122 #define NoSymbol 0L /* special KeySym */
124 /*****************************************************************
126 *****************************************************************/
128 /* Input Event Masks. Used as event-mask window attribute and as arguments
129 to Grab requests. Not to be confused with event names. */
131 #define NoEventMask 0L
132 #define KeyPressMask (1L<<0)
133 #define KeyReleaseMask (1L<<1)
134 #define ButtonPressMask (1L<<2)
135 #define ButtonReleaseMask (1L<<3)
136 #define EnterWindowMask (1L<<4)
137 #define LeaveWindowMask (1L<<5)
138 #define PointerMotionMask (1L<<6)
139 #define PointerMotionHintMask (1L<<7)
140 #define Button1MotionMask (1L<<8)
141 #define Button2MotionMask (1L<<9)
142 #define Button3MotionMask (1L<<10)
143 #define Button4MotionMask (1L<<11)
144 #define Button5MotionMask (1L<<12)
145 #define ButtonMotionMask (1L<<13)
146 #define KeymapStateMask (1L<<14)
147 #define ExposureMask (1L<<15)
148 #define VisibilityChangeMask (1L<<16)
149 #define StructureNotifyMask (1L<<17)
150 #define ResizeRedirectMask (1L<<18)
151 #define SubstructureNotifyMask (1L<<19)
152 #define SubstructureRedirectMask (1L<<20)
153 #define FocusChangeMask (1L<<21)
154 #define PropertyChangeMask (1L<<22)
155 #define ColormapChangeMask (1L<<23)
156 #define OwnerGrabButtonMask (1L<<24)
158 /* Event names. Used in "type" field in XEvent structures. Not to be
159 confused with event masks above. They start from 2 because 0 and 1
160 are reserved in the protocol for errors and replies. */
164 #define ButtonPress 4
165 #define ButtonRelease 5
166 #define MotionNotify 6
167 #define EnterNotify 7
168 #define LeaveNotify 8
171 #define KeymapNotify 11
173 #define GraphicsExpose 13
175 #define VisibilityNotify 15
176 #define CreateNotify 16
177 #define DestroyNotify 17
178 #define UnmapNotify 18
180 #define MapRequest 20
181 #define ReparentNotify 21
182 #define ConfigureNotify 22
183 #define ConfigureRequest 23
184 #define GravityNotify 24
185 #define ResizeRequest 25
186 #define CirculateNotify 26
187 #define CirculateRequest 27
188 #define PropertyNotify 28
189 #define SelectionClear 29
190 #define SelectionRequest 30
191 #define SelectionNotify 31
192 #define ColormapNotify 32
193 #define ClientMessage 33
194 #define MappingNotify 34
195 #define LASTEvent 35 /* must be bigger than any event # */
198 /* Key masks. Used as modifiers to GrabButton and GrabKey, results of QueryPointer,
199 state in various key-, mouse-, and button-related events. */
201 #define ShiftMask (1<<0)
202 #define LockMask (1<<1)
203 #define ControlMask (1<<2)
204 #define Mod1Mask (1<<3)
205 #define Mod2Mask (1<<4)
206 #define Mod3Mask (1<<5)
207 #define Mod4Mask (1<<6)
208 #define Mod5Mask (1<<7)
210 /* modifier names. Used to build a SetModifierMapping request or
211 to read a GetModifierMapping request. These correspond to the
212 masks defined above. */
213 #define ShiftMapIndex 0
214 #define LockMapIndex 1
215 #define ControlMapIndex 2
216 #define Mod1MapIndex 3
217 #define Mod2MapIndex 4
218 #define Mod3MapIndex 5
219 #define Mod4MapIndex 6
220 #define Mod5MapIndex 7
223 /* button masks. Used in same manner as Key masks above. Not to be confused
224 with button names below. */
226 #define Button1Mask (1<<8)
227 #define Button2Mask (1<<9)
228 #define Button3Mask (1<<10)
229 #define Button4Mask (1<<11)
230 #define Button5Mask (1<<12)
232 #define AnyModifier (1<<15) /* used in GrabButton, GrabKey */
235 /* button names. Used as arguments to GrabButton and as detail in ButtonPress
236 and ButtonRelease events. Not to be confused with button masks above.
237 Note that 0 is already defined above as "AnyButton". */
247 #define NotifyNormal 0
249 #define NotifyUngrab 2
250 #define NotifyWhileGrabbed 3
252 #define NotifyHint 1 /* for MotionNotify events */
256 #define NotifyAncestor 0
257 #define NotifyVirtual 1
258 #define NotifyInferior 2
259 #define NotifyNonlinear 3
260 #define NotifyNonlinearVirtual 4
261 #define NotifyPointer 5
262 #define NotifyPointerRoot 6
263 #define NotifyDetailNone 7
265 /* Visibility notify */
267 #define VisibilityUnobscured 0
268 #define VisibilityPartiallyObscured 1
269 #define VisibilityFullyObscured 2
271 /* Circulation request */
274 #define PlaceOnBottom 1
276 /* protocol families */
278 #define FamilyInternet 0
279 #define FamilyDECnet 1
280 #define FamilyChaos 2
282 /* Property notification */
284 #define PropertyNewValue 0
285 #define PropertyDelete 1
287 /* Color Map notification */
289 #define ColormapUninstalled 0
290 #define ColormapInstalled 1
292 /* GrabPointer, GrabButton, GrabKeyboard, GrabKey Modes */
294 #define GrabModeSync 0
295 #define GrabModeAsync 1
297 /* GrabPointer, GrabKeyboard reply status */
299 #define GrabSuccess 0
300 #define AlreadyGrabbed 1
301 #define GrabInvalidTime 2
302 #define GrabNotViewable 3
305 /* AllowEvents modes */
307 #define AsyncPointer 0
308 #define SyncPointer 1
309 #define ReplayPointer 2
310 #define AsyncKeyboard 3
311 #define SyncKeyboard 4
312 #define ReplayKeyboard 5
316 /* Used in SetInputFocus, GetInputFocus */
318 #define RevertToNone (int)None
319 #define RevertToPointerRoot (int)PointerRoot
320 #define RevertToParent 2
322 /*****************************************************************
324 *****************************************************************/
326 #define Success 0 /* everything's okay */
327 #define BadRequest 1 /* bad request code */
328 #define BadValue 2 /* int parameter out of range */
329 #define BadWindow 3 /* parameter not a Window */
330 #define BadPixmap 4 /* parameter not a Pixmap */
331 #define BadAtom 5 /* parameter not an Atom */
332 #define BadCursor 6 /* parameter not a Cursor */
333 #define BadFont 7 /* parameter not a Font */
334 #define BadMatch 8 /* parameter mismatch */
335 #define BadDrawable 9 /* parameter not a Pixmap or Window */
336 #define BadAccess 10 /* depending on context:
337 - key/button already grabbed
338 - attempt to free an illegal
340 - attempt to store into a read-only
342 - attempt to modify the access control
343 list from other than the local host.
345 #define BadAlloc 11 /* insufficient resources */
346 #define BadColor 12 /* no such colormap */
347 #define BadGC 13 /* parameter not a GC */
348 #define BadIDChoice 14 /* choice not in range or already used */
349 #define BadName 15 /* font or color name doesn't exist */
350 #define BadLength 16 /* Request length incorrect */
351 #define BadImplementation 17 /* server is defective */
353 #define FirstExtensionError 128
354 #define LastExtensionError 255
356 /*****************************************************************
358 *****************************************************************/
360 /* Window classes used by CreateWindow */
361 /* Note that CopyFromParent is already defined as 0 above */
363 #define InputOutput 1
366 /* Window attributes for CreateWindow and ChangeWindowAttributes */
368 #define CWBackPixmap (1L<<0)
369 #define CWBackPixel (1L<<1)
370 #define CWBorderPixmap (1L<<2)
371 #define CWBorderPixel (1L<<3)
372 #define CWBitGravity (1L<<4)
373 #define CWWinGravity (1L<<5)
374 #define CWBackingStore (1L<<6)
375 #define CWBackingPlanes (1L<<7)
376 #define CWBackingPixel (1L<<8)
377 #define CWOverrideRedirect (1L<<9)
378 #define CWSaveUnder (1L<<10)
379 #define CWEventMask (1L<<11)
380 #define CWDontPropagate (1L<<12)
381 #define CWColormap (1L<<13)
382 #define CWCursor (1L<<14)
384 /* ConfigureWindow structure */
388 #define CWWidth (1<<2)
389 #define CWHeight (1<<3)
390 #define CWBorderWidth (1<<4)
391 #define CWSibling (1<<5)
392 #define CWStackMode (1<<6)
397 #define ForgetGravity 0
398 #define NorthWestGravity 1
399 #define NorthGravity 2
400 #define NorthEastGravity 3
401 #define WestGravity 4
402 #define CenterGravity 5
403 #define EastGravity 6
404 #define SouthWestGravity 7
405 #define SouthGravity 8
406 #define SouthEastGravity 9
407 #define StaticGravity 10
409 /* Window gravity + bit gravity above */
411 #define UnmapGravity 0
413 /* Used in CreateWindow for backing-store hint */
419 /* Used in GetWindowAttributes reply */
422 #define IsUnviewable 1
425 /* Used in ChangeSaveSet */
427 #define SetModeInsert 0
428 #define SetModeDelete 1
430 /* Used in ChangeCloseDownMode */
433 #define RetainPermanent 1
434 #define RetainTemporary 2
436 /* Window stacking method (in configureWindow) */
444 /* Circulation direction */
446 #define RaiseLowest 0
447 #define LowerHighest 1
451 #define PropModeReplace 0
452 #define PropModePrepend 1
453 #define PropModeAppend 2
455 /*****************************************************************
456 * GRAPHICS DEFINITIONS
457 *****************************************************************/
459 /* graphics functions, as in GC.alu */
461 #define GXclear 0x0 /* 0 */
462 #define GXand 0x1 /* src AND dst */
463 #define GXandReverse 0x2 /* src AND NOT dst */
464 #define GXcopy 0x3 /* src */
465 #define GXandInverted 0x4 /* NOT src AND dst */
466 #define GXnoop 0x5 /* dst */
467 #define GXxor 0x6 /* src XOR dst */
468 #define GXor 0x7 /* src OR dst */
469 #define GXnor 0x8 /* NOT src AND NOT dst */
470 #define GXequiv 0x9 /* NOT src XOR dst */
471 #define GXinvert 0xa /* NOT dst */
472 #define GXorReverse 0xb /* src OR NOT dst */
473 #define GXcopyInverted 0xc /* NOT src */
474 #define GXorInverted 0xd /* NOT src OR dst */
475 #define GXnand 0xe /* NOT src OR NOT dst */
476 #define GXset 0xf /* 1 */
481 #define LineOnOffDash 1
482 #define LineDoubleDash 2
489 #define CapProjecting 3
501 #define FillStippled 2
502 #define FillOpaqueStippled 3
506 #define EvenOddRule 0
507 #define WindingRule 1
511 #define ClipByChildren 0
512 #define IncludeInferiors 1
514 /* SetClipRectangles ordering */
521 /* CoordinateMode for drawing routines */
523 #define CoordModeOrigin 0 /* relative to the origin */
524 #define CoordModePrevious 1 /* relative to previous point */
528 #define Complex 0 /* paths may intersect */
529 #define Nonconvex 1 /* no paths intersect, but not convex */
530 #define Convex 2 /* wholly convex */
532 /* Arc modes for PolyFillArc */
534 #define ArcChord 0 /* join endpoints of arc */
535 #define ArcPieSlice 1 /* join endpoints to center of arc */
537 /* GC components: masks used in CreateGC, CopyGC, ChangeGC, OR'ed into
540 #define GCFunction (1L<<0)
541 #define GCPlaneMask (1L<<1)
542 #define GCForeground (1L<<2)
543 #define GCBackground (1L<<3)
544 #define GCLineWidth (1L<<4)
545 #define GCLineStyle (1L<<5)
546 #define GCCapStyle (1L<<6)
547 #define GCJoinStyle (1L<<7)
548 #define GCFillStyle (1L<<8)
549 #define GCFillRule (1L<<9)
550 #define GCTile (1L<<10)
551 #define GCStipple (1L<<11)
552 #define GCTileStipXOrigin (1L<<12)
553 #define GCTileStipYOrigin (1L<<13)
554 #define GCFont (1L<<14)
555 #define GCSubwindowMode (1L<<15)
556 #define GCGraphicsExposures (1L<<16)
557 #define GCClipXOrigin (1L<<17)
558 #define GCClipYOrigin (1L<<18)
559 #define GCClipMask (1L<<19)
560 #define GCDashOffset (1L<<20)
561 #define GCDashList (1L<<21)
562 #define GCArcMode (1L<<22)
565 /*****************************************************************
567 *****************************************************************/
569 /* used in QueryFont -- draw direction */
571 #define FontLeftToRight 0
572 #define FontRightToLeft 1
574 #define FontChange 255
576 /*****************************************************************
578 *****************************************************************/
580 /* ImageFormat -- PutImage, GetImage */
582 #define XYBitmap 0 /* depth 1, XYFormat */
583 #define XYPixmap 1 /* depth == drawable depth */
584 #define ZPixmap 2 /* depth == drawable depth */
586 /*****************************************************************
588 *****************************************************************/
590 /* For CreateColormap */
592 #define AllocNone 0 /* create map with no entries */
593 #define AllocAll 1 /* allocate entire map writeable */
596 /* Flags used in StoreNamedColor, StoreColors */
599 #define DoGreen (1<<1)
600 #define DoBlue (1<<2)
602 /*****************************************************************
604 *****************************************************************/
606 /* QueryBestSize Class */
608 #define CursorShape 0 /* largest size that can be displayed */
609 #define TileShape 1 /* size tiled fastest */
610 #define StippleShape 2 /* size stippled fastest */
612 /*****************************************************************
613 * KEYBOARD/POINTER STUFF
614 *****************************************************************/
616 #define AutoRepeatModeOff 0
617 #define AutoRepeatModeOn 1
618 #define AutoRepeatModeDefault 2
623 /* masks for ChangeKeyboardControl */
625 #define KBKeyClickPercent (1L<<0)
626 #define KBBellPercent (1L<<1)
627 #define KBBellPitch (1L<<2)
628 #define KBBellDuration (1L<<3)
629 #define KBLed (1L<<4)
630 #define KBLedMode (1L<<5)
631 #define KBKey (1L<<6)
632 #define KBAutoRepeatMode (1L<<7)
634 #define MappingSuccess 0
635 #define MappingBusy 1
636 #define MappingFailed 2
638 #define MappingModifier 0
639 #define MappingKeyboard 1
640 #define MappingPointer 2
642 /*****************************************************************
644 *****************************************************************/
646 #define DontPreferBlanking 0
647 #define PreferBlanking 1
648 #define DefaultBlanking 2
650 #define DisableScreenSaver 0
651 #define DisableScreenInterval 0
653 #define DontAllowExposures 0
654 #define AllowExposures 1
655 #define DefaultExposures 2
657 /* for ForceScreenSaver */
659 #define ScreenSaverReset 0
660 #define ScreenSaverActive 1
662 /*****************************************************************
663 * HOSTS AND CONNECTIONS
664 *****************************************************************/
666 /* for ChangeHosts */
671 /* for ChangeAccessControl */
673 #define EnableAccess 1
674 #define DisableAccess 0
676 /* Display classes used in opening the connection
677 * Note that the statically allocated ones are even numbered and the
678 * dynamically changeable ones are odd numbered */
682 #define StaticColor 2
683 #define PseudoColor 3
685 #define DirectColor 5
688 /* Byte order used in imageByteOrder and bitmapBitOrder */