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 = "")]
27 public class Connection {
28 public void disconnect ();
30 public uint32 generate_id ();
31 public Setup get_setup ();
35 [CCode (cname = "xcb_setup_t", ref_function = "", unref_function = "")]
37 public ScreenIterator roots_iterator ();
40 public const char COPY_FROM_PARENT;
42 [CCode (cname = "xcb_window_class_t")]
43 public enum WindowClass {
50 [CCode (cname = "xcb_generic_event_t", ref_function = "", unref_function = "")]
51 public class GenericEvent {
52 public uint8 response_type;
55 public const uint8 BUTTON_PRESS;
56 public const uint8 BUTTON_RELEASE;
57 public const uint8 EXPOSE;
58 public const uint8 MOTION_NOTIFY;
59 public const uint8 ENTER_NOTIFY;
60 public const uint8 LEAVE_NOTIFY;
62 [CCode (cname = "xcb_button_press_event_t", ref_function = "", unref_function = "")]
63 public class ButtonPressEvent : GenericEvent {
70 public uint16 event_x;
71 public uint16 event_y;
74 [CCode (cname = "xcb_button_release_event_t", ref_function = "", unref_function = "")]
75 public class ButtonReleaseEvent : GenericEvent {
82 public uint16 event_x;
83 public uint16 event_y;
86 [CCode (cname = "xcb_motion_notify_event_t", ref_function = "", unref_function = "")]
87 public class MotionNotifyEvent : GenericEvent {
93 public uint16 event_x;
94 public uint16 event_y;
97 [CCode (cname = "xcb_expose_event_t", ref_function = "", unref_function = "")]
98 public class ExposeEvent : GenericEvent {
103 public uint16 height;
106 [CCode (cname = "xcb_cw_t")]
125 [CCode (cname = "xcb_event_mask_t")]
126 public enum EventMask {
148 SUBSTRUCTURE_REDIRECT,
156 [CCode (cname = "xcb_screen_t", ref_function = "", unref_function = "")]
157 public class Screen {
159 public uint32 white_pixel;
160 public uint32 black_pixel;
161 public VisualID root_visual;
162 public DepthIterator allowed_depths_iterator ();
165 [CCode (cname = "xcb_screen_iterator_t")]
166 public struct ScreenIterator {
167 public unowned Screen data;
173 [CCode (cname = "xcb_depth_t", ref_function = "", unref_function = "")]
176 public VisualTypeIterator visuals_iterator ();
179 [CCode (cname = "xcb_depth_iterator_t")]
180 public struct DepthIterator {
181 public unowned Depth data;
183 [CCode (cname = "xcb_depth_next")]
187 [CCode (cname = "xcb_visualtype_iterator_t")]
188 public struct VisualTypeIterator {
189 public unowned VisualType data;
191 [CCode (cname = "xcb_visualtype_next")]
195 public Connection connect (string? display = null, out int screen = null);
196 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);
197 public VoidCookie map_window (Connection connection, Window wid);
199 public struct VoidCookie {
202 public struct VisualID : uint32 {
205 public struct Button : uint8 {
208 [CCode (cname = "xcb_drawable_t")]
209 public struct Drawable : uint32 {
212 [CCode (cname = "xcb_window_t")]
213 public struct Window : Drawable {
217 [CCode (cname = "xcb_visualtype_t", ref_function = "", unref_function = "")]
218 public class VisualType {
219 public VisualID visual_id;
221 public uint8 bits_per_rgb_value;