webkit-1.0: Last parameter of WebKitWebView::load_error is GLib.Error.
[vala-lang.git] / vapi / x11.vapi
blob64cfca1bb7b0bb671b7d73739e37bda03053d420
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  */
23 [CCode (cprefix = "", lower_case_cprefix = "", cheader_filename = "X11/Xlib.h,X11/Xatom.h,X11/Xutil.h,X11/Xregion.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 ();
30         [Compact]
31         [CCode (cname = "Display", ref_function = "", unref_function = "")]
32         public class Display {
33                 [CCode (cname = "XOpenDisplay")]
34                 public Display (string? name = null);
36                 [CCode (cname = "XAllPlanes")]
37                 public static ulong get_all_planes ();
39                 [CCode (cname = "XActivateScreenSaver")]
40                 public void activate_screensaver ();
42                 [CCode (cname = "XAddToSaveSet")]
43                 public int add_to_save_set (Window w);
45                 [CCode (cname = "XAllowEvents")]
46                 public int allow_events (int event_mode, int time);
48                 [CCode (cname = "XBitmapBitOrder")]
49                 public int bitmap_bit_order ();
51                 [CCode (cname = "XBitmapUnit")]
52                 public int bitmap_scanline_unit ();
54                 [CCode (cname = "XBitmapPad")]
55                 public int bitmap_scanline_padding ();
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);
60                 [CCode (cname = "XChangeWindowAttributes")]
61                 public int change_window_attributes (Window w, ulong valuemask, SetWindowAttributes attributes);
63                 [CCode (cname = "XConfigureWindow")]
64                 public int configure_window (Window w, uint value_mask, WindowChanges values);
66                 [CCode (cname = "ConnectionNumber")]
67                 public int connection_number ();
69                 [CCode (cname = "DefaultRootWindow")]
70                 public Window default_root_window ();
72                 [CCode (cname = "XDefaultScreenOfDisplay")]
73                 public unowned Screen default_screen ();
75                 [CCode (cname = "XScreenOfDisplay")]
76                 public unowned Screen screen_by_id (int screen_number);
78                 [CCode (cname = "DisplayString")]
79                 public string display_string ();
81                 [CCode (cname = "XQLength")]
82                 public int event_queue_length ();
84                 [CCode (cname = "XFlush")]
85                 public int flush ();
87                 [CCode (cname = "XForceScreenSaver")]
88                 public void force_screensaver (int mode);
90                 [CCode (cname = "XGetKeyboardMapping", array_length = false)]
91                 public unowned uint[] get_keyboard_mapping (uint first_keycode, int keycode_count, ref int keysyms_per_keycode_return);
93                 [CCode (cname = "XGetModifierMapping")]
94                 public ModifierKeymap get_modifier_mapping ();
96                 [CCode (cname = "XGetScreenSaver")]
97                 public void get_screensaver (out int timeout, out int interval, out int prefer_blanking, out int allow_exposures);
99                 [CCode (cname = "XGetSelectionOwner")]
100                 public Window get_selection_owner (Atom selection);
102                 [CCode (cname = "XGetWindowAttributes")]
103                 public void get_window_attributes (Window w, out WindowAttributes window_attributes_return);
105                 [CCode (cname = "XGetWindowProperty")]
106                 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, [CCode (type = "unsigned char **")] out void* prop_return);
108                 [CCode (cname = "XGrabButton")]
109                 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);
111                 [CCode (cname = "XGrabKey")]
112                 public int grab_key (int keycode, uint modifiers, Window grab_window, bool owner_events, int pointer_mode, int keyboard_mode);
114                 [CCode (cname = "XGrabPointer")]
115                 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);
117                 [CCode (cname = "XGrabServer")]
118                 public int grab_server ();
120                 [CCode (cname = "XImageByteOrder")]
121                 public int image_byte_order ();
123                 [CCode (cname = "XInternAtom")]
124                 public Atom intern_atom (string atom_name, bool only_if_exists);
126                 [CCode (cname = "XInternAtoms")]
127                 public void intern_atoms (string[] names, bool only_if_exists, [CCode (array_length = false)] Atom[] atoms_return);
129                 [CCode (cname = "XInternalConnectionNumbers")]
130                 public Status internal_connection_numbers (ref int[] fd_return);
132                 [CCode (cname = "XDisplayKeycodes")]
133                 public int keycodes (ref int min_keycodes_return, ref int max_keycodes_return);
135                 [CCode (cname = "XKeysymToKeycode")]
136                 public int keysym_to_keycode (uint keysym);
138                 [CCode (cname = "XLastKnownRequestProcessed")]
139                 public ulong last_known_request_processed ();
141                 [CCode (cname = "XLockDisplay")]
142                 public void lock_display ();
144                 [CCode (cname = "XMapWindow")]
145                 public int map_window (Window w);
147                 [CCode (cname = "XMaxRequestSize")]
148                 public long max_request_size ();
150                 [CCode (cname = "XExtendedMaxRequestSize")]
151                 public long max_extended_request_size ();
153                 [CCode (cname = "XEventsQueued")]
154                 public int events_queued (int mode);
156                 [CCode (cname = "XNextEvent")]
157                 public int next_event (ref Event event_return);
159                 [CCode (cname = "XNextRequest")]
160                 public ulong next_request ();
162                 [CCode (cname = "XNoOp")]
163                 public void no_operation ();
165                 [CCode (cname = "XScreenCount")]
166                 public int number_of_screens ();
168                 [CCode (cname = "XPending")]
169                 public int pending ();
171                 [CCode (cname = "XProcessInternalConnection")]
172                 public void process_internal_connection (int fd);
174                 [CCode (cname = "XProtocolVersion")]
175                 public int protocol_version ();
177                 [CCode (cname = "XProtocolRevision")]
178                 public int protocol_revision ();
180                 [CCode (cname = "XRaiseWindow")]
181                 public int raise_window (Window w);
183                 [CCode (cname = "XReparentWindow")]
184                 public int reparent_window (Window w, Window parent, int x, int y);
186                 [CCode (cname = "XResetScreenSaver")]
187                 public void reset_screensaver ();
189                 [CCode (cname = "XResizeWindow")]
190                 public int resize_window (Window w, uint width, uint height);
192                 [CCode (cname = "XRootWindow")]
193                 public Window root_window (int screen_number);
195                 [CCode (cname = "ScreenCount")]
196                 public int screen_count ();
198                 [CCode (cname = "XScreenOfDisplay")]
199                 public unowned Screen screen_of_display (int screen_number);
201                 [CCode (cname = "XSelectInput")]
202                 public int select_input (Window w, long event_mask);
204                 [CCode (cname = "XSendEvent")]
205                 public void send_event (Window w, bool prpagate, long event_mask, ref Event event_send);
207                 [CCode (cname = "XSetCloseDownMode")]
208                 public void set_close_down_mode (int close_mode);
210                 [CCode (cname = "XSetScreenSaver")]
211                 public void set_screensaver (int timeout, int interval, int prefer_blanking, int allow_exposures);
213                 [CCode (cname = "XSetSelectionOwner")]
214                 public Window set_selection_owner (Atom selection, Window owner, int time);
216                 [CCode (cname = "XSetInputFocus")]
217                 public int set_input_focus (Window focus, int revert_to, int time);
219                 [CCode (cname = "XUngrabButton")]
220                 public int ungrab_button (uint button, uint modifiers, Window grab_window);
222                 [CCode (cname = "XUngrabKey")]
223                 public int ungrab_key (int keycode, uint modifiers, Window grab_window);
225                 [CCode (cname = "XUngrabPointer")]
226                 public int ungrab_pointer (int time);
228                 [CCode (cname = "XUngrabServer")]
229                 public int ungrab_server ();
231                 [CCode (cname = "XUnlockDisplay")]
232                 public void unlock_display ();
234                 [CCode (cname = "XUnmapWindow")]
235                 public int unmap_window (Window w);
237                 [CCode (cname = "XQueryTree")]
238                 public void query_tree (Window w, out Window root_return, out Window parent_return, out Window[] children_return);
240                 [CCode (cname = "XWindowEvent")]
241                 public int window_event (Window w, EventMask event_mask, out Event event_return);
243                 [CCode (cname = "XServerVendor")]
244                 public string xserver_vendor_name ();
246                 [CCode (cname = "XVendorRelease")]
247                 public string xserver_vendor_release ();
249                 [CCode (cname = "XMoveWindow")]
250                 public void move_window (Window window, int x, int y);
251         }
253         [Compact]
254         [CCode (cname = "XModifierKeymap", free_function = "XFreeModifiermap")]
255         public class ModifierKeymap {
256                 // The server's max # of keys per modifier
257                 public int max_keypermod;
258                 // An 8 by max_keypermod array of modifiers
259                 public uchar[] modifiermap;
260         }
262         [SimpleType]
263         [IntegerType (rank = 9)]
264         [CCode (cname = "Atom")]
265         public struct Atom {
266         }
268         [SimpleType]
269         [IntegerType (rank = 9)]
270         [CCode (cname = "Colormap")]
271         public struct Colormap {
272         }
274         [SimpleType]
275         [CCode (cname = "GC")]
276         public struct GC {
277         }
279         [SimpleType]
280         [IntegerType (rank = 9)]
281         [CCode (cname = "Status")]
282         public struct Status {
283         }
285         [SimpleType]
286         [IntegerType (rank = 9)]
287         [CCode (cname = "XID", type_id = "G_TYPE_INT",
288                 marshaller_type_name = "INT",
289                 get_value_function = "g_value_get_int",
290                 set_value_function = "g_value_set_int", default_value = "0",
291                 type_signature = "i")]
292         public struct ID {
293         }
295         [SimpleType]
296         [IntegerType (rank = 9)]
297         [CCode (cname = "Drawable", type_id = "G_TYPE_INT",
298                 marshaller_type_name = "INT",
299                 get_value_function = "g_value_get_int",
300                 set_value_function = "g_value_set_int", default_value = "0",
301                 type_signature = "i")]
302         public struct Drawable : ID
303         {
304         }
306         [SimpleType]
307         [IntegerType (rank = 9)]
308         [CCode (cname = "Window", type_id = "G_TYPE_INT",
309                 marshaller_type_name = "INT",
310                 get_value_function = "g_value_get_int",
311                 set_value_function = "g_value_set_int", default_value = "0",
312                 type_signature = "i")]
313         public struct Window : Drawable {
314         }
317         [SimpleType]
318         [IntegerType (rank = 9)]
319         [CCode (cname = "Pixmap", type_id = "G_TYPE_INT",
320                 marshaller_type_name = "INT",
321                 get_value_function = "g_value_get_int",
322                 set_value_function = "g_value_set_int", default_value = "0",
323                 type_signature = "i")]
324         public struct Pixmap : Drawable {
325         }
327         public struct Visual {
328         }
330         public struct WindowChanges {
331                 public int x;
332                 public int y;
333                 public int width;
334                 public int height;
335                 public int border_width;
336                 public Window sibling;
337                 public int stack_mode;
338         }
339         public struct SizeHints {
340                 public long @flags;
341                 public int x;
342                 public int y;
343                 public int width;
344                 public int height;
345         }
347         [CCode (cname = "XCreateWindow")]
348         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);
350         [CCode (cname = "XSetWindowAttributes")]
351         public struct SetWindowAttributes {
352                 // public Pixmap background_pixmap;     /* background or None or ParentRelative */
353                 public ulong background_pixel;  /* background pixel */
354                 // public Pixmap border_pixmap; /* border of the window */
355                 public ulong border_pixel;      /* border pixel value */
356                 public int bit_gravity;         /* one of bit gravity values */
357                 public int win_gravity;         /* one of the window gravity values */
358                 public int backing_store;               /* NotUseful, WhenMapped, Always */
359                 public ulong backing_planes;/* planes to be preseved if possible */
360                 public ulong backing_pixel;/* value to use in restoring planes */
361                 public bool save_under;         /* should bits under be saved? (popups) */
362                 public long event_mask;         /* set of events that should be saved */
363                 public long do_not_propagate_mask;      /* set of events that should not propagate */
364                 public bool override_redirect;  /* boolean value for override-redirect */
365                 // public Colormap colormap;            /* color map to be associated with window */
366                 // public Cursor cursor;                /* cursor to be displayed (or None) */
367         }
369         [CCode(cname = "XWindowAttributes",
370                cheader_filename = "X11/Xlib.h,X11/Xatom.h,X11/Xutil.h")]
371         public struct WindowAttributes {
372                 public int x;
373                 public int y;                   /* location of window */
374                 public int width;
375                 public int height;              /* width and height of window */
376                 public int border_width;                /* border width of window */
377                 public int depth;               /* depth of window */
378                 public Visual visual;           /* the associated visual structure */
379                 public Window root;             /* root of screen containing window */
380                 public int @class;                      /* InputOutput, InputOnly*/
381                 public int bit_gravity;         /* one of bit gravity values */
382                 public int win_gravity;         /* one of the window gravity values */
383                 public int backing_store;               /* NotUseful, WhenMapped, Always */
384                 public ulong backing_planes;/* planes to be preserved if possible */
385                 public ulong backing_pixel;/* value to be used when restoring planes */
386                 public bool save_under;         /* boolean, should bits under be saved? */
387                 // public Colormap colormap;            /* color map to be associated with window */
388                 public bool map_installed;              /* boolean, is color map currently installed*/
389                 public int map_state;           /* IsUnmapped, IsUnviewable, IsViewable */
390                 public long all_event_masks;    /* set of events all people have interest in*/
391                 public long your_event_mask;    /* my event mask */
392                 public long do_not_propagate_mask; /* set of events that should not propagate */
393                 public bool override_redirect;  /* boolean value for override-redirect */
394                 // public Screen screen;                /* back pointer to correct screen */
395         }
397         [CCode (cname = "CopyFromParent")]
398         public const int COPY_FROM_PARENT;
400         [CCode (cname = "CurrentTime")]
401         public const ulong CURRENT_TIME;
403         [CCode (cname = "Success")]
404         public int Success;
406         [CCode (cname = "XFree")]
407         public int free (void* data);
409         [CCode (cprefix = "CW", cname = "int")]
410         public enum CW {
411                 BackPixmap,
412                 BackPixel,
413                 BackingStore,
414                 BackingPlanes,
415                 BackingPixel,
416                 BitGravity,
417                 BorderPixmap,
418                 BorderPixel,
419                 BorderWidth,
420                 Colormap,
421                 Cursor,
422                 DontPropagate,
423                 EventMask,
424                 Height,
425                 OverrideRedirect,
426                 SaveUnder,
427                 Sibling,
428                 StackMode,
429                 X,
430                 Y,
431                 Width,
432                 WinGravity
433         }
435         [CCode (cprefix = "GrabMode")]
436         public enum GrabMode {
437                 Sync,
438                 Async
439         }
441         [CCode (cprefix = "")]
442         public enum EventMask {
443                 NoEventMask,
444                 KeyPressMask,
445                 KeyReleaseMask,
446                 ButtonPressMask,
447                 ButtonReleaseMask,
448                 EnterWindowMask,
449                 LeaveWindowMask,
450                 PointerMotionMask,
451                 PointerMotionHintMask,
452                 Button1MotionMask,
453                 Button2MotionMask,
454                 Button3MotionMask,
455                 Button4MotionMask,
456                 Button5MotionMask,
457                 ButtonMotionMask,
458                 KeymapStateMask,
459                 ExposureMask,
460                 VisibilityChangeMask,
461                 StructureNotifyMask,
462                 ResizeRedirectMask,
463                 SubstructureNotifyMask,
464                 SubstructureRedirectMask,
465                 FocusChangeMask,
466                 PropertyChangeMask,
467                 ColormapChangeMask,
468                 OwnerGrabButtonMask
469         }
471         [CCode (cprefix = "")]
472         public enum KeyMask {
473                 ShiftMask,
474                 LockMask,
475                 ControlMask,
476                 Mod1Mask,
477                 Mod2Mask,
478                 Mod3Mask,
479                 Mod4Mask,
480                 Mod5Mask
481         }
483         [CCode (cprefix = "")]
484         public enum EventType {
485                 KeyPress,
486                 KeyRelease,
487                 ButtonPress,
488                 ButtonRelease,
489                 MotionNotify,
490                 EnterNotify,
491                 LeaveNotify,
492                 FocusIn,
493                 FocusOut,
494                 KeymapNotify,
495                 Expose,
496                 GraphicsExpose,
497                 NoExpose,
498                 VisibilityNotify,
499                 CreateNotify,
500                 DestroyNotify,
501                 UnmapNotify,
502                 MapNotify,
503                 MapRequest,
504                 ReparentNotify,
505                 ConfigureNotify,
506                 ConfigureRequest,
507                 GravityNotify,
508                 ResizeRequest,
509                 CirculateNotify,
510                 CirculateRequest,
511                 PropertyNotify,
512                 SelectionClear,
513                 SelectionRequest,
514                 SelectionNotify,
515                 ColormapNotify,
516                 ClientMessage,
517                 MappingNotify
518         }
520         // union
521         [CCode (cname = "XEvent")]
522         public struct Event {
523                 public int type;
524                 public AnyEvent xany;
525                 public KeyEvent xkey;
526                 public ButtonEvent xbutton;
527                 public MotionEvent xmotion;
528                 public CrossingEvent xcrossing;
529                 public CreateWindowEvent xcreatewindow;
530                 public DestroyWindowEvent xdestroywindow;
531                 public UnmapEvent xunmap;
532                 public MapEvent xmap;
533                 public MapRequestEvent xmaprequest;
534                 public ReparentEvent xreparent;
535                 public ConfigureEvent xconfigure;
536                 public GravityEvent xgravity;
537                 public ConfigureRequestEvent xconfigurerequest;
538                 public CirculateEvent xcirculate;
539                 public CirculateRequestEvent xcirculaterequest;
540                 public PropertyEvent xproperty;
541                 public SelectionEvent xselection;
542                 public ClientMessageEvent xclient;
543         }
545         [CCode (cname = "XAnyEvent")]
546         public struct AnyEvent {
547                 public int type;
548                 public ulong serial;
549                 public bool send_event;
550                 public unowned Display display;
551                 public Window window;
552         }
554         [CCode (cname = "XKeyEvent")]
555         public struct KeyEvent {
556                 public int type;
557                 public ulong serial;
558                 public bool send_event;
559                 public unowned Display display;
560                 public Window window;
561                 public Window root;
562                 public Window subwindow;
563                 public ulong time;
564                 public int x;
565                 public int y;
566                 public int x_root;
567                 public int y_root;
568                 public uint state;
569                 public uint keycode;
570                 public bool same_screen;
571         }
573         [CCode (cname = "XButtonEvent")]
574         public struct ButtonEvent {
575                 public int type;
576                 public ulong serial;
577                 public bool send_event;
578                 public unowned Display display;
579                 public Window window;
580                 public Window subwindow;
581                 public ulong time;
582                 public int x;
583                 public int y;
584                 public int x_root;
585                 public int y_root;
586                 public uint state;
587                 public uint button;
588                 public bool same_screen;
589         }
591         [CCode (cname = "XMotionEvent")]
592         public struct MotionEvent {
593                 public int type;
594                 public ulong serial;
595                 public bool send_event;
596                 public unowned Display display;
597                 public Window window;
598                 public Window subwindow;
599                 public ulong time;
600                 public int x;
601                 public int y;
602                 public int x_root;
603                 public int y_root;
604                 public uint state;
605                 public char is_hint;
606                 public bool same_screen;
607         }
609         [CCode (cname = "XCrossingEvent")]
610         public struct CrossingEvent {
611                 public int type;
612                 public ulong serial;
613                 public bool send_event;
614                 public unowned Display display;
615                 public Window window;
616                 public Window root;
617                 public Window subwindow;
618                 public ulong time;
619                 public int x;
620                 public int y;
621                 public int x_root;
622                 public int y_root;
623                 public int mode;
624                 public int detail;
625                 public bool same_screen;
626                 public bool focus;
627                 public uint state;
628         }
630         [CCode (cname = "XCreateWindowEvent")]
631         public struct CreateWindowEvent {
632                 public int type;
633                 public ulong serial;
634                 public bool send_event;
635                 public unowned Display display;
636                 public Window parent;
637                 public Window window;
638                 public int x;
639                 public int y;
640                 public int width;
641                 public int height;
642                 public int border_width;
643                 public bool override_redirect;
644         }
646         [CCode (cname = "XDestroyWindowEvent")]
647         public struct DestroyWindowEvent {
648                 public int type;
649                 public ulong serial;
650                 public bool send_event;
651                 public unowned Display display;
652                 public Window event;
653                 public Window window;
654         }
656         [CCode (cname = "XUnmapEvent")]
657         public struct UnmapEvent {
658                 public int type;
659                 public ulong serial;
660                 public bool send_event;
661                 public unowned Display display;
662                 public Window event;
663                 public Window window;
664                 public bool from_configure;
665         }
667         [CCode (cname = "XMapEvent")]
668         public struct MapEvent {
669                 public int type;
670                 public ulong serial;
671                 public bool send_event;
672                 public unowned Display display;
673                 public Window event;
674                 public Window window;
675                 public bool override_redirect;
676         }
678         [CCode (cname = "XMapRequestEvent")]
679         public struct MapRequestEvent {
680                 public int type;
681                 public ulong serial;
682                 public bool send_event;
683                 public unowned Display display;
684                 public Window parent;
685                 public Window window;
686         }
688         [CCode (cname = "XReparentEvent")]
689         public struct ReparentEvent {
690                 public int type;
691                 public ulong serial;
692                 public bool send_event;
693                 public unowned Display display;
694                 public Window event;
695                 public Window window;
696                 public Window parent;
697                 public int x;
698                 public int y;
699                 public bool override_redirect;
700         }
702         [CCode (cname = "XConfigureEvent")]
703         public struct ConfigureEvent {
704                 public int type;
705                 public ulong serial;
706                 public bool send_event;
707                 public unowned Display display;
708                 public Window event;
709                 public Window window;
710                 public int x;
711                 public int y;
712                 public int width;
713                 public int height;
714                 public int border_width;
715                 public Window above;
716                 public bool override_redirect;
717         }
719         [CCode (cname = "XGravityEvent")]
720         public struct GravityEvent {
721                 public int type;
722                 public ulong serial;
723                 public bool send_event;
724                 public unowned Display display;
725                 public Window event;
726                 public Window window;
727                 public int x;
728                 public int y;
729         }
731         [CCode (cname = "XConfigureRequestEvent")]
732         public struct ConfigureRequestEvent {
733                 public int type;
734                 public ulong serial;
735                 public bool send_event;
736                 public unowned Display display;
737                 public Window parent;
738                 public Window window;
739                 public int x;
740                 public int y;
741                 public int width;
742                 public int height;
743                 public int border_width;
744                 public Window above;
745                 public int detail;
746                 public ulong value_mask;
747         }
749         [CCode (cname = "XCirculateEvent")]
750         public struct CirculateEvent {
751                 public int type;
752                 public ulong serial;
753                 public bool send_event;
754                 public unowned Display display;
755                 public Window event;
756                 public Window window;
757                 public int place;
758         }
760         [CCode (cname = "XCirculateRequestEvent")]
761         public struct CirculateRequestEvent {
762                 public int type;
763                 public ulong serial;
764                 public bool send_event;
765                 public unowned Display display;
766                 public Window parent;
767                 public Window window;
768                 public int place;
769         }
771         [CCode (cname = "XPropertyEvent")]
772         public struct PropertyEvent {
773                 public int type;
774                 public ulong serial;
775                 public bool send_event;
776                 public unowned Display display;
777                 public Window window;
778                 public Atom atom;
779                 public ulong time;
780                 public int state;
781         }
783         [CCode (cname = "XSelectionEvent")]
784         public struct SelectionEvent {
785                 public int type;
786                 public ulong serial;
787                 public bool send_event;
788                 public unowned Display display;
789                 public Window requestor;
790                 public Atom selection;
791                 public Atom target;
792                 public Atom property;
793                 public ulong time;
794         }
796         [CCode (cname = "XClientMessageEvent")]
797         public struct ClientMessageEvent {
798                 public int type;
799                 public ulong serial;    /* # of last request processed by server */
800                 public bool send_event; /* true if this came from a SendEvent request */
801                 public unowned Display display; /* Display the event was read from */
802                 public Window window;
803                 public Atom message_type;
804                 public int format;
805                 public ClientMessageEventData data;
806         }
808         [CCode (cname = "RECTANGLE", has_type_id = false)]
809         public struct Rectangle {
810                 public short x;
811                 public short y;
812                 public short width;
813                 public short height;
814         }
816         // union
817         public struct ClientMessageEventData {
818                 public unowned char[] b;
819                 public unowned short[] s;
820                 public unowned long[] l;
821         }
823         [CCode (cprefix = "Queued")]
824         public enum QueuedMode {
825                 Already,
826                 AfterFlush,
827                 AfterReading
828         }
830         [CCode (cprefix = "PropMode")]
831         public enum PropMode {
832                 Replace,
833                 Prepend,
834                 Append
835         }
837         [CCode (cprefix = "")]
838         public enum AllowEventsMode {
839                 AsyncPointer,
840                 SyncPointer,
841                 ReplayPointer,
842                 AsyncKeyboard,
843                 SyncKeyboard,
844                 ReplayKeyboard,
845                 AsyncBoth,
846                 SyncBoth
847         }
849         [CCode (cprefix = "")]
850         public enum MapState {
851                 IsUnmapped,
852                 IsUnviewable,
853                 IsViewable
854         }
856         [CCode (cprefix = "RevertTo")]
857         public enum RevertTo {
858                 None,
859                 PointerRoot,
860                 Parent
861         }
863         [Compact]
864         [CCode (cname = "Screen")]
865         public class Screen {
866                 public Display display;
867                 public Window root;
868                 public int width;
869                 public int height;
871                 [CCode (cname = "XScreenOfDisplay")]
872                 public static unowned Screen get_screen (Display disp, int screen_number);
874                 [CCode (cname = "XBlackPixelOfScreen")]
875                 public ulong black_pixel_of_screen ();
877                 [CCode (cname = "XCellsOfScreen")]
878                 public int cells_of_screen ();
880                 [CCode (cname = "XDefaultColormapOfScreen")]
881                 public Colormap default_colormap_of_screen ();
883                 [CCode (cname = "XDefaultDepthOfScreen")]
884                 public int default_depth_of_screen ();
886                 [CCode (cname = "XDefaultGCOfScreen")]
887                 public GC default_gc_of_screen ();
889                 [CCode (cname = "XDefaultVisualOfScreen")]
890                 public Visual default_visual_of_screen ();
892                 [CCode (cname = "XDisplayOfScreen")]
893                 public unowned Display display_of_screen ();
895                 [CCode (cname = "XDoesBackingStore")]
896                 public int does_backing_store ();
898                 [CCode (cname = "XDoesSaveUnders")]
899                 public bool does_save_unders ();
901                 [CCode (cname = "XEventMaskOfScreen")]
902                 public long event_mask_of_Screen ();
904                 [CCode (cname = "XHeightMMOfScreen")]
905                 public int height_in_mm_of_screen ();
907                 [CCode (cname = "XHeightOfScreen")]
908                 public int height_of_screen ();
910                 [CCode (cname = "XMaxCmapsOfScreen")]
911                 public int max_colormaps_of_screen ();
913                 [CCode (cname = "XMinCmapsOfScreen")]
914                 public int min_colormaps_of_screen ();
916                 [CCode (cname = "XPlanesOfScreen")]
917                 public int planes_of_screen ();
919                 [CCode (cname = "XRootWindowOfScreen")]
920                 public Window root_window_of_screen ();
922                 [CCode (cname = "XScreenNumberOfScreen")]
923                 public int screen_number_of_screen ();
925                 [CCode (cname = "XWhitePixelOfScreen")]
926                 public ulong white_pixel_of_screen ();
928                 [CCode (cname = "XWidthMMOfScreen")]
929                 public int width_in_mm_of_screen ();
931                 [CCode (cname = "XWidthOfScreen")]
932                 public int width_of_screen ();
933         }
935         public const X.ID None;
937         public const X.Atom XA_ATOM;
938         public const X.Atom XA_CARDINAL;
939         public const X.Atom XA_WINDOW;
940         public const X.Atom XA_WM_CLASS;
941         public const X.Atom XA_WM_HINTS;
942         public const X.Atom XA_WM_ICON_NAME;
943         public const X.Atom XA_WM_NAME;
944         public const X.Atom XA_WM_NORMAL_HINTS;
945         public const X.Atom XA_WM_TRANSIENT_FOR;
947         public const uint XK_Num_Lock;
948         public const uint XK_Scroll_Lock;
949         public const uint XK_Super_L;
950         public const uint XK_Super_R;