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