Home | History | Annotate | Line # | Download | only in files
      1 /*
      2  * This file generated automatically from xfixes.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 "xfixes.h"
     15 
     16 #define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member)
     17 #include "xproto.h"
     18 #include "render.h"
     19 #include "shape.h"
     20 
     21 xcb_extension_t xcb_xfixes_id = { "XFIXES", 0 };
     22 
     23 xcb_xfixes_query_version_cookie_t
     24 xcb_xfixes_query_version (xcb_connection_t *c,
     25                           uint32_t          client_major_version,
     26                           uint32_t          client_minor_version)
     27 {
     28     static const xcb_protocol_request_t xcb_req = {
     29         .count = 2,
     30         .ext = &xcb_xfixes_id,
     31         .opcode = XCB_XFIXES_QUERY_VERSION,
     32         .isvoid = 0
     33     };
     34 
     35     struct iovec xcb_parts[4];
     36     xcb_xfixes_query_version_cookie_t xcb_ret;
     37     xcb_xfixes_query_version_request_t xcb_out;
     38 
     39     xcb_out.client_major_version = client_major_version;
     40     xcb_out.client_minor_version = client_minor_version;
     41 
     42     xcb_parts[2].iov_base = (char *) &xcb_out;
     43     xcb_parts[2].iov_len = sizeof(xcb_out);
     44     xcb_parts[3].iov_base = 0;
     45     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
     46 
     47     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
     48     return xcb_ret;
     49 }
     50 
     51 xcb_xfixes_query_version_cookie_t
     52 xcb_xfixes_query_version_unchecked (xcb_connection_t *c,
     53                                     uint32_t          client_major_version,
     54                                     uint32_t          client_minor_version)
     55 {
     56     static const xcb_protocol_request_t xcb_req = {
     57         .count = 2,
     58         .ext = &xcb_xfixes_id,
     59         .opcode = XCB_XFIXES_QUERY_VERSION,
     60         .isvoid = 0
     61     };
     62 
     63     struct iovec xcb_parts[4];
     64     xcb_xfixes_query_version_cookie_t xcb_ret;
     65     xcb_xfixes_query_version_request_t xcb_out;
     66 
     67     xcb_out.client_major_version = client_major_version;
     68     xcb_out.client_minor_version = client_minor_version;
     69 
     70     xcb_parts[2].iov_base = (char *) &xcb_out;
     71     xcb_parts[2].iov_len = sizeof(xcb_out);
     72     xcb_parts[3].iov_base = 0;
     73     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
     74 
     75     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
     76     return xcb_ret;
     77 }
     78 
     79 xcb_xfixes_query_version_reply_t *
     80 xcb_xfixes_query_version_reply (xcb_connection_t                   *c,
     81                                 xcb_xfixes_query_version_cookie_t   cookie  /**< */,
     82                                 xcb_generic_error_t               **e)
     83 {
     84     return (xcb_xfixes_query_version_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
     85 }
     86 
     87 xcb_void_cookie_t
     88 xcb_xfixes_change_save_set_checked (xcb_connection_t *c,
     89                                     uint8_t           mode,
     90                                     uint8_t           target,
     91                                     uint8_t           map,
     92                                     xcb_window_t      window)
     93 {
     94     static const xcb_protocol_request_t xcb_req = {
     95         .count = 2,
     96         .ext = &xcb_xfixes_id,
     97         .opcode = XCB_XFIXES_CHANGE_SAVE_SET,
     98         .isvoid = 1
     99     };
    100 
    101     struct iovec xcb_parts[4];
    102     xcb_void_cookie_t xcb_ret;
    103     xcb_xfixes_change_save_set_request_t xcb_out;
    104 
    105     xcb_out.mode = mode;
    106     xcb_out.target = target;
    107     xcb_out.map = map;
    108     xcb_out.pad0 = 0;
    109     xcb_out.window = window;
    110 
    111     xcb_parts[2].iov_base = (char *) &xcb_out;
    112     xcb_parts[2].iov_len = sizeof(xcb_out);
    113     xcb_parts[3].iov_base = 0;
    114     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
    115 
    116     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
    117     return xcb_ret;
    118 }
    119 
    120 xcb_void_cookie_t
    121 xcb_xfixes_change_save_set (xcb_connection_t *c,
    122                             uint8_t           mode,
    123                             uint8_t           target,
    124                             uint8_t           map,
    125                             xcb_window_t      window)
    126 {
    127     static const xcb_protocol_request_t xcb_req = {
    128         .count = 2,
    129         .ext = &xcb_xfixes_id,
    130         .opcode = XCB_XFIXES_CHANGE_SAVE_SET,
    131         .isvoid = 1
    132     };
    133 
    134     struct iovec xcb_parts[4];
    135     xcb_void_cookie_t xcb_ret;
    136     xcb_xfixes_change_save_set_request_t xcb_out;
    137 
    138     xcb_out.mode = mode;
    139     xcb_out.target = target;
    140     xcb_out.map = map;
    141     xcb_out.pad0 = 0;
    142     xcb_out.window = window;
    143 
    144     xcb_parts[2].iov_base = (char *) &xcb_out;
    145     xcb_parts[2].iov_len = sizeof(xcb_out);
    146     xcb_parts[3].iov_base = 0;
    147     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
    148 
    149     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
    150     return xcb_ret;
    151 }
    152 
    153 xcb_void_cookie_t
    154 xcb_xfixes_select_selection_input_checked (xcb_connection_t *c,
    155                                            xcb_window_t      window,
    156                                            xcb_atom_t        selection,
    157                                            uint32_t          event_mask)
    158 {
    159     static const xcb_protocol_request_t xcb_req = {
    160         .count = 2,
    161         .ext = &xcb_xfixes_id,
    162         .opcode = XCB_XFIXES_SELECT_SELECTION_INPUT,
    163         .isvoid = 1
    164     };
    165 
    166     struct iovec xcb_parts[4];
    167     xcb_void_cookie_t xcb_ret;
    168     xcb_xfixes_select_selection_input_request_t xcb_out;
    169 
    170     xcb_out.window = window;
    171     xcb_out.selection = selection;
    172     xcb_out.event_mask = event_mask;
    173 
    174     xcb_parts[2].iov_base = (char *) &xcb_out;
    175     xcb_parts[2].iov_len = sizeof(xcb_out);
    176     xcb_parts[3].iov_base = 0;
    177     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
    178 
    179     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
    180     return xcb_ret;
    181 }
    182 
    183 xcb_void_cookie_t
    184 xcb_xfixes_select_selection_input (xcb_connection_t *c,
    185                                    xcb_window_t      window,
    186                                    xcb_atom_t        selection,
    187                                    uint32_t          event_mask)
    188 {
    189     static const xcb_protocol_request_t xcb_req = {
    190         .count = 2,
    191         .ext = &xcb_xfixes_id,
    192         .opcode = XCB_XFIXES_SELECT_SELECTION_INPUT,
    193         .isvoid = 1
    194     };
    195 
    196     struct iovec xcb_parts[4];
    197     xcb_void_cookie_t xcb_ret;
    198     xcb_xfixes_select_selection_input_request_t xcb_out;
    199 
    200     xcb_out.window = window;
    201     xcb_out.selection = selection;
    202     xcb_out.event_mask = event_mask;
    203 
    204     xcb_parts[2].iov_base = (char *) &xcb_out;
    205     xcb_parts[2].iov_len = sizeof(xcb_out);
    206     xcb_parts[3].iov_base = 0;
    207     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
    208 
    209     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
    210     return xcb_ret;
    211 }
    212 
    213 xcb_void_cookie_t
    214 xcb_xfixes_select_cursor_input_checked (xcb_connection_t *c,
    215                                         xcb_window_t      window,
    216                                         uint32_t          event_mask)
    217 {
    218     static const xcb_protocol_request_t xcb_req = {
    219         .count = 2,
    220         .ext = &xcb_xfixes_id,
    221         .opcode = XCB_XFIXES_SELECT_CURSOR_INPUT,
    222         .isvoid = 1
    223     };
    224 
    225     struct iovec xcb_parts[4];
    226     xcb_void_cookie_t xcb_ret;
    227     xcb_xfixes_select_cursor_input_request_t xcb_out;
    228 
    229     xcb_out.window = window;
    230     xcb_out.event_mask = event_mask;
    231 
    232     xcb_parts[2].iov_base = (char *) &xcb_out;
    233     xcb_parts[2].iov_len = sizeof(xcb_out);
    234     xcb_parts[3].iov_base = 0;
    235     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
    236 
    237     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
    238     return xcb_ret;
    239 }
    240 
    241 xcb_void_cookie_t
    242 xcb_xfixes_select_cursor_input (xcb_connection_t *c,
    243                                 xcb_window_t      window,
    244                                 uint32_t          event_mask)
    245 {
    246     static const xcb_protocol_request_t xcb_req = {
    247         .count = 2,
    248         .ext = &xcb_xfixes_id,
    249         .opcode = XCB_XFIXES_SELECT_CURSOR_INPUT,
    250         .isvoid = 1
    251     };
    252 
    253     struct iovec xcb_parts[4];
    254     xcb_void_cookie_t xcb_ret;
    255     xcb_xfixes_select_cursor_input_request_t xcb_out;
    256 
    257     xcb_out.window = window;
    258     xcb_out.event_mask = event_mask;
    259 
    260     xcb_parts[2].iov_base = (char *) &xcb_out;
    261     xcb_parts[2].iov_len = sizeof(xcb_out);
    262     xcb_parts[3].iov_base = 0;
    263     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
    264 
    265     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
    266     return xcb_ret;
    267 }
    268 
    269 int
    270 xcb_xfixes_get_cursor_image_sizeof (const void  *_buffer)
    271 {
    272     char *xcb_tmp = (char *)_buffer;
    273     const xcb_xfixes_get_cursor_image_reply_t *_aux = (xcb_xfixes_get_cursor_image_reply_t *)_buffer;
    274     unsigned int xcb_buffer_len = 0;
    275     unsigned int xcb_block_len = 0;
    276     unsigned int xcb_pad = 0;
    277     unsigned int xcb_align_to = 0;
    278 
    279 
    280     xcb_block_len += sizeof(xcb_xfixes_get_cursor_image_reply_t);
    281     xcb_tmp += xcb_block_len;
    282     xcb_buffer_len += xcb_block_len;
    283     xcb_block_len = 0;
    284     /* cursor_image */
    285     xcb_block_len += (_aux->width * _aux->height) * sizeof(uint32_t);
    286     xcb_tmp += xcb_block_len;
    287     xcb_align_to = ALIGNOF(uint32_t);
    288     /* insert padding */
    289     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
    290     xcb_buffer_len += xcb_block_len + xcb_pad;
    291     if (0 != xcb_pad) {
    292         xcb_tmp += xcb_pad;
    293         xcb_pad = 0;
    294     }
    295     xcb_block_len = 0;
    296 
    297     return xcb_buffer_len;
    298 }
    299 
    300 xcb_xfixes_get_cursor_image_cookie_t
    301 xcb_xfixes_get_cursor_image (xcb_connection_t *c)
    302 {
    303     static const xcb_protocol_request_t xcb_req = {
    304         .count = 2,
    305         .ext = &xcb_xfixes_id,
    306         .opcode = XCB_XFIXES_GET_CURSOR_IMAGE,
    307         .isvoid = 0
    308     };
    309 
    310     struct iovec xcb_parts[4];
    311     xcb_xfixes_get_cursor_image_cookie_t xcb_ret;
    312     xcb_xfixes_get_cursor_image_request_t xcb_out;
    313 
    314 
    315     xcb_parts[2].iov_base = (char *) &xcb_out;
    316     xcb_parts[2].iov_len = sizeof(xcb_out);
    317     xcb_parts[3].iov_base = 0;
    318     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
    319 
    320     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
    321     return xcb_ret;
    322 }
    323 
    324 xcb_xfixes_get_cursor_image_cookie_t
    325 xcb_xfixes_get_cursor_image_unchecked (xcb_connection_t *c)
    326 {
    327     static const xcb_protocol_request_t xcb_req = {
    328         .count = 2,
    329         .ext = &xcb_xfixes_id,
    330         .opcode = XCB_XFIXES_GET_CURSOR_IMAGE,
    331         .isvoid = 0
    332     };
    333 
    334     struct iovec xcb_parts[4];
    335     xcb_xfixes_get_cursor_image_cookie_t xcb_ret;
    336     xcb_xfixes_get_cursor_image_request_t xcb_out;
    337 
    338 
    339     xcb_parts[2].iov_base = (char *) &xcb_out;
    340     xcb_parts[2].iov_len = sizeof(xcb_out);
    341     xcb_parts[3].iov_base = 0;
    342     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
    343 
    344     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
    345     return xcb_ret;
    346 }
    347 
    348 uint32_t *
    349 xcb_xfixes_get_cursor_image_cursor_image (const xcb_xfixes_get_cursor_image_reply_t *R)
    350 {
    351     return (uint32_t *) (R + 1);
    352 }
    353 
    354 int
    355 xcb_xfixes_get_cursor_image_cursor_image_length (const xcb_xfixes_get_cursor_image_reply_t *R)
    356 {
    357     return (R->width * R->height);
    358 }
    359 
    360 xcb_generic_iterator_t
    361 xcb_xfixes_get_cursor_image_cursor_image_end (const xcb_xfixes_get_cursor_image_reply_t *R)
    362 {
    363     xcb_generic_iterator_t i;
    364     i.data = ((uint32_t *) (R + 1)) + ((R->width * R->height));
    365     i.rem = 0;
    366     i.index = (char *) i.data - (char *) R;
    367     return i;
    368 }
    369 
    370 xcb_xfixes_get_cursor_image_reply_t *
    371 xcb_xfixes_get_cursor_image_reply (xcb_connection_t                      *c,
    372                                    xcb_xfixes_get_cursor_image_cookie_t   cookie  /**< */,
    373                                    xcb_generic_error_t                  **e)
    374 {
    375     return (xcb_xfixes_get_cursor_image_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
    376 }
    377 
    378 void
    379 xcb_xfixes_region_next (xcb_xfixes_region_iterator_t *i)
    380 {
    381     --i->rem;
    382     ++i->data;
    383     i->index += sizeof(xcb_xfixes_region_t);
    384 }
    385 
    386 xcb_generic_iterator_t
    387 xcb_xfixes_region_end (xcb_xfixes_region_iterator_t i)
    388 {
    389     xcb_generic_iterator_t ret;
    390     ret.data = i.data + i.rem;
    391     ret.index = i.index + ((char *) ret.data - (char *) i.data);
    392     ret.rem = 0;
    393     return ret;
    394 }
    395 
    396 int
    397 xcb_xfixes_create_region_sizeof (const void  *_buffer,
    398                                  uint32_t     rectangles_len)
    399 {
    400     char *xcb_tmp = (char *)_buffer;
    401     unsigned int xcb_buffer_len = 0;
    402     unsigned int xcb_block_len = 0;
    403     unsigned int xcb_pad = 0;
    404     unsigned int xcb_align_to = 0;
    405 
    406 
    407     xcb_block_len += sizeof(xcb_xfixes_create_region_request_t);
    408     xcb_tmp += xcb_block_len;
    409     xcb_buffer_len += xcb_block_len;
    410     xcb_block_len = 0;
    411     /* rectangles */
    412     xcb_block_len += rectangles_len * sizeof(xcb_rectangle_t);
    413     xcb_tmp += xcb_block_len;
    414     xcb_align_to = ALIGNOF(xcb_rectangle_t);
    415     /* insert padding */
    416     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
    417     xcb_buffer_len += xcb_block_len + xcb_pad;
    418     if (0 != xcb_pad) {
    419         xcb_tmp += xcb_pad;
    420         xcb_pad = 0;
    421     }
    422     xcb_block_len = 0;
    423 
    424     return xcb_buffer_len;
    425 }
    426 
    427 xcb_void_cookie_t
    428 xcb_xfixes_create_region_checked (xcb_connection_t      *c,
    429                                   xcb_xfixes_region_t    region,
    430                                   uint32_t               rectangles_len,
    431                                   const xcb_rectangle_t *rectangles)
    432 {
    433     static const xcb_protocol_request_t xcb_req = {
    434         .count = 4,
    435         .ext = &xcb_xfixes_id,
    436         .opcode = XCB_XFIXES_CREATE_REGION,
    437         .isvoid = 1
    438     };
    439 
    440     struct iovec xcb_parts[6];
    441     xcb_void_cookie_t xcb_ret;
    442     xcb_xfixes_create_region_request_t xcb_out;
    443 
    444     xcb_out.region = region;
    445 
    446     xcb_parts[2].iov_base = (char *) &xcb_out;
    447     xcb_parts[2].iov_len = sizeof(xcb_out);
    448     xcb_parts[3].iov_base = 0;
    449     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
    450     /* xcb_rectangle_t rectangles */
    451     xcb_parts[4].iov_base = (char *) rectangles;
    452     xcb_parts[4].iov_len = rectangles_len * sizeof(xcb_rectangle_t);
    453     xcb_parts[5].iov_base = 0;
    454     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
    455 
    456     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
    457     return xcb_ret;
    458 }
    459 
    460 xcb_void_cookie_t
    461 xcb_xfixes_create_region (xcb_connection_t      *c,
    462                           xcb_xfixes_region_t    region,
    463                           uint32_t               rectangles_len,
    464                           const xcb_rectangle_t *rectangles)
    465 {
    466     static const xcb_protocol_request_t xcb_req = {
    467         .count = 4,
    468         .ext = &xcb_xfixes_id,
    469         .opcode = XCB_XFIXES_CREATE_REGION,
    470         .isvoid = 1
    471     };
    472 
    473     struct iovec xcb_parts[6];
    474     xcb_void_cookie_t xcb_ret;
    475     xcb_xfixes_create_region_request_t xcb_out;
    476 
    477     xcb_out.region = region;
    478 
    479     xcb_parts[2].iov_base = (char *) &xcb_out;
    480     xcb_parts[2].iov_len = sizeof(xcb_out);
    481     xcb_parts[3].iov_base = 0;
    482     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
    483     /* xcb_rectangle_t rectangles */
    484     xcb_parts[4].iov_base = (char *) rectangles;
    485     xcb_parts[4].iov_len = rectangles_len * sizeof(xcb_rectangle_t);
    486     xcb_parts[5].iov_base = 0;
    487     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
    488 
    489     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
    490     return xcb_ret;
    491 }
    492 
    493 xcb_rectangle_t *
    494 xcb_xfixes_create_region_rectangles (const xcb_xfixes_create_region_request_t *R)
    495 {
    496     return (xcb_rectangle_t *) (R + 1);
    497 }
    498 
    499 int
    500 xcb_xfixes_create_region_rectangles_length (const xcb_xfixes_create_region_request_t *R)
    501 {
    502     return (((R->length * 4) - sizeof(xcb_xfixes_create_region_request_t))/sizeof(xcb_rectangle_t));
    503 }
    504 
    505 xcb_rectangle_iterator_t
    506 xcb_xfixes_create_region_rectangles_iterator (const xcb_xfixes_create_region_request_t *R)
    507 {
    508     xcb_rectangle_iterator_t i;
    509     i.data = (xcb_rectangle_t *) (R + 1);
    510     i.rem = (((R->length * 4) - sizeof(xcb_xfixes_create_region_request_t))/sizeof(xcb_rectangle_t));
    511     i.index = (char *) i.data - (char *) R;
    512     return i;
    513 }
    514 
    515 xcb_void_cookie_t
    516 xcb_xfixes_create_region_from_bitmap_checked (xcb_connection_t    *c,
    517                                               xcb_xfixes_region_t  region,
    518                                               xcb_pixmap_t         bitmap)
    519 {
    520     static const xcb_protocol_request_t xcb_req = {
    521         .count = 2,
    522         .ext = &xcb_xfixes_id,
    523         .opcode = XCB_XFIXES_CREATE_REGION_FROM_BITMAP,
    524         .isvoid = 1
    525     };
    526 
    527     struct iovec xcb_parts[4];
    528     xcb_void_cookie_t xcb_ret;
    529     xcb_xfixes_create_region_from_bitmap_request_t xcb_out;
    530 
    531     xcb_out.region = region;
    532     xcb_out.bitmap = bitmap;
    533 
    534     xcb_parts[2].iov_base = (char *) &xcb_out;
    535     xcb_parts[2].iov_len = sizeof(xcb_out);
    536     xcb_parts[3].iov_base = 0;
    537     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
    538 
    539     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
    540     return xcb_ret;
    541 }
    542 
    543 xcb_void_cookie_t
    544 xcb_xfixes_create_region_from_bitmap (xcb_connection_t    *c,
    545                                       xcb_xfixes_region_t  region,
    546                                       xcb_pixmap_t         bitmap)
    547 {
    548     static const xcb_protocol_request_t xcb_req = {
    549         .count = 2,
    550         .ext = &xcb_xfixes_id,
    551         .opcode = XCB_XFIXES_CREATE_REGION_FROM_BITMAP,
    552         .isvoid = 1
    553     };
    554 
    555     struct iovec xcb_parts[4];
    556     xcb_void_cookie_t xcb_ret;
    557     xcb_xfixes_create_region_from_bitmap_request_t xcb_out;
    558 
    559     xcb_out.region = region;
    560     xcb_out.bitmap = bitmap;
    561 
    562     xcb_parts[2].iov_base = (char *) &xcb_out;
    563     xcb_parts[2].iov_len = sizeof(xcb_out);
    564     xcb_parts[3].iov_base = 0;
    565     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
    566 
    567     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
    568     return xcb_ret;
    569 }
    570 
    571 xcb_void_cookie_t
    572 xcb_xfixes_create_region_from_window_checked (xcb_connection_t    *c,
    573                                               xcb_xfixes_region_t  region,
    574                                               xcb_window_t         window,
    575                                               xcb_shape_kind_t     kind)
    576 {
    577     static const xcb_protocol_request_t xcb_req = {
    578         .count = 2,
    579         .ext = &xcb_xfixes_id,
    580         .opcode = XCB_XFIXES_CREATE_REGION_FROM_WINDOW,
    581         .isvoid = 1
    582     };
    583 
    584     struct iovec xcb_parts[4];
    585     xcb_void_cookie_t xcb_ret;
    586     xcb_xfixes_create_region_from_window_request_t xcb_out;
    587 
    588     xcb_out.region = region;
    589     xcb_out.window = window;
    590     xcb_out.kind = kind;
    591     memset(xcb_out.pad0, 0, 3);
    592 
    593     xcb_parts[2].iov_base = (char *) &xcb_out;
    594     xcb_parts[2].iov_len = sizeof(xcb_out);
    595     xcb_parts[3].iov_base = 0;
    596     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
    597 
    598     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
    599     return xcb_ret;
    600 }
    601 
    602 xcb_void_cookie_t
    603 xcb_xfixes_create_region_from_window (xcb_connection_t    *c,
    604                                       xcb_xfixes_region_t  region,
    605                                       xcb_window_t         window,
    606                                       xcb_shape_kind_t     kind)
    607 {
    608     static const xcb_protocol_request_t xcb_req = {
    609         .count = 2,
    610         .ext = &xcb_xfixes_id,
    611         .opcode = XCB_XFIXES_CREATE_REGION_FROM_WINDOW,
    612         .isvoid = 1
    613     };
    614 
    615     struct iovec xcb_parts[4];
    616     xcb_void_cookie_t xcb_ret;
    617     xcb_xfixes_create_region_from_window_request_t xcb_out;
    618 
    619     xcb_out.region = region;
    620     xcb_out.window = window;
    621     xcb_out.kind = kind;
    622     memset(xcb_out.pad0, 0, 3);
    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, 0, xcb_parts + 2, &xcb_req);
    630     return xcb_ret;
    631 }
    632 
    633 xcb_void_cookie_t
    634 xcb_xfixes_create_region_from_gc_checked (xcb_connection_t    *c,
    635                                           xcb_xfixes_region_t  region,
    636                                           xcb_gcontext_t       gc)
    637 {
    638     static const xcb_protocol_request_t xcb_req = {
    639         .count = 2,
    640         .ext = &xcb_xfixes_id,
    641         .opcode = XCB_XFIXES_CREATE_REGION_FROM_GC,
    642         .isvoid = 1
    643     };
    644 
    645     struct iovec xcb_parts[4];
    646     xcb_void_cookie_t xcb_ret;
    647     xcb_xfixes_create_region_from_gc_request_t xcb_out;
    648 
    649     xcb_out.region = region;
    650     xcb_out.gc = gc;
    651 
    652     xcb_parts[2].iov_base = (char *) &xcb_out;
    653     xcb_parts[2].iov_len = sizeof(xcb_out);
    654     xcb_parts[3].iov_base = 0;
    655     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
    656 
    657     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
    658     return xcb_ret;
    659 }
    660 
    661 xcb_void_cookie_t
    662 xcb_xfixes_create_region_from_gc (xcb_connection_t    *c,
    663                                   xcb_xfixes_region_t  region,
    664                                   xcb_gcontext_t       gc)
    665 {
    666     static const xcb_protocol_request_t xcb_req = {
    667         .count = 2,
    668         .ext = &xcb_xfixes_id,
    669         .opcode = XCB_XFIXES_CREATE_REGION_FROM_GC,
    670         .isvoid = 1
    671     };
    672 
    673     struct iovec xcb_parts[4];
    674     xcb_void_cookie_t xcb_ret;
    675     xcb_xfixes_create_region_from_gc_request_t xcb_out;
    676 
    677     xcb_out.region = region;
    678     xcb_out.gc = gc;
    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, 0, xcb_parts + 2, &xcb_req);
    686     return xcb_ret;
    687 }
    688 
    689 xcb_void_cookie_t
    690 xcb_xfixes_create_region_from_picture_checked (xcb_connection_t     *c,
    691                                                xcb_xfixes_region_t   region,
    692                                                xcb_render_picture_t  picture)
    693 {
    694     static const xcb_protocol_request_t xcb_req = {
    695         .count = 2,
    696         .ext = &xcb_xfixes_id,
    697         .opcode = XCB_XFIXES_CREATE_REGION_FROM_PICTURE,
    698         .isvoid = 1
    699     };
    700 
    701     struct iovec xcb_parts[4];
    702     xcb_void_cookie_t xcb_ret;
    703     xcb_xfixes_create_region_from_picture_request_t xcb_out;
    704 
    705     xcb_out.region = region;
    706     xcb_out.picture = picture;
    707 
    708     xcb_parts[2].iov_base = (char *) &xcb_out;
    709     xcb_parts[2].iov_len = sizeof(xcb_out);
    710     xcb_parts[3].iov_base = 0;
    711     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
    712 
    713     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
    714     return xcb_ret;
    715 }
    716 
    717 xcb_void_cookie_t
    718 xcb_xfixes_create_region_from_picture (xcb_connection_t     *c,
    719                                        xcb_xfixes_region_t   region,
    720                                        xcb_render_picture_t  picture)
    721 {
    722     static const xcb_protocol_request_t xcb_req = {
    723         .count = 2,
    724         .ext = &xcb_xfixes_id,
    725         .opcode = XCB_XFIXES_CREATE_REGION_FROM_PICTURE,
    726         .isvoid = 1
    727     };
    728 
    729     struct iovec xcb_parts[4];
    730     xcb_void_cookie_t xcb_ret;
    731     xcb_xfixes_create_region_from_picture_request_t xcb_out;
    732 
    733     xcb_out.region = region;
    734     xcb_out.picture = picture;
    735 
    736     xcb_parts[2].iov_base = (char *) &xcb_out;
    737     xcb_parts[2].iov_len = sizeof(xcb_out);
    738     xcb_parts[3].iov_base = 0;
    739     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
    740 
    741     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
    742     return xcb_ret;
    743 }
    744 
    745 xcb_void_cookie_t
    746 xcb_xfixes_destroy_region_checked (xcb_connection_t    *c,
    747                                    xcb_xfixes_region_t  region)
    748 {
    749     static const xcb_protocol_request_t xcb_req = {
    750         .count = 2,
    751         .ext = &xcb_xfixes_id,
    752         .opcode = XCB_XFIXES_DESTROY_REGION,
    753         .isvoid = 1
    754     };
    755 
    756     struct iovec xcb_parts[4];
    757     xcb_void_cookie_t xcb_ret;
    758     xcb_xfixes_destroy_region_request_t xcb_out;
    759 
    760     xcb_out.region = region;
    761 
    762     xcb_parts[2].iov_base = (char *) &xcb_out;
    763     xcb_parts[2].iov_len = sizeof(xcb_out);
    764     xcb_parts[3].iov_base = 0;
    765     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
    766 
    767     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
    768     return xcb_ret;
    769 }
    770 
    771 xcb_void_cookie_t
    772 xcb_xfixes_destroy_region (xcb_connection_t    *c,
    773                            xcb_xfixes_region_t  region)
    774 {
    775     static const xcb_protocol_request_t xcb_req = {
    776         .count = 2,
    777         .ext = &xcb_xfixes_id,
    778         .opcode = XCB_XFIXES_DESTROY_REGION,
    779         .isvoid = 1
    780     };
    781 
    782     struct iovec xcb_parts[4];
    783     xcb_void_cookie_t xcb_ret;
    784     xcb_xfixes_destroy_region_request_t xcb_out;
    785 
    786     xcb_out.region = region;
    787 
    788     xcb_parts[2].iov_base = (char *) &xcb_out;
    789     xcb_parts[2].iov_len = sizeof(xcb_out);
    790     xcb_parts[3].iov_base = 0;
    791     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
    792 
    793     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
    794     return xcb_ret;
    795 }
    796 
    797 int
    798 xcb_xfixes_set_region_sizeof (const void  *_buffer,
    799                               uint32_t     rectangles_len)
    800 {
    801     char *xcb_tmp = (char *)_buffer;
    802     unsigned int xcb_buffer_len = 0;
    803     unsigned int xcb_block_len = 0;
    804     unsigned int xcb_pad = 0;
    805     unsigned int xcb_align_to = 0;
    806 
    807 
    808     xcb_block_len += sizeof(xcb_xfixes_set_region_request_t);
    809     xcb_tmp += xcb_block_len;
    810     xcb_buffer_len += xcb_block_len;
    811     xcb_block_len = 0;
    812     /* rectangles */
    813     xcb_block_len += rectangles_len * sizeof(xcb_rectangle_t);
    814     xcb_tmp += xcb_block_len;
    815     xcb_align_to = ALIGNOF(xcb_rectangle_t);
    816     /* insert padding */
    817     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
    818     xcb_buffer_len += xcb_block_len + xcb_pad;
    819     if (0 != xcb_pad) {
    820         xcb_tmp += xcb_pad;
    821         xcb_pad = 0;
    822     }
    823     xcb_block_len = 0;
    824 
    825     return xcb_buffer_len;
    826 }
    827 
    828 xcb_void_cookie_t
    829 xcb_xfixes_set_region_checked (xcb_connection_t      *c,
    830                                xcb_xfixes_region_t    region,
    831                                uint32_t               rectangles_len,
    832                                const xcb_rectangle_t *rectangles)
    833 {
    834     static const xcb_protocol_request_t xcb_req = {
    835         .count = 4,
    836         .ext = &xcb_xfixes_id,
    837         .opcode = XCB_XFIXES_SET_REGION,
    838         .isvoid = 1
    839     };
    840 
    841     struct iovec xcb_parts[6];
    842     xcb_void_cookie_t xcb_ret;
    843     xcb_xfixes_set_region_request_t xcb_out;
    844 
    845     xcb_out.region = region;
    846 
    847     xcb_parts[2].iov_base = (char *) &xcb_out;
    848     xcb_parts[2].iov_len = sizeof(xcb_out);
    849     xcb_parts[3].iov_base = 0;
    850     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
    851     /* xcb_rectangle_t rectangles */
    852     xcb_parts[4].iov_base = (char *) rectangles;
    853     xcb_parts[4].iov_len = rectangles_len * sizeof(xcb_rectangle_t);
    854     xcb_parts[5].iov_base = 0;
    855     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
    856 
    857     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
    858     return xcb_ret;
    859 }
    860 
    861 xcb_void_cookie_t
    862 xcb_xfixes_set_region (xcb_connection_t      *c,
    863                        xcb_xfixes_region_t    region,
    864                        uint32_t               rectangles_len,
    865                        const xcb_rectangle_t *rectangles)
    866 {
    867     static const xcb_protocol_request_t xcb_req = {
    868         .count = 4,
    869         .ext = &xcb_xfixes_id,
    870         .opcode = XCB_XFIXES_SET_REGION,
    871         .isvoid = 1
    872     };
    873 
    874     struct iovec xcb_parts[6];
    875     xcb_void_cookie_t xcb_ret;
    876     xcb_xfixes_set_region_request_t xcb_out;
    877 
    878     xcb_out.region = region;
    879 
    880     xcb_parts[2].iov_base = (char *) &xcb_out;
    881     xcb_parts[2].iov_len = sizeof(xcb_out);
    882     xcb_parts[3].iov_base = 0;
    883     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
    884     /* xcb_rectangle_t rectangles */
    885     xcb_parts[4].iov_base = (char *) rectangles;
    886     xcb_parts[4].iov_len = rectangles_len * sizeof(xcb_rectangle_t);
    887     xcb_parts[5].iov_base = 0;
    888     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
    889 
    890     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
    891     return xcb_ret;
    892 }
    893 
    894 xcb_rectangle_t *
    895 xcb_xfixes_set_region_rectangles (const xcb_xfixes_set_region_request_t *R)
    896 {
    897     return (xcb_rectangle_t *) (R + 1);
    898 }
    899 
    900 int
    901 xcb_xfixes_set_region_rectangles_length (const xcb_xfixes_set_region_request_t *R)
    902 {
    903     return (((R->length * 4) - sizeof(xcb_xfixes_set_region_request_t))/sizeof(xcb_rectangle_t));
    904 }
    905 
    906 xcb_rectangle_iterator_t
    907 xcb_xfixes_set_region_rectangles_iterator (const xcb_xfixes_set_region_request_t *R)
    908 {
    909     xcb_rectangle_iterator_t i;
    910     i.data = (xcb_rectangle_t *) (R + 1);
    911     i.rem = (((R->length * 4) - sizeof(xcb_xfixes_set_region_request_t))/sizeof(xcb_rectangle_t));
    912     i.index = (char *) i.data - (char *) R;
    913     return i;
    914 }
    915 
    916 xcb_void_cookie_t
    917 xcb_xfixes_copy_region_checked (xcb_connection_t    *c,
    918                                 xcb_xfixes_region_t  source,
    919                                 xcb_xfixes_region_t  destination)
    920 {
    921     static const xcb_protocol_request_t xcb_req = {
    922         .count = 2,
    923         .ext = &xcb_xfixes_id,
    924         .opcode = XCB_XFIXES_COPY_REGION,
    925         .isvoid = 1
    926     };
    927 
    928     struct iovec xcb_parts[4];
    929     xcb_void_cookie_t xcb_ret;
    930     xcb_xfixes_copy_region_request_t xcb_out;
    931 
    932     xcb_out.source = source;
    933     xcb_out.destination = destination;
    934 
    935     xcb_parts[2].iov_base = (char *) &xcb_out;
    936     xcb_parts[2].iov_len = sizeof(xcb_out);
    937     xcb_parts[3].iov_base = 0;
    938     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
    939 
    940     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
    941     return xcb_ret;
    942 }
    943 
    944 xcb_void_cookie_t
    945 xcb_xfixes_copy_region (xcb_connection_t    *c,
    946                         xcb_xfixes_region_t  source,
    947                         xcb_xfixes_region_t  destination)
    948 {
    949     static const xcb_protocol_request_t xcb_req = {
    950         .count = 2,
    951         .ext = &xcb_xfixes_id,
    952         .opcode = XCB_XFIXES_COPY_REGION,
    953         .isvoid = 1
    954     };
    955 
    956     struct iovec xcb_parts[4];
    957     xcb_void_cookie_t xcb_ret;
    958     xcb_xfixes_copy_region_request_t xcb_out;
    959 
    960     xcb_out.source = source;
    961     xcb_out.destination = destination;
    962 
    963     xcb_parts[2].iov_base = (char *) &xcb_out;
    964     xcb_parts[2].iov_len = sizeof(xcb_out);
    965     xcb_parts[3].iov_base = 0;
    966     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
    967 
    968     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
    969     return xcb_ret;
    970 }
    971 
    972 xcb_void_cookie_t
    973 xcb_xfixes_union_region_checked (xcb_connection_t    *c,
    974                                  xcb_xfixes_region_t  source1,
    975                                  xcb_xfixes_region_t  source2,
    976                                  xcb_xfixes_region_t  destination)
    977 {
    978     static const xcb_protocol_request_t xcb_req = {
    979         .count = 2,
    980         .ext = &xcb_xfixes_id,
    981         .opcode = XCB_XFIXES_UNION_REGION,
    982         .isvoid = 1
    983     };
    984 
    985     struct iovec xcb_parts[4];
    986     xcb_void_cookie_t xcb_ret;
    987     xcb_xfixes_union_region_request_t xcb_out;
    988 
    989     xcb_out.source1 = source1;
    990     xcb_out.source2 = source2;
    991     xcb_out.destination = destination;
    992 
    993     xcb_parts[2].iov_base = (char *) &xcb_out;
    994     xcb_parts[2].iov_len = sizeof(xcb_out);
    995     xcb_parts[3].iov_base = 0;
    996     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
    997 
    998     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
    999     return xcb_ret;
   1000 }
   1001 
   1002 xcb_void_cookie_t
   1003 xcb_xfixes_union_region (xcb_connection_t    *c,
   1004                          xcb_xfixes_region_t  source1,
   1005                          xcb_xfixes_region_t  source2,
   1006                          xcb_xfixes_region_t  destination)
   1007 {
   1008     static const xcb_protocol_request_t xcb_req = {
   1009         .count = 2,
   1010         .ext = &xcb_xfixes_id,
   1011         .opcode = XCB_XFIXES_UNION_REGION,
   1012         .isvoid = 1
   1013     };
   1014 
   1015     struct iovec xcb_parts[4];
   1016     xcb_void_cookie_t xcb_ret;
   1017     xcb_xfixes_union_region_request_t xcb_out;
   1018 
   1019     xcb_out.source1 = source1;
   1020     xcb_out.source2 = source2;
   1021     xcb_out.destination = destination;
   1022 
   1023     xcb_parts[2].iov_base = (char *) &xcb_out;
   1024     xcb_parts[2].iov_len = sizeof(xcb_out);
   1025     xcb_parts[3].iov_base = 0;
   1026     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   1027 
   1028     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
   1029     return xcb_ret;
   1030 }
   1031 
   1032 xcb_void_cookie_t
   1033 xcb_xfixes_intersect_region_checked (xcb_connection_t    *c,
   1034                                      xcb_xfixes_region_t  source1,
   1035                                      xcb_xfixes_region_t  source2,
   1036                                      xcb_xfixes_region_t  destination)
   1037 {
   1038     static const xcb_protocol_request_t xcb_req = {
   1039         .count = 2,
   1040         .ext = &xcb_xfixes_id,
   1041         .opcode = XCB_XFIXES_INTERSECT_REGION,
   1042         .isvoid = 1
   1043     };
   1044 
   1045     struct iovec xcb_parts[4];
   1046     xcb_void_cookie_t xcb_ret;
   1047     xcb_xfixes_intersect_region_request_t xcb_out;
   1048 
   1049     xcb_out.source1 = source1;
   1050     xcb_out.source2 = source2;
   1051     xcb_out.destination = destination;
   1052 
   1053     xcb_parts[2].iov_base = (char *) &xcb_out;
   1054     xcb_parts[2].iov_len = sizeof(xcb_out);
   1055     xcb_parts[3].iov_base = 0;
   1056     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   1057 
   1058     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
   1059     return xcb_ret;
   1060 }
   1061 
   1062 xcb_void_cookie_t
   1063 xcb_xfixes_intersect_region (xcb_connection_t    *c,
   1064                              xcb_xfixes_region_t  source1,
   1065                              xcb_xfixes_region_t  source2,
   1066                              xcb_xfixes_region_t  destination)
   1067 {
   1068     static const xcb_protocol_request_t xcb_req = {
   1069         .count = 2,
   1070         .ext = &xcb_xfixes_id,
   1071         .opcode = XCB_XFIXES_INTERSECT_REGION,
   1072         .isvoid = 1
   1073     };
   1074 
   1075     struct iovec xcb_parts[4];
   1076     xcb_void_cookie_t xcb_ret;
   1077     xcb_xfixes_intersect_region_request_t xcb_out;
   1078 
   1079     xcb_out.source1 = source1;
   1080     xcb_out.source2 = source2;
   1081     xcb_out.destination = destination;
   1082 
   1083     xcb_parts[2].iov_base = (char *) &xcb_out;
   1084     xcb_parts[2].iov_len = sizeof(xcb_out);
   1085     xcb_parts[3].iov_base = 0;
   1086     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   1087 
   1088     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
   1089     return xcb_ret;
   1090 }
   1091 
   1092 xcb_void_cookie_t
   1093 xcb_xfixes_subtract_region_checked (xcb_connection_t    *c,
   1094                                     xcb_xfixes_region_t  source1,
   1095                                     xcb_xfixes_region_t  source2,
   1096                                     xcb_xfixes_region_t  destination)
   1097 {
   1098     static const xcb_protocol_request_t xcb_req = {
   1099         .count = 2,
   1100         .ext = &xcb_xfixes_id,
   1101         .opcode = XCB_XFIXES_SUBTRACT_REGION,
   1102         .isvoid = 1
   1103     };
   1104 
   1105     struct iovec xcb_parts[4];
   1106     xcb_void_cookie_t xcb_ret;
   1107     xcb_xfixes_subtract_region_request_t xcb_out;
   1108 
   1109     xcb_out.source1 = source1;
   1110     xcb_out.source2 = source2;
   1111     xcb_out.destination = destination;
   1112 
   1113     xcb_parts[2].iov_base = (char *) &xcb_out;
   1114     xcb_parts[2].iov_len = sizeof(xcb_out);
   1115     xcb_parts[3].iov_base = 0;
   1116     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   1117 
   1118     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
   1119     return xcb_ret;
   1120 }
   1121 
   1122 xcb_void_cookie_t
   1123 xcb_xfixes_subtract_region (xcb_connection_t    *c,
   1124                             xcb_xfixes_region_t  source1,
   1125                             xcb_xfixes_region_t  source2,
   1126                             xcb_xfixes_region_t  destination)
   1127 {
   1128     static const xcb_protocol_request_t xcb_req = {
   1129         .count = 2,
   1130         .ext = &xcb_xfixes_id,
   1131         .opcode = XCB_XFIXES_SUBTRACT_REGION,
   1132         .isvoid = 1
   1133     };
   1134 
   1135     struct iovec xcb_parts[4];
   1136     xcb_void_cookie_t xcb_ret;
   1137     xcb_xfixes_subtract_region_request_t xcb_out;
   1138 
   1139     xcb_out.source1 = source1;
   1140     xcb_out.source2 = source2;
   1141     xcb_out.destination = destination;
   1142 
   1143     xcb_parts[2].iov_base = (char *) &xcb_out;
   1144     xcb_parts[2].iov_len = sizeof(xcb_out);
   1145     xcb_parts[3].iov_base = 0;
   1146     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   1147 
   1148     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
   1149     return xcb_ret;
   1150 }
   1151 
   1152 xcb_void_cookie_t
   1153 xcb_xfixes_invert_region_checked (xcb_connection_t    *c,
   1154                                   xcb_xfixes_region_t  source,
   1155                                   xcb_rectangle_t      bounds,
   1156                                   xcb_xfixes_region_t  destination)
   1157 {
   1158     static const xcb_protocol_request_t xcb_req = {
   1159         .count = 2,
   1160         .ext = &xcb_xfixes_id,
   1161         .opcode = XCB_XFIXES_INVERT_REGION,
   1162         .isvoid = 1
   1163     };
   1164 
   1165     struct iovec xcb_parts[4];
   1166     xcb_void_cookie_t xcb_ret;
   1167     xcb_xfixes_invert_region_request_t xcb_out;
   1168 
   1169     xcb_out.source = source;
   1170     xcb_out.bounds = bounds;
   1171     xcb_out.destination = destination;
   1172 
   1173     xcb_parts[2].iov_base = (char *) &xcb_out;
   1174     xcb_parts[2].iov_len = sizeof(xcb_out);
   1175     xcb_parts[3].iov_base = 0;
   1176     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   1177 
   1178     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
   1179     return xcb_ret;
   1180 }
   1181 
   1182 xcb_void_cookie_t
   1183 xcb_xfixes_invert_region (xcb_connection_t    *c,
   1184                           xcb_xfixes_region_t  source,
   1185                           xcb_rectangle_t      bounds,
   1186                           xcb_xfixes_region_t  destination)
   1187 {
   1188     static const xcb_protocol_request_t xcb_req = {
   1189         .count = 2,
   1190         .ext = &xcb_xfixes_id,
   1191         .opcode = XCB_XFIXES_INVERT_REGION,
   1192         .isvoid = 1
   1193     };
   1194 
   1195     struct iovec xcb_parts[4];
   1196     xcb_void_cookie_t xcb_ret;
   1197     xcb_xfixes_invert_region_request_t xcb_out;
   1198 
   1199     xcb_out.source = source;
   1200     xcb_out.bounds = bounds;
   1201     xcb_out.destination = destination;
   1202 
   1203     xcb_parts[2].iov_base = (char *) &xcb_out;
   1204     xcb_parts[2].iov_len = sizeof(xcb_out);
   1205     xcb_parts[3].iov_base = 0;
   1206     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   1207 
   1208     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
   1209     return xcb_ret;
   1210 }
   1211 
   1212 xcb_void_cookie_t
   1213 xcb_xfixes_translate_region_checked (xcb_connection_t    *c,
   1214                                      xcb_xfixes_region_t  region,
   1215                                      int16_t              dx,
   1216                                      int16_t              dy)
   1217 {
   1218     static const xcb_protocol_request_t xcb_req = {
   1219         .count = 2,
   1220         .ext = &xcb_xfixes_id,
   1221         .opcode = XCB_XFIXES_TRANSLATE_REGION,
   1222         .isvoid = 1
   1223     };
   1224 
   1225     struct iovec xcb_parts[4];
   1226     xcb_void_cookie_t xcb_ret;
   1227     xcb_xfixes_translate_region_request_t xcb_out;
   1228 
   1229     xcb_out.region = region;
   1230     xcb_out.dx = dx;
   1231     xcb_out.dy = dy;
   1232 
   1233     xcb_parts[2].iov_base = (char *) &xcb_out;
   1234     xcb_parts[2].iov_len = sizeof(xcb_out);
   1235     xcb_parts[3].iov_base = 0;
   1236     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   1237 
   1238     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
   1239     return xcb_ret;
   1240 }
   1241 
   1242 xcb_void_cookie_t
   1243 xcb_xfixes_translate_region (xcb_connection_t    *c,
   1244                              xcb_xfixes_region_t  region,
   1245                              int16_t              dx,
   1246                              int16_t              dy)
   1247 {
   1248     static const xcb_protocol_request_t xcb_req = {
   1249         .count = 2,
   1250         .ext = &xcb_xfixes_id,
   1251         .opcode = XCB_XFIXES_TRANSLATE_REGION,
   1252         .isvoid = 1
   1253     };
   1254 
   1255     struct iovec xcb_parts[4];
   1256     xcb_void_cookie_t xcb_ret;
   1257     xcb_xfixes_translate_region_request_t xcb_out;
   1258 
   1259     xcb_out.region = region;
   1260     xcb_out.dx = dx;
   1261     xcb_out.dy = dy;
   1262 
   1263     xcb_parts[2].iov_base = (char *) &xcb_out;
   1264     xcb_parts[2].iov_len = sizeof(xcb_out);
   1265     xcb_parts[3].iov_base = 0;
   1266     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   1267 
   1268     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
   1269     return xcb_ret;
   1270 }
   1271 
   1272 xcb_void_cookie_t
   1273 xcb_xfixes_region_extents_checked (xcb_connection_t    *c,
   1274                                    xcb_xfixes_region_t  source,
   1275                                    xcb_xfixes_region_t  destination)
   1276 {
   1277     static const xcb_protocol_request_t xcb_req = {
   1278         .count = 2,
   1279         .ext = &xcb_xfixes_id,
   1280         .opcode = XCB_XFIXES_REGION_EXTENTS,
   1281         .isvoid = 1
   1282     };
   1283 
   1284     struct iovec xcb_parts[4];
   1285     xcb_void_cookie_t xcb_ret;
   1286     xcb_xfixes_region_extents_request_t xcb_out;
   1287 
   1288     xcb_out.source = source;
   1289     xcb_out.destination = destination;
   1290 
   1291     xcb_parts[2].iov_base = (char *) &xcb_out;
   1292     xcb_parts[2].iov_len = sizeof(xcb_out);
   1293     xcb_parts[3].iov_base = 0;
   1294     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   1295 
   1296     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
   1297     return xcb_ret;
   1298 }
   1299 
   1300 xcb_void_cookie_t
   1301 xcb_xfixes_region_extents (xcb_connection_t    *c,
   1302                            xcb_xfixes_region_t  source,
   1303                            xcb_xfixes_region_t  destination)
   1304 {
   1305     static const xcb_protocol_request_t xcb_req = {
   1306         .count = 2,
   1307         .ext = &xcb_xfixes_id,
   1308         .opcode = XCB_XFIXES_REGION_EXTENTS,
   1309         .isvoid = 1
   1310     };
   1311 
   1312     struct iovec xcb_parts[4];
   1313     xcb_void_cookie_t xcb_ret;
   1314     xcb_xfixes_region_extents_request_t xcb_out;
   1315 
   1316     xcb_out.source = source;
   1317     xcb_out.destination = destination;
   1318 
   1319     xcb_parts[2].iov_base = (char *) &xcb_out;
   1320     xcb_parts[2].iov_len = sizeof(xcb_out);
   1321     xcb_parts[3].iov_base = 0;
   1322     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   1323 
   1324     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
   1325     return xcb_ret;
   1326 }
   1327 
   1328 int
   1329 xcb_xfixes_fetch_region_sizeof (const void  *_buffer)
   1330 {
   1331     char *xcb_tmp = (char *)_buffer;
   1332     const xcb_xfixes_fetch_region_reply_t *_aux = (xcb_xfixes_fetch_region_reply_t *)_buffer;
   1333     unsigned int xcb_buffer_len = 0;
   1334     unsigned int xcb_block_len = 0;
   1335     unsigned int xcb_pad = 0;
   1336     unsigned int xcb_align_to = 0;
   1337 
   1338 
   1339     xcb_block_len += sizeof(xcb_xfixes_fetch_region_reply_t);
   1340     xcb_tmp += xcb_block_len;
   1341     xcb_buffer_len += xcb_block_len;
   1342     xcb_block_len = 0;
   1343     /* rectangles */
   1344     xcb_block_len += (_aux->length / 2) * sizeof(xcb_rectangle_t);
   1345     xcb_tmp += xcb_block_len;
   1346     xcb_align_to = ALIGNOF(xcb_rectangle_t);
   1347     /* insert padding */
   1348     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
   1349     xcb_buffer_len += xcb_block_len + xcb_pad;
   1350     if (0 != xcb_pad) {
   1351         xcb_tmp += xcb_pad;
   1352         xcb_pad = 0;
   1353     }
   1354     xcb_block_len = 0;
   1355 
   1356     return xcb_buffer_len;
   1357 }
   1358 
   1359 xcb_xfixes_fetch_region_cookie_t
   1360 xcb_xfixes_fetch_region (xcb_connection_t    *c,
   1361                          xcb_xfixes_region_t  region)
   1362 {
   1363     static const xcb_protocol_request_t xcb_req = {
   1364         .count = 2,
   1365         .ext = &xcb_xfixes_id,
   1366         .opcode = XCB_XFIXES_FETCH_REGION,
   1367         .isvoid = 0
   1368     };
   1369 
   1370     struct iovec xcb_parts[4];
   1371     xcb_xfixes_fetch_region_cookie_t xcb_ret;
   1372     xcb_xfixes_fetch_region_request_t xcb_out;
   1373 
   1374     xcb_out.region = region;
   1375 
   1376     xcb_parts[2].iov_base = (char *) &xcb_out;
   1377     xcb_parts[2].iov_len = sizeof(xcb_out);
   1378     xcb_parts[3].iov_base = 0;
   1379     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   1380 
   1381     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
   1382     return xcb_ret;
   1383 }
   1384 
   1385 xcb_xfixes_fetch_region_cookie_t
   1386 xcb_xfixes_fetch_region_unchecked (xcb_connection_t    *c,
   1387                                    xcb_xfixes_region_t  region)
   1388 {
   1389     static const xcb_protocol_request_t xcb_req = {
   1390         .count = 2,
   1391         .ext = &xcb_xfixes_id,
   1392         .opcode = XCB_XFIXES_FETCH_REGION,
   1393         .isvoid = 0
   1394     };
   1395 
   1396     struct iovec xcb_parts[4];
   1397     xcb_xfixes_fetch_region_cookie_t xcb_ret;
   1398     xcb_xfixes_fetch_region_request_t xcb_out;
   1399 
   1400     xcb_out.region = region;
   1401 
   1402     xcb_parts[2].iov_base = (char *) &xcb_out;
   1403     xcb_parts[2].iov_len = sizeof(xcb_out);
   1404     xcb_parts[3].iov_base = 0;
   1405     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   1406 
   1407     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
   1408     return xcb_ret;
   1409 }
   1410 
   1411 xcb_rectangle_t *
   1412 xcb_xfixes_fetch_region_rectangles (const xcb_xfixes_fetch_region_reply_t *R)
   1413 {
   1414     return (xcb_rectangle_t *) (R + 1);
   1415 }
   1416 
   1417 int
   1418 xcb_xfixes_fetch_region_rectangles_length (const xcb_xfixes_fetch_region_reply_t *R)
   1419 {
   1420     return (R->length / 2);
   1421 }
   1422 
   1423 xcb_rectangle_iterator_t
   1424 xcb_xfixes_fetch_region_rectangles_iterator (const xcb_xfixes_fetch_region_reply_t *R)
   1425 {
   1426     xcb_rectangle_iterator_t i;
   1427     i.data = (xcb_rectangle_t *) (R + 1);
   1428     i.rem = (R->length / 2);
   1429     i.index = (char *) i.data - (char *) R;
   1430     return i;
   1431 }
   1432 
   1433 xcb_xfixes_fetch_region_reply_t *
   1434 xcb_xfixes_fetch_region_reply (xcb_connection_t                  *c,
   1435                                xcb_xfixes_fetch_region_cookie_t   cookie  /**< */,
   1436                                xcb_generic_error_t              **e)
   1437 {
   1438     return (xcb_xfixes_fetch_region_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
   1439 }
   1440 
   1441 xcb_void_cookie_t
   1442 xcb_xfixes_set_gc_clip_region_checked (xcb_connection_t    *c,
   1443                                        xcb_gcontext_t       gc,
   1444                                        xcb_xfixes_region_t  region,
   1445                                        int16_t              x_origin,
   1446                                        int16_t              y_origin)
   1447 {
   1448     static const xcb_protocol_request_t xcb_req = {
   1449         .count = 2,
   1450         .ext = &xcb_xfixes_id,
   1451         .opcode = XCB_XFIXES_SET_GC_CLIP_REGION,
   1452         .isvoid = 1
   1453     };
   1454 
   1455     struct iovec xcb_parts[4];
   1456     xcb_void_cookie_t xcb_ret;
   1457     xcb_xfixes_set_gc_clip_region_request_t xcb_out;
   1458 
   1459     xcb_out.gc = gc;
   1460     xcb_out.region = region;
   1461     xcb_out.x_origin = x_origin;
   1462     xcb_out.y_origin = y_origin;
   1463 
   1464     xcb_parts[2].iov_base = (char *) &xcb_out;
   1465     xcb_parts[2].iov_len = sizeof(xcb_out);
   1466     xcb_parts[3].iov_base = 0;
   1467     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   1468 
   1469     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
   1470     return xcb_ret;
   1471 }
   1472 
   1473 xcb_void_cookie_t
   1474 xcb_xfixes_set_gc_clip_region (xcb_connection_t    *c,
   1475                                xcb_gcontext_t       gc,
   1476                                xcb_xfixes_region_t  region,
   1477                                int16_t              x_origin,
   1478                                int16_t              y_origin)
   1479 {
   1480     static const xcb_protocol_request_t xcb_req = {
   1481         .count = 2,
   1482         .ext = &xcb_xfixes_id,
   1483         .opcode = XCB_XFIXES_SET_GC_CLIP_REGION,
   1484         .isvoid = 1
   1485     };
   1486 
   1487     struct iovec xcb_parts[4];
   1488     xcb_void_cookie_t xcb_ret;
   1489     xcb_xfixes_set_gc_clip_region_request_t xcb_out;
   1490 
   1491     xcb_out.gc = gc;
   1492     xcb_out.region = region;
   1493     xcb_out.x_origin = x_origin;
   1494     xcb_out.y_origin = y_origin;
   1495 
   1496     xcb_parts[2].iov_base = (char *) &xcb_out;
   1497     xcb_parts[2].iov_len = sizeof(xcb_out);
   1498     xcb_parts[3].iov_base = 0;
   1499     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   1500 
   1501     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
   1502     return xcb_ret;
   1503 }
   1504 
   1505 xcb_void_cookie_t
   1506 xcb_xfixes_set_window_shape_region_checked (xcb_connection_t    *c,
   1507                                             xcb_window_t         dest,
   1508                                             xcb_shape_kind_t     dest_kind,
   1509                                             int16_t              x_offset,
   1510                                             int16_t              y_offset,
   1511                                             xcb_xfixes_region_t  region)
   1512 {
   1513     static const xcb_protocol_request_t xcb_req = {
   1514         .count = 2,
   1515         .ext = &xcb_xfixes_id,
   1516         .opcode = XCB_XFIXES_SET_WINDOW_SHAPE_REGION,
   1517         .isvoid = 1
   1518     };
   1519 
   1520     struct iovec xcb_parts[4];
   1521     xcb_void_cookie_t xcb_ret;
   1522     xcb_xfixes_set_window_shape_region_request_t xcb_out;
   1523 
   1524     xcb_out.dest = dest;
   1525     xcb_out.dest_kind = dest_kind;
   1526     memset(xcb_out.pad0, 0, 3);
   1527     xcb_out.x_offset = x_offset;
   1528     xcb_out.y_offset = y_offset;
   1529     xcb_out.region = region;
   1530 
   1531     xcb_parts[2].iov_base = (char *) &xcb_out;
   1532     xcb_parts[2].iov_len = sizeof(xcb_out);
   1533     xcb_parts[3].iov_base = 0;
   1534     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   1535 
   1536     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
   1537     return xcb_ret;
   1538 }
   1539 
   1540 xcb_void_cookie_t
   1541 xcb_xfixes_set_window_shape_region (xcb_connection_t    *c,
   1542                                     xcb_window_t         dest,
   1543                                     xcb_shape_kind_t     dest_kind,
   1544                                     int16_t              x_offset,
   1545                                     int16_t              y_offset,
   1546                                     xcb_xfixes_region_t  region)
   1547 {
   1548     static const xcb_protocol_request_t xcb_req = {
   1549         .count = 2,
   1550         .ext = &xcb_xfixes_id,
   1551         .opcode = XCB_XFIXES_SET_WINDOW_SHAPE_REGION,
   1552         .isvoid = 1
   1553     };
   1554 
   1555     struct iovec xcb_parts[4];
   1556     xcb_void_cookie_t xcb_ret;
   1557     xcb_xfixes_set_window_shape_region_request_t xcb_out;
   1558 
   1559     xcb_out.dest = dest;
   1560     xcb_out.dest_kind = dest_kind;
   1561     memset(xcb_out.pad0, 0, 3);
   1562     xcb_out.x_offset = x_offset;
   1563     xcb_out.y_offset = y_offset;
   1564     xcb_out.region = region;
   1565 
   1566     xcb_parts[2].iov_base = (char *) &xcb_out;
   1567     xcb_parts[2].iov_len = sizeof(xcb_out);
   1568     xcb_parts[3].iov_base = 0;
   1569     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   1570 
   1571     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
   1572     return xcb_ret;
   1573 }
   1574 
   1575 xcb_void_cookie_t
   1576 xcb_xfixes_set_picture_clip_region_checked (xcb_connection_t     *c,
   1577                                             xcb_render_picture_t  picture,
   1578                                             xcb_xfixes_region_t   region,
   1579                                             int16_t               x_origin,
   1580                                             int16_t               y_origin)
   1581 {
   1582     static const xcb_protocol_request_t xcb_req = {
   1583         .count = 2,
   1584         .ext = &xcb_xfixes_id,
   1585         .opcode = XCB_XFIXES_SET_PICTURE_CLIP_REGION,
   1586         .isvoid = 1
   1587     };
   1588 
   1589     struct iovec xcb_parts[4];
   1590     xcb_void_cookie_t xcb_ret;
   1591     xcb_xfixes_set_picture_clip_region_request_t xcb_out;
   1592 
   1593     xcb_out.picture = picture;
   1594     xcb_out.region = region;
   1595     xcb_out.x_origin = x_origin;
   1596     xcb_out.y_origin = y_origin;
   1597 
   1598     xcb_parts[2].iov_base = (char *) &xcb_out;
   1599     xcb_parts[2].iov_len = sizeof(xcb_out);
   1600     xcb_parts[3].iov_base = 0;
   1601     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   1602 
   1603     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
   1604     return xcb_ret;
   1605 }
   1606 
   1607 xcb_void_cookie_t
   1608 xcb_xfixes_set_picture_clip_region (xcb_connection_t     *c,
   1609                                     xcb_render_picture_t  picture,
   1610                                     xcb_xfixes_region_t   region,
   1611                                     int16_t               x_origin,
   1612                                     int16_t               y_origin)
   1613 {
   1614     static const xcb_protocol_request_t xcb_req = {
   1615         .count = 2,
   1616         .ext = &xcb_xfixes_id,
   1617         .opcode = XCB_XFIXES_SET_PICTURE_CLIP_REGION,
   1618         .isvoid = 1
   1619     };
   1620 
   1621     struct iovec xcb_parts[4];
   1622     xcb_void_cookie_t xcb_ret;
   1623     xcb_xfixes_set_picture_clip_region_request_t xcb_out;
   1624 
   1625     xcb_out.picture = picture;
   1626     xcb_out.region = region;
   1627     xcb_out.x_origin = x_origin;
   1628     xcb_out.y_origin = y_origin;
   1629 
   1630     xcb_parts[2].iov_base = (char *) &xcb_out;
   1631     xcb_parts[2].iov_len = sizeof(xcb_out);
   1632     xcb_parts[3].iov_base = 0;
   1633     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   1634 
   1635     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
   1636     return xcb_ret;
   1637 }
   1638 
   1639 int
   1640 xcb_xfixes_set_cursor_name_sizeof (const void  *_buffer)
   1641 {
   1642     char *xcb_tmp = (char *)_buffer;
   1643     const xcb_xfixes_set_cursor_name_request_t *_aux = (xcb_xfixes_set_cursor_name_request_t *)_buffer;
   1644     unsigned int xcb_buffer_len = 0;
   1645     unsigned int xcb_block_len = 0;
   1646     unsigned int xcb_pad = 0;
   1647     unsigned int xcb_align_to = 0;
   1648 
   1649 
   1650     xcb_block_len += sizeof(xcb_xfixes_set_cursor_name_request_t);
   1651     xcb_tmp += xcb_block_len;
   1652     xcb_buffer_len += xcb_block_len;
   1653     xcb_block_len = 0;
   1654     /* name */
   1655     xcb_block_len += _aux->nbytes * sizeof(char);
   1656     xcb_tmp += xcb_block_len;
   1657     xcb_align_to = ALIGNOF(char);
   1658     /* insert padding */
   1659     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
   1660     xcb_buffer_len += xcb_block_len + xcb_pad;
   1661     if (0 != xcb_pad) {
   1662         xcb_tmp += xcb_pad;
   1663         xcb_pad = 0;
   1664     }
   1665     xcb_block_len = 0;
   1666 
   1667     return xcb_buffer_len;
   1668 }
   1669 
   1670 xcb_void_cookie_t
   1671 xcb_xfixes_set_cursor_name_checked (xcb_connection_t *c,
   1672                                     xcb_cursor_t      cursor,
   1673                                     uint16_t          nbytes,
   1674                                     const char       *name)
   1675 {
   1676     static const xcb_protocol_request_t xcb_req = {
   1677         .count = 4,
   1678         .ext = &xcb_xfixes_id,
   1679         .opcode = XCB_XFIXES_SET_CURSOR_NAME,
   1680         .isvoid = 1
   1681     };
   1682 
   1683     struct iovec xcb_parts[6];
   1684     xcb_void_cookie_t xcb_ret;
   1685     xcb_xfixes_set_cursor_name_request_t xcb_out;
   1686 
   1687     xcb_out.cursor = cursor;
   1688     xcb_out.nbytes = nbytes;
   1689     memset(xcb_out.pad0, 0, 2);
   1690 
   1691     xcb_parts[2].iov_base = (char *) &xcb_out;
   1692     xcb_parts[2].iov_len = sizeof(xcb_out);
   1693     xcb_parts[3].iov_base = 0;
   1694     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   1695     /* char name */
   1696     xcb_parts[4].iov_base = (char *) name;
   1697     xcb_parts[4].iov_len = nbytes * sizeof(char);
   1698     xcb_parts[5].iov_base = 0;
   1699     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
   1700 
   1701     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
   1702     return xcb_ret;
   1703 }
   1704 
   1705 xcb_void_cookie_t
   1706 xcb_xfixes_set_cursor_name (xcb_connection_t *c,
   1707                             xcb_cursor_t      cursor,
   1708                             uint16_t          nbytes,
   1709                             const char       *name)
   1710 {
   1711     static const xcb_protocol_request_t xcb_req = {
   1712         .count = 4,
   1713         .ext = &xcb_xfixes_id,
   1714         .opcode = XCB_XFIXES_SET_CURSOR_NAME,
   1715         .isvoid = 1
   1716     };
   1717 
   1718     struct iovec xcb_parts[6];
   1719     xcb_void_cookie_t xcb_ret;
   1720     xcb_xfixes_set_cursor_name_request_t xcb_out;
   1721 
   1722     xcb_out.cursor = cursor;
   1723     xcb_out.nbytes = nbytes;
   1724     memset(xcb_out.pad0, 0, 2);
   1725 
   1726     xcb_parts[2].iov_base = (char *) &xcb_out;
   1727     xcb_parts[2].iov_len = sizeof(xcb_out);
   1728     xcb_parts[3].iov_base = 0;
   1729     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   1730     /* char name */
   1731     xcb_parts[4].iov_base = (char *) name;
   1732     xcb_parts[4].iov_len = nbytes * sizeof(char);
   1733     xcb_parts[5].iov_base = 0;
   1734     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
   1735 
   1736     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
   1737     return xcb_ret;
   1738 }
   1739 
   1740 char *
   1741 xcb_xfixes_set_cursor_name_name (const xcb_xfixes_set_cursor_name_request_t *R)
   1742 {
   1743     return (char *) (R + 1);
   1744 }
   1745 
   1746 int
   1747 xcb_xfixes_set_cursor_name_name_length (const xcb_xfixes_set_cursor_name_request_t *R)
   1748 {
   1749     return R->nbytes;
   1750 }
   1751 
   1752 xcb_generic_iterator_t
   1753 xcb_xfixes_set_cursor_name_name_end (const xcb_xfixes_set_cursor_name_request_t *R)
   1754 {
   1755     xcb_generic_iterator_t i;
   1756     i.data = ((char *) (R + 1)) + (R->nbytes);
   1757     i.rem = 0;
   1758     i.index = (char *) i.data - (char *) R;
   1759     return i;
   1760 }
   1761 
   1762 int
   1763 xcb_xfixes_get_cursor_name_sizeof (const void  *_buffer)
   1764 {
   1765     char *xcb_tmp = (char *)_buffer;
   1766     const xcb_xfixes_get_cursor_name_reply_t *_aux = (xcb_xfixes_get_cursor_name_reply_t *)_buffer;
   1767     unsigned int xcb_buffer_len = 0;
   1768     unsigned int xcb_block_len = 0;
   1769     unsigned int xcb_pad = 0;
   1770     unsigned int xcb_align_to = 0;
   1771 
   1772 
   1773     xcb_block_len += sizeof(xcb_xfixes_get_cursor_name_reply_t);
   1774     xcb_tmp += xcb_block_len;
   1775     xcb_buffer_len += xcb_block_len;
   1776     xcb_block_len = 0;
   1777     /* name */
   1778     xcb_block_len += _aux->nbytes * sizeof(char);
   1779     xcb_tmp += xcb_block_len;
   1780     xcb_align_to = ALIGNOF(char);
   1781     /* insert padding */
   1782     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
   1783     xcb_buffer_len += xcb_block_len + xcb_pad;
   1784     if (0 != xcb_pad) {
   1785         xcb_tmp += xcb_pad;
   1786         xcb_pad = 0;
   1787     }
   1788     xcb_block_len = 0;
   1789 
   1790     return xcb_buffer_len;
   1791 }
   1792 
   1793 xcb_xfixes_get_cursor_name_cookie_t
   1794 xcb_xfixes_get_cursor_name (xcb_connection_t *c,
   1795                             xcb_cursor_t      cursor)
   1796 {
   1797     static const xcb_protocol_request_t xcb_req = {
   1798         .count = 2,
   1799         .ext = &xcb_xfixes_id,
   1800         .opcode = XCB_XFIXES_GET_CURSOR_NAME,
   1801         .isvoid = 0
   1802     };
   1803 
   1804     struct iovec xcb_parts[4];
   1805     xcb_xfixes_get_cursor_name_cookie_t xcb_ret;
   1806     xcb_xfixes_get_cursor_name_request_t xcb_out;
   1807 
   1808     xcb_out.cursor = cursor;
   1809 
   1810     xcb_parts[2].iov_base = (char *) &xcb_out;
   1811     xcb_parts[2].iov_len = sizeof(xcb_out);
   1812     xcb_parts[3].iov_base = 0;
   1813     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   1814 
   1815     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
   1816     return xcb_ret;
   1817 }
   1818 
   1819 xcb_xfixes_get_cursor_name_cookie_t
   1820 xcb_xfixes_get_cursor_name_unchecked (xcb_connection_t *c,
   1821                                       xcb_cursor_t      cursor)
   1822 {
   1823     static const xcb_protocol_request_t xcb_req = {
   1824         .count = 2,
   1825         .ext = &xcb_xfixes_id,
   1826         .opcode = XCB_XFIXES_GET_CURSOR_NAME,
   1827         .isvoid = 0
   1828     };
   1829 
   1830     struct iovec xcb_parts[4];
   1831     xcb_xfixes_get_cursor_name_cookie_t xcb_ret;
   1832     xcb_xfixes_get_cursor_name_request_t xcb_out;
   1833 
   1834     xcb_out.cursor = cursor;
   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 
   1841     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
   1842     return xcb_ret;
   1843 }
   1844 
   1845 char *
   1846 xcb_xfixes_get_cursor_name_name (const xcb_xfixes_get_cursor_name_reply_t *R)
   1847 {
   1848     return (char *) (R + 1);
   1849 }
   1850 
   1851 int
   1852 xcb_xfixes_get_cursor_name_name_length (const xcb_xfixes_get_cursor_name_reply_t *R)
   1853 {
   1854     return R->nbytes;
   1855 }
   1856 
   1857 xcb_generic_iterator_t
   1858 xcb_xfixes_get_cursor_name_name_end (const xcb_xfixes_get_cursor_name_reply_t *R)
   1859 {
   1860     xcb_generic_iterator_t i;
   1861     i.data = ((char *) (R + 1)) + (R->nbytes);
   1862     i.rem = 0;
   1863     i.index = (char *) i.data - (char *) R;
   1864     return i;
   1865 }
   1866 
   1867 xcb_xfixes_get_cursor_name_reply_t *
   1868 xcb_xfixes_get_cursor_name_reply (xcb_connection_t                     *c,
   1869                                   xcb_xfixes_get_cursor_name_cookie_t   cookie  /**< */,
   1870                                   xcb_generic_error_t                 **e)
   1871 {
   1872     return (xcb_xfixes_get_cursor_name_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
   1873 }
   1874 
   1875 int
   1876 xcb_xfixes_get_cursor_image_and_name_sizeof (const void  *_buffer)
   1877 {
   1878     char *xcb_tmp = (char *)_buffer;
   1879     const xcb_xfixes_get_cursor_image_and_name_reply_t *_aux = (xcb_xfixes_get_cursor_image_and_name_reply_t *)_buffer;
   1880     unsigned int xcb_buffer_len = 0;
   1881     unsigned int xcb_block_len = 0;
   1882     unsigned int xcb_pad = 0;
   1883     unsigned int xcb_align_to = 0;
   1884 
   1885 
   1886     xcb_block_len += sizeof(xcb_xfixes_get_cursor_image_and_name_reply_t);
   1887     xcb_tmp += xcb_block_len;
   1888     xcb_buffer_len += xcb_block_len;
   1889     xcb_block_len = 0;
   1890     /* cursor_image */
   1891     xcb_block_len += (_aux->width * _aux->height) * sizeof(uint32_t);
   1892     xcb_tmp += xcb_block_len;
   1893     xcb_align_to = ALIGNOF(uint32_t);
   1894     /* insert padding */
   1895     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
   1896     xcb_buffer_len += xcb_block_len + xcb_pad;
   1897     if (0 != xcb_pad) {
   1898         xcb_tmp += xcb_pad;
   1899         xcb_pad = 0;
   1900     }
   1901     xcb_block_len = 0;
   1902     /* name */
   1903     xcb_block_len += _aux->nbytes * sizeof(char);
   1904     xcb_tmp += xcb_block_len;
   1905     xcb_align_to = ALIGNOF(char);
   1906     /* insert padding */
   1907     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
   1908     xcb_buffer_len += xcb_block_len + xcb_pad;
   1909     if (0 != xcb_pad) {
   1910         xcb_tmp += xcb_pad;
   1911         xcb_pad = 0;
   1912     }
   1913     xcb_block_len = 0;
   1914 
   1915     return xcb_buffer_len;
   1916 }
   1917 
   1918 xcb_xfixes_get_cursor_image_and_name_cookie_t
   1919 xcb_xfixes_get_cursor_image_and_name (xcb_connection_t *c)
   1920 {
   1921     static const xcb_protocol_request_t xcb_req = {
   1922         .count = 2,
   1923         .ext = &xcb_xfixes_id,
   1924         .opcode = XCB_XFIXES_GET_CURSOR_IMAGE_AND_NAME,
   1925         .isvoid = 0
   1926     };
   1927 
   1928     struct iovec xcb_parts[4];
   1929     xcb_xfixes_get_cursor_image_and_name_cookie_t xcb_ret;
   1930     xcb_xfixes_get_cursor_image_and_name_request_t xcb_out;
   1931 
   1932 
   1933     xcb_parts[2].iov_base = (char *) &xcb_out;
   1934     xcb_parts[2].iov_len = sizeof(xcb_out);
   1935     xcb_parts[3].iov_base = 0;
   1936     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   1937 
   1938     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
   1939     return xcb_ret;
   1940 }
   1941 
   1942 xcb_xfixes_get_cursor_image_and_name_cookie_t
   1943 xcb_xfixes_get_cursor_image_and_name_unchecked (xcb_connection_t *c)
   1944 {
   1945     static const xcb_protocol_request_t xcb_req = {
   1946         .count = 2,
   1947         .ext = &xcb_xfixes_id,
   1948         .opcode = XCB_XFIXES_GET_CURSOR_IMAGE_AND_NAME,
   1949         .isvoid = 0
   1950     };
   1951 
   1952     struct iovec xcb_parts[4];
   1953     xcb_xfixes_get_cursor_image_and_name_cookie_t xcb_ret;
   1954     xcb_xfixes_get_cursor_image_and_name_request_t xcb_out;
   1955 
   1956 
   1957     xcb_parts[2].iov_base = (char *) &xcb_out;
   1958     xcb_parts[2].iov_len = sizeof(xcb_out);
   1959     xcb_parts[3].iov_base = 0;
   1960     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   1961 
   1962     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
   1963     return xcb_ret;
   1964 }
   1965 
   1966 uint32_t *
   1967 xcb_xfixes_get_cursor_image_and_name_cursor_image (const xcb_xfixes_get_cursor_image_and_name_reply_t *R)
   1968 {
   1969     return (uint32_t *) (R + 1);
   1970 }
   1971 
   1972 int
   1973 xcb_xfixes_get_cursor_image_and_name_cursor_image_length (const xcb_xfixes_get_cursor_image_and_name_reply_t *R)
   1974 {
   1975     return (R->width * R->height);
   1976 }
   1977 
   1978 xcb_generic_iterator_t
   1979 xcb_xfixes_get_cursor_image_and_name_cursor_image_end (const xcb_xfixes_get_cursor_image_and_name_reply_t *R)
   1980 {
   1981     xcb_generic_iterator_t i;
   1982     i.data = ((uint32_t *) (R + 1)) + ((R->width * R->height));
   1983     i.rem = 0;
   1984     i.index = (char *) i.data - (char *) R;
   1985     return i;
   1986 }
   1987 
   1988 char *
   1989 xcb_xfixes_get_cursor_image_and_name_name (const xcb_xfixes_get_cursor_image_and_name_reply_t *R)
   1990 {
   1991     xcb_generic_iterator_t prev = xcb_xfixes_get_cursor_image_and_name_cursor_image_end(R);
   1992     return (char *) ((char *) prev.data + XCB_TYPE_PAD(char, prev.index) + 0);
   1993 }
   1994 
   1995 int
   1996 xcb_xfixes_get_cursor_image_and_name_name_length (const xcb_xfixes_get_cursor_image_and_name_reply_t *R)
   1997 {
   1998     return R->nbytes;
   1999 }
   2000 
   2001 xcb_generic_iterator_t
   2002 xcb_xfixes_get_cursor_image_and_name_name_end (const xcb_xfixes_get_cursor_image_and_name_reply_t *R)
   2003 {
   2004     xcb_generic_iterator_t i;
   2005     xcb_generic_iterator_t prev = xcb_xfixes_get_cursor_image_and_name_cursor_image_end(R);
   2006     i.data = ((char *) ((char*) prev.data + XCB_TYPE_PAD(char, prev.index))) + (R->nbytes);
   2007     i.rem = 0;
   2008     i.index = (char *) i.data - (char *) R;
   2009     return i;
   2010 }
   2011 
   2012 xcb_xfixes_get_cursor_image_and_name_reply_t *
   2013 xcb_xfixes_get_cursor_image_and_name_reply (xcb_connection_t                               *c,
   2014                                             xcb_xfixes_get_cursor_image_and_name_cookie_t   cookie  /**< */,
   2015                                             xcb_generic_error_t                           **e)
   2016 {
   2017     return (xcb_xfixes_get_cursor_image_and_name_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
   2018 }
   2019 
   2020 xcb_void_cookie_t
   2021 xcb_xfixes_change_cursor_checked (xcb_connection_t *c,
   2022                                   xcb_cursor_t      source,
   2023                                   xcb_cursor_t      destination)
   2024 {
   2025     static const xcb_protocol_request_t xcb_req = {
   2026         .count = 2,
   2027         .ext = &xcb_xfixes_id,
   2028         .opcode = XCB_XFIXES_CHANGE_CURSOR,
   2029         .isvoid = 1
   2030     };
   2031 
   2032     struct iovec xcb_parts[4];
   2033     xcb_void_cookie_t xcb_ret;
   2034     xcb_xfixes_change_cursor_request_t xcb_out;
   2035 
   2036     xcb_out.source = source;
   2037     xcb_out.destination = destination;
   2038 
   2039     xcb_parts[2].iov_base = (char *) &xcb_out;
   2040     xcb_parts[2].iov_len = sizeof(xcb_out);
   2041     xcb_parts[3].iov_base = 0;
   2042     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   2043 
   2044     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
   2045     return xcb_ret;
   2046 }
   2047 
   2048 xcb_void_cookie_t
   2049 xcb_xfixes_change_cursor (xcb_connection_t *c,
   2050                           xcb_cursor_t      source,
   2051                           xcb_cursor_t      destination)
   2052 {
   2053     static const xcb_protocol_request_t xcb_req = {
   2054         .count = 2,
   2055         .ext = &xcb_xfixes_id,
   2056         .opcode = XCB_XFIXES_CHANGE_CURSOR,
   2057         .isvoid = 1
   2058     };
   2059 
   2060     struct iovec xcb_parts[4];
   2061     xcb_void_cookie_t xcb_ret;
   2062     xcb_xfixes_change_cursor_request_t xcb_out;
   2063 
   2064     xcb_out.source = source;
   2065     xcb_out.destination = destination;
   2066 
   2067     xcb_parts[2].iov_base = (char *) &xcb_out;
   2068     xcb_parts[2].iov_len = sizeof(xcb_out);
   2069     xcb_parts[3].iov_base = 0;
   2070     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   2071 
   2072     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
   2073     return xcb_ret;
   2074 }
   2075 
   2076 int
   2077 xcb_xfixes_change_cursor_by_name_sizeof (const void  *_buffer)
   2078 {
   2079     char *xcb_tmp = (char *)_buffer;
   2080     const xcb_xfixes_change_cursor_by_name_request_t *_aux = (xcb_xfixes_change_cursor_by_name_request_t *)_buffer;
   2081     unsigned int xcb_buffer_len = 0;
   2082     unsigned int xcb_block_len = 0;
   2083     unsigned int xcb_pad = 0;
   2084     unsigned int xcb_align_to = 0;
   2085 
   2086 
   2087     xcb_block_len += sizeof(xcb_xfixes_change_cursor_by_name_request_t);
   2088     xcb_tmp += xcb_block_len;
   2089     xcb_buffer_len += xcb_block_len;
   2090     xcb_block_len = 0;
   2091     /* name */
   2092     xcb_block_len += _aux->nbytes * sizeof(char);
   2093     xcb_tmp += xcb_block_len;
   2094     xcb_align_to = ALIGNOF(char);
   2095     /* insert padding */
   2096     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
   2097     xcb_buffer_len += xcb_block_len + xcb_pad;
   2098     if (0 != xcb_pad) {
   2099         xcb_tmp += xcb_pad;
   2100         xcb_pad = 0;
   2101     }
   2102     xcb_block_len = 0;
   2103 
   2104     return xcb_buffer_len;
   2105 }
   2106 
   2107 xcb_void_cookie_t
   2108 xcb_xfixes_change_cursor_by_name_checked (xcb_connection_t *c,
   2109                                           xcb_cursor_t      src,
   2110                                           uint16_t          nbytes,
   2111                                           const char       *name)
   2112 {
   2113     static const xcb_protocol_request_t xcb_req = {
   2114         .count = 4,
   2115         .ext = &xcb_xfixes_id,
   2116         .opcode = XCB_XFIXES_CHANGE_CURSOR_BY_NAME,
   2117         .isvoid = 1
   2118     };
   2119 
   2120     struct iovec xcb_parts[6];
   2121     xcb_void_cookie_t xcb_ret;
   2122     xcb_xfixes_change_cursor_by_name_request_t xcb_out;
   2123 
   2124     xcb_out.src = src;
   2125     xcb_out.nbytes = nbytes;
   2126     memset(xcb_out.pad0, 0, 2);
   2127 
   2128     xcb_parts[2].iov_base = (char *) &xcb_out;
   2129     xcb_parts[2].iov_len = sizeof(xcb_out);
   2130     xcb_parts[3].iov_base = 0;
   2131     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   2132     /* char name */
   2133     xcb_parts[4].iov_base = (char *) name;
   2134     xcb_parts[4].iov_len = nbytes * sizeof(char);
   2135     xcb_parts[5].iov_base = 0;
   2136     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
   2137 
   2138     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
   2139     return xcb_ret;
   2140 }
   2141 
   2142 xcb_void_cookie_t
   2143 xcb_xfixes_change_cursor_by_name (xcb_connection_t *c,
   2144                                   xcb_cursor_t      src,
   2145                                   uint16_t          nbytes,
   2146                                   const char       *name)
   2147 {
   2148     static const xcb_protocol_request_t xcb_req = {
   2149         .count = 4,
   2150         .ext = &xcb_xfixes_id,
   2151         .opcode = XCB_XFIXES_CHANGE_CURSOR_BY_NAME,
   2152         .isvoid = 1
   2153     };
   2154 
   2155     struct iovec xcb_parts[6];
   2156     xcb_void_cookie_t xcb_ret;
   2157     xcb_xfixes_change_cursor_by_name_request_t xcb_out;
   2158 
   2159     xcb_out.src = src;
   2160     xcb_out.nbytes = nbytes;
   2161     memset(xcb_out.pad0, 0, 2);
   2162 
   2163     xcb_parts[2].iov_base = (char *) &xcb_out;
   2164     xcb_parts[2].iov_len = sizeof(xcb_out);
   2165     xcb_parts[3].iov_base = 0;
   2166     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   2167     /* char name */
   2168     xcb_parts[4].iov_base = (char *) name;
   2169     xcb_parts[4].iov_len = nbytes * sizeof(char);
   2170     xcb_parts[5].iov_base = 0;
   2171     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
   2172 
   2173     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
   2174     return xcb_ret;
   2175 }
   2176 
   2177 char *
   2178 xcb_xfixes_change_cursor_by_name_name (const xcb_xfixes_change_cursor_by_name_request_t *R)
   2179 {
   2180     return (char *) (R + 1);
   2181 }
   2182 
   2183 int
   2184 xcb_xfixes_change_cursor_by_name_name_length (const xcb_xfixes_change_cursor_by_name_request_t *R)
   2185 {
   2186     return R->nbytes;
   2187 }
   2188 
   2189 xcb_generic_iterator_t
   2190 xcb_xfixes_change_cursor_by_name_name_end (const xcb_xfixes_change_cursor_by_name_request_t *R)
   2191 {
   2192     xcb_generic_iterator_t i;
   2193     i.data = ((char *) (R + 1)) + (R->nbytes);
   2194     i.rem = 0;
   2195     i.index = (char *) i.data - (char *) R;
   2196     return i;
   2197 }
   2198 
   2199 xcb_void_cookie_t
   2200 xcb_xfixes_expand_region_checked (xcb_connection_t    *c,
   2201                                   xcb_xfixes_region_t  source,
   2202                                   xcb_xfixes_region_t  destination,
   2203                                   uint16_t             left,
   2204                                   uint16_t             right,
   2205                                   uint16_t             top,
   2206                                   uint16_t             bottom)
   2207 {
   2208     static const xcb_protocol_request_t xcb_req = {
   2209         .count = 2,
   2210         .ext = &xcb_xfixes_id,
   2211         .opcode = XCB_XFIXES_EXPAND_REGION,
   2212         .isvoid = 1
   2213     };
   2214 
   2215     struct iovec xcb_parts[4];
   2216     xcb_void_cookie_t xcb_ret;
   2217     xcb_xfixes_expand_region_request_t xcb_out;
   2218 
   2219     xcb_out.source = source;
   2220     xcb_out.destination = destination;
   2221     xcb_out.left = left;
   2222     xcb_out.right = right;
   2223     xcb_out.top = top;
   2224     xcb_out.bottom = bottom;
   2225 
   2226     xcb_parts[2].iov_base = (char *) &xcb_out;
   2227     xcb_parts[2].iov_len = sizeof(xcb_out);
   2228     xcb_parts[3].iov_base = 0;
   2229     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   2230 
   2231     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
   2232     return xcb_ret;
   2233 }
   2234 
   2235 xcb_void_cookie_t
   2236 xcb_xfixes_expand_region (xcb_connection_t    *c,
   2237                           xcb_xfixes_region_t  source,
   2238                           xcb_xfixes_region_t  destination,
   2239                           uint16_t             left,
   2240                           uint16_t             right,
   2241                           uint16_t             top,
   2242                           uint16_t             bottom)
   2243 {
   2244     static const xcb_protocol_request_t xcb_req = {
   2245         .count = 2,
   2246         .ext = &xcb_xfixes_id,
   2247         .opcode = XCB_XFIXES_EXPAND_REGION,
   2248         .isvoid = 1
   2249     };
   2250 
   2251     struct iovec xcb_parts[4];
   2252     xcb_void_cookie_t xcb_ret;
   2253     xcb_xfixes_expand_region_request_t xcb_out;
   2254 
   2255     xcb_out.source = source;
   2256     xcb_out.destination = destination;
   2257     xcb_out.left = left;
   2258     xcb_out.right = right;
   2259     xcb_out.top = top;
   2260     xcb_out.bottom = bottom;
   2261 
   2262     xcb_parts[2].iov_base = (char *) &xcb_out;
   2263     xcb_parts[2].iov_len = sizeof(xcb_out);
   2264     xcb_parts[3].iov_base = 0;
   2265     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   2266 
   2267     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
   2268     return xcb_ret;
   2269 }
   2270 
   2271 xcb_void_cookie_t
   2272 xcb_xfixes_hide_cursor_checked (xcb_connection_t *c,
   2273                                 xcb_window_t      window)
   2274 {
   2275     static const xcb_protocol_request_t xcb_req = {
   2276         .count = 2,
   2277         .ext = &xcb_xfixes_id,
   2278         .opcode = XCB_XFIXES_HIDE_CURSOR,
   2279         .isvoid = 1
   2280     };
   2281 
   2282     struct iovec xcb_parts[4];
   2283     xcb_void_cookie_t xcb_ret;
   2284     xcb_xfixes_hide_cursor_request_t xcb_out;
   2285 
   2286     xcb_out.window = window;
   2287 
   2288     xcb_parts[2].iov_base = (char *) &xcb_out;
   2289     xcb_parts[2].iov_len = sizeof(xcb_out);
   2290     xcb_parts[3].iov_base = 0;
   2291     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   2292 
   2293     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
   2294     return xcb_ret;
   2295 }
   2296 
   2297 xcb_void_cookie_t
   2298 xcb_xfixes_hide_cursor (xcb_connection_t *c,
   2299                         xcb_window_t      window)
   2300 {
   2301     static const xcb_protocol_request_t xcb_req = {
   2302         .count = 2,
   2303         .ext = &xcb_xfixes_id,
   2304         .opcode = XCB_XFIXES_HIDE_CURSOR,
   2305         .isvoid = 1
   2306     };
   2307 
   2308     struct iovec xcb_parts[4];
   2309     xcb_void_cookie_t xcb_ret;
   2310     xcb_xfixes_hide_cursor_request_t xcb_out;
   2311 
   2312     xcb_out.window = window;
   2313 
   2314     xcb_parts[2].iov_base = (char *) &xcb_out;
   2315     xcb_parts[2].iov_len = sizeof(xcb_out);
   2316     xcb_parts[3].iov_base = 0;
   2317     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   2318 
   2319     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
   2320     return xcb_ret;
   2321 }
   2322 
   2323 xcb_void_cookie_t
   2324 xcb_xfixes_show_cursor_checked (xcb_connection_t *c,
   2325                                 xcb_window_t      window)
   2326 {
   2327     static const xcb_protocol_request_t xcb_req = {
   2328         .count = 2,
   2329         .ext = &xcb_xfixes_id,
   2330         .opcode = XCB_XFIXES_SHOW_CURSOR,
   2331         .isvoid = 1
   2332     };
   2333 
   2334     struct iovec xcb_parts[4];
   2335     xcb_void_cookie_t xcb_ret;
   2336     xcb_xfixes_show_cursor_request_t xcb_out;
   2337 
   2338     xcb_out.window = window;
   2339 
   2340     xcb_parts[2].iov_base = (char *) &xcb_out;
   2341     xcb_parts[2].iov_len = sizeof(xcb_out);
   2342     xcb_parts[3].iov_base = 0;
   2343     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   2344 
   2345     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
   2346     return xcb_ret;
   2347 }
   2348 
   2349 xcb_void_cookie_t
   2350 xcb_xfixes_show_cursor (xcb_connection_t *c,
   2351                         xcb_window_t      window)
   2352 {
   2353     static const xcb_protocol_request_t xcb_req = {
   2354         .count = 2,
   2355         .ext = &xcb_xfixes_id,
   2356         .opcode = XCB_XFIXES_SHOW_CURSOR,
   2357         .isvoid = 1
   2358     };
   2359 
   2360     struct iovec xcb_parts[4];
   2361     xcb_void_cookie_t xcb_ret;
   2362     xcb_xfixes_show_cursor_request_t xcb_out;
   2363 
   2364     xcb_out.window = window;
   2365 
   2366     xcb_parts[2].iov_base = (char *) &xcb_out;
   2367     xcb_parts[2].iov_len = sizeof(xcb_out);
   2368     xcb_parts[3].iov_base = 0;
   2369     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   2370 
   2371     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
   2372     return xcb_ret;
   2373 }
   2374 
   2375 void
   2376 xcb_xfixes_barrier_next (xcb_xfixes_barrier_iterator_t *i)
   2377 {
   2378     --i->rem;
   2379     ++i->data;
   2380     i->index += sizeof(xcb_xfixes_barrier_t);
   2381 }
   2382 
   2383 xcb_generic_iterator_t
   2384 xcb_xfixes_barrier_end (xcb_xfixes_barrier_iterator_t i)
   2385 {
   2386     xcb_generic_iterator_t ret;
   2387     ret.data = i.data + i.rem;
   2388     ret.index = i.index + ((char *) ret.data - (char *) i.data);
   2389     ret.rem = 0;
   2390     return ret;
   2391 }
   2392 
   2393 int
   2394 xcb_xfixes_create_pointer_barrier_sizeof (const void  *_buffer)
   2395 {
   2396     char *xcb_tmp = (char *)_buffer;
   2397     const xcb_xfixes_create_pointer_barrier_request_t *_aux = (xcb_xfixes_create_pointer_barrier_request_t *)_buffer;
   2398     unsigned int xcb_buffer_len = 0;
   2399     unsigned int xcb_block_len = 0;
   2400     unsigned int xcb_pad = 0;
   2401     unsigned int xcb_align_to = 0;
   2402 
   2403 
   2404     xcb_block_len += sizeof(xcb_xfixes_create_pointer_barrier_request_t);
   2405     xcb_tmp += xcb_block_len;
   2406     xcb_buffer_len += xcb_block_len;
   2407     xcb_block_len = 0;
   2408     /* devices */
   2409     xcb_block_len += _aux->num_devices * sizeof(uint16_t);
   2410     xcb_tmp += xcb_block_len;
   2411     xcb_align_to = ALIGNOF(uint16_t);
   2412     /* insert padding */
   2413     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
   2414     xcb_buffer_len += xcb_block_len + xcb_pad;
   2415     if (0 != xcb_pad) {
   2416         xcb_tmp += xcb_pad;
   2417         xcb_pad = 0;
   2418     }
   2419     xcb_block_len = 0;
   2420 
   2421     return xcb_buffer_len;
   2422 }
   2423 
   2424 xcb_void_cookie_t
   2425 xcb_xfixes_create_pointer_barrier_checked (xcb_connection_t     *c,
   2426                                            xcb_xfixes_barrier_t  barrier,
   2427                                            xcb_window_t          window,
   2428                                            uint16_t              x1,
   2429                                            uint16_t              y1,
   2430                                            uint16_t              x2,
   2431                                            uint16_t              y2,
   2432                                            uint32_t              directions,
   2433                                            uint16_t              num_devices,
   2434                                            const uint16_t       *devices)
   2435 {
   2436     static const xcb_protocol_request_t xcb_req = {
   2437         .count = 4,
   2438         .ext = &xcb_xfixes_id,
   2439         .opcode = XCB_XFIXES_CREATE_POINTER_BARRIER,
   2440         .isvoid = 1
   2441     };
   2442 
   2443     struct iovec xcb_parts[6];
   2444     xcb_void_cookie_t xcb_ret;
   2445     xcb_xfixes_create_pointer_barrier_request_t xcb_out;
   2446 
   2447     xcb_out.barrier = barrier;
   2448     xcb_out.window = window;
   2449     xcb_out.x1 = x1;
   2450     xcb_out.y1 = y1;
   2451     xcb_out.x2 = x2;
   2452     xcb_out.y2 = y2;
   2453     xcb_out.directions = directions;
   2454     memset(xcb_out.pad0, 0, 2);
   2455     xcb_out.num_devices = num_devices;
   2456 
   2457     xcb_parts[2].iov_base = (char *) &xcb_out;
   2458     xcb_parts[2].iov_len = sizeof(xcb_out);
   2459     xcb_parts[3].iov_base = 0;
   2460     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   2461     /* uint16_t devices */
   2462     xcb_parts[4].iov_base = (char *) devices;
   2463     xcb_parts[4].iov_len = num_devices * sizeof(uint16_t);
   2464     xcb_parts[5].iov_base = 0;
   2465     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
   2466 
   2467     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
   2468     return xcb_ret;
   2469 }
   2470 
   2471 xcb_void_cookie_t
   2472 xcb_xfixes_create_pointer_barrier (xcb_connection_t     *c,
   2473                                    xcb_xfixes_barrier_t  barrier,
   2474                                    xcb_window_t          window,
   2475                                    uint16_t              x1,
   2476                                    uint16_t              y1,
   2477                                    uint16_t              x2,
   2478                                    uint16_t              y2,
   2479                                    uint32_t              directions,
   2480                                    uint16_t              num_devices,
   2481                                    const uint16_t       *devices)
   2482 {
   2483     static const xcb_protocol_request_t xcb_req = {
   2484         .count = 4,
   2485         .ext = &xcb_xfixes_id,
   2486         .opcode = XCB_XFIXES_CREATE_POINTER_BARRIER,
   2487         .isvoid = 1
   2488     };
   2489 
   2490     struct iovec xcb_parts[6];
   2491     xcb_void_cookie_t xcb_ret;
   2492     xcb_xfixes_create_pointer_barrier_request_t xcb_out;
   2493 
   2494     xcb_out.barrier = barrier;
   2495     xcb_out.window = window;
   2496     xcb_out.x1 = x1;
   2497     xcb_out.y1 = y1;
   2498     xcb_out.x2 = x2;
   2499     xcb_out.y2 = y2;
   2500     xcb_out.directions = directions;
   2501     memset(xcb_out.pad0, 0, 2);
   2502     xcb_out.num_devices = num_devices;
   2503 
   2504     xcb_parts[2].iov_base = (char *) &xcb_out;
   2505     xcb_parts[2].iov_len = sizeof(xcb_out);
   2506     xcb_parts[3].iov_base = 0;
   2507     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   2508     /* uint16_t devices */
   2509     xcb_parts[4].iov_base = (char *) devices;
   2510     xcb_parts[4].iov_len = num_devices * sizeof(uint16_t);
   2511     xcb_parts[5].iov_base = 0;
   2512     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
   2513 
   2514     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
   2515     return xcb_ret;
   2516 }
   2517 
   2518 uint16_t *
   2519 xcb_xfixes_create_pointer_barrier_devices (const xcb_xfixes_create_pointer_barrier_request_t *R)
   2520 {
   2521     return (uint16_t *) (R + 1);
   2522 }
   2523 
   2524 int
   2525 xcb_xfixes_create_pointer_barrier_devices_length (const xcb_xfixes_create_pointer_barrier_request_t *R)
   2526 {
   2527     return R->num_devices;
   2528 }
   2529 
   2530 xcb_generic_iterator_t
   2531 xcb_xfixes_create_pointer_barrier_devices_end (const xcb_xfixes_create_pointer_barrier_request_t *R)
   2532 {
   2533     xcb_generic_iterator_t i;
   2534     i.data = ((uint16_t *) (R + 1)) + (R->num_devices);
   2535     i.rem = 0;
   2536     i.index = (char *) i.data - (char *) R;
   2537     return i;
   2538 }
   2539 
   2540 xcb_void_cookie_t
   2541 xcb_xfixes_delete_pointer_barrier_checked (xcb_connection_t     *c,
   2542                                            xcb_xfixes_barrier_t  barrier)
   2543 {
   2544     static const xcb_protocol_request_t xcb_req = {
   2545         .count = 2,
   2546         .ext = &xcb_xfixes_id,
   2547         .opcode = XCB_XFIXES_DELETE_POINTER_BARRIER,
   2548         .isvoid = 1
   2549     };
   2550 
   2551     struct iovec xcb_parts[4];
   2552     xcb_void_cookie_t xcb_ret;
   2553     xcb_xfixes_delete_pointer_barrier_request_t xcb_out;
   2554 
   2555     xcb_out.barrier = barrier;
   2556 
   2557     xcb_parts[2].iov_base = (char *) &xcb_out;
   2558     xcb_parts[2].iov_len = sizeof(xcb_out);
   2559     xcb_parts[3].iov_base = 0;
   2560     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   2561 
   2562     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
   2563     return xcb_ret;
   2564 }
   2565 
   2566 xcb_void_cookie_t
   2567 xcb_xfixes_delete_pointer_barrier (xcb_connection_t     *c,
   2568                                    xcb_xfixes_barrier_t  barrier)
   2569 {
   2570     static const xcb_protocol_request_t xcb_req = {
   2571         .count = 2,
   2572         .ext = &xcb_xfixes_id,
   2573         .opcode = XCB_XFIXES_DELETE_POINTER_BARRIER,
   2574         .isvoid = 1
   2575     };
   2576 
   2577     struct iovec xcb_parts[4];
   2578     xcb_void_cookie_t xcb_ret;
   2579     xcb_xfixes_delete_pointer_barrier_request_t xcb_out;
   2580 
   2581     xcb_out.barrier = barrier;
   2582 
   2583     xcb_parts[2].iov_base = (char *) &xcb_out;
   2584     xcb_parts[2].iov_len = sizeof(xcb_out);
   2585     xcb_parts[3].iov_base = 0;
   2586     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   2587 
   2588     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
   2589     return xcb_ret;
   2590 }
   2591 
   2592 xcb_void_cookie_t
   2593 xcb_xfixes_set_client_disconnect_mode_checked (xcb_connection_t *c,
   2594                                                uint32_t          disconnect_mode)
   2595 {
   2596     static const xcb_protocol_request_t xcb_req = {
   2597         .count = 2,
   2598         .ext = &xcb_xfixes_id,
   2599         .opcode = XCB_XFIXES_SET_CLIENT_DISCONNECT_MODE,
   2600         .isvoid = 1
   2601     };
   2602 
   2603     struct iovec xcb_parts[4];
   2604     xcb_void_cookie_t xcb_ret;
   2605     xcb_xfixes_set_client_disconnect_mode_request_t xcb_out;
   2606 
   2607     xcb_out.disconnect_mode = disconnect_mode;
   2608 
   2609     xcb_parts[2].iov_base = (char *) &xcb_out;
   2610     xcb_parts[2].iov_len = sizeof(xcb_out);
   2611     xcb_parts[3].iov_base = 0;
   2612     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   2613 
   2614     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
   2615     return xcb_ret;
   2616 }
   2617 
   2618 xcb_void_cookie_t
   2619 xcb_xfixes_set_client_disconnect_mode (xcb_connection_t *c,
   2620                                        uint32_t          disconnect_mode)
   2621 {
   2622     static const xcb_protocol_request_t xcb_req = {
   2623         .count = 2,
   2624         .ext = &xcb_xfixes_id,
   2625         .opcode = XCB_XFIXES_SET_CLIENT_DISCONNECT_MODE,
   2626         .isvoid = 1
   2627     };
   2628 
   2629     struct iovec xcb_parts[4];
   2630     xcb_void_cookie_t xcb_ret;
   2631     xcb_xfixes_set_client_disconnect_mode_request_t xcb_out;
   2632 
   2633     xcb_out.disconnect_mode = disconnect_mode;
   2634 
   2635     xcb_parts[2].iov_base = (char *) &xcb_out;
   2636     xcb_parts[2].iov_len = sizeof(xcb_out);
   2637     xcb_parts[3].iov_base = 0;
   2638     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   2639 
   2640     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
   2641     return xcb_ret;
   2642 }
   2643 
   2644 xcb_xfixes_get_client_disconnect_mode_cookie_t
   2645 xcb_xfixes_get_client_disconnect_mode (xcb_connection_t *c)
   2646 {
   2647     static const xcb_protocol_request_t xcb_req = {
   2648         .count = 2,
   2649         .ext = &xcb_xfixes_id,
   2650         .opcode = XCB_XFIXES_GET_CLIENT_DISCONNECT_MODE,
   2651         .isvoid = 0
   2652     };
   2653 
   2654     struct iovec xcb_parts[4];
   2655     xcb_xfixes_get_client_disconnect_mode_cookie_t xcb_ret;
   2656     xcb_xfixes_get_client_disconnect_mode_request_t xcb_out;
   2657 
   2658 
   2659     xcb_parts[2].iov_base = (char *) &xcb_out;
   2660     xcb_parts[2].iov_len = sizeof(xcb_out);
   2661     xcb_parts[3].iov_base = 0;
   2662     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   2663 
   2664     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
   2665     return xcb_ret;
   2666 }
   2667 
   2668 xcb_xfixes_get_client_disconnect_mode_cookie_t
   2669 xcb_xfixes_get_client_disconnect_mode_unchecked (xcb_connection_t *c)
   2670 {
   2671     static const xcb_protocol_request_t xcb_req = {
   2672         .count = 2,
   2673         .ext = &xcb_xfixes_id,
   2674         .opcode = XCB_XFIXES_GET_CLIENT_DISCONNECT_MODE,
   2675         .isvoid = 0
   2676     };
   2677 
   2678     struct iovec xcb_parts[4];
   2679     xcb_xfixes_get_client_disconnect_mode_cookie_t xcb_ret;
   2680     xcb_xfixes_get_client_disconnect_mode_request_t xcb_out;
   2681 
   2682 
   2683     xcb_parts[2].iov_base = (char *) &xcb_out;
   2684     xcb_parts[2].iov_len = sizeof(xcb_out);
   2685     xcb_parts[3].iov_base = 0;
   2686     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
   2687 
   2688     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
   2689     return xcb_ret;
   2690 }
   2691 
   2692 xcb_xfixes_get_client_disconnect_mode_reply_t *
   2693 xcb_xfixes_get_client_disconnect_mode_reply (xcb_connection_t                                *c,
   2694                                              xcb_xfixes_get_client_disconnect_mode_cookie_t   cookie  /**< */,
   2695                                              xcb_generic_error_t                            **e)
   2696 {
   2697     return (xcb_xfixes_get_client_disconnect_mode_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
   2698 }
   2699 
   2700