/external/mit/xorg/lib/libxcb/files/xinput.c
C | 10140 lines | 8560 code | 1286 blank | 294 comment | 316 complexity | 83fc4ee9b1ea99db9894b67d4be4bb18 MD5 | raw file
Possible License(s): MIT, WTFPL, AGPL-1.0, BSD-3-Clause, GPL-3.0, LGPL-2.0, JSON, 0BSD
Large files files are truncated, but you can click here to view the full file
- /*
- * This file generated automatically from xinput.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 "xinput.h"
- #define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member)
- #include "xfixes.h"
- xcb_extension_t xcb_input_id = { "XInputExtension", 0 };
- void
- xcb_input_event_class_next (xcb_input_event_class_iterator_t *i /**< */)
- {
- --i->rem;
- ++i->data;
- i->index += sizeof(xcb_input_event_class_t);
- }
- xcb_generic_iterator_t
- xcb_input_event_class_end (xcb_input_event_class_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_input_key_code_next (xcb_input_key_code_iterator_t *i /**< */)
- {
- --i->rem;
- ++i->data;
- i->index += sizeof(xcb_input_key_code_t);
- }
- xcb_generic_iterator_t
- xcb_input_key_code_end (xcb_input_key_code_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_input_device_id_next (xcb_input_device_id_iterator_t *i /**< */)
- {
- --i->rem;
- ++i->data;
- i->index += sizeof(xcb_input_device_id_t);
- }
- xcb_generic_iterator_t
- xcb_input_device_id_end (xcb_input_device_id_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_input_fp1616_next (xcb_input_fp1616_iterator_t *i /**< */)
- {
- --i->rem;
- ++i->data;
- i->index += sizeof(xcb_input_fp1616_t);
- }
- xcb_generic_iterator_t
- xcb_input_fp1616_end (xcb_input_fp1616_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_input_fp3232_next (xcb_input_fp3232_iterator_t *i /**< */)
- {
- --i->rem;
- ++i->data;
- i->index += sizeof(xcb_input_fp3232_t);
- }
- xcb_generic_iterator_t
- xcb_input_fp3232_end (xcb_input_fp3232_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_input_get_extension_version_sizeof (const void *_buffer /**< */)
- {
- char *xcb_tmp = (char *)_buffer;
- const xcb_input_get_extension_version_request_t *_aux = (xcb_input_get_extension_version_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_input_get_extension_version_request_t);
- xcb_tmp += xcb_block_len;
- xcb_buffer_len += xcb_block_len;
- xcb_block_len = 0;
- /* 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;
- }
- xcb_input_get_extension_version_cookie_t
- xcb_input_get_extension_version (xcb_connection_t *c /**< */,
- uint16_t name_len /**< */,
- const char *name /**< */)
- {
- static const xcb_protocol_request_t xcb_req = {
- /* count */ 4,
- /* ext */ &xcb_input_id,
- /* opcode */ XCB_INPUT_GET_EXTENSION_VERSION,
- /* isvoid */ 0
- };
- struct iovec xcb_parts[6];
- xcb_input_get_extension_version_cookie_t xcb_ret;
- xcb_input_get_extension_version_request_t xcb_out;
- xcb_out.name_len = name_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 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_input_get_extension_version_cookie_t
- xcb_input_get_extension_version_unchecked (xcb_connection_t *c /**< */,
- uint16_t name_len /**< */,
- const char *name /**< */)
- {
- static const xcb_protocol_request_t xcb_req = {
- /* count */ 4,
- /* ext */ &xcb_input_id,
- /* opcode */ XCB_INPUT_GET_EXTENSION_VERSION,
- /* isvoid */ 0
- };
- struct iovec xcb_parts[6];
- xcb_input_get_extension_version_cookie_t xcb_ret;
- xcb_input_get_extension_version_request_t xcb_out;
- xcb_out.name_len = name_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 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_input_get_extension_version_reply_t *
- xcb_input_get_extension_version_reply (xcb_connection_t *c /**< */,
- xcb_input_get_extension_version_cookie_t cookie /**< */,
- xcb_generic_error_t **e /**< */)
- {
- return (xcb_input_get_extension_version_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
- }
- void
- xcb_input_device_info_next (xcb_input_device_info_iterator_t *i /**< */)
- {
- --i->rem;
- ++i->data;
- i->index += sizeof(xcb_input_device_info_t);
- }
- xcb_generic_iterator_t
- xcb_input_device_info_end (xcb_input_device_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;
- }
- void
- xcb_input_key_info_next (xcb_input_key_info_iterator_t *i /**< */)
- {
- --i->rem;
- ++i->data;
- i->index += sizeof(xcb_input_key_info_t);
- }
- xcb_generic_iterator_t
- xcb_input_key_info_end (xcb_input_key_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;
- }
- void
- xcb_input_button_info_next (xcb_input_button_info_iterator_t *i /**< */)
- {
- --i->rem;
- ++i->data;
- i->index += sizeof(xcb_input_button_info_t);
- }
- xcb_generic_iterator_t
- xcb_input_button_info_end (xcb_input_button_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;
- }
- void
- xcb_input_axis_info_next (xcb_input_axis_info_iterator_t *i /**< */)
- {
- --i->rem;
- ++i->data;
- i->index += sizeof(xcb_input_axis_info_t);
- }
- xcb_generic_iterator_t
- xcb_input_axis_info_end (xcb_input_axis_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_input_valuator_info_sizeof (const void *_buffer /**< */)
- {
- char *xcb_tmp = (char *)_buffer;
- const xcb_input_valuator_info_t *_aux = (xcb_input_valuator_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_input_valuator_info_t);
- xcb_tmp += xcb_block_len;
- xcb_buffer_len += xcb_block_len;
- xcb_block_len = 0;
- /* axes */
- xcb_block_len += _aux->axes_len * sizeof(xcb_input_axis_info_t);
- xcb_tmp += xcb_block_len;
- xcb_align_to = ALIGNOF(xcb_input_axis_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_input_axis_info_t *
- xcb_input_valuator_info_axes (const xcb_input_valuator_info_t *R /**< */)
- {
- return (xcb_input_axis_info_t *) (R + 1);
- }
- int
- xcb_input_valuator_info_axes_length (const xcb_input_valuator_info_t *R /**< */)
- {
- return R->axes_len;
- }
- xcb_input_axis_info_iterator_t
- xcb_input_valuator_info_axes_iterator (const xcb_input_valuator_info_t *R /**< */)
- {
- xcb_input_axis_info_iterator_t i;
- i.data = (xcb_input_axis_info_t *) (R + 1);
- i.rem = R->axes_len;
- i.index = (char *) i.data - (char *) R;
- return i;
- }
- void
- xcb_input_valuator_info_next (xcb_input_valuator_info_iterator_t *i /**< */)
- {
- xcb_input_valuator_info_t *R = i->data;
- xcb_generic_iterator_t child;
- child.data = (xcb_input_valuator_info_t *)(((char *)R) + xcb_input_valuator_info_sizeof(R));
- i->index = (char *) child.data - (char *) i->data;
- --i->rem;
- i->data = (xcb_input_valuator_info_t *) child.data;
- }
- xcb_generic_iterator_t
- xcb_input_valuator_info_end (xcb_input_valuator_info_iterator_t i /**< */)
- {
- xcb_generic_iterator_t ret;
- while(i.rem > 0)
- xcb_input_valuator_info_next(&i);
- ret.data = i.data;
- ret.rem = i.rem;
- ret.index = i.index;
- return ret;
- }
- void
- xcb_input_input_info_next (xcb_input_input_info_iterator_t *i /**< */)
- {
- --i->rem;
- ++i->data;
- i->index += sizeof(xcb_input_input_info_t);
- }
- xcb_generic_iterator_t
- xcb_input_input_info_end (xcb_input_input_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_input_device_name_sizeof (const void *_buffer /**< */)
- {
- char *xcb_tmp = (char *)_buffer;
- const xcb_input_device_name_t *_aux = (xcb_input_device_name_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_input_device_name_t);
- xcb_tmp += xcb_block_len;
- xcb_buffer_len += xcb_block_len;
- xcb_block_len = 0;
- /* string */
- xcb_block_len += _aux->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_input_device_name_string (const xcb_input_device_name_t *R /**< */)
- {
- return (char *) (R + 1);
- }
- int
- xcb_input_device_name_string_length (const xcb_input_device_name_t *R /**< */)
- {
- return R->len;
- }
- xcb_generic_iterator_t
- xcb_input_device_name_string_end (const xcb_input_device_name_t *R /**< */)
- {
- xcb_generic_iterator_t i;
- i.data = ((char *) (R + 1)) + (R->len);
- i.rem = 0;
- i.index = (char *) i.data - (char *) R;
- return i;
- }
- void
- xcb_input_device_name_next (xcb_input_device_name_iterator_t *i /**< */)
- {
- xcb_input_device_name_t *R = i->data;
- xcb_generic_iterator_t child;
- child.data = (xcb_input_device_name_t *)(((char *)R) + xcb_input_device_name_sizeof(R));
- i->index = (char *) child.data - (char *) i->data;
- --i->rem;
- i->data = (xcb_input_device_name_t *) child.data;
- }
- xcb_generic_iterator_t
- xcb_input_device_name_end (xcb_input_device_name_iterator_t i /**< */)
- {
- xcb_generic_iterator_t ret;
- while(i.rem > 0)
- xcb_input_device_name_next(&i);
- ret.data = i.data;
- ret.rem = i.rem;
- ret.index = i.index;
- return ret;
- }
- int
- xcb_input_list_input_devices_sizeof (const void *_buffer /**< */)
- {
- char *xcb_tmp = (char *)_buffer;
- const xcb_input_list_input_devices_reply_t *_aux = (xcb_input_list_input_devices_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_input_list_input_devices_reply_t);
- xcb_tmp += xcb_block_len;
- xcb_buffer_len += xcb_block_len;
- xcb_block_len = 0;
- /* devices */
- xcb_block_len += _aux->devices_len * sizeof(xcb_input_device_info_t);
- xcb_tmp += xcb_block_len;
- xcb_align_to = ALIGNOF(xcb_input_device_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_input_list_input_devices_cookie_t
- xcb_input_list_input_devices (xcb_connection_t *c /**< */)
- {
- static const xcb_protocol_request_t xcb_req = {
- /* count */ 2,
- /* ext */ &xcb_input_id,
- /* opcode */ XCB_INPUT_LIST_INPUT_DEVICES,
- /* isvoid */ 0
- };
- struct iovec xcb_parts[4];
- xcb_input_list_input_devices_cookie_t xcb_ret;
- xcb_input_list_input_devices_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_input_list_input_devices_cookie_t
- xcb_input_list_input_devices_unchecked (xcb_connection_t *c /**< */)
- {
- static const xcb_protocol_request_t xcb_req = {
- /* count */ 2,
- /* ext */ &xcb_input_id,
- /* opcode */ XCB_INPUT_LIST_INPUT_DEVICES,
- /* isvoid */ 0
- };
- struct iovec xcb_parts[4];
- xcb_input_list_input_devices_cookie_t xcb_ret;
- xcb_input_list_input_devices_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_input_device_info_t *
- xcb_input_list_input_devices_devices (const xcb_input_list_input_devices_reply_t *R /**< */)
- {
- return (xcb_input_device_info_t *) (R + 1);
- }
- int
- xcb_input_list_input_devices_devices_length (const xcb_input_list_input_devices_reply_t *R /**< */)
- {
- return R->devices_len;
- }
- xcb_input_device_info_iterator_t
- xcb_input_list_input_devices_devices_iterator (const xcb_input_list_input_devices_reply_t *R /**< */)
- {
- xcb_input_device_info_iterator_t i;
- i.data = (xcb_input_device_info_t *) (R + 1);
- i.rem = R->devices_len;
- i.index = (char *) i.data - (char *) R;
- return i;
- }
- xcb_input_list_input_devices_reply_t *
- xcb_input_list_input_devices_reply (xcb_connection_t *c /**< */,
- xcb_input_list_input_devices_cookie_t cookie /**< */,
- xcb_generic_error_t **e /**< */)
- {
- return (xcb_input_list_input_devices_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
- }
- void
- xcb_input_input_class_info_next (xcb_input_input_class_info_iterator_t *i /**< */)
- {
- --i->rem;
- ++i->data;
- i->index += sizeof(xcb_input_input_class_info_t);
- }
- xcb_generic_iterator_t
- xcb_input_input_class_info_end (xcb_input_input_class_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_input_open_device_sizeof (const void *_buffer /**< */)
- {
- char *xcb_tmp = (char *)_buffer;
- const xcb_input_open_device_reply_t *_aux = (xcb_input_open_device_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_input_open_device_reply_t);
- xcb_tmp += xcb_block_len;
- xcb_buffer_len += xcb_block_len;
- xcb_block_len = 0;
- /* class_info */
- xcb_block_len += _aux->num_classes * sizeof(xcb_input_input_class_info_t);
- xcb_tmp += xcb_block_len;
- xcb_align_to = ALIGNOF(xcb_input_input_class_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_input_open_device_cookie_t
- xcb_input_open_device (xcb_connection_t *c /**< */,
- uint8_t device_id /**< */)
- {
- static const xcb_protocol_request_t xcb_req = {
- /* count */ 2,
- /* ext */ &xcb_input_id,
- /* opcode */ XCB_INPUT_OPEN_DEVICE,
- /* isvoid */ 0
- };
- struct iovec xcb_parts[4];
- xcb_input_open_device_cookie_t xcb_ret;
- xcb_input_open_device_request_t xcb_out;
- xcb_out.device_id = device_id;
- 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_input_open_device_cookie_t
- xcb_input_open_device_unchecked (xcb_connection_t *c /**< */,
- uint8_t device_id /**< */)
- {
- static const xcb_protocol_request_t xcb_req = {
- /* count */ 2,
- /* ext */ &xcb_input_id,
- /* opcode */ XCB_INPUT_OPEN_DEVICE,
- /* isvoid */ 0
- };
- struct iovec xcb_parts[4];
- xcb_input_open_device_cookie_t xcb_ret;
- xcb_input_open_device_request_t xcb_out;
- xcb_out.device_id = device_id;
- 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_input_input_class_info_t *
- xcb_input_open_device_class_info (const xcb_input_open_device_reply_t *R /**< */)
- {
- return (xcb_input_input_class_info_t *) (R + 1);
- }
- int
- xcb_input_open_device_class_info_length (const xcb_input_open_device_reply_t *R /**< */)
- {
- return R->num_classes;
- }
- xcb_input_input_class_info_iterator_t
- xcb_input_open_device_class_info_iterator (const xcb_input_open_device_reply_t *R /**< */)
- {
- xcb_input_input_class_info_iterator_t i;
- i.data = (xcb_input_input_class_info_t *) (R + 1);
- i.rem = R->num_classes;
- i.index = (char *) i.data - (char *) R;
- return i;
- }
- xcb_input_open_device_reply_t *
- xcb_input_open_device_reply (xcb_connection_t *c /**< */,
- xcb_input_open_device_cookie_t cookie /**< */,
- xcb_generic_error_t **e /**< */)
- {
- return (xcb_input_open_device_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
- }
- xcb_void_cookie_t
- xcb_input_close_device_checked (xcb_connection_t *c /**< */,
- uint8_t device_id /**< */)
- {
- static const xcb_protocol_request_t xcb_req = {
- /* count */ 2,
- /* ext */ &xcb_input_id,
- /* opcode */ XCB_INPUT_CLOSE_DEVICE,
- /* isvoid */ 1
- };
- struct iovec xcb_parts[4];
- xcb_void_cookie_t xcb_ret;
- xcb_input_close_device_request_t xcb_out;
- xcb_out.device_id = device_id;
- 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_input_close_device (xcb_connection_t *c /**< */,
- uint8_t device_id /**< */)
- {
- static const xcb_protocol_request_t xcb_req = {
- /* count */ 2,
- /* ext */ &xcb_input_id,
- /* opcode */ XCB_INPUT_CLOSE_DEVICE,
- /* isvoid */ 1
- };
- struct iovec xcb_parts[4];
- xcb_void_cookie_t xcb_ret;
- xcb_input_close_device_request_t xcb_out;
- xcb_out.device_id = device_id;
- 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_input_set_device_mode_cookie_t
- xcb_input_set_device_mode (xcb_connection_t *c /**< */,
- uint8_t device_id /**< */,
- uint8_t mode /**< */)
- {
- static const xcb_protocol_request_t xcb_req = {
- /* count */ 2,
- /* ext */ &xcb_input_id,
- /* opcode */ XCB_INPUT_SET_DEVICE_MODE,
- /* isvoid */ 0
- };
- struct iovec xcb_parts[4];
- xcb_input_set_device_mode_cookie_t xcb_ret;
- xcb_input_set_device_mode_request_t xcb_out;
- xcb_out.device_id = device_id;
- xcb_out.mode = mode;
- 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_input_set_device_mode_cookie_t
- xcb_input_set_device_mode_unchecked (xcb_connection_t *c /**< */,
- uint8_t device_id /**< */,
- uint8_t mode /**< */)
- {
- static const xcb_protocol_request_t xcb_req = {
- /* count */ 2,
- /* ext */ &xcb_input_id,
- /* opcode */ XCB_INPUT_SET_DEVICE_MODE,
- /* isvoid */ 0
- };
- struct iovec xcb_parts[4];
- xcb_input_set_device_mode_cookie_t xcb_ret;
- xcb_input_set_device_mode_request_t xcb_out;
- xcb_out.device_id = device_id;
- xcb_out.mode = mode;
- 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_input_set_device_mode_reply_t *
- xcb_input_set_device_mode_reply (xcb_connection_t *c /**< */,
- xcb_input_set_device_mode_cookie_t cookie /**< */,
- xcb_generic_error_t **e /**< */)
- {
- return (xcb_input_set_device_mode_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
- }
- int
- xcb_input_select_extension_event_sizeof (const void *_buffer /**< */)
- {
- char *xcb_tmp = (char *)_buffer;
- const xcb_input_select_extension_event_request_t *_aux = (xcb_input_select_extension_event_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_input_select_extension_event_request_t);
- xcb_tmp += xcb_block_len;
- xcb_buffer_len += xcb_block_len;
- xcb_block_len = 0;
- /* classes */
- xcb_block_len += _aux->num_classes * sizeof(xcb_input_event_class_t);
- xcb_tmp += xcb_block_len;
- xcb_align_to = ALIGNOF(xcb_input_event_class_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_input_select_extension_event_checked (xcb_connection_t *c /**< */,
- xcb_window_t window /**< */,
- uint16_t num_classes /**< */,
- const xcb_input_event_class_t *classes /**< */)
- {
- static const xcb_protocol_request_t xcb_req = {
- /* count */ 4,
- /* ext */ &xcb_input_id,
- /* opcode */ XCB_INPUT_SELECT_EXTENSION_EVENT,
- /* isvoid */ 1
- };
- struct iovec xcb_parts[6];
- xcb_void_cookie_t xcb_ret;
- xcb_input_select_extension_event_request_t xcb_out;
- xcb_out.window = window;
- xcb_out.num_classes = num_classes;
- 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_input_event_class_t classes */
- xcb_parts[4].iov_base = (char *) classes;
- xcb_parts[4].iov_len = num_classes * sizeof(xcb_input_event_class_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_input_select_extension_event (xcb_connection_t *c /**< */,
- xcb_window_t window /**< */,
- uint16_t num_classes /**< */,
- const xcb_input_event_class_t *classes /**< */)
- {
- static const xcb_protocol_request_t xcb_req = {
- /* count */ 4,
- /* ext */ &xcb_input_id,
- /* opcode */ XCB_INPUT_SELECT_EXTENSION_EVENT,
- /* isvoid */ 1
- };
- struct iovec xcb_parts[6];
- xcb_void_cookie_t xcb_ret;
- xcb_input_select_extension_event_request_t xcb_out;
- xcb_out.window = window;
- xcb_out.num_classes = num_classes;
- 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_input_event_class_t classes */
- xcb_parts[4].iov_base = (char *) classes;
- xcb_parts[4].iov_len = num_classes * sizeof(xcb_input_event_class_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_input_get_selected_extension_events_sizeof (const void *_buffer /**< */)
- {
- char *xcb_tmp = (char *)_buffer;
- const xcb_input_get_selected_extension_events_reply_t *_aux = (xcb_input_get_selected_extension_events_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_input_get_selected_extension_events_reply_t);
- xcb_tmp += xcb_block_len;
- xcb_buffer_len += xcb_block_len;
- xcb_block_len = 0;
- /* this_classes */
- xcb_block_len += _aux->num_this_classes * sizeof(xcb_input_event_class_t);
- xcb_tmp += xcb_block_len;
- xcb_align_to = ALIGNOF(xcb_input_event_class_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;
- /* all_classes */
- xcb_block_len += _aux->num_all_classes * sizeof(xcb_input_event_class_t);
- xcb_tmp += xcb_block_len;
- xcb_align_to = ALIGNOF(xcb_input_event_class_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_input_get_selected_extension_events_cookie_t
- xcb_input_get_selected_extension_events (xcb_connection_t *c /**< */,
- xcb_window_t window /**< */)
- {
- static const xcb_protocol_request_t xcb_req = {
- /* count */ 2,
- /* ext */ &xcb_input_id,
- /* opcode */ XCB_INPUT_GET_SELECTED_EXTENSION_EVENTS,
- /* isvoid */ 0
- };
- struct iovec xcb_parts[4];
- xcb_input_get_selected_extension_events_cookie_t xcb_ret;
- xcb_input_get_selected_extension_events_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_input_get_selected_extension_events_cookie_t
- xcb_input_get_selected_extension_events_unchecked (xcb_connection_t *c /**< */,
- xcb_window_t window /**< */)
- {
- static const xcb_protocol_request_t xcb_req = {
- /* count */ 2,
- /* ext */ &xcb_input_id,
- /* opcode */ XCB_INPUT_GET_SELECTED_EXTENSION_EVENTS,
- /* isvoid */ 0
- };
- struct iovec xcb_parts[4];
- xcb_input_get_selected_extension_events_cookie_t xcb_ret;
- xcb_input_get_selected_extension_events_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_input_event_class_t *
- xcb_input_get_selected_extension_events_this_classes (const xcb_input_get_selected_extension_events_reply_t *R /**< */)
- {
- return (xcb_input_event_class_t *) (R + 1);
- }
- int
- xcb_input_get_selected_extension_events_this_classes_length (const xcb_input_get_selected_extension_events_reply_t *R /**< */)
- {
- return R->num_this_classes;
- }
- xcb_generic_iterator_t
- xcb_input_get_selected_extension_events_this_classes_end (const xcb_input_get_selected_extension_events_reply_t *R /**< */)
- {
- xcb_generic_iterator_t i;
- i.data = ((xcb_input_event_class_t *) (R + 1)) + (R->num_this_classes);
- i.rem = 0;
- i.index = (char *) i.data - (char *) R;
- return i;
- }
- xcb_input_event_class_t *
- xcb_input_get_selected_extension_events_all_classes (const xcb_input_get_selected_extension_events_reply_t *R /**< */)
- {
- xcb_generic_iterator_t prev = xcb_input_get_selected_extension_events_this_classes_end(R);
- return (xcb_input_event_class_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_input_event_class_t, prev.index) + 0);
- }
- int
- xcb_input_get_selected_extension_events_all_classes_length (const xcb_input_get_selected_extension_events_reply_t *R /**< */)
- {
- return R->num_all_classes;
- }
- xcb_generic_iterator_t
- xcb_input_get_selected_extension_events_all_classes_end (const xcb_input_get_selected_extension_events_reply_t *R /**< */)
- {
- xcb_generic_iterator_t i;
- xcb_generic_iterator_t child = xcb_input_get_selected_extension_events_this_classes_end(R);
- i.data = ((xcb_input_event_class_t *) child.data) + (R->num_all_classes);
- i.rem = 0;
- i.index = (char *) i.data - (char *) R;
- return i;
- }
- xcb_input_get_selected_extension_events_reply_t *
- xcb_input_get_selected_extension_events_reply (xcb_connection_t *c /**< */,
- xcb_input_get_selected_extension_events_cookie_t cookie /**< */,
- xcb_generic_error_t **e /**< */)
- {
- return (xcb_input_get_selected_extension_events_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
- }
- int
- xcb_input_change_device_dont_propagate_list_sizeof (const void *_buffer /**< */)
- {
- char *xcb_tmp = (char *)_buffer;
- const xcb_input_change_device_dont_propagate_list_request_t *_aux = (xcb_input_change_device_dont_propagate_list_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_input_change_device_dont_propagate_list_request_t);
- xcb_tmp += xcb_block_len;
- xcb_buffer_len += xcb_block_len;
- xcb_block_len = 0;
- /* classes */
- xcb_block_len += _aux->num_classes * sizeof(xcb_input_event_class_t);
- xcb_tmp += xcb_block_len;
- xcb_align_to = ALIGNOF(xcb_input_event_class_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_input_change_device_dont_propagate_list_checked (xcb_connection_t *c /**< */,
- xcb_window_t window /**< */,
- uint16_t num_classes /**< */,
- uint8_t mode /**< */,
- const xcb_input_event_class_t *classes /**< */)
- {
- static const xcb_protocol_request_t xcb_req = {
- /* count */ 4,
- /* ext */ &xcb_input_id,
- /* opcode */ XCB_INPUT_CHANGE_DEVICE_DONT_PROPAGATE_LIST,
- /* isvoid */ 1
- };
- struct iovec xcb_parts[6];
- xcb_void_cookie_t xcb_ret;
- xcb_input_change_device_dont_propagate_list_request_t xcb_out;
- xcb_out.window = window;
- xcb_out.num_classes = num_classes;
- xcb_out.mode = mode;
- 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_input_event_class_t classes */
- xcb_parts[4].iov_base = (char *) classes;
- xcb_parts[4].iov_len = num_classes * sizeof(xcb_input_event_class_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_input_change_device_dont_propagate_list (xcb_connection_t *c /**< */,
- xcb_window_t window /**< */,
- uint16_t num_classes /**< */,
- uint8_t mode /**< */,
- const xcb_input_event_class_t *classes /**< */)
- {
- static const xcb_protocol_request_t xcb_req = {
- /* count */ 4,
- /* ext */ &xcb_input_id,
- /* opcode */ XCB_INPUT_CHANGE_DEVICE_DONT_PROPAGATE_LIST,
- /* isvoid */ 1
- };
- struct iovec xcb_parts[6];
- xcb_void_cookie_t xcb_ret;
- xcb_input_change_device_dont_propagate_list_request_t xcb_out;
- xcb_out.window = window;
- xcb_out.num_classes = num_classes;
- xcb_out.mode = mode;
- 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_input_event_class_t classes */
- xcb_parts[4].iov_base = (char *) classes;
- xcb_parts[4].iov_len = num_classes * sizeof(xcb_input_event_class_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_input_get_device_dont_propagate_list_sizeof (const void *_buffer /**< */)
- {
- char *xcb_tmp = (char *)_buffer;
- const xcb_input_get_device_dont_propagate_list_reply_t *_aux = (xcb_input_get_device_dont_propagate_list_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_input_get_device_dont_propagate_list_reply_t);
- xcb_tmp += xcb_block_len;
- xcb_buffer_len += xcb_block_len;
- xcb_block_len = 0;
- /* classes */
- xcb_block_len += _aux->num_classes * sizeof(xcb_input_event_class_t);
- xcb_tmp += xcb_block_len;
- xcb_align_to = ALIGNOF(xcb_input_event_class_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_input_get_device_dont_propagate_list_cookie_t
- xcb_input_get_device_dont_propagate_list (xcb_connection_t *c /**< */,
- xcb_window_t window /**< */)
- {
- static const xcb_protocol_request_t xcb_req = {
- /* count */ 2,
- /* ext */ &xcb_input_id,
- /* opcode */ XCB_INPUT_GET_DEVICE_DONT_PROPAGATE_LIST,
- /* isvoid */ 0
- };
- struct iovec xcb_parts[4];
- xcb_input_get_device_dont_propagate_list_cookie_t xcb_ret;
- xcb_input_get_device_dont_propagate_list_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_input_get_device_dont_propagate_list_cookie_t
- xcb_input_get_device_dont_propagate_list_unchecked (xcb_connection_t *c /**< */,
- xcb_window_t window /**< */)
- {
- static const xcb_protocol_request_t xcb_req = {
- /* count */ 2,
- /* ext */ &xcb_input_id,
- /* opcode */ XCB_INPUT_GET_DEVICE_DONT_PROPAGATE_LIST,
- /* isvoid */ 0
- };
- struct iovec xcb_parts[4];
- xcb_input_get_device_dont_propagate_list_cookie_t xcb_ret;
- xcb_input_get_device_dont_propagate_list_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_input_event_class_t *
- xcb_input_get_device_dont_propagate_list_classes (const xcb_input_get_device_dont_propagate_list_reply_t *R /**< */)
- {
- return (xcb_input_event_class_t *) (R + 1);
- }
- int
- xcb_input_get_device_dont_propagate_list_classes_length (const xcb_input_get_device_dont_propagate_list_reply_t *R /**< */)
- {
- return R->num_classes;
- }
- xcb_generic_iterator_t
- xcb_input_get_device_dont_propagate_list_classes_end (const xcb_input_get_device_dont_propagate_list_reply_t *R /**< */)
- {
- xcb_generic_iterator_t i;
- i.data = ((xcb_input_event_class_t *) (R + 1)) + (R->num_classes);
- i.rem = 0;
- i.index = (char *) i.data - (char *) R;
- return i;
- }
- xcb_input_get_device_dont_propagate_list_reply_t *
- xcb_input_get_device_dont_propagate_list_reply (xcb_connection_t *c /**< */,
- xcb_input_get_device_dont_propagate_list_cookie_t cookie /**< */,
- xcb_generic_error_t **e /**< */)
- {
- return (xcb_input_get_device_dont_propagate_list_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
- }
- void
- xcb_input_device_time_coord_next (xcb_input_device_time_coord_iterator_t *i /**< */)
- {
- --i->rem;
- ++i->data;
- i->index += sizeof(xcb_input_device_time_coord_t);
- }
- xcb_generic_iterator_t
- xcb_input_device_time_coord_end (xcb_input_device_time_coord_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_input_get_device_motion_events_cookie_t
- xcb_input_get_device_motion_events (xcb_connection_t *c /**< */,
- xcb_timestamp_t start /**< */,
- xcb_timestamp_t stop /**< */,
- uint8_t device_id /**< */)
- {
- static const xcb_protocol_request_t xcb_req = {
- /* count */ 2,
- /* ext */ &xcb_input_id,
- /* opcode */ XCB_INPUT_GET_DEVICE_MOTION_EVENTS,
- /* isvoid */ 0
- };
- struct iovec xcb_parts[4];
- xcb_input_get_device_motion_events_cookie_t xcb_ret;
- xcb_input_get_device_motion_events_request_t xcb_out;
- xcb_out.start = start;
- xcb_out.stop = stop;
- xcb_out.device_id = device_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_input_get_device_motion_events_cookie_t
- xcb_input_get_device_motion_events_unchecked (xcb_connection_t *c /**< */,
- xcb_timestamp_t start /**< */,
- xcb_timestamp_t stop /**< */,
- uint8_t device_id /**< */)
- {
- static const xcb_protocol_request_t xcb_req = {
- /* count */ 2,
- /* ext */ &xcb_input_id,
- /* opcode */ XCB_INPUT_GET_DEVICE_MOTION_EVENTS,
- /* isvoid */ 0
- };
- struct iovec xcb_parts[4];
- xcb_input_get_device_motion_events_cookie_t xcb_ret;
- xcb_input_get_device_motion_events_request_t xcb_out;
- xcb_out.start = start;
- xcb_out.stop = stop;
- xcb_out.device_id = device_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_input_get_device_motion_events_reply_t *
- xcb_input_get_device_motion_events_reply (xcb_connection_t *c /**< */,
- xcb_input_get_device_motion_events_cookie_t cookie /**< */,
- xcb_generic_error_t **e /**< */)
- {
- return (xcb_input_get_device_motion_events_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
- }
- xcb_input_change_keyboard_device_cookie_t
- xcb_input_change_keyboard_device (xcb_connection_t *c /**< */,
- uint8_t device_id /**< */)
- {
- static const xcb_protocol_request_t xcb_req = {
- /* count */ 2,
- /* ext */ &xcb_input_id,
- /* opcode */ XCB_INPUT_CHANGE_KEYBOARD_DEVICE,
- /* isvoid */ 0
- };
- struct iovec xcb_parts[4];
- xcb_input_change_keyboard_device_cookie_t xcb_ret;
- xcb_input_change_keyboard_device_request_t xcb_out;
- xcb_out.device_id = device_id;
- 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_input_change_keyboard_device_cookie_t
- xcb_input_change_keyboard_device_unchecked (xcb_connection_t *c /**< */,
- uint8_t device_id /**< */)
- {
- static const xcb_protocol_request_t xcb_req = {
- /* count */ 2,
- /* ext */ &xcb_input_id,
- /* opcode */ XCB_INPUT_CHANGE_KEYBOARD_DEVICE,
- /* isvoid */ 0
- };
- struct iovec xcb_parts[4];
- xcb_input_change_keyboard_device_cookie_t xcb_ret;
- xcb_input_change_keyboard_device_request_t xcb_out;
- xcb_out.device_id = device_id;
- 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_input_change_keyboard_device_reply_t *
- xcb_input_change_keyboard_device_reply (xcb_connection_t *c /**< */,
- xcb_input_change_keyboard_device_cookie_t cookie /**< */,
- xcb_generic_error_t **e /**< */)
- {
- return (xcb_input_change_keyboard_device_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
- }
- xcb_input_change_pointer_device_cookie_t
- xcb_input_change_pointer_device (xcb_connection_t *c /**< */,
- uint8_t x_axis /**< */,
- uint8_t y_axis /**< */,
- uint8_t device_id /**< */)
- {
- static const xcb_protocol_request_t xcb_req = {
- /* count */ 2,
- /* ext */ &xcb_input_id,
- /* opcode */ XCB_INPUT_CHANGE_POINTER_DEVICE,
- /* isvoid */ 0
- };
- struct iovec xcb_parts[4];
- xcb_input_change_pointer_device_cookie_t xcb_ret;
- xcb_input_change_pointer_device_request_t xcb_out;
- xcb_out.x_axis = x_axis;
- xcb_out.y_axis = y_axis;
- xcb_out.device_id = device_id;
- 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_input_change_pointer_device_cookie_t
- xcb_input_change_pointer_device_unchecked (xcb_connection_t *c /**< */,
- uint8_t x_axis /**< */,
- uint8_t y_axis /**< */,
- uint8_t device_id /**< */)
- {
- static const xcb_protocol_request_t xcb_req = {
- /* count */ 2,
- /* ext */ &xcb_input_id,
- /* opcode */ XCB_INPUT_CHANGE_POINTER_DEVICE,
- /* isvoid */ 0
- };
- struct iovec xcb_parts[4];
- xcb_input_change_pointer_device_cookie_t xcb_ret;
- xcb_input_change_pointer_device_request_t xcb_out;
- xcb_out.x_axis = x_axis;
- xcb_out.y_axis = y_axis;
- xcb_out.device_id = device_id;
- 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_input_change_pointer_device_reply_t *
- xcb_input_change_pointer_device_reply (xcb_connection_t *c /**< */,
- xcb_input_change_pointer_device_cookie_t cookie /**< */,
- xcb_generic_error_t **e /**< */)
- {
- return (xcb_input_change_pointer_device_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
- }
- int
- xcb_input_grab_device_sizeof (const void *_buffer /**< */)
- {
- char *xcb_tmp = (char *)_buffer;
- const xcb_input_grab_device_request_t *_aux = (xcb_input_grab_device_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_input_grab_device_request_t);
- xcb_tmp += xcb_block_len;
- xcb_buffer_len += xcb_block_len;
- xcb_block_len = 0;
- /* classes */
- xcb_block_len += _aux->num_classes * sizeof(xcb_input_event_class_t);
- xcb_tmp += xcb_block_len;
- xcb_align_to = ALIGNOF(xcb_input_event_class_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_input_grab_device_cookie_t
- xcb_input_grab_device (xcb_connection_t *c /**< */,
- xcb_window_t grab_window /**< */,
- xcb_timestamp_t time /**< */,
- uint16_t num_classes /**< */,
- uint8_t this_device_mode /**< */,
- uint8_t other_device_mode /**< */,
- uint8_t owner_events /**< */,
- uint8_t device_id /**< */,
- const xcb_input_event_class_t *classes /**< */)
- {
- static const xcb_protocol_request_t xcb_req = {
- /* count */ 4,
- /* ext */ &xcb_input_id,
- /* opcode */ XCB_INPUT_GRAB_DEVICE,
- /* isvoid */ 0
- };
- struct iovec xcb_parts[6];
- xcb_input_grab_device_cookie_t xcb_ret;
- xcb_input_grab_device_request_t xcb_out;
- xcb_out.gr…
Large files files are truncated, but you can click here to view the full file