diff options
Diffstat (limited to 'src/3rdparty/xcb/libxcb')
-rw-r--r-- | src/3rdparty/xcb/libxcb/fix_compiler_warning_on_32bit_systems.patch | 15 | ||||
-rw-r--r-- | src/3rdparty/xcb/libxcb/fixup-xinput-c.patch | 19 | ||||
-rw-r--r-- | src/3rdparty/xcb/libxcb/randr.c | 5640 | ||||
-rw-r--r-- | src/3rdparty/xcb/libxcb/render.c | 5295 | ||||
-rw-r--r-- | src/3rdparty/xcb/libxcb/shape.c | 1102 | ||||
-rw-r--r-- | src/3rdparty/xcb/libxcb/shm.c | 724 | ||||
-rw-r--r-- | src/3rdparty/xcb/libxcb/sync.c | 2258 | ||||
-rw-r--r-- | src/3rdparty/xcb/libxcb/xfixes.c | 3274 | ||||
-rw-r--r-- | src/3rdparty/xcb/libxcb/xinerama.c | 703 | ||||
-rw-r--r-- | src/3rdparty/xcb/libxcb/xinput.c | 6 | ||||
-rw-r--r-- | src/3rdparty/xcb/libxcb/xkb.c | 15959 |
11 files changed, 22 insertions, 34973 deletions
diff --git a/src/3rdparty/xcb/libxcb/fix_compiler_warning_on_32bit_systems.patch b/src/3rdparty/xcb/libxcb/fix_compiler_warning_on_32bit_systems.patch deleted file mode 100644 index 240c20d2ac..0000000000 --- a/src/3rdparty/xcb/libxcb/fix_compiler_warning_on_32bit_systems.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/src/3rdparty/xcb/include/xcb/xkb.h b/src/3rdparty/xcb/include/xcb/xkb.h -index 44b0a8d..0180ec8 100644 ---- a/src/3rdparty/xcb/include/xcb/xkb.h -+++ b/src/3rdparty/xcb/include/xcb/xkb.h -@@ -114,8 +114,8 @@ typedef enum xcb_xkb_control_t { - XCB_XKB_CONTROL_GROUPS_WRAP = 134217728, - XCB_XKB_CONTROL_INTERNAL_MODS = 268435456, - XCB_XKB_CONTROL_IGNORE_LOCK_MODS = 536870912, -- XCB_XKB_CONTROL_PER_KEY_REPEAT = 1073741824, -- XCB_XKB_CONTROL_CONTROLS_ENABLED = 2147483648 -+ XCB_XKB_CONTROL_PER_KEY_REPEAT = 1073741824u, -+ XCB_XKB_CONTROL_CONTROLS_ENABLED = 2147483648u - } xcb_xkb_control_t; - - typedef enum xcb_xkb_axfb_opt_t { diff --git a/src/3rdparty/xcb/libxcb/fixup-xinput-c.patch b/src/3rdparty/xcb/libxcb/fixup-xinput-c.patch new file mode 100644 index 0000000000..9ddaf6c59a --- /dev/null +++ b/src/3rdparty/xcb/libxcb/fixup-xinput-c.patch @@ -0,0 +1,19 @@ +diff --git a/src/3rdparty/xcb/libxcb/xinput.c b/src/3rdparty/xcb/libxcb/xinput.c +index 0edfde656c..d4e3c250bc 100644 +--- a/src/3rdparty/xcb/libxcb/xinput.c ++++ b/src/3rdparty/xcb/libxcb/xinput.c +@@ -10,11 +10,11 @@ + #include <string.h> + #include <assert.h> + #include <stddef.h> /* for offsetof() */ +-#include "xcbext.h" +-#include "xinput.h" ++#include <xcb/xcbext.h> ++#include <xcb/xinput.h> + + #define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member) +-#include "xfixes.h" ++#include <xcb/xfixes.h> + + xcb_extension_t xcb_input_id = { "XInputExtension", 0 }; + diff --git a/src/3rdparty/xcb/libxcb/randr.c b/src/3rdparty/xcb/libxcb/randr.c deleted file mode 100644 index 0232af802f..0000000000 --- a/src/3rdparty/xcb/libxcb/randr.c +++ /dev/null @@ -1,5640 +0,0 @@ -/* - * This file generated automatically from randr.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 "randr.h" - -#define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member) -#include "xproto.h" -#include "render.h" - -xcb_extension_t xcb_randr_id = { "RANDR", 0 }; - - -/***************************************************************************** - ** - ** void xcb_randr_mode_next - ** - ** @param xcb_randr_mode_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_randr_mode_next (xcb_randr_mode_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_randr_mode_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_randr_mode_end - ** - ** @param xcb_randr_mode_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_randr_mode_end (xcb_randr_mode_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_randr_crtc_next - ** - ** @param xcb_randr_crtc_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_randr_crtc_next (xcb_randr_crtc_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_randr_crtc_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_randr_crtc_end - ** - ** @param xcb_randr_crtc_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_randr_crtc_end (xcb_randr_crtc_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_randr_output_next - ** - ** @param xcb_randr_output_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_randr_output_next (xcb_randr_output_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_randr_output_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_randr_output_end - ** - ** @param xcb_randr_output_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_randr_output_end (xcb_randr_output_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_randr_screen_size_next - ** - ** @param xcb_randr_screen_size_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_randr_screen_size_next (xcb_randr_screen_size_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_randr_screen_size_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_randr_screen_size_end - ** - ** @param xcb_randr_screen_size_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_randr_screen_size_end (xcb_randr_screen_size_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - -int -xcb_randr_refresh_rates_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_randr_refresh_rates_t *_aux = (xcb_randr_refresh_rates_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_randr_refresh_rates_t); - xcb_tmp += xcb_block_len; - /* rates */ - xcb_block_len += _aux->nRates * sizeof(uint16_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(uint16_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** uint16_t * xcb_randr_refresh_rates_rates - ** - ** @param const xcb_randr_refresh_rates_t *R - ** @returns uint16_t * - ** - *****************************************************************************/ - -uint16_t * -xcb_randr_refresh_rates_rates (const xcb_randr_refresh_rates_t *R /**< */) -{ - return (uint16_t *) (R + 1); -} - - -/***************************************************************************** - ** - ** int xcb_randr_refresh_rates_rates_length - ** - ** @param const xcb_randr_refresh_rates_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_randr_refresh_rates_rates_length (const xcb_randr_refresh_rates_t *R /**< */) -{ - return R->nRates; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_randr_refresh_rates_rates_end - ** - ** @param const xcb_randr_refresh_rates_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_randr_refresh_rates_rates_end (const xcb_randr_refresh_rates_t *R /**< */) -{ - xcb_generic_iterator_t i; - i.data = ((uint16_t *) (R + 1)) + (R->nRates); - i.rem = 0; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** void xcb_randr_refresh_rates_next - ** - ** @param xcb_randr_refresh_rates_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_randr_refresh_rates_next (xcb_randr_refresh_rates_iterator_t *i /**< */) -{ - xcb_randr_refresh_rates_t *R = i->data; - xcb_generic_iterator_t child; - child.data = (xcb_randr_refresh_rates_t *)(((char *)R) + xcb_randr_refresh_rates_sizeof(R)); - i->index = (char *) child.data - (char *) i->data; - --i->rem; - i->data = (xcb_randr_refresh_rates_t *) child.data; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_randr_refresh_rates_end - ** - ** @param xcb_randr_refresh_rates_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_randr_refresh_rates_end (xcb_randr_refresh_rates_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - while(i.rem > 0) - xcb_randr_refresh_rates_next(&i); - ret.data = i.data; - ret.rem = i.rem; - ret.index = i.index; - return ret; -} - - -/***************************************************************************** - ** - ** xcb_randr_query_version_cookie_t xcb_randr_query_version - ** - ** @param xcb_connection_t *c - ** @param uint32_t major_version - ** @param uint32_t minor_version - ** @returns xcb_randr_query_version_cookie_t - ** - *****************************************************************************/ - -xcb_randr_query_version_cookie_t -xcb_randr_query_version (xcb_connection_t *c /**< */, - uint32_t major_version /**< */, - uint32_t minor_version /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_QUERY_VERSION, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_randr_query_version_cookie_t xcb_ret; - xcb_randr_query_version_request_t xcb_out; - - xcb_out.major_version = major_version; - xcb_out.minor_version = 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_randr_query_version_cookie_t xcb_randr_query_version_unchecked - ** - ** @param xcb_connection_t *c - ** @param uint32_t major_version - ** @param uint32_t minor_version - ** @returns xcb_randr_query_version_cookie_t - ** - *****************************************************************************/ - -xcb_randr_query_version_cookie_t -xcb_randr_query_version_unchecked (xcb_connection_t *c /**< */, - uint32_t major_version /**< */, - uint32_t minor_version /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_QUERY_VERSION, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_randr_query_version_cookie_t xcb_ret; - xcb_randr_query_version_request_t xcb_out; - - xcb_out.major_version = major_version; - xcb_out.minor_version = 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_randr_query_version_reply_t * xcb_randr_query_version_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_query_version_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_randr_query_version_reply_t * - ** - *****************************************************************************/ - -xcb_randr_query_version_reply_t * -xcb_randr_query_version_reply (xcb_connection_t *c /**< */, - xcb_randr_query_version_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_randr_query_version_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - - -/***************************************************************************** - ** - ** xcb_randr_set_screen_config_cookie_t xcb_randr_set_screen_config - ** - ** @param xcb_connection_t *c - ** @param xcb_window_t window - ** @param xcb_timestamp_t timestamp - ** @param xcb_timestamp_t config_timestamp - ** @param uint16_t sizeID - ** @param uint16_t rotation - ** @param uint16_t rate - ** @returns xcb_randr_set_screen_config_cookie_t - ** - *****************************************************************************/ - -xcb_randr_set_screen_config_cookie_t -xcb_randr_set_screen_config (xcb_connection_t *c /**< */, - xcb_window_t window /**< */, - xcb_timestamp_t timestamp /**< */, - xcb_timestamp_t config_timestamp /**< */, - uint16_t sizeID /**< */, - uint16_t rotation /**< */, - uint16_t rate /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_SET_SCREEN_CONFIG, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_randr_set_screen_config_cookie_t xcb_ret; - xcb_randr_set_screen_config_request_t xcb_out; - - xcb_out.window = window; - xcb_out.timestamp = timestamp; - xcb_out.config_timestamp = config_timestamp; - xcb_out.sizeID = sizeID; - xcb_out.rotation = rotation; - xcb_out.rate = rate; - memset(xcb_out.pad0, 0, 2); - - 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_randr_set_screen_config_cookie_t xcb_randr_set_screen_config_unchecked - ** - ** @param xcb_connection_t *c - ** @param xcb_window_t window - ** @param xcb_timestamp_t timestamp - ** @param xcb_timestamp_t config_timestamp - ** @param uint16_t sizeID - ** @param uint16_t rotation - ** @param uint16_t rate - ** @returns xcb_randr_set_screen_config_cookie_t - ** - *****************************************************************************/ - -xcb_randr_set_screen_config_cookie_t -xcb_randr_set_screen_config_unchecked (xcb_connection_t *c /**< */, - xcb_window_t window /**< */, - xcb_timestamp_t timestamp /**< */, - xcb_timestamp_t config_timestamp /**< */, - uint16_t sizeID /**< */, - uint16_t rotation /**< */, - uint16_t rate /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_SET_SCREEN_CONFIG, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_randr_set_screen_config_cookie_t xcb_ret; - xcb_randr_set_screen_config_request_t xcb_out; - - xcb_out.window = window; - xcb_out.timestamp = timestamp; - xcb_out.config_timestamp = config_timestamp; - xcb_out.sizeID = sizeID; - xcb_out.rotation = rotation; - xcb_out.rate = rate; - memset(xcb_out.pad0, 0, 2); - - 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_randr_set_screen_config_reply_t * xcb_randr_set_screen_config_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_set_screen_config_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_randr_set_screen_config_reply_t * - ** - *****************************************************************************/ - -xcb_randr_set_screen_config_reply_t * -xcb_randr_set_screen_config_reply (xcb_connection_t *c /**< */, - xcb_randr_set_screen_config_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_randr_set_screen_config_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_randr_select_input_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_window_t window - ** @param uint16_t enable - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_randr_select_input_checked (xcb_connection_t *c /**< */, - xcb_window_t window /**< */, - uint16_t enable /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_SELECT_INPUT, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_randr_select_input_request_t xcb_out; - - xcb_out.window = window; - xcb_out.enable = enable; - memset(xcb_out.pad0, 0, 2); - - 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_randr_select_input - ** - ** @param xcb_connection_t *c - ** @param xcb_window_t window - ** @param uint16_t enable - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_randr_select_input (xcb_connection_t *c /**< */, - xcb_window_t window /**< */, - uint16_t enable /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_SELECT_INPUT, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_randr_select_input_request_t xcb_out; - - xcb_out.window = window; - xcb_out.enable = enable; - memset(xcb_out.pad0, 0, 2); - - 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; -} - -int -xcb_randr_get_screen_info_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_randr_get_screen_info_reply_t *_aux = (xcb_randr_get_screen_info_reply_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - unsigned int i; - unsigned int xcb_tmp_len; - - xcb_block_len += sizeof(xcb_randr_get_screen_info_reply_t); - xcb_tmp += xcb_block_len; - /* sizes */ - xcb_block_len += _aux->nSizes * sizeof(xcb_randr_screen_size_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_randr_screen_size_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* rates */ - for(i=0; i<(_aux->nInfo - _aux->nSizes); i++) { - xcb_tmp_len = xcb_randr_refresh_rates_sizeof(xcb_tmp); - xcb_block_len += xcb_tmp_len; - xcb_tmp += xcb_tmp_len; - } - xcb_align_to = ALIGNOF(xcb_randr_refresh_rates_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_randr_get_screen_info_cookie_t xcb_randr_get_screen_info - ** - ** @param xcb_connection_t *c - ** @param xcb_window_t window - ** @returns xcb_randr_get_screen_info_cookie_t - ** - *****************************************************************************/ - -xcb_randr_get_screen_info_cookie_t -xcb_randr_get_screen_info (xcb_connection_t *c /**< */, - xcb_window_t window /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_GET_SCREEN_INFO, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_randr_get_screen_info_cookie_t xcb_ret; - xcb_randr_get_screen_info_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_randr_get_screen_info_cookie_t xcb_randr_get_screen_info_unchecked - ** - ** @param xcb_connection_t *c - ** @param xcb_window_t window - ** @returns xcb_randr_get_screen_info_cookie_t - ** - *****************************************************************************/ - -xcb_randr_get_screen_info_cookie_t -xcb_randr_get_screen_info_unchecked (xcb_connection_t *c /**< */, - xcb_window_t window /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_GET_SCREEN_INFO, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_randr_get_screen_info_cookie_t xcb_ret; - xcb_randr_get_screen_info_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_randr_screen_size_t * xcb_randr_get_screen_info_sizes - ** - ** @param const xcb_randr_get_screen_info_reply_t *R - ** @returns xcb_randr_screen_size_t * - ** - *****************************************************************************/ - -xcb_randr_screen_size_t * -xcb_randr_get_screen_info_sizes (const xcb_randr_get_screen_info_reply_t *R /**< */) -{ - return (xcb_randr_screen_size_t *) (R + 1); -} - - -/***************************************************************************** - ** - ** int xcb_randr_get_screen_info_sizes_length - ** - ** @param const xcb_randr_get_screen_info_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_randr_get_screen_info_sizes_length (const xcb_randr_get_screen_info_reply_t *R /**< */) -{ - return R->nSizes; -} - - -/***************************************************************************** - ** - ** xcb_randr_screen_size_iterator_t xcb_randr_get_screen_info_sizes_iterator - ** - ** @param const xcb_randr_get_screen_info_reply_t *R - ** @returns xcb_randr_screen_size_iterator_t - ** - *****************************************************************************/ - -xcb_randr_screen_size_iterator_t -xcb_randr_get_screen_info_sizes_iterator (const xcb_randr_get_screen_info_reply_t *R /**< */) -{ - xcb_randr_screen_size_iterator_t i; - i.data = (xcb_randr_screen_size_t *) (R + 1); - i.rem = R->nSizes; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** int xcb_randr_get_screen_info_rates_length - ** - ** @param const xcb_randr_get_screen_info_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_randr_get_screen_info_rates_length (const xcb_randr_get_screen_info_reply_t *R /**< */) -{ - return (R->nInfo - R->nSizes); -} - - -/***************************************************************************** - ** - ** xcb_randr_refresh_rates_iterator_t xcb_randr_get_screen_info_rates_iterator - ** - ** @param const xcb_randr_get_screen_info_reply_t *R - ** @returns xcb_randr_refresh_rates_iterator_t - ** - *****************************************************************************/ - -xcb_randr_refresh_rates_iterator_t -xcb_randr_get_screen_info_rates_iterator (const xcb_randr_get_screen_info_reply_t *R /**< */) -{ - xcb_randr_refresh_rates_iterator_t i; - xcb_generic_iterator_t prev = xcb_randr_screen_size_end(xcb_randr_get_screen_info_sizes_iterator(R)); - i.data = (xcb_randr_refresh_rates_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_randr_refresh_rates_t, prev.index)); - i.rem = (R->nInfo - R->nSizes); - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** xcb_randr_get_screen_info_reply_t * xcb_randr_get_screen_info_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_get_screen_info_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_randr_get_screen_info_reply_t * - ** - *****************************************************************************/ - -xcb_randr_get_screen_info_reply_t * -xcb_randr_get_screen_info_reply (xcb_connection_t *c /**< */, - xcb_randr_get_screen_info_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_randr_get_screen_info_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - - -/***************************************************************************** - ** - ** xcb_randr_get_screen_size_range_cookie_t xcb_randr_get_screen_size_range - ** - ** @param xcb_connection_t *c - ** @param xcb_window_t window - ** @returns xcb_randr_get_screen_size_range_cookie_t - ** - *****************************************************************************/ - -xcb_randr_get_screen_size_range_cookie_t -xcb_randr_get_screen_size_range (xcb_connection_t *c /**< */, - xcb_window_t window /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_GET_SCREEN_SIZE_RANGE, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_randr_get_screen_size_range_cookie_t xcb_ret; - xcb_randr_get_screen_size_range_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_randr_get_screen_size_range_cookie_t xcb_randr_get_screen_size_range_unchecked - ** - ** @param xcb_connection_t *c - ** @param xcb_window_t window - ** @returns xcb_randr_get_screen_size_range_cookie_t - ** - *****************************************************************************/ - -xcb_randr_get_screen_size_range_cookie_t -xcb_randr_get_screen_size_range_unchecked (xcb_connection_t *c /**< */, - xcb_window_t window /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_GET_SCREEN_SIZE_RANGE, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_randr_get_screen_size_range_cookie_t xcb_ret; - xcb_randr_get_screen_size_range_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_randr_get_screen_size_range_reply_t * xcb_randr_get_screen_size_range_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_get_screen_size_range_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_randr_get_screen_size_range_reply_t * - ** - *****************************************************************************/ - -xcb_randr_get_screen_size_range_reply_t * -xcb_randr_get_screen_size_range_reply (xcb_connection_t *c /**< */, - xcb_randr_get_screen_size_range_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_randr_get_screen_size_range_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_randr_set_screen_size_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_window_t window - ** @param uint16_t width - ** @param uint16_t height - ** @param uint32_t mm_width - ** @param uint32_t mm_height - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_randr_set_screen_size_checked (xcb_connection_t *c /**< */, - xcb_window_t window /**< */, - uint16_t width /**< */, - uint16_t height /**< */, - uint32_t mm_width /**< */, - uint32_t mm_height /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_SET_SCREEN_SIZE, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_randr_set_screen_size_request_t xcb_out; - - xcb_out.window = window; - xcb_out.width = width; - xcb_out.height = height; - xcb_out.mm_width = mm_width; - xcb_out.mm_height = mm_height; - - 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_randr_set_screen_size - ** - ** @param xcb_connection_t *c - ** @param xcb_window_t window - ** @param uint16_t width - ** @param uint16_t height - ** @param uint32_t mm_width - ** @param uint32_t mm_height - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_randr_set_screen_size (xcb_connection_t *c /**< */, - xcb_window_t window /**< */, - uint16_t width /**< */, - uint16_t height /**< */, - uint32_t mm_width /**< */, - uint32_t mm_height /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_SET_SCREEN_SIZE, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_randr_set_screen_size_request_t xcb_out; - - xcb_out.window = window; - xcb_out.width = width; - xcb_out.height = height; - xcb_out.mm_width = mm_width; - xcb_out.mm_height = mm_height; - - 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; -} - - -/***************************************************************************** - ** - ** void xcb_randr_mode_info_next - ** - ** @param xcb_randr_mode_info_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_randr_mode_info_next (xcb_randr_mode_info_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_randr_mode_info_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_randr_mode_info_end - ** - ** @param xcb_randr_mode_info_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_randr_mode_info_end (xcb_randr_mode_info_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - -int -xcb_randr_get_screen_resources_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_randr_get_screen_resources_reply_t *_aux = (xcb_randr_get_screen_resources_reply_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_randr_get_screen_resources_reply_t); - xcb_tmp += xcb_block_len; - /* crtcs */ - xcb_block_len += _aux->num_crtcs * sizeof(uint32_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_randr_crtc_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* outputs */ - xcb_block_len += _aux->num_outputs * sizeof(uint32_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_randr_output_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* modes */ - xcb_block_len += _aux->num_modes * sizeof(xcb_randr_mode_info_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_randr_mode_info_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* names */ - xcb_block_len += _aux->names_len * sizeof(uint8_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(uint8_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_randr_get_screen_resources_cookie_t xcb_randr_get_screen_resources - ** - ** @param xcb_connection_t *c - ** @param xcb_window_t window - ** @returns xcb_randr_get_screen_resources_cookie_t - ** - *****************************************************************************/ - -xcb_randr_get_screen_resources_cookie_t -xcb_randr_get_screen_resources (xcb_connection_t *c /**< */, - xcb_window_t window /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_GET_SCREEN_RESOURCES, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_randr_get_screen_resources_cookie_t xcb_ret; - xcb_randr_get_screen_resources_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_randr_get_screen_resources_cookie_t xcb_randr_get_screen_resources_unchecked - ** - ** @param xcb_connection_t *c - ** @param xcb_window_t window - ** @returns xcb_randr_get_screen_resources_cookie_t - ** - *****************************************************************************/ - -xcb_randr_get_screen_resources_cookie_t -xcb_randr_get_screen_resources_unchecked (xcb_connection_t *c /**< */, - xcb_window_t window /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_GET_SCREEN_RESOURCES, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_randr_get_screen_resources_cookie_t xcb_ret; - xcb_randr_get_screen_resources_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_randr_crtc_t * xcb_randr_get_screen_resources_crtcs - ** - ** @param const xcb_randr_get_screen_resources_reply_t *R - ** @returns xcb_randr_crtc_t * - ** - *****************************************************************************/ - -xcb_randr_crtc_t * -xcb_randr_get_screen_resources_crtcs (const xcb_randr_get_screen_resources_reply_t *R /**< */) -{ - return (xcb_randr_crtc_t *) (R + 1); -} - - -/***************************************************************************** - ** - ** int xcb_randr_get_screen_resources_crtcs_length - ** - ** @param const xcb_randr_get_screen_resources_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_randr_get_screen_resources_crtcs_length (const xcb_randr_get_screen_resources_reply_t *R /**< */) -{ - return R->num_crtcs; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_randr_get_screen_resources_crtcs_end - ** - ** @param const xcb_randr_get_screen_resources_reply_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_randr_get_screen_resources_crtcs_end (const xcb_randr_get_screen_resources_reply_t *R /**< */) -{ - xcb_generic_iterator_t i; - i.data = ((xcb_randr_crtc_t *) (R + 1)) + (R->num_crtcs); - i.rem = 0; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** xcb_randr_output_t * xcb_randr_get_screen_resources_outputs - ** - ** @param const xcb_randr_get_screen_resources_reply_t *R - ** @returns xcb_randr_output_t * - ** - *****************************************************************************/ - -xcb_randr_output_t * -xcb_randr_get_screen_resources_outputs (const xcb_randr_get_screen_resources_reply_t *R /**< */) -{ - xcb_generic_iterator_t prev = xcb_randr_get_screen_resources_crtcs_end(R); - return (xcb_randr_output_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_randr_output_t, prev.index) + 0); -} - - -/***************************************************************************** - ** - ** int xcb_randr_get_screen_resources_outputs_length - ** - ** @param const xcb_randr_get_screen_resources_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_randr_get_screen_resources_outputs_length (const xcb_randr_get_screen_resources_reply_t *R /**< */) -{ - return R->num_outputs; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_randr_get_screen_resources_outputs_end - ** - ** @param const xcb_randr_get_screen_resources_reply_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_randr_get_screen_resources_outputs_end (const xcb_randr_get_screen_resources_reply_t *R /**< */) -{ - xcb_generic_iterator_t i; - xcb_generic_iterator_t child = xcb_randr_get_screen_resources_crtcs_end(R); - i.data = ((xcb_randr_output_t *) child.data) + (R->num_outputs); - i.rem = 0; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** xcb_randr_mode_info_t * xcb_randr_get_screen_resources_modes - ** - ** @param const xcb_randr_get_screen_resources_reply_t *R - ** @returns xcb_randr_mode_info_t * - ** - *****************************************************************************/ - -xcb_randr_mode_info_t * -xcb_randr_get_screen_resources_modes (const xcb_randr_get_screen_resources_reply_t *R /**< */) -{ - xcb_generic_iterator_t prev = xcb_randr_get_screen_resources_outputs_end(R); - return (xcb_randr_mode_info_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_randr_mode_info_t, prev.index) + 0); -} - - -/***************************************************************************** - ** - ** int xcb_randr_get_screen_resources_modes_length - ** - ** @param const xcb_randr_get_screen_resources_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_randr_get_screen_resources_modes_length (const xcb_randr_get_screen_resources_reply_t *R /**< */) -{ - return R->num_modes; -} - - -/***************************************************************************** - ** - ** xcb_randr_mode_info_iterator_t xcb_randr_get_screen_resources_modes_iterator - ** - ** @param const xcb_randr_get_screen_resources_reply_t *R - ** @returns xcb_randr_mode_info_iterator_t - ** - *****************************************************************************/ - -xcb_randr_mode_info_iterator_t -xcb_randr_get_screen_resources_modes_iterator (const xcb_randr_get_screen_resources_reply_t *R /**< */) -{ - xcb_randr_mode_info_iterator_t i; - xcb_generic_iterator_t prev = xcb_randr_get_screen_resources_outputs_end(R); - i.data = (xcb_randr_mode_info_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_randr_mode_info_t, prev.index)); - i.rem = R->num_modes; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** uint8_t * xcb_randr_get_screen_resources_names - ** - ** @param const xcb_randr_get_screen_resources_reply_t *R - ** @returns uint8_t * - ** - *****************************************************************************/ - -uint8_t * -xcb_randr_get_screen_resources_names (const xcb_randr_get_screen_resources_reply_t *R /**< */) -{ - xcb_generic_iterator_t prev = xcb_randr_mode_info_end(xcb_randr_get_screen_resources_modes_iterator(R)); - return (uint8_t *) ((char *) prev.data + XCB_TYPE_PAD(uint8_t, prev.index) + 0); -} - - -/***************************************************************************** - ** - ** int xcb_randr_get_screen_resources_names_length - ** - ** @param const xcb_randr_get_screen_resources_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_randr_get_screen_resources_names_length (const xcb_randr_get_screen_resources_reply_t *R /**< */) -{ - return R->names_len; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_randr_get_screen_resources_names_end - ** - ** @param const xcb_randr_get_screen_resources_reply_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_randr_get_screen_resources_names_end (const xcb_randr_get_screen_resources_reply_t *R /**< */) -{ - xcb_generic_iterator_t i; - xcb_generic_iterator_t child = xcb_randr_mode_info_end(xcb_randr_get_screen_resources_modes_iterator(R)); - i.data = ((uint8_t *) child.data) + (R->names_len); - i.rem = 0; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** xcb_randr_get_screen_resources_reply_t * xcb_randr_get_screen_resources_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_get_screen_resources_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_randr_get_screen_resources_reply_t * - ** - *****************************************************************************/ - -xcb_randr_get_screen_resources_reply_t * -xcb_randr_get_screen_resources_reply (xcb_connection_t *c /**< */, - xcb_randr_get_screen_resources_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_randr_get_screen_resources_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - -int -xcb_randr_get_output_info_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_randr_get_output_info_reply_t *_aux = (xcb_randr_get_output_info_reply_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_randr_get_output_info_reply_t); - xcb_tmp += xcb_block_len; - /* crtcs */ - xcb_block_len += _aux->num_crtcs * sizeof(xcb_randr_output_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_randr_crtc_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* modes */ - xcb_block_len += _aux->num_modes * sizeof(xcb_randr_output_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_randr_mode_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* clones */ - xcb_block_len += _aux->num_clones * sizeof(xcb_randr_output_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_randr_output_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* name */ - xcb_block_len += _aux->name_len * sizeof(uint8_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(uint8_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_randr_get_output_info_cookie_t xcb_randr_get_output_info - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_output_t output - ** @param xcb_timestamp_t config_timestamp - ** @returns xcb_randr_get_output_info_cookie_t - ** - *****************************************************************************/ - -xcb_randr_get_output_info_cookie_t -xcb_randr_get_output_info (xcb_connection_t *c /**< */, - xcb_randr_output_t output /**< */, - xcb_timestamp_t config_timestamp /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_GET_OUTPUT_INFO, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_randr_get_output_info_cookie_t xcb_ret; - xcb_randr_get_output_info_request_t xcb_out; - - xcb_out.output = output; - xcb_out.config_timestamp = config_timestamp; - - 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_randr_get_output_info_cookie_t xcb_randr_get_output_info_unchecked - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_output_t output - ** @param xcb_timestamp_t config_timestamp - ** @returns xcb_randr_get_output_info_cookie_t - ** - *****************************************************************************/ - -xcb_randr_get_output_info_cookie_t -xcb_randr_get_output_info_unchecked (xcb_connection_t *c /**< */, - xcb_randr_output_t output /**< */, - xcb_timestamp_t config_timestamp /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_GET_OUTPUT_INFO, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_randr_get_output_info_cookie_t xcb_ret; - xcb_randr_get_output_info_request_t xcb_out; - - xcb_out.output = output; - xcb_out.config_timestamp = config_timestamp; - - 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_randr_crtc_t * xcb_randr_get_output_info_crtcs - ** - ** @param const xcb_randr_get_output_info_reply_t *R - ** @returns xcb_randr_crtc_t * - ** - *****************************************************************************/ - -xcb_randr_crtc_t * -xcb_randr_get_output_info_crtcs (const xcb_randr_get_output_info_reply_t *R /**< */) -{ - return (xcb_randr_crtc_t *) (R + 1); -} - - -/***************************************************************************** - ** - ** int xcb_randr_get_output_info_crtcs_length - ** - ** @param const xcb_randr_get_output_info_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_randr_get_output_info_crtcs_length (const xcb_randr_get_output_info_reply_t *R /**< */) -{ - return R->num_crtcs; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_randr_get_output_info_crtcs_end - ** - ** @param const xcb_randr_get_output_info_reply_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_randr_get_output_info_crtcs_end (const xcb_randr_get_output_info_reply_t *R /**< */) -{ - xcb_generic_iterator_t i; - i.data = ((xcb_randr_crtc_t *) (R + 1)) + (R->num_crtcs); - i.rem = 0; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** xcb_randr_mode_t * xcb_randr_get_output_info_modes - ** - ** @param const xcb_randr_get_output_info_reply_t *R - ** @returns xcb_randr_mode_t * - ** - *****************************************************************************/ - -xcb_randr_mode_t * -xcb_randr_get_output_info_modes (const xcb_randr_get_output_info_reply_t *R /**< */) -{ - xcb_generic_iterator_t prev = xcb_randr_get_output_info_crtcs_end(R); - return (xcb_randr_mode_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_randr_mode_t, prev.index) + 0); -} - - -/***************************************************************************** - ** - ** int xcb_randr_get_output_info_modes_length - ** - ** @param const xcb_randr_get_output_info_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_randr_get_output_info_modes_length (const xcb_randr_get_output_info_reply_t *R /**< */) -{ - return R->num_modes; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_randr_get_output_info_modes_end - ** - ** @param const xcb_randr_get_output_info_reply_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_randr_get_output_info_modes_end (const xcb_randr_get_output_info_reply_t *R /**< */) -{ - xcb_generic_iterator_t i; - xcb_generic_iterator_t child = xcb_randr_get_output_info_crtcs_end(R); - i.data = ((xcb_randr_mode_t *) child.data) + (R->num_modes); - i.rem = 0; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** xcb_randr_output_t * xcb_randr_get_output_info_clones - ** - ** @param const xcb_randr_get_output_info_reply_t *R - ** @returns xcb_randr_output_t * - ** - *****************************************************************************/ - -xcb_randr_output_t * -xcb_randr_get_output_info_clones (const xcb_randr_get_output_info_reply_t *R /**< */) -{ - xcb_generic_iterator_t prev = xcb_randr_get_output_info_modes_end(R); - return (xcb_randr_output_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_randr_output_t, prev.index) + 0); -} - - -/***************************************************************************** - ** - ** int xcb_randr_get_output_info_clones_length - ** - ** @param const xcb_randr_get_output_info_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_randr_get_output_info_clones_length (const xcb_randr_get_output_info_reply_t *R /**< */) -{ - return R->num_clones; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_randr_get_output_info_clones_end - ** - ** @param const xcb_randr_get_output_info_reply_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_randr_get_output_info_clones_end (const xcb_randr_get_output_info_reply_t *R /**< */) -{ - xcb_generic_iterator_t i; - xcb_generic_iterator_t child = xcb_randr_get_output_info_modes_end(R); - i.data = ((xcb_randr_output_t *) child.data) + (R->num_clones); - i.rem = 0; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** uint8_t * xcb_randr_get_output_info_name - ** - ** @param const xcb_randr_get_output_info_reply_t *R - ** @returns uint8_t * - ** - *****************************************************************************/ - -uint8_t * -xcb_randr_get_output_info_name (const xcb_randr_get_output_info_reply_t *R /**< */) -{ - xcb_generic_iterator_t prev = xcb_randr_get_output_info_clones_end(R); - return (uint8_t *) ((char *) prev.data + XCB_TYPE_PAD(uint8_t, prev.index) + 0); -} - - -/***************************************************************************** - ** - ** int xcb_randr_get_output_info_name_length - ** - ** @param const xcb_randr_get_output_info_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_randr_get_output_info_name_length (const xcb_randr_get_output_info_reply_t *R /**< */) -{ - return R->name_len; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_randr_get_output_info_name_end - ** - ** @param const xcb_randr_get_output_info_reply_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_randr_get_output_info_name_end (const xcb_randr_get_output_info_reply_t *R /**< */) -{ - xcb_generic_iterator_t i; - xcb_generic_iterator_t child = xcb_randr_get_output_info_clones_end(R); - i.data = ((uint8_t *) child.data) + (R->name_len); - i.rem = 0; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** xcb_randr_get_output_info_reply_t * xcb_randr_get_output_info_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_get_output_info_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_randr_get_output_info_reply_t * - ** - *****************************************************************************/ - -xcb_randr_get_output_info_reply_t * -xcb_randr_get_output_info_reply (xcb_connection_t *c /**< */, - xcb_randr_get_output_info_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_randr_get_output_info_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - -int -xcb_randr_list_output_properties_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_randr_list_output_properties_reply_t *_aux = (xcb_randr_list_output_properties_reply_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_randr_list_output_properties_reply_t); - xcb_tmp += xcb_block_len; - /* atoms */ - xcb_block_len += _aux->num_atoms * sizeof(xcb_atom_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_atom_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_randr_list_output_properties_cookie_t xcb_randr_list_output_properties - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_output_t output - ** @returns xcb_randr_list_output_properties_cookie_t - ** - *****************************************************************************/ - -xcb_randr_list_output_properties_cookie_t -xcb_randr_list_output_properties (xcb_connection_t *c /**< */, - xcb_randr_output_t output /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_LIST_OUTPUT_PROPERTIES, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_randr_list_output_properties_cookie_t xcb_ret; - xcb_randr_list_output_properties_request_t xcb_out; - - xcb_out.output = output; - - 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_randr_list_output_properties_cookie_t xcb_randr_list_output_properties_unchecked - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_output_t output - ** @returns xcb_randr_list_output_properties_cookie_t - ** - *****************************************************************************/ - -xcb_randr_list_output_properties_cookie_t -xcb_randr_list_output_properties_unchecked (xcb_connection_t *c /**< */, - xcb_randr_output_t output /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_LIST_OUTPUT_PROPERTIES, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_randr_list_output_properties_cookie_t xcb_ret; - xcb_randr_list_output_properties_request_t xcb_out; - - xcb_out.output = output; - - 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_atom_t * xcb_randr_list_output_properties_atoms - ** - ** @param const xcb_randr_list_output_properties_reply_t *R - ** @returns xcb_atom_t * - ** - *****************************************************************************/ - -xcb_atom_t * -xcb_randr_list_output_properties_atoms (const xcb_randr_list_output_properties_reply_t *R /**< */) -{ - return (xcb_atom_t *) (R + 1); -} - - -/***************************************************************************** - ** - ** int xcb_randr_list_output_properties_atoms_length - ** - ** @param const xcb_randr_list_output_properties_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_randr_list_output_properties_atoms_length (const xcb_randr_list_output_properties_reply_t *R /**< */) -{ - return R->num_atoms; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_randr_list_output_properties_atoms_end - ** - ** @param const xcb_randr_list_output_properties_reply_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_randr_list_output_properties_atoms_end (const xcb_randr_list_output_properties_reply_t *R /**< */) -{ - xcb_generic_iterator_t i; - i.data = ((xcb_atom_t *) (R + 1)) + (R->num_atoms); - i.rem = 0; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** xcb_randr_list_output_properties_reply_t * xcb_randr_list_output_properties_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_list_output_properties_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_randr_list_output_properties_reply_t * - ** - *****************************************************************************/ - -xcb_randr_list_output_properties_reply_t * -xcb_randr_list_output_properties_reply (xcb_connection_t *c /**< */, - xcb_randr_list_output_properties_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_randr_list_output_properties_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - -int -xcb_randr_query_output_property_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_randr_query_output_property_reply_t *_aux = (xcb_randr_query_output_property_reply_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_randr_query_output_property_reply_t); - xcb_tmp += xcb_block_len; - /* validValues */ - xcb_block_len += _aux->length * sizeof(int32_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(int32_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_randr_query_output_property_cookie_t xcb_randr_query_output_property - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_output_t output - ** @param xcb_atom_t property - ** @returns xcb_randr_query_output_property_cookie_t - ** - *****************************************************************************/ - -xcb_randr_query_output_property_cookie_t -xcb_randr_query_output_property (xcb_connection_t *c /**< */, - xcb_randr_output_t output /**< */, - xcb_atom_t property /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_QUERY_OUTPUT_PROPERTY, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_randr_query_output_property_cookie_t xcb_ret; - xcb_randr_query_output_property_request_t xcb_out; - - xcb_out.output = output; - xcb_out.property = property; - - 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_randr_query_output_property_cookie_t xcb_randr_query_output_property_unchecked - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_output_t output - ** @param xcb_atom_t property - ** @returns xcb_randr_query_output_property_cookie_t - ** - *****************************************************************************/ - -xcb_randr_query_output_property_cookie_t -xcb_randr_query_output_property_unchecked (xcb_connection_t *c /**< */, - xcb_randr_output_t output /**< */, - xcb_atom_t property /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_QUERY_OUTPUT_PROPERTY, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_randr_query_output_property_cookie_t xcb_ret; - xcb_randr_query_output_property_request_t xcb_out; - - xcb_out.output = output; - xcb_out.property = property; - - 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; -} - - -/***************************************************************************** - ** - ** int32_t * xcb_randr_query_output_property_valid_values - ** - ** @param const xcb_randr_query_output_property_reply_t *R - ** @returns int32_t * - ** - *****************************************************************************/ - -int32_t * -xcb_randr_query_output_property_valid_values (const xcb_randr_query_output_property_reply_t *R /**< */) -{ - return (int32_t *) (R + 1); -} - - -/***************************************************************************** - ** - ** int xcb_randr_query_output_property_valid_values_length - ** - ** @param const xcb_randr_query_output_property_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_randr_query_output_property_valid_values_length (const xcb_randr_query_output_property_reply_t *R /**< */) -{ - return R->length; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_randr_query_output_property_valid_values_end - ** - ** @param const xcb_randr_query_output_property_reply_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_randr_query_output_property_valid_values_end (const xcb_randr_query_output_property_reply_t *R /**< */) -{ - xcb_generic_iterator_t i; - i.data = ((int32_t *) (R + 1)) + (R->length); - i.rem = 0; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** xcb_randr_query_output_property_reply_t * xcb_randr_query_output_property_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_query_output_property_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_randr_query_output_property_reply_t * - ** - *****************************************************************************/ - -xcb_randr_query_output_property_reply_t * -xcb_randr_query_output_property_reply (xcb_connection_t *c /**< */, - xcb_randr_query_output_property_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_randr_query_output_property_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - -int -xcb_randr_configure_output_property_sizeof (const void *_buffer /**< */, - uint32_t values_len /**< */) -{ - char *xcb_tmp = (char *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_randr_configure_output_property_request_t); - xcb_tmp += xcb_block_len; - /* values */ - xcb_block_len += values_len * sizeof(int32_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(int32_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_randr_configure_output_property_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_output_t output - ** @param xcb_atom_t property - ** @param uint8_t pending - ** @param uint8_t range - ** @param uint32_t values_len - ** @param const int32_t *values - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_randr_configure_output_property_checked (xcb_connection_t *c /**< */, - xcb_randr_output_t output /**< */, - xcb_atom_t property /**< */, - uint8_t pending /**< */, - uint8_t range /**< */, - uint32_t values_len /**< */, - const int32_t *values /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_CONFIGURE_OUTPUT_PROPERTY, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_randr_configure_output_property_request_t xcb_out; - - xcb_out.output = output; - xcb_out.property = property; - xcb_out.pending = pending; - xcb_out.range = range; - memset(xcb_out.pad0, 0, 2); - - 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; - /* int32_t values */ - xcb_parts[4].iov_base = (char *) values; - xcb_parts[4].iov_len = values_len * sizeof(int32_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].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_randr_configure_output_property - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_output_t output - ** @param xcb_atom_t property - ** @param uint8_t pending - ** @param uint8_t range - ** @param uint32_t values_len - ** @param const int32_t *values - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_randr_configure_output_property (xcb_connection_t *c /**< */, - xcb_randr_output_t output /**< */, - xcb_atom_t property /**< */, - uint8_t pending /**< */, - uint8_t range /**< */, - uint32_t values_len /**< */, - const int32_t *values /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_CONFIGURE_OUTPUT_PROPERTY, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_randr_configure_output_property_request_t xcb_out; - - xcb_out.output = output; - xcb_out.property = property; - xcb_out.pending = pending; - xcb_out.range = range; - memset(xcb_out.pad0, 0, 2); - - 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; - /* int32_t values */ - xcb_parts[4].iov_base = (char *) values; - xcb_parts[4].iov_len = values_len * sizeof(int32_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - - xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); - return xcb_ret; -} - -int -xcb_randr_change_output_property_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_randr_change_output_property_request_t *_aux = (xcb_randr_change_output_property_request_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_randr_change_output_property_request_t); - xcb_tmp += xcb_block_len; - /* data */ - xcb_block_len += ((_aux->num_units * _aux->format) / 8) * sizeof(char); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(char); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_randr_change_output_property_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_output_t output - ** @param xcb_atom_t property - ** @param xcb_atom_t type - ** @param uint8_t format - ** @param uint8_t mode - ** @param uint32_t num_units - ** @param const void *data - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_randr_change_output_property_checked (xcb_connection_t *c /**< */, - xcb_randr_output_t output /**< */, - xcb_atom_t property /**< */, - xcb_atom_t type /**< */, - uint8_t format /**< */, - uint8_t mode /**< */, - uint32_t num_units /**< */, - const void *data /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_CHANGE_OUTPUT_PROPERTY, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_randr_change_output_property_request_t xcb_out; - - xcb_out.output = output; - xcb_out.property = property; - xcb_out.type = type; - xcb_out.format = format; - xcb_out.mode = mode; - memset(xcb_out.pad0, 0, 2); - xcb_out.num_units = num_units; - - 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; - /* void data */ - xcb_parts[4].iov_base = (char *) data; - xcb_parts[4].iov_len = ((num_units * format) / 8) * sizeof(char); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].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_randr_change_output_property - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_output_t output - ** @param xcb_atom_t property - ** @param xcb_atom_t type - ** @param uint8_t format - ** @param uint8_t mode - ** @param uint32_t num_units - ** @param const void *data - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_randr_change_output_property (xcb_connection_t *c /**< */, - xcb_randr_output_t output /**< */, - xcb_atom_t property /**< */, - xcb_atom_t type /**< */, - uint8_t format /**< */, - uint8_t mode /**< */, - uint32_t num_units /**< */, - const void *data /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_CHANGE_OUTPUT_PROPERTY, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_randr_change_output_property_request_t xcb_out; - - xcb_out.output = output; - xcb_out.property = property; - xcb_out.type = type; - xcb_out.format = format; - xcb_out.mode = mode; - memset(xcb_out.pad0, 0, 2); - xcb_out.num_units = num_units; - - 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; - /* void data */ - xcb_parts[4].iov_base = (char *) data; - xcb_parts[4].iov_len = ((num_units * format) / 8) * sizeof(char); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - - xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); - return xcb_ret; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_randr_delete_output_property_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_output_t output - ** @param xcb_atom_t property - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_randr_delete_output_property_checked (xcb_connection_t *c /**< */, - xcb_randr_output_t output /**< */, - xcb_atom_t property /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_DELETE_OUTPUT_PROPERTY, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_randr_delete_output_property_request_t xcb_out; - - xcb_out.output = output; - xcb_out.property = property; - - 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_randr_delete_output_property - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_output_t output - ** @param xcb_atom_t property - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_randr_delete_output_property (xcb_connection_t *c /**< */, - xcb_randr_output_t output /**< */, - xcb_atom_t property /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_DELETE_OUTPUT_PROPERTY, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_randr_delete_output_property_request_t xcb_out; - - xcb_out.output = output; - xcb_out.property = property; - - 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; -} - -int -xcb_randr_get_output_property_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_randr_get_output_property_reply_t *_aux = (xcb_randr_get_output_property_reply_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_randr_get_output_property_reply_t); - xcb_tmp += xcb_block_len; - /* data */ - xcb_block_len += (_aux->num_items * (_aux->format / 8)) * sizeof(uint8_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(uint8_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_randr_get_output_property_cookie_t xcb_randr_get_output_property - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_output_t output - ** @param xcb_atom_t property - ** @param xcb_atom_t type - ** @param uint32_t long_offset - ** @param uint32_t long_length - ** @param uint8_t _delete - ** @param uint8_t pending - ** @returns xcb_randr_get_output_property_cookie_t - ** - *****************************************************************************/ - -xcb_randr_get_output_property_cookie_t -xcb_randr_get_output_property (xcb_connection_t *c /**< */, - xcb_randr_output_t output /**< */, - xcb_atom_t property /**< */, - xcb_atom_t type /**< */, - uint32_t long_offset /**< */, - uint32_t long_length /**< */, - uint8_t _delete /**< */, - uint8_t pending /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_GET_OUTPUT_PROPERTY, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_randr_get_output_property_cookie_t xcb_ret; - xcb_randr_get_output_property_request_t xcb_out; - - xcb_out.output = output; - xcb_out.property = property; - xcb_out.type = type; - xcb_out.long_offset = long_offset; - xcb_out.long_length = long_length; - xcb_out._delete = _delete; - xcb_out.pending = pending; - memset(xcb_out.pad0, 0, 2); - - 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_randr_get_output_property_cookie_t xcb_randr_get_output_property_unchecked - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_output_t output - ** @param xcb_atom_t property - ** @param xcb_atom_t type - ** @param uint32_t long_offset - ** @param uint32_t long_length - ** @param uint8_t _delete - ** @param uint8_t pending - ** @returns xcb_randr_get_output_property_cookie_t - ** - *****************************************************************************/ - -xcb_randr_get_output_property_cookie_t -xcb_randr_get_output_property_unchecked (xcb_connection_t *c /**< */, - xcb_randr_output_t output /**< */, - xcb_atom_t property /**< */, - xcb_atom_t type /**< */, - uint32_t long_offset /**< */, - uint32_t long_length /**< */, - uint8_t _delete /**< */, - uint8_t pending /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_GET_OUTPUT_PROPERTY, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_randr_get_output_property_cookie_t xcb_ret; - xcb_randr_get_output_property_request_t xcb_out; - - xcb_out.output = output; - xcb_out.property = property; - xcb_out.type = type; - xcb_out.long_offset = long_offset; - xcb_out.long_length = long_length; - xcb_out._delete = _delete; - xcb_out.pending = pending; - memset(xcb_out.pad0, 0, 2); - - 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; -} - - -/***************************************************************************** - ** - ** uint8_t * xcb_randr_get_output_property_data - ** - ** @param const xcb_randr_get_output_property_reply_t *R - ** @returns uint8_t * - ** - *****************************************************************************/ - -uint8_t * -xcb_randr_get_output_property_data (const xcb_randr_get_output_property_reply_t *R /**< */) -{ - return (uint8_t *) (R + 1); -} - - -/***************************************************************************** - ** - ** int xcb_randr_get_output_property_data_length - ** - ** @param const xcb_randr_get_output_property_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_randr_get_output_property_data_length (const xcb_randr_get_output_property_reply_t *R /**< */) -{ - return (R->num_items * (R->format / 8)); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_randr_get_output_property_data_end - ** - ** @param const xcb_randr_get_output_property_reply_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_randr_get_output_property_data_end (const xcb_randr_get_output_property_reply_t *R /**< */) -{ - xcb_generic_iterator_t i; - i.data = ((uint8_t *) (R + 1)) + ((R->num_items * (R->format / 8))); - i.rem = 0; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** xcb_randr_get_output_property_reply_t * xcb_randr_get_output_property_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_get_output_property_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_randr_get_output_property_reply_t * - ** - *****************************************************************************/ - -xcb_randr_get_output_property_reply_t * -xcb_randr_get_output_property_reply (xcb_connection_t *c /**< */, - xcb_randr_get_output_property_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_randr_get_output_property_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - -int -xcb_randr_create_mode_sizeof (const void *_buffer /**< */, - uint32_t name_len /**< */) -{ - char *xcb_tmp = (char *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_randr_create_mode_request_t); - xcb_tmp += xcb_block_len; - /* name */ - xcb_block_len += name_len * sizeof(char); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(char); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_randr_create_mode_cookie_t xcb_randr_create_mode - ** - ** @param xcb_connection_t *c - ** @param xcb_window_t window - ** @param xcb_randr_mode_info_t mode_info - ** @param uint32_t name_len - ** @param const char *name - ** @returns xcb_randr_create_mode_cookie_t - ** - *****************************************************************************/ - -xcb_randr_create_mode_cookie_t -xcb_randr_create_mode (xcb_connection_t *c /**< */, - xcb_window_t window /**< */, - xcb_randr_mode_info_t mode_info /**< */, - uint32_t name_len /**< */, - const char *name /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_CREATE_MODE, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[6]; - xcb_randr_create_mode_cookie_t xcb_ret; - xcb_randr_create_mode_request_t xcb_out; - - xcb_out.window = window; - xcb_out.mode_info = mode_info; - - 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; - /* char name */ - xcb_parts[4].iov_base = (char *) name; - xcb_parts[4].iov_len = name_len * sizeof(char); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - - xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); - return xcb_ret; -} - - -/***************************************************************************** - ** - ** xcb_randr_create_mode_cookie_t xcb_randr_create_mode_unchecked - ** - ** @param xcb_connection_t *c - ** @param xcb_window_t window - ** @param xcb_randr_mode_info_t mode_info - ** @param uint32_t name_len - ** @param const char *name - ** @returns xcb_randr_create_mode_cookie_t - ** - *****************************************************************************/ - -xcb_randr_create_mode_cookie_t -xcb_randr_create_mode_unchecked (xcb_connection_t *c /**< */, - xcb_window_t window /**< */, - xcb_randr_mode_info_t mode_info /**< */, - uint32_t name_len /**< */, - const char *name /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_CREATE_MODE, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[6]; - xcb_randr_create_mode_cookie_t xcb_ret; - xcb_randr_create_mode_request_t xcb_out; - - xcb_out.window = window; - xcb_out.mode_info = mode_info; - - 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; - /* char name */ - xcb_parts[4].iov_base = (char *) name; - xcb_parts[4].iov_len = name_len * sizeof(char); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - - xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); - return xcb_ret; -} - - -/***************************************************************************** - ** - ** xcb_randr_create_mode_reply_t * xcb_randr_create_mode_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_create_mode_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_randr_create_mode_reply_t * - ** - *****************************************************************************/ - -xcb_randr_create_mode_reply_t * -xcb_randr_create_mode_reply (xcb_connection_t *c /**< */, - xcb_randr_create_mode_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_randr_create_mode_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_randr_destroy_mode_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_mode_t mode - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_randr_destroy_mode_checked (xcb_connection_t *c /**< */, - xcb_randr_mode_t mode /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_DESTROY_MODE, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_randr_destroy_mode_request_t xcb_out; - - xcb_out.mode = mode; - - 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_randr_destroy_mode - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_mode_t mode - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_randr_destroy_mode (xcb_connection_t *c /**< */, - xcb_randr_mode_t mode /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_DESTROY_MODE, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_randr_destroy_mode_request_t xcb_out; - - xcb_out.mode = mode; - - 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_randr_add_output_mode_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_output_t output - ** @param xcb_randr_mode_t mode - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_randr_add_output_mode_checked (xcb_connection_t *c /**< */, - xcb_randr_output_t output /**< */, - xcb_randr_mode_t mode /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_ADD_OUTPUT_MODE, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_randr_add_output_mode_request_t xcb_out; - - xcb_out.output = output; - xcb_out.mode = mode; - - 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_randr_add_output_mode - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_output_t output - ** @param xcb_randr_mode_t mode - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_randr_add_output_mode (xcb_connection_t *c /**< */, - xcb_randr_output_t output /**< */, - xcb_randr_mode_t mode /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_ADD_OUTPUT_MODE, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_randr_add_output_mode_request_t xcb_out; - - xcb_out.output = output; - xcb_out.mode = mode; - - 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_randr_delete_output_mode_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_output_t output - ** @param xcb_randr_mode_t mode - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_randr_delete_output_mode_checked (xcb_connection_t *c /**< */, - xcb_randr_output_t output /**< */, - xcb_randr_mode_t mode /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_DELETE_OUTPUT_MODE, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_randr_delete_output_mode_request_t xcb_out; - - xcb_out.output = output; - xcb_out.mode = mode; - - 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_randr_delete_output_mode - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_output_t output - ** @param xcb_randr_mode_t mode - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_randr_delete_output_mode (xcb_connection_t *c /**< */, - xcb_randr_output_t output /**< */, - xcb_randr_mode_t mode /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_DELETE_OUTPUT_MODE, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_randr_delete_output_mode_request_t xcb_out; - - xcb_out.output = output; - xcb_out.mode = mode; - - 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; -} - -int -xcb_randr_get_crtc_info_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_randr_get_crtc_info_reply_t *_aux = (xcb_randr_get_crtc_info_reply_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_randr_get_crtc_info_reply_t); - xcb_tmp += xcb_block_len; - /* outputs */ - xcb_block_len += _aux->num_outputs * sizeof(xcb_randr_output_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_randr_output_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* possible */ - xcb_block_len += _aux->num_possible_outputs * sizeof(xcb_randr_output_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_randr_output_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_randr_get_crtc_info_cookie_t xcb_randr_get_crtc_info - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_crtc_t crtc - ** @param xcb_timestamp_t config_timestamp - ** @returns xcb_randr_get_crtc_info_cookie_t - ** - *****************************************************************************/ - -xcb_randr_get_crtc_info_cookie_t -xcb_randr_get_crtc_info (xcb_connection_t *c /**< */, - xcb_randr_crtc_t crtc /**< */, - xcb_timestamp_t config_timestamp /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_GET_CRTC_INFO, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_randr_get_crtc_info_cookie_t xcb_ret; - xcb_randr_get_crtc_info_request_t xcb_out; - - xcb_out.crtc = crtc; - xcb_out.config_timestamp = config_timestamp; - - 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_randr_get_crtc_info_cookie_t xcb_randr_get_crtc_info_unchecked - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_crtc_t crtc - ** @param xcb_timestamp_t config_timestamp - ** @returns xcb_randr_get_crtc_info_cookie_t - ** - *****************************************************************************/ - -xcb_randr_get_crtc_info_cookie_t -xcb_randr_get_crtc_info_unchecked (xcb_connection_t *c /**< */, - xcb_randr_crtc_t crtc /**< */, - xcb_timestamp_t config_timestamp /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_GET_CRTC_INFO, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_randr_get_crtc_info_cookie_t xcb_ret; - xcb_randr_get_crtc_info_request_t xcb_out; - - xcb_out.crtc = crtc; - xcb_out.config_timestamp = config_timestamp; - - 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_randr_output_t * xcb_randr_get_crtc_info_outputs - ** - ** @param const xcb_randr_get_crtc_info_reply_t *R - ** @returns xcb_randr_output_t * - ** - *****************************************************************************/ - -xcb_randr_output_t * -xcb_randr_get_crtc_info_outputs (const xcb_randr_get_crtc_info_reply_t *R /**< */) -{ - return (xcb_randr_output_t *) (R + 1); -} - - -/***************************************************************************** - ** - ** int xcb_randr_get_crtc_info_outputs_length - ** - ** @param const xcb_randr_get_crtc_info_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_randr_get_crtc_info_outputs_length (const xcb_randr_get_crtc_info_reply_t *R /**< */) -{ - return R->num_outputs; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_randr_get_crtc_info_outputs_end - ** - ** @param const xcb_randr_get_crtc_info_reply_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_randr_get_crtc_info_outputs_end (const xcb_randr_get_crtc_info_reply_t *R /**< */) -{ - xcb_generic_iterator_t i; - i.data = ((xcb_randr_output_t *) (R + 1)) + (R->num_outputs); - i.rem = 0; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** xcb_randr_output_t * xcb_randr_get_crtc_info_possible - ** - ** @param const xcb_randr_get_crtc_info_reply_t *R - ** @returns xcb_randr_output_t * - ** - *****************************************************************************/ - -xcb_randr_output_t * -xcb_randr_get_crtc_info_possible (const xcb_randr_get_crtc_info_reply_t *R /**< */) -{ - xcb_generic_iterator_t prev = xcb_randr_get_crtc_info_outputs_end(R); - return (xcb_randr_output_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_randr_output_t, prev.index) + 0); -} - - -/***************************************************************************** - ** - ** int xcb_randr_get_crtc_info_possible_length - ** - ** @param const xcb_randr_get_crtc_info_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_randr_get_crtc_info_possible_length (const xcb_randr_get_crtc_info_reply_t *R /**< */) -{ - return R->num_possible_outputs; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_randr_get_crtc_info_possible_end - ** - ** @param const xcb_randr_get_crtc_info_reply_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_randr_get_crtc_info_possible_end (const xcb_randr_get_crtc_info_reply_t *R /**< */) -{ - xcb_generic_iterator_t i; - xcb_generic_iterator_t child = xcb_randr_get_crtc_info_outputs_end(R); - i.data = ((xcb_randr_output_t *) child.data) + (R->num_possible_outputs); - i.rem = 0; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** xcb_randr_get_crtc_info_reply_t * xcb_randr_get_crtc_info_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_get_crtc_info_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_randr_get_crtc_info_reply_t * - ** - *****************************************************************************/ - -xcb_randr_get_crtc_info_reply_t * -xcb_randr_get_crtc_info_reply (xcb_connection_t *c /**< */, - xcb_randr_get_crtc_info_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_randr_get_crtc_info_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - -int -xcb_randr_set_crtc_config_sizeof (const void *_buffer /**< */, - uint32_t outputs_len /**< */) -{ - char *xcb_tmp = (char *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_randr_set_crtc_config_request_t); - xcb_tmp += xcb_block_len; - /* outputs */ - xcb_block_len += outputs_len * sizeof(xcb_randr_output_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_randr_output_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_randr_set_crtc_config_cookie_t xcb_randr_set_crtc_config - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_crtc_t crtc - ** @param xcb_timestamp_t timestamp - ** @param xcb_timestamp_t config_timestamp - ** @param int16_t x - ** @param int16_t y - ** @param xcb_randr_mode_t mode - ** @param uint16_t rotation - ** @param uint32_t outputs_len - ** @param const xcb_randr_output_t *outputs - ** @returns xcb_randr_set_crtc_config_cookie_t - ** - *****************************************************************************/ - -xcb_randr_set_crtc_config_cookie_t -xcb_randr_set_crtc_config (xcb_connection_t *c /**< */, - xcb_randr_crtc_t crtc /**< */, - xcb_timestamp_t timestamp /**< */, - xcb_timestamp_t config_timestamp /**< */, - int16_t x /**< */, - int16_t y /**< */, - xcb_randr_mode_t mode /**< */, - uint16_t rotation /**< */, - uint32_t outputs_len /**< */, - const xcb_randr_output_t *outputs /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_SET_CRTC_CONFIG, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[6]; - xcb_randr_set_crtc_config_cookie_t xcb_ret; - xcb_randr_set_crtc_config_request_t xcb_out; - - xcb_out.crtc = crtc; - xcb_out.timestamp = timestamp; - xcb_out.config_timestamp = config_timestamp; - xcb_out.x = x; - xcb_out.y = y; - xcb_out.mode = mode; - xcb_out.rotation = rotation; - memset(xcb_out.pad0, 0, 2); - - 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_randr_output_t outputs */ - xcb_parts[4].iov_base = (char *) outputs; - xcb_parts[4].iov_len = outputs_len * sizeof(xcb_timestamp_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - - xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); - return xcb_ret; -} - - -/***************************************************************************** - ** - ** xcb_randr_set_crtc_config_cookie_t xcb_randr_set_crtc_config_unchecked - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_crtc_t crtc - ** @param xcb_timestamp_t timestamp - ** @param xcb_timestamp_t config_timestamp - ** @param int16_t x - ** @param int16_t y - ** @param xcb_randr_mode_t mode - ** @param uint16_t rotation - ** @param uint32_t outputs_len - ** @param const xcb_randr_output_t *outputs - ** @returns xcb_randr_set_crtc_config_cookie_t - ** - *****************************************************************************/ - -xcb_randr_set_crtc_config_cookie_t -xcb_randr_set_crtc_config_unchecked (xcb_connection_t *c /**< */, - xcb_randr_crtc_t crtc /**< */, - xcb_timestamp_t timestamp /**< */, - xcb_timestamp_t config_timestamp /**< */, - int16_t x /**< */, - int16_t y /**< */, - xcb_randr_mode_t mode /**< */, - uint16_t rotation /**< */, - uint32_t outputs_len /**< */, - const xcb_randr_output_t *outputs /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_SET_CRTC_CONFIG, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[6]; - xcb_randr_set_crtc_config_cookie_t xcb_ret; - xcb_randr_set_crtc_config_request_t xcb_out; - - xcb_out.crtc = crtc; - xcb_out.timestamp = timestamp; - xcb_out.config_timestamp = config_timestamp; - xcb_out.x = x; - xcb_out.y = y; - xcb_out.mode = mode; - xcb_out.rotation = rotation; - memset(xcb_out.pad0, 0, 2); - - 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_randr_output_t outputs */ - xcb_parts[4].iov_base = (char *) outputs; - xcb_parts[4].iov_len = outputs_len * sizeof(xcb_timestamp_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - - xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); - return xcb_ret; -} - - -/***************************************************************************** - ** - ** xcb_randr_set_crtc_config_reply_t * xcb_randr_set_crtc_config_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_set_crtc_config_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_randr_set_crtc_config_reply_t * - ** - *****************************************************************************/ - -xcb_randr_set_crtc_config_reply_t * -xcb_randr_set_crtc_config_reply (xcb_connection_t *c /**< */, - xcb_randr_set_crtc_config_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_randr_set_crtc_config_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - - -/***************************************************************************** - ** - ** xcb_randr_get_crtc_gamma_size_cookie_t xcb_randr_get_crtc_gamma_size - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_crtc_t crtc - ** @returns xcb_randr_get_crtc_gamma_size_cookie_t - ** - *****************************************************************************/ - -xcb_randr_get_crtc_gamma_size_cookie_t -xcb_randr_get_crtc_gamma_size (xcb_connection_t *c /**< */, - xcb_randr_crtc_t crtc /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_GET_CRTC_GAMMA_SIZE, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_randr_get_crtc_gamma_size_cookie_t xcb_ret; - xcb_randr_get_crtc_gamma_size_request_t xcb_out; - - xcb_out.crtc = crtc; - - 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_randr_get_crtc_gamma_size_cookie_t xcb_randr_get_crtc_gamma_size_unchecked - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_crtc_t crtc - ** @returns xcb_randr_get_crtc_gamma_size_cookie_t - ** - *****************************************************************************/ - -xcb_randr_get_crtc_gamma_size_cookie_t -xcb_randr_get_crtc_gamma_size_unchecked (xcb_connection_t *c /**< */, - xcb_randr_crtc_t crtc /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_GET_CRTC_GAMMA_SIZE, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_randr_get_crtc_gamma_size_cookie_t xcb_ret; - xcb_randr_get_crtc_gamma_size_request_t xcb_out; - - xcb_out.crtc = crtc; - - 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_randr_get_crtc_gamma_size_reply_t * xcb_randr_get_crtc_gamma_size_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_get_crtc_gamma_size_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_randr_get_crtc_gamma_size_reply_t * - ** - *****************************************************************************/ - -xcb_randr_get_crtc_gamma_size_reply_t * -xcb_randr_get_crtc_gamma_size_reply (xcb_connection_t *c /**< */, - xcb_randr_get_crtc_gamma_size_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_randr_get_crtc_gamma_size_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - -int -xcb_randr_get_crtc_gamma_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_randr_get_crtc_gamma_reply_t *_aux = (xcb_randr_get_crtc_gamma_reply_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_randr_get_crtc_gamma_reply_t); - xcb_tmp += xcb_block_len; - /* red */ - xcb_block_len += _aux->size * sizeof(uint16_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(uint16_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* green */ - xcb_block_len += _aux->size * sizeof(uint16_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(uint16_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* blue */ - xcb_block_len += _aux->size * sizeof(uint16_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(uint16_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_randr_get_crtc_gamma_cookie_t xcb_randr_get_crtc_gamma - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_crtc_t crtc - ** @returns xcb_randr_get_crtc_gamma_cookie_t - ** - *****************************************************************************/ - -xcb_randr_get_crtc_gamma_cookie_t -xcb_randr_get_crtc_gamma (xcb_connection_t *c /**< */, - xcb_randr_crtc_t crtc /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_GET_CRTC_GAMMA, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_randr_get_crtc_gamma_cookie_t xcb_ret; - xcb_randr_get_crtc_gamma_request_t xcb_out; - - xcb_out.crtc = crtc; - - 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_randr_get_crtc_gamma_cookie_t xcb_randr_get_crtc_gamma_unchecked - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_crtc_t crtc - ** @returns xcb_randr_get_crtc_gamma_cookie_t - ** - *****************************************************************************/ - -xcb_randr_get_crtc_gamma_cookie_t -xcb_randr_get_crtc_gamma_unchecked (xcb_connection_t *c /**< */, - xcb_randr_crtc_t crtc /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_GET_CRTC_GAMMA, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_randr_get_crtc_gamma_cookie_t xcb_ret; - xcb_randr_get_crtc_gamma_request_t xcb_out; - - xcb_out.crtc = crtc; - - 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; -} - - -/***************************************************************************** - ** - ** uint16_t * xcb_randr_get_crtc_gamma_red - ** - ** @param const xcb_randr_get_crtc_gamma_reply_t *R - ** @returns uint16_t * - ** - *****************************************************************************/ - -uint16_t * -xcb_randr_get_crtc_gamma_red (const xcb_randr_get_crtc_gamma_reply_t *R /**< */) -{ - return (uint16_t *) (R + 1); -} - - -/***************************************************************************** - ** - ** int xcb_randr_get_crtc_gamma_red_length - ** - ** @param const xcb_randr_get_crtc_gamma_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_randr_get_crtc_gamma_red_length (const xcb_randr_get_crtc_gamma_reply_t *R /**< */) -{ - return R->size; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_randr_get_crtc_gamma_red_end - ** - ** @param const xcb_randr_get_crtc_gamma_reply_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_randr_get_crtc_gamma_red_end (const xcb_randr_get_crtc_gamma_reply_t *R /**< */) -{ - xcb_generic_iterator_t i; - i.data = ((uint16_t *) (R + 1)) + (R->size); - i.rem = 0; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** uint16_t * xcb_randr_get_crtc_gamma_green - ** - ** @param const xcb_randr_get_crtc_gamma_reply_t *R - ** @returns uint16_t * - ** - *****************************************************************************/ - -uint16_t * -xcb_randr_get_crtc_gamma_green (const xcb_randr_get_crtc_gamma_reply_t *R /**< */) -{ - xcb_generic_iterator_t prev = xcb_randr_get_crtc_gamma_red_end(R); - return (uint16_t *) ((char *) prev.data + XCB_TYPE_PAD(uint16_t, prev.index) + 0); -} - - -/***************************************************************************** - ** - ** int xcb_randr_get_crtc_gamma_green_length - ** - ** @param const xcb_randr_get_crtc_gamma_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_randr_get_crtc_gamma_green_length (const xcb_randr_get_crtc_gamma_reply_t *R /**< */) -{ - return R->size; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_randr_get_crtc_gamma_green_end - ** - ** @param const xcb_randr_get_crtc_gamma_reply_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_randr_get_crtc_gamma_green_end (const xcb_randr_get_crtc_gamma_reply_t *R /**< */) -{ - xcb_generic_iterator_t i; - xcb_generic_iterator_t child = xcb_randr_get_crtc_gamma_red_end(R); - i.data = ((uint16_t *) child.data) + (R->size); - i.rem = 0; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** uint16_t * xcb_randr_get_crtc_gamma_blue - ** - ** @param const xcb_randr_get_crtc_gamma_reply_t *R - ** @returns uint16_t * - ** - *****************************************************************************/ - -uint16_t * -xcb_randr_get_crtc_gamma_blue (const xcb_randr_get_crtc_gamma_reply_t *R /**< */) -{ - xcb_generic_iterator_t prev = xcb_randr_get_crtc_gamma_green_end(R); - return (uint16_t *) ((char *) prev.data + XCB_TYPE_PAD(uint16_t, prev.index) + 0); -} - - -/***************************************************************************** - ** - ** int xcb_randr_get_crtc_gamma_blue_length - ** - ** @param const xcb_randr_get_crtc_gamma_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_randr_get_crtc_gamma_blue_length (const xcb_randr_get_crtc_gamma_reply_t *R /**< */) -{ - return R->size; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_randr_get_crtc_gamma_blue_end - ** - ** @param const xcb_randr_get_crtc_gamma_reply_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_randr_get_crtc_gamma_blue_end (const xcb_randr_get_crtc_gamma_reply_t *R /**< */) -{ - xcb_generic_iterator_t i; - xcb_generic_iterator_t child = xcb_randr_get_crtc_gamma_green_end(R); - i.data = ((uint16_t *) child.data) + (R->size); - i.rem = 0; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** xcb_randr_get_crtc_gamma_reply_t * xcb_randr_get_crtc_gamma_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_get_crtc_gamma_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_randr_get_crtc_gamma_reply_t * - ** - *****************************************************************************/ - -xcb_randr_get_crtc_gamma_reply_t * -xcb_randr_get_crtc_gamma_reply (xcb_connection_t *c /**< */, - xcb_randr_get_crtc_gamma_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_randr_get_crtc_gamma_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - -int -xcb_randr_set_crtc_gamma_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_randr_set_crtc_gamma_request_t *_aux = (xcb_randr_set_crtc_gamma_request_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_randr_set_crtc_gamma_request_t); - xcb_tmp += xcb_block_len; - /* red */ - xcb_block_len += _aux->size * sizeof(uint16_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(uint16_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* green */ - xcb_block_len += _aux->size * sizeof(uint16_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(uint16_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* blue */ - xcb_block_len += _aux->size * sizeof(uint16_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(uint16_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_randr_set_crtc_gamma_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_crtc_t crtc - ** @param uint16_t size - ** @param const uint16_t *red - ** @param const uint16_t *green - ** @param const uint16_t *blue - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_randr_set_crtc_gamma_checked (xcb_connection_t *c /**< */, - xcb_randr_crtc_t crtc /**< */, - uint16_t size /**< */, - const uint16_t *red /**< */, - const uint16_t *green /**< */, - const uint16_t *blue /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 8, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_SET_CRTC_GAMMA, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[10]; - xcb_void_cookie_t xcb_ret; - xcb_randr_set_crtc_gamma_request_t xcb_out; - - xcb_out.crtc = crtc; - xcb_out.size = size; - memset(xcb_out.pad0, 0, 2); - - 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; - /* uint16_t red */ - xcb_parts[4].iov_base = (char *) red; - xcb_parts[4].iov_len = size * sizeof(uint16_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - /* uint16_t green */ - xcb_parts[6].iov_base = (char *) green; - xcb_parts[6].iov_len = size * sizeof(uint16_t); - xcb_parts[7].iov_base = 0; - xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3; - /* uint16_t blue */ - xcb_parts[8].iov_base = (char *) blue; - xcb_parts[8].iov_len = size * sizeof(uint16_t); - xcb_parts[9].iov_base = 0; - xcb_parts[9].iov_len = -xcb_parts[8].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_randr_set_crtc_gamma - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_crtc_t crtc - ** @param uint16_t size - ** @param const uint16_t *red - ** @param const uint16_t *green - ** @param const uint16_t *blue - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_randr_set_crtc_gamma (xcb_connection_t *c /**< */, - xcb_randr_crtc_t crtc /**< */, - uint16_t size /**< */, - const uint16_t *red /**< */, - const uint16_t *green /**< */, - const uint16_t *blue /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 8, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_SET_CRTC_GAMMA, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[10]; - xcb_void_cookie_t xcb_ret; - xcb_randr_set_crtc_gamma_request_t xcb_out; - - xcb_out.crtc = crtc; - xcb_out.size = size; - memset(xcb_out.pad0, 0, 2); - - 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; - /* uint16_t red */ - xcb_parts[4].iov_base = (char *) red; - xcb_parts[4].iov_len = size * sizeof(uint16_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - /* uint16_t green */ - xcb_parts[6].iov_base = (char *) green; - xcb_parts[6].iov_len = size * sizeof(uint16_t); - xcb_parts[7].iov_base = 0; - xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3; - /* uint16_t blue */ - xcb_parts[8].iov_base = (char *) blue; - xcb_parts[8].iov_len = size * sizeof(uint16_t); - xcb_parts[9].iov_base = 0; - xcb_parts[9].iov_len = -xcb_parts[8].iov_len & 3; - - xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); - return xcb_ret; -} - -int -xcb_randr_get_screen_resources_current_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_randr_get_screen_resources_current_reply_t *_aux = (xcb_randr_get_screen_resources_current_reply_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_randr_get_screen_resources_current_reply_t); - xcb_tmp += xcb_block_len; - /* crtcs */ - xcb_block_len += _aux->num_crtcs * sizeof(uint32_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_randr_crtc_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* outputs */ - xcb_block_len += _aux->num_outputs * sizeof(uint32_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_randr_output_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* modes */ - xcb_block_len += _aux->num_modes * sizeof(xcb_randr_mode_info_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_randr_mode_info_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* names */ - xcb_block_len += _aux->names_len * sizeof(uint8_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(uint8_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_randr_get_screen_resources_current_cookie_t xcb_randr_get_screen_resources_current - ** - ** @param xcb_connection_t *c - ** @param xcb_window_t window - ** @returns xcb_randr_get_screen_resources_current_cookie_t - ** - *****************************************************************************/ - -xcb_randr_get_screen_resources_current_cookie_t -xcb_randr_get_screen_resources_current (xcb_connection_t *c /**< */, - xcb_window_t window /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_GET_SCREEN_RESOURCES_CURRENT, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_randr_get_screen_resources_current_cookie_t xcb_ret; - xcb_randr_get_screen_resources_current_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_randr_get_screen_resources_current_cookie_t xcb_randr_get_screen_resources_current_unchecked - ** - ** @param xcb_connection_t *c - ** @param xcb_window_t window - ** @returns xcb_randr_get_screen_resources_current_cookie_t - ** - *****************************************************************************/ - -xcb_randr_get_screen_resources_current_cookie_t -xcb_randr_get_screen_resources_current_unchecked (xcb_connection_t *c /**< */, - xcb_window_t window /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_GET_SCREEN_RESOURCES_CURRENT, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_randr_get_screen_resources_current_cookie_t xcb_ret; - xcb_randr_get_screen_resources_current_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_randr_crtc_t * xcb_randr_get_screen_resources_current_crtcs - ** - ** @param const xcb_randr_get_screen_resources_current_reply_t *R - ** @returns xcb_randr_crtc_t * - ** - *****************************************************************************/ - -xcb_randr_crtc_t * -xcb_randr_get_screen_resources_current_crtcs (const xcb_randr_get_screen_resources_current_reply_t *R /**< */) -{ - return (xcb_randr_crtc_t *) (R + 1); -} - - -/***************************************************************************** - ** - ** int xcb_randr_get_screen_resources_current_crtcs_length - ** - ** @param const xcb_randr_get_screen_resources_current_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_randr_get_screen_resources_current_crtcs_length (const xcb_randr_get_screen_resources_current_reply_t *R /**< */) -{ - return R->num_crtcs; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_randr_get_screen_resources_current_crtcs_end - ** - ** @param const xcb_randr_get_screen_resources_current_reply_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_randr_get_screen_resources_current_crtcs_end (const xcb_randr_get_screen_resources_current_reply_t *R /**< */) -{ - xcb_generic_iterator_t i; - i.data = ((xcb_randr_crtc_t *) (R + 1)) + (R->num_crtcs); - i.rem = 0; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** xcb_randr_output_t * xcb_randr_get_screen_resources_current_outputs - ** - ** @param const xcb_randr_get_screen_resources_current_reply_t *R - ** @returns xcb_randr_output_t * - ** - *****************************************************************************/ - -xcb_randr_output_t * -xcb_randr_get_screen_resources_current_outputs (const xcb_randr_get_screen_resources_current_reply_t *R /**< */) -{ - xcb_generic_iterator_t prev = xcb_randr_get_screen_resources_current_crtcs_end(R); - return (xcb_randr_output_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_randr_output_t, prev.index) + 0); -} - - -/***************************************************************************** - ** - ** int xcb_randr_get_screen_resources_current_outputs_length - ** - ** @param const xcb_randr_get_screen_resources_current_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_randr_get_screen_resources_current_outputs_length (const xcb_randr_get_screen_resources_current_reply_t *R /**< */) -{ - return R->num_outputs; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_randr_get_screen_resources_current_outputs_end - ** - ** @param const xcb_randr_get_screen_resources_current_reply_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_randr_get_screen_resources_current_outputs_end (const xcb_randr_get_screen_resources_current_reply_t *R /**< */) -{ - xcb_generic_iterator_t i; - xcb_generic_iterator_t child = xcb_randr_get_screen_resources_current_crtcs_end(R); - i.data = ((xcb_randr_output_t *) child.data) + (R->num_outputs); - i.rem = 0; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** xcb_randr_mode_info_t * xcb_randr_get_screen_resources_current_modes - ** - ** @param const xcb_randr_get_screen_resources_current_reply_t *R - ** @returns xcb_randr_mode_info_t * - ** - *****************************************************************************/ - -xcb_randr_mode_info_t * -xcb_randr_get_screen_resources_current_modes (const xcb_randr_get_screen_resources_current_reply_t *R /**< */) -{ - xcb_generic_iterator_t prev = xcb_randr_get_screen_resources_current_outputs_end(R); - return (xcb_randr_mode_info_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_randr_mode_info_t, prev.index) + 0); -} - - -/***************************************************************************** - ** - ** int xcb_randr_get_screen_resources_current_modes_length - ** - ** @param const xcb_randr_get_screen_resources_current_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_randr_get_screen_resources_current_modes_length (const xcb_randr_get_screen_resources_current_reply_t *R /**< */) -{ - return R->num_modes; -} - - -/***************************************************************************** - ** - ** xcb_randr_mode_info_iterator_t xcb_randr_get_screen_resources_current_modes_iterator - ** - ** @param const xcb_randr_get_screen_resources_current_reply_t *R - ** @returns xcb_randr_mode_info_iterator_t - ** - *****************************************************************************/ - -xcb_randr_mode_info_iterator_t -xcb_randr_get_screen_resources_current_modes_iterator (const xcb_randr_get_screen_resources_current_reply_t *R /**< */) -{ - xcb_randr_mode_info_iterator_t i; - xcb_generic_iterator_t prev = xcb_randr_get_screen_resources_current_outputs_end(R); - i.data = (xcb_randr_mode_info_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_randr_mode_info_t, prev.index)); - i.rem = R->num_modes; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** uint8_t * xcb_randr_get_screen_resources_current_names - ** - ** @param const xcb_randr_get_screen_resources_current_reply_t *R - ** @returns uint8_t * - ** - *****************************************************************************/ - -uint8_t * -xcb_randr_get_screen_resources_current_names (const xcb_randr_get_screen_resources_current_reply_t *R /**< */) -{ - xcb_generic_iterator_t prev = xcb_randr_mode_info_end(xcb_randr_get_screen_resources_current_modes_iterator(R)); - return (uint8_t *) ((char *) prev.data + XCB_TYPE_PAD(uint8_t, prev.index) + 0); -} - - -/***************************************************************************** - ** - ** int xcb_randr_get_screen_resources_current_names_length - ** - ** @param const xcb_randr_get_screen_resources_current_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_randr_get_screen_resources_current_names_length (const xcb_randr_get_screen_resources_current_reply_t *R /**< */) -{ - return R->names_len; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_randr_get_screen_resources_current_names_end - ** - ** @param const xcb_randr_get_screen_resources_current_reply_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_randr_get_screen_resources_current_names_end (const xcb_randr_get_screen_resources_current_reply_t *R /**< */) -{ - xcb_generic_iterator_t i; - xcb_generic_iterator_t child = xcb_randr_mode_info_end(xcb_randr_get_screen_resources_current_modes_iterator(R)); - i.data = ((uint8_t *) child.data) + (R->names_len); - i.rem = 0; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** xcb_randr_get_screen_resources_current_reply_t * xcb_randr_get_screen_resources_current_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_get_screen_resources_current_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_randr_get_screen_resources_current_reply_t * - ** - *****************************************************************************/ - -xcb_randr_get_screen_resources_current_reply_t * -xcb_randr_get_screen_resources_current_reply (xcb_connection_t *c /**< */, - xcb_randr_get_screen_resources_current_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_randr_get_screen_resources_current_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - -int -xcb_randr_set_crtc_transform_sizeof (const void *_buffer /**< */, - uint32_t filter_params_len /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_randr_set_crtc_transform_request_t *_aux = (xcb_randr_set_crtc_transform_request_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_randr_set_crtc_transform_request_t); - xcb_tmp += xcb_block_len; - /* filter_name */ - xcb_block_len += _aux->filter_len * sizeof(char); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(char); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* filter_params */ - xcb_block_len += filter_params_len * sizeof(xcb_render_fixed_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_render_fixed_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_randr_set_crtc_transform_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_crtc_t crtc - ** @param xcb_render_transform_t transform - ** @param uint16_t filter_len - ** @param const char *filter_name - ** @param uint32_t filter_params_len - ** @param const xcb_render_fixed_t *filter_params - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_randr_set_crtc_transform_checked (xcb_connection_t *c /**< */, - xcb_randr_crtc_t crtc /**< */, - xcb_render_transform_t transform /**< */, - uint16_t filter_len /**< */, - const char *filter_name /**< */, - uint32_t filter_params_len /**< */, - const xcb_render_fixed_t *filter_params /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 6, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_SET_CRTC_TRANSFORM, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[8]; - xcb_void_cookie_t xcb_ret; - xcb_randr_set_crtc_transform_request_t xcb_out; - - xcb_out.crtc = crtc; - xcb_out.transform = transform; - xcb_out.filter_len = filter_len; - memset(xcb_out.pad0, 0, 2); - - 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; - /* char filter_name */ - xcb_parts[4].iov_base = (char *) filter_name; - xcb_parts[4].iov_len = filter_len * sizeof(char); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - /* xcb_render_fixed_t filter_params */ - xcb_parts[6].iov_base = (char *) filter_params; - xcb_parts[6].iov_len = filter_params_len * sizeof(xcb_render_fixed_t); - xcb_parts[7].iov_base = 0; - xcb_parts[7].iov_len = -xcb_parts[6].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_randr_set_crtc_transform - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_crtc_t crtc - ** @param xcb_render_transform_t transform - ** @param uint16_t filter_len - ** @param const char *filter_name - ** @param uint32_t filter_params_len - ** @param const xcb_render_fixed_t *filter_params - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_randr_set_crtc_transform (xcb_connection_t *c /**< */, - xcb_randr_crtc_t crtc /**< */, - xcb_render_transform_t transform /**< */, - uint16_t filter_len /**< */, - const char *filter_name /**< */, - uint32_t filter_params_len /**< */, - const xcb_render_fixed_t *filter_params /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 6, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_SET_CRTC_TRANSFORM, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[8]; - xcb_void_cookie_t xcb_ret; - xcb_randr_set_crtc_transform_request_t xcb_out; - - xcb_out.crtc = crtc; - xcb_out.transform = transform; - xcb_out.filter_len = filter_len; - memset(xcb_out.pad0, 0, 2); - - 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; - /* char filter_name */ - xcb_parts[4].iov_base = (char *) filter_name; - xcb_parts[4].iov_len = filter_len * sizeof(char); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - /* xcb_render_fixed_t filter_params */ - xcb_parts[6].iov_base = (char *) filter_params; - xcb_parts[6].iov_len = filter_params_len * sizeof(xcb_render_fixed_t); - xcb_parts[7].iov_base = 0; - xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3; - - xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); - return xcb_ret; -} - -int -xcb_randr_get_crtc_transform_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_randr_get_crtc_transform_reply_t *_aux = (xcb_randr_get_crtc_transform_reply_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_randr_get_crtc_transform_reply_t); - xcb_tmp += xcb_block_len; - /* pending_filter_name */ - xcb_block_len += _aux->pending_len * sizeof(char); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(char); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* pending_params */ - xcb_block_len += _aux->pending_nparams * sizeof(xcb_render_fixed_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_render_fixed_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* current_filter_name */ - xcb_block_len += _aux->current_len * sizeof(char); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(char); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* current_params */ - xcb_block_len += _aux->current_nparams * sizeof(xcb_render_fixed_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_render_fixed_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_randr_get_crtc_transform_cookie_t xcb_randr_get_crtc_transform - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_crtc_t crtc - ** @returns xcb_randr_get_crtc_transform_cookie_t - ** - *****************************************************************************/ - -xcb_randr_get_crtc_transform_cookie_t -xcb_randr_get_crtc_transform (xcb_connection_t *c /**< */, - xcb_randr_crtc_t crtc /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_GET_CRTC_TRANSFORM, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_randr_get_crtc_transform_cookie_t xcb_ret; - xcb_randr_get_crtc_transform_request_t xcb_out; - - xcb_out.crtc = crtc; - - 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_randr_get_crtc_transform_cookie_t xcb_randr_get_crtc_transform_unchecked - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_crtc_t crtc - ** @returns xcb_randr_get_crtc_transform_cookie_t - ** - *****************************************************************************/ - -xcb_randr_get_crtc_transform_cookie_t -xcb_randr_get_crtc_transform_unchecked (xcb_connection_t *c /**< */, - xcb_randr_crtc_t crtc /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_GET_CRTC_TRANSFORM, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_randr_get_crtc_transform_cookie_t xcb_ret; - xcb_randr_get_crtc_transform_request_t xcb_out; - - xcb_out.crtc = crtc; - - 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; -} - - -/***************************************************************************** - ** - ** char * xcb_randr_get_crtc_transform_pending_filter_name - ** - ** @param const xcb_randr_get_crtc_transform_reply_t *R - ** @returns char * - ** - *****************************************************************************/ - -char * -xcb_randr_get_crtc_transform_pending_filter_name (const xcb_randr_get_crtc_transform_reply_t *R /**< */) -{ - return (char *) (R + 1); -} - - -/***************************************************************************** - ** - ** int xcb_randr_get_crtc_transform_pending_filter_name_length - ** - ** @param const xcb_randr_get_crtc_transform_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_randr_get_crtc_transform_pending_filter_name_length (const xcb_randr_get_crtc_transform_reply_t *R /**< */) -{ - return R->pending_len; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_randr_get_crtc_transform_pending_filter_name_end - ** - ** @param const xcb_randr_get_crtc_transform_reply_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_randr_get_crtc_transform_pending_filter_name_end (const xcb_randr_get_crtc_transform_reply_t *R /**< */) -{ - xcb_generic_iterator_t i; - i.data = ((char *) (R + 1)) + (R->pending_len); - i.rem = 0; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** xcb_render_fixed_t * xcb_randr_get_crtc_transform_pending_params - ** - ** @param const xcb_randr_get_crtc_transform_reply_t *R - ** @returns xcb_render_fixed_t * - ** - *****************************************************************************/ - -xcb_render_fixed_t * -xcb_randr_get_crtc_transform_pending_params (const xcb_randr_get_crtc_transform_reply_t *R /**< */) -{ - xcb_generic_iterator_t prev = xcb_randr_get_crtc_transform_pending_filter_name_end(R); - return (xcb_render_fixed_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_render_fixed_t, prev.index) + 0); -} - - -/***************************************************************************** - ** - ** int xcb_randr_get_crtc_transform_pending_params_length - ** - ** @param const xcb_randr_get_crtc_transform_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_randr_get_crtc_transform_pending_params_length (const xcb_randr_get_crtc_transform_reply_t *R /**< */) -{ - return R->pending_nparams; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_randr_get_crtc_transform_pending_params_end - ** - ** @param const xcb_randr_get_crtc_transform_reply_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_randr_get_crtc_transform_pending_params_end (const xcb_randr_get_crtc_transform_reply_t *R /**< */) -{ - xcb_generic_iterator_t i; - xcb_generic_iterator_t child = xcb_randr_get_crtc_transform_pending_filter_name_end(R); - i.data = ((xcb_render_fixed_t *) child.data) + (R->pending_nparams); - i.rem = 0; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** char * xcb_randr_get_crtc_transform_current_filter_name - ** - ** @param const xcb_randr_get_crtc_transform_reply_t *R - ** @returns char * - ** - *****************************************************************************/ - -char * -xcb_randr_get_crtc_transform_current_filter_name (const xcb_randr_get_crtc_transform_reply_t *R /**< */) -{ - xcb_generic_iterator_t prev = xcb_randr_get_crtc_transform_pending_params_end(R); - return (char *) ((char *) prev.data + XCB_TYPE_PAD(char, prev.index) + 0); -} - - -/***************************************************************************** - ** - ** int xcb_randr_get_crtc_transform_current_filter_name_length - ** - ** @param const xcb_randr_get_crtc_transform_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_randr_get_crtc_transform_current_filter_name_length (const xcb_randr_get_crtc_transform_reply_t *R /**< */) -{ - return R->current_len; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_randr_get_crtc_transform_current_filter_name_end - ** - ** @param const xcb_randr_get_crtc_transform_reply_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_randr_get_crtc_transform_current_filter_name_end (const xcb_randr_get_crtc_transform_reply_t *R /**< */) -{ - xcb_generic_iterator_t i; - xcb_generic_iterator_t child = xcb_randr_get_crtc_transform_pending_params_end(R); - i.data = ((char *) child.data) + (R->current_len); - i.rem = 0; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** xcb_render_fixed_t * xcb_randr_get_crtc_transform_current_params - ** - ** @param const xcb_randr_get_crtc_transform_reply_t *R - ** @returns xcb_render_fixed_t * - ** - *****************************************************************************/ - -xcb_render_fixed_t * -xcb_randr_get_crtc_transform_current_params (const xcb_randr_get_crtc_transform_reply_t *R /**< */) -{ - xcb_generic_iterator_t prev = xcb_randr_get_crtc_transform_current_filter_name_end(R); - return (xcb_render_fixed_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_render_fixed_t, prev.index) + 0); -} - - -/***************************************************************************** - ** - ** int xcb_randr_get_crtc_transform_current_params_length - ** - ** @param const xcb_randr_get_crtc_transform_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_randr_get_crtc_transform_current_params_length (const xcb_randr_get_crtc_transform_reply_t *R /**< */) -{ - return R->current_nparams; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_randr_get_crtc_transform_current_params_end - ** - ** @param const xcb_randr_get_crtc_transform_reply_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_randr_get_crtc_transform_current_params_end (const xcb_randr_get_crtc_transform_reply_t *R /**< */) -{ - xcb_generic_iterator_t i; - xcb_generic_iterator_t child = xcb_randr_get_crtc_transform_current_filter_name_end(R); - i.data = ((xcb_render_fixed_t *) child.data) + (R->current_nparams); - i.rem = 0; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** xcb_randr_get_crtc_transform_reply_t * xcb_randr_get_crtc_transform_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_get_crtc_transform_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_randr_get_crtc_transform_reply_t * - ** - *****************************************************************************/ - -xcb_randr_get_crtc_transform_reply_t * -xcb_randr_get_crtc_transform_reply (xcb_connection_t *c /**< */, - xcb_randr_get_crtc_transform_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_randr_get_crtc_transform_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - - -/***************************************************************************** - ** - ** xcb_randr_get_panning_cookie_t xcb_randr_get_panning - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_crtc_t crtc - ** @returns xcb_randr_get_panning_cookie_t - ** - *****************************************************************************/ - -xcb_randr_get_panning_cookie_t -xcb_randr_get_panning (xcb_connection_t *c /**< */, - xcb_randr_crtc_t crtc /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_GET_PANNING, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_randr_get_panning_cookie_t xcb_ret; - xcb_randr_get_panning_request_t xcb_out; - - xcb_out.crtc = crtc; - - 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_randr_get_panning_cookie_t xcb_randr_get_panning_unchecked - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_crtc_t crtc - ** @returns xcb_randr_get_panning_cookie_t - ** - *****************************************************************************/ - -xcb_randr_get_panning_cookie_t -xcb_randr_get_panning_unchecked (xcb_connection_t *c /**< */, - xcb_randr_crtc_t crtc /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_GET_PANNING, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_randr_get_panning_cookie_t xcb_ret; - xcb_randr_get_panning_request_t xcb_out; - - xcb_out.crtc = crtc; - - 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_randr_get_panning_reply_t * xcb_randr_get_panning_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_get_panning_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_randr_get_panning_reply_t * - ** - *****************************************************************************/ - -xcb_randr_get_panning_reply_t * -xcb_randr_get_panning_reply (xcb_connection_t *c /**< */, - xcb_randr_get_panning_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_randr_get_panning_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - - -/***************************************************************************** - ** - ** xcb_randr_set_panning_cookie_t xcb_randr_set_panning - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_crtc_t crtc - ** @param xcb_timestamp_t timestamp - ** @param uint16_t left - ** @param uint16_t top - ** @param uint16_t width - ** @param uint16_t height - ** @param uint16_t track_left - ** @param uint16_t track_top - ** @param uint16_t track_width - ** @param uint16_t track_height - ** @param int16_t border_left - ** @param int16_t border_top - ** @param int16_t border_right - ** @param int16_t border_bottom - ** @returns xcb_randr_set_panning_cookie_t - ** - *****************************************************************************/ - -xcb_randr_set_panning_cookie_t -xcb_randr_set_panning (xcb_connection_t *c /**< */, - xcb_randr_crtc_t crtc /**< */, - xcb_timestamp_t timestamp /**< */, - uint16_t left /**< */, - uint16_t top /**< */, - uint16_t width /**< */, - uint16_t height /**< */, - uint16_t track_left /**< */, - uint16_t track_top /**< */, - uint16_t track_width /**< */, - uint16_t track_height /**< */, - int16_t border_left /**< */, - int16_t border_top /**< */, - int16_t border_right /**< */, - int16_t border_bottom /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_SET_PANNING, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_randr_set_panning_cookie_t xcb_ret; - xcb_randr_set_panning_request_t xcb_out; - - xcb_out.crtc = crtc; - xcb_out.timestamp = timestamp; - xcb_out.left = left; - xcb_out.top = top; - xcb_out.width = width; - xcb_out.height = height; - xcb_out.track_left = track_left; - xcb_out.track_top = track_top; - xcb_out.track_width = track_width; - xcb_out.track_height = track_height; - xcb_out.border_left = border_left; - xcb_out.border_top = border_top; - xcb_out.border_right = border_right; - xcb_out.border_bottom = border_bottom; - - 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_randr_set_panning_cookie_t xcb_randr_set_panning_unchecked - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_crtc_t crtc - ** @param xcb_timestamp_t timestamp - ** @param uint16_t left - ** @param uint16_t top - ** @param uint16_t width - ** @param uint16_t height - ** @param uint16_t track_left - ** @param uint16_t track_top - ** @param uint16_t track_width - ** @param uint16_t track_height - ** @param int16_t border_left - ** @param int16_t border_top - ** @param int16_t border_right - ** @param int16_t border_bottom - ** @returns xcb_randr_set_panning_cookie_t - ** - *****************************************************************************/ - -xcb_randr_set_panning_cookie_t -xcb_randr_set_panning_unchecked (xcb_connection_t *c /**< */, - xcb_randr_crtc_t crtc /**< */, - xcb_timestamp_t timestamp /**< */, - uint16_t left /**< */, - uint16_t top /**< */, - uint16_t width /**< */, - uint16_t height /**< */, - uint16_t track_left /**< */, - uint16_t track_top /**< */, - uint16_t track_width /**< */, - uint16_t track_height /**< */, - int16_t border_left /**< */, - int16_t border_top /**< */, - int16_t border_right /**< */, - int16_t border_bottom /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_SET_PANNING, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_randr_set_panning_cookie_t xcb_ret; - xcb_randr_set_panning_request_t xcb_out; - - xcb_out.crtc = crtc; - xcb_out.timestamp = timestamp; - xcb_out.left = left; - xcb_out.top = top; - xcb_out.width = width; - xcb_out.height = height; - xcb_out.track_left = track_left; - xcb_out.track_top = track_top; - xcb_out.track_width = track_width; - xcb_out.track_height = track_height; - xcb_out.border_left = border_left; - xcb_out.border_top = border_top; - xcb_out.border_right = border_right; - xcb_out.border_bottom = border_bottom; - - 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_randr_set_panning_reply_t * xcb_randr_set_panning_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_set_panning_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_randr_set_panning_reply_t * - ** - *****************************************************************************/ - -xcb_randr_set_panning_reply_t * -xcb_randr_set_panning_reply (xcb_connection_t *c /**< */, - xcb_randr_set_panning_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_randr_set_panning_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_randr_set_output_primary_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_window_t window - ** @param xcb_randr_output_t output - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_randr_set_output_primary_checked (xcb_connection_t *c /**< */, - xcb_window_t window /**< */, - xcb_randr_output_t output /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_SET_OUTPUT_PRIMARY, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_randr_set_output_primary_request_t xcb_out; - - xcb_out.window = window; - xcb_out.output = output; - - 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_randr_set_output_primary - ** - ** @param xcb_connection_t *c - ** @param xcb_window_t window - ** @param xcb_randr_output_t output - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_randr_set_output_primary (xcb_connection_t *c /**< */, - xcb_window_t window /**< */, - xcb_randr_output_t output /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_SET_OUTPUT_PRIMARY, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_randr_set_output_primary_request_t xcb_out; - - xcb_out.window = window; - xcb_out.output = output; - - 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_randr_get_output_primary_cookie_t xcb_randr_get_output_primary - ** - ** @param xcb_connection_t *c - ** @param xcb_window_t window - ** @returns xcb_randr_get_output_primary_cookie_t - ** - *****************************************************************************/ - -xcb_randr_get_output_primary_cookie_t -xcb_randr_get_output_primary (xcb_connection_t *c /**< */, - xcb_window_t window /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_GET_OUTPUT_PRIMARY, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_randr_get_output_primary_cookie_t xcb_ret; - xcb_randr_get_output_primary_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_randr_get_output_primary_cookie_t xcb_randr_get_output_primary_unchecked - ** - ** @param xcb_connection_t *c - ** @param xcb_window_t window - ** @returns xcb_randr_get_output_primary_cookie_t - ** - *****************************************************************************/ - -xcb_randr_get_output_primary_cookie_t -xcb_randr_get_output_primary_unchecked (xcb_connection_t *c /**< */, - xcb_window_t window /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_randr_id, - /* opcode */ XCB_RANDR_GET_OUTPUT_PRIMARY, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_randr_get_output_primary_cookie_t xcb_ret; - xcb_randr_get_output_primary_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_randr_get_output_primary_reply_t * xcb_randr_get_output_primary_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_randr_get_output_primary_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_randr_get_output_primary_reply_t * - ** - *****************************************************************************/ - -xcb_randr_get_output_primary_reply_t * -xcb_randr_get_output_primary_reply (xcb_connection_t *c /**< */, - xcb_randr_get_output_primary_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_randr_get_output_primary_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - - -/***************************************************************************** - ** - ** void xcb_randr_crtc_change_next - ** - ** @param xcb_randr_crtc_change_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_randr_crtc_change_next (xcb_randr_crtc_change_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_randr_crtc_change_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_randr_crtc_change_end - ** - ** @param xcb_randr_crtc_change_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_randr_crtc_change_end (xcb_randr_crtc_change_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_randr_output_change_next - ** - ** @param xcb_randr_output_change_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_randr_output_change_next (xcb_randr_output_change_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_randr_output_change_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_randr_output_change_end - ** - ** @param xcb_randr_output_change_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_randr_output_change_end (xcb_randr_output_change_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_randr_output_property_next - ** - ** @param xcb_randr_output_property_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_randr_output_property_next (xcb_randr_output_property_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_randr_output_property_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_randr_output_property_end - ** - ** @param xcb_randr_output_property_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_randr_output_property_end (xcb_randr_output_property_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_randr_notify_data_next - ** - ** @param xcb_randr_notify_data_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_randr_notify_data_next (xcb_randr_notify_data_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_randr_notify_data_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_randr_notify_data_end - ** - ** @param xcb_randr_notify_data_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_randr_notify_data_end (xcb_randr_notify_data_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - diff --git a/src/3rdparty/xcb/libxcb/render.c b/src/3rdparty/xcb/libxcb/render.c deleted file mode 100644 index 7e5379cfcf..0000000000 --- a/src/3rdparty/xcb/libxcb/render.c +++ /dev/null @@ -1,5295 +0,0 @@ -/* - * This file generated automatically from render.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 "render.h" - -#define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member) -#include "xproto.h" - -xcb_extension_t xcb_render_id = { "RENDER", 0 }; - - -/***************************************************************************** - ** - ** void xcb_render_glyph_next - ** - ** @param xcb_render_glyph_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_render_glyph_next (xcb_render_glyph_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_render_glyph_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_render_glyph_end - ** - ** @param xcb_render_glyph_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_render_glyph_end (xcb_render_glyph_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_render_glyphset_next - ** - ** @param xcb_render_glyphset_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_render_glyphset_next (xcb_render_glyphset_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_render_glyphset_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_render_glyphset_end - ** - ** @param xcb_render_glyphset_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_render_glyphset_end (xcb_render_glyphset_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_render_picture_next - ** - ** @param xcb_render_picture_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_render_picture_next (xcb_render_picture_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_render_picture_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_render_picture_end - ** - ** @param xcb_render_picture_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_render_picture_end (xcb_render_picture_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_render_pictformat_next - ** - ** @param xcb_render_pictformat_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_render_pictformat_next (xcb_render_pictformat_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_render_pictformat_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_render_pictformat_end - ** - ** @param xcb_render_pictformat_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_render_pictformat_end (xcb_render_pictformat_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_render_fixed_next - ** - ** @param xcb_render_fixed_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_render_fixed_next (xcb_render_fixed_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_render_fixed_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_render_fixed_end - ** - ** @param xcb_render_fixed_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_render_fixed_end (xcb_render_fixed_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_render_directformat_next - ** - ** @param xcb_render_directformat_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_render_directformat_next (xcb_render_directformat_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_render_directformat_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_render_directformat_end - ** - ** @param xcb_render_directformat_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_render_directformat_end (xcb_render_directformat_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_render_pictforminfo_next - ** - ** @param xcb_render_pictforminfo_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_render_pictforminfo_next (xcb_render_pictforminfo_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_render_pictforminfo_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_render_pictforminfo_end - ** - ** @param xcb_render_pictforminfo_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_render_pictforminfo_end (xcb_render_pictforminfo_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_render_pictvisual_next - ** - ** @param xcb_render_pictvisual_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_render_pictvisual_next (xcb_render_pictvisual_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_render_pictvisual_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_render_pictvisual_end - ** - ** @param xcb_render_pictvisual_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_render_pictvisual_end (xcb_render_pictvisual_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - -int -xcb_render_pictdepth_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_render_pictdepth_t *_aux = (xcb_render_pictdepth_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_render_pictdepth_t); - xcb_tmp += xcb_block_len; - /* visuals */ - xcb_block_len += _aux->num_visuals * sizeof(xcb_render_pictvisual_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_render_pictvisual_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_render_pictvisual_t * xcb_render_pictdepth_visuals - ** - ** @param const xcb_render_pictdepth_t *R - ** @returns xcb_render_pictvisual_t * - ** - *****************************************************************************/ - -xcb_render_pictvisual_t * -xcb_render_pictdepth_visuals (const xcb_render_pictdepth_t *R /**< */) -{ - return (xcb_render_pictvisual_t *) (R + 1); -} - - -/***************************************************************************** - ** - ** int xcb_render_pictdepth_visuals_length - ** - ** @param const xcb_render_pictdepth_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_render_pictdepth_visuals_length (const xcb_render_pictdepth_t *R /**< */) -{ - return R->num_visuals; -} - - -/***************************************************************************** - ** - ** xcb_render_pictvisual_iterator_t xcb_render_pictdepth_visuals_iterator - ** - ** @param const xcb_render_pictdepth_t *R - ** @returns xcb_render_pictvisual_iterator_t - ** - *****************************************************************************/ - -xcb_render_pictvisual_iterator_t -xcb_render_pictdepth_visuals_iterator (const xcb_render_pictdepth_t *R /**< */) -{ - xcb_render_pictvisual_iterator_t i; - i.data = (xcb_render_pictvisual_t *) (R + 1); - i.rem = R->num_visuals; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** void xcb_render_pictdepth_next - ** - ** @param xcb_render_pictdepth_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_render_pictdepth_next (xcb_render_pictdepth_iterator_t *i /**< */) -{ - xcb_render_pictdepth_t *R = i->data; - xcb_generic_iterator_t child; - child.data = (xcb_render_pictdepth_t *)(((char *)R) + xcb_render_pictdepth_sizeof(R)); - i->index = (char *) child.data - (char *) i->data; - --i->rem; - i->data = (xcb_render_pictdepth_t *) child.data; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_render_pictdepth_end - ** - ** @param xcb_render_pictdepth_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_render_pictdepth_end (xcb_render_pictdepth_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - while(i.rem > 0) - xcb_render_pictdepth_next(&i); - ret.data = i.data; - ret.rem = i.rem; - ret.index = i.index; - return ret; -} - -int -xcb_render_pictscreen_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_render_pictscreen_t *_aux = (xcb_render_pictscreen_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - unsigned int i; - unsigned int xcb_tmp_len; - - xcb_block_len += sizeof(xcb_render_pictscreen_t); - xcb_tmp += xcb_block_len; - /* depths */ - for(i=0; i<_aux->num_depths; i++) { - xcb_tmp_len = xcb_render_pictdepth_sizeof(xcb_tmp); - xcb_block_len += xcb_tmp_len; - xcb_tmp += xcb_tmp_len; - } - xcb_align_to = ALIGNOF(xcb_render_pictdepth_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** int xcb_render_pictscreen_depths_length - ** - ** @param const xcb_render_pictscreen_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_render_pictscreen_depths_length (const xcb_render_pictscreen_t *R /**< */) -{ - return R->num_depths; -} - - -/***************************************************************************** - ** - ** xcb_render_pictdepth_iterator_t xcb_render_pictscreen_depths_iterator - ** - ** @param const xcb_render_pictscreen_t *R - ** @returns xcb_render_pictdepth_iterator_t - ** - *****************************************************************************/ - -xcb_render_pictdepth_iterator_t -xcb_render_pictscreen_depths_iterator (const xcb_render_pictscreen_t *R /**< */) -{ - xcb_render_pictdepth_iterator_t i; - i.data = (xcb_render_pictdepth_t *) (R + 1); - i.rem = R->num_depths; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** void xcb_render_pictscreen_next - ** - ** @param xcb_render_pictscreen_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_render_pictscreen_next (xcb_render_pictscreen_iterator_t *i /**< */) -{ - xcb_render_pictscreen_t *R = i->data; - xcb_generic_iterator_t child; - child.data = (xcb_render_pictscreen_t *)(((char *)R) + xcb_render_pictscreen_sizeof(R)); - i->index = (char *) child.data - (char *) i->data; - --i->rem; - i->data = (xcb_render_pictscreen_t *) child.data; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_render_pictscreen_end - ** - ** @param xcb_render_pictscreen_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_render_pictscreen_end (xcb_render_pictscreen_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - while(i.rem > 0) - xcb_render_pictscreen_next(&i); - ret.data = i.data; - ret.rem = i.rem; - ret.index = i.index; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_render_indexvalue_next - ** - ** @param xcb_render_indexvalue_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_render_indexvalue_next (xcb_render_indexvalue_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_render_indexvalue_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_render_indexvalue_end - ** - ** @param xcb_render_indexvalue_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_render_indexvalue_end (xcb_render_indexvalue_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_render_color_next - ** - ** @param xcb_render_color_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_render_color_next (xcb_render_color_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_render_color_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_render_color_end - ** - ** @param xcb_render_color_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_render_color_end (xcb_render_color_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_render_pointfix_next - ** - ** @param xcb_render_pointfix_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_render_pointfix_next (xcb_render_pointfix_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_render_pointfix_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_render_pointfix_end - ** - ** @param xcb_render_pointfix_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_render_pointfix_end (xcb_render_pointfix_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_render_linefix_next - ** - ** @param xcb_render_linefix_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_render_linefix_next (xcb_render_linefix_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_render_linefix_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_render_linefix_end - ** - ** @param xcb_render_linefix_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_render_linefix_end (xcb_render_linefix_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_render_triangle_next - ** - ** @param xcb_render_triangle_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_render_triangle_next (xcb_render_triangle_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_render_triangle_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_render_triangle_end - ** - ** @param xcb_render_triangle_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_render_triangle_end (xcb_render_triangle_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_render_trapezoid_next - ** - ** @param xcb_render_trapezoid_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_render_trapezoid_next (xcb_render_trapezoid_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_render_trapezoid_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_render_trapezoid_end - ** - ** @param xcb_render_trapezoid_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_render_trapezoid_end (xcb_render_trapezoid_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_render_glyphinfo_next - ** - ** @param xcb_render_glyphinfo_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_render_glyphinfo_next (xcb_render_glyphinfo_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_render_glyphinfo_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_render_glyphinfo_end - ** - ** @param xcb_render_glyphinfo_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_render_glyphinfo_end (xcb_render_glyphinfo_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** xcb_render_query_version_cookie_t xcb_render_query_version - ** - ** @param xcb_connection_t *c - ** @param uint32_t client_major_version - ** @param uint32_t client_minor_version - ** @returns xcb_render_query_version_cookie_t - ** - *****************************************************************************/ - -xcb_render_query_version_cookie_t -xcb_render_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_render_id, - /* opcode */ XCB_RENDER_QUERY_VERSION, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_render_query_version_cookie_t xcb_ret; - xcb_render_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_render_query_version_cookie_t xcb_render_query_version_unchecked - ** - ** @param xcb_connection_t *c - ** @param uint32_t client_major_version - ** @param uint32_t client_minor_version - ** @returns xcb_render_query_version_cookie_t - ** - *****************************************************************************/ - -xcb_render_query_version_cookie_t -xcb_render_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_render_id, - /* opcode */ XCB_RENDER_QUERY_VERSION, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_render_query_version_cookie_t xcb_ret; - xcb_render_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_render_query_version_reply_t * xcb_render_query_version_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_render_query_version_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_render_query_version_reply_t * - ** - *****************************************************************************/ - -xcb_render_query_version_reply_t * -xcb_render_query_version_reply (xcb_connection_t *c /**< */, - xcb_render_query_version_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_render_query_version_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - -int -xcb_render_query_pict_formats_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_render_query_pict_formats_reply_t *_aux = (xcb_render_query_pict_formats_reply_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - unsigned int i; - unsigned int xcb_tmp_len; - - xcb_block_len += sizeof(xcb_render_query_pict_formats_reply_t); - xcb_tmp += xcb_block_len; - /* formats */ - xcb_block_len += _aux->num_formats * sizeof(xcb_render_pictforminfo_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_render_pictforminfo_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* screens */ - for(i=0; i<_aux->num_screens; i++) { - xcb_tmp_len = xcb_render_pictscreen_sizeof(xcb_tmp); - xcb_block_len += xcb_tmp_len; - xcb_tmp += xcb_tmp_len; - } - xcb_align_to = ALIGNOF(xcb_render_pictscreen_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* subpixels */ - xcb_block_len += _aux->num_subpixel * sizeof(uint32_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(uint32_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_render_query_pict_formats_cookie_t xcb_render_query_pict_formats - ** - ** @param xcb_connection_t *c - ** @returns xcb_render_query_pict_formats_cookie_t - ** - *****************************************************************************/ - -xcb_render_query_pict_formats_cookie_t -xcb_render_query_pict_formats (xcb_connection_t *c /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_QUERY_PICT_FORMATS, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_render_query_pict_formats_cookie_t xcb_ret; - xcb_render_query_pict_formats_request_t xcb_out; - - - 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_render_query_pict_formats_cookie_t xcb_render_query_pict_formats_unchecked - ** - ** @param xcb_connection_t *c - ** @returns xcb_render_query_pict_formats_cookie_t - ** - *****************************************************************************/ - -xcb_render_query_pict_formats_cookie_t -xcb_render_query_pict_formats_unchecked (xcb_connection_t *c /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_QUERY_PICT_FORMATS, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_render_query_pict_formats_cookie_t xcb_ret; - xcb_render_query_pict_formats_request_t xcb_out; - - - 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_render_pictforminfo_t * xcb_render_query_pict_formats_formats - ** - ** @param const xcb_render_query_pict_formats_reply_t *R - ** @returns xcb_render_pictforminfo_t * - ** - *****************************************************************************/ - -xcb_render_pictforminfo_t * -xcb_render_query_pict_formats_formats (const xcb_render_query_pict_formats_reply_t *R /**< */) -{ - return (xcb_render_pictforminfo_t *) (R + 1); -} - - -/***************************************************************************** - ** - ** int xcb_render_query_pict_formats_formats_length - ** - ** @param const xcb_render_query_pict_formats_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_render_query_pict_formats_formats_length (const xcb_render_query_pict_formats_reply_t *R /**< */) -{ - return R->num_formats; -} - - -/***************************************************************************** - ** - ** xcb_render_pictforminfo_iterator_t xcb_render_query_pict_formats_formats_iterator - ** - ** @param const xcb_render_query_pict_formats_reply_t *R - ** @returns xcb_render_pictforminfo_iterator_t - ** - *****************************************************************************/ - -xcb_render_pictforminfo_iterator_t -xcb_render_query_pict_formats_formats_iterator (const xcb_render_query_pict_formats_reply_t *R /**< */) -{ - xcb_render_pictforminfo_iterator_t i; - i.data = (xcb_render_pictforminfo_t *) (R + 1); - i.rem = R->num_formats; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** int xcb_render_query_pict_formats_screens_length - ** - ** @param const xcb_render_query_pict_formats_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_render_query_pict_formats_screens_length (const xcb_render_query_pict_formats_reply_t *R /**< */) -{ - return R->num_screens; -} - - -/***************************************************************************** - ** - ** xcb_render_pictscreen_iterator_t xcb_render_query_pict_formats_screens_iterator - ** - ** @param const xcb_render_query_pict_formats_reply_t *R - ** @returns xcb_render_pictscreen_iterator_t - ** - *****************************************************************************/ - -xcb_render_pictscreen_iterator_t -xcb_render_query_pict_formats_screens_iterator (const xcb_render_query_pict_formats_reply_t *R /**< */) -{ - xcb_render_pictscreen_iterator_t i; - xcb_generic_iterator_t prev = xcb_render_pictforminfo_end(xcb_render_query_pict_formats_formats_iterator(R)); - i.data = (xcb_render_pictscreen_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_render_pictscreen_t, prev.index)); - i.rem = R->num_screens; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** uint32_t * xcb_render_query_pict_formats_subpixels - ** - ** @param const xcb_render_query_pict_formats_reply_t *R - ** @returns uint32_t * - ** - *****************************************************************************/ - -uint32_t * -xcb_render_query_pict_formats_subpixels (const xcb_render_query_pict_formats_reply_t *R /**< */) -{ - xcb_generic_iterator_t prev = xcb_render_pictscreen_end(xcb_render_query_pict_formats_screens_iterator(R)); - return (uint32_t *) ((char *) prev.data + XCB_TYPE_PAD(uint32_t, prev.index) + 0); -} - - -/***************************************************************************** - ** - ** int xcb_render_query_pict_formats_subpixels_length - ** - ** @param const xcb_render_query_pict_formats_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_render_query_pict_formats_subpixels_length (const xcb_render_query_pict_formats_reply_t *R /**< */) -{ - return R->num_subpixel; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_render_query_pict_formats_subpixels_end - ** - ** @param const xcb_render_query_pict_formats_reply_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_render_query_pict_formats_subpixels_end (const xcb_render_query_pict_formats_reply_t *R /**< */) -{ - xcb_generic_iterator_t i; - xcb_generic_iterator_t child = xcb_render_pictscreen_end(xcb_render_query_pict_formats_screens_iterator(R)); - i.data = ((uint32_t *) child.data) + (R->num_subpixel); - i.rem = 0; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** xcb_render_query_pict_formats_reply_t * xcb_render_query_pict_formats_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_render_query_pict_formats_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_render_query_pict_formats_reply_t * - ** - *****************************************************************************/ - -xcb_render_query_pict_formats_reply_t * -xcb_render_query_pict_formats_reply (xcb_connection_t *c /**< */, - xcb_render_query_pict_formats_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_render_query_pict_formats_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - -int -xcb_render_query_pict_index_values_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_render_query_pict_index_values_reply_t *_aux = (xcb_render_query_pict_index_values_reply_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_render_query_pict_index_values_reply_t); - xcb_tmp += xcb_block_len; - /* values */ - xcb_block_len += _aux->num_values * sizeof(xcb_render_indexvalue_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_render_indexvalue_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_render_query_pict_index_values_cookie_t xcb_render_query_pict_index_values - ** - ** @param xcb_connection_t *c - ** @param xcb_render_pictformat_t format - ** @returns xcb_render_query_pict_index_values_cookie_t - ** - *****************************************************************************/ - -xcb_render_query_pict_index_values_cookie_t -xcb_render_query_pict_index_values (xcb_connection_t *c /**< */, - xcb_render_pictformat_t format /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_QUERY_PICT_INDEX_VALUES, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_render_query_pict_index_values_cookie_t xcb_ret; - xcb_render_query_pict_index_values_request_t xcb_out; - - xcb_out.format = format; - - 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_render_query_pict_index_values_cookie_t xcb_render_query_pict_index_values_unchecked - ** - ** @param xcb_connection_t *c - ** @param xcb_render_pictformat_t format - ** @returns xcb_render_query_pict_index_values_cookie_t - ** - *****************************************************************************/ - -xcb_render_query_pict_index_values_cookie_t -xcb_render_query_pict_index_values_unchecked (xcb_connection_t *c /**< */, - xcb_render_pictformat_t format /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_QUERY_PICT_INDEX_VALUES, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_render_query_pict_index_values_cookie_t xcb_ret; - xcb_render_query_pict_index_values_request_t xcb_out; - - xcb_out.format = format; - - 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_render_indexvalue_t * xcb_render_query_pict_index_values_values - ** - ** @param const xcb_render_query_pict_index_values_reply_t *R - ** @returns xcb_render_indexvalue_t * - ** - *****************************************************************************/ - -xcb_render_indexvalue_t * -xcb_render_query_pict_index_values_values (const xcb_render_query_pict_index_values_reply_t *R /**< */) -{ - return (xcb_render_indexvalue_t *) (R + 1); -} - - -/***************************************************************************** - ** - ** int xcb_render_query_pict_index_values_values_length - ** - ** @param const xcb_render_query_pict_index_values_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_render_query_pict_index_values_values_length (const xcb_render_query_pict_index_values_reply_t *R /**< */) -{ - return R->num_values; -} - - -/***************************************************************************** - ** - ** xcb_render_indexvalue_iterator_t xcb_render_query_pict_index_values_values_iterator - ** - ** @param const xcb_render_query_pict_index_values_reply_t *R - ** @returns xcb_render_indexvalue_iterator_t - ** - *****************************************************************************/ - -xcb_render_indexvalue_iterator_t -xcb_render_query_pict_index_values_values_iterator (const xcb_render_query_pict_index_values_reply_t *R /**< */) -{ - xcb_render_indexvalue_iterator_t i; - i.data = (xcb_render_indexvalue_t *) (R + 1); - i.rem = R->num_values; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** xcb_render_query_pict_index_values_reply_t * xcb_render_query_pict_index_values_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_render_query_pict_index_values_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_render_query_pict_index_values_reply_t * - ** - *****************************************************************************/ - -xcb_render_query_pict_index_values_reply_t * -xcb_render_query_pict_index_values_reply (xcb_connection_t *c /**< */, - xcb_render_query_pict_index_values_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_render_query_pict_index_values_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - -int -xcb_render_create_picture_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_render_create_picture_request_t *_aux = (xcb_render_create_picture_request_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_render_create_picture_request_t); - xcb_tmp += xcb_block_len; - /* value_list */ - xcb_block_len += xcb_popcount(_aux->value_mask) * sizeof(uint32_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(uint32_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_render_create_picture_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_render_picture_t pid - ** @param xcb_drawable_t drawable - ** @param xcb_render_pictformat_t format - ** @param uint32_t value_mask - ** @param const uint32_t *value_list - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_create_picture_checked (xcb_connection_t *c /**< */, - xcb_render_picture_t pid /**< */, - xcb_drawable_t drawable /**< */, - xcb_render_pictformat_t format /**< */, - uint32_t value_mask /**< */, - const uint32_t *value_list /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_CREATE_PICTURE, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_render_create_picture_request_t xcb_out; - - xcb_out.pid = pid; - xcb_out.drawable = drawable; - xcb_out.format = format; - xcb_out.value_mask = value_mask; - - 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; - /* uint32_t value_list */ - xcb_parts[4].iov_base = (char *) value_list; - xcb_parts[4].iov_len = xcb_popcount(value_mask) * sizeof(uint32_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].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_render_create_picture - ** - ** @param xcb_connection_t *c - ** @param xcb_render_picture_t pid - ** @param xcb_drawable_t drawable - ** @param xcb_render_pictformat_t format - ** @param uint32_t value_mask - ** @param const uint32_t *value_list - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_create_picture (xcb_connection_t *c /**< */, - xcb_render_picture_t pid /**< */, - xcb_drawable_t drawable /**< */, - xcb_render_pictformat_t format /**< */, - uint32_t value_mask /**< */, - const uint32_t *value_list /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_CREATE_PICTURE, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_render_create_picture_request_t xcb_out; - - xcb_out.pid = pid; - xcb_out.drawable = drawable; - xcb_out.format = format; - xcb_out.value_mask = value_mask; - - 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; - /* uint32_t value_list */ - xcb_parts[4].iov_base = (char *) value_list; - xcb_parts[4].iov_len = xcb_popcount(value_mask) * sizeof(uint32_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - - xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); - return xcb_ret; -} - -int -xcb_render_change_picture_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_render_change_picture_request_t *_aux = (xcb_render_change_picture_request_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_render_change_picture_request_t); - xcb_tmp += xcb_block_len; - /* value_list */ - xcb_block_len += xcb_popcount(_aux->value_mask) * sizeof(uint32_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(uint32_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_render_change_picture_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_render_picture_t picture - ** @param uint32_t value_mask - ** @param const uint32_t *value_list - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_change_picture_checked (xcb_connection_t *c /**< */, - xcb_render_picture_t picture /**< */, - uint32_t value_mask /**< */, - const uint32_t *value_list /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_CHANGE_PICTURE, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_render_change_picture_request_t xcb_out; - - xcb_out.picture = picture; - xcb_out.value_mask = value_mask; - - 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; - /* uint32_t value_list */ - xcb_parts[4].iov_base = (char *) value_list; - xcb_parts[4].iov_len = xcb_popcount(value_mask) * sizeof(uint32_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].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_render_change_picture - ** - ** @param xcb_connection_t *c - ** @param xcb_render_picture_t picture - ** @param uint32_t value_mask - ** @param const uint32_t *value_list - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_change_picture (xcb_connection_t *c /**< */, - xcb_render_picture_t picture /**< */, - uint32_t value_mask /**< */, - const uint32_t *value_list /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_CHANGE_PICTURE, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_render_change_picture_request_t xcb_out; - - xcb_out.picture = picture; - xcb_out.value_mask = value_mask; - - 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; - /* uint32_t value_list */ - xcb_parts[4].iov_base = (char *) value_list; - xcb_parts[4].iov_len = xcb_popcount(value_mask) * sizeof(uint32_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - - xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); - return xcb_ret; -} - -int -xcb_render_set_picture_clip_rectangles_sizeof (const void *_buffer /**< */, - uint32_t rectangles_len /**< */) -{ - char *xcb_tmp = (char *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_render_set_picture_clip_rectangles_request_t); - xcb_tmp += xcb_block_len; - /* rectangles */ - xcb_block_len += rectangles_len * sizeof(xcb_rectangle_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_rectangle_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_render_set_picture_clip_rectangles_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_render_picture_t picture - ** @param int16_t clip_x_origin - ** @param int16_t clip_y_origin - ** @param uint32_t rectangles_len - ** @param const xcb_rectangle_t *rectangles - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_set_picture_clip_rectangles_checked (xcb_connection_t *c /**< */, - xcb_render_picture_t picture /**< */, - int16_t clip_x_origin /**< */, - int16_t clip_y_origin /**< */, - uint32_t rectangles_len /**< */, - const xcb_rectangle_t *rectangles /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_SET_PICTURE_CLIP_RECTANGLES, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_render_set_picture_clip_rectangles_request_t xcb_out; - - xcb_out.picture = picture; - xcb_out.clip_x_origin = clip_x_origin; - xcb_out.clip_y_origin = clip_y_origin; - - 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_rectangle_t rectangles */ - xcb_parts[4].iov_base = (char *) rectangles; - xcb_parts[4].iov_len = rectangles_len * sizeof(xcb_rectangle_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].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_render_set_picture_clip_rectangles - ** - ** @param xcb_connection_t *c - ** @param xcb_render_picture_t picture - ** @param int16_t clip_x_origin - ** @param int16_t clip_y_origin - ** @param uint32_t rectangles_len - ** @param const xcb_rectangle_t *rectangles - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_set_picture_clip_rectangles (xcb_connection_t *c /**< */, - xcb_render_picture_t picture /**< */, - int16_t clip_x_origin /**< */, - int16_t clip_y_origin /**< */, - uint32_t rectangles_len /**< */, - const xcb_rectangle_t *rectangles /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_SET_PICTURE_CLIP_RECTANGLES, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_render_set_picture_clip_rectangles_request_t xcb_out; - - xcb_out.picture = picture; - xcb_out.clip_x_origin = clip_x_origin; - xcb_out.clip_y_origin = clip_y_origin; - - 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_rectangle_t rectangles */ - xcb_parts[4].iov_base = (char *) rectangles; - xcb_parts[4].iov_len = rectangles_len * sizeof(xcb_rectangle_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - - xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); - return xcb_ret; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_render_free_picture_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_render_picture_t picture - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_free_picture_checked (xcb_connection_t *c /**< */, - xcb_render_picture_t picture /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_FREE_PICTURE, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_render_free_picture_request_t xcb_out; - - xcb_out.picture = picture; - - 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_render_free_picture - ** - ** @param xcb_connection_t *c - ** @param xcb_render_picture_t picture - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_free_picture (xcb_connection_t *c /**< */, - xcb_render_picture_t picture /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_FREE_PICTURE, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_render_free_picture_request_t xcb_out; - - xcb_out.picture = picture; - - 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_render_composite_checked - ** - ** @param xcb_connection_t *c - ** @param uint8_t op - ** @param xcb_render_picture_t src - ** @param xcb_render_picture_t mask - ** @param xcb_render_picture_t dst - ** @param int16_t src_x - ** @param int16_t src_y - ** @param int16_t mask_x - ** @param int16_t mask_y - ** @param int16_t dst_x - ** @param int16_t dst_y - ** @param uint16_t width - ** @param uint16_t height - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_composite_checked (xcb_connection_t *c /**< */, - uint8_t op /**< */, - xcb_render_picture_t src /**< */, - xcb_render_picture_t mask /**< */, - xcb_render_picture_t dst /**< */, - int16_t src_x /**< */, - int16_t src_y /**< */, - int16_t mask_x /**< */, - int16_t mask_y /**< */, - int16_t dst_x /**< */, - int16_t dst_y /**< */, - uint16_t width /**< */, - uint16_t height /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_COMPOSITE, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_render_composite_request_t xcb_out; - - xcb_out.op = op; - memset(xcb_out.pad0, 0, 3); - xcb_out.src = src; - xcb_out.mask = mask; - xcb_out.dst = dst; - xcb_out.src_x = src_x; - xcb_out.src_y = src_y; - xcb_out.mask_x = mask_x; - xcb_out.mask_y = mask_y; - xcb_out.dst_x = dst_x; - xcb_out.dst_y = dst_y; - xcb_out.width = width; - xcb_out.height = height; - - 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_render_composite - ** - ** @param xcb_connection_t *c - ** @param uint8_t op - ** @param xcb_render_picture_t src - ** @param xcb_render_picture_t mask - ** @param xcb_render_picture_t dst - ** @param int16_t src_x - ** @param int16_t src_y - ** @param int16_t mask_x - ** @param int16_t mask_y - ** @param int16_t dst_x - ** @param int16_t dst_y - ** @param uint16_t width - ** @param uint16_t height - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_composite (xcb_connection_t *c /**< */, - uint8_t op /**< */, - xcb_render_picture_t src /**< */, - xcb_render_picture_t mask /**< */, - xcb_render_picture_t dst /**< */, - int16_t src_x /**< */, - int16_t src_y /**< */, - int16_t mask_x /**< */, - int16_t mask_y /**< */, - int16_t dst_x /**< */, - int16_t dst_y /**< */, - uint16_t width /**< */, - uint16_t height /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_COMPOSITE, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_render_composite_request_t xcb_out; - - xcb_out.op = op; - memset(xcb_out.pad0, 0, 3); - xcb_out.src = src; - xcb_out.mask = mask; - xcb_out.dst = dst; - xcb_out.src_x = src_x; - xcb_out.src_y = src_y; - xcb_out.mask_x = mask_x; - xcb_out.mask_y = mask_y; - xcb_out.dst_x = dst_x; - xcb_out.dst_y = dst_y; - xcb_out.width = width; - xcb_out.height = height; - - 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; -} - -int -xcb_render_trapezoids_sizeof (const void *_buffer /**< */, - uint32_t traps_len /**< */) -{ - char *xcb_tmp = (char *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_render_trapezoids_request_t); - xcb_tmp += xcb_block_len; - /* traps */ - xcb_block_len += traps_len * sizeof(xcb_render_trapezoid_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_render_trapezoid_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_render_trapezoids_checked - ** - ** @param xcb_connection_t *c - ** @param uint8_t op - ** @param xcb_render_picture_t src - ** @param xcb_render_picture_t dst - ** @param xcb_render_pictformat_t mask_format - ** @param int16_t src_x - ** @param int16_t src_y - ** @param uint32_t traps_len - ** @param const xcb_render_trapezoid_t *traps - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_trapezoids_checked (xcb_connection_t *c /**< */, - uint8_t op /**< */, - xcb_render_picture_t src /**< */, - xcb_render_picture_t dst /**< */, - xcb_render_pictformat_t mask_format /**< */, - int16_t src_x /**< */, - int16_t src_y /**< */, - uint32_t traps_len /**< */, - const xcb_render_trapezoid_t *traps /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_TRAPEZOIDS, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_render_trapezoids_request_t xcb_out; - - xcb_out.op = op; - memset(xcb_out.pad0, 0, 3); - xcb_out.src = src; - xcb_out.dst = dst; - xcb_out.mask_format = mask_format; - xcb_out.src_x = src_x; - xcb_out.src_y = src_y; - - 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_render_trapezoid_t traps */ - xcb_parts[4].iov_base = (char *) traps; - xcb_parts[4].iov_len = traps_len * sizeof(xcb_render_trapezoid_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].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_render_trapezoids - ** - ** @param xcb_connection_t *c - ** @param uint8_t op - ** @param xcb_render_picture_t src - ** @param xcb_render_picture_t dst - ** @param xcb_render_pictformat_t mask_format - ** @param int16_t src_x - ** @param int16_t src_y - ** @param uint32_t traps_len - ** @param const xcb_render_trapezoid_t *traps - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_trapezoids (xcb_connection_t *c /**< */, - uint8_t op /**< */, - xcb_render_picture_t src /**< */, - xcb_render_picture_t dst /**< */, - xcb_render_pictformat_t mask_format /**< */, - int16_t src_x /**< */, - int16_t src_y /**< */, - uint32_t traps_len /**< */, - const xcb_render_trapezoid_t *traps /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_TRAPEZOIDS, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_render_trapezoids_request_t xcb_out; - - xcb_out.op = op; - memset(xcb_out.pad0, 0, 3); - xcb_out.src = src; - xcb_out.dst = dst; - xcb_out.mask_format = mask_format; - xcb_out.src_x = src_x; - xcb_out.src_y = src_y; - - 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_render_trapezoid_t traps */ - xcb_parts[4].iov_base = (char *) traps; - xcb_parts[4].iov_len = traps_len * sizeof(xcb_render_trapezoid_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - - xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); - return xcb_ret; -} - -int -xcb_render_triangles_sizeof (const void *_buffer /**< */, - uint32_t triangles_len /**< */) -{ - char *xcb_tmp = (char *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_render_triangles_request_t); - xcb_tmp += xcb_block_len; - /* triangles */ - xcb_block_len += triangles_len * sizeof(xcb_render_triangle_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_render_triangle_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_render_triangles_checked - ** - ** @param xcb_connection_t *c - ** @param uint8_t op - ** @param xcb_render_picture_t src - ** @param xcb_render_picture_t dst - ** @param xcb_render_pictformat_t mask_format - ** @param int16_t src_x - ** @param int16_t src_y - ** @param uint32_t triangles_len - ** @param const xcb_render_triangle_t *triangles - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_triangles_checked (xcb_connection_t *c /**< */, - uint8_t op /**< */, - xcb_render_picture_t src /**< */, - xcb_render_picture_t dst /**< */, - xcb_render_pictformat_t mask_format /**< */, - int16_t src_x /**< */, - int16_t src_y /**< */, - uint32_t triangles_len /**< */, - const xcb_render_triangle_t *triangles /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_TRIANGLES, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_render_triangles_request_t xcb_out; - - xcb_out.op = op; - memset(xcb_out.pad0, 0, 3); - xcb_out.src = src; - xcb_out.dst = dst; - xcb_out.mask_format = mask_format; - xcb_out.src_x = src_x; - xcb_out.src_y = src_y; - - 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_render_triangle_t triangles */ - xcb_parts[4].iov_base = (char *) triangles; - xcb_parts[4].iov_len = triangles_len * sizeof(xcb_render_triangle_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].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_render_triangles - ** - ** @param xcb_connection_t *c - ** @param uint8_t op - ** @param xcb_render_picture_t src - ** @param xcb_render_picture_t dst - ** @param xcb_render_pictformat_t mask_format - ** @param int16_t src_x - ** @param int16_t src_y - ** @param uint32_t triangles_len - ** @param const xcb_render_triangle_t *triangles - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_triangles (xcb_connection_t *c /**< */, - uint8_t op /**< */, - xcb_render_picture_t src /**< */, - xcb_render_picture_t dst /**< */, - xcb_render_pictformat_t mask_format /**< */, - int16_t src_x /**< */, - int16_t src_y /**< */, - uint32_t triangles_len /**< */, - const xcb_render_triangle_t *triangles /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_TRIANGLES, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_render_triangles_request_t xcb_out; - - xcb_out.op = op; - memset(xcb_out.pad0, 0, 3); - xcb_out.src = src; - xcb_out.dst = dst; - xcb_out.mask_format = mask_format; - xcb_out.src_x = src_x; - xcb_out.src_y = src_y; - - 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_render_triangle_t triangles */ - xcb_parts[4].iov_base = (char *) triangles; - xcb_parts[4].iov_len = triangles_len * sizeof(xcb_render_triangle_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - - xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); - return xcb_ret; -} - -int -xcb_render_tri_strip_sizeof (const void *_buffer /**< */, - uint32_t points_len /**< */) -{ - char *xcb_tmp = (char *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_render_tri_strip_request_t); - xcb_tmp += xcb_block_len; - /* points */ - xcb_block_len += points_len * sizeof(xcb_render_pointfix_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_render_pointfix_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_render_tri_strip_checked - ** - ** @param xcb_connection_t *c - ** @param uint8_t op - ** @param xcb_render_picture_t src - ** @param xcb_render_picture_t dst - ** @param xcb_render_pictformat_t mask_format - ** @param int16_t src_x - ** @param int16_t src_y - ** @param uint32_t points_len - ** @param const xcb_render_pointfix_t *points - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_tri_strip_checked (xcb_connection_t *c /**< */, - uint8_t op /**< */, - xcb_render_picture_t src /**< */, - xcb_render_picture_t dst /**< */, - xcb_render_pictformat_t mask_format /**< */, - int16_t src_x /**< */, - int16_t src_y /**< */, - uint32_t points_len /**< */, - const xcb_render_pointfix_t *points /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_TRI_STRIP, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_render_tri_strip_request_t xcb_out; - - xcb_out.op = op; - memset(xcb_out.pad0, 0, 3); - xcb_out.src = src; - xcb_out.dst = dst; - xcb_out.mask_format = mask_format; - xcb_out.src_x = src_x; - xcb_out.src_y = src_y; - - 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_render_pointfix_t points */ - xcb_parts[4].iov_base = (char *) points; - xcb_parts[4].iov_len = points_len * sizeof(xcb_render_pointfix_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].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_render_tri_strip - ** - ** @param xcb_connection_t *c - ** @param uint8_t op - ** @param xcb_render_picture_t src - ** @param xcb_render_picture_t dst - ** @param xcb_render_pictformat_t mask_format - ** @param int16_t src_x - ** @param int16_t src_y - ** @param uint32_t points_len - ** @param const xcb_render_pointfix_t *points - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_tri_strip (xcb_connection_t *c /**< */, - uint8_t op /**< */, - xcb_render_picture_t src /**< */, - xcb_render_picture_t dst /**< */, - xcb_render_pictformat_t mask_format /**< */, - int16_t src_x /**< */, - int16_t src_y /**< */, - uint32_t points_len /**< */, - const xcb_render_pointfix_t *points /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_TRI_STRIP, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_render_tri_strip_request_t xcb_out; - - xcb_out.op = op; - memset(xcb_out.pad0, 0, 3); - xcb_out.src = src; - xcb_out.dst = dst; - xcb_out.mask_format = mask_format; - xcb_out.src_x = src_x; - xcb_out.src_y = src_y; - - 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_render_pointfix_t points */ - xcb_parts[4].iov_base = (char *) points; - xcb_parts[4].iov_len = points_len * sizeof(xcb_render_pointfix_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - - xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); - return xcb_ret; -} - -int -xcb_render_tri_fan_sizeof (const void *_buffer /**< */, - uint32_t points_len /**< */) -{ - char *xcb_tmp = (char *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_render_tri_fan_request_t); - xcb_tmp += xcb_block_len; - /* points */ - xcb_block_len += points_len * sizeof(xcb_render_pointfix_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_render_pointfix_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_render_tri_fan_checked - ** - ** @param xcb_connection_t *c - ** @param uint8_t op - ** @param xcb_render_picture_t src - ** @param xcb_render_picture_t dst - ** @param xcb_render_pictformat_t mask_format - ** @param int16_t src_x - ** @param int16_t src_y - ** @param uint32_t points_len - ** @param const xcb_render_pointfix_t *points - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_tri_fan_checked (xcb_connection_t *c /**< */, - uint8_t op /**< */, - xcb_render_picture_t src /**< */, - xcb_render_picture_t dst /**< */, - xcb_render_pictformat_t mask_format /**< */, - int16_t src_x /**< */, - int16_t src_y /**< */, - uint32_t points_len /**< */, - const xcb_render_pointfix_t *points /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_TRI_FAN, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_render_tri_fan_request_t xcb_out; - - xcb_out.op = op; - memset(xcb_out.pad0, 0, 3); - xcb_out.src = src; - xcb_out.dst = dst; - xcb_out.mask_format = mask_format; - xcb_out.src_x = src_x; - xcb_out.src_y = src_y; - - 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_render_pointfix_t points */ - xcb_parts[4].iov_base = (char *) points; - xcb_parts[4].iov_len = points_len * sizeof(xcb_render_pointfix_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].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_render_tri_fan - ** - ** @param xcb_connection_t *c - ** @param uint8_t op - ** @param xcb_render_picture_t src - ** @param xcb_render_picture_t dst - ** @param xcb_render_pictformat_t mask_format - ** @param int16_t src_x - ** @param int16_t src_y - ** @param uint32_t points_len - ** @param const xcb_render_pointfix_t *points - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_tri_fan (xcb_connection_t *c /**< */, - uint8_t op /**< */, - xcb_render_picture_t src /**< */, - xcb_render_picture_t dst /**< */, - xcb_render_pictformat_t mask_format /**< */, - int16_t src_x /**< */, - int16_t src_y /**< */, - uint32_t points_len /**< */, - const xcb_render_pointfix_t *points /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_TRI_FAN, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_render_tri_fan_request_t xcb_out; - - xcb_out.op = op; - memset(xcb_out.pad0, 0, 3); - xcb_out.src = src; - xcb_out.dst = dst; - xcb_out.mask_format = mask_format; - xcb_out.src_x = src_x; - xcb_out.src_y = src_y; - - 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_render_pointfix_t points */ - xcb_parts[4].iov_base = (char *) points; - xcb_parts[4].iov_len = points_len * sizeof(xcb_render_pointfix_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - - xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); - return xcb_ret; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_render_create_glyph_set_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_render_glyphset_t gsid - ** @param xcb_render_pictformat_t format - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_create_glyph_set_checked (xcb_connection_t *c /**< */, - xcb_render_glyphset_t gsid /**< */, - xcb_render_pictformat_t format /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_CREATE_GLYPH_SET, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_render_create_glyph_set_request_t xcb_out; - - xcb_out.gsid = gsid; - xcb_out.format = format; - - 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_render_create_glyph_set - ** - ** @param xcb_connection_t *c - ** @param xcb_render_glyphset_t gsid - ** @param xcb_render_pictformat_t format - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_create_glyph_set (xcb_connection_t *c /**< */, - xcb_render_glyphset_t gsid /**< */, - xcb_render_pictformat_t format /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_CREATE_GLYPH_SET, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_render_create_glyph_set_request_t xcb_out; - - xcb_out.gsid = gsid; - xcb_out.format = format; - - 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_render_reference_glyph_set_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_render_glyphset_t gsid - ** @param xcb_render_glyphset_t existing - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_reference_glyph_set_checked (xcb_connection_t *c /**< */, - xcb_render_glyphset_t gsid /**< */, - xcb_render_glyphset_t existing /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_REFERENCE_GLYPH_SET, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_render_reference_glyph_set_request_t xcb_out; - - xcb_out.gsid = gsid; - xcb_out.existing = existing; - - 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_render_reference_glyph_set - ** - ** @param xcb_connection_t *c - ** @param xcb_render_glyphset_t gsid - ** @param xcb_render_glyphset_t existing - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_reference_glyph_set (xcb_connection_t *c /**< */, - xcb_render_glyphset_t gsid /**< */, - xcb_render_glyphset_t existing /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_REFERENCE_GLYPH_SET, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_render_reference_glyph_set_request_t xcb_out; - - xcb_out.gsid = gsid; - xcb_out.existing = existing; - - 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_render_free_glyph_set_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_render_glyphset_t glyphset - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_free_glyph_set_checked (xcb_connection_t *c /**< */, - xcb_render_glyphset_t glyphset /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_FREE_GLYPH_SET, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_render_free_glyph_set_request_t xcb_out; - - xcb_out.glyphset = glyphset; - - 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_render_free_glyph_set - ** - ** @param xcb_connection_t *c - ** @param xcb_render_glyphset_t glyphset - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_free_glyph_set (xcb_connection_t *c /**< */, - xcb_render_glyphset_t glyphset /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_FREE_GLYPH_SET, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_render_free_glyph_set_request_t xcb_out; - - xcb_out.glyphset = glyphset; - - 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; -} - -int -xcb_render_add_glyphs_sizeof (const void *_buffer /**< */, - uint32_t data_len /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_render_add_glyphs_request_t *_aux = (xcb_render_add_glyphs_request_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_render_add_glyphs_request_t); - xcb_tmp += xcb_block_len; - /* glyphids */ - xcb_block_len += _aux->glyphs_len * sizeof(uint32_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(uint32_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* glyphs */ - xcb_block_len += _aux->glyphs_len * sizeof(xcb_render_glyphinfo_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_render_glyphinfo_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* data */ - xcb_block_len += data_len * sizeof(uint8_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(uint8_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_render_add_glyphs_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_render_glyphset_t glyphset - ** @param uint32_t glyphs_len - ** @param const uint32_t *glyphids - ** @param const xcb_render_glyphinfo_t *glyphs - ** @param uint32_t data_len - ** @param const uint8_t *data - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_add_glyphs_checked (xcb_connection_t *c /**< */, - xcb_render_glyphset_t glyphset /**< */, - uint32_t glyphs_len /**< */, - const uint32_t *glyphids /**< */, - const xcb_render_glyphinfo_t *glyphs /**< */, - uint32_t data_len /**< */, - const uint8_t *data /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 8, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_ADD_GLYPHS, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[10]; - xcb_void_cookie_t xcb_ret; - xcb_render_add_glyphs_request_t xcb_out; - - xcb_out.glyphset = glyphset; - xcb_out.glyphs_len = glyphs_len; - - 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; - /* uint32_t glyphids */ - xcb_parts[4].iov_base = (char *) glyphids; - xcb_parts[4].iov_len = glyphs_len * sizeof(uint32_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - /* xcb_render_glyphinfo_t glyphs */ - xcb_parts[6].iov_base = (char *) glyphs; - xcb_parts[6].iov_len = glyphs_len * sizeof(xcb_render_glyphinfo_t); - xcb_parts[7].iov_base = 0; - xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3; - /* uint8_t data */ - xcb_parts[8].iov_base = (char *) data; - xcb_parts[8].iov_len = data_len * sizeof(uint8_t); - xcb_parts[9].iov_base = 0; - xcb_parts[9].iov_len = -xcb_parts[8].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_render_add_glyphs - ** - ** @param xcb_connection_t *c - ** @param xcb_render_glyphset_t glyphset - ** @param uint32_t glyphs_len - ** @param const uint32_t *glyphids - ** @param const xcb_render_glyphinfo_t *glyphs - ** @param uint32_t data_len - ** @param const uint8_t *data - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_add_glyphs (xcb_connection_t *c /**< */, - xcb_render_glyphset_t glyphset /**< */, - uint32_t glyphs_len /**< */, - const uint32_t *glyphids /**< */, - const xcb_render_glyphinfo_t *glyphs /**< */, - uint32_t data_len /**< */, - const uint8_t *data /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 8, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_ADD_GLYPHS, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[10]; - xcb_void_cookie_t xcb_ret; - xcb_render_add_glyphs_request_t xcb_out; - - xcb_out.glyphset = glyphset; - xcb_out.glyphs_len = glyphs_len; - - 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; - /* uint32_t glyphids */ - xcb_parts[4].iov_base = (char *) glyphids; - xcb_parts[4].iov_len = glyphs_len * sizeof(uint32_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - /* xcb_render_glyphinfo_t glyphs */ - xcb_parts[6].iov_base = (char *) glyphs; - xcb_parts[6].iov_len = glyphs_len * sizeof(xcb_render_glyphinfo_t); - xcb_parts[7].iov_base = 0; - xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3; - /* uint8_t data */ - xcb_parts[8].iov_base = (char *) data; - xcb_parts[8].iov_len = data_len * sizeof(uint8_t); - xcb_parts[9].iov_base = 0; - xcb_parts[9].iov_len = -xcb_parts[8].iov_len & 3; - - xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); - return xcb_ret; -} - -int -xcb_render_free_glyphs_sizeof (const void *_buffer /**< */, - uint32_t glyphs_len /**< */) -{ - char *xcb_tmp = (char *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_render_free_glyphs_request_t); - xcb_tmp += xcb_block_len; - /* glyphs */ - xcb_block_len += glyphs_len * sizeof(xcb_render_glyph_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_render_glyph_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_render_free_glyphs_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_render_glyphset_t glyphset - ** @param uint32_t glyphs_len - ** @param const xcb_render_glyph_t *glyphs - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_free_glyphs_checked (xcb_connection_t *c /**< */, - xcb_render_glyphset_t glyphset /**< */, - uint32_t glyphs_len /**< */, - const xcb_render_glyph_t *glyphs /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_FREE_GLYPHS, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_render_free_glyphs_request_t xcb_out; - - xcb_out.glyphset = glyphset; - - 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_render_glyph_t glyphs */ - xcb_parts[4].iov_base = (char *) glyphs; - xcb_parts[4].iov_len = glyphs_len * sizeof(xcb_render_glyph_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].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_render_free_glyphs - ** - ** @param xcb_connection_t *c - ** @param xcb_render_glyphset_t glyphset - ** @param uint32_t glyphs_len - ** @param const xcb_render_glyph_t *glyphs - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_free_glyphs (xcb_connection_t *c /**< */, - xcb_render_glyphset_t glyphset /**< */, - uint32_t glyphs_len /**< */, - const xcb_render_glyph_t *glyphs /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_FREE_GLYPHS, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_render_free_glyphs_request_t xcb_out; - - xcb_out.glyphset = glyphset; - - 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_render_glyph_t glyphs */ - xcb_parts[4].iov_base = (char *) glyphs; - xcb_parts[4].iov_len = glyphs_len * sizeof(xcb_render_glyph_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - - xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); - return xcb_ret; -} - -int -xcb_render_composite_glyphs_8_sizeof (const void *_buffer /**< */, - uint32_t glyphcmds_len /**< */) -{ - char *xcb_tmp = (char *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_render_composite_glyphs_8_request_t); - xcb_tmp += xcb_block_len; - /* glyphcmds */ - xcb_block_len += glyphcmds_len * sizeof(uint8_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(uint8_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_render_composite_glyphs_8_checked - ** - ** @param xcb_connection_t *c - ** @param uint8_t op - ** @param xcb_render_picture_t src - ** @param xcb_render_picture_t dst - ** @param xcb_render_pictformat_t mask_format - ** @param xcb_render_glyphset_t glyphset - ** @param int16_t src_x - ** @param int16_t src_y - ** @param uint32_t glyphcmds_len - ** @param const uint8_t *glyphcmds - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_composite_glyphs_8_checked (xcb_connection_t *c /**< */, - uint8_t op /**< */, - xcb_render_picture_t src /**< */, - xcb_render_picture_t dst /**< */, - xcb_render_pictformat_t mask_format /**< */, - xcb_render_glyphset_t glyphset /**< */, - int16_t src_x /**< */, - int16_t src_y /**< */, - uint32_t glyphcmds_len /**< */, - const uint8_t *glyphcmds /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_COMPOSITE_GLYPHS_8, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_render_composite_glyphs_8_request_t xcb_out; - - xcb_out.op = op; - memset(xcb_out.pad0, 0, 3); - xcb_out.src = src; - xcb_out.dst = dst; - xcb_out.mask_format = mask_format; - xcb_out.glyphset = glyphset; - xcb_out.src_x = src_x; - xcb_out.src_y = src_y; - - 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; - /* uint8_t glyphcmds */ - xcb_parts[4].iov_base = (char *) glyphcmds; - xcb_parts[4].iov_len = glyphcmds_len * sizeof(uint8_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].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_render_composite_glyphs_8 - ** - ** @param xcb_connection_t *c - ** @param uint8_t op - ** @param xcb_render_picture_t src - ** @param xcb_render_picture_t dst - ** @param xcb_render_pictformat_t mask_format - ** @param xcb_render_glyphset_t glyphset - ** @param int16_t src_x - ** @param int16_t src_y - ** @param uint32_t glyphcmds_len - ** @param const uint8_t *glyphcmds - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_composite_glyphs_8 (xcb_connection_t *c /**< */, - uint8_t op /**< */, - xcb_render_picture_t src /**< */, - xcb_render_picture_t dst /**< */, - xcb_render_pictformat_t mask_format /**< */, - xcb_render_glyphset_t glyphset /**< */, - int16_t src_x /**< */, - int16_t src_y /**< */, - uint32_t glyphcmds_len /**< */, - const uint8_t *glyphcmds /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_COMPOSITE_GLYPHS_8, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_render_composite_glyphs_8_request_t xcb_out; - - xcb_out.op = op; - memset(xcb_out.pad0, 0, 3); - xcb_out.src = src; - xcb_out.dst = dst; - xcb_out.mask_format = mask_format; - xcb_out.glyphset = glyphset; - xcb_out.src_x = src_x; - xcb_out.src_y = src_y; - - 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; - /* uint8_t glyphcmds */ - xcb_parts[4].iov_base = (char *) glyphcmds; - xcb_parts[4].iov_len = glyphcmds_len * sizeof(uint8_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - - xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); - return xcb_ret; -} - -int -xcb_render_composite_glyphs_16_sizeof (const void *_buffer /**< */, - uint32_t glyphcmds_len /**< */) -{ - char *xcb_tmp = (char *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_render_composite_glyphs_16_request_t); - xcb_tmp += xcb_block_len; - /* glyphcmds */ - xcb_block_len += glyphcmds_len * sizeof(uint8_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(uint8_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_render_composite_glyphs_16_checked - ** - ** @param xcb_connection_t *c - ** @param uint8_t op - ** @param xcb_render_picture_t src - ** @param xcb_render_picture_t dst - ** @param xcb_render_pictformat_t mask_format - ** @param xcb_render_glyphset_t glyphset - ** @param int16_t src_x - ** @param int16_t src_y - ** @param uint32_t glyphcmds_len - ** @param const uint8_t *glyphcmds - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_composite_glyphs_16_checked (xcb_connection_t *c /**< */, - uint8_t op /**< */, - xcb_render_picture_t src /**< */, - xcb_render_picture_t dst /**< */, - xcb_render_pictformat_t mask_format /**< */, - xcb_render_glyphset_t glyphset /**< */, - int16_t src_x /**< */, - int16_t src_y /**< */, - uint32_t glyphcmds_len /**< */, - const uint8_t *glyphcmds /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_COMPOSITE_GLYPHS_16, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_render_composite_glyphs_16_request_t xcb_out; - - xcb_out.op = op; - memset(xcb_out.pad0, 0, 3); - xcb_out.src = src; - xcb_out.dst = dst; - xcb_out.mask_format = mask_format; - xcb_out.glyphset = glyphset; - xcb_out.src_x = src_x; - xcb_out.src_y = src_y; - - 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; - /* uint8_t glyphcmds */ - xcb_parts[4].iov_base = (char *) glyphcmds; - xcb_parts[4].iov_len = glyphcmds_len * sizeof(uint8_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].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_render_composite_glyphs_16 - ** - ** @param xcb_connection_t *c - ** @param uint8_t op - ** @param xcb_render_picture_t src - ** @param xcb_render_picture_t dst - ** @param xcb_render_pictformat_t mask_format - ** @param xcb_render_glyphset_t glyphset - ** @param int16_t src_x - ** @param int16_t src_y - ** @param uint32_t glyphcmds_len - ** @param const uint8_t *glyphcmds - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_composite_glyphs_16 (xcb_connection_t *c /**< */, - uint8_t op /**< */, - xcb_render_picture_t src /**< */, - xcb_render_picture_t dst /**< */, - xcb_render_pictformat_t mask_format /**< */, - xcb_render_glyphset_t glyphset /**< */, - int16_t src_x /**< */, - int16_t src_y /**< */, - uint32_t glyphcmds_len /**< */, - const uint8_t *glyphcmds /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_COMPOSITE_GLYPHS_16, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_render_composite_glyphs_16_request_t xcb_out; - - xcb_out.op = op; - memset(xcb_out.pad0, 0, 3); - xcb_out.src = src; - xcb_out.dst = dst; - xcb_out.mask_format = mask_format; - xcb_out.glyphset = glyphset; - xcb_out.src_x = src_x; - xcb_out.src_y = src_y; - - 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; - /* uint8_t glyphcmds */ - xcb_parts[4].iov_base = (char *) glyphcmds; - xcb_parts[4].iov_len = glyphcmds_len * sizeof(uint8_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - - xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); - return xcb_ret; -} - -int -xcb_render_composite_glyphs_32_sizeof (const void *_buffer /**< */, - uint32_t glyphcmds_len /**< */) -{ - char *xcb_tmp = (char *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_render_composite_glyphs_32_request_t); - xcb_tmp += xcb_block_len; - /* glyphcmds */ - xcb_block_len += glyphcmds_len * sizeof(uint8_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(uint8_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_render_composite_glyphs_32_checked - ** - ** @param xcb_connection_t *c - ** @param uint8_t op - ** @param xcb_render_picture_t src - ** @param xcb_render_picture_t dst - ** @param xcb_render_pictformat_t mask_format - ** @param xcb_render_glyphset_t glyphset - ** @param int16_t src_x - ** @param int16_t src_y - ** @param uint32_t glyphcmds_len - ** @param const uint8_t *glyphcmds - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_composite_glyphs_32_checked (xcb_connection_t *c /**< */, - uint8_t op /**< */, - xcb_render_picture_t src /**< */, - xcb_render_picture_t dst /**< */, - xcb_render_pictformat_t mask_format /**< */, - xcb_render_glyphset_t glyphset /**< */, - int16_t src_x /**< */, - int16_t src_y /**< */, - uint32_t glyphcmds_len /**< */, - const uint8_t *glyphcmds /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_COMPOSITE_GLYPHS_32, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_render_composite_glyphs_32_request_t xcb_out; - - xcb_out.op = op; - memset(xcb_out.pad0, 0, 3); - xcb_out.src = src; - xcb_out.dst = dst; - xcb_out.mask_format = mask_format; - xcb_out.glyphset = glyphset; - xcb_out.src_x = src_x; - xcb_out.src_y = src_y; - - 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; - /* uint8_t glyphcmds */ - xcb_parts[4].iov_base = (char *) glyphcmds; - xcb_parts[4].iov_len = glyphcmds_len * sizeof(uint8_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].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_render_composite_glyphs_32 - ** - ** @param xcb_connection_t *c - ** @param uint8_t op - ** @param xcb_render_picture_t src - ** @param xcb_render_picture_t dst - ** @param xcb_render_pictformat_t mask_format - ** @param xcb_render_glyphset_t glyphset - ** @param int16_t src_x - ** @param int16_t src_y - ** @param uint32_t glyphcmds_len - ** @param const uint8_t *glyphcmds - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_composite_glyphs_32 (xcb_connection_t *c /**< */, - uint8_t op /**< */, - xcb_render_picture_t src /**< */, - xcb_render_picture_t dst /**< */, - xcb_render_pictformat_t mask_format /**< */, - xcb_render_glyphset_t glyphset /**< */, - int16_t src_x /**< */, - int16_t src_y /**< */, - uint32_t glyphcmds_len /**< */, - const uint8_t *glyphcmds /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_COMPOSITE_GLYPHS_32, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_render_composite_glyphs_32_request_t xcb_out; - - xcb_out.op = op; - memset(xcb_out.pad0, 0, 3); - xcb_out.src = src; - xcb_out.dst = dst; - xcb_out.mask_format = mask_format; - xcb_out.glyphset = glyphset; - xcb_out.src_x = src_x; - xcb_out.src_y = src_y; - - 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; - /* uint8_t glyphcmds */ - xcb_parts[4].iov_base = (char *) glyphcmds; - xcb_parts[4].iov_len = glyphcmds_len * sizeof(uint8_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - - xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); - return xcb_ret; -} - -int -xcb_render_fill_rectangles_sizeof (const void *_buffer /**< */, - uint32_t rects_len /**< */) -{ - char *xcb_tmp = (char *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_render_fill_rectangles_request_t); - xcb_tmp += xcb_block_len; - /* rects */ - xcb_block_len += rects_len * sizeof(xcb_rectangle_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_rectangle_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_render_fill_rectangles_checked - ** - ** @param xcb_connection_t *c - ** @param uint8_t op - ** @param xcb_render_picture_t dst - ** @param xcb_render_color_t color - ** @param uint32_t rects_len - ** @param const xcb_rectangle_t *rects - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_fill_rectangles_checked (xcb_connection_t *c /**< */, - uint8_t op /**< */, - xcb_render_picture_t dst /**< */, - xcb_render_color_t color /**< */, - uint32_t rects_len /**< */, - const xcb_rectangle_t *rects /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_FILL_RECTANGLES, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_render_fill_rectangles_request_t xcb_out; - - xcb_out.op = op; - memset(xcb_out.pad0, 0, 3); - xcb_out.dst = dst; - xcb_out.color = color; - - 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_rectangle_t rects */ - xcb_parts[4].iov_base = (char *) rects; - xcb_parts[4].iov_len = rects_len * sizeof(xcb_rectangle_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].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_render_fill_rectangles - ** - ** @param xcb_connection_t *c - ** @param uint8_t op - ** @param xcb_render_picture_t dst - ** @param xcb_render_color_t color - ** @param uint32_t rects_len - ** @param const xcb_rectangle_t *rects - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_fill_rectangles (xcb_connection_t *c /**< */, - uint8_t op /**< */, - xcb_render_picture_t dst /**< */, - xcb_render_color_t color /**< */, - uint32_t rects_len /**< */, - const xcb_rectangle_t *rects /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_FILL_RECTANGLES, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_render_fill_rectangles_request_t xcb_out; - - xcb_out.op = op; - memset(xcb_out.pad0, 0, 3); - xcb_out.dst = dst; - xcb_out.color = color; - - 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_rectangle_t rects */ - xcb_parts[4].iov_base = (char *) rects; - xcb_parts[4].iov_len = rects_len * sizeof(xcb_rectangle_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - - xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); - return xcb_ret; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_render_create_cursor_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_cursor_t cid - ** @param xcb_render_picture_t source - ** @param uint16_t x - ** @param uint16_t y - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_create_cursor_checked (xcb_connection_t *c /**< */, - xcb_cursor_t cid /**< */, - xcb_render_picture_t source /**< */, - uint16_t x /**< */, - uint16_t y /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_CREATE_CURSOR, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_render_create_cursor_request_t xcb_out; - - xcb_out.cid = cid; - xcb_out.source = source; - xcb_out.x = x; - xcb_out.y = y; - - 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_render_create_cursor - ** - ** @param xcb_connection_t *c - ** @param xcb_cursor_t cid - ** @param xcb_render_picture_t source - ** @param uint16_t x - ** @param uint16_t y - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_create_cursor (xcb_connection_t *c /**< */, - xcb_cursor_t cid /**< */, - xcb_render_picture_t source /**< */, - uint16_t x /**< */, - uint16_t y /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_CREATE_CURSOR, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_render_create_cursor_request_t xcb_out; - - xcb_out.cid = cid; - xcb_out.source = source; - xcb_out.x = x; - xcb_out.y = y; - - 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; -} - - -/***************************************************************************** - ** - ** void xcb_render_transform_next - ** - ** @param xcb_render_transform_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_render_transform_next (xcb_render_transform_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_render_transform_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_render_transform_end - ** - ** @param xcb_render_transform_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_render_transform_end (xcb_render_transform_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_render_set_picture_transform_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_render_picture_t picture - ** @param xcb_render_transform_t transform - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_set_picture_transform_checked (xcb_connection_t *c /**< */, - xcb_render_picture_t picture /**< */, - xcb_render_transform_t transform /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_SET_PICTURE_TRANSFORM, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_render_set_picture_transform_request_t xcb_out; - - xcb_out.picture = picture; - xcb_out.transform = transform; - - 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_render_set_picture_transform - ** - ** @param xcb_connection_t *c - ** @param xcb_render_picture_t picture - ** @param xcb_render_transform_t transform - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_set_picture_transform (xcb_connection_t *c /**< */, - xcb_render_picture_t picture /**< */, - xcb_render_transform_t transform /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_SET_PICTURE_TRANSFORM, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_render_set_picture_transform_request_t xcb_out; - - xcb_out.picture = picture; - xcb_out.transform = transform; - - 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; -} - -int -xcb_render_query_filters_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_render_query_filters_reply_t *_aux = (xcb_render_query_filters_reply_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - unsigned int i; - unsigned int xcb_tmp_len; - - xcb_block_len += sizeof(xcb_render_query_filters_reply_t); - xcb_tmp += xcb_block_len; - /* aliases */ - xcb_block_len += _aux->num_aliases * sizeof(uint16_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(uint16_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* filters */ - for(i=0; i<_aux->num_filters; i++) { - xcb_tmp_len = xcb_str_sizeof(xcb_tmp); - xcb_block_len += xcb_tmp_len; - xcb_tmp += xcb_tmp_len; - } - xcb_align_to = ALIGNOF(xcb_str_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_render_query_filters_cookie_t xcb_render_query_filters - ** - ** @param xcb_connection_t *c - ** @param xcb_drawable_t drawable - ** @returns xcb_render_query_filters_cookie_t - ** - *****************************************************************************/ - -xcb_render_query_filters_cookie_t -xcb_render_query_filters (xcb_connection_t *c /**< */, - xcb_drawable_t drawable /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_QUERY_FILTERS, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_render_query_filters_cookie_t xcb_ret; - xcb_render_query_filters_request_t xcb_out; - - xcb_out.drawable = drawable; - - 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_render_query_filters_cookie_t xcb_render_query_filters_unchecked - ** - ** @param xcb_connection_t *c - ** @param xcb_drawable_t drawable - ** @returns xcb_render_query_filters_cookie_t - ** - *****************************************************************************/ - -xcb_render_query_filters_cookie_t -xcb_render_query_filters_unchecked (xcb_connection_t *c /**< */, - xcb_drawable_t drawable /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_QUERY_FILTERS, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_render_query_filters_cookie_t xcb_ret; - xcb_render_query_filters_request_t xcb_out; - - xcb_out.drawable = drawable; - - 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; -} - - -/***************************************************************************** - ** - ** uint16_t * xcb_render_query_filters_aliases - ** - ** @param const xcb_render_query_filters_reply_t *R - ** @returns uint16_t * - ** - *****************************************************************************/ - -uint16_t * -xcb_render_query_filters_aliases (const xcb_render_query_filters_reply_t *R /**< */) -{ - return (uint16_t *) (R + 1); -} - - -/***************************************************************************** - ** - ** int xcb_render_query_filters_aliases_length - ** - ** @param const xcb_render_query_filters_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_render_query_filters_aliases_length (const xcb_render_query_filters_reply_t *R /**< */) -{ - return R->num_aliases; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_render_query_filters_aliases_end - ** - ** @param const xcb_render_query_filters_reply_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_render_query_filters_aliases_end (const xcb_render_query_filters_reply_t *R /**< */) -{ - xcb_generic_iterator_t i; - i.data = ((uint16_t *) (R + 1)) + (R->num_aliases); - i.rem = 0; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** int xcb_render_query_filters_filters_length - ** - ** @param const xcb_render_query_filters_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_render_query_filters_filters_length (const xcb_render_query_filters_reply_t *R /**< */) -{ - return R->num_filters; -} - - -/***************************************************************************** - ** - ** xcb_str_iterator_t xcb_render_query_filters_filters_iterator - ** - ** @param const xcb_render_query_filters_reply_t *R - ** @returns xcb_str_iterator_t - ** - *****************************************************************************/ - -xcb_str_iterator_t -xcb_render_query_filters_filters_iterator (const xcb_render_query_filters_reply_t *R /**< */) -{ - xcb_str_iterator_t i; - xcb_generic_iterator_t prev = xcb_render_query_filters_aliases_end(R); - i.data = (xcb_str_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_str_t, prev.index)); - i.rem = R->num_filters; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** xcb_render_query_filters_reply_t * xcb_render_query_filters_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_render_query_filters_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_render_query_filters_reply_t * - ** - *****************************************************************************/ - -xcb_render_query_filters_reply_t * -xcb_render_query_filters_reply (xcb_connection_t *c /**< */, - xcb_render_query_filters_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_render_query_filters_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - -int -xcb_render_set_picture_filter_sizeof (const void *_buffer /**< */, - uint32_t values_len /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_render_set_picture_filter_request_t *_aux = (xcb_render_set_picture_filter_request_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_render_set_picture_filter_request_t); - xcb_tmp += xcb_block_len; - /* filter */ - xcb_block_len += _aux->filter_len * sizeof(char); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(char); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* values */ - xcb_block_len += values_len * sizeof(xcb_render_fixed_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_render_fixed_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_render_set_picture_filter_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_render_picture_t picture - ** @param uint16_t filter_len - ** @param const char *filter - ** @param uint32_t values_len - ** @param const xcb_render_fixed_t *values - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_set_picture_filter_checked (xcb_connection_t *c /**< */, - xcb_render_picture_t picture /**< */, - uint16_t filter_len /**< */, - const char *filter /**< */, - uint32_t values_len /**< */, - const xcb_render_fixed_t *values /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 6, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_SET_PICTURE_FILTER, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[8]; - xcb_void_cookie_t xcb_ret; - xcb_render_set_picture_filter_request_t xcb_out; - - xcb_out.picture = picture; - xcb_out.filter_len = filter_len; - memset(xcb_out.pad0, 0, 2); - - 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; - /* char filter */ - xcb_parts[4].iov_base = (char *) filter; - xcb_parts[4].iov_len = filter_len * sizeof(char); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - /* xcb_render_fixed_t values */ - xcb_parts[6].iov_base = (char *) values; - xcb_parts[6].iov_len = values_len * sizeof(xcb_render_fixed_t); - xcb_parts[7].iov_base = 0; - xcb_parts[7].iov_len = -xcb_parts[6].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_render_set_picture_filter - ** - ** @param xcb_connection_t *c - ** @param xcb_render_picture_t picture - ** @param uint16_t filter_len - ** @param const char *filter - ** @param uint32_t values_len - ** @param const xcb_render_fixed_t *values - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_set_picture_filter (xcb_connection_t *c /**< */, - xcb_render_picture_t picture /**< */, - uint16_t filter_len /**< */, - const char *filter /**< */, - uint32_t values_len /**< */, - const xcb_render_fixed_t *values /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 6, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_SET_PICTURE_FILTER, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[8]; - xcb_void_cookie_t xcb_ret; - xcb_render_set_picture_filter_request_t xcb_out; - - xcb_out.picture = picture; - xcb_out.filter_len = filter_len; - memset(xcb_out.pad0, 0, 2); - - 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; - /* char filter */ - xcb_parts[4].iov_base = (char *) filter; - xcb_parts[4].iov_len = filter_len * sizeof(char); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - /* xcb_render_fixed_t values */ - xcb_parts[6].iov_base = (char *) values; - xcb_parts[6].iov_len = values_len * sizeof(xcb_render_fixed_t); - xcb_parts[7].iov_base = 0; - xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3; - - xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); - return xcb_ret; -} - - -/***************************************************************************** - ** - ** void xcb_render_animcursorelt_next - ** - ** @param xcb_render_animcursorelt_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_render_animcursorelt_next (xcb_render_animcursorelt_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_render_animcursorelt_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_render_animcursorelt_end - ** - ** @param xcb_render_animcursorelt_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_render_animcursorelt_end (xcb_render_animcursorelt_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - -int -xcb_render_create_anim_cursor_sizeof (const void *_buffer /**< */, - uint32_t cursors_len /**< */) -{ - char *xcb_tmp = (char *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_render_create_anim_cursor_request_t); - xcb_tmp += xcb_block_len; - /* cursors */ - xcb_block_len += cursors_len * sizeof(xcb_render_animcursorelt_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_render_animcursorelt_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_render_create_anim_cursor_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_cursor_t cid - ** @param uint32_t cursors_len - ** @param const xcb_render_animcursorelt_t *cursors - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_create_anim_cursor_checked (xcb_connection_t *c /**< */, - xcb_cursor_t cid /**< */, - uint32_t cursors_len /**< */, - const xcb_render_animcursorelt_t *cursors /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_CREATE_ANIM_CURSOR, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_render_create_anim_cursor_request_t xcb_out; - - xcb_out.cid = cid; - - 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_render_animcursorelt_t cursors */ - xcb_parts[4].iov_base = (char *) cursors; - xcb_parts[4].iov_len = cursors_len * sizeof(xcb_render_animcursorelt_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].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_render_create_anim_cursor - ** - ** @param xcb_connection_t *c - ** @param xcb_cursor_t cid - ** @param uint32_t cursors_len - ** @param const xcb_render_animcursorelt_t *cursors - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_create_anim_cursor (xcb_connection_t *c /**< */, - xcb_cursor_t cid /**< */, - uint32_t cursors_len /**< */, - const xcb_render_animcursorelt_t *cursors /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_CREATE_ANIM_CURSOR, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_render_create_anim_cursor_request_t xcb_out; - - xcb_out.cid = cid; - - 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_render_animcursorelt_t cursors */ - xcb_parts[4].iov_base = (char *) cursors; - xcb_parts[4].iov_len = cursors_len * sizeof(xcb_render_animcursorelt_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - - xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); - return xcb_ret; -} - - -/***************************************************************************** - ** - ** void xcb_render_spanfix_next - ** - ** @param xcb_render_spanfix_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_render_spanfix_next (xcb_render_spanfix_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_render_spanfix_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_render_spanfix_end - ** - ** @param xcb_render_spanfix_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_render_spanfix_end (xcb_render_spanfix_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_render_trap_next - ** - ** @param xcb_render_trap_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_render_trap_next (xcb_render_trap_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_render_trap_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_render_trap_end - ** - ** @param xcb_render_trap_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_render_trap_end (xcb_render_trap_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - -int -xcb_render_add_traps_sizeof (const void *_buffer /**< */, - uint32_t traps_len /**< */) -{ - char *xcb_tmp = (char *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_render_add_traps_request_t); - xcb_tmp += xcb_block_len; - /* traps */ - xcb_block_len += traps_len * sizeof(xcb_render_trap_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_render_trap_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_render_add_traps_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_render_picture_t picture - ** @param int16_t x_off - ** @param int16_t y_off - ** @param uint32_t traps_len - ** @param const xcb_render_trap_t *traps - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_add_traps_checked (xcb_connection_t *c /**< */, - xcb_render_picture_t picture /**< */, - int16_t x_off /**< */, - int16_t y_off /**< */, - uint32_t traps_len /**< */, - const xcb_render_trap_t *traps /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_ADD_TRAPS, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_render_add_traps_request_t xcb_out; - - xcb_out.picture = picture; - xcb_out.x_off = x_off; - xcb_out.y_off = y_off; - - 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_render_trap_t traps */ - xcb_parts[4].iov_base = (char *) traps; - xcb_parts[4].iov_len = traps_len * sizeof(xcb_render_trap_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].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_render_add_traps - ** - ** @param xcb_connection_t *c - ** @param xcb_render_picture_t picture - ** @param int16_t x_off - ** @param int16_t y_off - ** @param uint32_t traps_len - ** @param const xcb_render_trap_t *traps - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_add_traps (xcb_connection_t *c /**< */, - xcb_render_picture_t picture /**< */, - int16_t x_off /**< */, - int16_t y_off /**< */, - uint32_t traps_len /**< */, - const xcb_render_trap_t *traps /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_ADD_TRAPS, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_render_add_traps_request_t xcb_out; - - xcb_out.picture = picture; - xcb_out.x_off = x_off; - xcb_out.y_off = y_off; - - 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_render_trap_t traps */ - xcb_parts[4].iov_base = (char *) traps; - xcb_parts[4].iov_len = traps_len * sizeof(xcb_render_trap_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - - xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); - return xcb_ret; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_render_create_solid_fill_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_render_picture_t picture - ** @param xcb_render_color_t color - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_create_solid_fill_checked (xcb_connection_t *c /**< */, - xcb_render_picture_t picture /**< */, - xcb_render_color_t color /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_CREATE_SOLID_FILL, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_render_create_solid_fill_request_t xcb_out; - - xcb_out.picture = picture; - xcb_out.color = color; - - 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_render_create_solid_fill - ** - ** @param xcb_connection_t *c - ** @param xcb_render_picture_t picture - ** @param xcb_render_color_t color - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_create_solid_fill (xcb_connection_t *c /**< */, - xcb_render_picture_t picture /**< */, - xcb_render_color_t color /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_CREATE_SOLID_FILL, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_render_create_solid_fill_request_t xcb_out; - - xcb_out.picture = picture; - xcb_out.color = color; - - 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; -} - -int -xcb_render_create_linear_gradient_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_render_create_linear_gradient_request_t *_aux = (xcb_render_create_linear_gradient_request_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_render_create_linear_gradient_request_t); - xcb_tmp += xcb_block_len; - /* stops */ - xcb_block_len += _aux->num_stops * sizeof(xcb_render_fixed_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_render_fixed_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* colors */ - xcb_block_len += _aux->num_stops * sizeof(xcb_render_color_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_render_color_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_render_create_linear_gradient_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_render_picture_t picture - ** @param xcb_render_pointfix_t p1 - ** @param xcb_render_pointfix_t p2 - ** @param uint32_t num_stops - ** @param const xcb_render_fixed_t *stops - ** @param const xcb_render_color_t *colors - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_create_linear_gradient_checked (xcb_connection_t *c /**< */, - xcb_render_picture_t picture /**< */, - xcb_render_pointfix_t p1 /**< */, - xcb_render_pointfix_t p2 /**< */, - uint32_t num_stops /**< */, - const xcb_render_fixed_t *stops /**< */, - const xcb_render_color_t *colors /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 6, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_CREATE_LINEAR_GRADIENT, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[8]; - xcb_void_cookie_t xcb_ret; - xcb_render_create_linear_gradient_request_t xcb_out; - - xcb_out.picture = picture; - xcb_out.p1 = p1; - xcb_out.p2 = p2; - xcb_out.num_stops = num_stops; - - 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_render_fixed_t stops */ - xcb_parts[4].iov_base = (char *) stops; - xcb_parts[4].iov_len = num_stops * sizeof(xcb_render_fixed_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - /* xcb_render_color_t colors */ - xcb_parts[6].iov_base = (char *) colors; - xcb_parts[6].iov_len = num_stops * sizeof(xcb_render_color_t); - xcb_parts[7].iov_base = 0; - xcb_parts[7].iov_len = -xcb_parts[6].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_render_create_linear_gradient - ** - ** @param xcb_connection_t *c - ** @param xcb_render_picture_t picture - ** @param xcb_render_pointfix_t p1 - ** @param xcb_render_pointfix_t p2 - ** @param uint32_t num_stops - ** @param const xcb_render_fixed_t *stops - ** @param const xcb_render_color_t *colors - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_create_linear_gradient (xcb_connection_t *c /**< */, - xcb_render_picture_t picture /**< */, - xcb_render_pointfix_t p1 /**< */, - xcb_render_pointfix_t p2 /**< */, - uint32_t num_stops /**< */, - const xcb_render_fixed_t *stops /**< */, - const xcb_render_color_t *colors /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 6, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_CREATE_LINEAR_GRADIENT, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[8]; - xcb_void_cookie_t xcb_ret; - xcb_render_create_linear_gradient_request_t xcb_out; - - xcb_out.picture = picture; - xcb_out.p1 = p1; - xcb_out.p2 = p2; - xcb_out.num_stops = num_stops; - - 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_render_fixed_t stops */ - xcb_parts[4].iov_base = (char *) stops; - xcb_parts[4].iov_len = num_stops * sizeof(xcb_render_fixed_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - /* xcb_render_color_t colors */ - xcb_parts[6].iov_base = (char *) colors; - xcb_parts[6].iov_len = num_stops * sizeof(xcb_render_color_t); - xcb_parts[7].iov_base = 0; - xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3; - - xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); - return xcb_ret; -} - -int -xcb_render_create_radial_gradient_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_render_create_radial_gradient_request_t *_aux = (xcb_render_create_radial_gradient_request_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_render_create_radial_gradient_request_t); - xcb_tmp += xcb_block_len; - /* stops */ - xcb_block_len += _aux->num_stops * sizeof(xcb_render_fixed_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_render_fixed_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* colors */ - xcb_block_len += _aux->num_stops * sizeof(xcb_render_color_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_render_color_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_render_create_radial_gradient_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_render_picture_t picture - ** @param xcb_render_pointfix_t inner - ** @param xcb_render_pointfix_t outer - ** @param xcb_render_fixed_t inner_radius - ** @param xcb_render_fixed_t outer_radius - ** @param uint32_t num_stops - ** @param const xcb_render_fixed_t *stops - ** @param const xcb_render_color_t *colors - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_create_radial_gradient_checked (xcb_connection_t *c /**< */, - xcb_render_picture_t picture /**< */, - xcb_render_pointfix_t inner /**< */, - xcb_render_pointfix_t outer /**< */, - xcb_render_fixed_t inner_radius /**< */, - xcb_render_fixed_t outer_radius /**< */, - uint32_t num_stops /**< */, - const xcb_render_fixed_t *stops /**< */, - const xcb_render_color_t *colors /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 6, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_CREATE_RADIAL_GRADIENT, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[8]; - xcb_void_cookie_t xcb_ret; - xcb_render_create_radial_gradient_request_t xcb_out; - - xcb_out.picture = picture; - xcb_out.inner = inner; - xcb_out.outer = outer; - xcb_out.inner_radius = inner_radius; - xcb_out.outer_radius = outer_radius; - xcb_out.num_stops = num_stops; - - 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_render_fixed_t stops */ - xcb_parts[4].iov_base = (char *) stops; - xcb_parts[4].iov_len = num_stops * sizeof(xcb_render_fixed_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - /* xcb_render_color_t colors */ - xcb_parts[6].iov_base = (char *) colors; - xcb_parts[6].iov_len = num_stops * sizeof(xcb_render_color_t); - xcb_parts[7].iov_base = 0; - xcb_parts[7].iov_len = -xcb_parts[6].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_render_create_radial_gradient - ** - ** @param xcb_connection_t *c - ** @param xcb_render_picture_t picture - ** @param xcb_render_pointfix_t inner - ** @param xcb_render_pointfix_t outer - ** @param xcb_render_fixed_t inner_radius - ** @param xcb_render_fixed_t outer_radius - ** @param uint32_t num_stops - ** @param const xcb_render_fixed_t *stops - ** @param const xcb_render_color_t *colors - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_create_radial_gradient (xcb_connection_t *c /**< */, - xcb_render_picture_t picture /**< */, - xcb_render_pointfix_t inner /**< */, - xcb_render_pointfix_t outer /**< */, - xcb_render_fixed_t inner_radius /**< */, - xcb_render_fixed_t outer_radius /**< */, - uint32_t num_stops /**< */, - const xcb_render_fixed_t *stops /**< */, - const xcb_render_color_t *colors /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 6, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_CREATE_RADIAL_GRADIENT, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[8]; - xcb_void_cookie_t xcb_ret; - xcb_render_create_radial_gradient_request_t xcb_out; - - xcb_out.picture = picture; - xcb_out.inner = inner; - xcb_out.outer = outer; - xcb_out.inner_radius = inner_radius; - xcb_out.outer_radius = outer_radius; - xcb_out.num_stops = num_stops; - - 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_render_fixed_t stops */ - xcb_parts[4].iov_base = (char *) stops; - xcb_parts[4].iov_len = num_stops * sizeof(xcb_render_fixed_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - /* xcb_render_color_t colors */ - xcb_parts[6].iov_base = (char *) colors; - xcb_parts[6].iov_len = num_stops * sizeof(xcb_render_color_t); - xcb_parts[7].iov_base = 0; - xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3; - - xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); - return xcb_ret; -} - -int -xcb_render_create_conical_gradient_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_render_create_conical_gradient_request_t *_aux = (xcb_render_create_conical_gradient_request_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_render_create_conical_gradient_request_t); - xcb_tmp += xcb_block_len; - /* stops */ - xcb_block_len += _aux->num_stops * sizeof(xcb_render_fixed_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_render_fixed_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* colors */ - xcb_block_len += _aux->num_stops * sizeof(xcb_render_color_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_render_color_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_render_create_conical_gradient_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_render_picture_t picture - ** @param xcb_render_pointfix_t center - ** @param xcb_render_fixed_t angle - ** @param uint32_t num_stops - ** @param const xcb_render_fixed_t *stops - ** @param const xcb_render_color_t *colors - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_create_conical_gradient_checked (xcb_connection_t *c /**< */, - xcb_render_picture_t picture /**< */, - xcb_render_pointfix_t center /**< */, - xcb_render_fixed_t angle /**< */, - uint32_t num_stops /**< */, - const xcb_render_fixed_t *stops /**< */, - const xcb_render_color_t *colors /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 6, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_CREATE_CONICAL_GRADIENT, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[8]; - xcb_void_cookie_t xcb_ret; - xcb_render_create_conical_gradient_request_t xcb_out; - - xcb_out.picture = picture; - xcb_out.center = center; - xcb_out.angle = angle; - xcb_out.num_stops = num_stops; - - 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_render_fixed_t stops */ - xcb_parts[4].iov_base = (char *) stops; - xcb_parts[4].iov_len = num_stops * sizeof(xcb_render_fixed_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - /* xcb_render_color_t colors */ - xcb_parts[6].iov_base = (char *) colors; - xcb_parts[6].iov_len = num_stops * sizeof(xcb_render_color_t); - xcb_parts[7].iov_base = 0; - xcb_parts[7].iov_len = -xcb_parts[6].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_render_create_conical_gradient - ** - ** @param xcb_connection_t *c - ** @param xcb_render_picture_t picture - ** @param xcb_render_pointfix_t center - ** @param xcb_render_fixed_t angle - ** @param uint32_t num_stops - ** @param const xcb_render_fixed_t *stops - ** @param const xcb_render_color_t *colors - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_render_create_conical_gradient (xcb_connection_t *c /**< */, - xcb_render_picture_t picture /**< */, - xcb_render_pointfix_t center /**< */, - xcb_render_fixed_t angle /**< */, - uint32_t num_stops /**< */, - const xcb_render_fixed_t *stops /**< */, - const xcb_render_color_t *colors /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 6, - /* ext */ &xcb_render_id, - /* opcode */ XCB_RENDER_CREATE_CONICAL_GRADIENT, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[8]; - xcb_void_cookie_t xcb_ret; - xcb_render_create_conical_gradient_request_t xcb_out; - - xcb_out.picture = picture; - xcb_out.center = center; - xcb_out.angle = angle; - xcb_out.num_stops = num_stops; - - 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_render_fixed_t stops */ - xcb_parts[4].iov_base = (char *) stops; - xcb_parts[4].iov_len = num_stops * sizeof(xcb_render_fixed_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - /* xcb_render_color_t colors */ - xcb_parts[6].iov_base = (char *) colors; - xcb_parts[6].iov_len = num_stops * sizeof(xcb_render_color_t); - xcb_parts[7].iov_base = 0; - xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3; - - xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); - return xcb_ret; -} - diff --git a/src/3rdparty/xcb/libxcb/shape.c b/src/3rdparty/xcb/libxcb/shape.c deleted file mode 100644 index 98621c4983..0000000000 --- a/src/3rdparty/xcb/libxcb/shape.c +++ /dev/null @@ -1,1102 +0,0 @@ -/* - * This file generated automatically from shape.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 "shape.h" - -#define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member) -#include "xproto.h" - -xcb_extension_t xcb_shape_id = { "SHAPE", 0 }; - - -/***************************************************************************** - ** - ** void xcb_shape_op_next - ** - ** @param xcb_shape_op_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_shape_op_next (xcb_shape_op_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_shape_op_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_shape_op_end - ** - ** @param xcb_shape_op_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_shape_op_end (xcb_shape_op_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_shape_kind_next - ** - ** @param xcb_shape_kind_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_shape_kind_next (xcb_shape_kind_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_shape_kind_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_shape_kind_end - ** - ** @param xcb_shape_kind_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_shape_kind_end (xcb_shape_kind_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** xcb_shape_query_version_cookie_t xcb_shape_query_version - ** - ** @param xcb_connection_t *c - ** @returns xcb_shape_query_version_cookie_t - ** - *****************************************************************************/ - -xcb_shape_query_version_cookie_t -xcb_shape_query_version (xcb_connection_t *c /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_shape_id, - /* opcode */ XCB_SHAPE_QUERY_VERSION, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_shape_query_version_cookie_t xcb_ret; - xcb_shape_query_version_request_t xcb_out; - - - 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_shape_query_version_cookie_t xcb_shape_query_version_unchecked - ** - ** @param xcb_connection_t *c - ** @returns xcb_shape_query_version_cookie_t - ** - *****************************************************************************/ - -xcb_shape_query_version_cookie_t -xcb_shape_query_version_unchecked (xcb_connection_t *c /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_shape_id, - /* opcode */ XCB_SHAPE_QUERY_VERSION, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_shape_query_version_cookie_t xcb_ret; - xcb_shape_query_version_request_t xcb_out; - - - 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_shape_query_version_reply_t * xcb_shape_query_version_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_shape_query_version_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_shape_query_version_reply_t * - ** - *****************************************************************************/ - -xcb_shape_query_version_reply_t * -xcb_shape_query_version_reply (xcb_connection_t *c /**< */, - xcb_shape_query_version_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_shape_query_version_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - -int -xcb_shape_rectangles_sizeof (const void *_buffer /**< */, - uint32_t rectangles_len /**< */) -{ - char *xcb_tmp = (char *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_shape_rectangles_request_t); - xcb_tmp += xcb_block_len; - /* rectangles */ - xcb_block_len += rectangles_len * sizeof(xcb_rectangle_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_rectangle_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_shape_rectangles_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_shape_op_t operation - ** @param xcb_shape_kind_t destination_kind - ** @param uint8_t ordering - ** @param xcb_window_t destination_window - ** @param int16_t x_offset - ** @param int16_t y_offset - ** @param uint32_t rectangles_len - ** @param const xcb_rectangle_t *rectangles - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_shape_rectangles_checked (xcb_connection_t *c /**< */, - xcb_shape_op_t operation /**< */, - xcb_shape_kind_t destination_kind /**< */, - uint8_t ordering /**< */, - xcb_window_t destination_window /**< */, - int16_t x_offset /**< */, - int16_t y_offset /**< */, - uint32_t rectangles_len /**< */, - const xcb_rectangle_t *rectangles /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_shape_id, - /* opcode */ XCB_SHAPE_RECTANGLES, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_shape_rectangles_request_t xcb_out; - - xcb_out.operation = operation; - xcb_out.destination_kind = destination_kind; - xcb_out.ordering = ordering; - xcb_out.pad0 = 0; - xcb_out.destination_window = destination_window; - xcb_out.x_offset = x_offset; - xcb_out.y_offset = y_offset; - - 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_rectangle_t rectangles */ - xcb_parts[4].iov_base = (char *) rectangles; - xcb_parts[4].iov_len = rectangles_len * sizeof(xcb_rectangle_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].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_shape_rectangles - ** - ** @param xcb_connection_t *c - ** @param xcb_shape_op_t operation - ** @param xcb_shape_kind_t destination_kind - ** @param uint8_t ordering - ** @param xcb_window_t destination_window - ** @param int16_t x_offset - ** @param int16_t y_offset - ** @param uint32_t rectangles_len - ** @param const xcb_rectangle_t *rectangles - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_shape_rectangles (xcb_connection_t *c /**< */, - xcb_shape_op_t operation /**< */, - xcb_shape_kind_t destination_kind /**< */, - uint8_t ordering /**< */, - xcb_window_t destination_window /**< */, - int16_t x_offset /**< */, - int16_t y_offset /**< */, - uint32_t rectangles_len /**< */, - const xcb_rectangle_t *rectangles /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_shape_id, - /* opcode */ XCB_SHAPE_RECTANGLES, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_shape_rectangles_request_t xcb_out; - - xcb_out.operation = operation; - xcb_out.destination_kind = destination_kind; - xcb_out.ordering = ordering; - xcb_out.pad0 = 0; - xcb_out.destination_window = destination_window; - xcb_out.x_offset = x_offset; - xcb_out.y_offset = y_offset; - - 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_rectangle_t rectangles */ - xcb_parts[4].iov_base = (char *) rectangles; - xcb_parts[4].iov_len = rectangles_len * sizeof(xcb_rectangle_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - - xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); - return xcb_ret; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_shape_mask_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_shape_op_t operation - ** @param xcb_shape_kind_t destination_kind - ** @param xcb_window_t destination_window - ** @param int16_t x_offset - ** @param int16_t y_offset - ** @param xcb_pixmap_t source_bitmap - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_shape_mask_checked (xcb_connection_t *c /**< */, - xcb_shape_op_t operation /**< */, - xcb_shape_kind_t destination_kind /**< */, - xcb_window_t destination_window /**< */, - int16_t x_offset /**< */, - int16_t y_offset /**< */, - xcb_pixmap_t source_bitmap /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_shape_id, - /* opcode */ XCB_SHAPE_MASK, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_shape_mask_request_t xcb_out; - - xcb_out.operation = operation; - xcb_out.destination_kind = destination_kind; - memset(xcb_out.pad0, 0, 2); - xcb_out.destination_window = destination_window; - xcb_out.x_offset = x_offset; - xcb_out.y_offset = y_offset; - xcb_out.source_bitmap = source_bitmap; - - 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_shape_mask - ** - ** @param xcb_connection_t *c - ** @param xcb_shape_op_t operation - ** @param xcb_shape_kind_t destination_kind - ** @param xcb_window_t destination_window - ** @param int16_t x_offset - ** @param int16_t y_offset - ** @param xcb_pixmap_t source_bitmap - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_shape_mask (xcb_connection_t *c /**< */, - xcb_shape_op_t operation /**< */, - xcb_shape_kind_t destination_kind /**< */, - xcb_window_t destination_window /**< */, - int16_t x_offset /**< */, - int16_t y_offset /**< */, - xcb_pixmap_t source_bitmap /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_shape_id, - /* opcode */ XCB_SHAPE_MASK, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_shape_mask_request_t xcb_out; - - xcb_out.operation = operation; - xcb_out.destination_kind = destination_kind; - memset(xcb_out.pad0, 0, 2); - xcb_out.destination_window = destination_window; - xcb_out.x_offset = x_offset; - xcb_out.y_offset = y_offset; - xcb_out.source_bitmap = source_bitmap; - - 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_shape_combine_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_shape_op_t operation - ** @param xcb_shape_kind_t destination_kind - ** @param xcb_shape_kind_t source_kind - ** @param xcb_window_t destination_window - ** @param int16_t x_offset - ** @param int16_t y_offset - ** @param xcb_window_t source_window - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_shape_combine_checked (xcb_connection_t *c /**< */, - xcb_shape_op_t operation /**< */, - xcb_shape_kind_t destination_kind /**< */, - xcb_shape_kind_t source_kind /**< */, - xcb_window_t destination_window /**< */, - int16_t x_offset /**< */, - int16_t y_offset /**< */, - xcb_window_t source_window /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_shape_id, - /* opcode */ XCB_SHAPE_COMBINE, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_shape_combine_request_t xcb_out; - - xcb_out.operation = operation; - xcb_out.destination_kind = destination_kind; - xcb_out.source_kind = source_kind; - xcb_out.pad0 = 0; - xcb_out.destination_window = destination_window; - xcb_out.x_offset = x_offset; - xcb_out.y_offset = y_offset; - xcb_out.source_window = source_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_shape_combine - ** - ** @param xcb_connection_t *c - ** @param xcb_shape_op_t operation - ** @param xcb_shape_kind_t destination_kind - ** @param xcb_shape_kind_t source_kind - ** @param xcb_window_t destination_window - ** @param int16_t x_offset - ** @param int16_t y_offset - ** @param xcb_window_t source_window - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_shape_combine (xcb_connection_t *c /**< */, - xcb_shape_op_t operation /**< */, - xcb_shape_kind_t destination_kind /**< */, - xcb_shape_kind_t source_kind /**< */, - xcb_window_t destination_window /**< */, - int16_t x_offset /**< */, - int16_t y_offset /**< */, - xcb_window_t source_window /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_shape_id, - /* opcode */ XCB_SHAPE_COMBINE, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_shape_combine_request_t xcb_out; - - xcb_out.operation = operation; - xcb_out.destination_kind = destination_kind; - xcb_out.source_kind = source_kind; - xcb_out.pad0 = 0; - xcb_out.destination_window = destination_window; - xcb_out.x_offset = x_offset; - xcb_out.y_offset = y_offset; - xcb_out.source_window = source_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_shape_offset_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_shape_kind_t destination_kind - ** @param xcb_window_t destination_window - ** @param int16_t x_offset - ** @param int16_t y_offset - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_shape_offset_checked (xcb_connection_t *c /**< */, - xcb_shape_kind_t destination_kind /**< */, - xcb_window_t destination_window /**< */, - int16_t x_offset /**< */, - int16_t y_offset /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_shape_id, - /* opcode */ XCB_SHAPE_OFFSET, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_shape_offset_request_t xcb_out; - - xcb_out.destination_kind = destination_kind; - memset(xcb_out.pad0, 0, 3); - xcb_out.destination_window = destination_window; - xcb_out.x_offset = x_offset; - xcb_out.y_offset = y_offset; - - 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_shape_offset - ** - ** @param xcb_connection_t *c - ** @param xcb_shape_kind_t destination_kind - ** @param xcb_window_t destination_window - ** @param int16_t x_offset - ** @param int16_t y_offset - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_shape_offset (xcb_connection_t *c /**< */, - xcb_shape_kind_t destination_kind /**< */, - xcb_window_t destination_window /**< */, - int16_t x_offset /**< */, - int16_t y_offset /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_shape_id, - /* opcode */ XCB_SHAPE_OFFSET, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_shape_offset_request_t xcb_out; - - xcb_out.destination_kind = destination_kind; - memset(xcb_out.pad0, 0, 3); - xcb_out.destination_window = destination_window; - xcb_out.x_offset = x_offset; - xcb_out.y_offset = y_offset; - - 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_shape_query_extents_cookie_t xcb_shape_query_extents - ** - ** @param xcb_connection_t *c - ** @param xcb_window_t destination_window - ** @returns xcb_shape_query_extents_cookie_t - ** - *****************************************************************************/ - -xcb_shape_query_extents_cookie_t -xcb_shape_query_extents (xcb_connection_t *c /**< */, - xcb_window_t destination_window /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_shape_id, - /* opcode */ XCB_SHAPE_QUERY_EXTENTS, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_shape_query_extents_cookie_t xcb_ret; - xcb_shape_query_extents_request_t xcb_out; - - xcb_out.destination_window = destination_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_shape_query_extents_cookie_t xcb_shape_query_extents_unchecked - ** - ** @param xcb_connection_t *c - ** @param xcb_window_t destination_window - ** @returns xcb_shape_query_extents_cookie_t - ** - *****************************************************************************/ - -xcb_shape_query_extents_cookie_t -xcb_shape_query_extents_unchecked (xcb_connection_t *c /**< */, - xcb_window_t destination_window /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_shape_id, - /* opcode */ XCB_SHAPE_QUERY_EXTENTS, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_shape_query_extents_cookie_t xcb_ret; - xcb_shape_query_extents_request_t xcb_out; - - xcb_out.destination_window = destination_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_shape_query_extents_reply_t * xcb_shape_query_extents_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_shape_query_extents_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_shape_query_extents_reply_t * - ** - *****************************************************************************/ - -xcb_shape_query_extents_reply_t * -xcb_shape_query_extents_reply (xcb_connection_t *c /**< */, - xcb_shape_query_extents_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_shape_query_extents_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_shape_select_input_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_window_t destination_window - ** @param uint8_t enable - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_shape_select_input_checked (xcb_connection_t *c /**< */, - xcb_window_t destination_window /**< */, - uint8_t enable /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_shape_id, - /* opcode */ XCB_SHAPE_SELECT_INPUT, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_shape_select_input_request_t xcb_out; - - xcb_out.destination_window = destination_window; - xcb_out.enable = enable; - 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_shape_select_input - ** - ** @param xcb_connection_t *c - ** @param xcb_window_t destination_window - ** @param uint8_t enable - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_shape_select_input (xcb_connection_t *c /**< */, - xcb_window_t destination_window /**< */, - uint8_t enable /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_shape_id, - /* opcode */ XCB_SHAPE_SELECT_INPUT, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_shape_select_input_request_t xcb_out; - - xcb_out.destination_window = destination_window; - xcb_out.enable = enable; - 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_shape_input_selected_cookie_t xcb_shape_input_selected - ** - ** @param xcb_connection_t *c - ** @param xcb_window_t destination_window - ** @returns xcb_shape_input_selected_cookie_t - ** - *****************************************************************************/ - -xcb_shape_input_selected_cookie_t -xcb_shape_input_selected (xcb_connection_t *c /**< */, - xcb_window_t destination_window /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_shape_id, - /* opcode */ XCB_SHAPE_INPUT_SELECTED, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_shape_input_selected_cookie_t xcb_ret; - xcb_shape_input_selected_request_t xcb_out; - - xcb_out.destination_window = destination_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_shape_input_selected_cookie_t xcb_shape_input_selected_unchecked - ** - ** @param xcb_connection_t *c - ** @param xcb_window_t destination_window - ** @returns xcb_shape_input_selected_cookie_t - ** - *****************************************************************************/ - -xcb_shape_input_selected_cookie_t -xcb_shape_input_selected_unchecked (xcb_connection_t *c /**< */, - xcb_window_t destination_window /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_shape_id, - /* opcode */ XCB_SHAPE_INPUT_SELECTED, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_shape_input_selected_cookie_t xcb_ret; - xcb_shape_input_selected_request_t xcb_out; - - xcb_out.destination_window = destination_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_shape_input_selected_reply_t * xcb_shape_input_selected_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_shape_input_selected_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_shape_input_selected_reply_t * - ** - *****************************************************************************/ - -xcb_shape_input_selected_reply_t * -xcb_shape_input_selected_reply (xcb_connection_t *c /**< */, - xcb_shape_input_selected_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_shape_input_selected_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - -int -xcb_shape_get_rectangles_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_shape_get_rectangles_reply_t *_aux = (xcb_shape_get_rectangles_reply_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_shape_get_rectangles_reply_t); - xcb_tmp += xcb_block_len; - /* rectangles */ - xcb_block_len += _aux->rectangles_len * sizeof(xcb_rectangle_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_rectangle_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_shape_get_rectangles_cookie_t xcb_shape_get_rectangles - ** - ** @param xcb_connection_t *c - ** @param xcb_window_t window - ** @param xcb_shape_kind_t source_kind - ** @returns xcb_shape_get_rectangles_cookie_t - ** - *****************************************************************************/ - -xcb_shape_get_rectangles_cookie_t -xcb_shape_get_rectangles (xcb_connection_t *c /**< */, - xcb_window_t window /**< */, - xcb_shape_kind_t source_kind /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_shape_id, - /* opcode */ XCB_SHAPE_GET_RECTANGLES, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_shape_get_rectangles_cookie_t xcb_ret; - xcb_shape_get_rectangles_request_t xcb_out; - - xcb_out.window = window; - xcb_out.source_kind = source_kind; - 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_shape_get_rectangles_cookie_t xcb_shape_get_rectangles_unchecked - ** - ** @param xcb_connection_t *c - ** @param xcb_window_t window - ** @param xcb_shape_kind_t source_kind - ** @returns xcb_shape_get_rectangles_cookie_t - ** - *****************************************************************************/ - -xcb_shape_get_rectangles_cookie_t -xcb_shape_get_rectangles_unchecked (xcb_connection_t *c /**< */, - xcb_window_t window /**< */, - xcb_shape_kind_t source_kind /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_shape_id, - /* opcode */ XCB_SHAPE_GET_RECTANGLES, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_shape_get_rectangles_cookie_t xcb_ret; - xcb_shape_get_rectangles_request_t xcb_out; - - xcb_out.window = window; - xcb_out.source_kind = source_kind; - 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_rectangle_t * xcb_shape_get_rectangles_rectangles - ** - ** @param const xcb_shape_get_rectangles_reply_t *R - ** @returns xcb_rectangle_t * - ** - *****************************************************************************/ - -xcb_rectangle_t * -xcb_shape_get_rectangles_rectangles (const xcb_shape_get_rectangles_reply_t *R /**< */) -{ - return (xcb_rectangle_t *) (R + 1); -} - - -/***************************************************************************** - ** - ** int xcb_shape_get_rectangles_rectangles_length - ** - ** @param const xcb_shape_get_rectangles_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_shape_get_rectangles_rectangles_length (const xcb_shape_get_rectangles_reply_t *R /**< */) -{ - return R->rectangles_len; -} - - -/***************************************************************************** - ** - ** xcb_rectangle_iterator_t xcb_shape_get_rectangles_rectangles_iterator - ** - ** @param const xcb_shape_get_rectangles_reply_t *R - ** @returns xcb_rectangle_iterator_t - ** - *****************************************************************************/ - -xcb_rectangle_iterator_t -xcb_shape_get_rectangles_rectangles_iterator (const xcb_shape_get_rectangles_reply_t *R /**< */) -{ - xcb_rectangle_iterator_t i; - i.data = (xcb_rectangle_t *) (R + 1); - i.rem = R->rectangles_len; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** xcb_shape_get_rectangles_reply_t * xcb_shape_get_rectangles_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_shape_get_rectangles_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_shape_get_rectangles_reply_t * - ** - *****************************************************************************/ - -xcb_shape_get_rectangles_reply_t * -xcb_shape_get_rectangles_reply (xcb_connection_t *c /**< */, - xcb_shape_get_rectangles_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_shape_get_rectangles_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - diff --git a/src/3rdparty/xcb/libxcb/shm.c b/src/3rdparty/xcb/libxcb/shm.c deleted file mode 100644 index 0a1c238732..0000000000 --- a/src/3rdparty/xcb/libxcb/shm.c +++ /dev/null @@ -1,724 +0,0 @@ -/* - * This file generated automatically from shm.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 "shm.h" - -#define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member) -#include "xproto.h" - -xcb_extension_t xcb_shm_id = { "MIT-SHM", 0 }; - - -/***************************************************************************** - ** - ** void xcb_shm_seg_next - ** - ** @param xcb_shm_seg_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_shm_seg_next (xcb_shm_seg_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_shm_seg_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_shm_seg_end - ** - ** @param xcb_shm_seg_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_shm_seg_end (xcb_shm_seg_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** xcb_shm_query_version_cookie_t xcb_shm_query_version - ** - ** @param xcb_connection_t *c - ** @returns xcb_shm_query_version_cookie_t - ** - *****************************************************************************/ - -xcb_shm_query_version_cookie_t -xcb_shm_query_version (xcb_connection_t *c /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_shm_id, - /* opcode */ XCB_SHM_QUERY_VERSION, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_shm_query_version_cookie_t xcb_ret; - xcb_shm_query_version_request_t xcb_out; - - - 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_shm_query_version_cookie_t xcb_shm_query_version_unchecked - ** - ** @param xcb_connection_t *c - ** @returns xcb_shm_query_version_cookie_t - ** - *****************************************************************************/ - -xcb_shm_query_version_cookie_t -xcb_shm_query_version_unchecked (xcb_connection_t *c /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_shm_id, - /* opcode */ XCB_SHM_QUERY_VERSION, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_shm_query_version_cookie_t xcb_ret; - xcb_shm_query_version_request_t xcb_out; - - - 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_shm_query_version_reply_t * xcb_shm_query_version_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_shm_query_version_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_shm_query_version_reply_t * - ** - *****************************************************************************/ - -xcb_shm_query_version_reply_t * -xcb_shm_query_version_reply (xcb_connection_t *c /**< */, - xcb_shm_query_version_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_shm_query_version_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_shm_attach_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_shm_seg_t shmseg - ** @param uint32_t shmid - ** @param uint8_t read_only - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_shm_attach_checked (xcb_connection_t *c /**< */, - xcb_shm_seg_t shmseg /**< */, - uint32_t shmid /**< */, - uint8_t read_only /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_shm_id, - /* opcode */ XCB_SHM_ATTACH, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_shm_attach_request_t xcb_out; - - xcb_out.shmseg = shmseg; - xcb_out.shmid = shmid; - xcb_out.read_only = read_only; - 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_shm_attach - ** - ** @param xcb_connection_t *c - ** @param xcb_shm_seg_t shmseg - ** @param uint32_t shmid - ** @param uint8_t read_only - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_shm_attach (xcb_connection_t *c /**< */, - xcb_shm_seg_t shmseg /**< */, - uint32_t shmid /**< */, - uint8_t read_only /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_shm_id, - /* opcode */ XCB_SHM_ATTACH, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_shm_attach_request_t xcb_out; - - xcb_out.shmseg = shmseg; - xcb_out.shmid = shmid; - xcb_out.read_only = read_only; - 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_shm_detach_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_shm_seg_t shmseg - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_shm_detach_checked (xcb_connection_t *c /**< */, - xcb_shm_seg_t shmseg /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_shm_id, - /* opcode */ XCB_SHM_DETACH, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_shm_detach_request_t xcb_out; - - xcb_out.shmseg = shmseg; - - 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_shm_detach - ** - ** @param xcb_connection_t *c - ** @param xcb_shm_seg_t shmseg - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_shm_detach (xcb_connection_t *c /**< */, - xcb_shm_seg_t shmseg /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_shm_id, - /* opcode */ XCB_SHM_DETACH, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_shm_detach_request_t xcb_out; - - xcb_out.shmseg = shmseg; - - 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_shm_put_image_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_drawable_t drawable - ** @param xcb_gcontext_t gc - ** @param uint16_t total_width - ** @param uint16_t total_height - ** @param uint16_t src_x - ** @param uint16_t src_y - ** @param uint16_t src_width - ** @param uint16_t src_height - ** @param int16_t dst_x - ** @param int16_t dst_y - ** @param uint8_t depth - ** @param uint8_t format - ** @param uint8_t send_event - ** @param xcb_shm_seg_t shmseg - ** @param uint32_t offset - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_shm_put_image_checked (xcb_connection_t *c /**< */, - xcb_drawable_t drawable /**< */, - xcb_gcontext_t gc /**< */, - uint16_t total_width /**< */, - uint16_t total_height /**< */, - uint16_t src_x /**< */, - uint16_t src_y /**< */, - uint16_t src_width /**< */, - uint16_t src_height /**< */, - int16_t dst_x /**< */, - int16_t dst_y /**< */, - uint8_t depth /**< */, - uint8_t format /**< */, - uint8_t send_event /**< */, - xcb_shm_seg_t shmseg /**< */, - uint32_t offset /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_shm_id, - /* opcode */ XCB_SHM_PUT_IMAGE, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_shm_put_image_request_t xcb_out; - - xcb_out.drawable = drawable; - xcb_out.gc = gc; - xcb_out.total_width = total_width; - xcb_out.total_height = total_height; - xcb_out.src_x = src_x; - xcb_out.src_y = src_y; - xcb_out.src_width = src_width; - xcb_out.src_height = src_height; - xcb_out.dst_x = dst_x; - xcb_out.dst_y = dst_y; - xcb_out.depth = depth; - xcb_out.format = format; - xcb_out.send_event = send_event; - xcb_out.pad0 = 0; - xcb_out.shmseg = shmseg; - xcb_out.offset = offset; - - 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_shm_put_image - ** - ** @param xcb_connection_t *c - ** @param xcb_drawable_t drawable - ** @param xcb_gcontext_t gc - ** @param uint16_t total_width - ** @param uint16_t total_height - ** @param uint16_t src_x - ** @param uint16_t src_y - ** @param uint16_t src_width - ** @param uint16_t src_height - ** @param int16_t dst_x - ** @param int16_t dst_y - ** @param uint8_t depth - ** @param uint8_t format - ** @param uint8_t send_event - ** @param xcb_shm_seg_t shmseg - ** @param uint32_t offset - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_shm_put_image (xcb_connection_t *c /**< */, - xcb_drawable_t drawable /**< */, - xcb_gcontext_t gc /**< */, - uint16_t total_width /**< */, - uint16_t total_height /**< */, - uint16_t src_x /**< */, - uint16_t src_y /**< */, - uint16_t src_width /**< */, - uint16_t src_height /**< */, - int16_t dst_x /**< */, - int16_t dst_y /**< */, - uint8_t depth /**< */, - uint8_t format /**< */, - uint8_t send_event /**< */, - xcb_shm_seg_t shmseg /**< */, - uint32_t offset /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_shm_id, - /* opcode */ XCB_SHM_PUT_IMAGE, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_shm_put_image_request_t xcb_out; - - xcb_out.drawable = drawable; - xcb_out.gc = gc; - xcb_out.total_width = total_width; - xcb_out.total_height = total_height; - xcb_out.src_x = src_x; - xcb_out.src_y = src_y; - xcb_out.src_width = src_width; - xcb_out.src_height = src_height; - xcb_out.dst_x = dst_x; - xcb_out.dst_y = dst_y; - xcb_out.depth = depth; - xcb_out.format = format; - xcb_out.send_event = send_event; - xcb_out.pad0 = 0; - xcb_out.shmseg = shmseg; - xcb_out.offset = offset; - - 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_shm_get_image_cookie_t xcb_shm_get_image - ** - ** @param xcb_connection_t *c - ** @param xcb_drawable_t drawable - ** @param int16_t x - ** @param int16_t y - ** @param uint16_t width - ** @param uint16_t height - ** @param uint32_t plane_mask - ** @param uint8_t format - ** @param xcb_shm_seg_t shmseg - ** @param uint32_t offset - ** @returns xcb_shm_get_image_cookie_t - ** - *****************************************************************************/ - -xcb_shm_get_image_cookie_t -xcb_shm_get_image (xcb_connection_t *c /**< */, - xcb_drawable_t drawable /**< */, - int16_t x /**< */, - int16_t y /**< */, - uint16_t width /**< */, - uint16_t height /**< */, - uint32_t plane_mask /**< */, - uint8_t format /**< */, - xcb_shm_seg_t shmseg /**< */, - uint32_t offset /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_shm_id, - /* opcode */ XCB_SHM_GET_IMAGE, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_shm_get_image_cookie_t xcb_ret; - xcb_shm_get_image_request_t xcb_out; - - xcb_out.drawable = drawable; - xcb_out.x = x; - xcb_out.y = y; - xcb_out.width = width; - xcb_out.height = height; - xcb_out.plane_mask = plane_mask; - xcb_out.format = format; - memset(xcb_out.pad0, 0, 3); - xcb_out.shmseg = shmseg; - xcb_out.offset = offset; - - 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_shm_get_image_cookie_t xcb_shm_get_image_unchecked - ** - ** @param xcb_connection_t *c - ** @param xcb_drawable_t drawable - ** @param int16_t x - ** @param int16_t y - ** @param uint16_t width - ** @param uint16_t height - ** @param uint32_t plane_mask - ** @param uint8_t format - ** @param xcb_shm_seg_t shmseg - ** @param uint32_t offset - ** @returns xcb_shm_get_image_cookie_t - ** - *****************************************************************************/ - -xcb_shm_get_image_cookie_t -xcb_shm_get_image_unchecked (xcb_connection_t *c /**< */, - xcb_drawable_t drawable /**< */, - int16_t x /**< */, - int16_t y /**< */, - uint16_t width /**< */, - uint16_t height /**< */, - uint32_t plane_mask /**< */, - uint8_t format /**< */, - xcb_shm_seg_t shmseg /**< */, - uint32_t offset /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_shm_id, - /* opcode */ XCB_SHM_GET_IMAGE, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_shm_get_image_cookie_t xcb_ret; - xcb_shm_get_image_request_t xcb_out; - - xcb_out.drawable = drawable; - xcb_out.x = x; - xcb_out.y = y; - xcb_out.width = width; - xcb_out.height = height; - xcb_out.plane_mask = plane_mask; - xcb_out.format = format; - memset(xcb_out.pad0, 0, 3); - xcb_out.shmseg = shmseg; - xcb_out.offset = offset; - - 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_shm_get_image_reply_t * xcb_shm_get_image_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_shm_get_image_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_shm_get_image_reply_t * - ** - *****************************************************************************/ - -xcb_shm_get_image_reply_t * -xcb_shm_get_image_reply (xcb_connection_t *c /**< */, - xcb_shm_get_image_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_shm_get_image_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_shm_create_pixmap_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_pixmap_t pid - ** @param xcb_drawable_t drawable - ** @param uint16_t width - ** @param uint16_t height - ** @param uint8_t depth - ** @param xcb_shm_seg_t shmseg - ** @param uint32_t offset - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_shm_create_pixmap_checked (xcb_connection_t *c /**< */, - xcb_pixmap_t pid /**< */, - xcb_drawable_t drawable /**< */, - uint16_t width /**< */, - uint16_t height /**< */, - uint8_t depth /**< */, - xcb_shm_seg_t shmseg /**< */, - uint32_t offset /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_shm_id, - /* opcode */ XCB_SHM_CREATE_PIXMAP, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_shm_create_pixmap_request_t xcb_out; - - xcb_out.pid = pid; - xcb_out.drawable = drawable; - xcb_out.width = width; - xcb_out.height = height; - xcb_out.depth = depth; - memset(xcb_out.pad0, 0, 3); - xcb_out.shmseg = shmseg; - xcb_out.offset = offset; - - 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_shm_create_pixmap - ** - ** @param xcb_connection_t *c - ** @param xcb_pixmap_t pid - ** @param xcb_drawable_t drawable - ** @param uint16_t width - ** @param uint16_t height - ** @param uint8_t depth - ** @param xcb_shm_seg_t shmseg - ** @param uint32_t offset - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_shm_create_pixmap (xcb_connection_t *c /**< */, - xcb_pixmap_t pid /**< */, - xcb_drawable_t drawable /**< */, - uint16_t width /**< */, - uint16_t height /**< */, - uint8_t depth /**< */, - xcb_shm_seg_t shmseg /**< */, - uint32_t offset /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_shm_id, - /* opcode */ XCB_SHM_CREATE_PIXMAP, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_shm_create_pixmap_request_t xcb_out; - - xcb_out.pid = pid; - xcb_out.drawable = drawable; - xcb_out.width = width; - xcb_out.height = height; - xcb_out.depth = depth; - memset(xcb_out.pad0, 0, 3); - xcb_out.shmseg = shmseg; - xcb_out.offset = offset; - - 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; -} - diff --git a/src/3rdparty/xcb/libxcb/sync.c b/src/3rdparty/xcb/libxcb/sync.c deleted file mode 100644 index 1f352756d8..0000000000 --- a/src/3rdparty/xcb/libxcb/sync.c +++ /dev/null @@ -1,2258 +0,0 @@ -/* - * This file generated automatically from sync.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 "sync.h" - -#define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member) -#include "xproto.h" - -xcb_extension_t xcb_sync_id = { "SYNC", 0 }; - - -/***************************************************************************** - ** - ** void xcb_sync_alarm_next - ** - ** @param xcb_sync_alarm_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_sync_alarm_next (xcb_sync_alarm_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_sync_alarm_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_sync_alarm_end - ** - ** @param xcb_sync_alarm_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_sync_alarm_end (xcb_sync_alarm_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_sync_counter_next - ** - ** @param xcb_sync_counter_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_sync_counter_next (xcb_sync_counter_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_sync_counter_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_sync_counter_end - ** - ** @param xcb_sync_counter_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_sync_counter_end (xcb_sync_counter_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_sync_fence_next - ** - ** @param xcb_sync_fence_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_sync_fence_next (xcb_sync_fence_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_sync_fence_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_sync_fence_end - ** - ** @param xcb_sync_fence_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_sync_fence_end (xcb_sync_fence_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_sync_int64_next - ** - ** @param xcb_sync_int64_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_sync_int64_next (xcb_sync_int64_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_sync_int64_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_sync_int64_end - ** - ** @param xcb_sync_int64_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_sync_int64_end (xcb_sync_int64_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - -int -xcb_sync_systemcounter_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_sync_systemcounter_t *_aux = (xcb_sync_systemcounter_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_sync_systemcounter_t); - xcb_tmp += xcb_block_len; - /* name */ - xcb_block_len += _aux->name_len * sizeof(char); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(char); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** char * xcb_sync_systemcounter_name - ** - ** @param const xcb_sync_systemcounter_t *R - ** @returns char * - ** - *****************************************************************************/ - -char * -xcb_sync_systemcounter_name (const xcb_sync_systemcounter_t *R /**< */) -{ - return (char *) (R + 1); -} - - -/***************************************************************************** - ** - ** int xcb_sync_systemcounter_name_length - ** - ** @param const xcb_sync_systemcounter_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_sync_systemcounter_name_length (const xcb_sync_systemcounter_t *R /**< */) -{ - return R->name_len; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_sync_systemcounter_name_end - ** - ** @param const xcb_sync_systemcounter_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_sync_systemcounter_name_end (const xcb_sync_systemcounter_t *R /**< */) -{ - xcb_generic_iterator_t i; - i.data = ((char *) (R + 1)) + (R->name_len); - i.rem = 0; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** void xcb_sync_systemcounter_next - ** - ** @param xcb_sync_systemcounter_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_sync_systemcounter_next (xcb_sync_systemcounter_iterator_t *i /**< */) -{ - xcb_sync_systemcounter_t *R = i->data; - xcb_generic_iterator_t child; - child.data = (xcb_sync_systemcounter_t *)(((char *)R) + xcb_sync_systemcounter_sizeof(R)); - i->index = (char *) child.data - (char *) i->data; - --i->rem; - i->data = (xcb_sync_systemcounter_t *) child.data; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_sync_systemcounter_end - ** - ** @param xcb_sync_systemcounter_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_sync_systemcounter_end (xcb_sync_systemcounter_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - while(i.rem > 0) - xcb_sync_systemcounter_next(&i); - ret.data = i.data; - ret.rem = i.rem; - ret.index = i.index; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_sync_trigger_next - ** - ** @param xcb_sync_trigger_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_sync_trigger_next (xcb_sync_trigger_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_sync_trigger_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_sync_trigger_end - ** - ** @param xcb_sync_trigger_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_sync_trigger_end (xcb_sync_trigger_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_sync_waitcondition_next - ** - ** @param xcb_sync_waitcondition_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_sync_waitcondition_next (xcb_sync_waitcondition_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_sync_waitcondition_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_sync_waitcondition_end - ** - ** @param xcb_sync_waitcondition_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_sync_waitcondition_end (xcb_sync_waitcondition_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** xcb_sync_initialize_cookie_t xcb_sync_initialize - ** - ** @param xcb_connection_t *c - ** @param uint8_t desired_major_version - ** @param uint8_t desired_minor_version - ** @returns xcb_sync_initialize_cookie_t - ** - *****************************************************************************/ - -xcb_sync_initialize_cookie_t -xcb_sync_initialize (xcb_connection_t *c /**< */, - uint8_t desired_major_version /**< */, - uint8_t desired_minor_version /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_sync_id, - /* opcode */ XCB_SYNC_INITIALIZE, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_sync_initialize_cookie_t xcb_ret; - xcb_sync_initialize_request_t xcb_out; - - xcb_out.desired_major_version = desired_major_version; - xcb_out.desired_minor_version = desired_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_sync_initialize_cookie_t xcb_sync_initialize_unchecked - ** - ** @param xcb_connection_t *c - ** @param uint8_t desired_major_version - ** @param uint8_t desired_minor_version - ** @returns xcb_sync_initialize_cookie_t - ** - *****************************************************************************/ - -xcb_sync_initialize_cookie_t -xcb_sync_initialize_unchecked (xcb_connection_t *c /**< */, - uint8_t desired_major_version /**< */, - uint8_t desired_minor_version /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_sync_id, - /* opcode */ XCB_SYNC_INITIALIZE, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_sync_initialize_cookie_t xcb_ret; - xcb_sync_initialize_request_t xcb_out; - - xcb_out.desired_major_version = desired_major_version; - xcb_out.desired_minor_version = desired_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_sync_initialize_reply_t * xcb_sync_initialize_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_sync_initialize_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_sync_initialize_reply_t * - ** - *****************************************************************************/ - -xcb_sync_initialize_reply_t * -xcb_sync_initialize_reply (xcb_connection_t *c /**< */, - xcb_sync_initialize_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_sync_initialize_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - -int -xcb_sync_list_system_counters_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_sync_list_system_counters_reply_t *_aux = (xcb_sync_list_system_counters_reply_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - unsigned int i; - unsigned int xcb_tmp_len; - - xcb_block_len += sizeof(xcb_sync_list_system_counters_reply_t); - xcb_tmp += xcb_block_len; - /* counters */ - for(i=0; i<_aux->counters_len; i++) { - xcb_tmp_len = xcb_sync_systemcounter_sizeof(xcb_tmp); - xcb_block_len += xcb_tmp_len; - xcb_tmp += xcb_tmp_len; - } - xcb_align_to = ALIGNOF(xcb_sync_systemcounter_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_sync_list_system_counters_cookie_t xcb_sync_list_system_counters - ** - ** @param xcb_connection_t *c - ** @returns xcb_sync_list_system_counters_cookie_t - ** - *****************************************************************************/ - -xcb_sync_list_system_counters_cookie_t -xcb_sync_list_system_counters (xcb_connection_t *c /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_sync_id, - /* opcode */ XCB_SYNC_LIST_SYSTEM_COUNTERS, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_sync_list_system_counters_cookie_t xcb_ret; - xcb_sync_list_system_counters_request_t xcb_out; - - - 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_sync_list_system_counters_cookie_t xcb_sync_list_system_counters_unchecked - ** - ** @param xcb_connection_t *c - ** @returns xcb_sync_list_system_counters_cookie_t - ** - *****************************************************************************/ - -xcb_sync_list_system_counters_cookie_t -xcb_sync_list_system_counters_unchecked (xcb_connection_t *c /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_sync_id, - /* opcode */ XCB_SYNC_LIST_SYSTEM_COUNTERS, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_sync_list_system_counters_cookie_t xcb_ret; - xcb_sync_list_system_counters_request_t xcb_out; - - - 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; -} - - -/***************************************************************************** - ** - ** int xcb_sync_list_system_counters_counters_length - ** - ** @param const xcb_sync_list_system_counters_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_sync_list_system_counters_counters_length (const xcb_sync_list_system_counters_reply_t *R /**< */) -{ - return R->counters_len; -} - - -/***************************************************************************** - ** - ** xcb_sync_systemcounter_iterator_t xcb_sync_list_system_counters_counters_iterator - ** - ** @param const xcb_sync_list_system_counters_reply_t *R - ** @returns xcb_sync_systemcounter_iterator_t - ** - *****************************************************************************/ - -xcb_sync_systemcounter_iterator_t -xcb_sync_list_system_counters_counters_iterator (const xcb_sync_list_system_counters_reply_t *R /**< */) -{ - xcb_sync_systemcounter_iterator_t i; - i.data = (xcb_sync_systemcounter_t *) (R + 1); - i.rem = R->counters_len; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** xcb_sync_list_system_counters_reply_t * xcb_sync_list_system_counters_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_sync_list_system_counters_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_sync_list_system_counters_reply_t * - ** - *****************************************************************************/ - -xcb_sync_list_system_counters_reply_t * -xcb_sync_list_system_counters_reply (xcb_connection_t *c /**< */, - xcb_sync_list_system_counters_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_sync_list_system_counters_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_sync_create_counter_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_sync_counter_t id - ** @param xcb_sync_int64_t initial_value - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_sync_create_counter_checked (xcb_connection_t *c /**< */, - xcb_sync_counter_t id /**< */, - xcb_sync_int64_t initial_value /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_sync_id, - /* opcode */ XCB_SYNC_CREATE_COUNTER, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_sync_create_counter_request_t xcb_out; - - xcb_out.id = id; - xcb_out.initial_value = initial_value; - - 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_sync_create_counter - ** - ** @param xcb_connection_t *c - ** @param xcb_sync_counter_t id - ** @param xcb_sync_int64_t initial_value - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_sync_create_counter (xcb_connection_t *c /**< */, - xcb_sync_counter_t id /**< */, - xcb_sync_int64_t initial_value /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_sync_id, - /* opcode */ XCB_SYNC_CREATE_COUNTER, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_sync_create_counter_request_t xcb_out; - - xcb_out.id = id; - xcb_out.initial_value = initial_value; - - 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_sync_destroy_counter_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_sync_counter_t counter - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_sync_destroy_counter_checked (xcb_connection_t *c /**< */, - xcb_sync_counter_t counter /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_sync_id, - /* opcode */ XCB_SYNC_DESTROY_COUNTER, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_sync_destroy_counter_request_t xcb_out; - - xcb_out.counter = counter; - - 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_sync_destroy_counter - ** - ** @param xcb_connection_t *c - ** @param xcb_sync_counter_t counter - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_sync_destroy_counter (xcb_connection_t *c /**< */, - xcb_sync_counter_t counter /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_sync_id, - /* opcode */ XCB_SYNC_DESTROY_COUNTER, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_sync_destroy_counter_request_t xcb_out; - - xcb_out.counter = counter; - - 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_sync_query_counter_cookie_t xcb_sync_query_counter - ** - ** @param xcb_connection_t *c - ** @param xcb_sync_counter_t counter - ** @returns xcb_sync_query_counter_cookie_t - ** - *****************************************************************************/ - -xcb_sync_query_counter_cookie_t -xcb_sync_query_counter (xcb_connection_t *c /**< */, - xcb_sync_counter_t counter /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_sync_id, - /* opcode */ XCB_SYNC_QUERY_COUNTER, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_sync_query_counter_cookie_t xcb_ret; - xcb_sync_query_counter_request_t xcb_out; - - xcb_out.counter = counter; - - 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_sync_query_counter_cookie_t xcb_sync_query_counter_unchecked - ** - ** @param xcb_connection_t *c - ** @param xcb_sync_counter_t counter - ** @returns xcb_sync_query_counter_cookie_t - ** - *****************************************************************************/ - -xcb_sync_query_counter_cookie_t -xcb_sync_query_counter_unchecked (xcb_connection_t *c /**< */, - xcb_sync_counter_t counter /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_sync_id, - /* opcode */ XCB_SYNC_QUERY_COUNTER, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_sync_query_counter_cookie_t xcb_ret; - xcb_sync_query_counter_request_t xcb_out; - - xcb_out.counter = counter; - - 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_sync_query_counter_reply_t * xcb_sync_query_counter_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_sync_query_counter_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_sync_query_counter_reply_t * - ** - *****************************************************************************/ - -xcb_sync_query_counter_reply_t * -xcb_sync_query_counter_reply (xcb_connection_t *c /**< */, - xcb_sync_query_counter_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_sync_query_counter_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - -int -xcb_sync_await_sizeof (const void *_buffer /**< */, - uint32_t wait_list_len /**< */) -{ - char *xcb_tmp = (char *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_sync_await_request_t); - xcb_tmp += xcb_block_len; - /* wait_list */ - xcb_block_len += wait_list_len * sizeof(xcb_sync_waitcondition_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_sync_waitcondition_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_sync_await_checked - ** - ** @param xcb_connection_t *c - ** @param uint32_t wait_list_len - ** @param const xcb_sync_waitcondition_t *wait_list - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_sync_await_checked (xcb_connection_t *c /**< */, - uint32_t wait_list_len /**< */, - const xcb_sync_waitcondition_t *wait_list /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_sync_id, - /* opcode */ XCB_SYNC_AWAIT, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_sync_await_request_t xcb_out; - - - 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_sync_waitcondition_t wait_list */ - xcb_parts[4].iov_base = (char *) wait_list; - xcb_parts[4].iov_len = wait_list_len * sizeof(xcb_sync_waitcondition_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].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_sync_await - ** - ** @param xcb_connection_t *c - ** @param uint32_t wait_list_len - ** @param const xcb_sync_waitcondition_t *wait_list - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_sync_await (xcb_connection_t *c /**< */, - uint32_t wait_list_len /**< */, - const xcb_sync_waitcondition_t *wait_list /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_sync_id, - /* opcode */ XCB_SYNC_AWAIT, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_sync_await_request_t xcb_out; - - - 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_sync_waitcondition_t wait_list */ - xcb_parts[4].iov_base = (char *) wait_list; - xcb_parts[4].iov_len = wait_list_len * sizeof(xcb_sync_waitcondition_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - - xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); - return xcb_ret; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_sync_change_counter_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_sync_counter_t counter - ** @param xcb_sync_int64_t amount - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_sync_change_counter_checked (xcb_connection_t *c /**< */, - xcb_sync_counter_t counter /**< */, - xcb_sync_int64_t amount /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_sync_id, - /* opcode */ XCB_SYNC_CHANGE_COUNTER, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_sync_change_counter_request_t xcb_out; - - xcb_out.counter = counter; - xcb_out.amount = amount; - - 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_sync_change_counter - ** - ** @param xcb_connection_t *c - ** @param xcb_sync_counter_t counter - ** @param xcb_sync_int64_t amount - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_sync_change_counter (xcb_connection_t *c /**< */, - xcb_sync_counter_t counter /**< */, - xcb_sync_int64_t amount /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_sync_id, - /* opcode */ XCB_SYNC_CHANGE_COUNTER, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_sync_change_counter_request_t xcb_out; - - xcb_out.counter = counter; - xcb_out.amount = amount; - - 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_sync_set_counter_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_sync_counter_t counter - ** @param xcb_sync_int64_t value - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_sync_set_counter_checked (xcb_connection_t *c /**< */, - xcb_sync_counter_t counter /**< */, - xcb_sync_int64_t value /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_sync_id, - /* opcode */ XCB_SYNC_SET_COUNTER, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_sync_set_counter_request_t xcb_out; - - xcb_out.counter = counter; - xcb_out.value = value; - - 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_sync_set_counter - ** - ** @param xcb_connection_t *c - ** @param xcb_sync_counter_t counter - ** @param xcb_sync_int64_t value - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_sync_set_counter (xcb_connection_t *c /**< */, - xcb_sync_counter_t counter /**< */, - xcb_sync_int64_t value /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_sync_id, - /* opcode */ XCB_SYNC_SET_COUNTER, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_sync_set_counter_request_t xcb_out; - - xcb_out.counter = counter; - xcb_out.value = value; - - 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; -} - -int -xcb_sync_create_alarm_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_sync_create_alarm_request_t *_aux = (xcb_sync_create_alarm_request_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_sync_create_alarm_request_t); - xcb_tmp += xcb_block_len; - /* value_list */ - xcb_block_len += xcb_popcount(_aux->value_mask) * sizeof(uint32_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(uint32_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_sync_create_alarm_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_sync_alarm_t id - ** @param uint32_t value_mask - ** @param const uint32_t *value_list - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_sync_create_alarm_checked (xcb_connection_t *c /**< */, - xcb_sync_alarm_t id /**< */, - uint32_t value_mask /**< */, - const uint32_t *value_list /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_sync_id, - /* opcode */ XCB_SYNC_CREATE_ALARM, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_sync_create_alarm_request_t xcb_out; - - xcb_out.id = id; - xcb_out.value_mask = value_mask; - - 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; - /* uint32_t value_list */ - xcb_parts[4].iov_base = (char *) value_list; - xcb_parts[4].iov_len = xcb_popcount(value_mask) * sizeof(uint32_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].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_sync_create_alarm - ** - ** @param xcb_connection_t *c - ** @param xcb_sync_alarm_t id - ** @param uint32_t value_mask - ** @param const uint32_t *value_list - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_sync_create_alarm (xcb_connection_t *c /**< */, - xcb_sync_alarm_t id /**< */, - uint32_t value_mask /**< */, - const uint32_t *value_list /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_sync_id, - /* opcode */ XCB_SYNC_CREATE_ALARM, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_sync_create_alarm_request_t xcb_out; - - xcb_out.id = id; - xcb_out.value_mask = value_mask; - - 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; - /* uint32_t value_list */ - xcb_parts[4].iov_base = (char *) value_list; - xcb_parts[4].iov_len = xcb_popcount(value_mask) * sizeof(uint32_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - - xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); - return xcb_ret; -} - -int -xcb_sync_change_alarm_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_sync_change_alarm_request_t *_aux = (xcb_sync_change_alarm_request_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_sync_change_alarm_request_t); - xcb_tmp += xcb_block_len; - /* value_list */ - xcb_block_len += xcb_popcount(_aux->value_mask) * sizeof(uint32_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(uint32_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_sync_change_alarm_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_sync_alarm_t id - ** @param uint32_t value_mask - ** @param const uint32_t *value_list - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_sync_change_alarm_checked (xcb_connection_t *c /**< */, - xcb_sync_alarm_t id /**< */, - uint32_t value_mask /**< */, - const uint32_t *value_list /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_sync_id, - /* opcode */ XCB_SYNC_CHANGE_ALARM, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_sync_change_alarm_request_t xcb_out; - - xcb_out.id = id; - xcb_out.value_mask = value_mask; - - 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; - /* uint32_t value_list */ - xcb_parts[4].iov_base = (char *) value_list; - xcb_parts[4].iov_len = xcb_popcount(value_mask) * sizeof(uint32_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].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_sync_change_alarm - ** - ** @param xcb_connection_t *c - ** @param xcb_sync_alarm_t id - ** @param uint32_t value_mask - ** @param const uint32_t *value_list - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_sync_change_alarm (xcb_connection_t *c /**< */, - xcb_sync_alarm_t id /**< */, - uint32_t value_mask /**< */, - const uint32_t *value_list /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_sync_id, - /* opcode */ XCB_SYNC_CHANGE_ALARM, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_sync_change_alarm_request_t xcb_out; - - xcb_out.id = id; - xcb_out.value_mask = value_mask; - - 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; - /* uint32_t value_list */ - xcb_parts[4].iov_base = (char *) value_list; - xcb_parts[4].iov_len = xcb_popcount(value_mask) * sizeof(uint32_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - - xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); - return xcb_ret; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_sync_destroy_alarm_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_sync_alarm_t alarm - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_sync_destroy_alarm_checked (xcb_connection_t *c /**< */, - xcb_sync_alarm_t alarm /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_sync_id, - /* opcode */ XCB_SYNC_DESTROY_ALARM, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_sync_destroy_alarm_request_t xcb_out; - - xcb_out.alarm = alarm; - - 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_sync_destroy_alarm - ** - ** @param xcb_connection_t *c - ** @param xcb_sync_alarm_t alarm - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_sync_destroy_alarm (xcb_connection_t *c /**< */, - xcb_sync_alarm_t alarm /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_sync_id, - /* opcode */ XCB_SYNC_DESTROY_ALARM, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_sync_destroy_alarm_request_t xcb_out; - - xcb_out.alarm = alarm; - - 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_sync_query_alarm_cookie_t xcb_sync_query_alarm - ** - ** @param xcb_connection_t *c - ** @param xcb_sync_alarm_t alarm - ** @returns xcb_sync_query_alarm_cookie_t - ** - *****************************************************************************/ - -xcb_sync_query_alarm_cookie_t -xcb_sync_query_alarm (xcb_connection_t *c /**< */, - xcb_sync_alarm_t alarm /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_sync_id, - /* opcode */ XCB_SYNC_QUERY_ALARM, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_sync_query_alarm_cookie_t xcb_ret; - xcb_sync_query_alarm_request_t xcb_out; - - xcb_out.alarm = alarm; - - 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_sync_query_alarm_cookie_t xcb_sync_query_alarm_unchecked - ** - ** @param xcb_connection_t *c - ** @param xcb_sync_alarm_t alarm - ** @returns xcb_sync_query_alarm_cookie_t - ** - *****************************************************************************/ - -xcb_sync_query_alarm_cookie_t -xcb_sync_query_alarm_unchecked (xcb_connection_t *c /**< */, - xcb_sync_alarm_t alarm /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_sync_id, - /* opcode */ XCB_SYNC_QUERY_ALARM, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_sync_query_alarm_cookie_t xcb_ret; - xcb_sync_query_alarm_request_t xcb_out; - - xcb_out.alarm = alarm; - - 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_sync_query_alarm_reply_t * xcb_sync_query_alarm_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_sync_query_alarm_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_sync_query_alarm_reply_t * - ** - *****************************************************************************/ - -xcb_sync_query_alarm_reply_t * -xcb_sync_query_alarm_reply (xcb_connection_t *c /**< */, - xcb_sync_query_alarm_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_sync_query_alarm_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_sync_set_priority_checked - ** - ** @param xcb_connection_t *c - ** @param uint32_t id - ** @param int32_t priority - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_sync_set_priority_checked (xcb_connection_t *c /**< */, - uint32_t id /**< */, - int32_t priority /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_sync_id, - /* opcode */ XCB_SYNC_SET_PRIORITY, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_sync_set_priority_request_t xcb_out; - - xcb_out.id = id; - xcb_out.priority = priority; - - 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_sync_set_priority - ** - ** @param xcb_connection_t *c - ** @param uint32_t id - ** @param int32_t priority - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_sync_set_priority (xcb_connection_t *c /**< */, - uint32_t id /**< */, - int32_t priority /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_sync_id, - /* opcode */ XCB_SYNC_SET_PRIORITY, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_sync_set_priority_request_t xcb_out; - - xcb_out.id = id; - xcb_out.priority = priority; - - 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_sync_get_priority_cookie_t xcb_sync_get_priority - ** - ** @param xcb_connection_t *c - ** @param uint32_t id - ** @returns xcb_sync_get_priority_cookie_t - ** - *****************************************************************************/ - -xcb_sync_get_priority_cookie_t -xcb_sync_get_priority (xcb_connection_t *c /**< */, - uint32_t id /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_sync_id, - /* opcode */ XCB_SYNC_GET_PRIORITY, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_sync_get_priority_cookie_t xcb_ret; - xcb_sync_get_priority_request_t xcb_out; - - xcb_out.id = id; - - 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_sync_get_priority_cookie_t xcb_sync_get_priority_unchecked - ** - ** @param xcb_connection_t *c - ** @param uint32_t id - ** @returns xcb_sync_get_priority_cookie_t - ** - *****************************************************************************/ - -xcb_sync_get_priority_cookie_t -xcb_sync_get_priority_unchecked (xcb_connection_t *c /**< */, - uint32_t id /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_sync_id, - /* opcode */ XCB_SYNC_GET_PRIORITY, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_sync_get_priority_cookie_t xcb_ret; - xcb_sync_get_priority_request_t xcb_out; - - xcb_out.id = id; - - 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_sync_get_priority_reply_t * xcb_sync_get_priority_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_sync_get_priority_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_sync_get_priority_reply_t * - ** - *****************************************************************************/ - -xcb_sync_get_priority_reply_t * -xcb_sync_get_priority_reply (xcb_connection_t *c /**< */, - xcb_sync_get_priority_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_sync_get_priority_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_sync_create_fence_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_drawable_t drawable - ** @param xcb_sync_fence_t fence - ** @param uint8_t initially_triggered - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_sync_create_fence_checked (xcb_connection_t *c /**< */, - xcb_drawable_t drawable /**< */, - xcb_sync_fence_t fence /**< */, - uint8_t initially_triggered /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_sync_id, - /* opcode */ XCB_SYNC_CREATE_FENCE, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_sync_create_fence_request_t xcb_out; - - xcb_out.drawable = drawable; - xcb_out.fence = fence; - xcb_out.initially_triggered = initially_triggered; - - 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_sync_create_fence - ** - ** @param xcb_connection_t *c - ** @param xcb_drawable_t drawable - ** @param xcb_sync_fence_t fence - ** @param uint8_t initially_triggered - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_sync_create_fence (xcb_connection_t *c /**< */, - xcb_drawable_t drawable /**< */, - xcb_sync_fence_t fence /**< */, - uint8_t initially_triggered /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_sync_id, - /* opcode */ XCB_SYNC_CREATE_FENCE, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_sync_create_fence_request_t xcb_out; - - xcb_out.drawable = drawable; - xcb_out.fence = fence; - xcb_out.initially_triggered = initially_triggered; - - 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_sync_trigger_fence_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_sync_fence_t fence - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_sync_trigger_fence_checked (xcb_connection_t *c /**< */, - xcb_sync_fence_t fence /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_sync_id, - /* opcode */ XCB_SYNC_TRIGGER_FENCE, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_sync_trigger_fence_request_t xcb_out; - - xcb_out.fence = fence; - - 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_sync_trigger_fence - ** - ** @param xcb_connection_t *c - ** @param xcb_sync_fence_t fence - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_sync_trigger_fence (xcb_connection_t *c /**< */, - xcb_sync_fence_t fence /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_sync_id, - /* opcode */ XCB_SYNC_TRIGGER_FENCE, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_sync_trigger_fence_request_t xcb_out; - - xcb_out.fence = fence; - - 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_sync_reset_fence_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_sync_fence_t fence - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_sync_reset_fence_checked (xcb_connection_t *c /**< */, - xcb_sync_fence_t fence /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_sync_id, - /* opcode */ XCB_SYNC_RESET_FENCE, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_sync_reset_fence_request_t xcb_out; - - xcb_out.fence = fence; - - 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_sync_reset_fence - ** - ** @param xcb_connection_t *c - ** @param xcb_sync_fence_t fence - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_sync_reset_fence (xcb_connection_t *c /**< */, - xcb_sync_fence_t fence /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_sync_id, - /* opcode */ XCB_SYNC_RESET_FENCE, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_sync_reset_fence_request_t xcb_out; - - xcb_out.fence = fence; - - 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_sync_destroy_fence_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_sync_fence_t fence - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_sync_destroy_fence_checked (xcb_connection_t *c /**< */, - xcb_sync_fence_t fence /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_sync_id, - /* opcode */ XCB_SYNC_DESTROY_FENCE, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_sync_destroy_fence_request_t xcb_out; - - xcb_out.fence = fence; - - 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_sync_destroy_fence - ** - ** @param xcb_connection_t *c - ** @param xcb_sync_fence_t fence - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_sync_destroy_fence (xcb_connection_t *c /**< */, - xcb_sync_fence_t fence /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_sync_id, - /* opcode */ XCB_SYNC_DESTROY_FENCE, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_sync_destroy_fence_request_t xcb_out; - - xcb_out.fence = fence; - - 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_sync_query_fence_cookie_t xcb_sync_query_fence - ** - ** @param xcb_connection_t *c - ** @param xcb_sync_fence_t fence - ** @returns xcb_sync_query_fence_cookie_t - ** - *****************************************************************************/ - -xcb_sync_query_fence_cookie_t -xcb_sync_query_fence (xcb_connection_t *c /**< */, - xcb_sync_fence_t fence /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_sync_id, - /* opcode */ XCB_SYNC_QUERY_FENCE, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_sync_query_fence_cookie_t xcb_ret; - xcb_sync_query_fence_request_t xcb_out; - - xcb_out.fence = fence; - - 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_sync_query_fence_cookie_t xcb_sync_query_fence_unchecked - ** - ** @param xcb_connection_t *c - ** @param xcb_sync_fence_t fence - ** @returns xcb_sync_query_fence_cookie_t - ** - *****************************************************************************/ - -xcb_sync_query_fence_cookie_t -xcb_sync_query_fence_unchecked (xcb_connection_t *c /**< */, - xcb_sync_fence_t fence /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_sync_id, - /* opcode */ XCB_SYNC_QUERY_FENCE, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_sync_query_fence_cookie_t xcb_ret; - xcb_sync_query_fence_request_t xcb_out; - - xcb_out.fence = fence; - - 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_sync_query_fence_reply_t * xcb_sync_query_fence_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_sync_query_fence_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_sync_query_fence_reply_t * - ** - *****************************************************************************/ - -xcb_sync_query_fence_reply_t * -xcb_sync_query_fence_reply (xcb_connection_t *c /**< */, - xcb_sync_query_fence_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_sync_query_fence_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - -int -xcb_sync_await_fence_sizeof (const void *_buffer /**< */, - uint32_t fence_list_len /**< */) -{ - char *xcb_tmp = (char *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_sync_await_fence_request_t); - xcb_tmp += xcb_block_len; - /* fence_list */ - xcb_block_len += fence_list_len * sizeof(xcb_sync_fence_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_sync_fence_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_sync_await_fence_checked - ** - ** @param xcb_connection_t *c - ** @param uint32_t fence_list_len - ** @param const xcb_sync_fence_t *fence_list - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_sync_await_fence_checked (xcb_connection_t *c /**< */, - uint32_t fence_list_len /**< */, - const xcb_sync_fence_t *fence_list /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_sync_id, - /* opcode */ XCB_SYNC_AWAIT_FENCE, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_sync_await_fence_request_t xcb_out; - - - 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_sync_fence_t fence_list */ - xcb_parts[4].iov_base = (char *) fence_list; - xcb_parts[4].iov_len = fence_list_len * sizeof(xcb_sync_fence_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].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_sync_await_fence - ** - ** @param xcb_connection_t *c - ** @param uint32_t fence_list_len - ** @param const xcb_sync_fence_t *fence_list - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_sync_await_fence (xcb_connection_t *c /**< */, - uint32_t fence_list_len /**< */, - const xcb_sync_fence_t *fence_list /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_sync_id, - /* opcode */ XCB_SYNC_AWAIT_FENCE, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_sync_await_fence_request_t xcb_out; - - - 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_sync_fence_t fence_list */ - xcb_parts[4].iov_base = (char *) fence_list; - xcb_parts[4].iov_len = fence_list_len * sizeof(xcb_sync_fence_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - - xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); - return xcb_ret; -} - diff --git a/src/3rdparty/xcb/libxcb/xfixes.c b/src/3rdparty/xcb/libxcb/xfixes.c deleted file mode 100644 index 4c0dc84b64..0000000000 --- a/src/3rdparty/xcb/libxcb/xfixes.c +++ /dev/null @@ -1,3274 +0,0 @@ -/* - * This file generated automatically from xfixes.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 "xfixes.h" - -#define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member) -#include "xproto.h" -#include "render.h" -#include "shape.h" - -xcb_extension_t xcb_xfixes_id = { "XFIXES", 0 }; - - -/***************************************************************************** - ** - ** xcb_xfixes_query_version_cookie_t xcb_xfixes_query_version - ** - ** @param xcb_connection_t *c - ** @param uint32_t client_major_version - ** @param uint32_t client_minor_version - ** @returns xcb_xfixes_query_version_cookie_t - ** - *****************************************************************************/ - -xcb_xfixes_query_version_cookie_t -xcb_xfixes_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_xfixes_id, - /* opcode */ XCB_XFIXES_QUERY_VERSION, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_xfixes_query_version_cookie_t xcb_ret; - xcb_xfixes_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_xfixes_query_version_cookie_t xcb_xfixes_query_version_unchecked - ** - ** @param xcb_connection_t *c - ** @param uint32_t client_major_version - ** @param uint32_t client_minor_version - ** @returns xcb_xfixes_query_version_cookie_t - ** - *****************************************************************************/ - -xcb_xfixes_query_version_cookie_t -xcb_xfixes_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_xfixes_id, - /* opcode */ XCB_XFIXES_QUERY_VERSION, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_xfixes_query_version_cookie_t xcb_ret; - xcb_xfixes_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_xfixes_query_version_reply_t * xcb_xfixes_query_version_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_xfixes_query_version_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_xfixes_query_version_reply_t * - ** - *****************************************************************************/ - -xcb_xfixes_query_version_reply_t * -xcb_xfixes_query_version_reply (xcb_connection_t *c /**< */, - xcb_xfixes_query_version_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_xfixes_query_version_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_xfixes_change_save_set_checked - ** - ** @param xcb_connection_t *c - ** @param uint8_t mode - ** @param uint8_t target - ** @param uint8_t map - ** @param xcb_window_t window - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_change_save_set_checked (xcb_connection_t *c /**< */, - uint8_t mode /**< */, - uint8_t target /**< */, - uint8_t map /**< */, - xcb_window_t window /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_CHANGE_SAVE_SET, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_change_save_set_request_t xcb_out; - - xcb_out.mode = mode; - xcb_out.target = target; - xcb_out.map = map; - xcb_out.pad0 = 0; - 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_xfixes_change_save_set - ** - ** @param xcb_connection_t *c - ** @param uint8_t mode - ** @param uint8_t target - ** @param uint8_t map - ** @param xcb_window_t window - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_change_save_set (xcb_connection_t *c /**< */, - uint8_t mode /**< */, - uint8_t target /**< */, - uint8_t map /**< */, - xcb_window_t window /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_CHANGE_SAVE_SET, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_change_save_set_request_t xcb_out; - - xcb_out.mode = mode; - xcb_out.target = target; - xcb_out.map = map; - xcb_out.pad0 = 0; - 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_xfixes_select_selection_input_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_window_t window - ** @param xcb_atom_t selection - ** @param uint32_t event_mask - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_select_selection_input_checked (xcb_connection_t *c /**< */, - xcb_window_t window /**< */, - xcb_atom_t selection /**< */, - uint32_t event_mask /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_SELECT_SELECTION_INPUT, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_select_selection_input_request_t xcb_out; - - xcb_out.window = window; - xcb_out.selection = selection; - xcb_out.event_mask = event_mask; - - 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_xfixes_select_selection_input - ** - ** @param xcb_connection_t *c - ** @param xcb_window_t window - ** @param xcb_atom_t selection - ** @param uint32_t event_mask - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_select_selection_input (xcb_connection_t *c /**< */, - xcb_window_t window /**< */, - xcb_atom_t selection /**< */, - uint32_t event_mask /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_SELECT_SELECTION_INPUT, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_select_selection_input_request_t xcb_out; - - xcb_out.window = window; - xcb_out.selection = selection; - xcb_out.event_mask = event_mask; - - 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_xfixes_select_cursor_input_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_window_t window - ** @param uint32_t event_mask - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_select_cursor_input_checked (xcb_connection_t *c /**< */, - xcb_window_t window /**< */, - uint32_t event_mask /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_SELECT_CURSOR_INPUT, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_select_cursor_input_request_t xcb_out; - - xcb_out.window = window; - xcb_out.event_mask = event_mask; - - 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_xfixes_select_cursor_input - ** - ** @param xcb_connection_t *c - ** @param xcb_window_t window - ** @param uint32_t event_mask - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_select_cursor_input (xcb_connection_t *c /**< */, - xcb_window_t window /**< */, - uint32_t event_mask /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_SELECT_CURSOR_INPUT, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_select_cursor_input_request_t xcb_out; - - xcb_out.window = window; - xcb_out.event_mask = event_mask; - - 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; -} - -int -xcb_xfixes_get_cursor_image_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_xfixes_get_cursor_image_reply_t *_aux = (xcb_xfixes_get_cursor_image_reply_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_xfixes_get_cursor_image_reply_t); - xcb_tmp += xcb_block_len; - /* cursor_image */ - xcb_block_len += (_aux->width * _aux->height) * sizeof(uint32_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(uint32_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_xfixes_get_cursor_image_cookie_t xcb_xfixes_get_cursor_image - ** - ** @param xcb_connection_t *c - ** @returns xcb_xfixes_get_cursor_image_cookie_t - ** - *****************************************************************************/ - -xcb_xfixes_get_cursor_image_cookie_t -xcb_xfixes_get_cursor_image (xcb_connection_t *c /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_GET_CURSOR_IMAGE, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_xfixes_get_cursor_image_cookie_t xcb_ret; - xcb_xfixes_get_cursor_image_request_t xcb_out; - - - 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_xfixes_get_cursor_image_cookie_t xcb_xfixes_get_cursor_image_unchecked - ** - ** @param xcb_connection_t *c - ** @returns xcb_xfixes_get_cursor_image_cookie_t - ** - *****************************************************************************/ - -xcb_xfixes_get_cursor_image_cookie_t -xcb_xfixes_get_cursor_image_unchecked (xcb_connection_t *c /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_GET_CURSOR_IMAGE, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_xfixes_get_cursor_image_cookie_t xcb_ret; - xcb_xfixes_get_cursor_image_request_t xcb_out; - - - 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; -} - - -/***************************************************************************** - ** - ** uint32_t * xcb_xfixes_get_cursor_image_cursor_image - ** - ** @param const xcb_xfixes_get_cursor_image_reply_t *R - ** @returns uint32_t * - ** - *****************************************************************************/ - -uint32_t * -xcb_xfixes_get_cursor_image_cursor_image (const xcb_xfixes_get_cursor_image_reply_t *R /**< */) -{ - return (uint32_t *) (R + 1); -} - - -/***************************************************************************** - ** - ** int xcb_xfixes_get_cursor_image_cursor_image_length - ** - ** @param const xcb_xfixes_get_cursor_image_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xfixes_get_cursor_image_cursor_image_length (const xcb_xfixes_get_cursor_image_reply_t *R /**< */) -{ - return (R->width * R->height); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xfixes_get_cursor_image_cursor_image_end - ** - ** @param const xcb_xfixes_get_cursor_image_reply_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xfixes_get_cursor_image_cursor_image_end (const xcb_xfixes_get_cursor_image_reply_t *R /**< */) -{ - xcb_generic_iterator_t i; - i.data = ((uint32_t *) (R + 1)) + ((R->width * R->height)); - i.rem = 0; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** xcb_xfixes_get_cursor_image_reply_t * xcb_xfixes_get_cursor_image_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_xfixes_get_cursor_image_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_xfixes_get_cursor_image_reply_t * - ** - *****************************************************************************/ - -xcb_xfixes_get_cursor_image_reply_t * -xcb_xfixes_get_cursor_image_reply (xcb_connection_t *c /**< */, - xcb_xfixes_get_cursor_image_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_xfixes_get_cursor_image_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - - -/***************************************************************************** - ** - ** void xcb_xfixes_region_next - ** - ** @param xcb_xfixes_region_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xfixes_region_next (xcb_xfixes_region_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xfixes_region_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xfixes_region_end - ** - ** @param xcb_xfixes_region_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xfixes_region_end (xcb_xfixes_region_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - -int -xcb_xfixes_create_region_sizeof (const void *_buffer /**< */, - uint32_t rectangles_len /**< */) -{ - char *xcb_tmp = (char *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_xfixes_create_region_request_t); - xcb_tmp += xcb_block_len; - /* rectangles */ - xcb_block_len += rectangles_len * sizeof(xcb_rectangle_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_rectangle_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_xfixes_create_region_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_xfixes_region_t region - ** @param uint32_t rectangles_len - ** @param const xcb_rectangle_t *rectangles - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_create_region_checked (xcb_connection_t *c /**< */, - xcb_xfixes_region_t region /**< */, - uint32_t rectangles_len /**< */, - const xcb_rectangle_t *rectangles /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_CREATE_REGION, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_create_region_request_t xcb_out; - - xcb_out.region = region; - - 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_rectangle_t rectangles */ - xcb_parts[4].iov_base = (char *) rectangles; - xcb_parts[4].iov_len = rectangles_len * sizeof(xcb_rectangle_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].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_xfixes_create_region - ** - ** @param xcb_connection_t *c - ** @param xcb_xfixes_region_t region - ** @param uint32_t rectangles_len - ** @param const xcb_rectangle_t *rectangles - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_create_region (xcb_connection_t *c /**< */, - xcb_xfixes_region_t region /**< */, - uint32_t rectangles_len /**< */, - const xcb_rectangle_t *rectangles /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_CREATE_REGION, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_create_region_request_t xcb_out; - - xcb_out.region = region; - - 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_rectangle_t rectangles */ - xcb_parts[4].iov_base = (char *) rectangles; - xcb_parts[4].iov_len = rectangles_len * sizeof(xcb_rectangle_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - - xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); - return xcb_ret; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_xfixes_create_region_from_bitmap_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_xfixes_region_t region - ** @param xcb_pixmap_t bitmap - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_create_region_from_bitmap_checked (xcb_connection_t *c /**< */, - xcb_xfixes_region_t region /**< */, - xcb_pixmap_t bitmap /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_CREATE_REGION_FROM_BITMAP, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_create_region_from_bitmap_request_t xcb_out; - - xcb_out.region = region; - xcb_out.bitmap = bitmap; - - 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_xfixes_create_region_from_bitmap - ** - ** @param xcb_connection_t *c - ** @param xcb_xfixes_region_t region - ** @param xcb_pixmap_t bitmap - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_create_region_from_bitmap (xcb_connection_t *c /**< */, - xcb_xfixes_region_t region /**< */, - xcb_pixmap_t bitmap /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_CREATE_REGION_FROM_BITMAP, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_create_region_from_bitmap_request_t xcb_out; - - xcb_out.region = region; - xcb_out.bitmap = bitmap; - - 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_xfixes_create_region_from_window_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_xfixes_region_t region - ** @param xcb_window_t window - ** @param xcb_shape_kind_t kind - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_create_region_from_window_checked (xcb_connection_t *c /**< */, - xcb_xfixes_region_t region /**< */, - xcb_window_t window /**< */, - xcb_shape_kind_t kind /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_CREATE_REGION_FROM_WINDOW, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_create_region_from_window_request_t xcb_out; - - xcb_out.region = region; - xcb_out.window = window; - xcb_out.kind = kind; - 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_xfixes_create_region_from_window - ** - ** @param xcb_connection_t *c - ** @param xcb_xfixes_region_t region - ** @param xcb_window_t window - ** @param xcb_shape_kind_t kind - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_create_region_from_window (xcb_connection_t *c /**< */, - xcb_xfixes_region_t region /**< */, - xcb_window_t window /**< */, - xcb_shape_kind_t kind /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_CREATE_REGION_FROM_WINDOW, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_create_region_from_window_request_t xcb_out; - - xcb_out.region = region; - xcb_out.window = window; - xcb_out.kind = kind; - 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_xfixes_create_region_from_gc_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_xfixes_region_t region - ** @param xcb_gcontext_t gc - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_create_region_from_gc_checked (xcb_connection_t *c /**< */, - xcb_xfixes_region_t region /**< */, - xcb_gcontext_t gc /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_CREATE_REGION_FROM_GC, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_create_region_from_gc_request_t xcb_out; - - xcb_out.region = region; - xcb_out.gc = gc; - - 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_xfixes_create_region_from_gc - ** - ** @param xcb_connection_t *c - ** @param xcb_xfixes_region_t region - ** @param xcb_gcontext_t gc - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_create_region_from_gc (xcb_connection_t *c /**< */, - xcb_xfixes_region_t region /**< */, - xcb_gcontext_t gc /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_CREATE_REGION_FROM_GC, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_create_region_from_gc_request_t xcb_out; - - xcb_out.region = region; - xcb_out.gc = gc; - - 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_xfixes_create_region_from_picture_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_xfixes_region_t region - ** @param xcb_render_picture_t picture - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_create_region_from_picture_checked (xcb_connection_t *c /**< */, - xcb_xfixes_region_t region /**< */, - xcb_render_picture_t picture /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_CREATE_REGION_FROM_PICTURE, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_create_region_from_picture_request_t xcb_out; - - xcb_out.region = region; - xcb_out.picture = picture; - - 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_xfixes_create_region_from_picture - ** - ** @param xcb_connection_t *c - ** @param xcb_xfixes_region_t region - ** @param xcb_render_picture_t picture - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_create_region_from_picture (xcb_connection_t *c /**< */, - xcb_xfixes_region_t region /**< */, - xcb_render_picture_t picture /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_CREATE_REGION_FROM_PICTURE, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_create_region_from_picture_request_t xcb_out; - - xcb_out.region = region; - xcb_out.picture = picture; - - 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_xfixes_destroy_region_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_xfixes_region_t region - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_destroy_region_checked (xcb_connection_t *c /**< */, - xcb_xfixes_region_t region /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_DESTROY_REGION, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_destroy_region_request_t xcb_out; - - xcb_out.region = region; - - 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_xfixes_destroy_region - ** - ** @param xcb_connection_t *c - ** @param xcb_xfixes_region_t region - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_destroy_region (xcb_connection_t *c /**< */, - xcb_xfixes_region_t region /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_DESTROY_REGION, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_destroy_region_request_t xcb_out; - - xcb_out.region = region; - - 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; -} - -int -xcb_xfixes_set_region_sizeof (const void *_buffer /**< */, - uint32_t rectangles_len /**< */) -{ - char *xcb_tmp = (char *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_xfixes_set_region_request_t); - xcb_tmp += xcb_block_len; - /* rectangles */ - xcb_block_len += rectangles_len * sizeof(xcb_rectangle_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_rectangle_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_xfixes_set_region_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_xfixes_region_t region - ** @param uint32_t rectangles_len - ** @param const xcb_rectangle_t *rectangles - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_set_region_checked (xcb_connection_t *c /**< */, - xcb_xfixes_region_t region /**< */, - uint32_t rectangles_len /**< */, - const xcb_rectangle_t *rectangles /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_SET_REGION, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_set_region_request_t xcb_out; - - xcb_out.region = region; - - 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_rectangle_t rectangles */ - xcb_parts[4].iov_base = (char *) rectangles; - xcb_parts[4].iov_len = rectangles_len * sizeof(xcb_rectangle_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].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_xfixes_set_region - ** - ** @param xcb_connection_t *c - ** @param xcb_xfixes_region_t region - ** @param uint32_t rectangles_len - ** @param const xcb_rectangle_t *rectangles - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_set_region (xcb_connection_t *c /**< */, - xcb_xfixes_region_t region /**< */, - uint32_t rectangles_len /**< */, - const xcb_rectangle_t *rectangles /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_SET_REGION, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_set_region_request_t xcb_out; - - xcb_out.region = region; - - 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_rectangle_t rectangles */ - xcb_parts[4].iov_base = (char *) rectangles; - xcb_parts[4].iov_len = rectangles_len * sizeof(xcb_rectangle_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - - xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); - return xcb_ret; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_xfixes_copy_region_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_xfixes_region_t source - ** @param xcb_xfixes_region_t destination - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_copy_region_checked (xcb_connection_t *c /**< */, - xcb_xfixes_region_t source /**< */, - xcb_xfixes_region_t destination /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_COPY_REGION, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_copy_region_request_t xcb_out; - - xcb_out.source = source; - xcb_out.destination = destination; - - 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_xfixes_copy_region - ** - ** @param xcb_connection_t *c - ** @param xcb_xfixes_region_t source - ** @param xcb_xfixes_region_t destination - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_copy_region (xcb_connection_t *c /**< */, - xcb_xfixes_region_t source /**< */, - xcb_xfixes_region_t destination /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_COPY_REGION, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_copy_region_request_t xcb_out; - - xcb_out.source = source; - xcb_out.destination = destination; - - 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_xfixes_union_region_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_xfixes_region_t source1 - ** @param xcb_xfixes_region_t source2 - ** @param xcb_xfixes_region_t destination - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_union_region_checked (xcb_connection_t *c /**< */, - xcb_xfixes_region_t source1 /**< */, - xcb_xfixes_region_t source2 /**< */, - xcb_xfixes_region_t destination /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_UNION_REGION, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_union_region_request_t xcb_out; - - xcb_out.source1 = source1; - xcb_out.source2 = source2; - xcb_out.destination = destination; - - 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_xfixes_union_region - ** - ** @param xcb_connection_t *c - ** @param xcb_xfixes_region_t source1 - ** @param xcb_xfixes_region_t source2 - ** @param xcb_xfixes_region_t destination - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_union_region (xcb_connection_t *c /**< */, - xcb_xfixes_region_t source1 /**< */, - xcb_xfixes_region_t source2 /**< */, - xcb_xfixes_region_t destination /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_UNION_REGION, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_union_region_request_t xcb_out; - - xcb_out.source1 = source1; - xcb_out.source2 = source2; - xcb_out.destination = destination; - - 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_xfixes_intersect_region_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_xfixes_region_t source1 - ** @param xcb_xfixes_region_t source2 - ** @param xcb_xfixes_region_t destination - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_intersect_region_checked (xcb_connection_t *c /**< */, - xcb_xfixes_region_t source1 /**< */, - xcb_xfixes_region_t source2 /**< */, - xcb_xfixes_region_t destination /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_INTERSECT_REGION, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_intersect_region_request_t xcb_out; - - xcb_out.source1 = source1; - xcb_out.source2 = source2; - xcb_out.destination = destination; - - 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_xfixes_intersect_region - ** - ** @param xcb_connection_t *c - ** @param xcb_xfixes_region_t source1 - ** @param xcb_xfixes_region_t source2 - ** @param xcb_xfixes_region_t destination - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_intersect_region (xcb_connection_t *c /**< */, - xcb_xfixes_region_t source1 /**< */, - xcb_xfixes_region_t source2 /**< */, - xcb_xfixes_region_t destination /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_INTERSECT_REGION, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_intersect_region_request_t xcb_out; - - xcb_out.source1 = source1; - xcb_out.source2 = source2; - xcb_out.destination = destination; - - 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_xfixes_subtract_region_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_xfixes_region_t source1 - ** @param xcb_xfixes_region_t source2 - ** @param xcb_xfixes_region_t destination - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_subtract_region_checked (xcb_connection_t *c /**< */, - xcb_xfixes_region_t source1 /**< */, - xcb_xfixes_region_t source2 /**< */, - xcb_xfixes_region_t destination /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_SUBTRACT_REGION, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_subtract_region_request_t xcb_out; - - xcb_out.source1 = source1; - xcb_out.source2 = source2; - xcb_out.destination = destination; - - 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_xfixes_subtract_region - ** - ** @param xcb_connection_t *c - ** @param xcb_xfixes_region_t source1 - ** @param xcb_xfixes_region_t source2 - ** @param xcb_xfixes_region_t destination - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_subtract_region (xcb_connection_t *c /**< */, - xcb_xfixes_region_t source1 /**< */, - xcb_xfixes_region_t source2 /**< */, - xcb_xfixes_region_t destination /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_SUBTRACT_REGION, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_subtract_region_request_t xcb_out; - - xcb_out.source1 = source1; - xcb_out.source2 = source2; - xcb_out.destination = destination; - - 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_xfixes_invert_region_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_xfixes_region_t source - ** @param xcb_rectangle_t bounds - ** @param xcb_xfixes_region_t destination - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_invert_region_checked (xcb_connection_t *c /**< */, - xcb_xfixes_region_t source /**< */, - xcb_rectangle_t bounds /**< */, - xcb_xfixes_region_t destination /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_INVERT_REGION, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_invert_region_request_t xcb_out; - - xcb_out.source = source; - xcb_out.bounds = bounds; - xcb_out.destination = destination; - - 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_xfixes_invert_region - ** - ** @param xcb_connection_t *c - ** @param xcb_xfixes_region_t source - ** @param xcb_rectangle_t bounds - ** @param xcb_xfixes_region_t destination - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_invert_region (xcb_connection_t *c /**< */, - xcb_xfixes_region_t source /**< */, - xcb_rectangle_t bounds /**< */, - xcb_xfixes_region_t destination /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_INVERT_REGION, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_invert_region_request_t xcb_out; - - xcb_out.source = source; - xcb_out.bounds = bounds; - xcb_out.destination = destination; - - 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_xfixes_translate_region_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_xfixes_region_t region - ** @param int16_t dx - ** @param int16_t dy - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_translate_region_checked (xcb_connection_t *c /**< */, - xcb_xfixes_region_t region /**< */, - int16_t dx /**< */, - int16_t dy /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_TRANSLATE_REGION, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_translate_region_request_t xcb_out; - - xcb_out.region = region; - xcb_out.dx = dx; - xcb_out.dy = dy; - - 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_xfixes_translate_region - ** - ** @param xcb_connection_t *c - ** @param xcb_xfixes_region_t region - ** @param int16_t dx - ** @param int16_t dy - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_translate_region (xcb_connection_t *c /**< */, - xcb_xfixes_region_t region /**< */, - int16_t dx /**< */, - int16_t dy /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_TRANSLATE_REGION, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_translate_region_request_t xcb_out; - - xcb_out.region = region; - xcb_out.dx = dx; - xcb_out.dy = dy; - - 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_xfixes_region_extents_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_xfixes_region_t source - ** @param xcb_xfixes_region_t destination - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_region_extents_checked (xcb_connection_t *c /**< */, - xcb_xfixes_region_t source /**< */, - xcb_xfixes_region_t destination /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_REGION_EXTENTS, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_region_extents_request_t xcb_out; - - xcb_out.source = source; - xcb_out.destination = destination; - - 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_xfixes_region_extents - ** - ** @param xcb_connection_t *c - ** @param xcb_xfixes_region_t source - ** @param xcb_xfixes_region_t destination - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_region_extents (xcb_connection_t *c /**< */, - xcb_xfixes_region_t source /**< */, - xcb_xfixes_region_t destination /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_REGION_EXTENTS, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_region_extents_request_t xcb_out; - - xcb_out.source = source; - xcb_out.destination = destination; - - 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; -} - -int -xcb_xfixes_fetch_region_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_xfixes_fetch_region_reply_t *_aux = (xcb_xfixes_fetch_region_reply_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_xfixes_fetch_region_reply_t); - xcb_tmp += xcb_block_len; - /* rectangles */ - xcb_block_len += (_aux->length / 2) * sizeof(xcb_rectangle_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_rectangle_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_xfixes_fetch_region_cookie_t xcb_xfixes_fetch_region - ** - ** @param xcb_connection_t *c - ** @param xcb_xfixes_region_t region - ** @returns xcb_xfixes_fetch_region_cookie_t - ** - *****************************************************************************/ - -xcb_xfixes_fetch_region_cookie_t -xcb_xfixes_fetch_region (xcb_connection_t *c /**< */, - xcb_xfixes_region_t region /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_FETCH_REGION, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_xfixes_fetch_region_cookie_t xcb_ret; - xcb_xfixes_fetch_region_request_t xcb_out; - - xcb_out.region = region; - - 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_xfixes_fetch_region_cookie_t xcb_xfixes_fetch_region_unchecked - ** - ** @param xcb_connection_t *c - ** @param xcb_xfixes_region_t region - ** @returns xcb_xfixes_fetch_region_cookie_t - ** - *****************************************************************************/ - -xcb_xfixes_fetch_region_cookie_t -xcb_xfixes_fetch_region_unchecked (xcb_connection_t *c /**< */, - xcb_xfixes_region_t region /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_FETCH_REGION, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_xfixes_fetch_region_cookie_t xcb_ret; - xcb_xfixes_fetch_region_request_t xcb_out; - - xcb_out.region = region; - - 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_rectangle_t * xcb_xfixes_fetch_region_rectangles - ** - ** @param const xcb_xfixes_fetch_region_reply_t *R - ** @returns xcb_rectangle_t * - ** - *****************************************************************************/ - -xcb_rectangle_t * -xcb_xfixes_fetch_region_rectangles (const xcb_xfixes_fetch_region_reply_t *R /**< */) -{ - return (xcb_rectangle_t *) (R + 1); -} - - -/***************************************************************************** - ** - ** int xcb_xfixes_fetch_region_rectangles_length - ** - ** @param const xcb_xfixes_fetch_region_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xfixes_fetch_region_rectangles_length (const xcb_xfixes_fetch_region_reply_t *R /**< */) -{ - return (R->length / 2); -} - - -/***************************************************************************** - ** - ** xcb_rectangle_iterator_t xcb_xfixes_fetch_region_rectangles_iterator - ** - ** @param const xcb_xfixes_fetch_region_reply_t *R - ** @returns xcb_rectangle_iterator_t - ** - *****************************************************************************/ - -xcb_rectangle_iterator_t -xcb_xfixes_fetch_region_rectangles_iterator (const xcb_xfixes_fetch_region_reply_t *R /**< */) -{ - xcb_rectangle_iterator_t i; - i.data = (xcb_rectangle_t *) (R + 1); - i.rem = (R->length / 2); - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** xcb_xfixes_fetch_region_reply_t * xcb_xfixes_fetch_region_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_xfixes_fetch_region_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_xfixes_fetch_region_reply_t * - ** - *****************************************************************************/ - -xcb_xfixes_fetch_region_reply_t * -xcb_xfixes_fetch_region_reply (xcb_connection_t *c /**< */, - xcb_xfixes_fetch_region_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_xfixes_fetch_region_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_xfixes_set_gc_clip_region_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_gcontext_t gc - ** @param xcb_xfixes_region_t region - ** @param int16_t x_origin - ** @param int16_t y_origin - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_set_gc_clip_region_checked (xcb_connection_t *c /**< */, - xcb_gcontext_t gc /**< */, - xcb_xfixes_region_t region /**< */, - int16_t x_origin /**< */, - int16_t y_origin /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_SET_GC_CLIP_REGION, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_set_gc_clip_region_request_t xcb_out; - - xcb_out.gc = gc; - xcb_out.region = region; - xcb_out.x_origin = x_origin; - xcb_out.y_origin = y_origin; - - 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_xfixes_set_gc_clip_region - ** - ** @param xcb_connection_t *c - ** @param xcb_gcontext_t gc - ** @param xcb_xfixes_region_t region - ** @param int16_t x_origin - ** @param int16_t y_origin - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_set_gc_clip_region (xcb_connection_t *c /**< */, - xcb_gcontext_t gc /**< */, - xcb_xfixes_region_t region /**< */, - int16_t x_origin /**< */, - int16_t y_origin /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_SET_GC_CLIP_REGION, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_set_gc_clip_region_request_t xcb_out; - - xcb_out.gc = gc; - xcb_out.region = region; - xcb_out.x_origin = x_origin; - xcb_out.y_origin = y_origin; - - 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_xfixes_set_window_shape_region_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_window_t dest - ** @param xcb_shape_kind_t dest_kind - ** @param int16_t x_offset - ** @param int16_t y_offset - ** @param xcb_xfixes_region_t region - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_set_window_shape_region_checked (xcb_connection_t *c /**< */, - xcb_window_t dest /**< */, - xcb_shape_kind_t dest_kind /**< */, - int16_t x_offset /**< */, - int16_t y_offset /**< */, - xcb_xfixes_region_t region /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_SET_WINDOW_SHAPE_REGION, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_set_window_shape_region_request_t xcb_out; - - xcb_out.dest = dest; - xcb_out.dest_kind = dest_kind; - memset(xcb_out.pad0, 0, 3); - xcb_out.x_offset = x_offset; - xcb_out.y_offset = y_offset; - xcb_out.region = region; - - 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_xfixes_set_window_shape_region - ** - ** @param xcb_connection_t *c - ** @param xcb_window_t dest - ** @param xcb_shape_kind_t dest_kind - ** @param int16_t x_offset - ** @param int16_t y_offset - ** @param xcb_xfixes_region_t region - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_set_window_shape_region (xcb_connection_t *c /**< */, - xcb_window_t dest /**< */, - xcb_shape_kind_t dest_kind /**< */, - int16_t x_offset /**< */, - int16_t y_offset /**< */, - xcb_xfixes_region_t region /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_SET_WINDOW_SHAPE_REGION, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_set_window_shape_region_request_t xcb_out; - - xcb_out.dest = dest; - xcb_out.dest_kind = dest_kind; - memset(xcb_out.pad0, 0, 3); - xcb_out.x_offset = x_offset; - xcb_out.y_offset = y_offset; - xcb_out.region = region; - - 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_xfixes_set_picture_clip_region_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_render_picture_t picture - ** @param xcb_xfixes_region_t region - ** @param int16_t x_origin - ** @param int16_t y_origin - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_set_picture_clip_region_checked (xcb_connection_t *c /**< */, - xcb_render_picture_t picture /**< */, - xcb_xfixes_region_t region /**< */, - int16_t x_origin /**< */, - int16_t y_origin /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_SET_PICTURE_CLIP_REGION, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_set_picture_clip_region_request_t xcb_out; - - xcb_out.picture = picture; - xcb_out.region = region; - xcb_out.x_origin = x_origin; - xcb_out.y_origin = y_origin; - - 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_xfixes_set_picture_clip_region - ** - ** @param xcb_connection_t *c - ** @param xcb_render_picture_t picture - ** @param xcb_xfixes_region_t region - ** @param int16_t x_origin - ** @param int16_t y_origin - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_set_picture_clip_region (xcb_connection_t *c /**< */, - xcb_render_picture_t picture /**< */, - xcb_xfixes_region_t region /**< */, - int16_t x_origin /**< */, - int16_t y_origin /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_SET_PICTURE_CLIP_REGION, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_set_picture_clip_region_request_t xcb_out; - - xcb_out.picture = picture; - xcb_out.region = region; - xcb_out.x_origin = x_origin; - xcb_out.y_origin = y_origin; - - 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; -} - -int -xcb_xfixes_set_cursor_name_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_xfixes_set_cursor_name_request_t *_aux = (xcb_xfixes_set_cursor_name_request_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_xfixes_set_cursor_name_request_t); - xcb_tmp += xcb_block_len; - /* name */ - xcb_block_len += _aux->nbytes * sizeof(char); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(char); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_xfixes_set_cursor_name_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_cursor_t cursor - ** @param uint16_t nbytes - ** @param const char *name - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_set_cursor_name_checked (xcb_connection_t *c /**< */, - xcb_cursor_t cursor /**< */, - uint16_t nbytes /**< */, - const char *name /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_SET_CURSOR_NAME, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_set_cursor_name_request_t xcb_out; - - xcb_out.cursor = cursor; - xcb_out.nbytes = nbytes; - memset(xcb_out.pad0, 0, 2); - - 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; - /* char name */ - xcb_parts[4].iov_base = (char *) name; - xcb_parts[4].iov_len = nbytes * sizeof(char); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].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_xfixes_set_cursor_name - ** - ** @param xcb_connection_t *c - ** @param xcb_cursor_t cursor - ** @param uint16_t nbytes - ** @param const char *name - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_set_cursor_name (xcb_connection_t *c /**< */, - xcb_cursor_t cursor /**< */, - uint16_t nbytes /**< */, - const char *name /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_SET_CURSOR_NAME, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_set_cursor_name_request_t xcb_out; - - xcb_out.cursor = cursor; - xcb_out.nbytes = nbytes; - memset(xcb_out.pad0, 0, 2); - - 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; - /* char name */ - xcb_parts[4].iov_base = (char *) name; - xcb_parts[4].iov_len = nbytes * sizeof(char); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - - xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); - return xcb_ret; -} - -int -xcb_xfixes_get_cursor_name_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_xfixes_get_cursor_name_reply_t *_aux = (xcb_xfixes_get_cursor_name_reply_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_xfixes_get_cursor_name_reply_t); - xcb_tmp += xcb_block_len; - /* name */ - xcb_block_len += _aux->nbytes * sizeof(char); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(char); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_xfixes_get_cursor_name_cookie_t xcb_xfixes_get_cursor_name - ** - ** @param xcb_connection_t *c - ** @param xcb_cursor_t cursor - ** @returns xcb_xfixes_get_cursor_name_cookie_t - ** - *****************************************************************************/ - -xcb_xfixes_get_cursor_name_cookie_t -xcb_xfixes_get_cursor_name (xcb_connection_t *c /**< */, - xcb_cursor_t cursor /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_GET_CURSOR_NAME, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_xfixes_get_cursor_name_cookie_t xcb_ret; - xcb_xfixes_get_cursor_name_request_t xcb_out; - - xcb_out.cursor = cursor; - - 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_xfixes_get_cursor_name_cookie_t xcb_xfixes_get_cursor_name_unchecked - ** - ** @param xcb_connection_t *c - ** @param xcb_cursor_t cursor - ** @returns xcb_xfixes_get_cursor_name_cookie_t - ** - *****************************************************************************/ - -xcb_xfixes_get_cursor_name_cookie_t -xcb_xfixes_get_cursor_name_unchecked (xcb_connection_t *c /**< */, - xcb_cursor_t cursor /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_GET_CURSOR_NAME, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_xfixes_get_cursor_name_cookie_t xcb_ret; - xcb_xfixes_get_cursor_name_request_t xcb_out; - - xcb_out.cursor = cursor; - - 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; -} - - -/***************************************************************************** - ** - ** char * xcb_xfixes_get_cursor_name_name - ** - ** @param const xcb_xfixes_get_cursor_name_reply_t *R - ** @returns char * - ** - *****************************************************************************/ - -char * -xcb_xfixes_get_cursor_name_name (const xcb_xfixes_get_cursor_name_reply_t *R /**< */) -{ - return (char *) (R + 1); -} - - -/***************************************************************************** - ** - ** int xcb_xfixes_get_cursor_name_name_length - ** - ** @param const xcb_xfixes_get_cursor_name_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xfixes_get_cursor_name_name_length (const xcb_xfixes_get_cursor_name_reply_t *R /**< */) -{ - return R->nbytes; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xfixes_get_cursor_name_name_end - ** - ** @param const xcb_xfixes_get_cursor_name_reply_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xfixes_get_cursor_name_name_end (const xcb_xfixes_get_cursor_name_reply_t *R /**< */) -{ - xcb_generic_iterator_t i; - i.data = ((char *) (R + 1)) + (R->nbytes); - i.rem = 0; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** xcb_xfixes_get_cursor_name_reply_t * xcb_xfixes_get_cursor_name_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_xfixes_get_cursor_name_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_xfixes_get_cursor_name_reply_t * - ** - *****************************************************************************/ - -xcb_xfixes_get_cursor_name_reply_t * -xcb_xfixes_get_cursor_name_reply (xcb_connection_t *c /**< */, - xcb_xfixes_get_cursor_name_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_xfixes_get_cursor_name_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - -int -xcb_xfixes_get_cursor_image_and_name_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_xfixes_get_cursor_image_and_name_reply_t *_aux = (xcb_xfixes_get_cursor_image_and_name_reply_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_xfixes_get_cursor_image_and_name_reply_t); - xcb_tmp += xcb_block_len; - /* name */ - xcb_block_len += _aux->nbytes * sizeof(char); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(char); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* cursor_image */ - xcb_block_len += (_aux->width * _aux->height) * sizeof(uint32_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(uint32_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_xfixes_get_cursor_image_and_name_cookie_t xcb_xfixes_get_cursor_image_and_name - ** - ** @param xcb_connection_t *c - ** @returns xcb_xfixes_get_cursor_image_and_name_cookie_t - ** - *****************************************************************************/ - -xcb_xfixes_get_cursor_image_and_name_cookie_t -xcb_xfixes_get_cursor_image_and_name (xcb_connection_t *c /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_GET_CURSOR_IMAGE_AND_NAME, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_xfixes_get_cursor_image_and_name_cookie_t xcb_ret; - xcb_xfixes_get_cursor_image_and_name_request_t xcb_out; - - - 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_xfixes_get_cursor_image_and_name_cookie_t xcb_xfixes_get_cursor_image_and_name_unchecked - ** - ** @param xcb_connection_t *c - ** @returns xcb_xfixes_get_cursor_image_and_name_cookie_t - ** - *****************************************************************************/ - -xcb_xfixes_get_cursor_image_and_name_cookie_t -xcb_xfixes_get_cursor_image_and_name_unchecked (xcb_connection_t *c /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_GET_CURSOR_IMAGE_AND_NAME, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_xfixes_get_cursor_image_and_name_cookie_t xcb_ret; - xcb_xfixes_get_cursor_image_and_name_request_t xcb_out; - - - 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; -} - - -/***************************************************************************** - ** - ** char * xcb_xfixes_get_cursor_image_and_name_name - ** - ** @param const xcb_xfixes_get_cursor_image_and_name_reply_t *R - ** @returns char * - ** - *****************************************************************************/ - -char * -xcb_xfixes_get_cursor_image_and_name_name (const xcb_xfixes_get_cursor_image_and_name_reply_t *R /**< */) -{ - return (char *) (R + 1); -} - - -/***************************************************************************** - ** - ** int xcb_xfixes_get_cursor_image_and_name_name_length - ** - ** @param const xcb_xfixes_get_cursor_image_and_name_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xfixes_get_cursor_image_and_name_name_length (const xcb_xfixes_get_cursor_image_and_name_reply_t *R /**< */) -{ - return R->nbytes; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xfixes_get_cursor_image_and_name_name_end - ** - ** @param const xcb_xfixes_get_cursor_image_and_name_reply_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xfixes_get_cursor_image_and_name_name_end (const xcb_xfixes_get_cursor_image_and_name_reply_t *R /**< */) -{ - xcb_generic_iterator_t i; - i.data = ((char *) (R + 1)) + (R->nbytes); - i.rem = 0; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** uint32_t * xcb_xfixes_get_cursor_image_and_name_cursor_image - ** - ** @param const xcb_xfixes_get_cursor_image_and_name_reply_t *R - ** @returns uint32_t * - ** - *****************************************************************************/ - -uint32_t * -xcb_xfixes_get_cursor_image_and_name_cursor_image (const xcb_xfixes_get_cursor_image_and_name_reply_t *R /**< */) -{ - xcb_generic_iterator_t prev = xcb_xfixes_get_cursor_image_and_name_name_end(R); - return (uint32_t *) ((char *) prev.data + XCB_TYPE_PAD(uint32_t, prev.index) + 0); -} - - -/***************************************************************************** - ** - ** int xcb_xfixes_get_cursor_image_and_name_cursor_image_length - ** - ** @param const xcb_xfixes_get_cursor_image_and_name_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xfixes_get_cursor_image_and_name_cursor_image_length (const xcb_xfixes_get_cursor_image_and_name_reply_t *R /**< */) -{ - return (R->width * R->height); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xfixes_get_cursor_image_and_name_cursor_image_end - ** - ** @param const xcb_xfixes_get_cursor_image_and_name_reply_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xfixes_get_cursor_image_and_name_cursor_image_end (const xcb_xfixes_get_cursor_image_and_name_reply_t *R /**< */) -{ - xcb_generic_iterator_t i; - xcb_generic_iterator_t child = xcb_xfixes_get_cursor_image_and_name_name_end(R); - i.data = ((uint32_t *) child.data) + ((R->width * R->height)); - i.rem = 0; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** xcb_xfixes_get_cursor_image_and_name_reply_t * xcb_xfixes_get_cursor_image_and_name_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_xfixes_get_cursor_image_and_name_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_xfixes_get_cursor_image_and_name_reply_t * - ** - *****************************************************************************/ - -xcb_xfixes_get_cursor_image_and_name_reply_t * -xcb_xfixes_get_cursor_image_and_name_reply (xcb_connection_t *c /**< */, - xcb_xfixes_get_cursor_image_and_name_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_xfixes_get_cursor_image_and_name_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_xfixes_change_cursor_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_cursor_t source - ** @param xcb_cursor_t destination - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_change_cursor_checked (xcb_connection_t *c /**< */, - xcb_cursor_t source /**< */, - xcb_cursor_t destination /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_CHANGE_CURSOR, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_change_cursor_request_t xcb_out; - - xcb_out.source = source; - xcb_out.destination = destination; - - 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_xfixes_change_cursor - ** - ** @param xcb_connection_t *c - ** @param xcb_cursor_t source - ** @param xcb_cursor_t destination - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_change_cursor (xcb_connection_t *c /**< */, - xcb_cursor_t source /**< */, - xcb_cursor_t destination /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_CHANGE_CURSOR, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_change_cursor_request_t xcb_out; - - xcb_out.source = source; - xcb_out.destination = destination; - - 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; -} - -int -xcb_xfixes_change_cursor_by_name_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_xfixes_change_cursor_by_name_request_t *_aux = (xcb_xfixes_change_cursor_by_name_request_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_xfixes_change_cursor_by_name_request_t); - xcb_tmp += xcb_block_len; - /* name */ - xcb_block_len += _aux->nbytes * sizeof(char); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(char); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_xfixes_change_cursor_by_name_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_cursor_t src - ** @param uint16_t nbytes - ** @param const char *name - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_change_cursor_by_name_checked (xcb_connection_t *c /**< */, - xcb_cursor_t src /**< */, - uint16_t nbytes /**< */, - const char *name /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_CHANGE_CURSOR_BY_NAME, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_change_cursor_by_name_request_t xcb_out; - - xcb_out.src = src; - xcb_out.nbytes = nbytes; - memset(xcb_out.pad0, 0, 2); - - 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; - /* char name */ - xcb_parts[4].iov_base = (char *) name; - xcb_parts[4].iov_len = nbytes * sizeof(char); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].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_xfixes_change_cursor_by_name - ** - ** @param xcb_connection_t *c - ** @param xcb_cursor_t src - ** @param uint16_t nbytes - ** @param const char *name - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_change_cursor_by_name (xcb_connection_t *c /**< */, - xcb_cursor_t src /**< */, - uint16_t nbytes /**< */, - const char *name /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_CHANGE_CURSOR_BY_NAME, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_change_cursor_by_name_request_t xcb_out; - - xcb_out.src = src; - xcb_out.nbytes = nbytes; - memset(xcb_out.pad0, 0, 2); - - 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; - /* char name */ - xcb_parts[4].iov_base = (char *) name; - xcb_parts[4].iov_len = nbytes * sizeof(char); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - - xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); - return xcb_ret; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_xfixes_expand_region_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_xfixes_region_t source - ** @param xcb_xfixes_region_t destination - ** @param uint16_t left - ** @param uint16_t right - ** @param uint16_t top - ** @param uint16_t bottom - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_expand_region_checked (xcb_connection_t *c /**< */, - xcb_xfixes_region_t source /**< */, - xcb_xfixes_region_t destination /**< */, - uint16_t left /**< */, - uint16_t right /**< */, - uint16_t top /**< */, - uint16_t bottom /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_EXPAND_REGION, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_expand_region_request_t xcb_out; - - xcb_out.source = source; - xcb_out.destination = destination; - xcb_out.left = left; - xcb_out.right = right; - xcb_out.top = top; - xcb_out.bottom = bottom; - - 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_xfixes_expand_region - ** - ** @param xcb_connection_t *c - ** @param xcb_xfixes_region_t source - ** @param xcb_xfixes_region_t destination - ** @param uint16_t left - ** @param uint16_t right - ** @param uint16_t top - ** @param uint16_t bottom - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_expand_region (xcb_connection_t *c /**< */, - xcb_xfixes_region_t source /**< */, - xcb_xfixes_region_t destination /**< */, - uint16_t left /**< */, - uint16_t right /**< */, - uint16_t top /**< */, - uint16_t bottom /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_EXPAND_REGION, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_expand_region_request_t xcb_out; - - xcb_out.source = source; - xcb_out.destination = destination; - xcb_out.left = left; - xcb_out.right = right; - xcb_out.top = top; - xcb_out.bottom = bottom; - - 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_xfixes_hide_cursor_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_window_t window - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_hide_cursor_checked (xcb_connection_t *c /**< */, - xcb_window_t window /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_HIDE_CURSOR, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_hide_cursor_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_xfixes_hide_cursor - ** - ** @param xcb_connection_t *c - ** @param xcb_window_t window - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_hide_cursor (xcb_connection_t *c /**< */, - xcb_window_t window /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_HIDE_CURSOR, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_hide_cursor_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_void_cookie_t xcb_xfixes_show_cursor_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_window_t window - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_show_cursor_checked (xcb_connection_t *c /**< */, - xcb_window_t window /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_SHOW_CURSOR, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_show_cursor_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_xfixes_show_cursor - ** - ** @param xcb_connection_t *c - ** @param xcb_window_t window - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xfixes_show_cursor (xcb_connection_t *c /**< */, - xcb_window_t window /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xfixes_id, - /* opcode */ XCB_XFIXES_SHOW_CURSOR, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xfixes_show_cursor_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; -} - diff --git a/src/3rdparty/xcb/libxcb/xinerama.c b/src/3rdparty/xcb/libxcb/xinerama.c deleted file mode 100644 index e660be267b..0000000000 --- a/src/3rdparty/xcb/libxcb/xinerama.c +++ /dev/null @@ -1,703 +0,0 @@ -/* - * This file generated automatically from xinerama.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 "xinerama.h" - -#define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member) -#include "xproto.h" - -xcb_extension_t xcb_xinerama_id = { "XINERAMA", 0 }; - - -/***************************************************************************** - ** - ** void xcb_xinerama_screen_info_next - ** - ** @param xcb_xinerama_screen_info_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xinerama_screen_info_next (xcb_xinerama_screen_info_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xinerama_screen_info_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xinerama_screen_info_end - ** - ** @param xcb_xinerama_screen_info_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xinerama_screen_info_end (xcb_xinerama_screen_info_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** xcb_xinerama_query_version_cookie_t xcb_xinerama_query_version - ** - ** @param xcb_connection_t *c - ** @param uint8_t major - ** @param uint8_t minor - ** @returns xcb_xinerama_query_version_cookie_t - ** - *****************************************************************************/ - -xcb_xinerama_query_version_cookie_t -xcb_xinerama_query_version (xcb_connection_t *c /**< */, - uint8_t major /**< */, - uint8_t minor /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xinerama_id, - /* opcode */ XCB_XINERAMA_QUERY_VERSION, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_xinerama_query_version_cookie_t xcb_ret; - xcb_xinerama_query_version_request_t xcb_out; - - xcb_out.major = major; - xcb_out.minor = minor; - - 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_xinerama_query_version_cookie_t xcb_xinerama_query_version_unchecked - ** - ** @param xcb_connection_t *c - ** @param uint8_t major - ** @param uint8_t minor - ** @returns xcb_xinerama_query_version_cookie_t - ** - *****************************************************************************/ - -xcb_xinerama_query_version_cookie_t -xcb_xinerama_query_version_unchecked (xcb_connection_t *c /**< */, - uint8_t major /**< */, - uint8_t minor /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xinerama_id, - /* opcode */ XCB_XINERAMA_QUERY_VERSION, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_xinerama_query_version_cookie_t xcb_ret; - xcb_xinerama_query_version_request_t xcb_out; - - xcb_out.major = major; - xcb_out.minor = minor; - - 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_xinerama_query_version_reply_t * xcb_xinerama_query_version_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_xinerama_query_version_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_xinerama_query_version_reply_t * - ** - *****************************************************************************/ - -xcb_xinerama_query_version_reply_t * -xcb_xinerama_query_version_reply (xcb_connection_t *c /**< */, - xcb_xinerama_query_version_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_xinerama_query_version_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - - -/***************************************************************************** - ** - ** xcb_xinerama_get_state_cookie_t xcb_xinerama_get_state - ** - ** @param xcb_connection_t *c - ** @param xcb_window_t window - ** @returns xcb_xinerama_get_state_cookie_t - ** - *****************************************************************************/ - -xcb_xinerama_get_state_cookie_t -xcb_xinerama_get_state (xcb_connection_t *c /**< */, - xcb_window_t window /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xinerama_id, - /* opcode */ XCB_XINERAMA_GET_STATE, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_xinerama_get_state_cookie_t xcb_ret; - xcb_xinerama_get_state_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_xinerama_get_state_cookie_t xcb_xinerama_get_state_unchecked - ** - ** @param xcb_connection_t *c - ** @param xcb_window_t window - ** @returns xcb_xinerama_get_state_cookie_t - ** - *****************************************************************************/ - -xcb_xinerama_get_state_cookie_t -xcb_xinerama_get_state_unchecked (xcb_connection_t *c /**< */, - xcb_window_t window /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xinerama_id, - /* opcode */ XCB_XINERAMA_GET_STATE, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_xinerama_get_state_cookie_t xcb_ret; - xcb_xinerama_get_state_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_xinerama_get_state_reply_t * xcb_xinerama_get_state_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_xinerama_get_state_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_xinerama_get_state_reply_t * - ** - *****************************************************************************/ - -xcb_xinerama_get_state_reply_t * -xcb_xinerama_get_state_reply (xcb_connection_t *c /**< */, - xcb_xinerama_get_state_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_xinerama_get_state_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - - -/***************************************************************************** - ** - ** xcb_xinerama_get_screen_count_cookie_t xcb_xinerama_get_screen_count - ** - ** @param xcb_connection_t *c - ** @param xcb_window_t window - ** @returns xcb_xinerama_get_screen_count_cookie_t - ** - *****************************************************************************/ - -xcb_xinerama_get_screen_count_cookie_t -xcb_xinerama_get_screen_count (xcb_connection_t *c /**< */, - xcb_window_t window /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xinerama_id, - /* opcode */ XCB_XINERAMA_GET_SCREEN_COUNT, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_xinerama_get_screen_count_cookie_t xcb_ret; - xcb_xinerama_get_screen_count_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_xinerama_get_screen_count_cookie_t xcb_xinerama_get_screen_count_unchecked - ** - ** @param xcb_connection_t *c - ** @param xcb_window_t window - ** @returns xcb_xinerama_get_screen_count_cookie_t - ** - *****************************************************************************/ - -xcb_xinerama_get_screen_count_cookie_t -xcb_xinerama_get_screen_count_unchecked (xcb_connection_t *c /**< */, - xcb_window_t window /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xinerama_id, - /* opcode */ XCB_XINERAMA_GET_SCREEN_COUNT, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_xinerama_get_screen_count_cookie_t xcb_ret; - xcb_xinerama_get_screen_count_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_xinerama_get_screen_count_reply_t * xcb_xinerama_get_screen_count_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_xinerama_get_screen_count_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_xinerama_get_screen_count_reply_t * - ** - *****************************************************************************/ - -xcb_xinerama_get_screen_count_reply_t * -xcb_xinerama_get_screen_count_reply (xcb_connection_t *c /**< */, - xcb_xinerama_get_screen_count_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_xinerama_get_screen_count_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - - -/***************************************************************************** - ** - ** xcb_xinerama_get_screen_size_cookie_t xcb_xinerama_get_screen_size - ** - ** @param xcb_connection_t *c - ** @param xcb_window_t window - ** @param uint32_t screen - ** @returns xcb_xinerama_get_screen_size_cookie_t - ** - *****************************************************************************/ - -xcb_xinerama_get_screen_size_cookie_t -xcb_xinerama_get_screen_size (xcb_connection_t *c /**< */, - xcb_window_t window /**< */, - uint32_t screen /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xinerama_id, - /* opcode */ XCB_XINERAMA_GET_SCREEN_SIZE, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_xinerama_get_screen_size_cookie_t xcb_ret; - xcb_xinerama_get_screen_size_request_t xcb_out; - - xcb_out.window = window; - xcb_out.screen = screen; - - 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_xinerama_get_screen_size_cookie_t xcb_xinerama_get_screen_size_unchecked - ** - ** @param xcb_connection_t *c - ** @param xcb_window_t window - ** @param uint32_t screen - ** @returns xcb_xinerama_get_screen_size_cookie_t - ** - *****************************************************************************/ - -xcb_xinerama_get_screen_size_cookie_t -xcb_xinerama_get_screen_size_unchecked (xcb_connection_t *c /**< */, - xcb_window_t window /**< */, - uint32_t screen /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xinerama_id, - /* opcode */ XCB_XINERAMA_GET_SCREEN_SIZE, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_xinerama_get_screen_size_cookie_t xcb_ret; - xcb_xinerama_get_screen_size_request_t xcb_out; - - xcb_out.window = window; - xcb_out.screen = screen; - - 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_xinerama_get_screen_size_reply_t * xcb_xinerama_get_screen_size_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_xinerama_get_screen_size_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_xinerama_get_screen_size_reply_t * - ** - *****************************************************************************/ - -xcb_xinerama_get_screen_size_reply_t * -xcb_xinerama_get_screen_size_reply (xcb_connection_t *c /**< */, - xcb_xinerama_get_screen_size_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_xinerama_get_screen_size_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - - -/***************************************************************************** - ** - ** xcb_xinerama_is_active_cookie_t xcb_xinerama_is_active - ** - ** @param xcb_connection_t *c - ** @returns xcb_xinerama_is_active_cookie_t - ** - *****************************************************************************/ - -xcb_xinerama_is_active_cookie_t -xcb_xinerama_is_active (xcb_connection_t *c /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xinerama_id, - /* opcode */ XCB_XINERAMA_IS_ACTIVE, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_xinerama_is_active_cookie_t xcb_ret; - xcb_xinerama_is_active_request_t xcb_out; - - - 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_xinerama_is_active_cookie_t xcb_xinerama_is_active_unchecked - ** - ** @param xcb_connection_t *c - ** @returns xcb_xinerama_is_active_cookie_t - ** - *****************************************************************************/ - -xcb_xinerama_is_active_cookie_t -xcb_xinerama_is_active_unchecked (xcb_connection_t *c /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xinerama_id, - /* opcode */ XCB_XINERAMA_IS_ACTIVE, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_xinerama_is_active_cookie_t xcb_ret; - xcb_xinerama_is_active_request_t xcb_out; - - - 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_xinerama_is_active_reply_t * xcb_xinerama_is_active_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_xinerama_is_active_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_xinerama_is_active_reply_t * - ** - *****************************************************************************/ - -xcb_xinerama_is_active_reply_t * -xcb_xinerama_is_active_reply (xcb_connection_t *c /**< */, - xcb_xinerama_is_active_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_xinerama_is_active_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - -int -xcb_xinerama_query_screens_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_xinerama_query_screens_reply_t *_aux = (xcb_xinerama_query_screens_reply_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to; - - - xcb_block_len += sizeof(xcb_xinerama_query_screens_reply_t); - xcb_tmp += xcb_block_len; - /* screen_info */ - xcb_block_len += _aux->number * sizeof(xcb_xinerama_screen_info_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_xinerama_screen_info_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_xinerama_query_screens_cookie_t xcb_xinerama_query_screens - ** - ** @param xcb_connection_t *c - ** @returns xcb_xinerama_query_screens_cookie_t - ** - *****************************************************************************/ - -xcb_xinerama_query_screens_cookie_t -xcb_xinerama_query_screens (xcb_connection_t *c /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xinerama_id, - /* opcode */ XCB_XINERAMA_QUERY_SCREENS, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_xinerama_query_screens_cookie_t xcb_ret; - xcb_xinerama_query_screens_request_t xcb_out; - - - 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_xinerama_query_screens_cookie_t xcb_xinerama_query_screens_unchecked - ** - ** @param xcb_connection_t *c - ** @returns xcb_xinerama_query_screens_cookie_t - ** - *****************************************************************************/ - -xcb_xinerama_query_screens_cookie_t -xcb_xinerama_query_screens_unchecked (xcb_connection_t *c /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xinerama_id, - /* opcode */ XCB_XINERAMA_QUERY_SCREENS, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_xinerama_query_screens_cookie_t xcb_ret; - xcb_xinerama_query_screens_request_t xcb_out; - - - 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_xinerama_screen_info_t * xcb_xinerama_query_screens_screen_info - ** - ** @param const xcb_xinerama_query_screens_reply_t *R - ** @returns xcb_xinerama_screen_info_t * - ** - *****************************************************************************/ - -xcb_xinerama_screen_info_t * -xcb_xinerama_query_screens_screen_info (const xcb_xinerama_query_screens_reply_t *R /**< */) -{ - return (xcb_xinerama_screen_info_t *) (R + 1); -} - - -/***************************************************************************** - ** - ** int xcb_xinerama_query_screens_screen_info_length - ** - ** @param const xcb_xinerama_query_screens_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xinerama_query_screens_screen_info_length (const xcb_xinerama_query_screens_reply_t *R /**< */) -{ - return R->number; -} - - -/***************************************************************************** - ** - ** xcb_xinerama_screen_info_iterator_t xcb_xinerama_query_screens_screen_info_iterator - ** - ** @param const xcb_xinerama_query_screens_reply_t *R - ** @returns xcb_xinerama_screen_info_iterator_t - ** - *****************************************************************************/ - -xcb_xinerama_screen_info_iterator_t -xcb_xinerama_query_screens_screen_info_iterator (const xcb_xinerama_query_screens_reply_t *R /**< */) -{ - xcb_xinerama_screen_info_iterator_t i; - i.data = (xcb_xinerama_screen_info_t *) (R + 1); - i.rem = R->number; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** xcb_xinerama_query_screens_reply_t * xcb_xinerama_query_screens_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_xinerama_query_screens_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_xinerama_query_screens_reply_t * - ** - *****************************************************************************/ - -xcb_xinerama_query_screens_reply_t * -xcb_xinerama_query_screens_reply (xcb_connection_t *c /**< */, - xcb_xinerama_query_screens_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_xinerama_query_screens_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - diff --git a/src/3rdparty/xcb/libxcb/xinput.c b/src/3rdparty/xcb/libxcb/xinput.c index 0edfde656c..d4e3c250bc 100644 --- a/src/3rdparty/xcb/libxcb/xinput.c +++ b/src/3rdparty/xcb/libxcb/xinput.c @@ -10,11 +10,11 @@ #include <string.h> #include <assert.h> #include <stddef.h> /* for offsetof() */ -#include "xcbext.h" -#include "xinput.h" +#include <xcb/xcbext.h> +#include <xcb/xinput.h> #define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member) -#include "xfixes.h" +#include <xcb/xfixes.h> xcb_extension_t xcb_input_id = { "XInputExtension", 0 }; diff --git a/src/3rdparty/xcb/libxcb/xkb.c b/src/3rdparty/xcb/libxcb/xkb.c deleted file mode 100644 index d55bd76f10..0000000000 --- a/src/3rdparty/xcb/libxcb/xkb.c +++ /dev/null @@ -1,15959 +0,0 @@ -/* - * This file generated automatically from xkb.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 "xkb.h" - -#define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member) -#include "xproto.h" - -xcb_extension_t xcb_xkb_id = { "XKEYBOARD", 0 }; - - -/***************************************************************************** - ** - ** void xcb_xkb_device_spec_next - ** - ** @param xcb_xkb_device_spec_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_device_spec_next (xcb_xkb_device_spec_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_device_spec_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_device_spec_end - ** - ** @param xcb_xkb_device_spec_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_device_spec_end (xcb_xkb_device_spec_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_led_class_spec_next - ** - ** @param xcb_xkb_led_class_spec_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_led_class_spec_next (xcb_xkb_led_class_spec_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_led_class_spec_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_led_class_spec_end - ** - ** @param xcb_xkb_led_class_spec_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_led_class_spec_end (xcb_xkb_led_class_spec_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_bell_class_spec_next - ** - ** @param xcb_xkb_bell_class_spec_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_bell_class_spec_next (xcb_xkb_bell_class_spec_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_bell_class_spec_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_bell_class_spec_end - ** - ** @param xcb_xkb_bell_class_spec_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_bell_class_spec_end (xcb_xkb_bell_class_spec_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_id_spec_next - ** - ** @param xcb_xkb_id_spec_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_id_spec_next (xcb_xkb_id_spec_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_id_spec_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_id_spec_end - ** - ** @param xcb_xkb_id_spec_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_id_spec_end (xcb_xkb_id_spec_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_indicator_map_next - ** - ** @param xcb_xkb_indicator_map_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_indicator_map_next (xcb_xkb_indicator_map_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_indicator_map_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_indicator_map_end - ** - ** @param xcb_xkb_indicator_map_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_indicator_map_end (xcb_xkb_indicator_map_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_mod_def_next - ** - ** @param xcb_xkb_mod_def_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_mod_def_next (xcb_xkb_mod_def_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_mod_def_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_mod_def_end - ** - ** @param xcb_xkb_mod_def_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_mod_def_end (xcb_xkb_mod_def_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_key_name_next - ** - ** @param xcb_xkb_key_name_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_key_name_next (xcb_xkb_key_name_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_key_name_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_key_name_end - ** - ** @param xcb_xkb_key_name_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_key_name_end (xcb_xkb_key_name_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_key_alias_next - ** - ** @param xcb_xkb_key_alias_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_key_alias_next (xcb_xkb_key_alias_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_key_alias_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_key_alias_end - ** - ** @param xcb_xkb_key_alias_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_key_alias_end (xcb_xkb_key_alias_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - -int -xcb_xkb_counted_string_16_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_xkb_counted_string_16_t *_aux = (xcb_xkb_counted_string_16_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to = 0; - - - xcb_block_len += sizeof(xcb_xkb_counted_string_16_t); - xcb_tmp += xcb_block_len; - xcb_buffer_len += xcb_block_len; - xcb_block_len = 0; - /* string */ - xcb_block_len += _aux->length * sizeof(char); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(char); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* alignment_pad */ - xcb_block_len += (((_aux->length + 5) & (~3)) - (_aux->length + 2)) * sizeof(char); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(char); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** char * xcb_xkb_counted_string_16_string - ** - ** @param const xcb_xkb_counted_string_16_t *R - ** @returns char * - ** - *****************************************************************************/ - -char * -xcb_xkb_counted_string_16_string (const xcb_xkb_counted_string_16_t *R /**< */) -{ - return (char *) (R + 1); -} - - -/***************************************************************************** - ** - ** int xcb_xkb_counted_string_16_string_length - ** - ** @param const xcb_xkb_counted_string_16_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_counted_string_16_string_length (const xcb_xkb_counted_string_16_t *R /**< */) -{ - return R->length; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_counted_string_16_string_end - ** - ** @param const xcb_xkb_counted_string_16_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_counted_string_16_string_end (const xcb_xkb_counted_string_16_t *R /**< */) -{ - xcb_generic_iterator_t i; - i.data = ((char *) (R + 1)) + (R->length); - i.rem = 0; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** void * xcb_xkb_counted_string_16_alignment_pad - ** - ** @param const xcb_xkb_counted_string_16_t *R - ** @returns void * - ** - *****************************************************************************/ - -void * -xcb_xkb_counted_string_16_alignment_pad (const xcb_xkb_counted_string_16_t *R /**< */) -{ - xcb_generic_iterator_t prev = xcb_xkb_counted_string_16_string_end(R); - return (void *) ((char *) prev.data + XCB_TYPE_PAD(char, prev.index) + 0); -} - - -/***************************************************************************** - ** - ** int xcb_xkb_counted_string_16_alignment_pad_length - ** - ** @param const xcb_xkb_counted_string_16_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_counted_string_16_alignment_pad_length (const xcb_xkb_counted_string_16_t *R /**< */) -{ - return (((R->length + 5) & (~3)) - (R->length + 2)); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_counted_string_16_alignment_pad_end - ** - ** @param const xcb_xkb_counted_string_16_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_counted_string_16_alignment_pad_end (const xcb_xkb_counted_string_16_t *R /**< */) -{ - xcb_generic_iterator_t i; - xcb_generic_iterator_t child = xcb_xkb_counted_string_16_string_end(R); - i.data = ((char *) child.data) + ((((R->length + 5) & (~3)) - (R->length + 2))); - i.rem = 0; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_counted_string_16_next - ** - ** @param xcb_xkb_counted_string_16_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_counted_string_16_next (xcb_xkb_counted_string_16_iterator_t *i /**< */) -{ - xcb_xkb_counted_string_16_t *R = i->data; - xcb_generic_iterator_t child; - child.data = (xcb_xkb_counted_string_16_t *)(((char *)R) + xcb_xkb_counted_string_16_sizeof(R)); - i->index = (char *) child.data - (char *) i->data; - --i->rem; - i->data = (xcb_xkb_counted_string_16_t *) child.data; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_counted_string_16_end - ** - ** @param xcb_xkb_counted_string_16_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_counted_string_16_end (xcb_xkb_counted_string_16_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - while(i.rem > 0) - xcb_xkb_counted_string_16_next(&i); - ret.data = i.data; - ret.rem = i.rem; - ret.index = i.index; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_kt_map_entry_next - ** - ** @param xcb_xkb_kt_map_entry_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_kt_map_entry_next (xcb_xkb_kt_map_entry_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_kt_map_entry_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_kt_map_entry_end - ** - ** @param xcb_xkb_kt_map_entry_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_kt_map_entry_end (xcb_xkb_kt_map_entry_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - -int -xcb_xkb_key_type_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_xkb_key_type_t *_aux = (xcb_xkb_key_type_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to = 0; - - - xcb_block_len += sizeof(xcb_xkb_key_type_t); - xcb_tmp += xcb_block_len; - xcb_buffer_len += xcb_block_len; - xcb_block_len = 0; - /* map */ - xcb_block_len += _aux->nMapEntries * sizeof(xcb_xkb_kt_map_entry_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_xkb_kt_map_entry_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* preserve */ - xcb_block_len += (_aux->hasPreserve * _aux->nMapEntries) * sizeof(xcb_xkb_mod_def_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_xkb_mod_def_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_xkb_kt_map_entry_t * xcb_xkb_key_type_map - ** - ** @param const xcb_xkb_key_type_t *R - ** @returns xcb_xkb_kt_map_entry_t * - ** - *****************************************************************************/ - -xcb_xkb_kt_map_entry_t * -xcb_xkb_key_type_map (const xcb_xkb_key_type_t *R /**< */) -{ - return (xcb_xkb_kt_map_entry_t *) (R + 1); -} - - -/***************************************************************************** - ** - ** int xcb_xkb_key_type_map_length - ** - ** @param const xcb_xkb_key_type_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_key_type_map_length (const xcb_xkb_key_type_t *R /**< */) -{ - return R->nMapEntries; -} - - -/***************************************************************************** - ** - ** xcb_xkb_kt_map_entry_iterator_t xcb_xkb_key_type_map_iterator - ** - ** @param const xcb_xkb_key_type_t *R - ** @returns xcb_xkb_kt_map_entry_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_kt_map_entry_iterator_t -xcb_xkb_key_type_map_iterator (const xcb_xkb_key_type_t *R /**< */) -{ - xcb_xkb_kt_map_entry_iterator_t i; - i.data = (xcb_xkb_kt_map_entry_t *) (R + 1); - i.rem = R->nMapEntries; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** xcb_xkb_mod_def_t * xcb_xkb_key_type_preserve - ** - ** @param const xcb_xkb_key_type_t *R - ** @returns xcb_xkb_mod_def_t * - ** - *****************************************************************************/ - -xcb_xkb_mod_def_t * -xcb_xkb_key_type_preserve (const xcb_xkb_key_type_t *R /**< */) -{ - xcb_generic_iterator_t prev = xcb_xkb_kt_map_entry_end(xcb_xkb_key_type_map_iterator(R)); - return (xcb_xkb_mod_def_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xkb_mod_def_t, prev.index) + 0); -} - - -/***************************************************************************** - ** - ** int xcb_xkb_key_type_preserve_length - ** - ** @param const xcb_xkb_key_type_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_key_type_preserve_length (const xcb_xkb_key_type_t *R /**< */) -{ - return (R->hasPreserve * R->nMapEntries); -} - - -/***************************************************************************** - ** - ** xcb_xkb_mod_def_iterator_t xcb_xkb_key_type_preserve_iterator - ** - ** @param const xcb_xkb_key_type_t *R - ** @returns xcb_xkb_mod_def_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_mod_def_iterator_t -xcb_xkb_key_type_preserve_iterator (const xcb_xkb_key_type_t *R /**< */) -{ - xcb_xkb_mod_def_iterator_t i; - xcb_generic_iterator_t prev = xcb_xkb_kt_map_entry_end(xcb_xkb_key_type_map_iterator(R)); - i.data = (xcb_xkb_mod_def_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xkb_mod_def_t, prev.index)); - i.rem = (R->hasPreserve * R->nMapEntries); - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_key_type_next - ** - ** @param xcb_xkb_key_type_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_key_type_next (xcb_xkb_key_type_iterator_t *i /**< */) -{ - xcb_xkb_key_type_t *R = i->data; - xcb_generic_iterator_t child; - child.data = (xcb_xkb_key_type_t *)(((char *)R) + xcb_xkb_key_type_sizeof(R)); - i->index = (char *) child.data - (char *) i->data; - --i->rem; - i->data = (xcb_xkb_key_type_t *) child.data; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_key_type_end - ** - ** @param xcb_xkb_key_type_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_key_type_end (xcb_xkb_key_type_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - while(i.rem > 0) - xcb_xkb_key_type_next(&i); - ret.data = i.data; - ret.rem = i.rem; - ret.index = i.index; - return ret; -} - -int -xcb_xkb_key_sym_map_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_xkb_key_sym_map_t *_aux = (xcb_xkb_key_sym_map_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to = 0; - - - xcb_block_len += sizeof(xcb_xkb_key_sym_map_t); - xcb_tmp += xcb_block_len; - xcb_buffer_len += xcb_block_len; - xcb_block_len = 0; - /* syms */ - xcb_block_len += _aux->nSyms * sizeof(xcb_keysym_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_keysym_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_keysym_t * xcb_xkb_key_sym_map_syms - ** - ** @param const xcb_xkb_key_sym_map_t *R - ** @returns xcb_keysym_t * - ** - *****************************************************************************/ - -xcb_keysym_t * -xcb_xkb_key_sym_map_syms (const xcb_xkb_key_sym_map_t *R /**< */) -{ - return (xcb_keysym_t *) (R + 1); -} - - -/***************************************************************************** - ** - ** int xcb_xkb_key_sym_map_syms_length - ** - ** @param const xcb_xkb_key_sym_map_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_key_sym_map_syms_length (const xcb_xkb_key_sym_map_t *R /**< */) -{ - return R->nSyms; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_key_sym_map_syms_end - ** - ** @param const xcb_xkb_key_sym_map_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_key_sym_map_syms_end (const xcb_xkb_key_sym_map_t *R /**< */) -{ - xcb_generic_iterator_t i; - i.data = ((xcb_keysym_t *) (R + 1)) + (R->nSyms); - i.rem = 0; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_key_sym_map_next - ** - ** @param xcb_xkb_key_sym_map_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_key_sym_map_next (xcb_xkb_key_sym_map_iterator_t *i /**< */) -{ - xcb_xkb_key_sym_map_t *R = i->data; - xcb_generic_iterator_t child; - child.data = (xcb_xkb_key_sym_map_t *)(((char *)R) + xcb_xkb_key_sym_map_sizeof(R)); - i->index = (char *) child.data - (char *) i->data; - --i->rem; - i->data = (xcb_xkb_key_sym_map_t *) child.data; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_key_sym_map_end - ** - ** @param xcb_xkb_key_sym_map_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_key_sym_map_end (xcb_xkb_key_sym_map_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - while(i.rem > 0) - xcb_xkb_key_sym_map_next(&i); - ret.data = i.data; - ret.rem = i.rem; - ret.index = i.index; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_common_behavior_next - ** - ** @param xcb_xkb_common_behavior_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_common_behavior_next (xcb_xkb_common_behavior_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_common_behavior_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_common_behavior_end - ** - ** @param xcb_xkb_common_behavior_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_common_behavior_end (xcb_xkb_common_behavior_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_default_behavior_next - ** - ** @param xcb_xkb_default_behavior_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_default_behavior_next (xcb_xkb_default_behavior_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_default_behavior_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_default_behavior_end - ** - ** @param xcb_xkb_default_behavior_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_default_behavior_end (xcb_xkb_default_behavior_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_lock_behavior_next - ** - ** @param xcb_xkb_lock_behavior_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_lock_behavior_next (xcb_xkb_lock_behavior_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_lock_behavior_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_lock_behavior_end - ** - ** @param xcb_xkb_lock_behavior_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_lock_behavior_end (xcb_xkb_lock_behavior_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_radio_group_behavior_next - ** - ** @param xcb_xkb_radio_group_behavior_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_radio_group_behavior_next (xcb_xkb_radio_group_behavior_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_radio_group_behavior_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_radio_group_behavior_end - ** - ** @param xcb_xkb_radio_group_behavior_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_radio_group_behavior_end (xcb_xkb_radio_group_behavior_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_overlay_behavior_next - ** - ** @param xcb_xkb_overlay_behavior_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_overlay_behavior_next (xcb_xkb_overlay_behavior_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_overlay_behavior_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_overlay_behavior_end - ** - ** @param xcb_xkb_overlay_behavior_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_overlay_behavior_end (xcb_xkb_overlay_behavior_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_permament_lock_behavior_next - ** - ** @param xcb_xkb_permament_lock_behavior_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_permament_lock_behavior_next (xcb_xkb_permament_lock_behavior_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_permament_lock_behavior_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_permament_lock_behavior_end - ** - ** @param xcb_xkb_permament_lock_behavior_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_permament_lock_behavior_end (xcb_xkb_permament_lock_behavior_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_permament_radio_group_behavior_next - ** - ** @param xcb_xkb_permament_radio_group_behavior_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_permament_radio_group_behavior_next (xcb_xkb_permament_radio_group_behavior_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_permament_radio_group_behavior_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_permament_radio_group_behavior_end - ** - ** @param xcb_xkb_permament_radio_group_behavior_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_permament_radio_group_behavior_end (xcb_xkb_permament_radio_group_behavior_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_permament_overlay_behavior_next - ** - ** @param xcb_xkb_permament_overlay_behavior_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_permament_overlay_behavior_next (xcb_xkb_permament_overlay_behavior_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_permament_overlay_behavior_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_permament_overlay_behavior_end - ** - ** @param xcb_xkb_permament_overlay_behavior_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_permament_overlay_behavior_end (xcb_xkb_permament_overlay_behavior_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_behavior_next - ** - ** @param xcb_xkb_behavior_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_behavior_next (xcb_xkb_behavior_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_behavior_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_behavior_end - ** - ** @param xcb_xkb_behavior_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_behavior_end (xcb_xkb_behavior_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_set_behavior_next - ** - ** @param xcb_xkb_set_behavior_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_set_behavior_next (xcb_xkb_set_behavior_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_set_behavior_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_set_behavior_end - ** - ** @param xcb_xkb_set_behavior_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_set_behavior_end (xcb_xkb_set_behavior_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_set_explicit_next - ** - ** @param xcb_xkb_set_explicit_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_set_explicit_next (xcb_xkb_set_explicit_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_set_explicit_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_set_explicit_end - ** - ** @param xcb_xkb_set_explicit_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_set_explicit_end (xcb_xkb_set_explicit_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_key_mod_map_next - ** - ** @param xcb_xkb_key_mod_map_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_key_mod_map_next (xcb_xkb_key_mod_map_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_key_mod_map_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_key_mod_map_end - ** - ** @param xcb_xkb_key_mod_map_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_key_mod_map_end (xcb_xkb_key_mod_map_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_key_v_mod_map_next - ** - ** @param xcb_xkb_key_v_mod_map_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_key_v_mod_map_next (xcb_xkb_key_v_mod_map_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_key_v_mod_map_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_key_v_mod_map_end - ** - ** @param xcb_xkb_key_v_mod_map_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_key_v_mod_map_end (xcb_xkb_key_v_mod_map_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_kt_set_map_entry_next - ** - ** @param xcb_xkb_kt_set_map_entry_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_kt_set_map_entry_next (xcb_xkb_kt_set_map_entry_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_kt_set_map_entry_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_kt_set_map_entry_end - ** - ** @param xcb_xkb_kt_set_map_entry_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_kt_set_map_entry_end (xcb_xkb_kt_set_map_entry_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - -int -xcb_xkb_set_key_type_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_xkb_set_key_type_t *_aux = (xcb_xkb_set_key_type_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to = 0; - - - xcb_block_len += sizeof(xcb_xkb_set_key_type_t); - xcb_tmp += xcb_block_len; - xcb_buffer_len += xcb_block_len; - xcb_block_len = 0; - /* entries */ - xcb_block_len += _aux->nMapEntries * sizeof(xcb_xkb_kt_set_map_entry_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_xkb_kt_set_map_entry_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* preserve_entries */ - xcb_block_len += (_aux->preserve * _aux->nMapEntries) * sizeof(xcb_xkb_kt_set_map_entry_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_xkb_kt_set_map_entry_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_xkb_kt_set_map_entry_t * xcb_xkb_set_key_type_entries - ** - ** @param const xcb_xkb_set_key_type_t *R - ** @returns xcb_xkb_kt_set_map_entry_t * - ** - *****************************************************************************/ - -xcb_xkb_kt_set_map_entry_t * -xcb_xkb_set_key_type_entries (const xcb_xkb_set_key_type_t *R /**< */) -{ - return (xcb_xkb_kt_set_map_entry_t *) (R + 1); -} - - -/***************************************************************************** - ** - ** int xcb_xkb_set_key_type_entries_length - ** - ** @param const xcb_xkb_set_key_type_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_set_key_type_entries_length (const xcb_xkb_set_key_type_t *R /**< */) -{ - return R->nMapEntries; -} - - -/***************************************************************************** - ** - ** xcb_xkb_kt_set_map_entry_iterator_t xcb_xkb_set_key_type_entries_iterator - ** - ** @param const xcb_xkb_set_key_type_t *R - ** @returns xcb_xkb_kt_set_map_entry_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_kt_set_map_entry_iterator_t -xcb_xkb_set_key_type_entries_iterator (const xcb_xkb_set_key_type_t *R /**< */) -{ - xcb_xkb_kt_set_map_entry_iterator_t i; - i.data = (xcb_xkb_kt_set_map_entry_t *) (R + 1); - i.rem = R->nMapEntries; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** xcb_xkb_kt_set_map_entry_t * xcb_xkb_set_key_type_preserve_entries - ** - ** @param const xcb_xkb_set_key_type_t *R - ** @returns xcb_xkb_kt_set_map_entry_t * - ** - *****************************************************************************/ - -xcb_xkb_kt_set_map_entry_t * -xcb_xkb_set_key_type_preserve_entries (const xcb_xkb_set_key_type_t *R /**< */) -{ - xcb_generic_iterator_t prev = xcb_xkb_kt_set_map_entry_end(xcb_xkb_set_key_type_entries_iterator(R)); - return (xcb_xkb_kt_set_map_entry_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xkb_kt_set_map_entry_t, prev.index) + 0); -} - - -/***************************************************************************** - ** - ** int xcb_xkb_set_key_type_preserve_entries_length - ** - ** @param const xcb_xkb_set_key_type_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_set_key_type_preserve_entries_length (const xcb_xkb_set_key_type_t *R /**< */) -{ - return (R->preserve * R->nMapEntries); -} - - -/***************************************************************************** - ** - ** xcb_xkb_kt_set_map_entry_iterator_t xcb_xkb_set_key_type_preserve_entries_iterator - ** - ** @param const xcb_xkb_set_key_type_t *R - ** @returns xcb_xkb_kt_set_map_entry_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_kt_set_map_entry_iterator_t -xcb_xkb_set_key_type_preserve_entries_iterator (const xcb_xkb_set_key_type_t *R /**< */) -{ - xcb_xkb_kt_set_map_entry_iterator_t i; - xcb_generic_iterator_t prev = xcb_xkb_kt_set_map_entry_end(xcb_xkb_set_key_type_entries_iterator(R)); - i.data = (xcb_xkb_kt_set_map_entry_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xkb_kt_set_map_entry_t, prev.index)); - i.rem = (R->preserve * R->nMapEntries); - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_set_key_type_next - ** - ** @param xcb_xkb_set_key_type_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_set_key_type_next (xcb_xkb_set_key_type_iterator_t *i /**< */) -{ - xcb_xkb_set_key_type_t *R = i->data; - xcb_generic_iterator_t child; - child.data = (xcb_xkb_set_key_type_t *)(((char *)R) + xcb_xkb_set_key_type_sizeof(R)); - i->index = (char *) child.data - (char *) i->data; - --i->rem; - i->data = (xcb_xkb_set_key_type_t *) child.data; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_set_key_type_end - ** - ** @param xcb_xkb_set_key_type_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_set_key_type_end (xcb_xkb_set_key_type_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - while(i.rem > 0) - xcb_xkb_set_key_type_next(&i); - ret.data = i.data; - ret.rem = i.rem; - ret.index = i.index; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_string8_next - ** - ** @param xcb_xkb_string8_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_string8_next (xcb_xkb_string8_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_string8_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_string8_end - ** - ** @param xcb_xkb_string8_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_string8_end (xcb_xkb_string8_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - -int -xcb_xkb_outline_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_xkb_outline_t *_aux = (xcb_xkb_outline_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to = 0; - - - xcb_block_len += sizeof(xcb_xkb_outline_t); - xcb_tmp += xcb_block_len; - xcb_buffer_len += xcb_block_len; - xcb_block_len = 0; - /* points */ - xcb_block_len += _aux->nPoints * sizeof(xcb_point_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_point_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_point_t * xcb_xkb_outline_points - ** - ** @param const xcb_xkb_outline_t *R - ** @returns xcb_point_t * - ** - *****************************************************************************/ - -xcb_point_t * -xcb_xkb_outline_points (const xcb_xkb_outline_t *R /**< */) -{ - return (xcb_point_t *) (R + 1); -} - - -/***************************************************************************** - ** - ** int xcb_xkb_outline_points_length - ** - ** @param const xcb_xkb_outline_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_outline_points_length (const xcb_xkb_outline_t *R /**< */) -{ - return R->nPoints; -} - - -/***************************************************************************** - ** - ** xcb_point_iterator_t xcb_xkb_outline_points_iterator - ** - ** @param const xcb_xkb_outline_t *R - ** @returns xcb_point_iterator_t - ** - *****************************************************************************/ - -xcb_point_iterator_t -xcb_xkb_outline_points_iterator (const xcb_xkb_outline_t *R /**< */) -{ - xcb_point_iterator_t i; - i.data = (xcb_point_t *) (R + 1); - i.rem = R->nPoints; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_outline_next - ** - ** @param xcb_xkb_outline_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_outline_next (xcb_xkb_outline_iterator_t *i /**< */) -{ - xcb_xkb_outline_t *R = i->data; - xcb_generic_iterator_t child; - child.data = (xcb_xkb_outline_t *)(((char *)R) + xcb_xkb_outline_sizeof(R)); - i->index = (char *) child.data - (char *) i->data; - --i->rem; - i->data = (xcb_xkb_outline_t *) child.data; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_outline_end - ** - ** @param xcb_xkb_outline_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_outline_end (xcb_xkb_outline_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - while(i.rem > 0) - xcb_xkb_outline_next(&i); - ret.data = i.data; - ret.rem = i.rem; - ret.index = i.index; - return ret; -} - -int -xcb_xkb_shape_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_xkb_shape_t *_aux = (xcb_xkb_shape_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to = 0; - - unsigned int i; - unsigned int xcb_tmp_len; - - xcb_block_len += sizeof(xcb_xkb_shape_t); - xcb_tmp += xcb_block_len; - xcb_buffer_len += xcb_block_len; - xcb_block_len = 0; - /* outlines */ - for(i=0; i<_aux->nOutlines; i++) { - xcb_tmp_len = xcb_xkb_outline_sizeof(xcb_tmp); - xcb_block_len += xcb_tmp_len; - xcb_tmp += xcb_tmp_len; - } - xcb_align_to = ALIGNOF(xcb_xkb_outline_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_shape_outlines_length - ** - ** @param const xcb_xkb_shape_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_shape_outlines_length (const xcb_xkb_shape_t *R /**< */) -{ - return R->nOutlines; -} - - -/***************************************************************************** - ** - ** xcb_xkb_outline_iterator_t xcb_xkb_shape_outlines_iterator - ** - ** @param const xcb_xkb_shape_t *R - ** @returns xcb_xkb_outline_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_outline_iterator_t -xcb_xkb_shape_outlines_iterator (const xcb_xkb_shape_t *R /**< */) -{ - xcb_xkb_outline_iterator_t i; - i.data = (xcb_xkb_outline_t *) (R + 1); - i.rem = R->nOutlines; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_shape_next - ** - ** @param xcb_xkb_shape_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_shape_next (xcb_xkb_shape_iterator_t *i /**< */) -{ - xcb_xkb_shape_t *R = i->data; - xcb_generic_iterator_t child; - child.data = (xcb_xkb_shape_t *)(((char *)R) + xcb_xkb_shape_sizeof(R)); - i->index = (char *) child.data - (char *) i->data; - --i->rem; - i->data = (xcb_xkb_shape_t *) child.data; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_shape_end - ** - ** @param xcb_xkb_shape_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_shape_end (xcb_xkb_shape_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - while(i.rem > 0) - xcb_xkb_shape_next(&i); - ret.data = i.data; - ret.rem = i.rem; - ret.index = i.index; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_key_next - ** - ** @param xcb_xkb_key_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_key_next (xcb_xkb_key_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_key_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_key_end - ** - ** @param xcb_xkb_key_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_key_end (xcb_xkb_key_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_overlay_key_next - ** - ** @param xcb_xkb_overlay_key_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_overlay_key_next (xcb_xkb_overlay_key_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_overlay_key_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_overlay_key_end - ** - ** @param xcb_xkb_overlay_key_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_overlay_key_end (xcb_xkb_overlay_key_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - -int -xcb_xkb_overlay_row_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_xkb_overlay_row_t *_aux = (xcb_xkb_overlay_row_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to = 0; - - - xcb_block_len += sizeof(xcb_xkb_overlay_row_t); - xcb_tmp += xcb_block_len; - xcb_buffer_len += xcb_block_len; - xcb_block_len = 0; - /* keys */ - xcb_block_len += _aux->nKeys * sizeof(xcb_xkb_overlay_key_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_xkb_overlay_key_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_xkb_overlay_key_t * xcb_xkb_overlay_row_keys - ** - ** @param const xcb_xkb_overlay_row_t *R - ** @returns xcb_xkb_overlay_key_t * - ** - *****************************************************************************/ - -xcb_xkb_overlay_key_t * -xcb_xkb_overlay_row_keys (const xcb_xkb_overlay_row_t *R /**< */) -{ - return (xcb_xkb_overlay_key_t *) (R + 1); -} - - -/***************************************************************************** - ** - ** int xcb_xkb_overlay_row_keys_length - ** - ** @param const xcb_xkb_overlay_row_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_overlay_row_keys_length (const xcb_xkb_overlay_row_t *R /**< */) -{ - return R->nKeys; -} - - -/***************************************************************************** - ** - ** xcb_xkb_overlay_key_iterator_t xcb_xkb_overlay_row_keys_iterator - ** - ** @param const xcb_xkb_overlay_row_t *R - ** @returns xcb_xkb_overlay_key_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_overlay_key_iterator_t -xcb_xkb_overlay_row_keys_iterator (const xcb_xkb_overlay_row_t *R /**< */) -{ - xcb_xkb_overlay_key_iterator_t i; - i.data = (xcb_xkb_overlay_key_t *) (R + 1); - i.rem = R->nKeys; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_overlay_row_next - ** - ** @param xcb_xkb_overlay_row_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_overlay_row_next (xcb_xkb_overlay_row_iterator_t *i /**< */) -{ - xcb_xkb_overlay_row_t *R = i->data; - xcb_generic_iterator_t child; - child.data = (xcb_xkb_overlay_row_t *)(((char *)R) + xcb_xkb_overlay_row_sizeof(R)); - i->index = (char *) child.data - (char *) i->data; - --i->rem; - i->data = (xcb_xkb_overlay_row_t *) child.data; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_overlay_row_end - ** - ** @param xcb_xkb_overlay_row_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_overlay_row_end (xcb_xkb_overlay_row_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - while(i.rem > 0) - xcb_xkb_overlay_row_next(&i); - ret.data = i.data; - ret.rem = i.rem; - ret.index = i.index; - return ret; -} - -int -xcb_xkb_overlay_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_xkb_overlay_t *_aux = (xcb_xkb_overlay_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to = 0; - - unsigned int i; - unsigned int xcb_tmp_len; - - xcb_block_len += sizeof(xcb_xkb_overlay_t); - xcb_tmp += xcb_block_len; - xcb_buffer_len += xcb_block_len; - xcb_block_len = 0; - /* rows */ - for(i=0; i<_aux->nRows; i++) { - xcb_tmp_len = xcb_xkb_overlay_row_sizeof(xcb_tmp); - xcb_block_len += xcb_tmp_len; - xcb_tmp += xcb_tmp_len; - } - xcb_align_to = ALIGNOF(xcb_xkb_overlay_row_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_overlay_rows_length - ** - ** @param const xcb_xkb_overlay_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_overlay_rows_length (const xcb_xkb_overlay_t *R /**< */) -{ - return R->nRows; -} - - -/***************************************************************************** - ** - ** xcb_xkb_overlay_row_iterator_t xcb_xkb_overlay_rows_iterator - ** - ** @param const xcb_xkb_overlay_t *R - ** @returns xcb_xkb_overlay_row_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_overlay_row_iterator_t -xcb_xkb_overlay_rows_iterator (const xcb_xkb_overlay_t *R /**< */) -{ - xcb_xkb_overlay_row_iterator_t i; - i.data = (xcb_xkb_overlay_row_t *) (R + 1); - i.rem = R->nRows; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_overlay_next - ** - ** @param xcb_xkb_overlay_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_overlay_next (xcb_xkb_overlay_iterator_t *i /**< */) -{ - xcb_xkb_overlay_t *R = i->data; - xcb_generic_iterator_t child; - child.data = (xcb_xkb_overlay_t *)(((char *)R) + xcb_xkb_overlay_sizeof(R)); - i->index = (char *) child.data - (char *) i->data; - --i->rem; - i->data = (xcb_xkb_overlay_t *) child.data; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_overlay_end - ** - ** @param xcb_xkb_overlay_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_overlay_end (xcb_xkb_overlay_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - while(i.rem > 0) - xcb_xkb_overlay_next(&i); - ret.data = i.data; - ret.rem = i.rem; - ret.index = i.index; - return ret; -} - -int -xcb_xkb_row_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_xkb_row_t *_aux = (xcb_xkb_row_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to = 0; - - - xcb_block_len += sizeof(xcb_xkb_row_t); - xcb_tmp += xcb_block_len; - xcb_buffer_len += xcb_block_len; - xcb_block_len = 0; - /* keys */ - xcb_block_len += _aux->nKeys * sizeof(xcb_xkb_key_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_xkb_key_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_xkb_key_t * xcb_xkb_row_keys - ** - ** @param const xcb_xkb_row_t *R - ** @returns xcb_xkb_key_t * - ** - *****************************************************************************/ - -xcb_xkb_key_t * -xcb_xkb_row_keys (const xcb_xkb_row_t *R /**< */) -{ - return (xcb_xkb_key_t *) (R + 1); -} - - -/***************************************************************************** - ** - ** int xcb_xkb_row_keys_length - ** - ** @param const xcb_xkb_row_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_row_keys_length (const xcb_xkb_row_t *R /**< */) -{ - return R->nKeys; -} - - -/***************************************************************************** - ** - ** xcb_xkb_key_iterator_t xcb_xkb_row_keys_iterator - ** - ** @param const xcb_xkb_row_t *R - ** @returns xcb_xkb_key_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_key_iterator_t -xcb_xkb_row_keys_iterator (const xcb_xkb_row_t *R /**< */) -{ - xcb_xkb_key_iterator_t i; - i.data = (xcb_xkb_key_t *) (R + 1); - i.rem = R->nKeys; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_row_next - ** - ** @param xcb_xkb_row_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_row_next (xcb_xkb_row_iterator_t *i /**< */) -{ - xcb_xkb_row_t *R = i->data; - xcb_generic_iterator_t child; - child.data = (xcb_xkb_row_t *)(((char *)R) + xcb_xkb_row_sizeof(R)); - i->index = (char *) child.data - (char *) i->data; - --i->rem; - i->data = (xcb_xkb_row_t *) child.data; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_row_end - ** - ** @param xcb_xkb_row_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_row_end (xcb_xkb_row_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - while(i.rem > 0) - xcb_xkb_row_next(&i); - ret.data = i.data; - ret.rem = i.rem; - ret.index = i.index; - return ret; -} - -int -xcb_xkb_listing_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_xkb_listing_t *_aux = (xcb_xkb_listing_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to = 0; - - - xcb_block_len += sizeof(xcb_xkb_listing_t); - xcb_tmp += xcb_block_len; - xcb_buffer_len += xcb_block_len; - xcb_block_len = 0; - /* string */ - xcb_block_len += _aux->length * sizeof(xcb_xkb_string8_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_xkb_string8_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_xkb_string8_t * xcb_xkb_listing_string - ** - ** @param const xcb_xkb_listing_t *R - ** @returns xcb_xkb_string8_t * - ** - *****************************************************************************/ - -xcb_xkb_string8_t * -xcb_xkb_listing_string (const xcb_xkb_listing_t *R /**< */) -{ - return (xcb_xkb_string8_t *) (R + 1); -} - - -/***************************************************************************** - ** - ** int xcb_xkb_listing_string_length - ** - ** @param const xcb_xkb_listing_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_listing_string_length (const xcb_xkb_listing_t *R /**< */) -{ - return R->length; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_listing_string_end - ** - ** @param const xcb_xkb_listing_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_listing_string_end (const xcb_xkb_listing_t *R /**< */) -{ - xcb_generic_iterator_t i; - i.data = ((xcb_xkb_string8_t *) (R + 1)) + (R->length); - i.rem = 0; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_listing_next - ** - ** @param xcb_xkb_listing_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_listing_next (xcb_xkb_listing_iterator_t *i /**< */) -{ - xcb_xkb_listing_t *R = i->data; - xcb_generic_iterator_t child; - child.data = (xcb_xkb_listing_t *)(((char *)R) + xcb_xkb_listing_sizeof(R)); - i->index = (char *) child.data - (char *) i->data; - --i->rem; - i->data = (xcb_xkb_listing_t *) child.data; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_listing_end - ** - ** @param xcb_xkb_listing_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_listing_end (xcb_xkb_listing_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - while(i.rem > 0) - xcb_xkb_listing_next(&i); - ret.data = i.data; - ret.rem = i.rem; - ret.index = i.index; - return ret; -} - -int -xcb_xkb_device_led_info_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_xkb_device_led_info_t *_aux = (xcb_xkb_device_led_info_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to = 0; - - - xcb_block_len += sizeof(xcb_xkb_device_led_info_t); - xcb_tmp += xcb_block_len; - xcb_buffer_len += xcb_block_len; - xcb_block_len = 0; - /* names */ - xcb_block_len += xcb_popcount(_aux->namesPresent) * sizeof(uint32_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_atom_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* maps */ - xcb_block_len += xcb_popcount(_aux->mapsPresent) * sizeof(xcb_xkb_indicator_map_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_xkb_indicator_map_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_atom_t * xcb_xkb_device_led_info_names - ** - ** @param const xcb_xkb_device_led_info_t *R - ** @returns xcb_atom_t * - ** - *****************************************************************************/ - -xcb_atom_t * -xcb_xkb_device_led_info_names (const xcb_xkb_device_led_info_t *R /**< */) -{ - return (xcb_atom_t *) (R + 1); -} - - -/***************************************************************************** - ** - ** int xcb_xkb_device_led_info_names_length - ** - ** @param const xcb_xkb_device_led_info_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_device_led_info_names_length (const xcb_xkb_device_led_info_t *R /**< */) -{ - return xcb_popcount(R->namesPresent); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_device_led_info_names_end - ** - ** @param const xcb_xkb_device_led_info_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_device_led_info_names_end (const xcb_xkb_device_led_info_t *R /**< */) -{ - xcb_generic_iterator_t i; - i.data = ((xcb_atom_t *) (R + 1)) + (xcb_popcount(R->namesPresent)); - i.rem = 0; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** xcb_xkb_indicator_map_t * xcb_xkb_device_led_info_maps - ** - ** @param const xcb_xkb_device_led_info_t *R - ** @returns xcb_xkb_indicator_map_t * - ** - *****************************************************************************/ - -xcb_xkb_indicator_map_t * -xcb_xkb_device_led_info_maps (const xcb_xkb_device_led_info_t *R /**< */) -{ - xcb_generic_iterator_t prev = xcb_xkb_device_led_info_names_end(R); - return (xcb_xkb_indicator_map_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xkb_indicator_map_t, prev.index) + 0); -} - - -/***************************************************************************** - ** - ** int xcb_xkb_device_led_info_maps_length - ** - ** @param const xcb_xkb_device_led_info_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_device_led_info_maps_length (const xcb_xkb_device_led_info_t *R /**< */) -{ - return xcb_popcount(R->mapsPresent); -} - - -/***************************************************************************** - ** - ** xcb_xkb_indicator_map_iterator_t xcb_xkb_device_led_info_maps_iterator - ** - ** @param const xcb_xkb_device_led_info_t *R - ** @returns xcb_xkb_indicator_map_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_indicator_map_iterator_t -xcb_xkb_device_led_info_maps_iterator (const xcb_xkb_device_led_info_t *R /**< */) -{ - xcb_xkb_indicator_map_iterator_t i; - xcb_generic_iterator_t prev = xcb_xkb_device_led_info_names_end(R); - i.data = (xcb_xkb_indicator_map_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xkb_indicator_map_t, prev.index)); - i.rem = xcb_popcount(R->mapsPresent); - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_device_led_info_next - ** - ** @param xcb_xkb_device_led_info_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_device_led_info_next (xcb_xkb_device_led_info_iterator_t *i /**< */) -{ - xcb_xkb_device_led_info_t *R = i->data; - xcb_generic_iterator_t child; - child.data = (xcb_xkb_device_led_info_t *)(((char *)R) + xcb_xkb_device_led_info_sizeof(R)); - i->index = (char *) child.data - (char *) i->data; - --i->rem; - i->data = (xcb_xkb_device_led_info_t *) child.data; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_device_led_info_end - ** - ** @param xcb_xkb_device_led_info_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_device_led_info_end (xcb_xkb_device_led_info_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - while(i.rem > 0) - xcb_xkb_device_led_info_next(&i); - ret.data = i.data; - ret.rem = i.rem; - ret.index = i.index; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_sa_no_action_next - ** - ** @param xcb_xkb_sa_no_action_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_sa_no_action_next (xcb_xkb_sa_no_action_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_sa_no_action_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_sa_no_action_end - ** - ** @param xcb_xkb_sa_no_action_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_sa_no_action_end (xcb_xkb_sa_no_action_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_sa_set_mods_next - ** - ** @param xcb_xkb_sa_set_mods_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_sa_set_mods_next (xcb_xkb_sa_set_mods_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_sa_set_mods_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_sa_set_mods_end - ** - ** @param xcb_xkb_sa_set_mods_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_sa_set_mods_end (xcb_xkb_sa_set_mods_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_sa_latch_mods_next - ** - ** @param xcb_xkb_sa_latch_mods_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_sa_latch_mods_next (xcb_xkb_sa_latch_mods_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_sa_latch_mods_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_sa_latch_mods_end - ** - ** @param xcb_xkb_sa_latch_mods_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_sa_latch_mods_end (xcb_xkb_sa_latch_mods_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_sa_lock_mods_next - ** - ** @param xcb_xkb_sa_lock_mods_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_sa_lock_mods_next (xcb_xkb_sa_lock_mods_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_sa_lock_mods_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_sa_lock_mods_end - ** - ** @param xcb_xkb_sa_lock_mods_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_sa_lock_mods_end (xcb_xkb_sa_lock_mods_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_sa_set_group_next - ** - ** @param xcb_xkb_sa_set_group_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_sa_set_group_next (xcb_xkb_sa_set_group_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_sa_set_group_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_sa_set_group_end - ** - ** @param xcb_xkb_sa_set_group_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_sa_set_group_end (xcb_xkb_sa_set_group_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_sa_latch_group_next - ** - ** @param xcb_xkb_sa_latch_group_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_sa_latch_group_next (xcb_xkb_sa_latch_group_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_sa_latch_group_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_sa_latch_group_end - ** - ** @param xcb_xkb_sa_latch_group_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_sa_latch_group_end (xcb_xkb_sa_latch_group_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_sa_lock_group_next - ** - ** @param xcb_xkb_sa_lock_group_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_sa_lock_group_next (xcb_xkb_sa_lock_group_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_sa_lock_group_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_sa_lock_group_end - ** - ** @param xcb_xkb_sa_lock_group_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_sa_lock_group_end (xcb_xkb_sa_lock_group_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_sa_move_ptr_next - ** - ** @param xcb_xkb_sa_move_ptr_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_sa_move_ptr_next (xcb_xkb_sa_move_ptr_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_sa_move_ptr_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_sa_move_ptr_end - ** - ** @param xcb_xkb_sa_move_ptr_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_sa_move_ptr_end (xcb_xkb_sa_move_ptr_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_sa_ptr_btn_next - ** - ** @param xcb_xkb_sa_ptr_btn_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_sa_ptr_btn_next (xcb_xkb_sa_ptr_btn_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_sa_ptr_btn_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_sa_ptr_btn_end - ** - ** @param xcb_xkb_sa_ptr_btn_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_sa_ptr_btn_end (xcb_xkb_sa_ptr_btn_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_sa_lock_ptr_btn_next - ** - ** @param xcb_xkb_sa_lock_ptr_btn_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_sa_lock_ptr_btn_next (xcb_xkb_sa_lock_ptr_btn_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_sa_lock_ptr_btn_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_sa_lock_ptr_btn_end - ** - ** @param xcb_xkb_sa_lock_ptr_btn_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_sa_lock_ptr_btn_end (xcb_xkb_sa_lock_ptr_btn_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_sa_set_ptr_dflt_next - ** - ** @param xcb_xkb_sa_set_ptr_dflt_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_sa_set_ptr_dflt_next (xcb_xkb_sa_set_ptr_dflt_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_sa_set_ptr_dflt_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_sa_set_ptr_dflt_end - ** - ** @param xcb_xkb_sa_set_ptr_dflt_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_sa_set_ptr_dflt_end (xcb_xkb_sa_set_ptr_dflt_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_sa_iso_lock_next - ** - ** @param xcb_xkb_sa_iso_lock_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_sa_iso_lock_next (xcb_xkb_sa_iso_lock_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_sa_iso_lock_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_sa_iso_lock_end - ** - ** @param xcb_xkb_sa_iso_lock_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_sa_iso_lock_end (xcb_xkb_sa_iso_lock_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_sa_terminate_next - ** - ** @param xcb_xkb_sa_terminate_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_sa_terminate_next (xcb_xkb_sa_terminate_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_sa_terminate_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_sa_terminate_end - ** - ** @param xcb_xkb_sa_terminate_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_sa_terminate_end (xcb_xkb_sa_terminate_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_sa_switch_screen_next - ** - ** @param xcb_xkb_sa_switch_screen_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_sa_switch_screen_next (xcb_xkb_sa_switch_screen_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_sa_switch_screen_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_sa_switch_screen_end - ** - ** @param xcb_xkb_sa_switch_screen_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_sa_switch_screen_end (xcb_xkb_sa_switch_screen_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_sa_set_controls_next - ** - ** @param xcb_xkb_sa_set_controls_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_sa_set_controls_next (xcb_xkb_sa_set_controls_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_sa_set_controls_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_sa_set_controls_end - ** - ** @param xcb_xkb_sa_set_controls_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_sa_set_controls_end (xcb_xkb_sa_set_controls_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_sa_lock_controls_next - ** - ** @param xcb_xkb_sa_lock_controls_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_sa_lock_controls_next (xcb_xkb_sa_lock_controls_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_sa_lock_controls_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_sa_lock_controls_end - ** - ** @param xcb_xkb_sa_lock_controls_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_sa_lock_controls_end (xcb_xkb_sa_lock_controls_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_sa_action_message_next - ** - ** @param xcb_xkb_sa_action_message_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_sa_action_message_next (xcb_xkb_sa_action_message_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_sa_action_message_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_sa_action_message_end - ** - ** @param xcb_xkb_sa_action_message_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_sa_action_message_end (xcb_xkb_sa_action_message_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_sa_redirect_key_next - ** - ** @param xcb_xkb_sa_redirect_key_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_sa_redirect_key_next (xcb_xkb_sa_redirect_key_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_sa_redirect_key_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_sa_redirect_key_end - ** - ** @param xcb_xkb_sa_redirect_key_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_sa_redirect_key_end (xcb_xkb_sa_redirect_key_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_sa_device_btn_next - ** - ** @param xcb_xkb_sa_device_btn_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_sa_device_btn_next (xcb_xkb_sa_device_btn_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_sa_device_btn_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_sa_device_btn_end - ** - ** @param xcb_xkb_sa_device_btn_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_sa_device_btn_end (xcb_xkb_sa_device_btn_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_sa_lock_device_btn_next - ** - ** @param xcb_xkb_sa_lock_device_btn_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_sa_lock_device_btn_next (xcb_xkb_sa_lock_device_btn_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_sa_lock_device_btn_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_sa_lock_device_btn_end - ** - ** @param xcb_xkb_sa_lock_device_btn_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_sa_lock_device_btn_end (xcb_xkb_sa_lock_device_btn_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_sa_device_valuator_next - ** - ** @param xcb_xkb_sa_device_valuator_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_sa_device_valuator_next (xcb_xkb_sa_device_valuator_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_sa_device_valuator_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_sa_device_valuator_end - ** - ** @param xcb_xkb_sa_device_valuator_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_sa_device_valuator_end (xcb_xkb_sa_device_valuator_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_si_action_next - ** - ** @param xcb_xkb_si_action_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_si_action_next (xcb_xkb_si_action_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_si_action_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_si_action_end - ** - ** @param xcb_xkb_si_action_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_si_action_end (xcb_xkb_si_action_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_sym_interpret_next - ** - ** @param xcb_xkb_sym_interpret_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_sym_interpret_next (xcb_xkb_sym_interpret_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_sym_interpret_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_sym_interpret_end - ** - ** @param xcb_xkb_sym_interpret_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_sym_interpret_end (xcb_xkb_sym_interpret_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** void xcb_xkb_action_next - ** - ** @param xcb_xkb_action_iterator_t *i - ** @returns void - ** - *****************************************************************************/ - -void -xcb_xkb_action_next (xcb_xkb_action_iterator_t *i /**< */) -{ - --i->rem; - ++i->data; - i->index += sizeof(xcb_xkb_action_t); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_action_end - ** - ** @param xcb_xkb_action_iterator_t i - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_action_end (xcb_xkb_action_iterator_t i /**< */) -{ - xcb_generic_iterator_t ret; - ret.data = i.data + i.rem; - ret.index = i.index + ((char *) ret.data - (char *) i.data); - ret.rem = 0; - return ret; -} - - -/***************************************************************************** - ** - ** xcb_xkb_use_extension_cookie_t xcb_xkb_use_extension - ** - ** @param xcb_connection_t *c - ** @param uint16_t wantedMajor - ** @param uint16_t wantedMinor - ** @returns xcb_xkb_use_extension_cookie_t - ** - *****************************************************************************/ - -xcb_xkb_use_extension_cookie_t -xcb_xkb_use_extension (xcb_connection_t *c /**< */, - uint16_t wantedMajor /**< */, - uint16_t wantedMinor /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_USE_EXTENSION, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_xkb_use_extension_cookie_t xcb_ret; - xcb_xkb_use_extension_request_t xcb_out; - - xcb_out.wantedMajor = wantedMajor; - xcb_out.wantedMinor = wantedMinor; - - 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_xkb_use_extension_cookie_t xcb_xkb_use_extension_unchecked - ** - ** @param xcb_connection_t *c - ** @param uint16_t wantedMajor - ** @param uint16_t wantedMinor - ** @returns xcb_xkb_use_extension_cookie_t - ** - *****************************************************************************/ - -xcb_xkb_use_extension_cookie_t -xcb_xkb_use_extension_unchecked (xcb_connection_t *c /**< */, - uint16_t wantedMajor /**< */, - uint16_t wantedMinor /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_USE_EXTENSION, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_xkb_use_extension_cookie_t xcb_ret; - xcb_xkb_use_extension_request_t xcb_out; - - xcb_out.wantedMajor = wantedMajor; - xcb_out.wantedMinor = wantedMinor; - - 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_xkb_use_extension_reply_t * xcb_xkb_use_extension_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_use_extension_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_xkb_use_extension_reply_t * - ** - *****************************************************************************/ - -xcb_xkb_use_extension_reply_t * -xcb_xkb_use_extension_reply (xcb_connection_t *c /**< */, - xcb_xkb_use_extension_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_xkb_use_extension_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - -int -xcb_xkb_select_events_details_serialize (void **_buffer /**< */, - uint16_t affectWhich /**< */, - uint16_t clear /**< */, - uint16_t selectAll /**< */, - const xcb_xkb_select_events_details_t *_aux /**< */) -{ - char *xcb_out = *_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_align_to = 0; - - unsigned int xcb_pad = 0; - char xcb_pad0[3] = {0, 0, 0}; - struct iovec xcb_parts[23]; - unsigned int xcb_parts_idx = 0; - unsigned int xcb_block_len = 0; - unsigned int i; - char *xcb_tmp; - - if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_NEW_KEYBOARD_NOTIFY) { - /* xcb_xkb_select_events_details_t.affectNewKeyboard */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->affectNewKeyboard; - xcb_block_len += sizeof(uint16_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_select_events_details_t.newKeyboardDetails */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->newKeyboardDetails; - xcb_block_len += sizeof(uint16_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint16_t); - } - if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_STATE_NOTIFY) { - /* xcb_xkb_select_events_details_t.affectState */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->affectState; - xcb_block_len += sizeof(uint16_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_select_events_details_t.stateDetails */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->stateDetails; - xcb_block_len += sizeof(uint16_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint16_t); - } - if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_CONTROLS_NOTIFY) { - /* xcb_xkb_select_events_details_t.affectCtrls */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->affectCtrls; - xcb_block_len += sizeof(uint32_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint32_t); - /* xcb_xkb_select_events_details_t.ctrlDetails */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->ctrlDetails; - xcb_block_len += sizeof(uint32_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint32_t); - } - if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_INDICATOR_STATE_NOTIFY) { - /* xcb_xkb_select_events_details_t.affectIndicatorState */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->affectIndicatorState; - xcb_block_len += sizeof(uint32_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint32_t); - /* xcb_xkb_select_events_details_t.indicatorStateDetails */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->indicatorStateDetails; - xcb_block_len += sizeof(uint32_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint32_t); - } - if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_INDICATOR_MAP_NOTIFY) { - /* xcb_xkb_select_events_details_t.affectIndicatorMap */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->affectIndicatorMap; - xcb_block_len += sizeof(uint32_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint32_t); - /* xcb_xkb_select_events_details_t.indicatorMapDetails */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->indicatorMapDetails; - xcb_block_len += sizeof(uint32_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint32_t); - } - if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_NAMES_NOTIFY) { - /* xcb_xkb_select_events_details_t.affectNames */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->affectNames; - xcb_block_len += sizeof(uint16_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_select_events_details_t.namesDetails */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->namesDetails; - xcb_block_len += sizeof(uint16_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint16_t); - } - if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_COMPAT_MAP_NOTIFY) { - /* xcb_xkb_select_events_details_t.affectCompat */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->affectCompat; - xcb_block_len += sizeof(uint8_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_select_events_details_t.compatDetails */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->compatDetails; - xcb_block_len += sizeof(uint8_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - } - if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_BELL_NOTIFY) { - /* xcb_xkb_select_events_details_t.affectBell */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->affectBell; - xcb_block_len += sizeof(uint8_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_select_events_details_t.bellDetails */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->bellDetails; - xcb_block_len += sizeof(uint8_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - } - if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_ACTION_MESSAGE) { - /* xcb_xkb_select_events_details_t.affectMsgDetails */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->affectMsgDetails; - xcb_block_len += sizeof(uint8_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_select_events_details_t.msgDetails */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->msgDetails; - xcb_block_len += sizeof(uint8_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - } - if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_ACCESS_X_NOTIFY) { - /* xcb_xkb_select_events_details_t.affectAccessX */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->affectAccessX; - xcb_block_len += sizeof(uint16_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_select_events_details_t.accessXDetails */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->accessXDetails; - xcb_block_len += sizeof(uint16_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint16_t); - } - if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_EXTENSION_DEVICE_NOTIFY) { - /* xcb_xkb_select_events_details_t.affectExtDev */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->affectExtDev; - xcb_block_len += sizeof(uint16_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_select_events_details_t.extdevDetails */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->extdevDetails; - xcb_block_len += sizeof(uint16_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint16_t); - } - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - - if (NULL == xcb_out) { - /* allocate memory */ - xcb_out = malloc(xcb_buffer_len); - *_buffer = xcb_out; - } - - xcb_tmp = xcb_out; - for(i=0; i<xcb_parts_idx; i++) { - if (0 != xcb_parts[i].iov_base && 0 != xcb_parts[i].iov_len) - memcpy(xcb_tmp, xcb_parts[i].iov_base, xcb_parts[i].iov_len); - if (0 != xcb_parts[i].iov_len) - xcb_tmp += xcb_parts[i].iov_len; - } - - return xcb_buffer_len; -} - -int -xcb_xkb_select_events_details_unpack (const void *_buffer /**< */, - uint16_t affectWhich /**< */, - uint16_t clear /**< */, - uint16_t selectAll /**< */, - xcb_xkb_select_events_details_t *_aux /**< */) -{ - char *xcb_tmp = (char *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to = 0; - - - if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_NEW_KEYBOARD_NOTIFY) { - /* xcb_xkb_select_events_details_t.affectNewKeyboard */ - _aux->affectNewKeyboard = *(uint16_t *)xcb_tmp; - xcb_block_len += sizeof(uint16_t); - xcb_tmp += sizeof(uint16_t); - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_select_events_details_t.newKeyboardDetails */ - _aux->newKeyboardDetails = *(uint16_t *)xcb_tmp; - xcb_block_len += sizeof(uint16_t); - xcb_tmp += sizeof(uint16_t); - xcb_align_to = ALIGNOF(uint16_t); - } - if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_STATE_NOTIFY) { - /* xcb_xkb_select_events_details_t.affectState */ - _aux->affectState = *(uint16_t *)xcb_tmp; - xcb_block_len += sizeof(uint16_t); - xcb_tmp += sizeof(uint16_t); - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_select_events_details_t.stateDetails */ - _aux->stateDetails = *(uint16_t *)xcb_tmp; - xcb_block_len += sizeof(uint16_t); - xcb_tmp += sizeof(uint16_t); - xcb_align_to = ALIGNOF(uint16_t); - } - if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_CONTROLS_NOTIFY) { - /* xcb_xkb_select_events_details_t.affectCtrls */ - _aux->affectCtrls = *(uint32_t *)xcb_tmp; - xcb_block_len += sizeof(uint32_t); - xcb_tmp += sizeof(uint32_t); - xcb_align_to = ALIGNOF(uint32_t); - /* xcb_xkb_select_events_details_t.ctrlDetails */ - _aux->ctrlDetails = *(uint32_t *)xcb_tmp; - xcb_block_len += sizeof(uint32_t); - xcb_tmp += sizeof(uint32_t); - xcb_align_to = ALIGNOF(uint32_t); - } - if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_INDICATOR_STATE_NOTIFY) { - /* xcb_xkb_select_events_details_t.affectIndicatorState */ - _aux->affectIndicatorState = *(uint32_t *)xcb_tmp; - xcb_block_len += sizeof(uint32_t); - xcb_tmp += sizeof(uint32_t); - xcb_align_to = ALIGNOF(uint32_t); - /* xcb_xkb_select_events_details_t.indicatorStateDetails */ - _aux->indicatorStateDetails = *(uint32_t *)xcb_tmp; - xcb_block_len += sizeof(uint32_t); - xcb_tmp += sizeof(uint32_t); - xcb_align_to = ALIGNOF(uint32_t); - } - if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_INDICATOR_MAP_NOTIFY) { - /* xcb_xkb_select_events_details_t.affectIndicatorMap */ - _aux->affectIndicatorMap = *(uint32_t *)xcb_tmp; - xcb_block_len += sizeof(uint32_t); - xcb_tmp += sizeof(uint32_t); - xcb_align_to = ALIGNOF(uint32_t); - /* xcb_xkb_select_events_details_t.indicatorMapDetails */ - _aux->indicatorMapDetails = *(uint32_t *)xcb_tmp; - xcb_block_len += sizeof(uint32_t); - xcb_tmp += sizeof(uint32_t); - xcb_align_to = ALIGNOF(uint32_t); - } - if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_NAMES_NOTIFY) { - /* xcb_xkb_select_events_details_t.affectNames */ - _aux->affectNames = *(uint16_t *)xcb_tmp; - xcb_block_len += sizeof(uint16_t); - xcb_tmp += sizeof(uint16_t); - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_select_events_details_t.namesDetails */ - _aux->namesDetails = *(uint16_t *)xcb_tmp; - xcb_block_len += sizeof(uint16_t); - xcb_tmp += sizeof(uint16_t); - xcb_align_to = ALIGNOF(uint16_t); - } - if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_COMPAT_MAP_NOTIFY) { - /* xcb_xkb_select_events_details_t.affectCompat */ - _aux->affectCompat = *(uint8_t *)xcb_tmp; - xcb_block_len += sizeof(uint8_t); - xcb_tmp += sizeof(uint8_t); - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_select_events_details_t.compatDetails */ - _aux->compatDetails = *(uint8_t *)xcb_tmp; - xcb_block_len += sizeof(uint8_t); - xcb_tmp += sizeof(uint8_t); - xcb_align_to = ALIGNOF(uint8_t); - } - if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_BELL_NOTIFY) { - /* xcb_xkb_select_events_details_t.affectBell */ - _aux->affectBell = *(uint8_t *)xcb_tmp; - xcb_block_len += sizeof(uint8_t); - xcb_tmp += sizeof(uint8_t); - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_select_events_details_t.bellDetails */ - _aux->bellDetails = *(uint8_t *)xcb_tmp; - xcb_block_len += sizeof(uint8_t); - xcb_tmp += sizeof(uint8_t); - xcb_align_to = ALIGNOF(uint8_t); - } - if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_ACTION_MESSAGE) { - /* xcb_xkb_select_events_details_t.affectMsgDetails */ - _aux->affectMsgDetails = *(uint8_t *)xcb_tmp; - xcb_block_len += sizeof(uint8_t); - xcb_tmp += sizeof(uint8_t); - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_select_events_details_t.msgDetails */ - _aux->msgDetails = *(uint8_t *)xcb_tmp; - xcb_block_len += sizeof(uint8_t); - xcb_tmp += sizeof(uint8_t); - xcb_align_to = ALIGNOF(uint8_t); - } - if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_ACCESS_X_NOTIFY) { - /* xcb_xkb_select_events_details_t.affectAccessX */ - _aux->affectAccessX = *(uint16_t *)xcb_tmp; - xcb_block_len += sizeof(uint16_t); - xcb_tmp += sizeof(uint16_t); - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_select_events_details_t.accessXDetails */ - _aux->accessXDetails = *(uint16_t *)xcb_tmp; - xcb_block_len += sizeof(uint16_t); - xcb_tmp += sizeof(uint16_t); - xcb_align_to = ALIGNOF(uint16_t); - } - if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_EXTENSION_DEVICE_NOTIFY) { - /* xcb_xkb_select_events_details_t.affectExtDev */ - _aux->affectExtDev = *(uint16_t *)xcb_tmp; - xcb_block_len += sizeof(uint16_t); - xcb_tmp += sizeof(uint16_t); - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_select_events_details_t.extdevDetails */ - _aux->extdevDetails = *(uint16_t *)xcb_tmp; - xcb_block_len += sizeof(uint16_t); - xcb_tmp += sizeof(uint16_t); - xcb_align_to = ALIGNOF(uint16_t); - } - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - -int -xcb_xkb_select_events_details_sizeof (const void *_buffer /**< */, - uint16_t affectWhich /**< */, - uint16_t clear /**< */, - uint16_t selectAll /**< */) -{ - xcb_xkb_select_events_details_t _aux; - return xcb_xkb_select_events_details_unpack(_buffer, affectWhich, clear, selectAll, &_aux); -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_xkb_select_events_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @param uint16_t affectWhich - ** @param uint16_t clear - ** @param uint16_t selectAll - ** @param uint16_t affectMap - ** @param uint16_t map - ** @param const void *details - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xkb_select_events_checked (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */, - uint16_t affectWhich /**< */, - uint16_t clear /**< */, - uint16_t selectAll /**< */, - uint16_t affectMap /**< */, - uint16_t map /**< */, - const void *details /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 3, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_SELECT_EVENTS, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[5]; - xcb_void_cookie_t xcb_ret; - xcb_xkb_select_events_request_t xcb_out; - - xcb_out.deviceSpec = deviceSpec; - xcb_out.affectWhich = affectWhich; - xcb_out.clear = clear; - xcb_out.selectAll = selectAll; - xcb_out.affectMap = affectMap; - xcb_out.map = map; - - 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_xkb_select_events_details_t details */ - xcb_parts[4].iov_base = (char *) details; - xcb_parts[4].iov_len = - xcb_xkb_select_events_details_sizeof (details, affectWhich, clear, selectAll); - - xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); - return xcb_ret; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_xkb_select_events - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @param uint16_t affectWhich - ** @param uint16_t clear - ** @param uint16_t selectAll - ** @param uint16_t affectMap - ** @param uint16_t map - ** @param const void *details - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xkb_select_events (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */, - uint16_t affectWhich /**< */, - uint16_t clear /**< */, - uint16_t selectAll /**< */, - uint16_t affectMap /**< */, - uint16_t map /**< */, - const void *details /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 3, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_SELECT_EVENTS, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[5]; - xcb_void_cookie_t xcb_ret; - xcb_xkb_select_events_request_t xcb_out; - - xcb_out.deviceSpec = deviceSpec; - xcb_out.affectWhich = affectWhich; - xcb_out.clear = clear; - xcb_out.selectAll = selectAll; - xcb_out.affectMap = affectMap; - xcb_out.map = map; - - 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_xkb_select_events_details_t details */ - xcb_parts[4].iov_base = (char *) details; - xcb_parts[4].iov_len = - xcb_xkb_select_events_details_sizeof (details, affectWhich, clear, selectAll); - - xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); - return xcb_ret; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_xkb_select_events_aux_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @param uint16_t affectWhich - ** @param uint16_t clear - ** @param uint16_t selectAll - ** @param uint16_t affectMap - ** @param uint16_t map - ** @param const xcb_xkb_select_events_details_t *details - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xkb_select_events_aux_checked (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */, - uint16_t affectWhich /**< */, - uint16_t clear /**< */, - uint16_t selectAll /**< */, - uint16_t affectMap /**< */, - uint16_t map /**< */, - const xcb_xkb_select_events_details_t *details /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 3, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_SELECT_EVENTS, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[5]; - xcb_void_cookie_t xcb_ret; - xcb_xkb_select_events_request_t xcb_out; - void *xcb_aux0 = 0; - - xcb_out.deviceSpec = deviceSpec; - xcb_out.affectWhich = affectWhich; - xcb_out.clear = clear; - xcb_out.selectAll = selectAll; - xcb_out.affectMap = affectMap; - xcb_out.map = map; - - 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_xkb_select_events_details_t details */ - xcb_parts[4].iov_len = - xcb_xkb_select_events_details_serialize (&xcb_aux0, affectWhich, clear, selectAll, details); - xcb_parts[4].iov_base = xcb_aux0; - - xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); - free(xcb_aux0); - return xcb_ret; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_xkb_select_events_aux - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @param uint16_t affectWhich - ** @param uint16_t clear - ** @param uint16_t selectAll - ** @param uint16_t affectMap - ** @param uint16_t map - ** @param const xcb_xkb_select_events_details_t *details - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xkb_select_events_aux (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */, - uint16_t affectWhich /**< */, - uint16_t clear /**< */, - uint16_t selectAll /**< */, - uint16_t affectMap /**< */, - uint16_t map /**< */, - const xcb_xkb_select_events_details_t *details /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 3, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_SELECT_EVENTS, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[5]; - xcb_void_cookie_t xcb_ret; - xcb_xkb_select_events_request_t xcb_out; - void *xcb_aux0 = 0; - - xcb_out.deviceSpec = deviceSpec; - xcb_out.affectWhich = affectWhich; - xcb_out.clear = clear; - xcb_out.selectAll = selectAll; - xcb_out.affectMap = affectMap; - xcb_out.map = map; - - 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_xkb_select_events_details_t details */ - xcb_parts[4].iov_len = - xcb_xkb_select_events_details_serialize (&xcb_aux0, affectWhich, clear, selectAll, details); - xcb_parts[4].iov_base = xcb_aux0; - - xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); - free(xcb_aux0); - return xcb_ret; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_xkb_bell_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @param xcb_xkb_bell_class_spec_t bellClass - ** @param xcb_xkb_id_spec_t bellID - ** @param int8_t percent - ** @param uint8_t forceSound - ** @param uint8_t eventOnly - ** @param int16_t pitch - ** @param int16_t duration - ** @param xcb_atom_t name - ** @param xcb_window_t window - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xkb_bell_checked (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */, - xcb_xkb_bell_class_spec_t bellClass /**< */, - xcb_xkb_id_spec_t bellID /**< */, - int8_t percent /**< */, - uint8_t forceSound /**< */, - uint8_t eventOnly /**< */, - int16_t pitch /**< */, - int16_t duration /**< */, - xcb_atom_t name /**< */, - xcb_window_t window /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_BELL, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xkb_bell_request_t xcb_out; - - xcb_out.deviceSpec = deviceSpec; - xcb_out.bellClass = bellClass; - xcb_out.bellID = bellID; - xcb_out.percent = percent; - xcb_out.forceSound = forceSound; - xcb_out.eventOnly = eventOnly; - xcb_out.pad0 = 0; - xcb_out.pitch = pitch; - xcb_out.duration = duration; - memset(xcb_out.pad1, 0, 2); - xcb_out.name = name; - 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_xkb_bell - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @param xcb_xkb_bell_class_spec_t bellClass - ** @param xcb_xkb_id_spec_t bellID - ** @param int8_t percent - ** @param uint8_t forceSound - ** @param uint8_t eventOnly - ** @param int16_t pitch - ** @param int16_t duration - ** @param xcb_atom_t name - ** @param xcb_window_t window - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xkb_bell (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */, - xcb_xkb_bell_class_spec_t bellClass /**< */, - xcb_xkb_id_spec_t bellID /**< */, - int8_t percent /**< */, - uint8_t forceSound /**< */, - uint8_t eventOnly /**< */, - int16_t pitch /**< */, - int16_t duration /**< */, - xcb_atom_t name /**< */, - xcb_window_t window /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_BELL, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xkb_bell_request_t xcb_out; - - xcb_out.deviceSpec = deviceSpec; - xcb_out.bellClass = bellClass; - xcb_out.bellID = bellID; - xcb_out.percent = percent; - xcb_out.forceSound = forceSound; - xcb_out.eventOnly = eventOnly; - xcb_out.pad0 = 0; - xcb_out.pitch = pitch; - xcb_out.duration = duration; - memset(xcb_out.pad1, 0, 2); - xcb_out.name = name; - 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_xkb_get_state_cookie_t xcb_xkb_get_state - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @returns xcb_xkb_get_state_cookie_t - ** - *****************************************************************************/ - -xcb_xkb_get_state_cookie_t -xcb_xkb_get_state (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_GET_STATE, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_xkb_get_state_cookie_t xcb_ret; - xcb_xkb_get_state_request_t xcb_out; - - xcb_out.deviceSpec = deviceSpec; - memset(xcb_out.pad0, 0, 2); - - 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_xkb_get_state_cookie_t xcb_xkb_get_state_unchecked - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @returns xcb_xkb_get_state_cookie_t - ** - *****************************************************************************/ - -xcb_xkb_get_state_cookie_t -xcb_xkb_get_state_unchecked (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_GET_STATE, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_xkb_get_state_cookie_t xcb_ret; - xcb_xkb_get_state_request_t xcb_out; - - xcb_out.deviceSpec = deviceSpec; - memset(xcb_out.pad0, 0, 2); - - 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_xkb_get_state_reply_t * xcb_xkb_get_state_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_get_state_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_xkb_get_state_reply_t * - ** - *****************************************************************************/ - -xcb_xkb_get_state_reply_t * -xcb_xkb_get_state_reply (xcb_connection_t *c /**< */, - xcb_xkb_get_state_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_xkb_get_state_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_xkb_latch_lock_state_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @param uint8_t affectModLocks - ** @param uint8_t modLocks - ** @param uint8_t lockGroup - ** @param uint8_t groupLock - ** @param uint8_t affectModLatches - ** @param uint8_t latchGroup - ** @param uint16_t groupLatch - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xkb_latch_lock_state_checked (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */, - uint8_t affectModLocks /**< */, - uint8_t modLocks /**< */, - uint8_t lockGroup /**< */, - uint8_t groupLock /**< */, - uint8_t affectModLatches /**< */, - uint8_t latchGroup /**< */, - uint16_t groupLatch /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_LATCH_LOCK_STATE, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xkb_latch_lock_state_request_t xcb_out; - - xcb_out.deviceSpec = deviceSpec; - xcb_out.affectModLocks = affectModLocks; - xcb_out.modLocks = modLocks; - xcb_out.lockGroup = lockGroup; - xcb_out.groupLock = groupLock; - xcb_out.affectModLatches = affectModLatches; - xcb_out.pad0 = 0; - xcb_out.latchGroup = latchGroup; - xcb_out.groupLatch = groupLatch; - - 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_xkb_latch_lock_state - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @param uint8_t affectModLocks - ** @param uint8_t modLocks - ** @param uint8_t lockGroup - ** @param uint8_t groupLock - ** @param uint8_t affectModLatches - ** @param uint8_t latchGroup - ** @param uint16_t groupLatch - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xkb_latch_lock_state (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */, - uint8_t affectModLocks /**< */, - uint8_t modLocks /**< */, - uint8_t lockGroup /**< */, - uint8_t groupLock /**< */, - uint8_t affectModLatches /**< */, - uint8_t latchGroup /**< */, - uint16_t groupLatch /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_LATCH_LOCK_STATE, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xkb_latch_lock_state_request_t xcb_out; - - xcb_out.deviceSpec = deviceSpec; - xcb_out.affectModLocks = affectModLocks; - xcb_out.modLocks = modLocks; - xcb_out.lockGroup = lockGroup; - xcb_out.groupLock = groupLock; - xcb_out.affectModLatches = affectModLatches; - xcb_out.pad0 = 0; - xcb_out.latchGroup = latchGroup; - xcb_out.groupLatch = groupLatch; - - 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_xkb_get_controls_cookie_t xcb_xkb_get_controls - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @returns xcb_xkb_get_controls_cookie_t - ** - *****************************************************************************/ - -xcb_xkb_get_controls_cookie_t -xcb_xkb_get_controls (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_GET_CONTROLS, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_xkb_get_controls_cookie_t xcb_ret; - xcb_xkb_get_controls_request_t xcb_out; - - xcb_out.deviceSpec = deviceSpec; - memset(xcb_out.pad0, 0, 2); - - 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_xkb_get_controls_cookie_t xcb_xkb_get_controls_unchecked - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @returns xcb_xkb_get_controls_cookie_t - ** - *****************************************************************************/ - -xcb_xkb_get_controls_cookie_t -xcb_xkb_get_controls_unchecked (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_GET_CONTROLS, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_xkb_get_controls_cookie_t xcb_ret; - xcb_xkb_get_controls_request_t xcb_out; - - xcb_out.deviceSpec = deviceSpec; - memset(xcb_out.pad0, 0, 2); - - 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_xkb_get_controls_reply_t * xcb_xkb_get_controls_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_get_controls_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_xkb_get_controls_reply_t * - ** - *****************************************************************************/ - -xcb_xkb_get_controls_reply_t * -xcb_xkb_get_controls_reply (xcb_connection_t *c /**< */, - xcb_xkb_get_controls_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_xkb_get_controls_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_xkb_set_controls_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @param uint8_t affectInternalRealMods - ** @param uint8_t internalRealMods - ** @param uint8_t affectIgnoreLockRealMods - ** @param uint8_t ignoreLockRealMods - ** @param uint16_t affectInternalVirtualMods - ** @param uint16_t internalVirtualMods - ** @param uint16_t affectIgnoreLockVirtualMods - ** @param uint16_t ignoreLockVirtualMods - ** @param uint8_t mouseKeysDfltBtn - ** @param uint8_t groupsWrap - ** @param uint16_t accessXOptions - ** @param uint32_t affectEnabledControls - ** @param uint32_t enabledControls - ** @param uint32_t changeControls - ** @param uint16_t repeatDelay - ** @param uint16_t repeatInterval - ** @param uint16_t slowKeysDelay - ** @param uint16_t debounceDelay - ** @param uint16_t mouseKeysDelay - ** @param uint16_t mouseKeysInterval - ** @param uint16_t mouseKeysTimeToMax - ** @param uint16_t mouseKeysMaxSpeed - ** @param int16_t mouseKeysCurve - ** @param uint16_t accessXTimeout - ** @param uint32_t accessXTimeoutMask - ** @param uint32_t accessXTimeoutValues - ** @param uint16_t accessXTimeoutOptionsMask - ** @param uint16_t accessXTimeoutOptionsValues - ** @param const uint8_t *perKeyRepeat - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xkb_set_controls_checked (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */, - uint8_t affectInternalRealMods /**< */, - uint8_t internalRealMods /**< */, - uint8_t affectIgnoreLockRealMods /**< */, - uint8_t ignoreLockRealMods /**< */, - uint16_t affectInternalVirtualMods /**< */, - uint16_t internalVirtualMods /**< */, - uint16_t affectIgnoreLockVirtualMods /**< */, - uint16_t ignoreLockVirtualMods /**< */, - uint8_t mouseKeysDfltBtn /**< */, - uint8_t groupsWrap /**< */, - uint16_t accessXOptions /**< */, - uint32_t affectEnabledControls /**< */, - uint32_t enabledControls /**< */, - uint32_t changeControls /**< */, - uint16_t repeatDelay /**< */, - uint16_t repeatInterval /**< */, - uint16_t slowKeysDelay /**< */, - uint16_t debounceDelay /**< */, - uint16_t mouseKeysDelay /**< */, - uint16_t mouseKeysInterval /**< */, - uint16_t mouseKeysTimeToMax /**< */, - uint16_t mouseKeysMaxSpeed /**< */, - int16_t mouseKeysCurve /**< */, - uint16_t accessXTimeout /**< */, - uint32_t accessXTimeoutMask /**< */, - uint32_t accessXTimeoutValues /**< */, - uint16_t accessXTimeoutOptionsMask /**< */, - uint16_t accessXTimeoutOptionsValues /**< */, - const uint8_t *perKeyRepeat /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_SET_CONTROLS, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xkb_set_controls_request_t xcb_out; - - xcb_out.deviceSpec = deviceSpec; - xcb_out.affectInternalRealMods = affectInternalRealMods; - xcb_out.internalRealMods = internalRealMods; - xcb_out.affectIgnoreLockRealMods = affectIgnoreLockRealMods; - xcb_out.ignoreLockRealMods = ignoreLockRealMods; - xcb_out.affectInternalVirtualMods = affectInternalVirtualMods; - xcb_out.internalVirtualMods = internalVirtualMods; - xcb_out.affectIgnoreLockVirtualMods = affectIgnoreLockVirtualMods; - xcb_out.ignoreLockVirtualMods = ignoreLockVirtualMods; - xcb_out.mouseKeysDfltBtn = mouseKeysDfltBtn; - xcb_out.groupsWrap = groupsWrap; - xcb_out.accessXOptions = accessXOptions; - memset(xcb_out.pad0, 0, 2); - xcb_out.affectEnabledControls = affectEnabledControls; - xcb_out.enabledControls = enabledControls; - xcb_out.changeControls = changeControls; - xcb_out.repeatDelay = repeatDelay; - xcb_out.repeatInterval = repeatInterval; - xcb_out.slowKeysDelay = slowKeysDelay; - xcb_out.debounceDelay = debounceDelay; - xcb_out.mouseKeysDelay = mouseKeysDelay; - xcb_out.mouseKeysInterval = mouseKeysInterval; - xcb_out.mouseKeysTimeToMax = mouseKeysTimeToMax; - xcb_out.mouseKeysMaxSpeed = mouseKeysMaxSpeed; - xcb_out.mouseKeysCurve = mouseKeysCurve; - xcb_out.accessXTimeout = accessXTimeout; - xcb_out.accessXTimeoutMask = accessXTimeoutMask; - xcb_out.accessXTimeoutValues = accessXTimeoutValues; - xcb_out.accessXTimeoutOptionsMask = accessXTimeoutOptionsMask; - xcb_out.accessXTimeoutOptionsValues = accessXTimeoutOptionsValues; - memcpy(xcb_out.perKeyRepeat, perKeyRepeat, 32); - - 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_xkb_set_controls - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @param uint8_t affectInternalRealMods - ** @param uint8_t internalRealMods - ** @param uint8_t affectIgnoreLockRealMods - ** @param uint8_t ignoreLockRealMods - ** @param uint16_t affectInternalVirtualMods - ** @param uint16_t internalVirtualMods - ** @param uint16_t affectIgnoreLockVirtualMods - ** @param uint16_t ignoreLockVirtualMods - ** @param uint8_t mouseKeysDfltBtn - ** @param uint8_t groupsWrap - ** @param uint16_t accessXOptions - ** @param uint32_t affectEnabledControls - ** @param uint32_t enabledControls - ** @param uint32_t changeControls - ** @param uint16_t repeatDelay - ** @param uint16_t repeatInterval - ** @param uint16_t slowKeysDelay - ** @param uint16_t debounceDelay - ** @param uint16_t mouseKeysDelay - ** @param uint16_t mouseKeysInterval - ** @param uint16_t mouseKeysTimeToMax - ** @param uint16_t mouseKeysMaxSpeed - ** @param int16_t mouseKeysCurve - ** @param uint16_t accessXTimeout - ** @param uint32_t accessXTimeoutMask - ** @param uint32_t accessXTimeoutValues - ** @param uint16_t accessXTimeoutOptionsMask - ** @param uint16_t accessXTimeoutOptionsValues - ** @param const uint8_t *perKeyRepeat - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xkb_set_controls (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */, - uint8_t affectInternalRealMods /**< */, - uint8_t internalRealMods /**< */, - uint8_t affectIgnoreLockRealMods /**< */, - uint8_t ignoreLockRealMods /**< */, - uint16_t affectInternalVirtualMods /**< */, - uint16_t internalVirtualMods /**< */, - uint16_t affectIgnoreLockVirtualMods /**< */, - uint16_t ignoreLockVirtualMods /**< */, - uint8_t mouseKeysDfltBtn /**< */, - uint8_t groupsWrap /**< */, - uint16_t accessXOptions /**< */, - uint32_t affectEnabledControls /**< */, - uint32_t enabledControls /**< */, - uint32_t changeControls /**< */, - uint16_t repeatDelay /**< */, - uint16_t repeatInterval /**< */, - uint16_t slowKeysDelay /**< */, - uint16_t debounceDelay /**< */, - uint16_t mouseKeysDelay /**< */, - uint16_t mouseKeysInterval /**< */, - uint16_t mouseKeysTimeToMax /**< */, - uint16_t mouseKeysMaxSpeed /**< */, - int16_t mouseKeysCurve /**< */, - uint16_t accessXTimeout /**< */, - uint32_t accessXTimeoutMask /**< */, - uint32_t accessXTimeoutValues /**< */, - uint16_t accessXTimeoutOptionsMask /**< */, - uint16_t accessXTimeoutOptionsValues /**< */, - const uint8_t *perKeyRepeat /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_SET_CONTROLS, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xkb_set_controls_request_t xcb_out; - - xcb_out.deviceSpec = deviceSpec; - xcb_out.affectInternalRealMods = affectInternalRealMods; - xcb_out.internalRealMods = internalRealMods; - xcb_out.affectIgnoreLockRealMods = affectIgnoreLockRealMods; - xcb_out.ignoreLockRealMods = ignoreLockRealMods; - xcb_out.affectInternalVirtualMods = affectInternalVirtualMods; - xcb_out.internalVirtualMods = internalVirtualMods; - xcb_out.affectIgnoreLockVirtualMods = affectIgnoreLockVirtualMods; - xcb_out.ignoreLockVirtualMods = ignoreLockVirtualMods; - xcb_out.mouseKeysDfltBtn = mouseKeysDfltBtn; - xcb_out.groupsWrap = groupsWrap; - xcb_out.accessXOptions = accessXOptions; - memset(xcb_out.pad0, 0, 2); - xcb_out.affectEnabledControls = affectEnabledControls; - xcb_out.enabledControls = enabledControls; - xcb_out.changeControls = changeControls; - xcb_out.repeatDelay = repeatDelay; - xcb_out.repeatInterval = repeatInterval; - xcb_out.slowKeysDelay = slowKeysDelay; - xcb_out.debounceDelay = debounceDelay; - xcb_out.mouseKeysDelay = mouseKeysDelay; - xcb_out.mouseKeysInterval = mouseKeysInterval; - xcb_out.mouseKeysTimeToMax = mouseKeysTimeToMax; - xcb_out.mouseKeysMaxSpeed = mouseKeysMaxSpeed; - xcb_out.mouseKeysCurve = mouseKeysCurve; - xcb_out.accessXTimeout = accessXTimeout; - xcb_out.accessXTimeoutMask = accessXTimeoutMask; - xcb_out.accessXTimeoutValues = accessXTimeoutValues; - xcb_out.accessXTimeoutOptionsMask = accessXTimeoutOptionsMask; - xcb_out.accessXTimeoutOptionsValues = accessXTimeoutOptionsValues; - memcpy(xcb_out.perKeyRepeat, perKeyRepeat, 32); - - 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; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_map_map_types_rtrn_length - ** - ** @param const xcb_xkb_get_map_map_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_map_map_types_rtrn_length (const xcb_xkb_get_map_reply_t *R /**< */, - const xcb_xkb_get_map_map_t *S /**< */) -{ - return R->nTypes; -} - - -/***************************************************************************** - ** - ** xcb_xkb_key_type_iterator_t xcb_xkb_get_map_map_types_rtrn_iterator - ** - ** @param const xcb_xkb_get_map_map_t *R - ** @returns xcb_xkb_key_type_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_key_type_iterator_t -xcb_xkb_get_map_map_types_rtrn_iterator (const xcb_xkb_get_map_reply_t *R /**< */, - const xcb_xkb_get_map_map_t *S /**< */) -{ - xcb_xkb_key_type_iterator_t i; - i.data = /* map */ S->types_rtrn; - i.rem = R->nTypes; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_map_map_syms_rtrn_length - ** - ** @param const xcb_xkb_get_map_map_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_map_map_syms_rtrn_length (const xcb_xkb_get_map_reply_t *R /**< */, - const xcb_xkb_get_map_map_t *S /**< */) -{ - return R->nKeySyms; -} - - -/***************************************************************************** - ** - ** xcb_xkb_key_sym_map_iterator_t xcb_xkb_get_map_map_syms_rtrn_iterator - ** - ** @param const xcb_xkb_get_map_map_t *R - ** @returns xcb_xkb_key_sym_map_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_key_sym_map_iterator_t -xcb_xkb_get_map_map_syms_rtrn_iterator (const xcb_xkb_get_map_reply_t *R /**< */, - const xcb_xkb_get_map_map_t *S /**< */) -{ - xcb_xkb_key_sym_map_iterator_t i; - i.data = /* map */ S->syms_rtrn; - i.rem = R->nKeySyms; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** uint8_t * xcb_xkb_get_map_map_acts_rtrn_count - ** - ** @param const xcb_xkb_get_map_map_t *S - ** @returns uint8_t * - ** - *****************************************************************************/ - -uint8_t * -xcb_xkb_get_map_map_acts_rtrn_count (const xcb_xkb_get_map_map_t *S /**< */) -{ - return /* map */ S->acts_rtrn_count; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_map_map_acts_rtrn_count_length - ** - ** @param const xcb_xkb_get_map_map_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_map_map_acts_rtrn_count_length (const xcb_xkb_get_map_reply_t *R /**< */, - const xcb_xkb_get_map_map_t *S /**< */) -{ - return R->nKeyActions; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_get_map_map_acts_rtrn_count_end - ** - ** @param const xcb_xkb_get_map_map_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_get_map_map_acts_rtrn_count_end (const xcb_xkb_get_map_reply_t *R /**< */, - const xcb_xkb_get_map_map_t *S /**< */) -{ - xcb_generic_iterator_t i; - i.data = /* map */ S->acts_rtrn_count + R->nKeyActions; - i.rem = 0; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** uint8_t * xcb_xkb_get_map_map_alignment_pad - ** - ** @param const xcb_xkb_get_map_map_t *S - ** @returns uint8_t * - ** - *****************************************************************************/ - -uint8_t * -xcb_xkb_get_map_map_alignment_pad (const xcb_xkb_get_map_map_t *S /**< */) -{ - return /* map */ S->alignment_pad; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_map_map_alignment_pad_length - ** - ** @param const xcb_xkb_get_map_map_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_map_map_alignment_pad_length (const xcb_xkb_get_map_reply_t *R /**< */, - const xcb_xkb_get_map_map_t *S /**< */) -{ - return (((R->nKeyActions + 3) & (~3)) - R->nKeyActions); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_get_map_map_alignment_pad_end - ** - ** @param const xcb_xkb_get_map_map_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_get_map_map_alignment_pad_end (const xcb_xkb_get_map_reply_t *R /**< */, - const xcb_xkb_get_map_map_t *S /**< */) -{ - xcb_generic_iterator_t i; - i.data = /* map */ S->alignment_pad + (((R->nKeyActions + 3) & (~3)) - R->nKeyActions); - i.rem = 0; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** xcb_xkb_action_t * xcb_xkb_get_map_map_acts_rtrn_acts - ** - ** @param const xcb_xkb_get_map_map_t *S - ** @returns xcb_xkb_action_t * - ** - *****************************************************************************/ - -xcb_xkb_action_t * -xcb_xkb_get_map_map_acts_rtrn_acts (const xcb_xkb_get_map_map_t *S /**< */) -{ - return /* map */ S->acts_rtrn_acts; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_map_map_acts_rtrn_acts_length - ** - ** @param const xcb_xkb_get_map_map_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_map_map_acts_rtrn_acts_length (const xcb_xkb_get_map_reply_t *R /**< */, - const xcb_xkb_get_map_map_t *S /**< */) -{ - return R->totalActions; -} - - -/***************************************************************************** - ** - ** xcb_xkb_action_iterator_t xcb_xkb_get_map_map_acts_rtrn_acts_iterator - ** - ** @param const xcb_xkb_get_map_map_t *R - ** @returns xcb_xkb_action_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_action_iterator_t -xcb_xkb_get_map_map_acts_rtrn_acts_iterator (const xcb_xkb_get_map_reply_t *R /**< */, - const xcb_xkb_get_map_map_t *S /**< */) -{ - xcb_xkb_action_iterator_t i; - i.data = /* map */ S->acts_rtrn_acts; - i.rem = R->totalActions; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** xcb_xkb_set_behavior_t * xcb_xkb_get_map_map_behaviors_rtrn - ** - ** @param const xcb_xkb_get_map_map_t *S - ** @returns xcb_xkb_set_behavior_t * - ** - *****************************************************************************/ - -xcb_xkb_set_behavior_t * -xcb_xkb_get_map_map_behaviors_rtrn (const xcb_xkb_get_map_map_t *S /**< */) -{ - return /* map */ S->behaviors_rtrn; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_map_map_behaviors_rtrn_length - ** - ** @param const xcb_xkb_get_map_map_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_map_map_behaviors_rtrn_length (const xcb_xkb_get_map_reply_t *R /**< */, - const xcb_xkb_get_map_map_t *S /**< */) -{ - return R->totalKeyBehaviors; -} - - -/***************************************************************************** - ** - ** xcb_xkb_set_behavior_iterator_t xcb_xkb_get_map_map_behaviors_rtrn_iterator - ** - ** @param const xcb_xkb_get_map_map_t *R - ** @returns xcb_xkb_set_behavior_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_set_behavior_iterator_t -xcb_xkb_get_map_map_behaviors_rtrn_iterator (const xcb_xkb_get_map_reply_t *R /**< */, - const xcb_xkb_get_map_map_t *S /**< */) -{ - xcb_xkb_set_behavior_iterator_t i; - i.data = /* map */ S->behaviors_rtrn; - i.rem = R->totalKeyBehaviors; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** uint8_t * xcb_xkb_get_map_map_vmods_rtrn - ** - ** @param const xcb_xkb_get_map_map_t *S - ** @returns uint8_t * - ** - *****************************************************************************/ - -uint8_t * -xcb_xkb_get_map_map_vmods_rtrn (const xcb_xkb_get_map_map_t *S /**< */) -{ - return /* map */ S->vmods_rtrn; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_map_map_vmods_rtrn_length - ** - ** @param const xcb_xkb_get_map_map_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_map_map_vmods_rtrn_length (const xcb_xkb_get_map_reply_t *R /**< */, - const xcb_xkb_get_map_map_t *S /**< */) -{ - return xcb_popcount(R->virtualMods); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_get_map_map_vmods_rtrn_end - ** - ** @param const xcb_xkb_get_map_map_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_get_map_map_vmods_rtrn_end (const xcb_xkb_get_map_reply_t *R /**< */, - const xcb_xkb_get_map_map_t *S /**< */) -{ - xcb_generic_iterator_t i; - i.data = /* map */ S->vmods_rtrn + xcb_popcount(R->virtualMods); - i.rem = 0; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** uint8_t * xcb_xkb_get_map_map_alignment_pad_2 - ** - ** @param const xcb_xkb_get_map_map_t *S - ** @returns uint8_t * - ** - *****************************************************************************/ - -uint8_t * -xcb_xkb_get_map_map_alignment_pad_2 (const xcb_xkb_get_map_map_t *S /**< */) -{ - return /* map */ S->alignment_pad2; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_map_map_alignment_pad_2_length - ** - ** @param const xcb_xkb_get_map_map_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_map_map_alignment_pad_2_length (const xcb_xkb_get_map_reply_t *R /**< */, - const xcb_xkb_get_map_map_t *S /**< */) -{ - return (((xcb_popcount(R->virtualMods) + 3) & (~3)) - xcb_popcount(R->virtualMods)); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_get_map_map_alignment_pad_2_end - ** - ** @param const xcb_xkb_get_map_map_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_get_map_map_alignment_pad_2_end (const xcb_xkb_get_map_reply_t *R /**< */, - const xcb_xkb_get_map_map_t *S /**< */) -{ - xcb_generic_iterator_t i; - i.data = /* map */ S->alignment_pad2 + (((xcb_popcount(R->virtualMods) + 3) & (~3)) - xcb_popcount(R->virtualMods)); - i.rem = 0; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** xcb_xkb_set_explicit_t * xcb_xkb_get_map_map_explicit_rtrn - ** - ** @param const xcb_xkb_get_map_map_t *S - ** @returns xcb_xkb_set_explicit_t * - ** - *****************************************************************************/ - -xcb_xkb_set_explicit_t * -xcb_xkb_get_map_map_explicit_rtrn (const xcb_xkb_get_map_map_t *S /**< */) -{ - return /* map */ S->explicit_rtrn; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_map_map_explicit_rtrn_length - ** - ** @param const xcb_xkb_get_map_map_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_map_map_explicit_rtrn_length (const xcb_xkb_get_map_reply_t *R /**< */, - const xcb_xkb_get_map_map_t *S /**< */) -{ - return R->totalKeyExplicit; -} - - -/***************************************************************************** - ** - ** xcb_xkb_set_explicit_iterator_t xcb_xkb_get_map_map_explicit_rtrn_iterator - ** - ** @param const xcb_xkb_get_map_map_t *R - ** @returns xcb_xkb_set_explicit_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_set_explicit_iterator_t -xcb_xkb_get_map_map_explicit_rtrn_iterator (const xcb_xkb_get_map_reply_t *R /**< */, - const xcb_xkb_get_map_map_t *S /**< */) -{ - xcb_xkb_set_explicit_iterator_t i; - i.data = /* map */ S->explicit_rtrn; - i.rem = R->totalKeyExplicit; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** uint16_t * xcb_xkb_get_map_map_alignment_pad_3 - ** - ** @param const xcb_xkb_get_map_map_t *S - ** @returns uint16_t * - ** - *****************************************************************************/ - -uint16_t * -xcb_xkb_get_map_map_alignment_pad_3 (const xcb_xkb_get_map_map_t *S /**< */) -{ - return /* map */ S->alignment_pad3; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_map_map_alignment_pad_3_length - ** - ** @param const xcb_xkb_get_map_map_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_map_map_alignment_pad_3_length (const xcb_xkb_get_map_reply_t *R /**< */, - const xcb_xkb_get_map_map_t *S /**< */) -{ - return (((R->totalKeyExplicit + 1) & (~1)) - R->totalKeyExplicit); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_get_map_map_alignment_pad_3_end - ** - ** @param const xcb_xkb_get_map_map_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_get_map_map_alignment_pad_3_end (const xcb_xkb_get_map_reply_t *R /**< */, - const xcb_xkb_get_map_map_t *S /**< */) -{ - xcb_generic_iterator_t i; - i.data = /* map */ S->alignment_pad3 + (((R->totalKeyExplicit + 1) & (~1)) - R->totalKeyExplicit); - i.rem = 0; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** xcb_xkb_key_mod_map_t * xcb_xkb_get_map_map_modmap_rtrn - ** - ** @param const xcb_xkb_get_map_map_t *S - ** @returns xcb_xkb_key_mod_map_t * - ** - *****************************************************************************/ - -xcb_xkb_key_mod_map_t * -xcb_xkb_get_map_map_modmap_rtrn (const xcb_xkb_get_map_map_t *S /**< */) -{ - return /* map */ S->modmap_rtrn; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_map_map_modmap_rtrn_length - ** - ** @param const xcb_xkb_get_map_map_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_map_map_modmap_rtrn_length (const xcb_xkb_get_map_reply_t *R /**< */, - const xcb_xkb_get_map_map_t *S /**< */) -{ - return R->totalModMapKeys; -} - - -/***************************************************************************** - ** - ** xcb_xkb_key_mod_map_iterator_t xcb_xkb_get_map_map_modmap_rtrn_iterator - ** - ** @param const xcb_xkb_get_map_map_t *R - ** @returns xcb_xkb_key_mod_map_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_key_mod_map_iterator_t -xcb_xkb_get_map_map_modmap_rtrn_iterator (const xcb_xkb_get_map_reply_t *R /**< */, - const xcb_xkb_get_map_map_t *S /**< */) -{ - xcb_xkb_key_mod_map_iterator_t i; - i.data = /* map */ S->modmap_rtrn; - i.rem = R->totalModMapKeys; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** uint16_t * xcb_xkb_get_map_map_alignment_pad_4 - ** - ** @param const xcb_xkb_get_map_map_t *S - ** @returns uint16_t * - ** - *****************************************************************************/ - -uint16_t * -xcb_xkb_get_map_map_alignment_pad_4 (const xcb_xkb_get_map_map_t *S /**< */) -{ - return /* map */ S->alignment_pad4; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_map_map_alignment_pad_4_length - ** - ** @param const xcb_xkb_get_map_map_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_map_map_alignment_pad_4_length (const xcb_xkb_get_map_reply_t *R /**< */, - const xcb_xkb_get_map_map_t *S /**< */) -{ - return (((R->totalModMapKeys + 1) & (~1)) - R->totalModMapKeys); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_get_map_map_alignment_pad_4_end - ** - ** @param const xcb_xkb_get_map_map_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_get_map_map_alignment_pad_4_end (const xcb_xkb_get_map_reply_t *R /**< */, - const xcb_xkb_get_map_map_t *S /**< */) -{ - xcb_generic_iterator_t i; - i.data = /* map */ S->alignment_pad4 + (((R->totalModMapKeys + 1) & (~1)) - R->totalModMapKeys); - i.rem = 0; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** xcb_xkb_key_v_mod_map_t * xcb_xkb_get_map_map_vmodmap_rtrn - ** - ** @param const xcb_xkb_get_map_map_t *S - ** @returns xcb_xkb_key_v_mod_map_t * - ** - *****************************************************************************/ - -xcb_xkb_key_v_mod_map_t * -xcb_xkb_get_map_map_vmodmap_rtrn (const xcb_xkb_get_map_map_t *S /**< */) -{ - return /* map */ S->vmodmap_rtrn; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_map_map_vmodmap_rtrn_length - ** - ** @param const xcb_xkb_get_map_map_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_map_map_vmodmap_rtrn_length (const xcb_xkb_get_map_reply_t *R /**< */, - const xcb_xkb_get_map_map_t *S /**< */) -{ - return R->totalVModMapKeys; -} - - -/***************************************************************************** - ** - ** xcb_xkb_key_v_mod_map_iterator_t xcb_xkb_get_map_map_vmodmap_rtrn_iterator - ** - ** @param const xcb_xkb_get_map_map_t *R - ** @returns xcb_xkb_key_v_mod_map_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_key_v_mod_map_iterator_t -xcb_xkb_get_map_map_vmodmap_rtrn_iterator (const xcb_xkb_get_map_reply_t *R /**< */, - const xcb_xkb_get_map_map_t *S /**< */) -{ - xcb_xkb_key_v_mod_map_iterator_t i; - i.data = /* map */ S->vmodmap_rtrn; - i.rem = R->totalVModMapKeys; - i.index = (char *) i.data - (char *) S; - return i; -} - -int -xcb_xkb_get_map_map_serialize (void **_buffer /**< */, - uint8_t nTypes /**< */, - uint8_t nKeySyms /**< */, - uint8_t nKeyActions /**< */, - uint16_t totalActions /**< */, - uint8_t totalKeyBehaviors /**< */, - uint16_t virtualMods /**< */, - uint8_t totalKeyExplicit /**< */, - uint8_t totalModMapKeys /**< */, - uint8_t totalVModMapKeys /**< */, - uint16_t present /**< */, - const xcb_xkb_get_map_map_t *_aux /**< */) -{ - char *xcb_out = *_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_align_to = 0; - - unsigned int xcb_pad = 0; - char xcb_pad0[3] = {0, 0, 0}; - struct iovec xcb_parts[27]; - unsigned int xcb_parts_idx = 0; - unsigned int xcb_block_len = 0; - unsigned int i; - char *xcb_tmp; - - if(present & XCB_XKB_MAP_PART_KEY_TYPES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* types_rtrn */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->types_rtrn; - xcb_parts[xcb_parts_idx].iov_len = 0; - xcb_tmp = (char *) _aux->types_rtrn; - for(i=0; i<nTypes; i++) { - xcb_block_len = xcb_xkb_key_type_sizeof(xcb_tmp); - xcb_parts[xcb_parts_idx].iov_len += xcb_block_len; - } - xcb_block_len = xcb_parts[xcb_parts_idx].iov_len; - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_xkb_key_type_t); - } - if(present & XCB_XKB_MAP_PART_KEY_SYMS) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* syms_rtrn */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->syms_rtrn; - xcb_parts[xcb_parts_idx].iov_len = 0; - xcb_tmp = (char *) _aux->syms_rtrn; - for(i=0; i<nKeySyms; i++) { - xcb_block_len = xcb_xkb_key_sym_map_sizeof(xcb_tmp); - xcb_parts[xcb_parts_idx].iov_len += xcb_block_len; - } - xcb_block_len = xcb_parts[xcb_parts_idx].iov_len; - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_xkb_key_sym_map_t); - } - if(present & XCB_XKB_MAP_PART_KEY_ACTIONS) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* acts_rtrn_count */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->acts_rtrn_count; - xcb_block_len += nKeyActions * sizeof(xcb_keycode_t); - xcb_parts[xcb_parts_idx].iov_len = nKeyActions * sizeof(xcb_keycode_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* alignment_pad */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->alignment_pad; - xcb_block_len += (((nKeyActions + 3) & (~3)) - nKeyActions) * sizeof(xcb_keycode_t); - xcb_parts[xcb_parts_idx].iov_len = (((nKeyActions + 3) & (~3)) - nKeyActions) * sizeof(xcb_keycode_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* acts_rtrn_acts */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->acts_rtrn_acts; - xcb_block_len += totalActions * sizeof(xcb_xkb_action_t); - xcb_parts[xcb_parts_idx].iov_len = totalActions * sizeof(xcb_xkb_action_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_xkb_action_t); - } - if(present & XCB_XKB_MAP_PART_KEY_BEHAVIORS) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* behaviors_rtrn */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->behaviors_rtrn; - xcb_block_len += totalKeyBehaviors * sizeof(xcb_xkb_set_behavior_t); - xcb_parts[xcb_parts_idx].iov_len = totalKeyBehaviors * sizeof(xcb_xkb_set_behavior_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_xkb_set_behavior_t); - } - if(present & XCB_XKB_MAP_PART_VIRTUAL_MODS) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* vmods_rtrn */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->vmods_rtrn; - xcb_block_len += xcb_popcount(virtualMods) * sizeof(xcb_keycode_t); - xcb_parts[xcb_parts_idx].iov_len = xcb_popcount(virtualMods) * sizeof(xcb_keycode_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* alignment_pad2 */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->alignment_pad2; - xcb_block_len += (((xcb_popcount(virtualMods) + 3) & (~3)) - xcb_popcount(virtualMods)) * sizeof(xcb_keycode_t); - xcb_parts[xcb_parts_idx].iov_len = (((xcb_popcount(virtualMods) + 3) & (~3)) - xcb_popcount(virtualMods)) * sizeof(xcb_keycode_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - } - if(present & XCB_XKB_MAP_PART_EXPLICIT_COMPONENTS) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* explicit_rtrn */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->explicit_rtrn; - xcb_block_len += totalKeyExplicit * sizeof(xcb_xkb_set_explicit_t); - xcb_parts[xcb_parts_idx].iov_len = totalKeyExplicit * sizeof(xcb_xkb_set_explicit_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_xkb_set_explicit_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* alignment_pad3 */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->alignment_pad3; - xcb_block_len += (((totalKeyExplicit + 1) & (~1)) - totalKeyExplicit) * sizeof(uint16_t); - xcb_parts[xcb_parts_idx].iov_len = (((totalKeyExplicit + 1) & (~1)) - totalKeyExplicit) * sizeof(uint16_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint16_t); - } - if(present & XCB_XKB_MAP_PART_MODIFIER_MAP) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* modmap_rtrn */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->modmap_rtrn; - xcb_block_len += totalModMapKeys * sizeof(xcb_xkb_key_mod_map_t); - xcb_parts[xcb_parts_idx].iov_len = totalModMapKeys * sizeof(xcb_xkb_key_mod_map_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_xkb_key_mod_map_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* alignment_pad4 */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->alignment_pad4; - xcb_block_len += (((totalModMapKeys + 1) & (~1)) - totalModMapKeys) * sizeof(uint16_t); - xcb_parts[xcb_parts_idx].iov_len = (((totalModMapKeys + 1) & (~1)) - totalModMapKeys) * sizeof(uint16_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint16_t); - } - if(present & XCB_XKB_MAP_PART_VIRTUAL_MOD_MAP) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* vmodmap_rtrn */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->vmodmap_rtrn; - xcb_block_len += totalVModMapKeys * sizeof(xcb_xkb_key_v_mod_map_t); - xcb_parts[xcb_parts_idx].iov_len = totalVModMapKeys * sizeof(xcb_xkb_key_v_mod_map_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_xkb_key_v_mod_map_t); - } - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - - if (NULL == xcb_out) { - /* allocate memory */ - xcb_out = malloc(xcb_buffer_len); - *_buffer = xcb_out; - } - - xcb_tmp = xcb_out; - for(i=0; i<xcb_parts_idx; i++) { - if (0 != xcb_parts[i].iov_base && 0 != xcb_parts[i].iov_len) - memcpy(xcb_tmp, xcb_parts[i].iov_base, xcb_parts[i].iov_len); - if (0 != xcb_parts[i].iov_len) - xcb_tmp += xcb_parts[i].iov_len; - } - - return xcb_buffer_len; -} - -int -xcb_xkb_get_map_map_unpack (const void *_buffer /**< */, - uint8_t nTypes /**< */, - uint8_t nKeySyms /**< */, - uint8_t nKeyActions /**< */, - uint16_t totalActions /**< */, - uint8_t totalKeyBehaviors /**< */, - uint16_t virtualMods /**< */, - uint8_t totalKeyExplicit /**< */, - uint8_t totalModMapKeys /**< */, - uint8_t totalVModMapKeys /**< */, - uint16_t present /**< */, - xcb_xkb_get_map_map_t *_aux /**< */) -{ - char *xcb_tmp = (char *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to = 0; - - unsigned int i; - unsigned int xcb_tmp_len; - - if(present & XCB_XKB_MAP_PART_KEY_TYPES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* types_rtrn */ - _aux->types_rtrn = (xcb_xkb_key_type_t *)xcb_tmp; - for(i=0; i<nTypes; i++) { - xcb_tmp_len = xcb_xkb_key_type_sizeof(xcb_tmp); - xcb_block_len += xcb_tmp_len; - xcb_tmp += xcb_tmp_len; - } - xcb_align_to = ALIGNOF(xcb_xkb_key_type_t); - } - if(present & XCB_XKB_MAP_PART_KEY_SYMS) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* syms_rtrn */ - _aux->syms_rtrn = (xcb_xkb_key_sym_map_t *)xcb_tmp; - for(i=0; i<nKeySyms; i++) { - xcb_tmp_len = xcb_xkb_key_sym_map_sizeof(xcb_tmp); - xcb_block_len += xcb_tmp_len; - xcb_tmp += xcb_tmp_len; - } - xcb_align_to = ALIGNOF(xcb_xkb_key_sym_map_t); - } - if(present & XCB_XKB_MAP_PART_KEY_ACTIONS) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* acts_rtrn_count */ - _aux->acts_rtrn_count = (uint8_t *)xcb_tmp; - xcb_block_len += nKeyActions * sizeof(xcb_keycode_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(uint8_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* alignment_pad */ - _aux->alignment_pad = (uint8_t *)xcb_tmp; - xcb_block_len += (((nKeyActions + 3) & (~3)) - nKeyActions) * sizeof(xcb_keycode_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(uint8_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* acts_rtrn_acts */ - _aux->acts_rtrn_acts = (xcb_xkb_action_t *)xcb_tmp; - xcb_block_len += totalActions * sizeof(xcb_xkb_action_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_xkb_action_t); - } - if(present & XCB_XKB_MAP_PART_KEY_BEHAVIORS) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* behaviors_rtrn */ - _aux->behaviors_rtrn = (xcb_xkb_set_behavior_t *)xcb_tmp; - xcb_block_len += totalKeyBehaviors * sizeof(xcb_xkb_set_behavior_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_xkb_set_behavior_t); - } - if(present & XCB_XKB_MAP_PART_VIRTUAL_MODS) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* vmods_rtrn */ - _aux->vmods_rtrn = (uint8_t *)xcb_tmp; - xcb_block_len += xcb_popcount(virtualMods) * sizeof(xcb_keycode_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(uint8_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* alignment_pad2 */ - _aux->alignment_pad2 = (uint8_t *)xcb_tmp; - xcb_block_len += (((xcb_popcount(virtualMods) + 3) & (~3)) - xcb_popcount(virtualMods)) * sizeof(xcb_keycode_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(uint8_t); - } - if(present & XCB_XKB_MAP_PART_EXPLICIT_COMPONENTS) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* explicit_rtrn */ - _aux->explicit_rtrn = (xcb_xkb_set_explicit_t *)xcb_tmp; - xcb_block_len += totalKeyExplicit * sizeof(xcb_xkb_set_explicit_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_xkb_set_explicit_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* alignment_pad3 */ - _aux->alignment_pad3 = (uint16_t *)xcb_tmp; - xcb_block_len += (((totalKeyExplicit + 1) & (~1)) - totalKeyExplicit) * sizeof(uint16_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(uint16_t); - } - if(present & XCB_XKB_MAP_PART_MODIFIER_MAP) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* modmap_rtrn */ - _aux->modmap_rtrn = (xcb_xkb_key_mod_map_t *)xcb_tmp; - xcb_block_len += totalModMapKeys * sizeof(xcb_xkb_key_mod_map_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_xkb_key_mod_map_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* alignment_pad4 */ - _aux->alignment_pad4 = (uint16_t *)xcb_tmp; - xcb_block_len += (((totalModMapKeys + 1) & (~1)) - totalModMapKeys) * sizeof(uint16_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(uint16_t); - } - if(present & XCB_XKB_MAP_PART_VIRTUAL_MOD_MAP) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* vmodmap_rtrn */ - _aux->vmodmap_rtrn = (xcb_xkb_key_v_mod_map_t *)xcb_tmp; - xcb_block_len += totalVModMapKeys * sizeof(xcb_xkb_key_v_mod_map_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_xkb_key_v_mod_map_t); - } - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - -int -xcb_xkb_get_map_map_sizeof (const void *_buffer /**< */, - uint8_t nTypes /**< */, - uint8_t nKeySyms /**< */, - uint8_t nKeyActions /**< */, - uint16_t totalActions /**< */, - uint8_t totalKeyBehaviors /**< */, - uint16_t virtualMods /**< */, - uint8_t totalKeyExplicit /**< */, - uint8_t totalModMapKeys /**< */, - uint8_t totalVModMapKeys /**< */, - uint16_t present /**< */) -{ - xcb_xkb_get_map_map_t _aux; - return xcb_xkb_get_map_map_unpack(_buffer, nTypes, nKeySyms, nKeyActions, totalActions, totalKeyBehaviors, virtualMods, totalKeyExplicit, totalModMapKeys, totalVModMapKeys, present, &_aux); -} - - -/***************************************************************************** - ** - ** xcb_xkb_get_map_cookie_t xcb_xkb_get_map - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @param uint16_t full - ** @param uint16_t partial - ** @param uint8_t firstType - ** @param uint8_t nTypes - ** @param xcb_keycode_t firstKeySym - ** @param uint8_t nKeySyms - ** @param xcb_keycode_t firstKeyAction - ** @param uint8_t nKeyActions - ** @param xcb_keycode_t firstKeyBehavior - ** @param uint8_t nKeyBehaviors - ** @param uint16_t virtualMods - ** @param xcb_keycode_t firstKeyExplicit - ** @param uint8_t nKeyExplicit - ** @param xcb_keycode_t firstModMapKey - ** @param uint8_t nModMapKeys - ** @param xcb_keycode_t firstVModMapKey - ** @param uint8_t nVModMapKeys - ** @returns xcb_xkb_get_map_cookie_t - ** - *****************************************************************************/ - -xcb_xkb_get_map_cookie_t -xcb_xkb_get_map (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */, - uint16_t full /**< */, - uint16_t partial /**< */, - uint8_t firstType /**< */, - uint8_t nTypes /**< */, - xcb_keycode_t firstKeySym /**< */, - uint8_t nKeySyms /**< */, - xcb_keycode_t firstKeyAction /**< */, - uint8_t nKeyActions /**< */, - xcb_keycode_t firstKeyBehavior /**< */, - uint8_t nKeyBehaviors /**< */, - uint16_t virtualMods /**< */, - xcb_keycode_t firstKeyExplicit /**< */, - uint8_t nKeyExplicit /**< */, - xcb_keycode_t firstModMapKey /**< */, - uint8_t nModMapKeys /**< */, - xcb_keycode_t firstVModMapKey /**< */, - uint8_t nVModMapKeys /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_GET_MAP, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_xkb_get_map_cookie_t xcb_ret; - xcb_xkb_get_map_request_t xcb_out; - - xcb_out.deviceSpec = deviceSpec; - xcb_out.full = full; - xcb_out.partial = partial; - xcb_out.firstType = firstType; - xcb_out.nTypes = nTypes; - xcb_out.firstKeySym = firstKeySym; - xcb_out.nKeySyms = nKeySyms; - xcb_out.firstKeyAction = firstKeyAction; - xcb_out.nKeyActions = nKeyActions; - xcb_out.firstKeyBehavior = firstKeyBehavior; - xcb_out.nKeyBehaviors = nKeyBehaviors; - xcb_out.virtualMods = virtualMods; - xcb_out.firstKeyExplicit = firstKeyExplicit; - xcb_out.nKeyExplicit = nKeyExplicit; - xcb_out.firstModMapKey = firstModMapKey; - xcb_out.nModMapKeys = nModMapKeys; - xcb_out.firstVModMapKey = firstVModMapKey; - xcb_out.nVModMapKeys = nVModMapKeys; - memset(xcb_out.pad0, 0, 2); - - 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_xkb_get_map_cookie_t xcb_xkb_get_map_unchecked - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @param uint16_t full - ** @param uint16_t partial - ** @param uint8_t firstType - ** @param uint8_t nTypes - ** @param xcb_keycode_t firstKeySym - ** @param uint8_t nKeySyms - ** @param xcb_keycode_t firstKeyAction - ** @param uint8_t nKeyActions - ** @param xcb_keycode_t firstKeyBehavior - ** @param uint8_t nKeyBehaviors - ** @param uint16_t virtualMods - ** @param xcb_keycode_t firstKeyExplicit - ** @param uint8_t nKeyExplicit - ** @param xcb_keycode_t firstModMapKey - ** @param uint8_t nModMapKeys - ** @param xcb_keycode_t firstVModMapKey - ** @param uint8_t nVModMapKeys - ** @returns xcb_xkb_get_map_cookie_t - ** - *****************************************************************************/ - -xcb_xkb_get_map_cookie_t -xcb_xkb_get_map_unchecked (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */, - uint16_t full /**< */, - uint16_t partial /**< */, - uint8_t firstType /**< */, - uint8_t nTypes /**< */, - xcb_keycode_t firstKeySym /**< */, - uint8_t nKeySyms /**< */, - xcb_keycode_t firstKeyAction /**< */, - uint8_t nKeyActions /**< */, - xcb_keycode_t firstKeyBehavior /**< */, - uint8_t nKeyBehaviors /**< */, - uint16_t virtualMods /**< */, - xcb_keycode_t firstKeyExplicit /**< */, - uint8_t nKeyExplicit /**< */, - xcb_keycode_t firstModMapKey /**< */, - uint8_t nModMapKeys /**< */, - xcb_keycode_t firstVModMapKey /**< */, - uint8_t nVModMapKeys /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_GET_MAP, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_xkb_get_map_cookie_t xcb_ret; - xcb_xkb_get_map_request_t xcb_out; - - xcb_out.deviceSpec = deviceSpec; - xcb_out.full = full; - xcb_out.partial = partial; - xcb_out.firstType = firstType; - xcb_out.nTypes = nTypes; - xcb_out.firstKeySym = firstKeySym; - xcb_out.nKeySyms = nKeySyms; - xcb_out.firstKeyAction = firstKeyAction; - xcb_out.nKeyActions = nKeyActions; - xcb_out.firstKeyBehavior = firstKeyBehavior; - xcb_out.nKeyBehaviors = nKeyBehaviors; - xcb_out.virtualMods = virtualMods; - xcb_out.firstKeyExplicit = firstKeyExplicit; - xcb_out.nKeyExplicit = nKeyExplicit; - xcb_out.firstModMapKey = firstModMapKey; - xcb_out.nModMapKeys = nModMapKeys; - xcb_out.firstVModMapKey = firstVModMapKey; - xcb_out.nVModMapKeys = nVModMapKeys; - memset(xcb_out.pad0, 0, 2); - - 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_xkb_get_map_map_t * xcb_xkb_get_map_map - ** - ** @param const xcb_xkb_get_map_reply_t *R - ** @returns xcb_xkb_get_map_map_t * - ** - *****************************************************************************/ - -void * -xcb_xkb_get_map_map (const xcb_xkb_get_map_reply_t *R /**< */) -{ - return (void *) (R + 1); -} - - -/***************************************************************************** - ** - ** xcb_xkb_get_map_reply_t * xcb_xkb_get_map_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_get_map_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_xkb_get_map_reply_t * - ** - *****************************************************************************/ - -xcb_xkb_get_map_reply_t * -xcb_xkb_get_map_reply (xcb_connection_t *c /**< */, - xcb_xkb_get_map_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_xkb_get_map_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - - -/***************************************************************************** - ** - ** int xcb_xkb_set_map_values_types_length - ** - ** @param const xcb_xkb_set_map_values_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_set_map_values_types_length (const xcb_xkb_set_map_request_t *R /**< */, - const xcb_xkb_set_map_values_t *S /**< */) -{ - return R->nTypes; -} - - -/***************************************************************************** - ** - ** xcb_xkb_set_key_type_iterator_t xcb_xkb_set_map_values_types_iterator - ** - ** @param const xcb_xkb_set_map_values_t *R - ** @returns xcb_xkb_set_key_type_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_set_key_type_iterator_t -xcb_xkb_set_map_values_types_iterator (const xcb_xkb_set_map_request_t *R /**< */, - const xcb_xkb_set_map_values_t *S /**< */) -{ - xcb_xkb_set_key_type_iterator_t i; - i.data = /* values */ S->types; - i.rem = R->nTypes; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_set_map_values_syms_length - ** - ** @param const xcb_xkb_set_map_values_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_set_map_values_syms_length (const xcb_xkb_set_map_request_t *R /**< */, - const xcb_xkb_set_map_values_t *S /**< */) -{ - return R->nKeySyms; -} - - -/***************************************************************************** - ** - ** xcb_xkb_key_sym_map_iterator_t xcb_xkb_set_map_values_syms_iterator - ** - ** @param const xcb_xkb_set_map_values_t *R - ** @returns xcb_xkb_key_sym_map_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_key_sym_map_iterator_t -xcb_xkb_set_map_values_syms_iterator (const xcb_xkb_set_map_request_t *R /**< */, - const xcb_xkb_set_map_values_t *S /**< */) -{ - xcb_xkb_key_sym_map_iterator_t i; - i.data = /* values */ S->syms; - i.rem = R->nKeySyms; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** uint8_t * xcb_xkb_set_map_values_actions_count - ** - ** @param const xcb_xkb_set_map_values_t *S - ** @returns uint8_t * - ** - *****************************************************************************/ - -uint8_t * -xcb_xkb_set_map_values_actions_count (const xcb_xkb_set_map_values_t *S /**< */) -{ - return /* values */ S->actionsCount; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_set_map_values_actions_count_length - ** - ** @param const xcb_xkb_set_map_values_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_set_map_values_actions_count_length (const xcb_xkb_set_map_request_t *R /**< */, - const xcb_xkb_set_map_values_t *S /**< */) -{ - return R->nKeyActions; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_set_map_values_actions_count_end - ** - ** @param const xcb_xkb_set_map_values_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_set_map_values_actions_count_end (const xcb_xkb_set_map_request_t *R /**< */, - const xcb_xkb_set_map_values_t *S /**< */) -{ - xcb_generic_iterator_t i; - i.data = /* values */ S->actionsCount + R->nKeyActions; - i.rem = 0; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** xcb_xkb_action_t * xcb_xkb_set_map_values_actions - ** - ** @param const xcb_xkb_set_map_values_t *S - ** @returns xcb_xkb_action_t * - ** - *****************************************************************************/ - -xcb_xkb_action_t * -xcb_xkb_set_map_values_actions (const xcb_xkb_set_map_values_t *S /**< */) -{ - return /* values */ S->actions; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_set_map_values_actions_length - ** - ** @param const xcb_xkb_set_map_values_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_set_map_values_actions_length (const xcb_xkb_set_map_request_t *R /**< */, - const xcb_xkb_set_map_values_t *S /**< */) -{ - return R->totalActions; -} - - -/***************************************************************************** - ** - ** xcb_xkb_action_iterator_t xcb_xkb_set_map_values_actions_iterator - ** - ** @param const xcb_xkb_set_map_values_t *R - ** @returns xcb_xkb_action_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_action_iterator_t -xcb_xkb_set_map_values_actions_iterator (const xcb_xkb_set_map_request_t *R /**< */, - const xcb_xkb_set_map_values_t *S /**< */) -{ - xcb_xkb_action_iterator_t i; - i.data = /* values */ S->actions; - i.rem = R->totalActions; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** xcb_xkb_set_behavior_t * xcb_xkb_set_map_values_behaviors - ** - ** @param const xcb_xkb_set_map_values_t *S - ** @returns xcb_xkb_set_behavior_t * - ** - *****************************************************************************/ - -xcb_xkb_set_behavior_t * -xcb_xkb_set_map_values_behaviors (const xcb_xkb_set_map_values_t *S /**< */) -{ - return /* values */ S->behaviors; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_set_map_values_behaviors_length - ** - ** @param const xcb_xkb_set_map_values_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_set_map_values_behaviors_length (const xcb_xkb_set_map_request_t *R /**< */, - const xcb_xkb_set_map_values_t *S /**< */) -{ - return R->totalKeyBehaviors; -} - - -/***************************************************************************** - ** - ** xcb_xkb_set_behavior_iterator_t xcb_xkb_set_map_values_behaviors_iterator - ** - ** @param const xcb_xkb_set_map_values_t *R - ** @returns xcb_xkb_set_behavior_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_set_behavior_iterator_t -xcb_xkb_set_map_values_behaviors_iterator (const xcb_xkb_set_map_request_t *R /**< */, - const xcb_xkb_set_map_values_t *S /**< */) -{ - xcb_xkb_set_behavior_iterator_t i; - i.data = /* values */ S->behaviors; - i.rem = R->totalKeyBehaviors; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** uint8_t * xcb_xkb_set_map_values_vmods - ** - ** @param const xcb_xkb_set_map_values_t *S - ** @returns uint8_t * - ** - *****************************************************************************/ - -uint8_t * -xcb_xkb_set_map_values_vmods (const xcb_xkb_set_map_values_t *S /**< */) -{ - return /* values */ S->vmods; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_set_map_values_vmods_length - ** - ** @param const xcb_xkb_set_map_values_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_set_map_values_vmods_length (const xcb_xkb_set_map_request_t *R /**< */, - const xcb_xkb_set_map_values_t *S /**< */) -{ - return xcb_popcount(R->virtualMods); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_set_map_values_vmods_end - ** - ** @param const xcb_xkb_set_map_values_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_set_map_values_vmods_end (const xcb_xkb_set_map_request_t *R /**< */, - const xcb_xkb_set_map_values_t *S /**< */) -{ - xcb_generic_iterator_t i; - i.data = /* values */ S->vmods + xcb_popcount(R->virtualMods); - i.rem = 0; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** xcb_xkb_set_explicit_t * xcb_xkb_set_map_values_explicit - ** - ** @param const xcb_xkb_set_map_values_t *S - ** @returns xcb_xkb_set_explicit_t * - ** - *****************************************************************************/ - -xcb_xkb_set_explicit_t * -xcb_xkb_set_map_values_explicit (const xcb_xkb_set_map_values_t *S /**< */) -{ - return /* values */ S->explicit; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_set_map_values_explicit_length - ** - ** @param const xcb_xkb_set_map_values_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_set_map_values_explicit_length (const xcb_xkb_set_map_request_t *R /**< */, - const xcb_xkb_set_map_values_t *S /**< */) -{ - return R->totalKeyExplicit; -} - - -/***************************************************************************** - ** - ** xcb_xkb_set_explicit_iterator_t xcb_xkb_set_map_values_explicit_iterator - ** - ** @param const xcb_xkb_set_map_values_t *R - ** @returns xcb_xkb_set_explicit_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_set_explicit_iterator_t -xcb_xkb_set_map_values_explicit_iterator (const xcb_xkb_set_map_request_t *R /**< */, - const xcb_xkb_set_map_values_t *S /**< */) -{ - xcb_xkb_set_explicit_iterator_t i; - i.data = /* values */ S->explicit; - i.rem = R->totalKeyExplicit; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** xcb_xkb_key_mod_map_t * xcb_xkb_set_map_values_modmap - ** - ** @param const xcb_xkb_set_map_values_t *S - ** @returns xcb_xkb_key_mod_map_t * - ** - *****************************************************************************/ - -xcb_xkb_key_mod_map_t * -xcb_xkb_set_map_values_modmap (const xcb_xkb_set_map_values_t *S /**< */) -{ - return /* values */ S->modmap; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_set_map_values_modmap_length - ** - ** @param const xcb_xkb_set_map_values_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_set_map_values_modmap_length (const xcb_xkb_set_map_request_t *R /**< */, - const xcb_xkb_set_map_values_t *S /**< */) -{ - return R->totalModMapKeys; -} - - -/***************************************************************************** - ** - ** xcb_xkb_key_mod_map_iterator_t xcb_xkb_set_map_values_modmap_iterator - ** - ** @param const xcb_xkb_set_map_values_t *R - ** @returns xcb_xkb_key_mod_map_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_key_mod_map_iterator_t -xcb_xkb_set_map_values_modmap_iterator (const xcb_xkb_set_map_request_t *R /**< */, - const xcb_xkb_set_map_values_t *S /**< */) -{ - xcb_xkb_key_mod_map_iterator_t i; - i.data = /* values */ S->modmap; - i.rem = R->totalModMapKeys; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** xcb_xkb_key_v_mod_map_t * xcb_xkb_set_map_values_vmodmap - ** - ** @param const xcb_xkb_set_map_values_t *S - ** @returns xcb_xkb_key_v_mod_map_t * - ** - *****************************************************************************/ - -xcb_xkb_key_v_mod_map_t * -xcb_xkb_set_map_values_vmodmap (const xcb_xkb_set_map_values_t *S /**< */) -{ - return /* values */ S->vmodmap; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_set_map_values_vmodmap_length - ** - ** @param const xcb_xkb_set_map_values_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_set_map_values_vmodmap_length (const xcb_xkb_set_map_request_t *R /**< */, - const xcb_xkb_set_map_values_t *S /**< */) -{ - return R->totalVModMapKeys; -} - - -/***************************************************************************** - ** - ** xcb_xkb_key_v_mod_map_iterator_t xcb_xkb_set_map_values_vmodmap_iterator - ** - ** @param const xcb_xkb_set_map_values_t *R - ** @returns xcb_xkb_key_v_mod_map_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_key_v_mod_map_iterator_t -xcb_xkb_set_map_values_vmodmap_iterator (const xcb_xkb_set_map_request_t *R /**< */, - const xcb_xkb_set_map_values_t *S /**< */) -{ - xcb_xkb_key_v_mod_map_iterator_t i; - i.data = /* values */ S->vmodmap; - i.rem = R->totalVModMapKeys; - i.index = (char *) i.data - (char *) S; - return i; -} - -int -xcb_xkb_set_map_values_serialize (void **_buffer /**< */, - uint8_t nTypes /**< */, - uint8_t nKeySyms /**< */, - uint8_t nKeyActions /**< */, - uint16_t totalActions /**< */, - uint8_t totalKeyBehaviors /**< */, - uint16_t virtualMods /**< */, - uint8_t totalKeyExplicit /**< */, - uint8_t totalModMapKeys /**< */, - uint8_t totalVModMapKeys /**< */, - uint16_t present /**< */, - const xcb_xkb_set_map_values_t *_aux /**< */) -{ - char *xcb_out = *_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_align_to = 0; - - unsigned int xcb_pad = 0; - char xcb_pad0[3] = {0, 0, 0}; - struct iovec xcb_parts[19]; - unsigned int xcb_parts_idx = 0; - unsigned int xcb_block_len = 0; - unsigned int i; - char *xcb_tmp; - - if(present & XCB_XKB_MAP_PART_KEY_TYPES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* types */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->types; - xcb_parts[xcb_parts_idx].iov_len = 0; - xcb_tmp = (char *) _aux->types; - for(i=0; i<nTypes; i++) { - xcb_block_len = xcb_xkb_set_key_type_sizeof(xcb_tmp); - xcb_parts[xcb_parts_idx].iov_len += xcb_block_len; - } - xcb_block_len = xcb_parts[xcb_parts_idx].iov_len; - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_xkb_set_key_type_t); - } - if(present & XCB_XKB_MAP_PART_KEY_SYMS) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* syms */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->syms; - xcb_parts[xcb_parts_idx].iov_len = 0; - xcb_tmp = (char *) _aux->syms; - for(i=0; i<nKeySyms; i++) { - xcb_block_len = xcb_xkb_key_sym_map_sizeof(xcb_tmp); - xcb_parts[xcb_parts_idx].iov_len += xcb_block_len; - } - xcb_block_len = xcb_parts[xcb_parts_idx].iov_len; - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_xkb_key_sym_map_t); - } - if(present & XCB_XKB_MAP_PART_KEY_ACTIONS) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* actionsCount */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->actionsCount; - xcb_block_len += nKeyActions * sizeof(xcb_keycode_t); - xcb_parts[xcb_parts_idx].iov_len = nKeyActions * sizeof(xcb_keycode_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* actions */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->actions; - xcb_block_len += totalActions * sizeof(xcb_xkb_action_t); - xcb_parts[xcb_parts_idx].iov_len = totalActions * sizeof(xcb_xkb_action_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_xkb_action_t); - } - if(present & XCB_XKB_MAP_PART_KEY_BEHAVIORS) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* behaviors */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->behaviors; - xcb_block_len += totalKeyBehaviors * sizeof(xcb_xkb_set_behavior_t); - xcb_parts[xcb_parts_idx].iov_len = totalKeyBehaviors * sizeof(xcb_xkb_set_behavior_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_xkb_set_behavior_t); - } - if(present & XCB_XKB_MAP_PART_VIRTUAL_MODS) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* vmods */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->vmods; - xcb_block_len += xcb_popcount(virtualMods) * sizeof(xcb_keycode_t); - xcb_parts[xcb_parts_idx].iov_len = xcb_popcount(virtualMods) * sizeof(xcb_keycode_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - } - if(present & XCB_XKB_MAP_PART_EXPLICIT_COMPONENTS) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* explicit */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->explicit; - xcb_block_len += totalKeyExplicit * sizeof(xcb_xkb_set_explicit_t); - xcb_parts[xcb_parts_idx].iov_len = totalKeyExplicit * sizeof(xcb_xkb_set_explicit_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_xkb_set_explicit_t); - } - if(present & XCB_XKB_MAP_PART_MODIFIER_MAP) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* modmap */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->modmap; - xcb_block_len += totalModMapKeys * sizeof(xcb_xkb_key_mod_map_t); - xcb_parts[xcb_parts_idx].iov_len = totalModMapKeys * sizeof(xcb_xkb_key_mod_map_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_xkb_key_mod_map_t); - } - if(present & XCB_XKB_MAP_PART_VIRTUAL_MOD_MAP) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* vmodmap */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->vmodmap; - xcb_block_len += totalVModMapKeys * sizeof(xcb_xkb_key_v_mod_map_t); - xcb_parts[xcb_parts_idx].iov_len = totalVModMapKeys * sizeof(xcb_xkb_key_v_mod_map_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_xkb_key_v_mod_map_t); - } - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - - if (NULL == xcb_out) { - /* allocate memory */ - xcb_out = malloc(xcb_buffer_len); - *_buffer = xcb_out; - } - - xcb_tmp = xcb_out; - for(i=0; i<xcb_parts_idx; i++) { - if (0 != xcb_parts[i].iov_base && 0 != xcb_parts[i].iov_len) - memcpy(xcb_tmp, xcb_parts[i].iov_base, xcb_parts[i].iov_len); - if (0 != xcb_parts[i].iov_len) - xcb_tmp += xcb_parts[i].iov_len; - } - - return xcb_buffer_len; -} - -int -xcb_xkb_set_map_values_unpack (const void *_buffer /**< */, - uint8_t nTypes /**< */, - uint8_t nKeySyms /**< */, - uint8_t nKeyActions /**< */, - uint16_t totalActions /**< */, - uint8_t totalKeyBehaviors /**< */, - uint16_t virtualMods /**< */, - uint8_t totalKeyExplicit /**< */, - uint8_t totalModMapKeys /**< */, - uint8_t totalVModMapKeys /**< */, - uint16_t present /**< */, - xcb_xkb_set_map_values_t *_aux /**< */) -{ - char *xcb_tmp = (char *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to = 0; - - unsigned int i; - unsigned int xcb_tmp_len; - - if(present & XCB_XKB_MAP_PART_KEY_TYPES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* types */ - _aux->types = (xcb_xkb_set_key_type_t *)xcb_tmp; - for(i=0; i<nTypes; i++) { - xcb_tmp_len = xcb_xkb_set_key_type_sizeof(xcb_tmp); - xcb_block_len += xcb_tmp_len; - xcb_tmp += xcb_tmp_len; - } - xcb_align_to = ALIGNOF(xcb_xkb_set_key_type_t); - } - if(present & XCB_XKB_MAP_PART_KEY_SYMS) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* syms */ - _aux->syms = (xcb_xkb_key_sym_map_t *)xcb_tmp; - for(i=0; i<nKeySyms; i++) { - xcb_tmp_len = xcb_xkb_key_sym_map_sizeof(xcb_tmp); - xcb_block_len += xcb_tmp_len; - xcb_tmp += xcb_tmp_len; - } - xcb_align_to = ALIGNOF(xcb_xkb_key_sym_map_t); - } - if(present & XCB_XKB_MAP_PART_KEY_ACTIONS) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* actionsCount */ - _aux->actionsCount = (uint8_t *)xcb_tmp; - xcb_block_len += nKeyActions * sizeof(xcb_keycode_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(uint8_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* actions */ - _aux->actions = (xcb_xkb_action_t *)xcb_tmp; - xcb_block_len += totalActions * sizeof(xcb_xkb_action_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_xkb_action_t); - } - if(present & XCB_XKB_MAP_PART_KEY_BEHAVIORS) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* behaviors */ - _aux->behaviors = (xcb_xkb_set_behavior_t *)xcb_tmp; - xcb_block_len += totalKeyBehaviors * sizeof(xcb_xkb_set_behavior_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_xkb_set_behavior_t); - } - if(present & XCB_XKB_MAP_PART_VIRTUAL_MODS) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* vmods */ - _aux->vmods = (uint8_t *)xcb_tmp; - xcb_block_len += xcb_popcount(virtualMods) * sizeof(xcb_keycode_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(uint8_t); - } - if(present & XCB_XKB_MAP_PART_EXPLICIT_COMPONENTS) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* explicit */ - _aux->explicit = (xcb_xkb_set_explicit_t *)xcb_tmp; - xcb_block_len += totalKeyExplicit * sizeof(xcb_xkb_set_explicit_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_xkb_set_explicit_t); - } - if(present & XCB_XKB_MAP_PART_MODIFIER_MAP) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* modmap */ - _aux->modmap = (xcb_xkb_key_mod_map_t *)xcb_tmp; - xcb_block_len += totalModMapKeys * sizeof(xcb_xkb_key_mod_map_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_xkb_key_mod_map_t); - } - if(present & XCB_XKB_MAP_PART_VIRTUAL_MOD_MAP) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* vmodmap */ - _aux->vmodmap = (xcb_xkb_key_v_mod_map_t *)xcb_tmp; - xcb_block_len += totalVModMapKeys * sizeof(xcb_xkb_key_v_mod_map_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_xkb_key_v_mod_map_t); - } - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - -int -xcb_xkb_set_map_values_sizeof (const void *_buffer /**< */, - uint8_t nTypes /**< */, - uint8_t nKeySyms /**< */, - uint8_t nKeyActions /**< */, - uint16_t totalActions /**< */, - uint8_t totalKeyBehaviors /**< */, - uint16_t virtualMods /**< */, - uint8_t totalKeyExplicit /**< */, - uint8_t totalModMapKeys /**< */, - uint8_t totalVModMapKeys /**< */, - uint16_t present /**< */) -{ - xcb_xkb_set_map_values_t _aux; - return xcb_xkb_set_map_values_unpack(_buffer, nTypes, nKeySyms, nKeyActions, totalActions, totalKeyBehaviors, virtualMods, totalKeyExplicit, totalModMapKeys, totalVModMapKeys, present, &_aux); -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_xkb_set_map_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @param uint16_t present - ** @param uint16_t flags - ** @param xcb_keycode_t minKeyCode - ** @param xcb_keycode_t maxKeyCode - ** @param uint8_t firstType - ** @param uint8_t nTypes - ** @param xcb_keycode_t firstKeySym - ** @param uint8_t nKeySyms - ** @param uint16_t totalSyms - ** @param xcb_keycode_t firstKeyAction - ** @param uint8_t nKeyActions - ** @param uint16_t totalActions - ** @param xcb_keycode_t firstKeyBehavior - ** @param uint8_t nKeyBehaviors - ** @param uint8_t totalKeyBehaviors - ** @param xcb_keycode_t firstKeyExplicit - ** @param uint8_t nKeyExplicit - ** @param uint8_t totalKeyExplicit - ** @param xcb_keycode_t firstModMapKey - ** @param uint8_t nModMapKeys - ** @param uint8_t totalModMapKeys - ** @param xcb_keycode_t firstVModMapKey - ** @param uint8_t nVModMapKeys - ** @param uint8_t totalVModMapKeys - ** @param uint16_t virtualMods - ** @param const void *values - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xkb_set_map_checked (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */, - uint16_t present /**< */, - uint16_t flags /**< */, - xcb_keycode_t minKeyCode /**< */, - xcb_keycode_t maxKeyCode /**< */, - uint8_t firstType /**< */, - uint8_t nTypes /**< */, - xcb_keycode_t firstKeySym /**< */, - uint8_t nKeySyms /**< */, - uint16_t totalSyms /**< */, - xcb_keycode_t firstKeyAction /**< */, - uint8_t nKeyActions /**< */, - uint16_t totalActions /**< */, - xcb_keycode_t firstKeyBehavior /**< */, - uint8_t nKeyBehaviors /**< */, - uint8_t totalKeyBehaviors /**< */, - xcb_keycode_t firstKeyExplicit /**< */, - uint8_t nKeyExplicit /**< */, - uint8_t totalKeyExplicit /**< */, - xcb_keycode_t firstModMapKey /**< */, - uint8_t nModMapKeys /**< */, - uint8_t totalModMapKeys /**< */, - xcb_keycode_t firstVModMapKey /**< */, - uint8_t nVModMapKeys /**< */, - uint8_t totalVModMapKeys /**< */, - uint16_t virtualMods /**< */, - const void *values /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 3, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_SET_MAP, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[5]; - xcb_void_cookie_t xcb_ret; - xcb_xkb_set_map_request_t xcb_out; - - xcb_out.deviceSpec = deviceSpec; - xcb_out.present = present; - xcb_out.flags = flags; - xcb_out.minKeyCode = minKeyCode; - xcb_out.maxKeyCode = maxKeyCode; - xcb_out.firstType = firstType; - xcb_out.nTypes = nTypes; - xcb_out.firstKeySym = firstKeySym; - xcb_out.nKeySyms = nKeySyms; - xcb_out.totalSyms = totalSyms; - xcb_out.firstKeyAction = firstKeyAction; - xcb_out.nKeyActions = nKeyActions; - xcb_out.totalActions = totalActions; - xcb_out.firstKeyBehavior = firstKeyBehavior; - xcb_out.nKeyBehaviors = nKeyBehaviors; - xcb_out.totalKeyBehaviors = totalKeyBehaviors; - xcb_out.firstKeyExplicit = firstKeyExplicit; - xcb_out.nKeyExplicit = nKeyExplicit; - xcb_out.totalKeyExplicit = totalKeyExplicit; - xcb_out.firstModMapKey = firstModMapKey; - xcb_out.nModMapKeys = nModMapKeys; - xcb_out.totalModMapKeys = totalModMapKeys; - xcb_out.firstVModMapKey = firstVModMapKey; - xcb_out.nVModMapKeys = nVModMapKeys; - xcb_out.totalVModMapKeys = totalVModMapKeys; - xcb_out.virtualMods = virtualMods; - - 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_xkb_set_map_values_t values */ - xcb_parts[4].iov_base = (char *) values; - xcb_parts[4].iov_len = - xcb_xkb_set_map_values_sizeof (values, nTypes, nKeySyms, nKeyActions, totalActions, totalKeyBehaviors, virtualMods, totalKeyExplicit, totalModMapKeys, totalVModMapKeys, present); - - xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); - return xcb_ret; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_xkb_set_map - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @param uint16_t present - ** @param uint16_t flags - ** @param xcb_keycode_t minKeyCode - ** @param xcb_keycode_t maxKeyCode - ** @param uint8_t firstType - ** @param uint8_t nTypes - ** @param xcb_keycode_t firstKeySym - ** @param uint8_t nKeySyms - ** @param uint16_t totalSyms - ** @param xcb_keycode_t firstKeyAction - ** @param uint8_t nKeyActions - ** @param uint16_t totalActions - ** @param xcb_keycode_t firstKeyBehavior - ** @param uint8_t nKeyBehaviors - ** @param uint8_t totalKeyBehaviors - ** @param xcb_keycode_t firstKeyExplicit - ** @param uint8_t nKeyExplicit - ** @param uint8_t totalKeyExplicit - ** @param xcb_keycode_t firstModMapKey - ** @param uint8_t nModMapKeys - ** @param uint8_t totalModMapKeys - ** @param xcb_keycode_t firstVModMapKey - ** @param uint8_t nVModMapKeys - ** @param uint8_t totalVModMapKeys - ** @param uint16_t virtualMods - ** @param const void *values - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xkb_set_map (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */, - uint16_t present /**< */, - uint16_t flags /**< */, - xcb_keycode_t minKeyCode /**< */, - xcb_keycode_t maxKeyCode /**< */, - uint8_t firstType /**< */, - uint8_t nTypes /**< */, - xcb_keycode_t firstKeySym /**< */, - uint8_t nKeySyms /**< */, - uint16_t totalSyms /**< */, - xcb_keycode_t firstKeyAction /**< */, - uint8_t nKeyActions /**< */, - uint16_t totalActions /**< */, - xcb_keycode_t firstKeyBehavior /**< */, - uint8_t nKeyBehaviors /**< */, - uint8_t totalKeyBehaviors /**< */, - xcb_keycode_t firstKeyExplicit /**< */, - uint8_t nKeyExplicit /**< */, - uint8_t totalKeyExplicit /**< */, - xcb_keycode_t firstModMapKey /**< */, - uint8_t nModMapKeys /**< */, - uint8_t totalModMapKeys /**< */, - xcb_keycode_t firstVModMapKey /**< */, - uint8_t nVModMapKeys /**< */, - uint8_t totalVModMapKeys /**< */, - uint16_t virtualMods /**< */, - const void *values /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 3, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_SET_MAP, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[5]; - xcb_void_cookie_t xcb_ret; - xcb_xkb_set_map_request_t xcb_out; - - xcb_out.deviceSpec = deviceSpec; - xcb_out.present = present; - xcb_out.flags = flags; - xcb_out.minKeyCode = minKeyCode; - xcb_out.maxKeyCode = maxKeyCode; - xcb_out.firstType = firstType; - xcb_out.nTypes = nTypes; - xcb_out.firstKeySym = firstKeySym; - xcb_out.nKeySyms = nKeySyms; - xcb_out.totalSyms = totalSyms; - xcb_out.firstKeyAction = firstKeyAction; - xcb_out.nKeyActions = nKeyActions; - xcb_out.totalActions = totalActions; - xcb_out.firstKeyBehavior = firstKeyBehavior; - xcb_out.nKeyBehaviors = nKeyBehaviors; - xcb_out.totalKeyBehaviors = totalKeyBehaviors; - xcb_out.firstKeyExplicit = firstKeyExplicit; - xcb_out.nKeyExplicit = nKeyExplicit; - xcb_out.totalKeyExplicit = totalKeyExplicit; - xcb_out.firstModMapKey = firstModMapKey; - xcb_out.nModMapKeys = nModMapKeys; - xcb_out.totalModMapKeys = totalModMapKeys; - xcb_out.firstVModMapKey = firstVModMapKey; - xcb_out.nVModMapKeys = nVModMapKeys; - xcb_out.totalVModMapKeys = totalVModMapKeys; - xcb_out.virtualMods = virtualMods; - - 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_xkb_set_map_values_t values */ - xcb_parts[4].iov_base = (char *) values; - xcb_parts[4].iov_len = - xcb_xkb_set_map_values_sizeof (values, nTypes, nKeySyms, nKeyActions, totalActions, totalKeyBehaviors, virtualMods, totalKeyExplicit, totalModMapKeys, totalVModMapKeys, present); - - xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); - return xcb_ret; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_xkb_set_map_aux_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @param uint16_t present - ** @param uint16_t flags - ** @param xcb_keycode_t minKeyCode - ** @param xcb_keycode_t maxKeyCode - ** @param uint8_t firstType - ** @param uint8_t nTypes - ** @param xcb_keycode_t firstKeySym - ** @param uint8_t nKeySyms - ** @param uint16_t totalSyms - ** @param xcb_keycode_t firstKeyAction - ** @param uint8_t nKeyActions - ** @param uint16_t totalActions - ** @param xcb_keycode_t firstKeyBehavior - ** @param uint8_t nKeyBehaviors - ** @param uint8_t totalKeyBehaviors - ** @param xcb_keycode_t firstKeyExplicit - ** @param uint8_t nKeyExplicit - ** @param uint8_t totalKeyExplicit - ** @param xcb_keycode_t firstModMapKey - ** @param uint8_t nModMapKeys - ** @param uint8_t totalModMapKeys - ** @param xcb_keycode_t firstVModMapKey - ** @param uint8_t nVModMapKeys - ** @param uint8_t totalVModMapKeys - ** @param uint16_t virtualMods - ** @param const xcb_xkb_set_map_values_t *values - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xkb_set_map_aux_checked (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */, - uint16_t present /**< */, - uint16_t flags /**< */, - xcb_keycode_t minKeyCode /**< */, - xcb_keycode_t maxKeyCode /**< */, - uint8_t firstType /**< */, - uint8_t nTypes /**< */, - xcb_keycode_t firstKeySym /**< */, - uint8_t nKeySyms /**< */, - uint16_t totalSyms /**< */, - xcb_keycode_t firstKeyAction /**< */, - uint8_t nKeyActions /**< */, - uint16_t totalActions /**< */, - xcb_keycode_t firstKeyBehavior /**< */, - uint8_t nKeyBehaviors /**< */, - uint8_t totalKeyBehaviors /**< */, - xcb_keycode_t firstKeyExplicit /**< */, - uint8_t nKeyExplicit /**< */, - uint8_t totalKeyExplicit /**< */, - xcb_keycode_t firstModMapKey /**< */, - uint8_t nModMapKeys /**< */, - uint8_t totalModMapKeys /**< */, - xcb_keycode_t firstVModMapKey /**< */, - uint8_t nVModMapKeys /**< */, - uint8_t totalVModMapKeys /**< */, - uint16_t virtualMods /**< */, - const xcb_xkb_set_map_values_t *values /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 3, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_SET_MAP, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[5]; - xcb_void_cookie_t xcb_ret; - xcb_xkb_set_map_request_t xcb_out; - void *xcb_aux0 = 0; - - xcb_out.deviceSpec = deviceSpec; - xcb_out.present = present; - xcb_out.flags = flags; - xcb_out.minKeyCode = minKeyCode; - xcb_out.maxKeyCode = maxKeyCode; - xcb_out.firstType = firstType; - xcb_out.nTypes = nTypes; - xcb_out.firstKeySym = firstKeySym; - xcb_out.nKeySyms = nKeySyms; - xcb_out.totalSyms = totalSyms; - xcb_out.firstKeyAction = firstKeyAction; - xcb_out.nKeyActions = nKeyActions; - xcb_out.totalActions = totalActions; - xcb_out.firstKeyBehavior = firstKeyBehavior; - xcb_out.nKeyBehaviors = nKeyBehaviors; - xcb_out.totalKeyBehaviors = totalKeyBehaviors; - xcb_out.firstKeyExplicit = firstKeyExplicit; - xcb_out.nKeyExplicit = nKeyExplicit; - xcb_out.totalKeyExplicit = totalKeyExplicit; - xcb_out.firstModMapKey = firstModMapKey; - xcb_out.nModMapKeys = nModMapKeys; - xcb_out.totalModMapKeys = totalModMapKeys; - xcb_out.firstVModMapKey = firstVModMapKey; - xcb_out.nVModMapKeys = nVModMapKeys; - xcb_out.totalVModMapKeys = totalVModMapKeys; - xcb_out.virtualMods = virtualMods; - - 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_xkb_set_map_values_t values */ - xcb_parts[4].iov_len = - xcb_xkb_set_map_values_serialize (&xcb_aux0, nTypes, nKeySyms, nKeyActions, totalActions, totalKeyBehaviors, virtualMods, totalKeyExplicit, totalModMapKeys, totalVModMapKeys, present, values); - xcb_parts[4].iov_base = xcb_aux0; - - xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); - free(xcb_aux0); - return xcb_ret; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_xkb_set_map_aux - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @param uint16_t present - ** @param uint16_t flags - ** @param xcb_keycode_t minKeyCode - ** @param xcb_keycode_t maxKeyCode - ** @param uint8_t firstType - ** @param uint8_t nTypes - ** @param xcb_keycode_t firstKeySym - ** @param uint8_t nKeySyms - ** @param uint16_t totalSyms - ** @param xcb_keycode_t firstKeyAction - ** @param uint8_t nKeyActions - ** @param uint16_t totalActions - ** @param xcb_keycode_t firstKeyBehavior - ** @param uint8_t nKeyBehaviors - ** @param uint8_t totalKeyBehaviors - ** @param xcb_keycode_t firstKeyExplicit - ** @param uint8_t nKeyExplicit - ** @param uint8_t totalKeyExplicit - ** @param xcb_keycode_t firstModMapKey - ** @param uint8_t nModMapKeys - ** @param uint8_t totalModMapKeys - ** @param xcb_keycode_t firstVModMapKey - ** @param uint8_t nVModMapKeys - ** @param uint8_t totalVModMapKeys - ** @param uint16_t virtualMods - ** @param const xcb_xkb_set_map_values_t *values - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xkb_set_map_aux (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */, - uint16_t present /**< */, - uint16_t flags /**< */, - xcb_keycode_t minKeyCode /**< */, - xcb_keycode_t maxKeyCode /**< */, - uint8_t firstType /**< */, - uint8_t nTypes /**< */, - xcb_keycode_t firstKeySym /**< */, - uint8_t nKeySyms /**< */, - uint16_t totalSyms /**< */, - xcb_keycode_t firstKeyAction /**< */, - uint8_t nKeyActions /**< */, - uint16_t totalActions /**< */, - xcb_keycode_t firstKeyBehavior /**< */, - uint8_t nKeyBehaviors /**< */, - uint8_t totalKeyBehaviors /**< */, - xcb_keycode_t firstKeyExplicit /**< */, - uint8_t nKeyExplicit /**< */, - uint8_t totalKeyExplicit /**< */, - xcb_keycode_t firstModMapKey /**< */, - uint8_t nModMapKeys /**< */, - uint8_t totalModMapKeys /**< */, - xcb_keycode_t firstVModMapKey /**< */, - uint8_t nVModMapKeys /**< */, - uint8_t totalVModMapKeys /**< */, - uint16_t virtualMods /**< */, - const xcb_xkb_set_map_values_t *values /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 3, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_SET_MAP, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[5]; - xcb_void_cookie_t xcb_ret; - xcb_xkb_set_map_request_t xcb_out; - void *xcb_aux0 = 0; - - xcb_out.deviceSpec = deviceSpec; - xcb_out.present = present; - xcb_out.flags = flags; - xcb_out.minKeyCode = minKeyCode; - xcb_out.maxKeyCode = maxKeyCode; - xcb_out.firstType = firstType; - xcb_out.nTypes = nTypes; - xcb_out.firstKeySym = firstKeySym; - xcb_out.nKeySyms = nKeySyms; - xcb_out.totalSyms = totalSyms; - xcb_out.firstKeyAction = firstKeyAction; - xcb_out.nKeyActions = nKeyActions; - xcb_out.totalActions = totalActions; - xcb_out.firstKeyBehavior = firstKeyBehavior; - xcb_out.nKeyBehaviors = nKeyBehaviors; - xcb_out.totalKeyBehaviors = totalKeyBehaviors; - xcb_out.firstKeyExplicit = firstKeyExplicit; - xcb_out.nKeyExplicit = nKeyExplicit; - xcb_out.totalKeyExplicit = totalKeyExplicit; - xcb_out.firstModMapKey = firstModMapKey; - xcb_out.nModMapKeys = nModMapKeys; - xcb_out.totalModMapKeys = totalModMapKeys; - xcb_out.firstVModMapKey = firstVModMapKey; - xcb_out.nVModMapKeys = nVModMapKeys; - xcb_out.totalVModMapKeys = totalVModMapKeys; - xcb_out.virtualMods = virtualMods; - - 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_xkb_set_map_values_t values */ - xcb_parts[4].iov_len = - xcb_xkb_set_map_values_serialize (&xcb_aux0, nTypes, nKeySyms, nKeyActions, totalActions, totalKeyBehaviors, virtualMods, totalKeyExplicit, totalModMapKeys, totalVModMapKeys, present, values); - xcb_parts[4].iov_base = xcb_aux0; - - xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); - free(xcb_aux0); - return xcb_ret; -} - -int -xcb_xkb_get_compat_map_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_xkb_get_compat_map_reply_t *_aux = (xcb_xkb_get_compat_map_reply_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to = 0; - - - xcb_block_len += sizeof(xcb_xkb_get_compat_map_reply_t); - xcb_tmp += xcb_block_len; - xcb_buffer_len += xcb_block_len; - xcb_block_len = 0; - /* si_rtrn */ - xcb_block_len += _aux->nSIRtrn * sizeof(xcb_xkb_sym_interpret_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_xkb_sym_interpret_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* group_rtrn */ - xcb_block_len += xcb_popcount(_aux->groupsRtrn) * sizeof(xcb_xkb_mod_def_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_xkb_mod_def_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_xkb_get_compat_map_cookie_t xcb_xkb_get_compat_map - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @param uint8_t groups - ** @param uint8_t getAllSI - ** @param uint16_t firstSI - ** @param uint16_t nSI - ** @returns xcb_xkb_get_compat_map_cookie_t - ** - *****************************************************************************/ - -xcb_xkb_get_compat_map_cookie_t -xcb_xkb_get_compat_map (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */, - uint8_t groups /**< */, - uint8_t getAllSI /**< */, - uint16_t firstSI /**< */, - uint16_t nSI /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_GET_COMPAT_MAP, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_xkb_get_compat_map_cookie_t xcb_ret; - xcb_xkb_get_compat_map_request_t xcb_out; - - xcb_out.deviceSpec = deviceSpec; - xcb_out.groups = groups; - xcb_out.getAllSI = getAllSI; - xcb_out.firstSI = firstSI; - xcb_out.nSI = nSI; - - 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_xkb_get_compat_map_cookie_t xcb_xkb_get_compat_map_unchecked - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @param uint8_t groups - ** @param uint8_t getAllSI - ** @param uint16_t firstSI - ** @param uint16_t nSI - ** @returns xcb_xkb_get_compat_map_cookie_t - ** - *****************************************************************************/ - -xcb_xkb_get_compat_map_cookie_t -xcb_xkb_get_compat_map_unchecked (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */, - uint8_t groups /**< */, - uint8_t getAllSI /**< */, - uint16_t firstSI /**< */, - uint16_t nSI /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_GET_COMPAT_MAP, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_xkb_get_compat_map_cookie_t xcb_ret; - xcb_xkb_get_compat_map_request_t xcb_out; - - xcb_out.deviceSpec = deviceSpec; - xcb_out.groups = groups; - xcb_out.getAllSI = getAllSI; - xcb_out.firstSI = firstSI; - xcb_out.nSI = nSI; - - 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_xkb_sym_interpret_t * xcb_xkb_get_compat_map_si_rtrn - ** - ** @param const xcb_xkb_get_compat_map_reply_t *R - ** @returns xcb_xkb_sym_interpret_t * - ** - *****************************************************************************/ - -xcb_xkb_sym_interpret_t * -xcb_xkb_get_compat_map_si_rtrn (const xcb_xkb_get_compat_map_reply_t *R /**< */) -{ - return (xcb_xkb_sym_interpret_t *) (R + 1); -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_compat_map_si_rtrn_length - ** - ** @param const xcb_xkb_get_compat_map_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_compat_map_si_rtrn_length (const xcb_xkb_get_compat_map_reply_t *R /**< */) -{ - return R->nSIRtrn; -} - - -/***************************************************************************** - ** - ** xcb_xkb_sym_interpret_iterator_t xcb_xkb_get_compat_map_si_rtrn_iterator - ** - ** @param const xcb_xkb_get_compat_map_reply_t *R - ** @returns xcb_xkb_sym_interpret_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_sym_interpret_iterator_t -xcb_xkb_get_compat_map_si_rtrn_iterator (const xcb_xkb_get_compat_map_reply_t *R /**< */) -{ - xcb_xkb_sym_interpret_iterator_t i; - i.data = (xcb_xkb_sym_interpret_t *) (R + 1); - i.rem = R->nSIRtrn; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** xcb_xkb_mod_def_t * xcb_xkb_get_compat_map_group_rtrn - ** - ** @param const xcb_xkb_get_compat_map_reply_t *R - ** @returns xcb_xkb_mod_def_t * - ** - *****************************************************************************/ - -xcb_xkb_mod_def_t * -xcb_xkb_get_compat_map_group_rtrn (const xcb_xkb_get_compat_map_reply_t *R /**< */) -{ - xcb_generic_iterator_t prev = xcb_xkb_sym_interpret_end(xcb_xkb_get_compat_map_si_rtrn_iterator(R)); - return (xcb_xkb_mod_def_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xkb_mod_def_t, prev.index) + 0); -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_compat_map_group_rtrn_length - ** - ** @param const xcb_xkb_get_compat_map_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_compat_map_group_rtrn_length (const xcb_xkb_get_compat_map_reply_t *R /**< */) -{ - return xcb_popcount(R->groupsRtrn); -} - - -/***************************************************************************** - ** - ** xcb_xkb_mod_def_iterator_t xcb_xkb_get_compat_map_group_rtrn_iterator - ** - ** @param const xcb_xkb_get_compat_map_reply_t *R - ** @returns xcb_xkb_mod_def_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_mod_def_iterator_t -xcb_xkb_get_compat_map_group_rtrn_iterator (const xcb_xkb_get_compat_map_reply_t *R /**< */) -{ - xcb_xkb_mod_def_iterator_t i; - xcb_generic_iterator_t prev = xcb_xkb_sym_interpret_end(xcb_xkb_get_compat_map_si_rtrn_iterator(R)); - i.data = (xcb_xkb_mod_def_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xkb_mod_def_t, prev.index)); - i.rem = xcb_popcount(R->groupsRtrn); - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** xcb_xkb_get_compat_map_reply_t * xcb_xkb_get_compat_map_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_get_compat_map_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_xkb_get_compat_map_reply_t * - ** - *****************************************************************************/ - -xcb_xkb_get_compat_map_reply_t * -xcb_xkb_get_compat_map_reply (xcb_connection_t *c /**< */, - xcb_xkb_get_compat_map_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_xkb_get_compat_map_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - -int -xcb_xkb_set_compat_map_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_xkb_set_compat_map_request_t *_aux = (xcb_xkb_set_compat_map_request_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to = 0; - - - xcb_block_len += sizeof(xcb_xkb_set_compat_map_request_t); - xcb_tmp += xcb_block_len; - xcb_buffer_len += xcb_block_len; - xcb_block_len = 0; - /* si */ - xcb_block_len += _aux->nSI * sizeof(xcb_xkb_sym_interpret_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_xkb_sym_interpret_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* groupMaps */ - xcb_block_len += xcb_popcount(_aux->groups) * sizeof(xcb_xkb_mod_def_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_xkb_mod_def_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_xkb_set_compat_map_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @param uint8_t recomputeActions - ** @param uint8_t truncateSI - ** @param uint8_t groups - ** @param uint16_t firstSI - ** @param uint16_t nSI - ** @param const xcb_xkb_sym_interpret_t *si - ** @param const xcb_xkb_mod_def_t *groupMaps - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xkb_set_compat_map_checked (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */, - uint8_t recomputeActions /**< */, - uint8_t truncateSI /**< */, - uint8_t groups /**< */, - uint16_t firstSI /**< */, - uint16_t nSI /**< */, - const xcb_xkb_sym_interpret_t *si /**< */, - const xcb_xkb_mod_def_t *groupMaps /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 6, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_SET_COMPAT_MAP, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[8]; - xcb_void_cookie_t xcb_ret; - xcb_xkb_set_compat_map_request_t xcb_out; - - xcb_out.deviceSpec = deviceSpec; - xcb_out.pad0 = 0; - xcb_out.recomputeActions = recomputeActions; - xcb_out.truncateSI = truncateSI; - xcb_out.groups = groups; - xcb_out.firstSI = firstSI; - xcb_out.nSI = nSI; - memset(xcb_out.pad1, 0, 2); - - 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_xkb_sym_interpret_t si */ - xcb_parts[4].iov_base = (char *) si; - xcb_parts[4].iov_len = nSI * sizeof(xcb_xkb_sym_interpret_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - /* xcb_xkb_mod_def_t groupMaps */ - xcb_parts[6].iov_base = (char *) groupMaps; - xcb_parts[6].iov_len = xcb_popcount(groups) * sizeof(xcb_xkb_mod_def_t); - xcb_parts[7].iov_base = 0; - xcb_parts[7].iov_len = -xcb_parts[6].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_xkb_set_compat_map - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @param uint8_t recomputeActions - ** @param uint8_t truncateSI - ** @param uint8_t groups - ** @param uint16_t firstSI - ** @param uint16_t nSI - ** @param const xcb_xkb_sym_interpret_t *si - ** @param const xcb_xkb_mod_def_t *groupMaps - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xkb_set_compat_map (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */, - uint8_t recomputeActions /**< */, - uint8_t truncateSI /**< */, - uint8_t groups /**< */, - uint16_t firstSI /**< */, - uint16_t nSI /**< */, - const xcb_xkb_sym_interpret_t *si /**< */, - const xcb_xkb_mod_def_t *groupMaps /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 6, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_SET_COMPAT_MAP, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[8]; - xcb_void_cookie_t xcb_ret; - xcb_xkb_set_compat_map_request_t xcb_out; - - xcb_out.deviceSpec = deviceSpec; - xcb_out.pad0 = 0; - xcb_out.recomputeActions = recomputeActions; - xcb_out.truncateSI = truncateSI; - xcb_out.groups = groups; - xcb_out.firstSI = firstSI; - xcb_out.nSI = nSI; - memset(xcb_out.pad1, 0, 2); - - 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_xkb_sym_interpret_t si */ - xcb_parts[4].iov_base = (char *) si; - xcb_parts[4].iov_len = nSI * sizeof(xcb_xkb_sym_interpret_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - /* xcb_xkb_mod_def_t groupMaps */ - xcb_parts[6].iov_base = (char *) groupMaps; - xcb_parts[6].iov_len = xcb_popcount(groups) * sizeof(xcb_xkb_mod_def_t); - xcb_parts[7].iov_base = 0; - xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3; - - xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); - return xcb_ret; -} - - -/***************************************************************************** - ** - ** xcb_xkb_get_indicator_state_cookie_t xcb_xkb_get_indicator_state - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @returns xcb_xkb_get_indicator_state_cookie_t - ** - *****************************************************************************/ - -xcb_xkb_get_indicator_state_cookie_t -xcb_xkb_get_indicator_state (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_GET_INDICATOR_STATE, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_xkb_get_indicator_state_cookie_t xcb_ret; - xcb_xkb_get_indicator_state_request_t xcb_out; - - xcb_out.deviceSpec = deviceSpec; - memset(xcb_out.pad0, 0, 2); - - 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_xkb_get_indicator_state_cookie_t xcb_xkb_get_indicator_state_unchecked - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @returns xcb_xkb_get_indicator_state_cookie_t - ** - *****************************************************************************/ - -xcb_xkb_get_indicator_state_cookie_t -xcb_xkb_get_indicator_state_unchecked (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_GET_INDICATOR_STATE, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_xkb_get_indicator_state_cookie_t xcb_ret; - xcb_xkb_get_indicator_state_request_t xcb_out; - - xcb_out.deviceSpec = deviceSpec; - memset(xcb_out.pad0, 0, 2); - - 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_xkb_get_indicator_state_reply_t * xcb_xkb_get_indicator_state_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_get_indicator_state_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_xkb_get_indicator_state_reply_t * - ** - *****************************************************************************/ - -xcb_xkb_get_indicator_state_reply_t * -xcb_xkb_get_indicator_state_reply (xcb_connection_t *c /**< */, - xcb_xkb_get_indicator_state_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_xkb_get_indicator_state_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - -int -xcb_xkb_get_indicator_map_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_xkb_get_indicator_map_reply_t *_aux = (xcb_xkb_get_indicator_map_reply_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to = 0; - - - xcb_block_len += sizeof(xcb_xkb_get_indicator_map_reply_t); - xcb_tmp += xcb_block_len; - xcb_buffer_len += xcb_block_len; - xcb_block_len = 0; - /* maps */ - xcb_block_len += xcb_popcount(_aux->which) * sizeof(xcb_xkb_indicator_map_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_xkb_indicator_map_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_xkb_get_indicator_map_cookie_t xcb_xkb_get_indicator_map - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @param uint32_t which - ** @returns xcb_xkb_get_indicator_map_cookie_t - ** - *****************************************************************************/ - -xcb_xkb_get_indicator_map_cookie_t -xcb_xkb_get_indicator_map (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */, - uint32_t which /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_GET_INDICATOR_MAP, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_xkb_get_indicator_map_cookie_t xcb_ret; - xcb_xkb_get_indicator_map_request_t xcb_out; - - xcb_out.deviceSpec = deviceSpec; - memset(xcb_out.pad0, 0, 2); - xcb_out.which = which; - - 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_xkb_get_indicator_map_cookie_t xcb_xkb_get_indicator_map_unchecked - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @param uint32_t which - ** @returns xcb_xkb_get_indicator_map_cookie_t - ** - *****************************************************************************/ - -xcb_xkb_get_indicator_map_cookie_t -xcb_xkb_get_indicator_map_unchecked (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */, - uint32_t which /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_GET_INDICATOR_MAP, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_xkb_get_indicator_map_cookie_t xcb_ret; - xcb_xkb_get_indicator_map_request_t xcb_out; - - xcb_out.deviceSpec = deviceSpec; - memset(xcb_out.pad0, 0, 2); - xcb_out.which = which; - - 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_xkb_indicator_map_t * xcb_xkb_get_indicator_map_maps - ** - ** @param const xcb_xkb_get_indicator_map_reply_t *R - ** @returns xcb_xkb_indicator_map_t * - ** - *****************************************************************************/ - -xcb_xkb_indicator_map_t * -xcb_xkb_get_indicator_map_maps (const xcb_xkb_get_indicator_map_reply_t *R /**< */) -{ - return (xcb_xkb_indicator_map_t *) (R + 1); -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_indicator_map_maps_length - ** - ** @param const xcb_xkb_get_indicator_map_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_indicator_map_maps_length (const xcb_xkb_get_indicator_map_reply_t *R /**< */) -{ - return xcb_popcount(R->which); -} - - -/***************************************************************************** - ** - ** xcb_xkb_indicator_map_iterator_t xcb_xkb_get_indicator_map_maps_iterator - ** - ** @param const xcb_xkb_get_indicator_map_reply_t *R - ** @returns xcb_xkb_indicator_map_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_indicator_map_iterator_t -xcb_xkb_get_indicator_map_maps_iterator (const xcb_xkb_get_indicator_map_reply_t *R /**< */) -{ - xcb_xkb_indicator_map_iterator_t i; - i.data = (xcb_xkb_indicator_map_t *) (R + 1); - i.rem = xcb_popcount(R->which); - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** xcb_xkb_get_indicator_map_reply_t * xcb_xkb_get_indicator_map_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_get_indicator_map_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_xkb_get_indicator_map_reply_t * - ** - *****************************************************************************/ - -xcb_xkb_get_indicator_map_reply_t * -xcb_xkb_get_indicator_map_reply (xcb_connection_t *c /**< */, - xcb_xkb_get_indicator_map_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_xkb_get_indicator_map_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - -int -xcb_xkb_set_indicator_map_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_xkb_set_indicator_map_request_t *_aux = (xcb_xkb_set_indicator_map_request_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to = 0; - - - xcb_block_len += sizeof(xcb_xkb_set_indicator_map_request_t); - xcb_tmp += xcb_block_len; - xcb_buffer_len += xcb_block_len; - xcb_block_len = 0; - /* maps */ - xcb_block_len += xcb_popcount(_aux->which) * sizeof(xcb_xkb_indicator_map_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_xkb_indicator_map_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_xkb_set_indicator_map_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @param uint32_t which - ** @param const xcb_xkb_indicator_map_t *maps - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xkb_set_indicator_map_checked (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */, - uint32_t which /**< */, - const xcb_xkb_indicator_map_t *maps /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_SET_INDICATOR_MAP, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_xkb_set_indicator_map_request_t xcb_out; - - xcb_out.deviceSpec = deviceSpec; - memset(xcb_out.pad0, 0, 2); - xcb_out.which = which; - - 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_xkb_indicator_map_t maps */ - xcb_parts[4].iov_base = (char *) maps; - xcb_parts[4].iov_len = xcb_popcount(which) * sizeof(xcb_xkb_indicator_map_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].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_xkb_set_indicator_map - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @param uint32_t which - ** @param const xcb_xkb_indicator_map_t *maps - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xkb_set_indicator_map (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */, - uint32_t which /**< */, - const xcb_xkb_indicator_map_t *maps /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_SET_INDICATOR_MAP, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[6]; - xcb_void_cookie_t xcb_ret; - xcb_xkb_set_indicator_map_request_t xcb_out; - - xcb_out.deviceSpec = deviceSpec; - memset(xcb_out.pad0, 0, 2); - xcb_out.which = which; - - 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_xkb_indicator_map_t maps */ - xcb_parts[4].iov_base = (char *) maps; - xcb_parts[4].iov_len = xcb_popcount(which) * sizeof(xcb_xkb_indicator_map_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - - xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); - return xcb_ret; -} - - -/***************************************************************************** - ** - ** xcb_xkb_get_named_indicator_cookie_t xcb_xkb_get_named_indicator - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @param xcb_xkb_led_class_spec_t ledClass - ** @param xcb_xkb_id_spec_t ledID - ** @param xcb_atom_t indicator - ** @returns xcb_xkb_get_named_indicator_cookie_t - ** - *****************************************************************************/ - -xcb_xkb_get_named_indicator_cookie_t -xcb_xkb_get_named_indicator (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */, - xcb_xkb_led_class_spec_t ledClass /**< */, - xcb_xkb_id_spec_t ledID /**< */, - xcb_atom_t indicator /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_GET_NAMED_INDICATOR, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_xkb_get_named_indicator_cookie_t xcb_ret; - xcb_xkb_get_named_indicator_request_t xcb_out; - - xcb_out.deviceSpec = deviceSpec; - xcb_out.ledClass = ledClass; - xcb_out.ledID = ledID; - memset(xcb_out.pad0, 0, 2); - xcb_out.indicator = indicator; - - 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_xkb_get_named_indicator_cookie_t xcb_xkb_get_named_indicator_unchecked - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @param xcb_xkb_led_class_spec_t ledClass - ** @param xcb_xkb_id_spec_t ledID - ** @param xcb_atom_t indicator - ** @returns xcb_xkb_get_named_indicator_cookie_t - ** - *****************************************************************************/ - -xcb_xkb_get_named_indicator_cookie_t -xcb_xkb_get_named_indicator_unchecked (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */, - xcb_xkb_led_class_spec_t ledClass /**< */, - xcb_xkb_id_spec_t ledID /**< */, - xcb_atom_t indicator /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_GET_NAMED_INDICATOR, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_xkb_get_named_indicator_cookie_t xcb_ret; - xcb_xkb_get_named_indicator_request_t xcb_out; - - xcb_out.deviceSpec = deviceSpec; - xcb_out.ledClass = ledClass; - xcb_out.ledID = ledID; - memset(xcb_out.pad0, 0, 2); - xcb_out.indicator = indicator; - - 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_xkb_get_named_indicator_reply_t * xcb_xkb_get_named_indicator_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_get_named_indicator_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_xkb_get_named_indicator_reply_t * - ** - *****************************************************************************/ - -xcb_xkb_get_named_indicator_reply_t * -xcb_xkb_get_named_indicator_reply (xcb_connection_t *c /**< */, - xcb_xkb_get_named_indicator_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_xkb_get_named_indicator_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_xkb_set_named_indicator_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @param xcb_xkb_led_class_spec_t ledClass - ** @param xcb_xkb_id_spec_t ledID - ** @param xcb_atom_t indicator - ** @param uint8_t setState - ** @param uint8_t on - ** @param uint8_t setMap - ** @param uint8_t createMap - ** @param uint8_t map_flags - ** @param uint8_t map_whichGroups - ** @param uint8_t map_groups - ** @param uint8_t map_whichMods - ** @param uint8_t map_realMods - ** @param uint16_t map_vmods - ** @param uint32_t map_ctrls - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xkb_set_named_indicator_checked (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */, - xcb_xkb_led_class_spec_t ledClass /**< */, - xcb_xkb_id_spec_t ledID /**< */, - xcb_atom_t indicator /**< */, - uint8_t setState /**< */, - uint8_t on /**< */, - uint8_t setMap /**< */, - uint8_t createMap /**< */, - uint8_t map_flags /**< */, - uint8_t map_whichGroups /**< */, - uint8_t map_groups /**< */, - uint8_t map_whichMods /**< */, - uint8_t map_realMods /**< */, - uint16_t map_vmods /**< */, - uint32_t map_ctrls /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_SET_NAMED_INDICATOR, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xkb_set_named_indicator_request_t xcb_out; - - xcb_out.deviceSpec = deviceSpec; - xcb_out.ledClass = ledClass; - xcb_out.ledID = ledID; - memset(xcb_out.pad0, 0, 2); - xcb_out.indicator = indicator; - xcb_out.setState = setState; - xcb_out.on = on; - xcb_out.setMap = setMap; - xcb_out.createMap = createMap; - xcb_out.pad1 = 0; - xcb_out.map_flags = map_flags; - xcb_out.map_whichGroups = map_whichGroups; - xcb_out.map_groups = map_groups; - xcb_out.map_whichMods = map_whichMods; - xcb_out.map_realMods = map_realMods; - xcb_out.map_vmods = map_vmods; - xcb_out.map_ctrls = map_ctrls; - - 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_xkb_set_named_indicator - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @param xcb_xkb_led_class_spec_t ledClass - ** @param xcb_xkb_id_spec_t ledID - ** @param xcb_atom_t indicator - ** @param uint8_t setState - ** @param uint8_t on - ** @param uint8_t setMap - ** @param uint8_t createMap - ** @param uint8_t map_flags - ** @param uint8_t map_whichGroups - ** @param uint8_t map_groups - ** @param uint8_t map_whichMods - ** @param uint8_t map_realMods - ** @param uint16_t map_vmods - ** @param uint32_t map_ctrls - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xkb_set_named_indicator (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */, - xcb_xkb_led_class_spec_t ledClass /**< */, - xcb_xkb_id_spec_t ledID /**< */, - xcb_atom_t indicator /**< */, - uint8_t setState /**< */, - uint8_t on /**< */, - uint8_t setMap /**< */, - uint8_t createMap /**< */, - uint8_t map_flags /**< */, - uint8_t map_whichGroups /**< */, - uint8_t map_groups /**< */, - uint8_t map_whichMods /**< */, - uint8_t map_realMods /**< */, - uint16_t map_vmods /**< */, - uint32_t map_ctrls /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_SET_NAMED_INDICATOR, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[4]; - xcb_void_cookie_t xcb_ret; - xcb_xkb_set_named_indicator_request_t xcb_out; - - xcb_out.deviceSpec = deviceSpec; - xcb_out.ledClass = ledClass; - xcb_out.ledID = ledID; - memset(xcb_out.pad0, 0, 2); - xcb_out.indicator = indicator; - xcb_out.setState = setState; - xcb_out.on = on; - xcb_out.setMap = setMap; - xcb_out.createMap = createMap; - xcb_out.pad1 = 0; - xcb_out.map_flags = map_flags; - xcb_out.map_whichGroups = map_whichGroups; - xcb_out.map_groups = map_groups; - xcb_out.map_whichMods = map_whichMods; - xcb_out.map_realMods = map_realMods; - xcb_out.map_vmods = map_vmods; - xcb_out.map_ctrls = map_ctrls; - - 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_atom_t * xcb_xkb_get_names_value_list_type_names - ** - ** @param const xcb_xkb_get_names_value_list_t *S - ** @returns xcb_atom_t * - ** - *****************************************************************************/ - -xcb_atom_t * -xcb_xkb_get_names_value_list_type_names (const xcb_xkb_get_names_value_list_t *S /**< */) -{ - return /* valueList */ S->typeNames; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_names_value_list_type_names_length - ** - ** @param const xcb_xkb_get_names_value_list_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_names_value_list_type_names_length (const xcb_xkb_get_names_reply_t *R /**< */, - const xcb_xkb_get_names_value_list_t *S /**< */) -{ - return R->nTypes; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_get_names_value_list_type_names_end - ** - ** @param const xcb_xkb_get_names_value_list_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_get_names_value_list_type_names_end (const xcb_xkb_get_names_reply_t *R /**< */, - const xcb_xkb_get_names_value_list_t *S /**< */) -{ - xcb_generic_iterator_t i; - i.data = /* valueList */ S->typeNames + R->nTypes; - i.rem = 0; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** uint8_t * xcb_xkb_get_names_value_list_n_levels_per_type - ** - ** @param const xcb_xkb_get_names_value_list_t *S - ** @returns uint8_t * - ** - *****************************************************************************/ - -uint8_t * -xcb_xkb_get_names_value_list_n_levels_per_type (const xcb_xkb_get_names_value_list_t *S /**< */) -{ - return /* valueList */ S->nLevelsPerType; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_names_value_list_n_levels_per_type_length - ** - ** @param const xcb_xkb_get_names_value_list_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_names_value_list_n_levels_per_type_length (const xcb_xkb_get_names_reply_t *R /**< */, - const xcb_xkb_get_names_value_list_t *S /**< */) -{ - return R->nTypes; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_get_names_value_list_n_levels_per_type_end - ** - ** @param const xcb_xkb_get_names_value_list_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_get_names_value_list_n_levels_per_type_end (const xcb_xkb_get_names_reply_t *R /**< */, - const xcb_xkb_get_names_value_list_t *S /**< */) -{ - xcb_generic_iterator_t i; - i.data = /* valueList */ S->nLevelsPerType + R->nTypes; - i.rem = 0; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** uint8_t * xcb_xkb_get_names_value_list_alignment_pad - ** - ** @param const xcb_xkb_get_names_value_list_t *S - ** @returns uint8_t * - ** - *****************************************************************************/ - -uint8_t * -xcb_xkb_get_names_value_list_alignment_pad (const xcb_xkb_get_names_value_list_t *S /**< */) -{ - return /* valueList */ S->alignment_pad; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_names_value_list_alignment_pad_length - ** - ** @param const xcb_xkb_get_names_value_list_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_names_value_list_alignment_pad_length (const xcb_xkb_get_names_reply_t *R /**< */, - const xcb_xkb_get_names_value_list_t *S /**< */) -{ - return (((R->nTypes + 3) & (~3)) - R->nTypes); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_get_names_value_list_alignment_pad_end - ** - ** @param const xcb_xkb_get_names_value_list_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_get_names_value_list_alignment_pad_end (const xcb_xkb_get_names_reply_t *R /**< */, - const xcb_xkb_get_names_value_list_t *S /**< */) -{ - xcb_generic_iterator_t i; - i.data = /* valueList */ S->alignment_pad + (((R->nTypes + 3) & (~3)) - R->nTypes); - i.rem = 0; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** xcb_atom_t * xcb_xkb_get_names_value_list_kt_level_names - ** - ** @param const xcb_xkb_get_names_value_list_t *S - ** @returns xcb_atom_t * - ** - *****************************************************************************/ - -xcb_atom_t * -xcb_xkb_get_names_value_list_kt_level_names (const xcb_xkb_get_names_value_list_t *S /**< */) -{ - return /* valueList */ S->ktLevelNames; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_names_value_list_kt_level_names_length - ** - ** @param const xcb_xkb_get_names_value_list_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_names_value_list_kt_level_names_length (const xcb_xkb_get_names_reply_t *R /**< */, - const xcb_xkb_get_names_value_list_t *S /**< */) -{ - return xcb_sumof(/* valueList */ S->nLevelsPerType, R->nTypes); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_get_names_value_list_kt_level_names_end - ** - ** @param const xcb_xkb_get_names_value_list_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_get_names_value_list_kt_level_names_end (const xcb_xkb_get_names_reply_t *R /**< */, - const xcb_xkb_get_names_value_list_t *S /**< */) -{ - xcb_generic_iterator_t i; - i.data = /* valueList */ S->ktLevelNames + xcb_sumof(/* valueList */ S->nLevelsPerType, R->nTypes); - i.rem = 0; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** xcb_atom_t * xcb_xkb_get_names_value_list_indicator_names - ** - ** @param const xcb_xkb_get_names_value_list_t *S - ** @returns xcb_atom_t * - ** - *****************************************************************************/ - -xcb_atom_t * -xcb_xkb_get_names_value_list_indicator_names (const xcb_xkb_get_names_value_list_t *S /**< */) -{ - return /* valueList */ S->indicatorNames; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_names_value_list_indicator_names_length - ** - ** @param const xcb_xkb_get_names_value_list_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_names_value_list_indicator_names_length (const xcb_xkb_get_names_reply_t *R /**< */, - const xcb_xkb_get_names_value_list_t *S /**< */) -{ - return xcb_popcount(R->indicators); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_get_names_value_list_indicator_names_end - ** - ** @param const xcb_xkb_get_names_value_list_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_get_names_value_list_indicator_names_end (const xcb_xkb_get_names_reply_t *R /**< */, - const xcb_xkb_get_names_value_list_t *S /**< */) -{ - xcb_generic_iterator_t i; - i.data = /* valueList */ S->indicatorNames + xcb_popcount(R->indicators); - i.rem = 0; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** xcb_atom_t * xcb_xkb_get_names_value_list_virtual_mod_names - ** - ** @param const xcb_xkb_get_names_value_list_t *S - ** @returns xcb_atom_t * - ** - *****************************************************************************/ - -xcb_atom_t * -xcb_xkb_get_names_value_list_virtual_mod_names (const xcb_xkb_get_names_value_list_t *S /**< */) -{ - return /* valueList */ S->virtualModNames; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_names_value_list_virtual_mod_names_length - ** - ** @param const xcb_xkb_get_names_value_list_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_names_value_list_virtual_mod_names_length (const xcb_xkb_get_names_reply_t *R /**< */, - const xcb_xkb_get_names_value_list_t *S /**< */) -{ - return xcb_popcount(R->virtualMods); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_get_names_value_list_virtual_mod_names_end - ** - ** @param const xcb_xkb_get_names_value_list_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_get_names_value_list_virtual_mod_names_end (const xcb_xkb_get_names_reply_t *R /**< */, - const xcb_xkb_get_names_value_list_t *S /**< */) -{ - xcb_generic_iterator_t i; - i.data = /* valueList */ S->virtualModNames + xcb_popcount(R->virtualMods); - i.rem = 0; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** xcb_atom_t * xcb_xkb_get_names_value_list_groups - ** - ** @param const xcb_xkb_get_names_value_list_t *S - ** @returns xcb_atom_t * - ** - *****************************************************************************/ - -xcb_atom_t * -xcb_xkb_get_names_value_list_groups (const xcb_xkb_get_names_value_list_t *S /**< */) -{ - return /* valueList */ S->groups; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_names_value_list_groups_length - ** - ** @param const xcb_xkb_get_names_value_list_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_names_value_list_groups_length (const xcb_xkb_get_names_reply_t *R /**< */, - const xcb_xkb_get_names_value_list_t *S /**< */) -{ - return xcb_popcount(R->groupNames); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_get_names_value_list_groups_end - ** - ** @param const xcb_xkb_get_names_value_list_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_get_names_value_list_groups_end (const xcb_xkb_get_names_reply_t *R /**< */, - const xcb_xkb_get_names_value_list_t *S /**< */) -{ - xcb_generic_iterator_t i; - i.data = /* valueList */ S->groups + xcb_popcount(R->groupNames); - i.rem = 0; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** xcb_xkb_key_name_t * xcb_xkb_get_names_value_list_key_names - ** - ** @param const xcb_xkb_get_names_value_list_t *S - ** @returns xcb_xkb_key_name_t * - ** - *****************************************************************************/ - -xcb_xkb_key_name_t * -xcb_xkb_get_names_value_list_key_names (const xcb_xkb_get_names_value_list_t *S /**< */) -{ - return /* valueList */ S->keyNames; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_names_value_list_key_names_length - ** - ** @param const xcb_xkb_get_names_value_list_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_names_value_list_key_names_length (const xcb_xkb_get_names_reply_t *R /**< */, - const xcb_xkb_get_names_value_list_t *S /**< */) -{ - return R->nKeys; -} - - -/***************************************************************************** - ** - ** xcb_xkb_key_name_iterator_t xcb_xkb_get_names_value_list_key_names_iterator - ** - ** @param const xcb_xkb_get_names_value_list_t *R - ** @returns xcb_xkb_key_name_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_key_name_iterator_t -xcb_xkb_get_names_value_list_key_names_iterator (const xcb_xkb_get_names_reply_t *R /**< */, - const xcb_xkb_get_names_value_list_t *S /**< */) -{ - xcb_xkb_key_name_iterator_t i; - i.data = /* valueList */ S->keyNames; - i.rem = R->nKeys; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** xcb_xkb_key_alias_t * xcb_xkb_get_names_value_list_key_aliases - ** - ** @param const xcb_xkb_get_names_value_list_t *S - ** @returns xcb_xkb_key_alias_t * - ** - *****************************************************************************/ - -xcb_xkb_key_alias_t * -xcb_xkb_get_names_value_list_key_aliases (const xcb_xkb_get_names_value_list_t *S /**< */) -{ - return /* valueList */ S->keyAliases; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_names_value_list_key_aliases_length - ** - ** @param const xcb_xkb_get_names_value_list_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_names_value_list_key_aliases_length (const xcb_xkb_get_names_reply_t *R /**< */, - const xcb_xkb_get_names_value_list_t *S /**< */) -{ - return R->nKeyAliases; -} - - -/***************************************************************************** - ** - ** xcb_xkb_key_alias_iterator_t xcb_xkb_get_names_value_list_key_aliases_iterator - ** - ** @param const xcb_xkb_get_names_value_list_t *R - ** @returns xcb_xkb_key_alias_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_key_alias_iterator_t -xcb_xkb_get_names_value_list_key_aliases_iterator (const xcb_xkb_get_names_reply_t *R /**< */, - const xcb_xkb_get_names_value_list_t *S /**< */) -{ - xcb_xkb_key_alias_iterator_t i; - i.data = /* valueList */ S->keyAliases; - i.rem = R->nKeyAliases; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** xcb_atom_t * xcb_xkb_get_names_value_list_radio_group_names - ** - ** @param const xcb_xkb_get_names_value_list_t *S - ** @returns xcb_atom_t * - ** - *****************************************************************************/ - -xcb_atom_t * -xcb_xkb_get_names_value_list_radio_group_names (const xcb_xkb_get_names_value_list_t *S /**< */) -{ - return /* valueList */ S->radioGroupNames; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_names_value_list_radio_group_names_length - ** - ** @param const xcb_xkb_get_names_value_list_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_names_value_list_radio_group_names_length (const xcb_xkb_get_names_reply_t *R /**< */, - const xcb_xkb_get_names_value_list_t *S /**< */) -{ - return R->nRadioGroups; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_get_names_value_list_radio_group_names_end - ** - ** @param const xcb_xkb_get_names_value_list_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_get_names_value_list_radio_group_names_end (const xcb_xkb_get_names_reply_t *R /**< */, - const xcb_xkb_get_names_value_list_t *S /**< */) -{ - xcb_generic_iterator_t i; - i.data = /* valueList */ S->radioGroupNames + R->nRadioGroups; - i.rem = 0; - i.index = (char *) i.data - (char *) S; - return i; -} - -int -xcb_xkb_get_names_value_list_serialize (void **_buffer /**< */, - uint8_t nTypes /**< */, - uint32_t indicators /**< */, - uint16_t virtualMods /**< */, - uint8_t groupNames /**< */, - uint8_t nKeys /**< */, - uint8_t nKeyAliases /**< */, - uint8_t nRadioGroups /**< */, - uint32_t which /**< */, - const xcb_xkb_get_names_value_list_t *_aux /**< */) -{ - char *xcb_out = *_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_align_to = 0; - - unsigned int xcb_pad = 0; - char xcb_pad0[3] = {0, 0, 0}; - struct iovec xcb_parts[27]; - unsigned int xcb_parts_idx = 0; - unsigned int xcb_block_len = 0; - unsigned int i; - char *xcb_tmp; - - if(which & XCB_XKB_NAME_DETAIL_KEYCODES) { - /* xcb_xkb_get_names_value_list_t.keycodesName */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->keycodesName; - xcb_block_len += sizeof(xcb_atom_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_GEOMETRY) { - /* xcb_xkb_get_names_value_list_t.geometryName */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometryName; - xcb_block_len += sizeof(xcb_atom_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_SYMBOLS) { - /* xcb_xkb_get_names_value_list_t.symbolsName */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->symbolsName; - xcb_block_len += sizeof(xcb_atom_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_PHYS_SYMBOLS) { - /* xcb_xkb_get_names_value_list_t.physSymbolsName */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->physSymbolsName; - xcb_block_len += sizeof(xcb_atom_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_TYPES) { - /* xcb_xkb_get_names_value_list_t.typesName */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->typesName; - xcb_block_len += sizeof(xcb_atom_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_COMPAT) { - /* xcb_xkb_get_names_value_list_t.compatName */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->compatName; - xcb_block_len += sizeof(xcb_atom_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_KEY_TYPE_NAMES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* typeNames */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->typeNames; - xcb_block_len += nTypes * sizeof(xcb_atom_t); - xcb_parts[xcb_parts_idx].iov_len = nTypes * sizeof(xcb_atom_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_KT_LEVEL_NAMES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* nLevelsPerType */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->nLevelsPerType; - xcb_block_len += nTypes * sizeof(uint8_t); - xcb_parts[xcb_parts_idx].iov_len = nTypes * sizeof(uint8_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* alignment_pad */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->alignment_pad; - xcb_block_len += (((nTypes + 3) & (~3)) - nTypes) * sizeof(uint8_t); - xcb_parts[xcb_parts_idx].iov_len = (((nTypes + 3) & (~3)) - nTypes) * sizeof(uint8_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* ktLevelNames */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->ktLevelNames; - xcb_block_len += xcb_sumof(_aux->nLevelsPerType, nTypes) * sizeof(xcb_atom_t); - xcb_parts[xcb_parts_idx].iov_len = xcb_sumof(_aux->nLevelsPerType, nTypes) * sizeof(xcb_atom_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_INDICATOR_NAMES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* indicatorNames */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->indicatorNames; - xcb_block_len += xcb_popcount(indicators) * sizeof(xcb_atom_t); - xcb_parts[xcb_parts_idx].iov_len = xcb_popcount(indicators) * sizeof(xcb_atom_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_VIRTUAL_MOD_NAMES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* virtualModNames */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->virtualModNames; - xcb_block_len += xcb_popcount(virtualMods) * sizeof(xcb_atom_t); - xcb_parts[xcb_parts_idx].iov_len = xcb_popcount(virtualMods) * sizeof(xcb_atom_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_GROUP_NAMES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* groups */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->groups; - xcb_block_len += xcb_popcount(groupNames) * sizeof(xcb_atom_t); - xcb_parts[xcb_parts_idx].iov_len = xcb_popcount(groupNames) * sizeof(xcb_atom_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_KEY_NAMES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* keyNames */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->keyNames; - xcb_block_len += nKeys * sizeof(xcb_xkb_key_name_t); - xcb_parts[xcb_parts_idx].iov_len = nKeys * sizeof(xcb_xkb_key_name_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_xkb_key_name_t); - } - if(which & XCB_XKB_NAME_DETAIL_KEY_ALIASES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* keyAliases */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->keyAliases; - xcb_block_len += nKeyAliases * sizeof(xcb_xkb_key_alias_t); - xcb_parts[xcb_parts_idx].iov_len = nKeyAliases * sizeof(xcb_xkb_key_alias_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_xkb_key_alias_t); - } - if(which & XCB_XKB_NAME_DETAIL_RG_NAMES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* radioGroupNames */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->radioGroupNames; - xcb_block_len += nRadioGroups * sizeof(xcb_atom_t); - xcb_parts[xcb_parts_idx].iov_len = nRadioGroups * sizeof(xcb_atom_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - - if (NULL == xcb_out) { - /* allocate memory */ - xcb_out = malloc(xcb_buffer_len); - *_buffer = xcb_out; - } - - xcb_tmp = xcb_out; - for(i=0; i<xcb_parts_idx; i++) { - if (0 != xcb_parts[i].iov_base && 0 != xcb_parts[i].iov_len) - memcpy(xcb_tmp, xcb_parts[i].iov_base, xcb_parts[i].iov_len); - if (0 != xcb_parts[i].iov_len) - xcb_tmp += xcb_parts[i].iov_len; - } - - return xcb_buffer_len; -} - -int -xcb_xkb_get_names_value_list_unpack (const void *_buffer /**< */, - uint8_t nTypes /**< */, - uint32_t indicators /**< */, - uint16_t virtualMods /**< */, - uint8_t groupNames /**< */, - uint8_t nKeys /**< */, - uint8_t nKeyAliases /**< */, - uint8_t nRadioGroups /**< */, - uint32_t which /**< */, - xcb_xkb_get_names_value_list_t *_aux /**< */) -{ - char *xcb_tmp = (char *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to = 0; - - - if(which & XCB_XKB_NAME_DETAIL_KEYCODES) { - /* xcb_xkb_get_names_value_list_t.keycodesName */ - _aux->keycodesName = *(xcb_atom_t *)xcb_tmp; - xcb_block_len += sizeof(xcb_atom_t); - xcb_tmp += sizeof(xcb_atom_t); - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_GEOMETRY) { - /* xcb_xkb_get_names_value_list_t.geometryName */ - _aux->geometryName = *(xcb_atom_t *)xcb_tmp; - xcb_block_len += sizeof(xcb_atom_t); - xcb_tmp += sizeof(xcb_atom_t); - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_SYMBOLS) { - /* xcb_xkb_get_names_value_list_t.symbolsName */ - _aux->symbolsName = *(xcb_atom_t *)xcb_tmp; - xcb_block_len += sizeof(xcb_atom_t); - xcb_tmp += sizeof(xcb_atom_t); - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_PHYS_SYMBOLS) { - /* xcb_xkb_get_names_value_list_t.physSymbolsName */ - _aux->physSymbolsName = *(xcb_atom_t *)xcb_tmp; - xcb_block_len += sizeof(xcb_atom_t); - xcb_tmp += sizeof(xcb_atom_t); - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_TYPES) { - /* xcb_xkb_get_names_value_list_t.typesName */ - _aux->typesName = *(xcb_atom_t *)xcb_tmp; - xcb_block_len += sizeof(xcb_atom_t); - xcb_tmp += sizeof(xcb_atom_t); - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_COMPAT) { - /* xcb_xkb_get_names_value_list_t.compatName */ - _aux->compatName = *(xcb_atom_t *)xcb_tmp; - xcb_block_len += sizeof(xcb_atom_t); - xcb_tmp += sizeof(xcb_atom_t); - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_KEY_TYPE_NAMES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* typeNames */ - _aux->typeNames = (xcb_atom_t *)xcb_tmp; - xcb_block_len += nTypes * sizeof(xcb_atom_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_KT_LEVEL_NAMES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* nLevelsPerType */ - _aux->nLevelsPerType = (uint8_t *)xcb_tmp; - xcb_block_len += nTypes * sizeof(uint8_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(uint8_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* alignment_pad */ - _aux->alignment_pad = (uint8_t *)xcb_tmp; - xcb_block_len += (((nTypes + 3) & (~3)) - nTypes) * sizeof(uint8_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(uint8_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* ktLevelNames */ - _aux->ktLevelNames = (xcb_atom_t *)xcb_tmp; - xcb_block_len += xcb_sumof(_aux->nLevelsPerType, nTypes) * sizeof(xcb_atom_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_INDICATOR_NAMES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* indicatorNames */ - _aux->indicatorNames = (xcb_atom_t *)xcb_tmp; - xcb_block_len += xcb_popcount(indicators) * sizeof(xcb_atom_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_VIRTUAL_MOD_NAMES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* virtualModNames */ - _aux->virtualModNames = (xcb_atom_t *)xcb_tmp; - xcb_block_len += xcb_popcount(virtualMods) * sizeof(xcb_atom_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_GROUP_NAMES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* groups */ - _aux->groups = (xcb_atom_t *)xcb_tmp; - xcb_block_len += xcb_popcount(groupNames) * sizeof(xcb_atom_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_KEY_NAMES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* keyNames */ - _aux->keyNames = (xcb_xkb_key_name_t *)xcb_tmp; - xcb_block_len += nKeys * sizeof(xcb_xkb_key_name_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_xkb_key_name_t); - } - if(which & XCB_XKB_NAME_DETAIL_KEY_ALIASES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* keyAliases */ - _aux->keyAliases = (xcb_xkb_key_alias_t *)xcb_tmp; - xcb_block_len += nKeyAliases * sizeof(xcb_xkb_key_alias_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_xkb_key_alias_t); - } - if(which & XCB_XKB_NAME_DETAIL_RG_NAMES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* radioGroupNames */ - _aux->radioGroupNames = (xcb_atom_t *)xcb_tmp; - xcb_block_len += nRadioGroups * sizeof(xcb_atom_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - -int -xcb_xkb_get_names_value_list_sizeof (const void *_buffer /**< */, - uint8_t nTypes /**< */, - uint32_t indicators /**< */, - uint16_t virtualMods /**< */, - uint8_t groupNames /**< */, - uint8_t nKeys /**< */, - uint8_t nKeyAliases /**< */, - uint8_t nRadioGroups /**< */, - uint32_t which /**< */) -{ - xcb_xkb_get_names_value_list_t _aux; - return xcb_xkb_get_names_value_list_unpack(_buffer, nTypes, indicators, virtualMods, groupNames, nKeys, nKeyAliases, nRadioGroups, which, &_aux); -} - - -/***************************************************************************** - ** - ** xcb_xkb_get_names_cookie_t xcb_xkb_get_names - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @param uint32_t which - ** @returns xcb_xkb_get_names_cookie_t - ** - *****************************************************************************/ - -xcb_xkb_get_names_cookie_t -xcb_xkb_get_names (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */, - uint32_t which /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_GET_NAMES, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_xkb_get_names_cookie_t xcb_ret; - xcb_xkb_get_names_request_t xcb_out; - - xcb_out.deviceSpec = deviceSpec; - memset(xcb_out.pad0, 0, 2); - xcb_out.which = which; - - 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_xkb_get_names_cookie_t xcb_xkb_get_names_unchecked - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @param uint32_t which - ** @returns xcb_xkb_get_names_cookie_t - ** - *****************************************************************************/ - -xcb_xkb_get_names_cookie_t -xcb_xkb_get_names_unchecked (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */, - uint32_t which /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_GET_NAMES, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_xkb_get_names_cookie_t xcb_ret; - xcb_xkb_get_names_request_t xcb_out; - - xcb_out.deviceSpec = deviceSpec; - memset(xcb_out.pad0, 0, 2); - xcb_out.which = which; - - 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_xkb_get_names_value_list_t * xcb_xkb_get_names_value_list - ** - ** @param const xcb_xkb_get_names_reply_t *R - ** @returns xcb_xkb_get_names_value_list_t * - ** - *****************************************************************************/ - -void * -xcb_xkb_get_names_value_list (const xcb_xkb_get_names_reply_t *R /**< */) -{ - return (void *) (R + 1); -} - - -/***************************************************************************** - ** - ** xcb_xkb_get_names_reply_t * xcb_xkb_get_names_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_get_names_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_xkb_get_names_reply_t * - ** - *****************************************************************************/ - -xcb_xkb_get_names_reply_t * -xcb_xkb_get_names_reply (xcb_connection_t *c /**< */, - xcb_xkb_get_names_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_xkb_get_names_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - - -/***************************************************************************** - ** - ** xcb_atom_t * xcb_xkb_set_names_values_type_names - ** - ** @param const xcb_xkb_set_names_values_t *S - ** @returns xcb_atom_t * - ** - *****************************************************************************/ - -xcb_atom_t * -xcb_xkb_set_names_values_type_names (const xcb_xkb_set_names_values_t *S /**< */) -{ - return /* values */ S->typeNames; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_set_names_values_type_names_length - ** - ** @param const xcb_xkb_set_names_values_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_set_names_values_type_names_length (const xcb_xkb_set_names_request_t *R /**< */, - const xcb_xkb_set_names_values_t *S /**< */) -{ - return R->nTypes; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_set_names_values_type_names_end - ** - ** @param const xcb_xkb_set_names_values_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_set_names_values_type_names_end (const xcb_xkb_set_names_request_t *R /**< */, - const xcb_xkb_set_names_values_t *S /**< */) -{ - xcb_generic_iterator_t i; - i.data = /* values */ S->typeNames + R->nTypes; - i.rem = 0; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** uint8_t * xcb_xkb_set_names_values_n_levels_per_type - ** - ** @param const xcb_xkb_set_names_values_t *S - ** @returns uint8_t * - ** - *****************************************************************************/ - -uint8_t * -xcb_xkb_set_names_values_n_levels_per_type (const xcb_xkb_set_names_values_t *S /**< */) -{ - return /* values */ S->nLevelsPerType; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_set_names_values_n_levels_per_type_length - ** - ** @param const xcb_xkb_set_names_values_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_set_names_values_n_levels_per_type_length (const xcb_xkb_set_names_request_t *R /**< */, - const xcb_xkb_set_names_values_t *S /**< */) -{ - return R->nKTLevels; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_set_names_values_n_levels_per_type_end - ** - ** @param const xcb_xkb_set_names_values_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_set_names_values_n_levels_per_type_end (const xcb_xkb_set_names_request_t *R /**< */, - const xcb_xkb_set_names_values_t *S /**< */) -{ - xcb_generic_iterator_t i; - i.data = /* values */ S->nLevelsPerType + R->nKTLevels; - i.rem = 0; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** xcb_atom_t * xcb_xkb_set_names_values_kt_level_names - ** - ** @param const xcb_xkb_set_names_values_t *S - ** @returns xcb_atom_t * - ** - *****************************************************************************/ - -xcb_atom_t * -xcb_xkb_set_names_values_kt_level_names (const xcb_xkb_set_names_values_t *S /**< */) -{ - return /* values */ S->ktLevelNames; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_set_names_values_kt_level_names_length - ** - ** @param const xcb_xkb_set_names_values_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_set_names_values_kt_level_names_length (const xcb_xkb_set_names_request_t *R /**< */, - const xcb_xkb_set_names_values_t *S /**< */) -{ - return xcb_sumof(/* values */ S->nLevelsPerType, R->nKTLevels); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_set_names_values_kt_level_names_end - ** - ** @param const xcb_xkb_set_names_values_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_set_names_values_kt_level_names_end (const xcb_xkb_set_names_request_t *R /**< */, - const xcb_xkb_set_names_values_t *S /**< */) -{ - xcb_generic_iterator_t i; - i.data = /* values */ S->ktLevelNames + xcb_sumof(/* values */ S->nLevelsPerType, R->nKTLevels); - i.rem = 0; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** xcb_atom_t * xcb_xkb_set_names_values_indicator_names - ** - ** @param const xcb_xkb_set_names_values_t *S - ** @returns xcb_atom_t * - ** - *****************************************************************************/ - -xcb_atom_t * -xcb_xkb_set_names_values_indicator_names (const xcb_xkb_set_names_values_t *S /**< */) -{ - return /* values */ S->indicatorNames; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_set_names_values_indicator_names_length - ** - ** @param const xcb_xkb_set_names_values_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_set_names_values_indicator_names_length (const xcb_xkb_set_names_request_t *R /**< */, - const xcb_xkb_set_names_values_t *S /**< */) -{ - return xcb_popcount(R->indicators); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_set_names_values_indicator_names_end - ** - ** @param const xcb_xkb_set_names_values_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_set_names_values_indicator_names_end (const xcb_xkb_set_names_request_t *R /**< */, - const xcb_xkb_set_names_values_t *S /**< */) -{ - xcb_generic_iterator_t i; - i.data = /* values */ S->indicatorNames + xcb_popcount(R->indicators); - i.rem = 0; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** xcb_atom_t * xcb_xkb_set_names_values_virtual_mod_names - ** - ** @param const xcb_xkb_set_names_values_t *S - ** @returns xcb_atom_t * - ** - *****************************************************************************/ - -xcb_atom_t * -xcb_xkb_set_names_values_virtual_mod_names (const xcb_xkb_set_names_values_t *S /**< */) -{ - return /* values */ S->virtualModNames; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_set_names_values_virtual_mod_names_length - ** - ** @param const xcb_xkb_set_names_values_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_set_names_values_virtual_mod_names_length (const xcb_xkb_set_names_request_t *R /**< */, - const xcb_xkb_set_names_values_t *S /**< */) -{ - return xcb_popcount(R->virtualMods); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_set_names_values_virtual_mod_names_end - ** - ** @param const xcb_xkb_set_names_values_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_set_names_values_virtual_mod_names_end (const xcb_xkb_set_names_request_t *R /**< */, - const xcb_xkb_set_names_values_t *S /**< */) -{ - xcb_generic_iterator_t i; - i.data = /* values */ S->virtualModNames + xcb_popcount(R->virtualMods); - i.rem = 0; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** xcb_atom_t * xcb_xkb_set_names_values_groups - ** - ** @param const xcb_xkb_set_names_values_t *S - ** @returns xcb_atom_t * - ** - *****************************************************************************/ - -xcb_atom_t * -xcb_xkb_set_names_values_groups (const xcb_xkb_set_names_values_t *S /**< */) -{ - return /* values */ S->groups; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_set_names_values_groups_length - ** - ** @param const xcb_xkb_set_names_values_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_set_names_values_groups_length (const xcb_xkb_set_names_request_t *R /**< */, - const xcb_xkb_set_names_values_t *S /**< */) -{ - return xcb_popcount(R->groupNames); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_set_names_values_groups_end - ** - ** @param const xcb_xkb_set_names_values_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_set_names_values_groups_end (const xcb_xkb_set_names_request_t *R /**< */, - const xcb_xkb_set_names_values_t *S /**< */) -{ - xcb_generic_iterator_t i; - i.data = /* values */ S->groups + xcb_popcount(R->groupNames); - i.rem = 0; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** xcb_xkb_key_name_t * xcb_xkb_set_names_values_key_names - ** - ** @param const xcb_xkb_set_names_values_t *S - ** @returns xcb_xkb_key_name_t * - ** - *****************************************************************************/ - -xcb_xkb_key_name_t * -xcb_xkb_set_names_values_key_names (const xcb_xkb_set_names_values_t *S /**< */) -{ - return /* values */ S->keyNames; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_set_names_values_key_names_length - ** - ** @param const xcb_xkb_set_names_values_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_set_names_values_key_names_length (const xcb_xkb_set_names_request_t *R /**< */, - const xcb_xkb_set_names_values_t *S /**< */) -{ - return R->nKeys; -} - - -/***************************************************************************** - ** - ** xcb_xkb_key_name_iterator_t xcb_xkb_set_names_values_key_names_iterator - ** - ** @param const xcb_xkb_set_names_values_t *R - ** @returns xcb_xkb_key_name_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_key_name_iterator_t -xcb_xkb_set_names_values_key_names_iterator (const xcb_xkb_set_names_request_t *R /**< */, - const xcb_xkb_set_names_values_t *S /**< */) -{ - xcb_xkb_key_name_iterator_t i; - i.data = /* values */ S->keyNames; - i.rem = R->nKeys; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** xcb_xkb_key_alias_t * xcb_xkb_set_names_values_key_aliases - ** - ** @param const xcb_xkb_set_names_values_t *S - ** @returns xcb_xkb_key_alias_t * - ** - *****************************************************************************/ - -xcb_xkb_key_alias_t * -xcb_xkb_set_names_values_key_aliases (const xcb_xkb_set_names_values_t *S /**< */) -{ - return /* values */ S->keyAliases; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_set_names_values_key_aliases_length - ** - ** @param const xcb_xkb_set_names_values_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_set_names_values_key_aliases_length (const xcb_xkb_set_names_request_t *R /**< */, - const xcb_xkb_set_names_values_t *S /**< */) -{ - return R->nKeyAliases; -} - - -/***************************************************************************** - ** - ** xcb_xkb_key_alias_iterator_t xcb_xkb_set_names_values_key_aliases_iterator - ** - ** @param const xcb_xkb_set_names_values_t *R - ** @returns xcb_xkb_key_alias_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_key_alias_iterator_t -xcb_xkb_set_names_values_key_aliases_iterator (const xcb_xkb_set_names_request_t *R /**< */, - const xcb_xkb_set_names_values_t *S /**< */) -{ - xcb_xkb_key_alias_iterator_t i; - i.data = /* values */ S->keyAliases; - i.rem = R->nKeyAliases; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** xcb_atom_t * xcb_xkb_set_names_values_radio_group_names - ** - ** @param const xcb_xkb_set_names_values_t *S - ** @returns xcb_atom_t * - ** - *****************************************************************************/ - -xcb_atom_t * -xcb_xkb_set_names_values_radio_group_names (const xcb_xkb_set_names_values_t *S /**< */) -{ - return /* values */ S->radioGroupNames; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_set_names_values_radio_group_names_length - ** - ** @param const xcb_xkb_set_names_values_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_set_names_values_radio_group_names_length (const xcb_xkb_set_names_request_t *R /**< */, - const xcb_xkb_set_names_values_t *S /**< */) -{ - return R->nRadioGroups; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_set_names_values_radio_group_names_end - ** - ** @param const xcb_xkb_set_names_values_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_set_names_values_radio_group_names_end (const xcb_xkb_set_names_request_t *R /**< */, - const xcb_xkb_set_names_values_t *S /**< */) -{ - xcb_generic_iterator_t i; - i.data = /* values */ S->radioGroupNames + R->nRadioGroups; - i.rem = 0; - i.index = (char *) i.data - (char *) S; - return i; -} - -int -xcb_xkb_set_names_values_serialize (void **_buffer /**< */, - uint8_t nTypes /**< */, - uint8_t nKTLevels /**< */, - uint32_t indicators /**< */, - uint16_t virtualMods /**< */, - uint8_t groupNames /**< */, - uint8_t nKeys /**< */, - uint8_t nKeyAliases /**< */, - uint8_t nRadioGroups /**< */, - uint32_t which /**< */, - const xcb_xkb_set_names_values_t *_aux /**< */) -{ - char *xcb_out = *_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_align_to = 0; - - unsigned int xcb_pad = 0; - char xcb_pad0[3] = {0, 0, 0}; - struct iovec xcb_parts[25]; - unsigned int xcb_parts_idx = 0; - unsigned int xcb_block_len = 0; - unsigned int i; - char *xcb_tmp; - - if(which & XCB_XKB_NAME_DETAIL_KEYCODES) { - /* xcb_xkb_set_names_values_t.keycodesName */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->keycodesName; - xcb_block_len += sizeof(xcb_atom_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_GEOMETRY) { - /* xcb_xkb_set_names_values_t.geometryName */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometryName; - xcb_block_len += sizeof(xcb_atom_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_SYMBOLS) { - /* xcb_xkb_set_names_values_t.symbolsName */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->symbolsName; - xcb_block_len += sizeof(xcb_atom_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_PHYS_SYMBOLS) { - /* xcb_xkb_set_names_values_t.physSymbolsName */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->physSymbolsName; - xcb_block_len += sizeof(xcb_atom_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_TYPES) { - /* xcb_xkb_set_names_values_t.typesName */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->typesName; - xcb_block_len += sizeof(xcb_atom_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_COMPAT) { - /* xcb_xkb_set_names_values_t.compatName */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->compatName; - xcb_block_len += sizeof(xcb_atom_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_KEY_TYPE_NAMES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* typeNames */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->typeNames; - xcb_block_len += nTypes * sizeof(xcb_atom_t); - xcb_parts[xcb_parts_idx].iov_len = nTypes * sizeof(xcb_atom_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_KT_LEVEL_NAMES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* nLevelsPerType */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->nLevelsPerType; - xcb_block_len += nKTLevels * sizeof(uint8_t); - xcb_parts[xcb_parts_idx].iov_len = nKTLevels * sizeof(uint8_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* ktLevelNames */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->ktLevelNames; - xcb_block_len += xcb_sumof(_aux->nLevelsPerType, nKTLevels) * sizeof(xcb_atom_t); - xcb_parts[xcb_parts_idx].iov_len = xcb_sumof(_aux->nLevelsPerType, nKTLevels) * sizeof(xcb_atom_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_INDICATOR_NAMES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* indicatorNames */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->indicatorNames; - xcb_block_len += xcb_popcount(indicators) * sizeof(xcb_atom_t); - xcb_parts[xcb_parts_idx].iov_len = xcb_popcount(indicators) * sizeof(xcb_atom_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_VIRTUAL_MOD_NAMES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* virtualModNames */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->virtualModNames; - xcb_block_len += xcb_popcount(virtualMods) * sizeof(xcb_atom_t); - xcb_parts[xcb_parts_idx].iov_len = xcb_popcount(virtualMods) * sizeof(xcb_atom_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_GROUP_NAMES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* groups */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->groups; - xcb_block_len += xcb_popcount(groupNames) * sizeof(xcb_atom_t); - xcb_parts[xcb_parts_idx].iov_len = xcb_popcount(groupNames) * sizeof(xcb_atom_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_KEY_NAMES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* keyNames */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->keyNames; - xcb_block_len += nKeys * sizeof(xcb_xkb_key_name_t); - xcb_parts[xcb_parts_idx].iov_len = nKeys * sizeof(xcb_xkb_key_name_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_xkb_key_name_t); - } - if(which & XCB_XKB_NAME_DETAIL_KEY_ALIASES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* keyAliases */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->keyAliases; - xcb_block_len += nKeyAliases * sizeof(xcb_xkb_key_alias_t); - xcb_parts[xcb_parts_idx].iov_len = nKeyAliases * sizeof(xcb_xkb_key_alias_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_xkb_key_alias_t); - } - if(which & XCB_XKB_NAME_DETAIL_RG_NAMES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* radioGroupNames */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->radioGroupNames; - xcb_block_len += nRadioGroups * sizeof(xcb_atom_t); - xcb_parts[xcb_parts_idx].iov_len = nRadioGroups * sizeof(xcb_atom_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - - if (NULL == xcb_out) { - /* allocate memory */ - xcb_out = malloc(xcb_buffer_len); - *_buffer = xcb_out; - } - - xcb_tmp = xcb_out; - for(i=0; i<xcb_parts_idx; i++) { - if (0 != xcb_parts[i].iov_base && 0 != xcb_parts[i].iov_len) - memcpy(xcb_tmp, xcb_parts[i].iov_base, xcb_parts[i].iov_len); - if (0 != xcb_parts[i].iov_len) - xcb_tmp += xcb_parts[i].iov_len; - } - - return xcb_buffer_len; -} - -int -xcb_xkb_set_names_values_unpack (const void *_buffer /**< */, - uint8_t nTypes /**< */, - uint8_t nKTLevels /**< */, - uint32_t indicators /**< */, - uint16_t virtualMods /**< */, - uint8_t groupNames /**< */, - uint8_t nKeys /**< */, - uint8_t nKeyAliases /**< */, - uint8_t nRadioGroups /**< */, - uint32_t which /**< */, - xcb_xkb_set_names_values_t *_aux /**< */) -{ - char *xcb_tmp = (char *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to = 0; - - - if(which & XCB_XKB_NAME_DETAIL_KEYCODES) { - /* xcb_xkb_set_names_values_t.keycodesName */ - _aux->keycodesName = *(xcb_atom_t *)xcb_tmp; - xcb_block_len += sizeof(xcb_atom_t); - xcb_tmp += sizeof(xcb_atom_t); - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_GEOMETRY) { - /* xcb_xkb_set_names_values_t.geometryName */ - _aux->geometryName = *(xcb_atom_t *)xcb_tmp; - xcb_block_len += sizeof(xcb_atom_t); - xcb_tmp += sizeof(xcb_atom_t); - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_SYMBOLS) { - /* xcb_xkb_set_names_values_t.symbolsName */ - _aux->symbolsName = *(xcb_atom_t *)xcb_tmp; - xcb_block_len += sizeof(xcb_atom_t); - xcb_tmp += sizeof(xcb_atom_t); - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_PHYS_SYMBOLS) { - /* xcb_xkb_set_names_values_t.physSymbolsName */ - _aux->physSymbolsName = *(xcb_atom_t *)xcb_tmp; - xcb_block_len += sizeof(xcb_atom_t); - xcb_tmp += sizeof(xcb_atom_t); - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_TYPES) { - /* xcb_xkb_set_names_values_t.typesName */ - _aux->typesName = *(xcb_atom_t *)xcb_tmp; - xcb_block_len += sizeof(xcb_atom_t); - xcb_tmp += sizeof(xcb_atom_t); - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_COMPAT) { - /* xcb_xkb_set_names_values_t.compatName */ - _aux->compatName = *(xcb_atom_t *)xcb_tmp; - xcb_block_len += sizeof(xcb_atom_t); - xcb_tmp += sizeof(xcb_atom_t); - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_KEY_TYPE_NAMES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* typeNames */ - _aux->typeNames = (xcb_atom_t *)xcb_tmp; - xcb_block_len += nTypes * sizeof(xcb_atom_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_KT_LEVEL_NAMES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* nLevelsPerType */ - _aux->nLevelsPerType = (uint8_t *)xcb_tmp; - xcb_block_len += nKTLevels * sizeof(uint8_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(uint8_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* ktLevelNames */ - _aux->ktLevelNames = (xcb_atom_t *)xcb_tmp; - xcb_block_len += xcb_sumof(_aux->nLevelsPerType, nKTLevels) * sizeof(xcb_atom_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_INDICATOR_NAMES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* indicatorNames */ - _aux->indicatorNames = (xcb_atom_t *)xcb_tmp; - xcb_block_len += xcb_popcount(indicators) * sizeof(xcb_atom_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_VIRTUAL_MOD_NAMES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* virtualModNames */ - _aux->virtualModNames = (xcb_atom_t *)xcb_tmp; - xcb_block_len += xcb_popcount(virtualMods) * sizeof(xcb_atom_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_GROUP_NAMES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* groups */ - _aux->groups = (xcb_atom_t *)xcb_tmp; - xcb_block_len += xcb_popcount(groupNames) * sizeof(xcb_atom_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_KEY_NAMES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* keyNames */ - _aux->keyNames = (xcb_xkb_key_name_t *)xcb_tmp; - xcb_block_len += nKeys * sizeof(xcb_xkb_key_name_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_xkb_key_name_t); - } - if(which & XCB_XKB_NAME_DETAIL_KEY_ALIASES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* keyAliases */ - _aux->keyAliases = (xcb_xkb_key_alias_t *)xcb_tmp; - xcb_block_len += nKeyAliases * sizeof(xcb_xkb_key_alias_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_xkb_key_alias_t); - } - if(which & XCB_XKB_NAME_DETAIL_RG_NAMES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* radioGroupNames */ - _aux->radioGroupNames = (xcb_atom_t *)xcb_tmp; - xcb_block_len += nRadioGroups * sizeof(xcb_atom_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - -int -xcb_xkb_set_names_values_sizeof (const void *_buffer /**< */, - uint8_t nTypes /**< */, - uint8_t nKTLevels /**< */, - uint32_t indicators /**< */, - uint16_t virtualMods /**< */, - uint8_t groupNames /**< */, - uint8_t nKeys /**< */, - uint8_t nKeyAliases /**< */, - uint8_t nRadioGroups /**< */, - uint32_t which /**< */) -{ - xcb_xkb_set_names_values_t _aux; - return xcb_xkb_set_names_values_unpack(_buffer, nTypes, nKTLevels, indicators, virtualMods, groupNames, nKeys, nKeyAliases, nRadioGroups, which, &_aux); -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_xkb_set_names_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @param uint16_t virtualMods - ** @param uint32_t which - ** @param uint8_t firstType - ** @param uint8_t nTypes - ** @param uint8_t firstKTLevelt - ** @param uint8_t nKTLevels - ** @param uint32_t indicators - ** @param uint8_t groupNames - ** @param uint8_t nRadioGroups - ** @param xcb_keycode_t firstKey - ** @param uint8_t nKeys - ** @param uint8_t nKeyAliases - ** @param uint16_t totalKTLevelNames - ** @param const void *values - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xkb_set_names_checked (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */, - uint16_t virtualMods /**< */, - uint32_t which /**< */, - uint8_t firstType /**< */, - uint8_t nTypes /**< */, - uint8_t firstKTLevelt /**< */, - uint8_t nKTLevels /**< */, - uint32_t indicators /**< */, - uint8_t groupNames /**< */, - uint8_t nRadioGroups /**< */, - xcb_keycode_t firstKey /**< */, - uint8_t nKeys /**< */, - uint8_t nKeyAliases /**< */, - uint16_t totalKTLevelNames /**< */, - const void *values /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 3, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_SET_NAMES, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[5]; - xcb_void_cookie_t xcb_ret; - xcb_xkb_set_names_request_t xcb_out; - - xcb_out.deviceSpec = deviceSpec; - xcb_out.virtualMods = virtualMods; - xcb_out.which = which; - xcb_out.firstType = firstType; - xcb_out.nTypes = nTypes; - xcb_out.firstKTLevelt = firstKTLevelt; - xcb_out.nKTLevels = nKTLevels; - xcb_out.indicators = indicators; - xcb_out.groupNames = groupNames; - xcb_out.nRadioGroups = nRadioGroups; - xcb_out.firstKey = firstKey; - xcb_out.nKeys = nKeys; - xcb_out.nKeyAliases = nKeyAliases; - xcb_out.pad0 = 0; - xcb_out.totalKTLevelNames = totalKTLevelNames; - - 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_xkb_set_names_values_t values */ - xcb_parts[4].iov_base = (char *) values; - xcb_parts[4].iov_len = - xcb_xkb_set_names_values_sizeof (values, nTypes, nKTLevels, indicators, virtualMods, groupNames, nKeys, nKeyAliases, nRadioGroups, which); - - xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); - return xcb_ret; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_xkb_set_names - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @param uint16_t virtualMods - ** @param uint32_t which - ** @param uint8_t firstType - ** @param uint8_t nTypes - ** @param uint8_t firstKTLevelt - ** @param uint8_t nKTLevels - ** @param uint32_t indicators - ** @param uint8_t groupNames - ** @param uint8_t nRadioGroups - ** @param xcb_keycode_t firstKey - ** @param uint8_t nKeys - ** @param uint8_t nKeyAliases - ** @param uint16_t totalKTLevelNames - ** @param const void *values - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xkb_set_names (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */, - uint16_t virtualMods /**< */, - uint32_t which /**< */, - uint8_t firstType /**< */, - uint8_t nTypes /**< */, - uint8_t firstKTLevelt /**< */, - uint8_t nKTLevels /**< */, - uint32_t indicators /**< */, - uint8_t groupNames /**< */, - uint8_t nRadioGroups /**< */, - xcb_keycode_t firstKey /**< */, - uint8_t nKeys /**< */, - uint8_t nKeyAliases /**< */, - uint16_t totalKTLevelNames /**< */, - const void *values /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 3, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_SET_NAMES, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[5]; - xcb_void_cookie_t xcb_ret; - xcb_xkb_set_names_request_t xcb_out; - - xcb_out.deviceSpec = deviceSpec; - xcb_out.virtualMods = virtualMods; - xcb_out.which = which; - xcb_out.firstType = firstType; - xcb_out.nTypes = nTypes; - xcb_out.firstKTLevelt = firstKTLevelt; - xcb_out.nKTLevels = nKTLevels; - xcb_out.indicators = indicators; - xcb_out.groupNames = groupNames; - xcb_out.nRadioGroups = nRadioGroups; - xcb_out.firstKey = firstKey; - xcb_out.nKeys = nKeys; - xcb_out.nKeyAliases = nKeyAliases; - xcb_out.pad0 = 0; - xcb_out.totalKTLevelNames = totalKTLevelNames; - - 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_xkb_set_names_values_t values */ - xcb_parts[4].iov_base = (char *) values; - xcb_parts[4].iov_len = - xcb_xkb_set_names_values_sizeof (values, nTypes, nKTLevels, indicators, virtualMods, groupNames, nKeys, nKeyAliases, nRadioGroups, which); - - xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); - return xcb_ret; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_xkb_set_names_aux_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @param uint16_t virtualMods - ** @param uint32_t which - ** @param uint8_t firstType - ** @param uint8_t nTypes - ** @param uint8_t firstKTLevelt - ** @param uint8_t nKTLevels - ** @param uint32_t indicators - ** @param uint8_t groupNames - ** @param uint8_t nRadioGroups - ** @param xcb_keycode_t firstKey - ** @param uint8_t nKeys - ** @param uint8_t nKeyAliases - ** @param uint16_t totalKTLevelNames - ** @param const xcb_xkb_set_names_values_t *values - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xkb_set_names_aux_checked (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */, - uint16_t virtualMods /**< */, - uint32_t which /**< */, - uint8_t firstType /**< */, - uint8_t nTypes /**< */, - uint8_t firstKTLevelt /**< */, - uint8_t nKTLevels /**< */, - uint32_t indicators /**< */, - uint8_t groupNames /**< */, - uint8_t nRadioGroups /**< */, - xcb_keycode_t firstKey /**< */, - uint8_t nKeys /**< */, - uint8_t nKeyAliases /**< */, - uint16_t totalKTLevelNames /**< */, - const xcb_xkb_set_names_values_t *values /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 3, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_SET_NAMES, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[5]; - xcb_void_cookie_t xcb_ret; - xcb_xkb_set_names_request_t xcb_out; - void *xcb_aux0 = 0; - - xcb_out.deviceSpec = deviceSpec; - xcb_out.virtualMods = virtualMods; - xcb_out.which = which; - xcb_out.firstType = firstType; - xcb_out.nTypes = nTypes; - xcb_out.firstKTLevelt = firstKTLevelt; - xcb_out.nKTLevels = nKTLevels; - xcb_out.indicators = indicators; - xcb_out.groupNames = groupNames; - xcb_out.nRadioGroups = nRadioGroups; - xcb_out.firstKey = firstKey; - xcb_out.nKeys = nKeys; - xcb_out.nKeyAliases = nKeyAliases; - xcb_out.pad0 = 0; - xcb_out.totalKTLevelNames = totalKTLevelNames; - - 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_xkb_set_names_values_t values */ - xcb_parts[4].iov_len = - xcb_xkb_set_names_values_serialize (&xcb_aux0, nTypes, nKTLevels, indicators, virtualMods, groupNames, nKeys, nKeyAliases, nRadioGroups, which, values); - xcb_parts[4].iov_base = xcb_aux0; - - xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); - free(xcb_aux0); - return xcb_ret; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_xkb_set_names_aux - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @param uint16_t virtualMods - ** @param uint32_t which - ** @param uint8_t firstType - ** @param uint8_t nTypes - ** @param uint8_t firstKTLevelt - ** @param uint8_t nKTLevels - ** @param uint32_t indicators - ** @param uint8_t groupNames - ** @param uint8_t nRadioGroups - ** @param xcb_keycode_t firstKey - ** @param uint8_t nKeys - ** @param uint8_t nKeyAliases - ** @param uint16_t totalKTLevelNames - ** @param const xcb_xkb_set_names_values_t *values - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xkb_set_names_aux (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */, - uint16_t virtualMods /**< */, - uint32_t which /**< */, - uint8_t firstType /**< */, - uint8_t nTypes /**< */, - uint8_t firstKTLevelt /**< */, - uint8_t nKTLevels /**< */, - uint32_t indicators /**< */, - uint8_t groupNames /**< */, - uint8_t nRadioGroups /**< */, - xcb_keycode_t firstKey /**< */, - uint8_t nKeys /**< */, - uint8_t nKeyAliases /**< */, - uint16_t totalKTLevelNames /**< */, - const xcb_xkb_set_names_values_t *values /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 3, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_SET_NAMES, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[5]; - xcb_void_cookie_t xcb_ret; - xcb_xkb_set_names_request_t xcb_out; - void *xcb_aux0 = 0; - - xcb_out.deviceSpec = deviceSpec; - xcb_out.virtualMods = virtualMods; - xcb_out.which = which; - xcb_out.firstType = firstType; - xcb_out.nTypes = nTypes; - xcb_out.firstKTLevelt = firstKTLevelt; - xcb_out.nKTLevels = nKTLevels; - xcb_out.indicators = indicators; - xcb_out.groupNames = groupNames; - xcb_out.nRadioGroups = nRadioGroups; - xcb_out.firstKey = firstKey; - xcb_out.nKeys = nKeys; - xcb_out.nKeyAliases = nKeyAliases; - xcb_out.pad0 = 0; - xcb_out.totalKTLevelNames = totalKTLevelNames; - - 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_xkb_set_names_values_t values */ - xcb_parts[4].iov_len = - xcb_xkb_set_names_values_serialize (&xcb_aux0, nTypes, nKTLevels, indicators, virtualMods, groupNames, nKeys, nKeyAliases, nRadioGroups, which, values); - xcb_parts[4].iov_base = xcb_aux0; - - xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); - free(xcb_aux0); - return xcb_ret; -} - - -/***************************************************************************** - ** - ** xcb_xkb_per_client_flags_cookie_t xcb_xkb_per_client_flags - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @param uint32_t change - ** @param uint32_t value - ** @param uint32_t ctrlsToChange - ** @param uint32_t autoCtrls - ** @param uint32_t autoCtrlsValues - ** @returns xcb_xkb_per_client_flags_cookie_t - ** - *****************************************************************************/ - -xcb_xkb_per_client_flags_cookie_t -xcb_xkb_per_client_flags (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */, - uint32_t change /**< */, - uint32_t value /**< */, - uint32_t ctrlsToChange /**< */, - uint32_t autoCtrls /**< */, - uint32_t autoCtrlsValues /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_PER_CLIENT_FLAGS, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_xkb_per_client_flags_cookie_t xcb_ret; - xcb_xkb_per_client_flags_request_t xcb_out; - - xcb_out.deviceSpec = deviceSpec; - memset(xcb_out.pad0, 0, 2); - xcb_out.change = change; - xcb_out.value = value; - xcb_out.ctrlsToChange = ctrlsToChange; - xcb_out.autoCtrls = autoCtrls; - xcb_out.autoCtrlsValues = autoCtrlsValues; - - 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_xkb_per_client_flags_cookie_t xcb_xkb_per_client_flags_unchecked - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @param uint32_t change - ** @param uint32_t value - ** @param uint32_t ctrlsToChange - ** @param uint32_t autoCtrls - ** @param uint32_t autoCtrlsValues - ** @returns xcb_xkb_per_client_flags_cookie_t - ** - *****************************************************************************/ - -xcb_xkb_per_client_flags_cookie_t -xcb_xkb_per_client_flags_unchecked (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */, - uint32_t change /**< */, - uint32_t value /**< */, - uint32_t ctrlsToChange /**< */, - uint32_t autoCtrls /**< */, - uint32_t autoCtrlsValues /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_PER_CLIENT_FLAGS, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_xkb_per_client_flags_cookie_t xcb_ret; - xcb_xkb_per_client_flags_request_t xcb_out; - - xcb_out.deviceSpec = deviceSpec; - memset(xcb_out.pad0, 0, 2); - xcb_out.change = change; - xcb_out.value = value; - xcb_out.ctrlsToChange = ctrlsToChange; - xcb_out.autoCtrls = autoCtrls; - xcb_out.autoCtrlsValues = autoCtrlsValues; - - 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_xkb_per_client_flags_reply_t * xcb_xkb_per_client_flags_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_per_client_flags_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_xkb_per_client_flags_reply_t * - ** - *****************************************************************************/ - -xcb_xkb_per_client_flags_reply_t * -xcb_xkb_per_client_flags_reply (xcb_connection_t *c /**< */, - xcb_xkb_per_client_flags_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_xkb_per_client_flags_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - -int -xcb_xkb_list_components_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_xkb_list_components_reply_t *_aux = (xcb_xkb_list_components_reply_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to = 0; - - unsigned int i; - unsigned int xcb_tmp_len; - - xcb_block_len += sizeof(xcb_xkb_list_components_reply_t); - xcb_tmp += xcb_block_len; - xcb_buffer_len += xcb_block_len; - xcb_block_len = 0; - /* keymaps */ - for(i=0; i<_aux->nKeymaps; i++) { - xcb_tmp_len = xcb_xkb_listing_sizeof(xcb_tmp); - xcb_block_len += xcb_tmp_len; - xcb_tmp += xcb_tmp_len; - } - xcb_align_to = ALIGNOF(xcb_xkb_listing_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* keycodes */ - for(i=0; i<_aux->nKeycodes; i++) { - xcb_tmp_len = xcb_xkb_listing_sizeof(xcb_tmp); - xcb_block_len += xcb_tmp_len; - xcb_tmp += xcb_tmp_len; - } - xcb_align_to = ALIGNOF(xcb_xkb_listing_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* types */ - for(i=0; i<_aux->nTypes; i++) { - xcb_tmp_len = xcb_xkb_listing_sizeof(xcb_tmp); - xcb_block_len += xcb_tmp_len; - xcb_tmp += xcb_tmp_len; - } - xcb_align_to = ALIGNOF(xcb_xkb_listing_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* compatMaps */ - for(i=0; i<_aux->nCompatMaps; i++) { - xcb_tmp_len = xcb_xkb_listing_sizeof(xcb_tmp); - xcb_block_len += xcb_tmp_len; - xcb_tmp += xcb_tmp_len; - } - xcb_align_to = ALIGNOF(xcb_xkb_listing_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* symbols */ - for(i=0; i<_aux->nSymbols; i++) { - xcb_tmp_len = xcb_xkb_listing_sizeof(xcb_tmp); - xcb_block_len += xcb_tmp_len; - xcb_tmp += xcb_tmp_len; - } - xcb_align_to = ALIGNOF(xcb_xkb_listing_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* geometries */ - for(i=0; i<_aux->nGeometries; i++) { - xcb_tmp_len = xcb_xkb_listing_sizeof(xcb_tmp); - xcb_block_len += xcb_tmp_len; - xcb_tmp += xcb_tmp_len; - } - xcb_align_to = ALIGNOF(xcb_xkb_listing_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_xkb_list_components_cookie_t xcb_xkb_list_components - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @param uint16_t maxNames - ** @returns xcb_xkb_list_components_cookie_t - ** - *****************************************************************************/ - -xcb_xkb_list_components_cookie_t -xcb_xkb_list_components (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */, - uint16_t maxNames /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_LIST_COMPONENTS, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_xkb_list_components_cookie_t xcb_ret; - xcb_xkb_list_components_request_t xcb_out; - - xcb_out.deviceSpec = deviceSpec; - xcb_out.maxNames = maxNames; - - 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_xkb_list_components_cookie_t xcb_xkb_list_components_unchecked - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @param uint16_t maxNames - ** @returns xcb_xkb_list_components_cookie_t - ** - *****************************************************************************/ - -xcb_xkb_list_components_cookie_t -xcb_xkb_list_components_unchecked (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */, - uint16_t maxNames /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_LIST_COMPONENTS, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_xkb_list_components_cookie_t xcb_ret; - xcb_xkb_list_components_request_t xcb_out; - - xcb_out.deviceSpec = deviceSpec; - xcb_out.maxNames = maxNames; - - 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; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_list_components_keymaps_length - ** - ** @param const xcb_xkb_list_components_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_list_components_keymaps_length (const xcb_xkb_list_components_reply_t *R /**< */) -{ - return R->nKeymaps; -} - - -/***************************************************************************** - ** - ** xcb_xkb_listing_iterator_t xcb_xkb_list_components_keymaps_iterator - ** - ** @param const xcb_xkb_list_components_reply_t *R - ** @returns xcb_xkb_listing_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_listing_iterator_t -xcb_xkb_list_components_keymaps_iterator (const xcb_xkb_list_components_reply_t *R /**< */) -{ - xcb_xkb_listing_iterator_t i; - i.data = (xcb_xkb_listing_t *) (R + 1); - i.rem = R->nKeymaps; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_list_components_keycodes_length - ** - ** @param const xcb_xkb_list_components_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_list_components_keycodes_length (const xcb_xkb_list_components_reply_t *R /**< */) -{ - return R->nKeycodes; -} - - -/***************************************************************************** - ** - ** xcb_xkb_listing_iterator_t xcb_xkb_list_components_keycodes_iterator - ** - ** @param const xcb_xkb_list_components_reply_t *R - ** @returns xcb_xkb_listing_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_listing_iterator_t -xcb_xkb_list_components_keycodes_iterator (const xcb_xkb_list_components_reply_t *R /**< */) -{ - xcb_xkb_listing_iterator_t i; - xcb_generic_iterator_t prev = xcb_xkb_listing_end(xcb_xkb_list_components_keymaps_iterator(R)); - i.data = (xcb_xkb_listing_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xkb_listing_t, prev.index)); - i.rem = R->nKeycodes; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_list_components_types_length - ** - ** @param const xcb_xkb_list_components_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_list_components_types_length (const xcb_xkb_list_components_reply_t *R /**< */) -{ - return R->nTypes; -} - - -/***************************************************************************** - ** - ** xcb_xkb_listing_iterator_t xcb_xkb_list_components_types_iterator - ** - ** @param const xcb_xkb_list_components_reply_t *R - ** @returns xcb_xkb_listing_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_listing_iterator_t -xcb_xkb_list_components_types_iterator (const xcb_xkb_list_components_reply_t *R /**< */) -{ - xcb_xkb_listing_iterator_t i; - xcb_generic_iterator_t prev = xcb_xkb_listing_end(xcb_xkb_list_components_keycodes_iterator(R)); - i.data = (xcb_xkb_listing_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xkb_listing_t, prev.index)); - i.rem = R->nTypes; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_list_components_compat_maps_length - ** - ** @param const xcb_xkb_list_components_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_list_components_compat_maps_length (const xcb_xkb_list_components_reply_t *R /**< */) -{ - return R->nCompatMaps; -} - - -/***************************************************************************** - ** - ** xcb_xkb_listing_iterator_t xcb_xkb_list_components_compat_maps_iterator - ** - ** @param const xcb_xkb_list_components_reply_t *R - ** @returns xcb_xkb_listing_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_listing_iterator_t -xcb_xkb_list_components_compat_maps_iterator (const xcb_xkb_list_components_reply_t *R /**< */) -{ - xcb_xkb_listing_iterator_t i; - xcb_generic_iterator_t prev = xcb_xkb_listing_end(xcb_xkb_list_components_types_iterator(R)); - i.data = (xcb_xkb_listing_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xkb_listing_t, prev.index)); - i.rem = R->nCompatMaps; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_list_components_symbols_length - ** - ** @param const xcb_xkb_list_components_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_list_components_symbols_length (const xcb_xkb_list_components_reply_t *R /**< */) -{ - return R->nSymbols; -} - - -/***************************************************************************** - ** - ** xcb_xkb_listing_iterator_t xcb_xkb_list_components_symbols_iterator - ** - ** @param const xcb_xkb_list_components_reply_t *R - ** @returns xcb_xkb_listing_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_listing_iterator_t -xcb_xkb_list_components_symbols_iterator (const xcb_xkb_list_components_reply_t *R /**< */) -{ - xcb_xkb_listing_iterator_t i; - xcb_generic_iterator_t prev = xcb_xkb_listing_end(xcb_xkb_list_components_compat_maps_iterator(R)); - i.data = (xcb_xkb_listing_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xkb_listing_t, prev.index)); - i.rem = R->nSymbols; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_list_components_geometries_length - ** - ** @param const xcb_xkb_list_components_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_list_components_geometries_length (const xcb_xkb_list_components_reply_t *R /**< */) -{ - return R->nGeometries; -} - - -/***************************************************************************** - ** - ** xcb_xkb_listing_iterator_t xcb_xkb_list_components_geometries_iterator - ** - ** @param const xcb_xkb_list_components_reply_t *R - ** @returns xcb_xkb_listing_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_listing_iterator_t -xcb_xkb_list_components_geometries_iterator (const xcb_xkb_list_components_reply_t *R /**< */) -{ - xcb_xkb_listing_iterator_t i; - xcb_generic_iterator_t prev = xcb_xkb_listing_end(xcb_xkb_list_components_symbols_iterator(R)); - i.data = (xcb_xkb_listing_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xkb_listing_t, prev.index)); - i.rem = R->nGeometries; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** xcb_xkb_list_components_reply_t * xcb_xkb_list_components_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_list_components_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_xkb_list_components_reply_t * - ** - *****************************************************************************/ - -xcb_xkb_list_components_reply_t * -xcb_xkb_list_components_reply (xcb_connection_t *c /**< */, - xcb_xkb_list_components_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_xkb_list_components_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_kbd_by_name_replies_types_map_types_rtrn_length - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_types_map_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_kbd_by_name_replies_types_map_types_rtrn_length (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */, - const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - return /* replies */ S->types.nTypes; -} - - -/***************************************************************************** - ** - ** xcb_xkb_key_type_iterator_t xcb_xkb_get_kbd_by_name_replies_types_map_types_rtrn_iterator - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_types_map_t *R - ** @returns xcb_xkb_key_type_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_key_type_iterator_t -xcb_xkb_get_kbd_by_name_replies_types_map_types_rtrn_iterator (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */, - const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - xcb_xkb_key_type_iterator_t i; - i.data = /* replies */ S->types.map.types_rtrn; - i.rem = /* replies */ S->types.nTypes; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_kbd_by_name_replies_types_map_syms_rtrn_length - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_types_map_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_kbd_by_name_replies_types_map_syms_rtrn_length (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */, - const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - return /* replies */ S->types.nKeySyms; -} - - -/***************************************************************************** - ** - ** xcb_xkb_key_sym_map_iterator_t xcb_xkb_get_kbd_by_name_replies_types_map_syms_rtrn_iterator - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_types_map_t *R - ** @returns xcb_xkb_key_sym_map_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_key_sym_map_iterator_t -xcb_xkb_get_kbd_by_name_replies_types_map_syms_rtrn_iterator (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */, - const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - xcb_xkb_key_sym_map_iterator_t i; - i.data = /* replies */ S->types.map.syms_rtrn; - i.rem = /* replies */ S->types.nKeySyms; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** uint8_t * xcb_xkb_get_kbd_by_name_replies_types_map_acts_rtrn_count - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_t *S - ** @returns uint8_t * - ** - *****************************************************************************/ - -uint8_t * -xcb_xkb_get_kbd_by_name_replies_types_map_acts_rtrn_count (const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - return /* replies */ S->types.map.acts_rtrn_count; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_kbd_by_name_replies_types_map_acts_rtrn_count_length - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_types_map_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_kbd_by_name_replies_types_map_acts_rtrn_count_length (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */, - const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - return /* replies */ S->types.nKeyActions; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_get_kbd_by_name_replies_types_map_acts_rtrn_count_end - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_types_map_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_get_kbd_by_name_replies_types_map_acts_rtrn_count_end (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */, - const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - xcb_generic_iterator_t i; - i.data = /* replies */ S->types.map.acts_rtrn_count + /* replies */ S->types.nKeyActions; - i.rem = 0; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** xcb_xkb_action_t * xcb_xkb_get_kbd_by_name_replies_types_map_acts_rtrn_acts - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_t *S - ** @returns xcb_xkb_action_t * - ** - *****************************************************************************/ - -xcb_xkb_action_t * -xcb_xkb_get_kbd_by_name_replies_types_map_acts_rtrn_acts (const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - return /* replies */ S->types.map.acts_rtrn_acts; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_kbd_by_name_replies_types_map_acts_rtrn_acts_length - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_types_map_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_kbd_by_name_replies_types_map_acts_rtrn_acts_length (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */, - const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - return /* replies */ S->types.totalActions; -} - - -/***************************************************************************** - ** - ** xcb_xkb_action_iterator_t xcb_xkb_get_kbd_by_name_replies_types_map_acts_rtrn_acts_iterator - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_types_map_t *R - ** @returns xcb_xkb_action_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_action_iterator_t -xcb_xkb_get_kbd_by_name_replies_types_map_acts_rtrn_acts_iterator (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */, - const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - xcb_xkb_action_iterator_t i; - i.data = /* replies */ S->types.map.acts_rtrn_acts; - i.rem = /* replies */ S->types.totalActions; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** xcb_xkb_set_behavior_t * xcb_xkb_get_kbd_by_name_replies_types_map_behaviors_rtrn - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_t *S - ** @returns xcb_xkb_set_behavior_t * - ** - *****************************************************************************/ - -xcb_xkb_set_behavior_t * -xcb_xkb_get_kbd_by_name_replies_types_map_behaviors_rtrn (const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - return /* replies */ S->types.map.behaviors_rtrn; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_kbd_by_name_replies_types_map_behaviors_rtrn_length - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_types_map_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_kbd_by_name_replies_types_map_behaviors_rtrn_length (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */, - const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - return /* replies */ S->types.totalKeyBehaviors; -} - - -/***************************************************************************** - ** - ** xcb_xkb_set_behavior_iterator_t xcb_xkb_get_kbd_by_name_replies_types_map_behaviors_rtrn_iterator - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_types_map_t *R - ** @returns xcb_xkb_set_behavior_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_set_behavior_iterator_t -xcb_xkb_get_kbd_by_name_replies_types_map_behaviors_rtrn_iterator (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */, - const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - xcb_xkb_set_behavior_iterator_t i; - i.data = /* replies */ S->types.map.behaviors_rtrn; - i.rem = /* replies */ S->types.totalKeyBehaviors; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** uint8_t * xcb_xkb_get_kbd_by_name_replies_types_map_vmods_rtrn - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_t *S - ** @returns uint8_t * - ** - *****************************************************************************/ - -uint8_t * -xcb_xkb_get_kbd_by_name_replies_types_map_vmods_rtrn (const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - return /* replies */ S->types.map.vmods_rtrn; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_kbd_by_name_replies_types_map_vmods_rtrn_length - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_types_map_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_kbd_by_name_replies_types_map_vmods_rtrn_length (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */, - const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - return xcb_popcount(/* replies */ S->types.virtualMods); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_get_kbd_by_name_replies_types_map_vmods_rtrn_end - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_types_map_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_get_kbd_by_name_replies_types_map_vmods_rtrn_end (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */, - const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - xcb_generic_iterator_t i; - i.data = /* replies */ S->types.map.vmods_rtrn + xcb_popcount(/* replies */ S->types.virtualMods); - i.rem = 0; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** xcb_xkb_set_explicit_t * xcb_xkb_get_kbd_by_name_replies_types_map_explicit_rtrn - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_t *S - ** @returns xcb_xkb_set_explicit_t * - ** - *****************************************************************************/ - -xcb_xkb_set_explicit_t * -xcb_xkb_get_kbd_by_name_replies_types_map_explicit_rtrn (const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - return /* replies */ S->types.map.explicit_rtrn; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_kbd_by_name_replies_types_map_explicit_rtrn_length - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_types_map_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_kbd_by_name_replies_types_map_explicit_rtrn_length (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */, - const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - return /* replies */ S->types.totalKeyExplicit; -} - - -/***************************************************************************** - ** - ** xcb_xkb_set_explicit_iterator_t xcb_xkb_get_kbd_by_name_replies_types_map_explicit_rtrn_iterator - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_types_map_t *R - ** @returns xcb_xkb_set_explicit_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_set_explicit_iterator_t -xcb_xkb_get_kbd_by_name_replies_types_map_explicit_rtrn_iterator (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */, - const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - xcb_xkb_set_explicit_iterator_t i; - i.data = /* replies */ S->types.map.explicit_rtrn; - i.rem = /* replies */ S->types.totalKeyExplicit; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** xcb_xkb_key_mod_map_t * xcb_xkb_get_kbd_by_name_replies_types_map_modmap_rtrn - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_t *S - ** @returns xcb_xkb_key_mod_map_t * - ** - *****************************************************************************/ - -xcb_xkb_key_mod_map_t * -xcb_xkb_get_kbd_by_name_replies_types_map_modmap_rtrn (const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - return /* replies */ S->types.map.modmap_rtrn; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_kbd_by_name_replies_types_map_modmap_rtrn_length - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_types_map_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_kbd_by_name_replies_types_map_modmap_rtrn_length (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */, - const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - return /* replies */ S->types.totalModMapKeys; -} - - -/***************************************************************************** - ** - ** xcb_xkb_key_mod_map_iterator_t xcb_xkb_get_kbd_by_name_replies_types_map_modmap_rtrn_iterator - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_types_map_t *R - ** @returns xcb_xkb_key_mod_map_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_key_mod_map_iterator_t -xcb_xkb_get_kbd_by_name_replies_types_map_modmap_rtrn_iterator (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */, - const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - xcb_xkb_key_mod_map_iterator_t i; - i.data = /* replies */ S->types.map.modmap_rtrn; - i.rem = /* replies */ S->types.totalModMapKeys; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** xcb_xkb_key_v_mod_map_t * xcb_xkb_get_kbd_by_name_replies_types_map_vmodmap_rtrn - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_t *S - ** @returns xcb_xkb_key_v_mod_map_t * - ** - *****************************************************************************/ - -xcb_xkb_key_v_mod_map_t * -xcb_xkb_get_kbd_by_name_replies_types_map_vmodmap_rtrn (const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - return /* replies */ S->types.map.vmodmap_rtrn; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_kbd_by_name_replies_types_map_vmodmap_rtrn_length - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_types_map_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_kbd_by_name_replies_types_map_vmodmap_rtrn_length (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */, - const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - return /* replies */ S->types.totalVModMapKeys; -} - - -/***************************************************************************** - ** - ** xcb_xkb_key_v_mod_map_iterator_t xcb_xkb_get_kbd_by_name_replies_types_map_vmodmap_rtrn_iterator - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_types_map_t *R - ** @returns xcb_xkb_key_v_mod_map_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_key_v_mod_map_iterator_t -xcb_xkb_get_kbd_by_name_replies_types_map_vmodmap_rtrn_iterator (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */, - const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - xcb_xkb_key_v_mod_map_iterator_t i; - i.data = /* replies */ S->types.map.vmodmap_rtrn; - i.rem = /* replies */ S->types.totalVModMapKeys; - i.index = (char *) i.data - (char *) S; - return i; -} - -int -xcb_xkb_get_kbd_by_name_replies_types_map_serialize (void **_buffer /**< */, - uint8_t nTypes /**< */, - uint8_t nKeySyms /**< */, - uint8_t nKeyActions /**< */, - uint16_t totalActions /**< */, - uint8_t totalKeyBehaviors /**< */, - uint16_t virtualMods /**< */, - uint8_t totalKeyExplicit /**< */, - uint8_t totalModMapKeys /**< */, - uint8_t totalVModMapKeys /**< */, - uint16_t present /**< */, - const xcb_xkb_get_kbd_by_name_replies_types_map_t *_aux /**< */) -{ - char *xcb_out = *_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_align_to = 0; - - unsigned int xcb_pad = 0; - char xcb_pad0[3] = {0, 0, 0}; - struct iovec xcb_parts[19]; - unsigned int xcb_parts_idx = 0; - unsigned int xcb_block_len = 0; - unsigned int i; - char *xcb_tmp; - - if(present & XCB_XKB_MAP_PART_KEY_TYPES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* types_rtrn */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->types_rtrn; - xcb_parts[xcb_parts_idx].iov_len = 0; - xcb_tmp = (char *) _aux->types_rtrn; - for(i=0; i<nTypes; i++) { - xcb_block_len = xcb_xkb_key_type_sizeof(xcb_tmp); - xcb_parts[xcb_parts_idx].iov_len += xcb_block_len; - } - xcb_block_len = xcb_parts[xcb_parts_idx].iov_len; - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_xkb_key_type_t); - } - if(present & XCB_XKB_MAP_PART_KEY_SYMS) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* syms_rtrn */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->syms_rtrn; - xcb_parts[xcb_parts_idx].iov_len = 0; - xcb_tmp = (char *) _aux->syms_rtrn; - for(i=0; i<nKeySyms; i++) { - xcb_block_len = xcb_xkb_key_sym_map_sizeof(xcb_tmp); - xcb_parts[xcb_parts_idx].iov_len += xcb_block_len; - } - xcb_block_len = xcb_parts[xcb_parts_idx].iov_len; - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_xkb_key_sym_map_t); - } - if(present & XCB_XKB_MAP_PART_KEY_ACTIONS) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* acts_rtrn_count */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->acts_rtrn_count; - xcb_block_len += nKeyActions * sizeof(xcb_keycode_t); - xcb_parts[xcb_parts_idx].iov_len = nKeyActions * sizeof(xcb_keycode_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* acts_rtrn_acts */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->acts_rtrn_acts; - xcb_block_len += totalActions * sizeof(xcb_xkb_action_t); - xcb_parts[xcb_parts_idx].iov_len = totalActions * sizeof(xcb_xkb_action_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_xkb_action_t); - } - if(present & XCB_XKB_MAP_PART_KEY_BEHAVIORS) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* behaviors_rtrn */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->behaviors_rtrn; - xcb_block_len += totalKeyBehaviors * sizeof(xcb_xkb_set_behavior_t); - xcb_parts[xcb_parts_idx].iov_len = totalKeyBehaviors * sizeof(xcb_xkb_set_behavior_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_xkb_set_behavior_t); - } - if(present & XCB_XKB_MAP_PART_VIRTUAL_MODS) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* vmods_rtrn */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->vmods_rtrn; - xcb_block_len += xcb_popcount(virtualMods) * sizeof(xcb_keycode_t); - xcb_parts[xcb_parts_idx].iov_len = xcb_popcount(virtualMods) * sizeof(xcb_keycode_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - } - if(present & XCB_XKB_MAP_PART_EXPLICIT_COMPONENTS) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* explicit_rtrn */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->explicit_rtrn; - xcb_block_len += totalKeyExplicit * sizeof(xcb_xkb_set_explicit_t); - xcb_parts[xcb_parts_idx].iov_len = totalKeyExplicit * sizeof(xcb_xkb_set_explicit_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_xkb_set_explicit_t); - } - if(present & XCB_XKB_MAP_PART_MODIFIER_MAP) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* modmap_rtrn */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->modmap_rtrn; - xcb_block_len += totalModMapKeys * sizeof(xcb_xkb_key_mod_map_t); - xcb_parts[xcb_parts_idx].iov_len = totalModMapKeys * sizeof(xcb_xkb_key_mod_map_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_xkb_key_mod_map_t); - } - if(present & XCB_XKB_MAP_PART_VIRTUAL_MOD_MAP) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* vmodmap_rtrn */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->vmodmap_rtrn; - xcb_block_len += totalVModMapKeys * sizeof(xcb_xkb_key_v_mod_map_t); - xcb_parts[xcb_parts_idx].iov_len = totalVModMapKeys * sizeof(xcb_xkb_key_v_mod_map_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_xkb_key_v_mod_map_t); - } - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - - if (NULL == xcb_out) { - /* allocate memory */ - xcb_out = malloc(xcb_buffer_len); - *_buffer = xcb_out; - } - - xcb_tmp = xcb_out; - for(i=0; i<xcb_parts_idx; i++) { - if (0 != xcb_parts[i].iov_base && 0 != xcb_parts[i].iov_len) - memcpy(xcb_tmp, xcb_parts[i].iov_base, xcb_parts[i].iov_len); - if (0 != xcb_parts[i].iov_len) - xcb_tmp += xcb_parts[i].iov_len; - } - - return xcb_buffer_len; -} - -int -xcb_xkb_get_kbd_by_name_replies_types_map_unpack (const void *_buffer /**< */, - uint8_t nTypes /**< */, - uint8_t nKeySyms /**< */, - uint8_t nKeyActions /**< */, - uint16_t totalActions /**< */, - uint8_t totalKeyBehaviors /**< */, - uint16_t virtualMods /**< */, - uint8_t totalKeyExplicit /**< */, - uint8_t totalModMapKeys /**< */, - uint8_t totalVModMapKeys /**< */, - uint16_t present /**< */, - xcb_xkb_get_kbd_by_name_replies_types_map_t *_aux /**< */) -{ - char *xcb_tmp = (char *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to = 0; - - unsigned int i; - unsigned int xcb_tmp_len; - - if(present & XCB_XKB_MAP_PART_KEY_TYPES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* types_rtrn */ - _aux->types_rtrn = (xcb_xkb_key_type_t *)xcb_tmp; - for(i=0; i<nTypes; i++) { - xcb_tmp_len = xcb_xkb_key_type_sizeof(xcb_tmp); - xcb_block_len += xcb_tmp_len; - xcb_tmp += xcb_tmp_len; - } - xcb_align_to = ALIGNOF(xcb_xkb_key_type_t); - } - if(present & XCB_XKB_MAP_PART_KEY_SYMS) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* syms_rtrn */ - _aux->syms_rtrn = (xcb_xkb_key_sym_map_t *)xcb_tmp; - for(i=0; i<nKeySyms; i++) { - xcb_tmp_len = xcb_xkb_key_sym_map_sizeof(xcb_tmp); - xcb_block_len += xcb_tmp_len; - xcb_tmp += xcb_tmp_len; - } - xcb_align_to = ALIGNOF(xcb_xkb_key_sym_map_t); - } - if(present & XCB_XKB_MAP_PART_KEY_ACTIONS) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* acts_rtrn_count */ - _aux->acts_rtrn_count = (uint8_t *)xcb_tmp; - xcb_block_len += nKeyActions * sizeof(xcb_keycode_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(uint8_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* acts_rtrn_acts */ - _aux->acts_rtrn_acts = (xcb_xkb_action_t *)xcb_tmp; - xcb_block_len += totalActions * sizeof(xcb_xkb_action_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_xkb_action_t); - } - if(present & XCB_XKB_MAP_PART_KEY_BEHAVIORS) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* behaviors_rtrn */ - _aux->behaviors_rtrn = (xcb_xkb_set_behavior_t *)xcb_tmp; - xcb_block_len += totalKeyBehaviors * sizeof(xcb_xkb_set_behavior_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_xkb_set_behavior_t); - } - if(present & XCB_XKB_MAP_PART_VIRTUAL_MODS) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* vmods_rtrn */ - _aux->vmods_rtrn = (uint8_t *)xcb_tmp; - xcb_block_len += xcb_popcount(virtualMods) * sizeof(xcb_keycode_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(uint8_t); - } - if(present & XCB_XKB_MAP_PART_EXPLICIT_COMPONENTS) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* explicit_rtrn */ - _aux->explicit_rtrn = (xcb_xkb_set_explicit_t *)xcb_tmp; - xcb_block_len += totalKeyExplicit * sizeof(xcb_xkb_set_explicit_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_xkb_set_explicit_t); - } - if(present & XCB_XKB_MAP_PART_MODIFIER_MAP) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* modmap_rtrn */ - _aux->modmap_rtrn = (xcb_xkb_key_mod_map_t *)xcb_tmp; - xcb_block_len += totalModMapKeys * sizeof(xcb_xkb_key_mod_map_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_xkb_key_mod_map_t); - } - if(present & XCB_XKB_MAP_PART_VIRTUAL_MOD_MAP) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* vmodmap_rtrn */ - _aux->vmodmap_rtrn = (xcb_xkb_key_v_mod_map_t *)xcb_tmp; - xcb_block_len += totalVModMapKeys * sizeof(xcb_xkb_key_v_mod_map_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_xkb_key_v_mod_map_t); - } - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - -int -xcb_xkb_get_kbd_by_name_replies_types_map_sizeof (const void *_buffer /**< */, - uint8_t nTypes /**< */, - uint8_t nKeySyms /**< */, - uint8_t nKeyActions /**< */, - uint16_t totalActions /**< */, - uint8_t totalKeyBehaviors /**< */, - uint16_t virtualMods /**< */, - uint8_t totalKeyExplicit /**< */, - uint8_t totalModMapKeys /**< */, - uint8_t totalVModMapKeys /**< */, - uint16_t present /**< */) -{ - xcb_xkb_get_kbd_by_name_replies_types_map_t _aux; - return xcb_xkb_get_kbd_by_name_replies_types_map_unpack(_buffer, nTypes, nKeySyms, nKeyActions, totalActions, totalKeyBehaviors, virtualMods, totalKeyExplicit, totalModMapKeys, totalVModMapKeys, present, &_aux); -} - - -/***************************************************************************** - ** - ** xcb_atom_t * xcb_xkb_get_kbd_by_name_replies_key_names_value_list_type_names - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_t *S - ** @returns xcb_atom_t * - ** - *****************************************************************************/ - -xcb_atom_t * -xcb_xkb_get_kbd_by_name_replies_key_names_value_list_type_names (const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - return /* replies */ S->key_names.valueList.typeNames; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_kbd_by_name_replies_key_names_value_list_type_names_length - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_kbd_by_name_replies_key_names_value_list_type_names_length (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */, - const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - return /* replies */ S->key_names.nTypes; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_get_kbd_by_name_replies_key_names_value_list_type_names_end - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_get_kbd_by_name_replies_key_names_value_list_type_names_end (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */, - const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - xcb_generic_iterator_t i; - i.data = /* replies */ S->key_names.valueList.typeNames + /* replies */ S->key_names.nTypes; - i.rem = 0; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** uint8_t * xcb_xkb_get_kbd_by_name_replies_key_names_value_list_n_levels_per_type - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_t *S - ** @returns uint8_t * - ** - *****************************************************************************/ - -uint8_t * -xcb_xkb_get_kbd_by_name_replies_key_names_value_list_n_levels_per_type (const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - return /* replies */ S->key_names.valueList.nLevelsPerType; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_kbd_by_name_replies_key_names_value_list_n_levels_per_type_length - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_kbd_by_name_replies_key_names_value_list_n_levels_per_type_length (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */, - const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - return /* replies */ S->key_names.nKTLevels; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_get_kbd_by_name_replies_key_names_value_list_n_levels_per_type_end - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_get_kbd_by_name_replies_key_names_value_list_n_levels_per_type_end (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */, - const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - xcb_generic_iterator_t i; - i.data = /* replies */ S->key_names.valueList.nLevelsPerType + /* replies */ S->key_names.nKTLevels; - i.rem = 0; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** xcb_atom_t * xcb_xkb_get_kbd_by_name_replies_key_names_value_list_kt_level_names - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_t *S - ** @returns xcb_atom_t * - ** - *****************************************************************************/ - -xcb_atom_t * -xcb_xkb_get_kbd_by_name_replies_key_names_value_list_kt_level_names (const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - return /* replies */ S->key_names.valueList.ktLevelNames; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_kbd_by_name_replies_key_names_value_list_kt_level_names_length - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_kbd_by_name_replies_key_names_value_list_kt_level_names_length (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */, - const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - return xcb_sumof(/* replies */ S->key_names.valueList.nLevelsPerType, /* replies */ S->key_names.nKTLevels); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_get_kbd_by_name_replies_key_names_value_list_kt_level_names_end - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_get_kbd_by_name_replies_key_names_value_list_kt_level_names_end (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */, - const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - xcb_generic_iterator_t i; - i.data = /* replies */ S->key_names.valueList.ktLevelNames + xcb_sumof(/* replies */ S->key_names.valueList.nLevelsPerType, /* replies */ S->key_names.nKTLevels); - i.rem = 0; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** xcb_atom_t * xcb_xkb_get_kbd_by_name_replies_key_names_value_list_indicator_names - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_t *S - ** @returns xcb_atom_t * - ** - *****************************************************************************/ - -xcb_atom_t * -xcb_xkb_get_kbd_by_name_replies_key_names_value_list_indicator_names (const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - return /* replies */ S->key_names.valueList.indicatorNames; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_kbd_by_name_replies_key_names_value_list_indicator_names_length - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_kbd_by_name_replies_key_names_value_list_indicator_names_length (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */, - const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - return xcb_popcount(/* replies */ S->key_names.indicators); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_get_kbd_by_name_replies_key_names_value_list_indicator_names_end - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_get_kbd_by_name_replies_key_names_value_list_indicator_names_end (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */, - const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - xcb_generic_iterator_t i; - i.data = /* replies */ S->key_names.valueList.indicatorNames + xcb_popcount(/* replies */ S->key_names.indicators); - i.rem = 0; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** xcb_atom_t * xcb_xkb_get_kbd_by_name_replies_key_names_value_list_virtual_mod_names - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_t *S - ** @returns xcb_atom_t * - ** - *****************************************************************************/ - -xcb_atom_t * -xcb_xkb_get_kbd_by_name_replies_key_names_value_list_virtual_mod_names (const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - return /* replies */ S->key_names.valueList.virtualModNames; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_kbd_by_name_replies_key_names_value_list_virtual_mod_names_length - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_kbd_by_name_replies_key_names_value_list_virtual_mod_names_length (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */, - const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - return xcb_popcount(/* replies */ S->key_names.virtualMods); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_get_kbd_by_name_replies_key_names_value_list_virtual_mod_names_end - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_get_kbd_by_name_replies_key_names_value_list_virtual_mod_names_end (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */, - const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - xcb_generic_iterator_t i; - i.data = /* replies */ S->key_names.valueList.virtualModNames + xcb_popcount(/* replies */ S->key_names.virtualMods); - i.rem = 0; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** xcb_atom_t * xcb_xkb_get_kbd_by_name_replies_key_names_value_list_groups - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_t *S - ** @returns xcb_atom_t * - ** - *****************************************************************************/ - -xcb_atom_t * -xcb_xkb_get_kbd_by_name_replies_key_names_value_list_groups (const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - return /* replies */ S->key_names.valueList.groups; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_kbd_by_name_replies_key_names_value_list_groups_length - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_kbd_by_name_replies_key_names_value_list_groups_length (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */, - const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - return xcb_popcount(/* replies */ S->key_names.groupNames); -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_get_kbd_by_name_replies_key_names_value_list_groups_end - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_get_kbd_by_name_replies_key_names_value_list_groups_end (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */, - const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - xcb_generic_iterator_t i; - i.data = /* replies */ S->key_names.valueList.groups + xcb_popcount(/* replies */ S->key_names.groupNames); - i.rem = 0; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** xcb_xkb_key_name_t * xcb_xkb_get_kbd_by_name_replies_key_names_value_list_key_names - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_t *S - ** @returns xcb_xkb_key_name_t * - ** - *****************************************************************************/ - -xcb_xkb_key_name_t * -xcb_xkb_get_kbd_by_name_replies_key_names_value_list_key_names (const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - return /* replies */ S->key_names.valueList.keyNames; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_kbd_by_name_replies_key_names_value_list_key_names_length - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_kbd_by_name_replies_key_names_value_list_key_names_length (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */, - const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - return /* replies */ S->key_names.nKeys; -} - - -/***************************************************************************** - ** - ** xcb_xkb_key_name_iterator_t xcb_xkb_get_kbd_by_name_replies_key_names_value_list_key_names_iterator - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t *R - ** @returns xcb_xkb_key_name_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_key_name_iterator_t -xcb_xkb_get_kbd_by_name_replies_key_names_value_list_key_names_iterator (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */, - const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - xcb_xkb_key_name_iterator_t i; - i.data = /* replies */ S->key_names.valueList.keyNames; - i.rem = /* replies */ S->key_names.nKeys; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** xcb_xkb_key_alias_t * xcb_xkb_get_kbd_by_name_replies_key_names_value_list_key_aliases - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_t *S - ** @returns xcb_xkb_key_alias_t * - ** - *****************************************************************************/ - -xcb_xkb_key_alias_t * -xcb_xkb_get_kbd_by_name_replies_key_names_value_list_key_aliases (const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - return /* replies */ S->key_names.valueList.keyAliases; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_kbd_by_name_replies_key_names_value_list_key_aliases_length - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_kbd_by_name_replies_key_names_value_list_key_aliases_length (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */, - const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - return /* replies */ S->key_names.nKeyAliases; -} - - -/***************************************************************************** - ** - ** xcb_xkb_key_alias_iterator_t xcb_xkb_get_kbd_by_name_replies_key_names_value_list_key_aliases_iterator - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t *R - ** @returns xcb_xkb_key_alias_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_key_alias_iterator_t -xcb_xkb_get_kbd_by_name_replies_key_names_value_list_key_aliases_iterator (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */, - const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - xcb_xkb_key_alias_iterator_t i; - i.data = /* replies */ S->key_names.valueList.keyAliases; - i.rem = /* replies */ S->key_names.nKeyAliases; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** xcb_atom_t * xcb_xkb_get_kbd_by_name_replies_key_names_value_list_radio_group_names - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_t *S - ** @returns xcb_atom_t * - ** - *****************************************************************************/ - -xcb_atom_t * -xcb_xkb_get_kbd_by_name_replies_key_names_value_list_radio_group_names (const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - return /* replies */ S->key_names.valueList.radioGroupNames; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_kbd_by_name_replies_key_names_value_list_radio_group_names_length - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_kbd_by_name_replies_key_names_value_list_radio_group_names_length (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */, - const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - return /* replies */ S->key_names.nRadioGroups; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_get_kbd_by_name_replies_key_names_value_list_radio_group_names_end - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_get_kbd_by_name_replies_key_names_value_list_radio_group_names_end (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */, - const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - xcb_generic_iterator_t i; - i.data = /* replies */ S->key_names.valueList.radioGroupNames + /* replies */ S->key_names.nRadioGroups; - i.rem = 0; - i.index = (char *) i.data - (char *) S; - return i; -} - -int -xcb_xkb_get_kbd_by_name_replies_key_names_value_list_serialize (void **_buffer /**< */, - uint8_t nTypes /**< */, - uint16_t nKTLevels /**< */, - uint32_t indicators /**< */, - uint16_t virtualMods /**< */, - uint8_t groupNames /**< */, - uint8_t nKeys /**< */, - uint8_t nKeyAliases /**< */, - uint8_t nRadioGroups /**< */, - uint32_t which /**< */, - const xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t *_aux /**< */) -{ - char *xcb_out = *_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_align_to = 0; - - unsigned int xcb_pad = 0; - char xcb_pad0[3] = {0, 0, 0}; - struct iovec xcb_parts[25]; - unsigned int xcb_parts_idx = 0; - unsigned int xcb_block_len = 0; - unsigned int i; - char *xcb_tmp; - - if(which & XCB_XKB_NAME_DETAIL_KEYCODES) { - /* xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t.keycodesName */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->keycodesName; - xcb_block_len += sizeof(xcb_atom_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_GEOMETRY) { - /* xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t.geometryName */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometryName; - xcb_block_len += sizeof(xcb_atom_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_SYMBOLS) { - /* xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t.symbolsName */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->symbolsName; - xcb_block_len += sizeof(xcb_atom_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_PHYS_SYMBOLS) { - /* xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t.physSymbolsName */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->physSymbolsName; - xcb_block_len += sizeof(xcb_atom_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_TYPES) { - /* xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t.typesName */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->typesName; - xcb_block_len += sizeof(xcb_atom_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_COMPAT) { - /* xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t.compatName */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->compatName; - xcb_block_len += sizeof(xcb_atom_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_KEY_TYPE_NAMES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* typeNames */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->typeNames; - xcb_block_len += nTypes * sizeof(xcb_atom_t); - xcb_parts[xcb_parts_idx].iov_len = nTypes * sizeof(xcb_atom_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_KT_LEVEL_NAMES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* nLevelsPerType */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->nLevelsPerType; - xcb_block_len += nKTLevels * sizeof(uint8_t); - xcb_parts[xcb_parts_idx].iov_len = nKTLevels * sizeof(uint8_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* ktLevelNames */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->ktLevelNames; - xcb_block_len += xcb_sumof(_aux->nLevelsPerType, nKTLevels) * sizeof(xcb_atom_t); - xcb_parts[xcb_parts_idx].iov_len = xcb_sumof(_aux->nLevelsPerType, nKTLevels) * sizeof(xcb_atom_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_INDICATOR_NAMES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* indicatorNames */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->indicatorNames; - xcb_block_len += xcb_popcount(indicators) * sizeof(xcb_atom_t); - xcb_parts[xcb_parts_idx].iov_len = xcb_popcount(indicators) * sizeof(xcb_atom_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_VIRTUAL_MOD_NAMES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* virtualModNames */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->virtualModNames; - xcb_block_len += xcb_popcount(virtualMods) * sizeof(xcb_atom_t); - xcb_parts[xcb_parts_idx].iov_len = xcb_popcount(virtualMods) * sizeof(xcb_atom_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_GROUP_NAMES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* groups */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->groups; - xcb_block_len += xcb_popcount(groupNames) * sizeof(xcb_atom_t); - xcb_parts[xcb_parts_idx].iov_len = xcb_popcount(groupNames) * sizeof(xcb_atom_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_KEY_NAMES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* keyNames */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->keyNames; - xcb_block_len += nKeys * sizeof(xcb_xkb_key_name_t); - xcb_parts[xcb_parts_idx].iov_len = nKeys * sizeof(xcb_xkb_key_name_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_xkb_key_name_t); - } - if(which & XCB_XKB_NAME_DETAIL_KEY_ALIASES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* keyAliases */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->keyAliases; - xcb_block_len += nKeyAliases * sizeof(xcb_xkb_key_alias_t); - xcb_parts[xcb_parts_idx].iov_len = nKeyAliases * sizeof(xcb_xkb_key_alias_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_xkb_key_alias_t); - } - if(which & XCB_XKB_NAME_DETAIL_RG_NAMES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* radioGroupNames */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->radioGroupNames; - xcb_block_len += nRadioGroups * sizeof(xcb_atom_t); - xcb_parts[xcb_parts_idx].iov_len = nRadioGroups * sizeof(xcb_atom_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - - if (NULL == xcb_out) { - /* allocate memory */ - xcb_out = malloc(xcb_buffer_len); - *_buffer = xcb_out; - } - - xcb_tmp = xcb_out; - for(i=0; i<xcb_parts_idx; i++) { - if (0 != xcb_parts[i].iov_base && 0 != xcb_parts[i].iov_len) - memcpy(xcb_tmp, xcb_parts[i].iov_base, xcb_parts[i].iov_len); - if (0 != xcb_parts[i].iov_len) - xcb_tmp += xcb_parts[i].iov_len; - } - - return xcb_buffer_len; -} - -int -xcb_xkb_get_kbd_by_name_replies_key_names_value_list_unpack (const void *_buffer /**< */, - uint8_t nTypes /**< */, - uint16_t nKTLevels /**< */, - uint32_t indicators /**< */, - uint16_t virtualMods /**< */, - uint8_t groupNames /**< */, - uint8_t nKeys /**< */, - uint8_t nKeyAliases /**< */, - uint8_t nRadioGroups /**< */, - uint32_t which /**< */, - xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t *_aux /**< */) -{ - char *xcb_tmp = (char *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to = 0; - - - if(which & XCB_XKB_NAME_DETAIL_KEYCODES) { - /* xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t.keycodesName */ - _aux->keycodesName = *(xcb_atom_t *)xcb_tmp; - xcb_block_len += sizeof(xcb_atom_t); - xcb_tmp += sizeof(xcb_atom_t); - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_GEOMETRY) { - /* xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t.geometryName */ - _aux->geometryName = *(xcb_atom_t *)xcb_tmp; - xcb_block_len += sizeof(xcb_atom_t); - xcb_tmp += sizeof(xcb_atom_t); - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_SYMBOLS) { - /* xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t.symbolsName */ - _aux->symbolsName = *(xcb_atom_t *)xcb_tmp; - xcb_block_len += sizeof(xcb_atom_t); - xcb_tmp += sizeof(xcb_atom_t); - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_PHYS_SYMBOLS) { - /* xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t.physSymbolsName */ - _aux->physSymbolsName = *(xcb_atom_t *)xcb_tmp; - xcb_block_len += sizeof(xcb_atom_t); - xcb_tmp += sizeof(xcb_atom_t); - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_TYPES) { - /* xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t.typesName */ - _aux->typesName = *(xcb_atom_t *)xcb_tmp; - xcb_block_len += sizeof(xcb_atom_t); - xcb_tmp += sizeof(xcb_atom_t); - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_COMPAT) { - /* xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t.compatName */ - _aux->compatName = *(xcb_atom_t *)xcb_tmp; - xcb_block_len += sizeof(xcb_atom_t); - xcb_tmp += sizeof(xcb_atom_t); - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_KEY_TYPE_NAMES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* typeNames */ - _aux->typeNames = (xcb_atom_t *)xcb_tmp; - xcb_block_len += nTypes * sizeof(xcb_atom_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_KT_LEVEL_NAMES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* nLevelsPerType */ - _aux->nLevelsPerType = (uint8_t *)xcb_tmp; - xcb_block_len += nKTLevels * sizeof(uint8_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(uint8_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* ktLevelNames */ - _aux->ktLevelNames = (xcb_atom_t *)xcb_tmp; - xcb_block_len += xcb_sumof(_aux->nLevelsPerType, nKTLevels) * sizeof(xcb_atom_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_INDICATOR_NAMES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* indicatorNames */ - _aux->indicatorNames = (xcb_atom_t *)xcb_tmp; - xcb_block_len += xcb_popcount(indicators) * sizeof(xcb_atom_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_VIRTUAL_MOD_NAMES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* virtualModNames */ - _aux->virtualModNames = (xcb_atom_t *)xcb_tmp; - xcb_block_len += xcb_popcount(virtualMods) * sizeof(xcb_atom_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_GROUP_NAMES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* groups */ - _aux->groups = (xcb_atom_t *)xcb_tmp; - xcb_block_len += xcb_popcount(groupNames) * sizeof(xcb_atom_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - if(which & XCB_XKB_NAME_DETAIL_KEY_NAMES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* keyNames */ - _aux->keyNames = (xcb_xkb_key_name_t *)xcb_tmp; - xcb_block_len += nKeys * sizeof(xcb_xkb_key_name_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_xkb_key_name_t); - } - if(which & XCB_XKB_NAME_DETAIL_KEY_ALIASES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* keyAliases */ - _aux->keyAliases = (xcb_xkb_key_alias_t *)xcb_tmp; - xcb_block_len += nKeyAliases * sizeof(xcb_xkb_key_alias_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_xkb_key_alias_t); - } - if(which & XCB_XKB_NAME_DETAIL_RG_NAMES) { - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* radioGroupNames */ - _aux->radioGroupNames = (xcb_atom_t *)xcb_tmp; - xcb_block_len += nRadioGroups * sizeof(xcb_atom_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_atom_t); - } - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - -int -xcb_xkb_get_kbd_by_name_replies_key_names_value_list_sizeof (const void *_buffer /**< */, - uint8_t nTypes /**< */, - uint16_t nKTLevels /**< */, - uint32_t indicators /**< */, - uint16_t virtualMods /**< */, - uint8_t groupNames /**< */, - uint8_t nKeys /**< */, - uint8_t nKeyAliases /**< */, - uint8_t nRadioGroups /**< */, - uint32_t which /**< */) -{ - xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t _aux; - return xcb_xkb_get_kbd_by_name_replies_key_names_value_list_unpack(_buffer, nTypes, nKTLevels, indicators, virtualMods, groupNames, nKeys, nKeyAliases, nRadioGroups, which, &_aux); -} - - -/***************************************************************************** - ** - ** xcb_xkb_get_kbd_by_name_replies_types_map_t * xcb_xkb_get_kbd_by_name_replies_types_map - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_t *R - ** @returns xcb_xkb_get_kbd_by_name_replies_types_map_t * - ** - *****************************************************************************/ - -xcb_xkb_get_kbd_by_name_replies_types_map_t * -xcb_xkb_get_kbd_by_name_replies_types_map (const xcb_xkb_get_kbd_by_name_replies_t *R /**< */) -{ - return (xcb_xkb_get_kbd_by_name_replies_types_map_t *) (R + 1); -} - - -/***************************************************************************** - ** - ** xcb_xkb_sym_interpret_t * xcb_xkb_get_kbd_by_name_replies_compat_map_si_rtrn - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_t *S - ** @returns xcb_xkb_sym_interpret_t * - ** - *****************************************************************************/ - -xcb_xkb_sym_interpret_t * -xcb_xkb_get_kbd_by_name_replies_compat_map_si_rtrn (const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - return /* replies */ S->compat_map.si_rtrn; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_kbd_by_name_replies_compat_map_si_rtrn_length - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_kbd_by_name_replies_compat_map_si_rtrn_length (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */, - const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - return /* replies */ S->compat_map.nSIRtrn; -} - - -/***************************************************************************** - ** - ** xcb_xkb_sym_interpret_iterator_t xcb_xkb_get_kbd_by_name_replies_compat_map_si_rtrn_iterator - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_t *R - ** @returns xcb_xkb_sym_interpret_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_sym_interpret_iterator_t -xcb_xkb_get_kbd_by_name_replies_compat_map_si_rtrn_iterator (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */, - const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - xcb_xkb_sym_interpret_iterator_t i; - i.data = /* replies */ S->compat_map.si_rtrn; - i.rem = /* replies */ S->compat_map.nSIRtrn; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** xcb_xkb_mod_def_t * xcb_xkb_get_kbd_by_name_replies_compat_map_group_rtrn - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_t *S - ** @returns xcb_xkb_mod_def_t * - ** - *****************************************************************************/ - -xcb_xkb_mod_def_t * -xcb_xkb_get_kbd_by_name_replies_compat_map_group_rtrn (const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - return /* replies */ S->compat_map.group_rtrn; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_kbd_by_name_replies_compat_map_group_rtrn_length - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_kbd_by_name_replies_compat_map_group_rtrn_length (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */, - const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - return xcb_popcount(/* replies */ S->compat_map.groupsRtrn); -} - - -/***************************************************************************** - ** - ** xcb_xkb_mod_def_iterator_t xcb_xkb_get_kbd_by_name_replies_compat_map_group_rtrn_iterator - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_t *R - ** @returns xcb_xkb_mod_def_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_mod_def_iterator_t -xcb_xkb_get_kbd_by_name_replies_compat_map_group_rtrn_iterator (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */, - const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - xcb_xkb_mod_def_iterator_t i; - i.data = /* replies */ S->compat_map.group_rtrn; - i.rem = xcb_popcount(/* replies */ S->compat_map.groupsRtrn); - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** xcb_xkb_indicator_map_t * xcb_xkb_get_kbd_by_name_replies_indicator_maps_maps - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_t *S - ** @returns xcb_xkb_indicator_map_t * - ** - *****************************************************************************/ - -xcb_xkb_indicator_map_t * -xcb_xkb_get_kbd_by_name_replies_indicator_maps_maps (const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - return /* replies */ S->indicator_maps.maps; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_kbd_by_name_replies_indicator_maps_maps_length - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_kbd_by_name_replies_indicator_maps_maps_length (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */, - const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - return /* replies */ S->indicator_maps.nIndicators; -} - - -/***************************************************************************** - ** - ** xcb_xkb_indicator_map_iterator_t xcb_xkb_get_kbd_by_name_replies_indicator_maps_maps_iterator - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_t *R - ** @returns xcb_xkb_indicator_map_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_indicator_map_iterator_t -xcb_xkb_get_kbd_by_name_replies_indicator_maps_maps_iterator (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */, - const xcb_xkb_get_kbd_by_name_replies_t *S /**< */) -{ - xcb_xkb_indicator_map_iterator_t i; - i.data = /* replies */ S->indicator_maps.maps; - i.rem = /* replies */ S->indicator_maps.nIndicators; - i.index = (char *) i.data - (char *) S; - return i; -} - - -/***************************************************************************** - ** - ** xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t * xcb_xkb_get_kbd_by_name_replies_key_names_value_list - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_t *R - ** @returns xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t * - ** - *****************************************************************************/ - -xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t * -xcb_xkb_get_kbd_by_name_replies_key_names_value_list (const xcb_xkb_get_kbd_by_name_replies_t *R /**< */) -{ - return (xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t *) (R + 1); -} - - -/***************************************************************************** - ** - ** xcb_xkb_counted_string_16_t * xcb_xkb_get_kbd_by_name_replies_geometry_label_font - ** - ** @param const xcb_xkb_get_kbd_by_name_replies_t *R - ** @returns xcb_xkb_counted_string_16_t * - ** - *****************************************************************************/ - -xcb_xkb_counted_string_16_t * -xcb_xkb_get_kbd_by_name_replies_geometry_label_font (const xcb_xkb_get_kbd_by_name_replies_t *R /**< */) -{ - return (xcb_xkb_counted_string_16_t *) (R + 1); -} - -int -xcb_xkb_get_kbd_by_name_replies_serialize (void **_buffer /**< */, - uint16_t reported /**< */, - const xcb_xkb_get_kbd_by_name_replies_t *_aux /**< */) -{ - char *xcb_out = *_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_align_to = 0; - - unsigned int xcb_pad = 0; - char xcb_pad0[3] = {0, 0, 0}; - struct iovec xcb_parts[96]; - unsigned int xcb_parts_idx = 0; - unsigned int xcb_block_len = 0; - unsigned int i; - char *xcb_tmp; - - if((reported & XCB_XKB_GBN_DETAIL_TYPES) || - (reported & XCB_XKB_GBN_DETAIL_CLIENT_SYMBOLS) || - (reported & XCB_XKB_GBN_DETAIL_SERVER_SYMBOLS)) { - /* xcb_xkb_get_kbd_by_name_replies_t.types.getmap_type */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.getmap_type; - xcb_block_len += sizeof(uint8_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.typeDeviceID */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.typeDeviceID; - xcb_block_len += sizeof(uint8_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.getmap_sequence */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.getmap_sequence; - xcb_block_len += sizeof(uint16_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.getmap_length */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.getmap_length; - xcb_block_len += sizeof(uint32_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint32_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.pad0 */ - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_block_len += sizeof(uint8_t)*2; - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t)*2; - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.typeMinKeyCode */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.typeMinKeyCode; - xcb_block_len += sizeof(xcb_keycode_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_keycode_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_keycode_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.typeMaxKeyCode */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.typeMaxKeyCode; - xcb_block_len += sizeof(xcb_keycode_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_keycode_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_keycode_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.present */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.present; - xcb_block_len += sizeof(uint16_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.firstType */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.firstType; - xcb_block_len += sizeof(uint8_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.nTypes */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.nTypes; - xcb_block_len += sizeof(uint8_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.totalTypes */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.totalTypes; - xcb_block_len += sizeof(uint8_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.firstKeySym */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.firstKeySym; - xcb_block_len += sizeof(xcb_keycode_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_keycode_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_keycode_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.totalSyms */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.totalSyms; - xcb_block_len += sizeof(uint16_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.nKeySyms */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.nKeySyms; - xcb_block_len += sizeof(uint8_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.firstKeyAction */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.firstKeyAction; - xcb_block_len += sizeof(xcb_keycode_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_keycode_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_keycode_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.totalActions */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.totalActions; - xcb_block_len += sizeof(uint16_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.nKeyActions */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.nKeyActions; - xcb_block_len += sizeof(uint8_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.firstKeyBehavior */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.firstKeyBehavior; - xcb_block_len += sizeof(xcb_keycode_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_keycode_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_keycode_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.nKeyBehaviors */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.nKeyBehaviors; - xcb_block_len += sizeof(uint8_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.totalKeyBehaviors */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.totalKeyBehaviors; - xcb_block_len += sizeof(uint8_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.firstKeyExplicit */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.firstKeyExplicit; - xcb_block_len += sizeof(xcb_keycode_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_keycode_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_keycode_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.nKeyExplicit */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.nKeyExplicit; - xcb_block_len += sizeof(uint8_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.totalKeyExplicit */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.totalKeyExplicit; - xcb_block_len += sizeof(uint8_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.firstModMapKey */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.firstModMapKey; - xcb_block_len += sizeof(xcb_keycode_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_keycode_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_keycode_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.nModMapKeys */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.nModMapKeys; - xcb_block_len += sizeof(uint8_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.totalModMapKeys */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.totalModMapKeys; - xcb_block_len += sizeof(uint8_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.firstVModMapKey */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.firstVModMapKey; - xcb_block_len += sizeof(xcb_keycode_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_keycode_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_keycode_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.nVModMapKeys */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.nVModMapKeys; - xcb_block_len += sizeof(uint8_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.totalVModMapKeys */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.totalVModMapKeys; - xcb_block_len += sizeof(uint8_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.pad1 */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &xcb_pad; - xcb_block_len += sizeof(uint8_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.virtualMods */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.virtualMods; - xcb_block_len += sizeof(uint16_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint16_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* map */ - xcb_parts[xcb_parts_idx].iov_base = (char *)0; - xcb_block_len += xcb_xkb_get_kbd_by_name_replies_types_map_serialize(&xcb_parts[xcb_parts_idx].iov_base, _aux->types.nTypes, _aux->types.nKeySyms, _aux->types.nKeyActions, _aux->types.totalActions, _aux->types.totalKeyBehaviors, _aux->types.virtualMods, _aux->types.totalKeyExplicit, _aux->types.totalModMapKeys, _aux->types.totalVModMapKeys, _aux->types.present, &_aux->types.map); - xcb_parts[xcb_parts_idx].iov_len = xcb_xkb_get_kbd_by_name_replies_types_map_serialize(&xcb_parts[xcb_parts_idx].iov_base, _aux->types.nTypes, _aux->types.nKeySyms, _aux->types.nKeyActions, _aux->types.totalActions, _aux->types.totalKeyBehaviors, _aux->types.virtualMods, _aux->types.totalKeyExplicit, _aux->types.totalModMapKeys, _aux->types.totalVModMapKeys, _aux->types.present, &_aux->types.map); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_xkb_get_kbd_by_name_replies_types_map_t); - } - if(reported & XCB_XKB_GBN_DETAIL_COMPAT_MAP) { - /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.compatmap_type */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->compat_map.compatmap_type; - xcb_block_len += sizeof(uint8_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.compatDeviceID */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->compat_map.compatDeviceID; - xcb_block_len += sizeof(uint8_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.compatmap_sequence */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->compat_map.compatmap_sequence; - xcb_block_len += sizeof(uint16_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.compatmap_length */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->compat_map.compatmap_length; - xcb_block_len += sizeof(uint32_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint32_t); - /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.groupsRtrn */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->compat_map.groupsRtrn; - xcb_block_len += sizeof(uint8_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.pad0 */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &xcb_pad; - xcb_block_len += sizeof(uint8_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.firstSIRtrn */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->compat_map.firstSIRtrn; - xcb_block_len += sizeof(uint16_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.nSIRtrn */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->compat_map.nSIRtrn; - xcb_block_len += sizeof(uint16_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.nTotalSI */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->compat_map.nTotalSI; - xcb_block_len += sizeof(uint16_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.pad1 */ - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_block_len += sizeof(uint8_t)*16; - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t)*16; - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* si_rtrn */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->compat_map.si_rtrn; - xcb_block_len += _aux->compat_map.nSIRtrn * sizeof(xcb_xkb_sym_interpret_t); - xcb_parts[xcb_parts_idx].iov_len = _aux->compat_map.nSIRtrn * sizeof(xcb_xkb_sym_interpret_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_xkb_sym_interpret_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* group_rtrn */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->compat_map.group_rtrn; - xcb_block_len += xcb_popcount(_aux->compat_map.groupsRtrn) * sizeof(xcb_xkb_mod_def_t); - xcb_parts[xcb_parts_idx].iov_len = xcb_popcount(_aux->compat_map.groupsRtrn) * sizeof(xcb_xkb_mod_def_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_xkb_mod_def_t); - } - if(reported & XCB_XKB_GBN_DETAIL_INDICATOR_MAPS) { - /* xcb_xkb_get_kbd_by_name_replies_t.indicator_maps.indicatormap_type */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->indicator_maps.indicatormap_type; - xcb_block_len += sizeof(uint8_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.indicator_maps.indicatorDeviceID */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->indicator_maps.indicatorDeviceID; - xcb_block_len += sizeof(uint8_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.indicator_maps.indicatormap_sequence */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->indicator_maps.indicatormap_sequence; - xcb_block_len += sizeof(uint16_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_get_kbd_by_name_replies_t.indicator_maps.indicatormap_length */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->indicator_maps.indicatormap_length; - xcb_block_len += sizeof(uint32_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint32_t); - /* xcb_xkb_get_kbd_by_name_replies_t.indicator_maps.which */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->indicator_maps.which; - xcb_block_len += sizeof(uint32_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint32_t); - /* xcb_xkb_get_kbd_by_name_replies_t.indicator_maps.realIndicators */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->indicator_maps.realIndicators; - xcb_block_len += sizeof(uint32_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint32_t); - /* xcb_xkb_get_kbd_by_name_replies_t.indicator_maps.nIndicators */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->indicator_maps.nIndicators; - xcb_block_len += sizeof(uint8_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.indicator_maps.pad0 */ - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_block_len += sizeof(uint8_t)*15; - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t)*15; - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* maps */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->indicator_maps.maps; - xcb_block_len += _aux->indicator_maps.nIndicators * sizeof(xcb_xkb_indicator_map_t); - xcb_parts[xcb_parts_idx].iov_len = _aux->indicator_maps.nIndicators * sizeof(xcb_xkb_indicator_map_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_xkb_indicator_map_t); - } - if((reported & XCB_XKB_GBN_DETAIL_KEY_NAMES) || - (reported & XCB_XKB_GBN_DETAIL_OTHER_NAMES)) { - /* xcb_xkb_get_kbd_by_name_replies_t.key_names.keyname_type */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->key_names.keyname_type; - xcb_block_len += sizeof(uint8_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.key_names.keyDeviceID */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->key_names.keyDeviceID; - xcb_block_len += sizeof(uint8_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.key_names.keyname_sequence */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->key_names.keyname_sequence; - xcb_block_len += sizeof(uint16_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_get_kbd_by_name_replies_t.key_names.keyname_length */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->key_names.keyname_length; - xcb_block_len += sizeof(uint32_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint32_t); - /* xcb_xkb_get_kbd_by_name_replies_t.key_names.which */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->key_names.which; - xcb_block_len += sizeof(uint32_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint32_t); - /* xcb_xkb_get_kbd_by_name_replies_t.key_names.keyMinKeyCode */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->key_names.keyMinKeyCode; - xcb_block_len += sizeof(xcb_keycode_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_keycode_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_keycode_t); - /* xcb_xkb_get_kbd_by_name_replies_t.key_names.keyMaxKeyCode */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->key_names.keyMaxKeyCode; - xcb_block_len += sizeof(xcb_keycode_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_keycode_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_keycode_t); - /* xcb_xkb_get_kbd_by_name_replies_t.key_names.nTypes */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->key_names.nTypes; - xcb_block_len += sizeof(uint8_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.key_names.groupNames */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->key_names.groupNames; - xcb_block_len += sizeof(uint8_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.key_names.virtualMods */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->key_names.virtualMods; - xcb_block_len += sizeof(uint16_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_get_kbd_by_name_replies_t.key_names.firstKey */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->key_names.firstKey; - xcb_block_len += sizeof(xcb_keycode_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_keycode_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_keycode_t); - /* xcb_xkb_get_kbd_by_name_replies_t.key_names.nKeys */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->key_names.nKeys; - xcb_block_len += sizeof(uint8_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.key_names.indicators */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->key_names.indicators; - xcb_block_len += sizeof(uint32_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint32_t); - /* xcb_xkb_get_kbd_by_name_replies_t.key_names.nRadioGroups */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->key_names.nRadioGroups; - xcb_block_len += sizeof(uint8_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.key_names.nKeyAliases */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->key_names.nKeyAliases; - xcb_block_len += sizeof(uint8_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.key_names.nKTLevels */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->key_names.nKTLevels; - xcb_block_len += sizeof(uint16_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_get_kbd_by_name_replies_t.key_names.pad0 */ - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_block_len += sizeof(uint8_t)*4; - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t)*4; - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* valueList */ - xcb_parts[xcb_parts_idx].iov_base = (char *)0; - xcb_block_len += xcb_xkb_get_kbd_by_name_replies_key_names_value_list_serialize(&xcb_parts[xcb_parts_idx].iov_base, _aux->key_names.nTypes, _aux->key_names.nKTLevels, _aux->key_names.indicators, _aux->key_names.virtualMods, _aux->key_names.groupNames, _aux->key_names.nKeys, _aux->key_names.nKeyAliases, _aux->key_names.nRadioGroups, _aux->key_names.which, &_aux->key_names.valueList); - xcb_parts[xcb_parts_idx].iov_len = xcb_xkb_get_kbd_by_name_replies_key_names_value_list_serialize(&xcb_parts[xcb_parts_idx].iov_base, _aux->key_names.nTypes, _aux->key_names.nKTLevels, _aux->key_names.indicators, _aux->key_names.virtualMods, _aux->key_names.groupNames, _aux->key_names.nKeys, _aux->key_names.nKeyAliases, _aux->key_names.nRadioGroups, _aux->key_names.which, &_aux->key_names.valueList); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t); - } - if(reported & XCB_XKB_GBN_DETAIL_GEOMETRY) { - /* xcb_xkb_get_kbd_by_name_replies_t.geometry.geometry_type */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometry.geometry_type; - xcb_block_len += sizeof(uint8_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.geometry.geometryDeviceID */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometry.geometryDeviceID; - xcb_block_len += sizeof(uint8_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.geometry.geometry_sequence */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometry.geometry_sequence; - xcb_block_len += sizeof(uint16_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_get_kbd_by_name_replies_t.geometry.geometry_length */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometry.geometry_length; - xcb_block_len += sizeof(uint32_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint32_t); - /* xcb_xkb_get_kbd_by_name_replies_t.geometry.name */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometry.name; - xcb_block_len += sizeof(xcb_atom_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_atom_t); - /* xcb_xkb_get_kbd_by_name_replies_t.geometry.geometryFound */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometry.geometryFound; - xcb_block_len += sizeof(uint8_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.geometry.pad0 */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &xcb_pad; - xcb_block_len += sizeof(uint8_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.geometry.widthMM */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometry.widthMM; - xcb_block_len += sizeof(uint16_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_get_kbd_by_name_replies_t.geometry.heightMM */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometry.heightMM; - xcb_block_len += sizeof(uint16_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_get_kbd_by_name_replies_t.geometry.nProperties */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometry.nProperties; - xcb_block_len += sizeof(uint16_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_get_kbd_by_name_replies_t.geometry.nColors */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometry.nColors; - xcb_block_len += sizeof(uint16_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_get_kbd_by_name_replies_t.geometry.nShapes */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometry.nShapes; - xcb_block_len += sizeof(uint16_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_get_kbd_by_name_replies_t.geometry.nSections */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometry.nSections; - xcb_block_len += sizeof(uint16_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_get_kbd_by_name_replies_t.geometry.nDoodads */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometry.nDoodads; - xcb_block_len += sizeof(uint16_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_get_kbd_by_name_replies_t.geometry.nKeyAliases */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometry.nKeyAliases; - xcb_block_len += sizeof(uint16_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_get_kbd_by_name_replies_t.geometry.baseColorNdx */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometry.baseColorNdx; - xcb_block_len += sizeof(uint8_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.geometry.labelColorNdx */ - xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometry.labelColorNdx; - xcb_block_len += sizeof(uint8_t); - xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(uint8_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - /* labelFont */ - xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->geometry.labelFont; - xcb_block_len += xcb_xkb_counted_string_16_sizeof(_aux->geometry.labelFont); - xcb_parts[xcb_parts_idx].iov_len = xcb_xkb_counted_string_16_sizeof(_aux->geometry.labelFont); - xcb_parts_idx++; - xcb_align_to = ALIGNOF(xcb_xkb_counted_string_16_t); - } - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; - xcb_parts[xcb_parts_idx].iov_len = xcb_pad; - xcb_parts_idx++; - xcb_pad = 0; - } - xcb_block_len = 0; - - if (NULL == xcb_out) { - /* allocate memory */ - xcb_out = malloc(xcb_buffer_len); - *_buffer = xcb_out; - } - - xcb_tmp = xcb_out; - for(i=0; i<xcb_parts_idx; i++) { - if (0 != xcb_parts[i].iov_base && 0 != xcb_parts[i].iov_len) - memcpy(xcb_tmp, xcb_parts[i].iov_base, xcb_parts[i].iov_len); - if (0 != xcb_parts[i].iov_len) - xcb_tmp += xcb_parts[i].iov_len; - } - - return xcb_buffer_len; -} - -int -xcb_xkb_get_kbd_by_name_replies_unpack (const void *_buffer /**< */, - uint16_t reported /**< */, - xcb_xkb_get_kbd_by_name_replies_t *_aux /**< */) -{ - char *xcb_tmp = (char *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to = 0; - - - if((reported & XCB_XKB_GBN_DETAIL_TYPES) || - (reported & XCB_XKB_GBN_DETAIL_CLIENT_SYMBOLS) || - (reported & XCB_XKB_GBN_DETAIL_SERVER_SYMBOLS)) { - /* xcb_xkb_get_kbd_by_name_replies_t.types.getmap_type */ - _aux->types.getmap_type = *(uint8_t *)xcb_tmp; - xcb_block_len += sizeof(uint8_t); - xcb_tmp += sizeof(uint8_t); - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.typeDeviceID */ - _aux->types.typeDeviceID = *(uint8_t *)xcb_tmp; - xcb_block_len += sizeof(uint8_t); - xcb_tmp += sizeof(uint8_t); - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.getmap_sequence */ - _aux->types.getmap_sequence = *(uint16_t *)xcb_tmp; - xcb_block_len += sizeof(uint16_t); - xcb_tmp += sizeof(uint16_t); - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.getmap_length */ - _aux->types.getmap_length = *(uint32_t *)xcb_tmp; - xcb_block_len += sizeof(uint32_t); - xcb_tmp += sizeof(uint32_t); - xcb_align_to = ALIGNOF(uint32_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.pad0 */ - _aux->types.pad0[0] = *(uint8_t *)xcb_tmp; - _aux->types.pad0[1] = *(uint8_t *)xcb_tmp; - xcb_block_len += sizeof(uint8_t) * 2; - xcb_tmp += sizeof(uint8_t) * 2; - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.typeMinKeyCode */ - _aux->types.typeMinKeyCode = *(xcb_keycode_t *)xcb_tmp; - xcb_block_len += sizeof(xcb_keycode_t); - xcb_tmp += sizeof(xcb_keycode_t); - xcb_align_to = ALIGNOF(xcb_keycode_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.typeMaxKeyCode */ - _aux->types.typeMaxKeyCode = *(xcb_keycode_t *)xcb_tmp; - xcb_block_len += sizeof(xcb_keycode_t); - xcb_tmp += sizeof(xcb_keycode_t); - xcb_align_to = ALIGNOF(xcb_keycode_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.present */ - _aux->types.present = *(uint16_t *)xcb_tmp; - xcb_block_len += sizeof(uint16_t); - xcb_tmp += sizeof(uint16_t); - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.firstType */ - _aux->types.firstType = *(uint8_t *)xcb_tmp; - xcb_block_len += sizeof(uint8_t); - xcb_tmp += sizeof(uint8_t); - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.nTypes */ - _aux->types.nTypes = *(uint8_t *)xcb_tmp; - xcb_block_len += sizeof(uint8_t); - xcb_tmp += sizeof(uint8_t); - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.totalTypes */ - _aux->types.totalTypes = *(uint8_t *)xcb_tmp; - xcb_block_len += sizeof(uint8_t); - xcb_tmp += sizeof(uint8_t); - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.firstKeySym */ - _aux->types.firstKeySym = *(xcb_keycode_t *)xcb_tmp; - xcb_block_len += sizeof(xcb_keycode_t); - xcb_tmp += sizeof(xcb_keycode_t); - xcb_align_to = ALIGNOF(xcb_keycode_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.totalSyms */ - _aux->types.totalSyms = *(uint16_t *)xcb_tmp; - xcb_block_len += sizeof(uint16_t); - xcb_tmp += sizeof(uint16_t); - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.nKeySyms */ - _aux->types.nKeySyms = *(uint8_t *)xcb_tmp; - xcb_block_len += sizeof(uint8_t); - xcb_tmp += sizeof(uint8_t); - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.firstKeyAction */ - _aux->types.firstKeyAction = *(xcb_keycode_t *)xcb_tmp; - xcb_block_len += sizeof(xcb_keycode_t); - xcb_tmp += sizeof(xcb_keycode_t); - xcb_align_to = ALIGNOF(xcb_keycode_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.totalActions */ - _aux->types.totalActions = *(uint16_t *)xcb_tmp; - xcb_block_len += sizeof(uint16_t); - xcb_tmp += sizeof(uint16_t); - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.nKeyActions */ - _aux->types.nKeyActions = *(uint8_t *)xcb_tmp; - xcb_block_len += sizeof(uint8_t); - xcb_tmp += sizeof(uint8_t); - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.firstKeyBehavior */ - _aux->types.firstKeyBehavior = *(xcb_keycode_t *)xcb_tmp; - xcb_block_len += sizeof(xcb_keycode_t); - xcb_tmp += sizeof(xcb_keycode_t); - xcb_align_to = ALIGNOF(xcb_keycode_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.nKeyBehaviors */ - _aux->types.nKeyBehaviors = *(uint8_t *)xcb_tmp; - xcb_block_len += sizeof(uint8_t); - xcb_tmp += sizeof(uint8_t); - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.totalKeyBehaviors */ - _aux->types.totalKeyBehaviors = *(uint8_t *)xcb_tmp; - xcb_block_len += sizeof(uint8_t); - xcb_tmp += sizeof(uint8_t); - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.firstKeyExplicit */ - _aux->types.firstKeyExplicit = *(xcb_keycode_t *)xcb_tmp; - xcb_block_len += sizeof(xcb_keycode_t); - xcb_tmp += sizeof(xcb_keycode_t); - xcb_align_to = ALIGNOF(xcb_keycode_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.nKeyExplicit */ - _aux->types.nKeyExplicit = *(uint8_t *)xcb_tmp; - xcb_block_len += sizeof(uint8_t); - xcb_tmp += sizeof(uint8_t); - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.totalKeyExplicit */ - _aux->types.totalKeyExplicit = *(uint8_t *)xcb_tmp; - xcb_block_len += sizeof(uint8_t); - xcb_tmp += sizeof(uint8_t); - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.firstModMapKey */ - _aux->types.firstModMapKey = *(xcb_keycode_t *)xcb_tmp; - xcb_block_len += sizeof(xcb_keycode_t); - xcb_tmp += sizeof(xcb_keycode_t); - xcb_align_to = ALIGNOF(xcb_keycode_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.nModMapKeys */ - _aux->types.nModMapKeys = *(uint8_t *)xcb_tmp; - xcb_block_len += sizeof(uint8_t); - xcb_tmp += sizeof(uint8_t); - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.totalModMapKeys */ - _aux->types.totalModMapKeys = *(uint8_t *)xcb_tmp; - xcb_block_len += sizeof(uint8_t); - xcb_tmp += sizeof(uint8_t); - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.firstVModMapKey */ - _aux->types.firstVModMapKey = *(xcb_keycode_t *)xcb_tmp; - xcb_block_len += sizeof(xcb_keycode_t); - xcb_tmp += sizeof(xcb_keycode_t); - xcb_align_to = ALIGNOF(xcb_keycode_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.nVModMapKeys */ - _aux->types.nVModMapKeys = *(uint8_t *)xcb_tmp; - xcb_block_len += sizeof(uint8_t); - xcb_tmp += sizeof(uint8_t); - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.totalVModMapKeys */ - _aux->types.totalVModMapKeys = *(uint8_t *)xcb_tmp; - xcb_block_len += sizeof(uint8_t); - xcb_tmp += sizeof(uint8_t); - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.pad1 */ - _aux->types.pad1 = *(uint8_t *)xcb_tmp; - xcb_block_len += sizeof(uint8_t); - xcb_tmp += sizeof(uint8_t); - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.types.virtualMods */ - _aux->types.virtualMods = *(uint16_t *)xcb_tmp; - xcb_block_len += sizeof(uint16_t); - xcb_tmp += sizeof(uint16_t); - xcb_align_to = ALIGNOF(uint16_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* map */ - xcb_block_len += xcb_xkb_get_kbd_by_name_replies_types_map_unpack(xcb_tmp, _aux->types.nTypes, _aux->types.nKeySyms, _aux->types.nKeyActions, _aux->types.totalActions, _aux->types.totalKeyBehaviors, _aux->types.virtualMods, _aux->types.totalKeyExplicit, _aux->types.totalModMapKeys, _aux->types.totalVModMapKeys, _aux->types.present, &_aux->types.map); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_xkb_get_kbd_by_name_replies_types_map_t); - } - if(reported & XCB_XKB_GBN_DETAIL_COMPAT_MAP) { - /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.compatmap_type */ - _aux->compat_map.compatmap_type = *(uint8_t *)xcb_tmp; - xcb_block_len += sizeof(uint8_t); - xcb_tmp += sizeof(uint8_t); - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.compatDeviceID */ - _aux->compat_map.compatDeviceID = *(uint8_t *)xcb_tmp; - xcb_block_len += sizeof(uint8_t); - xcb_tmp += sizeof(uint8_t); - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.compatmap_sequence */ - _aux->compat_map.compatmap_sequence = *(uint16_t *)xcb_tmp; - xcb_block_len += sizeof(uint16_t); - xcb_tmp += sizeof(uint16_t); - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.compatmap_length */ - _aux->compat_map.compatmap_length = *(uint32_t *)xcb_tmp; - xcb_block_len += sizeof(uint32_t); - xcb_tmp += sizeof(uint32_t); - xcb_align_to = ALIGNOF(uint32_t); - /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.groupsRtrn */ - _aux->compat_map.groupsRtrn = *(uint8_t *)xcb_tmp; - xcb_block_len += sizeof(uint8_t); - xcb_tmp += sizeof(uint8_t); - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.pad0 */ - _aux->compat_map.pad0 = *(uint8_t *)xcb_tmp; - xcb_block_len += sizeof(uint8_t); - xcb_tmp += sizeof(uint8_t); - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.firstSIRtrn */ - _aux->compat_map.firstSIRtrn = *(uint16_t *)xcb_tmp; - xcb_block_len += sizeof(uint16_t); - xcb_tmp += sizeof(uint16_t); - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.nSIRtrn */ - _aux->compat_map.nSIRtrn = *(uint16_t *)xcb_tmp; - xcb_block_len += sizeof(uint16_t); - xcb_tmp += sizeof(uint16_t); - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.nTotalSI */ - _aux->compat_map.nTotalSI = *(uint16_t *)xcb_tmp; - xcb_block_len += sizeof(uint16_t); - xcb_tmp += sizeof(uint16_t); - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.pad1 */ - _aux->compat_map.pad1[0] = *(uint8_t *)xcb_tmp; - _aux->compat_map.pad1[1] = *(uint8_t *)xcb_tmp; - _aux->compat_map.pad1[2] = *(uint8_t *)xcb_tmp; - _aux->compat_map.pad1[3] = *(uint8_t *)xcb_tmp; - _aux->compat_map.pad1[4] = *(uint8_t *)xcb_tmp; - _aux->compat_map.pad1[5] = *(uint8_t *)xcb_tmp; - _aux->compat_map.pad1[6] = *(uint8_t *)xcb_tmp; - _aux->compat_map.pad1[7] = *(uint8_t *)xcb_tmp; - _aux->compat_map.pad1[8] = *(uint8_t *)xcb_tmp; - _aux->compat_map.pad1[9] = *(uint8_t *)xcb_tmp; - _aux->compat_map.pad1[10] = *(uint8_t *)xcb_tmp; - _aux->compat_map.pad1[11] = *(uint8_t *)xcb_tmp; - _aux->compat_map.pad1[12] = *(uint8_t *)xcb_tmp; - _aux->compat_map.pad1[13] = *(uint8_t *)xcb_tmp; - _aux->compat_map.pad1[14] = *(uint8_t *)xcb_tmp; - _aux->compat_map.pad1[15] = *(uint8_t *)xcb_tmp; - xcb_block_len += sizeof(uint8_t) * 16; - xcb_tmp += sizeof(uint8_t) * 16; - xcb_align_to = ALIGNOF(uint8_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* si_rtrn */ - _aux->compat_map.si_rtrn = (xcb_xkb_sym_interpret_t *)xcb_tmp; - xcb_block_len += _aux->compat_map.nSIRtrn * sizeof(xcb_xkb_sym_interpret_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_xkb_sym_interpret_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* group_rtrn */ - _aux->compat_map.group_rtrn = (xcb_xkb_mod_def_t *)xcb_tmp; - xcb_block_len += xcb_popcount(_aux->compat_map.groupsRtrn) * sizeof(xcb_xkb_mod_def_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_xkb_mod_def_t); - } - if(reported & XCB_XKB_GBN_DETAIL_INDICATOR_MAPS) { - /* xcb_xkb_get_kbd_by_name_replies_t.indicator_maps.indicatormap_type */ - _aux->indicator_maps.indicatormap_type = *(uint8_t *)xcb_tmp; - xcb_block_len += sizeof(uint8_t); - xcb_tmp += sizeof(uint8_t); - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.indicator_maps.indicatorDeviceID */ - _aux->indicator_maps.indicatorDeviceID = *(uint8_t *)xcb_tmp; - xcb_block_len += sizeof(uint8_t); - xcb_tmp += sizeof(uint8_t); - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.indicator_maps.indicatormap_sequence */ - _aux->indicator_maps.indicatormap_sequence = *(uint16_t *)xcb_tmp; - xcb_block_len += sizeof(uint16_t); - xcb_tmp += sizeof(uint16_t); - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_get_kbd_by_name_replies_t.indicator_maps.indicatormap_length */ - _aux->indicator_maps.indicatormap_length = *(uint32_t *)xcb_tmp; - xcb_block_len += sizeof(uint32_t); - xcb_tmp += sizeof(uint32_t); - xcb_align_to = ALIGNOF(uint32_t); - /* xcb_xkb_get_kbd_by_name_replies_t.indicator_maps.which */ - _aux->indicator_maps.which = *(uint32_t *)xcb_tmp; - xcb_block_len += sizeof(uint32_t); - xcb_tmp += sizeof(uint32_t); - xcb_align_to = ALIGNOF(uint32_t); - /* xcb_xkb_get_kbd_by_name_replies_t.indicator_maps.realIndicators */ - _aux->indicator_maps.realIndicators = *(uint32_t *)xcb_tmp; - xcb_block_len += sizeof(uint32_t); - xcb_tmp += sizeof(uint32_t); - xcb_align_to = ALIGNOF(uint32_t); - /* xcb_xkb_get_kbd_by_name_replies_t.indicator_maps.nIndicators */ - _aux->indicator_maps.nIndicators = *(uint8_t *)xcb_tmp; - xcb_block_len += sizeof(uint8_t); - xcb_tmp += sizeof(uint8_t); - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.indicator_maps.pad0 */ - _aux->indicator_maps.pad0[0] = *(uint8_t *)xcb_tmp; - _aux->indicator_maps.pad0[1] = *(uint8_t *)xcb_tmp; - _aux->indicator_maps.pad0[2] = *(uint8_t *)xcb_tmp; - _aux->indicator_maps.pad0[3] = *(uint8_t *)xcb_tmp; - _aux->indicator_maps.pad0[4] = *(uint8_t *)xcb_tmp; - _aux->indicator_maps.pad0[5] = *(uint8_t *)xcb_tmp; - _aux->indicator_maps.pad0[6] = *(uint8_t *)xcb_tmp; - _aux->indicator_maps.pad0[7] = *(uint8_t *)xcb_tmp; - _aux->indicator_maps.pad0[8] = *(uint8_t *)xcb_tmp; - _aux->indicator_maps.pad0[9] = *(uint8_t *)xcb_tmp; - _aux->indicator_maps.pad0[10] = *(uint8_t *)xcb_tmp; - _aux->indicator_maps.pad0[11] = *(uint8_t *)xcb_tmp; - _aux->indicator_maps.pad0[12] = *(uint8_t *)xcb_tmp; - _aux->indicator_maps.pad0[13] = *(uint8_t *)xcb_tmp; - _aux->indicator_maps.pad0[14] = *(uint8_t *)xcb_tmp; - xcb_block_len += sizeof(uint8_t) * 15; - xcb_tmp += sizeof(uint8_t) * 15; - xcb_align_to = ALIGNOF(uint8_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* maps */ - _aux->indicator_maps.maps = (xcb_xkb_indicator_map_t *)xcb_tmp; - xcb_block_len += _aux->indicator_maps.nIndicators * sizeof(xcb_xkb_indicator_map_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_xkb_indicator_map_t); - } - if((reported & XCB_XKB_GBN_DETAIL_KEY_NAMES) || - (reported & XCB_XKB_GBN_DETAIL_OTHER_NAMES)) { - /* xcb_xkb_get_kbd_by_name_replies_t.key_names.keyname_type */ - _aux->key_names.keyname_type = *(uint8_t *)xcb_tmp; - xcb_block_len += sizeof(uint8_t); - xcb_tmp += sizeof(uint8_t); - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.key_names.keyDeviceID */ - _aux->key_names.keyDeviceID = *(uint8_t *)xcb_tmp; - xcb_block_len += sizeof(uint8_t); - xcb_tmp += sizeof(uint8_t); - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.key_names.keyname_sequence */ - _aux->key_names.keyname_sequence = *(uint16_t *)xcb_tmp; - xcb_block_len += sizeof(uint16_t); - xcb_tmp += sizeof(uint16_t); - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_get_kbd_by_name_replies_t.key_names.keyname_length */ - _aux->key_names.keyname_length = *(uint32_t *)xcb_tmp; - xcb_block_len += sizeof(uint32_t); - xcb_tmp += sizeof(uint32_t); - xcb_align_to = ALIGNOF(uint32_t); - /* xcb_xkb_get_kbd_by_name_replies_t.key_names.which */ - _aux->key_names.which = *(uint32_t *)xcb_tmp; - xcb_block_len += sizeof(uint32_t); - xcb_tmp += sizeof(uint32_t); - xcb_align_to = ALIGNOF(uint32_t); - /* xcb_xkb_get_kbd_by_name_replies_t.key_names.keyMinKeyCode */ - _aux->key_names.keyMinKeyCode = *(xcb_keycode_t *)xcb_tmp; - xcb_block_len += sizeof(xcb_keycode_t); - xcb_tmp += sizeof(xcb_keycode_t); - xcb_align_to = ALIGNOF(xcb_keycode_t); - /* xcb_xkb_get_kbd_by_name_replies_t.key_names.keyMaxKeyCode */ - _aux->key_names.keyMaxKeyCode = *(xcb_keycode_t *)xcb_tmp; - xcb_block_len += sizeof(xcb_keycode_t); - xcb_tmp += sizeof(xcb_keycode_t); - xcb_align_to = ALIGNOF(xcb_keycode_t); - /* xcb_xkb_get_kbd_by_name_replies_t.key_names.nTypes */ - _aux->key_names.nTypes = *(uint8_t *)xcb_tmp; - xcb_block_len += sizeof(uint8_t); - xcb_tmp += sizeof(uint8_t); - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.key_names.groupNames */ - _aux->key_names.groupNames = *(uint8_t *)xcb_tmp; - xcb_block_len += sizeof(uint8_t); - xcb_tmp += sizeof(uint8_t); - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.key_names.virtualMods */ - _aux->key_names.virtualMods = *(uint16_t *)xcb_tmp; - xcb_block_len += sizeof(uint16_t); - xcb_tmp += sizeof(uint16_t); - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_get_kbd_by_name_replies_t.key_names.firstKey */ - _aux->key_names.firstKey = *(xcb_keycode_t *)xcb_tmp; - xcb_block_len += sizeof(xcb_keycode_t); - xcb_tmp += sizeof(xcb_keycode_t); - xcb_align_to = ALIGNOF(xcb_keycode_t); - /* xcb_xkb_get_kbd_by_name_replies_t.key_names.nKeys */ - _aux->key_names.nKeys = *(uint8_t *)xcb_tmp; - xcb_block_len += sizeof(uint8_t); - xcb_tmp += sizeof(uint8_t); - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.key_names.indicators */ - _aux->key_names.indicators = *(uint32_t *)xcb_tmp; - xcb_block_len += sizeof(uint32_t); - xcb_tmp += sizeof(uint32_t); - xcb_align_to = ALIGNOF(uint32_t); - /* xcb_xkb_get_kbd_by_name_replies_t.key_names.nRadioGroups */ - _aux->key_names.nRadioGroups = *(uint8_t *)xcb_tmp; - xcb_block_len += sizeof(uint8_t); - xcb_tmp += sizeof(uint8_t); - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.key_names.nKeyAliases */ - _aux->key_names.nKeyAliases = *(uint8_t *)xcb_tmp; - xcb_block_len += sizeof(uint8_t); - xcb_tmp += sizeof(uint8_t); - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.key_names.nKTLevels */ - _aux->key_names.nKTLevels = *(uint16_t *)xcb_tmp; - xcb_block_len += sizeof(uint16_t); - xcb_tmp += sizeof(uint16_t); - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_get_kbd_by_name_replies_t.key_names.pad0 */ - _aux->key_names.pad0[0] = *(uint8_t *)xcb_tmp; - _aux->key_names.pad0[1] = *(uint8_t *)xcb_tmp; - _aux->key_names.pad0[2] = *(uint8_t *)xcb_tmp; - _aux->key_names.pad0[3] = *(uint8_t *)xcb_tmp; - xcb_block_len += sizeof(uint8_t) * 4; - xcb_tmp += sizeof(uint8_t) * 4; - xcb_align_to = ALIGNOF(uint8_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* valueList */ - xcb_block_len += xcb_xkb_get_kbd_by_name_replies_key_names_value_list_unpack(xcb_tmp, _aux->key_names.nTypes, _aux->key_names.nKTLevels, _aux->key_names.indicators, _aux->key_names.virtualMods, _aux->key_names.groupNames, _aux->key_names.nKeys, _aux->key_names.nKeyAliases, _aux->key_names.nRadioGroups, _aux->key_names.which, &_aux->key_names.valueList); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t); - } - if(reported & XCB_XKB_GBN_DETAIL_GEOMETRY) { - /* xcb_xkb_get_kbd_by_name_replies_t.geometry.geometry_type */ - _aux->geometry.geometry_type = *(uint8_t *)xcb_tmp; - xcb_block_len += sizeof(uint8_t); - xcb_tmp += sizeof(uint8_t); - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.geometry.geometryDeviceID */ - _aux->geometry.geometryDeviceID = *(uint8_t *)xcb_tmp; - xcb_block_len += sizeof(uint8_t); - xcb_tmp += sizeof(uint8_t); - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.geometry.geometry_sequence */ - _aux->geometry.geometry_sequence = *(uint16_t *)xcb_tmp; - xcb_block_len += sizeof(uint16_t); - xcb_tmp += sizeof(uint16_t); - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_get_kbd_by_name_replies_t.geometry.geometry_length */ - _aux->geometry.geometry_length = *(uint32_t *)xcb_tmp; - xcb_block_len += sizeof(uint32_t); - xcb_tmp += sizeof(uint32_t); - xcb_align_to = ALIGNOF(uint32_t); - /* xcb_xkb_get_kbd_by_name_replies_t.geometry.name */ - _aux->geometry.name = *(xcb_atom_t *)xcb_tmp; - xcb_block_len += sizeof(xcb_atom_t); - xcb_tmp += sizeof(xcb_atom_t); - xcb_align_to = ALIGNOF(xcb_atom_t); - /* xcb_xkb_get_kbd_by_name_replies_t.geometry.geometryFound */ - _aux->geometry.geometryFound = *(uint8_t *)xcb_tmp; - xcb_block_len += sizeof(uint8_t); - xcb_tmp += sizeof(uint8_t); - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.geometry.pad0 */ - _aux->geometry.pad0 = *(uint8_t *)xcb_tmp; - xcb_block_len += sizeof(uint8_t); - xcb_tmp += sizeof(uint8_t); - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.geometry.widthMM */ - _aux->geometry.widthMM = *(uint16_t *)xcb_tmp; - xcb_block_len += sizeof(uint16_t); - xcb_tmp += sizeof(uint16_t); - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_get_kbd_by_name_replies_t.geometry.heightMM */ - _aux->geometry.heightMM = *(uint16_t *)xcb_tmp; - xcb_block_len += sizeof(uint16_t); - xcb_tmp += sizeof(uint16_t); - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_get_kbd_by_name_replies_t.geometry.nProperties */ - _aux->geometry.nProperties = *(uint16_t *)xcb_tmp; - xcb_block_len += sizeof(uint16_t); - xcb_tmp += sizeof(uint16_t); - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_get_kbd_by_name_replies_t.geometry.nColors */ - _aux->geometry.nColors = *(uint16_t *)xcb_tmp; - xcb_block_len += sizeof(uint16_t); - xcb_tmp += sizeof(uint16_t); - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_get_kbd_by_name_replies_t.geometry.nShapes */ - _aux->geometry.nShapes = *(uint16_t *)xcb_tmp; - xcb_block_len += sizeof(uint16_t); - xcb_tmp += sizeof(uint16_t); - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_get_kbd_by_name_replies_t.geometry.nSections */ - _aux->geometry.nSections = *(uint16_t *)xcb_tmp; - xcb_block_len += sizeof(uint16_t); - xcb_tmp += sizeof(uint16_t); - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_get_kbd_by_name_replies_t.geometry.nDoodads */ - _aux->geometry.nDoodads = *(uint16_t *)xcb_tmp; - xcb_block_len += sizeof(uint16_t); - xcb_tmp += sizeof(uint16_t); - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_get_kbd_by_name_replies_t.geometry.nKeyAliases */ - _aux->geometry.nKeyAliases = *(uint16_t *)xcb_tmp; - xcb_block_len += sizeof(uint16_t); - xcb_tmp += sizeof(uint16_t); - xcb_align_to = ALIGNOF(uint16_t); - /* xcb_xkb_get_kbd_by_name_replies_t.geometry.baseColorNdx */ - _aux->geometry.baseColorNdx = *(uint8_t *)xcb_tmp; - xcb_block_len += sizeof(uint8_t); - xcb_tmp += sizeof(uint8_t); - xcb_align_to = ALIGNOF(uint8_t); - /* xcb_xkb_get_kbd_by_name_replies_t.geometry.labelColorNdx */ - _aux->geometry.labelColorNdx = *(uint8_t *)xcb_tmp; - xcb_block_len += sizeof(uint8_t); - xcb_tmp += sizeof(uint8_t); - xcb_align_to = ALIGNOF(uint8_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* labelFont */ - _aux->geometry.labelFont = (xcb_xkb_counted_string_16_t *)xcb_tmp; - xcb_block_len += xcb_xkb_counted_string_16_sizeof(xcb_tmp); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_xkb_counted_string_16_t); - } - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - -int -xcb_xkb_get_kbd_by_name_replies_sizeof (const void *_buffer /**< */, - uint16_t reported /**< */) -{ - xcb_xkb_get_kbd_by_name_replies_t _aux; - return xcb_xkb_get_kbd_by_name_replies_unpack(_buffer, reported, &_aux); -} - - -/***************************************************************************** - ** - ** xcb_xkb_get_kbd_by_name_cookie_t xcb_xkb_get_kbd_by_name - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @param uint16_t need - ** @param uint16_t want - ** @param uint8_t load - ** @returns xcb_xkb_get_kbd_by_name_cookie_t - ** - *****************************************************************************/ - -xcb_xkb_get_kbd_by_name_cookie_t -xcb_xkb_get_kbd_by_name (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */, - uint16_t need /**< */, - uint16_t want /**< */, - uint8_t load /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_GET_KBD_BY_NAME, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_xkb_get_kbd_by_name_cookie_t xcb_ret; - xcb_xkb_get_kbd_by_name_request_t xcb_out; - - xcb_out.deviceSpec = deviceSpec; - xcb_out.need = need; - xcb_out.want = want; - xcb_out.load = load; - xcb_out.pad0 = 0; - - 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_xkb_get_kbd_by_name_cookie_t xcb_xkb_get_kbd_by_name_unchecked - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @param uint16_t need - ** @param uint16_t want - ** @param uint8_t load - ** @returns xcb_xkb_get_kbd_by_name_cookie_t - ** - *****************************************************************************/ - -xcb_xkb_get_kbd_by_name_cookie_t -xcb_xkb_get_kbd_by_name_unchecked (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */, - uint16_t need /**< */, - uint16_t want /**< */, - uint8_t load /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_GET_KBD_BY_NAME, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_xkb_get_kbd_by_name_cookie_t xcb_ret; - xcb_xkb_get_kbd_by_name_request_t xcb_out; - - xcb_out.deviceSpec = deviceSpec; - xcb_out.need = need; - xcb_out.want = want; - xcb_out.load = load; - xcb_out.pad0 = 0; - - 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_xkb_get_kbd_by_name_replies_t * xcb_xkb_get_kbd_by_name_replies - ** - ** @param const xcb_xkb_get_kbd_by_name_reply_t *R - ** @returns xcb_xkb_get_kbd_by_name_replies_t * - ** - *****************************************************************************/ - -void * -xcb_xkb_get_kbd_by_name_replies (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */) -{ - return (void *) (R + 1); -} - - -/***************************************************************************** - ** - ** xcb_xkb_get_kbd_by_name_reply_t * xcb_xkb_get_kbd_by_name_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_get_kbd_by_name_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_xkb_get_kbd_by_name_reply_t * - ** - *****************************************************************************/ - -xcb_xkb_get_kbd_by_name_reply_t * -xcb_xkb_get_kbd_by_name_reply (xcb_connection_t *c /**< */, - xcb_xkb_get_kbd_by_name_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_xkb_get_kbd_by_name_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - -int -xcb_xkb_get_device_info_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_xkb_get_device_info_reply_t *_aux = (xcb_xkb_get_device_info_reply_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to = 0; - - unsigned int i; - unsigned int xcb_tmp_len; - - xcb_block_len += sizeof(xcb_xkb_get_device_info_reply_t); - xcb_tmp += xcb_block_len; - xcb_buffer_len += xcb_block_len; - xcb_block_len = 0; - /* name */ - xcb_block_len += _aux->nameLen * sizeof(xcb_xkb_string8_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_xkb_string8_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* btnActions */ - xcb_block_len += _aux->nBtnsRtrn * sizeof(xcb_xkb_action_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_xkb_action_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* leds */ - for(i=0; i<_aux->nDeviceLedFBs; i++) { - xcb_tmp_len = xcb_xkb_device_led_info_sizeof(xcb_tmp); - xcb_block_len += xcb_tmp_len; - xcb_tmp += xcb_tmp_len; - } - xcb_align_to = ALIGNOF(xcb_xkb_device_led_info_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_xkb_get_device_info_cookie_t xcb_xkb_get_device_info - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @param uint16_t wanted - ** @param uint8_t allButtons - ** @param uint8_t firstButton - ** @param uint8_t nButtons - ** @param xcb_xkb_led_class_spec_t ledClass - ** @param xcb_xkb_id_spec_t ledID - ** @returns xcb_xkb_get_device_info_cookie_t - ** - *****************************************************************************/ - -xcb_xkb_get_device_info_cookie_t -xcb_xkb_get_device_info (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */, - uint16_t wanted /**< */, - uint8_t allButtons /**< */, - uint8_t firstButton /**< */, - uint8_t nButtons /**< */, - xcb_xkb_led_class_spec_t ledClass /**< */, - xcb_xkb_id_spec_t ledID /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_GET_DEVICE_INFO, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_xkb_get_device_info_cookie_t xcb_ret; - xcb_xkb_get_device_info_request_t xcb_out; - - xcb_out.deviceSpec = deviceSpec; - xcb_out.wanted = wanted; - xcb_out.allButtons = allButtons; - xcb_out.firstButton = firstButton; - xcb_out.nButtons = nButtons; - xcb_out.pad0 = 0; - xcb_out.ledClass = ledClass; - xcb_out.ledID = ledID; - - 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_xkb_get_device_info_cookie_t xcb_xkb_get_device_info_unchecked - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @param uint16_t wanted - ** @param uint8_t allButtons - ** @param uint8_t firstButton - ** @param uint8_t nButtons - ** @param xcb_xkb_led_class_spec_t ledClass - ** @param xcb_xkb_id_spec_t ledID - ** @returns xcb_xkb_get_device_info_cookie_t - ** - *****************************************************************************/ - -xcb_xkb_get_device_info_cookie_t -xcb_xkb_get_device_info_unchecked (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */, - uint16_t wanted /**< */, - uint8_t allButtons /**< */, - uint8_t firstButton /**< */, - uint8_t nButtons /**< */, - xcb_xkb_led_class_spec_t ledClass /**< */, - xcb_xkb_id_spec_t ledID /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 2, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_GET_DEVICE_INFO, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[4]; - xcb_xkb_get_device_info_cookie_t xcb_ret; - xcb_xkb_get_device_info_request_t xcb_out; - - xcb_out.deviceSpec = deviceSpec; - xcb_out.wanted = wanted; - xcb_out.allButtons = allButtons; - xcb_out.firstButton = firstButton; - xcb_out.nButtons = nButtons; - xcb_out.pad0 = 0; - xcb_out.ledClass = ledClass; - xcb_out.ledID = ledID; - - 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_xkb_string8_t * xcb_xkb_get_device_info_name - ** - ** @param const xcb_xkb_get_device_info_reply_t *R - ** @returns xcb_xkb_string8_t * - ** - *****************************************************************************/ - -xcb_xkb_string8_t * -xcb_xkb_get_device_info_name (const xcb_xkb_get_device_info_reply_t *R /**< */) -{ - return (xcb_xkb_string8_t *) (R + 1); -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_device_info_name_length - ** - ** @param const xcb_xkb_get_device_info_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_device_info_name_length (const xcb_xkb_get_device_info_reply_t *R /**< */) -{ - return R->nameLen; -} - - -/***************************************************************************** - ** - ** xcb_generic_iterator_t xcb_xkb_get_device_info_name_end - ** - ** @param const xcb_xkb_get_device_info_reply_t *R - ** @returns xcb_generic_iterator_t - ** - *****************************************************************************/ - -xcb_generic_iterator_t -xcb_xkb_get_device_info_name_end (const xcb_xkb_get_device_info_reply_t *R /**< */) -{ - xcb_generic_iterator_t i; - i.data = ((xcb_xkb_string8_t *) (R + 1)) + (R->nameLen); - i.rem = 0; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** xcb_xkb_action_t * xcb_xkb_get_device_info_btn_actions - ** - ** @param const xcb_xkb_get_device_info_reply_t *R - ** @returns xcb_xkb_action_t * - ** - *****************************************************************************/ - -xcb_xkb_action_t * -xcb_xkb_get_device_info_btn_actions (const xcb_xkb_get_device_info_reply_t *R /**< */) -{ - xcb_generic_iterator_t prev = xcb_xkb_get_device_info_name_end(R); - return (xcb_xkb_action_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xkb_action_t, prev.index) + 0); -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_device_info_btn_actions_length - ** - ** @param const xcb_xkb_get_device_info_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_device_info_btn_actions_length (const xcb_xkb_get_device_info_reply_t *R /**< */) -{ - return R->nBtnsRtrn; -} - - -/***************************************************************************** - ** - ** xcb_xkb_action_iterator_t xcb_xkb_get_device_info_btn_actions_iterator - ** - ** @param const xcb_xkb_get_device_info_reply_t *R - ** @returns xcb_xkb_action_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_action_iterator_t -xcb_xkb_get_device_info_btn_actions_iterator (const xcb_xkb_get_device_info_reply_t *R /**< */) -{ - xcb_xkb_action_iterator_t i; - xcb_generic_iterator_t prev = xcb_xkb_get_device_info_name_end(R); - i.data = (xcb_xkb_action_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xkb_action_t, prev.index)); - i.rem = R->nBtnsRtrn; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** int xcb_xkb_get_device_info_leds_length - ** - ** @param const xcb_xkb_get_device_info_reply_t *R - ** @returns int - ** - *****************************************************************************/ - -int -xcb_xkb_get_device_info_leds_length (const xcb_xkb_get_device_info_reply_t *R /**< */) -{ - return R->nDeviceLedFBs; -} - - -/***************************************************************************** - ** - ** xcb_xkb_device_led_info_iterator_t xcb_xkb_get_device_info_leds_iterator - ** - ** @param const xcb_xkb_get_device_info_reply_t *R - ** @returns xcb_xkb_device_led_info_iterator_t - ** - *****************************************************************************/ - -xcb_xkb_device_led_info_iterator_t -xcb_xkb_get_device_info_leds_iterator (const xcb_xkb_get_device_info_reply_t *R /**< */) -{ - xcb_xkb_device_led_info_iterator_t i; - xcb_generic_iterator_t prev = xcb_xkb_action_end(xcb_xkb_get_device_info_btn_actions_iterator(R)); - i.data = (xcb_xkb_device_led_info_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xkb_device_led_info_t, prev.index)); - i.rem = R->nDeviceLedFBs; - i.index = (char *) i.data - (char *) R; - return i; -} - - -/***************************************************************************** - ** - ** xcb_xkb_get_device_info_reply_t * xcb_xkb_get_device_info_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_get_device_info_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_xkb_get_device_info_reply_t * - ** - *****************************************************************************/ - -xcb_xkb_get_device_info_reply_t * -xcb_xkb_get_device_info_reply (xcb_connection_t *c /**< */, - xcb_xkb_get_device_info_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_xkb_get_device_info_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - -int -xcb_xkb_set_device_info_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_xkb_set_device_info_request_t *_aux = (xcb_xkb_set_device_info_request_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to = 0; - - unsigned int i; - unsigned int xcb_tmp_len; - - xcb_block_len += sizeof(xcb_xkb_set_device_info_request_t); - xcb_tmp += xcb_block_len; - xcb_buffer_len += xcb_block_len; - xcb_block_len = 0; - /* btnActions */ - xcb_block_len += _aux->nBtns * sizeof(xcb_xkb_action_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_xkb_action_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - /* leds */ - for(i=0; i<_aux->nDeviceLedFBs; i++) { - xcb_tmp_len = xcb_xkb_device_led_info_sizeof(xcb_tmp); - xcb_block_len += xcb_tmp_len; - xcb_tmp += xcb_tmp_len; - } - xcb_align_to = ALIGNOF(xcb_xkb_device_led_info_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_void_cookie_t xcb_xkb_set_device_info_checked - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @param uint8_t firstBtn - ** @param uint8_t nBtns - ** @param uint16_t change - ** @param uint16_t nDeviceLedFBs - ** @param const xcb_xkb_action_t *btnActions - ** @param const xcb_xkb_device_led_info_t *leds - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xkb_set_device_info_checked (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */, - uint8_t firstBtn /**< */, - uint8_t nBtns /**< */, - uint16_t change /**< */, - uint16_t nDeviceLedFBs /**< */, - const xcb_xkb_action_t *btnActions /**< */, - const xcb_xkb_device_led_info_t *leds /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 6, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_SET_DEVICE_INFO, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[8]; - xcb_void_cookie_t xcb_ret; - xcb_xkb_set_device_info_request_t xcb_out; - unsigned int i; - unsigned int xcb_tmp_len; - char *xcb_tmp; - - xcb_out.deviceSpec = deviceSpec; - xcb_out.firstBtn = firstBtn; - xcb_out.nBtns = nBtns; - xcb_out.change = change; - xcb_out.nDeviceLedFBs = nDeviceLedFBs; - - 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_xkb_action_t btnActions */ - xcb_parts[4].iov_base = (char *) btnActions; - xcb_parts[4].iov_len = nBtns * sizeof(xcb_xkb_action_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - /* xcb_xkb_device_led_info_t leds */ - xcb_parts[6].iov_base = (char *) leds; - xcb_parts[6].iov_len = 0; - xcb_tmp = (char *)leds; - for(i=0; i<nDeviceLedFBs; i++) { - xcb_tmp_len = xcb_xkb_device_led_info_sizeof(xcb_tmp); - xcb_parts[6].iov_len += xcb_tmp_len; - xcb_tmp += xcb_tmp_len; - } - xcb_parts[7].iov_base = 0; - xcb_parts[7].iov_len = -xcb_parts[6].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_xkb_set_device_info - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_device_spec_t deviceSpec - ** @param uint8_t firstBtn - ** @param uint8_t nBtns - ** @param uint16_t change - ** @param uint16_t nDeviceLedFBs - ** @param const xcb_xkb_action_t *btnActions - ** @param const xcb_xkb_device_led_info_t *leds - ** @returns xcb_void_cookie_t - ** - *****************************************************************************/ - -xcb_void_cookie_t -xcb_xkb_set_device_info (xcb_connection_t *c /**< */, - xcb_xkb_device_spec_t deviceSpec /**< */, - uint8_t firstBtn /**< */, - uint8_t nBtns /**< */, - uint16_t change /**< */, - uint16_t nDeviceLedFBs /**< */, - const xcb_xkb_action_t *btnActions /**< */, - const xcb_xkb_device_led_info_t *leds /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 6, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_SET_DEVICE_INFO, - /* isvoid */ 1 - }; - - struct iovec xcb_parts[8]; - xcb_void_cookie_t xcb_ret; - xcb_xkb_set_device_info_request_t xcb_out; - unsigned int i; - unsigned int xcb_tmp_len; - char *xcb_tmp; - - xcb_out.deviceSpec = deviceSpec; - xcb_out.firstBtn = firstBtn; - xcb_out.nBtns = nBtns; - xcb_out.change = change; - xcb_out.nDeviceLedFBs = nDeviceLedFBs; - - 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_xkb_action_t btnActions */ - xcb_parts[4].iov_base = (char *) btnActions; - xcb_parts[4].iov_len = nBtns * sizeof(xcb_xkb_action_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - /* xcb_xkb_device_led_info_t leds */ - xcb_parts[6].iov_base = (char *) leds; - xcb_parts[6].iov_len = 0; - xcb_tmp = (char *)leds; - for(i=0; i<nDeviceLedFBs; i++) { - xcb_tmp_len = xcb_xkb_device_led_info_sizeof(xcb_tmp); - xcb_parts[6].iov_len += xcb_tmp_len; - xcb_tmp += xcb_tmp_len; - } - xcb_parts[7].iov_base = 0; - xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3; - - xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); - return xcb_ret; -} - -int -xcb_xkb_set_debugging_flags_sizeof (const void *_buffer /**< */) -{ - char *xcb_tmp = (char *)_buffer; - const xcb_xkb_set_debugging_flags_request_t *_aux = (xcb_xkb_set_debugging_flags_request_t *)_buffer; - unsigned int xcb_buffer_len = 0; - unsigned int xcb_block_len = 0; - unsigned int xcb_pad = 0; - unsigned int xcb_align_to = 0; - - - xcb_block_len += sizeof(xcb_xkb_set_debugging_flags_request_t); - xcb_tmp += xcb_block_len; - xcb_buffer_len += xcb_block_len; - xcb_block_len = 0; - /* message */ - xcb_block_len += _aux->msgLength * sizeof(xcb_xkb_string8_t); - xcb_tmp += xcb_block_len; - xcb_align_to = ALIGNOF(xcb_xkb_string8_t); - /* insert padding */ - xcb_pad = -xcb_block_len & (xcb_align_to - 1); - xcb_buffer_len += xcb_block_len + xcb_pad; - if (0 != xcb_pad) { - xcb_tmp += xcb_pad; - xcb_pad = 0; - } - xcb_block_len = 0; - - return xcb_buffer_len; -} - - -/***************************************************************************** - ** - ** xcb_xkb_set_debugging_flags_cookie_t xcb_xkb_set_debugging_flags - ** - ** @param xcb_connection_t *c - ** @param uint16_t msgLength - ** @param uint32_t affectFlags - ** @param uint32_t flags - ** @param uint32_t affectCtrls - ** @param uint32_t ctrls - ** @param const xcb_xkb_string8_t *message - ** @returns xcb_xkb_set_debugging_flags_cookie_t - ** - *****************************************************************************/ - -xcb_xkb_set_debugging_flags_cookie_t -xcb_xkb_set_debugging_flags (xcb_connection_t *c /**< */, - uint16_t msgLength /**< */, - uint32_t affectFlags /**< */, - uint32_t flags /**< */, - uint32_t affectCtrls /**< */, - uint32_t ctrls /**< */, - const xcb_xkb_string8_t *message /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_SET_DEBUGGING_FLAGS, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[6]; - xcb_xkb_set_debugging_flags_cookie_t xcb_ret; - xcb_xkb_set_debugging_flags_request_t xcb_out; - - xcb_out.msgLength = msgLength; - memset(xcb_out.pad0, 0, 2); - xcb_out.affectFlags = affectFlags; - xcb_out.flags = flags; - xcb_out.affectCtrls = affectCtrls; - xcb_out.ctrls = ctrls; - - 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_xkb_string8_t message */ - xcb_parts[4].iov_base = (char *) message; - xcb_parts[4].iov_len = msgLength * sizeof(xcb_xkb_string8_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - - xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); - return xcb_ret; -} - - -/***************************************************************************** - ** - ** xcb_xkb_set_debugging_flags_cookie_t xcb_xkb_set_debugging_flags_unchecked - ** - ** @param xcb_connection_t *c - ** @param uint16_t msgLength - ** @param uint32_t affectFlags - ** @param uint32_t flags - ** @param uint32_t affectCtrls - ** @param uint32_t ctrls - ** @param const xcb_xkb_string8_t *message - ** @returns xcb_xkb_set_debugging_flags_cookie_t - ** - *****************************************************************************/ - -xcb_xkb_set_debugging_flags_cookie_t -xcb_xkb_set_debugging_flags_unchecked (xcb_connection_t *c /**< */, - uint16_t msgLength /**< */, - uint32_t affectFlags /**< */, - uint32_t flags /**< */, - uint32_t affectCtrls /**< */, - uint32_t ctrls /**< */, - const xcb_xkb_string8_t *message /**< */) -{ - static const xcb_protocol_request_t xcb_req = { - /* count */ 4, - /* ext */ &xcb_xkb_id, - /* opcode */ XCB_XKB_SET_DEBUGGING_FLAGS, - /* isvoid */ 0 - }; - - struct iovec xcb_parts[6]; - xcb_xkb_set_debugging_flags_cookie_t xcb_ret; - xcb_xkb_set_debugging_flags_request_t xcb_out; - - xcb_out.msgLength = msgLength; - memset(xcb_out.pad0, 0, 2); - xcb_out.affectFlags = affectFlags; - xcb_out.flags = flags; - xcb_out.affectCtrls = affectCtrls; - xcb_out.ctrls = ctrls; - - 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_xkb_string8_t message */ - xcb_parts[4].iov_base = (char *) message; - xcb_parts[4].iov_len = msgLength * sizeof(xcb_xkb_string8_t); - xcb_parts[5].iov_base = 0; - xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; - - xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); - return xcb_ret; -} - - -/***************************************************************************** - ** - ** xcb_xkb_set_debugging_flags_reply_t * xcb_xkb_set_debugging_flags_reply - ** - ** @param xcb_connection_t *c - ** @param xcb_xkb_set_debugging_flags_cookie_t cookie - ** @param xcb_generic_error_t **e - ** @returns xcb_xkb_set_debugging_flags_reply_t * - ** - *****************************************************************************/ - -xcb_xkb_set_debugging_flags_reply_t * -xcb_xkb_set_debugging_flags_reply (xcb_connection_t *c /**< */, - xcb_xkb_set_debugging_flags_cookie_t cookie /**< */, - xcb_generic_error_t **e /**< */) -{ - return (xcb_xkb_set_debugging_flags_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); -} - |