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