forked from nemequ/vala-extra-vapis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
xcb-dri2.vapi
376 lines (332 loc) · 16 KB
/
xcb-dri2.vapi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
/*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
using Xcb;
namespace Xcb {
[CCode (cprefix = "xcb_dri2_", cheader_filename = "xcb/dri2.h")]
namespace DRI2 {
public static Connection get_connection (Xcb.Connection c) {
return (Connection) c;
}
[Compact]
[CCode (cname = "xcb_connection_t", cprefix = "xcb_dri2_", unref_function = "")]
public class Connection : Xcb.Connection {
public QueryVersionCookie query_version (uint32 major_version, uint32 minor_version);
public QueryVersionCookie query_version_unchecked (uint32 major_version, uint32 minor_version);
public QueryVersionReply? query_version_reply (QueryVersionCookie cookie, out Xcb.GenericError? e = null);
public ConnectCookie connect (Xcb.Window window, uint32 driver_type);
public ConnectCookie connect_unchecked (Xcb.Window window, uint32 driver_type);
public ConnectReply? connect_reply (ConnectCookie cookie, out Xcb.GenericError? e = null);
public AuthenticateCookie authenticate (Xcb.Window window, uint32 magic);
public AuthenticateCookie authenticate_unchecked (Xcb.Window window, uint32 magic);
public AuthenticateReply? authenticate_reply (AuthenticateCookie cookie, out Xcb.GenericError? e = null);
public VoidCookie create_drawable_checked (Xcb.Drawable drawable);
public VoidCookie create_drawable (Xcb.Drawable drawable);
public VoidCookie destroy_drawable_checked (Xcb.Drawable drawable);
public VoidCookie destroy_drawable (Xcb.Drawable drawable);
// NOTE: XCB has an error and has two fields for the length of attachments - this can't be fixed without breaking API
[CCode (cname = "xcb_dri2_get_buffers")]
public GetBuffersCookie vala_get_buffers (Xcb.Drawable drawable, uint32 count, [CCode (array_length_pos = 2.9, array_length_type = "uint32_t")] uint32[] attachments);
[CCode (cname = "vala_xcb_dri2_get_buffers")]
public GetBuffersCookie get_buffers (Xcb.Drawable drawable, uint32[] attachments) {
this.vala_get_buffers (drawable, attachments.length, attachments);
}
[CCode (cname = "xcb_dri2_get_buffers_unchecked")]
public GetBuffersCookie vala_get_buffers_unchecked (Xcb.Drawable drawable, uint32 count, [CCode (array_length_pos = 2.9, array_length_type = "uint32_t")] uint32[] attachments);
[CCode (cname = "vala_xcb_dri2_get_buffers_unchecked")]
public GetBuffersCookie get_buffers_unchecked (Xcb.Drawable drawable, uint32[] attachments) {
this.vala_get_buffers_unchecked (drawable, attachments.length, attachments);
}
public GetBuffersReply? get_buffers_reply (GetBuffersCookie cookie, out Xcb.GenericError? e = null);
public CopyRegionCookie copy_region (Xcb.Drawable drawable, uint32 region, uint32 dest, uint32 src);
public CopyRegionCookie copy_region_unchecked (Xcb.Drawable drawable, uint32 region, uint32 dest, uint32 src);
public CopyRegionReply? copy_region_reply (CopyRegionCookie cookie, out Xcb.GenericError? e = null);
// NOTE: XCB has an error and has two fields for the length of attachments - this can't be fixed without breaking API
[CCode (cname = "xcb_dri2_get_buffers_with_format")]
public GetBuffersWithFormatCookie vala_get_buffers_with_format (Xcb.Drawable drawable, uint32 count, [CCode (array_length_pos = 2.9, array_length_type = "uint32_t")] AttachFormat[] attachments);
[CCode (cname = "vala_xcb_dri2_get_buffers_with_format")]
public GetBuffersWithFormatCookie get_buffers_with_format (Xcb.Drawable drawable, AttachFormat[] attachments) {
this.vala_get_buffers_with_format (drawable, attachments.length, attachments);
}
[CCode (cname = "xcb_dri2_get_buffers_with_format_unchecked")]
public GetBuffersWithFormatCookie vala_get_buffers_with_format_unchecked (Xcb.Drawable drawable, uint32 count, [CCode (array_length_pos = 2.9, array_length_type = "uint32_t")] AttachFormat[] attachments);
[CCode (cname = "vala_xcb_dri2_get_buffers_with_format_unchecked")]
public GetBuffersWithFormatCookie get_buffers_with_format_unchecked (Xcb.Drawable drawable, AttachFormat[] attachments) {
this.vala_get_buffers_with_format_unchecked (drawable, attachments.length, attachments);
}
public GetBuffersWithFormatReply? get_buffers_with_format_reply (GetBuffersWithFormatCookie cookie, out Xcb.GenericError? e = null);
[CCode (cname = "xcb_dri2_swap_buffers")]
private SwapBuffersCookie vala_swap_buffers (Xcb.Drawable drawable, uint32 target_msc_hi, uint32 target_msc_lo, uint32 divisor_hi, uint32 divisor_lo, uint32 remainder_hi, uint32 remainder_lo);
[CCode (cname = "vala_xcb_dri2_swap_buffers")]
public SwapBuffersCookie swap_buffers (Xcb.Drawable drawable, uint64 target_msc, uint64 divisor, uint64 remainder) {
return this.vala_swap_buffers (drawable, (uint32) (target_msc >> 32), (uint32) (target_msc & 0xFFFFFFFF), (uint32) (divisor >> 32), (uint32) (divisor & 0xFFFFFFFF), (uint32) (remainder >> 32), (uint32) (remainder & 0xFFFFFFFF));
}
[CCode (cname = "xcb_dri2_swap_buffers_unchecked")]
private SwapBuffersCookie vala_swap_buffers_unchecked (Xcb.Drawable drawable, uint32 target_msc_hi, uint32 target_msc_lo, uint32 divisor_hi, uint32 divisor_lo, uint32 remainder_hi, uint32 remainder_lo);
[CCode (cname = "vala_xcb_dri2_swap_buffers_unchecked")]
public SwapBuffersCookie swap_buffers_unchecked (Xcb.Drawable drawable, uint64 target_msc, uint64 divisor, uint64 remainder) {
return this.vala_swap_buffers_unchecked (drawable, (uint32) (target_msc >> 32), (uint32) (target_msc & 0xFFFFFFFF), (uint32) (divisor >> 32), (uint32) (divisor & 0xFFFFFFFF), (uint32) (remainder >> 32), (uint32) (remainder & 0xFFFFFFFF));
}
public SwapBuffersReply? swap_buffers_reply (SwapBuffersCookie cookie, out Xcb.GenericError? e = null);
public GetMSCCookie get_msc (Xcb.Drawable drawable);
public GetMSCCookie get_msc_unchecked (Xcb.Drawable drawable);
public GetMSCReply? get_msc_reply (GetMSCCookie cookie, out Xcb.GenericError? e = null);
[CCode (cname = "xcb_dri2_wait_msc")]
private WaitMSCCookie vala_wait_msc (Xcb.Drawable drawable, uint32 target_msc_hi, uint32 target_msc_lo, uint32 divisor_hi, uint32 divisor_lo, uint32 remainder_hi, uint32 remainder_lo);
[CCode (cname = "vala_xcb_dri2_wait_msc")]
public SwapBuffersCookie wait_msc (Xcb.Drawable drawable, uint64 target_msc, uint64 divisor, uint64 remainder) {
return this.vala_wait_msc (drawable, (uint32) (target_msc >> 32), (uint32) (target_msc & 0xFFFFFFFF), (uint32) (divisor >> 32), (uint32) (divisor & 0xFFFFFFFF), (uint32) (remainder >> 32), (uint32) (remainder & 0xFFFFFFFF));
}
[CCode (cname = "xcb_dri2_wait_msc_unchecked")]
private WaitMSCCookie vala_wait_msc_unchecked (Xcb.Drawable drawable, uint32 target_msc_hi, uint32 target_msc_lo, uint32 divisor_hi, uint32 divisor_lo, uint32 remainder_hi, uint32 remainder_lo);
[CCode (cname = "vala_xcb_dri2_wait_msc")]
public SwapBuffersCookie wait_msc_unchecked (Xcb.Drawable drawable, uint64 target_msc, uint64 divisor, uint64 remainder) {
return this.vala_wait_msc_unchecked (drawable, (uint32) (target_msc >> 32), (uint32) (target_msc & 0xFFFFFFFF), (uint32) (divisor >> 32), (uint32) (divisor & 0xFFFFFFFF), (uint32) (remainder >> 32), (uint32) (remainder & 0xFFFFFFFF));
}
public WaitMSCReply? wait_msc_reply (WaitMSCCookie cookie, out Xcb.GenericError? e = null);
[CCode (cname = "xcb_dri2_wait_sbc")]
private WaitSBCCookie vala_wait_sbc (Xcb.Drawable drawable, uint32 target_sbc_hi, uint32 target_sbc_lo);
[CCode (cname = "vala_xcb_dri2_wait_sbc")]
public SwapBuffersCookie wait_sbc (Xcb.Drawable drawable, uint64 target_sbc) {
return this.vala_wait_sbc (drawable, (uint32) (target_sbc >> 32), (uint32) (target_sbc & 0xFFFFFFFF));
}
[CCode (cname = "xcb_dri2_wait_sbc_unchecked")]
private WaitSBCCookie vala_wait_sbc_unchecked (Xcb.Drawable drawable, uint32 target_sbc_hi, uint32 target_sbc_lo);
[CCode (cname = "vala_xcb_dri2_wait_sbc")]
public SwapBuffersCookie wait_sbc_unchecked (Xcb.Drawable drawable, uint32 target_sbc) {
return this.vala_wait_sbc_unchecked (drawable, (uint32) (target_sbc >> 32), (uint32) (target_sbc & 0xFFFFFFFF));
}
public WaitSBCReply? wait_sbc_reply (WaitSBCCookie cookie, out Xcb.GenericError? e = null);
public VoidCookie swap_interval_checked (Xcb.Drawable drawable, uint32 interval);
public VoidCookie swap_interval (Xcb.Drawable drawable, uint32 interval);
public GetParamCookie get_param (Xcb.Drawable drawable, uint32 param);
public GetParamCookie get_param_unchecked (Xcb.Drawable drawable, uint32 param);
public GetParamReply? get_param_reply (GetParamCookie cookie, out Xcb.GenericError? e = null);
}
[CCode (cname = "xcb_dri2_attachment_t", cprefix = "XCB_DRI2_ATTACHMENT_", has_type_id = false)]
public enum Attachment {
BUFFER_FRONT_LEFT,
BUFFER_BACK_LEFT,
BUFFER_FRONT_RIGHT,
BUFFER_BACK_RIGHT,
BUFFER_DEPTH,
BUFFER_STENCIL,
BUFFER_ACCUM,
BUFFER_FAKE_FRONT_LEFT,
BUFFER_FAKE_FRONT_RIGHT,
BUFFER_DEPTH_STENCIL,
BUFFER_HIZ
}
[CCode (cname = "xcb_dri2_driver_type_t", cprefix = "XCB_DRI2_DRIVER_TYPE_", has_type_id = false)]
public enum DriverType {
DRI,
VDPAU
}
[CCode (cname = "xcb_dri2_event_type_t", cprefix = "XCB_DRI2_EVENT_TYPE_", has_type_id = false)]
public enum EventType {
EXCHANGE_COMPLETE,
BLIT_COMPLETE,
FLIP_COMPLETE
}
[SimpleType]
[IntegerType (rank = 9)]
[CCode (cname = "xcb_dri2_buffer_t", has_type_id = false)]
public struct Buffer {
public Attachment attachment;
public uint32 name;
public uint32 pitch;
public uint32 cpp;
public uint32 flags;
}
[SimpleType]
[IntegerType (rank = 9)]
[CCode (cname = "xcb_dri2_attach_format_t", has_type_id = false)]
public struct AttachFormat {
public Attachment attachment;
public uint32 format;
}
[SimpleType]
[IntegerType (rank = 9)]
[CCode (cname = "xcb_dri2_query_version_cookie_t", has_type_id = false)]
public struct QueryVersionCookie {
}
[Compact]
[CCode (cname = "xcb_dri2_query_version_reply_t", ref_function = "", unref_function = "free")]
public struct QueryVersionReply {
public uint32 major_version;
public uint32 minor_version;
}
[SimpleType]
[IntegerType (rank = 9)]
[CCode (cname = "xcb_dri2_connect_cookie_t", has_type_id = false)]
public struct ConnectCookie {
}
[Compact]
[CCode (cname = "xcb_dri2_connect_reply_t", ref_function = "", unref_function = "free")]
public struct ConnectReply {
private uint32 driver_name_length;
[CCode (cname = "xcb_dri2_connect_driver_name")]
private char* vala_driver_name ();
public string driver_name { owned get { return "%.*s".printf (driver_name_length, vala_driver_name ()); } }
private uint32 device_name_length;
[CCode (cname = "xcb_dri2_connect_device_name")]
private char* vala_device_name ();
public string device_name { owned get { return "%.*s".printf (device_name_length, vala_device_name ()); } }
}
[SimpleType]
[IntegerType (rank = 9)]
[CCode (cname = "xcb_dri2_authenticate_cookie_t", has_type_id = false)]
public struct AuthenticateCookie {
}
[Compact]
[CCode (cname = "xcb_dri2_authenticate_reply_t", ref_function = "", unref_function = "free")]
public struct AuthenticateReply {
private bool authenticated;
}
[SimpleType]
[IntegerType (rank = 9)]
[CCode (cname = "xcb_dri2_get_buffers_cookie_t", has_type_id = false)]
public struct GetBuffersCookie {
}
[Compact]
[CCode (cname = "xcb_dri2_get_buffers_reply_t", ref_function = "", unref_function = "free")]
public struct GetBuffersReply {
public uint32 width;
public uint32 height;
private uint32 count;
[CCode (cname = "xcb_dri2_get_buffers_buffers")]
private Buffer* vala_buffers ();
public Buffer[] buffers
{
get {
unowned Buffer[] res = (Buffer[]) vala_buffers ();
res.length = (int) count;
return res;
}
}
}
[SimpleType]
[IntegerType (rank = 9)]
[CCode (cname = "xcb_dri2_copy_region_cookie_t", has_type_id = false)]
public struct CopyRegionCookie {
}
[Compact]
[CCode (cname = "xcb_dri2_copy_region_reply_t", ref_function = "", unref_function = "free")]
public struct CopyRegionReply {
/* (intentionally empty) */
}
[SimpleType]
[IntegerType (rank = 9)]
[CCode (cname = "xcb_dri2_get_buffers_with_format_cookie_t", has_type_id = false)]
public struct GetBuffersWithFormatCookie {
}
[Compact]
[CCode (cname = "xcb_dri2_get_buffers_with_format_reply_t", ref_function = "", unref_function = "free")]
public struct GetBuffersWithFormatReply {
public uint32 width;
public uint32 height;
private uint32 count;
[CCode (cname = "xcb_dri2_get_buffers_with_format_buffers")]
private Buffer* vala_buffers ();
public Buffer[] buffers
{
get {
unowned Buffer[] res = (Buffer[]) vala_buffers ();
res.length = (int) count;
return res;
}
}
}
[SimpleType]
[IntegerType (rank = 9)]
[CCode (cname = "xcb_dri2_swap_buffers_cookie_t", has_type_id = false)]
public struct SwapBuffersCookie {
}
[Compact]
[CCode (cname = "xcb_dri2_swap_buffers_reply_t", ref_function = "", unref_function = "free")]
public struct SwapBuffersReply {
private uint32 swap_hi;
private uint32 swap_lo;
public uint64 swap { get { return swap_hi << 32 | swap_lo; } }
}
[SimpleType]
[IntegerType (rank = 9)]
[CCode (cname = "xcb_dri2_get_msc_cookie_t", has_type_id = false)]
public struct GetMSCCookie {
}
[Compact]
[CCode (cname = "xcb_dri2_get_msc_reply_t", ref_function = "", unref_function = "free")]
public struct GetMSCReply {
private uint32 ust_hi;
private uint32 ust_lo;
public uint64 ust { get { return ust_hi << 32 | ust_lo; } }
private uint32 msc_hi;
private uint32 msc_lo;
public uint64 msc { get { return msc_hi << 32 | msc_lo; } }
private uint32 sbc_hi;
private uint32 sbc_lo;
public uint64 sbc { get { return sbc_hi << 32 | sbc_lo; } }
}
[SimpleType]
[IntegerType (rank = 9)]
[CCode (cname = "xcb_dri2_wait_msc_cookie_t", has_type_id = false)]
public struct WaitMSCCookie {
}
[Compact]
[CCode (cname = "xcb_dri2_wait_msc_reply_t", ref_function = "", unref_function = "free")]
public struct WaitMSCReply {
private uint32 ust_hi;
private uint32 ust_lo;
public uint64 ust { get { return ust_hi << 32 | ust_lo; } }
private uint32 msc_hi;
private uint32 msc_lo;
public uint64 msc { get { return msc_hi << 32 | msc_lo; } }
private uint32 sbc_hi;
private uint32 sbc_lo;
public uint64 sbc { get { return sbc_hi << 32 | sbc_lo; } }
}
[SimpleType]
[IntegerType (rank = 9)]
[CCode (cname = "xcb_dri2_wait_sbc_cookie_t", has_type_id = false)]
public struct WaitSBCCookie {
}
[Compact]
[CCode (cname = "xcb_dri2_wait_sbc_reply_t", ref_function = "", unref_function = "free")]
public struct WaitSBCReply {
private uint32 ust_hi;
private uint32 ust_lo;
public uint64 ust { get { return ust_hi << 32 | ust_lo; } }
private uint32 msc_hi;
private uint32 msc_lo;
public uint64 msc { get { return msc_hi << 32 | msc_lo; } }
private uint32 sbc_hi;
private uint32 sbc_lo;
public uint64 sbc { get { return sbc_hi << 32 | sbc_lo; } }
}
[SimpleType]
[IntegerType (rank = 9)]
[CCode (cname = "xcb_dri2_get_param_cookie_t", has_type_id = false)]
public struct GetParamCookie {
}
[Compact]
[CCode (cname = "xcb_dri2_get_param_reply_t", ref_function = "", unref_function = "free")]
public struct GetParamReply {
public bool is_param_recognized;
private uint32 value_hi;
private uint32 value_lo;
public uint64 value { get { return value_hi << 32 | value_lo; } }
}
}
}