1 module iv
.x11
.x11
/*is aliced*/;
4 public import core
.stdc
.config
: c_long
, c_ulong
;
6 extern (C
) @safe nothrow @nogc:
8 enum uint X_PROTOCOL
= 11; /* current protocol version */
9 enum uint X_PROTOCOL_REVISION
= 0; /* current minor version */
11 //typedef XID = c_ulong;
13 //typedef Mask = c_ulong;
15 //typedef Atom = c_ulong;
17 //typedef VisualID = c_ulong;
18 alias VisualID
= c_ulong
;
19 //typedef Time = c_ulong;
21 //typedef Window = XID;
23 //typedef Drawable = XID;
27 //typedef Pixmap = XID;
29 //typedef Cursor = XID;
31 //typedef Colormap = XID;
33 //typedef GContext = XID;
35 //typedef KeySym = XID;
37 //typedef KeyCode = ubyte;
38 alias KeyCode
= ubyte;
40 /*****************************************************************
41 * RESERVED RESOURCE AND CONSTANT DEFINITIONS
42 *****************************************************************/
43 enum XID None
= cast(XID
)0; /* universal null resource or null atom */
44 enum XID ParentRelative
= cast(XID
)1; /* background pixmap in CreateWindow and ChangeWindowAttributes */
45 enum XID CopyFromParent
= cast(XID
)0; /* border pixmap in CreateWindow and ChangeWindowAttributes special VisualID and
46 special window class passed to CreateWindow */
48 enum Window PointerWindow
= cast(Window
)0; /* destination window in SendEvent */
49 enum Window InputFocus
= cast(Window
)1; /* destination window in SendEvent */
50 enum Window PointerRoot
= cast(Window
)1; /* focus window in SetInputFocus */
51 enum Atom AnyPropertyType
= cast(Atom
)0; /* special Atom, passed to GetProperty */
52 enum KeyCode AnyKey
= cast(KeyCode
)0; /* special Key Code, passed to GrabKey */
53 enum c_long AnyButton
= cast(c_long
)0; /* special Button Code, passed to GrabButton */
54 enum XID AllTemporary
= cast(XID
)0; /* special Resource ID passed to KillClient */
55 enum Time CurrentTime
= cast(Time
)0; /* special Time */
56 enum KeySym NoSymbol
= cast(KeySym
)0; /* special KeySym */
58 /*****************************************************************
60 *****************************************************************/
62 /* Input Event Masks. Used as event-mask window attribute and as arguments
63 to Grab requests. Not to be confused with event names. */
67 KeyReleaseMask
= 1<<1,
68 ButtonPressMask
= 1<<2,
69 ButtonReleaseMask
= 1<<3,
70 EnterWindowMask
= 1<<4,
71 LeaveWindowMask
= 1<<5,
72 PointerMotionMask
= 1<<6,
73 PointerMotionHintMask
= 1<<7,
74 Button1MotionMask
= 1<<8,
75 Button2MotionMask
= 1<<9,
76 Button3MotionMask
= 1<<10,
77 Button4MotionMask
= 1<<11,
78 Button5MotionMask
= 1<<12,
79 ButtonMotionMask
= 1<<13,
80 KeymapStateMask
= 1<<14,
82 VisibilityChangeMask
= 1<<16,
83 StructureNotifyMask
= 1<<17,
84 ResizeRedirectMask
= 1<<18,
85 SubstructureNotifyMask
= 1<<19,
86 SubstructureRedirectMask
= 1<<20,
87 FocusChangeMask
= 1<<21,
88 PropertyChangeMask
= 1<<22,
89 ColormapChangeMask
= 1<<23,
90 OwnerGrabButtonMask
= 1<<24,
93 /* Event names. Used in "type" field in XEvent structures. Not to be
94 * confused with event masks above. They start from 2 because 0 and 1
95 * are reserved in the protocol for errors and replies. */
110 VisibilityNotify
= 15,
117 ConfigureNotify
= 22,
118 ConfigureRequest
= 23,
121 CirculateNotify
= 26,
122 CirculateRequest
= 27,
125 SelectionRequest
= 30,
126 SelectionNotify
= 31,
131 LASTEvent
= 36, /* must be bigger than any event # */
134 /* Key masks. Used as modifiers to GrabButton and GrabKey, results of QueryPointer,
135 * state in various key-, mouse-, and button-related events. */
147 /* modifier names. Used to build a SetModifierMapping request or
148 * to read a GetModifierMapping request. These correspond to the
149 * masks defined above. */
161 /* button masks. Used in same manner as Key masks above. Not to be confused
162 * with button names below. */
169 AnyModifier
= 1<<15, /* used in GrabButton, GrabKey */
183 /* button names. Used as arguments to GrabButton and as detail in ButtonPress
184 * and ButtonRelease events. Not to be confused with button masks above.
185 * Note that 0 is already defined above as "AnyButton". */
199 NotifyWhileGrabbed
= 3,
202 enum int NotifyHint
= 1; /* for MotionNotify events */
210 NotifyNonlinearVirtual
= 4,
212 NotifyPointerRoot
= 6,
213 NotifyDetailNone
= 7,
216 /* Visibility notify */
218 VisibilityUnobscured
= 0,
219 VisibilityPartiallyObscured
= 1,
220 VisibilityFullyObscured
= 2,
223 /* Circulation request */
229 /* protocol families */
231 FamilyInternet
= 0, /* IPv4 */
234 FamilyServerInterpreted
= 5, /* authentication families not tied to a specific protocol */
235 FamilyInternet6
= 6, /* IPv6 */
238 /* Property notification */
240 PropertyNewValue
= 0,
244 /* Color Map notification */
246 ColormapUninstalled
= 0,
247 ColormapInstalled
= 1,
250 /* GrabPointer, GrabButton, GrabKeyboard, GrabKey Modes */
256 /* GrabPointer, GrabKeyboard reply status */
265 /* AllowEvents modes */
277 /* Used in SetInputFocus, GetInputFocus */
280 RevertToPointerRoot
= PointerRoot
,
284 /*****************************************************************
286 *****************************************************************/
287 enum XErrorCode
: int {
288 Success
= 0, /* everything's okay */
289 BadRequest
= 1, /* bad request code */
290 BadValue
= 2, /* int parameter out of range */
291 BadWindow
= 3, /* parameter not a Window */
292 BadPixmap
= 4, /* parameter not a Pixmap */
293 BadAtom
= 5, /* parameter not an Atom */
294 BadCursor
= 6, /* parameter not a Cursor */
295 BadFont
= 7, /* parameter not a Font */
296 BadMatch
= 8, /* parameter mismatch */
297 BadDrawable
= 9, /* parameter not a Pixmap or Window */
298 BadAccess
= 10, /* depending on context:
299 - key/button already grabbed
300 - attempt to free an illegal
302 - attempt to store into a read-only
304 - attempt to modify the access control
305 list from other than the local host. */
306 BadAlloc
= 11, /* insufficient resources */
307 BadColor
= 12, /* no such colormap */
308 BadGC
= 13, /* parameter not a GC */
309 BadIDChoice
= 14, /* choice not in range or already used */
310 BadName
= 15, /* font or color name doesn't exist */
311 BadLength
= 16, /* Request length incorrect */
312 BadImplementation
= 17, /* server is defective */
314 FirstExtensionError
= 128,
315 LastExtensionError
= 255,
318 /*****************************************************************
320 *****************************************************************/
322 /* Window classes used by CreateWindow */
323 /* Note that CopyFromParent is already defined as 0 above */
329 /* Window attributes for CreateWindow and ChangeWindowAttributes */
333 CWBorderPixmap
= 1<<2,
334 CWBorderPixel
= 1<<3,
337 CWBackingStore
= 1<<6,
338 CWBackingPlanes
= 1<<7,
339 CWBackingPixel
= 1<<8,
340 CWOverrideRedirect
= 1<<9,
343 CWDontPropagate
= 1<<12,
348 /* ConfigureWindow structure */
354 CWBorderWidth
= 1<<4,
362 NorthWestGravity
= 1,
364 NorthEastGravity
= 3,
368 SouthWestGravity
= 7,
370 SouthEastGravity
= 9,
374 /* Window gravity + bit gravity above */
375 enum uint UnmapGravity
= 0;
377 /* Used in CreateWindow for backing-store hint */
384 /* Used in GetWindowAttributes reply */
391 /* Used in ChangeSaveSet */
397 /* Used in ChangeCloseDownMode */
398 enum CloseDownMode
: int {
404 /* Window stacking method (in configureWindow) */
413 /* Circulation direction */
426 /*****************************************************************
427 * GRAPHICS DEFINITIONS
428 *****************************************************************/
430 /* graphics functions, as in GC.alu */
432 GXclear
= 0x0, /* 0 */
433 GXand
= 0x1, /* src AND dst */
434 GXandReverse
= 0x2, /* src AND NOT dst */
435 GXcopy
= 0x3, /* src */
436 GXandInverted
= 0x4, /* NOT src AND dst */
437 GXnoop
= 0x5, /* dst */
438 GXxor
= 0x6, /* src XOR dst */
439 GXor
= 0x7, /* src OR dst */
440 GXnor
= 0x8, /* NOT src AND NOT dst */
441 GXequiv
= 0x9, /* NOT src XOR dst */
442 GXinvert
= 0xa, /* NOT dst */
443 GXorReverse
= 0xb, /* src OR NOT dst */
444 GXcopyInverted
= 0xc, /* NOT src */
445 GXorInverted
= 0xd, /* NOT src OR dst */
446 GXnand
= 0xe, /* NOT src OR NOT dst */
477 FillOpaqueStippled
= 3,
489 IncludeInferiors
= 1,
492 /* SetClipRectangles ordering */
500 /* CoordinateMode for drawing routines */
502 CoordModeOrigin
= 0, /* relative to the origin */
503 CoordModePrevious
= 1, /* relative to previous point */
508 Complex
= 0, /* paths may intersect */
509 Nonconvex
= 1, /* no paths intersect, but not convex */
510 Convex
= 2, /* wholly convex */
513 /* Arc modes for PolyFillArc */
515 ArcChord
= 0, /* join endpoints of arc */
516 ArcPieSlice
= 1, /* join endpoints to center of arc */
519 /* GC components: masks used in CreateGC, CopyGC, ChangeGC, OR'ed into GC.stateChanges */
533 GCTileStipXOrigin
= 1<<12,
534 GCTileStipYOrigin
= 1<<13,
536 GCSubwindowMode
= 1<<15,
537 GCGraphicsExposures
= 1<<16,
538 GCClipXOrigin
= 1<<17,
539 GCClipYOrigin
= 1<<18,
541 GCDashOffset
= 1<<20,
545 enum uint GCLastBit
= 22;
547 /*****************************************************************
549 *****************************************************************/
551 /* used in QueryFont -- draw direction */
558 /*****************************************************************
560 *****************************************************************/
562 /* ImageFormat -- PutImage, GetImage */
564 XYBitmap
= 0, /* depth 1, XYFormat */
565 XYPixmap
= 1, /* depth == drawable depth */
566 ZPixmap
= 2, /* depth == drawable depth */
569 /*****************************************************************
571 *****************************************************************/
573 /* For CreateColormap */
575 AllocNone
= 0, /* create map with no entries */
576 AllocAll
= 1, /* allocate entire map writeable */
579 /* Flags used in StoreNamedColor, StoreColors */
586 /*****************************************************************
588 *****************************************************************/
590 /* QueryBestSize Class */
592 CursorShape
= 0, /* largest size that can be displayed */
593 TileShape
= 1, /* size tiled fastest */
594 StippleShape
= 2, /* size stippled fastest */
597 /*****************************************************************
598 * KEYBOARD/POINTER STUFF
599 *****************************************************************/
602 AutoRepeatModeOff
= 0,
603 AutoRepeatModeOn
= 1,
604 AutoRepeatModeDefault
= 2,
612 /* masks for ChangeKeyboardControl */
614 KBKeyClickPercent
= 1<<0,
615 KBBellPercent
= 1<<1,
617 KBBellDuration
= 1<<3,
621 KBAutoRepeatMode
= 1<<7,
636 /*****************************************************************
638 *****************************************************************/
641 DontPreferBlanking
= 0,
647 DisableScreenSaver
= 0,
648 DisableScreenInterval
= 0,
652 DontAllowExposures
= 0,
654 DefaultExposures
= 2,
657 /* for ForceScreenSaver */
659 ScreenSaverReset
= 0,
660 ScreenSaverActive
= 1,
663 /*****************************************************************
664 * HOSTS AND CONNECTIONS
665 *****************************************************************/
667 /* for ChangeHosts */
673 /* for ChangeAccessControl */
679 /* Display classes used in opening the connection
680 * Note that the statically allocated ones are even numbered and the
681 * dynamically changeable ones are odd numbered */
691 /* Byte order used in imageByteOrder and bitmapBitOrder */