3
* Copyright (C) 2009 JĆ¼rg Billeter
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.
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.
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
20
* JĆ¼rg Billeter <j@bitron.ch>
23
[CCode (lower_case_cprefix = "xcb_", cheader_filename = "xcb/xcb.h")]
26
[CCode (cname = "xcb_connection_t", cprefix = "xcb_", ref_function = "", unref_function = "xcb_disconnect")]
27
public class Connection {
28
[CCode (cname = "xcb_connect")]
29
public Connection (string? display = null, out int screen = null);
32
public uint32 generate_id ();
33
public Setup get_setup ();
34
public GenericEvent wait_for_event ();
35
public int get_file_descriptor ();
36
public VoidCookie create_window (uint8 depth, Window wid, Window parent, int16 x, int16 y, uint16 width, uint16 height, uint16 border_width, uint16 _class, VisualID visual, uint32 value_mask, [CCode (array_length = false)] uint32[]? value_list);
37
public VoidCookie map_window (Window wid);
38
public VoidCookie change_window_attributes (Window wid, uint32 value_mask, [CCode (array_length = false)] uint32[]? value_list);
39
public QueryTreeCookie query_tree (Window wid);
40
public QueryTreeReply query_tree_reply (QueryTreeCookie cookie, out GenericError? e);
44
[CCode (cname = "xcb_setup_t", ref_function = "", unref_function = "")]
46
public int roots_length ();
47
public ScreenIterator roots_iterator ();
50
public const char COPY_FROM_PARENT;
52
[CCode (cname = "xcb_window_class_t")]
53
public enum WindowClass {
60
[CCode (cname = "xcb_generic_event_t", ref_function = "", unref_function = "")]
61
public class GenericEvent {
62
public uint8 response_type;
66
[CCode (cname = "xcb_generic_error_t", ref_function = "", unref_function = "")]
67
public class GenericError {
68
public uint8 response_type;
69
public uint8 error_code;
70
public uint16 sequence;
71
public uint32 resource_id;
72
public uint16 minor_code;
73
public uint8 major_code;
76
public const uint8 BUTTON_PRESS;
77
public const uint8 BUTTON_RELEASE;
78
public const uint8 EXPOSE;
79
public const uint8 MOTION_NOTIFY;
80
public const uint8 ENTER_NOTIFY;
81
public const uint8 LEAVE_NOTIFY;
83
[CCode (cname = "xcb_button_press_event_t", ref_function = "", unref_function = "")]
84
public class ButtonPressEvent : GenericEvent {
91
public uint16 event_x;
92
public uint16 event_y;
95
[CCode (cname = "xcb_button_release_event_t", ref_function = "", unref_function = "")]
96
public class ButtonReleaseEvent : GenericEvent {
101
public uint16 root_x;
102
public uint16 root_y;
103
public uint16 event_x;
104
public uint16 event_y;
107
[CCode (cname = "xcb_motion_notify_event_t", ref_function = "", unref_function = "")]
108
public class MotionNotifyEvent : GenericEvent {
112
public uint16 root_x;
113
public uint16 root_y;
114
public uint16 event_x;
115
public uint16 event_y;
118
[CCode (cname = "xcb_expose_event_t", ref_function = "", unref_function = "")]
119
public class ExposeEvent : GenericEvent {
120
public Window window;
124
public uint16 height;
127
[CCode (cname = "xcb_cw_t")]
146
[CCode (cname = "xcb_event_mask_t")]
147
public enum EventMask {
169
SUBSTRUCTURE_REDIRECT,
177
[CCode (cname = "xcb_screen_t", ref_function = "", unref_function = "")]
178
public class Screen {
180
public uint32 white_pixel;
181
public uint32 black_pixel;
182
public uint16 width_in_pixels;
183
public uint16 height_in_pixels;
184
public uint16 width_in_millimeters;
185
public uint16 height_in_millimeters;
186
public VisualID root_visual;
187
public DepthIterator allowed_depths_iterator ();
191
[CCode (cname = "xcb_screen_iterator_t")]
192
public struct ScreenIterator {
193
public unowned Screen data;
196
public static void next (ref ScreenIterator iter);
200
[CCode (cname = "xcb_depth_t", ref_function = "", unref_function = "")]
203
public VisualTypeIterator visuals_iterator ();
207
[CCode (cname = "xcb_query_tree_reply_t", ref_function = "", unref_function = "")]
208
public class QueryTreeReply {
210
public Window parent;
211
public uint16 children_len;
212
[CCode (cname = "xcb_query_tree_children", array_length = false)]
213
public Window* children();
216
[CCode (cname = "xcb_depth_iterator_t")]
217
public struct DepthIterator {
218
public unowned Depth data;
220
[CCode (cname = "xcb_depth_next")]
224
[CCode (cname = "xcb_visualtype_iterator_t")]
225
public struct VisualTypeIterator {
226
public unowned VisualType data;
228
[CCode (cname = "xcb_visualtype_next")]
232
[Deprecated (since = "vala-0.14", replacement = "Xcb.Connection")]
233
public Connection connect (string? display = null, out int screen = null);
234
[Deprecated (since = "vala-0.14", replacement = "Xcb.Connection.create_window")]
235
public VoidCookie create_window (Connection connection, uint8 depth, Window wid, Window parent, int16 x, int16 y, uint16 width, uint16 height, uint16 border_width, uint16 _class, VisualID visual, uint32 value_mask, [CCode (array_length = false)] uint32[] value_list);
236
[Deprecated (since = "vala-0.14", replacement = "Xcb.Connection.map_window")]
237
public VoidCookie map_window (Connection connection, Window wid);
240
[CCode (cname = "xcb_void_cookie_t")]
241
public struct VoidCookie {
245
[CCode (cname = "xcb_query_tree_cookie_t")]
246
public struct QueryTreeCookie {
249
[CCode (cname = "xcb_rectangle_t")]
250
public struct Rectangle {
254
public uint16 height;
257
public struct VisualID : uint32 {
260
public struct Button : uint8 {
264
[IntegerType (rank = 9)]
265
[CCode (cname = "xcb_drawable_t", type_id = "G_TYPE_INT",
266
marshaller_type_name = "INT",
267
get_value_function = "g_value_get_int",
268
set_value_function = "g_value_set_int", default_value = "0",
269
type_signature = "i")]
270
public struct Drawable : uint32 {
274
[IntegerType (rank = 9)]
275
[CCode (cname = "xcb_window_t", type_id = "G_TYPE_INT",
276
marshaller_type_name = "INT",
277
get_value_function = "g_value_get_int",
278
set_value_function = "g_value_set_int", default_value = "0",
279
type_signature = "i")]
280
public struct Window : Drawable {
284
[CCode (cname = "xcb_visualtype_t", ref_function = "", unref_function = "")]
285
public class VisualType {
286
public VisualID visual_id;
288
public uint8 bits_per_rgb_value;