xref: /netbsd-src/external/mit/xorg/lib/libxcb/files/shape.c (revision b7b7574d3bf8eeb51a1fa3977b59142ec6434a55)
1 /*
2  * This file generated automatically from shape.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 "shape.h"
15 
16 #define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member)
17 #include "xproto.h"
18 
19 xcb_extension_t xcb_shape_id = { "SHAPE", 0 };
20 
21 
22 /*****************************************************************************
23  **
24  ** void xcb_shape_op_next
25  **
26  ** @param xcb_shape_op_iterator_t *i
27  ** @returns void
28  **
29  *****************************************************************************/
30 
31 void
32 xcb_shape_op_next (xcb_shape_op_iterator_t *i  /**< */)
33 {
34     --i->rem;
35     ++i->data;
36     i->index += sizeof(xcb_shape_op_t);
37 }
38 
39 
40 /*****************************************************************************
41  **
42  ** xcb_generic_iterator_t xcb_shape_op_end
43  **
44  ** @param xcb_shape_op_iterator_t i
45  ** @returns xcb_generic_iterator_t
46  **
47  *****************************************************************************/
48 
49 xcb_generic_iterator_t
50 xcb_shape_op_end (xcb_shape_op_iterator_t i  /**< */)
51 {
52     xcb_generic_iterator_t ret;
53     ret.data = i.data + i.rem;
54     ret.index = i.index + ((char *) ret.data - (char *) i.data);
55     ret.rem = 0;
56     return ret;
57 }
58 
59 
60 /*****************************************************************************
61  **
62  ** void xcb_shape_kind_next
63  **
64  ** @param xcb_shape_kind_iterator_t *i
65  ** @returns void
66  **
67  *****************************************************************************/
68 
69 void
70 xcb_shape_kind_next (xcb_shape_kind_iterator_t *i  /**< */)
71 {
72     --i->rem;
73     ++i->data;
74     i->index += sizeof(xcb_shape_kind_t);
75 }
76 
77 
78 /*****************************************************************************
79  **
80  ** xcb_generic_iterator_t xcb_shape_kind_end
81  **
82  ** @param xcb_shape_kind_iterator_t i
83  ** @returns xcb_generic_iterator_t
84  **
85  *****************************************************************************/
86 
87 xcb_generic_iterator_t
88 xcb_shape_kind_end (xcb_shape_kind_iterator_t i  /**< */)
89 {
90     xcb_generic_iterator_t ret;
91     ret.data = i.data + i.rem;
92     ret.index = i.index + ((char *) ret.data - (char *) i.data);
93     ret.rem = 0;
94     return ret;
95 }
96 
97 
98 /*****************************************************************************
99  **
100  ** xcb_shape_query_version_cookie_t xcb_shape_query_version
101  **
102  ** @param xcb_connection_t *c
103  ** @returns xcb_shape_query_version_cookie_t
104  **
105  *****************************************************************************/
106 
107 xcb_shape_query_version_cookie_t
108 xcb_shape_query_version (xcb_connection_t *c  /**< */)
109 {
110     static const xcb_protocol_request_t xcb_req = {
111         /* count */ 2,
112         /* ext */ &xcb_shape_id,
113         /* opcode */ XCB_SHAPE_QUERY_VERSION,
114         /* isvoid */ 0
115     };
116 
117     struct iovec xcb_parts[4];
118     xcb_shape_query_version_cookie_t xcb_ret;
119     xcb_shape_query_version_request_t xcb_out;
120 
121 
122     xcb_parts[2].iov_base = (char *) &xcb_out;
123     xcb_parts[2].iov_len = sizeof(xcb_out);
124     xcb_parts[3].iov_base = 0;
125     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
126 
127     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
128     return xcb_ret;
129 }
130 
131 
132 /*****************************************************************************
133  **
134  ** xcb_shape_query_version_cookie_t xcb_shape_query_version_unchecked
135  **
136  ** @param xcb_connection_t *c
137  ** @returns xcb_shape_query_version_cookie_t
138  **
139  *****************************************************************************/
140 
141 xcb_shape_query_version_cookie_t
142 xcb_shape_query_version_unchecked (xcb_connection_t *c  /**< */)
143 {
144     static const xcb_protocol_request_t xcb_req = {
145         /* count */ 2,
146         /* ext */ &xcb_shape_id,
147         /* opcode */ XCB_SHAPE_QUERY_VERSION,
148         /* isvoid */ 0
149     };
150 
151     struct iovec xcb_parts[4];
152     xcb_shape_query_version_cookie_t xcb_ret;
153     xcb_shape_query_version_request_t xcb_out;
154 
155 
156     xcb_parts[2].iov_base = (char *) &xcb_out;
157     xcb_parts[2].iov_len = sizeof(xcb_out);
158     xcb_parts[3].iov_base = 0;
159     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
160 
161     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
162     return xcb_ret;
163 }
164 
165 
166 /*****************************************************************************
167  **
168  ** xcb_shape_query_version_reply_t * xcb_shape_query_version_reply
169  **
170  ** @param xcb_connection_t                  *c
171  ** @param xcb_shape_query_version_cookie_t   cookie
172  ** @param xcb_generic_error_t              **e
173  ** @returns xcb_shape_query_version_reply_t *
174  **
175  *****************************************************************************/
176 
177 xcb_shape_query_version_reply_t *
178 xcb_shape_query_version_reply (xcb_connection_t                  *c  /**< */,
179                                xcb_shape_query_version_cookie_t   cookie  /**< */,
180                                xcb_generic_error_t              **e  /**< */)
181 {
182     return (xcb_shape_query_version_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
183 }
184 
185 int
186 xcb_shape_rectangles_sizeof (const void  *_buffer  /**< */,
187                              uint32_t     rectangles_len  /**< */)
188 {
189     char *xcb_tmp = (char *)_buffer;
190     unsigned int xcb_buffer_len = 0;
191     unsigned int xcb_block_len = 0;
192     unsigned int xcb_pad = 0;
193     unsigned int xcb_align_to = 0;
194 
195 
196     xcb_block_len += sizeof(xcb_shape_rectangles_request_t);
197     xcb_tmp += xcb_block_len;
198     xcb_buffer_len += xcb_block_len;
199     xcb_block_len = 0;
200     /* rectangles */
201     xcb_block_len += rectangles_len * sizeof(xcb_rectangle_t);
202     xcb_tmp += xcb_block_len;
203     xcb_align_to = ALIGNOF(xcb_rectangle_t);
204     /* insert padding */
205     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
206     xcb_buffer_len += xcb_block_len + xcb_pad;
207     if (0 != xcb_pad) {
208         xcb_tmp += xcb_pad;
209         xcb_pad = 0;
210     }
211     xcb_block_len = 0;
212 
213     return xcb_buffer_len;
214 }
215 
216 
217 /*****************************************************************************
218  **
219  ** xcb_void_cookie_t xcb_shape_rectangles_checked
220  **
221  ** @param xcb_connection_t      *c
222  ** @param xcb_shape_op_t         operation
223  ** @param xcb_shape_kind_t       destination_kind
224  ** @param uint8_t                ordering
225  ** @param xcb_window_t           destination_window
226  ** @param int16_t                x_offset
227  ** @param int16_t                y_offset
228  ** @param uint32_t               rectangles_len
229  ** @param const xcb_rectangle_t *rectangles
230  ** @returns xcb_void_cookie_t
231  **
232  *****************************************************************************/
233 
234 xcb_void_cookie_t
235 xcb_shape_rectangles_checked (xcb_connection_t      *c  /**< */,
236                               xcb_shape_op_t         operation  /**< */,
237                               xcb_shape_kind_t       destination_kind  /**< */,
238                               uint8_t                ordering  /**< */,
239                               xcb_window_t           destination_window  /**< */,
240                               int16_t                x_offset  /**< */,
241                               int16_t                y_offset  /**< */,
242                               uint32_t               rectangles_len  /**< */,
243                               const xcb_rectangle_t *rectangles  /**< */)
244 {
245     static const xcb_protocol_request_t xcb_req = {
246         /* count */ 4,
247         /* ext */ &xcb_shape_id,
248         /* opcode */ XCB_SHAPE_RECTANGLES,
249         /* isvoid */ 1
250     };
251 
252     struct iovec xcb_parts[6];
253     xcb_void_cookie_t xcb_ret;
254     xcb_shape_rectangles_request_t xcb_out;
255 
256     xcb_out.operation = operation;
257     xcb_out.destination_kind = destination_kind;
258     xcb_out.ordering = ordering;
259     xcb_out.pad0 = 0;
260     xcb_out.destination_window = destination_window;
261     xcb_out.x_offset = x_offset;
262     xcb_out.y_offset = y_offset;
263 
264     xcb_parts[2].iov_base = (char *) &xcb_out;
265     xcb_parts[2].iov_len = sizeof(xcb_out);
266     xcb_parts[3].iov_base = 0;
267     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
268     /* xcb_rectangle_t rectangles */
269     xcb_parts[4].iov_base = (char *) rectangles;
270     xcb_parts[4].iov_len = rectangles_len * sizeof(xcb_rectangle_t);
271     xcb_parts[5].iov_base = 0;
272     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
273 
274     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
275     return xcb_ret;
276 }
277 
278 
279 /*****************************************************************************
280  **
281  ** xcb_void_cookie_t xcb_shape_rectangles
282  **
283  ** @param xcb_connection_t      *c
284  ** @param xcb_shape_op_t         operation
285  ** @param xcb_shape_kind_t       destination_kind
286  ** @param uint8_t                ordering
287  ** @param xcb_window_t           destination_window
288  ** @param int16_t                x_offset
289  ** @param int16_t                y_offset
290  ** @param uint32_t               rectangles_len
291  ** @param const xcb_rectangle_t *rectangles
292  ** @returns xcb_void_cookie_t
293  **
294  *****************************************************************************/
295 
296 xcb_void_cookie_t
297 xcb_shape_rectangles (xcb_connection_t      *c  /**< */,
298                       xcb_shape_op_t         operation  /**< */,
299                       xcb_shape_kind_t       destination_kind  /**< */,
300                       uint8_t                ordering  /**< */,
301                       xcb_window_t           destination_window  /**< */,
302                       int16_t                x_offset  /**< */,
303                       int16_t                y_offset  /**< */,
304                       uint32_t               rectangles_len  /**< */,
305                       const xcb_rectangle_t *rectangles  /**< */)
306 {
307     static const xcb_protocol_request_t xcb_req = {
308         /* count */ 4,
309         /* ext */ &xcb_shape_id,
310         /* opcode */ XCB_SHAPE_RECTANGLES,
311         /* isvoid */ 1
312     };
313 
314     struct iovec xcb_parts[6];
315     xcb_void_cookie_t xcb_ret;
316     xcb_shape_rectangles_request_t xcb_out;
317 
318     xcb_out.operation = operation;
319     xcb_out.destination_kind = destination_kind;
320     xcb_out.ordering = ordering;
321     xcb_out.pad0 = 0;
322     xcb_out.destination_window = destination_window;
323     xcb_out.x_offset = x_offset;
324     xcb_out.y_offset = y_offset;
325 
326     xcb_parts[2].iov_base = (char *) &xcb_out;
327     xcb_parts[2].iov_len = sizeof(xcb_out);
328     xcb_parts[3].iov_base = 0;
329     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
330     /* xcb_rectangle_t rectangles */
331     xcb_parts[4].iov_base = (char *) rectangles;
332     xcb_parts[4].iov_len = rectangles_len * sizeof(xcb_rectangle_t);
333     xcb_parts[5].iov_base = 0;
334     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
335 
336     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
337     return xcb_ret;
338 }
339 
340 
341 /*****************************************************************************
342  **
343  ** xcb_void_cookie_t xcb_shape_mask_checked
344  **
345  ** @param xcb_connection_t *c
346  ** @param xcb_shape_op_t    operation
347  ** @param xcb_shape_kind_t  destination_kind
348  ** @param xcb_window_t      destination_window
349  ** @param int16_t           x_offset
350  ** @param int16_t           y_offset
351  ** @param xcb_pixmap_t      source_bitmap
352  ** @returns xcb_void_cookie_t
353  **
354  *****************************************************************************/
355 
356 xcb_void_cookie_t
357 xcb_shape_mask_checked (xcb_connection_t *c  /**< */,
358                         xcb_shape_op_t    operation  /**< */,
359                         xcb_shape_kind_t  destination_kind  /**< */,
360                         xcb_window_t      destination_window  /**< */,
361                         int16_t           x_offset  /**< */,
362                         int16_t           y_offset  /**< */,
363                         xcb_pixmap_t      source_bitmap  /**< */)
364 {
365     static const xcb_protocol_request_t xcb_req = {
366         /* count */ 2,
367         /* ext */ &xcb_shape_id,
368         /* opcode */ XCB_SHAPE_MASK,
369         /* isvoid */ 1
370     };
371 
372     struct iovec xcb_parts[4];
373     xcb_void_cookie_t xcb_ret;
374     xcb_shape_mask_request_t xcb_out;
375 
376     xcb_out.operation = operation;
377     xcb_out.destination_kind = destination_kind;
378     memset(xcb_out.pad0, 0, 2);
379     xcb_out.destination_window = destination_window;
380     xcb_out.x_offset = x_offset;
381     xcb_out.y_offset = y_offset;
382     xcb_out.source_bitmap = source_bitmap;
383 
384     xcb_parts[2].iov_base = (char *) &xcb_out;
385     xcb_parts[2].iov_len = sizeof(xcb_out);
386     xcb_parts[3].iov_base = 0;
387     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
388 
389     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
390     return xcb_ret;
391 }
392 
393 
394 /*****************************************************************************
395  **
396  ** xcb_void_cookie_t xcb_shape_mask
397  **
398  ** @param xcb_connection_t *c
399  ** @param xcb_shape_op_t    operation
400  ** @param xcb_shape_kind_t  destination_kind
401  ** @param xcb_window_t      destination_window
402  ** @param int16_t           x_offset
403  ** @param int16_t           y_offset
404  ** @param xcb_pixmap_t      source_bitmap
405  ** @returns xcb_void_cookie_t
406  **
407  *****************************************************************************/
408 
409 xcb_void_cookie_t
410 xcb_shape_mask (xcb_connection_t *c  /**< */,
411                 xcb_shape_op_t    operation  /**< */,
412                 xcb_shape_kind_t  destination_kind  /**< */,
413                 xcb_window_t      destination_window  /**< */,
414                 int16_t           x_offset  /**< */,
415                 int16_t           y_offset  /**< */,
416                 xcb_pixmap_t      source_bitmap  /**< */)
417 {
418     static const xcb_protocol_request_t xcb_req = {
419         /* count */ 2,
420         /* ext */ &xcb_shape_id,
421         /* opcode */ XCB_SHAPE_MASK,
422         /* isvoid */ 1
423     };
424 
425     struct iovec xcb_parts[4];
426     xcb_void_cookie_t xcb_ret;
427     xcb_shape_mask_request_t xcb_out;
428 
429     xcb_out.operation = operation;
430     xcb_out.destination_kind = destination_kind;
431     memset(xcb_out.pad0, 0, 2);
432     xcb_out.destination_window = destination_window;
433     xcb_out.x_offset = x_offset;
434     xcb_out.y_offset = y_offset;
435     xcb_out.source_bitmap = source_bitmap;
436 
437     xcb_parts[2].iov_base = (char *) &xcb_out;
438     xcb_parts[2].iov_len = sizeof(xcb_out);
439     xcb_parts[3].iov_base = 0;
440     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
441 
442     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
443     return xcb_ret;
444 }
445 
446 
447 /*****************************************************************************
448  **
449  ** xcb_void_cookie_t xcb_shape_combine_checked
450  **
451  ** @param xcb_connection_t *c
452  ** @param xcb_shape_op_t    operation
453  ** @param xcb_shape_kind_t  destination_kind
454  ** @param xcb_shape_kind_t  source_kind
455  ** @param xcb_window_t      destination_window
456  ** @param int16_t           x_offset
457  ** @param int16_t           y_offset
458  ** @param xcb_window_t      source_window
459  ** @returns xcb_void_cookie_t
460  **
461  *****************************************************************************/
462 
463 xcb_void_cookie_t
464 xcb_shape_combine_checked (xcb_connection_t *c  /**< */,
465                            xcb_shape_op_t    operation  /**< */,
466                            xcb_shape_kind_t  destination_kind  /**< */,
467                            xcb_shape_kind_t  source_kind  /**< */,
468                            xcb_window_t      destination_window  /**< */,
469                            int16_t           x_offset  /**< */,
470                            int16_t           y_offset  /**< */,
471                            xcb_window_t      source_window  /**< */)
472 {
473     static const xcb_protocol_request_t xcb_req = {
474         /* count */ 2,
475         /* ext */ &xcb_shape_id,
476         /* opcode */ XCB_SHAPE_COMBINE,
477         /* isvoid */ 1
478     };
479 
480     struct iovec xcb_parts[4];
481     xcb_void_cookie_t xcb_ret;
482     xcb_shape_combine_request_t xcb_out;
483 
484     xcb_out.operation = operation;
485     xcb_out.destination_kind = destination_kind;
486     xcb_out.source_kind = source_kind;
487     xcb_out.pad0 = 0;
488     xcb_out.destination_window = destination_window;
489     xcb_out.x_offset = x_offset;
490     xcb_out.y_offset = y_offset;
491     xcb_out.source_window = source_window;
492 
493     xcb_parts[2].iov_base = (char *) &xcb_out;
494     xcb_parts[2].iov_len = sizeof(xcb_out);
495     xcb_parts[3].iov_base = 0;
496     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
497 
498     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
499     return xcb_ret;
500 }
501 
502 
503 /*****************************************************************************
504  **
505  ** xcb_void_cookie_t xcb_shape_combine
506  **
507  ** @param xcb_connection_t *c
508  ** @param xcb_shape_op_t    operation
509  ** @param xcb_shape_kind_t  destination_kind
510  ** @param xcb_shape_kind_t  source_kind
511  ** @param xcb_window_t      destination_window
512  ** @param int16_t           x_offset
513  ** @param int16_t           y_offset
514  ** @param xcb_window_t      source_window
515  ** @returns xcb_void_cookie_t
516  **
517  *****************************************************************************/
518 
519 xcb_void_cookie_t
520 xcb_shape_combine (xcb_connection_t *c  /**< */,
521                    xcb_shape_op_t    operation  /**< */,
522                    xcb_shape_kind_t  destination_kind  /**< */,
523                    xcb_shape_kind_t  source_kind  /**< */,
524                    xcb_window_t      destination_window  /**< */,
525                    int16_t           x_offset  /**< */,
526                    int16_t           y_offset  /**< */,
527                    xcb_window_t      source_window  /**< */)
528 {
529     static const xcb_protocol_request_t xcb_req = {
530         /* count */ 2,
531         /* ext */ &xcb_shape_id,
532         /* opcode */ XCB_SHAPE_COMBINE,
533         /* isvoid */ 1
534     };
535 
536     struct iovec xcb_parts[4];
537     xcb_void_cookie_t xcb_ret;
538     xcb_shape_combine_request_t xcb_out;
539 
540     xcb_out.operation = operation;
541     xcb_out.destination_kind = destination_kind;
542     xcb_out.source_kind = source_kind;
543     xcb_out.pad0 = 0;
544     xcb_out.destination_window = destination_window;
545     xcb_out.x_offset = x_offset;
546     xcb_out.y_offset = y_offset;
547     xcb_out.source_window = source_window;
548 
549     xcb_parts[2].iov_base = (char *) &xcb_out;
550     xcb_parts[2].iov_len = sizeof(xcb_out);
551     xcb_parts[3].iov_base = 0;
552     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
553 
554     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
555     return xcb_ret;
556 }
557 
558 
559 /*****************************************************************************
560  **
561  ** xcb_void_cookie_t xcb_shape_offset_checked
562  **
563  ** @param xcb_connection_t *c
564  ** @param xcb_shape_kind_t  destination_kind
565  ** @param xcb_window_t      destination_window
566  ** @param int16_t           x_offset
567  ** @param int16_t           y_offset
568  ** @returns xcb_void_cookie_t
569  **
570  *****************************************************************************/
571 
572 xcb_void_cookie_t
573 xcb_shape_offset_checked (xcb_connection_t *c  /**< */,
574                           xcb_shape_kind_t  destination_kind  /**< */,
575                           xcb_window_t      destination_window  /**< */,
576                           int16_t           x_offset  /**< */,
577                           int16_t           y_offset  /**< */)
578 {
579     static const xcb_protocol_request_t xcb_req = {
580         /* count */ 2,
581         /* ext */ &xcb_shape_id,
582         /* opcode */ XCB_SHAPE_OFFSET,
583         /* isvoid */ 1
584     };
585 
586     struct iovec xcb_parts[4];
587     xcb_void_cookie_t xcb_ret;
588     xcb_shape_offset_request_t xcb_out;
589 
590     xcb_out.destination_kind = destination_kind;
591     memset(xcb_out.pad0, 0, 3);
592     xcb_out.destination_window = destination_window;
593     xcb_out.x_offset = x_offset;
594     xcb_out.y_offset = y_offset;
595 
596     xcb_parts[2].iov_base = (char *) &xcb_out;
597     xcb_parts[2].iov_len = sizeof(xcb_out);
598     xcb_parts[3].iov_base = 0;
599     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
600 
601     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
602     return xcb_ret;
603 }
604 
605 
606 /*****************************************************************************
607  **
608  ** xcb_void_cookie_t xcb_shape_offset
609  **
610  ** @param xcb_connection_t *c
611  ** @param xcb_shape_kind_t  destination_kind
612  ** @param xcb_window_t      destination_window
613  ** @param int16_t           x_offset
614  ** @param int16_t           y_offset
615  ** @returns xcb_void_cookie_t
616  **
617  *****************************************************************************/
618 
619 xcb_void_cookie_t
620 xcb_shape_offset (xcb_connection_t *c  /**< */,
621                   xcb_shape_kind_t  destination_kind  /**< */,
622                   xcb_window_t      destination_window  /**< */,
623                   int16_t           x_offset  /**< */,
624                   int16_t           y_offset  /**< */)
625 {
626     static const xcb_protocol_request_t xcb_req = {
627         /* count */ 2,
628         /* ext */ &xcb_shape_id,
629         /* opcode */ XCB_SHAPE_OFFSET,
630         /* isvoid */ 1
631     };
632 
633     struct iovec xcb_parts[4];
634     xcb_void_cookie_t xcb_ret;
635     xcb_shape_offset_request_t xcb_out;
636 
637     xcb_out.destination_kind = destination_kind;
638     memset(xcb_out.pad0, 0, 3);
639     xcb_out.destination_window = destination_window;
640     xcb_out.x_offset = x_offset;
641     xcb_out.y_offset = y_offset;
642 
643     xcb_parts[2].iov_base = (char *) &xcb_out;
644     xcb_parts[2].iov_len = sizeof(xcb_out);
645     xcb_parts[3].iov_base = 0;
646     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
647 
648     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
649     return xcb_ret;
650 }
651 
652 
653 /*****************************************************************************
654  **
655  ** xcb_shape_query_extents_cookie_t xcb_shape_query_extents
656  **
657  ** @param xcb_connection_t *c
658  ** @param xcb_window_t      destination_window
659  ** @returns xcb_shape_query_extents_cookie_t
660  **
661  *****************************************************************************/
662 
663 xcb_shape_query_extents_cookie_t
664 xcb_shape_query_extents (xcb_connection_t *c  /**< */,
665                          xcb_window_t      destination_window  /**< */)
666 {
667     static const xcb_protocol_request_t xcb_req = {
668         /* count */ 2,
669         /* ext */ &xcb_shape_id,
670         /* opcode */ XCB_SHAPE_QUERY_EXTENTS,
671         /* isvoid */ 0
672     };
673 
674     struct iovec xcb_parts[4];
675     xcb_shape_query_extents_cookie_t xcb_ret;
676     xcb_shape_query_extents_request_t xcb_out;
677 
678     xcb_out.destination_window = destination_window;
679 
680     xcb_parts[2].iov_base = (char *) &xcb_out;
681     xcb_parts[2].iov_len = sizeof(xcb_out);
682     xcb_parts[3].iov_base = 0;
683     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
684 
685     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
686     return xcb_ret;
687 }
688 
689 
690 /*****************************************************************************
691  **
692  ** xcb_shape_query_extents_cookie_t xcb_shape_query_extents_unchecked
693  **
694  ** @param xcb_connection_t *c
695  ** @param xcb_window_t      destination_window
696  ** @returns xcb_shape_query_extents_cookie_t
697  **
698  *****************************************************************************/
699 
700 xcb_shape_query_extents_cookie_t
701 xcb_shape_query_extents_unchecked (xcb_connection_t *c  /**< */,
702                                    xcb_window_t      destination_window  /**< */)
703 {
704     static const xcb_protocol_request_t xcb_req = {
705         /* count */ 2,
706         /* ext */ &xcb_shape_id,
707         /* opcode */ XCB_SHAPE_QUERY_EXTENTS,
708         /* isvoid */ 0
709     };
710 
711     struct iovec xcb_parts[4];
712     xcb_shape_query_extents_cookie_t xcb_ret;
713     xcb_shape_query_extents_request_t xcb_out;
714 
715     xcb_out.destination_window = destination_window;
716 
717     xcb_parts[2].iov_base = (char *) &xcb_out;
718     xcb_parts[2].iov_len = sizeof(xcb_out);
719     xcb_parts[3].iov_base = 0;
720     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
721 
722     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
723     return xcb_ret;
724 }
725 
726 
727 /*****************************************************************************
728  **
729  ** xcb_shape_query_extents_reply_t * xcb_shape_query_extents_reply
730  **
731  ** @param xcb_connection_t                  *c
732  ** @param xcb_shape_query_extents_cookie_t   cookie
733  ** @param xcb_generic_error_t              **e
734  ** @returns xcb_shape_query_extents_reply_t *
735  **
736  *****************************************************************************/
737 
738 xcb_shape_query_extents_reply_t *
739 xcb_shape_query_extents_reply (xcb_connection_t                  *c  /**< */,
740                                xcb_shape_query_extents_cookie_t   cookie  /**< */,
741                                xcb_generic_error_t              **e  /**< */)
742 {
743     return (xcb_shape_query_extents_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
744 }
745 
746 
747 /*****************************************************************************
748  **
749  ** xcb_void_cookie_t xcb_shape_select_input_checked
750  **
751  ** @param xcb_connection_t *c
752  ** @param xcb_window_t      destination_window
753  ** @param uint8_t           enable
754  ** @returns xcb_void_cookie_t
755  **
756  *****************************************************************************/
757 
758 xcb_void_cookie_t
759 xcb_shape_select_input_checked (xcb_connection_t *c  /**< */,
760                                 xcb_window_t      destination_window  /**< */,
761                                 uint8_t           enable  /**< */)
762 {
763     static const xcb_protocol_request_t xcb_req = {
764         /* count */ 2,
765         /* ext */ &xcb_shape_id,
766         /* opcode */ XCB_SHAPE_SELECT_INPUT,
767         /* isvoid */ 1
768     };
769 
770     struct iovec xcb_parts[4];
771     xcb_void_cookie_t xcb_ret;
772     xcb_shape_select_input_request_t xcb_out;
773 
774     xcb_out.destination_window = destination_window;
775     xcb_out.enable = enable;
776     memset(xcb_out.pad0, 0, 3);
777 
778     xcb_parts[2].iov_base = (char *) &xcb_out;
779     xcb_parts[2].iov_len = sizeof(xcb_out);
780     xcb_parts[3].iov_base = 0;
781     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
782 
783     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
784     return xcb_ret;
785 }
786 
787 
788 /*****************************************************************************
789  **
790  ** xcb_void_cookie_t xcb_shape_select_input
791  **
792  ** @param xcb_connection_t *c
793  ** @param xcb_window_t      destination_window
794  ** @param uint8_t           enable
795  ** @returns xcb_void_cookie_t
796  **
797  *****************************************************************************/
798 
799 xcb_void_cookie_t
800 xcb_shape_select_input (xcb_connection_t *c  /**< */,
801                         xcb_window_t      destination_window  /**< */,
802                         uint8_t           enable  /**< */)
803 {
804     static const xcb_protocol_request_t xcb_req = {
805         /* count */ 2,
806         /* ext */ &xcb_shape_id,
807         /* opcode */ XCB_SHAPE_SELECT_INPUT,
808         /* isvoid */ 1
809     };
810 
811     struct iovec xcb_parts[4];
812     xcb_void_cookie_t xcb_ret;
813     xcb_shape_select_input_request_t xcb_out;
814 
815     xcb_out.destination_window = destination_window;
816     xcb_out.enable = enable;
817     memset(xcb_out.pad0, 0, 3);
818 
819     xcb_parts[2].iov_base = (char *) &xcb_out;
820     xcb_parts[2].iov_len = sizeof(xcb_out);
821     xcb_parts[3].iov_base = 0;
822     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
823 
824     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
825     return xcb_ret;
826 }
827 
828 
829 /*****************************************************************************
830  **
831  ** xcb_shape_input_selected_cookie_t xcb_shape_input_selected
832  **
833  ** @param xcb_connection_t *c
834  ** @param xcb_window_t      destination_window
835  ** @returns xcb_shape_input_selected_cookie_t
836  **
837  *****************************************************************************/
838 
839 xcb_shape_input_selected_cookie_t
840 xcb_shape_input_selected (xcb_connection_t *c  /**< */,
841                           xcb_window_t      destination_window  /**< */)
842 {
843     static const xcb_protocol_request_t xcb_req = {
844         /* count */ 2,
845         /* ext */ &xcb_shape_id,
846         /* opcode */ XCB_SHAPE_INPUT_SELECTED,
847         /* isvoid */ 0
848     };
849 
850     struct iovec xcb_parts[4];
851     xcb_shape_input_selected_cookie_t xcb_ret;
852     xcb_shape_input_selected_request_t xcb_out;
853 
854     xcb_out.destination_window = destination_window;
855 
856     xcb_parts[2].iov_base = (char *) &xcb_out;
857     xcb_parts[2].iov_len = sizeof(xcb_out);
858     xcb_parts[3].iov_base = 0;
859     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
860 
861     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
862     return xcb_ret;
863 }
864 
865 
866 /*****************************************************************************
867  **
868  ** xcb_shape_input_selected_cookie_t xcb_shape_input_selected_unchecked
869  **
870  ** @param xcb_connection_t *c
871  ** @param xcb_window_t      destination_window
872  ** @returns xcb_shape_input_selected_cookie_t
873  **
874  *****************************************************************************/
875 
876 xcb_shape_input_selected_cookie_t
877 xcb_shape_input_selected_unchecked (xcb_connection_t *c  /**< */,
878                                     xcb_window_t      destination_window  /**< */)
879 {
880     static const xcb_protocol_request_t xcb_req = {
881         /* count */ 2,
882         /* ext */ &xcb_shape_id,
883         /* opcode */ XCB_SHAPE_INPUT_SELECTED,
884         /* isvoid */ 0
885     };
886 
887     struct iovec xcb_parts[4];
888     xcb_shape_input_selected_cookie_t xcb_ret;
889     xcb_shape_input_selected_request_t xcb_out;
890 
891     xcb_out.destination_window = destination_window;
892 
893     xcb_parts[2].iov_base = (char *) &xcb_out;
894     xcb_parts[2].iov_len = sizeof(xcb_out);
895     xcb_parts[3].iov_base = 0;
896     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
897 
898     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
899     return xcb_ret;
900 }
901 
902 
903 /*****************************************************************************
904  **
905  ** xcb_shape_input_selected_reply_t * xcb_shape_input_selected_reply
906  **
907  ** @param xcb_connection_t                   *c
908  ** @param xcb_shape_input_selected_cookie_t   cookie
909  ** @param xcb_generic_error_t               **e
910  ** @returns xcb_shape_input_selected_reply_t *
911  **
912  *****************************************************************************/
913 
914 xcb_shape_input_selected_reply_t *
915 xcb_shape_input_selected_reply (xcb_connection_t                   *c  /**< */,
916                                 xcb_shape_input_selected_cookie_t   cookie  /**< */,
917                                 xcb_generic_error_t               **e  /**< */)
918 {
919     return (xcb_shape_input_selected_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
920 }
921 
922 int
923 xcb_shape_get_rectangles_sizeof (const void  *_buffer  /**< */)
924 {
925     char *xcb_tmp = (char *)_buffer;
926     const xcb_shape_get_rectangles_reply_t *_aux = (xcb_shape_get_rectangles_reply_t *)_buffer;
927     unsigned int xcb_buffer_len = 0;
928     unsigned int xcb_block_len = 0;
929     unsigned int xcb_pad = 0;
930     unsigned int xcb_align_to = 0;
931 
932 
933     xcb_block_len += sizeof(xcb_shape_get_rectangles_reply_t);
934     xcb_tmp += xcb_block_len;
935     xcb_buffer_len += xcb_block_len;
936     xcb_block_len = 0;
937     /* rectangles */
938     xcb_block_len += _aux->rectangles_len * sizeof(xcb_rectangle_t);
939     xcb_tmp += xcb_block_len;
940     xcb_align_to = ALIGNOF(xcb_rectangle_t);
941     /* insert padding */
942     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
943     xcb_buffer_len += xcb_block_len + xcb_pad;
944     if (0 != xcb_pad) {
945         xcb_tmp += xcb_pad;
946         xcb_pad = 0;
947     }
948     xcb_block_len = 0;
949 
950     return xcb_buffer_len;
951 }
952 
953 
954 /*****************************************************************************
955  **
956  ** xcb_shape_get_rectangles_cookie_t xcb_shape_get_rectangles
957  **
958  ** @param xcb_connection_t *c
959  ** @param xcb_window_t      window
960  ** @param xcb_shape_kind_t  source_kind
961  ** @returns xcb_shape_get_rectangles_cookie_t
962  **
963  *****************************************************************************/
964 
965 xcb_shape_get_rectangles_cookie_t
966 xcb_shape_get_rectangles (xcb_connection_t *c  /**< */,
967                           xcb_window_t      window  /**< */,
968                           xcb_shape_kind_t  source_kind  /**< */)
969 {
970     static const xcb_protocol_request_t xcb_req = {
971         /* count */ 2,
972         /* ext */ &xcb_shape_id,
973         /* opcode */ XCB_SHAPE_GET_RECTANGLES,
974         /* isvoid */ 0
975     };
976 
977     struct iovec xcb_parts[4];
978     xcb_shape_get_rectangles_cookie_t xcb_ret;
979     xcb_shape_get_rectangles_request_t xcb_out;
980 
981     xcb_out.window = window;
982     xcb_out.source_kind = source_kind;
983     memset(xcb_out.pad0, 0, 3);
984 
985     xcb_parts[2].iov_base = (char *) &xcb_out;
986     xcb_parts[2].iov_len = sizeof(xcb_out);
987     xcb_parts[3].iov_base = 0;
988     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
989 
990     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
991     return xcb_ret;
992 }
993 
994 
995 /*****************************************************************************
996  **
997  ** xcb_shape_get_rectangles_cookie_t xcb_shape_get_rectangles_unchecked
998  **
999  ** @param xcb_connection_t *c
1000  ** @param xcb_window_t      window
1001  ** @param xcb_shape_kind_t  source_kind
1002  ** @returns xcb_shape_get_rectangles_cookie_t
1003  **
1004  *****************************************************************************/
1005 
1006 xcb_shape_get_rectangles_cookie_t
1007 xcb_shape_get_rectangles_unchecked (xcb_connection_t *c  /**< */,
1008                                     xcb_window_t      window  /**< */,
1009                                     xcb_shape_kind_t  source_kind  /**< */)
1010 {
1011     static const xcb_protocol_request_t xcb_req = {
1012         /* count */ 2,
1013         /* ext */ &xcb_shape_id,
1014         /* opcode */ XCB_SHAPE_GET_RECTANGLES,
1015         /* isvoid */ 0
1016     };
1017 
1018     struct iovec xcb_parts[4];
1019     xcb_shape_get_rectangles_cookie_t xcb_ret;
1020     xcb_shape_get_rectangles_request_t xcb_out;
1021 
1022     xcb_out.window = window;
1023     xcb_out.source_kind = source_kind;
1024     memset(xcb_out.pad0, 0, 3);
1025 
1026     xcb_parts[2].iov_base = (char *) &xcb_out;
1027     xcb_parts[2].iov_len = sizeof(xcb_out);
1028     xcb_parts[3].iov_base = 0;
1029     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1030 
1031     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1032     return xcb_ret;
1033 }
1034 
1035 
1036 /*****************************************************************************
1037  **
1038  ** xcb_rectangle_t * xcb_shape_get_rectangles_rectangles
1039  **
1040  ** @param const xcb_shape_get_rectangles_reply_t *R
1041  ** @returns xcb_rectangle_t *
1042  **
1043  *****************************************************************************/
1044 
1045 xcb_rectangle_t *
1046 xcb_shape_get_rectangles_rectangles (const xcb_shape_get_rectangles_reply_t *R  /**< */)
1047 {
1048     return (xcb_rectangle_t *) (R + 1);
1049 }
1050 
1051 
1052 /*****************************************************************************
1053  **
1054  ** int xcb_shape_get_rectangles_rectangles_length
1055  **
1056  ** @param const xcb_shape_get_rectangles_reply_t *R
1057  ** @returns int
1058  **
1059  *****************************************************************************/
1060 
1061 int
1062 xcb_shape_get_rectangles_rectangles_length (const xcb_shape_get_rectangles_reply_t *R  /**< */)
1063 {
1064     return R->rectangles_len;
1065 }
1066 
1067 
1068 /*****************************************************************************
1069  **
1070  ** xcb_rectangle_iterator_t xcb_shape_get_rectangles_rectangles_iterator
1071  **
1072  ** @param const xcb_shape_get_rectangles_reply_t *R
1073  ** @returns xcb_rectangle_iterator_t
1074  **
1075  *****************************************************************************/
1076 
1077 xcb_rectangle_iterator_t
1078 xcb_shape_get_rectangles_rectangles_iterator (const xcb_shape_get_rectangles_reply_t *R  /**< */)
1079 {
1080     xcb_rectangle_iterator_t i;
1081     i.data = (xcb_rectangle_t *) (R + 1);
1082     i.rem = R->rectangles_len;
1083     i.index = (char *) i.data - (char *) R;
1084     return i;
1085 }
1086 
1087 
1088 /*****************************************************************************
1089  **
1090  ** xcb_shape_get_rectangles_reply_t * xcb_shape_get_rectangles_reply
1091  **
1092  ** @param xcb_connection_t                   *c
1093  ** @param xcb_shape_get_rectangles_cookie_t   cookie
1094  ** @param xcb_generic_error_t               **e
1095  ** @returns xcb_shape_get_rectangles_reply_t *
1096  **
1097  *****************************************************************************/
1098 
1099 xcb_shape_get_rectangles_reply_t *
1100 xcb_shape_get_rectangles_reply (xcb_connection_t                   *c  /**< */,
1101                                 xcb_shape_get_rectangles_cookie_t   cookie  /**< */,
1102                                 xcb_generic_error_t               **e  /**< */)
1103 {
1104     return (xcb_shape_get_rectangles_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1105 }
1106 
1107