Initial bulk commit for "Git on MSys"
[msysgit/historical-msysgit.git] / mingw / include / X11 / X.h
blob7755cacc4d8a610d8278ced270ceaee4567d5640
1 /*
2 * $XConsortium: X.h,v 1.66 88/09/06 15:55:56 jim Exp $
3 */
5 /* Definitions for the X window system likely to be used by applications */
7 #ifndef X_H
8 #define X_H
10 /***********************************************************
11 Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
12 and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
14 All Rights Reserved
16 Permission to use, copy, modify, and distribute this software and its
17 documentation for any purpose and without fee is hereby granted,
18 provided that the above copyright notice appear in all copies and that
19 both that copyright notice and this permission notice appear in
20 supporting documentation, and that the names of Digital or MIT not be
21 used in advertising or publicity pertaining to distribution of the
22 software without specific, written prior permission.
24 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
25 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
26 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
27 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
28 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
29 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
30 SOFTWARE.
32 ******************************************************************/
33 #define X_PROTOCOL 11 /* current protocol version */
34 #define X_PROTOCOL_REVISION 0 /* current minor version */
36 #if defined(MAC_TCL) || defined(MAC_OSX_TK)
37 # define Cursor XCursor
38 # define Region XRegion
39 #endif
41 /* Resources */
43 #ifdef _WIN64
44 typedef __int64 XID;
45 #else
46 typedef unsigned long XID;
47 #endif
49 typedef XID Window;
50 typedef XID Drawable;
51 typedef XID Font;
52 typedef XID Pixmap;
53 typedef XID Cursor;
54 typedef XID Colormap;
55 typedef XID GContext;
56 typedef XID KeySym;
58 typedef unsigned long Mask;
60 typedef unsigned long Atom;
62 typedef unsigned long VisualID;
64 typedef unsigned long Time;
66 typedef unsigned long KeyCode; /* In order to use IME, the Macintosh needs
67 * to pack 3 bytes into the keyCode field in
68 * the XEvent. In the real X.h, a KeyCode is
69 * defined as a short, which wouldn't be big
70 * enough. */
72 /*****************************************************************
73 * RESERVED RESOURCE AND CONSTANT DEFINITIONS
74 *****************************************************************/
76 #define None 0L /* universal null resource or null atom */
78 #define ParentRelative 1L /* background pixmap in CreateWindow
79 and ChangeWindowAttributes */
81 #define CopyFromParent 0L /* border pixmap in CreateWindow
82 and ChangeWindowAttributes
83 special VisualID and special window
84 class passed to CreateWindow */
86 #define PointerWindow 0L /* destination window in SendEvent */
87 #define InputFocus 1L /* destination window in SendEvent */
89 #define PointerRoot 1L /* focus window in SetInputFocus */
91 #define AnyPropertyType 0L /* special Atom, passed to GetProperty */
93 #define AnyKey 0L /* special Key Code, passed to GrabKey */
95 #define AnyButton 0L /* special Button Code, passed to GrabButton */
97 #define AllTemporary 0L /* special Resource ID passed to KillClient */
99 #define CurrentTime 0L /* special Time */
101 #define NoSymbol 0L /* special KeySym */
103 /*****************************************************************
104 * EVENT DEFINITIONS
105 *****************************************************************/
107 /* Input Event Masks. Used as event-mask window attribute and as arguments
108 to Grab requests. Not to be confused with event names. */
110 #define NoEventMask 0L
111 #define KeyPressMask (1L<<0)
112 #define KeyReleaseMask (1L<<1)
113 #define ButtonPressMask (1L<<2)
114 #define ButtonReleaseMask (1L<<3)
115 #define EnterWindowMask (1L<<4)
116 #define LeaveWindowMask (1L<<5)
117 #define PointerMotionMask (1L<<6)
118 #define PointerMotionHintMask (1L<<7)
119 #define Button1MotionMask (1L<<8)
120 #define Button2MotionMask (1L<<9)
121 #define Button3MotionMask (1L<<10)
122 #define Button4MotionMask (1L<<11)
123 #define Button5MotionMask (1L<<12)
124 #define ButtonMotionMask (1L<<13)
125 #define KeymapStateMask (1L<<14)
126 #define ExposureMask (1L<<15)
127 #define VisibilityChangeMask (1L<<16)
128 #define StructureNotifyMask (1L<<17)
129 #define ResizeRedirectMask (1L<<18)
130 #define SubstructureNotifyMask (1L<<19)
131 #define SubstructureRedirectMask (1L<<20)
132 #define FocusChangeMask (1L<<21)
133 #define PropertyChangeMask (1L<<22)
134 #define ColormapChangeMask (1L<<23)
135 #define OwnerGrabButtonMask (1L<<24)
137 /* Event names. Used in "type" field in XEvent structures. Not to be
138 confused with event masks above. They start from 2 because 0 and 1
139 are reserved in the protocol for errors and replies. */
141 #define KeyPress 2
142 #define KeyRelease 3
143 #define ButtonPress 4
144 #define ButtonRelease 5
145 #define MotionNotify 6
146 #define EnterNotify 7
147 #define LeaveNotify 8
148 #define FocusIn 9
149 #define FocusOut 10
150 #define KeymapNotify 11
151 #define Expose 12
152 #define GraphicsExpose 13
153 #define NoExpose 14
154 #define VisibilityNotify 15
155 #define CreateNotify 16
156 #define DestroyNotify 17
157 #define UnmapNotify 18
158 #define MapNotify 19
159 #define MapRequest 20
160 #define ReparentNotify 21
161 #define ConfigureNotify 22
162 #define ConfigureRequest 23
163 #define GravityNotify 24
164 #define ResizeRequest 25
165 #define CirculateNotify 26
166 #define CirculateRequest 27
167 #define PropertyNotify 28
168 #define SelectionClear 29
169 #define SelectionRequest 30
170 #define SelectionNotify 31
171 #define ColormapNotify 32
172 #define ClientMessage 33
173 #define MappingNotify 34
174 #define LASTEvent 35 /* must be bigger than any event # */
177 /* Key masks. Used as modifiers to GrabButton and GrabKey, results of QueryPointer,
178 state in various key-, mouse-, and button-related events. */
180 #define ShiftMask (1<<0)
181 #define LockMask (1<<1)
182 #define ControlMask (1<<2)
183 #define Mod1Mask (1<<3)
184 #define Mod2Mask (1<<4)
185 #define Mod3Mask (1<<5)
186 #define Mod4Mask (1<<6)
187 #define Mod5Mask (1<<7)
189 /* modifier names. Used to build a SetModifierMapping request or
190 to read a GetModifierMapping request. These correspond to the
191 masks defined above. */
192 #define ShiftMapIndex 0
193 #define LockMapIndex 1
194 #define ControlMapIndex 2
195 #define Mod1MapIndex 3
196 #define Mod2MapIndex 4
197 #define Mod3MapIndex 5
198 #define Mod4MapIndex 6
199 #define Mod5MapIndex 7
202 /* button masks. Used in same manner as Key masks above. Not to be confused
203 with button names below. */
205 #define Button1Mask (1<<8)
206 #define Button2Mask (1<<9)
207 #define Button3Mask (1<<10)
208 #define Button4Mask (1<<11)
209 #define Button5Mask (1<<12)
211 #define AnyModifier (1<<15) /* used in GrabButton, GrabKey */
214 /* button names. Used as arguments to GrabButton and as detail in ButtonPress
215 and ButtonRelease events. Not to be confused with button masks above.
216 Note that 0 is already defined above as "AnyButton". */
218 #define Button1 1
219 #define Button2 2
220 #define Button3 3
221 #define Button4 4
222 #define Button5 5
224 /* Notify modes */
226 #define NotifyNormal 0
227 #define NotifyGrab 1
228 #define NotifyUngrab 2
229 #define NotifyWhileGrabbed 3
231 #define NotifyHint 1 /* for MotionNotify events */
233 /* Notify detail */
235 #define NotifyAncestor 0
236 #define NotifyVirtual 1
237 #define NotifyInferior 2
238 #define NotifyNonlinear 3
239 #define NotifyNonlinearVirtual 4
240 #define NotifyPointer 5
241 #define NotifyPointerRoot 6
242 #define NotifyDetailNone 7
244 /* Visibility notify */
246 #define VisibilityUnobscured 0
247 #define VisibilityPartiallyObscured 1
248 #define VisibilityFullyObscured 2
250 /* Circulation request */
252 #define PlaceOnTop 0
253 #define PlaceOnBottom 1
255 /* protocol families */
257 #define FamilyInternet 0
258 #define FamilyDECnet 1
259 #define FamilyChaos 2
261 /* Property notification */
263 #define PropertyNewValue 0
264 #define PropertyDelete 1
266 /* Color Map notification */
268 #define ColormapUninstalled 0
269 #define ColormapInstalled 1
271 /* GrabPointer, GrabButton, GrabKeyboard, GrabKey Modes */
273 #define GrabModeSync 0
274 #define GrabModeAsync 1
276 /* GrabPointer, GrabKeyboard reply status */
278 #define GrabSuccess 0
279 #define AlreadyGrabbed 1
280 #define GrabInvalidTime 2
281 #define GrabNotViewable 3
282 #define GrabFrozen 4
284 /* AllowEvents modes */
286 #define AsyncPointer 0
287 #define SyncPointer 1
288 #define ReplayPointer 2
289 #define AsyncKeyboard 3
290 #define SyncKeyboard 4
291 #define ReplayKeyboard 5
292 #define AsyncBoth 6
293 #define SyncBoth 7
295 /* Used in SetInputFocus, GetInputFocus */
297 #define RevertToNone (int)None
298 #define RevertToPointerRoot (int)PointerRoot
299 #define RevertToParent 2
301 /*****************************************************************
302 * ERROR CODES
303 *****************************************************************/
305 #define Success 0 /* everything's okay */
306 #define BadRequest 1 /* bad request code */
307 #define BadValue 2 /* int parameter out of range */
308 #define BadWindow 3 /* parameter not a Window */
309 #define BadPixmap 4 /* parameter not a Pixmap */
310 #define BadAtom 5 /* parameter not an Atom */
311 #define BadCursor 6 /* parameter not a Cursor */
312 #define BadFont 7 /* parameter not a Font */
313 #define BadMatch 8 /* parameter mismatch */
314 #define BadDrawable 9 /* parameter not a Pixmap or Window */
315 #define BadAccess 10 /* depending on context:
316 - key/button already grabbed
317 - attempt to free an illegal
318 cmap entry
319 - attempt to store into a read-only
320 color map entry.
321 - attempt to modify the access control
322 list from other than the local host.
324 #define BadAlloc 11 /* insufficient resources */
325 #define BadColor 12 /* no such colormap */
326 #define BadGC 13 /* parameter not a GC */
327 #define BadIDChoice 14 /* choice not in range or already used */
328 #define BadName 15 /* font or color name doesn't exist */
329 #define BadLength 16 /* Request length incorrect */
330 #define BadImplementation 17 /* server is defective */
332 #define FirstExtensionError 128
333 #define LastExtensionError 255
335 /*****************************************************************
336 * WINDOW DEFINITIONS
337 *****************************************************************/
339 /* Window classes used by CreateWindow */
340 /* Note that CopyFromParent is already defined as 0 above */
342 #define InputOutput 1
343 #define InputOnly 2
345 /* Window attributes for CreateWindow and ChangeWindowAttributes */
347 #define CWBackPixmap (1L<<0)
348 #define CWBackPixel (1L<<1)
349 #define CWBorderPixmap (1L<<2)
350 #define CWBorderPixel (1L<<3)
351 #define CWBitGravity (1L<<4)
352 #define CWWinGravity (1L<<5)
353 #define CWBackingStore (1L<<6)
354 #define CWBackingPlanes (1L<<7)
355 #define CWBackingPixel (1L<<8)
356 #define CWOverrideRedirect (1L<<9)
357 #define CWSaveUnder (1L<<10)
358 #define CWEventMask (1L<<11)
359 #define CWDontPropagate (1L<<12)
360 #define CWColormap (1L<<13)
361 #define CWCursor (1L<<14)
363 /* ConfigureWindow structure */
365 #define CWX (1<<0)
366 #define CWY (1<<1)
367 #define CWWidth (1<<2)
368 #define CWHeight (1<<3)
369 #define CWBorderWidth (1<<4)
370 #define CWSibling (1<<5)
371 #define CWStackMode (1<<6)
374 /* Bit Gravity */
376 #define ForgetGravity 0
377 #define NorthWestGravity 1
378 #define NorthGravity 2
379 #define NorthEastGravity 3
380 #define WestGravity 4
381 #define CenterGravity 5
382 #define EastGravity 6
383 #define SouthWestGravity 7
384 #define SouthGravity 8
385 #define SouthEastGravity 9
386 #define StaticGravity 10
388 /* Window gravity + bit gravity above */
390 #define UnmapGravity 0
392 /* Used in CreateWindow for backing-store hint */
394 #define NotUseful 0
395 #define WhenMapped 1
396 #define Always 2
398 /* Used in GetWindowAttributes reply */
400 #define IsUnmapped 0
401 #define IsUnviewable 1
402 #define IsViewable 2
404 /* Used in ChangeSaveSet */
406 #define SetModeInsert 0
407 #define SetModeDelete 1
409 /* Used in ChangeCloseDownMode */
411 #define DestroyAll 0
412 #define RetainPermanent 1
413 #define RetainTemporary 2
415 /* Window stacking method (in configureWindow) */
417 #define Above 0
418 #define Below 1
419 #define TopIf 2
420 #define BottomIf 3
421 #define Opposite 4
423 /* Circulation direction */
425 #define RaiseLowest 0
426 #define LowerHighest 1
428 /* Property modes */
430 #define PropModeReplace 0
431 #define PropModePrepend 1
432 #define PropModeAppend 2
434 /*****************************************************************
435 * GRAPHICS DEFINITIONS
436 *****************************************************************/
438 /* graphics functions, as in GC.alu */
440 #define GXclear 0x0 /* 0 */
441 #define GXand 0x1 /* src AND dst */
442 #define GXandReverse 0x2 /* src AND NOT dst */
443 #define GXcopy 0x3 /* src */
444 #define GXandInverted 0x4 /* NOT src AND dst */
445 #define GXnoop 0x5 /* dst */
446 #define GXxor 0x6 /* src XOR dst */
447 #define GXor 0x7 /* src OR dst */
448 #define GXnor 0x8 /* NOT src AND NOT dst */
449 #define GXequiv 0x9 /* NOT src XOR dst */
450 #define GXinvert 0xa /* NOT dst */
451 #define GXorReverse 0xb /* src OR NOT dst */
452 #define GXcopyInverted 0xc /* NOT src */
453 #define GXorInverted 0xd /* NOT src OR dst */
454 #define GXnand 0xe /* NOT src OR NOT dst */
455 #define GXset 0xf /* 1 */
457 /* LineStyle */
459 #define LineSolid 0
460 #define LineOnOffDash 1
461 #define LineDoubleDash 2
463 /* capStyle */
465 #define CapNotLast 0
466 #define CapButt 1
467 #define CapRound 2
468 #define CapProjecting 3
470 /* joinStyle */
472 #define JoinMiter 0
473 #define JoinRound 1
474 #define JoinBevel 2
476 /* fillStyle */
478 #define FillSolid 0
479 #define FillTiled 1
480 #define FillStippled 2
481 #define FillOpaqueStippled 3
483 /* fillRule */
485 #define EvenOddRule 0
486 #define WindingRule 1
488 /* subwindow mode */
490 #define ClipByChildren 0
491 #define IncludeInferiors 1
493 /* SetClipRectangles ordering */
495 #define Unsorted 0
496 #define YSorted 1
497 #define YXSorted 2
498 #define YXBanded 3
500 /* CoordinateMode for drawing routines */
502 #define CoordModeOrigin 0 /* relative to the origin */
503 #define CoordModePrevious 1 /* relative to previous point */
505 /* Polygon shapes */
507 #define Complex 0 /* paths may intersect */
508 #define Nonconvex 1 /* no paths intersect, but not convex */
509 #define Convex 2 /* wholly convex */
511 /* Arc modes for PolyFillArc */
513 #define ArcChord 0 /* join endpoints of arc */
514 #define ArcPieSlice 1 /* join endpoints to center of arc */
516 /* GC components: masks used in CreateGC, CopyGC, ChangeGC, OR'ed into
517 GC.stateChanges */
519 #define GCFunction (1L<<0)
520 #define GCPlaneMask (1L<<1)
521 #define GCForeground (1L<<2)
522 #define GCBackground (1L<<3)
523 #define GCLineWidth (1L<<4)
524 #define GCLineStyle (1L<<5)
525 #define GCCapStyle (1L<<6)
526 #define GCJoinStyle (1L<<7)
527 #define GCFillStyle (1L<<8)
528 #define GCFillRule (1L<<9)
529 #define GCTile (1L<<10)
530 #define GCStipple (1L<<11)
531 #define GCTileStipXOrigin (1L<<12)
532 #define GCTileStipYOrigin (1L<<13)
533 #define GCFont (1L<<14)
534 #define GCSubwindowMode (1L<<15)
535 #define GCGraphicsExposures (1L<<16)
536 #define GCClipXOrigin (1L<<17)
537 #define GCClipYOrigin (1L<<18)
538 #define GCClipMask (1L<<19)
539 #define GCDashOffset (1L<<20)
540 #define GCDashList (1L<<21)
541 #define GCArcMode (1L<<22)
543 #define GCLastBit 22
544 /*****************************************************************
545 * FONTS
546 *****************************************************************/
548 /* used in QueryFont -- draw direction */
550 #define FontLeftToRight 0
551 #define FontRightToLeft 1
553 #define FontChange 255
555 /*****************************************************************
556 * IMAGING
557 *****************************************************************/
559 /* ImageFormat -- PutImage, GetImage */
561 #define XYBitmap 0 /* depth 1, XYFormat */
562 #define XYPixmap 1 /* depth == drawable depth */
563 #define ZPixmap 2 /* depth == drawable depth */
565 /*****************************************************************
566 * COLOR MAP STUFF
567 *****************************************************************/
569 /* For CreateColormap */
571 #define AllocNone 0 /* create map with no entries */
572 #define AllocAll 1 /* allocate entire map writeable */
575 /* Flags used in StoreNamedColor, StoreColors */
577 #define DoRed (1<<0)
578 #define DoGreen (1<<1)
579 #define DoBlue (1<<2)
581 /*****************************************************************
582 * CURSOR STUFF
583 *****************************************************************/
585 /* QueryBestSize Class */
587 #define CursorShape 0 /* largest size that can be displayed */
588 #define TileShape 1 /* size tiled fastest */
589 #define StippleShape 2 /* size stippled fastest */
591 /*****************************************************************
592 * KEYBOARD/POINTER STUFF
593 *****************************************************************/
595 #define AutoRepeatModeOff 0
596 #define AutoRepeatModeOn 1
597 #define AutoRepeatModeDefault 2
599 #define LedModeOff 0
600 #define LedModeOn 1
602 /* masks for ChangeKeyboardControl */
604 #define KBKeyClickPercent (1L<<0)
605 #define KBBellPercent (1L<<1)
606 #define KBBellPitch (1L<<2)
607 #define KBBellDuration (1L<<3)
608 #define KBLed (1L<<4)
609 #define KBLedMode (1L<<5)
610 #define KBKey (1L<<6)
611 #define KBAutoRepeatMode (1L<<7)
613 #define MappingSuccess 0
614 #define MappingBusy 1
615 #define MappingFailed 2
617 #define MappingModifier 0
618 #define MappingKeyboard 1
619 #define MappingPointer 2
621 /*****************************************************************
622 * SCREEN SAVER STUFF
623 *****************************************************************/
625 #define DontPreferBlanking 0
626 #define PreferBlanking 1
627 #define DefaultBlanking 2
629 #define DisableScreenSaver 0
630 #define DisableScreenInterval 0
632 #define DontAllowExposures 0
633 #define AllowExposures 1
634 #define DefaultExposures 2
636 /* for ForceScreenSaver */
638 #define ScreenSaverReset 0
639 #define ScreenSaverActive 1
641 /*****************************************************************
642 * HOSTS AND CONNECTIONS
643 *****************************************************************/
645 /* for ChangeHosts */
647 #define HostInsert 0
648 #define HostDelete 1
650 /* for ChangeAccessControl */
652 #define EnableAccess 1
653 #define DisableAccess 0
655 /* Display classes used in opening the connection
656 * Note that the statically allocated ones are even numbered and the
657 * dynamically changeable ones are odd numbered */
659 #define StaticGray 0
660 #define GrayScale 1
661 #define StaticColor 2
662 #define PseudoColor 3
663 #define TrueColor 4
664 #define DirectColor 5
667 /* Byte order used in imageByteOrder and bitmapBitOrder */
669 #define LSBFirst 0
670 #define MSBFirst 1
672 #if defined(MAC_TCL) || defined(MAC_OSX_TK)
673 # undef Cursor
674 # undef Region
675 #endif
677 #endif /* X_H */