Remove building with NOCRYPTO option
[minix.git] / external / mit / xorg / lib / libxcb / files / present.c
blob12faec693158896336f1d41105f7a039629b89b5
1 /*
2 * This file generated automatically from present.xml by c_client.py.
3 * Edit at your peril.
4 */
6 #ifdef HAVE_CONFIG_H
7 #include "config.h"
8 #endif
9 #include <stdlib.h>
10 #include <string.h>
11 #include <assert.h>
12 #include <stddef.h> /* for offsetof() */
13 #include "xcbext.h"
14 #include "present.h"
16 #define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member)
17 #include "xproto.h"
18 #include "randr.h"
19 #include "xfixes.h"
20 #include "sync.h"
22 xcb_extension_t xcb_present_id = { "Present", 0 };
24 void
25 xcb_present_notify_next (xcb_present_notify_iterator_t *i /**< */)
27 --i->rem;
28 ++i->data;
29 i->index += sizeof(xcb_present_notify_t);
32 xcb_generic_iterator_t
33 xcb_present_notify_end (xcb_present_notify_iterator_t i /**< */)
35 xcb_generic_iterator_t ret;
36 ret.data = i.data + i.rem;
37 ret.index = i.index + ((char *) ret.data - (char *) i.data);
38 ret.rem = 0;
39 return ret;
42 xcb_present_query_version_cookie_t
43 xcb_present_query_version (xcb_connection_t *c /**< */,
44 uint32_t major_version /**< */,
45 uint32_t minor_version /**< */)
47 static const xcb_protocol_request_t xcb_req = {
48 /* count */ 2,
49 /* ext */ &xcb_present_id,
50 /* opcode */ XCB_PRESENT_QUERY_VERSION,
51 /* isvoid */ 0
54 struct iovec xcb_parts[4];
55 xcb_present_query_version_cookie_t xcb_ret;
56 xcb_present_query_version_request_t xcb_out;
58 xcb_out.major_version = major_version;
59 xcb_out.minor_version = minor_version;
61 xcb_parts[2].iov_base = (char *) &xcb_out;
62 xcb_parts[2].iov_len = sizeof(xcb_out);
63 xcb_parts[3].iov_base = 0;
64 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
66 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
67 return xcb_ret;
70 xcb_present_query_version_cookie_t
71 xcb_present_query_version_unchecked (xcb_connection_t *c /**< */,
72 uint32_t major_version /**< */,
73 uint32_t minor_version /**< */)
75 static const xcb_protocol_request_t xcb_req = {
76 /* count */ 2,
77 /* ext */ &xcb_present_id,
78 /* opcode */ XCB_PRESENT_QUERY_VERSION,
79 /* isvoid */ 0
82 struct iovec xcb_parts[4];
83 xcb_present_query_version_cookie_t xcb_ret;
84 xcb_present_query_version_request_t xcb_out;
86 xcb_out.major_version = major_version;
87 xcb_out.minor_version = minor_version;
89 xcb_parts[2].iov_base = (char *) &xcb_out;
90 xcb_parts[2].iov_len = sizeof(xcb_out);
91 xcb_parts[3].iov_base = 0;
92 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
94 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
95 return xcb_ret;
98 xcb_present_query_version_reply_t *
99 xcb_present_query_version_reply (xcb_connection_t *c /**< */,
100 xcb_present_query_version_cookie_t cookie /**< */,
101 xcb_generic_error_t **e /**< */)
103 return (xcb_present_query_version_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
107 xcb_present_pixmap_sizeof (const void *_buffer /**< */,
108 uint32_t notifies_len /**< */)
110 char *xcb_tmp = (char *)_buffer;
111 unsigned int xcb_buffer_len = 0;
112 unsigned int xcb_block_len = 0;
113 unsigned int xcb_pad = 0;
114 unsigned int xcb_align_to = 0;
117 xcb_block_len += sizeof(xcb_present_pixmap_request_t);
118 xcb_tmp += xcb_block_len;
119 xcb_buffer_len += xcb_block_len;
120 xcb_block_len = 0;
121 /* notifies */
122 xcb_block_len += notifies_len * sizeof(xcb_present_notify_t);
123 xcb_tmp += xcb_block_len;
124 xcb_align_to = ALIGNOF(xcb_present_notify_t);
125 /* insert padding */
126 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
127 xcb_buffer_len += xcb_block_len + xcb_pad;
128 if (0 != xcb_pad) {
129 xcb_tmp += xcb_pad;
130 xcb_pad = 0;
132 xcb_block_len = 0;
134 return xcb_buffer_len;
137 xcb_void_cookie_t
138 xcb_present_pixmap_checked (xcb_connection_t *c /**< */,
139 xcb_window_t window /**< */,
140 xcb_pixmap_t pixmap /**< */,
141 uint32_t serial /**< */,
142 xcb_xfixes_region_t valid /**< */,
143 xcb_xfixes_region_t update /**< */,
144 int16_t x_off /**< */,
145 int16_t y_off /**< */,
146 xcb_randr_crtc_t target_crtc /**< */,
147 xcb_sync_fence_t wait_fence /**< */,
148 xcb_sync_fence_t idle_fence /**< */,
149 uint32_t options /**< */,
150 uint64_t target_msc /**< */,
151 uint64_t divisor /**< */,
152 uint64_t remainder /**< */,
153 uint32_t notifies_len /**< */,
154 const xcb_present_notify_t *notifies /**< */)
156 static const xcb_protocol_request_t xcb_req = {
157 /* count */ 4,
158 /* ext */ &xcb_present_id,
159 /* opcode */ XCB_PRESENT_PIXMAP,
160 /* isvoid */ 1
163 struct iovec xcb_parts[6];
164 xcb_void_cookie_t xcb_ret;
165 xcb_present_pixmap_request_t xcb_out;
167 xcb_out.window = window;
168 xcb_out.pixmap = pixmap;
169 xcb_out.serial = serial;
170 xcb_out.valid = valid;
171 xcb_out.update = update;
172 xcb_out.x_off = x_off;
173 xcb_out.y_off = y_off;
174 xcb_out.target_crtc = target_crtc;
175 xcb_out.wait_fence = wait_fence;
176 xcb_out.idle_fence = idle_fence;
177 xcb_out.options = options;
178 memset(xcb_out.pad0, 0, 4);
179 xcb_out.target_msc = target_msc;
180 xcb_out.divisor = divisor;
181 xcb_out.remainder = remainder;
183 xcb_parts[2].iov_base = (char *) &xcb_out;
184 xcb_parts[2].iov_len = sizeof(xcb_out);
185 xcb_parts[3].iov_base = 0;
186 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
187 /* xcb_present_notify_t notifies */
188 xcb_parts[4].iov_base = (char *) notifies;
189 xcb_parts[4].iov_len = notifies_len * sizeof(xcb_present_notify_t);
190 xcb_parts[5].iov_base = 0;
191 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
193 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
194 return xcb_ret;
197 xcb_void_cookie_t
198 xcb_present_pixmap (xcb_connection_t *c /**< */,
199 xcb_window_t window /**< */,
200 xcb_pixmap_t pixmap /**< */,
201 uint32_t serial /**< */,
202 xcb_xfixes_region_t valid /**< */,
203 xcb_xfixes_region_t update /**< */,
204 int16_t x_off /**< */,
205 int16_t y_off /**< */,
206 xcb_randr_crtc_t target_crtc /**< */,
207 xcb_sync_fence_t wait_fence /**< */,
208 xcb_sync_fence_t idle_fence /**< */,
209 uint32_t options /**< */,
210 uint64_t target_msc /**< */,
211 uint64_t divisor /**< */,
212 uint64_t remainder /**< */,
213 uint32_t notifies_len /**< */,
214 const xcb_present_notify_t *notifies /**< */)
216 static const xcb_protocol_request_t xcb_req = {
217 /* count */ 4,
218 /* ext */ &xcb_present_id,
219 /* opcode */ XCB_PRESENT_PIXMAP,
220 /* isvoid */ 1
223 struct iovec xcb_parts[6];
224 xcb_void_cookie_t xcb_ret;
225 xcb_present_pixmap_request_t xcb_out;
227 xcb_out.window = window;
228 xcb_out.pixmap = pixmap;
229 xcb_out.serial = serial;
230 xcb_out.valid = valid;
231 xcb_out.update = update;
232 xcb_out.x_off = x_off;
233 xcb_out.y_off = y_off;
234 xcb_out.target_crtc = target_crtc;
235 xcb_out.wait_fence = wait_fence;
236 xcb_out.idle_fence = idle_fence;
237 xcb_out.options = options;
238 memset(xcb_out.pad0, 0, 4);
239 xcb_out.target_msc = target_msc;
240 xcb_out.divisor = divisor;
241 xcb_out.remainder = remainder;
243 xcb_parts[2].iov_base = (char *) &xcb_out;
244 xcb_parts[2].iov_len = sizeof(xcb_out);
245 xcb_parts[3].iov_base = 0;
246 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
247 /* xcb_present_notify_t notifies */
248 xcb_parts[4].iov_base = (char *) notifies;
249 xcb_parts[4].iov_len = notifies_len * sizeof(xcb_present_notify_t);
250 xcb_parts[5].iov_base = 0;
251 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
253 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
254 return xcb_ret;
257 xcb_void_cookie_t
258 xcb_present_notify_msc_checked (xcb_connection_t *c /**< */,
259 xcb_window_t window /**< */,
260 uint32_t serial /**< */,
261 uint64_t target_msc /**< */,
262 uint64_t divisor /**< */,
263 uint64_t remainder /**< */)
265 static const xcb_protocol_request_t xcb_req = {
266 /* count */ 2,
267 /* ext */ &xcb_present_id,
268 /* opcode */ XCB_PRESENT_NOTIFY_MSC,
269 /* isvoid */ 1
272 struct iovec xcb_parts[4];
273 xcb_void_cookie_t xcb_ret;
274 xcb_present_notify_msc_request_t xcb_out;
276 xcb_out.window = window;
277 xcb_out.serial = serial;
278 memset(xcb_out.pad0, 0, 4);
279 xcb_out.target_msc = target_msc;
280 xcb_out.divisor = divisor;
281 xcb_out.remainder = remainder;
283 xcb_parts[2].iov_base = (char *) &xcb_out;
284 xcb_parts[2].iov_len = sizeof(xcb_out);
285 xcb_parts[3].iov_base = 0;
286 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
288 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
289 return xcb_ret;
292 xcb_void_cookie_t
293 xcb_present_notify_msc (xcb_connection_t *c /**< */,
294 xcb_window_t window /**< */,
295 uint32_t serial /**< */,
296 uint64_t target_msc /**< */,
297 uint64_t divisor /**< */,
298 uint64_t remainder /**< */)
300 static const xcb_protocol_request_t xcb_req = {
301 /* count */ 2,
302 /* ext */ &xcb_present_id,
303 /* opcode */ XCB_PRESENT_NOTIFY_MSC,
304 /* isvoid */ 1
307 struct iovec xcb_parts[4];
308 xcb_void_cookie_t xcb_ret;
309 xcb_present_notify_msc_request_t xcb_out;
311 xcb_out.window = window;
312 xcb_out.serial = serial;
313 memset(xcb_out.pad0, 0, 4);
314 xcb_out.target_msc = target_msc;
315 xcb_out.divisor = divisor;
316 xcb_out.remainder = remainder;
318 xcb_parts[2].iov_base = (char *) &xcb_out;
319 xcb_parts[2].iov_len = sizeof(xcb_out);
320 xcb_parts[3].iov_base = 0;
321 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
323 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
324 return xcb_ret;
327 void
328 xcb_present_event_next (xcb_present_event_iterator_t *i /**< */)
330 --i->rem;
331 ++i->data;
332 i->index += sizeof(xcb_present_event_t);
335 xcb_generic_iterator_t
336 xcb_present_event_end (xcb_present_event_iterator_t i /**< */)
338 xcb_generic_iterator_t ret;
339 ret.data = i.data + i.rem;
340 ret.index = i.index + ((char *) ret.data - (char *) i.data);
341 ret.rem = 0;
342 return ret;
345 xcb_void_cookie_t
346 xcb_present_select_input_checked (xcb_connection_t *c /**< */,
347 xcb_present_event_t eid /**< */,
348 xcb_window_t window /**< */,
349 uint32_t event_mask /**< */)
351 static const xcb_protocol_request_t xcb_req = {
352 /* count */ 2,
353 /* ext */ &xcb_present_id,
354 /* opcode */ XCB_PRESENT_SELECT_INPUT,
355 /* isvoid */ 1
358 struct iovec xcb_parts[4];
359 xcb_void_cookie_t xcb_ret;
360 xcb_present_select_input_request_t xcb_out;
362 xcb_out.eid = eid;
363 xcb_out.window = window;
364 xcb_out.event_mask = event_mask;
366 xcb_parts[2].iov_base = (char *) &xcb_out;
367 xcb_parts[2].iov_len = sizeof(xcb_out);
368 xcb_parts[3].iov_base = 0;
369 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
371 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
372 return xcb_ret;
375 xcb_void_cookie_t
376 xcb_present_select_input (xcb_connection_t *c /**< */,
377 xcb_present_event_t eid /**< */,
378 xcb_window_t window /**< */,
379 uint32_t event_mask /**< */)
381 static const xcb_protocol_request_t xcb_req = {
382 /* count */ 2,
383 /* ext */ &xcb_present_id,
384 /* opcode */ XCB_PRESENT_SELECT_INPUT,
385 /* isvoid */ 1
388 struct iovec xcb_parts[4];
389 xcb_void_cookie_t xcb_ret;
390 xcb_present_select_input_request_t xcb_out;
392 xcb_out.eid = eid;
393 xcb_out.window = window;
394 xcb_out.event_mask = event_mask;
396 xcb_parts[2].iov_base = (char *) &xcb_out;
397 xcb_parts[2].iov_len = sizeof(xcb_out);
398 xcb_parts[3].iov_base = 0;
399 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
401 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
402 return xcb_ret;
405 xcb_present_query_capabilities_cookie_t
406 xcb_present_query_capabilities (xcb_connection_t *c /**< */,
407 uint32_t target /**< */)
409 static const xcb_protocol_request_t xcb_req = {
410 /* count */ 2,
411 /* ext */ &xcb_present_id,
412 /* opcode */ XCB_PRESENT_QUERY_CAPABILITIES,
413 /* isvoid */ 0
416 struct iovec xcb_parts[4];
417 xcb_present_query_capabilities_cookie_t xcb_ret;
418 xcb_present_query_capabilities_request_t xcb_out;
420 xcb_out.target = target;
422 xcb_parts[2].iov_base = (char *) &xcb_out;
423 xcb_parts[2].iov_len = sizeof(xcb_out);
424 xcb_parts[3].iov_base = 0;
425 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
427 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
428 return xcb_ret;
431 xcb_present_query_capabilities_cookie_t
432 xcb_present_query_capabilities_unchecked (xcb_connection_t *c /**< */,
433 uint32_t target /**< */)
435 static const xcb_protocol_request_t xcb_req = {
436 /* count */ 2,
437 /* ext */ &xcb_present_id,
438 /* opcode */ XCB_PRESENT_QUERY_CAPABILITIES,
439 /* isvoid */ 0
442 struct iovec xcb_parts[4];
443 xcb_present_query_capabilities_cookie_t xcb_ret;
444 xcb_present_query_capabilities_request_t xcb_out;
446 xcb_out.target = target;
448 xcb_parts[2].iov_base = (char *) &xcb_out;
449 xcb_parts[2].iov_len = sizeof(xcb_out);
450 xcb_parts[3].iov_base = 0;
451 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
453 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
454 return xcb_ret;
457 xcb_present_query_capabilities_reply_t *
458 xcb_present_query_capabilities_reply (xcb_connection_t *c /**< */,
459 xcb_present_query_capabilities_cookie_t cookie /**< */,
460 xcb_generic_error_t **e /**< */)
462 return (xcb_present_query_capabilities_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
466 xcb_present_redirect_notify_sizeof (const void *_buffer /**< */,
467 uint32_t notifies_len /**< */)
469 char *xcb_tmp = (char *)_buffer;
470 unsigned int xcb_buffer_len = 0;
471 unsigned int xcb_block_len = 0;
472 unsigned int xcb_pad = 0;
473 unsigned int xcb_align_to = 0;
476 xcb_block_len += sizeof(xcb_present_redirect_notify_event_t);
477 xcb_tmp += xcb_block_len;
478 xcb_buffer_len += xcb_block_len;
479 xcb_block_len = 0;
480 /* notifies */
481 xcb_block_len += notifies_len * sizeof(xcb_present_notify_t);
482 xcb_tmp += xcb_block_len;
483 xcb_align_to = ALIGNOF(xcb_present_notify_t);
484 /* insert padding */
485 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
486 xcb_buffer_len += xcb_block_len + xcb_pad;
487 if (0 != xcb_pad) {
488 xcb_tmp += xcb_pad;
489 xcb_pad = 0;
491 xcb_block_len = 0;
493 return xcb_buffer_len;