From f59ee7ec3fedc65b1e8768fa7ba037e44fa04670 Mon Sep 17 00:00:00 2001 From: Nicolas Bruguier Date: Mon, 16 Nov 2009 12:49:26 -0800 Subject: [PATCH] x11: Add drawable, pixmap and RECTANGLE structs. Fixes bug 598174. --- vapi/x11.vapi | 56 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 54 insertions(+), 2 deletions(-) diff --git a/vapi/x11.vapi b/vapi/x11.vapi index 062e50c13..a47d5db33 100644 --- a/vapi/x11.vapi +++ b/vapi/x11.vapi @@ -20,7 +20,7 @@ * Jürg Billeter */ -[CCode (cprefix = "", lower_case_cprefix = "", cheader_filename = "X11/Xlib.h,X11/Xatom.h,X11/Xutil.h")] +[CCode (cprefix = "", lower_case_cprefix = "", cheader_filename = "X11/Xlib.h,X11/Xatom.h,X11/Xutil.h,X11/Xregion.h")] namespace X { // Note: must be called before opening a display or calling any other Xlib function, // see http://tronche.com/gui/x/xlib/display/XInitThreads.html @@ -141,6 +141,9 @@ namespace X { [CCode (cname = "XExtendedMaxRequestSize")] public long max_extended_request_size (); + [CCode (cname = "XEventsQueued")] + public int events_queued (int mode); + [CCode (cname = "XNextEvent")] public int next_event (ref Event event_return); @@ -261,6 +264,27 @@ namespace X { public struct Status { } + [SimpleType] + [IntegerType (rank = 9)] + [CCode (cname = "XID", type_id = "G_TYPE_INT", + marshaller_type_name = "INT", + get_value_function = "g_value_get_int", + set_value_function = "g_value_set_int", default_value = "0", + type_signature = "i")] + public struct ID { + } + + [SimpleType] + [IntegerType (rank = 9)] + [CCode (cname = "Drawable", type_id = "G_TYPE_INT", + marshaller_type_name = "INT", + get_value_function = "g_value_get_int", + set_value_function = "g_value_set_int", default_value = "0", + type_signature = "i")] + public struct Drawable : ID + { + } + [SimpleType] [IntegerType (rank = 9)] [CCode (cname = "Window", type_id = "G_TYPE_INT", @@ -268,7 +292,18 @@ namespace X { get_value_function = "g_value_get_int", set_value_function = "g_value_set_int", default_value = "0", type_signature = "i")] - public struct Window { + public struct Window : Drawable { + } + + + [SimpleType] + [IntegerType (rank = 9)] + [CCode (cname = "Pixmap", type_id = "G_TYPE_INT", + marshaller_type_name = "INT", + get_value_function = "g_value_get_int", + set_value_function = "g_value_set_int", default_value = "0", + type_signature = "i")] + public struct Pixmap : Drawable { } public struct Visual { @@ -752,6 +787,14 @@ namespace X { public ClientMessageEventData data; } + [CCode (cname = "RECTANGLE", has_type_id = "false")] + public struct Rectangle { + public short x; + public short y; + public short width; + public short height; + } + // union public struct ClientMessageEventData { public unowned char[] b; @@ -759,6 +802,13 @@ namespace X { public unowned long[] l; } + [CCode (cprefix = "Queued")] + public enum QueuedMode { + Already, + AfterFlush, + AfterReading + } + [CCode (cprefix = "PropMode")] public enum PropMode { Replace, @@ -864,6 +914,8 @@ namespace X { public int width_of_screen (); } + public const X.ID None; + public const X.Atom XA_ATOM; public const X.Atom XA_CARDINAL; public const X.Atom XA_WINDOW; -- 2.47.3