]> gitweb.factorcode.org Git - factor.git/blob - basis/x11/xlib/xlib.factor
alien.c-types: not necessary to import `short` differently anymore
[factor.git] / basis / x11 / xlib / xlib.factor
1 ! Copyright (C) 2005, 2006 Eduardo Cavazos
2 ! See http://factorcode.org/license.txt for BSD license.
3 !
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.
13 !
14 ! https://www.x.org/releases/X11R7.6/doc/libX11/specs/libX11/libX11.html
15 USING: accessors alien.c-types alien.data alien.syntax classes.struct
16 io.encodings.ascii kernel literals math x11.X x11.syntax ;
17 IN: x11.xlib
18
19 LIBRARY: xlib
20
21 TYPEDEF: c-string XPointer
22 C-TYPE: Screen
23 TYPEDEF: void* GC
24 C-TYPE: Visual
25 C-TYPE: XExtData
26 C-TYPE: XFontProp
27 C-TYPE: XComposeStatus
28 TYPEDEF: void* XIM
29 TYPEDEF: void* XIC
30
31 TYPEDEF: int Status
32
33 TYPEDEF: int Bool
34
35 TYPEDEF: ulong VisualID
36 TYPEDEF: ulong Time
37
38 : *XID ( bytes -- n ) ulong deref ;
39 ALIAS: *Window *XID
40 ALIAS: *Drawable *XID
41 ALIAS: *KeySym *XID
42 : *Atom ( bytes -- n ) ulong deref ;
43 !
44 ! 2 - Display Functions
45 !
46
47 ! This struct is incomplete
48 STRUCT: Display
49     { ext_data void* }
50     { free_funcs void* }
51     { fd int } ;
52
53 X-FUNCTION: Display* XOpenDisplay ( c-string[ascii] display_name )
54
55 ! 2.2 Obtaining Information about the Display, Image Formats, or Screens
56
57 X-FUNCTION: ulong XBlackPixel ( Display* display, int screen_number )
58 X-FUNCTION: ulong XWhitePixel ( Display* display, int screen_number )
59 X-FUNCTION: Colormap XDefaultColormap ( Display* display, int screen_number )
60 X-FUNCTION: int XDefaultDepth ( Display* display, int screen_number )
61 X-FUNCTION: GC XDefaultGC ( Display* display, int screen_number )
62 X-FUNCTION: int XDefaultScreen ( Display* display )
63 X-FUNCTION: Window XRootWindow ( Display* display, int screen_number )
64 X-FUNCTION: Window XDefaultRootWindow ( Display* display )
65 X-FUNCTION: int XProtocolVersion ( Display* display )
66 X-FUNCTION: int XProtocolRevision ( Display* display )
67 X-FUNCTION: int XQLength ( Display* display )
68 X-FUNCTION: int XScreenCount ( Display* display )
69 X-FUNCTION: int XConnectionNumber ( Display* display )
70
71 ! 2.5 Closing the Display
72 X-FUNCTION: int XCloseDisplay ( Display* display )
73
74 !
75 ! 3 - Window Functions
76 !
77
78 ! 3.2 - Window Attributes
79
80 : CWBackPixmap       ( -- n ) 0 2^ ; inline
81 : CWBackPixel        ( -- n ) 1 2^ ; inline
82 : CWBorderPixmap     ( -- n ) 2 2^ ; inline
83 : CWBorderPixel      ( -- n ) 3 2^ ; inline
84 : CWBitGravity       ( -- n ) 4 2^ ; inline
85 : CWWinGravity       ( -- n ) 5 2^ ; inline
86 : CWBackingStore     ( -- n ) 6 2^ ; inline
87 : CWBackingPlanes    ( -- n ) 7 2^ ; inline
88 : CWBackingPixel     ( -- n ) 8 2^ ; inline
89 : CWOverrideRedirect ( -- n ) 9 2^ ; inline
90 : CWSaveUnder        ( -- n ) 10 2^ ; inline
91 : CWEventMask        ( -- n ) 11 2^ ; inline
92 : CWDontPropagate    ( -- n ) 12 2^ ; inline
93 : CWColormap         ( -- n ) 13 2^ ; inline
94 : CWCursor           ( -- n ) 14 2^ ; inline
95
96 STRUCT: XSetWindowAttributes
97     { background_pixmap Pixmap }
98     { background_pixel ulong }
99     { border_pixmap Pixmap }
100     { border_pixel ulong }
101     { bit_gravity int }
102     { win_gravity int }
103     { backing_store int }
104     { backing_planes ulong }
105     { backing_pixel ulong }
106     { save_under Bool }
107     { event_mask long }
108     { do_not_propagate_mask long }
109     { override_redirect Bool }
110     { colormap Colormap }
111     { cursor Cursor } ;
112
113 ! 3.3 - Creating Windows
114
115 X-FUNCTION: Window XCreateWindow ( Display* display,
116                                    Window parent,
117                                    int x, int y, uint width, uint height,
118                                    uint border_width, int depth, uint class,
119                                    Visual* visual, ulong valuemask,
120                                    XSetWindowAttributes* attributes )
121 X-FUNCTION: Window XCreateSimpleWindow ( Display* display,
122                                          Window parent,
123                                          int x, int y, uint width, uint height,
124                                          uint border_width, ulong border,
125                                          ulong background )
126 X-FUNCTION: Status XDestroyWindow ( Display* display, Window w )
127 X-FUNCTION: Status XMapWindow ( Display* display, Window window )
128 X-FUNCTION: Status XMapSubwindows ( Display* display, Window window )
129 X-FUNCTION: Status XUnmapWindow ( Display* display, Window w )
130 X-FUNCTION: Status XUnmapSubwindows ( Display* display, Window w )
131
132 ! 3.5 Mapping Windows
133
134 X-FUNCTION: int XMapRaised ( Display* display, Window w )
135
136 ! 3.7 - Configuring Windows
137
138 STRUCT: XWindowChanges
139     { x int }
140     { y int }
141     { width int }
142     { height int }
143     { border_width int }
144     { sibling Window }
145     { stack_mode int } ;
146
147 X-FUNCTION: Status XConfigureWindow ( Display* display,
148                                       Window w,
149                                       uint value_mask, XWindowChanges* values )
150 X-FUNCTION: Status XMoveWindow ( Display* display, Window w,
151                                  int x, int y )
152 X-FUNCTION: Status XResizeWindow ( Display* display,
153                                    Window w,
154                                    uint width,
155                                    uint height )
156 X-FUNCTION: Status XSetWindowBorderWidth ( Display* display,
157                                            ulong w,
158                                            uint width )
159
160
161 ! 3.8 Changing Window Stacking Order
162
163 X-FUNCTION: Status XRaiseWindow ( Display* display, Window w )
164 X-FUNCTION: Status XLowerWindow ( Display* display, Window w )
165
166 ! 3.9 - Changing Window Attributes
167
168 X-FUNCTION: Status XChangeWindowAttributes ( Display* display,
169                                              Window w,
170                                              ulong valuemask,
171                                              XSetWindowAttributes* attr )
172 X-FUNCTION: Status XSetWindowBackground ( Display* display,
173                                           Window w, ulong background_pixel )
174 X-FUNCTION: Status XDefineCursor ( Display* display, Window w, Cursor cursor )
175 X-FUNCTION: Status XUndefineCursor ( Display* display, Window w )
176
177 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
178 ! 4 - Window Information Functions
179 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
180
181 ! 4.1 - Obtaining Window Information
182
183 X-FUNCTION: Status XQueryTree ( Display* display,
184                                 Window w,
185                                 Window* root_return,
186                                 Window* parent_return,
187                                 Window** children_return,
188                                 uint* nchildren_return )
189
190 STRUCT: XWindowAttributes
191     { x int }
192     { y int }
193     { width int }
194     {  height int }
195     { border_width int }
196     { depth int }
197     { visual Visual* }
198     { root Window }
199     { class int }
200     { bit_gravity int }
201     { win_gravity int }
202     { backing_store int }
203     { backing_planes ulong }
204     { backing_pixel ulong }
205     { save_under Bool }
206     { colormap Colormap }
207     { map_installed Bool }
208     { map_state int }
209     { all_event_masks long }
210     { your_event_mask long }
211     { do_not_propagate_mask long }
212     { override_redirect Bool }
213     { screen Screen* } ;
214
215 X-FUNCTION: Status XGetWindowAttributes ( Display* display,
216                                           Window w,
217                                           XWindowAttributes* attr )
218
219 X-FUNCTION: Status XGetGeometry ( Display* display,
220                                   Drawable d,
221                                   Window* root_return,
222                                   int* x_return,
223                                   int* y_return,
224                                   uint* width_return,
225                                   uint* height_return,
226                                   uint* border_width_return,
227                                   uint* depth_return )
228
229 ! 4.2 - Translating Screen Coordinates
230
231 X-FUNCTION: Bool XQueryPointer ( Display* display,
232                                  Window w,
233                                  Window* root_return, Window* child_return,
234                                  int* root_x_return, int* root_y_return,
235                                  int* win_x_return, int* win_y_return,
236                                  uint* mask_return )
237
238 ! 4.3 - Properties and Atoms
239
240 X-FUNCTION: Atom XInternAtom ( Display* display,
241                                c-string atom_name,
242                                Bool only_if_exists )
243
244 X-FUNCTION: c-string XGetAtomName ( Display* display, Atom atom )
245
246 ! 4.4 - Obtaining and Changing Window Properties
247
248 X-FUNCTION: int XGetWindowProperty ( Display* display, Window w, Atom property,
249                                      long long_offset, long long_length,
250                                      Bool delete, Atom req_type,
251                                      Atom* actual_type_return,
252                                      int* actual_format_return,
253                                      ulong* nitems_return,
254                                      ulong* bytes_after_return,
255                                      c-string* prop_return )
256
257 X-FUNCTION: int XChangeProperty ( Display* display, Window w, Atom property,
258                                   Atom type, int format,
259                                   int mode, void* data, int nelements )
260
261 ! 4.5 Selections
262
263 X-FUNCTION: int XSetSelectionOwner ( Display* display,
264                                      Atom selection,
265                                      Window owner,
266                                      Time time )
267
268 X-FUNCTION: Window XGetSelectionOwner ( Display* display, Atom selection )
269
270 X-FUNCTION: int XConvertSelection ( Display* display,
271                                     Atom selection,
272                                     Atom target,
273                                     Atom property,
274                                     Window requestor,
275                                     Time time )
276
277
278 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
279 ! 5 - Pixmap and Cursor Functions
280 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
281
282 ! 5.1 - Creating and Freeing Pixmaps
283
284 X-FUNCTION: Pixmap XCreatePixmap ( Display* display,
285                                    Drawable d,
286                                    uint width, uint height, uint depth )
287 X-FUNCTION: int XFreePixmap ( Display* display, Pixmap pixmap )
288
289 ! 5.2 - Creating, Recoloring, and Freeing Cursors
290
291 C-TYPE: XColor
292 X-FUNCTION: Cursor XCreatePixmapCursor ( Display* display,
293                                          Pixmap source, Pixmap mask,
294                                          XColor* foreground_color,
295                                          XColor* background_color,
296                                          uint x, uint y )
297 X-FUNCTION: int XFreeCursor ( Display* display, Cursor cursor )
298
299 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
300 ! 6 - Color Management Functions
301 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
302
303 STRUCT: XColor
304     { pixel ulong }
305     { red ushort }
306     { green ushort }
307     { blue ushort }
308     { flags char }
309     { pad char } ;
310
311 X-FUNCTION: Status XLookupColor ( Display* display,
312                                   Colormap colormap,
313                                   c-string color_name,
314                                   XColor* exact_def_return,
315                                   XColor* screen_def_return )
316 X-FUNCTION: Status XAllocColor ( Display* display, Colormap colormap, XColor* screen_in_out )
317 X-FUNCTION: Status XQueryColor ( Display* display, Colormap colormap, XColor* def_in_out )
318
319 ! 6.4 Creating, Copying, and Destroying Colormaps
320
321 X-FUNCTION: Colormap XCreateColormap ( Display* display, Window w, Visual* visual, int alloc )
322
323 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
324 ! 7 - Graphics Context Functions
325 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
326
327 STRUCT: XGCValues
328     { function int }
329     { plane_mask ulong }
330     { foreground ulong }
331     { background ulong }
332     { line_width int }
333     { line_style int }
334     { cap_style int }
335     { join_style int }
336     { fill_style int }
337     { fill_rule int }
338     { arc_mode int }
339     { tile Pixmap }
340     { stipple Pixmap }
341     { ts_x_origin int }
342     { ts_y_origin int }
343     { font Font }
344     { subwindow_mode int }
345     { graphics_exposures Bool }
346     { clip_x_origin int }
347     { clip_y_origin int }
348     { clip_mask Pixmap }
349     { dash_offset int }
350     { dashes char } ;
351
352 X-FUNCTION: GC XCreateGC ( Display* display, Window d, ulong valuemask, XGCValues* values )
353 X-FUNCTION: int XChangeGC ( Display* display, GC gc, ulong valuemask, XGCValues* values )
354 X-FUNCTION: Status XGetGCValues ( Display* display, GC gc, ulong valuemask, XGCValues* values_return )
355 X-FUNCTION: Status XSetForeground ( Display* display, GC gc, ulong foreground )
356 X-FUNCTION: Status XSetBackground ( Display* display, GC gc, ulong background )
357 X-FUNCTION: Status XSetFunction ( Display* display, GC gc, int function )
358 X-FUNCTION: Status XSetSubwindowMode ( Display* display, GC gc, int subwindow_mode )
359
360 X-FUNCTION: GContext XGContextFromGC ( GC gc )
361
362 X-FUNCTION: Status XSetFont ( Display* display, GC gc, Font font )
363
364 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
365 ! 8 - Graphics Functions
366 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
367
368 X-FUNCTION: Status XClearWindow ( Display* display, Window w )
369 X-FUNCTION: Status XDrawPoint ( Display* display, Drawable d, GC gc, int x, int y )
370 X-FUNCTION: Status XDrawLine ( Display* display, Drawable d, GC gc, int x1, int y1, int x2, int y2 )
371 X-FUNCTION: Status XDrawArc ( Display* display, Drawable d, GC gc, int x, int y, uint width, uint height, int angle1, int angle2 )
372 X-FUNCTION: Status XFillArc ( Display* display, Drawable d, GC gc, int x, int y, uint width, uint height, int angle1, int angle2 )
373
374 ! 8.5 - Font Metrics
375
376 STRUCT: XCharStruct
377     { lbearing short }
378     { rbearing short }
379     { width short }
380     { ascent short }
381     { descent short }
382     { attributes ushort } ;
383
384 STRUCT: XFontStruct
385     { ext_data XExtData* }
386     { fid Font }
387     { direction uint }
388     { min_char_or_byte2 uint }
389     { max_char_or_byte2 uint }
390     { min_byte1 uint }
391     { max_byte1 uint }
392     { all_chars_exist Bool }
393     { default_char uint }
394     { n_properties int }
395     { properties XFontProp* }
396     { min_bounds XCharStruct }
397     { max_bounds XCharStruct }
398     { per_char XCharStruct* }
399     { ascent int }
400     { descent int } ;
401
402 X-FUNCTION: Font XLoadFont ( Display* display, c-string name )
403 X-FUNCTION: XFontStruct* XQueryFont ( Display* display, XID font_ID )
404 X-FUNCTION: XFontStruct* XLoadQueryFont ( Display* display, c-string name )
405
406 X-FUNCTION: int XTextWidth ( XFontStruct* font_struct, c-string string, int count )
407
408 ! 8.6 - Drawing Text
409
410 X-FUNCTION: Status XDrawString (
411         Display* display,
412         Drawable d,
413         GC gc,
414         int x,
415         int y,
416         c-string string,
417         int length )
418
419 ! 8.7 - Transferring Images between Client and Server
420
421 CONSTANT: AllPlanes -1
422
423 STRUCT: XImage-funcs
424     { create_image void* }
425     { destroy_image void* }
426     { get_pixel void* }
427     { put_pixel void* }
428     { sub_image void* }
429     { add_pixel void* } ;
430
431 STRUCT: XImage
432     { width int }
433     { height int }
434     { xoffset int }
435     { format int }
436     { data uchar* }
437     { byte_order int }
438     { bitmap_unit int }
439     { bitmap_bit_order int }
440     { bitmap_pad int }
441     { depth int }
442     { bytes_per_line int }
443     { bits_per_pixel int }
444     { red_mask ulong }
445     { green_mask ulong }
446     { blue_mask ulong }
447     { obdata XPointer }
448     { f XImage-funcs } ;
449
450 X-FUNCTION: XImage* XGetImage ( Display* display, Drawable d, int x, int y, uint width, uint height, ulong plane_mask, int format )
451 X-FUNCTION: int XDestroyImage ( XImage* ximage )
452
453 : XImage-size ( ximage -- size )
454     [ height>> ] [ bytes_per_line>> ] bi * ;
455
456 : XImage-pixels ( ximage -- byte-array )
457     [ data>> ] [ XImage-size ] bi memory>byte-array ;
458
459 !
460 ! 9 - Window and Session Manager Functions
461 !
462
463 X-FUNCTION: Status XReparentWindow ( Display* display, Window w, Window parent, int x, int y )
464 X-FUNCTION: Status XAddToSaveSet ( Display* display, Window w )
465 X-FUNCTION: Status XRemoveFromSaveSet ( Display* display, Window w )
466 X-FUNCTION: Status XGrabServer ( Display* display )
467 X-FUNCTION: Status XUngrabServer ( Display* display )
468 X-FUNCTION: Status XKillClient ( Display* display, XID resource )
469
470 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
471 ! 10 - Events
472 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
473
474 ! 10.3 - Event Masks
475
476 STRUCT: XAnyEvent
477     { type int }
478     { serial ulong }
479     { send_event Bool }
480     { display Display* }
481     { window Window } ;
482
483 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
484
485 ! 10.5 Keyboard and Pointer Events
486
487 STRUCT: XButtonEvent
488     { type int }
489     { serial ulong }
490     { send_event Bool }
491     { display Display* }
492     { window Window }
493     { root Window }
494     { subwindow Window }
495     { time Time }
496     { x int }
497     { y int }
498     { x_root int }
499     { y_root int }
500     { state uint }
501     { button uint }
502     { same_screen Bool } ;
503
504 TYPEDEF: XButtonEvent XButtonPressedEvent
505 TYPEDEF: XButtonEvent XButtonReleasedEvent
506
507
508 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
509
510 STRUCT: XKeyEvent
511     { type int }
512     { serial ulong }
513     { send_event Bool }
514     { display Display* }
515     { window Window }
516     { root Window }
517     { subwindow Window }
518     { time Time }
519     { x int }
520     { y int }
521     { x_root int }
522     { y_root int }
523     { state uint }
524     { keycode uint }
525     { same_screen Bool } ;
526
527 TYPEDEF: XKeyEvent XKeyPressedEvent
528 TYPEDEF: XKeyEvent XKeyReleasedEvent
529
530 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
531
532 STRUCT: XMotionEvent
533     { type int }
534     { serial ulong }
535     { send_event Bool }
536     { display Display* }
537     { window Window }
538     { root Window }
539     { subwindow Window }
540     { time Time }
541     { x int }
542     { y int }
543     { x_root int }
544     { y_root int }
545     { state uint }
546     { is_hint char }
547     { same_screen Bool } ;
548
549 TYPEDEF: XMotionEvent XPointerMovedEvent
550
551 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
552
553 STRUCT: XCrossingEvent
554     { type int }
555     { serial ulong }
556     { send_event Bool }
557     { display Display* }
558     { window Window }
559     { root Window }
560     { subwindow Window }
561     { time Time }
562     { x int }
563     { y int }
564     { x_root int }
565     { y_root int }
566     { mode int }
567     { detail int }
568     { same_screen Bool }
569     { focus Bool }
570     { state uint } ;
571
572 TYPEDEF: XCrossingEvent XEnterWindowEvent
573 TYPEDEF: XCrossingEvent XLeaveWindowEvent
574
575 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
576
577 STRUCT: XFocusChangeEvent
578     { type int }
579     { serial ulong }
580     { send_event Bool }
581     { display Display* }
582     { window Window }
583     { mode int }
584     { detail int } ;
585
586 TYPEDEF: XFocusChangeEvent XFocusInEvent
587 TYPEDEF: XFocusChangeEvent XFocusOutEvent
588
589 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
590
591 STRUCT: XExposeEvent
592     { type int }
593     { serial ulong }
594     { send_event Bool }
595     { display Display* }
596     { window Window }
597     { x int }
598     { y int }
599     { width int }
600     { height int }
601     { count int } ;
602
603 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
604
605 STRUCT: XGraphicsExposeEvent
606     { type int }
607     { serial ulong }
608     { send_event Bool }
609     { display Display* }
610     { drawable Drawable }
611     { x int }
612     { y int }
613     { width int }
614     { height int }
615     { count int }
616     { major_code int }
617     { minor_code int } ;
618
619 STRUCT: XNoExposeEvent
620     { type int }
621     { serial ulong }
622     { send_event Bool }
623     { display Display* }
624     { drawable Drawable }
625     { major_code int }
626     { minor_code int } ;
627
628 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
629
630 STRUCT: XVisibilityEvent
631     { type int }
632     { serial ulong }
633     { send_event Bool }
634     { display Display* }
635     { window Window }
636     { state int } ;
637
638 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
639
640 STRUCT: XCreateWindowEvent
641     { type int }
642     { serial ulong }
643     { send_event Bool }
644     { display Display* }
645     { parent Window }
646     { window Window }
647     { x int }
648     { y int }
649     { width int }
650     { height int }
651     { border_width int }
652     { override_redirect Bool } ;
653
654 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
655
656 STRUCT: XDestroyWindowEvent
657     { type int }
658     { serial ulong }
659     { send_event Bool }
660     { display Display* }
661     { event Window }
662     { window Window } ;
663
664 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
665
666 STRUCT: XUnmapEvent
667     { type int }
668     { serial ulong }
669     { send_event Bool }
670     { display Display* }
671     { event Window }
672     { window Window }
673     { from_configure Bool } ;
674
675 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
676
677 STRUCT: XMapEvent
678     { type int }
679     { serial ulong }
680     { send_event Bool }
681     { display Display* }
682     { event Window }
683     { window Window }
684     { override_redirect Bool } ;
685
686 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
687
688 STRUCT: XMapRequestEvent
689     { type int }
690     { serial ulong }
691     { send_event Bool }
692     { display Display* }
693     { parent Window }
694     { window Window } ;
695
696 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
697
698 STRUCT: XReparentEvent
699     { type int }
700     { serial ulong }
701     { send_event Bool }
702     { display Display* }
703     { event Window }
704     { window Window }
705     { parent Window }
706     { x int }
707     { y int }
708     { override_redirect Bool } ;
709
710 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
711
712 STRUCT: XConfigureEvent
713     { type int }
714     { serial ulong }
715     { send_event Bool }
716     { display Display* }
717     { event Window }
718     { window Window }
719     { x int }
720     { y int }
721     { width int }
722     { height int }
723     { border_width int }
724     { above Window }
725     { override_redirect Bool } ;
726
727 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
728
729 STRUCT: XGravityEvent
730     { type int }
731     { serial ulong }
732     { send_event Bool }
733     { display Display* }
734     { event Window }
735     { window Window }
736     { x int }
737     { y int } ;
738
739 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
740
741 STRUCT: XResizeRequestEvent
742     { type int }
743     { serial ulong }
744     { send_event Bool }
745     { display Display* }
746     { window Window }
747     { width int }
748     { height int } ;
749
750 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
751
752 STRUCT: XConfigureRequestEvent
753     { type int }
754     { serial ulong }
755     { send_event Bool }
756     { display Display* }
757     { parent Window }
758     { window Window }
759     { x int }
760     { y int }
761     { width int }
762     { height int }
763     { border_width int }
764     { above Window }
765     { detail int }
766     { value_mask ulong } ;
767
768 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
769
770 STRUCT: XCirculateEvent
771     { type int }
772     { serial ulong }
773     { send_event Bool }
774     { display Display* }
775     { event Window }
776     { window Window }
777     { place int } ;
778
779 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
780
781 STRUCT: XCirculateRequestEvent
782     { type int }
783     { serial ulong }
784     { send_event Bool }
785     { display Display* }
786     { parent Window }
787     { window Window }
788     { place int } ;
789
790 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
791
792 STRUCT: XPropertyEvent
793     { type int }
794     { serial ulong }
795     { send_event Bool }
796     { display Display* }
797     { window Window }
798     { atom Atom }
799     { time Time }
800     { state int } ;
801
802 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
803
804 STRUCT: XSelectionClearEvent
805     { type int }
806     { serial ulong }
807     { send_event Bool }
808     { display Display* }
809     { window Window }
810     { selection Atom }
811     { time Time } ;
812
813 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
814
815 STRUCT: XSelectionRequestEvent
816     { type int }
817     { serial ulong }
818     { send_event Bool }
819     { display Display* }
820     { owner Window }
821     { requestor Window }
822     { selection Atom }
823     { target Atom }
824     { property Atom }
825     { time Time } ;
826
827 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
828
829 STRUCT: XSelectionEvent
830     { type int }
831     { serial ulong }
832     { send_event Bool }
833     { display Display* }
834     { requestor Window }
835     { selection Atom }
836     { target Atom }
837     { property Atom }
838     { time Time } ;
839
840 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
841
842 STRUCT: XColormapEvent
843     { type int }
844     { serial ulong }
845     { send_event Bool }
846     { display Display* }
847     { window Window }
848     { colormap Colormap }
849     { new Bool }
850     { state int } ;
851
852 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
853
854 STRUCT: XClientMessageEvent
855     { type int }
856     { serial ulong }
857     { send_event Bool }
858     { display Display* }
859     { window Window }
860     { message_type Atom }
861     { format int }
862     { data0 long }
863     { data1 long }
864     { data2 long }
865     { data3 long }
866     { data4 long } ;
867
868 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
869
870 STRUCT: XMappingEvent
871     { type int }
872     { serial ulong }
873     { send_event Bool }
874     { display Display* }
875     { window Window }
876     { request int }
877     { first_keycode int }
878     { count int } ;
879
880 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
881
882 STRUCT: XErrorEvent
883     { type int }
884     { display Display* }
885     { resourceid XID }
886     { serial ulong }
887     { error_code uchar }
888     { request_code uchar }
889     { minor_code uchar } ;
890
891 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
892
893 STRUCT: XKeymapEvent
894     { type int }
895     { serial ulong }
896     { send_event Bool }
897     { display Display* }
898     { window Window }
899     { pad int[8] } ;
900
901 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
902
903 ! Newer things, needed for XInput2 support. Not in the book.
904
905 ! GenericEvent is the standard event for all newer extensions.
906 STRUCT: XGenericEvent
907     { type int }
908     { serial ulong }
909     { send_event Bool }
910     { display Display* }
911     { extension int }
912     { evtype int } ;
913
914 STRUCT: XGenericEventCookie
915     { type int }
916     { serial ulong }
917     { send_event Bool }
918     { display Display* }
919     { extension int }
920     { evtype int }
921     { cookie uint }
922     { data void* } ;
923
924 X-FUNCTION: Bool XGetEventData ( Display* dpy, XGenericEventCookie* cookie )
925 X-FUNCTION: void XFreeEventData ( Display* dpy, XGenericEventCookie* cookie )
926
927 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
928
929 UNION-STRUCT: XEvent
930     { int int }
931     { XAnyEvent XAnyEvent }
932     { XKeyEvent XKeyEvent }
933     { XButtonEvent XButtonEvent }
934     { XMotionEvent XMotionEvent }
935     { XCrossingEvent XCrossingEvent }
936     { XFocusChangeEvent XFocusChangeEvent }
937     { XExposeEvent XExposeEvent }
938     { XGraphicsExposeEvent XGraphicsExposeEvent }
939     { XNoExposeEvent XNoExposeEvent }
940     { XVisibilityEvent XVisibilityEvent }
941     { XCreateWindowEvent XCreateWindowEvent }
942     { XDestroyWindowEvent XDestroyWindowEvent }
943     { XUnmapEvent XUnmapEvent }
944     { XMapEvent XMapEvent }
945     { XMapRequestEvent XMapRequestEvent }
946     { XReparentEvent XReparentEvent }
947     { XConfigureEvent XConfigureEvent }
948     { XGravityEvent XGravityEvent }
949     { XResizeRequestEvent XResizeRequestEvent }
950     { XConfigureRequestEvent XConfigureRequestEvent }
951     { XCirculateEvent XCirculateEvent }
952     { XCirculateRequestEvent XCirculateRequestEvent }
953     { XPropertyEvent XPropertyEvent }
954     { XSelectionClearEvent XSelectionClearEvent }
955     { XSelectionRequestEvent XSelectionRequestEvent }
956     { XSelectionEvent XSelectionEvent }
957     { XColormapEvent XColormapEvent }
958     { XClientMessageEvent XClientMessageEvent }
959     { XMappingEvent XMappingEvent }
960     { XErrorEvent XErrorEvent }
961     { XKeymapEvent XKeymapEvent }
962     { XGenericEvent XGenericEvent }
963     { XGenericEventCookie XGenericEventCookie }
964     { padding long[24] } ;
965
966 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
967 ! 11 - Event Handling Functions
968 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
969
970 X-FUNCTION: Status XSelectInput ( Display* display, Window w, long event_mask )
971 X-FUNCTION: Status XFlush ( Display* display )
972 X-FUNCTION: Status XSync ( Display* display, int discard )
973 X-FUNCTION: Status XNextEvent ( Display* display, XEvent* event )
974 X-FUNCTION: Status XMaskEvent ( Display* display,
975                                 long event_mask,
976                                 XEvent* event_return )
977
978 ! 11.3 - Event Queue Management
979
980 CONSTANT: QueuedAlready 0
981 CONSTANT: QueuedAfterReading 1
982 CONSTANT: QueuedAfterFlush 2
983
984 X-FUNCTION: int XEventsQueued ( Display* display, int mode )
985 X-FUNCTION: int XPending ( Display* display )
986
987 ! 11.6 - Sending Events to Other Applications
988
989 X-FUNCTION: Status XSendEvent ( Display* display,
990                                 Window w,
991                                 Bool propagate,
992                                 long event_mask,
993                                 XEvent* event_send )
994
995 ! 11.8 - Handling Protocol Errors
996
997 X-FUNCTION: int XSetErrorHandler ( void* handler )
998
999 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1000 ! 12 - Input Device Functions
1001 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1002 X-FUNCTION: int XGrabPointer (
1003     Display* display,
1004     Window grab_window,
1005     Bool owner_events,
1006     uint event_mask,
1007     int pointer_mode,
1008     int keyboard_mode,
1009     Window confine_to,
1010     Cursor cursor,
1011     Time time
1012 )
1013
1014 X-FUNCTION: Status XUngrabPointer ( Display* display, Time time )
1015 X-FUNCTION: Status XChangeActivePointerGrab ( Display* display, uint event_mask, Cursor cursor, Time time )
1016 X-FUNCTION: Status XGrabKey (
1017     Display* display, int keycode, uint modifiers,
1018     Window grab_window, Bool owner_events,
1019     int pointer_mode, int keyboard_mode
1020 )
1021 X-FUNCTION: int XGrabKeyboard (
1022     Display* display, Window grab_window,
1023     Bool owner_events,
1024     int pointer_mode, int keyboard_mode, Time time
1025 )
1026 X-FUNCTION: Status XSetInputFocus ( Display* display, Window focus, int revert_to, Time time )
1027
1028 X-FUNCTION: Status XGetInputFocus (
1029     Display* display,
1030     Window* focus_return,
1031     int* revert_to_return
1032 )
1033
1034 X-FUNCTION: Status XWarpPointer (
1035     Display* display,
1036     Window src_w, Window dest_w,
1037     int src_x, int src_y, uint src_width, uint src_height,
1038     int dest_x, int dest_y
1039 )
1040
1041 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1042 ! 14 - Inter-Client Communication Functions
1043 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1044
1045 ! 14.1 Client to Window Manager Communication
1046
1047 X-FUNCTION: Status XFetchName ( Display* display, Window w, c-string* window_name_return )
1048 X-FUNCTION: Status XGetTransientForHint ( Display* display, Window w, Window* prop_window_return )
1049
1050 ! 14.1.1.  Manipulating Top-Level Windows
1051
1052 X-FUNCTION: Status XIconifyWindow (
1053     Display* display,
1054     Window w,
1055     int screen_number
1056 )
1057
1058 X-FUNCTION: Status XWithdrawWindow (
1059     Display* display,
1060     Window w,
1061     int screen_number
1062 )
1063
1064 ! 14.1.6 - Setting and Reading the WM_HINTS Property
1065
1066 ! 17.1.7 - Setting and Reading the WM_NORMAL_HINTS Property
1067
1068 : USPosition   ( -- n ) 0 2^ ; inline
1069 : USSize       ( -- n ) 1 2^ ; inline
1070 : PPosition    ( -- n ) 2 2^ ; inline
1071 : PSize        ( -- n ) 3 2^ ; inline
1072 : PMinSize     ( -- n ) 4 2^ ; inline
1073 : PMaxSize     ( -- n ) 5 2^ ; inline
1074 : PResizeInc   ( -- n ) 6 2^ ; inline
1075 : PAspect      ( -- n ) 7 2^ ; inline
1076 : PBaseSize    ( -- n ) 8 2^ ; inline
1077 : PWinGravity  ( -- n ) 9 2^ ; inline
1078 CONSTANT: PAllHints
1079     flags{ PPosition PSize PMinSize PMaxSize PResizeInc PAspect }
1080
1081 STRUCT: XSizeHints
1082     { flags long }
1083     { x int }
1084     { y int }
1085     { width int }
1086     { height int }
1087     { min_width int }
1088     { min_height int }
1089     { max_width int }
1090     { max_height int }
1091     { width_inc int }
1092     { height_inc int }
1093     { min_aspect_x int }
1094     { min_aspect_y int }
1095     { max_aspect_x int }
1096     { max_aspect_y int }
1097     { base_width int }
1098     { base_height int }
1099     { win_gravity int } ;
1100
1101 ! 14.1.10.  Setting and Reading the WM_PROTOCOLS Property
1102
1103 X-FUNCTION: Status XSetWMProtocols (
1104         Display* display, Window w, Atom* protocols, int count )
1105
1106 X-FUNCTION: Status XGetWMProtocols (
1107         Display* display,
1108         Window w,
1109         Atom** protocols_return,
1110         int* count_return )
1111
1112 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1113 ! 16 - Application Utility Functions
1114 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1115
1116 ! 16.1 Keyboard Utility Functions
1117
1118 X-FUNCTION: KeySym XLookupKeysym ( XKeyEvent* key_event, int index )
1119
1120 X-FUNCTION: int XLookupString (
1121     XKeyEvent* event_struct,
1122     void* buffer_return,
1123     int bytes_buffer,
1124     KeySym* keysym_return,
1125     XComposeStatus* status_in_out
1126 )
1127
1128 ! 16.7 Determining the Appropriate Visual Type
1129
1130 CONSTANT: VisualNoMask                  0x0
1131 CONSTANT: VisualIDMask                  0x1
1132 CONSTANT: VisualScreenMask              0x2
1133 CONSTANT: VisualDepthMask               0x4
1134 CONSTANT: VisualClassMask               0x8
1135 CONSTANT: VisualRedMaskMask             0x10
1136 CONSTANT: VisualGreenMaskMask           0x20
1137 CONSTANT: VisualBlueMaskMask            0x40
1138 CONSTANT: VisualColormapSizeMask        0x80
1139 CONSTANT: VisualBitsPerRGBMask          0x100
1140 CONSTANT: VisualAllMask                 0x1FF
1141
1142 STRUCT: XVisualInfo
1143     { visual Visual* }
1144     { visualid VisualID }
1145     { screen int }
1146     { depth uint }
1147     { class int }
1148     { red_mask ulong }
1149     { green_mask ulong }
1150     { blue_mask ulong }
1151     { colormap_size int }
1152     { bits_per_rgb int } ;
1153
1154 ! 16.9 Manipulating Bitmaps
1155 X-FUNCTION: Pixmap XCreateBitmapFromData (
1156     Display* display,
1157     Drawable d,
1158     c-string data,
1159     uint width,
1160     uint height )
1161
1162 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1163 ! Appendix C - Extensions
1164 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1165 X-FUNCTION: Bool XQueryExtension (
1166     Display* display,
1167     c-string name,
1168     int* major_opcode_return,
1169     int* first_event_return,
1170     int* first_error_return
1171 )
1172
1173 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1174 ! Appendix D - Compatibility Functions
1175 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1176
1177 X-FUNCTION: Status XSetStandardProperties (
1178     Display* display,
1179     Window w,
1180     c-string window_name,
1181     c-string icon_name,
1182     Pixmap icon_pixmap,
1183     c-string* argv,
1184     int argc,
1185     XSizeHints* hints
1186 )
1187
1188 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1189
1190 CONSTANT: XA_PRIMARY  1
1191 CONSTANT: XA_SECONDARY 2
1192 CONSTANT: XA_ARC 3
1193 CONSTANT: XA_ATOM 4
1194 CONSTANT: XA_BITMAP 5
1195 CONSTANT: XA_CARDINAL 6
1196 CONSTANT: XA_COLORMAP 7
1197 CONSTANT: XA_CURSOR 8
1198 CONSTANT: XA_CUT_BUFFER0 9
1199 CONSTANT: XA_CUT_BUFFER1 10
1200 CONSTANT: XA_CUT_BUFFER2 11
1201 CONSTANT: XA_CUT_BUFFER3 12
1202 CONSTANT: XA_CUT_BUFFER4 13
1203 CONSTANT: XA_CUT_BUFFER5 14
1204 CONSTANT: XA_CUT_BUFFER6 15
1205 CONSTANT: XA_CUT_BUFFER7 16
1206 CONSTANT: XA_DRAWABLE 17
1207 CONSTANT: XA_FONT 18
1208 CONSTANT: XA_INTEGER 19
1209 CONSTANT: XA_PIXMAP 20
1210 CONSTANT: XA_POINT 21
1211 CONSTANT: XA_RECTANGLE 22
1212 CONSTANT: XA_RESOURCE_MANAGER 23
1213 CONSTANT: XA_RGB_COLOR_MAP 24
1214 CONSTANT: XA_RGB_BEST_MAP 25
1215 CONSTANT: XA_RGB_BLUE_MAP 26
1216 CONSTANT: XA_RGB_DEFAULT_MAP 27
1217 CONSTANT: XA_RGB_GRAY_MAP 28
1218 CONSTANT: XA_RGB_GREEN_MAP 29
1219 CONSTANT: XA_RGB_RED_MAP 30
1220 CONSTANT: XA_STRING 31
1221 CONSTANT: XA_VISUALID 32
1222 CONSTANT: XA_WINDOW 33
1223 CONSTANT: XA_WM_COMMAND 34
1224 CONSTANT: XA_WM_HINTS 35
1225 CONSTANT: XA_WM_CLIENT_MACHINE 36
1226 CONSTANT: XA_WM_ICON_NAME 37
1227 CONSTANT: XA_WM_ICON_SIZE 38
1228 CONSTANT: XA_WM_NAME 39
1229 CONSTANT: XA_WM_NORMAL_HINTS 40
1230 CONSTANT: XA_WM_SIZE_HINTS 41
1231 CONSTANT: XA_WM_ZOOM_HINTS 42
1232 CONSTANT: XA_MIN_SPACE 43
1233 CONSTANT: XA_NORM_SPACE 44
1234 CONSTANT: XA_MAX_SPACE 45
1235 CONSTANT: XA_END_SPACE 46
1236 CONSTANT: XA_SUPERSCRIPT_X 47
1237 CONSTANT: XA_SUPERSCRIPT_Y 48
1238 CONSTANT: XA_SUBSCRIPT_X 49
1239 CONSTANT: XA_SUBSCRIPT_Y 50
1240 CONSTANT: XA_UNDERLINE_POSITION 51
1241 CONSTANT: XA_UNDERLINE_THICKNESS 52
1242 CONSTANT: XA_STRIKEOUT_ASCENT 53
1243 CONSTANT: XA_STRIKEOUT_DESCENT 54
1244 CONSTANT: XA_ITALIC_ANGLE 55
1245 CONSTANT: XA_X_HEIGHT 56
1246 CONSTANT: XA_QUAD_WIDTH 57
1247 CONSTANT: XA_WEIGHT 58
1248 CONSTANT: XA_POINT_SIZE 59
1249 CONSTANT: XA_RESOLUTION 60
1250 CONSTANT: XA_COPYRIGHT 61
1251 CONSTANT: XA_NOTICE 62
1252 CONSTANT: XA_FONT_NAME 63
1253 CONSTANT: XA_FAMILY_NAME 64
1254 CONSTANT: XA_FULL_NAME 65
1255 CONSTANT: XA_CAP_HEIGHT 66
1256 CONSTANT: XA_WM_CLASS 67
1257 CONSTANT: XA_WM_TRANSIENT_FOR 68
1258
1259 CONSTANT: XA_LAST_PREDEFINED 68
1260
1261 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1262 ! The rest of the stuff is not from the book.
1263 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1264
1265 X-FUNCTION: void XFree ( void* data )
1266 X-FUNCTION: int XStoreName ( Display* display, Window w, c-string window_name )
1267 X-FUNCTION: void XSetWMNormalHints ( Display* display,
1268                                      Window w,
1269                                      XSizeHints* hints )
1270 X-FUNCTION: int XBell ( Display* display, int percent )
1271
1272 ! !!! INPUT METHODS
1273
1274 CONSTANT: XIMPreeditArea      0x0001
1275 CONSTANT: XIMPreeditCallbacks 0x0002
1276 CONSTANT: XIMPreeditPosition  0x0004
1277 CONSTANT: XIMPreeditNothing   0x0008
1278 CONSTANT: XIMPreeditNone      0x0010
1279 CONSTANT: XIMStatusArea       0x0100
1280 CONSTANT: XIMStatusCallbacks  0x0200
1281 CONSTANT: XIMStatusNothing    0x0400
1282 CONSTANT: XIMStatusNone       0x0800
1283
1284 CONSTANT: XNVaNestedList "XNVaNestedList"
1285 CONSTANT: XNQueryInputStyle "queryInputStyle"
1286 CONSTANT: XNClientWindow "clientWindow"
1287 CONSTANT: XNInputStyle "inputStyle"
1288 CONSTANT: XNFocusWindow "focusWindow"
1289 CONSTANT: XNResourceName "resourceName"
1290 CONSTANT: XNResourceClass "resourceClass"
1291 CONSTANT: XNGeometryCallback "geometryCallback"
1292 CONSTANT: XNDestroyCallback "destroyCallback"
1293 CONSTANT: XNFilterEvents "filterEvents"
1294 CONSTANT: XNPreeditStartCallback "preeditStartCallback"
1295 CONSTANT: XNPreeditDoneCallback "preeditDoneCallback"
1296 CONSTANT: XNPreeditDrawCallback "preeditDrawCallback"
1297 CONSTANT: XNPreeditCaretCallback "preeditCaretCallback"
1298 CONSTANT: XNPreeditStateNotifyCallback "preeditStateNotifyCallback"
1299 CONSTANT: XNPreeditAttributes "preeditAttributes"
1300 CONSTANT: XNStatusStartCallback "statusStartCallback"
1301 CONSTANT: XNStatusDoneCallback "statusDoneCallback"
1302 CONSTANT: XNStatusDrawCallback "statusDrawCallback"
1303 CONSTANT: XNStatusAttributes "statusAttributes"
1304 CONSTANT: XNArea "area"
1305 CONSTANT: XNAreaNeeded "areaNeeded"
1306 CONSTANT: XNSpotLocation "spotLocation"
1307 CONSTANT: XNColormap "colorMap"
1308 CONSTANT: XNStdColormap "stdColorMap"
1309 CONSTANT: XNForeground "foreground"
1310 CONSTANT: XNBackground "background"
1311 CONSTANT: XNBackgroundPixmap "backgroundPixmap"
1312 CONSTANT: XNFontSet "fontSet"
1313 CONSTANT: XNLineSpace "lineSpace"
1314 CONSTANT: XNCursor "cursor"
1315
1316 CONSTANT: XNQueryIMValuesList "queryIMValuesList"
1317 CONSTANT: XNQueryICValuesList "queryICValuesList"
1318 CONSTANT: XNVisiblePosition "visiblePosition"
1319 CONSTANT: XNR6PreeditCallback "r6PreeditCallback"
1320 CONSTANT: XNStringConversionCallback "stringConversionCallback"
1321 CONSTANT: XNStringConversion "stringConversion"
1322 CONSTANT: XNResetState "resetState"
1323 CONSTANT: XNHotKey "hotKey"
1324 CONSTANT: XNHotKeyState "hotKeyState"
1325 CONSTANT: XNPreeditState "preeditState"
1326 CONSTANT: XNSeparatorofNestedList "separatorofNestedList"
1327
1328 CONSTANT: XBufferOverflow -1
1329 CONSTANT: XLookupNone      1
1330 CONSTANT: XLookupChars     2
1331 CONSTANT: XLookupKeySym    3
1332 CONSTANT: XLookupBoth      4
1333
1334 X-FUNCTION: Bool XFilterEvent ( XEvent* event, Window w )
1335
1336 X-FUNCTION: XIM XOpenIM ( Display* dpy,
1337                           void* rdb,
1338                           c-string res_name,
1339                           c-string res_class )
1340
1341 X-FUNCTION: Status XCloseIM ( XIM im )
1342
1343 X-FUNCTION: XIC XCreateIC ( XIM im,
1344                             c-string key1, Window value1,
1345                             c-string key2, Window value2,
1346                             c-string key3, int value3,
1347                             c-string key4, c-string value4,
1348                             c-string key5, c-string value5,
1349                             int key6 )
1350
1351 X-FUNCTION: void XDestroyIC ( XIC ic )
1352
1353 X-FUNCTION: void XSetICFocus ( XIC ic )
1354
1355 X-FUNCTION: void XUnsetICFocus ( XIC ic )
1356
1357 X-FUNCTION: int XwcLookupString ( XIC ic,
1358                                   XKeyPressedEvent* event,
1359                                   ulong* buffer_return,
1360                                   int bytes_buffer,
1361                                   KeySym* keysym_return,
1362                                   Status* status_return )
1363
1364 X-FUNCTION: int Xutf8LookupString ( XIC ic,
1365                                     XKeyPressedEvent* event,
1366                                     c-string buffer_return,
1367                                     int bytes_buffer,
1368                                     KeySym* keysym_return,
1369                                     Status* status_return )
1370
1371 ! !!! category of setlocale
1372 CONSTANT: LC_ALL      0
1373 CONSTANT: LC_COLLATE  1
1374 CONSTANT: LC_CTYPE    2
1375 CONSTANT: LC_MONETARY 3
1376 CONSTANT: LC_NUMERIC  4
1377 CONSTANT: LC_TIME     5
1378
1379 X-FUNCTION: c-string setlocale ( int category, c-string name )
1380
1381 X-FUNCTION: Bool XSupportsLocale ( )
1382
1383 X-FUNCTION: c-string XSetLocaleModifiers ( c-string modifier_list )
1384
1385 ! uncategorized xlib bindings
1386
1387 X-FUNCTION: int XQueryKeymap ( Display* display, char[32] keys_return )