/*
 * This file generated automatically from composite.xml by c_client.py.
 * Edit at your peril.
 */

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <stddef.h>  /* for offsetof() */
#include "xcbext.h"
#include "composite.h"

#define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member)
#include "xproto.h"
#include "xfixes.h"

xcb_extension_t xcb_composite_id = { "Composite", 0 };

xcb_composite_query_version_cookie_t
xcb_composite_query_version (xcb_connection_t *c,
                             uint32_t          client_major_version,
                             uint32_t          client_minor_version)
{
    static const xcb_protocol_request_t xcb_req = {
        .count = 2,
        .ext = &xcb_composite_id,
        .opcode = XCB_COMPOSITE_QUERY_VERSION,
        .isvoid = 0
    };

    struct iovec xcb_parts[4];
    xcb_composite_query_version_cookie_t xcb_ret;
    xcb_composite_query_version_request_t xcb_out;

    xcb_out.client_major_version = client_major_version;
    xcb_out.client_minor_version = client_minor_version;

    xcb_parts[2].iov_base = (char *) &xcb_out;
    xcb_parts[2].iov_len = sizeof(xcb_out);
    xcb_parts[3].iov_base = 0;
    xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;

    xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
    return xcb_ret;
}

xcb_composite_query_version_cookie_t
xcb_composite_query_version_unchecked (xcb_connection_t *c,
                                       uint32_t          client_major_version,
                                       uint32_t          client_minor_version)
{
    static const xcb_protocol_request_t xcb_req = {
        .count = 2,
        .ext = &xcb_composite_id,
        .opcode = XCB_COMPOSITE_QUERY_VERSION,
        .isvoid = 0
    };

    struct iovec xcb_parts[4];
    xcb_composite_query_version_cookie_t xcb_ret;
    xcb_composite_query_version_request_t xcb_out;

    xcb_out.client_major_version = client_major_version;
    xcb_out.client_minor_version = client_minor_version;

    xcb_parts[2].iov_base = (char *) &xcb_out;
    xcb_parts[2].iov_len = sizeof(xcb_out);
    xcb_parts[3].iov_base = 0;
    xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;

    xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
    return xcb_ret;
}

xcb_composite_query_version_reply_t *
xcb_composite_query_version_reply (xcb_connection_t                      *c,
                                   xcb_composite_query_version_cookie_t   cookie  /**< */,
                                   xcb_generic_error_t                  **e)
{
    return (xcb_composite_query_version_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
}

xcb_void_cookie_t
xcb_composite_redirect_window_checked (xcb_connection_t *c,
                                       xcb_window_t      window,
                                       uint8_t           update)
{
    static const xcb_protocol_request_t xcb_req = {
        .count = 2,
        .ext = &xcb_composite_id,
        .opcode = XCB_COMPOSITE_REDIRECT_WINDOW,
        .isvoid = 1
    };

    struct iovec xcb_parts[4];
    xcb_void_cookie_t xcb_ret;
    xcb_composite_redirect_window_request_t xcb_out;

    xcb_out.window = window;
    xcb_out.update = update;
    memset(xcb_out.pad0, 0, 3);

    xcb_parts[2].iov_base = (char *) &xcb_out;
    xcb_parts[2].iov_len = sizeof(xcb_out);
    xcb_parts[3].iov_base = 0;
    xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;

    xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
    return xcb_ret;
}

xcb_void_cookie_t
xcb_composite_redirect_window (xcb_connection_t *c,
                               xcb_window_t      window,
                               uint8_t           update)
{
    static const xcb_protocol_request_t xcb_req = {
        .count = 2,
        .ext = &xcb_composite_id,
        .opcode = XCB_COMPOSITE_REDIRECT_WINDOW,
        .isvoid = 1
    };

    struct iovec xcb_parts[4];
    xcb_void_cookie_t xcb_ret;
    xcb_composite_redirect_window_request_t xcb_out;

    xcb_out.window = window;
    xcb_out.update = update;
    memset(xcb_out.pad0, 0, 3);

    xcb_parts[2].iov_base = (char *) &xcb_out;
    xcb_parts[2].iov_len = sizeof(xcb_out);
    xcb_parts[3].iov_base = 0;
    xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;

    xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
    return xcb_ret;
}

xcb_void_cookie_t
xcb_composite_redirect_subwindows_checked (xcb_connection_t *c,
                                           xcb_window_t      window,
                                           uint8_t           update)
{
    static const xcb_protocol_request_t xcb_req = {
        .count = 2,
        .ext = &xcb_composite_id,
        .opcode = XCB_COMPOSITE_REDIRECT_SUBWINDOWS,
        .isvoid = 1
    };

    struct iovec xcb_parts[4];
    xcb_void_cookie_t xcb_ret;
    xcb_composite_redirect_subwindows_request_t xcb_out;

    xcb_out.window = window;
    xcb_out.update = update;
    memset(xcb_out.pad0, 0, 3);

    xcb_parts[2].iov_base = (char *) &xcb_out;
    xcb_parts[2].iov_len = sizeof(xcb_out);
    xcb_parts[3].iov_base = 0;
    xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;

    xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
    return xcb_ret;
}

xcb_void_cookie_t
xcb_composite_redirect_subwindows (xcb_connection_t *c,
                                   xcb_window_t      window,
                                   uint8_t           update)
{
    static const xcb_protocol_request_t xcb_req = {
        .count = 2,
        .ext = &xcb_composite_id,
        .opcode = XCB_COMPOSITE_REDIRECT_SUBWINDOWS,
        .isvoid = 1
    };

    struct iovec xcb_parts[4];
    xcb_void_cookie_t xcb_ret;
    xcb_composite_redirect_subwindows_request_t xcb_out;

    xcb_out.window = window;
    xcb_out.update = update;
    memset(xcb_out.pad0, 0, 3);

    xcb_parts[2].iov_base = (char *) &xcb_out;
    xcb_parts[2].iov_len = sizeof(xcb_out);
    xcb_parts[3].iov_base = 0;
    xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;

    xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
    return xcb_ret;
}

xcb_void_cookie_t
xcb_composite_unredirect_window_checked (xcb_connection_t *c,
                                         xcb_window_t      window,
                                         uint8_t           update)
{
    static const xcb_protocol_request_t xcb_req = {
        .count = 2,
        .ext = &xcb_composite_id,
        .opcode = XCB_COMPOSITE_UNREDIRECT_WINDOW,
        .isvoid = 1
    };

    struct iovec xcb_parts[4];
    xcb_void_cookie_t xcb_ret;
    xcb_composite_unredirect_window_request_t xcb_out;

    xcb_out.window = window;
    xcb_out.update = update;
    memset(xcb_out.pad0, 0, 3);

    xcb_parts[2].iov_base = (char *) &xcb_out;
    xcb_parts[2].iov_len = sizeof(xcb_out);
    xcb_parts[3].iov_base = 0;
    xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;

    xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
    return xcb_ret;
}

xcb_void_cookie_t
xcb_composite_unredirect_window (xcb_connection_t *c,
                                 xcb_window_t      window,
                                 uint8_t           update)
{
    static const xcb_protocol_request_t xcb_req = {
        .count = 2,
        .ext = &xcb_composite_id,
        .opcode = XCB_COMPOSITE_UNREDIRECT_WINDOW,
        .isvoid = 1
    };

    struct iovec xcb_parts[4];
    xcb_void_cookie_t xcb_ret;
    xcb_composite_unredirect_window_request_t xcb_out;

    xcb_out.window = window;
    xcb_out.update = update;
    memset(xcb_out.pad0, 0, 3);

    xcb_parts[2].iov_base = (char *) &xcb_out;
    xcb_parts[2].iov_len = sizeof(xcb_out);
    xcb_parts[3].iov_base = 0;
    xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;

    xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
    return xcb_ret;
}

xcb_void_cookie_t
xcb_composite_unredirect_subwindows_checked (xcb_connection_t *c,
                                             xcb_window_t      window,
                                             uint8_t           update)
{
    static const xcb_protocol_request_t xcb_req = {
        .count = 2,
        .ext = &xcb_composite_id,
        .opcode = XCB_COMPOSITE_UNREDIRECT_SUBWINDOWS,
        .isvoid = 1
    };

    struct iovec xcb_parts[4];
    xcb_void_cookie_t xcb_ret;
    xcb_composite_unredirect_subwindows_request_t xcb_out;

    xcb_out.window = window;
    xcb_out.update = update;
    memset(xcb_out.pad0, 0, 3);

    xcb_parts[2].iov_base = (char *) &xcb_out;
    xcb_parts[2].iov_len = sizeof(xcb_out);
    xcb_parts[3].iov_base = 0;
    xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;

    xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
    return xcb_ret;
}

xcb_void_cookie_t
xcb_composite_unredirect_subwindows (xcb_connection_t *c,
                                     xcb_window_t      window,
                                     uint8_t           update)
{
    static const xcb_protocol_request_t xcb_req = {
        .count = 2,
        .ext = &xcb_composite_id,
        .opcode = XCB_COMPOSITE_UNREDIRECT_SUBWINDOWS,
        .isvoid = 1
    };

    struct iovec xcb_parts[4];
    xcb_void_cookie_t xcb_ret;
    xcb_composite_unredirect_subwindows_request_t xcb_out;

    xcb_out.window = window;
    xcb_out.update = update;
    memset(xcb_out.pad0, 0, 3);

    xcb_parts[2].iov_base = (char *) &xcb_out;
    xcb_parts[2].iov_len = sizeof(xcb_out);
    xcb_parts[3].iov_base = 0;
    xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;

    xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
    return xcb_ret;
}

xcb_void_cookie_t
xcb_composite_create_region_from_border_clip_checked (xcb_connection_t    *c,
                                                      xcb_xfixes_region_t  region,
                                                      xcb_window_t         window)
{
    static const xcb_protocol_request_t xcb_req = {
        .count = 2,
        .ext = &xcb_composite_id,
        .opcode = XCB_COMPOSITE_CREATE_REGION_FROM_BORDER_CLIP,
        .isvoid = 1
    };

    struct iovec xcb_parts[4];
    xcb_void_cookie_t xcb_ret;
    xcb_composite_create_region_from_border_clip_request_t xcb_out;

    xcb_out.region = region;
    xcb_out.window = window;

    xcb_parts[2].iov_base = (char *) &xcb_out;
    xcb_parts[2].iov_len = sizeof(xcb_out);
    xcb_parts[3].iov_base = 0;
    xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;

    xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
    return xcb_ret;
}

xcb_void_cookie_t
xcb_composite_create_region_from_border_clip (xcb_connection_t    *c,
                                              xcb_xfixes_region_t  region,
                                              xcb_window_t         window)
{
    static const xcb_protocol_request_t xcb_req = {
        .count = 2,
        .ext = &xcb_composite_id,
        .opcode = XCB_COMPOSITE_CREATE_REGION_FROM_BORDER_CLIP,
        .isvoid = 1
    };

    struct iovec xcb_parts[4];
    xcb_void_cookie_t xcb_ret;
    xcb_composite_create_region_from_border_clip_request_t xcb_out;

    xcb_out.region = region;
    xcb_out.window = window;

    xcb_parts[2].iov_base = (char *) &xcb_out;
    xcb_parts[2].iov_len = sizeof(xcb_out);
    xcb_parts[3].iov_base = 0;
    xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;

    xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
    return xcb_ret;
}

xcb_void_cookie_t
xcb_composite_name_window_pixmap_checked (xcb_connection_t *c,
                                          xcb_window_t      window,
                                          xcb_pixmap_t      pixmap)
{
    static const xcb_protocol_request_t xcb_req = {
        .count = 2,
        .ext = &xcb_composite_id,
        .opcode = XCB_COMPOSITE_NAME_WINDOW_PIXMAP,
        .isvoid = 1
    };

    struct iovec xcb_parts[4];
    xcb_void_cookie_t xcb_ret;
    xcb_composite_name_window_pixmap_request_t xcb_out;

    xcb_out.window = window;
    xcb_out.pixmap = pixmap;

    xcb_parts[2].iov_base = (char *) &xcb_out;
    xcb_parts[2].iov_len = sizeof(xcb_out);
    xcb_parts[3].iov_base = 0;
    xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;

    xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
    return xcb_ret;
}

xcb_void_cookie_t
xcb_composite_name_window_pixmap (xcb_connection_t *c,
                                  xcb_window_t      window,
                                  xcb_pixmap_t      pixmap)
{
    static const xcb_protocol_request_t xcb_req = {
        .count = 2,
        .ext = &xcb_composite_id,
        .opcode = XCB_COMPOSITE_NAME_WINDOW_PIXMAP,
        .isvoid = 1
    };

    struct iovec xcb_parts[4];
    xcb_void_cookie_t xcb_ret;
    xcb_composite_name_window_pixmap_request_t xcb_out;

    xcb_out.window = window;
    xcb_out.pixmap = pixmap;

    xcb_parts[2].iov_base = (char *) &xcb_out;
    xcb_parts[2].iov_len = sizeof(xcb_out);
    xcb_parts[3].iov_base = 0;
    xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;

    xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
    return xcb_ret;
}

xcb_composite_get_overlay_window_cookie_t
xcb_composite_get_overlay_window (xcb_connection_t *c,
                                  xcb_window_t      window)
{
    static const xcb_protocol_request_t xcb_req = {
        .count = 2,
        .ext = &xcb_composite_id,
        .opcode = XCB_COMPOSITE_GET_OVERLAY_WINDOW,
        .isvoid = 0
    };

    struct iovec xcb_parts[4];
    xcb_composite_get_overlay_window_cookie_t xcb_ret;
    xcb_composite_get_overlay_window_request_t xcb_out;

    xcb_out.window = window;

    xcb_parts[2].iov_base = (char *) &xcb_out;
    xcb_parts[2].iov_len = sizeof(xcb_out);
    xcb_parts[3].iov_base = 0;
    xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;

    xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
    return xcb_ret;
}

xcb_composite_get_overlay_window_cookie_t
xcb_composite_get_overlay_window_unchecked (xcb_connection_t *c,
                                            xcb_window_t      window)
{
    static const xcb_protocol_request_t xcb_req = {
        .count = 2,
        .ext = &xcb_composite_id,
        .opcode = XCB_COMPOSITE_GET_OVERLAY_WINDOW,
        .isvoid = 0
    };

    struct iovec xcb_parts[4];
    xcb_composite_get_overlay_window_cookie_t xcb_ret;
    xcb_composite_get_overlay_window_request_t xcb_out;

    xcb_out.window = window;

    xcb_parts[2].iov_base = (char *) &xcb_out;
    xcb_parts[2].iov_len = sizeof(xcb_out);
    xcb_parts[3].iov_base = 0;
    xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;

    xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
    return xcb_ret;
}

xcb_composite_get_overlay_window_reply_t *
xcb_composite_get_overlay_window_reply (xcb_connection_t                           *c,
                                        xcb_composite_get_overlay_window_cookie_t   cookie  /**< */,
                                        xcb_generic_error_t                       **e)
{
    return (xcb_composite_get_overlay_window_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
}

xcb_void_cookie_t
xcb_composite_release_overlay_window_checked (xcb_connection_t *c,
                                              xcb_window_t      window)
{
    static const xcb_protocol_request_t xcb_req = {
        .count = 2,
        .ext = &xcb_composite_id,
        .opcode = XCB_COMPOSITE_RELEASE_OVERLAY_WINDOW,
        .isvoid = 1
    };

    struct iovec xcb_parts[4];
    xcb_void_cookie_t xcb_ret;
    xcb_composite_release_overlay_window_request_t xcb_out;

    xcb_out.window = window;

    xcb_parts[2].iov_base = (char *) &xcb_out;
    xcb_parts[2].iov_len = sizeof(xcb_out);
    xcb_parts[3].iov_base = 0;
    xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;

    xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
    return xcb_ret;
}

xcb_void_cookie_t
xcb_composite_release_overlay_window (xcb_connection_t *c,
                                      xcb_window_t      window)
{
    static const xcb_protocol_request_t xcb_req = {
        .count = 2,
        .ext = &xcb_composite_id,
        .opcode = XCB_COMPOSITE_RELEASE_OVERLAY_WINDOW,
        .isvoid = 1
    };

    struct iovec xcb_parts[4];
    xcb_void_cookie_t xcb_ret;
    xcb_composite_release_overlay_window_request_t xcb_out;

    xcb_out.window = window;

    xcb_parts[2].iov_base = (char *) &xcb_out;
    xcb_parts[2].iov_len = sizeof(xcb_out);
    xcb_parts[3].iov_base = 0;
    xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;

    xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
    return xcb_ret;
}

