~ubuntu-branches/ubuntu/raring/vala-0.20/raring-proposed

« back to all changes in this revision

Viewing changes to vapi/xcb.vapi

  • Committer: Package Import Robot
  • Author(s): Sebastien Bacher
  • Date: 2013-04-05 13:45:05 UTC
  • Revision ID: package-import@ubuntu.com-20130405134505-yyk3rec9904i7p8o
Tags: upstream-0.20.1
ImportĀ upstreamĀ versionĀ 0.20.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* xcb.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 (lower_case_cprefix = "xcb_", cheader_filename = "xcb/xcb.h")]
 
24
namespace Xcb {
 
25
        [Compact]
 
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);
 
30
 
 
31
                public void flush ();
 
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);
 
41
        }
 
42
 
 
43
        [Compact]
 
44
        [CCode (cname = "xcb_setup_t", ref_function = "", unref_function = "")]
 
45
        public class Setup {
 
46
                public int roots_length ();
 
47
                public ScreenIterator roots_iterator ();
 
48
        }
 
49
 
 
50
        public const char COPY_FROM_PARENT;
 
51
 
 
52
        [CCode (cname = "xcb_window_class_t")]
 
53
        public enum WindowClass {
 
54
                COPY_FROM_PARENT,
 
55
                INPUT_OUTPUT,
 
56
                INPUT_ONLY
 
57
        }
 
58
 
 
59
        [Compact]
 
60
        [CCode (cname = "xcb_generic_event_t", ref_function = "", unref_function = "")]
 
61
        public class GenericEvent {
 
62
                public uint8 response_type;
 
63
        }
 
64
 
 
65
        [Compact]
 
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;
 
74
        }
 
75
 
 
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;
 
82
 
 
83
        [CCode (cname = "xcb_button_press_event_t", ref_function = "", unref_function = "")]
 
84
        public class ButtonPressEvent : GenericEvent {
 
85
                public Button detail;
 
86
                public Window root;
 
87
                public Window event;
 
88
                public Window child;
 
89
                public uint16 root_x;
 
90
                public uint16 root_y;
 
91
                public uint16 event_x;
 
92
                public uint16 event_y;
 
93
        }
 
94
 
 
95
        [CCode (cname = "xcb_button_release_event_t", ref_function = "", unref_function = "")]
 
96
        public class ButtonReleaseEvent : GenericEvent {
 
97
                public Button detail;
 
98
                public Window root;
 
99
                public Window event;
 
100
                public Window child;
 
101
                public uint16 root_x;
 
102
                public uint16 root_y;
 
103
                public uint16 event_x;
 
104
                public uint16 event_y;
 
105
        }
 
106
 
 
107
        [CCode (cname = "xcb_motion_notify_event_t", ref_function = "", unref_function = "")]
 
108
        public class MotionNotifyEvent : GenericEvent {
 
109
                public Window root;
 
110
                public Window event;
 
111
                public Window child;
 
112
                public uint16 root_x;
 
113
                public uint16 root_y;
 
114
                public uint16 event_x;
 
115
                public uint16 event_y;
 
116
        }
 
117
 
 
118
        [CCode (cname = "xcb_expose_event_t", ref_function = "", unref_function = "")]
 
119
        public class ExposeEvent : GenericEvent {
 
120
                public Window window;
 
121
                public uint16 x;
 
122
                public uint16 y;
 
123
                public uint16 width;
 
124
                public uint16 height;
 
125
        }
 
126
 
 
127
        [CCode (cname = "xcb_cw_t")]
 
128
        public enum CW {
 
129
                BACK_PIXMAP,
 
130
                BACK_PIXEL,
 
131
                BORDER_PIXMAP,
 
132
                BORDER_PIXEL,
 
133
                BIT_GRAVITY,
 
134
                WIN_GRAVITY,
 
135
                BACKING_STORE,
 
136
                BACKING_PLANES,
 
137
                BACKING_PIXEL,
 
138
                OVERRIDE_REDIRECT,
 
139
                SAVE_UNDER,
 
140
                EVENT_MASK,
 
141
                DONT_PROPAGATE,
 
142
                COLORMAP,
 
143
                CURSOR
 
144
        }
 
145
 
 
146
        [CCode (cname = "xcb_event_mask_t")]
 
147
        public enum EventMask {
 
148
                NO_EVENT,
 
149
                KEY_PRESS,
 
150
                KEY_RELEASE,
 
151
                BUTTON_PRESS,
 
152
                BUTTON_RELEASE,
 
153
                ENTER_WINDOW,
 
154
                LEAVE_WINDOW,
 
155
                POINTER_MOTION,
 
156
                POINTER_MOTION_HINT,
 
157
                BUTTON_1MOTION,
 
158
                BUTTON_2MOTION,
 
159
                BUTTON_3MOTION,
 
160
                BUTTON_4MOTION,
 
161
                BUTTON_5MOTION,
 
162
                BUTTON_MOTION,
 
163
                KEYMAP_STATE,
 
164
                EXPOSURE,
 
165
                VISIBILITY_CHANGE,
 
166
                STRUCTURE_NOTIFY,
 
167
                RESIZE_REDIRECT,
 
168
                SUBSTRUCTURE_NOTIFY,
 
169
                SUBSTRUCTURE_REDIRECT,
 
170
                FOCUS_CHANGE,
 
171
                PROPERTY_CHANGE,
 
172
                COLOR_MAP_CHANGE,
 
173
                OWNER_GRAB_BUTTON
 
174
        }
 
175
 
 
176
        [Compact]
 
177
        [CCode (cname = "xcb_screen_t", ref_function = "", unref_function = "")]
 
178
        public class Screen {
 
179
                public Window root;
 
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 ();
 
188
        }
 
189
 
 
190
        [SimpleType]
 
191
        [CCode (cname = "xcb_screen_iterator_t")]
 
192
        public struct ScreenIterator {
 
193
                public unowned Screen data;
 
194
                public int rem;
 
195
                public int index;
 
196
                public static void next (ref ScreenIterator iter);
 
197
        }
 
198
 
 
199
        [Compact]
 
200
        [CCode (cname = "xcb_depth_t", ref_function = "", unref_function = "")]
 
201
        public class Depth {
 
202
                public uint8 depth;
 
203
                public VisualTypeIterator visuals_iterator ();
 
204
        }
 
205
 
 
206
        [Compact]
 
207
        [CCode (cname = "xcb_query_tree_reply_t", ref_function = "", unref_function = "")]
 
208
        public class QueryTreeReply {
 
209
                public Window root;
 
210
                public Window parent;
 
211
                public uint16 children_len;
 
212
                [CCode (cname = "xcb_query_tree_children", array_length = false)]
 
213
                public Window* children();
 
214
        }
 
215
 
 
216
        [CCode (cname = "xcb_depth_iterator_t")]
 
217
        public struct DepthIterator {
 
218
                public unowned Depth data;
 
219
                public int rem;
 
220
                [CCode (cname = "xcb_depth_next")]
 
221
                public void next ();
 
222
        }
 
223
 
 
224
        [CCode (cname = "xcb_visualtype_iterator_t")]
 
225
        public struct VisualTypeIterator {
 
226
                public unowned VisualType data;
 
227
                public int rem;
 
228
                [CCode (cname = "xcb_visualtype_next")]
 
229
                public void next ();
 
230
        }
 
231
 
 
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);
 
238
 
 
239
        [SimpleType]
 
240
        [CCode (cname = "xcb_void_cookie_t")]
 
241
        public struct VoidCookie {
 
242
        }
 
243
 
 
244
        [SimpleType]
 
245
        [CCode (cname = "xcb_query_tree_cookie_t")]
 
246
        public struct QueryTreeCookie {
 
247
        }
 
248
 
 
249
        [CCode (cname = "xcb_rectangle_t")]
 
250
        public struct Rectangle {
 
251
                public int16 x;
 
252
                public int16 y;
 
253
                public uint16 width;
 
254
                public uint16 height;
 
255
        }
 
256
 
 
257
        public struct VisualID : uint32 {
 
258
        }
 
259
 
 
260
        public struct Button : uint8 {
 
261
        }
 
262
 
 
263
        [SimpleType]
 
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 {
 
271
        }
 
272
 
 
273
        [SimpleType]
 
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 {
 
281
        }
 
282
 
 
283
        [Compact]
 
284
        [CCode (cname = "xcb_visualtype_t", ref_function = "", unref_function = "")]
 
285
        public class VisualType {
 
286
                public VisualID visual_id;
 
287
                public uint8 _class;
 
288
                public uint8 bits_per_rgb_value;
 
289
        }
 
290
}
 
291