egra: agg mini cosmetix
[iv.d.git] / x11 / xlib.d
blobb9a1149cb8ef021c96cbcb422ab5b7372db4a4b2
1 module iv.x11.xlib /*is aliced*/;
2 pragma(lib, "X11");
4 import core.stdc.config : c_long, c_ulong;
5 import core.stdc.stddef : wchar_t;
7 import iv.alice;
8 import iv.x11.md;
9 import iv.x11.x11;
12 extern(C):
14 alias XIOErrorHandler = int function ( /* WARNING, this type not in Xlib spec */
15 Display* display
19 @trusted nothrow @nogc:
21 enum int XlibSpecificationRelease = 6;
22 enum int X_HAVE_UTF8_STRING = 1;
24 alias XPointer = char*;
25 alias Status = int;
27 alias Bool = int;
28 enum { False, True }
30 alias QueueMode = int;
31 enum {
32 QueuedAlready,
33 QueuedAfterReading,
34 QueuedAfterFlush
37 int ConnectionNumber() (Display* dpy) { return dpy.fd; }
38 Window RootWindow() (Display* dpy,int scr) { return ScreenOfDisplay( dpy,scr ).root; }
39 int DefaultScreen() (Display* dpy) { return dpy.default_screen; }
40 Window DefaultRootWindow() (Display* dpy) { return ScreenOfDisplay( dpy,DefaultScreen( dpy ) ).root; }
41 Visual* DefaultVisual() (Display* dpy,int scr) { return ScreenOfDisplay( dpy,scr ).root_visual; }
42 GC DefaultGC() (Display* dpy,int scr) { return ScreenOfDisplay( dpy,scr ).default_gc; }
43 uint BlackPixel() (Display* dpy,int scr) { return cast(uint)ScreenOfDisplay( dpy,scr ).black_pixel; }
44 uint WhitePixel() (Display* dpy,int scr) { return cast(uint)ScreenOfDisplay( dpy,scr ).white_pixel; }
45 c_ulong AllPlanes() ( ) { return 0xFFFFFFFF; }
46 int QLength() (Display* dpy) { return dpy.qlen; }
47 int DisplayWidth() (Display* dpy,int scr) { return ScreenOfDisplay( dpy,scr ).width; }
48 int DisplayHeight() (Display* dpy,int scr) { return ScreenOfDisplay( dpy,scr ).height; }
49 int DisplayWidthMM() (Display* dpy,int scr) { return ScreenOfDisplay( dpy,scr ).mwidth; }
50 int DisplayHeightMM() (Display* dpy,int scr) { return ScreenOfDisplay( dpy,scr ).mheight; }
51 int DisplayPlanes() (Display* dpy,int scr) { return ScreenOfDisplay( dpy,scr ).root_depth; }
52 int DisplayCells() (Display* dpy,int scr) { return DefaultVisual( dpy,scr ).map_entries; }
53 int ScreenCount() (Display* dpy) { return dpy.nscreens; }
54 const(char)* ServerVendor() (Display* dpy) { return dpy.vendor; }
55 int ProtocolVersion() (Display* dpy) { return dpy.proto_major_version; }
56 int ProtocolRevision() (Display* dpy) { return dpy.proto_minor_version; }
57 int VendorRelease() (Display* dpy) { return dpy.release; }
58 const(char)* DisplayString() (Display* dpy) { return dpy.display_name; }
59 int DefaultDepth() (Display* dpy,int scr) { return ScreenOfDisplay( dpy,scr ).root_depth; }
60 Colormap DefaultColormap() (Display* dpy,int scr) { return ScreenOfDisplay( dpy,scr ).cmap; }
61 int BitmapUnit() (Display* dpy) { return dpy.bitmap_unit; }
62 int BitmapBitOrder() (Display* dpy) { return dpy.bitmap_bit_order; }
63 int BitmapPad() (Display* dpy) { return dpy.bitmap_pad; }
64 int ImagecharOrder() (Display* dpy) { return dpy.char_order; }
65 uint NextRequest() (Display* dpy) { return cast(uint)dpy.request + 1; }
66 uint LastKnownRequestProcessed() (Display* dpy) { return cast(uint)dpy.last_request_read; }
68 /* macros for screen oriented applications ( toolkit ) */
69 Screen* ScreenOfDisplay() (Display* dpy,int scr) { return &dpy.screens[scr]; }
70 Screen* DefaultScreenOfDisplay() (Display* dpy) { return ScreenOfDisplay( dpy,DefaultScreen( dpy ) ); }
71 Display* DisplayOfScreen() (Screen* s) { return s.display; }
72 Window RootWindowOfScreen() (Screen* s) { return s.root; }
73 uint BlackPixelOfScreen() (Screen* s) { return cast(uint)s.black_pixel; }
74 uint WhitePixelOfScreen() (Screen* s) { return cast(uint)s.white_pixel; }
75 Colormap DefaultColormapOfScreen() (Screen* s) { return s.cmap; }
76 int DefaultDepthOfScreen() (Screen* s) { return s.root_depth; }
77 GC DefaultGCOfScreen() (Screen* s) { return s.default_gc; }
78 Visual* DefaultVisualOfScreen() (Screen* s) { return s.root_visual; }
79 int WidthOfScreen() (Screen* s) { return s.width; }
80 int HeightOfScreen() (Screen* s) { return s.height; }
81 int WidthMMOfScreen() (Screen* s) { return s.mwidth; }
82 int HeightMMOfScreen() (Screen* s) { return s.mheight; }
83 int PlanesOfScreen() (Screen* s) { return s.root_depth; }
84 int CellsOfScreen() (Screen* s) { return DefaultVisualOfScreen( s ).map_entries; }
85 int MinCmapsOfScreen() (Screen* s) { return s.min_maps; }
86 int MaxCmapsOfScreen() (Screen* s) { return s.max_maps; }
87 Bool DoesSaveUnders() (Screen* s) { return s.save_unders; }
88 int DoesBackingStore() (Screen* s) { return s.backing_store; }
89 long EventMaskOfScreen() (Screen* s) { return s.root_input_mask; }
92 * Extensions need a way to hang private data on some structures.
94 struct XExtData {
95 int number; /* number returned by XRegisterExtension */
96 XExtData* next; /* next item on list of data for structure */
97 extern(C) @trusted nothrow @nogc int function (XExtData *extension) free_private; /* called to free private storage */
98 XPointer private_data; /* data private to this extension. */
102 * This file contains structures used by the extension mechanism.
104 /* public to extension, cannot be changed */
105 struct XExtCodes {
106 int extension; /* extension number */
107 int major_opcode; /* major op-code assigned by server */
108 int first_event; /* first event number for the extension */
109 int first_error; /* first error number for the extension */
113 * Data structure for retrieving info about pixmap formats.
115 struct XPixmapFormatValues {
116 int depth;
117 int bits_per_pixel;
118 int scanline_pad;
122 * Data structure for setting graphics context.
124 struct XGCValues {
125 int func; /* logical operation */
126 c_ulong plane_mask; /* plane mask */
127 c_ulong foreground; /* foreground pixel */
128 c_ulong background; /* background pixel */
129 int line_width; /* line width */
130 int line_style; /* LineSolid; LineOnOffDash; LineDoubleDash */
131 int cap_style; /* CapNotLast; CapButt; CapRound; CapProjecting */
132 int join_style; /* JoinMiter; JoinRound; JoinBevel */
133 int fill_style; /* FillSolid; FillTiled; FillStippled; FillOpaeueStippled */
134 int fill_rule; /* EvenOddRule; WindingRule */
135 int arc_mode; /* ArcChord; ArcPieSlice */
136 Pixmap tile; /* tile pixmap for tiling operations */
137 Pixmap stipple; /* stipple 1 plane pixmap for stipping */
138 int ts_x_origin; /* offset for tile or stipple operations */
139 int ts_y_origin;
140 Font font; /* default text font for text operations */
141 int subwindow_mode; /* ClipByChildren; IncludeInferiors */
142 Bool graphics_exposures; /* boolean; should exposures be generated */
143 int clip_x_origin; /* origin for clipping */
144 int clip_y_origin;
145 Pixmap clip_mask; /* bitmap clipping; other calls for rects */
146 int dash_offset; /* patterned/dashed line information */
147 char dashes;
149 version (XLIB_ILLEGAL_ACCESS) {
150 struct _XGC {
151 XExtData* ext_data; /* hook for extension to hang data */
152 GContext gid; /* protocol ID for graphics context */
153 /* there is more to this structure, but it is private to Xlib */
155 } else {
156 struct _XGC;
159 alias GC = _XGC*;
162 * Visual structure; contains information about colormapping possible.
164 struct Visual {
165 XExtData* ext_data; /* hook for extension to hang data */
166 VisualID visualid; /* visual id of this visual */
167 int c_class; /* class of screen (monochrome, etc.) */
168 c_ulong red_mask, green_mask, blue_mask; /* mask values */
169 int bits_per_rgb; /* log base 2 of distinct color values */
170 int map_entries; /* color map entries */
174 * Depth structure; contains information for each possible depth.
176 struct Depth {
177 int depth; /* this depth (Z) of the depth */
178 int nvisuals; /* number of Visual types at this depth */
179 Visual* visuals; /* list of visuals possible at this depth */
182 alias XDisplay = Display;
184 struct Screen {
185 XExtData* ext_data; /* hook for extension to hang data */
186 XDisplay* display; /* back pointer to display structure */
187 Window root; /* Root window id. */
188 int width, height; /* width and height of screen */
189 int mwidth, mheight; /* width and height of in millimeters */
190 int ndepths; /* number of depths possible */
191 Depth* depths; /* list of allowable depths on the screen */
192 int root_depth; /* bits per pixel */
193 Visual* root_visual; /* root visual */
194 GC default_gc; /* GC for the root root visual */
195 Colormap cmap; /* default color map */
196 c_ulong white_pixel;
197 c_ulong black_pixel; /* White and Black pixel values */
198 int max_maps, min_maps; /* max and min color maps */
199 int backing_store; /* Never, WhenMapped, Always */
200 Bool save_unders;
201 c_long root_input_mask; /* initial root input mask */
205 * Format structure; describes ZFormat data the screen will understand.
207 struct ScreenFormat {
208 XExtData* ext_data; /* hook for extension to hang data */
209 int depth; /* depth of this image format */
210 int bits_per_pixel; /* bits/pixel at this depth */
211 int scanline_pad; /* scanline must padded to this multiple */
215 * Data structure for setting window attributes.
217 struct XSetWindowAttributes {
218 Pixmap background_pixmap; /* background or None or ParentRelative */
219 c_ulong background_pixel; /* background pixel */
220 Pixmap border_pixmap; /* border of the window */
221 c_ulong border_pixel; /* border pixel value */
222 int bit_gravity; /* one of bit gravity values */
223 int win_gravity; /* one of the window gravity values */
224 int backing_store; /* NotUseful, WhenMapped, Always */
225 c_ulong backing_planes; /* planes to be preseved if possible */
226 c_ulong backing_pixel; /* value to use in restoring planes */
227 Bool save_under; /* should bits under be saved? (popups) */
228 c_long event_mask; /* set of events that should be saved */
229 c_long do_not_propagate_mask; /* set of events that should not propagate */
230 Bool override_redirect; /* boolean value for override-redirect */
231 Colormap colormap; /* color map to be associated with window */
232 Cursor cursor; /* cursor to be displayed (or None) */
235 struct XWindowAttributes {
236 int x, y; /* location of window */
237 int width, height; /* width and height of window */
238 int border_width; /* border width of window */
239 int depth; /* depth of window */
240 Visual* visual; /* the associated visual structure */
241 Window root; /* root of screen containing window */
242 int c_class; /* InputOutput, InputOnly */
243 int bit_gravity; /* one of bit gravity values */
244 int win_gravity; /* one of the window gravity values */
245 int backing_store; /* NotUseful, WhenMapped, Always */
246 c_ulong backing_planes; /* planes to be preserved if possible */
247 c_ulong backing_pixel; /* value to be used when restoring planes */
248 Bool save_under; /* boolean, should bits under be saved? */
249 Colormap colormap; /* color map to be associated with window */
250 Bool map_installed; /* boolean, is color map currently installed */
251 int map_state; /* IsUnmapped, IsUnviewable, IsViewable */
252 c_long all_event_masks; /* set of events all people have interest in */
253 c_long your_event_mask; /* my event mask */
254 c_long do_not_propagate_mask; /* set of events that should not propagate */
255 Bool override_redirect; /* boolean value for override-redirect */
256 Screen* screen; /* back pointer to correct screen */
260 * Data structure for host setting; getting routines.
263 struct XHostAddress {
264 int family; /* for example FamilyInternet */
265 int length; /* length of address, in chars */
266 char* address; /* pointer to where to find the chars */
270 * Data structure for ServerFamilyInterpreted addresses in host routines
272 struct XServerInterpretedAddress {
273 int typelength; /* length of type string, in chars */
274 int valuelength; /* length of value string, in chars */
275 char* type; /* pointer to where to find the type string */
276 char* value; /* pointer to where to find the address */
279 struct XImage {
280 int width, height; /* size of image */
281 int xoffset; /* number of pixels offset in X direction */
282 int format; /* XYBitmap, XYPixmap, ZPixmap */
283 void* data; /* pointer to image data */
284 int byte_order; /* data byte order, LSBFirst, MSBFirst */
285 int bitmap_unit; /* quant. of scanline 8, 16, 32 */
286 int bitmap_bit_order; /* LSBFirst, MSBFirst */
287 int bitmap_pad; /* 8, 16, 32 either XY or ZPixmap */
288 int depth; /* depth of image */
289 int bytes_per_line; /* accelarator to next line */
290 int bits_per_pixel; /* bits per pixel (ZPixmap) */
291 c_ulong red_mask; /* bits in z arrangment */
292 c_ulong green_mask;
293 c_ulong blue_mask;
294 XPointer obdata; /* hook for the object routines to hang on */
295 /* image manipulation routines */
296 static struct F {
297 extern(C):
298 XImage* function (XDisplay* display, Visual* visual, uint depth, int format, int offset, void* data, uint width, uint height, int bitmap_pad, int chars_per_line) create_image;
299 int function (XImage*) destroy_image;
300 c_ulong function (XImage*, int, int) get_pixel;
301 int function (XImage*, int, int, c_ulong ) put_pixel;
302 XImage* function (XImage*, int, int, uint, uint) sub_image;
303 int function (XImage*, c_long) add_pixel;
305 F f;
309 * Data structure for XReconfigureWindow
311 struct XWindowChanges {
312 int x, y;
313 int width, height;
314 int border_width;
315 Window sibling;
316 int stack_mode;
321 * Data structure used by color operations
323 struct XColor {
324 c_ulong pixel;
325 ushort red, green, blue;
326 char flags; /* do_red, do_green, do_blue */
327 char pad;
331 * Data structures for graphics operations. On most machines, these are
332 * congruent with the wire protocol structures, so reformatting the data
333 * can be avoided on these architectures.
335 struct XSegment {
336 short x1, y1, x2, y2;
339 struct XPoint {
340 short x, y;
343 struct XRectangle {
344 short x, y;
345 ushort width, height;
348 struct XArc {
349 short x, y;
350 ushort width, height;
351 short angle1, angle2;
354 /* Data structure for XChangeKeyboardControl */
355 struct XKeyboardControl {
356 int key_click_percent;
357 int bell_percent;
358 int bell_pitch;
359 int bell_duration;
360 int led;
361 int led_mode;
362 int key;
363 int auto_repeat_mode; /* On, Off, Default */
366 /* Data structure for XGetKeyboardControl */
367 struct XKeyboardState {
368 int key_click_percent;
369 int bell_percent;
370 uint bell_pitch, bell_duration;
371 c_ulong led_mask;
372 int global_auto_repeat;
373 char[32] auto_repeats;
376 /* Data structure for XGetMotionEvents. */
377 struct XTimeCoord {
378 Time time;
379 short x, y;
382 /* Data structure for X{Set,Get}ModifierMapping */
383 struct XModifierKeymap {
384 int max_keypermod; /* The server's max # of keys per modifier */
385 KeyCode* modifiermap; /* An 8 by max_keypermod array of modifiers */
390 * Display datatype maintaining display specific data.
391 * The contents of this structure are implementation dependent.
392 * A Display should be treated as opaque by application code.
395 struct _XPrivate; /* Forward declare before use for C++ */
396 struct _XrmHashBucketRec;
398 struct _XDisplay {
399 XExtData* ext_data; /* hook for extension to hang data */
400 _XPrivate* private1;
401 int fd; /* Network socket. */
402 int private2;
403 int proto_major_version; /* major version of server's X protocol */
404 int proto_minor_version; /* minor version of servers X protocol */
405 char* vendor; /* vendor of the server hardware */
406 XID private3;
407 XID private4;
408 XID private5;
409 int private6;
410 extern (C) @trusted nothrow @nogc XID function(_XDisplay*) resource_alloc; /* allocator function */
411 int char_order; /* screen char order, LSBFirst, MSBFirst */
412 int bitmap_unit; /* padding and data requirements */
413 int bitmap_pad; /* padding requirements on bitmaps */
414 int bitmap_bit_order; /* LeastSignificant or MostSignificant */
415 int nformats; /* number of pixmap formats in list */
416 ScreenFormat* pixmap_format; /* pixmap format list */
417 int private8;
418 int release; /* release of the server */
419 _XPrivate* private9, private10;
420 int qlen; /* Length of input event queue */
421 c_ulong last_request_read; /* seq number of last event read */
422 c_ulong request; /* sequence number of last request. */
423 XPointer private11;
424 XPointer private12;
425 XPointer private13;
426 XPointer private14;
427 uint max_request_size; /* maximum number 32 bit words in request*/
428 _XrmHashBucketRec* db;
429 extern (C) @trusted nothrow @nogc int function (_XDisplay*) private15;
430 char* display_name; /* "host:display" string used on this connect*/
431 int default_screen; /* default screen for operations */
432 int nscreens; /* number of screens on this server*/
433 Screen* screens; /* pointer to list of screens */
434 c_ulong motion_buffer; /* size of motion buffer */
435 c_ulong private16;
436 int min_keycode; /* minimum defined keycode */
437 int max_keycode; /* maximum defined keycode */
438 XPointer private17;
439 XPointer private18;
440 int private19;
441 char* xdefaults; /* contents of defaults from server */
442 /* there is more to this structure, but it is private to Xlib */
444 alias Display = _XDisplay;
445 alias _XPrivDisplay = _XDisplay*;
447 struct XKeyEvent {
448 int type; /* of event */
449 c_ulong serial; /* # of last request processed by server */
450 Bool send_event; /* true if this came from a SendEvent request */
451 Display* display; /* Display the event was read from */
452 Window window; /* "event" window it is reported relative to */
453 Window root; /* root window that the event occurred on */
454 Window subwindow; /* child window */
455 Time time; /* milliseconds */
456 int x, y; /* pointer x, y coordinates in event window */
457 int x_root, y_root; /* coordinates relative to root */
458 uint state; /* key or button mask */
459 uint keycode; /* detail */
460 Bool same_screen; /* same screen flag */
463 alias XKeyPressedEvent = XKeyEvent;
464 alias XKeyReleasedEvent = XKeyEvent;
466 struct XButtonEvent {
467 int type; /* of event */
468 c_ulong serial; /* # of last request processed by server */
469 Bool send_event; /* true if this came from a SendEvent request */
470 Display* display; /* Display the event was read from */
471 Window window; /* "event" window it is reported relative to */
472 Window root; /* root window that the event occurred on */
473 Window subwindow; /* child window */
474 Time time; /* milliseconds */
475 int x, y; /* pointer x, y coordinates in event window */
476 int x_root, y_root; /* coordinates relative to root */
477 uint state; /* key or button mask */
478 uint button; /* detail */
479 Bool same_screen; /* same screen flag */
481 alias XButtonPressedEvent = XButtonEvent;
482 alias XButtonReleasedEvent = XButtonEvent;
484 struct XMotionEvent {
485 int type; /* of event */
486 c_ulong serial; /* # of last request processed by server */
487 Bool send_event; /* true if this came from a SendEvent request */
488 Display* display; /* Display the event was read from */
489 Window window; /* "event" window reported relative to */
490 Window root; /* root window that the event occurred on */
491 Window subwindow; /* child window */
492 Time time; /* milliseconds */
493 int x, y; /* pointer x, y coordinates in event window */
494 int x_root, y_root; /* coordinates relative to root */
495 uint state; /* key or button mask */
496 char is_hint; /* detail */
497 Bool same_screen; /* same screen flag */
499 alias XPointerMovedEvent = XMotionEvent;
501 struct XCrossingEvent {
502 int type; /* of event */
503 c_ulong serial; /* # of last request processed by server */
504 Bool send_event; /* true if this came from a SendEvent request */
505 Display* display; /* Display the event was read from */
506 Window window; /* "event" window reported relative to */
507 Window root; /* root window that the event occurred on */
508 Window subwindow; /* child window */
509 Time time; /* milliseconds */
510 int x, y; /* pointer x, y coordinates in event window */
511 int x_root, y_root; /* coordinates relative to root */
512 int mode; /* NotifyNormal, NotifyGrab, NotifyUngrab */
513 int detail;
515 * NotifyAncestor, NotifyVirtual, NotifyInferior,
516 * NotifyNonlinear,NotifyNonlinearVirtual
518 Bool same_screen; /* same screen flag */
519 Bool focus; /* boolean focus */
520 uint state; /* key or button mask */
522 alias XEnterWindowEvent = XCrossingEvent;
523 alias XLeaveWindowEvent = XCrossingEvent;
525 struct XFocusChangeEvent {
526 int type; /* FocusIn or FocusOut */
527 c_ulong serial; /* # of last request processed by server */
528 Bool send_event; /* true if this came from a SendEvent request */
529 Display* display; /* Display the event was read from */
530 Window window; /* window of event */
531 int mode; /* NotifyNormal, NotifyWhileGrabbed,*/
532 /* NotifyGrab, NotifyUngrab */
533 int detail;
535 * NotifyAncestor, NotifyVirtual, NotifyInferior,
536 * NotifyNonlinear,NotifyNonlinearVirtual, NotifyPointer,
537 * NotifyPointerRoot, NotifyDetailNone
540 alias XFocusInEvent = XFocusChangeEvent;
541 alias XFocusOutEvent = XFocusChangeEvent;
543 /* generated on EnterWindow and FocusIn when KeyMapState selected */
544 struct XKeymapEvent {
545 int type;
546 c_ulong serial; /* # of last request processed by server */
547 Bool send_event; /* true if this came from a SendEvent request */
548 Display* display; /* Display the event was read from */
549 Window window;
550 char[32] key_vector;
553 struct XExposeEvent {
554 int type;
555 c_ulong serial; /* # of last request processed by server */
556 Bool send_event; /* true if this came from a SendEvent request */
557 Display* display; /* Display the event was read from */
558 Window window;
559 int x, y;
560 int width, height;
561 int count; /* if non-zero, at least this many more */
564 struct XGraphicsExposeEvent {
565 int type;
566 c_ulong serial; /* # of last request processed by server */
567 Bool send_event; /* true if this came from a SendEvent request */
568 Display* display; /* Display the event was read from */
569 Drawable drawable;
570 int x, y;
571 int width, height;
572 int count; /* if non-zero, at least this many more */
573 int major_code; /* core is CopyArea or CopyPlane */
574 int minor_code; /* not defined in the core */
577 struct XNoExposeEvent {
578 int type;
579 c_ulong serial; /* # of last request processed by server */
580 Bool send_event; /* true if this came from a SendEvent request */
581 Display* display; /* Display the event was read from */
582 Drawable drawable;
583 int major_code; /* core is CopyArea or CopyPlane */
584 int minor_code; /* not defined in the core */
587 struct XVisibilityEvent {
588 int type;
589 c_ulong serial; /* # of last request processed by server */
590 Bool send_event; /* true if this came from a SendEvent request */
591 Display* display; /* Display the event was read from */
592 Window window;
593 int state; /* Visibility state */
596 struct XCreateWindowEvent {
597 int type;
598 c_ulong serial; /* # of last request processed by server */
599 Bool send_event; /* true if this came from a SendEvent request */
600 Display* display; /* Display the event was read from */
601 Window parent; /* parent of the window */
602 Window window; /* window id of window created */
603 int x, y; /* window location */
604 int width, height; /* size of window */
605 int border_width; /* border width */
606 Bool override_redirect; /* creation should be overridden */
609 struct XDestroyWindowEvent {
610 int type;
611 c_ulong serial; /* # of last request processed by server */
612 Bool send_event; /* true if this came from a SendEvent request */
613 Display* display; /* Display the event was read from */
614 Window event;
615 Window window;
618 struct XUnmapEvent {
619 int type;
620 c_ulong serial; /* # of last request processed by server */
621 Bool send_event; /* true if this came from a SendEvent request */
622 Display* display; /* Display the event was read from */
623 Window event;
624 Window window;
625 Bool from_configure;
628 struct XMapEvent {
629 int type;
630 c_ulong serial; /* # of last request processed by server */
631 Bool send_event; /* true if this came from a SendEvent request */
632 Display* display; /* Display the event was read from */
633 Window event;
634 Window window;
635 Bool override_redirect; /* boolean, is override set... */
638 struct XMapRequestEvent {
639 int type;
640 c_ulong serial; /* # of last request processed by server */
641 Bool send_event; /* true if this came from a SendEvent request */
642 Display* display; /* Display the event was read from */
643 Window parent;
644 Window window;
647 struct XReparentEvent {
648 int type;
649 c_ulong serial; /* # of last request processed by server */
650 Bool send_event; /* true if this came from a SendEvent request */
651 Display* display; /* Display the event was read from */
652 Window event;
653 Window window;
654 Window parent;
655 int x, y;
656 Bool override_redirect;
659 struct XConfigureEvent {
660 int type;
661 c_ulong serial; /* # of last request processed by server */
662 Bool send_event; /* true if this came from a SendEvent request */
663 Display* display; /* Display the event was read from */
664 Window event;
665 Window window;
666 int x, y;
667 int width, height;
668 int border_width;
669 Window above;
670 Bool override_redirect;
673 struct XGravityEvent {
674 int type;
675 c_ulong serial; /* # of last request processed by server */
676 Bool send_event; /* true if this came from a SendEvent request */
677 Display* display; /* Display the event was read from */
678 Window event;
679 Window window;
680 int x, y;
683 struct XResizeRequestEvent {
684 int type;
685 c_ulong serial; /* # of last request processed by server */
686 Bool send_event; /* true if this came from a SendEvent request */
687 Display* display; /* Display the event was read from */
688 Window window;
689 int width, height;
692 struct XConfigureRequestEvent {
693 int type;
694 c_ulong serial; /* # of last request processed by server */
695 Bool send_event; /* true if this came from a SendEvent request */
696 Display* display; /* Display the event was read from */
697 Window parent;
698 Window window;
699 int x, y;
700 int width, height;
701 int border_width;
702 Window above;
703 int detail; /* Above, Below, TopIf, BottomIf, Opposite */
704 uint value_mask;
707 struct XCirculateEvent {
708 int type;
709 c_ulong serial; /* # of last request processed by server */
710 Bool send_event; /* true if this came from a SendEvent request */
711 Display* display; /* Display the event was read from */
712 Window event;
713 Window window;
714 int place; /* PlaceOnTop, PlaceOnBottom */
717 struct XCirculateRequestEvent {
718 int type;
719 c_ulong serial; /* # of last request processed by server */
720 Bool send_event; /* true if this came from a SendEvent request */
721 Display* display; /* Display the event was read from */
722 Window parent;
723 Window window;
724 int place; /* PlaceOnTop, PlaceOnBottom */
727 struct XPropertyEvent {
728 int type;
729 c_ulong serial; /* # of last request processed by server */
730 Bool send_event; /* true if this came from a SendEvent request */
731 Display* display; /* Display the event was read from */
732 Window window;
733 Atom atom;
734 Time time;
735 int state; /* NewValue, Deleted */
738 struct XSelectionClearEvent {
739 int type;
740 c_ulong serial; /* # of last request processed by server */
741 Bool send_event; /* true if this came from a SendEvent request */
742 Display* display; /* Display the event was read from */
743 Window window;
744 Atom selection;
745 Time time;
748 struct XSelectionRequestEvent {
749 int type;
750 c_ulong serial; /* # of last request processed by server */
751 Bool send_event; /* true if this came from a SendEvent request */
752 Display* display; /* Display the event was read from */
753 Window owner;
754 Window requestor;
755 Atom selection;
756 Atom target;
757 Atom property;
758 Time time;
761 struct XSelectionEvent {
762 int type;
763 c_ulong serial; /* # of last request processed by server */
764 Bool send_event; /* true if this came from a SendEvent request */
765 Display* display; /* Display the event was read from */
766 Window requestor;
767 Atom selection;
768 Atom target;
769 Atom property; /* ATOM or None */
770 Time time;
773 struct XColormapEvent {
774 int type;
775 c_ulong serial; /* # of last request processed by server */
776 Bool send_event; /* true if this came from a SendEvent request */
777 Display* display; /* Display the event was read from */
778 Window window;
779 Colormap colormap; /* COLORMAP or None */
780 Bool c_new; /* C++ */
781 int state; /* ColormapInstalled, ColormapUninstalled */
784 struct XClientMessageEvent {
785 int type;
786 c_ulong serial; /* # of last request processed by server */
787 Bool send_event; /* true if this came from a SendEvent request */
788 Display* display; /* Display the event was read from */
789 Window window;
790 Atom message_type;
791 int format;
792 union _data {
793 char[20] b;
794 short[10] s;
795 c_long[5] l;
797 _data data;
800 struct XMappingEvent {
801 int type;
802 c_ulong serial; /* # of last request processed by server */
803 Bool send_event; /* true if this came from a SendEvent request */
804 Display* display; /* Display the event was read from */
805 Window window; /* unused */
806 int request; /* one of MappingModifier, MappingKeyboard, MappingPointer */
807 int first_keycode; /* first keycode */
808 int count; /* defines range of change w. first_keycode */
811 struct XErrorEvent {
812 int type;
813 Display* display; /* Display the event was read from */
814 XID resourceid; /* resource id */
815 c_ulong serial; /* serial number of failed request */
816 ubyte error_code; /* error code of failed request */
817 ubyte request_code; /* Major op-code of failed request */
818 ubyte minor_code; /* Minor op-code of failed request */
821 struct XAnyEvent {
822 int type;
823 c_ulong serial; /* # of last request processed by server */
824 Bool send_event; /* true if this came from a SendEvent request */
825 Display* display; /* Display the event was read from */
826 Window window; /* window on which event was requested in event mask */
830 /***************************************************************
832 * GenericEvent. This event is the standard event for all newer extensions.
835 struct XGenericEvent {
836 int type; /* of event. Always GenericEvent */
837 c_ulong serial; /* # of last request processed */
838 Bool send_event; /* true if from SendEvent request */
839 Display* display; /* Display the event was read from */
840 int extension; /* major opcode of extension that caused the event */
841 int evtype; /* actual event type. */
844 struct XGenericEventCookie {
845 int type; /* of event. Always GenericEvent */
846 c_ulong serial; /* # of last request processed */
847 Bool send_event; /* true if from SendEvent request */
848 Display* display; /* Display the event was read from */
849 int extension; /* major opcode of extension that caused the event */
850 int evtype; /* actual event type. */
851 uint cookie;
852 void* data;
856 * this union is defined so Xlib can always use the same sized
857 * event structure internally, to avoid memory fragmentation.
859 union XEvent {
860 int type; /* must not be changed; first element */
861 XAnyEvent xany;
862 XKeyEvent xkey;
863 XButtonEvent xbutton;
864 XMotionEvent xmotion;
865 XCrossingEvent xcrossing;
866 XFocusChangeEvent xfocus;
867 XExposeEvent xexpose;
868 XGraphicsExposeEvent xgraphicsexpose;
869 XNoExposeEvent xnoexpose;
870 XVisibilityEvent xvisibility;
871 XCreateWindowEvent xcreatewindow;
872 XDestroyWindowEvent xdestroywindow;
873 XUnmapEvent xunmap;
874 XMapEvent xmap;
875 XMapRequestEvent xmaprequest;
876 XReparentEvent xreparent;
877 XConfigureEvent xconfigure;
878 XGravityEvent xgravity;
879 XResizeRequestEvent xresizerequest;
880 XConfigureRequestEvent xconfigurerequest;
881 XCirculateEvent xcirculate;
882 XCirculateRequestEvent xcirculaterequest;
883 XPropertyEvent xproperty;
884 XSelectionClearEvent xselectionclear;
885 XSelectionRequestEvent xselectionrequest;
886 XSelectionEvent xselection;
887 XColormapEvent xcolormap;
888 XClientMessageEvent xclient;
889 XMappingEvent xmapping;
890 XErrorEvent xerror;
891 XKeymapEvent xkeymap;
892 XGenericEvent xgeneric;
893 XGenericEventCookie xcookie;
894 c_long[24] pad;
897 int XAllocID (Display* dpy) { return cast(int)dpy.resource_alloc(dpy); }
900 * per character font metric information.
902 struct XCharStruct {
903 short lbearing; /* origin to left edge of raster */
904 short rbearing; /* origin to right edge of raster */
905 short width; /* advance to next char's origin */
906 short ascent; /* baseline to top edge of raster */
907 short descent; /* baseline to bottom edge of raster */
908 ushort attributes; /* per char flags (not predefined) */
912 * To allow arbitrary information with fonts, there are additional properties
913 * returned.
915 struct XFontProp {
916 Atom name;
917 c_ulong card32;
920 struct XFontStruct {
921 XExtData* ext_data; /* hook for extension to hang data */
922 Font fid; /* Font id for this font */
923 uint direction; /* hint about direction the font is painted */
924 uint min_char_or_char2; /* first character */
925 uint max_char_or_char2; /* last character */
926 uint min_char1; /* first row that exists */
927 uint max_char1; /* last row that exists */
928 Bool all_chars_exist; /* flag if all characters have non-zero size */
929 uint default_char; /* char to print for undefined character */
930 int n_properties; /* how many properties there are */
931 XFontProp* properties; /* pointer to array of additional properties */
932 XCharStruct min_bounds; /* minimum bounds over all existing char */
933 XCharStruct max_bounds; /* maximum bounds over all existing char */
934 XCharStruct* per_char; /* first_char to last_char information */
935 int ascent; /* log. extent above baseline for spacing */
936 int descent; /* log. descent below baseline for spacing */
940 * PolyText routines take these as arguments.
942 struct XTextItem {
943 char* chars; /* pointer to string */
944 int nchars; /* number of characters */
945 int delta; /* delta between strings */
946 Font font; /* font to print it in, None don't change */
949 /* normal 16 bit characters are two chars */
950 align(1) struct XChar2b {
951 align(1):
952 ubyte char1;
953 ubyte char2;
956 struct XTextItem16 {
957 XChar2b* chars; /* two char characters */
958 int nchars; /* number of characters */
959 int delta; /* delta between strings */
960 Font font; /* font to print it in, None don't change */
963 union XEDataObject {
964 Display* display;
965 GC gc;
966 Visual* visual;
967 Screen* screen;
968 ScreenFormat* pixmap_format;
969 XFontStruct* font;
972 struct XFontSetExtents{
973 XRectangle max_ink_extent;
974 XRectangle max_logical_extent;
977 /* unused:
978 void (*XOMProc)();
981 struct _XOM {}
982 struct _XOC {}
983 alias XOM = _XOM*;
984 alias XOC = _XOC*;
985 alias XFontSet = _XOC*;
987 struct XmbTextItem {
988 char* chars;
989 int nchars;
990 int delta;
991 XFontSet font_set;
994 struct XwcTextItem {
995 wchar_t* chars;
996 int nchars;
997 int delta;
998 XFontSet font_set;
1001 enum {
1002 XNRequiredCharSet = "requiredCharSet",
1003 XNQueryOrientation = "queryOrientation",
1004 XNBaseFontName = "baseFontName",
1005 XNOMAutomatic = "omAutomatic",
1006 XNMissingCharSet = "missingCharSet",
1007 XNDefaultString = "defaultString",
1008 XNOrientation = "orientation",
1009 XNDirectionalDependentDrawing = "directionalDependentDrawing",
1010 XNContextualDrawing = "contextualDrawing",
1011 XNFontInfo = "fontInfo",
1014 struct XOMCharSetList {
1015 int charset_count;
1016 char** charset_list;
1019 alias XOrientation = int;
1020 enum {
1021 XOMOrientation_LTR_TTB,
1022 XOMOrientation_RTL_TTB,
1023 XOMOrientation_TTB_LTR,
1024 XOMOrientation_TTB_RTL,
1025 XOMOrientation_Context,
1028 struct XOMOrientation {
1029 int num_orientation;
1030 XOrientation* orientation; /* Input Text description */
1033 struct XOMFontInfo{
1034 int num_font;
1035 XFontStruct **font_struct_list;
1036 char** font_name_list;
1039 struct _XIM {}
1040 struct _XIC {}
1041 alias XIM = _XIM*;
1042 alias XIC = _XIC*;
1044 alias XIMProc = void function (
1045 XIM,
1046 XPointer,
1047 XPointer
1050 alias XICProc = Bool function (
1051 XIC,
1052 XPointer,
1053 XPointer
1056 alias XIDProc = void function (
1057 Display*,
1058 XPointer,
1059 XPointer
1062 struct XIMStyles {
1063 ushort count_styles;
1064 XIMStyle* supported_styles;
1067 alias XIMStyle = c_ulong;
1068 enum : c_ulong {
1069 XIMPreeditArea = 0x0001,
1070 XIMPreeditCallbacks = 0x0002,
1071 XIMPreeditPosition = 0x0004,
1072 XIMPreeditNothing = 0x0008,
1073 XIMPreeditNone = 0x0010,
1074 XIMStatusArea = 0x0100,
1075 XIMStatusCallbacks = 0x0200,
1076 XIMStatusNothing = 0x0400,
1077 XIMStatusNone = 0x0800,
1080 enum {
1081 XNVaNestedList = "XNVaNestedList",
1082 XNQueryInputStyle = "queryInputStyle",
1083 XNClientWindow = "clientWindow",
1084 XNInputStyle = "inputStyle",
1085 XNFocusWindow = "focusWindow",
1086 XNResourceName = "resourceName",
1087 XNResourceClass = "resourceClass",
1088 XNGeometryCallback = "geometryCallback",
1089 XNDestroyCallback = "destroyCallback",
1090 XNFilterEvents = "filterEvents",
1091 XNPreeditStartCallback = "preeditStartCallback",
1092 XNPreeditDoneCallback = "preeditDoneCallback",
1093 XNPreeditDrawCallback = "preeditDrawCallback",
1094 XNPreeditCaretCallback = "preeditCaretCallback",
1095 XNPreeditStateNotifyCallback = "preeditStateNotifyCallback",
1096 XNPreeditAttributes = "preeditAttributes",
1097 XNStatusStartCallback = "statusStartCallback",
1098 XNStatusDoneCallback = "statusDoneCallback",
1099 XNStatusDrawCallback = "statusDrawCallback",
1100 XNStatusAttributes = "statusAttributes",
1101 XNArea = "area",
1102 XNAreaNeeded = "areaNeeded",
1103 XNSpotLocation = "spotLocation",
1104 XNColormap = "colorMap",
1105 XNStdColormap = "stdColorMap",
1106 XNForeground = "foreground",
1107 XNBackground = "background",
1108 XNBackgroundPixmap = "backgroundPixmap",
1109 XNFontSet = "fontSet",
1110 XNLineSpace = "lineSpace",
1111 XNCursor = "cursor",
1113 XNQueryIMValuesList = "queryIMValuesList",
1114 XNQueryICValuesList = "queryICValuesList",
1115 XNVisiblePosition = "visiblePosition",
1116 XNR6PreeditCallback = "r6PreeditCallback",
1117 XNStringConversionCallback = "stringConversionCallback",
1118 XNStringConversion = "stringConversion",
1119 XNResetState = "resetState",
1120 XNHotKey = "hotKey",
1121 XNHotKeyState = "hotKeyState",
1122 XNPreeditState = "preeditState",
1123 XNSeparatorofNestedList = "separatorofNestedList",
1126 enum int XBufferOverflow = -1;
1127 enum int XLookupNone = 1;
1128 enum int XLookupChars = 2;
1129 enum int XLookupKeySym = 3;
1130 enum int XLookupBoth = 4;
1132 void* XVaNestedList;
1134 struct XIMCallback {
1135 XPointer client_data;
1136 XIMProc callback;
1139 struct XICCallback {
1140 XPointer client_data;
1141 XICProc callback;
1144 alias XIMFeedback = int;
1145 enum {
1146 XIMReverse = 1,
1147 XIMUnderline = (1<<1),
1148 XIMHighlight = (1<<2),
1149 XIMPrimary = (1<<5),
1150 XIMSecondary = (1<<6),
1151 XIMTertiary = (1<<7),
1152 XIMVisibleToForward = (1<<8),
1153 XIMVisibleToBackword = (1<<9),
1154 XIMVisibleToCenter = (1<<10),
1157 struct XIMText {
1158 ushort length;
1159 XIMFeedback* feedback;
1160 Bool encoding_is_wchar;
1161 union c_string {
1162 char* multi_char;
1163 wchar_t* wide_char;
1168 alias XIMPreeditState = c_ulong;
1169 enum {
1170 XIMPreeditUnKnown = 0,
1171 XIMPreeditEnable = 1,
1172 XIMPreeditDisable = (1<<1),
1175 struct XIMPreeditStateNotifyCallbackStruct {
1176 XIMPreeditState state;
1179 alias XIMResetState = c_ulong;
1180 enum {
1181 XIMInitialState = 1,
1182 XIMPreserveState = 1<<1
1185 alias XIMStringConversionFeedback = c_ulong;
1186 enum {
1187 XIMStringConversionLeftEdge = 0x00000001,
1188 XIMStringConversionRightEdge = 0x00000002,
1189 XIMStringConversionTopEdge = 0x00000004,
1190 XIMStringConversionBottomEdge = 0x00000008,
1191 XIMStringConversionConcealed = 0x00000010,
1192 XIMStringConversionWrapped = 0x00000020,
1195 struct XIMStringConversionText{
1196 ushort length;
1197 XIMStringConversionFeedback* feedback;
1198 Bool encoding_is_wchar;
1199 union c_string{
1200 char* mbs;
1201 wchar_t* wcs;
1205 alias XIMStringConversionPosition = ushort;
1207 alias XIMStringConversionType = ushort;
1208 enum {
1209 XIMStringConversionBuffer = 0x0001,
1210 XIMStringConversionLine = 0x0002,
1211 XIMStringConversionWord = 0x0003,
1212 XIMStringConversionChar = 0x0004,
1215 alias XIMStringConversionOperation = ushort;
1216 enum {
1217 XIMStringConversionSubstitution = 0x0001,
1218 XIMStringConversionRetrieval = 0x0002,
1221 alias XIMCaretDirection = int;
1222 enum {
1223 XIMForwardChar, XIMBackwardChar,
1224 XIMForwardWord, XIMBackwardWord,
1225 XIMCaretUp, XIMCaretDown,
1226 XIMNextLine, XIMPreviousLine,
1227 XIMLineStart, XIMLineEnd,
1228 XIMAbsolutePosition,
1229 XIMDontChange
1232 struct XIMStringConversionCallbackStruct {
1233 XIMStringConversionPosition position;
1234 XIMCaretDirection direction;
1235 XIMStringConversionOperation operation;
1236 ushort factor;
1237 XIMStringConversionText* text;
1240 struct XIMPreeditDrawCallbackStruct{
1241 int caret; /* Cursor offset within pre-edit string */
1242 int chg_first; /* Starting change position */
1243 int chg_length; /* Length of the change in character count */
1244 XIMText* text;
1247 alias XIMCaretStyle = int;
1248 enum {
1249 XIMIsInvisible, /* Disable caret feedback */
1250 XIMIsPrimary, /* UI defined caret feedback */
1251 XIMIsSecondary /* UI defined caret feedback */
1254 struct XIMPreeditCaretCallbackStruct {
1255 int position; /* Caret offset within pre-edit string */
1256 XIMCaretDirection direction; /* Caret moves direction */
1257 XIMCaretStyle style; /* Feedback of the caret */
1260 alias XIMStatusDataType = int;
1261 enum {
1262 XIMTextType,
1263 XIMBitmapType
1266 struct XIMStatusDrawCallbackStruct {
1267 XIMStatusDataType type;
1268 union data {
1269 XIMText* text;
1270 Pixmap bitmap;
1274 struct XIMHotKeyTrigger {
1275 KeySym keysym;
1276 int modifier;
1277 int modifier_mask;
1280 struct XIMHotKeyTriggers {
1281 int num_hot_key;
1282 XIMHotKeyTrigger* key;
1285 alias XIMHotKeyState = c_ulong;
1286 enum : c_ulong {
1287 XIMHotKeyStateON = 0x0001,
1288 XIMHotKeyStateOFF = 0x0002,
1291 struct XIMValuesList {
1292 ushort count_values;
1293 char** supported_values;
1296 version (Windows) {
1297 extern int *_Xdebug_p;
1298 } else {
1299 extern int _Xdebug;
1302 XFontStruct* XLoadQueryFont(
1303 Display* display,
1304 const(char)* name
1307 XFontStruct* XQueryFont(
1308 Display* display,
1309 XID font_ID
1313 XTimeCoord* XGetMotionEvents(
1314 Display* display,
1315 Window w,
1316 Time start,
1317 Time stop,
1318 int* nevents_return
1321 XModifierKeymap* XDeleteModifiermapEntry(
1322 XModifierKeymap* modmap,
1323 KeyCode keycode_entry,
1324 int modifier
1327 XModifierKeymap* XGetModifierMapping(
1328 Display* display
1331 XModifierKeymap* XInsertModifiermapEntry(
1332 XModifierKeymap* modmap,
1333 KeyCode keycode_entry,
1334 int modifier
1337 XModifierKeymap* XNewModifiermap(
1338 int max_keys_per_mod
1341 XImage* XCreateImage(
1342 Display* display,
1343 Visual* visual,
1344 uint depth,
1345 int format,
1346 int offset,
1347 void* data,
1348 uint width,
1349 uint height,
1350 int bitmap_pad,
1351 int chars_per_line
1353 Status XInitImage(
1354 XImage* image
1356 XImage* XGetImage(
1357 Display* display,
1358 Drawable d,
1359 int x,
1360 int y,
1361 uint width,
1362 uint height,
1363 c_ulong plane_mask,
1364 int format
1366 XImage* XGetSubImage(
1367 Display* display,
1368 Drawable d,
1369 int x,
1370 int y,
1371 uint width,
1372 uint height,
1373 c_ulong plane_mask,
1374 int format,
1375 XImage* dest_image,
1376 int dest_x,
1377 int dest_y
1381 * X function declarations.
1383 Display* XOpenDisplay(
1384 const(char)*dpname=null /*display_name*/
1387 void XrmInitialize( );
1389 char* XFetchchars(
1390 Display* display,
1391 int* nchars_return
1393 char* XFetchBuffer(
1394 Display* display,
1395 int* nchars_return,
1396 int buffer
1398 char* XGetAtomName(
1399 Display* display,
1400 Atom atom
1402 Status XGetAtomNames(
1403 Display* dpy,
1404 Atom* atoms,
1405 int count,
1406 char** names_return
1408 char* XGetDefault(
1409 Display* display,
1410 char* program,
1411 char* option
1413 char* XDisplayName(
1414 char* string
1416 char* XKeysymToString(
1417 KeySym keysym
1420 int function(
1421 Display* display
1422 )XSynchronize(
1423 Display* display,
1424 Bool onoff
1426 int function(
1427 Display* display
1428 )XSetAfterFunction(
1429 Display* display,
1430 int function(
1431 Display* display
1432 ) procedure
1434 Atom XInternAtom(
1435 Display* display,
1436 const(char)* atom_name,
1437 Bool only_if_exists
1439 Status XInternAtoms(
1440 Display* dpy,
1441 const(const(char)*)* names,
1442 int count,
1443 Bool onlyIfExists,
1444 Atom* atoms_return
1446 Colormap XCopyColormapAndFree(
1447 Display* display,
1448 Colormap colormap
1450 Colormap XCreateColormap(
1451 Display* display,
1452 Window w,
1453 Visual* visual,
1454 int alloc
1456 Cursor XCreatePixmapCursor(
1457 Display* display,
1458 Pixmap source,
1459 Pixmap mask,
1460 XColor* foreground_color,
1461 XColor* background_color,
1462 uint x,
1463 uint y
1465 Cursor XCreateGlyphCursor(
1466 Display* display,
1467 Font source_font,
1468 Font mask_font,
1469 uint* source_char, //FIXME
1470 uint* mask_char, //FIXME
1471 XColor* foreground_color,
1472 XColor* background_color
1474 Cursor XCreateFontCursor(
1475 Display* display,
1476 uint shape
1478 Font XLoadFont(
1479 Display* display,
1480 const(char)* name
1482 GC XCreateGC(
1483 Display* display,
1484 Drawable d,
1485 c_ulong valuemask,
1486 XGCValues* values
1488 GContext XGContextFromGC(
1489 GC gc
1491 void XFlushGC(
1492 Display* display,
1493 GC gc
1495 Pixmap XCreatePixmap(
1496 Display* display,
1497 Drawable d,
1498 uint width,
1499 uint height,
1500 uint depth
1502 Pixmap XCreateBitmapFromData(
1503 Display* display,
1504 Drawable d,
1505 const(char)* data,
1506 uint width,
1507 uint height
1509 Pixmap XCreatePixmapFromBitmapData(
1510 Display* display,
1511 Drawable d,
1512 const(char)* data,
1513 uint width,
1514 uint height,
1515 c_ulong fg,
1516 c_ulong bg,
1517 uint depth
1519 Window XCreateSimpleWindow(
1520 Display* display,
1521 Window parent,
1522 int x,
1523 int y,
1524 uint width,
1525 uint height,
1526 uint border_width,
1527 c_ulong border,
1528 uint background
1530 Window XGetSelectionOwner(
1531 Display* display,
1532 Atom selection
1534 Window XCreateWindow(
1535 Display* display,
1536 Window parent,
1537 int x,
1538 int y,
1539 uint width,
1540 uint height,
1541 uint border_width,
1542 int depth,
1543 uint klass,
1544 Visual* visual,
1545 c_ulong valuemask,
1546 XSetWindowAttributes* attributes
1548 Colormap* XListInstalledColormaps(
1549 Display* display,
1550 Window w,
1551 int* num_return
1553 char** XListFonts(
1554 Display* display,
1555 const(char)* pattern,
1556 int maxnames,
1557 int* actual_count_return
1559 char* XListFontsWithInfo(
1560 Display* display,
1561 const(char)* pattern,
1562 int maxnames,
1563 int* count_return,
1564 XFontStruct** info_return
1566 char** XGetFontPath(
1567 Display* display,
1568 int* npaths_return
1570 char** XListExtensions(
1571 Display* display,
1572 int* nextensions_return
1574 Atom* XListProperties(
1575 Display* display,
1576 Window w,
1577 int* num_prop_return
1579 XHostAddress* XListHosts(
1580 Display* display,
1581 int* nhosts_return,
1582 Bool* state_return
1584 KeySym XKeycodeToKeysym(
1585 Display* display,
1586 KeyCode keycode,
1587 int index
1589 KeySym XLookupKeysym(
1590 XKeyEvent* key_event,
1591 int index
1593 KeySym* XGetKeyboardMapping(
1594 Display* display,
1595 KeyCode first_keycode,
1596 int keycode_count,
1597 int* keysyms_per_keycode_return
1599 KeySym XStringToKeysym(
1600 const(char)* string
1602 c_long XMaxRequestSize(
1603 Display* display
1605 c_long XExtendedMaxRequestSize(
1606 Display* display
1608 char* XResourceManagerString(
1609 Display* display
1611 char* XScreenResourceString(
1612 Screen* screen
1614 c_ulong XDisplayMotionBufferSize(
1615 Display* display
1617 VisualID XVisualIDFromVisual(
1618 Visual* visual
1621 /* multithread routines */
1623 Status XInitThreads( );
1625 void XLockDisplay(
1626 Display* display
1629 void XUnlockDisplay(
1630 Display* display
1633 /* routines for dealing with extensions */
1635 XExtCodes* XInitExtension(
1636 Display* display,
1637 const(char)* name
1640 XExtCodes* XAddExtension(
1641 Display* display
1643 XExtData* XFindOnExtensionList(
1644 XExtData** structure,
1645 int number
1647 XExtData **XEHeadOfExtensionList(
1648 XEDataObject object
1651 /* these are routines for which there are also macros */
1652 Window XRootWindow(
1653 Display* display,
1654 int screen_number
1656 Window XDefaultRootWindow(
1657 Display* display
1659 Window XRootWindowOfScreen(
1660 Screen* screen
1662 Visual* XDefaultVisual(
1663 Display* display,
1664 int screen_number
1666 Visual* XDefaultVisualOfScreen(
1667 Screen* screen
1669 GC XDefaultGC(
1670 Display* display,
1671 int screen_number
1673 GC XDefaultGCOfScreen(
1674 Screen* screen
1676 c_ulong XBlackPixel(
1677 Display* display,
1678 int screen_number
1680 c_ulong XWhitePixel(
1681 Display* display,
1682 int screen_number
1684 c_ulong XAllPlanes( );
1685 c_ulong XBlackPixelOfScreen(
1686 Screen* screen
1688 c_ulong XWhitePixelOfScreen(
1689 Screen* screen
1691 uint XNextRequest(
1692 Display* display
1694 uint XLastKnownRequestProcessed(
1695 Display* display
1697 char* XServerVendor(
1698 Display* display
1700 char* XDisplayString(
1701 Display* display
1703 Colormap XDefaultColormap(
1704 Display* display,
1705 int screen_number
1707 Colormap XDefaultColormapOfScreen(
1708 Screen* screen
1710 Display* XDisplayOfScreen(
1711 Screen* screen
1713 Screen* XScreenOfDisplay(
1714 Display* display,
1715 int screen_number
1717 Screen* XDefaultScreenOfDisplay(
1718 Display* display
1720 c_long XEventMaskOfScreen(
1721 Screen* screen
1724 int XScreenNumberOfScreen(
1725 Screen* screen
1728 alias XErrorHandler = int function ( /* WARNING, this type not in Xlib spec */
1729 Display* display,
1730 XErrorEvent* error_event
1733 XErrorHandler XSetErrorHandler (
1734 XErrorHandler handler
1737 //XIOErrorHandler: see at the top
1738 XIOErrorHandler XSetIOErrorHandler (
1739 XIOErrorHandler handler
1743 XPixmapFormatValues* XListPixmapFormats(
1744 Display* display,
1745 int* count_return
1747 int* XListDepths(
1748 Display* display,
1749 int screen_number,
1750 int* count_return
1753 /* ICCCM routines for things that don't require special include files; */
1754 /* other declarations are given in Xutil.h */
1755 Status XReconfigureWMWindow(
1756 Display* display,
1757 Window w,
1758 int screen_number,
1759 uint mask,
1760 XWindowChanges* changes
1763 Status XGetWMProtocols(
1764 Display* display,
1765 Window w,
1766 Atom** protocols_return,
1767 int* count_return
1769 Status XSetWMProtocols(
1770 Display* display,
1771 Window w,
1772 Atom* protocols,
1773 int count
1775 Status XIconifyWindow(
1776 Display* display,
1777 Window w,
1778 int screen_number
1780 Status XWithdrawWindow(
1781 Display* display,
1782 Window w,
1783 int screen_number
1785 Status XGetCommand(
1786 Display* display,
1787 Window w,
1788 char*** argv_return,
1789 int* argc_return
1791 Status XGetWMColormapWindows(
1792 Display* display,
1793 Window w,
1794 Window** windows_return,
1795 int* count_return
1797 Status XSetWMColormapWindows(
1798 Display* display,
1799 Window w,
1800 Window* colormap_windows,
1801 int count
1803 void XFreeStringList(
1804 char** list
1806 int XSetTransientForHint(
1807 Display* display,
1808 Window w,
1809 Window prop_window
1812 /* The following are given in alphabetical order */
1814 int XActivateScreenSaver(
1815 Display* display
1818 int XAddHost(
1819 Display* display,
1820 XHostAddress* host
1823 int XAddHosts(
1824 Display* display,
1825 XHostAddress* hosts,
1826 int num_hosts
1829 int XAddToExtensionList(
1830 XExtData** structure,
1831 XExtData* ext_data
1834 int XAddToSaveSet(
1835 Display* display,
1836 Window w
1839 Status XAllocColor(
1840 Display* display,
1841 Colormap colormap,
1842 XColor* screen_in_out
1845 Status XAllocColorCells(
1846 Display* display,
1847 Colormap colormap,
1848 Bool contig,
1849 c_ulong* plane_masks_return,
1850 uint nplanes,
1851 c_ulong* pixels_return,
1852 uint npixels
1855 Status XAllocColorPlanes(
1856 Display* display,
1857 Colormap colormap,
1858 Bool contig,
1859 c_ulong* pixels_return,
1860 int ncolors,
1861 int nreds,
1862 int ngreens,
1863 int nblues,
1864 c_ulong* rmask_return,
1865 c_ulong* gmask_return,
1866 c_ulong* bmask_return
1869 Status XAllocNamedColor(
1870 Display* display,
1871 Colormap colormap,
1872 const(char)* color_name,
1873 XColor* screen_def_return,
1874 XColor* exact_def_return
1877 int XAllowEvents(
1878 Display* display,
1879 int event_mode,
1880 Time time
1883 int XAutoRepeatOff(
1884 Display* display
1887 int XAutoRepeatOn(
1888 Display* display
1891 int XBell(
1892 Display* display,
1893 int percent
1896 int XBitmapBitOrder(
1897 Display* display
1900 int XBitmapPad(
1901 Display* display
1904 int XBitmapUnit(
1905 Display* display
1908 int XCellsOfScreen(
1909 Screen* screen
1912 int XChangeActivePointerGrab(
1913 Display* display,
1914 uint event_mask,
1915 Cursor cursor,
1916 Time time
1919 int XChangeGC(
1920 Display* display,
1921 GC gc,
1922 c_ulong valuemask,
1923 XGCValues* values
1926 int XChangeKeyboardControl(
1927 Display* display,
1928 c_ulong value_mask,
1929 XKeyboardControl* values
1932 int XChangeKeyboardMapping(
1933 Display* display,
1934 int first_keycode,
1935 int keysyms_per_keycode,
1936 KeySym* keysyms,
1937 int num_codes
1940 int XChangePointerControl(
1941 Display* display,
1942 Bool do_accel,
1943 Bool do_threshold,
1944 int accel_numerator,
1945 int accel_denominator,
1946 int threshold
1949 int XChangeProperty(
1950 Display* display,
1951 Window w,
1952 Atom property,
1953 Atom type,
1954 int format,
1955 int mode,
1956 ubyte* data,
1957 int nelements
1960 int XChangeSaveSet(
1961 Display* display,
1962 Window w,
1963 int change_mode
1966 int XChangeWindowAttributes(
1967 Display* display,
1968 Window w,
1969 uint valuemask,
1970 XSetWindowAttributes* attributes
1973 Bool XCheckIfEvent(
1974 Display* display,
1975 XEvent* event_return,
1976 Bool function(
1977 Display* display,
1978 XEvent* event,
1979 XPointer arg
1980 ) predicate,
1981 XPointer arg
1984 Bool XCheckMaskEvent(
1985 Display* display,
1986 c_long event_mask,
1987 XEvent* event_return
1990 Bool XCheckTypedEvent(
1991 Display* display,
1992 int event_type,
1993 XEvent* event_return
1996 Bool XCheckTypedWindowEvent(
1997 Display* display,
1998 Window w,
1999 int event_type,
2000 XEvent* event_return
2003 Bool XCheckWindowEvent(
2004 Display* display,
2005 Window w,
2006 c_long event_mask,
2007 XEvent* event_return
2010 int XCirculateSubwindows(
2011 Display* display,
2012 Window w,
2013 int direction
2016 int XCirculateSubwindowsDown(
2017 Display* display,
2018 Window w
2021 int XCirculateSubwindowsUp(
2022 Display* display,
2023 Window w
2026 int XClearArea(
2027 Display* display,
2028 Window w,
2029 int x,
2030 int y,
2031 uint width,
2032 uint height,
2033 Bool exposures
2036 int XClearWindow(
2037 Display* display,
2038 Window w
2041 int XCloseDisplay(
2042 Display* display
2045 int XConfigureWindow(
2046 Display* display,
2047 Window w,
2048 c_ulong value_mask,
2049 XWindowChanges* values
2052 int XConnectionNumber(
2053 Display* display
2056 int XConvertSelection(
2057 Display* display,
2058 Atom selection,
2059 Atom target,
2060 Atom property,
2061 Window requestor,
2062 Time time
2065 int XCopyArea(
2066 Display* display,
2067 Drawable src,
2068 Drawable dest,
2069 GC gc,
2070 int src_x,
2071 int src_y,
2072 uint width,
2073 uint height,
2074 int dest_x,
2075 int dest_y
2078 int XCopyGC(
2079 Display* display,
2080 GC src,
2081 uint valuemask,
2082 GC dest
2085 int XCopyPlane(
2086 Display* display,
2087 Drawable src,
2088 Drawable dest,
2089 GC gc,
2090 int src_x,
2091 int src_y,
2092 uint width,
2093 uint height,
2094 int dest_x,
2095 int dest_y,
2096 c_ulong plane
2099 int XDefaultDepth(
2100 Display* display,
2101 int screen_number
2104 int XDefaultDepthOfScreen(
2105 Screen* screen
2108 int XDefaultScreen(
2109 Display* display
2112 int XDefineCursor(
2113 Display* display,
2114 Window w,
2115 Cursor cursor
2118 int XDeleteProperty(
2119 Display* display,
2120 Window w,
2121 Atom property
2124 int XDestroyWindow(
2125 Display* display,
2126 Window w
2129 int XDestroySubwindows(
2130 Display* display,
2131 Window w
2134 int XDoesBackingStore(
2135 Screen* screen
2138 Bool XDoesSaveUnders(
2139 Screen* screen
2142 int XDisableAccessControl(
2143 Display* display
2147 int XDisplayCells(
2148 Display* display,
2149 int screen_number
2152 int XDisplayHeight(
2153 Display* display,
2154 int screen_number
2157 int XDisplayHeightMM(
2158 Display* display,
2159 int screen_number
2162 int XDisplayKeycodes(
2163 Display* display,
2164 int* min_keycodes_return,
2165 int* max_keycodes_return
2168 int XDisplayPlanes(
2169 Display* display,
2170 int screen_number
2173 int XDisplayWidth(
2174 Display* display,
2175 int screen_number
2178 int XDisplayWidthMM(
2179 Display* display,
2180 int screen_number
2183 int XDrawArc(
2184 Display* display,
2185 Drawable d,
2186 GC gc,
2187 int x,
2188 int y,
2189 uint width,
2190 uint height,
2191 int angle1,
2192 int angle2
2195 int XDrawArcs(
2196 Display* display,
2197 Drawable d,
2198 GC gc,
2199 XArc* arcs,
2200 int narcs
2203 int XDrawImageString(
2204 Display* display,
2205 Drawable d,
2206 GC gc,
2207 int x,
2208 int y,
2209 const(char)* string,
2210 int length
2213 int XDrawImageString16(
2214 Display* display,
2215 Drawable d,
2216 GC gc,
2217 int x,
2218 int y,
2219 XChar2b* string,
2220 int length
2223 int XDrawLine(
2224 Display* display,
2225 Drawable d,
2226 GC gc,
2227 int x1,
2228 int y1,
2229 int x2,
2230 int y2
2233 int XDrawLines(
2234 Display* display,
2235 Drawable d,
2236 GC gc,
2237 XPoint* points,
2238 int npoints,
2239 int mode
2242 int XDrawPoint(
2243 Display* display,
2244 Drawable d,
2245 GC gc,
2246 int x,
2247 int y
2250 int XDrawPoints(
2251 Display* display,
2252 Drawable d,
2253 GC gc,
2254 XPoint* points,
2255 int npoints,
2256 int mode
2259 int XDrawRectangle(
2260 Display* display,
2261 Drawable d,
2262 GC gc,
2263 int x,
2264 int y,
2265 uint width,
2266 uint height
2269 int XDrawRectangles(
2270 Display* display,
2271 Drawable d,
2272 GC gc,
2273 XRectangle* rectangles,
2274 int nrectangles
2277 int XDrawSegments(
2278 Display* display,
2279 Drawable d,
2280 GC gc,
2281 XSegment* segments,
2282 int nsegments
2285 int XDrawString(
2286 Display* display,
2287 Drawable d,
2288 GC gc,
2289 int x,
2290 int y,
2291 const(char)* string,
2292 int length
2295 int XDrawString16(
2296 Display* display,
2297 Drawable d,
2298 GC gc,
2299 int x,
2300 int y,
2301 XChar2b* string,
2302 int length
2305 int XDrawText(
2306 Display* display,
2307 Drawable d,
2308 GC gc,
2309 int x,
2310 int y,
2311 XTextItem* items,
2312 int nitems
2315 int XDrawText16(
2316 Display* display,
2317 Drawable d,
2318 GC gc,
2319 int x,
2320 int y,
2321 XTextItem16* items,
2322 int nitems
2325 int XEnableAccessControl(
2326 Display* display
2329 int XEventsQueued(
2330 Display* display,
2331 int mode
2334 Status XFetchName(
2335 Display* display,
2336 Window w,
2337 char** window_name_return
2340 int XFillArc(
2341 Display* display,
2342 Drawable d,
2343 GC gc,
2344 int x,
2345 int y,
2346 uint width,
2347 uint height,
2348 int angle1,
2349 int angle2
2352 int XFillArcs(
2353 Display* display,
2354 Drawable d,
2355 GC gc,
2356 XArc* arcs,
2357 int narcs
2360 int XFillPolygon(
2361 Display* display,
2362 Drawable d,
2363 GC gc,
2364 XPoint* points,
2365 int npoints,
2366 int shape,
2367 int mode
2370 int XFillRectangle(
2371 Display* display,
2372 Drawable d,
2373 GC gc,
2374 int x,
2375 int y,
2376 uint width,
2377 uint height
2380 int XFillRectangles(
2381 Display* display,
2382 Drawable d,
2383 GC gc,
2384 XRectangle* rectangles,
2385 int nrectangles
2388 int XFlush(
2389 Display* display
2392 int XForceScreenSaver(
2393 Display* display,
2394 int mode
2397 int XFree(
2398 void* data
2401 int XFreeColormap(
2402 Display* display,
2403 Colormap colormap
2406 int XFreeColors(
2407 Display* display,
2408 Colormap colormap,
2409 c_ulong* pixels,
2410 int npixels,
2411 c_ulong planes
2414 int XFreeCursor(
2415 Display* display,
2416 Cursor cursor
2419 int XFreeExtensionList(
2420 char** list
2423 int XFreeFont(
2424 Display* display,
2425 XFontStruct* font_struct
2428 int XFreeFontInfo(
2429 char** names,
2430 XFontStruct* free_info,
2431 int actual_count
2434 int XFreeFontNames(
2435 char** list
2438 int XFreeFontPath(
2439 char** list
2442 int XFreeGC(
2443 Display* display,
2444 GC gc
2447 int XFreeModifiermap(
2448 XModifierKeymap* modmap
2451 int XFreePixmap(
2452 Display* display,
2453 Pixmap pixmap
2456 int XGeometry(
2457 Display* display,
2458 int screen,
2459 char* position,
2460 char* default_position,
2461 uint bwidth,
2462 uint fwidth,
2463 uint fheight,
2464 int xadder,
2465 int yadder,
2466 int* x_return,
2467 int* y_return,
2468 int* width_return,
2469 int* height_return
2472 int XGetErrorDatabaseText(
2473 Display* display,
2474 const(char)* name,
2475 const(char)* message,
2476 const(char)* default_string,
2477 char* buffer_return,
2478 int length
2481 int XGetErrorText(
2482 Display* display,
2483 int code,
2484 char* buffer_return,
2485 int length
2488 Bool XGetFontProperty(
2489 XFontStruct* font_struct,
2490 Atom atom,
2491 c_ulong* value_return
2494 Status XGetGCValues(
2495 Display* display,
2496 GC gc,
2497 c_ulong valuemask,
2498 XGCValues* values_return
2501 Status XGetGeometry(
2502 Display* display,
2503 Drawable d,
2504 Window* root_return,
2505 int* x_return,
2506 int* y_return,
2507 uint* width_return,
2508 uint* height_return,
2509 uint* border_width_return,
2510 uint* depth_return
2513 Status XGetIconName(
2514 Display* display,
2515 Window w,
2516 char** icon_name_return
2519 int XGetInputFocus(
2520 Display* display,
2521 Window* focus_return,
2522 int* revert_to_return
2525 int XGetKeyboardControl(
2526 Display* display,
2527 XKeyboardState* values_return
2530 int XGetPointerControl(
2531 Display* display,
2532 int* accel_numerator_return,
2533 int* accel_denominator_return,
2534 int* threshold_return
2537 int XGetPointerMapping(
2538 Display* display,
2539 ubyte* map_return,
2540 int nmap
2543 int XGetScreenSaver(
2544 Display* display,
2545 int* timeout_return,
2546 int* interval_return,
2547 int* prefer_blanking_return,
2548 int* allow_exposures_return
2551 Status XGetTransientForHint(
2552 Display* display,
2553 Window w,
2554 Window* prop_window_return
2557 int XGetWindowProperty(
2558 Display* display,
2559 Window w,
2560 Atom property,
2561 c_long c_long_offset,
2562 c_long c_long_length,
2563 Bool dodelete,
2564 Atom req_type,
2565 Atom* actual_type_return,
2566 int* actual_format_return,
2567 c_ulong* nitems_return,
2568 c_ulong* chars_after_return,
2569 ubyte** prop_return
2572 Status XGetWindowAttributes(
2573 Display* display,
2574 Window w,
2575 XWindowAttributes* window_attributes_return
2578 int XGrabButton(
2579 Display* display,
2580 uint button,
2581 uint modifiers,
2582 Window grab_window,
2583 Bool owner_events,
2584 uint event_mask,
2585 int pointer_mode,
2586 int keyboard_mode,
2587 Window confine_to,
2588 Cursor cursor
2591 int XGrabKey(
2592 Display* display,
2593 int keycode,
2594 uint modifiers,
2595 Window grab_window,
2596 Bool owner_events,
2597 int pointer_mode,
2598 int keyboard_mode
2601 int XGrabKeyboard(
2602 Display* display,
2603 Window grab_window,
2604 Bool owner_events,
2605 int pointer_mode,
2606 int keyboard_mode,
2607 Time time
2610 int XGrabPointer(
2611 Display* display,
2612 Window grab_window,
2613 Bool owner_events,
2614 uint event_mask,
2615 int pointer_mode,
2616 int keyboard_mode,
2617 Window confine_to,
2618 Cursor cursor,
2619 Time time
2622 int XGrabServer(
2623 Display* display
2626 int XHeightMMOfScreen(
2627 Screen* screen
2630 int XHeightOfScreen(
2631 Screen* screen
2634 int XIfEvent(
2635 Display* display,
2636 XEvent* event_return,
2637 Bool function(
2638 Display* display,
2639 XEvent* event,
2640 XPointer arg
2641 ) predicate,
2642 XPointer arg
2645 int XImagecharOrder(
2646 Display* display
2649 int XInstallColormap(
2650 Display* display,
2651 Colormap colormap
2654 KeyCode XKeysymToKeycode(
2655 Display* display,
2656 KeySym keysym
2659 int XKillClient(
2660 Display* display,
2661 XID resource
2664 Status XLookupColor(
2665 Display* display,
2666 Colormap colormap,
2667 const(char)* color_name,
2668 XColor* exact_def_return,
2669 XColor* screen_def_return
2672 int XLowerWindow(
2673 Display* display,
2674 Window w
2677 int XMapRaised(
2678 Display* display,
2679 Window w
2682 int XMapSubwindows(
2683 Display* display,
2684 Window w
2687 int XMapWindow(
2688 Display* display,
2689 Window w
2692 int XMaskEvent(
2693 Display* display,
2694 c_long event_mask,
2695 XEvent* event_return
2698 int XMaxCmapsOfScreen(
2699 Screen* screen
2702 int XMinCmapsOfScreen(
2703 Screen* screen
2706 int XMoveResizeWindow(
2707 Display* display,
2708 Window w,
2709 int x,
2710 int y,
2711 uint width,
2712 uint height
2715 int XMoveWindow(
2716 Display* display,
2717 Window w,
2718 int x,
2719 int y
2722 int XNextEvent(
2723 Display* display,
2724 XEvent* event_return
2727 int XNoOp(
2728 Display* display
2731 Status XParseColor(
2732 Display* display,
2733 Colormap colormap,
2734 const(char)* spec,
2735 XColor* exact_def_return
2738 int XParseGeometry(
2739 char* parsestring,
2740 int* x_return,
2741 int* y_return,
2742 uint* width_return,
2743 uint* height_return
2746 int XPeekEvent(
2747 Display* display,
2748 XEvent* event_return
2751 int XPeekIfEvent(
2752 Display* display,
2753 XEvent* event_return,
2754 Bool function(
2755 Display* display,
2756 XEvent* event,
2757 XPointer arg
2758 ) predicate,
2759 XPointer arg
2762 int XPending(
2763 Display* display
2766 int XPlanesOfScreen(
2767 Screen* screen
2770 int XProtocolRevision(
2771 Display* display
2774 int XProtocolVersion(
2775 Display* display
2779 int XPutBackEvent(
2780 Display* display,
2781 XEvent* event
2784 int XPutImage(
2785 Display* display,
2786 Drawable d,
2787 GC gc,
2788 XImage* image,
2789 int src_x,
2790 int src_y,
2791 int dest_x,
2792 int dest_y,
2793 uint width,
2794 uint height
2797 int XQLength(
2798 Display* display
2801 Status XQueryBestCursor(
2802 Display* display,
2803 Drawable d,
2804 uint width,
2805 uint height,
2806 uint* width_return,
2807 uint* height_return
2810 Status XQueryBestSize(
2811 Display* display,
2812 int klass,
2813 Drawable which_screen,
2814 uint width,
2815 uint height,
2816 uint* width_return,
2817 uint* height_return
2820 Status XQueryBestStipple(
2821 Display* display,
2822 Drawable which_screen,
2823 uint width,
2824 uint height,
2825 uint* width_return,
2826 uint* height_return
2829 Status XQueryBestTile(
2830 Display* display,
2831 Drawable which_screen,
2832 uint width,
2833 uint height,
2834 uint* width_return,
2835 uint* height_return
2838 int XQueryColor(
2839 Display* display,
2840 Colormap colormap,
2841 XColor* def_in_out
2844 int XQueryColors(
2845 Display* display,
2846 Colormap colormap,
2847 XColor* defs_in_out,
2848 int ncolors
2851 Bool XQueryExtension(
2852 Display* display,
2853 char* name,
2854 int* major_opcode_return,
2855 int* first_event_return,
2856 int* first_error_return
2859 int XQueryKeymap(
2860 Display* display,
2861 char [32] keys_return
2864 Bool XQueryPointer(
2865 Display* display,
2866 Window w,
2867 Window* root_return,
2868 Window* child_return,
2869 int* root_x_return,
2870 int* root_y_return,
2871 int* win_x_return,
2872 int* win_y_return,
2873 uint* mask_return
2876 int XQueryTextExtents(
2877 Display* display,
2878 XID font_ID,
2879 const(char)* string,
2880 int nchars,
2881 int* direction_return,
2882 int* font_ascent_return,
2883 int* font_descent_return,
2884 XCharStruct* overall_return
2887 int XQueryTextExtents16(
2888 Display* display,
2889 XID font_ID,
2890 XChar2b* string,
2891 int nchars,
2892 int* direction_return,
2893 int* font_ascent_return,
2894 int* font_descent_return,
2895 XCharStruct* overall_return
2898 Status XQueryTree(
2899 Display* display,
2900 Window w,
2901 Window* root_return,
2902 Window* parent_return,
2903 Window** children_return,
2904 uint* nchildren_return
2907 int XRaiseWindow(
2908 Display* display,
2909 Window w
2912 int XReadBitmapFile(
2913 Display* display,
2914 Drawable d,
2915 ubyte* filename,
2916 uint* width_return,
2917 uint* height_return,
2918 Pixmap* bitmap_return,
2919 int* x_hot_return,
2920 int* y_hot_return
2923 int XReadBitmapFileData(
2924 const(char)* filename,
2925 uint* width_return,
2926 uint* height_return,
2927 ubyte** data_return,
2928 int* x_hot_return,
2929 int* y_hot_return
2932 int XRebindKeysym(
2933 Display* display,
2934 KeySym keysym,
2935 KeySym* list,
2936 int mod_count,
2937 ubyte* string,
2938 int chars_string
2941 int XRecolorCursor(
2942 Display* display,
2943 Cursor cursor,
2944 XColor* foreground_color,
2945 XColor* background_color
2948 int XRefreshKeyboardMapping(
2949 XMappingEvent* event_map
2952 int XRemoveFromSaveSet(
2953 Display* display,
2954 Window w
2957 int XRemoveHost(
2958 Display* display,
2959 XHostAddress* host
2962 int XRemoveHosts(
2963 Display* display,
2964 XHostAddress* hosts,
2965 int num_hosts
2968 int XReparentWindow(
2969 Display* display,
2970 Window w,
2971 Window parent,
2972 int x,
2973 int y
2976 int XResetScreenSaver(
2977 Display* display
2980 int XResizeWindow(
2981 Display* display,
2982 Window w,
2983 uint width,
2984 uint height
2987 int XRestackWindows(
2988 Display* display,
2989 Window* windows,
2990 int nwindows
2993 int XRotateBuffers(
2994 Display* display,
2995 int rotate
2998 int XRotateWindowProperties(
2999 Display* display,
3000 Window w,
3001 Atom* properties,
3002 int num_prop,
3003 int npositions
3006 int XScreenCount(
3007 Display* display
3010 int XSelectInput(
3011 Display* display,
3012 Window w,
3013 c_long event_mask
3016 Status XSendEvent(
3017 Display* display,
3018 Window w,
3019 Bool propagate,
3020 c_long event_mask,
3021 XEvent* event_send
3024 int XSetAccessControl(
3025 Display* display,
3026 int mode
3029 int XSetArcMode(
3030 Display* display,
3031 GC gc,
3032 int arc_mode
3035 int XSetBackground(
3036 Display* display,
3037 GC gc,
3038 c_ulong background
3041 int XSetClipMask(
3042 Display* display,
3043 GC gc,
3044 Pixmap pixmap
3047 int XSetClipOrigin(
3048 Display* display,
3049 GC gc,
3050 int clip_x_origin,
3051 int clip_y_origin
3054 int XSetClipRectangles(
3055 Display* display,
3056 GC gc,
3057 int clip_x_origin,
3058 int clip_y_origin,
3059 XRectangle* rectangles,
3060 int n,
3061 int ordering
3064 int XSetCloseDownMode(
3065 Display* display,
3066 int close_mode
3069 int XSetCommand(
3070 Display* display,
3071 Window w,
3072 char** argv,
3073 int argc
3076 int XSetDashes(
3077 Display* display,
3078 GC gc,
3079 int dash_offset,
3080 char* dash_list,
3081 int n
3084 int XSetFillRule(
3085 Display* display,
3086 GC gc,
3087 int fill_rule
3090 int XSetFillStyle(
3091 Display* display,
3092 GC gc,
3093 int fill_style
3096 int XSetFont(
3097 Display* display,
3098 GC gc,
3099 Font font
3102 int XSetFontPath(
3103 Display* display,
3104 char** directories,
3105 int ndirs
3108 int XSetForeground(
3109 Display* display,
3110 GC gc,
3111 c_ulong foreground
3114 int XSetFunction(
3115 Display* display,
3116 GC gc,
3117 int func
3120 int XSetGraphicsExposures(
3121 Display* display,
3122 GC gc,
3123 Bool graphics_exposures
3126 int XSetIconName(
3127 Display* display,
3128 Window w,
3129 const(char)* icon_name
3132 int XSetInputFocus(
3133 Display* display,
3134 Window focus,
3135 int revert_to,
3136 Time time
3139 int XSetLineAttributes(
3140 Display* display,
3141 GC gc,
3142 uint line_width,
3143 int line_style,
3144 int cap_style,
3145 int join_style
3148 int XSetModifierMapping(
3149 Display* display,
3150 XModifierKeymap* modmap
3153 int XSetPlaneMask(
3154 Display* display,
3155 GC gc,
3156 c_ulong plane_mask
3159 int XSetPointerMapping(
3160 Display* display,
3161 ubyte* map,
3162 int nmap
3165 int XSetScreenSaver(
3166 Display* display,
3167 int timeout,
3168 int interval,
3169 int prefer_blanking,
3170 int allow_exposures
3173 int XSetSelectionOwner(
3174 Display* display,
3175 Atom selection,
3176 Window owner,
3177 Time time
3180 int XSetState(
3181 Display* display,
3182 GC gc,
3183 c_ulong foreground,
3184 c_ulong background,
3185 int func,
3186 c_ulong plane_mask
3189 int XSetStipple(
3190 Display* display,
3191 GC gc,
3192 Pixmap stipple
3195 int XSetSubwindowMode(
3196 Display* display,
3197 GC gc,
3198 int subwindow_mode
3201 int XSetTSOrigin(
3202 Display* display,
3203 GC gc,
3204 int ts_x_origin,
3205 int ts_y_origin
3208 int XSetTile(
3209 Display* display,
3210 GC gc,
3211 Pixmap tile
3214 int XSetWindowBackground(
3215 Display* display,
3216 Window w,
3217 c_ulong background_pixel
3220 int XSetWindowBackgroundPixmap(
3221 Display* display,
3222 Window w,
3223 Pixmap background_pixmap
3226 int XSetWindowBorder(
3227 Display* display,
3228 Window w,
3229 c_ulong border_pixel
3232 int XSetWindowBorderPixmap(
3233 Display* display,
3234 Window w,
3235 Pixmap border_pixmap
3238 int XSetWindowBorderWidth(
3239 Display* display,
3240 Window w,
3241 uint width
3244 int XSetWindowColormap(
3245 Display* display,
3246 Window w,
3247 Colormap colormap
3250 int XStoreBuffer(
3251 Display* display,
3252 char* chars,
3253 int nchars,
3254 int buffer
3257 int XStorechars(
3258 Display* display,
3259 char* chars,
3260 int nchars
3263 int XStoreColor(
3264 Display* display,
3265 Colormap colormap,
3266 XColor* color
3269 int XStoreColors(
3270 Display* display,
3271 Colormap colormap,
3272 XColor* color,
3273 int ncolors
3276 int XStoreName(
3277 Display* display,
3278 Window w,
3279 const(char)* window_name
3282 int XStoreNamedColor(
3283 Display* display,
3284 Colormap colormap,
3285 char* color,
3286 c_ulong pixel,
3287 int flags
3290 int XSync(
3291 Display* display,
3292 Bool discard
3295 int XTextExtents(
3296 XFontStruct* font_struct,
3297 const(char)* string,
3298 int nchars,
3299 int* direction_return,
3300 int* font_ascent_return,
3301 int* font_descent_return,
3302 XCharStruct* overall_return
3305 int XTextExtents16(
3306 XFontStruct* font_struct,
3307 XChar2b* string,
3308 int nchars,
3309 int* direction_return,
3310 int* font_ascent_return,
3311 int* font_descent_return,
3312 XCharStruct* overall_return
3315 int XTextWidth(
3316 XFontStruct* font_struct,
3317 const(char)* string,
3318 int count
3321 int XTextWidth16(
3322 XFontStruct* font_struct,
3323 XChar2b* string,
3324 int count
3327 Bool XTranslateCoordinates(
3328 Display* display,
3329 Window src_w,
3330 Window dest_w,
3331 int src_x,
3332 int src_y,
3333 int* dest_x_return,
3334 int* dest_y_return,
3335 Window* child_return
3338 int XUndefineCursor(
3339 Display* display,
3340 Window w
3343 int XUngrabButton(
3344 Display* display,
3345 uint button,
3346 uint modifiers,
3347 Window grab_window
3350 int XUngrabKey(
3351 Display* display,
3352 int keycode,
3353 uint modifiers,
3354 Window grab_window
3357 int XUngrabKeyboard(
3358 Display* display,
3359 Time time
3362 int XUngrabPointer(
3363 Display* display,
3364 Time time
3367 int XUngrabServer(
3368 Display* display
3371 int XUninstallColormap(
3372 Display* display,
3373 Colormap colormap
3376 int XUnloadFont(
3377 Display* display,
3378 Font font
3381 int XUnmapSubwindows(
3382 Display* display,
3383 Window w
3386 int XUnmapWindow(
3387 Display* display,
3388 Window w
3391 int XVendorRelease(
3392 Display* display
3395 int XWarpPointer(
3396 Display* display,
3397 Window src_w,
3398 Window dest_w,
3399 int src_x,
3400 int src_y,
3401 uint src_width,
3402 uint src_height,
3403 int dest_x,
3404 int dest_y
3407 int XWidthMMOfScreen(
3408 Screen* screen
3411 int XWidthOfScreen(
3412 Screen* screen
3415 int XWindowEvent(
3416 Display* display,
3417 Window w,
3418 c_long event_mask,
3419 XEvent* event_return
3422 int XWriteBitmapFile(
3423 Display* display,
3424 const(char)* filename,
3425 Pixmap bitmap,
3426 uint width,
3427 uint height,
3428 int x_hot,
3429 int y_hot
3432 Bool XSupportsLocale ( );
3434 char* XSetLocaleModifiers(
3435 const(char)* modifier_list
3438 XOM XOpenOM(
3439 Display* display,
3440 _XrmHashBucketRec* rdb,
3441 const(char)* res_name,
3442 const(char)* res_class
3445 Status XCloseOM(
3446 XOM om
3449 /+todo
3450 char* XSetOMValues(
3451 XOM om,
3453 ) _X_SENTINEL(0);
3455 char* XGetOMValues(
3456 XOM om,
3458 ) _X_SENTINEL(0);
3461 Display* XDisplayOfOM(
3462 XOM om
3465 char* XLocaleOfOM(
3466 XOM om
3469 /+todo
3470 XOC XCreateOC(
3471 XOM om,
3473 ) _X_SENTINEL(0);
3475 void XDestroyOC(
3476 XOC oc
3479 XOM XOMOfOC(
3480 XOC oc
3483 /+todo
3484 char* XSetOCValues(
3485 XOC oc,
3487 ) _X_SENTINEL(0);
3489 char* XGetOCValues(
3490 XOC oc,
3492 ) _X_SENTINEL(0);
3495 XFontSet XCreateFontSet(
3496 Display* display,
3497 const(char)* base_font_name_list,
3498 char*** missing_charset_list,
3499 int* missing_charset_count,
3500 char** def_string
3503 void XFreeFontSet(
3504 Display* display,
3505 XFontSet font_set
3508 int XFontsOfFontSet(
3509 XFontSet font_set,
3510 XFontStruct*** font_struct_list,
3511 char*** font_name_list
3514 char* XBaseFontNameListOfFontSet(
3515 XFontSet font_set /*was char*/
3518 char* XLocaleOfFontSet(
3519 XFontSet font_set
3522 Bool XContextDependentDrawing(
3523 XFontSet font_set
3526 Bool XDirectionalDependentDrawing(
3527 XFontSet font_set
3530 Bool XContextualDrawing(
3531 XFontSet font_set
3534 XFontSetExtents* XExtentsOfFontSet(
3535 XFontSet font_set
3538 int XmbTextEscapement(
3539 XFontSet font_set,
3540 const(char)* text,
3541 int chars_text
3544 int XwcTextEscapement(
3545 XFontSet font_set,
3546 const(wchar_t)* text,
3547 int num_wchars
3550 int Xutf8TextEscapement(
3551 XFontSet font_set,
3552 const(char)* text,
3553 int chars_text
3556 int XmbTextExtents(
3557 XFontSet font_set,
3558 const(char)* text,
3559 int chars_text,
3560 XRectangle* overall_ink_return,
3561 XRectangle* overall_logical_return
3564 int XwcTextExtents(
3565 XFontSet font_set,
3566 const(wchar_t)* text,
3567 int num_wchars,
3568 XRectangle* overall_ink_return,
3569 XRectangle* overall_logical_return
3572 int Xutf8TextExtents(
3573 XFontSet font_set,
3574 const(char)* text,
3575 int chars_text,
3576 XRectangle* overall_ink_return,
3577 XRectangle* overall_logical_return
3580 Status XmbTextPerCharExtents(
3581 XFontSet font_set,
3582 const(char)* text,
3583 int chars_text,
3584 XRectangle* ink_extents_buffer,
3585 XRectangle* logical_extents_buffer,
3586 int buffer_size,
3587 int* num_chars,
3588 XRectangle* overall_ink_return,
3589 XRectangle* overall_logical_return
3592 Status XwcTextPerCharExtents(
3593 XFontSet font_set,
3594 const(wchar_t)* text,
3595 int num_wchars,
3596 XRectangle* ink_extents_buffer,
3597 XRectangle* logical_extents_buffer,
3598 int buffer_size,
3599 int* num_chars,
3600 XRectangle* overall_ink_return,
3601 XRectangle* overall_logical_return
3604 Status Xutf8TextPerCharExtents(
3605 XFontSet font_set,
3606 const(char)* text,
3607 int chars_text,
3608 XRectangle* ink_extents_buffer,
3609 XRectangle* logical_extents_buffer,
3610 int buffer_size,
3611 int* num_chars,
3612 XRectangle* overall_ink_return,
3613 XRectangle* overall_logical_return
3616 void XmbDrawText(
3617 Display* display,
3618 Drawable d,
3619 GC gc,
3620 int x,
3621 int y,
3622 XmbTextItem* text_items,
3623 int nitems
3626 void XwcDrawText(
3627 Display* display,
3628 Drawable d,
3629 GC gc,
3630 int x,
3631 int y,
3632 XwcTextItem* text_items,
3633 int nitems
3636 void Xutf8DrawText(
3637 Display* display,
3638 Drawable d,
3639 GC gc,
3640 int x,
3641 int y,
3642 XmbTextItem* text_items,
3643 int nitems
3646 void XmbDrawString(
3647 Display* display,
3648 Drawable d,
3649 XFontSet font_set,
3650 GC gc,
3651 int x,
3652 int y,
3653 const(char)* text,
3654 int chars_text
3657 void XwcDrawString(
3658 Display* display,
3659 Drawable d,
3660 XFontSet font_set,
3661 GC gc,
3662 int x,
3663 int y,
3664 const(wchar_t)* text,
3665 int num_wchars
3668 void Xutf8DrawString(
3669 Display* display,
3670 Drawable d,
3671 XFontSet font_set,
3672 GC gc,
3673 int x,
3674 int y,
3675 const(char)* text,
3676 int chars_text
3679 void XmbDrawImageString(
3680 Display* display,
3681 Drawable d,
3682 XFontSet font_set,
3683 GC gc,
3684 int x,
3685 int y,
3686 const(char)* text,
3687 int chars_text
3690 void XwcDrawImageString(
3691 Display* display,
3692 Drawable d,
3693 XFontSet font_set,
3694 GC gc,
3695 int x,
3696 int y,
3697 const(wchar_t)* text,
3698 int num_wchars
3701 void Xutf8DrawImageString(
3702 Display* display,
3703 Drawable d,
3704 XFontSet font_set,
3705 GC gc,
3706 int x,
3707 int y,
3708 const(char)* text,
3709 int chars_text
3712 XIM XOpenIM(
3713 Display* dpy,
3714 _XrmHashBucketRec* rdb,
3715 const(char)* res_name,
3716 const(char)* res_class
3719 Status XCloseIM(
3720 XIM im
3723 char* XGetIMValues(
3724 XIM im, ...
3725 ) /*_X_SENTINEL(0)*/;
3727 char* XSetIMValues(
3728 XIM im, ...
3729 ) /*_X_SENTINEL(0)*/;
3731 Display* XDisplayOfIM(
3732 XIM im
3735 char* XLocaleOfIM(
3736 XIM im
3739 //TODO
3740 XIC XCreateIC(
3741 XIM im, ...
3742 ) /*_X_SENTINEL(0)*/;
3744 void XDestroyIC(
3745 XIC ic
3748 void XSetICFocus(
3749 XIC ic
3752 void XUnsetICFocus(
3753 XIC ic
3756 wchar_t* XwcResetIC(
3757 XIC ic
3760 char* XmbResetIC(
3761 XIC ic
3764 char* Xutf8ResetIC(
3765 XIC ic
3768 char* XSetICValues(
3769 XIC ic, ...
3770 ) /*_X_SENTINEL(0)*/;
3772 char* XGetICValues(
3773 XIC ic, ...
3774 ) /*_X_SENTINEL(0)*/;
3776 XIM XIMOfIC(
3777 XIC ic
3780 Bool XFilterEvent(
3781 XEvent* event,
3782 Window window
3785 int XmbLookupString(
3786 XIC ic,
3787 XKeyPressedEvent* event,
3788 char* buffer_return,
3789 int chars_buffer,
3790 KeySym* keysym_return,
3791 Status* status_return
3794 int XwcLookupString(
3795 XIC ic,
3796 XKeyPressedEvent* event,
3797 wchar_t* buffer_return,
3798 int wchars_buffer,
3799 KeySym* keysym_return,
3800 Status* status_return
3803 int Xutf8LookupString(
3804 XIC ic,
3805 XKeyPressedEvent* event,
3806 char* buffer_return,
3807 int chars_buffer,
3808 KeySym* keysym_return,
3809 Status* status_return
3812 /+todo
3813 XVaNestedList XVaCreateNestedList(
3814 int unused, ...
3815 ) _X_SENTINEL(0);
3817 /* internal connections for IMs */
3819 Bool XRegisterIMInstantiateCallback(
3820 Display* dpy,
3821 _XrmHashBucketRec* rdb,
3822 const(char)* res_name,
3823 const(char)* res_class,
3824 XIDProc callback,
3825 XPointer client_data
3828 Bool XUnregisterIMInstantiateCallback(
3829 Display* dpy,
3830 _XrmHashBucketRec* rdb,
3831 const(char)* res_name,
3832 const(char)* res_class,
3833 XIDProc callback,
3834 XPointer client_data
3837 alias XConnectionWatchProc = void function(
3838 Display* dpy,
3839 XPointer client_data,
3840 int fd,
3841 Bool /* opening, open or close flag */,
3842 XPointer* /* watch_data, open sets, close uses */
3846 Status XInternalConnectionNumbers(
3847 Display* dpy,
3848 int** fd_return,
3849 int* count_return
3852 void XProcessInternalConnection(
3853 Display* dpy,
3854 int fd
3857 Status XAddConnectionWatch(
3858 Display* dpy,
3859 XConnectionWatchProc callback,
3860 XPointer client_data
3863 void XRemoveConnectionWatch(
3864 Display* dpy,
3865 XConnectionWatchProc callback,
3866 XPointer client_data
3869 void XSetAuthorization(
3870 char* name,
3871 int namelen,
3872 char* data,
3873 int datalen
3876 int _Xmbtowc(
3877 wchar_t* wstr,
3878 char* str,
3879 int len
3882 int _Xwctomb(
3883 char* str,
3884 wchar_t wc
3887 Bool XGetEventData(
3888 Display* dpy,
3889 XGenericEventCookie* cookie
3892 void XFreeEventData(
3893 Display* dpy,
3894 XGenericEventCookie* cookie
3898 Bool XkbSetDetectableAutoRepeat(
3899 Display* dpy,
3900 Bool detectable,
3901 Bool* supported