xref: /minix/external/mit/xorg/lib/libxcb/files/randr.c (revision 0a6a1f1d)
1 /*
2  * This file generated automatically from randr.xml by c_client.py.
3  * Edit at your peril.
4  */
5 
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 "randr.h"
15 
16 #define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member)
17 #include "xproto.h"
18 #include "render.h"
19 
20 xcb_extension_t xcb_randr_id = { "RANDR", 0 };
21 
22 void
xcb_randr_mode_next(xcb_randr_mode_iterator_t * i)23 xcb_randr_mode_next (xcb_randr_mode_iterator_t *i  /**< */)
24 {
25     --i->rem;
26     ++i->data;
27     i->index += sizeof(xcb_randr_mode_t);
28 }
29 
30 xcb_generic_iterator_t
xcb_randr_mode_end(xcb_randr_mode_iterator_t i)31 xcb_randr_mode_end (xcb_randr_mode_iterator_t i  /**< */)
32 {
33     xcb_generic_iterator_t ret;
34     ret.data = i.data + i.rem;
35     ret.index = i.index + ((char *) ret.data - (char *) i.data);
36     ret.rem = 0;
37     return ret;
38 }
39 
40 void
xcb_randr_crtc_next(xcb_randr_crtc_iterator_t * i)41 xcb_randr_crtc_next (xcb_randr_crtc_iterator_t *i  /**< */)
42 {
43     --i->rem;
44     ++i->data;
45     i->index += sizeof(xcb_randr_crtc_t);
46 }
47 
48 xcb_generic_iterator_t
xcb_randr_crtc_end(xcb_randr_crtc_iterator_t i)49 xcb_randr_crtc_end (xcb_randr_crtc_iterator_t i  /**< */)
50 {
51     xcb_generic_iterator_t ret;
52     ret.data = i.data + i.rem;
53     ret.index = i.index + ((char *) ret.data - (char *) i.data);
54     ret.rem = 0;
55     return ret;
56 }
57 
58 void
xcb_randr_output_next(xcb_randr_output_iterator_t * i)59 xcb_randr_output_next (xcb_randr_output_iterator_t *i  /**< */)
60 {
61     --i->rem;
62     ++i->data;
63     i->index += sizeof(xcb_randr_output_t);
64 }
65 
66 xcb_generic_iterator_t
xcb_randr_output_end(xcb_randr_output_iterator_t i)67 xcb_randr_output_end (xcb_randr_output_iterator_t i  /**< */)
68 {
69     xcb_generic_iterator_t ret;
70     ret.data = i.data + i.rem;
71     ret.index = i.index + ((char *) ret.data - (char *) i.data);
72     ret.rem = 0;
73     return ret;
74 }
75 
76 void
xcb_randr_provider_next(xcb_randr_provider_iterator_t * i)77 xcb_randr_provider_next (xcb_randr_provider_iterator_t *i  /**< */)
78 {
79     --i->rem;
80     ++i->data;
81     i->index += sizeof(xcb_randr_provider_t);
82 }
83 
84 xcb_generic_iterator_t
xcb_randr_provider_end(xcb_randr_provider_iterator_t i)85 xcb_randr_provider_end (xcb_randr_provider_iterator_t i  /**< */)
86 {
87     xcb_generic_iterator_t ret;
88     ret.data = i.data + i.rem;
89     ret.index = i.index + ((char *) ret.data - (char *) i.data);
90     ret.rem = 0;
91     return ret;
92 }
93 
94 void
xcb_randr_screen_size_next(xcb_randr_screen_size_iterator_t * i)95 xcb_randr_screen_size_next (xcb_randr_screen_size_iterator_t *i  /**< */)
96 {
97     --i->rem;
98     ++i->data;
99     i->index += sizeof(xcb_randr_screen_size_t);
100 }
101 
102 xcb_generic_iterator_t
xcb_randr_screen_size_end(xcb_randr_screen_size_iterator_t i)103 xcb_randr_screen_size_end (xcb_randr_screen_size_iterator_t i  /**< */)
104 {
105     xcb_generic_iterator_t ret;
106     ret.data = i.data + i.rem;
107     ret.index = i.index + ((char *) ret.data - (char *) i.data);
108     ret.rem = 0;
109     return ret;
110 }
111 
112 int
xcb_randr_refresh_rates_sizeof(const void * _buffer)113 xcb_randr_refresh_rates_sizeof (const void  *_buffer  /**< */)
114 {
115     char *xcb_tmp = (char *)_buffer;
116     const xcb_randr_refresh_rates_t *_aux = (xcb_randr_refresh_rates_t *)_buffer;
117     unsigned int xcb_buffer_len = 0;
118     unsigned int xcb_block_len = 0;
119     unsigned int xcb_pad = 0;
120     unsigned int xcb_align_to = 0;
121 
122 
123     xcb_block_len += sizeof(xcb_randr_refresh_rates_t);
124     xcb_tmp += xcb_block_len;
125     xcb_buffer_len += xcb_block_len;
126     xcb_block_len = 0;
127     /* rates */
128     xcb_block_len += _aux->nRates * sizeof(uint16_t);
129     xcb_tmp += xcb_block_len;
130     xcb_align_to = ALIGNOF(uint16_t);
131     /* insert padding */
132     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
133     xcb_buffer_len += xcb_block_len + xcb_pad;
134     if (0 != xcb_pad) {
135         xcb_tmp += xcb_pad;
136         xcb_pad = 0;
137     }
138     xcb_block_len = 0;
139 
140     return xcb_buffer_len;
141 }
142 
143 uint16_t *
xcb_randr_refresh_rates_rates(const xcb_randr_refresh_rates_t * R)144 xcb_randr_refresh_rates_rates (const xcb_randr_refresh_rates_t *R  /**< */)
145 {
146     return (uint16_t *) (R + 1);
147 }
148 
149 int
xcb_randr_refresh_rates_rates_length(const xcb_randr_refresh_rates_t * R)150 xcb_randr_refresh_rates_rates_length (const xcb_randr_refresh_rates_t *R  /**< */)
151 {
152     return R->nRates;
153 }
154 
155 xcb_generic_iterator_t
xcb_randr_refresh_rates_rates_end(const xcb_randr_refresh_rates_t * R)156 xcb_randr_refresh_rates_rates_end (const xcb_randr_refresh_rates_t *R  /**< */)
157 {
158     xcb_generic_iterator_t i;
159     i.data = ((uint16_t *) (R + 1)) + (R->nRates);
160     i.rem = 0;
161     i.index = (char *) i.data - (char *) R;
162     return i;
163 }
164 
165 void
xcb_randr_refresh_rates_next(xcb_randr_refresh_rates_iterator_t * i)166 xcb_randr_refresh_rates_next (xcb_randr_refresh_rates_iterator_t *i  /**< */)
167 {
168     xcb_randr_refresh_rates_t *R = i->data;
169     xcb_generic_iterator_t child;
170     child.data = (xcb_randr_refresh_rates_t *)(((char *)R) + xcb_randr_refresh_rates_sizeof(R));
171     i->index = (char *) child.data - (char *) i->data;
172     --i->rem;
173     i->data = (xcb_randr_refresh_rates_t *) child.data;
174 }
175 
176 xcb_generic_iterator_t
xcb_randr_refresh_rates_end(xcb_randr_refresh_rates_iterator_t i)177 xcb_randr_refresh_rates_end (xcb_randr_refresh_rates_iterator_t i  /**< */)
178 {
179     xcb_generic_iterator_t ret;
180     while(i.rem > 0)
181         xcb_randr_refresh_rates_next(&i);
182     ret.data = i.data;
183     ret.rem = i.rem;
184     ret.index = i.index;
185     return ret;
186 }
187 
188 xcb_randr_query_version_cookie_t
xcb_randr_query_version(xcb_connection_t * c,uint32_t major_version,uint32_t minor_version)189 xcb_randr_query_version (xcb_connection_t *c  /**< */,
190                          uint32_t          major_version  /**< */,
191                          uint32_t          minor_version  /**< */)
192 {
193     static const xcb_protocol_request_t xcb_req = {
194         /* count */ 2,
195         /* ext */ &xcb_randr_id,
196         /* opcode */ XCB_RANDR_QUERY_VERSION,
197         /* isvoid */ 0
198     };
199 
200     struct iovec xcb_parts[4];
201     xcb_randr_query_version_cookie_t xcb_ret;
202     xcb_randr_query_version_request_t xcb_out;
203 
204     xcb_out.major_version = major_version;
205     xcb_out.minor_version = minor_version;
206 
207     xcb_parts[2].iov_base = (char *) &xcb_out;
208     xcb_parts[2].iov_len = sizeof(xcb_out);
209     xcb_parts[3].iov_base = 0;
210     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
211 
212     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
213     return xcb_ret;
214 }
215 
216 xcb_randr_query_version_cookie_t
xcb_randr_query_version_unchecked(xcb_connection_t * c,uint32_t major_version,uint32_t minor_version)217 xcb_randr_query_version_unchecked (xcb_connection_t *c  /**< */,
218                                    uint32_t          major_version  /**< */,
219                                    uint32_t          minor_version  /**< */)
220 {
221     static const xcb_protocol_request_t xcb_req = {
222         /* count */ 2,
223         /* ext */ &xcb_randr_id,
224         /* opcode */ XCB_RANDR_QUERY_VERSION,
225         /* isvoid */ 0
226     };
227 
228     struct iovec xcb_parts[4];
229     xcb_randr_query_version_cookie_t xcb_ret;
230     xcb_randr_query_version_request_t xcb_out;
231 
232     xcb_out.major_version = major_version;
233     xcb_out.minor_version = minor_version;
234 
235     xcb_parts[2].iov_base = (char *) &xcb_out;
236     xcb_parts[2].iov_len = sizeof(xcb_out);
237     xcb_parts[3].iov_base = 0;
238     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
239 
240     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
241     return xcb_ret;
242 }
243 
244 xcb_randr_query_version_reply_t *
xcb_randr_query_version_reply(xcb_connection_t * c,xcb_randr_query_version_cookie_t cookie,xcb_generic_error_t ** e)245 xcb_randr_query_version_reply (xcb_connection_t                  *c  /**< */,
246                                xcb_randr_query_version_cookie_t   cookie  /**< */,
247                                xcb_generic_error_t              **e  /**< */)
248 {
249     return (xcb_randr_query_version_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
250 }
251 
252 xcb_randr_set_screen_config_cookie_t
xcb_randr_set_screen_config(xcb_connection_t * c,xcb_window_t window,xcb_timestamp_t timestamp,xcb_timestamp_t config_timestamp,uint16_t sizeID,uint16_t rotation,uint16_t rate)253 xcb_randr_set_screen_config (xcb_connection_t *c  /**< */,
254                              xcb_window_t      window  /**< */,
255                              xcb_timestamp_t   timestamp  /**< */,
256                              xcb_timestamp_t   config_timestamp  /**< */,
257                              uint16_t          sizeID  /**< */,
258                              uint16_t          rotation  /**< */,
259                              uint16_t          rate  /**< */)
260 {
261     static const xcb_protocol_request_t xcb_req = {
262         /* count */ 2,
263         /* ext */ &xcb_randr_id,
264         /* opcode */ XCB_RANDR_SET_SCREEN_CONFIG,
265         /* isvoid */ 0
266     };
267 
268     struct iovec xcb_parts[4];
269     xcb_randr_set_screen_config_cookie_t xcb_ret;
270     xcb_randr_set_screen_config_request_t xcb_out;
271 
272     xcb_out.window = window;
273     xcb_out.timestamp = timestamp;
274     xcb_out.config_timestamp = config_timestamp;
275     xcb_out.sizeID = sizeID;
276     xcb_out.rotation = rotation;
277     xcb_out.rate = rate;
278     memset(xcb_out.pad0, 0, 2);
279 
280     xcb_parts[2].iov_base = (char *) &xcb_out;
281     xcb_parts[2].iov_len = sizeof(xcb_out);
282     xcb_parts[3].iov_base = 0;
283     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
284 
285     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
286     return xcb_ret;
287 }
288 
289 xcb_randr_set_screen_config_cookie_t
xcb_randr_set_screen_config_unchecked(xcb_connection_t * c,xcb_window_t window,xcb_timestamp_t timestamp,xcb_timestamp_t config_timestamp,uint16_t sizeID,uint16_t rotation,uint16_t rate)290 xcb_randr_set_screen_config_unchecked (xcb_connection_t *c  /**< */,
291                                        xcb_window_t      window  /**< */,
292                                        xcb_timestamp_t   timestamp  /**< */,
293                                        xcb_timestamp_t   config_timestamp  /**< */,
294                                        uint16_t          sizeID  /**< */,
295                                        uint16_t          rotation  /**< */,
296                                        uint16_t          rate  /**< */)
297 {
298     static const xcb_protocol_request_t xcb_req = {
299         /* count */ 2,
300         /* ext */ &xcb_randr_id,
301         /* opcode */ XCB_RANDR_SET_SCREEN_CONFIG,
302         /* isvoid */ 0
303     };
304 
305     struct iovec xcb_parts[4];
306     xcb_randr_set_screen_config_cookie_t xcb_ret;
307     xcb_randr_set_screen_config_request_t xcb_out;
308 
309     xcb_out.window = window;
310     xcb_out.timestamp = timestamp;
311     xcb_out.config_timestamp = config_timestamp;
312     xcb_out.sizeID = sizeID;
313     xcb_out.rotation = rotation;
314     xcb_out.rate = rate;
315     memset(xcb_out.pad0, 0, 2);
316 
317     xcb_parts[2].iov_base = (char *) &xcb_out;
318     xcb_parts[2].iov_len = sizeof(xcb_out);
319     xcb_parts[3].iov_base = 0;
320     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
321 
322     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
323     return xcb_ret;
324 }
325 
326 xcb_randr_set_screen_config_reply_t *
xcb_randr_set_screen_config_reply(xcb_connection_t * c,xcb_randr_set_screen_config_cookie_t cookie,xcb_generic_error_t ** e)327 xcb_randr_set_screen_config_reply (xcb_connection_t                      *c  /**< */,
328                                    xcb_randr_set_screen_config_cookie_t   cookie  /**< */,
329                                    xcb_generic_error_t                  **e  /**< */)
330 {
331     return (xcb_randr_set_screen_config_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
332 }
333 
334 xcb_void_cookie_t
xcb_randr_select_input_checked(xcb_connection_t * c,xcb_window_t window,uint16_t enable)335 xcb_randr_select_input_checked (xcb_connection_t *c  /**< */,
336                                 xcb_window_t      window  /**< */,
337                                 uint16_t          enable  /**< */)
338 {
339     static const xcb_protocol_request_t xcb_req = {
340         /* count */ 2,
341         /* ext */ &xcb_randr_id,
342         /* opcode */ XCB_RANDR_SELECT_INPUT,
343         /* isvoid */ 1
344     };
345 
346     struct iovec xcb_parts[4];
347     xcb_void_cookie_t xcb_ret;
348     xcb_randr_select_input_request_t xcb_out;
349 
350     xcb_out.window = window;
351     xcb_out.enable = enable;
352     memset(xcb_out.pad0, 0, 2);
353 
354     xcb_parts[2].iov_base = (char *) &xcb_out;
355     xcb_parts[2].iov_len = sizeof(xcb_out);
356     xcb_parts[3].iov_base = 0;
357     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
358 
359     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
360     return xcb_ret;
361 }
362 
363 xcb_void_cookie_t
xcb_randr_select_input(xcb_connection_t * c,xcb_window_t window,uint16_t enable)364 xcb_randr_select_input (xcb_connection_t *c  /**< */,
365                         xcb_window_t      window  /**< */,
366                         uint16_t          enable  /**< */)
367 {
368     static const xcb_protocol_request_t xcb_req = {
369         /* count */ 2,
370         /* ext */ &xcb_randr_id,
371         /* opcode */ XCB_RANDR_SELECT_INPUT,
372         /* isvoid */ 1
373     };
374 
375     struct iovec xcb_parts[4];
376     xcb_void_cookie_t xcb_ret;
377     xcb_randr_select_input_request_t xcb_out;
378 
379     xcb_out.window = window;
380     xcb_out.enable = enable;
381     memset(xcb_out.pad0, 0, 2);
382 
383     xcb_parts[2].iov_base = (char *) &xcb_out;
384     xcb_parts[2].iov_len = sizeof(xcb_out);
385     xcb_parts[3].iov_base = 0;
386     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
387 
388     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
389     return xcb_ret;
390 }
391 
392 int
xcb_randr_get_screen_info_sizeof(const void * _buffer)393 xcb_randr_get_screen_info_sizeof (const void  *_buffer  /**< */)
394 {
395     char *xcb_tmp = (char *)_buffer;
396     const xcb_randr_get_screen_info_reply_t *_aux = (xcb_randr_get_screen_info_reply_t *)_buffer;
397     unsigned int xcb_buffer_len = 0;
398     unsigned int xcb_block_len = 0;
399     unsigned int xcb_pad = 0;
400     unsigned int xcb_align_to = 0;
401 
402     unsigned int i;
403     unsigned int xcb_tmp_len;
404 
405     xcb_block_len += sizeof(xcb_randr_get_screen_info_reply_t);
406     xcb_tmp += xcb_block_len;
407     xcb_buffer_len += xcb_block_len;
408     xcb_block_len = 0;
409     /* sizes */
410     xcb_block_len += _aux->nSizes * sizeof(xcb_randr_screen_size_t);
411     xcb_tmp += xcb_block_len;
412     xcb_align_to = ALIGNOF(xcb_randr_screen_size_t);
413     /* insert padding */
414     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
415     xcb_buffer_len += xcb_block_len + xcb_pad;
416     if (0 != xcb_pad) {
417         xcb_tmp += xcb_pad;
418         xcb_pad = 0;
419     }
420     xcb_block_len = 0;
421     /* rates */
422     for(i=0; i<(_aux->nInfo - _aux->nSizes); i++) {
423         xcb_tmp_len = xcb_randr_refresh_rates_sizeof(xcb_tmp);
424         xcb_block_len += xcb_tmp_len;
425         xcb_tmp += xcb_tmp_len;
426     }
427     xcb_align_to = ALIGNOF(xcb_randr_refresh_rates_t);
428     /* insert padding */
429     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
430     xcb_buffer_len += xcb_block_len + xcb_pad;
431     if (0 != xcb_pad) {
432         xcb_tmp += xcb_pad;
433         xcb_pad = 0;
434     }
435     xcb_block_len = 0;
436 
437     return xcb_buffer_len;
438 }
439 
440 xcb_randr_get_screen_info_cookie_t
xcb_randr_get_screen_info(xcb_connection_t * c,xcb_window_t window)441 xcb_randr_get_screen_info (xcb_connection_t *c  /**< */,
442                            xcb_window_t      window  /**< */)
443 {
444     static const xcb_protocol_request_t xcb_req = {
445         /* count */ 2,
446         /* ext */ &xcb_randr_id,
447         /* opcode */ XCB_RANDR_GET_SCREEN_INFO,
448         /* isvoid */ 0
449     };
450 
451     struct iovec xcb_parts[4];
452     xcb_randr_get_screen_info_cookie_t xcb_ret;
453     xcb_randr_get_screen_info_request_t xcb_out;
454 
455     xcb_out.window = window;
456 
457     xcb_parts[2].iov_base = (char *) &xcb_out;
458     xcb_parts[2].iov_len = sizeof(xcb_out);
459     xcb_parts[3].iov_base = 0;
460     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
461 
462     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
463     return xcb_ret;
464 }
465 
466 xcb_randr_get_screen_info_cookie_t
xcb_randr_get_screen_info_unchecked(xcb_connection_t * c,xcb_window_t window)467 xcb_randr_get_screen_info_unchecked (xcb_connection_t *c  /**< */,
468                                      xcb_window_t      window  /**< */)
469 {
470     static const xcb_protocol_request_t xcb_req = {
471         /* count */ 2,
472         /* ext */ &xcb_randr_id,
473         /* opcode */ XCB_RANDR_GET_SCREEN_INFO,
474         /* isvoid */ 0
475     };
476 
477     struct iovec xcb_parts[4];
478     xcb_randr_get_screen_info_cookie_t xcb_ret;
479     xcb_randr_get_screen_info_request_t xcb_out;
480 
481     xcb_out.window = window;
482 
483     xcb_parts[2].iov_base = (char *) &xcb_out;
484     xcb_parts[2].iov_len = sizeof(xcb_out);
485     xcb_parts[3].iov_base = 0;
486     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
487 
488     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
489     return xcb_ret;
490 }
491 
492 xcb_randr_screen_size_t *
xcb_randr_get_screen_info_sizes(const xcb_randr_get_screen_info_reply_t * R)493 xcb_randr_get_screen_info_sizes (const xcb_randr_get_screen_info_reply_t *R  /**< */)
494 {
495     return (xcb_randr_screen_size_t *) (R + 1);
496 }
497 
498 int
xcb_randr_get_screen_info_sizes_length(const xcb_randr_get_screen_info_reply_t * R)499 xcb_randr_get_screen_info_sizes_length (const xcb_randr_get_screen_info_reply_t *R  /**< */)
500 {
501     return R->nSizes;
502 }
503 
504 xcb_randr_screen_size_iterator_t
xcb_randr_get_screen_info_sizes_iterator(const xcb_randr_get_screen_info_reply_t * R)505 xcb_randr_get_screen_info_sizes_iterator (const xcb_randr_get_screen_info_reply_t *R  /**< */)
506 {
507     xcb_randr_screen_size_iterator_t i;
508     i.data = (xcb_randr_screen_size_t *) (R + 1);
509     i.rem = R->nSizes;
510     i.index = (char *) i.data - (char *) R;
511     return i;
512 }
513 
514 int
xcb_randr_get_screen_info_rates_length(const xcb_randr_get_screen_info_reply_t * R)515 xcb_randr_get_screen_info_rates_length (const xcb_randr_get_screen_info_reply_t *R  /**< */)
516 {
517     return (R->nInfo - R->nSizes);
518 }
519 
520 xcb_randr_refresh_rates_iterator_t
xcb_randr_get_screen_info_rates_iterator(const xcb_randr_get_screen_info_reply_t * R)521 xcb_randr_get_screen_info_rates_iterator (const xcb_randr_get_screen_info_reply_t *R  /**< */)
522 {
523     xcb_randr_refresh_rates_iterator_t i;
524     xcb_generic_iterator_t prev = xcb_randr_screen_size_end(xcb_randr_get_screen_info_sizes_iterator(R));
525     i.data = (xcb_randr_refresh_rates_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_randr_refresh_rates_t, prev.index));
526     i.rem = (R->nInfo - R->nSizes);
527     i.index = (char *) i.data - (char *) R;
528     return i;
529 }
530 
531 xcb_randr_get_screen_info_reply_t *
xcb_randr_get_screen_info_reply(xcb_connection_t * c,xcb_randr_get_screen_info_cookie_t cookie,xcb_generic_error_t ** e)532 xcb_randr_get_screen_info_reply (xcb_connection_t                    *c  /**< */,
533                                  xcb_randr_get_screen_info_cookie_t   cookie  /**< */,
534                                  xcb_generic_error_t                **e  /**< */)
535 {
536     return (xcb_randr_get_screen_info_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
537 }
538 
539 xcb_randr_get_screen_size_range_cookie_t
xcb_randr_get_screen_size_range(xcb_connection_t * c,xcb_window_t window)540 xcb_randr_get_screen_size_range (xcb_connection_t *c  /**< */,
541                                  xcb_window_t      window  /**< */)
542 {
543     static const xcb_protocol_request_t xcb_req = {
544         /* count */ 2,
545         /* ext */ &xcb_randr_id,
546         /* opcode */ XCB_RANDR_GET_SCREEN_SIZE_RANGE,
547         /* isvoid */ 0
548     };
549 
550     struct iovec xcb_parts[4];
551     xcb_randr_get_screen_size_range_cookie_t xcb_ret;
552     xcb_randr_get_screen_size_range_request_t xcb_out;
553 
554     xcb_out.window = window;
555 
556     xcb_parts[2].iov_base = (char *) &xcb_out;
557     xcb_parts[2].iov_len = sizeof(xcb_out);
558     xcb_parts[3].iov_base = 0;
559     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
560 
561     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
562     return xcb_ret;
563 }
564 
565 xcb_randr_get_screen_size_range_cookie_t
xcb_randr_get_screen_size_range_unchecked(xcb_connection_t * c,xcb_window_t window)566 xcb_randr_get_screen_size_range_unchecked (xcb_connection_t *c  /**< */,
567                                            xcb_window_t      window  /**< */)
568 {
569     static const xcb_protocol_request_t xcb_req = {
570         /* count */ 2,
571         /* ext */ &xcb_randr_id,
572         /* opcode */ XCB_RANDR_GET_SCREEN_SIZE_RANGE,
573         /* isvoid */ 0
574     };
575 
576     struct iovec xcb_parts[4];
577     xcb_randr_get_screen_size_range_cookie_t xcb_ret;
578     xcb_randr_get_screen_size_range_request_t xcb_out;
579 
580     xcb_out.window = window;
581 
582     xcb_parts[2].iov_base = (char *) &xcb_out;
583     xcb_parts[2].iov_len = sizeof(xcb_out);
584     xcb_parts[3].iov_base = 0;
585     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
586 
587     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
588     return xcb_ret;
589 }
590 
591 xcb_randr_get_screen_size_range_reply_t *
xcb_randr_get_screen_size_range_reply(xcb_connection_t * c,xcb_randr_get_screen_size_range_cookie_t cookie,xcb_generic_error_t ** e)592 xcb_randr_get_screen_size_range_reply (xcb_connection_t                          *c  /**< */,
593                                        xcb_randr_get_screen_size_range_cookie_t   cookie  /**< */,
594                                        xcb_generic_error_t                      **e  /**< */)
595 {
596     return (xcb_randr_get_screen_size_range_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
597 }
598 
599 xcb_void_cookie_t
xcb_randr_set_screen_size_checked(xcb_connection_t * c,xcb_window_t window,uint16_t width,uint16_t height,uint32_t mm_width,uint32_t mm_height)600 xcb_randr_set_screen_size_checked (xcb_connection_t *c  /**< */,
601                                    xcb_window_t      window  /**< */,
602                                    uint16_t          width  /**< */,
603                                    uint16_t          height  /**< */,
604                                    uint32_t          mm_width  /**< */,
605                                    uint32_t          mm_height  /**< */)
606 {
607     static const xcb_protocol_request_t xcb_req = {
608         /* count */ 2,
609         /* ext */ &xcb_randr_id,
610         /* opcode */ XCB_RANDR_SET_SCREEN_SIZE,
611         /* isvoid */ 1
612     };
613 
614     struct iovec xcb_parts[4];
615     xcb_void_cookie_t xcb_ret;
616     xcb_randr_set_screen_size_request_t xcb_out;
617 
618     xcb_out.window = window;
619     xcb_out.width = width;
620     xcb_out.height = height;
621     xcb_out.mm_width = mm_width;
622     xcb_out.mm_height = mm_height;
623 
624     xcb_parts[2].iov_base = (char *) &xcb_out;
625     xcb_parts[2].iov_len = sizeof(xcb_out);
626     xcb_parts[3].iov_base = 0;
627     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
628 
629     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
630     return xcb_ret;
631 }
632 
633 xcb_void_cookie_t
xcb_randr_set_screen_size(xcb_connection_t * c,xcb_window_t window,uint16_t width,uint16_t height,uint32_t mm_width,uint32_t mm_height)634 xcb_randr_set_screen_size (xcb_connection_t *c  /**< */,
635                            xcb_window_t      window  /**< */,
636                            uint16_t          width  /**< */,
637                            uint16_t          height  /**< */,
638                            uint32_t          mm_width  /**< */,
639                            uint32_t          mm_height  /**< */)
640 {
641     static const xcb_protocol_request_t xcb_req = {
642         /* count */ 2,
643         /* ext */ &xcb_randr_id,
644         /* opcode */ XCB_RANDR_SET_SCREEN_SIZE,
645         /* isvoid */ 1
646     };
647 
648     struct iovec xcb_parts[4];
649     xcb_void_cookie_t xcb_ret;
650     xcb_randr_set_screen_size_request_t xcb_out;
651 
652     xcb_out.window = window;
653     xcb_out.width = width;
654     xcb_out.height = height;
655     xcb_out.mm_width = mm_width;
656     xcb_out.mm_height = mm_height;
657 
658     xcb_parts[2].iov_base = (char *) &xcb_out;
659     xcb_parts[2].iov_len = sizeof(xcb_out);
660     xcb_parts[3].iov_base = 0;
661     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
662 
663     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
664     return xcb_ret;
665 }
666 
667 void
xcb_randr_mode_info_next(xcb_randr_mode_info_iterator_t * i)668 xcb_randr_mode_info_next (xcb_randr_mode_info_iterator_t *i  /**< */)
669 {
670     --i->rem;
671     ++i->data;
672     i->index += sizeof(xcb_randr_mode_info_t);
673 }
674 
675 xcb_generic_iterator_t
xcb_randr_mode_info_end(xcb_randr_mode_info_iterator_t i)676 xcb_randr_mode_info_end (xcb_randr_mode_info_iterator_t i  /**< */)
677 {
678     xcb_generic_iterator_t ret;
679     ret.data = i.data + i.rem;
680     ret.index = i.index + ((char *) ret.data - (char *) i.data);
681     ret.rem = 0;
682     return ret;
683 }
684 
685 int
xcb_randr_get_screen_resources_sizeof(const void * _buffer)686 xcb_randr_get_screen_resources_sizeof (const void  *_buffer  /**< */)
687 {
688     char *xcb_tmp = (char *)_buffer;
689     const xcb_randr_get_screen_resources_reply_t *_aux = (xcb_randr_get_screen_resources_reply_t *)_buffer;
690     unsigned int xcb_buffer_len = 0;
691     unsigned int xcb_block_len = 0;
692     unsigned int xcb_pad = 0;
693     unsigned int xcb_align_to = 0;
694 
695 
696     xcb_block_len += sizeof(xcb_randr_get_screen_resources_reply_t);
697     xcb_tmp += xcb_block_len;
698     xcb_buffer_len += xcb_block_len;
699     xcb_block_len = 0;
700     /* crtcs */
701     xcb_block_len += _aux->num_crtcs * sizeof(uint32_t);
702     xcb_tmp += xcb_block_len;
703     xcb_align_to = ALIGNOF(xcb_randr_crtc_t);
704     /* insert padding */
705     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
706     xcb_buffer_len += xcb_block_len + xcb_pad;
707     if (0 != xcb_pad) {
708         xcb_tmp += xcb_pad;
709         xcb_pad = 0;
710     }
711     xcb_block_len = 0;
712     /* outputs */
713     xcb_block_len += _aux->num_outputs * sizeof(uint32_t);
714     xcb_tmp += xcb_block_len;
715     xcb_align_to = ALIGNOF(xcb_randr_output_t);
716     /* insert padding */
717     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
718     xcb_buffer_len += xcb_block_len + xcb_pad;
719     if (0 != xcb_pad) {
720         xcb_tmp += xcb_pad;
721         xcb_pad = 0;
722     }
723     xcb_block_len = 0;
724     /* modes */
725     xcb_block_len += _aux->num_modes * sizeof(xcb_randr_mode_info_t);
726     xcb_tmp += xcb_block_len;
727     xcb_align_to = ALIGNOF(xcb_randr_mode_info_t);
728     /* insert padding */
729     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
730     xcb_buffer_len += xcb_block_len + xcb_pad;
731     if (0 != xcb_pad) {
732         xcb_tmp += xcb_pad;
733         xcb_pad = 0;
734     }
735     xcb_block_len = 0;
736     /* names */
737     xcb_block_len += _aux->names_len * sizeof(uint8_t);
738     xcb_tmp += xcb_block_len;
739     xcb_align_to = ALIGNOF(uint8_t);
740     /* insert padding */
741     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
742     xcb_buffer_len += xcb_block_len + xcb_pad;
743     if (0 != xcb_pad) {
744         xcb_tmp += xcb_pad;
745         xcb_pad = 0;
746     }
747     xcb_block_len = 0;
748 
749     return xcb_buffer_len;
750 }
751 
752 xcb_randr_get_screen_resources_cookie_t
xcb_randr_get_screen_resources(xcb_connection_t * c,xcb_window_t window)753 xcb_randr_get_screen_resources (xcb_connection_t *c  /**< */,
754                                 xcb_window_t      window  /**< */)
755 {
756     static const xcb_protocol_request_t xcb_req = {
757         /* count */ 2,
758         /* ext */ &xcb_randr_id,
759         /* opcode */ XCB_RANDR_GET_SCREEN_RESOURCES,
760         /* isvoid */ 0
761     };
762 
763     struct iovec xcb_parts[4];
764     xcb_randr_get_screen_resources_cookie_t xcb_ret;
765     xcb_randr_get_screen_resources_request_t xcb_out;
766 
767     xcb_out.window = window;
768 
769     xcb_parts[2].iov_base = (char *) &xcb_out;
770     xcb_parts[2].iov_len = sizeof(xcb_out);
771     xcb_parts[3].iov_base = 0;
772     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
773 
774     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
775     return xcb_ret;
776 }
777 
778 xcb_randr_get_screen_resources_cookie_t
xcb_randr_get_screen_resources_unchecked(xcb_connection_t * c,xcb_window_t window)779 xcb_randr_get_screen_resources_unchecked (xcb_connection_t *c  /**< */,
780                                           xcb_window_t      window  /**< */)
781 {
782     static const xcb_protocol_request_t xcb_req = {
783         /* count */ 2,
784         /* ext */ &xcb_randr_id,
785         /* opcode */ XCB_RANDR_GET_SCREEN_RESOURCES,
786         /* isvoid */ 0
787     };
788 
789     struct iovec xcb_parts[4];
790     xcb_randr_get_screen_resources_cookie_t xcb_ret;
791     xcb_randr_get_screen_resources_request_t xcb_out;
792 
793     xcb_out.window = window;
794 
795     xcb_parts[2].iov_base = (char *) &xcb_out;
796     xcb_parts[2].iov_len = sizeof(xcb_out);
797     xcb_parts[3].iov_base = 0;
798     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
799 
800     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
801     return xcb_ret;
802 }
803 
804 xcb_randr_crtc_t *
xcb_randr_get_screen_resources_crtcs(const xcb_randr_get_screen_resources_reply_t * R)805 xcb_randr_get_screen_resources_crtcs (const xcb_randr_get_screen_resources_reply_t *R  /**< */)
806 {
807     return (xcb_randr_crtc_t *) (R + 1);
808 }
809 
810 int
xcb_randr_get_screen_resources_crtcs_length(const xcb_randr_get_screen_resources_reply_t * R)811 xcb_randr_get_screen_resources_crtcs_length (const xcb_randr_get_screen_resources_reply_t *R  /**< */)
812 {
813     return R->num_crtcs;
814 }
815 
816 xcb_generic_iterator_t
xcb_randr_get_screen_resources_crtcs_end(const xcb_randr_get_screen_resources_reply_t * R)817 xcb_randr_get_screen_resources_crtcs_end (const xcb_randr_get_screen_resources_reply_t *R  /**< */)
818 {
819     xcb_generic_iterator_t i;
820     i.data = ((xcb_randr_crtc_t *) (R + 1)) + (R->num_crtcs);
821     i.rem = 0;
822     i.index = (char *) i.data - (char *) R;
823     return i;
824 }
825 
826 xcb_randr_output_t *
xcb_randr_get_screen_resources_outputs(const xcb_randr_get_screen_resources_reply_t * R)827 xcb_randr_get_screen_resources_outputs (const xcb_randr_get_screen_resources_reply_t *R  /**< */)
828 {
829     xcb_generic_iterator_t prev = xcb_randr_get_screen_resources_crtcs_end(R);
830     return (xcb_randr_output_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_randr_output_t, prev.index) + 0);
831 }
832 
833 int
xcb_randr_get_screen_resources_outputs_length(const xcb_randr_get_screen_resources_reply_t * R)834 xcb_randr_get_screen_resources_outputs_length (const xcb_randr_get_screen_resources_reply_t *R  /**< */)
835 {
836     return R->num_outputs;
837 }
838 
839 xcb_generic_iterator_t
xcb_randr_get_screen_resources_outputs_end(const xcb_randr_get_screen_resources_reply_t * R)840 xcb_randr_get_screen_resources_outputs_end (const xcb_randr_get_screen_resources_reply_t *R  /**< */)
841 {
842     xcb_generic_iterator_t i;
843     xcb_generic_iterator_t child = xcb_randr_get_screen_resources_crtcs_end(R);
844     i.data = ((xcb_randr_output_t *) child.data) + (R->num_outputs);
845     i.rem = 0;
846     i.index = (char *) i.data - (char *) R;
847     return i;
848 }
849 
850 xcb_randr_mode_info_t *
xcb_randr_get_screen_resources_modes(const xcb_randr_get_screen_resources_reply_t * R)851 xcb_randr_get_screen_resources_modes (const xcb_randr_get_screen_resources_reply_t *R  /**< */)
852 {
853     xcb_generic_iterator_t prev = xcb_randr_get_screen_resources_outputs_end(R);
854     return (xcb_randr_mode_info_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_randr_mode_info_t, prev.index) + 0);
855 }
856 
857 int
xcb_randr_get_screen_resources_modes_length(const xcb_randr_get_screen_resources_reply_t * R)858 xcb_randr_get_screen_resources_modes_length (const xcb_randr_get_screen_resources_reply_t *R  /**< */)
859 {
860     return R->num_modes;
861 }
862 
863 xcb_randr_mode_info_iterator_t
xcb_randr_get_screen_resources_modes_iterator(const xcb_randr_get_screen_resources_reply_t * R)864 xcb_randr_get_screen_resources_modes_iterator (const xcb_randr_get_screen_resources_reply_t *R  /**< */)
865 {
866     xcb_randr_mode_info_iterator_t i;
867     xcb_generic_iterator_t prev = xcb_randr_get_screen_resources_outputs_end(R);
868     i.data = (xcb_randr_mode_info_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_randr_mode_info_t, prev.index));
869     i.rem = R->num_modes;
870     i.index = (char *) i.data - (char *) R;
871     return i;
872 }
873 
874 uint8_t *
xcb_randr_get_screen_resources_names(const xcb_randr_get_screen_resources_reply_t * R)875 xcb_randr_get_screen_resources_names (const xcb_randr_get_screen_resources_reply_t *R  /**< */)
876 {
877     xcb_generic_iterator_t prev = xcb_randr_mode_info_end(xcb_randr_get_screen_resources_modes_iterator(R));
878     return (uint8_t *) ((char *) prev.data + XCB_TYPE_PAD(uint8_t, prev.index) + 0);
879 }
880 
881 int
xcb_randr_get_screen_resources_names_length(const xcb_randr_get_screen_resources_reply_t * R)882 xcb_randr_get_screen_resources_names_length (const xcb_randr_get_screen_resources_reply_t *R  /**< */)
883 {
884     return R->names_len;
885 }
886 
887 xcb_generic_iterator_t
xcb_randr_get_screen_resources_names_end(const xcb_randr_get_screen_resources_reply_t * R)888 xcb_randr_get_screen_resources_names_end (const xcb_randr_get_screen_resources_reply_t *R  /**< */)
889 {
890     xcb_generic_iterator_t i;
891     xcb_generic_iterator_t child = xcb_randr_mode_info_end(xcb_randr_get_screen_resources_modes_iterator(R));
892     i.data = ((uint8_t *) child.data) + (R->names_len);
893     i.rem = 0;
894     i.index = (char *) i.data - (char *) R;
895     return i;
896 }
897 
898 xcb_randr_get_screen_resources_reply_t *
xcb_randr_get_screen_resources_reply(xcb_connection_t * c,xcb_randr_get_screen_resources_cookie_t cookie,xcb_generic_error_t ** e)899 xcb_randr_get_screen_resources_reply (xcb_connection_t                         *c  /**< */,
900                                       xcb_randr_get_screen_resources_cookie_t   cookie  /**< */,
901                                       xcb_generic_error_t                     **e  /**< */)
902 {
903     return (xcb_randr_get_screen_resources_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
904 }
905 
906 int
xcb_randr_get_output_info_sizeof(const void * _buffer)907 xcb_randr_get_output_info_sizeof (const void  *_buffer  /**< */)
908 {
909     char *xcb_tmp = (char *)_buffer;
910     const xcb_randr_get_output_info_reply_t *_aux = (xcb_randr_get_output_info_reply_t *)_buffer;
911     unsigned int xcb_buffer_len = 0;
912     unsigned int xcb_block_len = 0;
913     unsigned int xcb_pad = 0;
914     unsigned int xcb_align_to = 0;
915 
916 
917     xcb_block_len += sizeof(xcb_randr_get_output_info_reply_t);
918     xcb_tmp += xcb_block_len;
919     xcb_buffer_len += xcb_block_len;
920     xcb_block_len = 0;
921     /* crtcs */
922     xcb_block_len += _aux->num_crtcs * sizeof(xcb_randr_output_t);
923     xcb_tmp += xcb_block_len;
924     xcb_align_to = ALIGNOF(xcb_randr_crtc_t);
925     /* insert padding */
926     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
927     xcb_buffer_len += xcb_block_len + xcb_pad;
928     if (0 != xcb_pad) {
929         xcb_tmp += xcb_pad;
930         xcb_pad = 0;
931     }
932     xcb_block_len = 0;
933     /* modes */
934     xcb_block_len += _aux->num_modes * sizeof(xcb_randr_output_t);
935     xcb_tmp += xcb_block_len;
936     xcb_align_to = ALIGNOF(xcb_randr_mode_t);
937     /* insert padding */
938     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
939     xcb_buffer_len += xcb_block_len + xcb_pad;
940     if (0 != xcb_pad) {
941         xcb_tmp += xcb_pad;
942         xcb_pad = 0;
943     }
944     xcb_block_len = 0;
945     /* clones */
946     xcb_block_len += _aux->num_clones * sizeof(xcb_randr_output_t);
947     xcb_tmp += xcb_block_len;
948     xcb_align_to = ALIGNOF(xcb_randr_output_t);
949     /* insert padding */
950     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
951     xcb_buffer_len += xcb_block_len + xcb_pad;
952     if (0 != xcb_pad) {
953         xcb_tmp += xcb_pad;
954         xcb_pad = 0;
955     }
956     xcb_block_len = 0;
957     /* name */
958     xcb_block_len += _aux->name_len * sizeof(uint8_t);
959     xcb_tmp += xcb_block_len;
960     xcb_align_to = ALIGNOF(uint8_t);
961     /* insert padding */
962     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
963     xcb_buffer_len += xcb_block_len + xcb_pad;
964     if (0 != xcb_pad) {
965         xcb_tmp += xcb_pad;
966         xcb_pad = 0;
967     }
968     xcb_block_len = 0;
969 
970     return xcb_buffer_len;
971 }
972 
973 xcb_randr_get_output_info_cookie_t
xcb_randr_get_output_info(xcb_connection_t * c,xcb_randr_output_t output,xcb_timestamp_t config_timestamp)974 xcb_randr_get_output_info (xcb_connection_t   *c  /**< */,
975                            xcb_randr_output_t  output  /**< */,
976                            xcb_timestamp_t     config_timestamp  /**< */)
977 {
978     static const xcb_protocol_request_t xcb_req = {
979         /* count */ 2,
980         /* ext */ &xcb_randr_id,
981         /* opcode */ XCB_RANDR_GET_OUTPUT_INFO,
982         /* isvoid */ 0
983     };
984 
985     struct iovec xcb_parts[4];
986     xcb_randr_get_output_info_cookie_t xcb_ret;
987     xcb_randr_get_output_info_request_t xcb_out;
988 
989     xcb_out.output = output;
990     xcb_out.config_timestamp = config_timestamp;
991 
992     xcb_parts[2].iov_base = (char *) &xcb_out;
993     xcb_parts[2].iov_len = sizeof(xcb_out);
994     xcb_parts[3].iov_base = 0;
995     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
996 
997     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
998     return xcb_ret;
999 }
1000 
1001 xcb_randr_get_output_info_cookie_t
xcb_randr_get_output_info_unchecked(xcb_connection_t * c,xcb_randr_output_t output,xcb_timestamp_t config_timestamp)1002 xcb_randr_get_output_info_unchecked (xcb_connection_t   *c  /**< */,
1003                                      xcb_randr_output_t  output  /**< */,
1004                                      xcb_timestamp_t     config_timestamp  /**< */)
1005 {
1006     static const xcb_protocol_request_t xcb_req = {
1007         /* count */ 2,
1008         /* ext */ &xcb_randr_id,
1009         /* opcode */ XCB_RANDR_GET_OUTPUT_INFO,
1010         /* isvoid */ 0
1011     };
1012 
1013     struct iovec xcb_parts[4];
1014     xcb_randr_get_output_info_cookie_t xcb_ret;
1015     xcb_randr_get_output_info_request_t xcb_out;
1016 
1017     xcb_out.output = output;
1018     xcb_out.config_timestamp = config_timestamp;
1019 
1020     xcb_parts[2].iov_base = (char *) &xcb_out;
1021     xcb_parts[2].iov_len = sizeof(xcb_out);
1022     xcb_parts[3].iov_base = 0;
1023     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1024 
1025     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1026     return xcb_ret;
1027 }
1028 
1029 xcb_randr_crtc_t *
xcb_randr_get_output_info_crtcs(const xcb_randr_get_output_info_reply_t * R)1030 xcb_randr_get_output_info_crtcs (const xcb_randr_get_output_info_reply_t *R  /**< */)
1031 {
1032     return (xcb_randr_crtc_t *) (R + 1);
1033 }
1034 
1035 int
xcb_randr_get_output_info_crtcs_length(const xcb_randr_get_output_info_reply_t * R)1036 xcb_randr_get_output_info_crtcs_length (const xcb_randr_get_output_info_reply_t *R  /**< */)
1037 {
1038     return R->num_crtcs;
1039 }
1040 
1041 xcb_generic_iterator_t
xcb_randr_get_output_info_crtcs_end(const xcb_randr_get_output_info_reply_t * R)1042 xcb_randr_get_output_info_crtcs_end (const xcb_randr_get_output_info_reply_t *R  /**< */)
1043 {
1044     xcb_generic_iterator_t i;
1045     i.data = ((xcb_randr_crtc_t *) (R + 1)) + (R->num_crtcs);
1046     i.rem = 0;
1047     i.index = (char *) i.data - (char *) R;
1048     return i;
1049 }
1050 
1051 xcb_randr_mode_t *
xcb_randr_get_output_info_modes(const xcb_randr_get_output_info_reply_t * R)1052 xcb_randr_get_output_info_modes (const xcb_randr_get_output_info_reply_t *R  /**< */)
1053 {
1054     xcb_generic_iterator_t prev = xcb_randr_get_output_info_crtcs_end(R);
1055     return (xcb_randr_mode_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_randr_mode_t, prev.index) + 0);
1056 }
1057 
1058 int
xcb_randr_get_output_info_modes_length(const xcb_randr_get_output_info_reply_t * R)1059 xcb_randr_get_output_info_modes_length (const xcb_randr_get_output_info_reply_t *R  /**< */)
1060 {
1061     return R->num_modes;
1062 }
1063 
1064 xcb_generic_iterator_t
xcb_randr_get_output_info_modes_end(const xcb_randr_get_output_info_reply_t * R)1065 xcb_randr_get_output_info_modes_end (const xcb_randr_get_output_info_reply_t *R  /**< */)
1066 {
1067     xcb_generic_iterator_t i;
1068     xcb_generic_iterator_t child = xcb_randr_get_output_info_crtcs_end(R);
1069     i.data = ((xcb_randr_mode_t *) child.data) + (R->num_modes);
1070     i.rem = 0;
1071     i.index = (char *) i.data - (char *) R;
1072     return i;
1073 }
1074 
1075 xcb_randr_output_t *
xcb_randr_get_output_info_clones(const xcb_randr_get_output_info_reply_t * R)1076 xcb_randr_get_output_info_clones (const xcb_randr_get_output_info_reply_t *R  /**< */)
1077 {
1078     xcb_generic_iterator_t prev = xcb_randr_get_output_info_modes_end(R);
1079     return (xcb_randr_output_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_randr_output_t, prev.index) + 0);
1080 }
1081 
1082 int
xcb_randr_get_output_info_clones_length(const xcb_randr_get_output_info_reply_t * R)1083 xcb_randr_get_output_info_clones_length (const xcb_randr_get_output_info_reply_t *R  /**< */)
1084 {
1085     return R->num_clones;
1086 }
1087 
1088 xcb_generic_iterator_t
xcb_randr_get_output_info_clones_end(const xcb_randr_get_output_info_reply_t * R)1089 xcb_randr_get_output_info_clones_end (const xcb_randr_get_output_info_reply_t *R  /**< */)
1090 {
1091     xcb_generic_iterator_t i;
1092     xcb_generic_iterator_t child = xcb_randr_get_output_info_modes_end(R);
1093     i.data = ((xcb_randr_output_t *) child.data) + (R->num_clones);
1094     i.rem = 0;
1095     i.index = (char *) i.data - (char *) R;
1096     return i;
1097 }
1098 
1099 uint8_t *
xcb_randr_get_output_info_name(const xcb_randr_get_output_info_reply_t * R)1100 xcb_randr_get_output_info_name (const xcb_randr_get_output_info_reply_t *R  /**< */)
1101 {
1102     xcb_generic_iterator_t prev = xcb_randr_get_output_info_clones_end(R);
1103     return (uint8_t *) ((char *) prev.data + XCB_TYPE_PAD(uint8_t, prev.index) + 0);
1104 }
1105 
1106 int
xcb_randr_get_output_info_name_length(const xcb_randr_get_output_info_reply_t * R)1107 xcb_randr_get_output_info_name_length (const xcb_randr_get_output_info_reply_t *R  /**< */)
1108 {
1109     return R->name_len;
1110 }
1111 
1112 xcb_generic_iterator_t
xcb_randr_get_output_info_name_end(const xcb_randr_get_output_info_reply_t * R)1113 xcb_randr_get_output_info_name_end (const xcb_randr_get_output_info_reply_t *R  /**< */)
1114 {
1115     xcb_generic_iterator_t i;
1116     xcb_generic_iterator_t child = xcb_randr_get_output_info_clones_end(R);
1117     i.data = ((uint8_t *) child.data) + (R->name_len);
1118     i.rem = 0;
1119     i.index = (char *) i.data - (char *) R;
1120     return i;
1121 }
1122 
1123 xcb_randr_get_output_info_reply_t *
xcb_randr_get_output_info_reply(xcb_connection_t * c,xcb_randr_get_output_info_cookie_t cookie,xcb_generic_error_t ** e)1124 xcb_randr_get_output_info_reply (xcb_connection_t                    *c  /**< */,
1125                                  xcb_randr_get_output_info_cookie_t   cookie  /**< */,
1126                                  xcb_generic_error_t                **e  /**< */)
1127 {
1128     return (xcb_randr_get_output_info_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1129 }
1130 
1131 int
xcb_randr_list_output_properties_sizeof(const void * _buffer)1132 xcb_randr_list_output_properties_sizeof (const void  *_buffer  /**< */)
1133 {
1134     char *xcb_tmp = (char *)_buffer;
1135     const xcb_randr_list_output_properties_reply_t *_aux = (xcb_randr_list_output_properties_reply_t *)_buffer;
1136     unsigned int xcb_buffer_len = 0;
1137     unsigned int xcb_block_len = 0;
1138     unsigned int xcb_pad = 0;
1139     unsigned int xcb_align_to = 0;
1140 
1141 
1142     xcb_block_len += sizeof(xcb_randr_list_output_properties_reply_t);
1143     xcb_tmp += xcb_block_len;
1144     xcb_buffer_len += xcb_block_len;
1145     xcb_block_len = 0;
1146     /* atoms */
1147     xcb_block_len += _aux->num_atoms * sizeof(xcb_atom_t);
1148     xcb_tmp += xcb_block_len;
1149     xcb_align_to = ALIGNOF(xcb_atom_t);
1150     /* insert padding */
1151     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1152     xcb_buffer_len += xcb_block_len + xcb_pad;
1153     if (0 != xcb_pad) {
1154         xcb_tmp += xcb_pad;
1155         xcb_pad = 0;
1156     }
1157     xcb_block_len = 0;
1158 
1159     return xcb_buffer_len;
1160 }
1161 
1162 xcb_randr_list_output_properties_cookie_t
xcb_randr_list_output_properties(xcb_connection_t * c,xcb_randr_output_t output)1163 xcb_randr_list_output_properties (xcb_connection_t   *c  /**< */,
1164                                   xcb_randr_output_t  output  /**< */)
1165 {
1166     static const xcb_protocol_request_t xcb_req = {
1167         /* count */ 2,
1168         /* ext */ &xcb_randr_id,
1169         /* opcode */ XCB_RANDR_LIST_OUTPUT_PROPERTIES,
1170         /* isvoid */ 0
1171     };
1172 
1173     struct iovec xcb_parts[4];
1174     xcb_randr_list_output_properties_cookie_t xcb_ret;
1175     xcb_randr_list_output_properties_request_t xcb_out;
1176 
1177     xcb_out.output = output;
1178 
1179     xcb_parts[2].iov_base = (char *) &xcb_out;
1180     xcb_parts[2].iov_len = sizeof(xcb_out);
1181     xcb_parts[3].iov_base = 0;
1182     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1183 
1184     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1185     return xcb_ret;
1186 }
1187 
1188 xcb_randr_list_output_properties_cookie_t
xcb_randr_list_output_properties_unchecked(xcb_connection_t * c,xcb_randr_output_t output)1189 xcb_randr_list_output_properties_unchecked (xcb_connection_t   *c  /**< */,
1190                                             xcb_randr_output_t  output  /**< */)
1191 {
1192     static const xcb_protocol_request_t xcb_req = {
1193         /* count */ 2,
1194         /* ext */ &xcb_randr_id,
1195         /* opcode */ XCB_RANDR_LIST_OUTPUT_PROPERTIES,
1196         /* isvoid */ 0
1197     };
1198 
1199     struct iovec xcb_parts[4];
1200     xcb_randr_list_output_properties_cookie_t xcb_ret;
1201     xcb_randr_list_output_properties_request_t xcb_out;
1202 
1203     xcb_out.output = output;
1204 
1205     xcb_parts[2].iov_base = (char *) &xcb_out;
1206     xcb_parts[2].iov_len = sizeof(xcb_out);
1207     xcb_parts[3].iov_base = 0;
1208     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1209 
1210     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1211     return xcb_ret;
1212 }
1213 
1214 xcb_atom_t *
xcb_randr_list_output_properties_atoms(const xcb_randr_list_output_properties_reply_t * R)1215 xcb_randr_list_output_properties_atoms (const xcb_randr_list_output_properties_reply_t *R  /**< */)
1216 {
1217     return (xcb_atom_t *) (R + 1);
1218 }
1219 
1220 int
xcb_randr_list_output_properties_atoms_length(const xcb_randr_list_output_properties_reply_t * R)1221 xcb_randr_list_output_properties_atoms_length (const xcb_randr_list_output_properties_reply_t *R  /**< */)
1222 {
1223     return R->num_atoms;
1224 }
1225 
1226 xcb_generic_iterator_t
xcb_randr_list_output_properties_atoms_end(const xcb_randr_list_output_properties_reply_t * R)1227 xcb_randr_list_output_properties_atoms_end (const xcb_randr_list_output_properties_reply_t *R  /**< */)
1228 {
1229     xcb_generic_iterator_t i;
1230     i.data = ((xcb_atom_t *) (R + 1)) + (R->num_atoms);
1231     i.rem = 0;
1232     i.index = (char *) i.data - (char *) R;
1233     return i;
1234 }
1235 
1236 xcb_randr_list_output_properties_reply_t *
xcb_randr_list_output_properties_reply(xcb_connection_t * c,xcb_randr_list_output_properties_cookie_t cookie,xcb_generic_error_t ** e)1237 xcb_randr_list_output_properties_reply (xcb_connection_t                           *c  /**< */,
1238                                         xcb_randr_list_output_properties_cookie_t   cookie  /**< */,
1239                                         xcb_generic_error_t                       **e  /**< */)
1240 {
1241     return (xcb_randr_list_output_properties_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1242 }
1243 
1244 int
xcb_randr_query_output_property_sizeof(const void * _buffer)1245 xcb_randr_query_output_property_sizeof (const void  *_buffer  /**< */)
1246 {
1247     char *xcb_tmp = (char *)_buffer;
1248     const xcb_randr_query_output_property_reply_t *_aux = (xcb_randr_query_output_property_reply_t *)_buffer;
1249     unsigned int xcb_buffer_len = 0;
1250     unsigned int xcb_block_len = 0;
1251     unsigned int xcb_pad = 0;
1252     unsigned int xcb_align_to = 0;
1253 
1254 
1255     xcb_block_len += sizeof(xcb_randr_query_output_property_reply_t);
1256     xcb_tmp += xcb_block_len;
1257     xcb_buffer_len += xcb_block_len;
1258     xcb_block_len = 0;
1259     /* validValues */
1260     xcb_block_len += _aux->length * sizeof(int32_t);
1261     xcb_tmp += xcb_block_len;
1262     xcb_align_to = ALIGNOF(int32_t);
1263     /* insert padding */
1264     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1265     xcb_buffer_len += xcb_block_len + xcb_pad;
1266     if (0 != xcb_pad) {
1267         xcb_tmp += xcb_pad;
1268         xcb_pad = 0;
1269     }
1270     xcb_block_len = 0;
1271 
1272     return xcb_buffer_len;
1273 }
1274 
1275 xcb_randr_query_output_property_cookie_t
xcb_randr_query_output_property(xcb_connection_t * c,xcb_randr_output_t output,xcb_atom_t property)1276 xcb_randr_query_output_property (xcb_connection_t   *c  /**< */,
1277                                  xcb_randr_output_t  output  /**< */,
1278                                  xcb_atom_t          property  /**< */)
1279 {
1280     static const xcb_protocol_request_t xcb_req = {
1281         /* count */ 2,
1282         /* ext */ &xcb_randr_id,
1283         /* opcode */ XCB_RANDR_QUERY_OUTPUT_PROPERTY,
1284         /* isvoid */ 0
1285     };
1286 
1287     struct iovec xcb_parts[4];
1288     xcb_randr_query_output_property_cookie_t xcb_ret;
1289     xcb_randr_query_output_property_request_t xcb_out;
1290 
1291     xcb_out.output = output;
1292     xcb_out.property = property;
1293 
1294     xcb_parts[2].iov_base = (char *) &xcb_out;
1295     xcb_parts[2].iov_len = sizeof(xcb_out);
1296     xcb_parts[3].iov_base = 0;
1297     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1298 
1299     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1300     return xcb_ret;
1301 }
1302 
1303 xcb_randr_query_output_property_cookie_t
xcb_randr_query_output_property_unchecked(xcb_connection_t * c,xcb_randr_output_t output,xcb_atom_t property)1304 xcb_randr_query_output_property_unchecked (xcb_connection_t   *c  /**< */,
1305                                            xcb_randr_output_t  output  /**< */,
1306                                            xcb_atom_t          property  /**< */)
1307 {
1308     static const xcb_protocol_request_t xcb_req = {
1309         /* count */ 2,
1310         /* ext */ &xcb_randr_id,
1311         /* opcode */ XCB_RANDR_QUERY_OUTPUT_PROPERTY,
1312         /* isvoid */ 0
1313     };
1314 
1315     struct iovec xcb_parts[4];
1316     xcb_randr_query_output_property_cookie_t xcb_ret;
1317     xcb_randr_query_output_property_request_t xcb_out;
1318 
1319     xcb_out.output = output;
1320     xcb_out.property = property;
1321 
1322     xcb_parts[2].iov_base = (char *) &xcb_out;
1323     xcb_parts[2].iov_len = sizeof(xcb_out);
1324     xcb_parts[3].iov_base = 0;
1325     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1326 
1327     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1328     return xcb_ret;
1329 }
1330 
1331 int32_t *
xcb_randr_query_output_property_valid_values(const xcb_randr_query_output_property_reply_t * R)1332 xcb_randr_query_output_property_valid_values (const xcb_randr_query_output_property_reply_t *R  /**< */)
1333 {
1334     return (int32_t *) (R + 1);
1335 }
1336 
1337 int
xcb_randr_query_output_property_valid_values_length(const xcb_randr_query_output_property_reply_t * R)1338 xcb_randr_query_output_property_valid_values_length (const xcb_randr_query_output_property_reply_t *R  /**< */)
1339 {
1340     return R->length;
1341 }
1342 
1343 xcb_generic_iterator_t
xcb_randr_query_output_property_valid_values_end(const xcb_randr_query_output_property_reply_t * R)1344 xcb_randr_query_output_property_valid_values_end (const xcb_randr_query_output_property_reply_t *R  /**< */)
1345 {
1346     xcb_generic_iterator_t i;
1347     i.data = ((int32_t *) (R + 1)) + (R->length);
1348     i.rem = 0;
1349     i.index = (char *) i.data - (char *) R;
1350     return i;
1351 }
1352 
1353 xcb_randr_query_output_property_reply_t *
xcb_randr_query_output_property_reply(xcb_connection_t * c,xcb_randr_query_output_property_cookie_t cookie,xcb_generic_error_t ** e)1354 xcb_randr_query_output_property_reply (xcb_connection_t                          *c  /**< */,
1355                                        xcb_randr_query_output_property_cookie_t   cookie  /**< */,
1356                                        xcb_generic_error_t                      **e  /**< */)
1357 {
1358     return (xcb_randr_query_output_property_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1359 }
1360 
1361 int
xcb_randr_configure_output_property_sizeof(const void * _buffer,uint32_t values_len)1362 xcb_randr_configure_output_property_sizeof (const void  *_buffer  /**< */,
1363                                             uint32_t     values_len  /**< */)
1364 {
1365     char *xcb_tmp = (char *)_buffer;
1366     unsigned int xcb_buffer_len = 0;
1367     unsigned int xcb_block_len = 0;
1368     unsigned int xcb_pad = 0;
1369     unsigned int xcb_align_to = 0;
1370 
1371 
1372     xcb_block_len += sizeof(xcb_randr_configure_output_property_request_t);
1373     xcb_tmp += xcb_block_len;
1374     xcb_buffer_len += xcb_block_len;
1375     xcb_block_len = 0;
1376     /* values */
1377     xcb_block_len += values_len * sizeof(int32_t);
1378     xcb_tmp += xcb_block_len;
1379     xcb_align_to = ALIGNOF(int32_t);
1380     /* insert padding */
1381     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1382     xcb_buffer_len += xcb_block_len + xcb_pad;
1383     if (0 != xcb_pad) {
1384         xcb_tmp += xcb_pad;
1385         xcb_pad = 0;
1386     }
1387     xcb_block_len = 0;
1388 
1389     return xcb_buffer_len;
1390 }
1391 
1392 xcb_void_cookie_t
xcb_randr_configure_output_property_checked(xcb_connection_t * c,xcb_randr_output_t output,xcb_atom_t property,uint8_t pending,uint8_t range,uint32_t values_len,const int32_t * values)1393 xcb_randr_configure_output_property_checked (xcb_connection_t   *c  /**< */,
1394                                              xcb_randr_output_t  output  /**< */,
1395                                              xcb_atom_t          property  /**< */,
1396                                              uint8_t             pending  /**< */,
1397                                              uint8_t             range  /**< */,
1398                                              uint32_t            values_len  /**< */,
1399                                              const int32_t      *values  /**< */)
1400 {
1401     static const xcb_protocol_request_t xcb_req = {
1402         /* count */ 4,
1403         /* ext */ &xcb_randr_id,
1404         /* opcode */ XCB_RANDR_CONFIGURE_OUTPUT_PROPERTY,
1405         /* isvoid */ 1
1406     };
1407 
1408     struct iovec xcb_parts[6];
1409     xcb_void_cookie_t xcb_ret;
1410     xcb_randr_configure_output_property_request_t xcb_out;
1411 
1412     xcb_out.output = output;
1413     xcb_out.property = property;
1414     xcb_out.pending = pending;
1415     xcb_out.range = range;
1416     memset(xcb_out.pad0, 0, 2);
1417 
1418     xcb_parts[2].iov_base = (char *) &xcb_out;
1419     xcb_parts[2].iov_len = sizeof(xcb_out);
1420     xcb_parts[3].iov_base = 0;
1421     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1422     /* int32_t values */
1423     xcb_parts[4].iov_base = (char *) values;
1424     xcb_parts[4].iov_len = values_len * sizeof(int32_t);
1425     xcb_parts[5].iov_base = 0;
1426     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1427 
1428     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1429     return xcb_ret;
1430 }
1431 
1432 xcb_void_cookie_t
xcb_randr_configure_output_property(xcb_connection_t * c,xcb_randr_output_t output,xcb_atom_t property,uint8_t pending,uint8_t range,uint32_t values_len,const int32_t * values)1433 xcb_randr_configure_output_property (xcb_connection_t   *c  /**< */,
1434                                      xcb_randr_output_t  output  /**< */,
1435                                      xcb_atom_t          property  /**< */,
1436                                      uint8_t             pending  /**< */,
1437                                      uint8_t             range  /**< */,
1438                                      uint32_t            values_len  /**< */,
1439                                      const int32_t      *values  /**< */)
1440 {
1441     static const xcb_protocol_request_t xcb_req = {
1442         /* count */ 4,
1443         /* ext */ &xcb_randr_id,
1444         /* opcode */ XCB_RANDR_CONFIGURE_OUTPUT_PROPERTY,
1445         /* isvoid */ 1
1446     };
1447 
1448     struct iovec xcb_parts[6];
1449     xcb_void_cookie_t xcb_ret;
1450     xcb_randr_configure_output_property_request_t xcb_out;
1451 
1452     xcb_out.output = output;
1453     xcb_out.property = property;
1454     xcb_out.pending = pending;
1455     xcb_out.range = range;
1456     memset(xcb_out.pad0, 0, 2);
1457 
1458     xcb_parts[2].iov_base = (char *) &xcb_out;
1459     xcb_parts[2].iov_len = sizeof(xcb_out);
1460     xcb_parts[3].iov_base = 0;
1461     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1462     /* int32_t values */
1463     xcb_parts[4].iov_base = (char *) values;
1464     xcb_parts[4].iov_len = values_len * sizeof(int32_t);
1465     xcb_parts[5].iov_base = 0;
1466     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1467 
1468     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1469     return xcb_ret;
1470 }
1471 
1472 int
xcb_randr_change_output_property_sizeof(const void * _buffer)1473 xcb_randr_change_output_property_sizeof (const void  *_buffer  /**< */)
1474 {
1475     char *xcb_tmp = (char *)_buffer;
1476     const xcb_randr_change_output_property_request_t *_aux = (xcb_randr_change_output_property_request_t *)_buffer;
1477     unsigned int xcb_buffer_len = 0;
1478     unsigned int xcb_block_len = 0;
1479     unsigned int xcb_pad = 0;
1480     unsigned int xcb_align_to = 0;
1481 
1482 
1483     xcb_block_len += sizeof(xcb_randr_change_output_property_request_t);
1484     xcb_tmp += xcb_block_len;
1485     xcb_buffer_len += xcb_block_len;
1486     xcb_block_len = 0;
1487     /* data */
1488     xcb_block_len += ((_aux->num_units * _aux->format) / 8) * sizeof(char);
1489     xcb_tmp += xcb_block_len;
1490     xcb_align_to = ALIGNOF(char);
1491     /* insert padding */
1492     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1493     xcb_buffer_len += xcb_block_len + xcb_pad;
1494     if (0 != xcb_pad) {
1495         xcb_tmp += xcb_pad;
1496         xcb_pad = 0;
1497     }
1498     xcb_block_len = 0;
1499 
1500     return xcb_buffer_len;
1501 }
1502 
1503 xcb_void_cookie_t
xcb_randr_change_output_property_checked(xcb_connection_t * c,xcb_randr_output_t output,xcb_atom_t property,xcb_atom_t type,uint8_t format,uint8_t mode,uint32_t num_units,const void * data)1504 xcb_randr_change_output_property_checked (xcb_connection_t   *c  /**< */,
1505                                           xcb_randr_output_t  output  /**< */,
1506                                           xcb_atom_t          property  /**< */,
1507                                           xcb_atom_t          type  /**< */,
1508                                           uint8_t             format  /**< */,
1509                                           uint8_t             mode  /**< */,
1510                                           uint32_t            num_units  /**< */,
1511                                           const void         *data  /**< */)
1512 {
1513     static const xcb_protocol_request_t xcb_req = {
1514         /* count */ 4,
1515         /* ext */ &xcb_randr_id,
1516         /* opcode */ XCB_RANDR_CHANGE_OUTPUT_PROPERTY,
1517         /* isvoid */ 1
1518     };
1519 
1520     struct iovec xcb_parts[6];
1521     xcb_void_cookie_t xcb_ret;
1522     xcb_randr_change_output_property_request_t xcb_out;
1523 
1524     xcb_out.output = output;
1525     xcb_out.property = property;
1526     xcb_out.type = type;
1527     xcb_out.format = format;
1528     xcb_out.mode = mode;
1529     memset(xcb_out.pad0, 0, 2);
1530     xcb_out.num_units = num_units;
1531 
1532     xcb_parts[2].iov_base = (char *) &xcb_out;
1533     xcb_parts[2].iov_len = sizeof(xcb_out);
1534     xcb_parts[3].iov_base = 0;
1535     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1536     /* void data */
1537     xcb_parts[4].iov_base = (char *) data;
1538     xcb_parts[4].iov_len = ((num_units * format) / 8) * sizeof(char);
1539     xcb_parts[5].iov_base = 0;
1540     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1541 
1542     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1543     return xcb_ret;
1544 }
1545 
1546 xcb_void_cookie_t
xcb_randr_change_output_property(xcb_connection_t * c,xcb_randr_output_t output,xcb_atom_t property,xcb_atom_t type,uint8_t format,uint8_t mode,uint32_t num_units,const void * data)1547 xcb_randr_change_output_property (xcb_connection_t   *c  /**< */,
1548                                   xcb_randr_output_t  output  /**< */,
1549                                   xcb_atom_t          property  /**< */,
1550                                   xcb_atom_t          type  /**< */,
1551                                   uint8_t             format  /**< */,
1552                                   uint8_t             mode  /**< */,
1553                                   uint32_t            num_units  /**< */,
1554                                   const void         *data  /**< */)
1555 {
1556     static const xcb_protocol_request_t xcb_req = {
1557         /* count */ 4,
1558         /* ext */ &xcb_randr_id,
1559         /* opcode */ XCB_RANDR_CHANGE_OUTPUT_PROPERTY,
1560         /* isvoid */ 1
1561     };
1562 
1563     struct iovec xcb_parts[6];
1564     xcb_void_cookie_t xcb_ret;
1565     xcb_randr_change_output_property_request_t xcb_out;
1566 
1567     xcb_out.output = output;
1568     xcb_out.property = property;
1569     xcb_out.type = type;
1570     xcb_out.format = format;
1571     xcb_out.mode = mode;
1572     memset(xcb_out.pad0, 0, 2);
1573     xcb_out.num_units = num_units;
1574 
1575     xcb_parts[2].iov_base = (char *) &xcb_out;
1576     xcb_parts[2].iov_len = sizeof(xcb_out);
1577     xcb_parts[3].iov_base = 0;
1578     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1579     /* void data */
1580     xcb_parts[4].iov_base = (char *) data;
1581     xcb_parts[4].iov_len = ((num_units * format) / 8) * sizeof(char);
1582     xcb_parts[5].iov_base = 0;
1583     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1584 
1585     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1586     return xcb_ret;
1587 }
1588 
1589 xcb_void_cookie_t
xcb_randr_delete_output_property_checked(xcb_connection_t * c,xcb_randr_output_t output,xcb_atom_t property)1590 xcb_randr_delete_output_property_checked (xcb_connection_t   *c  /**< */,
1591                                           xcb_randr_output_t  output  /**< */,
1592                                           xcb_atom_t          property  /**< */)
1593 {
1594     static const xcb_protocol_request_t xcb_req = {
1595         /* count */ 2,
1596         /* ext */ &xcb_randr_id,
1597         /* opcode */ XCB_RANDR_DELETE_OUTPUT_PROPERTY,
1598         /* isvoid */ 1
1599     };
1600 
1601     struct iovec xcb_parts[4];
1602     xcb_void_cookie_t xcb_ret;
1603     xcb_randr_delete_output_property_request_t xcb_out;
1604 
1605     xcb_out.output = output;
1606     xcb_out.property = property;
1607 
1608     xcb_parts[2].iov_base = (char *) &xcb_out;
1609     xcb_parts[2].iov_len = sizeof(xcb_out);
1610     xcb_parts[3].iov_base = 0;
1611     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1612 
1613     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1614     return xcb_ret;
1615 }
1616 
1617 xcb_void_cookie_t
xcb_randr_delete_output_property(xcb_connection_t * c,xcb_randr_output_t output,xcb_atom_t property)1618 xcb_randr_delete_output_property (xcb_connection_t   *c  /**< */,
1619                                   xcb_randr_output_t  output  /**< */,
1620                                   xcb_atom_t          property  /**< */)
1621 {
1622     static const xcb_protocol_request_t xcb_req = {
1623         /* count */ 2,
1624         /* ext */ &xcb_randr_id,
1625         /* opcode */ XCB_RANDR_DELETE_OUTPUT_PROPERTY,
1626         /* isvoid */ 1
1627     };
1628 
1629     struct iovec xcb_parts[4];
1630     xcb_void_cookie_t xcb_ret;
1631     xcb_randr_delete_output_property_request_t xcb_out;
1632 
1633     xcb_out.output = output;
1634     xcb_out.property = property;
1635 
1636     xcb_parts[2].iov_base = (char *) &xcb_out;
1637     xcb_parts[2].iov_len = sizeof(xcb_out);
1638     xcb_parts[3].iov_base = 0;
1639     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1640 
1641     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1642     return xcb_ret;
1643 }
1644 
1645 int
xcb_randr_get_output_property_sizeof(const void * _buffer)1646 xcb_randr_get_output_property_sizeof (const void  *_buffer  /**< */)
1647 {
1648     char *xcb_tmp = (char *)_buffer;
1649     const xcb_randr_get_output_property_reply_t *_aux = (xcb_randr_get_output_property_reply_t *)_buffer;
1650     unsigned int xcb_buffer_len = 0;
1651     unsigned int xcb_block_len = 0;
1652     unsigned int xcb_pad = 0;
1653     unsigned int xcb_align_to = 0;
1654 
1655 
1656     xcb_block_len += sizeof(xcb_randr_get_output_property_reply_t);
1657     xcb_tmp += xcb_block_len;
1658     xcb_buffer_len += xcb_block_len;
1659     xcb_block_len = 0;
1660     /* data */
1661     xcb_block_len += (_aux->num_items * (_aux->format / 8)) * sizeof(uint8_t);
1662     xcb_tmp += xcb_block_len;
1663     xcb_align_to = ALIGNOF(uint8_t);
1664     /* insert padding */
1665     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1666     xcb_buffer_len += xcb_block_len + xcb_pad;
1667     if (0 != xcb_pad) {
1668         xcb_tmp += xcb_pad;
1669         xcb_pad = 0;
1670     }
1671     xcb_block_len = 0;
1672 
1673     return xcb_buffer_len;
1674 }
1675 
1676 xcb_randr_get_output_property_cookie_t
xcb_randr_get_output_property(xcb_connection_t * c,xcb_randr_output_t output,xcb_atom_t property,xcb_atom_t type,uint32_t long_offset,uint32_t long_length,uint8_t _delete,uint8_t pending)1677 xcb_randr_get_output_property (xcb_connection_t   *c  /**< */,
1678                                xcb_randr_output_t  output  /**< */,
1679                                xcb_atom_t          property  /**< */,
1680                                xcb_atom_t          type  /**< */,
1681                                uint32_t            long_offset  /**< */,
1682                                uint32_t            long_length  /**< */,
1683                                uint8_t             _delete  /**< */,
1684                                uint8_t             pending  /**< */)
1685 {
1686     static const xcb_protocol_request_t xcb_req = {
1687         /* count */ 2,
1688         /* ext */ &xcb_randr_id,
1689         /* opcode */ XCB_RANDR_GET_OUTPUT_PROPERTY,
1690         /* isvoid */ 0
1691     };
1692 
1693     struct iovec xcb_parts[4];
1694     xcb_randr_get_output_property_cookie_t xcb_ret;
1695     xcb_randr_get_output_property_request_t xcb_out;
1696 
1697     xcb_out.output = output;
1698     xcb_out.property = property;
1699     xcb_out.type = type;
1700     xcb_out.long_offset = long_offset;
1701     xcb_out.long_length = long_length;
1702     xcb_out._delete = _delete;
1703     xcb_out.pending = pending;
1704     memset(xcb_out.pad0, 0, 2);
1705 
1706     xcb_parts[2].iov_base = (char *) &xcb_out;
1707     xcb_parts[2].iov_len = sizeof(xcb_out);
1708     xcb_parts[3].iov_base = 0;
1709     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1710 
1711     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1712     return xcb_ret;
1713 }
1714 
1715 xcb_randr_get_output_property_cookie_t
xcb_randr_get_output_property_unchecked(xcb_connection_t * c,xcb_randr_output_t output,xcb_atom_t property,xcb_atom_t type,uint32_t long_offset,uint32_t long_length,uint8_t _delete,uint8_t pending)1716 xcb_randr_get_output_property_unchecked (xcb_connection_t   *c  /**< */,
1717                                          xcb_randr_output_t  output  /**< */,
1718                                          xcb_atom_t          property  /**< */,
1719                                          xcb_atom_t          type  /**< */,
1720                                          uint32_t            long_offset  /**< */,
1721                                          uint32_t            long_length  /**< */,
1722                                          uint8_t             _delete  /**< */,
1723                                          uint8_t             pending  /**< */)
1724 {
1725     static const xcb_protocol_request_t xcb_req = {
1726         /* count */ 2,
1727         /* ext */ &xcb_randr_id,
1728         /* opcode */ XCB_RANDR_GET_OUTPUT_PROPERTY,
1729         /* isvoid */ 0
1730     };
1731 
1732     struct iovec xcb_parts[4];
1733     xcb_randr_get_output_property_cookie_t xcb_ret;
1734     xcb_randr_get_output_property_request_t xcb_out;
1735 
1736     xcb_out.output = output;
1737     xcb_out.property = property;
1738     xcb_out.type = type;
1739     xcb_out.long_offset = long_offset;
1740     xcb_out.long_length = long_length;
1741     xcb_out._delete = _delete;
1742     xcb_out.pending = pending;
1743     memset(xcb_out.pad0, 0, 2);
1744 
1745     xcb_parts[2].iov_base = (char *) &xcb_out;
1746     xcb_parts[2].iov_len = sizeof(xcb_out);
1747     xcb_parts[3].iov_base = 0;
1748     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1749 
1750     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1751     return xcb_ret;
1752 }
1753 
1754 uint8_t *
xcb_randr_get_output_property_data(const xcb_randr_get_output_property_reply_t * R)1755 xcb_randr_get_output_property_data (const xcb_randr_get_output_property_reply_t *R  /**< */)
1756 {
1757     return (uint8_t *) (R + 1);
1758 }
1759 
1760 int
xcb_randr_get_output_property_data_length(const xcb_randr_get_output_property_reply_t * R)1761 xcb_randr_get_output_property_data_length (const xcb_randr_get_output_property_reply_t *R  /**< */)
1762 {
1763     return (R->num_items * (R->format / 8));
1764 }
1765 
1766 xcb_generic_iterator_t
xcb_randr_get_output_property_data_end(const xcb_randr_get_output_property_reply_t * R)1767 xcb_randr_get_output_property_data_end (const xcb_randr_get_output_property_reply_t *R  /**< */)
1768 {
1769     xcb_generic_iterator_t i;
1770     i.data = ((uint8_t *) (R + 1)) + ((R->num_items * (R->format / 8)));
1771     i.rem = 0;
1772     i.index = (char *) i.data - (char *) R;
1773     return i;
1774 }
1775 
1776 xcb_randr_get_output_property_reply_t *
xcb_randr_get_output_property_reply(xcb_connection_t * c,xcb_randr_get_output_property_cookie_t cookie,xcb_generic_error_t ** e)1777 xcb_randr_get_output_property_reply (xcb_connection_t                        *c  /**< */,
1778                                      xcb_randr_get_output_property_cookie_t   cookie  /**< */,
1779                                      xcb_generic_error_t                    **e  /**< */)
1780 {
1781     return (xcb_randr_get_output_property_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1782 }
1783 
1784 int
xcb_randr_create_mode_sizeof(const void * _buffer,uint32_t name_len)1785 xcb_randr_create_mode_sizeof (const void  *_buffer  /**< */,
1786                               uint32_t     name_len  /**< */)
1787 {
1788     char *xcb_tmp = (char *)_buffer;
1789     unsigned int xcb_buffer_len = 0;
1790     unsigned int xcb_block_len = 0;
1791     unsigned int xcb_pad = 0;
1792     unsigned int xcb_align_to = 0;
1793 
1794 
1795     xcb_block_len += sizeof(xcb_randr_create_mode_request_t);
1796     xcb_tmp += xcb_block_len;
1797     xcb_buffer_len += xcb_block_len;
1798     xcb_block_len = 0;
1799     /* name */
1800     xcb_block_len += name_len * sizeof(char);
1801     xcb_tmp += xcb_block_len;
1802     xcb_align_to = ALIGNOF(char);
1803     /* insert padding */
1804     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1805     xcb_buffer_len += xcb_block_len + xcb_pad;
1806     if (0 != xcb_pad) {
1807         xcb_tmp += xcb_pad;
1808         xcb_pad = 0;
1809     }
1810     xcb_block_len = 0;
1811 
1812     return xcb_buffer_len;
1813 }
1814 
1815 xcb_randr_create_mode_cookie_t
xcb_randr_create_mode(xcb_connection_t * c,xcb_window_t window,xcb_randr_mode_info_t mode_info,uint32_t name_len,const char * name)1816 xcb_randr_create_mode (xcb_connection_t      *c  /**< */,
1817                        xcb_window_t           window  /**< */,
1818                        xcb_randr_mode_info_t  mode_info  /**< */,
1819                        uint32_t               name_len  /**< */,
1820                        const char            *name  /**< */)
1821 {
1822     static const xcb_protocol_request_t xcb_req = {
1823         /* count */ 4,
1824         /* ext */ &xcb_randr_id,
1825         /* opcode */ XCB_RANDR_CREATE_MODE,
1826         /* isvoid */ 0
1827     };
1828 
1829     struct iovec xcb_parts[6];
1830     xcb_randr_create_mode_cookie_t xcb_ret;
1831     xcb_randr_create_mode_request_t xcb_out;
1832 
1833     xcb_out.window = window;
1834     xcb_out.mode_info = mode_info;
1835 
1836     xcb_parts[2].iov_base = (char *) &xcb_out;
1837     xcb_parts[2].iov_len = sizeof(xcb_out);
1838     xcb_parts[3].iov_base = 0;
1839     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1840     /* char name */
1841     xcb_parts[4].iov_base = (char *) name;
1842     xcb_parts[4].iov_len = name_len * sizeof(char);
1843     xcb_parts[5].iov_base = 0;
1844     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1845 
1846     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1847     return xcb_ret;
1848 }
1849 
1850 xcb_randr_create_mode_cookie_t
xcb_randr_create_mode_unchecked(xcb_connection_t * c,xcb_window_t window,xcb_randr_mode_info_t mode_info,uint32_t name_len,const char * name)1851 xcb_randr_create_mode_unchecked (xcb_connection_t      *c  /**< */,
1852                                  xcb_window_t           window  /**< */,
1853                                  xcb_randr_mode_info_t  mode_info  /**< */,
1854                                  uint32_t               name_len  /**< */,
1855                                  const char            *name  /**< */)
1856 {
1857     static const xcb_protocol_request_t xcb_req = {
1858         /* count */ 4,
1859         /* ext */ &xcb_randr_id,
1860         /* opcode */ XCB_RANDR_CREATE_MODE,
1861         /* isvoid */ 0
1862     };
1863 
1864     struct iovec xcb_parts[6];
1865     xcb_randr_create_mode_cookie_t xcb_ret;
1866     xcb_randr_create_mode_request_t xcb_out;
1867 
1868     xcb_out.window = window;
1869     xcb_out.mode_info = mode_info;
1870 
1871     xcb_parts[2].iov_base = (char *) &xcb_out;
1872     xcb_parts[2].iov_len = sizeof(xcb_out);
1873     xcb_parts[3].iov_base = 0;
1874     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1875     /* char name */
1876     xcb_parts[4].iov_base = (char *) name;
1877     xcb_parts[4].iov_len = name_len * sizeof(char);
1878     xcb_parts[5].iov_base = 0;
1879     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1880 
1881     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1882     return xcb_ret;
1883 }
1884 
1885 xcb_randr_create_mode_reply_t *
xcb_randr_create_mode_reply(xcb_connection_t * c,xcb_randr_create_mode_cookie_t cookie,xcb_generic_error_t ** e)1886 xcb_randr_create_mode_reply (xcb_connection_t                *c  /**< */,
1887                              xcb_randr_create_mode_cookie_t   cookie  /**< */,
1888                              xcb_generic_error_t            **e  /**< */)
1889 {
1890     return (xcb_randr_create_mode_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1891 }
1892 
1893 xcb_void_cookie_t
xcb_randr_destroy_mode_checked(xcb_connection_t * c,xcb_randr_mode_t mode)1894 xcb_randr_destroy_mode_checked (xcb_connection_t *c  /**< */,
1895                                 xcb_randr_mode_t  mode  /**< */)
1896 {
1897     static const xcb_protocol_request_t xcb_req = {
1898         /* count */ 2,
1899         /* ext */ &xcb_randr_id,
1900         /* opcode */ XCB_RANDR_DESTROY_MODE,
1901         /* isvoid */ 1
1902     };
1903 
1904     struct iovec xcb_parts[4];
1905     xcb_void_cookie_t xcb_ret;
1906     xcb_randr_destroy_mode_request_t xcb_out;
1907 
1908     xcb_out.mode = mode;
1909 
1910     xcb_parts[2].iov_base = (char *) &xcb_out;
1911     xcb_parts[2].iov_len = sizeof(xcb_out);
1912     xcb_parts[3].iov_base = 0;
1913     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1914 
1915     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1916     return xcb_ret;
1917 }
1918 
1919 xcb_void_cookie_t
xcb_randr_destroy_mode(xcb_connection_t * c,xcb_randr_mode_t mode)1920 xcb_randr_destroy_mode (xcb_connection_t *c  /**< */,
1921                         xcb_randr_mode_t  mode  /**< */)
1922 {
1923     static const xcb_protocol_request_t xcb_req = {
1924         /* count */ 2,
1925         /* ext */ &xcb_randr_id,
1926         /* opcode */ XCB_RANDR_DESTROY_MODE,
1927         /* isvoid */ 1
1928     };
1929 
1930     struct iovec xcb_parts[4];
1931     xcb_void_cookie_t xcb_ret;
1932     xcb_randr_destroy_mode_request_t xcb_out;
1933 
1934     xcb_out.mode = mode;
1935 
1936     xcb_parts[2].iov_base = (char *) &xcb_out;
1937     xcb_parts[2].iov_len = sizeof(xcb_out);
1938     xcb_parts[3].iov_base = 0;
1939     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1940 
1941     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1942     return xcb_ret;
1943 }
1944 
1945 xcb_void_cookie_t
xcb_randr_add_output_mode_checked(xcb_connection_t * c,xcb_randr_output_t output,xcb_randr_mode_t mode)1946 xcb_randr_add_output_mode_checked (xcb_connection_t   *c  /**< */,
1947                                    xcb_randr_output_t  output  /**< */,
1948                                    xcb_randr_mode_t    mode  /**< */)
1949 {
1950     static const xcb_protocol_request_t xcb_req = {
1951         /* count */ 2,
1952         /* ext */ &xcb_randr_id,
1953         /* opcode */ XCB_RANDR_ADD_OUTPUT_MODE,
1954         /* isvoid */ 1
1955     };
1956 
1957     struct iovec xcb_parts[4];
1958     xcb_void_cookie_t xcb_ret;
1959     xcb_randr_add_output_mode_request_t xcb_out;
1960 
1961     xcb_out.output = output;
1962     xcb_out.mode = mode;
1963 
1964     xcb_parts[2].iov_base = (char *) &xcb_out;
1965     xcb_parts[2].iov_len = sizeof(xcb_out);
1966     xcb_parts[3].iov_base = 0;
1967     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1968 
1969     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1970     return xcb_ret;
1971 }
1972 
1973 xcb_void_cookie_t
xcb_randr_add_output_mode(xcb_connection_t * c,xcb_randr_output_t output,xcb_randr_mode_t mode)1974 xcb_randr_add_output_mode (xcb_connection_t   *c  /**< */,
1975                            xcb_randr_output_t  output  /**< */,
1976                            xcb_randr_mode_t    mode  /**< */)
1977 {
1978     static const xcb_protocol_request_t xcb_req = {
1979         /* count */ 2,
1980         /* ext */ &xcb_randr_id,
1981         /* opcode */ XCB_RANDR_ADD_OUTPUT_MODE,
1982         /* isvoid */ 1
1983     };
1984 
1985     struct iovec xcb_parts[4];
1986     xcb_void_cookie_t xcb_ret;
1987     xcb_randr_add_output_mode_request_t xcb_out;
1988 
1989     xcb_out.output = output;
1990     xcb_out.mode = mode;
1991 
1992     xcb_parts[2].iov_base = (char *) &xcb_out;
1993     xcb_parts[2].iov_len = sizeof(xcb_out);
1994     xcb_parts[3].iov_base = 0;
1995     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1996 
1997     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1998     return xcb_ret;
1999 }
2000 
2001 xcb_void_cookie_t
xcb_randr_delete_output_mode_checked(xcb_connection_t * c,xcb_randr_output_t output,xcb_randr_mode_t mode)2002 xcb_randr_delete_output_mode_checked (xcb_connection_t   *c  /**< */,
2003                                       xcb_randr_output_t  output  /**< */,
2004                                       xcb_randr_mode_t    mode  /**< */)
2005 {
2006     static const xcb_protocol_request_t xcb_req = {
2007         /* count */ 2,
2008         /* ext */ &xcb_randr_id,
2009         /* opcode */ XCB_RANDR_DELETE_OUTPUT_MODE,
2010         /* isvoid */ 1
2011     };
2012 
2013     struct iovec xcb_parts[4];
2014     xcb_void_cookie_t xcb_ret;
2015     xcb_randr_delete_output_mode_request_t xcb_out;
2016 
2017     xcb_out.output = output;
2018     xcb_out.mode = mode;
2019 
2020     xcb_parts[2].iov_base = (char *) &xcb_out;
2021     xcb_parts[2].iov_len = sizeof(xcb_out);
2022     xcb_parts[3].iov_base = 0;
2023     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2024 
2025     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2026     return xcb_ret;
2027 }
2028 
2029 xcb_void_cookie_t
xcb_randr_delete_output_mode(xcb_connection_t * c,xcb_randr_output_t output,xcb_randr_mode_t mode)2030 xcb_randr_delete_output_mode (xcb_connection_t   *c  /**< */,
2031                               xcb_randr_output_t  output  /**< */,
2032                               xcb_randr_mode_t    mode  /**< */)
2033 {
2034     static const xcb_protocol_request_t xcb_req = {
2035         /* count */ 2,
2036         /* ext */ &xcb_randr_id,
2037         /* opcode */ XCB_RANDR_DELETE_OUTPUT_MODE,
2038         /* isvoid */ 1
2039     };
2040 
2041     struct iovec xcb_parts[4];
2042     xcb_void_cookie_t xcb_ret;
2043     xcb_randr_delete_output_mode_request_t xcb_out;
2044 
2045     xcb_out.output = output;
2046     xcb_out.mode = mode;
2047 
2048     xcb_parts[2].iov_base = (char *) &xcb_out;
2049     xcb_parts[2].iov_len = sizeof(xcb_out);
2050     xcb_parts[3].iov_base = 0;
2051     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2052 
2053     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2054     return xcb_ret;
2055 }
2056 
2057 int
xcb_randr_get_crtc_info_sizeof(const void * _buffer)2058 xcb_randr_get_crtc_info_sizeof (const void  *_buffer  /**< */)
2059 {
2060     char *xcb_tmp = (char *)_buffer;
2061     const xcb_randr_get_crtc_info_reply_t *_aux = (xcb_randr_get_crtc_info_reply_t *)_buffer;
2062     unsigned int xcb_buffer_len = 0;
2063     unsigned int xcb_block_len = 0;
2064     unsigned int xcb_pad = 0;
2065     unsigned int xcb_align_to = 0;
2066 
2067 
2068     xcb_block_len += sizeof(xcb_randr_get_crtc_info_reply_t);
2069     xcb_tmp += xcb_block_len;
2070     xcb_buffer_len += xcb_block_len;
2071     xcb_block_len = 0;
2072     /* outputs */
2073     xcb_block_len += _aux->num_outputs * sizeof(xcb_randr_output_t);
2074     xcb_tmp += xcb_block_len;
2075     xcb_align_to = ALIGNOF(xcb_randr_output_t);
2076     /* insert padding */
2077     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2078     xcb_buffer_len += xcb_block_len + xcb_pad;
2079     if (0 != xcb_pad) {
2080         xcb_tmp += xcb_pad;
2081         xcb_pad = 0;
2082     }
2083     xcb_block_len = 0;
2084     /* possible */
2085     xcb_block_len += _aux->num_possible_outputs * sizeof(xcb_randr_output_t);
2086     xcb_tmp += xcb_block_len;
2087     xcb_align_to = ALIGNOF(xcb_randr_output_t);
2088     /* insert padding */
2089     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2090     xcb_buffer_len += xcb_block_len + xcb_pad;
2091     if (0 != xcb_pad) {
2092         xcb_tmp += xcb_pad;
2093         xcb_pad = 0;
2094     }
2095     xcb_block_len = 0;
2096 
2097     return xcb_buffer_len;
2098 }
2099 
2100 xcb_randr_get_crtc_info_cookie_t
xcb_randr_get_crtc_info(xcb_connection_t * c,xcb_randr_crtc_t crtc,xcb_timestamp_t config_timestamp)2101 xcb_randr_get_crtc_info (xcb_connection_t *c  /**< */,
2102                          xcb_randr_crtc_t  crtc  /**< */,
2103                          xcb_timestamp_t   config_timestamp  /**< */)
2104 {
2105     static const xcb_protocol_request_t xcb_req = {
2106         /* count */ 2,
2107         /* ext */ &xcb_randr_id,
2108         /* opcode */ XCB_RANDR_GET_CRTC_INFO,
2109         /* isvoid */ 0
2110     };
2111 
2112     struct iovec xcb_parts[4];
2113     xcb_randr_get_crtc_info_cookie_t xcb_ret;
2114     xcb_randr_get_crtc_info_request_t xcb_out;
2115 
2116     xcb_out.crtc = crtc;
2117     xcb_out.config_timestamp = config_timestamp;
2118 
2119     xcb_parts[2].iov_base = (char *) &xcb_out;
2120     xcb_parts[2].iov_len = sizeof(xcb_out);
2121     xcb_parts[3].iov_base = 0;
2122     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2123 
2124     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2125     return xcb_ret;
2126 }
2127 
2128 xcb_randr_get_crtc_info_cookie_t
xcb_randr_get_crtc_info_unchecked(xcb_connection_t * c,xcb_randr_crtc_t crtc,xcb_timestamp_t config_timestamp)2129 xcb_randr_get_crtc_info_unchecked (xcb_connection_t *c  /**< */,
2130                                    xcb_randr_crtc_t  crtc  /**< */,
2131                                    xcb_timestamp_t   config_timestamp  /**< */)
2132 {
2133     static const xcb_protocol_request_t xcb_req = {
2134         /* count */ 2,
2135         /* ext */ &xcb_randr_id,
2136         /* opcode */ XCB_RANDR_GET_CRTC_INFO,
2137         /* isvoid */ 0
2138     };
2139 
2140     struct iovec xcb_parts[4];
2141     xcb_randr_get_crtc_info_cookie_t xcb_ret;
2142     xcb_randr_get_crtc_info_request_t xcb_out;
2143 
2144     xcb_out.crtc = crtc;
2145     xcb_out.config_timestamp = config_timestamp;
2146 
2147     xcb_parts[2].iov_base = (char *) &xcb_out;
2148     xcb_parts[2].iov_len = sizeof(xcb_out);
2149     xcb_parts[3].iov_base = 0;
2150     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2151 
2152     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2153     return xcb_ret;
2154 }
2155 
2156 xcb_randr_output_t *
xcb_randr_get_crtc_info_outputs(const xcb_randr_get_crtc_info_reply_t * R)2157 xcb_randr_get_crtc_info_outputs (const xcb_randr_get_crtc_info_reply_t *R  /**< */)
2158 {
2159     return (xcb_randr_output_t *) (R + 1);
2160 }
2161 
2162 int
xcb_randr_get_crtc_info_outputs_length(const xcb_randr_get_crtc_info_reply_t * R)2163 xcb_randr_get_crtc_info_outputs_length (const xcb_randr_get_crtc_info_reply_t *R  /**< */)
2164 {
2165     return R->num_outputs;
2166 }
2167 
2168 xcb_generic_iterator_t
xcb_randr_get_crtc_info_outputs_end(const xcb_randr_get_crtc_info_reply_t * R)2169 xcb_randr_get_crtc_info_outputs_end (const xcb_randr_get_crtc_info_reply_t *R  /**< */)
2170 {
2171     xcb_generic_iterator_t i;
2172     i.data = ((xcb_randr_output_t *) (R + 1)) + (R->num_outputs);
2173     i.rem = 0;
2174     i.index = (char *) i.data - (char *) R;
2175     return i;
2176 }
2177 
2178 xcb_randr_output_t *
xcb_randr_get_crtc_info_possible(const xcb_randr_get_crtc_info_reply_t * R)2179 xcb_randr_get_crtc_info_possible (const xcb_randr_get_crtc_info_reply_t *R  /**< */)
2180 {
2181     xcb_generic_iterator_t prev = xcb_randr_get_crtc_info_outputs_end(R);
2182     return (xcb_randr_output_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_randr_output_t, prev.index) + 0);
2183 }
2184 
2185 int
xcb_randr_get_crtc_info_possible_length(const xcb_randr_get_crtc_info_reply_t * R)2186 xcb_randr_get_crtc_info_possible_length (const xcb_randr_get_crtc_info_reply_t *R  /**< */)
2187 {
2188     return R->num_possible_outputs;
2189 }
2190 
2191 xcb_generic_iterator_t
xcb_randr_get_crtc_info_possible_end(const xcb_randr_get_crtc_info_reply_t * R)2192 xcb_randr_get_crtc_info_possible_end (const xcb_randr_get_crtc_info_reply_t *R  /**< */)
2193 {
2194     xcb_generic_iterator_t i;
2195     xcb_generic_iterator_t child = xcb_randr_get_crtc_info_outputs_end(R);
2196     i.data = ((xcb_randr_output_t *) child.data) + (R->num_possible_outputs);
2197     i.rem = 0;
2198     i.index = (char *) i.data - (char *) R;
2199     return i;
2200 }
2201 
2202 xcb_randr_get_crtc_info_reply_t *
xcb_randr_get_crtc_info_reply(xcb_connection_t * c,xcb_randr_get_crtc_info_cookie_t cookie,xcb_generic_error_t ** e)2203 xcb_randr_get_crtc_info_reply (xcb_connection_t                  *c  /**< */,
2204                                xcb_randr_get_crtc_info_cookie_t   cookie  /**< */,
2205                                xcb_generic_error_t              **e  /**< */)
2206 {
2207     return (xcb_randr_get_crtc_info_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
2208 }
2209 
2210 int
xcb_randr_set_crtc_config_sizeof(const void * _buffer,uint32_t outputs_len)2211 xcb_randr_set_crtc_config_sizeof (const void  *_buffer  /**< */,
2212                                   uint32_t     outputs_len  /**< */)
2213 {
2214     char *xcb_tmp = (char *)_buffer;
2215     unsigned int xcb_buffer_len = 0;
2216     unsigned int xcb_block_len = 0;
2217     unsigned int xcb_pad = 0;
2218     unsigned int xcb_align_to = 0;
2219 
2220 
2221     xcb_block_len += sizeof(xcb_randr_set_crtc_config_request_t);
2222     xcb_tmp += xcb_block_len;
2223     xcb_buffer_len += xcb_block_len;
2224     xcb_block_len = 0;
2225     /* outputs */
2226     xcb_block_len += outputs_len * sizeof(xcb_randr_output_t);
2227     xcb_tmp += xcb_block_len;
2228     xcb_align_to = ALIGNOF(xcb_randr_output_t);
2229     /* insert padding */
2230     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2231     xcb_buffer_len += xcb_block_len + xcb_pad;
2232     if (0 != xcb_pad) {
2233         xcb_tmp += xcb_pad;
2234         xcb_pad = 0;
2235     }
2236     xcb_block_len = 0;
2237 
2238     return xcb_buffer_len;
2239 }
2240 
2241 xcb_randr_set_crtc_config_cookie_t
xcb_randr_set_crtc_config(xcb_connection_t * c,xcb_randr_crtc_t crtc,xcb_timestamp_t timestamp,xcb_timestamp_t config_timestamp,int16_t x,int16_t y,xcb_randr_mode_t mode,uint16_t rotation,uint32_t outputs_len,const xcb_randr_output_t * outputs)2242 xcb_randr_set_crtc_config (xcb_connection_t         *c  /**< */,
2243                            xcb_randr_crtc_t          crtc  /**< */,
2244                            xcb_timestamp_t           timestamp  /**< */,
2245                            xcb_timestamp_t           config_timestamp  /**< */,
2246                            int16_t                   x  /**< */,
2247                            int16_t                   y  /**< */,
2248                            xcb_randr_mode_t          mode  /**< */,
2249                            uint16_t                  rotation  /**< */,
2250                            uint32_t                  outputs_len  /**< */,
2251                            const xcb_randr_output_t *outputs  /**< */)
2252 {
2253     static const xcb_protocol_request_t xcb_req = {
2254         /* count */ 4,
2255         /* ext */ &xcb_randr_id,
2256         /* opcode */ XCB_RANDR_SET_CRTC_CONFIG,
2257         /* isvoid */ 0
2258     };
2259 
2260     struct iovec xcb_parts[6];
2261     xcb_randr_set_crtc_config_cookie_t xcb_ret;
2262     xcb_randr_set_crtc_config_request_t xcb_out;
2263 
2264     xcb_out.crtc = crtc;
2265     xcb_out.timestamp = timestamp;
2266     xcb_out.config_timestamp = config_timestamp;
2267     xcb_out.x = x;
2268     xcb_out.y = y;
2269     xcb_out.mode = mode;
2270     xcb_out.rotation = rotation;
2271     memset(xcb_out.pad0, 0, 2);
2272 
2273     xcb_parts[2].iov_base = (char *) &xcb_out;
2274     xcb_parts[2].iov_len = sizeof(xcb_out);
2275     xcb_parts[3].iov_base = 0;
2276     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2277     /* xcb_randr_output_t outputs */
2278     xcb_parts[4].iov_base = (char *) outputs;
2279     xcb_parts[4].iov_len = outputs_len * sizeof(xcb_timestamp_t);
2280     xcb_parts[5].iov_base = 0;
2281     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
2282 
2283     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2284     return xcb_ret;
2285 }
2286 
2287 xcb_randr_set_crtc_config_cookie_t
xcb_randr_set_crtc_config_unchecked(xcb_connection_t * c,xcb_randr_crtc_t crtc,xcb_timestamp_t timestamp,xcb_timestamp_t config_timestamp,int16_t x,int16_t y,xcb_randr_mode_t mode,uint16_t rotation,uint32_t outputs_len,const xcb_randr_output_t * outputs)2288 xcb_randr_set_crtc_config_unchecked (xcb_connection_t         *c  /**< */,
2289                                      xcb_randr_crtc_t          crtc  /**< */,
2290                                      xcb_timestamp_t           timestamp  /**< */,
2291                                      xcb_timestamp_t           config_timestamp  /**< */,
2292                                      int16_t                   x  /**< */,
2293                                      int16_t                   y  /**< */,
2294                                      xcb_randr_mode_t          mode  /**< */,
2295                                      uint16_t                  rotation  /**< */,
2296                                      uint32_t                  outputs_len  /**< */,
2297                                      const xcb_randr_output_t *outputs  /**< */)
2298 {
2299     static const xcb_protocol_request_t xcb_req = {
2300         /* count */ 4,
2301         /* ext */ &xcb_randr_id,
2302         /* opcode */ XCB_RANDR_SET_CRTC_CONFIG,
2303         /* isvoid */ 0
2304     };
2305 
2306     struct iovec xcb_parts[6];
2307     xcb_randr_set_crtc_config_cookie_t xcb_ret;
2308     xcb_randr_set_crtc_config_request_t xcb_out;
2309 
2310     xcb_out.crtc = crtc;
2311     xcb_out.timestamp = timestamp;
2312     xcb_out.config_timestamp = config_timestamp;
2313     xcb_out.x = x;
2314     xcb_out.y = y;
2315     xcb_out.mode = mode;
2316     xcb_out.rotation = rotation;
2317     memset(xcb_out.pad0, 0, 2);
2318 
2319     xcb_parts[2].iov_base = (char *) &xcb_out;
2320     xcb_parts[2].iov_len = sizeof(xcb_out);
2321     xcb_parts[3].iov_base = 0;
2322     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2323     /* xcb_randr_output_t outputs */
2324     xcb_parts[4].iov_base = (char *) outputs;
2325     xcb_parts[4].iov_len = outputs_len * sizeof(xcb_timestamp_t);
2326     xcb_parts[5].iov_base = 0;
2327     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
2328 
2329     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2330     return xcb_ret;
2331 }
2332 
2333 xcb_randr_set_crtc_config_reply_t *
xcb_randr_set_crtc_config_reply(xcb_connection_t * c,xcb_randr_set_crtc_config_cookie_t cookie,xcb_generic_error_t ** e)2334 xcb_randr_set_crtc_config_reply (xcb_connection_t                    *c  /**< */,
2335                                  xcb_randr_set_crtc_config_cookie_t   cookie  /**< */,
2336                                  xcb_generic_error_t                **e  /**< */)
2337 {
2338     return (xcb_randr_set_crtc_config_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
2339 }
2340 
2341 xcb_randr_get_crtc_gamma_size_cookie_t
xcb_randr_get_crtc_gamma_size(xcb_connection_t * c,xcb_randr_crtc_t crtc)2342 xcb_randr_get_crtc_gamma_size (xcb_connection_t *c  /**< */,
2343                                xcb_randr_crtc_t  crtc  /**< */)
2344 {
2345     static const xcb_protocol_request_t xcb_req = {
2346         /* count */ 2,
2347         /* ext */ &xcb_randr_id,
2348         /* opcode */ XCB_RANDR_GET_CRTC_GAMMA_SIZE,
2349         /* isvoid */ 0
2350     };
2351 
2352     struct iovec xcb_parts[4];
2353     xcb_randr_get_crtc_gamma_size_cookie_t xcb_ret;
2354     xcb_randr_get_crtc_gamma_size_request_t xcb_out;
2355 
2356     xcb_out.crtc = crtc;
2357 
2358     xcb_parts[2].iov_base = (char *) &xcb_out;
2359     xcb_parts[2].iov_len = sizeof(xcb_out);
2360     xcb_parts[3].iov_base = 0;
2361     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2362 
2363     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2364     return xcb_ret;
2365 }
2366 
2367 xcb_randr_get_crtc_gamma_size_cookie_t
xcb_randr_get_crtc_gamma_size_unchecked(xcb_connection_t * c,xcb_randr_crtc_t crtc)2368 xcb_randr_get_crtc_gamma_size_unchecked (xcb_connection_t *c  /**< */,
2369                                          xcb_randr_crtc_t  crtc  /**< */)
2370 {
2371     static const xcb_protocol_request_t xcb_req = {
2372         /* count */ 2,
2373         /* ext */ &xcb_randr_id,
2374         /* opcode */ XCB_RANDR_GET_CRTC_GAMMA_SIZE,
2375         /* isvoid */ 0
2376     };
2377 
2378     struct iovec xcb_parts[4];
2379     xcb_randr_get_crtc_gamma_size_cookie_t xcb_ret;
2380     xcb_randr_get_crtc_gamma_size_request_t xcb_out;
2381 
2382     xcb_out.crtc = crtc;
2383 
2384     xcb_parts[2].iov_base = (char *) &xcb_out;
2385     xcb_parts[2].iov_len = sizeof(xcb_out);
2386     xcb_parts[3].iov_base = 0;
2387     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2388 
2389     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2390     return xcb_ret;
2391 }
2392 
2393 xcb_randr_get_crtc_gamma_size_reply_t *
xcb_randr_get_crtc_gamma_size_reply(xcb_connection_t * c,xcb_randr_get_crtc_gamma_size_cookie_t cookie,xcb_generic_error_t ** e)2394 xcb_randr_get_crtc_gamma_size_reply (xcb_connection_t                        *c  /**< */,
2395                                      xcb_randr_get_crtc_gamma_size_cookie_t   cookie  /**< */,
2396                                      xcb_generic_error_t                    **e  /**< */)
2397 {
2398     return (xcb_randr_get_crtc_gamma_size_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
2399 }
2400 
2401 int
xcb_randr_get_crtc_gamma_sizeof(const void * _buffer)2402 xcb_randr_get_crtc_gamma_sizeof (const void  *_buffer  /**< */)
2403 {
2404     char *xcb_tmp = (char *)_buffer;
2405     const xcb_randr_get_crtc_gamma_reply_t *_aux = (xcb_randr_get_crtc_gamma_reply_t *)_buffer;
2406     unsigned int xcb_buffer_len = 0;
2407     unsigned int xcb_block_len = 0;
2408     unsigned int xcb_pad = 0;
2409     unsigned int xcb_align_to = 0;
2410 
2411 
2412     xcb_block_len += sizeof(xcb_randr_get_crtc_gamma_reply_t);
2413     xcb_tmp += xcb_block_len;
2414     xcb_buffer_len += xcb_block_len;
2415     xcb_block_len = 0;
2416     /* red */
2417     xcb_block_len += _aux->size * sizeof(uint16_t);
2418     xcb_tmp += xcb_block_len;
2419     xcb_align_to = ALIGNOF(uint16_t);
2420     /* insert padding */
2421     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2422     xcb_buffer_len += xcb_block_len + xcb_pad;
2423     if (0 != xcb_pad) {
2424         xcb_tmp += xcb_pad;
2425         xcb_pad = 0;
2426     }
2427     xcb_block_len = 0;
2428     /* green */
2429     xcb_block_len += _aux->size * sizeof(uint16_t);
2430     xcb_tmp += xcb_block_len;
2431     xcb_align_to = ALIGNOF(uint16_t);
2432     /* insert padding */
2433     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2434     xcb_buffer_len += xcb_block_len + xcb_pad;
2435     if (0 != xcb_pad) {
2436         xcb_tmp += xcb_pad;
2437         xcb_pad = 0;
2438     }
2439     xcb_block_len = 0;
2440     /* blue */
2441     xcb_block_len += _aux->size * sizeof(uint16_t);
2442     xcb_tmp += xcb_block_len;
2443     xcb_align_to = ALIGNOF(uint16_t);
2444     /* insert padding */
2445     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2446     xcb_buffer_len += xcb_block_len + xcb_pad;
2447     if (0 != xcb_pad) {
2448         xcb_tmp += xcb_pad;
2449         xcb_pad = 0;
2450     }
2451     xcb_block_len = 0;
2452 
2453     return xcb_buffer_len;
2454 }
2455 
2456 xcb_randr_get_crtc_gamma_cookie_t
xcb_randr_get_crtc_gamma(xcb_connection_t * c,xcb_randr_crtc_t crtc)2457 xcb_randr_get_crtc_gamma (xcb_connection_t *c  /**< */,
2458                           xcb_randr_crtc_t  crtc  /**< */)
2459 {
2460     static const xcb_protocol_request_t xcb_req = {
2461         /* count */ 2,
2462         /* ext */ &xcb_randr_id,
2463         /* opcode */ XCB_RANDR_GET_CRTC_GAMMA,
2464         /* isvoid */ 0
2465     };
2466 
2467     struct iovec xcb_parts[4];
2468     xcb_randr_get_crtc_gamma_cookie_t xcb_ret;
2469     xcb_randr_get_crtc_gamma_request_t xcb_out;
2470 
2471     xcb_out.crtc = crtc;
2472 
2473     xcb_parts[2].iov_base = (char *) &xcb_out;
2474     xcb_parts[2].iov_len = sizeof(xcb_out);
2475     xcb_parts[3].iov_base = 0;
2476     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2477 
2478     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2479     return xcb_ret;
2480 }
2481 
2482 xcb_randr_get_crtc_gamma_cookie_t
xcb_randr_get_crtc_gamma_unchecked(xcb_connection_t * c,xcb_randr_crtc_t crtc)2483 xcb_randr_get_crtc_gamma_unchecked (xcb_connection_t *c  /**< */,
2484                                     xcb_randr_crtc_t  crtc  /**< */)
2485 {
2486     static const xcb_protocol_request_t xcb_req = {
2487         /* count */ 2,
2488         /* ext */ &xcb_randr_id,
2489         /* opcode */ XCB_RANDR_GET_CRTC_GAMMA,
2490         /* isvoid */ 0
2491     };
2492 
2493     struct iovec xcb_parts[4];
2494     xcb_randr_get_crtc_gamma_cookie_t xcb_ret;
2495     xcb_randr_get_crtc_gamma_request_t xcb_out;
2496 
2497     xcb_out.crtc = crtc;
2498 
2499     xcb_parts[2].iov_base = (char *) &xcb_out;
2500     xcb_parts[2].iov_len = sizeof(xcb_out);
2501     xcb_parts[3].iov_base = 0;
2502     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2503 
2504     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2505     return xcb_ret;
2506 }
2507 
2508 uint16_t *
xcb_randr_get_crtc_gamma_red(const xcb_randr_get_crtc_gamma_reply_t * R)2509 xcb_randr_get_crtc_gamma_red (const xcb_randr_get_crtc_gamma_reply_t *R  /**< */)
2510 {
2511     return (uint16_t *) (R + 1);
2512 }
2513 
2514 int
xcb_randr_get_crtc_gamma_red_length(const xcb_randr_get_crtc_gamma_reply_t * R)2515 xcb_randr_get_crtc_gamma_red_length (const xcb_randr_get_crtc_gamma_reply_t *R  /**< */)
2516 {
2517     return R->size;
2518 }
2519 
2520 xcb_generic_iterator_t
xcb_randr_get_crtc_gamma_red_end(const xcb_randr_get_crtc_gamma_reply_t * R)2521 xcb_randr_get_crtc_gamma_red_end (const xcb_randr_get_crtc_gamma_reply_t *R  /**< */)
2522 {
2523     xcb_generic_iterator_t i;
2524     i.data = ((uint16_t *) (R + 1)) + (R->size);
2525     i.rem = 0;
2526     i.index = (char *) i.data - (char *) R;
2527     return i;
2528 }
2529 
2530 uint16_t *
xcb_randr_get_crtc_gamma_green(const xcb_randr_get_crtc_gamma_reply_t * R)2531 xcb_randr_get_crtc_gamma_green (const xcb_randr_get_crtc_gamma_reply_t *R  /**< */)
2532 {
2533     xcb_generic_iterator_t prev = xcb_randr_get_crtc_gamma_red_end(R);
2534     return (uint16_t *) ((char *) prev.data + XCB_TYPE_PAD(uint16_t, prev.index) + 0);
2535 }
2536 
2537 int
xcb_randr_get_crtc_gamma_green_length(const xcb_randr_get_crtc_gamma_reply_t * R)2538 xcb_randr_get_crtc_gamma_green_length (const xcb_randr_get_crtc_gamma_reply_t *R  /**< */)
2539 {
2540     return R->size;
2541 }
2542 
2543 xcb_generic_iterator_t
xcb_randr_get_crtc_gamma_green_end(const xcb_randr_get_crtc_gamma_reply_t * R)2544 xcb_randr_get_crtc_gamma_green_end (const xcb_randr_get_crtc_gamma_reply_t *R  /**< */)
2545 {
2546     xcb_generic_iterator_t i;
2547     xcb_generic_iterator_t child = xcb_randr_get_crtc_gamma_red_end(R);
2548     i.data = ((uint16_t *) child.data) + (R->size);
2549     i.rem = 0;
2550     i.index = (char *) i.data - (char *) R;
2551     return i;
2552 }
2553 
2554 uint16_t *
xcb_randr_get_crtc_gamma_blue(const xcb_randr_get_crtc_gamma_reply_t * R)2555 xcb_randr_get_crtc_gamma_blue (const xcb_randr_get_crtc_gamma_reply_t *R  /**< */)
2556 {
2557     xcb_generic_iterator_t prev = xcb_randr_get_crtc_gamma_green_end(R);
2558     return (uint16_t *) ((char *) prev.data + XCB_TYPE_PAD(uint16_t, prev.index) + 0);
2559 }
2560 
2561 int
xcb_randr_get_crtc_gamma_blue_length(const xcb_randr_get_crtc_gamma_reply_t * R)2562 xcb_randr_get_crtc_gamma_blue_length (const xcb_randr_get_crtc_gamma_reply_t *R  /**< */)
2563 {
2564     return R->size;
2565 }
2566 
2567 xcb_generic_iterator_t
xcb_randr_get_crtc_gamma_blue_end(const xcb_randr_get_crtc_gamma_reply_t * R)2568 xcb_randr_get_crtc_gamma_blue_end (const xcb_randr_get_crtc_gamma_reply_t *R  /**< */)
2569 {
2570     xcb_generic_iterator_t i;
2571     xcb_generic_iterator_t child = xcb_randr_get_crtc_gamma_green_end(R);
2572     i.data = ((uint16_t *) child.data) + (R->size);
2573     i.rem = 0;
2574     i.index = (char *) i.data - (char *) R;
2575     return i;
2576 }
2577 
2578 xcb_randr_get_crtc_gamma_reply_t *
xcb_randr_get_crtc_gamma_reply(xcb_connection_t * c,xcb_randr_get_crtc_gamma_cookie_t cookie,xcb_generic_error_t ** e)2579 xcb_randr_get_crtc_gamma_reply (xcb_connection_t                   *c  /**< */,
2580                                 xcb_randr_get_crtc_gamma_cookie_t   cookie  /**< */,
2581                                 xcb_generic_error_t               **e  /**< */)
2582 {
2583     return (xcb_randr_get_crtc_gamma_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
2584 }
2585 
2586 int
xcb_randr_set_crtc_gamma_sizeof(const void * _buffer)2587 xcb_randr_set_crtc_gamma_sizeof (const void  *_buffer  /**< */)
2588 {
2589     char *xcb_tmp = (char *)_buffer;
2590     const xcb_randr_set_crtc_gamma_request_t *_aux = (xcb_randr_set_crtc_gamma_request_t *)_buffer;
2591     unsigned int xcb_buffer_len = 0;
2592     unsigned int xcb_block_len = 0;
2593     unsigned int xcb_pad = 0;
2594     unsigned int xcb_align_to = 0;
2595 
2596 
2597     xcb_block_len += sizeof(xcb_randr_set_crtc_gamma_request_t);
2598     xcb_tmp += xcb_block_len;
2599     xcb_buffer_len += xcb_block_len;
2600     xcb_block_len = 0;
2601     /* red */
2602     xcb_block_len += _aux->size * sizeof(uint16_t);
2603     xcb_tmp += xcb_block_len;
2604     xcb_align_to = ALIGNOF(uint16_t);
2605     /* insert padding */
2606     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2607     xcb_buffer_len += xcb_block_len + xcb_pad;
2608     if (0 != xcb_pad) {
2609         xcb_tmp += xcb_pad;
2610         xcb_pad = 0;
2611     }
2612     xcb_block_len = 0;
2613     /* green */
2614     xcb_block_len += _aux->size * sizeof(uint16_t);
2615     xcb_tmp += xcb_block_len;
2616     xcb_align_to = ALIGNOF(uint16_t);
2617     /* insert padding */
2618     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2619     xcb_buffer_len += xcb_block_len + xcb_pad;
2620     if (0 != xcb_pad) {
2621         xcb_tmp += xcb_pad;
2622         xcb_pad = 0;
2623     }
2624     xcb_block_len = 0;
2625     /* blue */
2626     xcb_block_len += _aux->size * sizeof(uint16_t);
2627     xcb_tmp += xcb_block_len;
2628     xcb_align_to = ALIGNOF(uint16_t);
2629     /* insert padding */
2630     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2631     xcb_buffer_len += xcb_block_len + xcb_pad;
2632     if (0 != xcb_pad) {
2633         xcb_tmp += xcb_pad;
2634         xcb_pad = 0;
2635     }
2636     xcb_block_len = 0;
2637 
2638     return xcb_buffer_len;
2639 }
2640 
2641 xcb_void_cookie_t
xcb_randr_set_crtc_gamma_checked(xcb_connection_t * c,xcb_randr_crtc_t crtc,uint16_t size,const uint16_t * red,const uint16_t * green,const uint16_t * blue)2642 xcb_randr_set_crtc_gamma_checked (xcb_connection_t *c  /**< */,
2643                                   xcb_randr_crtc_t  crtc  /**< */,
2644                                   uint16_t          size  /**< */,
2645                                   const uint16_t   *red  /**< */,
2646                                   const uint16_t   *green  /**< */,
2647                                   const uint16_t   *blue  /**< */)
2648 {
2649     static const xcb_protocol_request_t xcb_req = {
2650         /* count */ 8,
2651         /* ext */ &xcb_randr_id,
2652         /* opcode */ XCB_RANDR_SET_CRTC_GAMMA,
2653         /* isvoid */ 1
2654     };
2655 
2656     struct iovec xcb_parts[10];
2657     xcb_void_cookie_t xcb_ret;
2658     xcb_randr_set_crtc_gamma_request_t xcb_out;
2659 
2660     xcb_out.crtc = crtc;
2661     xcb_out.size = size;
2662     memset(xcb_out.pad0, 0, 2);
2663 
2664     xcb_parts[2].iov_base = (char *) &xcb_out;
2665     xcb_parts[2].iov_len = sizeof(xcb_out);
2666     xcb_parts[3].iov_base = 0;
2667     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2668     /* uint16_t red */
2669     xcb_parts[4].iov_base = (char *) red;
2670     xcb_parts[4].iov_len = size * sizeof(uint16_t);
2671     xcb_parts[5].iov_base = 0;
2672     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
2673     /* uint16_t green */
2674     xcb_parts[6].iov_base = (char *) green;
2675     xcb_parts[6].iov_len = size * sizeof(uint16_t);
2676     xcb_parts[7].iov_base = 0;
2677     xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3;
2678     /* uint16_t blue */
2679     xcb_parts[8].iov_base = (char *) blue;
2680     xcb_parts[8].iov_len = size * sizeof(uint16_t);
2681     xcb_parts[9].iov_base = 0;
2682     xcb_parts[9].iov_len = -xcb_parts[8].iov_len & 3;
2683 
2684     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2685     return xcb_ret;
2686 }
2687 
2688 xcb_void_cookie_t
xcb_randr_set_crtc_gamma(xcb_connection_t * c,xcb_randr_crtc_t crtc,uint16_t size,const uint16_t * red,const uint16_t * green,const uint16_t * blue)2689 xcb_randr_set_crtc_gamma (xcb_connection_t *c  /**< */,
2690                           xcb_randr_crtc_t  crtc  /**< */,
2691                           uint16_t          size  /**< */,
2692                           const uint16_t   *red  /**< */,
2693                           const uint16_t   *green  /**< */,
2694                           const uint16_t   *blue  /**< */)
2695 {
2696     static const xcb_protocol_request_t xcb_req = {
2697         /* count */ 8,
2698         /* ext */ &xcb_randr_id,
2699         /* opcode */ XCB_RANDR_SET_CRTC_GAMMA,
2700         /* isvoid */ 1
2701     };
2702 
2703     struct iovec xcb_parts[10];
2704     xcb_void_cookie_t xcb_ret;
2705     xcb_randr_set_crtc_gamma_request_t xcb_out;
2706 
2707     xcb_out.crtc = crtc;
2708     xcb_out.size = size;
2709     memset(xcb_out.pad0, 0, 2);
2710 
2711     xcb_parts[2].iov_base = (char *) &xcb_out;
2712     xcb_parts[2].iov_len = sizeof(xcb_out);
2713     xcb_parts[3].iov_base = 0;
2714     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2715     /* uint16_t red */
2716     xcb_parts[4].iov_base = (char *) red;
2717     xcb_parts[4].iov_len = size * sizeof(uint16_t);
2718     xcb_parts[5].iov_base = 0;
2719     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
2720     /* uint16_t green */
2721     xcb_parts[6].iov_base = (char *) green;
2722     xcb_parts[6].iov_len = size * sizeof(uint16_t);
2723     xcb_parts[7].iov_base = 0;
2724     xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3;
2725     /* uint16_t blue */
2726     xcb_parts[8].iov_base = (char *) blue;
2727     xcb_parts[8].iov_len = size * sizeof(uint16_t);
2728     xcb_parts[9].iov_base = 0;
2729     xcb_parts[9].iov_len = -xcb_parts[8].iov_len & 3;
2730 
2731     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2732     return xcb_ret;
2733 }
2734 
2735 int
xcb_randr_get_screen_resources_current_sizeof(const void * _buffer)2736 xcb_randr_get_screen_resources_current_sizeof (const void  *_buffer  /**< */)
2737 {
2738     char *xcb_tmp = (char *)_buffer;
2739     const xcb_randr_get_screen_resources_current_reply_t *_aux = (xcb_randr_get_screen_resources_current_reply_t *)_buffer;
2740     unsigned int xcb_buffer_len = 0;
2741     unsigned int xcb_block_len = 0;
2742     unsigned int xcb_pad = 0;
2743     unsigned int xcb_align_to = 0;
2744 
2745 
2746     xcb_block_len += sizeof(xcb_randr_get_screen_resources_current_reply_t);
2747     xcb_tmp += xcb_block_len;
2748     xcb_buffer_len += xcb_block_len;
2749     xcb_block_len = 0;
2750     /* crtcs */
2751     xcb_block_len += _aux->num_crtcs * sizeof(uint32_t);
2752     xcb_tmp += xcb_block_len;
2753     xcb_align_to = ALIGNOF(xcb_randr_crtc_t);
2754     /* insert padding */
2755     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2756     xcb_buffer_len += xcb_block_len + xcb_pad;
2757     if (0 != xcb_pad) {
2758         xcb_tmp += xcb_pad;
2759         xcb_pad = 0;
2760     }
2761     xcb_block_len = 0;
2762     /* outputs */
2763     xcb_block_len += _aux->num_outputs * sizeof(uint32_t);
2764     xcb_tmp += xcb_block_len;
2765     xcb_align_to = ALIGNOF(xcb_randr_output_t);
2766     /* insert padding */
2767     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2768     xcb_buffer_len += xcb_block_len + xcb_pad;
2769     if (0 != xcb_pad) {
2770         xcb_tmp += xcb_pad;
2771         xcb_pad = 0;
2772     }
2773     xcb_block_len = 0;
2774     /* modes */
2775     xcb_block_len += _aux->num_modes * sizeof(xcb_randr_mode_info_t);
2776     xcb_tmp += xcb_block_len;
2777     xcb_align_to = ALIGNOF(xcb_randr_mode_info_t);
2778     /* insert padding */
2779     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2780     xcb_buffer_len += xcb_block_len + xcb_pad;
2781     if (0 != xcb_pad) {
2782         xcb_tmp += xcb_pad;
2783         xcb_pad = 0;
2784     }
2785     xcb_block_len = 0;
2786     /* names */
2787     xcb_block_len += _aux->names_len * sizeof(uint8_t);
2788     xcb_tmp += xcb_block_len;
2789     xcb_align_to = ALIGNOF(uint8_t);
2790     /* insert padding */
2791     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2792     xcb_buffer_len += xcb_block_len + xcb_pad;
2793     if (0 != xcb_pad) {
2794         xcb_tmp += xcb_pad;
2795         xcb_pad = 0;
2796     }
2797     xcb_block_len = 0;
2798 
2799     return xcb_buffer_len;
2800 }
2801 
2802 xcb_randr_get_screen_resources_current_cookie_t
xcb_randr_get_screen_resources_current(xcb_connection_t * c,xcb_window_t window)2803 xcb_randr_get_screen_resources_current (xcb_connection_t *c  /**< */,
2804                                         xcb_window_t      window  /**< */)
2805 {
2806     static const xcb_protocol_request_t xcb_req = {
2807         /* count */ 2,
2808         /* ext */ &xcb_randr_id,
2809         /* opcode */ XCB_RANDR_GET_SCREEN_RESOURCES_CURRENT,
2810         /* isvoid */ 0
2811     };
2812 
2813     struct iovec xcb_parts[4];
2814     xcb_randr_get_screen_resources_current_cookie_t xcb_ret;
2815     xcb_randr_get_screen_resources_current_request_t xcb_out;
2816 
2817     xcb_out.window = window;
2818 
2819     xcb_parts[2].iov_base = (char *) &xcb_out;
2820     xcb_parts[2].iov_len = sizeof(xcb_out);
2821     xcb_parts[3].iov_base = 0;
2822     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2823 
2824     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2825     return xcb_ret;
2826 }
2827 
2828 xcb_randr_get_screen_resources_current_cookie_t
xcb_randr_get_screen_resources_current_unchecked(xcb_connection_t * c,xcb_window_t window)2829 xcb_randr_get_screen_resources_current_unchecked (xcb_connection_t *c  /**< */,
2830                                                   xcb_window_t      window  /**< */)
2831 {
2832     static const xcb_protocol_request_t xcb_req = {
2833         /* count */ 2,
2834         /* ext */ &xcb_randr_id,
2835         /* opcode */ XCB_RANDR_GET_SCREEN_RESOURCES_CURRENT,
2836         /* isvoid */ 0
2837     };
2838 
2839     struct iovec xcb_parts[4];
2840     xcb_randr_get_screen_resources_current_cookie_t xcb_ret;
2841     xcb_randr_get_screen_resources_current_request_t xcb_out;
2842 
2843     xcb_out.window = window;
2844 
2845     xcb_parts[2].iov_base = (char *) &xcb_out;
2846     xcb_parts[2].iov_len = sizeof(xcb_out);
2847     xcb_parts[3].iov_base = 0;
2848     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2849 
2850     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2851     return xcb_ret;
2852 }
2853 
2854 xcb_randr_crtc_t *
xcb_randr_get_screen_resources_current_crtcs(const xcb_randr_get_screen_resources_current_reply_t * R)2855 xcb_randr_get_screen_resources_current_crtcs (const xcb_randr_get_screen_resources_current_reply_t *R  /**< */)
2856 {
2857     return (xcb_randr_crtc_t *) (R + 1);
2858 }
2859 
2860 int
xcb_randr_get_screen_resources_current_crtcs_length(const xcb_randr_get_screen_resources_current_reply_t * R)2861 xcb_randr_get_screen_resources_current_crtcs_length (const xcb_randr_get_screen_resources_current_reply_t *R  /**< */)
2862 {
2863     return R->num_crtcs;
2864 }
2865 
2866 xcb_generic_iterator_t
xcb_randr_get_screen_resources_current_crtcs_end(const xcb_randr_get_screen_resources_current_reply_t * R)2867 xcb_randr_get_screen_resources_current_crtcs_end (const xcb_randr_get_screen_resources_current_reply_t *R  /**< */)
2868 {
2869     xcb_generic_iterator_t i;
2870     i.data = ((xcb_randr_crtc_t *) (R + 1)) + (R->num_crtcs);
2871     i.rem = 0;
2872     i.index = (char *) i.data - (char *) R;
2873     return i;
2874 }
2875 
2876 xcb_randr_output_t *
xcb_randr_get_screen_resources_current_outputs(const xcb_randr_get_screen_resources_current_reply_t * R)2877 xcb_randr_get_screen_resources_current_outputs (const xcb_randr_get_screen_resources_current_reply_t *R  /**< */)
2878 {
2879     xcb_generic_iterator_t prev = xcb_randr_get_screen_resources_current_crtcs_end(R);
2880     return (xcb_randr_output_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_randr_output_t, prev.index) + 0);
2881 }
2882 
2883 int
xcb_randr_get_screen_resources_current_outputs_length(const xcb_randr_get_screen_resources_current_reply_t * R)2884 xcb_randr_get_screen_resources_current_outputs_length (const xcb_randr_get_screen_resources_current_reply_t *R  /**< */)
2885 {
2886     return R->num_outputs;
2887 }
2888 
2889 xcb_generic_iterator_t
xcb_randr_get_screen_resources_current_outputs_end(const xcb_randr_get_screen_resources_current_reply_t * R)2890 xcb_randr_get_screen_resources_current_outputs_end (const xcb_randr_get_screen_resources_current_reply_t *R  /**< */)
2891 {
2892     xcb_generic_iterator_t i;
2893     xcb_generic_iterator_t child = xcb_randr_get_screen_resources_current_crtcs_end(R);
2894     i.data = ((xcb_randr_output_t *) child.data) + (R->num_outputs);
2895     i.rem = 0;
2896     i.index = (char *) i.data - (char *) R;
2897     return i;
2898 }
2899 
2900 xcb_randr_mode_info_t *
xcb_randr_get_screen_resources_current_modes(const xcb_randr_get_screen_resources_current_reply_t * R)2901 xcb_randr_get_screen_resources_current_modes (const xcb_randr_get_screen_resources_current_reply_t *R  /**< */)
2902 {
2903     xcb_generic_iterator_t prev = xcb_randr_get_screen_resources_current_outputs_end(R);
2904     return (xcb_randr_mode_info_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_randr_mode_info_t, prev.index) + 0);
2905 }
2906 
2907 int
xcb_randr_get_screen_resources_current_modes_length(const xcb_randr_get_screen_resources_current_reply_t * R)2908 xcb_randr_get_screen_resources_current_modes_length (const xcb_randr_get_screen_resources_current_reply_t *R  /**< */)
2909 {
2910     return R->num_modes;
2911 }
2912 
2913 xcb_randr_mode_info_iterator_t
xcb_randr_get_screen_resources_current_modes_iterator(const xcb_randr_get_screen_resources_current_reply_t * R)2914 xcb_randr_get_screen_resources_current_modes_iterator (const xcb_randr_get_screen_resources_current_reply_t *R  /**< */)
2915 {
2916     xcb_randr_mode_info_iterator_t i;
2917     xcb_generic_iterator_t prev = xcb_randr_get_screen_resources_current_outputs_end(R);
2918     i.data = (xcb_randr_mode_info_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_randr_mode_info_t, prev.index));
2919     i.rem = R->num_modes;
2920     i.index = (char *) i.data - (char *) R;
2921     return i;
2922 }
2923 
2924 uint8_t *
xcb_randr_get_screen_resources_current_names(const xcb_randr_get_screen_resources_current_reply_t * R)2925 xcb_randr_get_screen_resources_current_names (const xcb_randr_get_screen_resources_current_reply_t *R  /**< */)
2926 {
2927     xcb_generic_iterator_t prev = xcb_randr_mode_info_end(xcb_randr_get_screen_resources_current_modes_iterator(R));
2928     return (uint8_t *) ((char *) prev.data + XCB_TYPE_PAD(uint8_t, prev.index) + 0);
2929 }
2930 
2931 int
xcb_randr_get_screen_resources_current_names_length(const xcb_randr_get_screen_resources_current_reply_t * R)2932 xcb_randr_get_screen_resources_current_names_length (const xcb_randr_get_screen_resources_current_reply_t *R  /**< */)
2933 {
2934     return R->names_len;
2935 }
2936 
2937 xcb_generic_iterator_t
xcb_randr_get_screen_resources_current_names_end(const xcb_randr_get_screen_resources_current_reply_t * R)2938 xcb_randr_get_screen_resources_current_names_end (const xcb_randr_get_screen_resources_current_reply_t *R  /**< */)
2939 {
2940     xcb_generic_iterator_t i;
2941     xcb_generic_iterator_t child = xcb_randr_mode_info_end(xcb_randr_get_screen_resources_current_modes_iterator(R));
2942     i.data = ((uint8_t *) child.data) + (R->names_len);
2943     i.rem = 0;
2944     i.index = (char *) i.data - (char *) R;
2945     return i;
2946 }
2947 
2948 xcb_randr_get_screen_resources_current_reply_t *
xcb_randr_get_screen_resources_current_reply(xcb_connection_t * c,xcb_randr_get_screen_resources_current_cookie_t cookie,xcb_generic_error_t ** e)2949 xcb_randr_get_screen_resources_current_reply (xcb_connection_t                                 *c  /**< */,
2950                                               xcb_randr_get_screen_resources_current_cookie_t   cookie  /**< */,
2951                                               xcb_generic_error_t                             **e  /**< */)
2952 {
2953     return (xcb_randr_get_screen_resources_current_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
2954 }
2955 
2956 int
xcb_randr_set_crtc_transform_sizeof(const void * _buffer,uint32_t filter_params_len)2957 xcb_randr_set_crtc_transform_sizeof (const void  *_buffer  /**< */,
2958                                      uint32_t     filter_params_len  /**< */)
2959 {
2960     char *xcb_tmp = (char *)_buffer;
2961     const xcb_randr_set_crtc_transform_request_t *_aux = (xcb_randr_set_crtc_transform_request_t *)_buffer;
2962     unsigned int xcb_buffer_len = 0;
2963     unsigned int xcb_block_len = 0;
2964     unsigned int xcb_pad = 0;
2965     unsigned int xcb_align_to = 0;
2966 
2967 
2968     xcb_block_len += sizeof(xcb_randr_set_crtc_transform_request_t);
2969     xcb_tmp += xcb_block_len;
2970     xcb_buffer_len += xcb_block_len;
2971     xcb_block_len = 0;
2972     /* filter_name */
2973     xcb_block_len += _aux->filter_len * sizeof(char);
2974     xcb_tmp += xcb_block_len;
2975     xcb_align_to = ALIGNOF(char);
2976     /* insert padding */
2977     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2978     xcb_buffer_len += xcb_block_len + xcb_pad;
2979     if (0 != xcb_pad) {
2980         xcb_tmp += xcb_pad;
2981         xcb_pad = 0;
2982     }
2983     xcb_block_len = 0;
2984     /* filter_params */
2985     xcb_block_len += filter_params_len * sizeof(xcb_render_fixed_t);
2986     xcb_tmp += xcb_block_len;
2987     xcb_align_to = ALIGNOF(xcb_render_fixed_t);
2988     /* insert padding */
2989     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2990     xcb_buffer_len += xcb_block_len + xcb_pad;
2991     if (0 != xcb_pad) {
2992         xcb_tmp += xcb_pad;
2993         xcb_pad = 0;
2994     }
2995     xcb_block_len = 0;
2996 
2997     return xcb_buffer_len;
2998 }
2999 
3000 xcb_void_cookie_t
xcb_randr_set_crtc_transform_checked(xcb_connection_t * c,xcb_randr_crtc_t crtc,xcb_render_transform_t transform,uint16_t filter_len,const char * filter_name,uint32_t filter_params_len,const xcb_render_fixed_t * filter_params)3001 xcb_randr_set_crtc_transform_checked (xcb_connection_t         *c  /**< */,
3002                                       xcb_randr_crtc_t          crtc  /**< */,
3003                                       xcb_render_transform_t    transform  /**< */,
3004                                       uint16_t                  filter_len  /**< */,
3005                                       const char               *filter_name  /**< */,
3006                                       uint32_t                  filter_params_len  /**< */,
3007                                       const xcb_render_fixed_t *filter_params  /**< */)
3008 {
3009     static const xcb_protocol_request_t xcb_req = {
3010         /* count */ 6,
3011         /* ext */ &xcb_randr_id,
3012         /* opcode */ XCB_RANDR_SET_CRTC_TRANSFORM,
3013         /* isvoid */ 1
3014     };
3015 
3016     struct iovec xcb_parts[8];
3017     xcb_void_cookie_t xcb_ret;
3018     xcb_randr_set_crtc_transform_request_t xcb_out;
3019 
3020     xcb_out.crtc = crtc;
3021     xcb_out.transform = transform;
3022     xcb_out.filter_len = filter_len;
3023     memset(xcb_out.pad0, 0, 2);
3024 
3025     xcb_parts[2].iov_base = (char *) &xcb_out;
3026     xcb_parts[2].iov_len = sizeof(xcb_out);
3027     xcb_parts[3].iov_base = 0;
3028     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3029     /* char filter_name */
3030     xcb_parts[4].iov_base = (char *) filter_name;
3031     xcb_parts[4].iov_len = filter_len * sizeof(char);
3032     xcb_parts[5].iov_base = 0;
3033     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
3034     /* xcb_render_fixed_t filter_params */
3035     xcb_parts[6].iov_base = (char *) filter_params;
3036     xcb_parts[6].iov_len = filter_params_len * sizeof(xcb_render_fixed_t);
3037     xcb_parts[7].iov_base = 0;
3038     xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3;
3039 
3040     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3041     return xcb_ret;
3042 }
3043 
3044 xcb_void_cookie_t
xcb_randr_set_crtc_transform(xcb_connection_t * c,xcb_randr_crtc_t crtc,xcb_render_transform_t transform,uint16_t filter_len,const char * filter_name,uint32_t filter_params_len,const xcb_render_fixed_t * filter_params)3045 xcb_randr_set_crtc_transform (xcb_connection_t         *c  /**< */,
3046                               xcb_randr_crtc_t          crtc  /**< */,
3047                               xcb_render_transform_t    transform  /**< */,
3048                               uint16_t                  filter_len  /**< */,
3049                               const char               *filter_name  /**< */,
3050                               uint32_t                  filter_params_len  /**< */,
3051                               const xcb_render_fixed_t *filter_params  /**< */)
3052 {
3053     static const xcb_protocol_request_t xcb_req = {
3054         /* count */ 6,
3055         /* ext */ &xcb_randr_id,
3056         /* opcode */ XCB_RANDR_SET_CRTC_TRANSFORM,
3057         /* isvoid */ 1
3058     };
3059 
3060     struct iovec xcb_parts[8];
3061     xcb_void_cookie_t xcb_ret;
3062     xcb_randr_set_crtc_transform_request_t xcb_out;
3063 
3064     xcb_out.crtc = crtc;
3065     xcb_out.transform = transform;
3066     xcb_out.filter_len = filter_len;
3067     memset(xcb_out.pad0, 0, 2);
3068 
3069     xcb_parts[2].iov_base = (char *) &xcb_out;
3070     xcb_parts[2].iov_len = sizeof(xcb_out);
3071     xcb_parts[3].iov_base = 0;
3072     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3073     /* char filter_name */
3074     xcb_parts[4].iov_base = (char *) filter_name;
3075     xcb_parts[4].iov_len = filter_len * sizeof(char);
3076     xcb_parts[5].iov_base = 0;
3077     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
3078     /* xcb_render_fixed_t filter_params */
3079     xcb_parts[6].iov_base = (char *) filter_params;
3080     xcb_parts[6].iov_len = filter_params_len * sizeof(xcb_render_fixed_t);
3081     xcb_parts[7].iov_base = 0;
3082     xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3;
3083 
3084     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3085     return xcb_ret;
3086 }
3087 
3088 int
xcb_randr_get_crtc_transform_sizeof(const void * _buffer)3089 xcb_randr_get_crtc_transform_sizeof (const void  *_buffer  /**< */)
3090 {
3091     char *xcb_tmp = (char *)_buffer;
3092     const xcb_randr_get_crtc_transform_reply_t *_aux = (xcb_randr_get_crtc_transform_reply_t *)_buffer;
3093     unsigned int xcb_buffer_len = 0;
3094     unsigned int xcb_block_len = 0;
3095     unsigned int xcb_pad = 0;
3096     unsigned int xcb_align_to = 0;
3097 
3098 
3099     xcb_block_len += sizeof(xcb_randr_get_crtc_transform_reply_t);
3100     xcb_tmp += xcb_block_len;
3101     xcb_buffer_len += xcb_block_len;
3102     xcb_block_len = 0;
3103     /* pending_filter_name */
3104     xcb_block_len += _aux->pending_len * sizeof(char);
3105     xcb_tmp += xcb_block_len;
3106     xcb_align_to = ALIGNOF(char);
3107     /* insert padding */
3108     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3109     xcb_buffer_len += xcb_block_len + xcb_pad;
3110     if (0 != xcb_pad) {
3111         xcb_tmp += xcb_pad;
3112         xcb_pad = 0;
3113     }
3114     xcb_block_len = 0;
3115     /* pending_params */
3116     xcb_block_len += _aux->pending_nparams * sizeof(xcb_render_fixed_t);
3117     xcb_tmp += xcb_block_len;
3118     xcb_align_to = ALIGNOF(xcb_render_fixed_t);
3119     /* insert padding */
3120     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3121     xcb_buffer_len += xcb_block_len + xcb_pad;
3122     if (0 != xcb_pad) {
3123         xcb_tmp += xcb_pad;
3124         xcb_pad = 0;
3125     }
3126     xcb_block_len = 0;
3127     /* current_filter_name */
3128     xcb_block_len += _aux->current_len * sizeof(char);
3129     xcb_tmp += xcb_block_len;
3130     xcb_align_to = ALIGNOF(char);
3131     /* insert padding */
3132     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3133     xcb_buffer_len += xcb_block_len + xcb_pad;
3134     if (0 != xcb_pad) {
3135         xcb_tmp += xcb_pad;
3136         xcb_pad = 0;
3137     }
3138     xcb_block_len = 0;
3139     /* current_params */
3140     xcb_block_len += _aux->current_nparams * sizeof(xcb_render_fixed_t);
3141     xcb_tmp += xcb_block_len;
3142     xcb_align_to = ALIGNOF(xcb_render_fixed_t);
3143     /* insert padding */
3144     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3145     xcb_buffer_len += xcb_block_len + xcb_pad;
3146     if (0 != xcb_pad) {
3147         xcb_tmp += xcb_pad;
3148         xcb_pad = 0;
3149     }
3150     xcb_block_len = 0;
3151 
3152     return xcb_buffer_len;
3153 }
3154 
3155 xcb_randr_get_crtc_transform_cookie_t
xcb_randr_get_crtc_transform(xcb_connection_t * c,xcb_randr_crtc_t crtc)3156 xcb_randr_get_crtc_transform (xcb_connection_t *c  /**< */,
3157                               xcb_randr_crtc_t  crtc  /**< */)
3158 {
3159     static const xcb_protocol_request_t xcb_req = {
3160         /* count */ 2,
3161         /* ext */ &xcb_randr_id,
3162         /* opcode */ XCB_RANDR_GET_CRTC_TRANSFORM,
3163         /* isvoid */ 0
3164     };
3165 
3166     struct iovec xcb_parts[4];
3167     xcb_randr_get_crtc_transform_cookie_t xcb_ret;
3168     xcb_randr_get_crtc_transform_request_t xcb_out;
3169 
3170     xcb_out.crtc = crtc;
3171 
3172     xcb_parts[2].iov_base = (char *) &xcb_out;
3173     xcb_parts[2].iov_len = sizeof(xcb_out);
3174     xcb_parts[3].iov_base = 0;
3175     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3176 
3177     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3178     return xcb_ret;
3179 }
3180 
3181 xcb_randr_get_crtc_transform_cookie_t
xcb_randr_get_crtc_transform_unchecked(xcb_connection_t * c,xcb_randr_crtc_t crtc)3182 xcb_randr_get_crtc_transform_unchecked (xcb_connection_t *c  /**< */,
3183                                         xcb_randr_crtc_t  crtc  /**< */)
3184 {
3185     static const xcb_protocol_request_t xcb_req = {
3186         /* count */ 2,
3187         /* ext */ &xcb_randr_id,
3188         /* opcode */ XCB_RANDR_GET_CRTC_TRANSFORM,
3189         /* isvoid */ 0
3190     };
3191 
3192     struct iovec xcb_parts[4];
3193     xcb_randr_get_crtc_transform_cookie_t xcb_ret;
3194     xcb_randr_get_crtc_transform_request_t xcb_out;
3195 
3196     xcb_out.crtc = crtc;
3197 
3198     xcb_parts[2].iov_base = (char *) &xcb_out;
3199     xcb_parts[2].iov_len = sizeof(xcb_out);
3200     xcb_parts[3].iov_base = 0;
3201     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3202 
3203     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3204     return xcb_ret;
3205 }
3206 
3207 char *
xcb_randr_get_crtc_transform_pending_filter_name(const xcb_randr_get_crtc_transform_reply_t * R)3208 xcb_randr_get_crtc_transform_pending_filter_name (const xcb_randr_get_crtc_transform_reply_t *R  /**< */)
3209 {
3210     return (char *) (R + 1);
3211 }
3212 
3213 int
xcb_randr_get_crtc_transform_pending_filter_name_length(const xcb_randr_get_crtc_transform_reply_t * R)3214 xcb_randr_get_crtc_transform_pending_filter_name_length (const xcb_randr_get_crtc_transform_reply_t *R  /**< */)
3215 {
3216     return R->pending_len;
3217 }
3218 
3219 xcb_generic_iterator_t
xcb_randr_get_crtc_transform_pending_filter_name_end(const xcb_randr_get_crtc_transform_reply_t * R)3220 xcb_randr_get_crtc_transform_pending_filter_name_end (const xcb_randr_get_crtc_transform_reply_t *R  /**< */)
3221 {
3222     xcb_generic_iterator_t i;
3223     i.data = ((char *) (R + 1)) + (R->pending_len);
3224     i.rem = 0;
3225     i.index = (char *) i.data - (char *) R;
3226     return i;
3227 }
3228 
3229 xcb_render_fixed_t *
xcb_randr_get_crtc_transform_pending_params(const xcb_randr_get_crtc_transform_reply_t * R)3230 xcb_randr_get_crtc_transform_pending_params (const xcb_randr_get_crtc_transform_reply_t *R  /**< */)
3231 {
3232     xcb_generic_iterator_t prev = xcb_randr_get_crtc_transform_pending_filter_name_end(R);
3233     return (xcb_render_fixed_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_render_fixed_t, prev.index) + 0);
3234 }
3235 
3236 int
xcb_randr_get_crtc_transform_pending_params_length(const xcb_randr_get_crtc_transform_reply_t * R)3237 xcb_randr_get_crtc_transform_pending_params_length (const xcb_randr_get_crtc_transform_reply_t *R  /**< */)
3238 {
3239     return R->pending_nparams;
3240 }
3241 
3242 xcb_generic_iterator_t
xcb_randr_get_crtc_transform_pending_params_end(const xcb_randr_get_crtc_transform_reply_t * R)3243 xcb_randr_get_crtc_transform_pending_params_end (const xcb_randr_get_crtc_transform_reply_t *R  /**< */)
3244 {
3245     xcb_generic_iterator_t i;
3246     xcb_generic_iterator_t child = xcb_randr_get_crtc_transform_pending_filter_name_end(R);
3247     i.data = ((xcb_render_fixed_t *) child.data) + (R->pending_nparams);
3248     i.rem = 0;
3249     i.index = (char *) i.data - (char *) R;
3250     return i;
3251 }
3252 
3253 char *
xcb_randr_get_crtc_transform_current_filter_name(const xcb_randr_get_crtc_transform_reply_t * R)3254 xcb_randr_get_crtc_transform_current_filter_name (const xcb_randr_get_crtc_transform_reply_t *R  /**< */)
3255 {
3256     xcb_generic_iterator_t prev = xcb_randr_get_crtc_transform_pending_params_end(R);
3257     return (char *) ((char *) prev.data + XCB_TYPE_PAD(char, prev.index) + 0);
3258 }
3259 
3260 int
xcb_randr_get_crtc_transform_current_filter_name_length(const xcb_randr_get_crtc_transform_reply_t * R)3261 xcb_randr_get_crtc_transform_current_filter_name_length (const xcb_randr_get_crtc_transform_reply_t *R  /**< */)
3262 {
3263     return R->current_len;
3264 }
3265 
3266 xcb_generic_iterator_t
xcb_randr_get_crtc_transform_current_filter_name_end(const xcb_randr_get_crtc_transform_reply_t * R)3267 xcb_randr_get_crtc_transform_current_filter_name_end (const xcb_randr_get_crtc_transform_reply_t *R  /**< */)
3268 {
3269     xcb_generic_iterator_t i;
3270     xcb_generic_iterator_t child = xcb_randr_get_crtc_transform_pending_params_end(R);
3271     i.data = ((char *) child.data) + (R->current_len);
3272     i.rem = 0;
3273     i.index = (char *) i.data - (char *) R;
3274     return i;
3275 }
3276 
3277 xcb_render_fixed_t *
xcb_randr_get_crtc_transform_current_params(const xcb_randr_get_crtc_transform_reply_t * R)3278 xcb_randr_get_crtc_transform_current_params (const xcb_randr_get_crtc_transform_reply_t *R  /**< */)
3279 {
3280     xcb_generic_iterator_t prev = xcb_randr_get_crtc_transform_current_filter_name_end(R);
3281     return (xcb_render_fixed_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_render_fixed_t, prev.index) + 0);
3282 }
3283 
3284 int
xcb_randr_get_crtc_transform_current_params_length(const xcb_randr_get_crtc_transform_reply_t * R)3285 xcb_randr_get_crtc_transform_current_params_length (const xcb_randr_get_crtc_transform_reply_t *R  /**< */)
3286 {
3287     return R->current_nparams;
3288 }
3289 
3290 xcb_generic_iterator_t
xcb_randr_get_crtc_transform_current_params_end(const xcb_randr_get_crtc_transform_reply_t * R)3291 xcb_randr_get_crtc_transform_current_params_end (const xcb_randr_get_crtc_transform_reply_t *R  /**< */)
3292 {
3293     xcb_generic_iterator_t i;
3294     xcb_generic_iterator_t child = xcb_randr_get_crtc_transform_current_filter_name_end(R);
3295     i.data = ((xcb_render_fixed_t *) child.data) + (R->current_nparams);
3296     i.rem = 0;
3297     i.index = (char *) i.data - (char *) R;
3298     return i;
3299 }
3300 
3301 xcb_randr_get_crtc_transform_reply_t *
xcb_randr_get_crtc_transform_reply(xcb_connection_t * c,xcb_randr_get_crtc_transform_cookie_t cookie,xcb_generic_error_t ** e)3302 xcb_randr_get_crtc_transform_reply (xcb_connection_t                       *c  /**< */,
3303                                     xcb_randr_get_crtc_transform_cookie_t   cookie  /**< */,
3304                                     xcb_generic_error_t                   **e  /**< */)
3305 {
3306     return (xcb_randr_get_crtc_transform_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
3307 }
3308 
3309 xcb_randr_get_panning_cookie_t
xcb_randr_get_panning(xcb_connection_t * c,xcb_randr_crtc_t crtc)3310 xcb_randr_get_panning (xcb_connection_t *c  /**< */,
3311                        xcb_randr_crtc_t  crtc  /**< */)
3312 {
3313     static const xcb_protocol_request_t xcb_req = {
3314         /* count */ 2,
3315         /* ext */ &xcb_randr_id,
3316         /* opcode */ XCB_RANDR_GET_PANNING,
3317         /* isvoid */ 0
3318     };
3319 
3320     struct iovec xcb_parts[4];
3321     xcb_randr_get_panning_cookie_t xcb_ret;
3322     xcb_randr_get_panning_request_t xcb_out;
3323 
3324     xcb_out.crtc = crtc;
3325 
3326     xcb_parts[2].iov_base = (char *) &xcb_out;
3327     xcb_parts[2].iov_len = sizeof(xcb_out);
3328     xcb_parts[3].iov_base = 0;
3329     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3330 
3331     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3332     return xcb_ret;
3333 }
3334 
3335 xcb_randr_get_panning_cookie_t
xcb_randr_get_panning_unchecked(xcb_connection_t * c,xcb_randr_crtc_t crtc)3336 xcb_randr_get_panning_unchecked (xcb_connection_t *c  /**< */,
3337                                  xcb_randr_crtc_t  crtc  /**< */)
3338 {
3339     static const xcb_protocol_request_t xcb_req = {
3340         /* count */ 2,
3341         /* ext */ &xcb_randr_id,
3342         /* opcode */ XCB_RANDR_GET_PANNING,
3343         /* isvoid */ 0
3344     };
3345 
3346     struct iovec xcb_parts[4];
3347     xcb_randr_get_panning_cookie_t xcb_ret;
3348     xcb_randr_get_panning_request_t xcb_out;
3349 
3350     xcb_out.crtc = crtc;
3351 
3352     xcb_parts[2].iov_base = (char *) &xcb_out;
3353     xcb_parts[2].iov_len = sizeof(xcb_out);
3354     xcb_parts[3].iov_base = 0;
3355     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3356 
3357     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3358     return xcb_ret;
3359 }
3360 
3361 xcb_randr_get_panning_reply_t *
xcb_randr_get_panning_reply(xcb_connection_t * c,xcb_randr_get_panning_cookie_t cookie,xcb_generic_error_t ** e)3362 xcb_randr_get_panning_reply (xcb_connection_t                *c  /**< */,
3363                              xcb_randr_get_panning_cookie_t   cookie  /**< */,
3364                              xcb_generic_error_t            **e  /**< */)
3365 {
3366     return (xcb_randr_get_panning_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
3367 }
3368 
3369 xcb_randr_set_panning_cookie_t
xcb_randr_set_panning(xcb_connection_t * c,xcb_randr_crtc_t crtc,xcb_timestamp_t timestamp,uint16_t left,uint16_t top,uint16_t width,uint16_t height,uint16_t track_left,uint16_t track_top,uint16_t track_width,uint16_t track_height,int16_t border_left,int16_t border_top,int16_t border_right,int16_t border_bottom)3370 xcb_randr_set_panning (xcb_connection_t *c  /**< */,
3371                        xcb_randr_crtc_t  crtc  /**< */,
3372                        xcb_timestamp_t   timestamp  /**< */,
3373                        uint16_t          left  /**< */,
3374                        uint16_t          top  /**< */,
3375                        uint16_t          width  /**< */,
3376                        uint16_t          height  /**< */,
3377                        uint16_t          track_left  /**< */,
3378                        uint16_t          track_top  /**< */,
3379                        uint16_t          track_width  /**< */,
3380                        uint16_t          track_height  /**< */,
3381                        int16_t           border_left  /**< */,
3382                        int16_t           border_top  /**< */,
3383                        int16_t           border_right  /**< */,
3384                        int16_t           border_bottom  /**< */)
3385 {
3386     static const xcb_protocol_request_t xcb_req = {
3387         /* count */ 2,
3388         /* ext */ &xcb_randr_id,
3389         /* opcode */ XCB_RANDR_SET_PANNING,
3390         /* isvoid */ 0
3391     };
3392 
3393     struct iovec xcb_parts[4];
3394     xcb_randr_set_panning_cookie_t xcb_ret;
3395     xcb_randr_set_panning_request_t xcb_out;
3396 
3397     xcb_out.crtc = crtc;
3398     xcb_out.timestamp = timestamp;
3399     xcb_out.left = left;
3400     xcb_out.top = top;
3401     xcb_out.width = width;
3402     xcb_out.height = height;
3403     xcb_out.track_left = track_left;
3404     xcb_out.track_top = track_top;
3405     xcb_out.track_width = track_width;
3406     xcb_out.track_height = track_height;
3407     xcb_out.border_left = border_left;
3408     xcb_out.border_top = border_top;
3409     xcb_out.border_right = border_right;
3410     xcb_out.border_bottom = border_bottom;
3411 
3412     xcb_parts[2].iov_base = (char *) &xcb_out;
3413     xcb_parts[2].iov_len = sizeof(xcb_out);
3414     xcb_parts[3].iov_base = 0;
3415     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3416 
3417     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3418     return xcb_ret;
3419 }
3420 
3421 xcb_randr_set_panning_cookie_t
xcb_randr_set_panning_unchecked(xcb_connection_t * c,xcb_randr_crtc_t crtc,xcb_timestamp_t timestamp,uint16_t left,uint16_t top,uint16_t width,uint16_t height,uint16_t track_left,uint16_t track_top,uint16_t track_width,uint16_t track_height,int16_t border_left,int16_t border_top,int16_t border_right,int16_t border_bottom)3422 xcb_randr_set_panning_unchecked (xcb_connection_t *c  /**< */,
3423                                  xcb_randr_crtc_t  crtc  /**< */,
3424                                  xcb_timestamp_t   timestamp  /**< */,
3425                                  uint16_t          left  /**< */,
3426                                  uint16_t          top  /**< */,
3427                                  uint16_t          width  /**< */,
3428                                  uint16_t          height  /**< */,
3429                                  uint16_t          track_left  /**< */,
3430                                  uint16_t          track_top  /**< */,
3431                                  uint16_t          track_width  /**< */,
3432                                  uint16_t          track_height  /**< */,
3433                                  int16_t           border_left  /**< */,
3434                                  int16_t           border_top  /**< */,
3435                                  int16_t           border_right  /**< */,
3436                                  int16_t           border_bottom  /**< */)
3437 {
3438     static const xcb_protocol_request_t xcb_req = {
3439         /* count */ 2,
3440         /* ext */ &xcb_randr_id,
3441         /* opcode */ XCB_RANDR_SET_PANNING,
3442         /* isvoid */ 0
3443     };
3444 
3445     struct iovec xcb_parts[4];
3446     xcb_randr_set_panning_cookie_t xcb_ret;
3447     xcb_randr_set_panning_request_t xcb_out;
3448 
3449     xcb_out.crtc = crtc;
3450     xcb_out.timestamp = timestamp;
3451     xcb_out.left = left;
3452     xcb_out.top = top;
3453     xcb_out.width = width;
3454     xcb_out.height = height;
3455     xcb_out.track_left = track_left;
3456     xcb_out.track_top = track_top;
3457     xcb_out.track_width = track_width;
3458     xcb_out.track_height = track_height;
3459     xcb_out.border_left = border_left;
3460     xcb_out.border_top = border_top;
3461     xcb_out.border_right = border_right;
3462     xcb_out.border_bottom = border_bottom;
3463 
3464     xcb_parts[2].iov_base = (char *) &xcb_out;
3465     xcb_parts[2].iov_len = sizeof(xcb_out);
3466     xcb_parts[3].iov_base = 0;
3467     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3468 
3469     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3470     return xcb_ret;
3471 }
3472 
3473 xcb_randr_set_panning_reply_t *
xcb_randr_set_panning_reply(xcb_connection_t * c,xcb_randr_set_panning_cookie_t cookie,xcb_generic_error_t ** e)3474 xcb_randr_set_panning_reply (xcb_connection_t                *c  /**< */,
3475                              xcb_randr_set_panning_cookie_t   cookie  /**< */,
3476                              xcb_generic_error_t            **e  /**< */)
3477 {
3478     return (xcb_randr_set_panning_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
3479 }
3480 
3481 xcb_void_cookie_t
xcb_randr_set_output_primary_checked(xcb_connection_t * c,xcb_window_t window,xcb_randr_output_t output)3482 xcb_randr_set_output_primary_checked (xcb_connection_t   *c  /**< */,
3483                                       xcb_window_t        window  /**< */,
3484                                       xcb_randr_output_t  output  /**< */)
3485 {
3486     static const xcb_protocol_request_t xcb_req = {
3487         /* count */ 2,
3488         /* ext */ &xcb_randr_id,
3489         /* opcode */ XCB_RANDR_SET_OUTPUT_PRIMARY,
3490         /* isvoid */ 1
3491     };
3492 
3493     struct iovec xcb_parts[4];
3494     xcb_void_cookie_t xcb_ret;
3495     xcb_randr_set_output_primary_request_t xcb_out;
3496 
3497     xcb_out.window = window;
3498     xcb_out.output = output;
3499 
3500     xcb_parts[2].iov_base = (char *) &xcb_out;
3501     xcb_parts[2].iov_len = sizeof(xcb_out);
3502     xcb_parts[3].iov_base = 0;
3503     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3504 
3505     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3506     return xcb_ret;
3507 }
3508 
3509 xcb_void_cookie_t
xcb_randr_set_output_primary(xcb_connection_t * c,xcb_window_t window,xcb_randr_output_t output)3510 xcb_randr_set_output_primary (xcb_connection_t   *c  /**< */,
3511                               xcb_window_t        window  /**< */,
3512                               xcb_randr_output_t  output  /**< */)
3513 {
3514     static const xcb_protocol_request_t xcb_req = {
3515         /* count */ 2,
3516         /* ext */ &xcb_randr_id,
3517         /* opcode */ XCB_RANDR_SET_OUTPUT_PRIMARY,
3518         /* isvoid */ 1
3519     };
3520 
3521     struct iovec xcb_parts[4];
3522     xcb_void_cookie_t xcb_ret;
3523     xcb_randr_set_output_primary_request_t xcb_out;
3524 
3525     xcb_out.window = window;
3526     xcb_out.output = output;
3527 
3528     xcb_parts[2].iov_base = (char *) &xcb_out;
3529     xcb_parts[2].iov_len = sizeof(xcb_out);
3530     xcb_parts[3].iov_base = 0;
3531     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3532 
3533     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3534     return xcb_ret;
3535 }
3536 
3537 xcb_randr_get_output_primary_cookie_t
xcb_randr_get_output_primary(xcb_connection_t * c,xcb_window_t window)3538 xcb_randr_get_output_primary (xcb_connection_t *c  /**< */,
3539                               xcb_window_t      window  /**< */)
3540 {
3541     static const xcb_protocol_request_t xcb_req = {
3542         /* count */ 2,
3543         /* ext */ &xcb_randr_id,
3544         /* opcode */ XCB_RANDR_GET_OUTPUT_PRIMARY,
3545         /* isvoid */ 0
3546     };
3547 
3548     struct iovec xcb_parts[4];
3549     xcb_randr_get_output_primary_cookie_t xcb_ret;
3550     xcb_randr_get_output_primary_request_t xcb_out;
3551 
3552     xcb_out.window = window;
3553 
3554     xcb_parts[2].iov_base = (char *) &xcb_out;
3555     xcb_parts[2].iov_len = sizeof(xcb_out);
3556     xcb_parts[3].iov_base = 0;
3557     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3558 
3559     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3560     return xcb_ret;
3561 }
3562 
3563 xcb_randr_get_output_primary_cookie_t
xcb_randr_get_output_primary_unchecked(xcb_connection_t * c,xcb_window_t window)3564 xcb_randr_get_output_primary_unchecked (xcb_connection_t *c  /**< */,
3565                                         xcb_window_t      window  /**< */)
3566 {
3567     static const xcb_protocol_request_t xcb_req = {
3568         /* count */ 2,
3569         /* ext */ &xcb_randr_id,
3570         /* opcode */ XCB_RANDR_GET_OUTPUT_PRIMARY,
3571         /* isvoid */ 0
3572     };
3573 
3574     struct iovec xcb_parts[4];
3575     xcb_randr_get_output_primary_cookie_t xcb_ret;
3576     xcb_randr_get_output_primary_request_t xcb_out;
3577 
3578     xcb_out.window = window;
3579 
3580     xcb_parts[2].iov_base = (char *) &xcb_out;
3581     xcb_parts[2].iov_len = sizeof(xcb_out);
3582     xcb_parts[3].iov_base = 0;
3583     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3584 
3585     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3586     return xcb_ret;
3587 }
3588 
3589 xcb_randr_get_output_primary_reply_t *
xcb_randr_get_output_primary_reply(xcb_connection_t * c,xcb_randr_get_output_primary_cookie_t cookie,xcb_generic_error_t ** e)3590 xcb_randr_get_output_primary_reply (xcb_connection_t                       *c  /**< */,
3591                                     xcb_randr_get_output_primary_cookie_t   cookie  /**< */,
3592                                     xcb_generic_error_t                   **e  /**< */)
3593 {
3594     return (xcb_randr_get_output_primary_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
3595 }
3596 
3597 int
xcb_randr_get_providers_sizeof(const void * _buffer)3598 xcb_randr_get_providers_sizeof (const void  *_buffer  /**< */)
3599 {
3600     char *xcb_tmp = (char *)_buffer;
3601     const xcb_randr_get_providers_reply_t *_aux = (xcb_randr_get_providers_reply_t *)_buffer;
3602     unsigned int xcb_buffer_len = 0;
3603     unsigned int xcb_block_len = 0;
3604     unsigned int xcb_pad = 0;
3605     unsigned int xcb_align_to = 0;
3606 
3607 
3608     xcb_block_len += sizeof(xcb_randr_get_providers_reply_t);
3609     xcb_tmp += xcb_block_len;
3610     xcb_buffer_len += xcb_block_len;
3611     xcb_block_len = 0;
3612     /* providers */
3613     xcb_block_len += _aux->num_providers * sizeof(xcb_randr_provider_t);
3614     xcb_tmp += xcb_block_len;
3615     xcb_align_to = ALIGNOF(xcb_randr_provider_t);
3616     /* insert padding */
3617     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3618     xcb_buffer_len += xcb_block_len + xcb_pad;
3619     if (0 != xcb_pad) {
3620         xcb_tmp += xcb_pad;
3621         xcb_pad = 0;
3622     }
3623     xcb_block_len = 0;
3624 
3625     return xcb_buffer_len;
3626 }
3627 
3628 xcb_randr_get_providers_cookie_t
xcb_randr_get_providers(xcb_connection_t * c,xcb_window_t window)3629 xcb_randr_get_providers (xcb_connection_t *c  /**< */,
3630                          xcb_window_t      window  /**< */)
3631 {
3632     static const xcb_protocol_request_t xcb_req = {
3633         /* count */ 2,
3634         /* ext */ &xcb_randr_id,
3635         /* opcode */ XCB_RANDR_GET_PROVIDERS,
3636         /* isvoid */ 0
3637     };
3638 
3639     struct iovec xcb_parts[4];
3640     xcb_randr_get_providers_cookie_t xcb_ret;
3641     xcb_randr_get_providers_request_t xcb_out;
3642 
3643     xcb_out.window = window;
3644 
3645     xcb_parts[2].iov_base = (char *) &xcb_out;
3646     xcb_parts[2].iov_len = sizeof(xcb_out);
3647     xcb_parts[3].iov_base = 0;
3648     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3649 
3650     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3651     return xcb_ret;
3652 }
3653 
3654 xcb_randr_get_providers_cookie_t
xcb_randr_get_providers_unchecked(xcb_connection_t * c,xcb_window_t window)3655 xcb_randr_get_providers_unchecked (xcb_connection_t *c  /**< */,
3656                                    xcb_window_t      window  /**< */)
3657 {
3658     static const xcb_protocol_request_t xcb_req = {
3659         /* count */ 2,
3660         /* ext */ &xcb_randr_id,
3661         /* opcode */ XCB_RANDR_GET_PROVIDERS,
3662         /* isvoid */ 0
3663     };
3664 
3665     struct iovec xcb_parts[4];
3666     xcb_randr_get_providers_cookie_t xcb_ret;
3667     xcb_randr_get_providers_request_t xcb_out;
3668 
3669     xcb_out.window = window;
3670 
3671     xcb_parts[2].iov_base = (char *) &xcb_out;
3672     xcb_parts[2].iov_len = sizeof(xcb_out);
3673     xcb_parts[3].iov_base = 0;
3674     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3675 
3676     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3677     return xcb_ret;
3678 }
3679 
3680 xcb_randr_provider_t *
xcb_randr_get_providers_providers(const xcb_randr_get_providers_reply_t * R)3681 xcb_randr_get_providers_providers (const xcb_randr_get_providers_reply_t *R  /**< */)
3682 {
3683     return (xcb_randr_provider_t *) (R + 1);
3684 }
3685 
3686 int
xcb_randr_get_providers_providers_length(const xcb_randr_get_providers_reply_t * R)3687 xcb_randr_get_providers_providers_length (const xcb_randr_get_providers_reply_t *R  /**< */)
3688 {
3689     return R->num_providers;
3690 }
3691 
3692 xcb_generic_iterator_t
xcb_randr_get_providers_providers_end(const xcb_randr_get_providers_reply_t * R)3693 xcb_randr_get_providers_providers_end (const xcb_randr_get_providers_reply_t *R  /**< */)
3694 {
3695     xcb_generic_iterator_t i;
3696     i.data = ((xcb_randr_provider_t *) (R + 1)) + (R->num_providers);
3697     i.rem = 0;
3698     i.index = (char *) i.data - (char *) R;
3699     return i;
3700 }
3701 
3702 xcb_randr_get_providers_reply_t *
xcb_randr_get_providers_reply(xcb_connection_t * c,xcb_randr_get_providers_cookie_t cookie,xcb_generic_error_t ** e)3703 xcb_randr_get_providers_reply (xcb_connection_t                  *c  /**< */,
3704                                xcb_randr_get_providers_cookie_t   cookie  /**< */,
3705                                xcb_generic_error_t              **e  /**< */)
3706 {
3707     return (xcb_randr_get_providers_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
3708 }
3709 
3710 int
xcb_randr_get_provider_info_sizeof(const void * _buffer)3711 xcb_randr_get_provider_info_sizeof (const void  *_buffer  /**< */)
3712 {
3713     char *xcb_tmp = (char *)_buffer;
3714     const xcb_randr_get_provider_info_reply_t *_aux = (xcb_randr_get_provider_info_reply_t *)_buffer;
3715     unsigned int xcb_buffer_len = 0;
3716     unsigned int xcb_block_len = 0;
3717     unsigned int xcb_pad = 0;
3718     unsigned int xcb_align_to = 0;
3719 
3720 
3721     xcb_block_len += sizeof(xcb_randr_get_provider_info_reply_t);
3722     xcb_tmp += xcb_block_len;
3723     xcb_buffer_len += xcb_block_len;
3724     xcb_block_len = 0;
3725     /* crtcs */
3726     xcb_block_len += _aux->num_crtcs * sizeof(uint32_t);
3727     xcb_tmp += xcb_block_len;
3728     xcb_align_to = ALIGNOF(xcb_randr_crtc_t);
3729     /* insert padding */
3730     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3731     xcb_buffer_len += xcb_block_len + xcb_pad;
3732     if (0 != xcb_pad) {
3733         xcb_tmp += xcb_pad;
3734         xcb_pad = 0;
3735     }
3736     xcb_block_len = 0;
3737     /* outputs */
3738     xcb_block_len += _aux->num_outputs * sizeof(uint32_t);
3739     xcb_tmp += xcb_block_len;
3740     xcb_align_to = ALIGNOF(xcb_randr_output_t);
3741     /* insert padding */
3742     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3743     xcb_buffer_len += xcb_block_len + xcb_pad;
3744     if (0 != xcb_pad) {
3745         xcb_tmp += xcb_pad;
3746         xcb_pad = 0;
3747     }
3748     xcb_block_len = 0;
3749     /* associated_providers */
3750     xcb_block_len += _aux->num_associated_providers * sizeof(uint32_t);
3751     xcb_tmp += xcb_block_len;
3752     xcb_align_to = ALIGNOF(xcb_randr_provider_t);
3753     /* insert padding */
3754     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3755     xcb_buffer_len += xcb_block_len + xcb_pad;
3756     if (0 != xcb_pad) {
3757         xcb_tmp += xcb_pad;
3758         xcb_pad = 0;
3759     }
3760     xcb_block_len = 0;
3761     /* associated_capability */
3762     xcb_block_len += _aux->num_associated_providers * sizeof(uint32_t);
3763     xcb_tmp += xcb_block_len;
3764     xcb_align_to = ALIGNOF(uint32_t);
3765     /* insert padding */
3766     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3767     xcb_buffer_len += xcb_block_len + xcb_pad;
3768     if (0 != xcb_pad) {
3769         xcb_tmp += xcb_pad;
3770         xcb_pad = 0;
3771     }
3772     xcb_block_len = 0;
3773     /* name */
3774     xcb_block_len += _aux->name_len * sizeof(char);
3775     xcb_tmp += xcb_block_len;
3776     xcb_align_to = ALIGNOF(char);
3777     /* insert padding */
3778     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3779     xcb_buffer_len += xcb_block_len + xcb_pad;
3780     if (0 != xcb_pad) {
3781         xcb_tmp += xcb_pad;
3782         xcb_pad = 0;
3783     }
3784     xcb_block_len = 0;
3785 
3786     return xcb_buffer_len;
3787 }
3788 
3789 xcb_randr_get_provider_info_cookie_t
xcb_randr_get_provider_info(xcb_connection_t * c,xcb_randr_provider_t provider,xcb_timestamp_t config_timestamp)3790 xcb_randr_get_provider_info (xcb_connection_t     *c  /**< */,
3791                              xcb_randr_provider_t  provider  /**< */,
3792                              xcb_timestamp_t       config_timestamp  /**< */)
3793 {
3794     static const xcb_protocol_request_t xcb_req = {
3795         /* count */ 2,
3796         /* ext */ &xcb_randr_id,
3797         /* opcode */ XCB_RANDR_GET_PROVIDER_INFO,
3798         /* isvoid */ 0
3799     };
3800 
3801     struct iovec xcb_parts[4];
3802     xcb_randr_get_provider_info_cookie_t xcb_ret;
3803     xcb_randr_get_provider_info_request_t xcb_out;
3804 
3805     xcb_out.provider = provider;
3806     xcb_out.config_timestamp = config_timestamp;
3807 
3808     xcb_parts[2].iov_base = (char *) &xcb_out;
3809     xcb_parts[2].iov_len = sizeof(xcb_out);
3810     xcb_parts[3].iov_base = 0;
3811     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3812 
3813     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3814     return xcb_ret;
3815 }
3816 
3817 xcb_randr_get_provider_info_cookie_t
xcb_randr_get_provider_info_unchecked(xcb_connection_t * c,xcb_randr_provider_t provider,xcb_timestamp_t config_timestamp)3818 xcb_randr_get_provider_info_unchecked (xcb_connection_t     *c  /**< */,
3819                                        xcb_randr_provider_t  provider  /**< */,
3820                                        xcb_timestamp_t       config_timestamp  /**< */)
3821 {
3822     static const xcb_protocol_request_t xcb_req = {
3823         /* count */ 2,
3824         /* ext */ &xcb_randr_id,
3825         /* opcode */ XCB_RANDR_GET_PROVIDER_INFO,
3826         /* isvoid */ 0
3827     };
3828 
3829     struct iovec xcb_parts[4];
3830     xcb_randr_get_provider_info_cookie_t xcb_ret;
3831     xcb_randr_get_provider_info_request_t xcb_out;
3832 
3833     xcb_out.provider = provider;
3834     xcb_out.config_timestamp = config_timestamp;
3835 
3836     xcb_parts[2].iov_base = (char *) &xcb_out;
3837     xcb_parts[2].iov_len = sizeof(xcb_out);
3838     xcb_parts[3].iov_base = 0;
3839     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3840 
3841     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3842     return xcb_ret;
3843 }
3844 
3845 xcb_randr_crtc_t *
xcb_randr_get_provider_info_crtcs(const xcb_randr_get_provider_info_reply_t * R)3846 xcb_randr_get_provider_info_crtcs (const xcb_randr_get_provider_info_reply_t *R  /**< */)
3847 {
3848     return (xcb_randr_crtc_t *) (R + 1);
3849 }
3850 
3851 int
xcb_randr_get_provider_info_crtcs_length(const xcb_randr_get_provider_info_reply_t * R)3852 xcb_randr_get_provider_info_crtcs_length (const xcb_randr_get_provider_info_reply_t *R  /**< */)
3853 {
3854     return R->num_crtcs;
3855 }
3856 
3857 xcb_generic_iterator_t
xcb_randr_get_provider_info_crtcs_end(const xcb_randr_get_provider_info_reply_t * R)3858 xcb_randr_get_provider_info_crtcs_end (const xcb_randr_get_provider_info_reply_t *R  /**< */)
3859 {
3860     xcb_generic_iterator_t i;
3861     i.data = ((xcb_randr_crtc_t *) (R + 1)) + (R->num_crtcs);
3862     i.rem = 0;
3863     i.index = (char *) i.data - (char *) R;
3864     return i;
3865 }
3866 
3867 xcb_randr_output_t *
xcb_randr_get_provider_info_outputs(const xcb_randr_get_provider_info_reply_t * R)3868 xcb_randr_get_provider_info_outputs (const xcb_randr_get_provider_info_reply_t *R  /**< */)
3869 {
3870     xcb_generic_iterator_t prev = xcb_randr_get_provider_info_crtcs_end(R);
3871     return (xcb_randr_output_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_randr_output_t, prev.index) + 0);
3872 }
3873 
3874 int
xcb_randr_get_provider_info_outputs_length(const xcb_randr_get_provider_info_reply_t * R)3875 xcb_randr_get_provider_info_outputs_length (const xcb_randr_get_provider_info_reply_t *R  /**< */)
3876 {
3877     return R->num_outputs;
3878 }
3879 
3880 xcb_generic_iterator_t
xcb_randr_get_provider_info_outputs_end(const xcb_randr_get_provider_info_reply_t * R)3881 xcb_randr_get_provider_info_outputs_end (const xcb_randr_get_provider_info_reply_t *R  /**< */)
3882 {
3883     xcb_generic_iterator_t i;
3884     xcb_generic_iterator_t child = xcb_randr_get_provider_info_crtcs_end(R);
3885     i.data = ((xcb_randr_output_t *) child.data) + (R->num_outputs);
3886     i.rem = 0;
3887     i.index = (char *) i.data - (char *) R;
3888     return i;
3889 }
3890 
3891 xcb_randr_provider_t *
xcb_randr_get_provider_info_associated_providers(const xcb_randr_get_provider_info_reply_t * R)3892 xcb_randr_get_provider_info_associated_providers (const xcb_randr_get_provider_info_reply_t *R  /**< */)
3893 {
3894     xcb_generic_iterator_t prev = xcb_randr_get_provider_info_outputs_end(R);
3895     return (xcb_randr_provider_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_randr_provider_t, prev.index) + 0);
3896 }
3897 
3898 int
xcb_randr_get_provider_info_associated_providers_length(const xcb_randr_get_provider_info_reply_t * R)3899 xcb_randr_get_provider_info_associated_providers_length (const xcb_randr_get_provider_info_reply_t *R  /**< */)
3900 {
3901     return R->num_associated_providers;
3902 }
3903 
3904 xcb_generic_iterator_t
xcb_randr_get_provider_info_associated_providers_end(const xcb_randr_get_provider_info_reply_t * R)3905 xcb_randr_get_provider_info_associated_providers_end (const xcb_randr_get_provider_info_reply_t *R  /**< */)
3906 {
3907     xcb_generic_iterator_t i;
3908     xcb_generic_iterator_t child = xcb_randr_get_provider_info_outputs_end(R);
3909     i.data = ((xcb_randr_provider_t *) child.data) + (R->num_associated_providers);
3910     i.rem = 0;
3911     i.index = (char *) i.data - (char *) R;
3912     return i;
3913 }
3914 
3915 uint32_t *
xcb_randr_get_provider_info_associated_capability(const xcb_randr_get_provider_info_reply_t * R)3916 xcb_randr_get_provider_info_associated_capability (const xcb_randr_get_provider_info_reply_t *R  /**< */)
3917 {
3918     xcb_generic_iterator_t prev = xcb_randr_get_provider_info_associated_providers_end(R);
3919     return (uint32_t *) ((char *) prev.data + XCB_TYPE_PAD(uint32_t, prev.index) + 0);
3920 }
3921 
3922 int
xcb_randr_get_provider_info_associated_capability_length(const xcb_randr_get_provider_info_reply_t * R)3923 xcb_randr_get_provider_info_associated_capability_length (const xcb_randr_get_provider_info_reply_t *R  /**< */)
3924 {
3925     return R->num_associated_providers;
3926 }
3927 
3928 xcb_generic_iterator_t
xcb_randr_get_provider_info_associated_capability_end(const xcb_randr_get_provider_info_reply_t * R)3929 xcb_randr_get_provider_info_associated_capability_end (const xcb_randr_get_provider_info_reply_t *R  /**< */)
3930 {
3931     xcb_generic_iterator_t i;
3932     xcb_generic_iterator_t child = xcb_randr_get_provider_info_associated_providers_end(R);
3933     i.data = ((uint32_t *) child.data) + (R->num_associated_providers);
3934     i.rem = 0;
3935     i.index = (char *) i.data - (char *) R;
3936     return i;
3937 }
3938 
3939 char *
xcb_randr_get_provider_info_name(const xcb_randr_get_provider_info_reply_t * R)3940 xcb_randr_get_provider_info_name (const xcb_randr_get_provider_info_reply_t *R  /**< */)
3941 {
3942     xcb_generic_iterator_t prev = xcb_randr_get_provider_info_associated_capability_end(R);
3943     return (char *) ((char *) prev.data + XCB_TYPE_PAD(char, prev.index) + 0);
3944 }
3945 
3946 int
xcb_randr_get_provider_info_name_length(const xcb_randr_get_provider_info_reply_t * R)3947 xcb_randr_get_provider_info_name_length (const xcb_randr_get_provider_info_reply_t *R  /**< */)
3948 {
3949     return R->name_len;
3950 }
3951 
3952 xcb_generic_iterator_t
xcb_randr_get_provider_info_name_end(const xcb_randr_get_provider_info_reply_t * R)3953 xcb_randr_get_provider_info_name_end (const xcb_randr_get_provider_info_reply_t *R  /**< */)
3954 {
3955     xcb_generic_iterator_t i;
3956     xcb_generic_iterator_t child = xcb_randr_get_provider_info_associated_capability_end(R);
3957     i.data = ((char *) child.data) + (R->name_len);
3958     i.rem = 0;
3959     i.index = (char *) i.data - (char *) R;
3960     return i;
3961 }
3962 
3963 xcb_randr_get_provider_info_reply_t *
xcb_randr_get_provider_info_reply(xcb_connection_t * c,xcb_randr_get_provider_info_cookie_t cookie,xcb_generic_error_t ** e)3964 xcb_randr_get_provider_info_reply (xcb_connection_t                      *c  /**< */,
3965                                    xcb_randr_get_provider_info_cookie_t   cookie  /**< */,
3966                                    xcb_generic_error_t                  **e  /**< */)
3967 {
3968     return (xcb_randr_get_provider_info_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
3969 }
3970 
3971 xcb_void_cookie_t
xcb_randr_set_provider_offload_sink_checked(xcb_connection_t * c,xcb_randr_provider_t provider,xcb_randr_provider_t sink_provider,xcb_timestamp_t config_timestamp)3972 xcb_randr_set_provider_offload_sink_checked (xcb_connection_t     *c  /**< */,
3973                                              xcb_randr_provider_t  provider  /**< */,
3974                                              xcb_randr_provider_t  sink_provider  /**< */,
3975                                              xcb_timestamp_t       config_timestamp  /**< */)
3976 {
3977     static const xcb_protocol_request_t xcb_req = {
3978         /* count */ 2,
3979         /* ext */ &xcb_randr_id,
3980         /* opcode */ XCB_RANDR_SET_PROVIDER_OFFLOAD_SINK,
3981         /* isvoid */ 1
3982     };
3983 
3984     struct iovec xcb_parts[4];
3985     xcb_void_cookie_t xcb_ret;
3986     xcb_randr_set_provider_offload_sink_request_t xcb_out;
3987 
3988     xcb_out.provider = provider;
3989     xcb_out.sink_provider = sink_provider;
3990     xcb_out.config_timestamp = config_timestamp;
3991 
3992     xcb_parts[2].iov_base = (char *) &xcb_out;
3993     xcb_parts[2].iov_len = sizeof(xcb_out);
3994     xcb_parts[3].iov_base = 0;
3995     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3996 
3997     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3998     return xcb_ret;
3999 }
4000 
4001 xcb_void_cookie_t
xcb_randr_set_provider_offload_sink(xcb_connection_t * c,xcb_randr_provider_t provider,xcb_randr_provider_t sink_provider,xcb_timestamp_t config_timestamp)4002 xcb_randr_set_provider_offload_sink (xcb_connection_t     *c  /**< */,
4003                                      xcb_randr_provider_t  provider  /**< */,
4004                                      xcb_randr_provider_t  sink_provider  /**< */,
4005                                      xcb_timestamp_t       config_timestamp  /**< */)
4006 {
4007     static const xcb_protocol_request_t xcb_req = {
4008         /* count */ 2,
4009         /* ext */ &xcb_randr_id,
4010         /* opcode */ XCB_RANDR_SET_PROVIDER_OFFLOAD_SINK,
4011         /* isvoid */ 1
4012     };
4013 
4014     struct iovec xcb_parts[4];
4015     xcb_void_cookie_t xcb_ret;
4016     xcb_randr_set_provider_offload_sink_request_t xcb_out;
4017 
4018     xcb_out.provider = provider;
4019     xcb_out.sink_provider = sink_provider;
4020     xcb_out.config_timestamp = config_timestamp;
4021 
4022     xcb_parts[2].iov_base = (char *) &xcb_out;
4023     xcb_parts[2].iov_len = sizeof(xcb_out);
4024     xcb_parts[3].iov_base = 0;
4025     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4026 
4027     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
4028     return xcb_ret;
4029 }
4030 
4031 xcb_void_cookie_t
xcb_randr_set_provider_output_source_checked(xcb_connection_t * c,xcb_randr_provider_t provider,xcb_randr_provider_t source_provider,xcb_timestamp_t config_timestamp)4032 xcb_randr_set_provider_output_source_checked (xcb_connection_t     *c  /**< */,
4033                                               xcb_randr_provider_t  provider  /**< */,
4034                                               xcb_randr_provider_t  source_provider  /**< */,
4035                                               xcb_timestamp_t       config_timestamp  /**< */)
4036 {
4037     static const xcb_protocol_request_t xcb_req = {
4038         /* count */ 2,
4039         /* ext */ &xcb_randr_id,
4040         /* opcode */ XCB_RANDR_SET_PROVIDER_OUTPUT_SOURCE,
4041         /* isvoid */ 1
4042     };
4043 
4044     struct iovec xcb_parts[4];
4045     xcb_void_cookie_t xcb_ret;
4046     xcb_randr_set_provider_output_source_request_t xcb_out;
4047 
4048     xcb_out.provider = provider;
4049     xcb_out.source_provider = source_provider;
4050     xcb_out.config_timestamp = config_timestamp;
4051 
4052     xcb_parts[2].iov_base = (char *) &xcb_out;
4053     xcb_parts[2].iov_len = sizeof(xcb_out);
4054     xcb_parts[3].iov_base = 0;
4055     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4056 
4057     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
4058     return xcb_ret;
4059 }
4060 
4061 xcb_void_cookie_t
xcb_randr_set_provider_output_source(xcb_connection_t * c,xcb_randr_provider_t provider,xcb_randr_provider_t source_provider,xcb_timestamp_t config_timestamp)4062 xcb_randr_set_provider_output_source (xcb_connection_t     *c  /**< */,
4063                                       xcb_randr_provider_t  provider  /**< */,
4064                                       xcb_randr_provider_t  source_provider  /**< */,
4065                                       xcb_timestamp_t       config_timestamp  /**< */)
4066 {
4067     static const xcb_protocol_request_t xcb_req = {
4068         /* count */ 2,
4069         /* ext */ &xcb_randr_id,
4070         /* opcode */ XCB_RANDR_SET_PROVIDER_OUTPUT_SOURCE,
4071         /* isvoid */ 1
4072     };
4073 
4074     struct iovec xcb_parts[4];
4075     xcb_void_cookie_t xcb_ret;
4076     xcb_randr_set_provider_output_source_request_t xcb_out;
4077 
4078     xcb_out.provider = provider;
4079     xcb_out.source_provider = source_provider;
4080     xcb_out.config_timestamp = config_timestamp;
4081 
4082     xcb_parts[2].iov_base = (char *) &xcb_out;
4083     xcb_parts[2].iov_len = sizeof(xcb_out);
4084     xcb_parts[3].iov_base = 0;
4085     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4086 
4087     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
4088     return xcb_ret;
4089 }
4090 
4091 int
xcb_randr_list_provider_properties_sizeof(const void * _buffer)4092 xcb_randr_list_provider_properties_sizeof (const void  *_buffer  /**< */)
4093 {
4094     char *xcb_tmp = (char *)_buffer;
4095     const xcb_randr_list_provider_properties_reply_t *_aux = (xcb_randr_list_provider_properties_reply_t *)_buffer;
4096     unsigned int xcb_buffer_len = 0;
4097     unsigned int xcb_block_len = 0;
4098     unsigned int xcb_pad = 0;
4099     unsigned int xcb_align_to = 0;
4100 
4101 
4102     xcb_block_len += sizeof(xcb_randr_list_provider_properties_reply_t);
4103     xcb_tmp += xcb_block_len;
4104     xcb_buffer_len += xcb_block_len;
4105     xcb_block_len = 0;
4106     /* atoms */
4107     xcb_block_len += _aux->num_atoms * sizeof(xcb_atom_t);
4108     xcb_tmp += xcb_block_len;
4109     xcb_align_to = ALIGNOF(xcb_atom_t);
4110     /* insert padding */
4111     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4112     xcb_buffer_len += xcb_block_len + xcb_pad;
4113     if (0 != xcb_pad) {
4114         xcb_tmp += xcb_pad;
4115         xcb_pad = 0;
4116     }
4117     xcb_block_len = 0;
4118 
4119     return xcb_buffer_len;
4120 }
4121 
4122 xcb_randr_list_provider_properties_cookie_t
xcb_randr_list_provider_properties(xcb_connection_t * c,xcb_randr_provider_t provider)4123 xcb_randr_list_provider_properties (xcb_connection_t     *c  /**< */,
4124                                     xcb_randr_provider_t  provider  /**< */)
4125 {
4126     static const xcb_protocol_request_t xcb_req = {
4127         /* count */ 2,
4128         /* ext */ &xcb_randr_id,
4129         /* opcode */ XCB_RANDR_LIST_PROVIDER_PROPERTIES,
4130         /* isvoid */ 0
4131     };
4132 
4133     struct iovec xcb_parts[4];
4134     xcb_randr_list_provider_properties_cookie_t xcb_ret;
4135     xcb_randr_list_provider_properties_request_t xcb_out;
4136 
4137     xcb_out.provider = provider;
4138 
4139     xcb_parts[2].iov_base = (char *) &xcb_out;
4140     xcb_parts[2].iov_len = sizeof(xcb_out);
4141     xcb_parts[3].iov_base = 0;
4142     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4143 
4144     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
4145     return xcb_ret;
4146 }
4147 
4148 xcb_randr_list_provider_properties_cookie_t
xcb_randr_list_provider_properties_unchecked(xcb_connection_t * c,xcb_randr_provider_t provider)4149 xcb_randr_list_provider_properties_unchecked (xcb_connection_t     *c  /**< */,
4150                                               xcb_randr_provider_t  provider  /**< */)
4151 {
4152     static const xcb_protocol_request_t xcb_req = {
4153         /* count */ 2,
4154         /* ext */ &xcb_randr_id,
4155         /* opcode */ XCB_RANDR_LIST_PROVIDER_PROPERTIES,
4156         /* isvoid */ 0
4157     };
4158 
4159     struct iovec xcb_parts[4];
4160     xcb_randr_list_provider_properties_cookie_t xcb_ret;
4161     xcb_randr_list_provider_properties_request_t xcb_out;
4162 
4163     xcb_out.provider = provider;
4164 
4165     xcb_parts[2].iov_base = (char *) &xcb_out;
4166     xcb_parts[2].iov_len = sizeof(xcb_out);
4167     xcb_parts[3].iov_base = 0;
4168     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4169 
4170     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
4171     return xcb_ret;
4172 }
4173 
4174 xcb_atom_t *
xcb_randr_list_provider_properties_atoms(const xcb_randr_list_provider_properties_reply_t * R)4175 xcb_randr_list_provider_properties_atoms (const xcb_randr_list_provider_properties_reply_t *R  /**< */)
4176 {
4177     return (xcb_atom_t *) (R + 1);
4178 }
4179 
4180 int
xcb_randr_list_provider_properties_atoms_length(const xcb_randr_list_provider_properties_reply_t * R)4181 xcb_randr_list_provider_properties_atoms_length (const xcb_randr_list_provider_properties_reply_t *R  /**< */)
4182 {
4183     return R->num_atoms;
4184 }
4185 
4186 xcb_generic_iterator_t
xcb_randr_list_provider_properties_atoms_end(const xcb_randr_list_provider_properties_reply_t * R)4187 xcb_randr_list_provider_properties_atoms_end (const xcb_randr_list_provider_properties_reply_t *R  /**< */)
4188 {
4189     xcb_generic_iterator_t i;
4190     i.data = ((xcb_atom_t *) (R + 1)) + (R->num_atoms);
4191     i.rem = 0;
4192     i.index = (char *) i.data - (char *) R;
4193     return i;
4194 }
4195 
4196 xcb_randr_list_provider_properties_reply_t *
xcb_randr_list_provider_properties_reply(xcb_connection_t * c,xcb_randr_list_provider_properties_cookie_t cookie,xcb_generic_error_t ** e)4197 xcb_randr_list_provider_properties_reply (xcb_connection_t                             *c  /**< */,
4198                                           xcb_randr_list_provider_properties_cookie_t   cookie  /**< */,
4199                                           xcb_generic_error_t                         **e  /**< */)
4200 {
4201     return (xcb_randr_list_provider_properties_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
4202 }
4203 
4204 int
xcb_randr_query_provider_property_sizeof(const void * _buffer)4205 xcb_randr_query_provider_property_sizeof (const void  *_buffer  /**< */)
4206 {
4207     char *xcb_tmp = (char *)_buffer;
4208     const xcb_randr_query_provider_property_reply_t *_aux = (xcb_randr_query_provider_property_reply_t *)_buffer;
4209     unsigned int xcb_buffer_len = 0;
4210     unsigned int xcb_block_len = 0;
4211     unsigned int xcb_pad = 0;
4212     unsigned int xcb_align_to = 0;
4213 
4214 
4215     xcb_block_len += sizeof(xcb_randr_query_provider_property_reply_t);
4216     xcb_tmp += xcb_block_len;
4217     xcb_buffer_len += xcb_block_len;
4218     xcb_block_len = 0;
4219     /* valid_values */
4220     xcb_block_len += _aux->length * sizeof(int32_t);
4221     xcb_tmp += xcb_block_len;
4222     xcb_align_to = ALIGNOF(int32_t);
4223     /* insert padding */
4224     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4225     xcb_buffer_len += xcb_block_len + xcb_pad;
4226     if (0 != xcb_pad) {
4227         xcb_tmp += xcb_pad;
4228         xcb_pad = 0;
4229     }
4230     xcb_block_len = 0;
4231 
4232     return xcb_buffer_len;
4233 }
4234 
4235 xcb_randr_query_provider_property_cookie_t
xcb_randr_query_provider_property(xcb_connection_t * c,xcb_randr_provider_t provider,xcb_atom_t property)4236 xcb_randr_query_provider_property (xcb_connection_t     *c  /**< */,
4237                                    xcb_randr_provider_t  provider  /**< */,
4238                                    xcb_atom_t            property  /**< */)
4239 {
4240     static const xcb_protocol_request_t xcb_req = {
4241         /* count */ 2,
4242         /* ext */ &xcb_randr_id,
4243         /* opcode */ XCB_RANDR_QUERY_PROVIDER_PROPERTY,
4244         /* isvoid */ 0
4245     };
4246 
4247     struct iovec xcb_parts[4];
4248     xcb_randr_query_provider_property_cookie_t xcb_ret;
4249     xcb_randr_query_provider_property_request_t xcb_out;
4250 
4251     xcb_out.provider = provider;
4252     xcb_out.property = property;
4253 
4254     xcb_parts[2].iov_base = (char *) &xcb_out;
4255     xcb_parts[2].iov_len = sizeof(xcb_out);
4256     xcb_parts[3].iov_base = 0;
4257     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4258 
4259     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
4260     return xcb_ret;
4261 }
4262 
4263 xcb_randr_query_provider_property_cookie_t
xcb_randr_query_provider_property_unchecked(xcb_connection_t * c,xcb_randr_provider_t provider,xcb_atom_t property)4264 xcb_randr_query_provider_property_unchecked (xcb_connection_t     *c  /**< */,
4265                                              xcb_randr_provider_t  provider  /**< */,
4266                                              xcb_atom_t            property  /**< */)
4267 {
4268     static const xcb_protocol_request_t xcb_req = {
4269         /* count */ 2,
4270         /* ext */ &xcb_randr_id,
4271         /* opcode */ XCB_RANDR_QUERY_PROVIDER_PROPERTY,
4272         /* isvoid */ 0
4273     };
4274 
4275     struct iovec xcb_parts[4];
4276     xcb_randr_query_provider_property_cookie_t xcb_ret;
4277     xcb_randr_query_provider_property_request_t xcb_out;
4278 
4279     xcb_out.provider = provider;
4280     xcb_out.property = property;
4281 
4282     xcb_parts[2].iov_base = (char *) &xcb_out;
4283     xcb_parts[2].iov_len = sizeof(xcb_out);
4284     xcb_parts[3].iov_base = 0;
4285     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4286 
4287     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
4288     return xcb_ret;
4289 }
4290 
4291 int32_t *
xcb_randr_query_provider_property_valid_values(const xcb_randr_query_provider_property_reply_t * R)4292 xcb_randr_query_provider_property_valid_values (const xcb_randr_query_provider_property_reply_t *R  /**< */)
4293 {
4294     return (int32_t *) (R + 1);
4295 }
4296 
4297 int
xcb_randr_query_provider_property_valid_values_length(const xcb_randr_query_provider_property_reply_t * R)4298 xcb_randr_query_provider_property_valid_values_length (const xcb_randr_query_provider_property_reply_t *R  /**< */)
4299 {
4300     return R->length;
4301 }
4302 
4303 xcb_generic_iterator_t
xcb_randr_query_provider_property_valid_values_end(const xcb_randr_query_provider_property_reply_t * R)4304 xcb_randr_query_provider_property_valid_values_end (const xcb_randr_query_provider_property_reply_t *R  /**< */)
4305 {
4306     xcb_generic_iterator_t i;
4307     i.data = ((int32_t *) (R + 1)) + (R->length);
4308     i.rem = 0;
4309     i.index = (char *) i.data - (char *) R;
4310     return i;
4311 }
4312 
4313 xcb_randr_query_provider_property_reply_t *
xcb_randr_query_provider_property_reply(xcb_connection_t * c,xcb_randr_query_provider_property_cookie_t cookie,xcb_generic_error_t ** e)4314 xcb_randr_query_provider_property_reply (xcb_connection_t                            *c  /**< */,
4315                                          xcb_randr_query_provider_property_cookie_t   cookie  /**< */,
4316                                          xcb_generic_error_t                        **e  /**< */)
4317 {
4318     return (xcb_randr_query_provider_property_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
4319 }
4320 
4321 int
xcb_randr_configure_provider_property_sizeof(const void * _buffer,uint32_t values_len)4322 xcb_randr_configure_provider_property_sizeof (const void  *_buffer  /**< */,
4323                                               uint32_t     values_len  /**< */)
4324 {
4325     char *xcb_tmp = (char *)_buffer;
4326     unsigned int xcb_buffer_len = 0;
4327     unsigned int xcb_block_len = 0;
4328     unsigned int xcb_pad = 0;
4329     unsigned int xcb_align_to = 0;
4330 
4331 
4332     xcb_block_len += sizeof(xcb_randr_configure_provider_property_request_t);
4333     xcb_tmp += xcb_block_len;
4334     xcb_buffer_len += xcb_block_len;
4335     xcb_block_len = 0;
4336     /* values */
4337     xcb_block_len += values_len * sizeof(int32_t);
4338     xcb_tmp += xcb_block_len;
4339     xcb_align_to = ALIGNOF(int32_t);
4340     /* insert padding */
4341     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4342     xcb_buffer_len += xcb_block_len + xcb_pad;
4343     if (0 != xcb_pad) {
4344         xcb_tmp += xcb_pad;
4345         xcb_pad = 0;
4346     }
4347     xcb_block_len = 0;
4348 
4349     return xcb_buffer_len;
4350 }
4351 
4352 xcb_void_cookie_t
xcb_randr_configure_provider_property_checked(xcb_connection_t * c,xcb_randr_provider_t provider,xcb_atom_t property,uint8_t pending,uint8_t range,uint32_t values_len,const int32_t * values)4353 xcb_randr_configure_provider_property_checked (xcb_connection_t     *c  /**< */,
4354                                                xcb_randr_provider_t  provider  /**< */,
4355                                                xcb_atom_t            property  /**< */,
4356                                                uint8_t               pending  /**< */,
4357                                                uint8_t               range  /**< */,
4358                                                uint32_t              values_len  /**< */,
4359                                                const int32_t        *values  /**< */)
4360 {
4361     static const xcb_protocol_request_t xcb_req = {
4362         /* count */ 4,
4363         /* ext */ &xcb_randr_id,
4364         /* opcode */ XCB_RANDR_CONFIGURE_PROVIDER_PROPERTY,
4365         /* isvoid */ 1
4366     };
4367 
4368     struct iovec xcb_parts[6];
4369     xcb_void_cookie_t xcb_ret;
4370     xcb_randr_configure_provider_property_request_t xcb_out;
4371 
4372     xcb_out.provider = provider;
4373     xcb_out.property = property;
4374     xcb_out.pending = pending;
4375     xcb_out.range = range;
4376     memset(xcb_out.pad0, 0, 2);
4377 
4378     xcb_parts[2].iov_base = (char *) &xcb_out;
4379     xcb_parts[2].iov_len = sizeof(xcb_out);
4380     xcb_parts[3].iov_base = 0;
4381     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4382     /* int32_t values */
4383     xcb_parts[4].iov_base = (char *) values;
4384     xcb_parts[4].iov_len = values_len * sizeof(int32_t);
4385     xcb_parts[5].iov_base = 0;
4386     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
4387 
4388     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
4389     return xcb_ret;
4390 }
4391 
4392 xcb_void_cookie_t
xcb_randr_configure_provider_property(xcb_connection_t * c,xcb_randr_provider_t provider,xcb_atom_t property,uint8_t pending,uint8_t range,uint32_t values_len,const int32_t * values)4393 xcb_randr_configure_provider_property (xcb_connection_t     *c  /**< */,
4394                                        xcb_randr_provider_t  provider  /**< */,
4395                                        xcb_atom_t            property  /**< */,
4396                                        uint8_t               pending  /**< */,
4397                                        uint8_t               range  /**< */,
4398                                        uint32_t              values_len  /**< */,
4399                                        const int32_t        *values  /**< */)
4400 {
4401     static const xcb_protocol_request_t xcb_req = {
4402         /* count */ 4,
4403         /* ext */ &xcb_randr_id,
4404         /* opcode */ XCB_RANDR_CONFIGURE_PROVIDER_PROPERTY,
4405         /* isvoid */ 1
4406     };
4407 
4408     struct iovec xcb_parts[6];
4409     xcb_void_cookie_t xcb_ret;
4410     xcb_randr_configure_provider_property_request_t xcb_out;
4411 
4412     xcb_out.provider = provider;
4413     xcb_out.property = property;
4414     xcb_out.pending = pending;
4415     xcb_out.range = range;
4416     memset(xcb_out.pad0, 0, 2);
4417 
4418     xcb_parts[2].iov_base = (char *) &xcb_out;
4419     xcb_parts[2].iov_len = sizeof(xcb_out);
4420     xcb_parts[3].iov_base = 0;
4421     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4422     /* int32_t values */
4423     xcb_parts[4].iov_base = (char *) values;
4424     xcb_parts[4].iov_len = values_len * sizeof(int32_t);
4425     xcb_parts[5].iov_base = 0;
4426     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
4427 
4428     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
4429     return xcb_ret;
4430 }
4431 
4432 int
xcb_randr_change_provider_property_sizeof(const void * _buffer)4433 xcb_randr_change_provider_property_sizeof (const void  *_buffer  /**< */)
4434 {
4435     char *xcb_tmp = (char *)_buffer;
4436     const xcb_randr_change_provider_property_request_t *_aux = (xcb_randr_change_provider_property_request_t *)_buffer;
4437     unsigned int xcb_buffer_len = 0;
4438     unsigned int xcb_block_len = 0;
4439     unsigned int xcb_pad = 0;
4440     unsigned int xcb_align_to = 0;
4441 
4442 
4443     xcb_block_len += sizeof(xcb_randr_change_provider_property_request_t);
4444     xcb_tmp += xcb_block_len;
4445     xcb_buffer_len += xcb_block_len;
4446     xcb_block_len = 0;
4447     /* data */
4448     xcb_block_len += (_aux->num_items * (_aux->format / 8)) * sizeof(char);
4449     xcb_tmp += xcb_block_len;
4450     xcb_align_to = ALIGNOF(char);
4451     /* insert padding */
4452     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4453     xcb_buffer_len += xcb_block_len + xcb_pad;
4454     if (0 != xcb_pad) {
4455         xcb_tmp += xcb_pad;
4456         xcb_pad = 0;
4457     }
4458     xcb_block_len = 0;
4459 
4460     return xcb_buffer_len;
4461 }
4462 
4463 xcb_void_cookie_t
xcb_randr_change_provider_property_checked(xcb_connection_t * c,xcb_randr_provider_t provider,xcb_atom_t property,xcb_atom_t type,uint8_t format,uint8_t mode,uint32_t num_items,const void * data)4464 xcb_randr_change_provider_property_checked (xcb_connection_t     *c  /**< */,
4465                                             xcb_randr_provider_t  provider  /**< */,
4466                                             xcb_atom_t            property  /**< */,
4467                                             xcb_atom_t            type  /**< */,
4468                                             uint8_t               format  /**< */,
4469                                             uint8_t               mode  /**< */,
4470                                             uint32_t              num_items  /**< */,
4471                                             const void           *data  /**< */)
4472 {
4473     static const xcb_protocol_request_t xcb_req = {
4474         /* count */ 4,
4475         /* ext */ &xcb_randr_id,
4476         /* opcode */ XCB_RANDR_CHANGE_PROVIDER_PROPERTY,
4477         /* isvoid */ 1
4478     };
4479 
4480     struct iovec xcb_parts[6];
4481     xcb_void_cookie_t xcb_ret;
4482     xcb_randr_change_provider_property_request_t xcb_out;
4483 
4484     xcb_out.provider = provider;
4485     xcb_out.property = property;
4486     xcb_out.type = type;
4487     xcb_out.format = format;
4488     xcb_out.mode = mode;
4489     memset(xcb_out.pad0, 0, 2);
4490     xcb_out.num_items = num_items;
4491 
4492     xcb_parts[2].iov_base = (char *) &xcb_out;
4493     xcb_parts[2].iov_len = sizeof(xcb_out);
4494     xcb_parts[3].iov_base = 0;
4495     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4496     /* void data */
4497     xcb_parts[4].iov_base = (char *) data;
4498     xcb_parts[4].iov_len = (num_items * (format / 8)) * sizeof(char);
4499     xcb_parts[5].iov_base = 0;
4500     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
4501 
4502     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
4503     return xcb_ret;
4504 }
4505 
4506 xcb_void_cookie_t
xcb_randr_change_provider_property(xcb_connection_t * c,xcb_randr_provider_t provider,xcb_atom_t property,xcb_atom_t type,uint8_t format,uint8_t mode,uint32_t num_items,const void * data)4507 xcb_randr_change_provider_property (xcb_connection_t     *c  /**< */,
4508                                     xcb_randr_provider_t  provider  /**< */,
4509                                     xcb_atom_t            property  /**< */,
4510                                     xcb_atom_t            type  /**< */,
4511                                     uint8_t               format  /**< */,
4512                                     uint8_t               mode  /**< */,
4513                                     uint32_t              num_items  /**< */,
4514                                     const void           *data  /**< */)
4515 {
4516     static const xcb_protocol_request_t xcb_req = {
4517         /* count */ 4,
4518         /* ext */ &xcb_randr_id,
4519         /* opcode */ XCB_RANDR_CHANGE_PROVIDER_PROPERTY,
4520         /* isvoid */ 1
4521     };
4522 
4523     struct iovec xcb_parts[6];
4524     xcb_void_cookie_t xcb_ret;
4525     xcb_randr_change_provider_property_request_t xcb_out;
4526 
4527     xcb_out.provider = provider;
4528     xcb_out.property = property;
4529     xcb_out.type = type;
4530     xcb_out.format = format;
4531     xcb_out.mode = mode;
4532     memset(xcb_out.pad0, 0, 2);
4533     xcb_out.num_items = num_items;
4534 
4535     xcb_parts[2].iov_base = (char *) &xcb_out;
4536     xcb_parts[2].iov_len = sizeof(xcb_out);
4537     xcb_parts[3].iov_base = 0;
4538     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4539     /* void data */
4540     xcb_parts[4].iov_base = (char *) data;
4541     xcb_parts[4].iov_len = (num_items * (format / 8)) * sizeof(char);
4542     xcb_parts[5].iov_base = 0;
4543     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
4544 
4545     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
4546     return xcb_ret;
4547 }
4548 
4549 xcb_void_cookie_t
xcb_randr_delete_provider_property_checked(xcb_connection_t * c,xcb_randr_provider_t provider,xcb_atom_t property)4550 xcb_randr_delete_provider_property_checked (xcb_connection_t     *c  /**< */,
4551                                             xcb_randr_provider_t  provider  /**< */,
4552                                             xcb_atom_t            property  /**< */)
4553 {
4554     static const xcb_protocol_request_t xcb_req = {
4555         /* count */ 2,
4556         /* ext */ &xcb_randr_id,
4557         /* opcode */ XCB_RANDR_DELETE_PROVIDER_PROPERTY,
4558         /* isvoid */ 1
4559     };
4560 
4561     struct iovec xcb_parts[4];
4562     xcb_void_cookie_t xcb_ret;
4563     xcb_randr_delete_provider_property_request_t xcb_out;
4564 
4565     xcb_out.provider = provider;
4566     xcb_out.property = property;
4567 
4568     xcb_parts[2].iov_base = (char *) &xcb_out;
4569     xcb_parts[2].iov_len = sizeof(xcb_out);
4570     xcb_parts[3].iov_base = 0;
4571     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4572 
4573     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
4574     return xcb_ret;
4575 }
4576 
4577 xcb_void_cookie_t
xcb_randr_delete_provider_property(xcb_connection_t * c,xcb_randr_provider_t provider,xcb_atom_t property)4578 xcb_randr_delete_provider_property (xcb_connection_t     *c  /**< */,
4579                                     xcb_randr_provider_t  provider  /**< */,
4580                                     xcb_atom_t            property  /**< */)
4581 {
4582     static const xcb_protocol_request_t xcb_req = {
4583         /* count */ 2,
4584         /* ext */ &xcb_randr_id,
4585         /* opcode */ XCB_RANDR_DELETE_PROVIDER_PROPERTY,
4586         /* isvoid */ 1
4587     };
4588 
4589     struct iovec xcb_parts[4];
4590     xcb_void_cookie_t xcb_ret;
4591     xcb_randr_delete_provider_property_request_t xcb_out;
4592 
4593     xcb_out.provider = provider;
4594     xcb_out.property = property;
4595 
4596     xcb_parts[2].iov_base = (char *) &xcb_out;
4597     xcb_parts[2].iov_len = sizeof(xcb_out);
4598     xcb_parts[3].iov_base = 0;
4599     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4600 
4601     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
4602     return xcb_ret;
4603 }
4604 
4605 int
xcb_randr_get_provider_property_sizeof(const void * _buffer)4606 xcb_randr_get_provider_property_sizeof (const void  *_buffer  /**< */)
4607 {
4608     char *xcb_tmp = (char *)_buffer;
4609     const xcb_randr_get_provider_property_reply_t *_aux = (xcb_randr_get_provider_property_reply_t *)_buffer;
4610     unsigned int xcb_buffer_len = 0;
4611     unsigned int xcb_block_len = 0;
4612     unsigned int xcb_pad = 0;
4613     unsigned int xcb_align_to = 0;
4614 
4615 
4616     xcb_block_len += sizeof(xcb_randr_get_provider_property_reply_t);
4617     xcb_tmp += xcb_block_len;
4618     xcb_buffer_len += xcb_block_len;
4619     xcb_block_len = 0;
4620     /* data */
4621     xcb_block_len += (_aux->num_items * (_aux->format / 8)) * sizeof(char);
4622     xcb_tmp += xcb_block_len;
4623     xcb_align_to = ALIGNOF(char);
4624     /* insert padding */
4625     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4626     xcb_buffer_len += xcb_block_len + xcb_pad;
4627     if (0 != xcb_pad) {
4628         xcb_tmp += xcb_pad;
4629         xcb_pad = 0;
4630     }
4631     xcb_block_len = 0;
4632 
4633     return xcb_buffer_len;
4634 }
4635 
4636 xcb_randr_get_provider_property_cookie_t
xcb_randr_get_provider_property(xcb_connection_t * c,xcb_randr_provider_t provider,xcb_atom_t property,xcb_atom_t type,uint32_t long_offset,uint32_t long_length,uint8_t _delete,uint8_t pending)4637 xcb_randr_get_provider_property (xcb_connection_t     *c  /**< */,
4638                                  xcb_randr_provider_t  provider  /**< */,
4639                                  xcb_atom_t            property  /**< */,
4640                                  xcb_atom_t            type  /**< */,
4641                                  uint32_t              long_offset  /**< */,
4642                                  uint32_t              long_length  /**< */,
4643                                  uint8_t               _delete  /**< */,
4644                                  uint8_t               pending  /**< */)
4645 {
4646     static const xcb_protocol_request_t xcb_req = {
4647         /* count */ 2,
4648         /* ext */ &xcb_randr_id,
4649         /* opcode */ XCB_RANDR_GET_PROVIDER_PROPERTY,
4650         /* isvoid */ 0
4651     };
4652 
4653     struct iovec xcb_parts[4];
4654     xcb_randr_get_provider_property_cookie_t xcb_ret;
4655     xcb_randr_get_provider_property_request_t xcb_out;
4656 
4657     xcb_out.provider = provider;
4658     xcb_out.property = property;
4659     xcb_out.type = type;
4660     xcb_out.long_offset = long_offset;
4661     xcb_out.long_length = long_length;
4662     xcb_out._delete = _delete;
4663     xcb_out.pending = pending;
4664     memset(xcb_out.pad0, 0, 2);
4665 
4666     xcb_parts[2].iov_base = (char *) &xcb_out;
4667     xcb_parts[2].iov_len = sizeof(xcb_out);
4668     xcb_parts[3].iov_base = 0;
4669     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4670 
4671     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
4672     return xcb_ret;
4673 }
4674 
4675 xcb_randr_get_provider_property_cookie_t
xcb_randr_get_provider_property_unchecked(xcb_connection_t * c,xcb_randr_provider_t provider,xcb_atom_t property,xcb_atom_t type,uint32_t long_offset,uint32_t long_length,uint8_t _delete,uint8_t pending)4676 xcb_randr_get_provider_property_unchecked (xcb_connection_t     *c  /**< */,
4677                                            xcb_randr_provider_t  provider  /**< */,
4678                                            xcb_atom_t            property  /**< */,
4679                                            xcb_atom_t            type  /**< */,
4680                                            uint32_t              long_offset  /**< */,
4681                                            uint32_t              long_length  /**< */,
4682                                            uint8_t               _delete  /**< */,
4683                                            uint8_t               pending  /**< */)
4684 {
4685     static const xcb_protocol_request_t xcb_req = {
4686         /* count */ 2,
4687         /* ext */ &xcb_randr_id,
4688         /* opcode */ XCB_RANDR_GET_PROVIDER_PROPERTY,
4689         /* isvoid */ 0
4690     };
4691 
4692     struct iovec xcb_parts[4];
4693     xcb_randr_get_provider_property_cookie_t xcb_ret;
4694     xcb_randr_get_provider_property_request_t xcb_out;
4695 
4696     xcb_out.provider = provider;
4697     xcb_out.property = property;
4698     xcb_out.type = type;
4699     xcb_out.long_offset = long_offset;
4700     xcb_out.long_length = long_length;
4701     xcb_out._delete = _delete;
4702     xcb_out.pending = pending;
4703     memset(xcb_out.pad0, 0, 2);
4704 
4705     xcb_parts[2].iov_base = (char *) &xcb_out;
4706     xcb_parts[2].iov_len = sizeof(xcb_out);
4707     xcb_parts[3].iov_base = 0;
4708     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4709 
4710     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
4711     return xcb_ret;
4712 }
4713 
4714 void *
xcb_randr_get_provider_property_data(const xcb_randr_get_provider_property_reply_t * R)4715 xcb_randr_get_provider_property_data (const xcb_randr_get_provider_property_reply_t *R  /**< */)
4716 {
4717     return (void *) (R + 1);
4718 }
4719 
4720 int
xcb_randr_get_provider_property_data_length(const xcb_randr_get_provider_property_reply_t * R)4721 xcb_randr_get_provider_property_data_length (const xcb_randr_get_provider_property_reply_t *R  /**< */)
4722 {
4723     return (R->num_items * (R->format / 8));
4724 }
4725 
4726 xcb_generic_iterator_t
xcb_randr_get_provider_property_data_end(const xcb_randr_get_provider_property_reply_t * R)4727 xcb_randr_get_provider_property_data_end (const xcb_randr_get_provider_property_reply_t *R  /**< */)
4728 {
4729     xcb_generic_iterator_t i;
4730     i.data = ((char *) (R + 1)) + ((R->num_items * (R->format / 8)));
4731     i.rem = 0;
4732     i.index = (char *) i.data - (char *) R;
4733     return i;
4734 }
4735 
4736 xcb_randr_get_provider_property_reply_t *
xcb_randr_get_provider_property_reply(xcb_connection_t * c,xcb_randr_get_provider_property_cookie_t cookie,xcb_generic_error_t ** e)4737 xcb_randr_get_provider_property_reply (xcb_connection_t                          *c  /**< */,
4738                                        xcb_randr_get_provider_property_cookie_t   cookie  /**< */,
4739                                        xcb_generic_error_t                      **e  /**< */)
4740 {
4741     return (xcb_randr_get_provider_property_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
4742 }
4743 
4744 void
xcb_randr_crtc_change_next(xcb_randr_crtc_change_iterator_t * i)4745 xcb_randr_crtc_change_next (xcb_randr_crtc_change_iterator_t *i  /**< */)
4746 {
4747     --i->rem;
4748     ++i->data;
4749     i->index += sizeof(xcb_randr_crtc_change_t);
4750 }
4751 
4752 xcb_generic_iterator_t
xcb_randr_crtc_change_end(xcb_randr_crtc_change_iterator_t i)4753 xcb_randr_crtc_change_end (xcb_randr_crtc_change_iterator_t i  /**< */)
4754 {
4755     xcb_generic_iterator_t ret;
4756     ret.data = i.data + i.rem;
4757     ret.index = i.index + ((char *) ret.data - (char *) i.data);
4758     ret.rem = 0;
4759     return ret;
4760 }
4761 
4762 void
xcb_randr_output_change_next(xcb_randr_output_change_iterator_t * i)4763 xcb_randr_output_change_next (xcb_randr_output_change_iterator_t *i  /**< */)
4764 {
4765     --i->rem;
4766     ++i->data;
4767     i->index += sizeof(xcb_randr_output_change_t);
4768 }
4769 
4770 xcb_generic_iterator_t
xcb_randr_output_change_end(xcb_randr_output_change_iterator_t i)4771 xcb_randr_output_change_end (xcb_randr_output_change_iterator_t i  /**< */)
4772 {
4773     xcb_generic_iterator_t ret;
4774     ret.data = i.data + i.rem;
4775     ret.index = i.index + ((char *) ret.data - (char *) i.data);
4776     ret.rem = 0;
4777     return ret;
4778 }
4779 
4780 void
xcb_randr_output_property_next(xcb_randr_output_property_iterator_t * i)4781 xcb_randr_output_property_next (xcb_randr_output_property_iterator_t *i  /**< */)
4782 {
4783     --i->rem;
4784     ++i->data;
4785     i->index += sizeof(xcb_randr_output_property_t);
4786 }
4787 
4788 xcb_generic_iterator_t
xcb_randr_output_property_end(xcb_randr_output_property_iterator_t i)4789 xcb_randr_output_property_end (xcb_randr_output_property_iterator_t i  /**< */)
4790 {
4791     xcb_generic_iterator_t ret;
4792     ret.data = i.data + i.rem;
4793     ret.index = i.index + ((char *) ret.data - (char *) i.data);
4794     ret.rem = 0;
4795     return ret;
4796 }
4797 
4798 void
xcb_randr_provider_change_next(xcb_randr_provider_change_iterator_t * i)4799 xcb_randr_provider_change_next (xcb_randr_provider_change_iterator_t *i  /**< */)
4800 {
4801     --i->rem;
4802     ++i->data;
4803     i->index += sizeof(xcb_randr_provider_change_t);
4804 }
4805 
4806 xcb_generic_iterator_t
xcb_randr_provider_change_end(xcb_randr_provider_change_iterator_t i)4807 xcb_randr_provider_change_end (xcb_randr_provider_change_iterator_t i  /**< */)
4808 {
4809     xcb_generic_iterator_t ret;
4810     ret.data = i.data + i.rem;
4811     ret.index = i.index + ((char *) ret.data - (char *) i.data);
4812     ret.rem = 0;
4813     return ret;
4814 }
4815 
4816 void
xcb_randr_provider_property_next(xcb_randr_provider_property_iterator_t * i)4817 xcb_randr_provider_property_next (xcb_randr_provider_property_iterator_t *i  /**< */)
4818 {
4819     --i->rem;
4820     ++i->data;
4821     i->index += sizeof(xcb_randr_provider_property_t);
4822 }
4823 
4824 xcb_generic_iterator_t
xcb_randr_provider_property_end(xcb_randr_provider_property_iterator_t i)4825 xcb_randr_provider_property_end (xcb_randr_provider_property_iterator_t i  /**< */)
4826 {
4827     xcb_generic_iterator_t ret;
4828     ret.data = i.data + i.rem;
4829     ret.index = i.index + ((char *) ret.data - (char *) i.data);
4830     ret.rem = 0;
4831     return ret;
4832 }
4833 
4834 void
xcb_randr_resource_change_next(xcb_randr_resource_change_iterator_t * i)4835 xcb_randr_resource_change_next (xcb_randr_resource_change_iterator_t *i  /**< */)
4836 {
4837     --i->rem;
4838     ++i->data;
4839     i->index += sizeof(xcb_randr_resource_change_t);
4840 }
4841 
4842 xcb_generic_iterator_t
xcb_randr_resource_change_end(xcb_randr_resource_change_iterator_t i)4843 xcb_randr_resource_change_end (xcb_randr_resource_change_iterator_t i  /**< */)
4844 {
4845     xcb_generic_iterator_t ret;
4846     ret.data = i.data + i.rem;
4847     ret.index = i.index + ((char *) ret.data - (char *) i.data);
4848     ret.rem = 0;
4849     return ret;
4850 }
4851 
4852 void
xcb_randr_notify_data_next(xcb_randr_notify_data_iterator_t * i)4853 xcb_randr_notify_data_next (xcb_randr_notify_data_iterator_t *i  /**< */)
4854 {
4855     --i->rem;
4856     ++i->data;
4857     i->index += sizeof(xcb_randr_notify_data_t);
4858 }
4859 
4860 xcb_generic_iterator_t
xcb_randr_notify_data_end(xcb_randr_notify_data_iterator_t i)4861 xcb_randr_notify_data_end (xcb_randr_notify_data_iterator_t i  /**< */)
4862 {
4863     xcb_generic_iterator_t ret;
4864     ret.data = i.data + i.rem;
4865     ret.index = i.index + ((char *) ret.data - (char *) i.data);
4866     ret.rem = 0;
4867     return ret;
4868 }
4869 
4870