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