1 ! Copyright (C) 2005, 2006 Eduardo Cavazos
2 ! See http://factorcode.org/license.txt for BSD license.
4 ! The most popular guides to programming the X Window System are
5 ! the series from Oreilly. For programming with Xlib, there is
6 ! the reference manual and the programmers guide. However, a
7 ! lesser known manual is the free Xlib manual that comes with
8 ! the MIT X distribution. The arrangement and order of these
9 ! bindings follows the structure of the free Xlib manual. If you
10 ! add to this library and are wondering what part of the file to
11 ! modify, just find the function or data structure in the manual
12 ! and note the section.
14 USING: kernel arrays alien alien.c-types alien.syntax
15 math words sequences namespaces continuations ;
32 TYPEDEF: char* XPointer
33 TYPEDEF: void* Display*
34 TYPEDEF: void* Screen*
36 TYPEDEF: void* Visual*
37 TYPEDEF: void* XExtData*
38 TYPEDEF: void* XFontProp*
39 TYPEDEF: void* XComposeStatus*
47 TYPEDEF: ulong VisualID
50 TYPEDEF: void* Window**
53 : <XID> <ulong> ; inline
54 : <Window> <XID> ; inline
55 : <Drawable> <XID> ; inline
56 : <KeySym> <XID> ; inline
57 : <Atom> <ulong> ; inline
59 : *XID *ulong ; inline
60 : *Window *XID ; inline
61 : *Drawable *XID ; inline
62 : *KeySym *XID ; inline
63 : *Atom *ulong ; inline
65 ! 2 - Display Functions
68 FUNCTION: Display* XOpenDisplay ( void* display_name ) ;
70 ! 2.2 Obtaining Information about the Display, Image Formats, or Screens
72 FUNCTION: ulong XBlackPixel ( Display* display, int screen_number ) ;
73 FUNCTION: ulong XWhitePixel ( Display* display, int screen_number ) ;
74 FUNCTION: Colormap XDefaultColormap ( Display* display, int screen_number ) ;
75 FUNCTION: int XDefaultDepth ( Display* display, int screen_number ) ;
76 FUNCTION: GC XDefaultGC ( Display* display, int screen_number ) ;
77 FUNCTION: int XDefaultScreen ( Display* display ) ;
78 FUNCTION: Window XRootWindow ( Display* display, int screen_number ) ;
79 FUNCTION: Window XDefaultRootWindow ( Display* display ) ;
80 FUNCTION: int XProtocolVersion ( Display* display ) ;
81 FUNCTION: int XProtocolRevision ( Display* display ) ;
82 FUNCTION: int XQLength ( Display* display ) ;
83 FUNCTION: int XScreenCount ( Display* display ) ;
84 FUNCTION: int XConnectionNumber ( Display* display ) ;
86 ! 2.5 Closing the Display
87 FUNCTION: int XCloseDisplay ( Display* display ) ;
90 ! 3 - Window Functions
93 ! 3.2 - Window Attributes
95 : CWBackPixmap 1 0 shift ; inline
96 : CWBackPixel 1 1 shift ; inline
97 : CWBorderPixmap 1 2 shift ; inline
98 : CWBorderPixel 1 3 shift ; inline
99 : CWBitGravity 1 4 shift ; inline
100 : CWWinGravity 1 5 shift ; inline
101 : CWBackingStore 1 6 shift ; inline
102 : CWBackingPlanes 1 7 shift ; inline
103 : CWBackingPixel 1 8 shift ; inline
104 : CWOverrideRedirect 1 9 shift ; inline
105 : CWSaveUnder 1 10 shift ; inline
106 : CWEventMask 1 11 shift ; inline
107 : CWDontPropagate 1 12 shift ; inline
108 : CWColormap 1 13 shift ; inline
109 : CWCursor 1 14 shift ; inline
111 C-STRUCT: XSetWindowAttributes
112 { "Pixmap" "background_pixmap" }
113 { "ulong" "background_pixel" }
114 { "Pixmap" "border_pixmap" }
115 { "ulong" "border_pixel" }
116 { "int" "bit_gravity" }
117 { "int" "win_gravity" }
118 { "int" "backing_store" }
119 { "ulong" "backing_planes" }
120 { "ulong" "backing_pixel" }
121 { "Bool" "save_under" }
122 { "long" "event_mask" }
123 { "long" "do_not_propagate_mask" }
124 { "Bool" "override_redirect" }
125 { "Colormap" "colormap" }
126 { "Cursor" "cursor" } ;
128 : UnmapGravity 0 ; inline
130 : ForgetGravity 0 ; inline
131 : NorthWestGravity 1 ; inline
132 : NorthGravity 2 ; inline
133 : NorthEastGravity 3 ; inline
134 : WestGravity 4 ; inline
135 : CenterGravity 5 ; inline
136 : EastGravity 6 ; inline
137 : SouthWestGravity 7 ; inline
138 : SouthGravity 8 ; inline
139 : SouthEastGravity 9 ; inline
140 : StaticGravity 10 ; inline
142 ! 3.3 - Creating Windows
144 FUNCTION: Window XCreateWindow ( Display* display, Window parent, int x, int y, uint width, uint height, uint border_width, int depth, uint class, Visual* visual, ulong valuemask, XSetWindowAttributes* attributes ) ;
145 FUNCTION: Window XCreateSimpleWindow ( Display* display, Window parent, int x, int y, uint width, uint height, uint border_width, ulong border, ulong background ) ;
146 FUNCTION: Status XDestroyWindow ( Display* display, Window w ) ;
147 FUNCTION: Status XMapWindow ( Display* display, Window window ) ;
148 FUNCTION: Status XMapSubwindows ( Display* display, Window window ) ;
149 FUNCTION: Status XUnmapWindow ( Display* display, Window w ) ;
150 FUNCTION: Status XUnmapSubwindows ( Display* display, Window w ) ;
152 ! 3.5 Mapping Windows
154 FUNCTION: int XMapRaised ( Display* display, Window w ) ;
156 ! 3.7 - Configuring Windows
158 : CWX 1 0 shift ; inline
159 : CWY 1 1 shift ; inline
160 : CWWidth 1 2 shift ; inline
161 : CWHeight 1 3 shift ; inline
162 : CWBorderWidth 1 4 shift ; inline
163 : CWSibling 1 5 shift ; inline
164 : CWStackMode 1 6 shift ; inline
166 C-STRUCT: XWindowChanges
171 { "int" "border_width" }
172 { "Window" "sibling" }
173 { "int" "stack_mode" } ;
175 FUNCTION: Status XConfigureWindow ( Display* display, Window w, uint value_mask, XWindowChanges* values ) ;
176 FUNCTION: Status XMoveWindow ( Display* display, Window w, int x, int y ) ;
177 FUNCTION: Status XResizeWindow ( Display* display, Window w, uint width, uint height ) ;
178 FUNCTION: Status XSetWindowBorderWidth ( Display* display, ulong w, uint width ) ;
181 ! 3.8 Changing Window Stacking Order
183 FUNCTION: Status XRaiseWindow ( Display* display, Window w ) ;
184 FUNCTION: Status XLowerWindow ( Display* display, Window w ) ;
186 ! 3.9 - Changing Window Attributes
188 FUNCTION: Status XChangeWindowAttributes (
189 Display* display, Window w, ulong valuemask, XSetWindowAttributes* attr ) ;
190 FUNCTION: Status XSetWindowBackground (
191 Display* display, Window w, ulong background_pixel ) ;
192 FUNCTION: Status XDefineCursor ( Display* display, Window w, Cursor cursor ) ;
193 FUNCTION: Status XUndefineCursor ( Display* display, Window w ) ;
195 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
196 ! 4 - Window Information Functions
197 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
199 ! 4.1 - Obtaining Window Information
201 FUNCTION: Status XQueryTree (
205 Window* parent_return,
206 Window** children_return, uint* nchildren_return ) ;
208 C-STRUCT: XWindowAttributes
213 { "int" "border_width" }
215 { "Visual*" "visual" }
218 { "int" "bit_gravity" }
219 { "int" "win_gravity" }
220 { "int" "backing_store" }
221 { "ulong" "backing_planes" }
222 { "ulong" "backing_pixel" }
223 { "Bool" "save_under" }
224 { "Colormap" "colormap" }
225 { "Bool" "map_installed" }
226 { "int" "map_state" }
227 { "long" "all_event_masks" }
228 { "long" "your_event_mask" }
229 { "long" "do_not_propagate_mask" }
230 { "Bool" "override_redirect" }
231 { "Screen*" "screen" } ;
233 FUNCTION: Status XGetWindowAttributes ( Display* display, Window w, XWindowAttributes* attr ) ;
235 : IsUnmapped 0 ; inline
236 : IsUnviewable 1 ; inline
237 : IsViewable 2 ; inline
239 FUNCTION: Status XGetGeometry (
247 uint* border_width_return,
248 uint* depth_return ) ;
250 ! 4.2 - Translating Screen Coordinates
252 FUNCTION: Bool XQueryPointer ( Display* display, Window w, Window* root_return, Window* child_return, int* root_x_return, int* root_y_return, int* win_x_return, int* win_y_return, uint* mask_return ) ;
254 ! 4.3 - Properties and Atoms
256 FUNCTION: Atom XInternAtom ( Display* display, char* atom_name, Bool only_if_exists ) ;
258 FUNCTION: char* XGetAtomName ( Display* display, Atom atom ) ;
260 ! 4.4 - Obtaining and Changing Window Properties
262 FUNCTION: int XGetWindowProperty ( Display* display, Window w, Atom property, long long_offset, long long_length, Bool delete, Atom req_type, Atom* actual_type_return, int* actual_format_return, ulong* nitems_return, ulong* bytes_after_return, char** prop_return ) ;
264 FUNCTION: int XChangeProperty ( Display* display, Window w, Atom property, Atom type, int format, int mode, void* data, int nelements ) ;
268 FUNCTION: int XSetSelectionOwner ( Display* display, Atom selection, Window owner, Time time ) ;
270 FUNCTION: Window XGetSelectionOwner ( Display* display, Atom selection ) ;
272 FUNCTION: int XConvertSelection ( Display* display, Atom selection, Atom target, Atom property, Window requestor, Time time ) ;
274 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
275 ! 6 - Color Management Functions
276 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
286 FUNCTION: Status XLookupColor ( Display* display, Colormap colormap, char* color_name, XColor* exact_def_return, XColor* screen_def_return ) ;
287 FUNCTION: Status XAllocColor ( Display* display, Colormap colormap, XColor* screen_in_out ) ;
288 FUNCTION: Status XQueryColor ( Display* display, Colormap colormap, XColor* def_in_out ) ;
290 ! 6.4 Creating, Copying, and Destroying Colormaps
292 FUNCTION: Colormap XCreateColormap ( Display* display, Window w, Visual* visual, int alloc ) ;
294 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
295 ! 7 - Graphics Context Functions
296 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
298 : GCFunction 1 0 shift ; inline
299 : GCPlaneMask 1 1 shift ; inline
300 : GCForeground 1 2 shift ; inline
301 : GCBackground 1 3 shift ; inline
302 : GCLineWidth 1 4 shift ; inline
303 : GCLineStyle 1 5 shift ; inline
304 : GCCapStyle 1 6 shift ; inline
305 : GCJoinStyle 1 7 shift ; inline
306 : GCFillStyle 1 8 shift ; inline
307 : GCFillRule 1 9 shift ; inline
308 : GCTile 1 10 shift ; inline
309 : GCStipple 1 11 shift ; inline
310 : GCTileStipXOrigin 1 12 shift ; inline
311 : GCTileStipYOrigin 1 13 shift ; inline
312 : GCFont 1 14 shift ; inline
313 : GCSubwindowMode 1 15 shift ; inline
314 : GCGraphicsExposures 1 16 shift ; inline
315 : GCClipXOrigin 1 17 shift ; inline
316 : GCClipYOrigin 1 18 shift ; inline
317 : GCClipMask 1 19 shift ; inline
318 : GCDashOffset 1 20 shift ; inline
319 : GCDashList 1 21 shift ; inline
320 : GCArcMode 1 22 shift ; inline
322 : GXclear HEX: 0 ; inline
323 : GXand HEX: 1 ; inline
324 : GXandReverse HEX: 2 ; inline
325 : GXcopy HEX: 3 ; inline
326 : GXandInverted HEX: 4 ; inline
327 : GXnoop HEX: 5 ; inline
328 : GXxor HEX: 6 ; inline
329 : GXor HEX: 7 ; inline
330 : GXnor HEX: 8 ; inline
331 : GXequiv HEX: 9 ; inline
332 : GXinvert HEX: a ; inline
333 : GXorReverse HEX: b ; inline
334 : GXcopyInverted HEX: c ; inline
335 : GXorInverted HEX: d ; inline
336 : GXnand HEX: e ; inline
337 : GXset HEX: f ; inline
341 { "ulong" "plane_mask" }
342 { "ulong" "foreground" }
343 { "ulong" "background" }
344 { "int" "line_width" }
345 { "int" "line_style" }
346 { "int" "cap_style" }
347 { "int" "join_style" }
348 { "int" "fill_style" }
349 { "int" "fill_rule" }
352 { "Pixmap" "stipple" }
353 { "int" "ts_x_origin" }
354 { "int" "ts_y_origin" }
356 { "int" "subwindow_mode" }
357 { "Bool" "graphics_exposures" }
358 { "int" "clip_x_origin" }
359 { "int" "clip_y_origin" }
360 { "Pixmap" "clip_mask" }
361 { "int" "dash_offset" }
362 { "char" "dashes" } ;
364 FUNCTION: GC XCreateGC ( Display* display, Window d, ulong valuemask, XGCValues* values ) ;
365 FUNCTION: int XChangeGC ( Display* display, GC gc, ulong valuemask, XGCValues* values ) ;
366 FUNCTION: Status XGetGCValues ( Display* display, GC gc, ulong valuemask, XGCValues* values_return ) ;
367 FUNCTION: Status XSetForeground ( Display* display, GC gc, ulong foreground ) ;
368 FUNCTION: Status XSetBackground ( Display* display, GC gc, ulong background ) ;
369 FUNCTION: Status XSetFunction ( Display* display, GC gc, int function ) ;
370 FUNCTION: Status XSetSubwindowMode ( Display* display, GC gc, int subwindow_mode ) ;
372 FUNCTION: GContext XGContextFromGC ( GC gc ) ;
374 FUNCTION: Status XSetFont ( Display* display, GC gc, Font font ) ;
376 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
377 ! 8 - Graphics Functions
378 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
380 FUNCTION: Status XClearWindow ( Display* display, Window w ) ;
381 FUNCTION: Status XDrawPoint ( Display* display, Drawable d, GC gc, int x, int y ) ;
382 FUNCTION: Status XDrawLine ( Display* display, Drawable d, GC gc, int x1, int y1, int x2, int y2 ) ;
383 FUNCTION: Status XDrawArc ( Display* display, Drawable d, GC gc, int x, int y, uint width, uint height, int angle1, int angle2 ) ;
384 FUNCTION: Status XFillArc ( Display* display, Drawable d, GC gc, int x, int y, uint width, uint height, int angle1, int angle2 ) ;
388 C-STRUCT: XCharStruct
389 { "short" "lbearing" }
390 { "short" "rbearing" }
393 { "short" "descent" }
394 { "ushort" "attributes" } ;
396 FUNCTION: Font XLoadFont ( Display* display, char* name ) ;
397 FUNCTION: XFontStruct* XQueryFont ( Display* display, XID font_ID ) ;
398 FUNCTION: XFontStruct* XLoadQueryFont ( Display* display, char* name ) ;
400 C-STRUCT: XFontStruct
401 { "XExtData*" "ext_data" }
403 { "uint" "direction" }
404 { "uint" "min_char_or_byte2" }
405 { "uint" "max_char_or_byte2" }
406 { "uint" "min_byte1" }
407 { "uint" "max_byte1" }
408 { "Bool" "all_chars_exist" }
409 { "uint" "default_char" }
410 { "int" "n_properties" }
411 { "XFontProp*" "properties" }
412 { "XCharStruct" "min_bounds" }
413 { "XCharStruct" "max_bounds" }
414 { "XCharStruct*" "per_char" }
416 { "int" "descent" } ;
418 FUNCTION: int XTextWidth ( XFontStruct* font_struct, char* string, int count ) ;
422 FUNCTION: Status XDrawString (
432 ! 9 - Window and Session Manager Functions
435 FUNCTION: Status XReparentWindow ( Display* display, Window w, Window parent, int x, int y ) ;
436 FUNCTION: Status XAddToSaveSet ( Display* display, Window w ) ;
437 FUNCTION: Status XRemoveFromSaveSet ( Display* display, Window w ) ;
438 FUNCTION: Status XGrabServer ( Display* display ) ;
439 FUNCTION: Status XUngrabServer ( Display* display ) ;
440 FUNCTION: Status XKillClient ( Display* display, XID resource ) ;
442 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
444 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
448 : NoEventMask 0 ; inline
449 : KeyPressMask 1 0 shift ; inline
450 : KeyReleaseMask 1 1 shift ; inline
451 : ButtonPressMask 1 2 shift ; inline
452 : ButtonReleaseMask 1 3 shift ; inline
453 : EnterWindowMask 1 4 shift ; inline
454 : LeaveWindowMask 1 5 shift ; inline
455 : PointerMotionMask 1 6 shift ; inline
456 : PointerMotionHintMask 1 7 shift ; inline
457 : Button1MotionMask 1 8 shift ; inline
458 : Button2MotionMask 1 9 shift ; inline
459 : Button3MotionMask 1 10 shift ; inline
460 : Button4MotionMask 1 11 shift ; inline
461 : Button5MotionMask 1 12 shift ; inline
462 : ButtonMotionMask 1 13 shift ; inline
463 : KeymapStateMask 1 14 shift ; inline
464 : ExposureMask 1 15 shift ; inline
465 : VisibilityChangeMask 1 16 shift ; inline
466 : StructureNotifyMask 1 17 shift ; inline
467 : ResizeRedirectMask 1 18 shift ; inline
468 : SubstructureNotifyMask 1 19 shift ; inline
469 : SubstructureRedirectMask 1 20 shift ; inline
470 : FocusChangeMask 1 21 shift ; inline
471 : PropertyChangeMask 1 22 shift ; inline
472 : ColormapChangeMask 1 23 shift ; inline
473 : OwnerGrabButtonMask 1 24 shift ; inline
475 : KeyPress 2 ; inline
476 : KeyRelease 3 ; inline
477 : ButtonPress 4 ; inline
478 : ButtonRelease 5 ; inline
479 : MotionNotify 6 ; inline
480 : EnterNotify 7 ; inline
481 : LeaveNotify 8 ; inline
483 : FocusOut 10 ; inline
484 : KeymapNotify 11 ; inline
486 : GraphicsExpose 13 ; inline
487 : NoExpose 14 ; inline
488 : VisibilityNotify 15 ; inline
489 : CreateNotify 16 ; inline
490 : DestroyNotify 17 ; inline
491 : UnmapNotify 18 ; inline
492 : MapNotify 19 ; inline
493 : MapRequest 20 ; inline
494 : ReparentNotify 21 ; inline
495 : ConfigureNotify 22 ; inline
496 : ConfigureRequest 23 ; inline
497 : GravityNotify 24 ; inline
498 : ResizeRequest 25 ; inline
499 : CirculateNotify 26 ; inline
500 : CirculateRequest 27 ; inline
501 : PropertyNotify 28 ; inline
502 : SelectionClear 29 ; inline
503 : SelectionRequest 30 ; inline
504 : SelectionNotify 31 ; inline
505 : ColormapNotify 32 ; inline
506 : ClientMessage 33 ; inline
507 : MappingNotify 34 ; inline
508 : LASTEvent 35 ; inline
513 { "Bool" "send_event" }
514 { "Display*" "display" }
515 { "Window" "window" } ;
517 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
519 ! 10.5 Keyboard and Pointer Events
527 : Button1Mask 1 8 shift ; inline
528 : Button2Mask 1 9 shift ; inline
529 : Button3Mask 1 10 shift ; inline
530 : Button4Mask 1 11 shift ; inline
531 : Button5Mask 1 12 shift ; inline
533 : ShiftMask 1 0 shift ; inline
534 : LockMask 1 1 shift ; inline
535 : ControlMask 1 2 shift ; inline
536 : Mod1Mask 1 3 shift ; inline
537 : Mod2Mask 1 4 shift ; inline
538 : Mod3Mask 1 5 shift ; inline
539 : Mod4Mask 1 6 shift ; inline
540 : Mod5Mask 1 7 shift ; inline
542 C-STRUCT: XButtonEvent
545 { "Bool" "send_event" }
546 { "Display*" "display" }
547 { "Window" "window" }
549 { "Window" "subwindow" }
557 { "Bool" "same_screen" } ;
559 TYPEDEF: XButtonEvent XButtonPressedEvent
560 TYPEDEF: XButtonEvent XButtonReleasedEvent
563 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
568 { "Bool" "send_event" }
569 { "Display*" "display" }
570 { "Window" "window" }
572 { "Window" "subwindow" }
580 { "Bool" "same_screen" } ;
582 TYPEDEF: XKeyEvent XKeyPressedEvent
583 TYPEDEF: XKeyEvent XKeyReleasedEvent
585 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
587 C-STRUCT: XMotionEvent
590 { "Bool" "send_event" }
591 { "Display*" "display" }
592 { "Window" "window" }
594 { "Window" "subwindow" }
602 { "Bool" "same_screen" } ;
604 TYPEDEF: XMotionEvent XPointerMovedEvent
606 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
608 C-STRUCT: XCrossingEvent
611 { "Bool" "send_event" }
612 { "Display*" "display" }
613 { "Window" "window" }
615 { "Window" "subwindow" }
623 { "Bool" "same_screen" }
627 TYPEDEF: XCrossingEvent XEnterWindowEvent
628 TYPEDEF: XCrossingEvent XLeaveWindowEvent
630 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
632 C-STRUCT: XFocusChangeEvent
635 { "Bool" "send_event" }
636 { "Display*" "display" }
637 { "Window" "window" }
641 TYPEDEF: XFocusChangeEvent XFocusInEvent
642 TYPEDEF: XFocusChangeEvent XFocusOutEvent
644 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
646 C-STRUCT: XExposeEvent
649 { "Bool" "send_event" }
650 { "Display*" "display" }
651 { "Window" "window" }
658 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
660 C-STRUCT: XGraphicsExposeEvent
663 { "Bool" "send_event" }
664 { "Display*" "display" }
665 { "Drawable" "drawable" }
671 { "int" "major_code" }
672 { "int" "minor_code" } ;
674 C-STRUCT: XNoExposeEvent
677 { "Bool" "send_event" }
678 { "Display*" "display" }
679 { "Drawable" "drawable" }
680 { "int" "major_code" }
681 { "int" "minor_code" } ;
683 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
685 C-STRUCT: XVisibilityEvent
688 { "Bool" "send_event" }
689 { "Display*" "display" }
690 { "Window" "window" }
693 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
695 C-STRUCT: XCreateWindowEvent
698 { "Bool" "send_event" }
699 { "Display*" "display" }
700 { "Window" "parent" }
701 { "Window" "window" }
706 { "int" "border_width" }
707 { "Bool" "override_redirect" } ;
709 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
711 C-STRUCT: XDestroyWindowEvent
714 { "Bool" "send_event" }
715 { "Display*" "display" }
717 { "Window" "window" } ;
719 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
721 C-STRUCT: XUnmapEvent
724 { "Bool" "send_event" }
725 { "Display*" "display" }
727 { "Window" "window" }
728 { "Bool" "from_configure" } ;
730 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
735 { "Bool" "send_event" }
736 { "Display*" "display" }
738 { "Window" "window" }
739 { "Bool" "override_redirect" } ;
741 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
743 C-STRUCT: XMapRequestEvent
746 { "Bool" "send_event" }
747 { "Display*" "display" }
748 { "Window" "parent" }
749 { "Window" "window" } ;
751 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
753 C-STRUCT: XReparentEvent
756 { "Bool" "send_event" }
757 { "Display*" "display" }
759 { "Window" "window" }
760 { "Window" "parent" }
763 { "Bool" "override_redirect" } ;
765 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
767 C-STRUCT: XConfigureEvent
770 { "Bool" "send_event" }
771 { "Display*" "display" }
773 { "Window" "window" }
778 { "int" "border_width" }
780 { "Bool" "override_redirect" } ;
782 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
784 C-STRUCT: XGravityEvent
787 { "Bool" "send_event" }
788 { "Display*" "display" }
790 { "Window" "window" }
794 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
796 C-STRUCT: XResizeRequestEvent
799 { "Bool" "send_event" }
800 { "Display*" "display" }
801 { "Window" "window" }
805 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
807 C-STRUCT: XConfigureRequestEvent
810 { "Bool" "send_event" }
811 { "Display*" "display" }
812 { "Window" "parent" }
813 { "Window" "window" }
818 { "int" "border_width" }
821 { "ulong" "value_mask" } ;
823 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
825 C-STRUCT: XCirculateEvent
828 { "Bool" "send_event" }
829 { "Display*" "display" }
831 { "Window" "window" }
834 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
836 C-STRUCT: XCirculateRequestEvent
839 { "Bool" "send_event" }
840 { "Display*" "display" }
841 { "Window" "parent" }
842 { "Window" "window" }
845 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
847 C-STRUCT: XPropertyEvent
850 { "Bool" "send_event" }
851 { "Display*" "display" }
852 { "Window" "window" }
857 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
859 C-STRUCT: XSelectionClearEvent
862 { "Bool" "send_event" }
863 { "Display*" "display" }
864 { "Window" "window" }
865 { "Atom" "selection" }
868 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
870 C-STRUCT: XSelectionRequestEvent
873 { "Bool" "send_event" }
874 { "Display*" "display" }
876 { "Window" "requestor" }
877 { "Atom" "selection" }
879 { "Atom" "property" }
882 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
884 C-STRUCT: XSelectionEvent
887 { "Bool" "send_event" }
888 { "Display*" "display" }
889 { "Window" "requestor" }
890 { "Atom" "selection" }
892 { "Atom" "property" }
895 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
897 C-STRUCT: XColormapEvent
900 { "Bool" "send_event" }
901 { "Display*" "display" }
902 { "Window" "window" }
903 { "Colormap" "colormap" }
907 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
909 C-STRUCT: XClientMessageEvent
912 { "Bool" "send_event" }
913 { "Display*" "display" }
914 { "Window" "window" }
915 { "Atom" "message_type" }
929 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
931 C-STRUCT: XMappingEvent
934 { "Bool" "send_event" }
935 { "Display*" "display" }
936 { "Window" "window" }
938 { "int" "first_keycode" }
941 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
943 C-STRUCT: XErrorEvent
945 { "Display*" "display" }
946 { "XID" "resourceid" }
948 { "uchar" "error_code" }
949 { "uchar" "request_code" }
950 { "uchar" "minor_code" } ;
952 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
954 C-STRUCT: XKeymapEvent
957 { "Bool" "send_event" }
958 { "Display*" "display" }
959 { "Window" "window" }
960 ! char key_vector[32];
979 "XGraphicsExposeEvent"
983 "XDestroyWindowEvent"
990 "XResizeRequestEvent"
991 "XConfigureRequestEvent"
993 "XCirculateRequestEvent"
995 "XSelectionClearEvent"
996 "XSelectionRequestEvent"
999 "XClientMessageEvent"
1005 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1006 ! 11 - Event Handling Functions
1007 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1009 FUNCTION: Status XSelectInput ( Display* display, Window w, long event_mask ) ;
1010 FUNCTION: Status XFlush ( Display* display ) ;
1011 FUNCTION: Status XSync ( Display* display, int discard ) ;
1012 FUNCTION: Status XNextEvent ( Display* display, XEvent* event ) ;
1013 FUNCTION: Status XMaskEvent ( Display* display, long event_mask, XEvent* event_return ) ;
1015 ! 11.3 - Event Queue Management
1017 : QueuedAlready 0 ; inline
1018 : QueuedAfterReading 1 ; inline
1019 : QueuedAfterFlush 2 ; inline
1021 FUNCTION: int XEventsQueued ( Display* display, int mode ) ;
1022 FUNCTION: int XPending ( Display* display ) ;
1024 ! 11.6 - Sending Events to Other Applications
1026 FUNCTION: Status XSendEvent ( Display* display, Window w, Bool propagate, long event_mask, XEvent* event_send ) ;
1028 ! 11.8 - Handling Protocol Errors
1030 FUNCTION: int XSetErrorHandler ( void* handler ) ;
1032 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1033 ! 12 - Input Device Functions
1034 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1038 FUNCTION: int XGrabPointer (
1049 FUNCTION: Status XUngrabPointer ( Display* display, Time time ) ;
1050 FUNCTION: Status XChangeActivePointerGrab ( Display* display, uint event_mask, Cursor cursor, Time time ) ;
1051 FUNCTION: Status XGrabKey ( Display* display, int keycode, uint modifiers, Window grab_window, Bool owner_events, int pointer_mode, int keyboard_mode ) ;
1052 FUNCTION: Status XSetInputFocus ( Display* display, Window focus, int revert_to, Time time ) ;
1054 FUNCTION: Status XGetInputFocus ( Display* display,
1055 Window* focus_return,
1056 int* revert_to_return ) ;
1058 FUNCTION: Status XWarpPointer ( Display* display, Window src_w, Window dest_w, int src_x, int src_y, uint src_width, uint src_height, int dest_x, int dest_y ) ;
1060 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1061 ! 14 - Inter-Client Communication Functions
1062 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1064 ! 14.1 Client to Window Manager Communication
1066 FUNCTION: Status XFetchName ( Display* display, Window w, char** window_name_return ) ;
1067 FUNCTION: Status XGetTransientForHint ( Display* display, Window w, Window* prop_window_return ) ;
1069 ! 14.1.1. Manipulating Top-Level Windows
1071 FUNCTION: Status XIconifyWindow (
1072 Display* display, Window w, int screen_number ) ;
1074 FUNCTION: Status XWithdrawWindow (
1075 Display* display, Window w, int screen_number ) ;
1077 ! 14.1.6 - Setting and Reading the WM_HINTS Property
1079 ! 17.1.7 - Setting and Reading the WM_NORMAL_HINTS Property
1081 : USPosition 1 0 shift ; inline
1082 : USSize 1 1 shift ; inline
1083 : PPosition 1 2 shift ; inline
1084 : PSize 1 3 shift ; inline
1085 : PMinSize 1 4 shift ; inline
1086 : PMaxSize 1 5 shift ; inline
1087 : PResizeInc 1 6 shift ; inline
1088 : PAspect 1 7 shift ; inline
1089 : PBaseSize 1 8 shift ; inline
1090 : PWinGravity 1 9 shift ; inline
1091 : PAllHints [ PPosition PSize PMinSize PMaxSize PResizeInc PAspect ]
1092 0 [ execute bitor ] reduce ; inline
1094 C-STRUCT: XSizeHints
1100 { "int" "min_width" }
1101 { "int" "min_height" }
1102 { "int" "max_width" }
1103 { "int" "max_height" }
1104 { "int" "width_inc" }
1105 { "int" "height_inc" }
1106 { "int" "min_aspect_x" }
1107 { "int" "min_aspect_y" }
1108 { "int" "max_aspect_x" }
1109 { "int" "max_aspect_y" }
1110 { "int" "base_width" }
1111 { "int" "base_height" }
1112 { "int" "win_gravity" } ;
1114 ! 14.1.10. Setting and Reading the WM_PROTOCOLS Property
1116 FUNCTION: Status XSetWMProtocols (
1117 Display* display, Window w, Atom* protocols, int count ) ;
1119 FUNCTION: Status XGetWMProtocols (
1122 Atom** protocols_return,
1123 int* count_return ) ;
1125 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1126 ! 16 - Application Utility Functions
1127 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1129 ! 16.1 Keyboard Utility Functions
1131 FUNCTION: KeySym XLookupKeysym ( XKeyEvent* key_event, int index ) ;
1133 FUNCTION: int XLookupString (
1134 XKeyEvent* event_struct,
1135 void* buffer_return,
1137 KeySym* keysym_return,
1138 XComposeStatus* status_in_out ) ;
1140 ! 16.7 Determining the Appropriate Visual Type
1142 : VisualNoMask HEX: 0 ; inline
1143 : VisualIDMask HEX: 1 ; inline
1144 : VisualScreenMask HEX: 2 ; inline
1145 : VisualDepthMask HEX: 4 ; inline
1146 : VisualClassMask HEX: 8 ; inline
1147 : VisualRedMaskMask HEX: 10 ; inline
1148 : VisualGreenMaskMask HEX: 20 ; inline
1149 : VisualBlueMaskMask HEX: 40 ; inline
1150 : VisualColormapSizeMask HEX: 80 ; inline
1151 : VisualBitsPerRGBMask HEX: 100 ; inline
1152 : VisualAllMask HEX: 1FF ; inline
1154 C-STRUCT: XVisualInfo
1155 { "Visual*" "visual" }
1156 { "VisualID" "visualid" }
1160 { "ulong" "red_mask" }
1161 { "ulong" "green_mask" }
1162 { "ulong" "blue_mask" }
1163 { "int" "colormap_size" }
1164 { "int" "bits_per_rgb" } ;
1166 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1167 ! Appendix D - Compatibility Functions
1168 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1170 FUNCTION: Status XSetStandardProperties (
1178 XSizeHints* hints ) ;
1180 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1182 : XA_PRIMARY 1 ; inline
1183 : XA_SECONDARY 2 ; inline
1185 : XA_ATOM 4 ; inline
1186 : XA_BITMAP 5 ; inline
1187 : XA_CARDINAL 6 ; inline
1188 : XA_COLORMAP 7 ; inline
1189 : XA_CURSOR 8 ; inline
1190 : XA_CUT_BUFFER0 9 ; inline
1191 : XA_CUT_BUFFER1 10 ; inline
1192 : XA_CUT_BUFFER2 11 ; inline
1193 : XA_CUT_BUFFER3 12 ; inline
1194 : XA_CUT_BUFFER4 13 ; inline
1195 : XA_CUT_BUFFER5 14 ; inline
1196 : XA_CUT_BUFFER6 15 ; inline
1197 : XA_CUT_BUFFER7 16 ; inline
1198 : XA_DRAWABLE 17 ; inline
1199 : XA_FONT 18 ; inline
1200 : XA_INTEGER 19 ; inline
1201 : XA_PIXMAP 20 ; inline
1202 : XA_POINT 21 ; inline
1203 : XA_RECTANGLE 22 ; inline
1204 : XA_RESOURCE_MANAGER 23 ; inline
1205 : XA_RGB_COLOR_MAP 24 ; inline
1206 : XA_RGB_BEST_MAP 25 ; inline
1207 : XA_RGB_BLUE_MAP 26 ; inline
1208 : XA_RGB_DEFAULT_MAP 27 ; inline
1209 : XA_RGB_GRAY_MAP 28 ; inline
1210 : XA_RGB_GREEN_MAP 29 ; inline
1211 : XA_RGB_RED_MAP 30 ; inline
1212 : XA_STRING 31 ; inline
1213 : XA_VISUALID 32 ; inline
1214 : XA_WINDOW 33 ; inline
1215 : XA_WM_COMMAND 34 ; inline
1216 : XA_WM_HINTS 35 ; inline
1217 : XA_WM_CLIENT_MACHINE 36 ; inline
1218 : XA_WM_ICON_NAME 37 ; inline
1219 : XA_WM_ICON_SIZE 38 ; inline
1220 : XA_WM_NAME 39 ; inline
1221 : XA_WM_NORMAL_HINTS 40 ; inline
1222 : XA_WM_SIZE_HINTS 41 ; inline
1223 : XA_WM_ZOOM_HINTS 42 ; inline
1224 : XA_MIN_SPACE 43 ; inline
1225 : XA_NORM_SPACE 44 ; inline
1226 : XA_MAX_SPACE 45 ; inline
1227 : XA_END_SPACE 46 ; inline
1228 : XA_SUPERSCRIPT_X 47 ; inline
1229 : XA_SUPERSCRIPT_Y 48 ; inline
1230 : XA_SUBSCRIPT_X 49 ; inline
1231 : XA_SUBSCRIPT_Y 50 ; inline
1232 : XA_UNDERLINE_POSITION 51 ; inline
1233 : XA_UNDERLINE_THICKNESS 52 ; inline
1234 : XA_STRIKEOUT_ASCENT 53 ; inline
1235 : XA_STRIKEOUT_DESCENT 54 ; inline
1236 : XA_ITALIC_ANGLE 55 ; inline
1237 : XA_X_HEIGHT 56 ; inline
1238 : XA_QUAD_WIDTH 57 ; inline
1239 : XA_WEIGHT 58 ; inline
1240 : XA_POINT_SIZE 59 ; inline
1241 : XA_RESOLUTION 60 ; inline
1242 : XA_COPYRIGHT 61 ; inline
1243 : XA_NOTICE 62 ; inline
1244 : XA_FONT_NAME 63 ; inline
1245 : XA_FAMILY_NAME 64 ; inline
1246 : XA_FULL_NAME 65 ; inline
1247 : XA_CAP_HEIGHT 66 ; inline
1248 : XA_WM_CLASS 67 ; inline
1249 : XA_WM_TRANSIENT_FOR 68 ; inline
1251 : XA_LAST_PREDEFINED 68 ; inline
1253 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1254 ! The rest of the stuff is not from the book.
1255 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1257 FUNCTION: void XFree ( void* data ) ;
1258 FUNCTION: int XStoreName ( Display* display, Window w, char* window_name ) ;
1260 FUNCTION: void XSetWMNormalHints ( Display* display, Window w, XSizeHints* hints ) ;
1264 : XIMPreeditArea HEX: 0001 ;
1265 : XIMPreeditCallbacks HEX: 0002 ;
1266 : XIMPreeditPosition HEX: 0004 ;
1267 : XIMPreeditNothing HEX: 0008 ;
1268 : XIMPreeditNone HEX: 0010 ;
1269 : XIMStatusArea HEX: 0100 ;
1270 : XIMStatusCallbacks HEX: 0200 ;
1271 : XIMStatusNothing HEX: 0400 ;
1272 : XIMStatusNone HEX: 0800 ;
1274 : XNVaNestedList "XNVaNestedList" ;
1275 : XNQueryInputStyle "queryInputStyle" ;
1276 : XNClientWindow "clientWindow" ;
1277 : XNInputStyle "inputStyle" ;
1278 : XNFocusWindow "focusWindow" ;
1279 : XNResourceName "resourceName" ;
1280 : XNResourceClass "resourceClass" ;
1281 : XNGeometryCallback "geometryCallback" ;
1282 : XNDestroyCallback "destroyCallback" ;
1283 : XNFilterEvents "filterEvents" ;
1284 : XNPreeditStartCallback "preeditStartCallback" ;
1285 : XNPreeditDoneCallback "preeditDoneCallback" ;
1286 : XNPreeditDrawCallback "preeditDrawCallback" ;
1287 : XNPreeditCaretCallback "preeditCaretCallback" ;
1288 : XNPreeditStateNotifyCallback "preeditStateNotifyCallback" ;
1289 : XNPreeditAttributes "preeditAttributes" ;
1290 : XNStatusStartCallback "statusStartCallback" ;
1291 : XNStatusDoneCallback "statusDoneCallback" ;
1292 : XNStatusDrawCallback "statusDrawCallback" ;
1293 : XNStatusAttributes "statusAttributes" ;
1295 : XNAreaNeeded "areaNeeded" ;
1296 : XNSpotLocation "spotLocation" ;
1297 : XNColormap "colorMap" ;
1298 : XNStdColormap "stdColorMap" ;
1299 : XNForeground "foreground" ;
1300 : XNBackground "background" ;
1301 : XNBackgroundPixmap "backgroundPixmap" ;
1302 : XNFontSet "fontSet" ;
1303 : XNLineSpace "lineSpace" ;
1304 : XNCursor "cursor" ;
1306 : XNQueryIMValuesList "queryIMValuesList" ;
1307 : XNQueryICValuesList "queryICValuesList" ;
1308 : XNVisiblePosition "visiblePosition" ;
1309 : XNR6PreeditCallback "r6PreeditCallback" ;
1310 : XNStringConversionCallback "stringConversionCallback" ;
1311 : XNStringConversion "stringConversion" ;
1312 : XNResetState "resetState" ;
1313 : XNHotKey "hotKey" ;
1314 : XNHotKeyState "hotKeyState" ;
1315 : XNPreeditState "preeditState" ;
1316 : XNSeparatorofNestedList "separatorofNestedList" ;
1318 : XBufferOverflow -1 ;
1324 FUNCTION: Bool XFilterEvent ( XEvent* event, Window w ) ;
1326 FUNCTION: XIM XOpenIM ( Display* dpy, void* rdb, char* res_name, char* res_class ) ;
1328 FUNCTION: Status XCloseIM ( XIM im ) ;
1330 FUNCTION: XIC XCreateIC ( XIM im, char* key1, Window value1, char* key2, Window value2, char* key3, int value3, char* key4, char* value4, char* key5, char* value5, int key6 ) ;
1332 FUNCTION: void XDestroyIC ( XIC ic ) ;
1334 FUNCTION: void XSetICFocus ( XIC ic ) ;
1336 FUNCTION: void XUnsetICFocus ( XIC ic ) ;
1338 FUNCTION: int XwcLookupString ( XIC ic, XKeyPressedEvent* event, ulong* buffer_return, int bytes_buffer, KeySym* keysym_return, Status* status_return ) ;
1340 FUNCTION: int Xutf8LookupString ( XIC ic, XKeyPressedEvent* event, char* buffer_return, int bytes_buffer, KeySym* keysym_return, Status* status_return ) ;
1346 : flush-dpy ( -- ) dpy get XFlush drop ;
1348 : x-atom ( string -- atom ) dpy get swap 0 XInternAtom ;
1352 "Cannot connect to X server - check $DISPLAY" throw
1355 : initialize-x ( display-string -- )
1356 dup [ string>char-alien ] when
1357 XOpenDisplay check-display dpy set-global
1358 dpy get XDefaultScreen scr set-global
1359 dpy get scr get XRootWindow root set-global ;
1361 : close-x ( -- ) dpy get XCloseDisplay drop ;
1363 : with-x ( display-string quot -- )
1364 >r initialize-x r> [ close-x ] [ ] cleanup ;