Added config options for call and sms ringtones
[gregoa/zavai.git] / src / x11.vapi
1 /* x11.vapi
2  *
3  * Copyright (C) 2009  Jürg Billeter
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
18  *
19  * Author:
20  *      Jürg Billeter <j@bitron.ch>
21  */
22
23 [CCode (cprefix = "", lower_case_cprefix = "", cheader_filename = "X11/Xlib.h,X11/Xatom.h,X11/Xutil.h")]
24 namespace X {
25         // Note: must be called before opening a display or calling any other Xlib function,
26         // see http://tronche.com/gui/x/xlib/display/XInitThreads.html
27         [CCode (cname = "XInitThreads")]
28         public Status init_threads ();
29
30         [Compact]
31         [CCode (cname = "Display", ref_function = "", unref_function = "")]
32         public class Display {
33                 [CCode (cname = "XOpenDisplay")]
34                 public Display (string? name = null);
35
36                 [CCode (cname = "XGetAtomName")]
37                 public string get_atom_name(Atom a);
38
39                 [CCode (cname = "XAllPlanes")]
40                 public static ulong get_all_planes ();
41
42                 [CCode (cname = "XAddToSaveSet")]
43                 public int add_to_save_set (Window w);
44
45                 [CCode (cname = "XAllowEvents")]
46                 public int allow_events (int event_mode, int time);
47
48                 [CCode (cname = "XBitmapBitOrder")]
49                 public int bitmap_bit_order ();
50
51                 [CCode (cname = "XBitmapUnit")]
52                 public int bitmap_scanline_unit ();
53
54                 [CCode (cname = "XBitmapPad")]
55                 public int bitmap_scanline_padding ();
56
57                 [CCode (cname = "XChangeProperty")]
58                 public int change_property (Window w, Atom property, Atom type, int format, int mode, [CCode (array_length = false)] uchar[] data, int nelements);
59
60                 [CCode (cname = "XChangeWindowAttributes")]
61                 public int change_window_attributes (Window w, ulong valuemask, SetWindowAttributes attributes);
62
63                 [CCode (cname = "XConfigureWindow")]
64                 public int configure_window (Window w, uint value_mask, WindowChanges values);
65
66                 [CCode (cname = "ConnectionNumber")]
67                 public int connection_number ();
68
69                 [CCode (cname = "DefaultRootWindow")]
70                 public Window default_root_window ();
71
72                 [CCode (cname = "XDefaultScreenOfDisplay")]
73                 public unowned Screen default_screen ();
74
75                 [CCode (cname = "XScreenOfDisplay")]
76                 public unowned Screen screen_by_id (int screen_number);
77
78                 [CCode (cname = "DisplayString")]
79                 public string display_string ();
80
81                 [CCode (cname = "XQLength")]
82                 public int event_queue_length ();
83
84                 [CCode (cname = "XFlush")]
85                 public int flush ();
86
87                 [CCode (cname = "XGetKeyboardMapping", array_length = false)]
88                 public weak uint[] get_keyboard_mapping (uint first_keycode, int keycode_count, ref int keysyms_per_keycode_return);
89
90                 [CCode (cname = "XGetModifierMapping")]
91                 public ModifierKeymap get_modifier_mapping ();
92
93                 [CCode (cname = "XGetSelectionOwner")]
94                 public Window get_selection_owner (Atom selection);
95
96                 [CCode (cname = "XGetWindowAttributes")]
97                 public void get_window_attributes (Window w, out WindowAttributes window_attributes_return);
98
99                 [CCode (cname = "XGetWindowProperty")]
100                 public int get_window_property (Window w, Atom property, long long_offset, long long_length, bool delete, Atom req_type, out Atom actual_type_return, out int actual_format_return, out ulong nitems_return, out ulong bytes_after_return, out void* prop_return);
101
102                 [CCode (cname = "XGrabButton")]
103                 public int grab_button (uint button, uint modifiers, Window grab_window, bool owner_events, uint event_mask, int pointer_mode, int keyboard_mode, Window confine_to, uint cursor);
104
105                 [CCode (cname = "XGrabKey")]
106                 public int grab_key (int keycode, uint modifiers, Window grab_window, bool owner_events, int pointer_mode, int keyboard_mode);
107
108                 [CCode (cname = "XGrabPointer")]
109                 public int grab_pointer (Window grab_window, bool owner_events, uint event_mask, int pointer_mode, int keyboard_mode, Window confine_to, uint cursor, int time);
110
111                 [CCode (cname = "XGrabServer")]
112                 public int grab_server ();
113
114                 [CCode (cname = "XImageByteOrder")]
115                 public int image_byte_order ();
116
117                 [CCode (cname = "XInternAtom")]
118                 public Atom intern_atom (string atom_name, bool only_if_exists);
119
120                 [CCode (cname = "XInternAtoms")]
121                 public void intern_atoms (string[] names, bool only_if_exists, [CCode (array_length = false)] Atom[] atoms_return);
122
123                 [CCode (cname = "XInternalConnectionNumbers")]
124                 public Status internal_connection_numbers (ref int[] fd_return);
125
126                 [CCode (cname = "XDisplayKeycodes")]
127                 public int keycodes (ref int min_keycodes_return, ref int max_keycodes_return);
128
129                 [CCode (cname = "XKeysymToKeycode")]
130                 public int keysym_to_keycode (uint keysym);
131
132                 [CCode (cname = "XLastKnownRequestProcessed")]
133                 public ulong last_known_request_processed ();
134
135                 [CCode (cname = "XLockDisplay")]
136                 public void lock_display ();
137
138                 [CCode (cname = "XMapWindow")]
139                 public int map_window (Window w);
140
141                 [CCode (cname = "XMaxRequestSize")]
142                 public long max_request_size ();
143
144                 [CCode (cname = "XExtendedMaxRequestSize")]
145                 public long max_extended_request_size ();
146
147                 [CCode (cname = "XNextEvent")]
148                 public int next_event (ref Event event_return);
149
150                 [CCode (cname = "XNextRequest")]
151                 public ulong next_request ();
152
153                 [CCode (cname = "XNoOp")]
154                 public void no_operation ();
155
156                 [CCode (cname = "XScreenCount")]
157                 public int number_of_screens ();
158
159                 [CCode (cname = "XPending")]
160                 public int pending ();
161
162                 [CCode (cname = "XProcessInternalConnection")]
163                 public void process_internal_connection (int fd);
164
165                 [CCode (cname = "XProtocolVersion")]
166                 public int protocol_version ();
167
168                 [CCode (cname = "XProtocolRevision")]
169                 public int protocol_revision ();
170
171                 [CCode (cname = "XRaiseWindow")]
172                 public int raise_window (Window w);
173
174                 [CCode (cname = "XReparentWindow")]
175                 public int reparent_window (Window w, Window parent, int x, int y);
176
177                 [CCode (cname = "XResizeWindow")]
178                 public int resize_window (Window w, uint width, uint height);
179
180                 [CCode (cname = "XRootWindow")]
181                 public Window root_window (int screen_number);
182
183                 [CCode (cname = "ScreenCount")]
184                 public int screen_count ();
185
186                 [CCode (cname = "XScreenOfDisplay")]
187                 public weak Screen screen_of_display (int screen_number);
188
189                 [CCode (cname = "XSelectInput")]
190                 public int select_input (Window w, long event_mask);
191
192                 [CCode (cname = "XSendEvent")]
193                 public void send_event (Window w, bool prpagate, long event_mask, ref Event event_send);
194
195                 [CCode (cname = "XSetCloseDownMode")]
196                 public void set_close_down_mode (int close_mode);
197
198                 [CCode (cname = "XSetSelectionOwner")]
199                 public Window set_selection_owner (Atom selection, Window owner, int time);
200
201                 [CCode (cname = "XSetInputFocus")]
202                 public int set_input_focus (Window focus, int revert_to, int time);
203
204                 [CCode (cname = "XUngrabButton")]
205                 public int ungrab_button (uint button, uint modifiers, Window grab_window);
206
207                 [CCode (cname = "XUngrabPointer")]
208                 public int ungrab_pointer (int time);
209
210                 [CCode (cname = "XUngrabServer")]
211                 public int ungrab_server ();
212
213                 [CCode (cname = "XUnlockDisplay")]
214                 public void unlock_display ();
215
216                 [CCode (cname = "XUnmapWindow")]
217                 public int unmap_window (Window w);
218
219                 [CCode (cname = "XQueryTree")]
220                 public void query_tree (Window w, out Window root_return, out Window parent_return, out Window[] children_return);
221
222                 [CCode (cname = "XWindowEvent")]
223                 public int window_event (Window w, EventMask event_mask, out Event event_return);
224
225                 [CCode (cname = "XServerVendor")]
226                 public string xserver_vendor_name ();
227
228                 [CCode (cname = "XVendorRelease")]
229                 public string xserver_vendor_release ();
230
231                 [CCode (cname = "XMoveWindow")]
232                 public void move_window (Window window, int x, int y);
233         }
234
235         [Compact]
236         [CCode (cname = "XModifierKeymap", free_function = "XFreeModifiermap")]
237         public class ModifierKeymap {
238                 // The server's max # of keys per modifier
239                 public int max_keypermod;
240                 // An 8 by max_keypermod array of modifiers
241                 public uchar[] modifiermap;
242         }
243
244         [SimpleType]
245         [IntegerType (rank = 9)]
246         [CCode (cname = "Atom")]
247         public struct Atom {
248         }
249
250         [SimpleType]
251         [IntegerType (rank = 9)]
252         [CCode (cname = "Colormap")]
253         public struct Colormap {
254         }
255
256         [SimpleType]
257         [CCode (cname = "GC")]
258         public struct GC {
259         }
260
261         [SimpleType]
262         [IntegerType (rank = 9)]
263         [CCode (cname = "Status")]
264         public struct Status {
265         }
266
267         [SimpleType]
268         [IntegerType (rank = 9)]
269         [CCode (cname = "Window", type_id = "G_TYPE_INT",
270                 marshaller_type_name = "INT",
271                 get_value_function = "g_value_get_int",
272                 set_value_function = "g_value_set_int", default_value = "0",
273                 type_signature = "i")]
274         public struct Window {
275         }
276
277         public struct Visual {
278         }
279
280         public struct WindowChanges {
281                 public int x;
282                 public int y;
283                 public int width;
284                 public int height;
285                 public int border_width;
286                 public Window sibling;
287                 public int stack_mode;
288         }
289         public struct SizeHints {
290                 public long @flags;
291                 public int x;
292                 public int y;
293                 public int width;
294                 public int height;
295         }
296
297         [CCode (cname = "XCreateWindow")]
298         public Window create_window (Display display, Window parent, int x, int y, uint width, uint height, uint border_width, int depth, uint @class, Visual? visual, X.CW valuemask, ref SetWindowAttributes attributes);
299
300         [CCode (cname = "XSetWindowAttributes")]
301         public struct SetWindowAttributes {
302                 // public Pixmap background_pixmap;     /* background or None or ParentRelative */
303                 public ulong background_pixel;  /* background pixel */
304                 // public Pixmap border_pixmap; /* border of the window */
305                 public ulong border_pixel;      /* border pixel value */
306                 public int bit_gravity;         /* one of bit gravity values */
307                 public int win_gravity;         /* one of the window gravity values */
308                 public int backing_store;               /* NotUseful, WhenMapped, Always */
309                 public ulong backing_planes;/* planes to be preseved if possible */
310                 public ulong backing_pixel;/* value to use in restoring planes */
311                 public bool save_under;         /* should bits under be saved? (popups) */
312                 public long event_mask;         /* set of events that should be saved */
313                 public long do_not_propagate_mask;      /* set of events that should not propagate */
314                 public bool override_redirect;  /* boolean value for override-redirect */
315                 // public Colormap colormap;            /* color map to be associated with window */
316                 // public Cursor cursor;                /* cursor to be displayed (or None) */
317         }
318
319         [CCode(cname = "XWindowAttributes",
320                cheader_filename = "X11/Xlib.h,X11/Xatom.h,X11/Xutil.h")]
321         public struct WindowAttributes {
322                 public int x;
323                 public int y;                   /* location of window */
324                 public int width;
325                 public int height;              /* width and height of window */
326                 public int border_width;                /* border width of window */
327                 public int depth;               /* depth of window */
328                 public Visual visual;           /* the associated visual structure */
329                 public Window root;             /* root of screen containing window */
330                 public int @class;                      /* InputOutput, InputOnly*/
331                 public int bit_gravity;         /* one of bit gravity values */
332                 public int win_gravity;         /* one of the window gravity values */
333                 public int backing_store;               /* NotUseful, WhenMapped, Always */
334                 public ulong backing_planes;/* planes to be preserved if possible */
335                 public ulong backing_pixel;/* value to be used when restoring planes */
336                 public bool save_under;         /* boolean, should bits under be saved? */
337                 // public Colormap colormap;            /* color map to be associated with window */
338                 public bool map_installed;              /* boolean, is color map currently installed*/
339                 public int map_state;           /* IsUnmapped, IsUnviewable, IsViewable */
340                 public long all_event_masks;    /* set of events all people have interest in*/
341                 public long your_event_mask;    /* my event mask */
342                 public long do_not_propagate_mask; /* set of events that should not propagate */
343                 public bool override_redirect;  /* boolean value for override-redirect */
344                 // public Screen screen;                /* back pointer to correct screen */
345         }
346
347         [CCode (cname = "CopyFromParent")]
348         public const int COPY_FROM_PARENT;
349
350         [CCode (cname = "CurrentTime")]
351         public const ulong CURRENT_TIME;
352
353         [CCode (cname = "Success")]
354         public int Success;
355
356         [CCode (cname = "XFree")]
357         public int free (void* data);
358
359         [CCode (cprefix = "CW", cname = "int")]
360         public enum CW {
361                 BackPixmap,
362                 BackPixel,
363                 BackingStore,
364                 BackingPlanes,
365                 BackingPixel,
366                 BitGravity,
367                 BorderPixmap,
368                 BorderPixel,
369                 BorderWidth,
370                 Colormap,
371                 Cursor,
372                 DontPropagate,
373                 EventMask,
374                 Height,
375                 OverrideRedirect,
376                 SaveUnder,
377                 Sibling,
378                 StackMode,
379                 X,
380                 Y,
381                 Width,
382                 WinGravity
383         }
384
385         [CCode (cprefix = "GrabMode")]
386         public enum GrabMode {
387                 Sync,
388                 Async
389         }
390
391         [CCode (cprefix = "")]
392         public enum EventMask {
393                 NoEventMask,
394                 KeyPressMask,
395                 KeyReleaseMask,
396                 ButtonPressMask,
397                 ButtonReleaseMask,
398                 EnterWindowMask,
399                 LeaveWindowMask,
400                 PointerMotionMask,
401                 PointerMotionHintMask,
402                 Button1MotionMask,
403                 Button2MotionMask,
404                 Button3MotionMask,
405                 Button4MotionMask,
406                 Button5MotionMask,
407                 ButtonMotionMask,
408                 KeymapStateMask,
409                 ExposureMask,
410                 VisibilityChangeMask,
411                 StructureNotifyMask,
412                 ResizeRedirectMask,
413                 SubstructureNotifyMask,
414                 SubstructureRedirectMask,
415                 FocusChangeMask,
416                 PropertyChangeMask,
417                 ColormapChangeMask,
418                 OwnerGrabButtonMask
419         }
420
421         [CCode (cprefix = "")]
422         public enum KeyMask {
423                 ShiftMask,
424                 LockMask,
425                 ControlMask,
426                 Mod1Mask,
427                 Mod2Mask,
428                 Mod3Mask,
429                 Mod4Mask,
430                 Mod5Mask
431         }
432
433         [CCode (cprefix = "")]
434         public enum EventType {
435                 KeyPress,
436                 KeyRelease,
437                 ButtonPress,
438                 ButtonRelease,
439                 MotionNotify,
440                 EnterNotify,
441                 LeaveNotify,
442                 FocusIn,
443                 FocusOut,
444                 KeymapNotify,
445                 Expose,
446                 GraphicsExpose,
447                 NoExpose,
448                 VisibilityNotify,
449                 CreateNotify,
450                 DestroyNotify,
451                 UnmapNotify,
452                 MapNotify,
453                 MapRequest,
454                 ReparentNotify,
455                 ConfigureNotify,
456                 ConfigureRequest,
457                 GravityNotify,
458                 ResizeRequest,
459                 CirculateNotify,
460                 CirculateRequest,
461                 PropertyNotify,
462                 SelectionClear,
463                 SelectionRequest,
464                 SelectionNotify,
465                 ColormapNotify,
466                 ClientMessage,
467                 MappingNotify
468         }
469
470         // union
471         [CCode (cname = "XEvent")]
472         public struct Event {
473                 public int type;
474                 public AnyEvent xany;
475                 public KeyEvent xkey;
476                 public ButtonEvent xbutton;
477                 public MotionEvent xmotion;
478                 public CrossingEvent xcrossing;
479                 public CreateWindowEvent xcreatewindow;
480                 public DestroyWindowEvent xdestroywindow;
481                 public UnmapEvent xunmap;
482                 public MapEvent xmap;
483                 public MapRequestEvent xmaprequest;
484                 public ReparentEvent xreparent;
485                 public ConfigureEvent xconfigure;
486                 public GravityEvent xgravity;
487                 public ConfigureRequestEvent xconfigurerequest;
488                 public CirculateEvent xcirculate;
489                 public CirculateRequestEvent xcirculaterequest;
490                 public PropertyEvent xproperty;
491                 public SelectionEvent xselection;
492                 public ClientMessageEvent xclient;
493         }
494
495         [CCode (cname = "XAnyEvent")]
496         public struct AnyEvent {
497                 public int type;
498                 public ulong serial;
499                 public bool send_event;
500                 public unowned Display display;
501                 public Window window;
502         }
503
504         [CCode (cname = "XKeyEvent")]
505         public struct KeyEvent {
506                 public int type;
507                 public ulong serial;
508                 public bool send_event;
509                 public unowned Display display;
510                 public Window window;
511                 public Window root;
512                 public Window subwindow;
513                 public ulong time;
514                 public int x;
515                 public int y;
516                 public int x_root;
517                 public int y_root;
518                 public uint state;
519                 public uint keycode;
520                 public bool same_screen;
521         }
522
523         [CCode (cname = "XButtonEvent")]
524         public struct ButtonEvent {
525                 public int type;
526                 public ulong serial;
527                 public bool send_event;
528                 public unowned Display display;
529                 public Window window;
530                 public Window subwindow;
531                 public ulong time;
532                 public int x;
533                 public int y;
534                 public int x_root;
535                 public int y_root;
536                 public uint state;
537                 public uint button;
538                 public bool same_screen;
539         }
540
541         [CCode (cname = "XMotionEvent")]
542         public struct MotionEvent {
543                 public int type;
544                 public ulong serial;
545                 public bool send_event;
546                 public unowned Display display;
547                 public Window window;
548                 public Window subwindow;
549                 public ulong time;
550                 public int x;
551                 public int y;
552                 public int x_root;
553                 public int y_root;
554                 public uint state;
555                 public char is_hint;
556                 public bool same_screen;
557         }
558
559         [CCode (cname = "XCrossingEvent")]
560         public struct CrossingEvent {
561                 public int type;
562                 public ulong serial;
563                 public bool send_event;
564                 public unowned Display display;
565                 public Window window;
566                 public Window root;
567                 public Window subwindow;
568                 public ulong time;
569                 public int x;
570                 public int y;
571                 public int x_root;
572                 public int y_root;
573                 public int mode;
574                 public int detail;
575                 public bool same_screen;
576                 public bool focus;
577                 public uint state;
578         }
579
580         [CCode (cname = "XCreateWindowEvent")]
581         public struct CreateWindowEvent {
582                 public int type;
583                 public ulong serial;
584                 public bool send_event;
585                 public unowned Display display;
586                 public Window parent;
587                 public Window window;
588                 public int x;
589                 public int y;
590                 public int width;
591                 public int height;
592                 public int border_width;
593                 public bool override_redirect;
594         }
595
596         [CCode (cname = "XDestroyWindowEvent")]
597         public struct DestroyWindowEvent {
598                 public int type;
599                 public ulong serial;
600                 public bool send_event;
601                 public unowned Display display;
602                 public Window event;
603                 public Window window;
604         }
605
606         [CCode (cname = "XUnmapEvent")]
607         public struct UnmapEvent {
608                 public int type;
609                 public ulong serial;
610                 public bool send_event;
611                 public unowned Display display;
612                 public Window event;
613                 public Window window;
614                 public bool from_configure;
615         }
616
617         [CCode (cname = "XMapEvent")]
618         public struct MapEvent {
619                 public int type;
620                 public ulong serial;
621                 public bool send_event;
622                 public unowned Display display;
623                 public Window event;
624                 public Window window;
625                 public bool override_redirect;
626         }
627
628         [CCode (cname = "XMapRequestEvent")]
629         public struct MapRequestEvent {
630                 public int type;
631                 public ulong serial;
632                 public bool send_event;
633                 public unowned Display display;
634                 public Window parent;
635                 public Window window;
636         }
637
638         [CCode (cname = "XReparentEvent")]
639         public struct ReparentEvent {
640                 public int type;
641                 public ulong serial;
642                 public bool send_event;
643                 public unowned Display display;
644                 public Window event;
645                 public Window window;
646                 public Window parent;
647                 public int x;
648                 public int y;
649                 public bool override_redirect;
650         }
651
652         [CCode (cname = "XConfigureEvent")]
653         public struct ConfigureEvent {
654                 public int type;
655                 public ulong serial;
656                 public bool send_event;
657                 public unowned Display display;
658                 public Window event;
659                 public Window window;
660                 public int x;
661                 public int y;
662                 public int width;
663                 public int height;
664                 public int border_width;
665                 public Window above;
666                 public bool override_redirect;
667         }
668
669         [CCode (cname = "XGravityEvent")]
670         public struct GravityEvent {
671                 public int type;
672                 public ulong serial;
673                 public bool send_event;
674                 public unowned Display display;
675                 public Window event;
676                 public Window window;
677                 public int x;
678                 public int y;
679         }
680
681         [CCode (cname = "XConfigureRequestEvent")]
682         public struct ConfigureRequestEvent {
683                 public int type;
684                 public ulong serial;
685                 public bool send_event;
686                 public unowned Display display;
687                 public Window parent;
688                 public Window window;
689                 public int x;
690                 public int y;
691                 public int width;
692                 public int height;
693                 public int border_width;
694                 public Window above;
695                 public int detail;
696                 public ulong value_mask;
697         }
698
699         [CCode (cname = "XCirculateEvent")]
700         public struct CirculateEvent {
701                 public int type;
702                 public ulong serial;
703                 public bool send_event;
704                 public unowned Display display;
705                 public Window event;
706                 public Window window;
707                 public int place;
708         }
709
710         [CCode (cname = "XCirculateRequestEvent")]
711         public struct CirculateRequestEvent {
712                 public int type;
713                 public ulong serial;
714                 public bool send_event;
715                 public unowned Display display;
716                 public Window parent;
717                 public Window window;
718                 public int place;
719         }
720
721         [CCode (cname = "XPropertyEvent")]
722         public struct PropertyEvent {
723                 public int type;
724                 public ulong serial;
725                 public bool send_event;
726                 public unowned Display display;
727                 public Window window;
728                 public Atom atom;
729                 public ulong time;
730                 public int state;
731         }
732
733         [CCode (cname = "XSelectionEvent")]
734         public struct SelectionEvent {
735                 public int type;
736                 public ulong serial;
737                 public bool send_event;
738                 public unowned Display display;
739                 public Window requestor;
740                 public Atom selection;
741                 public Atom target;
742                 public Atom property;
743                 public ulong time;
744         }
745
746         [CCode (cname = "XClientMessageEvent")]
747         public struct ClientMessageEvent {
748                 public int type;
749                 public ulong serial;    /* # of last request processed by server */
750                 public bool send_event; /* true if this came from a SendEvent request */
751                 public unowned Display display; /* Display the event was read from */
752                 public Window window;
753                 public Atom message_type;
754                 public int format;
755                 public ClientMessageEventData data;
756         }
757
758         // union
759         public struct ClientMessageEventData {
760                 public unowned char[] b;
761                 public unowned short[] s;
762                 public unowned long[] l;
763         }
764
765         [CCode (cprefix = "PropMode")]
766         public enum PropMode {
767                 Replace,
768                 Prepend,
769                 Append
770         }
771
772         [CCode (cprefix = "")]
773         public enum AllowEventsMode {
774                 AsyncPointer,
775                 SyncPointer,
776                 ReplayPointer,
777                 AsyncKeyboard,
778                 SyncKeyboard,
779                 ReplayKeyboard,
780                 AsyncBoth,
781                 SyncBoth
782         }
783
784         [CCode (cprefix = "")]
785         public enum MapState {
786                 IsUnmapped,
787                 IsUnviewable,
788                 IsViewable
789         }
790
791         [CCode (cprefix = "RevertTo")]
792         public enum RevertTo {
793                 None,
794                 PointerRoot,
795                 Parent
796         }
797
798         [Compact]
799         [CCode (cname = "Screen")]
800         public class Screen {
801                 public Display display;
802                 public Window root;
803                 public int width;
804                 public int height;
805
806                 [CCode (cname = "XScreenOfDisplay")]
807                 public static unowned Screen get_screen (Display disp, int screen_number);
808
809                 [CCode (cname = "XBlackPixelOfScreen")]
810                 public ulong black_pixel_of_screen ();
811
812                 [CCode (cname = "XCellsOfScreen")]
813                 public int cells_of_screen ();
814
815                 [CCode (cname = "XDefaultColormapOfScreen")]
816                 public Colormap default_colormap_of_screen ();
817
818                 [CCode (cname = "XDefaultDepthOfScreen")]
819                 public int default_depth_of_screen ();
820
821                 [CCode (cname = "XDefaultGCOfScreen")]
822                 public GC default_gc_of_screen ();
823
824                 [CCode (cname = "XDefaultVisualOfScreen")]
825                 public Visual default_visual_of_screen ();
826
827                 [CCode (cname = "XDisplayOfScreen")]
828                 public unowned Display display_of_screen ();
829
830                 [CCode (cname = "XDoesBackingStore")]
831                 public int does_backing_store ();
832
833                 [CCode (cname = "XDoesSaveUnders")]
834                 public bool does_save_unders ();
835
836                 [CCode (cname = "XEventMaskOfScreen")]
837                 public long event_mask_of_Screen ();
838
839                 [CCode (cname = "XHeightMMOfScreen")]
840                 public int height_in_mm_of_screen ();
841
842                 [CCode (cname = "XHeightOfScreen")]
843                 public int height_of_screen ();
844
845                 [CCode (cname = "XMaxCmapsOfScreen")]
846                 public int max_colormaps_of_screen ();
847
848                 [CCode (cname = "XMinCmapsOfScreen")]
849                 public int min_colormaps_of_screen ();
850
851                 [CCode (cname = "XPlanesOfScreen")]
852                 public int planes_of_screen ();
853
854                 [CCode (cname = "XRootWindowOfScreen")]
855                 public Window root_window_of_screen ();
856
857                 [CCode (cname = "XScreenNumberOfScreen")]
858                 public int screen_number_of_screen ();
859
860                 [CCode (cname = "XWhitePixelOfScreen")]
861                 public ulong white_pixel_of_screen ();
862
863                 [CCode (cname = "XWidthMMOfScreen")]
864                 public int width_in_mm_of_screen ();
865
866                 [CCode (cname = "XWidthOfScreen")]
867                 public int width_of_screen ();
868         }
869
870         public const X.Atom XA_ATOM;
871         public const X.Atom XA_CARDINAL;
872         public const X.Atom XA_WINDOW;
873         public const X.Atom XA_WM_CLASS;
874         public const X.Atom XA_WM_HINTS;
875         public const X.Atom XA_WM_ICON_NAME;
876         public const X.Atom XA_WM_NAME;
877         public const X.Atom XA_WM_NORMAL_HINTS;
878         public const X.Atom XA_WM_TRANSIENT_FOR;
879
880         public const uint XK_Num_Lock;
881         public const uint XK_Scroll_Lock;
882 }
883