etc/protocols - sync with NetBSD-8
[minix.git] / external / mit / xorg / lib / libxcb / files / xinput.c
blob620ac6a087aedc76d34797201ce05b623504fc8f
1 /*
2 * This file generated automatically from xinput.xml by c_client.py.
3 * Edit at your peril.
4 */
6 #ifdef HAVE_CONFIG_H
7 #include "config.h"
8 #endif
9 #include <stdlib.h>
10 #include <string.h>
11 #include <assert.h>
12 #include <stddef.h> /* for offsetof() */
13 #include "xcbext.h"
14 #include "xinput.h"
16 #define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member)
17 #include "xfixes.h"
19 xcb_extension_t xcb_input_id = { "XInputExtension", 0 };
21 void
22 xcb_input_event_class_next (xcb_input_event_class_iterator_t *i /**< */)
24 --i->rem;
25 ++i->data;
26 i->index += sizeof(xcb_input_event_class_t);
29 xcb_generic_iterator_t
30 xcb_input_event_class_end (xcb_input_event_class_iterator_t i /**< */)
32 xcb_generic_iterator_t ret;
33 ret.data = i.data + i.rem;
34 ret.index = i.index + ((char *) ret.data - (char *) i.data);
35 ret.rem = 0;
36 return ret;
39 void
40 xcb_input_key_code_next (xcb_input_key_code_iterator_t *i /**< */)
42 --i->rem;
43 ++i->data;
44 i->index += sizeof(xcb_input_key_code_t);
47 xcb_generic_iterator_t
48 xcb_input_key_code_end (xcb_input_key_code_iterator_t i /**< */)
50 xcb_generic_iterator_t ret;
51 ret.data = i.data + i.rem;
52 ret.index = i.index + ((char *) ret.data - (char *) i.data);
53 ret.rem = 0;
54 return ret;
57 void
58 xcb_input_device_id_next (xcb_input_device_id_iterator_t *i /**< */)
60 --i->rem;
61 ++i->data;
62 i->index += sizeof(xcb_input_device_id_t);
65 xcb_generic_iterator_t
66 xcb_input_device_id_end (xcb_input_device_id_iterator_t i /**< */)
68 xcb_generic_iterator_t ret;
69 ret.data = i.data + i.rem;
70 ret.index = i.index + ((char *) ret.data - (char *) i.data);
71 ret.rem = 0;
72 return ret;
75 void
76 xcb_input_fp1616_next (xcb_input_fp1616_iterator_t *i /**< */)
78 --i->rem;
79 ++i->data;
80 i->index += sizeof(xcb_input_fp1616_t);
83 xcb_generic_iterator_t
84 xcb_input_fp1616_end (xcb_input_fp1616_iterator_t i /**< */)
86 xcb_generic_iterator_t ret;
87 ret.data = i.data + i.rem;
88 ret.index = i.index + ((char *) ret.data - (char *) i.data);
89 ret.rem = 0;
90 return ret;
93 void
94 xcb_input_fp3232_next (xcb_input_fp3232_iterator_t *i /**< */)
96 --i->rem;
97 ++i->data;
98 i->index += sizeof(xcb_input_fp3232_t);
101 xcb_generic_iterator_t
102 xcb_input_fp3232_end (xcb_input_fp3232_iterator_t i /**< */)
104 xcb_generic_iterator_t ret;
105 ret.data = i.data + i.rem;
106 ret.index = i.index + ((char *) ret.data - (char *) i.data);
107 ret.rem = 0;
108 return ret;
112 xcb_input_get_extension_version_sizeof (const void *_buffer /**< */)
114 char *xcb_tmp = (char *)_buffer;
115 const xcb_input_get_extension_version_request_t *_aux = (xcb_input_get_extension_version_request_t *)_buffer;
116 unsigned int xcb_buffer_len = 0;
117 unsigned int xcb_block_len = 0;
118 unsigned int xcb_pad = 0;
119 unsigned int xcb_align_to = 0;
122 xcb_block_len += sizeof(xcb_input_get_extension_version_request_t);
123 xcb_tmp += xcb_block_len;
124 xcb_buffer_len += xcb_block_len;
125 xcb_block_len = 0;
126 /* name */
127 xcb_block_len += _aux->name_len * sizeof(char);
128 xcb_tmp += xcb_block_len;
129 xcb_align_to = ALIGNOF(char);
130 /* insert padding */
131 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
132 xcb_buffer_len += xcb_block_len + xcb_pad;
133 if (0 != xcb_pad) {
134 xcb_tmp += xcb_pad;
135 xcb_pad = 0;
137 xcb_block_len = 0;
139 return xcb_buffer_len;
142 xcb_input_get_extension_version_cookie_t
143 xcb_input_get_extension_version (xcb_connection_t *c /**< */,
144 uint16_t name_len /**< */,
145 const char *name /**< */)
147 static const xcb_protocol_request_t xcb_req = {
148 /* count */ 4,
149 /* ext */ &xcb_input_id,
150 /* opcode */ XCB_INPUT_GET_EXTENSION_VERSION,
151 /* isvoid */ 0
154 struct iovec xcb_parts[6];
155 xcb_input_get_extension_version_cookie_t xcb_ret;
156 xcb_input_get_extension_version_request_t xcb_out;
158 xcb_out.name_len = name_len;
159 memset(xcb_out.pad0, 0, 2);
161 xcb_parts[2].iov_base = (char *) &xcb_out;
162 xcb_parts[2].iov_len = sizeof(xcb_out);
163 xcb_parts[3].iov_base = 0;
164 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
165 /* char name */
166 xcb_parts[4].iov_base = (char *) name;
167 xcb_parts[4].iov_len = name_len * sizeof(char);
168 xcb_parts[5].iov_base = 0;
169 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
171 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
172 return xcb_ret;
175 xcb_input_get_extension_version_cookie_t
176 xcb_input_get_extension_version_unchecked (xcb_connection_t *c /**< */,
177 uint16_t name_len /**< */,
178 const char *name /**< */)
180 static const xcb_protocol_request_t xcb_req = {
181 /* count */ 4,
182 /* ext */ &xcb_input_id,
183 /* opcode */ XCB_INPUT_GET_EXTENSION_VERSION,
184 /* isvoid */ 0
187 struct iovec xcb_parts[6];
188 xcb_input_get_extension_version_cookie_t xcb_ret;
189 xcb_input_get_extension_version_request_t xcb_out;
191 xcb_out.name_len = name_len;
192 memset(xcb_out.pad0, 0, 2);
194 xcb_parts[2].iov_base = (char *) &xcb_out;
195 xcb_parts[2].iov_len = sizeof(xcb_out);
196 xcb_parts[3].iov_base = 0;
197 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
198 /* char name */
199 xcb_parts[4].iov_base = (char *) name;
200 xcb_parts[4].iov_len = name_len * sizeof(char);
201 xcb_parts[5].iov_base = 0;
202 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
204 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
205 return xcb_ret;
208 xcb_input_get_extension_version_reply_t *
209 xcb_input_get_extension_version_reply (xcb_connection_t *c /**< */,
210 xcb_input_get_extension_version_cookie_t cookie /**< */,
211 xcb_generic_error_t **e /**< */)
213 return (xcb_input_get_extension_version_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
216 void
217 xcb_input_device_info_next (xcb_input_device_info_iterator_t *i /**< */)
219 --i->rem;
220 ++i->data;
221 i->index += sizeof(xcb_input_device_info_t);
224 xcb_generic_iterator_t
225 xcb_input_device_info_end (xcb_input_device_info_iterator_t i /**< */)
227 xcb_generic_iterator_t ret;
228 ret.data = i.data + i.rem;
229 ret.index = i.index + ((char *) ret.data - (char *) i.data);
230 ret.rem = 0;
231 return ret;
234 void
235 xcb_input_key_info_next (xcb_input_key_info_iterator_t *i /**< */)
237 --i->rem;
238 ++i->data;
239 i->index += sizeof(xcb_input_key_info_t);
242 xcb_generic_iterator_t
243 xcb_input_key_info_end (xcb_input_key_info_iterator_t i /**< */)
245 xcb_generic_iterator_t ret;
246 ret.data = i.data + i.rem;
247 ret.index = i.index + ((char *) ret.data - (char *) i.data);
248 ret.rem = 0;
249 return ret;
252 void
253 xcb_input_button_info_next (xcb_input_button_info_iterator_t *i /**< */)
255 --i->rem;
256 ++i->data;
257 i->index += sizeof(xcb_input_button_info_t);
260 xcb_generic_iterator_t
261 xcb_input_button_info_end (xcb_input_button_info_iterator_t i /**< */)
263 xcb_generic_iterator_t ret;
264 ret.data = i.data + i.rem;
265 ret.index = i.index + ((char *) ret.data - (char *) i.data);
266 ret.rem = 0;
267 return ret;
270 void
271 xcb_input_axis_info_next (xcb_input_axis_info_iterator_t *i /**< */)
273 --i->rem;
274 ++i->data;
275 i->index += sizeof(xcb_input_axis_info_t);
278 xcb_generic_iterator_t
279 xcb_input_axis_info_end (xcb_input_axis_info_iterator_t i /**< */)
281 xcb_generic_iterator_t ret;
282 ret.data = i.data + i.rem;
283 ret.index = i.index + ((char *) ret.data - (char *) i.data);
284 ret.rem = 0;
285 return ret;
289 xcb_input_valuator_info_sizeof (const void *_buffer /**< */)
291 char *xcb_tmp = (char *)_buffer;
292 const xcb_input_valuator_info_t *_aux = (xcb_input_valuator_info_t *)_buffer;
293 unsigned int xcb_buffer_len = 0;
294 unsigned int xcb_block_len = 0;
295 unsigned int xcb_pad = 0;
296 unsigned int xcb_align_to = 0;
299 xcb_block_len += sizeof(xcb_input_valuator_info_t);
300 xcb_tmp += xcb_block_len;
301 xcb_buffer_len += xcb_block_len;
302 xcb_block_len = 0;
303 /* axes */
304 xcb_block_len += _aux->axes_len * sizeof(xcb_input_axis_info_t);
305 xcb_tmp += xcb_block_len;
306 xcb_align_to = ALIGNOF(xcb_input_axis_info_t);
307 /* insert padding */
308 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
309 xcb_buffer_len += xcb_block_len + xcb_pad;
310 if (0 != xcb_pad) {
311 xcb_tmp += xcb_pad;
312 xcb_pad = 0;
314 xcb_block_len = 0;
316 return xcb_buffer_len;
319 xcb_input_axis_info_t *
320 xcb_input_valuator_info_axes (const xcb_input_valuator_info_t *R /**< */)
322 return (xcb_input_axis_info_t *) (R + 1);
326 xcb_input_valuator_info_axes_length (const xcb_input_valuator_info_t *R /**< */)
328 return R->axes_len;
331 xcb_input_axis_info_iterator_t
332 xcb_input_valuator_info_axes_iterator (const xcb_input_valuator_info_t *R /**< */)
334 xcb_input_axis_info_iterator_t i;
335 i.data = (xcb_input_axis_info_t *) (R + 1);
336 i.rem = R->axes_len;
337 i.index = (char *) i.data - (char *) R;
338 return i;
341 void
342 xcb_input_valuator_info_next (xcb_input_valuator_info_iterator_t *i /**< */)
344 xcb_input_valuator_info_t *R = i->data;
345 xcb_generic_iterator_t child;
346 child.data = (xcb_input_valuator_info_t *)(((char *)R) + xcb_input_valuator_info_sizeof(R));
347 i->index = (char *) child.data - (char *) i->data;
348 --i->rem;
349 i->data = (xcb_input_valuator_info_t *) child.data;
352 xcb_generic_iterator_t
353 xcb_input_valuator_info_end (xcb_input_valuator_info_iterator_t i /**< */)
355 xcb_generic_iterator_t ret;
356 while(i.rem > 0)
357 xcb_input_valuator_info_next(&i);
358 ret.data = i.data;
359 ret.rem = i.rem;
360 ret.index = i.index;
361 return ret;
364 void
365 xcb_input_input_info_next (xcb_input_input_info_iterator_t *i /**< */)
367 --i->rem;
368 ++i->data;
369 i->index += sizeof(xcb_input_input_info_t);
372 xcb_generic_iterator_t
373 xcb_input_input_info_end (xcb_input_input_info_iterator_t i /**< */)
375 xcb_generic_iterator_t ret;
376 ret.data = i.data + i.rem;
377 ret.index = i.index + ((char *) ret.data - (char *) i.data);
378 ret.rem = 0;
379 return ret;
383 xcb_input_device_name_sizeof (const void *_buffer /**< */)
385 char *xcb_tmp = (char *)_buffer;
386 const xcb_input_device_name_t *_aux = (xcb_input_device_name_t *)_buffer;
387 unsigned int xcb_buffer_len = 0;
388 unsigned int xcb_block_len = 0;
389 unsigned int xcb_pad = 0;
390 unsigned int xcb_align_to = 0;
393 xcb_block_len += sizeof(xcb_input_device_name_t);
394 xcb_tmp += xcb_block_len;
395 xcb_buffer_len += xcb_block_len;
396 xcb_block_len = 0;
397 /* string */
398 xcb_block_len += _aux->len * sizeof(char);
399 xcb_tmp += xcb_block_len;
400 xcb_align_to = ALIGNOF(char);
401 /* insert padding */
402 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
403 xcb_buffer_len += xcb_block_len + xcb_pad;
404 if (0 != xcb_pad) {
405 xcb_tmp += xcb_pad;
406 xcb_pad = 0;
408 xcb_block_len = 0;
410 return xcb_buffer_len;
413 char *
414 xcb_input_device_name_string (const xcb_input_device_name_t *R /**< */)
416 return (char *) (R + 1);
420 xcb_input_device_name_string_length (const xcb_input_device_name_t *R /**< */)
422 return R->len;
425 xcb_generic_iterator_t
426 xcb_input_device_name_string_end (const xcb_input_device_name_t *R /**< */)
428 xcb_generic_iterator_t i;
429 i.data = ((char *) (R + 1)) + (R->len);
430 i.rem = 0;
431 i.index = (char *) i.data - (char *) R;
432 return i;
435 void
436 xcb_input_device_name_next (xcb_input_device_name_iterator_t *i /**< */)
438 xcb_input_device_name_t *R = i->data;
439 xcb_generic_iterator_t child;
440 child.data = (xcb_input_device_name_t *)(((char *)R) + xcb_input_device_name_sizeof(R));
441 i->index = (char *) child.data - (char *) i->data;
442 --i->rem;
443 i->data = (xcb_input_device_name_t *) child.data;
446 xcb_generic_iterator_t
447 xcb_input_device_name_end (xcb_input_device_name_iterator_t i /**< */)
449 xcb_generic_iterator_t ret;
450 while(i.rem > 0)
451 xcb_input_device_name_next(&i);
452 ret.data = i.data;
453 ret.rem = i.rem;
454 ret.index = i.index;
455 return ret;
459 xcb_input_list_input_devices_sizeof (const void *_buffer /**< */)
461 char *xcb_tmp = (char *)_buffer;
462 const xcb_input_list_input_devices_reply_t *_aux = (xcb_input_list_input_devices_reply_t *)_buffer;
463 unsigned int xcb_buffer_len = 0;
464 unsigned int xcb_block_len = 0;
465 unsigned int xcb_pad = 0;
466 unsigned int xcb_align_to = 0;
469 xcb_block_len += sizeof(xcb_input_list_input_devices_reply_t);
470 xcb_tmp += xcb_block_len;
471 xcb_buffer_len += xcb_block_len;
472 xcb_block_len = 0;
473 /* devices */
474 xcb_block_len += _aux->devices_len * sizeof(xcb_input_device_info_t);
475 xcb_tmp += xcb_block_len;
476 xcb_align_to = ALIGNOF(xcb_input_device_info_t);
477 /* insert padding */
478 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
479 xcb_buffer_len += xcb_block_len + xcb_pad;
480 if (0 != xcb_pad) {
481 xcb_tmp += xcb_pad;
482 xcb_pad = 0;
484 xcb_block_len = 0;
486 return xcb_buffer_len;
489 xcb_input_list_input_devices_cookie_t
490 xcb_input_list_input_devices (xcb_connection_t *c /**< */)
492 static const xcb_protocol_request_t xcb_req = {
493 /* count */ 2,
494 /* ext */ &xcb_input_id,
495 /* opcode */ XCB_INPUT_LIST_INPUT_DEVICES,
496 /* isvoid */ 0
499 struct iovec xcb_parts[4];
500 xcb_input_list_input_devices_cookie_t xcb_ret;
501 xcb_input_list_input_devices_request_t xcb_out;
504 xcb_parts[2].iov_base = (char *) &xcb_out;
505 xcb_parts[2].iov_len = sizeof(xcb_out);
506 xcb_parts[3].iov_base = 0;
507 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
509 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
510 return xcb_ret;
513 xcb_input_list_input_devices_cookie_t
514 xcb_input_list_input_devices_unchecked (xcb_connection_t *c /**< */)
516 static const xcb_protocol_request_t xcb_req = {
517 /* count */ 2,
518 /* ext */ &xcb_input_id,
519 /* opcode */ XCB_INPUT_LIST_INPUT_DEVICES,
520 /* isvoid */ 0
523 struct iovec xcb_parts[4];
524 xcb_input_list_input_devices_cookie_t xcb_ret;
525 xcb_input_list_input_devices_request_t xcb_out;
528 xcb_parts[2].iov_base = (char *) &xcb_out;
529 xcb_parts[2].iov_len = sizeof(xcb_out);
530 xcb_parts[3].iov_base = 0;
531 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
533 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
534 return xcb_ret;
537 xcb_input_device_info_t *
538 xcb_input_list_input_devices_devices (const xcb_input_list_input_devices_reply_t *R /**< */)
540 return (xcb_input_device_info_t *) (R + 1);
544 xcb_input_list_input_devices_devices_length (const xcb_input_list_input_devices_reply_t *R /**< */)
546 return R->devices_len;
549 xcb_input_device_info_iterator_t
550 xcb_input_list_input_devices_devices_iterator (const xcb_input_list_input_devices_reply_t *R /**< */)
552 xcb_input_device_info_iterator_t i;
553 i.data = (xcb_input_device_info_t *) (R + 1);
554 i.rem = R->devices_len;
555 i.index = (char *) i.data - (char *) R;
556 return i;
559 xcb_input_list_input_devices_reply_t *
560 xcb_input_list_input_devices_reply (xcb_connection_t *c /**< */,
561 xcb_input_list_input_devices_cookie_t cookie /**< */,
562 xcb_generic_error_t **e /**< */)
564 return (xcb_input_list_input_devices_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
567 void
568 xcb_input_input_class_info_next (xcb_input_input_class_info_iterator_t *i /**< */)
570 --i->rem;
571 ++i->data;
572 i->index += sizeof(xcb_input_input_class_info_t);
575 xcb_generic_iterator_t
576 xcb_input_input_class_info_end (xcb_input_input_class_info_iterator_t i /**< */)
578 xcb_generic_iterator_t ret;
579 ret.data = i.data + i.rem;
580 ret.index = i.index + ((char *) ret.data - (char *) i.data);
581 ret.rem = 0;
582 return ret;
586 xcb_input_open_device_sizeof (const void *_buffer /**< */)
588 char *xcb_tmp = (char *)_buffer;
589 const xcb_input_open_device_reply_t *_aux = (xcb_input_open_device_reply_t *)_buffer;
590 unsigned int xcb_buffer_len = 0;
591 unsigned int xcb_block_len = 0;
592 unsigned int xcb_pad = 0;
593 unsigned int xcb_align_to = 0;
596 xcb_block_len += sizeof(xcb_input_open_device_reply_t);
597 xcb_tmp += xcb_block_len;
598 xcb_buffer_len += xcb_block_len;
599 xcb_block_len = 0;
600 /* class_info */
601 xcb_block_len += _aux->num_classes * sizeof(xcb_input_input_class_info_t);
602 xcb_tmp += xcb_block_len;
603 xcb_align_to = ALIGNOF(xcb_input_input_class_info_t);
604 /* insert padding */
605 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
606 xcb_buffer_len += xcb_block_len + xcb_pad;
607 if (0 != xcb_pad) {
608 xcb_tmp += xcb_pad;
609 xcb_pad = 0;
611 xcb_block_len = 0;
613 return xcb_buffer_len;
616 xcb_input_open_device_cookie_t
617 xcb_input_open_device (xcb_connection_t *c /**< */,
618 uint8_t device_id /**< */)
620 static const xcb_protocol_request_t xcb_req = {
621 /* count */ 2,
622 /* ext */ &xcb_input_id,
623 /* opcode */ XCB_INPUT_OPEN_DEVICE,
624 /* isvoid */ 0
627 struct iovec xcb_parts[4];
628 xcb_input_open_device_cookie_t xcb_ret;
629 xcb_input_open_device_request_t xcb_out;
631 xcb_out.device_id = device_id;
632 memset(xcb_out.pad0, 0, 3);
634 xcb_parts[2].iov_base = (char *) &xcb_out;
635 xcb_parts[2].iov_len = sizeof(xcb_out);
636 xcb_parts[3].iov_base = 0;
637 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
639 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
640 return xcb_ret;
643 xcb_input_open_device_cookie_t
644 xcb_input_open_device_unchecked (xcb_connection_t *c /**< */,
645 uint8_t device_id /**< */)
647 static const xcb_protocol_request_t xcb_req = {
648 /* count */ 2,
649 /* ext */ &xcb_input_id,
650 /* opcode */ XCB_INPUT_OPEN_DEVICE,
651 /* isvoid */ 0
654 struct iovec xcb_parts[4];
655 xcb_input_open_device_cookie_t xcb_ret;
656 xcb_input_open_device_request_t xcb_out;
658 xcb_out.device_id = device_id;
659 memset(xcb_out.pad0, 0, 3);
661 xcb_parts[2].iov_base = (char *) &xcb_out;
662 xcb_parts[2].iov_len = sizeof(xcb_out);
663 xcb_parts[3].iov_base = 0;
664 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
666 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
667 return xcb_ret;
670 xcb_input_input_class_info_t *
671 xcb_input_open_device_class_info (const xcb_input_open_device_reply_t *R /**< */)
673 return (xcb_input_input_class_info_t *) (R + 1);
677 xcb_input_open_device_class_info_length (const xcb_input_open_device_reply_t *R /**< */)
679 return R->num_classes;
682 xcb_input_input_class_info_iterator_t
683 xcb_input_open_device_class_info_iterator (const xcb_input_open_device_reply_t *R /**< */)
685 xcb_input_input_class_info_iterator_t i;
686 i.data = (xcb_input_input_class_info_t *) (R + 1);
687 i.rem = R->num_classes;
688 i.index = (char *) i.data - (char *) R;
689 return i;
692 xcb_input_open_device_reply_t *
693 xcb_input_open_device_reply (xcb_connection_t *c /**< */,
694 xcb_input_open_device_cookie_t cookie /**< */,
695 xcb_generic_error_t **e /**< */)
697 return (xcb_input_open_device_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
700 xcb_void_cookie_t
701 xcb_input_close_device_checked (xcb_connection_t *c /**< */,
702 uint8_t device_id /**< */)
704 static const xcb_protocol_request_t xcb_req = {
705 /* count */ 2,
706 /* ext */ &xcb_input_id,
707 /* opcode */ XCB_INPUT_CLOSE_DEVICE,
708 /* isvoid */ 1
711 struct iovec xcb_parts[4];
712 xcb_void_cookie_t xcb_ret;
713 xcb_input_close_device_request_t xcb_out;
715 xcb_out.device_id = device_id;
716 memset(xcb_out.pad0, 0, 3);
718 xcb_parts[2].iov_base = (char *) &xcb_out;
719 xcb_parts[2].iov_len = sizeof(xcb_out);
720 xcb_parts[3].iov_base = 0;
721 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
723 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
724 return xcb_ret;
727 xcb_void_cookie_t
728 xcb_input_close_device (xcb_connection_t *c /**< */,
729 uint8_t device_id /**< */)
731 static const xcb_protocol_request_t xcb_req = {
732 /* count */ 2,
733 /* ext */ &xcb_input_id,
734 /* opcode */ XCB_INPUT_CLOSE_DEVICE,
735 /* isvoid */ 1
738 struct iovec xcb_parts[4];
739 xcb_void_cookie_t xcb_ret;
740 xcb_input_close_device_request_t xcb_out;
742 xcb_out.device_id = device_id;
743 memset(xcb_out.pad0, 0, 3);
745 xcb_parts[2].iov_base = (char *) &xcb_out;
746 xcb_parts[2].iov_len = sizeof(xcb_out);
747 xcb_parts[3].iov_base = 0;
748 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
750 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
751 return xcb_ret;
754 xcb_input_set_device_mode_cookie_t
755 xcb_input_set_device_mode (xcb_connection_t *c /**< */,
756 uint8_t device_id /**< */,
757 uint8_t mode /**< */)
759 static const xcb_protocol_request_t xcb_req = {
760 /* count */ 2,
761 /* ext */ &xcb_input_id,
762 /* opcode */ XCB_INPUT_SET_DEVICE_MODE,
763 /* isvoid */ 0
766 struct iovec xcb_parts[4];
767 xcb_input_set_device_mode_cookie_t xcb_ret;
768 xcb_input_set_device_mode_request_t xcb_out;
770 xcb_out.device_id = device_id;
771 xcb_out.mode = mode;
772 memset(xcb_out.pad0, 0, 2);
774 xcb_parts[2].iov_base = (char *) &xcb_out;
775 xcb_parts[2].iov_len = sizeof(xcb_out);
776 xcb_parts[3].iov_base = 0;
777 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
779 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
780 return xcb_ret;
783 xcb_input_set_device_mode_cookie_t
784 xcb_input_set_device_mode_unchecked (xcb_connection_t *c /**< */,
785 uint8_t device_id /**< */,
786 uint8_t mode /**< */)
788 static const xcb_protocol_request_t xcb_req = {
789 /* count */ 2,
790 /* ext */ &xcb_input_id,
791 /* opcode */ XCB_INPUT_SET_DEVICE_MODE,
792 /* isvoid */ 0
795 struct iovec xcb_parts[4];
796 xcb_input_set_device_mode_cookie_t xcb_ret;
797 xcb_input_set_device_mode_request_t xcb_out;
799 xcb_out.device_id = device_id;
800 xcb_out.mode = mode;
801 memset(xcb_out.pad0, 0, 2);
803 xcb_parts[2].iov_base = (char *) &xcb_out;
804 xcb_parts[2].iov_len = sizeof(xcb_out);
805 xcb_parts[3].iov_base = 0;
806 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
808 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
809 return xcb_ret;
812 xcb_input_set_device_mode_reply_t *
813 xcb_input_set_device_mode_reply (xcb_connection_t *c /**< */,
814 xcb_input_set_device_mode_cookie_t cookie /**< */,
815 xcb_generic_error_t **e /**< */)
817 return (xcb_input_set_device_mode_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
821 xcb_input_select_extension_event_sizeof (const void *_buffer /**< */)
823 char *xcb_tmp = (char *)_buffer;
824 const xcb_input_select_extension_event_request_t *_aux = (xcb_input_select_extension_event_request_t *)_buffer;
825 unsigned int xcb_buffer_len = 0;
826 unsigned int xcb_block_len = 0;
827 unsigned int xcb_pad = 0;
828 unsigned int xcb_align_to = 0;
831 xcb_block_len += sizeof(xcb_input_select_extension_event_request_t);
832 xcb_tmp += xcb_block_len;
833 xcb_buffer_len += xcb_block_len;
834 xcb_block_len = 0;
835 /* classes */
836 xcb_block_len += _aux->num_classes * sizeof(xcb_input_event_class_t);
837 xcb_tmp += xcb_block_len;
838 xcb_align_to = ALIGNOF(xcb_input_event_class_t);
839 /* insert padding */
840 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
841 xcb_buffer_len += xcb_block_len + xcb_pad;
842 if (0 != xcb_pad) {
843 xcb_tmp += xcb_pad;
844 xcb_pad = 0;
846 xcb_block_len = 0;
848 return xcb_buffer_len;
851 xcb_void_cookie_t
852 xcb_input_select_extension_event_checked (xcb_connection_t *c /**< */,
853 xcb_window_t window /**< */,
854 uint16_t num_classes /**< */,
855 const xcb_input_event_class_t *classes /**< */)
857 static const xcb_protocol_request_t xcb_req = {
858 /* count */ 4,
859 /* ext */ &xcb_input_id,
860 /* opcode */ XCB_INPUT_SELECT_EXTENSION_EVENT,
861 /* isvoid */ 1
864 struct iovec xcb_parts[6];
865 xcb_void_cookie_t xcb_ret;
866 xcb_input_select_extension_event_request_t xcb_out;
868 xcb_out.window = window;
869 xcb_out.num_classes = num_classes;
870 memset(xcb_out.pad0, 0, 2);
872 xcb_parts[2].iov_base = (char *) &xcb_out;
873 xcb_parts[2].iov_len = sizeof(xcb_out);
874 xcb_parts[3].iov_base = 0;
875 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
876 /* xcb_input_event_class_t classes */
877 xcb_parts[4].iov_base = (char *) classes;
878 xcb_parts[4].iov_len = num_classes * sizeof(xcb_input_event_class_t);
879 xcb_parts[5].iov_base = 0;
880 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
882 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
883 return xcb_ret;
886 xcb_void_cookie_t
887 xcb_input_select_extension_event (xcb_connection_t *c /**< */,
888 xcb_window_t window /**< */,
889 uint16_t num_classes /**< */,
890 const xcb_input_event_class_t *classes /**< */)
892 static const xcb_protocol_request_t xcb_req = {
893 /* count */ 4,
894 /* ext */ &xcb_input_id,
895 /* opcode */ XCB_INPUT_SELECT_EXTENSION_EVENT,
896 /* isvoid */ 1
899 struct iovec xcb_parts[6];
900 xcb_void_cookie_t xcb_ret;
901 xcb_input_select_extension_event_request_t xcb_out;
903 xcb_out.window = window;
904 xcb_out.num_classes = num_classes;
905 memset(xcb_out.pad0, 0, 2);
907 xcb_parts[2].iov_base = (char *) &xcb_out;
908 xcb_parts[2].iov_len = sizeof(xcb_out);
909 xcb_parts[3].iov_base = 0;
910 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
911 /* xcb_input_event_class_t classes */
912 xcb_parts[4].iov_base = (char *) classes;
913 xcb_parts[4].iov_len = num_classes * sizeof(xcb_input_event_class_t);
914 xcb_parts[5].iov_base = 0;
915 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
917 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
918 return xcb_ret;
922 xcb_input_get_selected_extension_events_sizeof (const void *_buffer /**< */)
924 char *xcb_tmp = (char *)_buffer;
925 const xcb_input_get_selected_extension_events_reply_t *_aux = (xcb_input_get_selected_extension_events_reply_t *)_buffer;
926 unsigned int xcb_buffer_len = 0;
927 unsigned int xcb_block_len = 0;
928 unsigned int xcb_pad = 0;
929 unsigned int xcb_align_to = 0;
932 xcb_block_len += sizeof(xcb_input_get_selected_extension_events_reply_t);
933 xcb_tmp += xcb_block_len;
934 xcb_buffer_len += xcb_block_len;
935 xcb_block_len = 0;
936 /* this_classes */
937 xcb_block_len += _aux->num_this_classes * sizeof(xcb_input_event_class_t);
938 xcb_tmp += xcb_block_len;
939 xcb_align_to = ALIGNOF(xcb_input_event_class_t);
940 /* insert padding */
941 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
942 xcb_buffer_len += xcb_block_len + xcb_pad;
943 if (0 != xcb_pad) {
944 xcb_tmp += xcb_pad;
945 xcb_pad = 0;
947 xcb_block_len = 0;
948 /* all_classes */
949 xcb_block_len += _aux->num_all_classes * sizeof(xcb_input_event_class_t);
950 xcb_tmp += xcb_block_len;
951 xcb_align_to = ALIGNOF(xcb_input_event_class_t);
952 /* insert padding */
953 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
954 xcb_buffer_len += xcb_block_len + xcb_pad;
955 if (0 != xcb_pad) {
956 xcb_tmp += xcb_pad;
957 xcb_pad = 0;
959 xcb_block_len = 0;
961 return xcb_buffer_len;
964 xcb_input_get_selected_extension_events_cookie_t
965 xcb_input_get_selected_extension_events (xcb_connection_t *c /**< */,
966 xcb_window_t window /**< */)
968 static const xcb_protocol_request_t xcb_req = {
969 /* count */ 2,
970 /* ext */ &xcb_input_id,
971 /* opcode */ XCB_INPUT_GET_SELECTED_EXTENSION_EVENTS,
972 /* isvoid */ 0
975 struct iovec xcb_parts[4];
976 xcb_input_get_selected_extension_events_cookie_t xcb_ret;
977 xcb_input_get_selected_extension_events_request_t xcb_out;
979 xcb_out.window = window;
981 xcb_parts[2].iov_base = (char *) &xcb_out;
982 xcb_parts[2].iov_len = sizeof(xcb_out);
983 xcb_parts[3].iov_base = 0;
984 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
986 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
987 return xcb_ret;
990 xcb_input_get_selected_extension_events_cookie_t
991 xcb_input_get_selected_extension_events_unchecked (xcb_connection_t *c /**< */,
992 xcb_window_t window /**< */)
994 static const xcb_protocol_request_t xcb_req = {
995 /* count */ 2,
996 /* ext */ &xcb_input_id,
997 /* opcode */ XCB_INPUT_GET_SELECTED_EXTENSION_EVENTS,
998 /* isvoid */ 0
1001 struct iovec xcb_parts[4];
1002 xcb_input_get_selected_extension_events_cookie_t xcb_ret;
1003 xcb_input_get_selected_extension_events_request_t xcb_out;
1005 xcb_out.window = window;
1007 xcb_parts[2].iov_base = (char *) &xcb_out;
1008 xcb_parts[2].iov_len = sizeof(xcb_out);
1009 xcb_parts[3].iov_base = 0;
1010 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1012 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1013 return xcb_ret;
1016 xcb_input_event_class_t *
1017 xcb_input_get_selected_extension_events_this_classes (const xcb_input_get_selected_extension_events_reply_t *R /**< */)
1019 return (xcb_input_event_class_t *) (R + 1);
1023 xcb_input_get_selected_extension_events_this_classes_length (const xcb_input_get_selected_extension_events_reply_t *R /**< */)
1025 return R->num_this_classes;
1028 xcb_generic_iterator_t
1029 xcb_input_get_selected_extension_events_this_classes_end (const xcb_input_get_selected_extension_events_reply_t *R /**< */)
1031 xcb_generic_iterator_t i;
1032 i.data = ((xcb_input_event_class_t *) (R + 1)) + (R->num_this_classes);
1033 i.rem = 0;
1034 i.index = (char *) i.data - (char *) R;
1035 return i;
1038 xcb_input_event_class_t *
1039 xcb_input_get_selected_extension_events_all_classes (const xcb_input_get_selected_extension_events_reply_t *R /**< */)
1041 xcb_generic_iterator_t prev = xcb_input_get_selected_extension_events_this_classes_end(R);
1042 return (xcb_input_event_class_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_input_event_class_t, prev.index) + 0);
1046 xcb_input_get_selected_extension_events_all_classes_length (const xcb_input_get_selected_extension_events_reply_t *R /**< */)
1048 return R->num_all_classes;
1051 xcb_generic_iterator_t
1052 xcb_input_get_selected_extension_events_all_classes_end (const xcb_input_get_selected_extension_events_reply_t *R /**< */)
1054 xcb_generic_iterator_t i;
1055 xcb_generic_iterator_t child = xcb_input_get_selected_extension_events_this_classes_end(R);
1056 i.data = ((xcb_input_event_class_t *) child.data) + (R->num_all_classes);
1057 i.rem = 0;
1058 i.index = (char *) i.data - (char *) R;
1059 return i;
1062 xcb_input_get_selected_extension_events_reply_t *
1063 xcb_input_get_selected_extension_events_reply (xcb_connection_t *c /**< */,
1064 xcb_input_get_selected_extension_events_cookie_t cookie /**< */,
1065 xcb_generic_error_t **e /**< */)
1067 return (xcb_input_get_selected_extension_events_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1071 xcb_input_change_device_dont_propagate_list_sizeof (const void *_buffer /**< */)
1073 char *xcb_tmp = (char *)_buffer;
1074 const xcb_input_change_device_dont_propagate_list_request_t *_aux = (xcb_input_change_device_dont_propagate_list_request_t *)_buffer;
1075 unsigned int xcb_buffer_len = 0;
1076 unsigned int xcb_block_len = 0;
1077 unsigned int xcb_pad = 0;
1078 unsigned int xcb_align_to = 0;
1081 xcb_block_len += sizeof(xcb_input_change_device_dont_propagate_list_request_t);
1082 xcb_tmp += xcb_block_len;
1083 xcb_buffer_len += xcb_block_len;
1084 xcb_block_len = 0;
1085 /* classes */
1086 xcb_block_len += _aux->num_classes * sizeof(xcb_input_event_class_t);
1087 xcb_tmp += xcb_block_len;
1088 xcb_align_to = ALIGNOF(xcb_input_event_class_t);
1089 /* insert padding */
1090 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1091 xcb_buffer_len += xcb_block_len + xcb_pad;
1092 if (0 != xcb_pad) {
1093 xcb_tmp += xcb_pad;
1094 xcb_pad = 0;
1096 xcb_block_len = 0;
1098 return xcb_buffer_len;
1101 xcb_void_cookie_t
1102 xcb_input_change_device_dont_propagate_list_checked (xcb_connection_t *c /**< */,
1103 xcb_window_t window /**< */,
1104 uint16_t num_classes /**< */,
1105 uint8_t mode /**< */,
1106 const xcb_input_event_class_t *classes /**< */)
1108 static const xcb_protocol_request_t xcb_req = {
1109 /* count */ 4,
1110 /* ext */ &xcb_input_id,
1111 /* opcode */ XCB_INPUT_CHANGE_DEVICE_DONT_PROPAGATE_LIST,
1112 /* isvoid */ 1
1115 struct iovec xcb_parts[6];
1116 xcb_void_cookie_t xcb_ret;
1117 xcb_input_change_device_dont_propagate_list_request_t xcb_out;
1119 xcb_out.window = window;
1120 xcb_out.num_classes = num_classes;
1121 xcb_out.mode = mode;
1122 xcb_out.pad0 = 0;
1124 xcb_parts[2].iov_base = (char *) &xcb_out;
1125 xcb_parts[2].iov_len = sizeof(xcb_out);
1126 xcb_parts[3].iov_base = 0;
1127 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1128 /* xcb_input_event_class_t classes */
1129 xcb_parts[4].iov_base = (char *) classes;
1130 xcb_parts[4].iov_len = num_classes * sizeof(xcb_input_event_class_t);
1131 xcb_parts[5].iov_base = 0;
1132 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1134 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1135 return xcb_ret;
1138 xcb_void_cookie_t
1139 xcb_input_change_device_dont_propagate_list (xcb_connection_t *c /**< */,
1140 xcb_window_t window /**< */,
1141 uint16_t num_classes /**< */,
1142 uint8_t mode /**< */,
1143 const xcb_input_event_class_t *classes /**< */)
1145 static const xcb_protocol_request_t xcb_req = {
1146 /* count */ 4,
1147 /* ext */ &xcb_input_id,
1148 /* opcode */ XCB_INPUT_CHANGE_DEVICE_DONT_PROPAGATE_LIST,
1149 /* isvoid */ 1
1152 struct iovec xcb_parts[6];
1153 xcb_void_cookie_t xcb_ret;
1154 xcb_input_change_device_dont_propagate_list_request_t xcb_out;
1156 xcb_out.window = window;
1157 xcb_out.num_classes = num_classes;
1158 xcb_out.mode = mode;
1159 xcb_out.pad0 = 0;
1161 xcb_parts[2].iov_base = (char *) &xcb_out;
1162 xcb_parts[2].iov_len = sizeof(xcb_out);
1163 xcb_parts[3].iov_base = 0;
1164 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1165 /* xcb_input_event_class_t classes */
1166 xcb_parts[4].iov_base = (char *) classes;
1167 xcb_parts[4].iov_len = num_classes * sizeof(xcb_input_event_class_t);
1168 xcb_parts[5].iov_base = 0;
1169 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1171 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1172 return xcb_ret;
1176 xcb_input_get_device_dont_propagate_list_sizeof (const void *_buffer /**< */)
1178 char *xcb_tmp = (char *)_buffer;
1179 const xcb_input_get_device_dont_propagate_list_reply_t *_aux = (xcb_input_get_device_dont_propagate_list_reply_t *)_buffer;
1180 unsigned int xcb_buffer_len = 0;
1181 unsigned int xcb_block_len = 0;
1182 unsigned int xcb_pad = 0;
1183 unsigned int xcb_align_to = 0;
1186 xcb_block_len += sizeof(xcb_input_get_device_dont_propagate_list_reply_t);
1187 xcb_tmp += xcb_block_len;
1188 xcb_buffer_len += xcb_block_len;
1189 xcb_block_len = 0;
1190 /* classes */
1191 xcb_block_len += _aux->num_classes * sizeof(xcb_input_event_class_t);
1192 xcb_tmp += xcb_block_len;
1193 xcb_align_to = ALIGNOF(xcb_input_event_class_t);
1194 /* insert padding */
1195 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1196 xcb_buffer_len += xcb_block_len + xcb_pad;
1197 if (0 != xcb_pad) {
1198 xcb_tmp += xcb_pad;
1199 xcb_pad = 0;
1201 xcb_block_len = 0;
1203 return xcb_buffer_len;
1206 xcb_input_get_device_dont_propagate_list_cookie_t
1207 xcb_input_get_device_dont_propagate_list (xcb_connection_t *c /**< */,
1208 xcb_window_t window /**< */)
1210 static const xcb_protocol_request_t xcb_req = {
1211 /* count */ 2,
1212 /* ext */ &xcb_input_id,
1213 /* opcode */ XCB_INPUT_GET_DEVICE_DONT_PROPAGATE_LIST,
1214 /* isvoid */ 0
1217 struct iovec xcb_parts[4];
1218 xcb_input_get_device_dont_propagate_list_cookie_t xcb_ret;
1219 xcb_input_get_device_dont_propagate_list_request_t xcb_out;
1221 xcb_out.window = window;
1223 xcb_parts[2].iov_base = (char *) &xcb_out;
1224 xcb_parts[2].iov_len = sizeof(xcb_out);
1225 xcb_parts[3].iov_base = 0;
1226 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1228 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1229 return xcb_ret;
1232 xcb_input_get_device_dont_propagate_list_cookie_t
1233 xcb_input_get_device_dont_propagate_list_unchecked (xcb_connection_t *c /**< */,
1234 xcb_window_t window /**< */)
1236 static const xcb_protocol_request_t xcb_req = {
1237 /* count */ 2,
1238 /* ext */ &xcb_input_id,
1239 /* opcode */ XCB_INPUT_GET_DEVICE_DONT_PROPAGATE_LIST,
1240 /* isvoid */ 0
1243 struct iovec xcb_parts[4];
1244 xcb_input_get_device_dont_propagate_list_cookie_t xcb_ret;
1245 xcb_input_get_device_dont_propagate_list_request_t xcb_out;
1247 xcb_out.window = window;
1249 xcb_parts[2].iov_base = (char *) &xcb_out;
1250 xcb_parts[2].iov_len = sizeof(xcb_out);
1251 xcb_parts[3].iov_base = 0;
1252 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1254 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1255 return xcb_ret;
1258 xcb_input_event_class_t *
1259 xcb_input_get_device_dont_propagate_list_classes (const xcb_input_get_device_dont_propagate_list_reply_t *R /**< */)
1261 return (xcb_input_event_class_t *) (R + 1);
1265 xcb_input_get_device_dont_propagate_list_classes_length (const xcb_input_get_device_dont_propagate_list_reply_t *R /**< */)
1267 return R->num_classes;
1270 xcb_generic_iterator_t
1271 xcb_input_get_device_dont_propagate_list_classes_end (const xcb_input_get_device_dont_propagate_list_reply_t *R /**< */)
1273 xcb_generic_iterator_t i;
1274 i.data = ((xcb_input_event_class_t *) (R + 1)) + (R->num_classes);
1275 i.rem = 0;
1276 i.index = (char *) i.data - (char *) R;
1277 return i;
1280 xcb_input_get_device_dont_propagate_list_reply_t *
1281 xcb_input_get_device_dont_propagate_list_reply (xcb_connection_t *c /**< */,
1282 xcb_input_get_device_dont_propagate_list_cookie_t cookie /**< */,
1283 xcb_generic_error_t **e /**< */)
1285 return (xcb_input_get_device_dont_propagate_list_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1288 void
1289 xcb_input_device_time_coord_next (xcb_input_device_time_coord_iterator_t *i /**< */)
1291 --i->rem;
1292 ++i->data;
1293 i->index += sizeof(xcb_input_device_time_coord_t);
1296 xcb_generic_iterator_t
1297 xcb_input_device_time_coord_end (xcb_input_device_time_coord_iterator_t i /**< */)
1299 xcb_generic_iterator_t ret;
1300 ret.data = i.data + i.rem;
1301 ret.index = i.index + ((char *) ret.data - (char *) i.data);
1302 ret.rem = 0;
1303 return ret;
1306 xcb_input_get_device_motion_events_cookie_t
1307 xcb_input_get_device_motion_events (xcb_connection_t *c /**< */,
1308 xcb_timestamp_t start /**< */,
1309 xcb_timestamp_t stop /**< */,
1310 uint8_t device_id /**< */)
1312 static const xcb_protocol_request_t xcb_req = {
1313 /* count */ 2,
1314 /* ext */ &xcb_input_id,
1315 /* opcode */ XCB_INPUT_GET_DEVICE_MOTION_EVENTS,
1316 /* isvoid */ 0
1319 struct iovec xcb_parts[4];
1320 xcb_input_get_device_motion_events_cookie_t xcb_ret;
1321 xcb_input_get_device_motion_events_request_t xcb_out;
1323 xcb_out.start = start;
1324 xcb_out.stop = stop;
1325 xcb_out.device_id = device_id;
1327 xcb_parts[2].iov_base = (char *) &xcb_out;
1328 xcb_parts[2].iov_len = sizeof(xcb_out);
1329 xcb_parts[3].iov_base = 0;
1330 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1332 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1333 return xcb_ret;
1336 xcb_input_get_device_motion_events_cookie_t
1337 xcb_input_get_device_motion_events_unchecked (xcb_connection_t *c /**< */,
1338 xcb_timestamp_t start /**< */,
1339 xcb_timestamp_t stop /**< */,
1340 uint8_t device_id /**< */)
1342 static const xcb_protocol_request_t xcb_req = {
1343 /* count */ 2,
1344 /* ext */ &xcb_input_id,
1345 /* opcode */ XCB_INPUT_GET_DEVICE_MOTION_EVENTS,
1346 /* isvoid */ 0
1349 struct iovec xcb_parts[4];
1350 xcb_input_get_device_motion_events_cookie_t xcb_ret;
1351 xcb_input_get_device_motion_events_request_t xcb_out;
1353 xcb_out.start = start;
1354 xcb_out.stop = stop;
1355 xcb_out.device_id = device_id;
1357 xcb_parts[2].iov_base = (char *) &xcb_out;
1358 xcb_parts[2].iov_len = sizeof(xcb_out);
1359 xcb_parts[3].iov_base = 0;
1360 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1362 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1363 return xcb_ret;
1366 xcb_input_get_device_motion_events_reply_t *
1367 xcb_input_get_device_motion_events_reply (xcb_connection_t *c /**< */,
1368 xcb_input_get_device_motion_events_cookie_t cookie /**< */,
1369 xcb_generic_error_t **e /**< */)
1371 return (xcb_input_get_device_motion_events_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1374 xcb_input_change_keyboard_device_cookie_t
1375 xcb_input_change_keyboard_device (xcb_connection_t *c /**< */,
1376 uint8_t device_id /**< */)
1378 static const xcb_protocol_request_t xcb_req = {
1379 /* count */ 2,
1380 /* ext */ &xcb_input_id,
1381 /* opcode */ XCB_INPUT_CHANGE_KEYBOARD_DEVICE,
1382 /* isvoid */ 0
1385 struct iovec xcb_parts[4];
1386 xcb_input_change_keyboard_device_cookie_t xcb_ret;
1387 xcb_input_change_keyboard_device_request_t xcb_out;
1389 xcb_out.device_id = device_id;
1390 memset(xcb_out.pad0, 0, 3);
1392 xcb_parts[2].iov_base = (char *) &xcb_out;
1393 xcb_parts[2].iov_len = sizeof(xcb_out);
1394 xcb_parts[3].iov_base = 0;
1395 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1397 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1398 return xcb_ret;
1401 xcb_input_change_keyboard_device_cookie_t
1402 xcb_input_change_keyboard_device_unchecked (xcb_connection_t *c /**< */,
1403 uint8_t device_id /**< */)
1405 static const xcb_protocol_request_t xcb_req = {
1406 /* count */ 2,
1407 /* ext */ &xcb_input_id,
1408 /* opcode */ XCB_INPUT_CHANGE_KEYBOARD_DEVICE,
1409 /* isvoid */ 0
1412 struct iovec xcb_parts[4];
1413 xcb_input_change_keyboard_device_cookie_t xcb_ret;
1414 xcb_input_change_keyboard_device_request_t xcb_out;
1416 xcb_out.device_id = device_id;
1417 memset(xcb_out.pad0, 0, 3);
1419 xcb_parts[2].iov_base = (char *) &xcb_out;
1420 xcb_parts[2].iov_len = sizeof(xcb_out);
1421 xcb_parts[3].iov_base = 0;
1422 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1424 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1425 return xcb_ret;
1428 xcb_input_change_keyboard_device_reply_t *
1429 xcb_input_change_keyboard_device_reply (xcb_connection_t *c /**< */,
1430 xcb_input_change_keyboard_device_cookie_t cookie /**< */,
1431 xcb_generic_error_t **e /**< */)
1433 return (xcb_input_change_keyboard_device_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1436 xcb_input_change_pointer_device_cookie_t
1437 xcb_input_change_pointer_device (xcb_connection_t *c /**< */,
1438 uint8_t x_axis /**< */,
1439 uint8_t y_axis /**< */,
1440 uint8_t device_id /**< */)
1442 static const xcb_protocol_request_t xcb_req = {
1443 /* count */ 2,
1444 /* ext */ &xcb_input_id,
1445 /* opcode */ XCB_INPUT_CHANGE_POINTER_DEVICE,
1446 /* isvoid */ 0
1449 struct iovec xcb_parts[4];
1450 xcb_input_change_pointer_device_cookie_t xcb_ret;
1451 xcb_input_change_pointer_device_request_t xcb_out;
1453 xcb_out.x_axis = x_axis;
1454 xcb_out.y_axis = y_axis;
1455 xcb_out.device_id = device_id;
1456 xcb_out.pad0 = 0;
1458 xcb_parts[2].iov_base = (char *) &xcb_out;
1459 xcb_parts[2].iov_len = sizeof(xcb_out);
1460 xcb_parts[3].iov_base = 0;
1461 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1463 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1464 return xcb_ret;
1467 xcb_input_change_pointer_device_cookie_t
1468 xcb_input_change_pointer_device_unchecked (xcb_connection_t *c /**< */,
1469 uint8_t x_axis /**< */,
1470 uint8_t y_axis /**< */,
1471 uint8_t device_id /**< */)
1473 static const xcb_protocol_request_t xcb_req = {
1474 /* count */ 2,
1475 /* ext */ &xcb_input_id,
1476 /* opcode */ XCB_INPUT_CHANGE_POINTER_DEVICE,
1477 /* isvoid */ 0
1480 struct iovec xcb_parts[4];
1481 xcb_input_change_pointer_device_cookie_t xcb_ret;
1482 xcb_input_change_pointer_device_request_t xcb_out;
1484 xcb_out.x_axis = x_axis;
1485 xcb_out.y_axis = y_axis;
1486 xcb_out.device_id = device_id;
1487 xcb_out.pad0 = 0;
1489 xcb_parts[2].iov_base = (char *) &xcb_out;
1490 xcb_parts[2].iov_len = sizeof(xcb_out);
1491 xcb_parts[3].iov_base = 0;
1492 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1494 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1495 return xcb_ret;
1498 xcb_input_change_pointer_device_reply_t *
1499 xcb_input_change_pointer_device_reply (xcb_connection_t *c /**< */,
1500 xcb_input_change_pointer_device_cookie_t cookie /**< */,
1501 xcb_generic_error_t **e /**< */)
1503 return (xcb_input_change_pointer_device_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1507 xcb_input_grab_device_sizeof (const void *_buffer /**< */)
1509 char *xcb_tmp = (char *)_buffer;
1510 const xcb_input_grab_device_request_t *_aux = (xcb_input_grab_device_request_t *)_buffer;
1511 unsigned int xcb_buffer_len = 0;
1512 unsigned int xcb_block_len = 0;
1513 unsigned int xcb_pad = 0;
1514 unsigned int xcb_align_to = 0;
1517 xcb_block_len += sizeof(xcb_input_grab_device_request_t);
1518 xcb_tmp += xcb_block_len;
1519 xcb_buffer_len += xcb_block_len;
1520 xcb_block_len = 0;
1521 /* classes */
1522 xcb_block_len += _aux->num_classes * sizeof(xcb_input_event_class_t);
1523 xcb_tmp += xcb_block_len;
1524 xcb_align_to = ALIGNOF(xcb_input_event_class_t);
1525 /* insert padding */
1526 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1527 xcb_buffer_len += xcb_block_len + xcb_pad;
1528 if (0 != xcb_pad) {
1529 xcb_tmp += xcb_pad;
1530 xcb_pad = 0;
1532 xcb_block_len = 0;
1534 return xcb_buffer_len;
1537 xcb_input_grab_device_cookie_t
1538 xcb_input_grab_device (xcb_connection_t *c /**< */,
1539 xcb_window_t grab_window /**< */,
1540 xcb_timestamp_t time /**< */,
1541 uint16_t num_classes /**< */,
1542 uint8_t this_device_mode /**< */,
1543 uint8_t other_device_mode /**< */,
1544 uint8_t owner_events /**< */,
1545 uint8_t device_id /**< */,
1546 const xcb_input_event_class_t *classes /**< */)
1548 static const xcb_protocol_request_t xcb_req = {
1549 /* count */ 4,
1550 /* ext */ &xcb_input_id,
1551 /* opcode */ XCB_INPUT_GRAB_DEVICE,
1552 /* isvoid */ 0
1555 struct iovec xcb_parts[6];
1556 xcb_input_grab_device_cookie_t xcb_ret;
1557 xcb_input_grab_device_request_t xcb_out;
1559 xcb_out.grab_window = grab_window;
1560 xcb_out.time = time;
1561 xcb_out.num_classes = num_classes;
1562 xcb_out.this_device_mode = this_device_mode;
1563 xcb_out.other_device_mode = other_device_mode;
1564 xcb_out.owner_events = owner_events;
1565 xcb_out.device_id = device_id;
1566 memset(xcb_out.pad0, 0, 2);
1568 xcb_parts[2].iov_base = (char *) &xcb_out;
1569 xcb_parts[2].iov_len = sizeof(xcb_out);
1570 xcb_parts[3].iov_base = 0;
1571 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1572 /* xcb_input_event_class_t classes */
1573 xcb_parts[4].iov_base = (char *) classes;
1574 xcb_parts[4].iov_len = num_classes * sizeof(uint32_t);
1575 xcb_parts[5].iov_base = 0;
1576 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1578 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1579 return xcb_ret;
1582 xcb_input_grab_device_cookie_t
1583 xcb_input_grab_device_unchecked (xcb_connection_t *c /**< */,
1584 xcb_window_t grab_window /**< */,
1585 xcb_timestamp_t time /**< */,
1586 uint16_t num_classes /**< */,
1587 uint8_t this_device_mode /**< */,
1588 uint8_t other_device_mode /**< */,
1589 uint8_t owner_events /**< */,
1590 uint8_t device_id /**< */,
1591 const xcb_input_event_class_t *classes /**< */)
1593 static const xcb_protocol_request_t xcb_req = {
1594 /* count */ 4,
1595 /* ext */ &xcb_input_id,
1596 /* opcode */ XCB_INPUT_GRAB_DEVICE,
1597 /* isvoid */ 0
1600 struct iovec xcb_parts[6];
1601 xcb_input_grab_device_cookie_t xcb_ret;
1602 xcb_input_grab_device_request_t xcb_out;
1604 xcb_out.grab_window = grab_window;
1605 xcb_out.time = time;
1606 xcb_out.num_classes = num_classes;
1607 xcb_out.this_device_mode = this_device_mode;
1608 xcb_out.other_device_mode = other_device_mode;
1609 xcb_out.owner_events = owner_events;
1610 xcb_out.device_id = device_id;
1611 memset(xcb_out.pad0, 0, 2);
1613 xcb_parts[2].iov_base = (char *) &xcb_out;
1614 xcb_parts[2].iov_len = sizeof(xcb_out);
1615 xcb_parts[3].iov_base = 0;
1616 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1617 /* xcb_input_event_class_t classes */
1618 xcb_parts[4].iov_base = (char *) classes;
1619 xcb_parts[4].iov_len = num_classes * sizeof(uint32_t);
1620 xcb_parts[5].iov_base = 0;
1621 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1623 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1624 return xcb_ret;
1627 xcb_input_grab_device_reply_t *
1628 xcb_input_grab_device_reply (xcb_connection_t *c /**< */,
1629 xcb_input_grab_device_cookie_t cookie /**< */,
1630 xcb_generic_error_t **e /**< */)
1632 return (xcb_input_grab_device_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1635 xcb_void_cookie_t
1636 xcb_input_ungrab_device_checked (xcb_connection_t *c /**< */,
1637 xcb_timestamp_t time /**< */,
1638 uint8_t device_id /**< */)
1640 static const xcb_protocol_request_t xcb_req = {
1641 /* count */ 2,
1642 /* ext */ &xcb_input_id,
1643 /* opcode */ XCB_INPUT_UNGRAB_DEVICE,
1644 /* isvoid */ 1
1647 struct iovec xcb_parts[4];
1648 xcb_void_cookie_t xcb_ret;
1649 xcb_input_ungrab_device_request_t xcb_out;
1651 xcb_out.time = time;
1652 xcb_out.device_id = device_id;
1654 xcb_parts[2].iov_base = (char *) &xcb_out;
1655 xcb_parts[2].iov_len = sizeof(xcb_out);
1656 xcb_parts[3].iov_base = 0;
1657 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1659 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1660 return xcb_ret;
1663 xcb_void_cookie_t
1664 xcb_input_ungrab_device (xcb_connection_t *c /**< */,
1665 xcb_timestamp_t time /**< */,
1666 uint8_t device_id /**< */)
1668 static const xcb_protocol_request_t xcb_req = {
1669 /* count */ 2,
1670 /* ext */ &xcb_input_id,
1671 /* opcode */ XCB_INPUT_UNGRAB_DEVICE,
1672 /* isvoid */ 1
1675 struct iovec xcb_parts[4];
1676 xcb_void_cookie_t xcb_ret;
1677 xcb_input_ungrab_device_request_t xcb_out;
1679 xcb_out.time = time;
1680 xcb_out.device_id = device_id;
1682 xcb_parts[2].iov_base = (char *) &xcb_out;
1683 xcb_parts[2].iov_len = sizeof(xcb_out);
1684 xcb_parts[3].iov_base = 0;
1685 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1687 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1688 return xcb_ret;
1692 xcb_input_grab_device_key_sizeof (const void *_buffer /**< */)
1694 char *xcb_tmp = (char *)_buffer;
1695 const xcb_input_grab_device_key_request_t *_aux = (xcb_input_grab_device_key_request_t *)_buffer;
1696 unsigned int xcb_buffer_len = 0;
1697 unsigned int xcb_block_len = 0;
1698 unsigned int xcb_pad = 0;
1699 unsigned int xcb_align_to = 0;
1702 xcb_block_len += sizeof(xcb_input_grab_device_key_request_t);
1703 xcb_tmp += xcb_block_len;
1704 xcb_buffer_len += xcb_block_len;
1705 xcb_block_len = 0;
1706 /* classes */
1707 xcb_block_len += _aux->num_classes * sizeof(xcb_input_event_class_t);
1708 xcb_tmp += xcb_block_len;
1709 xcb_align_to = ALIGNOF(xcb_input_event_class_t);
1710 /* insert padding */
1711 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1712 xcb_buffer_len += xcb_block_len + xcb_pad;
1713 if (0 != xcb_pad) {
1714 xcb_tmp += xcb_pad;
1715 xcb_pad = 0;
1717 xcb_block_len = 0;
1719 return xcb_buffer_len;
1722 xcb_void_cookie_t
1723 xcb_input_grab_device_key_checked (xcb_connection_t *c /**< */,
1724 xcb_window_t grab_window /**< */,
1725 uint16_t num_classes /**< */,
1726 uint16_t modifiers /**< */,
1727 uint8_t modifier_device /**< */,
1728 uint8_t grabbed_device /**< */,
1729 uint8_t key /**< */,
1730 uint8_t this_device_mode /**< */,
1731 uint8_t other_device_mode /**< */,
1732 uint8_t owner_events /**< */,
1733 const xcb_input_event_class_t *classes /**< */)
1735 static const xcb_protocol_request_t xcb_req = {
1736 /* count */ 4,
1737 /* ext */ &xcb_input_id,
1738 /* opcode */ XCB_INPUT_GRAB_DEVICE_KEY,
1739 /* isvoid */ 1
1742 struct iovec xcb_parts[6];
1743 xcb_void_cookie_t xcb_ret;
1744 xcb_input_grab_device_key_request_t xcb_out;
1746 xcb_out.grab_window = grab_window;
1747 xcb_out.num_classes = num_classes;
1748 xcb_out.modifiers = modifiers;
1749 xcb_out.modifier_device = modifier_device;
1750 xcb_out.grabbed_device = grabbed_device;
1751 xcb_out.key = key;
1752 xcb_out.this_device_mode = this_device_mode;
1753 xcb_out.other_device_mode = other_device_mode;
1754 xcb_out.owner_events = owner_events;
1755 memset(xcb_out.pad0, 0, 2);
1757 xcb_parts[2].iov_base = (char *) &xcb_out;
1758 xcb_parts[2].iov_len = sizeof(xcb_out);
1759 xcb_parts[3].iov_base = 0;
1760 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1761 /* xcb_input_event_class_t classes */
1762 xcb_parts[4].iov_base = (char *) classes;
1763 xcb_parts[4].iov_len = num_classes * sizeof(xcb_input_event_class_t);
1764 xcb_parts[5].iov_base = 0;
1765 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1767 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1768 return xcb_ret;
1771 xcb_void_cookie_t
1772 xcb_input_grab_device_key (xcb_connection_t *c /**< */,
1773 xcb_window_t grab_window /**< */,
1774 uint16_t num_classes /**< */,
1775 uint16_t modifiers /**< */,
1776 uint8_t modifier_device /**< */,
1777 uint8_t grabbed_device /**< */,
1778 uint8_t key /**< */,
1779 uint8_t this_device_mode /**< */,
1780 uint8_t other_device_mode /**< */,
1781 uint8_t owner_events /**< */,
1782 const xcb_input_event_class_t *classes /**< */)
1784 static const xcb_protocol_request_t xcb_req = {
1785 /* count */ 4,
1786 /* ext */ &xcb_input_id,
1787 /* opcode */ XCB_INPUT_GRAB_DEVICE_KEY,
1788 /* isvoid */ 1
1791 struct iovec xcb_parts[6];
1792 xcb_void_cookie_t xcb_ret;
1793 xcb_input_grab_device_key_request_t xcb_out;
1795 xcb_out.grab_window = grab_window;
1796 xcb_out.num_classes = num_classes;
1797 xcb_out.modifiers = modifiers;
1798 xcb_out.modifier_device = modifier_device;
1799 xcb_out.grabbed_device = grabbed_device;
1800 xcb_out.key = key;
1801 xcb_out.this_device_mode = this_device_mode;
1802 xcb_out.other_device_mode = other_device_mode;
1803 xcb_out.owner_events = owner_events;
1804 memset(xcb_out.pad0, 0, 2);
1806 xcb_parts[2].iov_base = (char *) &xcb_out;
1807 xcb_parts[2].iov_len = sizeof(xcb_out);
1808 xcb_parts[3].iov_base = 0;
1809 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1810 /* xcb_input_event_class_t classes */
1811 xcb_parts[4].iov_base = (char *) classes;
1812 xcb_parts[4].iov_len = num_classes * sizeof(xcb_input_event_class_t);
1813 xcb_parts[5].iov_base = 0;
1814 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1816 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1817 return xcb_ret;
1820 xcb_void_cookie_t
1821 xcb_input_ungrab_device_key_checked (xcb_connection_t *c /**< */,
1822 xcb_window_t grabWindow /**< */,
1823 uint16_t modifiers /**< */,
1824 uint8_t modifier_device /**< */,
1825 uint8_t key /**< */,
1826 uint8_t grabbed_device /**< */)
1828 static const xcb_protocol_request_t xcb_req = {
1829 /* count */ 2,
1830 /* ext */ &xcb_input_id,
1831 /* opcode */ XCB_INPUT_UNGRAB_DEVICE_KEY,
1832 /* isvoid */ 1
1835 struct iovec xcb_parts[4];
1836 xcb_void_cookie_t xcb_ret;
1837 xcb_input_ungrab_device_key_request_t xcb_out;
1839 xcb_out.grabWindow = grabWindow;
1840 xcb_out.modifiers = modifiers;
1841 xcb_out.modifier_device = modifier_device;
1842 xcb_out.key = key;
1843 xcb_out.grabbed_device = grabbed_device;
1845 xcb_parts[2].iov_base = (char *) &xcb_out;
1846 xcb_parts[2].iov_len = sizeof(xcb_out);
1847 xcb_parts[3].iov_base = 0;
1848 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1850 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1851 return xcb_ret;
1854 xcb_void_cookie_t
1855 xcb_input_ungrab_device_key (xcb_connection_t *c /**< */,
1856 xcb_window_t grabWindow /**< */,
1857 uint16_t modifiers /**< */,
1858 uint8_t modifier_device /**< */,
1859 uint8_t key /**< */,
1860 uint8_t grabbed_device /**< */)
1862 static const xcb_protocol_request_t xcb_req = {
1863 /* count */ 2,
1864 /* ext */ &xcb_input_id,
1865 /* opcode */ XCB_INPUT_UNGRAB_DEVICE_KEY,
1866 /* isvoid */ 1
1869 struct iovec xcb_parts[4];
1870 xcb_void_cookie_t xcb_ret;
1871 xcb_input_ungrab_device_key_request_t xcb_out;
1873 xcb_out.grabWindow = grabWindow;
1874 xcb_out.modifiers = modifiers;
1875 xcb_out.modifier_device = modifier_device;
1876 xcb_out.key = key;
1877 xcb_out.grabbed_device = grabbed_device;
1879 xcb_parts[2].iov_base = (char *) &xcb_out;
1880 xcb_parts[2].iov_len = sizeof(xcb_out);
1881 xcb_parts[3].iov_base = 0;
1882 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1884 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1885 return xcb_ret;
1889 xcb_input_grab_device_button_sizeof (const void *_buffer /**< */)
1891 char *xcb_tmp = (char *)_buffer;
1892 const xcb_input_grab_device_button_request_t *_aux = (xcb_input_grab_device_button_request_t *)_buffer;
1893 unsigned int xcb_buffer_len = 0;
1894 unsigned int xcb_block_len = 0;
1895 unsigned int xcb_pad = 0;
1896 unsigned int xcb_align_to = 0;
1899 xcb_block_len += sizeof(xcb_input_grab_device_button_request_t);
1900 xcb_tmp += xcb_block_len;
1901 xcb_buffer_len += xcb_block_len;
1902 xcb_block_len = 0;
1903 /* classes */
1904 xcb_block_len += _aux->num_classes * sizeof(xcb_input_event_class_t);
1905 xcb_tmp += xcb_block_len;
1906 xcb_align_to = ALIGNOF(xcb_input_event_class_t);
1907 /* insert padding */
1908 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1909 xcb_buffer_len += xcb_block_len + xcb_pad;
1910 if (0 != xcb_pad) {
1911 xcb_tmp += xcb_pad;
1912 xcb_pad = 0;
1914 xcb_block_len = 0;
1916 return xcb_buffer_len;
1919 xcb_void_cookie_t
1920 xcb_input_grab_device_button_checked (xcb_connection_t *c /**< */,
1921 xcb_window_t grab_window /**< */,
1922 uint8_t grabbed_device /**< */,
1923 uint8_t modifier_device /**< */,
1924 uint16_t num_classes /**< */,
1925 uint16_t modifiers /**< */,
1926 uint8_t this_device_mode /**< */,
1927 uint8_t other_device_mode /**< */,
1928 uint8_t button /**< */,
1929 uint8_t owner_events /**< */,
1930 const xcb_input_event_class_t *classes /**< */)
1932 static const xcb_protocol_request_t xcb_req = {
1933 /* count */ 4,
1934 /* ext */ &xcb_input_id,
1935 /* opcode */ XCB_INPUT_GRAB_DEVICE_BUTTON,
1936 /* isvoid */ 1
1939 struct iovec xcb_parts[6];
1940 xcb_void_cookie_t xcb_ret;
1941 xcb_input_grab_device_button_request_t xcb_out;
1943 xcb_out.grab_window = grab_window;
1944 xcb_out.grabbed_device = grabbed_device;
1945 xcb_out.modifier_device = modifier_device;
1946 xcb_out.num_classes = num_classes;
1947 xcb_out.modifiers = modifiers;
1948 xcb_out.this_device_mode = this_device_mode;
1949 xcb_out.other_device_mode = other_device_mode;
1950 xcb_out.button = button;
1951 xcb_out.owner_events = owner_events;
1952 memset(xcb_out.pad0, 0, 2);
1954 xcb_parts[2].iov_base = (char *) &xcb_out;
1955 xcb_parts[2].iov_len = sizeof(xcb_out);
1956 xcb_parts[3].iov_base = 0;
1957 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1958 /* xcb_input_event_class_t classes */
1959 xcb_parts[4].iov_base = (char *) classes;
1960 xcb_parts[4].iov_len = num_classes * sizeof(xcb_input_event_class_t);
1961 xcb_parts[5].iov_base = 0;
1962 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1964 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1965 return xcb_ret;
1968 xcb_void_cookie_t
1969 xcb_input_grab_device_button (xcb_connection_t *c /**< */,
1970 xcb_window_t grab_window /**< */,
1971 uint8_t grabbed_device /**< */,
1972 uint8_t modifier_device /**< */,
1973 uint16_t num_classes /**< */,
1974 uint16_t modifiers /**< */,
1975 uint8_t this_device_mode /**< */,
1976 uint8_t other_device_mode /**< */,
1977 uint8_t button /**< */,
1978 uint8_t owner_events /**< */,
1979 const xcb_input_event_class_t *classes /**< */)
1981 static const xcb_protocol_request_t xcb_req = {
1982 /* count */ 4,
1983 /* ext */ &xcb_input_id,
1984 /* opcode */ XCB_INPUT_GRAB_DEVICE_BUTTON,
1985 /* isvoid */ 1
1988 struct iovec xcb_parts[6];
1989 xcb_void_cookie_t xcb_ret;
1990 xcb_input_grab_device_button_request_t xcb_out;
1992 xcb_out.grab_window = grab_window;
1993 xcb_out.grabbed_device = grabbed_device;
1994 xcb_out.modifier_device = modifier_device;
1995 xcb_out.num_classes = num_classes;
1996 xcb_out.modifiers = modifiers;
1997 xcb_out.this_device_mode = this_device_mode;
1998 xcb_out.other_device_mode = other_device_mode;
1999 xcb_out.button = button;
2000 xcb_out.owner_events = owner_events;
2001 memset(xcb_out.pad0, 0, 2);
2003 xcb_parts[2].iov_base = (char *) &xcb_out;
2004 xcb_parts[2].iov_len = sizeof(xcb_out);
2005 xcb_parts[3].iov_base = 0;
2006 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2007 /* xcb_input_event_class_t classes */
2008 xcb_parts[4].iov_base = (char *) classes;
2009 xcb_parts[4].iov_len = num_classes * sizeof(xcb_input_event_class_t);
2010 xcb_parts[5].iov_base = 0;
2011 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
2013 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2014 return xcb_ret;
2017 xcb_void_cookie_t
2018 xcb_input_ungrab_device_button_checked (xcb_connection_t *c /**< */,
2019 xcb_window_t grab_window /**< */,
2020 uint16_t modifiers /**< */,
2021 uint8_t modifier_device /**< */,
2022 uint8_t button /**< */,
2023 uint8_t grabbed_device /**< */)
2025 static const xcb_protocol_request_t xcb_req = {
2026 /* count */ 2,
2027 /* ext */ &xcb_input_id,
2028 /* opcode */ XCB_INPUT_UNGRAB_DEVICE_BUTTON,
2029 /* isvoid */ 1
2032 struct iovec xcb_parts[4];
2033 xcb_void_cookie_t xcb_ret;
2034 xcb_input_ungrab_device_button_request_t xcb_out;
2036 xcb_out.grab_window = grab_window;
2037 xcb_out.modifiers = modifiers;
2038 xcb_out.modifier_device = modifier_device;
2039 xcb_out.button = button;
2040 xcb_out.grabbed_device = grabbed_device;
2042 xcb_parts[2].iov_base = (char *) &xcb_out;
2043 xcb_parts[2].iov_len = sizeof(xcb_out);
2044 xcb_parts[3].iov_base = 0;
2045 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2047 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2048 return xcb_ret;
2051 xcb_void_cookie_t
2052 xcb_input_ungrab_device_button (xcb_connection_t *c /**< */,
2053 xcb_window_t grab_window /**< */,
2054 uint16_t modifiers /**< */,
2055 uint8_t modifier_device /**< */,
2056 uint8_t button /**< */,
2057 uint8_t grabbed_device /**< */)
2059 static const xcb_protocol_request_t xcb_req = {
2060 /* count */ 2,
2061 /* ext */ &xcb_input_id,
2062 /* opcode */ XCB_INPUT_UNGRAB_DEVICE_BUTTON,
2063 /* isvoid */ 1
2066 struct iovec xcb_parts[4];
2067 xcb_void_cookie_t xcb_ret;
2068 xcb_input_ungrab_device_button_request_t xcb_out;
2070 xcb_out.grab_window = grab_window;
2071 xcb_out.modifiers = modifiers;
2072 xcb_out.modifier_device = modifier_device;
2073 xcb_out.button = button;
2074 xcb_out.grabbed_device = grabbed_device;
2076 xcb_parts[2].iov_base = (char *) &xcb_out;
2077 xcb_parts[2].iov_len = sizeof(xcb_out);
2078 xcb_parts[3].iov_base = 0;
2079 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2081 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2082 return xcb_ret;
2085 xcb_void_cookie_t
2086 xcb_input_allow_device_events_checked (xcb_connection_t *c /**< */,
2087 xcb_timestamp_t time /**< */,
2088 uint8_t mode /**< */,
2089 uint8_t device_id /**< */)
2091 static const xcb_protocol_request_t xcb_req = {
2092 /* count */ 2,
2093 /* ext */ &xcb_input_id,
2094 /* opcode */ XCB_INPUT_ALLOW_DEVICE_EVENTS,
2095 /* isvoid */ 1
2098 struct iovec xcb_parts[4];
2099 xcb_void_cookie_t xcb_ret;
2100 xcb_input_allow_device_events_request_t xcb_out;
2102 xcb_out.time = time;
2103 xcb_out.mode = mode;
2104 xcb_out.device_id = device_id;
2106 xcb_parts[2].iov_base = (char *) &xcb_out;
2107 xcb_parts[2].iov_len = sizeof(xcb_out);
2108 xcb_parts[3].iov_base = 0;
2109 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2111 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2112 return xcb_ret;
2115 xcb_void_cookie_t
2116 xcb_input_allow_device_events (xcb_connection_t *c /**< */,
2117 xcb_timestamp_t time /**< */,
2118 uint8_t mode /**< */,
2119 uint8_t device_id /**< */)
2121 static const xcb_protocol_request_t xcb_req = {
2122 /* count */ 2,
2123 /* ext */ &xcb_input_id,
2124 /* opcode */ XCB_INPUT_ALLOW_DEVICE_EVENTS,
2125 /* isvoid */ 1
2128 struct iovec xcb_parts[4];
2129 xcb_void_cookie_t xcb_ret;
2130 xcb_input_allow_device_events_request_t xcb_out;
2132 xcb_out.time = time;
2133 xcb_out.mode = mode;
2134 xcb_out.device_id = device_id;
2136 xcb_parts[2].iov_base = (char *) &xcb_out;
2137 xcb_parts[2].iov_len = sizeof(xcb_out);
2138 xcb_parts[3].iov_base = 0;
2139 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2141 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2142 return xcb_ret;
2145 xcb_input_get_device_focus_cookie_t
2146 xcb_input_get_device_focus (xcb_connection_t *c /**< */,
2147 uint8_t device_id /**< */)
2149 static const xcb_protocol_request_t xcb_req = {
2150 /* count */ 2,
2151 /* ext */ &xcb_input_id,
2152 /* opcode */ XCB_INPUT_GET_DEVICE_FOCUS,
2153 /* isvoid */ 0
2156 struct iovec xcb_parts[4];
2157 xcb_input_get_device_focus_cookie_t xcb_ret;
2158 xcb_input_get_device_focus_request_t xcb_out;
2160 xcb_out.device_id = device_id;
2161 memset(xcb_out.pad0, 0, 3);
2163 xcb_parts[2].iov_base = (char *) &xcb_out;
2164 xcb_parts[2].iov_len = sizeof(xcb_out);
2165 xcb_parts[3].iov_base = 0;
2166 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2168 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2169 return xcb_ret;
2172 xcb_input_get_device_focus_cookie_t
2173 xcb_input_get_device_focus_unchecked (xcb_connection_t *c /**< */,
2174 uint8_t device_id /**< */)
2176 static const xcb_protocol_request_t xcb_req = {
2177 /* count */ 2,
2178 /* ext */ &xcb_input_id,
2179 /* opcode */ XCB_INPUT_GET_DEVICE_FOCUS,
2180 /* isvoid */ 0
2183 struct iovec xcb_parts[4];
2184 xcb_input_get_device_focus_cookie_t xcb_ret;
2185 xcb_input_get_device_focus_request_t xcb_out;
2187 xcb_out.device_id = device_id;
2188 memset(xcb_out.pad0, 0, 3);
2190 xcb_parts[2].iov_base = (char *) &xcb_out;
2191 xcb_parts[2].iov_len = sizeof(xcb_out);
2192 xcb_parts[3].iov_base = 0;
2193 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2195 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2196 return xcb_ret;
2199 xcb_input_get_device_focus_reply_t *
2200 xcb_input_get_device_focus_reply (xcb_connection_t *c /**< */,
2201 xcb_input_get_device_focus_cookie_t cookie /**< */,
2202 xcb_generic_error_t **e /**< */)
2204 return (xcb_input_get_device_focus_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
2207 xcb_void_cookie_t
2208 xcb_input_set_device_focus_checked (xcb_connection_t *c /**< */,
2209 xcb_window_t focus /**< */,
2210 xcb_timestamp_t time /**< */,
2211 uint8_t revert_to /**< */,
2212 uint8_t device_id /**< */)
2214 static const xcb_protocol_request_t xcb_req = {
2215 /* count */ 2,
2216 /* ext */ &xcb_input_id,
2217 /* opcode */ XCB_INPUT_SET_DEVICE_FOCUS,
2218 /* isvoid */ 1
2221 struct iovec xcb_parts[4];
2222 xcb_void_cookie_t xcb_ret;
2223 xcb_input_set_device_focus_request_t xcb_out;
2225 xcb_out.focus = focus;
2226 xcb_out.time = time;
2227 xcb_out.revert_to = revert_to;
2228 xcb_out.device_id = device_id;
2230 xcb_parts[2].iov_base = (char *) &xcb_out;
2231 xcb_parts[2].iov_len = sizeof(xcb_out);
2232 xcb_parts[3].iov_base = 0;
2233 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2235 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2236 return xcb_ret;
2239 xcb_void_cookie_t
2240 xcb_input_set_device_focus (xcb_connection_t *c /**< */,
2241 xcb_window_t focus /**< */,
2242 xcb_timestamp_t time /**< */,
2243 uint8_t revert_to /**< */,
2244 uint8_t device_id /**< */)
2246 static const xcb_protocol_request_t xcb_req = {
2247 /* count */ 2,
2248 /* ext */ &xcb_input_id,
2249 /* opcode */ XCB_INPUT_SET_DEVICE_FOCUS,
2250 /* isvoid */ 1
2253 struct iovec xcb_parts[4];
2254 xcb_void_cookie_t xcb_ret;
2255 xcb_input_set_device_focus_request_t xcb_out;
2257 xcb_out.focus = focus;
2258 xcb_out.time = time;
2259 xcb_out.revert_to = revert_to;
2260 xcb_out.device_id = device_id;
2262 xcb_parts[2].iov_base = (char *) &xcb_out;
2263 xcb_parts[2].iov_len = sizeof(xcb_out);
2264 xcb_parts[3].iov_base = 0;
2265 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2267 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2268 return xcb_ret;
2271 void
2272 xcb_input_kbd_feedback_state_next (xcb_input_kbd_feedback_state_iterator_t *i /**< */)
2274 --i->rem;
2275 ++i->data;
2276 i->index += sizeof(xcb_input_kbd_feedback_state_t);
2279 xcb_generic_iterator_t
2280 xcb_input_kbd_feedback_state_end (xcb_input_kbd_feedback_state_iterator_t i /**< */)
2282 xcb_generic_iterator_t ret;
2283 ret.data = i.data + i.rem;
2284 ret.index = i.index + ((char *) ret.data - (char *) i.data);
2285 ret.rem = 0;
2286 return ret;
2289 void
2290 xcb_input_ptr_feedback_state_next (xcb_input_ptr_feedback_state_iterator_t *i /**< */)
2292 --i->rem;
2293 ++i->data;
2294 i->index += sizeof(xcb_input_ptr_feedback_state_t);
2297 xcb_generic_iterator_t
2298 xcb_input_ptr_feedback_state_end (xcb_input_ptr_feedback_state_iterator_t i /**< */)
2300 xcb_generic_iterator_t ret;
2301 ret.data = i.data + i.rem;
2302 ret.index = i.index + ((char *) ret.data - (char *) i.data);
2303 ret.rem = 0;
2304 return ret;
2307 void
2308 xcb_input_integer_feedback_state_next (xcb_input_integer_feedback_state_iterator_t *i /**< */)
2310 --i->rem;
2311 ++i->data;
2312 i->index += sizeof(xcb_input_integer_feedback_state_t);
2315 xcb_generic_iterator_t
2316 xcb_input_integer_feedback_state_end (xcb_input_integer_feedback_state_iterator_t i /**< */)
2318 xcb_generic_iterator_t ret;
2319 ret.data = i.data + i.rem;
2320 ret.index = i.index + ((char *) ret.data - (char *) i.data);
2321 ret.rem = 0;
2322 return ret;
2326 xcb_input_string_feedback_state_sizeof (const void *_buffer /**< */)
2328 char *xcb_tmp = (char *)_buffer;
2329 const xcb_input_string_feedback_state_t *_aux = (xcb_input_string_feedback_state_t *)_buffer;
2330 unsigned int xcb_buffer_len = 0;
2331 unsigned int xcb_block_len = 0;
2332 unsigned int xcb_pad = 0;
2333 unsigned int xcb_align_to = 0;
2336 xcb_block_len += sizeof(xcb_input_string_feedback_state_t);
2337 xcb_tmp += xcb_block_len;
2338 xcb_buffer_len += xcb_block_len;
2339 xcb_block_len = 0;
2340 /* keysyms */
2341 xcb_block_len += _aux->num_keysyms * sizeof(xcb_keysym_t);
2342 xcb_tmp += xcb_block_len;
2343 xcb_align_to = ALIGNOF(xcb_keysym_t);
2344 /* insert padding */
2345 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2346 xcb_buffer_len += xcb_block_len + xcb_pad;
2347 if (0 != xcb_pad) {
2348 xcb_tmp += xcb_pad;
2349 xcb_pad = 0;
2351 xcb_block_len = 0;
2353 return xcb_buffer_len;
2356 xcb_keysym_t *
2357 xcb_input_string_feedback_state_keysyms (const xcb_input_string_feedback_state_t *R /**< */)
2359 return (xcb_keysym_t *) (R + 1);
2363 xcb_input_string_feedback_state_keysyms_length (const xcb_input_string_feedback_state_t *R /**< */)
2365 return R->num_keysyms;
2368 xcb_generic_iterator_t
2369 xcb_input_string_feedback_state_keysyms_end (const xcb_input_string_feedback_state_t *R /**< */)
2371 xcb_generic_iterator_t i;
2372 i.data = ((xcb_keysym_t *) (R + 1)) + (R->num_keysyms);
2373 i.rem = 0;
2374 i.index = (char *) i.data - (char *) R;
2375 return i;
2378 void
2379 xcb_input_string_feedback_state_next (xcb_input_string_feedback_state_iterator_t *i /**< */)
2381 xcb_input_string_feedback_state_t *R = i->data;
2382 xcb_generic_iterator_t child;
2383 child.data = (xcb_input_string_feedback_state_t *)(((char *)R) + xcb_input_string_feedback_state_sizeof(R));
2384 i->index = (char *) child.data - (char *) i->data;
2385 --i->rem;
2386 i->data = (xcb_input_string_feedback_state_t *) child.data;
2389 xcb_generic_iterator_t
2390 xcb_input_string_feedback_state_end (xcb_input_string_feedback_state_iterator_t i /**< */)
2392 xcb_generic_iterator_t ret;
2393 while(i.rem > 0)
2394 xcb_input_string_feedback_state_next(&i);
2395 ret.data = i.data;
2396 ret.rem = i.rem;
2397 ret.index = i.index;
2398 return ret;
2401 void
2402 xcb_input_bell_feedback_state_next (xcb_input_bell_feedback_state_iterator_t *i /**< */)
2404 --i->rem;
2405 ++i->data;
2406 i->index += sizeof(xcb_input_bell_feedback_state_t);
2409 xcb_generic_iterator_t
2410 xcb_input_bell_feedback_state_end (xcb_input_bell_feedback_state_iterator_t i /**< */)
2412 xcb_generic_iterator_t ret;
2413 ret.data = i.data + i.rem;
2414 ret.index = i.index + ((char *) ret.data - (char *) i.data);
2415 ret.rem = 0;
2416 return ret;
2419 void
2420 xcb_input_led_feedback_state_next (xcb_input_led_feedback_state_iterator_t *i /**< */)
2422 --i->rem;
2423 ++i->data;
2424 i->index += sizeof(xcb_input_led_feedback_state_t);
2427 xcb_generic_iterator_t
2428 xcb_input_led_feedback_state_end (xcb_input_led_feedback_state_iterator_t i /**< */)
2430 xcb_generic_iterator_t ret;
2431 ret.data = i.data + i.rem;
2432 ret.index = i.index + ((char *) ret.data - (char *) i.data);
2433 ret.rem = 0;
2434 return ret;
2438 xcb_input_feedback_state_sizeof (const void *_buffer /**< */)
2440 char *xcb_tmp = (char *)_buffer;
2441 const xcb_input_feedback_state_t *_aux = (xcb_input_feedback_state_t *)_buffer;
2442 unsigned int xcb_buffer_len = 0;
2443 unsigned int xcb_block_len = 0;
2444 unsigned int xcb_pad = 0;
2445 unsigned int xcb_align_to = 0;
2448 xcb_block_len += sizeof(xcb_input_feedback_state_t);
2449 xcb_tmp += xcb_block_len;
2450 xcb_buffer_len += xcb_block_len;
2451 xcb_block_len = 0;
2452 /* uninterpreted_data */
2453 xcb_block_len += (_aux->len - 4) * sizeof(uint8_t);
2454 xcb_tmp += xcb_block_len;
2455 xcb_align_to = ALIGNOF(uint8_t);
2456 /* insert padding */
2457 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2458 xcb_buffer_len += xcb_block_len + xcb_pad;
2459 if (0 != xcb_pad) {
2460 xcb_tmp += xcb_pad;
2461 xcb_pad = 0;
2463 xcb_block_len = 0;
2465 return xcb_buffer_len;
2468 uint8_t *
2469 xcb_input_feedback_state_uninterpreted_data (const xcb_input_feedback_state_t *R /**< */)
2471 return (uint8_t *) (R + 1);
2475 xcb_input_feedback_state_uninterpreted_data_length (const xcb_input_feedback_state_t *R /**< */)
2477 return (R->len - 4);
2480 xcb_generic_iterator_t
2481 xcb_input_feedback_state_uninterpreted_data_end (const xcb_input_feedback_state_t *R /**< */)
2483 xcb_generic_iterator_t i;
2484 i.data = ((uint8_t *) (R + 1)) + ((R->len - 4));
2485 i.rem = 0;
2486 i.index = (char *) i.data - (char *) R;
2487 return i;
2490 void
2491 xcb_input_feedback_state_next (xcb_input_feedback_state_iterator_t *i /**< */)
2493 xcb_input_feedback_state_t *R = i->data;
2494 xcb_generic_iterator_t child;
2495 child.data = (xcb_input_feedback_state_t *)(((char *)R) + xcb_input_feedback_state_sizeof(R));
2496 i->index = (char *) child.data - (char *) i->data;
2497 --i->rem;
2498 i->data = (xcb_input_feedback_state_t *) child.data;
2501 xcb_generic_iterator_t
2502 xcb_input_feedback_state_end (xcb_input_feedback_state_iterator_t i /**< */)
2504 xcb_generic_iterator_t ret;
2505 while(i.rem > 0)
2506 xcb_input_feedback_state_next(&i);
2507 ret.data = i.data;
2508 ret.rem = i.rem;
2509 ret.index = i.index;
2510 return ret;
2514 xcb_input_get_feedback_control_sizeof (const void *_buffer /**< */)
2516 char *xcb_tmp = (char *)_buffer;
2517 const xcb_input_get_feedback_control_reply_t *_aux = (xcb_input_get_feedback_control_reply_t *)_buffer;
2518 unsigned int xcb_buffer_len = 0;
2519 unsigned int xcb_block_len = 0;
2520 unsigned int xcb_pad = 0;
2521 unsigned int xcb_align_to = 0;
2523 unsigned int i;
2524 unsigned int xcb_tmp_len;
2526 xcb_block_len += sizeof(xcb_input_get_feedback_control_reply_t);
2527 xcb_tmp += xcb_block_len;
2528 xcb_buffer_len += xcb_block_len;
2529 xcb_block_len = 0;
2530 /* feedbacks */
2531 for(i=0; i<_aux->num_feedbacks; i++) {
2532 xcb_tmp_len = xcb_input_feedback_state_sizeof(xcb_tmp);
2533 xcb_block_len += xcb_tmp_len;
2534 xcb_tmp += xcb_tmp_len;
2536 xcb_align_to = ALIGNOF(xcb_input_feedback_state_t);
2537 /* insert padding */
2538 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2539 xcb_buffer_len += xcb_block_len + xcb_pad;
2540 if (0 != xcb_pad) {
2541 xcb_tmp += xcb_pad;
2542 xcb_pad = 0;
2544 xcb_block_len = 0;
2546 return xcb_buffer_len;
2549 xcb_input_get_feedback_control_cookie_t
2550 xcb_input_get_feedback_control (xcb_connection_t *c /**< */,
2551 uint8_t device_id /**< */)
2553 static const xcb_protocol_request_t xcb_req = {
2554 /* count */ 2,
2555 /* ext */ &xcb_input_id,
2556 /* opcode */ XCB_INPUT_GET_FEEDBACK_CONTROL,
2557 /* isvoid */ 0
2560 struct iovec xcb_parts[4];
2561 xcb_input_get_feedback_control_cookie_t xcb_ret;
2562 xcb_input_get_feedback_control_request_t xcb_out;
2564 xcb_out.device_id = device_id;
2565 memset(xcb_out.pad0, 0, 3);
2567 xcb_parts[2].iov_base = (char *) &xcb_out;
2568 xcb_parts[2].iov_len = sizeof(xcb_out);
2569 xcb_parts[3].iov_base = 0;
2570 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2572 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2573 return xcb_ret;
2576 xcb_input_get_feedback_control_cookie_t
2577 xcb_input_get_feedback_control_unchecked (xcb_connection_t *c /**< */,
2578 uint8_t device_id /**< */)
2580 static const xcb_protocol_request_t xcb_req = {
2581 /* count */ 2,
2582 /* ext */ &xcb_input_id,
2583 /* opcode */ XCB_INPUT_GET_FEEDBACK_CONTROL,
2584 /* isvoid */ 0
2587 struct iovec xcb_parts[4];
2588 xcb_input_get_feedback_control_cookie_t xcb_ret;
2589 xcb_input_get_feedback_control_request_t xcb_out;
2591 xcb_out.device_id = device_id;
2592 memset(xcb_out.pad0, 0, 3);
2594 xcb_parts[2].iov_base = (char *) &xcb_out;
2595 xcb_parts[2].iov_len = sizeof(xcb_out);
2596 xcb_parts[3].iov_base = 0;
2597 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2599 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2600 return xcb_ret;
2604 xcb_input_get_feedback_control_feedbacks_length (const xcb_input_get_feedback_control_reply_t *R /**< */)
2606 return R->num_feedbacks;
2609 xcb_input_feedback_state_iterator_t
2610 xcb_input_get_feedback_control_feedbacks_iterator (const xcb_input_get_feedback_control_reply_t *R /**< */)
2612 xcb_input_feedback_state_iterator_t i;
2613 i.data = (xcb_input_feedback_state_t *) (R + 1);
2614 i.rem = R->num_feedbacks;
2615 i.index = (char *) i.data - (char *) R;
2616 return i;
2619 xcb_input_get_feedback_control_reply_t *
2620 xcb_input_get_feedback_control_reply (xcb_connection_t *c /**< */,
2621 xcb_input_get_feedback_control_cookie_t cookie /**< */,
2622 xcb_generic_error_t **e /**< */)
2624 return (xcb_input_get_feedback_control_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
2627 void
2628 xcb_input_kbd_feedback_ctl_next (xcb_input_kbd_feedback_ctl_iterator_t *i /**< */)
2630 --i->rem;
2631 ++i->data;
2632 i->index += sizeof(xcb_input_kbd_feedback_ctl_t);
2635 xcb_generic_iterator_t
2636 xcb_input_kbd_feedback_ctl_end (xcb_input_kbd_feedback_ctl_iterator_t i /**< */)
2638 xcb_generic_iterator_t ret;
2639 ret.data = i.data + i.rem;
2640 ret.index = i.index + ((char *) ret.data - (char *) i.data);
2641 ret.rem = 0;
2642 return ret;
2645 void
2646 xcb_input_ptr_feedback_ctl_next (xcb_input_ptr_feedback_ctl_iterator_t *i /**< */)
2648 --i->rem;
2649 ++i->data;
2650 i->index += sizeof(xcb_input_ptr_feedback_ctl_t);
2653 xcb_generic_iterator_t
2654 xcb_input_ptr_feedback_ctl_end (xcb_input_ptr_feedback_ctl_iterator_t i /**< */)
2656 xcb_generic_iterator_t ret;
2657 ret.data = i.data + i.rem;
2658 ret.index = i.index + ((char *) ret.data - (char *) i.data);
2659 ret.rem = 0;
2660 return ret;
2663 void
2664 xcb_input_integer_feedback_ctl_next (xcb_input_integer_feedback_ctl_iterator_t *i /**< */)
2666 --i->rem;
2667 ++i->data;
2668 i->index += sizeof(xcb_input_integer_feedback_ctl_t);
2671 xcb_generic_iterator_t
2672 xcb_input_integer_feedback_ctl_end (xcb_input_integer_feedback_ctl_iterator_t i /**< */)
2674 xcb_generic_iterator_t ret;
2675 ret.data = i.data + i.rem;
2676 ret.index = i.index + ((char *) ret.data - (char *) i.data);
2677 ret.rem = 0;
2678 return ret;
2682 xcb_input_string_feedback_ctl_sizeof (const void *_buffer /**< */)
2684 char *xcb_tmp = (char *)_buffer;
2685 const xcb_input_string_feedback_ctl_t *_aux = (xcb_input_string_feedback_ctl_t *)_buffer;
2686 unsigned int xcb_buffer_len = 0;
2687 unsigned int xcb_block_len = 0;
2688 unsigned int xcb_pad = 0;
2689 unsigned int xcb_align_to = 0;
2692 xcb_block_len += sizeof(xcb_input_string_feedback_ctl_t);
2693 xcb_tmp += xcb_block_len;
2694 xcb_buffer_len += xcb_block_len;
2695 xcb_block_len = 0;
2696 /* keysyms */
2697 xcb_block_len += _aux->num_keysyms * sizeof(xcb_keysym_t);
2698 xcb_tmp += xcb_block_len;
2699 xcb_align_to = ALIGNOF(xcb_keysym_t);
2700 /* insert padding */
2701 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2702 xcb_buffer_len += xcb_block_len + xcb_pad;
2703 if (0 != xcb_pad) {
2704 xcb_tmp += xcb_pad;
2705 xcb_pad = 0;
2707 xcb_block_len = 0;
2709 return xcb_buffer_len;
2712 xcb_keysym_t *
2713 xcb_input_string_feedback_ctl_keysyms (const xcb_input_string_feedback_ctl_t *R /**< */)
2715 return (xcb_keysym_t *) (R + 1);
2719 xcb_input_string_feedback_ctl_keysyms_length (const xcb_input_string_feedback_ctl_t *R /**< */)
2721 return R->num_keysyms;
2724 xcb_generic_iterator_t
2725 xcb_input_string_feedback_ctl_keysyms_end (const xcb_input_string_feedback_ctl_t *R /**< */)
2727 xcb_generic_iterator_t i;
2728 i.data = ((xcb_keysym_t *) (R + 1)) + (R->num_keysyms);
2729 i.rem = 0;
2730 i.index = (char *) i.data - (char *) R;
2731 return i;
2734 void
2735 xcb_input_string_feedback_ctl_next (xcb_input_string_feedback_ctl_iterator_t *i /**< */)
2737 xcb_input_string_feedback_ctl_t *R = i->data;
2738 xcb_generic_iterator_t child;
2739 child.data = (xcb_input_string_feedback_ctl_t *)(((char *)R) + xcb_input_string_feedback_ctl_sizeof(R));
2740 i->index = (char *) child.data - (char *) i->data;
2741 --i->rem;
2742 i->data = (xcb_input_string_feedback_ctl_t *) child.data;
2745 xcb_generic_iterator_t
2746 xcb_input_string_feedback_ctl_end (xcb_input_string_feedback_ctl_iterator_t i /**< */)
2748 xcb_generic_iterator_t ret;
2749 while(i.rem > 0)
2750 xcb_input_string_feedback_ctl_next(&i);
2751 ret.data = i.data;
2752 ret.rem = i.rem;
2753 ret.index = i.index;
2754 return ret;
2757 void
2758 xcb_input_bell_feedback_ctl_next (xcb_input_bell_feedback_ctl_iterator_t *i /**< */)
2760 --i->rem;
2761 ++i->data;
2762 i->index += sizeof(xcb_input_bell_feedback_ctl_t);
2765 xcb_generic_iterator_t
2766 xcb_input_bell_feedback_ctl_end (xcb_input_bell_feedback_ctl_iterator_t i /**< */)
2768 xcb_generic_iterator_t ret;
2769 ret.data = i.data + i.rem;
2770 ret.index = i.index + ((char *) ret.data - (char *) i.data);
2771 ret.rem = 0;
2772 return ret;
2775 void
2776 xcb_input_led_feedback_ctl_next (xcb_input_led_feedback_ctl_iterator_t *i /**< */)
2778 --i->rem;
2779 ++i->data;
2780 i->index += sizeof(xcb_input_led_feedback_ctl_t);
2783 xcb_generic_iterator_t
2784 xcb_input_led_feedback_ctl_end (xcb_input_led_feedback_ctl_iterator_t i /**< */)
2786 xcb_generic_iterator_t ret;
2787 ret.data = i.data + i.rem;
2788 ret.index = i.index + ((char *) ret.data - (char *) i.data);
2789 ret.rem = 0;
2790 return ret;
2794 xcb_input_feedback_ctl_sizeof (const void *_buffer /**< */)
2796 char *xcb_tmp = (char *)_buffer;
2797 const xcb_input_feedback_ctl_t *_aux = (xcb_input_feedback_ctl_t *)_buffer;
2798 unsigned int xcb_buffer_len = 0;
2799 unsigned int xcb_block_len = 0;
2800 unsigned int xcb_pad = 0;
2801 unsigned int xcb_align_to = 0;
2804 xcb_block_len += sizeof(xcb_input_feedback_ctl_t);
2805 xcb_tmp += xcb_block_len;
2806 xcb_buffer_len += xcb_block_len;
2807 xcb_block_len = 0;
2808 /* uninterpreted_data */
2809 xcb_block_len += (_aux->len - 4) * sizeof(uint8_t);
2810 xcb_tmp += xcb_block_len;
2811 xcb_align_to = ALIGNOF(uint8_t);
2812 /* insert padding */
2813 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2814 xcb_buffer_len += xcb_block_len + xcb_pad;
2815 if (0 != xcb_pad) {
2816 xcb_tmp += xcb_pad;
2817 xcb_pad = 0;
2819 xcb_block_len = 0;
2821 return xcb_buffer_len;
2824 uint8_t *
2825 xcb_input_feedback_ctl_uninterpreted_data (const xcb_input_feedback_ctl_t *R /**< */)
2827 return (uint8_t *) (R + 1);
2831 xcb_input_feedback_ctl_uninterpreted_data_length (const xcb_input_feedback_ctl_t *R /**< */)
2833 return (R->len - 4);
2836 xcb_generic_iterator_t
2837 xcb_input_feedback_ctl_uninterpreted_data_end (const xcb_input_feedback_ctl_t *R /**< */)
2839 xcb_generic_iterator_t i;
2840 i.data = ((uint8_t *) (R + 1)) + ((R->len - 4));
2841 i.rem = 0;
2842 i.index = (char *) i.data - (char *) R;
2843 return i;
2846 void
2847 xcb_input_feedback_ctl_next (xcb_input_feedback_ctl_iterator_t *i /**< */)
2849 xcb_input_feedback_ctl_t *R = i->data;
2850 xcb_generic_iterator_t child;
2851 child.data = (xcb_input_feedback_ctl_t *)(((char *)R) + xcb_input_feedback_ctl_sizeof(R));
2852 i->index = (char *) child.data - (char *) i->data;
2853 --i->rem;
2854 i->data = (xcb_input_feedback_ctl_t *) child.data;
2857 xcb_generic_iterator_t
2858 xcb_input_feedback_ctl_end (xcb_input_feedback_ctl_iterator_t i /**< */)
2860 xcb_generic_iterator_t ret;
2861 while(i.rem > 0)
2862 xcb_input_feedback_ctl_next(&i);
2863 ret.data = i.data;
2864 ret.rem = i.rem;
2865 ret.index = i.index;
2866 return ret;
2870 xcb_input_change_feedback_control_sizeof (const void *_buffer /**< */)
2872 char *xcb_tmp = (char *)_buffer;
2873 unsigned int xcb_buffer_len = 0;
2874 unsigned int xcb_block_len = 0;
2875 unsigned int xcb_pad = 0;
2876 unsigned int xcb_align_to = 0;
2879 xcb_block_len += sizeof(xcb_input_change_feedback_control_request_t);
2880 xcb_tmp += xcb_block_len;
2881 xcb_buffer_len += xcb_block_len;
2882 xcb_block_len = 0;
2883 /* feedback */
2884 xcb_block_len += xcb_input_feedback_ctl_sizeof(xcb_tmp);
2885 xcb_tmp += xcb_block_len;
2886 xcb_align_to = ALIGNOF(xcb_input_feedback_ctl_t);
2887 /* insert padding */
2888 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2889 xcb_buffer_len += xcb_block_len + xcb_pad;
2890 if (0 != xcb_pad) {
2891 xcb_tmp += xcb_pad;
2892 xcb_pad = 0;
2894 xcb_block_len = 0;
2896 return xcb_buffer_len;
2899 xcb_void_cookie_t
2900 xcb_input_change_feedback_control_checked (xcb_connection_t *c /**< */,
2901 uint32_t mask /**< */,
2902 uint8_t device_id /**< */,
2903 uint8_t feedback_id /**< */,
2904 xcb_input_feedback_ctl_t *feedback /**< */)
2906 static const xcb_protocol_request_t xcb_req = {
2907 /* count */ 4,
2908 /* ext */ &xcb_input_id,
2909 /* opcode */ XCB_INPUT_CHANGE_FEEDBACK_CONTROL,
2910 /* isvoid */ 1
2913 struct iovec xcb_parts[6];
2914 xcb_void_cookie_t xcb_ret;
2915 xcb_input_change_feedback_control_request_t xcb_out;
2917 xcb_out.mask = mask;
2918 xcb_out.device_id = device_id;
2919 xcb_out.feedback_id = feedback_id;
2921 xcb_parts[2].iov_base = (char *) &xcb_out;
2922 xcb_parts[2].iov_len = sizeof(xcb_out);
2923 xcb_parts[3].iov_base = 0;
2924 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2925 /* xcb_input_feedback_ctl_t feedback */
2926 xcb_parts[4].iov_base = (char *) feedback;
2927 xcb_parts[4].iov_len =
2928 xcb_input_feedback_ctl_sizeof (feedback);
2930 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2931 return xcb_ret;
2934 xcb_void_cookie_t
2935 xcb_input_change_feedback_control (xcb_connection_t *c /**< */,
2936 uint32_t mask /**< */,
2937 uint8_t device_id /**< */,
2938 uint8_t feedback_id /**< */,
2939 xcb_input_feedback_ctl_t *feedback /**< */)
2941 static const xcb_protocol_request_t xcb_req = {
2942 /* count */ 4,
2943 /* ext */ &xcb_input_id,
2944 /* opcode */ XCB_INPUT_CHANGE_FEEDBACK_CONTROL,
2945 /* isvoid */ 1
2948 struct iovec xcb_parts[6];
2949 xcb_void_cookie_t xcb_ret;
2950 xcb_input_change_feedback_control_request_t xcb_out;
2952 xcb_out.mask = mask;
2953 xcb_out.device_id = device_id;
2954 xcb_out.feedback_id = feedback_id;
2956 xcb_parts[2].iov_base = (char *) &xcb_out;
2957 xcb_parts[2].iov_len = sizeof(xcb_out);
2958 xcb_parts[3].iov_base = 0;
2959 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2960 /* xcb_input_feedback_ctl_t feedback */
2961 xcb_parts[4].iov_base = (char *) feedback;
2962 xcb_parts[4].iov_len =
2963 xcb_input_feedback_ctl_sizeof (feedback);
2965 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2966 return xcb_ret;
2970 xcb_input_get_device_key_mapping_sizeof (const void *_buffer /**< */)
2972 char *xcb_tmp = (char *)_buffer;
2973 const xcb_input_get_device_key_mapping_reply_t *_aux = (xcb_input_get_device_key_mapping_reply_t *)_buffer;
2974 unsigned int xcb_buffer_len = 0;
2975 unsigned int xcb_block_len = 0;
2976 unsigned int xcb_pad = 0;
2977 unsigned int xcb_align_to = 0;
2980 xcb_block_len += sizeof(xcb_input_get_device_key_mapping_reply_t);
2981 xcb_tmp += xcb_block_len;
2982 xcb_buffer_len += xcb_block_len;
2983 xcb_block_len = 0;
2984 /* keysyms */
2985 xcb_block_len += _aux->length * sizeof(xcb_keysym_t);
2986 xcb_tmp += xcb_block_len;
2987 xcb_align_to = ALIGNOF(xcb_keysym_t);
2988 /* insert padding */
2989 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2990 xcb_buffer_len += xcb_block_len + xcb_pad;
2991 if (0 != xcb_pad) {
2992 xcb_tmp += xcb_pad;
2993 xcb_pad = 0;
2995 xcb_block_len = 0;
2997 return xcb_buffer_len;
3000 xcb_input_get_device_key_mapping_cookie_t
3001 xcb_input_get_device_key_mapping (xcb_connection_t *c /**< */,
3002 uint8_t device_id /**< */,
3003 xcb_input_key_code_t first_keycode /**< */,
3004 uint8_t count /**< */)
3006 static const xcb_protocol_request_t xcb_req = {
3007 /* count */ 2,
3008 /* ext */ &xcb_input_id,
3009 /* opcode */ XCB_INPUT_GET_DEVICE_KEY_MAPPING,
3010 /* isvoid */ 0
3013 struct iovec xcb_parts[4];
3014 xcb_input_get_device_key_mapping_cookie_t xcb_ret;
3015 xcb_input_get_device_key_mapping_request_t xcb_out;
3017 xcb_out.device_id = device_id;
3018 xcb_out.first_keycode = first_keycode;
3019 xcb_out.count = count;
3021 xcb_parts[2].iov_base = (char *) &xcb_out;
3022 xcb_parts[2].iov_len = sizeof(xcb_out);
3023 xcb_parts[3].iov_base = 0;
3024 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3026 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3027 return xcb_ret;
3030 xcb_input_get_device_key_mapping_cookie_t
3031 xcb_input_get_device_key_mapping_unchecked (xcb_connection_t *c /**< */,
3032 uint8_t device_id /**< */,
3033 xcb_input_key_code_t first_keycode /**< */,
3034 uint8_t count /**< */)
3036 static const xcb_protocol_request_t xcb_req = {
3037 /* count */ 2,
3038 /* ext */ &xcb_input_id,
3039 /* opcode */ XCB_INPUT_GET_DEVICE_KEY_MAPPING,
3040 /* isvoid */ 0
3043 struct iovec xcb_parts[4];
3044 xcb_input_get_device_key_mapping_cookie_t xcb_ret;
3045 xcb_input_get_device_key_mapping_request_t xcb_out;
3047 xcb_out.device_id = device_id;
3048 xcb_out.first_keycode = first_keycode;
3049 xcb_out.count = count;
3051 xcb_parts[2].iov_base = (char *) &xcb_out;
3052 xcb_parts[2].iov_len = sizeof(xcb_out);
3053 xcb_parts[3].iov_base = 0;
3054 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3056 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3057 return xcb_ret;
3060 xcb_keysym_t *
3061 xcb_input_get_device_key_mapping_keysyms (const xcb_input_get_device_key_mapping_reply_t *R /**< */)
3063 return (xcb_keysym_t *) (R + 1);
3067 xcb_input_get_device_key_mapping_keysyms_length (const xcb_input_get_device_key_mapping_reply_t *R /**< */)
3069 return R->length;
3072 xcb_generic_iterator_t
3073 xcb_input_get_device_key_mapping_keysyms_end (const xcb_input_get_device_key_mapping_reply_t *R /**< */)
3075 xcb_generic_iterator_t i;
3076 i.data = ((xcb_keysym_t *) (R + 1)) + (R->length);
3077 i.rem = 0;
3078 i.index = (char *) i.data - (char *) R;
3079 return i;
3082 xcb_input_get_device_key_mapping_reply_t *
3083 xcb_input_get_device_key_mapping_reply (xcb_connection_t *c /**< */,
3084 xcb_input_get_device_key_mapping_cookie_t cookie /**< */,
3085 xcb_generic_error_t **e /**< */)
3087 return (xcb_input_get_device_key_mapping_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
3091 xcb_input_change_device_key_mapping_sizeof (const void *_buffer /**< */)
3093 char *xcb_tmp = (char *)_buffer;
3094 const xcb_input_change_device_key_mapping_request_t *_aux = (xcb_input_change_device_key_mapping_request_t *)_buffer;
3095 unsigned int xcb_buffer_len = 0;
3096 unsigned int xcb_block_len = 0;
3097 unsigned int xcb_pad = 0;
3098 unsigned int xcb_align_to = 0;
3101 xcb_block_len += sizeof(xcb_input_change_device_key_mapping_request_t);
3102 xcb_tmp += xcb_block_len;
3103 xcb_buffer_len += xcb_block_len;
3104 xcb_block_len = 0;
3105 /* keysyms */
3106 xcb_block_len += (_aux->keycode_count * _aux->keysyms_per_keycode) * sizeof(xcb_keysym_t);
3107 xcb_tmp += xcb_block_len;
3108 xcb_align_to = ALIGNOF(xcb_keysym_t);
3109 /* insert padding */
3110 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3111 xcb_buffer_len += xcb_block_len + xcb_pad;
3112 if (0 != xcb_pad) {
3113 xcb_tmp += xcb_pad;
3114 xcb_pad = 0;
3116 xcb_block_len = 0;
3118 return xcb_buffer_len;
3121 xcb_void_cookie_t
3122 xcb_input_change_device_key_mapping_checked (xcb_connection_t *c /**< */,
3123 uint8_t device_id /**< */,
3124 xcb_input_key_code_t first_keycode /**< */,
3125 uint8_t keysyms_per_keycode /**< */,
3126 uint8_t keycode_count /**< */,
3127 const xcb_keysym_t *keysyms /**< */)
3129 static const xcb_protocol_request_t xcb_req = {
3130 /* count */ 4,
3131 /* ext */ &xcb_input_id,
3132 /* opcode */ XCB_INPUT_CHANGE_DEVICE_KEY_MAPPING,
3133 /* isvoid */ 1
3136 struct iovec xcb_parts[6];
3137 xcb_void_cookie_t xcb_ret;
3138 xcb_input_change_device_key_mapping_request_t xcb_out;
3140 xcb_out.device_id = device_id;
3141 xcb_out.first_keycode = first_keycode;
3142 xcb_out.keysyms_per_keycode = keysyms_per_keycode;
3143 xcb_out.keycode_count = keycode_count;
3145 xcb_parts[2].iov_base = (char *) &xcb_out;
3146 xcb_parts[2].iov_len = sizeof(xcb_out);
3147 xcb_parts[3].iov_base = 0;
3148 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3149 /* xcb_keysym_t keysyms */
3150 xcb_parts[4].iov_base = (char *) keysyms;
3151 xcb_parts[4].iov_len = (keycode_count * keysyms_per_keycode) * sizeof(xcb_keysym_t);
3152 xcb_parts[5].iov_base = 0;
3153 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
3155 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3156 return xcb_ret;
3159 xcb_void_cookie_t
3160 xcb_input_change_device_key_mapping (xcb_connection_t *c /**< */,
3161 uint8_t device_id /**< */,
3162 xcb_input_key_code_t first_keycode /**< */,
3163 uint8_t keysyms_per_keycode /**< */,
3164 uint8_t keycode_count /**< */,
3165 const xcb_keysym_t *keysyms /**< */)
3167 static const xcb_protocol_request_t xcb_req = {
3168 /* count */ 4,
3169 /* ext */ &xcb_input_id,
3170 /* opcode */ XCB_INPUT_CHANGE_DEVICE_KEY_MAPPING,
3171 /* isvoid */ 1
3174 struct iovec xcb_parts[6];
3175 xcb_void_cookie_t xcb_ret;
3176 xcb_input_change_device_key_mapping_request_t xcb_out;
3178 xcb_out.device_id = device_id;
3179 xcb_out.first_keycode = first_keycode;
3180 xcb_out.keysyms_per_keycode = keysyms_per_keycode;
3181 xcb_out.keycode_count = keycode_count;
3183 xcb_parts[2].iov_base = (char *) &xcb_out;
3184 xcb_parts[2].iov_len = sizeof(xcb_out);
3185 xcb_parts[3].iov_base = 0;
3186 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3187 /* xcb_keysym_t keysyms */
3188 xcb_parts[4].iov_base = (char *) keysyms;
3189 xcb_parts[4].iov_len = (keycode_count * keysyms_per_keycode) * sizeof(xcb_keysym_t);
3190 xcb_parts[5].iov_base = 0;
3191 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
3193 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3194 return xcb_ret;
3198 xcb_input_get_device_modifier_mapping_sizeof (const void *_buffer /**< */)
3200 char *xcb_tmp = (char *)_buffer;
3201 const xcb_input_get_device_modifier_mapping_reply_t *_aux = (xcb_input_get_device_modifier_mapping_reply_t *)_buffer;
3202 unsigned int xcb_buffer_len = 0;
3203 unsigned int xcb_block_len = 0;
3204 unsigned int xcb_pad = 0;
3205 unsigned int xcb_align_to = 0;
3208 xcb_block_len += sizeof(xcb_input_get_device_modifier_mapping_reply_t);
3209 xcb_tmp += xcb_block_len;
3210 xcb_buffer_len += xcb_block_len;
3211 xcb_block_len = 0;
3212 /* keymaps */
3213 xcb_block_len += (_aux->keycodes_per_modifier * 8) * sizeof(uint8_t);
3214 xcb_tmp += xcb_block_len;
3215 xcb_align_to = ALIGNOF(uint8_t);
3216 /* insert padding */
3217 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3218 xcb_buffer_len += xcb_block_len + xcb_pad;
3219 if (0 != xcb_pad) {
3220 xcb_tmp += xcb_pad;
3221 xcb_pad = 0;
3223 xcb_block_len = 0;
3225 return xcb_buffer_len;
3228 xcb_input_get_device_modifier_mapping_cookie_t
3229 xcb_input_get_device_modifier_mapping (xcb_connection_t *c /**< */,
3230 uint8_t device_id /**< */)
3232 static const xcb_protocol_request_t xcb_req = {
3233 /* count */ 2,
3234 /* ext */ &xcb_input_id,
3235 /* opcode */ XCB_INPUT_GET_DEVICE_MODIFIER_MAPPING,
3236 /* isvoid */ 0
3239 struct iovec xcb_parts[4];
3240 xcb_input_get_device_modifier_mapping_cookie_t xcb_ret;
3241 xcb_input_get_device_modifier_mapping_request_t xcb_out;
3243 xcb_out.device_id = device_id;
3244 memset(xcb_out.pad0, 0, 3);
3246 xcb_parts[2].iov_base = (char *) &xcb_out;
3247 xcb_parts[2].iov_len = sizeof(xcb_out);
3248 xcb_parts[3].iov_base = 0;
3249 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3251 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3252 return xcb_ret;
3255 xcb_input_get_device_modifier_mapping_cookie_t
3256 xcb_input_get_device_modifier_mapping_unchecked (xcb_connection_t *c /**< */,
3257 uint8_t device_id /**< */)
3259 static const xcb_protocol_request_t xcb_req = {
3260 /* count */ 2,
3261 /* ext */ &xcb_input_id,
3262 /* opcode */ XCB_INPUT_GET_DEVICE_MODIFIER_MAPPING,
3263 /* isvoid */ 0
3266 struct iovec xcb_parts[4];
3267 xcb_input_get_device_modifier_mapping_cookie_t xcb_ret;
3268 xcb_input_get_device_modifier_mapping_request_t xcb_out;
3270 xcb_out.device_id = device_id;
3271 memset(xcb_out.pad0, 0, 3);
3273 xcb_parts[2].iov_base = (char *) &xcb_out;
3274 xcb_parts[2].iov_len = sizeof(xcb_out);
3275 xcb_parts[3].iov_base = 0;
3276 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3278 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3279 return xcb_ret;
3282 uint8_t *
3283 xcb_input_get_device_modifier_mapping_keymaps (const xcb_input_get_device_modifier_mapping_reply_t *R /**< */)
3285 return (uint8_t *) (R + 1);
3289 xcb_input_get_device_modifier_mapping_keymaps_length (const xcb_input_get_device_modifier_mapping_reply_t *R /**< */)
3291 return (R->keycodes_per_modifier * 8);
3294 xcb_generic_iterator_t
3295 xcb_input_get_device_modifier_mapping_keymaps_end (const xcb_input_get_device_modifier_mapping_reply_t *R /**< */)
3297 xcb_generic_iterator_t i;
3298 i.data = ((uint8_t *) (R + 1)) + ((R->keycodes_per_modifier * 8));
3299 i.rem = 0;
3300 i.index = (char *) i.data - (char *) R;
3301 return i;
3304 xcb_input_get_device_modifier_mapping_reply_t *
3305 xcb_input_get_device_modifier_mapping_reply (xcb_connection_t *c /**< */,
3306 xcb_input_get_device_modifier_mapping_cookie_t cookie /**< */,
3307 xcb_generic_error_t **e /**< */)
3309 return (xcb_input_get_device_modifier_mapping_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
3313 xcb_input_set_device_modifier_mapping_sizeof (const void *_buffer /**< */)
3315 char *xcb_tmp = (char *)_buffer;
3316 const xcb_input_set_device_modifier_mapping_request_t *_aux = (xcb_input_set_device_modifier_mapping_request_t *)_buffer;
3317 unsigned int xcb_buffer_len = 0;
3318 unsigned int xcb_block_len = 0;
3319 unsigned int xcb_pad = 0;
3320 unsigned int xcb_align_to = 0;
3323 xcb_block_len += sizeof(xcb_input_set_device_modifier_mapping_request_t);
3324 xcb_tmp += xcb_block_len;
3325 xcb_buffer_len += xcb_block_len;
3326 xcb_block_len = 0;
3327 /* keymaps */
3328 xcb_block_len += (_aux->keycodes_per_modifier * 8) * sizeof(uint8_t);
3329 xcb_tmp += xcb_block_len;
3330 xcb_align_to = ALIGNOF(uint8_t);
3331 /* insert padding */
3332 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3333 xcb_buffer_len += xcb_block_len + xcb_pad;
3334 if (0 != xcb_pad) {
3335 xcb_tmp += xcb_pad;
3336 xcb_pad = 0;
3338 xcb_block_len = 0;
3340 return xcb_buffer_len;
3343 xcb_input_set_device_modifier_mapping_cookie_t
3344 xcb_input_set_device_modifier_mapping (xcb_connection_t *c /**< */,
3345 uint8_t device_id /**< */,
3346 uint8_t keycodes_per_modifier /**< */,
3347 const uint8_t *keymaps /**< */)
3349 static const xcb_protocol_request_t xcb_req = {
3350 /* count */ 4,
3351 /* ext */ &xcb_input_id,
3352 /* opcode */ XCB_INPUT_SET_DEVICE_MODIFIER_MAPPING,
3353 /* isvoid */ 0
3356 struct iovec xcb_parts[6];
3357 xcb_input_set_device_modifier_mapping_cookie_t xcb_ret;
3358 xcb_input_set_device_modifier_mapping_request_t xcb_out;
3360 xcb_out.device_id = device_id;
3361 xcb_out.keycodes_per_modifier = keycodes_per_modifier;
3362 xcb_out.pad0 = 0;
3364 xcb_parts[2].iov_base = (char *) &xcb_out;
3365 xcb_parts[2].iov_len = sizeof(xcb_out);
3366 xcb_parts[3].iov_base = 0;
3367 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3368 /* uint8_t keymaps */
3369 xcb_parts[4].iov_base = (char *) keymaps;
3370 xcb_parts[4].iov_len = (keycodes_per_modifier * 8) * sizeof(uint8_t);
3371 xcb_parts[5].iov_base = 0;
3372 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
3374 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3375 return xcb_ret;
3378 xcb_input_set_device_modifier_mapping_cookie_t
3379 xcb_input_set_device_modifier_mapping_unchecked (xcb_connection_t *c /**< */,
3380 uint8_t device_id /**< */,
3381 uint8_t keycodes_per_modifier /**< */,
3382 const uint8_t *keymaps /**< */)
3384 static const xcb_protocol_request_t xcb_req = {
3385 /* count */ 4,
3386 /* ext */ &xcb_input_id,
3387 /* opcode */ XCB_INPUT_SET_DEVICE_MODIFIER_MAPPING,
3388 /* isvoid */ 0
3391 struct iovec xcb_parts[6];
3392 xcb_input_set_device_modifier_mapping_cookie_t xcb_ret;
3393 xcb_input_set_device_modifier_mapping_request_t xcb_out;
3395 xcb_out.device_id = device_id;
3396 xcb_out.keycodes_per_modifier = keycodes_per_modifier;
3397 xcb_out.pad0 = 0;
3399 xcb_parts[2].iov_base = (char *) &xcb_out;
3400 xcb_parts[2].iov_len = sizeof(xcb_out);
3401 xcb_parts[3].iov_base = 0;
3402 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3403 /* uint8_t keymaps */
3404 xcb_parts[4].iov_base = (char *) keymaps;
3405 xcb_parts[4].iov_len = (keycodes_per_modifier * 8) * sizeof(uint8_t);
3406 xcb_parts[5].iov_base = 0;
3407 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
3409 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3410 return xcb_ret;
3413 xcb_input_set_device_modifier_mapping_reply_t *
3414 xcb_input_set_device_modifier_mapping_reply (xcb_connection_t *c /**< */,
3415 xcb_input_set_device_modifier_mapping_cookie_t cookie /**< */,
3416 xcb_generic_error_t **e /**< */)
3418 return (xcb_input_set_device_modifier_mapping_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
3422 xcb_input_get_device_button_mapping_sizeof (const void *_buffer /**< */)
3424 char *xcb_tmp = (char *)_buffer;
3425 const xcb_input_get_device_button_mapping_reply_t *_aux = (xcb_input_get_device_button_mapping_reply_t *)_buffer;
3426 unsigned int xcb_buffer_len = 0;
3427 unsigned int xcb_block_len = 0;
3428 unsigned int xcb_pad = 0;
3429 unsigned int xcb_align_to = 0;
3432 xcb_block_len += sizeof(xcb_input_get_device_button_mapping_reply_t);
3433 xcb_tmp += xcb_block_len;
3434 xcb_buffer_len += xcb_block_len;
3435 xcb_block_len = 0;
3436 /* map */
3437 xcb_block_len += _aux->map_size * sizeof(uint8_t);
3438 xcb_tmp += xcb_block_len;
3439 xcb_align_to = ALIGNOF(uint8_t);
3440 /* insert padding */
3441 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3442 xcb_buffer_len += xcb_block_len + xcb_pad;
3443 if (0 != xcb_pad) {
3444 xcb_tmp += xcb_pad;
3445 xcb_pad = 0;
3447 xcb_block_len = 0;
3449 return xcb_buffer_len;
3452 xcb_input_get_device_button_mapping_cookie_t
3453 xcb_input_get_device_button_mapping (xcb_connection_t *c /**< */,
3454 uint8_t device_id /**< */)
3456 static const xcb_protocol_request_t xcb_req = {
3457 /* count */ 2,
3458 /* ext */ &xcb_input_id,
3459 /* opcode */ XCB_INPUT_GET_DEVICE_BUTTON_MAPPING,
3460 /* isvoid */ 0
3463 struct iovec xcb_parts[4];
3464 xcb_input_get_device_button_mapping_cookie_t xcb_ret;
3465 xcb_input_get_device_button_mapping_request_t xcb_out;
3467 xcb_out.device_id = device_id;
3468 memset(xcb_out.pad0, 0, 3);
3470 xcb_parts[2].iov_base = (char *) &xcb_out;
3471 xcb_parts[2].iov_len = sizeof(xcb_out);
3472 xcb_parts[3].iov_base = 0;
3473 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3475 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3476 return xcb_ret;
3479 xcb_input_get_device_button_mapping_cookie_t
3480 xcb_input_get_device_button_mapping_unchecked (xcb_connection_t *c /**< */,
3481 uint8_t device_id /**< */)
3483 static const xcb_protocol_request_t xcb_req = {
3484 /* count */ 2,
3485 /* ext */ &xcb_input_id,
3486 /* opcode */ XCB_INPUT_GET_DEVICE_BUTTON_MAPPING,
3487 /* isvoid */ 0
3490 struct iovec xcb_parts[4];
3491 xcb_input_get_device_button_mapping_cookie_t xcb_ret;
3492 xcb_input_get_device_button_mapping_request_t xcb_out;
3494 xcb_out.device_id = device_id;
3495 memset(xcb_out.pad0, 0, 3);
3497 xcb_parts[2].iov_base = (char *) &xcb_out;
3498 xcb_parts[2].iov_len = sizeof(xcb_out);
3499 xcb_parts[3].iov_base = 0;
3500 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3502 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3503 return xcb_ret;
3506 uint8_t *
3507 xcb_input_get_device_button_mapping_map (const xcb_input_get_device_button_mapping_reply_t *R /**< */)
3509 return (uint8_t *) (R + 1);
3513 xcb_input_get_device_button_mapping_map_length (const xcb_input_get_device_button_mapping_reply_t *R /**< */)
3515 return R->map_size;
3518 xcb_generic_iterator_t
3519 xcb_input_get_device_button_mapping_map_end (const xcb_input_get_device_button_mapping_reply_t *R /**< */)
3521 xcb_generic_iterator_t i;
3522 i.data = ((uint8_t *) (R + 1)) + (R->map_size);
3523 i.rem = 0;
3524 i.index = (char *) i.data - (char *) R;
3525 return i;
3528 xcb_input_get_device_button_mapping_reply_t *
3529 xcb_input_get_device_button_mapping_reply (xcb_connection_t *c /**< */,
3530 xcb_input_get_device_button_mapping_cookie_t cookie /**< */,
3531 xcb_generic_error_t **e /**< */)
3533 return (xcb_input_get_device_button_mapping_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
3537 xcb_input_set_device_button_mapping_sizeof (const void *_buffer /**< */)
3539 char *xcb_tmp = (char *)_buffer;
3540 const xcb_input_set_device_button_mapping_request_t *_aux = (xcb_input_set_device_button_mapping_request_t *)_buffer;
3541 unsigned int xcb_buffer_len = 0;
3542 unsigned int xcb_block_len = 0;
3543 unsigned int xcb_pad = 0;
3544 unsigned int xcb_align_to = 0;
3547 xcb_block_len += sizeof(xcb_input_set_device_button_mapping_request_t);
3548 xcb_tmp += xcb_block_len;
3549 xcb_buffer_len += xcb_block_len;
3550 xcb_block_len = 0;
3551 /* map */
3552 xcb_block_len += _aux->map_size * sizeof(uint8_t);
3553 xcb_tmp += xcb_block_len;
3554 xcb_align_to = ALIGNOF(uint8_t);
3555 /* insert padding */
3556 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3557 xcb_buffer_len += xcb_block_len + xcb_pad;
3558 if (0 != xcb_pad) {
3559 xcb_tmp += xcb_pad;
3560 xcb_pad = 0;
3562 xcb_block_len = 0;
3564 return xcb_buffer_len;
3567 xcb_input_set_device_button_mapping_cookie_t
3568 xcb_input_set_device_button_mapping (xcb_connection_t *c /**< */,
3569 uint8_t device_id /**< */,
3570 uint8_t map_size /**< */,
3571 const uint8_t *map /**< */)
3573 static const xcb_protocol_request_t xcb_req = {
3574 /* count */ 4,
3575 /* ext */ &xcb_input_id,
3576 /* opcode */ XCB_INPUT_SET_DEVICE_BUTTON_MAPPING,
3577 /* isvoid */ 0
3580 struct iovec xcb_parts[6];
3581 xcb_input_set_device_button_mapping_cookie_t xcb_ret;
3582 xcb_input_set_device_button_mapping_request_t xcb_out;
3584 xcb_out.device_id = device_id;
3585 xcb_out.map_size = map_size;
3586 memset(xcb_out.pad0, 0, 2);
3588 xcb_parts[2].iov_base = (char *) &xcb_out;
3589 xcb_parts[2].iov_len = sizeof(xcb_out);
3590 xcb_parts[3].iov_base = 0;
3591 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3592 /* uint8_t map */
3593 xcb_parts[4].iov_base = (char *) map;
3594 xcb_parts[4].iov_len = map_size * sizeof(uint8_t);
3595 xcb_parts[5].iov_base = 0;
3596 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
3598 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3599 return xcb_ret;
3602 xcb_input_set_device_button_mapping_cookie_t
3603 xcb_input_set_device_button_mapping_unchecked (xcb_connection_t *c /**< */,
3604 uint8_t device_id /**< */,
3605 uint8_t map_size /**< */,
3606 const uint8_t *map /**< */)
3608 static const xcb_protocol_request_t xcb_req = {
3609 /* count */ 4,
3610 /* ext */ &xcb_input_id,
3611 /* opcode */ XCB_INPUT_SET_DEVICE_BUTTON_MAPPING,
3612 /* isvoid */ 0
3615 struct iovec xcb_parts[6];
3616 xcb_input_set_device_button_mapping_cookie_t xcb_ret;
3617 xcb_input_set_device_button_mapping_request_t xcb_out;
3619 xcb_out.device_id = device_id;
3620 xcb_out.map_size = map_size;
3621 memset(xcb_out.pad0, 0, 2);
3623 xcb_parts[2].iov_base = (char *) &xcb_out;
3624 xcb_parts[2].iov_len = sizeof(xcb_out);
3625 xcb_parts[3].iov_base = 0;
3626 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3627 /* uint8_t map */
3628 xcb_parts[4].iov_base = (char *) map;
3629 xcb_parts[4].iov_len = map_size * sizeof(uint8_t);
3630 xcb_parts[5].iov_base = 0;
3631 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
3633 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3634 return xcb_ret;
3637 xcb_input_set_device_button_mapping_reply_t *
3638 xcb_input_set_device_button_mapping_reply (xcb_connection_t *c /**< */,
3639 xcb_input_set_device_button_mapping_cookie_t cookie /**< */,
3640 xcb_generic_error_t **e /**< */)
3642 return (xcb_input_set_device_button_mapping_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
3645 void
3646 xcb_input_key_state_next (xcb_input_key_state_iterator_t *i /**< */)
3648 --i->rem;
3649 ++i->data;
3650 i->index += sizeof(xcb_input_key_state_t);
3653 xcb_generic_iterator_t
3654 xcb_input_key_state_end (xcb_input_key_state_iterator_t i /**< */)
3656 xcb_generic_iterator_t ret;
3657 ret.data = i.data + i.rem;
3658 ret.index = i.index + ((char *) ret.data - (char *) i.data);
3659 ret.rem = 0;
3660 return ret;
3663 void
3664 xcb_input_button_state_next (xcb_input_button_state_iterator_t *i /**< */)
3666 --i->rem;
3667 ++i->data;
3668 i->index += sizeof(xcb_input_button_state_t);
3671 xcb_generic_iterator_t
3672 xcb_input_button_state_end (xcb_input_button_state_iterator_t i /**< */)
3674 xcb_generic_iterator_t ret;
3675 ret.data = i.data + i.rem;
3676 ret.index = i.index + ((char *) ret.data - (char *) i.data);
3677 ret.rem = 0;
3678 return ret;
3682 xcb_input_valuator_state_sizeof (const void *_buffer /**< */)
3684 char *xcb_tmp = (char *)_buffer;
3685 const xcb_input_valuator_state_t *_aux = (xcb_input_valuator_state_t *)_buffer;
3686 unsigned int xcb_buffer_len = 0;
3687 unsigned int xcb_block_len = 0;
3688 unsigned int xcb_pad = 0;
3689 unsigned int xcb_align_to = 0;
3692 xcb_block_len += sizeof(xcb_input_valuator_state_t);
3693 xcb_tmp += xcb_block_len;
3694 xcb_buffer_len += xcb_block_len;
3695 xcb_block_len = 0;
3696 /* valuators */
3697 xcb_block_len += _aux->num_valuators * sizeof(uint32_t);
3698 xcb_tmp += xcb_block_len;
3699 xcb_align_to = ALIGNOF(uint32_t);
3700 /* insert padding */
3701 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3702 xcb_buffer_len += xcb_block_len + xcb_pad;
3703 if (0 != xcb_pad) {
3704 xcb_tmp += xcb_pad;
3705 xcb_pad = 0;
3707 xcb_block_len = 0;
3709 return xcb_buffer_len;
3712 uint32_t *
3713 xcb_input_valuator_state_valuators (const xcb_input_valuator_state_t *R /**< */)
3715 return (uint32_t *) (R + 1);
3719 xcb_input_valuator_state_valuators_length (const xcb_input_valuator_state_t *R /**< */)
3721 return R->num_valuators;
3724 xcb_generic_iterator_t
3725 xcb_input_valuator_state_valuators_end (const xcb_input_valuator_state_t *R /**< */)
3727 xcb_generic_iterator_t i;
3728 i.data = ((uint32_t *) (R + 1)) + (R->num_valuators);
3729 i.rem = 0;
3730 i.index = (char *) i.data - (char *) R;
3731 return i;
3734 void
3735 xcb_input_valuator_state_next (xcb_input_valuator_state_iterator_t *i /**< */)
3737 xcb_input_valuator_state_t *R = i->data;
3738 xcb_generic_iterator_t child;
3739 child.data = (xcb_input_valuator_state_t *)(((char *)R) + xcb_input_valuator_state_sizeof(R));
3740 i->index = (char *) child.data - (char *) i->data;
3741 --i->rem;
3742 i->data = (xcb_input_valuator_state_t *) child.data;
3745 xcb_generic_iterator_t
3746 xcb_input_valuator_state_end (xcb_input_valuator_state_iterator_t i /**< */)
3748 xcb_generic_iterator_t ret;
3749 while(i.rem > 0)
3750 xcb_input_valuator_state_next(&i);
3751 ret.data = i.data;
3752 ret.rem = i.rem;
3753 ret.index = i.index;
3754 return ret;
3758 xcb_input_input_state_sizeof (const void *_buffer /**< */)
3760 char *xcb_tmp = (char *)_buffer;
3761 const xcb_input_input_state_t *_aux = (xcb_input_input_state_t *)_buffer;
3762 unsigned int xcb_buffer_len = 0;
3763 unsigned int xcb_block_len = 0;
3764 unsigned int xcb_pad = 0;
3765 unsigned int xcb_align_to = 0;
3768 xcb_block_len += sizeof(xcb_input_input_state_t);
3769 xcb_tmp += xcb_block_len;
3770 xcb_buffer_len += xcb_block_len;
3771 xcb_block_len = 0;
3772 /* uninterpreted_data */
3773 xcb_block_len += (_aux->len - 4) * sizeof(uint8_t);
3774 xcb_tmp += xcb_block_len;
3775 xcb_align_to = ALIGNOF(uint8_t);
3776 /* insert padding */
3777 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3778 xcb_buffer_len += xcb_block_len + xcb_pad;
3779 if (0 != xcb_pad) {
3780 xcb_tmp += xcb_pad;
3781 xcb_pad = 0;
3783 xcb_block_len = 0;
3785 return xcb_buffer_len;
3788 uint8_t *
3789 xcb_input_input_state_uninterpreted_data (const xcb_input_input_state_t *R /**< */)
3791 return (uint8_t *) (R + 1);
3795 xcb_input_input_state_uninterpreted_data_length (const xcb_input_input_state_t *R /**< */)
3797 return (R->len - 4);
3800 xcb_generic_iterator_t
3801 xcb_input_input_state_uninterpreted_data_end (const xcb_input_input_state_t *R /**< */)
3803 xcb_generic_iterator_t i;
3804 i.data = ((uint8_t *) (R + 1)) + ((R->len - 4));
3805 i.rem = 0;
3806 i.index = (char *) i.data - (char *) R;
3807 return i;
3810 void
3811 xcb_input_input_state_next (xcb_input_input_state_iterator_t *i /**< */)
3813 xcb_input_input_state_t *R = i->data;
3814 xcb_generic_iterator_t child;
3815 child.data = (xcb_input_input_state_t *)(((char *)R) + xcb_input_input_state_sizeof(R));
3816 i->index = (char *) child.data - (char *) i->data;
3817 --i->rem;
3818 i->data = (xcb_input_input_state_t *) child.data;
3821 xcb_generic_iterator_t
3822 xcb_input_input_state_end (xcb_input_input_state_iterator_t i /**< */)
3824 xcb_generic_iterator_t ret;
3825 while(i.rem > 0)
3826 xcb_input_input_state_next(&i);
3827 ret.data = i.data;
3828 ret.rem = i.rem;
3829 ret.index = i.index;
3830 return ret;
3834 xcb_input_query_device_state_sizeof (const void *_buffer /**< */)
3836 char *xcb_tmp = (char *)_buffer;
3837 const xcb_input_query_device_state_reply_t *_aux = (xcb_input_query_device_state_reply_t *)_buffer;
3838 unsigned int xcb_buffer_len = 0;
3839 unsigned int xcb_block_len = 0;
3840 unsigned int xcb_pad = 0;
3841 unsigned int xcb_align_to = 0;
3843 unsigned int i;
3844 unsigned int xcb_tmp_len;
3846 xcb_block_len += sizeof(xcb_input_query_device_state_reply_t);
3847 xcb_tmp += xcb_block_len;
3848 xcb_buffer_len += xcb_block_len;
3849 xcb_block_len = 0;
3850 /* classes */
3851 for(i=0; i<_aux->num_classes; i++) {
3852 xcb_tmp_len = xcb_input_input_state_sizeof(xcb_tmp);
3853 xcb_block_len += xcb_tmp_len;
3854 xcb_tmp += xcb_tmp_len;
3856 xcb_align_to = ALIGNOF(xcb_input_input_state_t);
3857 /* insert padding */
3858 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3859 xcb_buffer_len += xcb_block_len + xcb_pad;
3860 if (0 != xcb_pad) {
3861 xcb_tmp += xcb_pad;
3862 xcb_pad = 0;
3864 xcb_block_len = 0;
3866 return xcb_buffer_len;
3869 xcb_input_query_device_state_cookie_t
3870 xcb_input_query_device_state (xcb_connection_t *c /**< */,
3871 uint8_t device_id /**< */)
3873 static const xcb_protocol_request_t xcb_req = {
3874 /* count */ 2,
3875 /* ext */ &xcb_input_id,
3876 /* opcode */ XCB_INPUT_QUERY_DEVICE_STATE,
3877 /* isvoid */ 0
3880 struct iovec xcb_parts[4];
3881 xcb_input_query_device_state_cookie_t xcb_ret;
3882 xcb_input_query_device_state_request_t xcb_out;
3884 xcb_out.device_id = device_id;
3885 memset(xcb_out.pad0, 0, 3);
3887 xcb_parts[2].iov_base = (char *) &xcb_out;
3888 xcb_parts[2].iov_len = sizeof(xcb_out);
3889 xcb_parts[3].iov_base = 0;
3890 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3892 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3893 return xcb_ret;
3896 xcb_input_query_device_state_cookie_t
3897 xcb_input_query_device_state_unchecked (xcb_connection_t *c /**< */,
3898 uint8_t device_id /**< */)
3900 static const xcb_protocol_request_t xcb_req = {
3901 /* count */ 2,
3902 /* ext */ &xcb_input_id,
3903 /* opcode */ XCB_INPUT_QUERY_DEVICE_STATE,
3904 /* isvoid */ 0
3907 struct iovec xcb_parts[4];
3908 xcb_input_query_device_state_cookie_t xcb_ret;
3909 xcb_input_query_device_state_request_t xcb_out;
3911 xcb_out.device_id = device_id;
3912 memset(xcb_out.pad0, 0, 3);
3914 xcb_parts[2].iov_base = (char *) &xcb_out;
3915 xcb_parts[2].iov_len = sizeof(xcb_out);
3916 xcb_parts[3].iov_base = 0;
3917 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3919 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3920 return xcb_ret;
3924 xcb_input_query_device_state_classes_length (const xcb_input_query_device_state_reply_t *R /**< */)
3926 return R->num_classes;
3929 xcb_input_input_state_iterator_t
3930 xcb_input_query_device_state_classes_iterator (const xcb_input_query_device_state_reply_t *R /**< */)
3932 xcb_input_input_state_iterator_t i;
3933 i.data = (xcb_input_input_state_t *) (R + 1);
3934 i.rem = R->num_classes;
3935 i.index = (char *) i.data - (char *) R;
3936 return i;
3939 xcb_input_query_device_state_reply_t *
3940 xcb_input_query_device_state_reply (xcb_connection_t *c /**< */,
3941 xcb_input_query_device_state_cookie_t cookie /**< */,
3942 xcb_generic_error_t **e /**< */)
3944 return (xcb_input_query_device_state_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
3948 xcb_input_send_extension_event_sizeof (const void *_buffer /**< */)
3950 char *xcb_tmp = (char *)_buffer;
3951 const xcb_input_send_extension_event_request_t *_aux = (xcb_input_send_extension_event_request_t *)_buffer;
3952 unsigned int xcb_buffer_len = 0;
3953 unsigned int xcb_block_len = 0;
3954 unsigned int xcb_pad = 0;
3955 unsigned int xcb_align_to = 0;
3958 xcb_block_len += sizeof(xcb_input_send_extension_event_request_t);
3959 xcb_tmp += xcb_block_len;
3960 xcb_buffer_len += xcb_block_len;
3961 xcb_block_len = 0;
3962 /* events */
3963 xcb_block_len += (_aux->num_events * 32) * sizeof(uint8_t);
3964 xcb_tmp += xcb_block_len;
3965 xcb_align_to = ALIGNOF(uint8_t);
3966 /* insert padding */
3967 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3968 xcb_buffer_len += xcb_block_len + xcb_pad;
3969 if (0 != xcb_pad) {
3970 xcb_tmp += xcb_pad;
3971 xcb_pad = 0;
3973 xcb_block_len = 0;
3974 /* classes */
3975 xcb_block_len += _aux->num_classes * sizeof(xcb_input_event_class_t);
3976 xcb_tmp += xcb_block_len;
3977 xcb_align_to = ALIGNOF(xcb_input_event_class_t);
3978 /* insert padding */
3979 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3980 xcb_buffer_len += xcb_block_len + xcb_pad;
3981 if (0 != xcb_pad) {
3982 xcb_tmp += xcb_pad;
3983 xcb_pad = 0;
3985 xcb_block_len = 0;
3987 return xcb_buffer_len;
3990 xcb_void_cookie_t
3991 xcb_input_send_extension_event_checked (xcb_connection_t *c /**< */,
3992 xcb_window_t destination /**< */,
3993 uint8_t device_id /**< */,
3994 uint8_t propagate /**< */,
3995 uint16_t num_classes /**< */,
3996 uint8_t num_events /**< */,
3997 const uint8_t *events /**< */,
3998 const xcb_input_event_class_t *classes /**< */)
4000 static const xcb_protocol_request_t xcb_req = {
4001 /* count */ 6,
4002 /* ext */ &xcb_input_id,
4003 /* opcode */ XCB_INPUT_SEND_EXTENSION_EVENT,
4004 /* isvoid */ 1
4007 struct iovec xcb_parts[8];
4008 xcb_void_cookie_t xcb_ret;
4009 xcb_input_send_extension_event_request_t xcb_out;
4011 xcb_out.destination = destination;
4012 xcb_out.device_id = device_id;
4013 xcb_out.propagate = propagate;
4014 xcb_out.num_classes = num_classes;
4015 xcb_out.num_events = num_events;
4016 memset(xcb_out.pad0, 0, 3);
4018 xcb_parts[2].iov_base = (char *) &xcb_out;
4019 xcb_parts[2].iov_len = sizeof(xcb_out);
4020 xcb_parts[3].iov_base = 0;
4021 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4022 /* uint8_t events */
4023 xcb_parts[4].iov_base = (char *) events;
4024 xcb_parts[4].iov_len = (num_events * 32) * sizeof(uint8_t);
4025 xcb_parts[5].iov_base = 0;
4026 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
4027 /* xcb_input_event_class_t classes */
4028 xcb_parts[6].iov_base = (char *) classes;
4029 xcb_parts[6].iov_len = num_classes * sizeof(xcb_input_event_class_t);
4030 xcb_parts[7].iov_base = 0;
4031 xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3;
4033 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
4034 return xcb_ret;
4037 xcb_void_cookie_t
4038 xcb_input_send_extension_event (xcb_connection_t *c /**< */,
4039 xcb_window_t destination /**< */,
4040 uint8_t device_id /**< */,
4041 uint8_t propagate /**< */,
4042 uint16_t num_classes /**< */,
4043 uint8_t num_events /**< */,
4044 const uint8_t *events /**< */,
4045 const xcb_input_event_class_t *classes /**< */)
4047 static const xcb_protocol_request_t xcb_req = {
4048 /* count */ 6,
4049 /* ext */ &xcb_input_id,
4050 /* opcode */ XCB_INPUT_SEND_EXTENSION_EVENT,
4051 /* isvoid */ 1
4054 struct iovec xcb_parts[8];
4055 xcb_void_cookie_t xcb_ret;
4056 xcb_input_send_extension_event_request_t xcb_out;
4058 xcb_out.destination = destination;
4059 xcb_out.device_id = device_id;
4060 xcb_out.propagate = propagate;
4061 xcb_out.num_classes = num_classes;
4062 xcb_out.num_events = num_events;
4063 memset(xcb_out.pad0, 0, 3);
4065 xcb_parts[2].iov_base = (char *) &xcb_out;
4066 xcb_parts[2].iov_len = sizeof(xcb_out);
4067 xcb_parts[3].iov_base = 0;
4068 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4069 /* uint8_t events */
4070 xcb_parts[4].iov_base = (char *) events;
4071 xcb_parts[4].iov_len = (num_events * 32) * sizeof(uint8_t);
4072 xcb_parts[5].iov_base = 0;
4073 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
4074 /* xcb_input_event_class_t classes */
4075 xcb_parts[6].iov_base = (char *) classes;
4076 xcb_parts[6].iov_len = num_classes * sizeof(xcb_input_event_class_t);
4077 xcb_parts[7].iov_base = 0;
4078 xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3;
4080 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
4081 return xcb_ret;
4084 xcb_void_cookie_t
4085 xcb_input_device_bell_checked (xcb_connection_t *c /**< */,
4086 uint8_t device_id /**< */,
4087 uint8_t feedback_id /**< */,
4088 uint8_t feedback_class /**< */,
4089 int8_t percent /**< */)
4091 static const xcb_protocol_request_t xcb_req = {
4092 /* count */ 2,
4093 /* ext */ &xcb_input_id,
4094 /* opcode */ XCB_INPUT_DEVICE_BELL,
4095 /* isvoid */ 1
4098 struct iovec xcb_parts[4];
4099 xcb_void_cookie_t xcb_ret;
4100 xcb_input_device_bell_request_t xcb_out;
4102 xcb_out.device_id = device_id;
4103 xcb_out.feedback_id = feedback_id;
4104 xcb_out.feedback_class = feedback_class;
4105 xcb_out.percent = percent;
4107 xcb_parts[2].iov_base = (char *) &xcb_out;
4108 xcb_parts[2].iov_len = sizeof(xcb_out);
4109 xcb_parts[3].iov_base = 0;
4110 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4112 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
4113 return xcb_ret;
4116 xcb_void_cookie_t
4117 xcb_input_device_bell (xcb_connection_t *c /**< */,
4118 uint8_t device_id /**< */,
4119 uint8_t feedback_id /**< */,
4120 uint8_t feedback_class /**< */,
4121 int8_t percent /**< */)
4123 static const xcb_protocol_request_t xcb_req = {
4124 /* count */ 2,
4125 /* ext */ &xcb_input_id,
4126 /* opcode */ XCB_INPUT_DEVICE_BELL,
4127 /* isvoid */ 1
4130 struct iovec xcb_parts[4];
4131 xcb_void_cookie_t xcb_ret;
4132 xcb_input_device_bell_request_t xcb_out;
4134 xcb_out.device_id = device_id;
4135 xcb_out.feedback_id = feedback_id;
4136 xcb_out.feedback_class = feedback_class;
4137 xcb_out.percent = percent;
4139 xcb_parts[2].iov_base = (char *) &xcb_out;
4140 xcb_parts[2].iov_len = sizeof(xcb_out);
4141 xcb_parts[3].iov_base = 0;
4142 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4144 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
4145 return xcb_ret;
4149 xcb_input_set_device_valuators_sizeof (const void *_buffer /**< */)
4151 char *xcb_tmp = (char *)_buffer;
4152 const xcb_input_set_device_valuators_request_t *_aux = (xcb_input_set_device_valuators_request_t *)_buffer;
4153 unsigned int xcb_buffer_len = 0;
4154 unsigned int xcb_block_len = 0;
4155 unsigned int xcb_pad = 0;
4156 unsigned int xcb_align_to = 0;
4159 xcb_block_len += sizeof(xcb_input_set_device_valuators_request_t);
4160 xcb_tmp += xcb_block_len;
4161 xcb_buffer_len += xcb_block_len;
4162 xcb_block_len = 0;
4163 /* valuators */
4164 xcb_block_len += _aux->num_valuators * sizeof(int32_t);
4165 xcb_tmp += xcb_block_len;
4166 xcb_align_to = ALIGNOF(int32_t);
4167 /* insert padding */
4168 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4169 xcb_buffer_len += xcb_block_len + xcb_pad;
4170 if (0 != xcb_pad) {
4171 xcb_tmp += xcb_pad;
4172 xcb_pad = 0;
4174 xcb_block_len = 0;
4176 return xcb_buffer_len;
4179 xcb_input_set_device_valuators_cookie_t
4180 xcb_input_set_device_valuators (xcb_connection_t *c /**< */,
4181 uint8_t device_id /**< */,
4182 uint8_t first_valuator /**< */,
4183 uint8_t num_valuators /**< */,
4184 const int32_t *valuators /**< */)
4186 static const xcb_protocol_request_t xcb_req = {
4187 /* count */ 4,
4188 /* ext */ &xcb_input_id,
4189 /* opcode */ XCB_INPUT_SET_DEVICE_VALUATORS,
4190 /* isvoid */ 0
4193 struct iovec xcb_parts[6];
4194 xcb_input_set_device_valuators_cookie_t xcb_ret;
4195 xcb_input_set_device_valuators_request_t xcb_out;
4197 xcb_out.device_id = device_id;
4198 xcb_out.first_valuator = first_valuator;
4199 xcb_out.num_valuators = num_valuators;
4200 xcb_out.pad0 = 0;
4202 xcb_parts[2].iov_base = (char *) &xcb_out;
4203 xcb_parts[2].iov_len = sizeof(xcb_out);
4204 xcb_parts[3].iov_base = 0;
4205 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4206 /* int32_t valuators */
4207 xcb_parts[4].iov_base = (char *) valuators;
4208 xcb_parts[4].iov_len = num_valuators * sizeof(int32_t);
4209 xcb_parts[5].iov_base = 0;
4210 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
4212 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
4213 return xcb_ret;
4216 xcb_input_set_device_valuators_cookie_t
4217 xcb_input_set_device_valuators_unchecked (xcb_connection_t *c /**< */,
4218 uint8_t device_id /**< */,
4219 uint8_t first_valuator /**< */,
4220 uint8_t num_valuators /**< */,
4221 const int32_t *valuators /**< */)
4223 static const xcb_protocol_request_t xcb_req = {
4224 /* count */ 4,
4225 /* ext */ &xcb_input_id,
4226 /* opcode */ XCB_INPUT_SET_DEVICE_VALUATORS,
4227 /* isvoid */ 0
4230 struct iovec xcb_parts[6];
4231 xcb_input_set_device_valuators_cookie_t xcb_ret;
4232 xcb_input_set_device_valuators_request_t xcb_out;
4234 xcb_out.device_id = device_id;
4235 xcb_out.first_valuator = first_valuator;
4236 xcb_out.num_valuators = num_valuators;
4237 xcb_out.pad0 = 0;
4239 xcb_parts[2].iov_base = (char *) &xcb_out;
4240 xcb_parts[2].iov_len = sizeof(xcb_out);
4241 xcb_parts[3].iov_base = 0;
4242 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4243 /* int32_t valuators */
4244 xcb_parts[4].iov_base = (char *) valuators;
4245 xcb_parts[4].iov_len = num_valuators * sizeof(int32_t);
4246 xcb_parts[5].iov_base = 0;
4247 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
4249 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
4250 return xcb_ret;
4253 xcb_input_set_device_valuators_reply_t *
4254 xcb_input_set_device_valuators_reply (xcb_connection_t *c /**< */,
4255 xcb_input_set_device_valuators_cookie_t cookie /**< */,
4256 xcb_generic_error_t **e /**< */)
4258 return (xcb_input_set_device_valuators_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
4262 xcb_input_device_resolution_state_sizeof (const void *_buffer /**< */)
4264 char *xcb_tmp = (char *)_buffer;
4265 const xcb_input_device_resolution_state_t *_aux = (xcb_input_device_resolution_state_t *)_buffer;
4266 unsigned int xcb_buffer_len = 0;
4267 unsigned int xcb_block_len = 0;
4268 unsigned int xcb_pad = 0;
4269 unsigned int xcb_align_to = 0;
4272 xcb_block_len += sizeof(xcb_input_device_resolution_state_t);
4273 xcb_tmp += xcb_block_len;
4274 xcb_buffer_len += xcb_block_len;
4275 xcb_block_len = 0;
4276 /* resolution_values */
4277 xcb_block_len += _aux->num_valuators * sizeof(uint32_t);
4278 xcb_tmp += xcb_block_len;
4279 xcb_align_to = ALIGNOF(uint32_t);
4280 /* insert padding */
4281 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4282 xcb_buffer_len += xcb_block_len + xcb_pad;
4283 if (0 != xcb_pad) {
4284 xcb_tmp += xcb_pad;
4285 xcb_pad = 0;
4287 xcb_block_len = 0;
4288 /* resolution_min */
4289 xcb_block_len += _aux->num_valuators * sizeof(uint32_t);
4290 xcb_tmp += xcb_block_len;
4291 xcb_align_to = ALIGNOF(uint32_t);
4292 /* insert padding */
4293 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4294 xcb_buffer_len += xcb_block_len + xcb_pad;
4295 if (0 != xcb_pad) {
4296 xcb_tmp += xcb_pad;
4297 xcb_pad = 0;
4299 xcb_block_len = 0;
4300 /* resolution_max */
4301 xcb_block_len += _aux->num_valuators * sizeof(uint32_t);
4302 xcb_tmp += xcb_block_len;
4303 xcb_align_to = ALIGNOF(uint32_t);
4304 /* insert padding */
4305 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4306 xcb_buffer_len += xcb_block_len + xcb_pad;
4307 if (0 != xcb_pad) {
4308 xcb_tmp += xcb_pad;
4309 xcb_pad = 0;
4311 xcb_block_len = 0;
4313 return xcb_buffer_len;
4316 uint32_t *
4317 xcb_input_device_resolution_state_resolution_values (const xcb_input_device_resolution_state_t *R /**< */)
4319 return (uint32_t *) (R + 1);
4323 xcb_input_device_resolution_state_resolution_values_length (const xcb_input_device_resolution_state_t *R /**< */)
4325 return R->num_valuators;
4328 xcb_generic_iterator_t
4329 xcb_input_device_resolution_state_resolution_values_end (const xcb_input_device_resolution_state_t *R /**< */)
4331 xcb_generic_iterator_t i;
4332 i.data = ((uint32_t *) (R + 1)) + (R->num_valuators);
4333 i.rem = 0;
4334 i.index = (char *) i.data - (char *) R;
4335 return i;
4338 uint32_t *
4339 xcb_input_device_resolution_state_resolution_min (const xcb_input_device_resolution_state_t *R /**< */)
4341 xcb_generic_iterator_t prev = xcb_input_device_resolution_state_resolution_values_end(R);
4342 return (uint32_t *) ((char *) prev.data + XCB_TYPE_PAD(uint32_t, prev.index) + 0);
4346 xcb_input_device_resolution_state_resolution_min_length (const xcb_input_device_resolution_state_t *R /**< */)
4348 return R->num_valuators;
4351 xcb_generic_iterator_t
4352 xcb_input_device_resolution_state_resolution_min_end (const xcb_input_device_resolution_state_t *R /**< */)
4354 xcb_generic_iterator_t i;
4355 xcb_generic_iterator_t child = xcb_input_device_resolution_state_resolution_values_end(R);
4356 i.data = ((uint32_t *) child.data) + (R->num_valuators);
4357 i.rem = 0;
4358 i.index = (char *) i.data - (char *) R;
4359 return i;
4362 uint32_t *
4363 xcb_input_device_resolution_state_resolution_max (const xcb_input_device_resolution_state_t *R /**< */)
4365 xcb_generic_iterator_t prev = xcb_input_device_resolution_state_resolution_min_end(R);
4366 return (uint32_t *) ((char *) prev.data + XCB_TYPE_PAD(uint32_t, prev.index) + 0);
4370 xcb_input_device_resolution_state_resolution_max_length (const xcb_input_device_resolution_state_t *R /**< */)
4372 return R->num_valuators;
4375 xcb_generic_iterator_t
4376 xcb_input_device_resolution_state_resolution_max_end (const xcb_input_device_resolution_state_t *R /**< */)
4378 xcb_generic_iterator_t i;
4379 xcb_generic_iterator_t child = xcb_input_device_resolution_state_resolution_min_end(R);
4380 i.data = ((uint32_t *) child.data) + (R->num_valuators);
4381 i.rem = 0;
4382 i.index = (char *) i.data - (char *) R;
4383 return i;
4386 void
4387 xcb_input_device_resolution_state_next (xcb_input_device_resolution_state_iterator_t *i /**< */)
4389 xcb_input_device_resolution_state_t *R = i->data;
4390 xcb_generic_iterator_t child;
4391 child.data = (xcb_input_device_resolution_state_t *)(((char *)R) + xcb_input_device_resolution_state_sizeof(R));
4392 i->index = (char *) child.data - (char *) i->data;
4393 --i->rem;
4394 i->data = (xcb_input_device_resolution_state_t *) child.data;
4397 xcb_generic_iterator_t
4398 xcb_input_device_resolution_state_end (xcb_input_device_resolution_state_iterator_t i /**< */)
4400 xcb_generic_iterator_t ret;
4401 while(i.rem > 0)
4402 xcb_input_device_resolution_state_next(&i);
4403 ret.data = i.data;
4404 ret.rem = i.rem;
4405 ret.index = i.index;
4406 return ret;
4409 void
4410 xcb_input_device_abs_calib_state_next (xcb_input_device_abs_calib_state_iterator_t *i /**< */)
4412 --i->rem;
4413 ++i->data;
4414 i->index += sizeof(xcb_input_device_abs_calib_state_t);
4417 xcb_generic_iterator_t
4418 xcb_input_device_abs_calib_state_end (xcb_input_device_abs_calib_state_iterator_t i /**< */)
4420 xcb_generic_iterator_t ret;
4421 ret.data = i.data + i.rem;
4422 ret.index = i.index + ((char *) ret.data - (char *) i.data);
4423 ret.rem = 0;
4424 return ret;
4427 void
4428 xcb_input_device_abs_area_state_next (xcb_input_device_abs_area_state_iterator_t *i /**< */)
4430 --i->rem;
4431 ++i->data;
4432 i->index += sizeof(xcb_input_device_abs_area_state_t);
4435 xcb_generic_iterator_t
4436 xcb_input_device_abs_area_state_end (xcb_input_device_abs_area_state_iterator_t i /**< */)
4438 xcb_generic_iterator_t ret;
4439 ret.data = i.data + i.rem;
4440 ret.index = i.index + ((char *) ret.data - (char *) i.data);
4441 ret.rem = 0;
4442 return ret;
4445 void
4446 xcb_input_device_core_state_next (xcb_input_device_core_state_iterator_t *i /**< */)
4448 --i->rem;
4449 ++i->data;
4450 i->index += sizeof(xcb_input_device_core_state_t);
4453 xcb_generic_iterator_t
4454 xcb_input_device_core_state_end (xcb_input_device_core_state_iterator_t i /**< */)
4456 xcb_generic_iterator_t ret;
4457 ret.data = i.data + i.rem;
4458 ret.index = i.index + ((char *) ret.data - (char *) i.data);
4459 ret.rem = 0;
4460 return ret;
4463 void
4464 xcb_input_device_enable_state_next (xcb_input_device_enable_state_iterator_t *i /**< */)
4466 --i->rem;
4467 ++i->data;
4468 i->index += sizeof(xcb_input_device_enable_state_t);
4471 xcb_generic_iterator_t
4472 xcb_input_device_enable_state_end (xcb_input_device_enable_state_iterator_t i /**< */)
4474 xcb_generic_iterator_t ret;
4475 ret.data = i.data + i.rem;
4476 ret.index = i.index + ((char *) ret.data - (char *) i.data);
4477 ret.rem = 0;
4478 return ret;
4482 xcb_input_device_state_sizeof (const void *_buffer /**< */)
4484 char *xcb_tmp = (char *)_buffer;
4485 const xcb_input_device_state_t *_aux = (xcb_input_device_state_t *)_buffer;
4486 unsigned int xcb_buffer_len = 0;
4487 unsigned int xcb_block_len = 0;
4488 unsigned int xcb_pad = 0;
4489 unsigned int xcb_align_to = 0;
4492 xcb_block_len += sizeof(xcb_input_device_state_t);
4493 xcb_tmp += xcb_block_len;
4494 xcb_buffer_len += xcb_block_len;
4495 xcb_block_len = 0;
4496 /* uninterpreted_data */
4497 xcb_block_len += (_aux->len - 4) * sizeof(uint8_t);
4498 xcb_tmp += xcb_block_len;
4499 xcb_align_to = ALIGNOF(uint8_t);
4500 /* insert padding */
4501 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4502 xcb_buffer_len += xcb_block_len + xcb_pad;
4503 if (0 != xcb_pad) {
4504 xcb_tmp += xcb_pad;
4505 xcb_pad = 0;
4507 xcb_block_len = 0;
4509 return xcb_buffer_len;
4512 uint8_t *
4513 xcb_input_device_state_uninterpreted_data (const xcb_input_device_state_t *R /**< */)
4515 return (uint8_t *) (R + 1);
4519 xcb_input_device_state_uninterpreted_data_length (const xcb_input_device_state_t *R /**< */)
4521 return (R->len - 4);
4524 xcb_generic_iterator_t
4525 xcb_input_device_state_uninterpreted_data_end (const xcb_input_device_state_t *R /**< */)
4527 xcb_generic_iterator_t i;
4528 i.data = ((uint8_t *) (R + 1)) + ((R->len - 4));
4529 i.rem = 0;
4530 i.index = (char *) i.data - (char *) R;
4531 return i;
4534 void
4535 xcb_input_device_state_next (xcb_input_device_state_iterator_t *i /**< */)
4537 xcb_input_device_state_t *R = i->data;
4538 xcb_generic_iterator_t child;
4539 child.data = (xcb_input_device_state_t *)(((char *)R) + xcb_input_device_state_sizeof(R));
4540 i->index = (char *) child.data - (char *) i->data;
4541 --i->rem;
4542 i->data = (xcb_input_device_state_t *) child.data;
4545 xcb_generic_iterator_t
4546 xcb_input_device_state_end (xcb_input_device_state_iterator_t i /**< */)
4548 xcb_generic_iterator_t ret;
4549 while(i.rem > 0)
4550 xcb_input_device_state_next(&i);
4551 ret.data = i.data;
4552 ret.rem = i.rem;
4553 ret.index = i.index;
4554 return ret;
4558 xcb_input_get_device_control_sizeof (const void *_buffer /**< */)
4560 char *xcb_tmp = (char *)_buffer;
4561 unsigned int xcb_buffer_len = 0;
4562 unsigned int xcb_block_len = 0;
4563 unsigned int xcb_pad = 0;
4564 unsigned int xcb_align_to = 0;
4567 xcb_block_len += sizeof(xcb_input_get_device_control_reply_t);
4568 xcb_tmp += xcb_block_len;
4569 xcb_buffer_len += xcb_block_len;
4570 xcb_block_len = 0;
4571 /* control */
4572 xcb_block_len += xcb_input_device_state_sizeof(xcb_tmp);
4573 xcb_tmp += xcb_block_len;
4574 xcb_align_to = ALIGNOF(xcb_input_device_state_t);
4575 /* insert padding */
4576 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4577 xcb_buffer_len += xcb_block_len + xcb_pad;
4578 if (0 != xcb_pad) {
4579 xcb_tmp += xcb_pad;
4580 xcb_pad = 0;
4582 xcb_block_len = 0;
4584 return xcb_buffer_len;
4587 xcb_input_get_device_control_cookie_t
4588 xcb_input_get_device_control (xcb_connection_t *c /**< */,
4589 uint16_t control_id /**< */,
4590 uint8_t device_id /**< */)
4592 static const xcb_protocol_request_t xcb_req = {
4593 /* count */ 2,
4594 /* ext */ &xcb_input_id,
4595 /* opcode */ XCB_INPUT_GET_DEVICE_CONTROL,
4596 /* isvoid */ 0
4599 struct iovec xcb_parts[4];
4600 xcb_input_get_device_control_cookie_t xcb_ret;
4601 xcb_input_get_device_control_request_t xcb_out;
4603 xcb_out.control_id = control_id;
4604 xcb_out.device_id = device_id;
4605 xcb_out.pad0 = 0;
4607 xcb_parts[2].iov_base = (char *) &xcb_out;
4608 xcb_parts[2].iov_len = sizeof(xcb_out);
4609 xcb_parts[3].iov_base = 0;
4610 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4612 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
4613 return xcb_ret;
4616 xcb_input_get_device_control_cookie_t
4617 xcb_input_get_device_control_unchecked (xcb_connection_t *c /**< */,
4618 uint16_t control_id /**< */,
4619 uint8_t device_id /**< */)
4621 static const xcb_protocol_request_t xcb_req = {
4622 /* count */ 2,
4623 /* ext */ &xcb_input_id,
4624 /* opcode */ XCB_INPUT_GET_DEVICE_CONTROL,
4625 /* isvoid */ 0
4628 struct iovec xcb_parts[4];
4629 xcb_input_get_device_control_cookie_t xcb_ret;
4630 xcb_input_get_device_control_request_t xcb_out;
4632 xcb_out.control_id = control_id;
4633 xcb_out.device_id = device_id;
4634 xcb_out.pad0 = 0;
4636 xcb_parts[2].iov_base = (char *) &xcb_out;
4637 xcb_parts[2].iov_len = sizeof(xcb_out);
4638 xcb_parts[3].iov_base = 0;
4639 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4641 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
4642 return xcb_ret;
4645 xcb_input_device_state_t *
4646 xcb_input_get_device_control_control (const xcb_input_get_device_control_reply_t *R /**< */)
4648 return (xcb_input_device_state_t *) (R + 1);
4651 xcb_input_get_device_control_reply_t *
4652 xcb_input_get_device_control_reply (xcb_connection_t *c /**< */,
4653 xcb_input_get_device_control_cookie_t cookie /**< */,
4654 xcb_generic_error_t **e /**< */)
4656 return (xcb_input_get_device_control_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
4660 xcb_input_device_resolution_ctl_sizeof (const void *_buffer /**< */)
4662 char *xcb_tmp = (char *)_buffer;
4663 const xcb_input_device_resolution_ctl_t *_aux = (xcb_input_device_resolution_ctl_t *)_buffer;
4664 unsigned int xcb_buffer_len = 0;
4665 unsigned int xcb_block_len = 0;
4666 unsigned int xcb_pad = 0;
4667 unsigned int xcb_align_to = 0;
4670 xcb_block_len += sizeof(xcb_input_device_resolution_ctl_t);
4671 xcb_tmp += xcb_block_len;
4672 xcb_buffer_len += xcb_block_len;
4673 xcb_block_len = 0;
4674 /* resolution_values */
4675 xcb_block_len += _aux->num_valuators * sizeof(uint32_t);
4676 xcb_tmp += xcb_block_len;
4677 xcb_align_to = ALIGNOF(uint32_t);
4678 /* insert padding */
4679 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4680 xcb_buffer_len += xcb_block_len + xcb_pad;
4681 if (0 != xcb_pad) {
4682 xcb_tmp += xcb_pad;
4683 xcb_pad = 0;
4685 xcb_block_len = 0;
4687 return xcb_buffer_len;
4690 uint32_t *
4691 xcb_input_device_resolution_ctl_resolution_values (const xcb_input_device_resolution_ctl_t *R /**< */)
4693 return (uint32_t *) (R + 1);
4697 xcb_input_device_resolution_ctl_resolution_values_length (const xcb_input_device_resolution_ctl_t *R /**< */)
4699 return R->num_valuators;
4702 xcb_generic_iterator_t
4703 xcb_input_device_resolution_ctl_resolution_values_end (const xcb_input_device_resolution_ctl_t *R /**< */)
4705 xcb_generic_iterator_t i;
4706 i.data = ((uint32_t *) (R + 1)) + (R->num_valuators);
4707 i.rem = 0;
4708 i.index = (char *) i.data - (char *) R;
4709 return i;
4712 void
4713 xcb_input_device_resolution_ctl_next (xcb_input_device_resolution_ctl_iterator_t *i /**< */)
4715 xcb_input_device_resolution_ctl_t *R = i->data;
4716 xcb_generic_iterator_t child;
4717 child.data = (xcb_input_device_resolution_ctl_t *)(((char *)R) + xcb_input_device_resolution_ctl_sizeof(R));
4718 i->index = (char *) child.data - (char *) i->data;
4719 --i->rem;
4720 i->data = (xcb_input_device_resolution_ctl_t *) child.data;
4723 xcb_generic_iterator_t
4724 xcb_input_device_resolution_ctl_end (xcb_input_device_resolution_ctl_iterator_t i /**< */)
4726 xcb_generic_iterator_t ret;
4727 while(i.rem > 0)
4728 xcb_input_device_resolution_ctl_next(&i);
4729 ret.data = i.data;
4730 ret.rem = i.rem;
4731 ret.index = i.index;
4732 return ret;
4735 void
4736 xcb_input_device_abs_calib_ctl_next (xcb_input_device_abs_calib_ctl_iterator_t *i /**< */)
4738 --i->rem;
4739 ++i->data;
4740 i->index += sizeof(xcb_input_device_abs_calib_ctl_t);
4743 xcb_generic_iterator_t
4744 xcb_input_device_abs_calib_ctl_end (xcb_input_device_abs_calib_ctl_iterator_t i /**< */)
4746 xcb_generic_iterator_t ret;
4747 ret.data = i.data + i.rem;
4748 ret.index = i.index + ((char *) ret.data - (char *) i.data);
4749 ret.rem = 0;
4750 return ret;
4753 void
4754 xcb_input_device_abs_area_ctrl_next (xcb_input_device_abs_area_ctrl_iterator_t *i /**< */)
4756 --i->rem;
4757 ++i->data;
4758 i->index += sizeof(xcb_input_device_abs_area_ctrl_t);
4761 xcb_generic_iterator_t
4762 xcb_input_device_abs_area_ctrl_end (xcb_input_device_abs_area_ctrl_iterator_t i /**< */)
4764 xcb_generic_iterator_t ret;
4765 ret.data = i.data + i.rem;
4766 ret.index = i.index + ((char *) ret.data - (char *) i.data);
4767 ret.rem = 0;
4768 return ret;
4771 void
4772 xcb_input_device_core_ctrl_next (xcb_input_device_core_ctrl_iterator_t *i /**< */)
4774 --i->rem;
4775 ++i->data;
4776 i->index += sizeof(xcb_input_device_core_ctrl_t);
4779 xcb_generic_iterator_t
4780 xcb_input_device_core_ctrl_end (xcb_input_device_core_ctrl_iterator_t i /**< */)
4782 xcb_generic_iterator_t ret;
4783 ret.data = i.data + i.rem;
4784 ret.index = i.index + ((char *) ret.data - (char *) i.data);
4785 ret.rem = 0;
4786 return ret;
4789 void
4790 xcb_input_device_enable_ctrl_next (xcb_input_device_enable_ctrl_iterator_t *i /**< */)
4792 --i->rem;
4793 ++i->data;
4794 i->index += sizeof(xcb_input_device_enable_ctrl_t);
4797 xcb_generic_iterator_t
4798 xcb_input_device_enable_ctrl_end (xcb_input_device_enable_ctrl_iterator_t i /**< */)
4800 xcb_generic_iterator_t ret;
4801 ret.data = i.data + i.rem;
4802 ret.index = i.index + ((char *) ret.data - (char *) i.data);
4803 ret.rem = 0;
4804 return ret;
4808 xcb_input_device_ctl_sizeof (const void *_buffer /**< */)
4810 char *xcb_tmp = (char *)_buffer;
4811 const xcb_input_device_ctl_t *_aux = (xcb_input_device_ctl_t *)_buffer;
4812 unsigned int xcb_buffer_len = 0;
4813 unsigned int xcb_block_len = 0;
4814 unsigned int xcb_pad = 0;
4815 unsigned int xcb_align_to = 0;
4818 xcb_block_len += sizeof(xcb_input_device_ctl_t);
4819 xcb_tmp += xcb_block_len;
4820 xcb_buffer_len += xcb_block_len;
4821 xcb_block_len = 0;
4822 /* uninterpreted_data */
4823 xcb_block_len += (_aux->len - 4) * sizeof(uint8_t);
4824 xcb_tmp += xcb_block_len;
4825 xcb_align_to = ALIGNOF(uint8_t);
4826 /* insert padding */
4827 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4828 xcb_buffer_len += xcb_block_len + xcb_pad;
4829 if (0 != xcb_pad) {
4830 xcb_tmp += xcb_pad;
4831 xcb_pad = 0;
4833 xcb_block_len = 0;
4835 return xcb_buffer_len;
4838 uint8_t *
4839 xcb_input_device_ctl_uninterpreted_data (const xcb_input_device_ctl_t *R /**< */)
4841 return (uint8_t *) (R + 1);
4845 xcb_input_device_ctl_uninterpreted_data_length (const xcb_input_device_ctl_t *R /**< */)
4847 return (R->len - 4);
4850 xcb_generic_iterator_t
4851 xcb_input_device_ctl_uninterpreted_data_end (const xcb_input_device_ctl_t *R /**< */)
4853 xcb_generic_iterator_t i;
4854 i.data = ((uint8_t *) (R + 1)) + ((R->len - 4));
4855 i.rem = 0;
4856 i.index = (char *) i.data - (char *) R;
4857 return i;
4860 void
4861 xcb_input_device_ctl_next (xcb_input_device_ctl_iterator_t *i /**< */)
4863 xcb_input_device_ctl_t *R = i->data;
4864 xcb_generic_iterator_t child;
4865 child.data = (xcb_input_device_ctl_t *)(((char *)R) + xcb_input_device_ctl_sizeof(R));
4866 i->index = (char *) child.data - (char *) i->data;
4867 --i->rem;
4868 i->data = (xcb_input_device_ctl_t *) child.data;
4871 xcb_generic_iterator_t
4872 xcb_input_device_ctl_end (xcb_input_device_ctl_iterator_t i /**< */)
4874 xcb_generic_iterator_t ret;
4875 while(i.rem > 0)
4876 xcb_input_device_ctl_next(&i);
4877 ret.data = i.data;
4878 ret.rem = i.rem;
4879 ret.index = i.index;
4880 return ret;
4884 xcb_input_change_device_control_sizeof (const void *_buffer /**< */)
4886 char *xcb_tmp = (char *)_buffer;
4887 unsigned int xcb_buffer_len = 0;
4888 unsigned int xcb_block_len = 0;
4889 unsigned int xcb_pad = 0;
4890 unsigned int xcb_align_to = 0;
4893 xcb_block_len += sizeof(xcb_input_change_device_control_request_t);
4894 xcb_tmp += xcb_block_len;
4895 xcb_buffer_len += xcb_block_len;
4896 xcb_block_len = 0;
4897 /* control */
4898 xcb_block_len += xcb_input_device_ctl_sizeof(xcb_tmp);
4899 xcb_tmp += xcb_block_len;
4900 xcb_align_to = ALIGNOF(xcb_input_device_ctl_t);
4901 /* insert padding */
4902 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4903 xcb_buffer_len += xcb_block_len + xcb_pad;
4904 if (0 != xcb_pad) {
4905 xcb_tmp += xcb_pad;
4906 xcb_pad = 0;
4908 xcb_block_len = 0;
4910 return xcb_buffer_len;
4913 xcb_input_change_device_control_cookie_t
4914 xcb_input_change_device_control (xcb_connection_t *c /**< */,
4915 uint16_t control_id /**< */,
4916 uint8_t device_id /**< */,
4917 xcb_input_device_ctl_t *control /**< */)
4919 static const xcb_protocol_request_t xcb_req = {
4920 /* count */ 4,
4921 /* ext */ &xcb_input_id,
4922 /* opcode */ XCB_INPUT_CHANGE_DEVICE_CONTROL,
4923 /* isvoid */ 0
4926 struct iovec xcb_parts[6];
4927 xcb_input_change_device_control_cookie_t xcb_ret;
4928 xcb_input_change_device_control_request_t xcb_out;
4930 xcb_out.control_id = control_id;
4931 xcb_out.device_id = device_id;
4932 xcb_out.pad0 = 0;
4934 xcb_parts[2].iov_base = (char *) &xcb_out;
4935 xcb_parts[2].iov_len = sizeof(xcb_out);
4936 xcb_parts[3].iov_base = 0;
4937 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4938 /* xcb_input_device_ctl_t control */
4939 xcb_parts[4].iov_base = (char *) control;
4940 xcb_parts[4].iov_len =
4941 xcb_input_device_ctl_sizeof (control);
4943 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
4944 return xcb_ret;
4947 xcb_input_change_device_control_cookie_t
4948 xcb_input_change_device_control_unchecked (xcb_connection_t *c /**< */,
4949 uint16_t control_id /**< */,
4950 uint8_t device_id /**< */,
4951 xcb_input_device_ctl_t *control /**< */)
4953 static const xcb_protocol_request_t xcb_req = {
4954 /* count */ 4,
4955 /* ext */ &xcb_input_id,
4956 /* opcode */ XCB_INPUT_CHANGE_DEVICE_CONTROL,
4957 /* isvoid */ 0
4960 struct iovec xcb_parts[6];
4961 xcb_input_change_device_control_cookie_t xcb_ret;
4962 xcb_input_change_device_control_request_t xcb_out;
4964 xcb_out.control_id = control_id;
4965 xcb_out.device_id = device_id;
4966 xcb_out.pad0 = 0;
4968 xcb_parts[2].iov_base = (char *) &xcb_out;
4969 xcb_parts[2].iov_len = sizeof(xcb_out);
4970 xcb_parts[3].iov_base = 0;
4971 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4972 /* xcb_input_device_ctl_t control */
4973 xcb_parts[4].iov_base = (char *) control;
4974 xcb_parts[4].iov_len =
4975 xcb_input_device_ctl_sizeof (control);
4977 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
4978 return xcb_ret;
4981 xcb_input_change_device_control_reply_t *
4982 xcb_input_change_device_control_reply (xcb_connection_t *c /**< */,
4983 xcb_input_change_device_control_cookie_t cookie /**< */,
4984 xcb_generic_error_t **e /**< */)
4986 return (xcb_input_change_device_control_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
4990 xcb_input_list_device_properties_sizeof (const void *_buffer /**< */)
4992 char *xcb_tmp = (char *)_buffer;
4993 const xcb_input_list_device_properties_reply_t *_aux = (xcb_input_list_device_properties_reply_t *)_buffer;
4994 unsigned int xcb_buffer_len = 0;
4995 unsigned int xcb_block_len = 0;
4996 unsigned int xcb_pad = 0;
4997 unsigned int xcb_align_to = 0;
5000 xcb_block_len += sizeof(xcb_input_list_device_properties_reply_t);
5001 xcb_tmp += xcb_block_len;
5002 xcb_buffer_len += xcb_block_len;
5003 xcb_block_len = 0;
5004 /* atoms */
5005 xcb_block_len += _aux->num_atoms * sizeof(xcb_atom_t);
5006 xcb_tmp += xcb_block_len;
5007 xcb_align_to = ALIGNOF(xcb_atom_t);
5008 /* insert padding */
5009 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
5010 xcb_buffer_len += xcb_block_len + xcb_pad;
5011 if (0 != xcb_pad) {
5012 xcb_tmp += xcb_pad;
5013 xcb_pad = 0;
5015 xcb_block_len = 0;
5017 return xcb_buffer_len;
5020 xcb_input_list_device_properties_cookie_t
5021 xcb_input_list_device_properties (xcb_connection_t *c /**< */,
5022 uint8_t device_id /**< */)
5024 static const xcb_protocol_request_t xcb_req = {
5025 /* count */ 2,
5026 /* ext */ &xcb_input_id,
5027 /* opcode */ XCB_INPUT_LIST_DEVICE_PROPERTIES,
5028 /* isvoid */ 0
5031 struct iovec xcb_parts[4];
5032 xcb_input_list_device_properties_cookie_t xcb_ret;
5033 xcb_input_list_device_properties_request_t xcb_out;
5035 xcb_out.device_id = device_id;
5036 memset(xcb_out.pad0, 0, 3);
5038 xcb_parts[2].iov_base = (char *) &xcb_out;
5039 xcb_parts[2].iov_len = sizeof(xcb_out);
5040 xcb_parts[3].iov_base = 0;
5041 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5043 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
5044 return xcb_ret;
5047 xcb_input_list_device_properties_cookie_t
5048 xcb_input_list_device_properties_unchecked (xcb_connection_t *c /**< */,
5049 uint8_t device_id /**< */)
5051 static const xcb_protocol_request_t xcb_req = {
5052 /* count */ 2,
5053 /* ext */ &xcb_input_id,
5054 /* opcode */ XCB_INPUT_LIST_DEVICE_PROPERTIES,
5055 /* isvoid */ 0
5058 struct iovec xcb_parts[4];
5059 xcb_input_list_device_properties_cookie_t xcb_ret;
5060 xcb_input_list_device_properties_request_t xcb_out;
5062 xcb_out.device_id = device_id;
5063 memset(xcb_out.pad0, 0, 3);
5065 xcb_parts[2].iov_base = (char *) &xcb_out;
5066 xcb_parts[2].iov_len = sizeof(xcb_out);
5067 xcb_parts[3].iov_base = 0;
5068 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5070 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
5071 return xcb_ret;
5074 xcb_atom_t *
5075 xcb_input_list_device_properties_atoms (const xcb_input_list_device_properties_reply_t *R /**< */)
5077 return (xcb_atom_t *) (R + 1);
5081 xcb_input_list_device_properties_atoms_length (const xcb_input_list_device_properties_reply_t *R /**< */)
5083 return R->num_atoms;
5086 xcb_generic_iterator_t
5087 xcb_input_list_device_properties_atoms_end (const xcb_input_list_device_properties_reply_t *R /**< */)
5089 xcb_generic_iterator_t i;
5090 i.data = ((xcb_atom_t *) (R + 1)) + (R->num_atoms);
5091 i.rem = 0;
5092 i.index = (char *) i.data - (char *) R;
5093 return i;
5096 xcb_input_list_device_properties_reply_t *
5097 xcb_input_list_device_properties_reply (xcb_connection_t *c /**< */,
5098 xcb_input_list_device_properties_cookie_t cookie /**< */,
5099 xcb_generic_error_t **e /**< */)
5101 return (xcb_input_list_device_properties_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
5104 uint8_t *
5105 xcb_input_change_device_property_items_data_8 (const xcb_input_change_device_property_items_t *S /**< */)
5107 return /* items */ S->data8;
5111 xcb_input_change_device_property_items_data_8_length (const xcb_input_change_device_property_request_t *R /**< */,
5112 const xcb_input_change_device_property_items_t *S /**< */)
5114 return R->num_items;
5117 xcb_generic_iterator_t
5118 xcb_input_change_device_property_items_data_8_end (const xcb_input_change_device_property_request_t *R /**< */,
5119 const xcb_input_change_device_property_items_t *S /**< */)
5121 xcb_generic_iterator_t i;
5122 i.data = /* items */ S->data8 + R->num_items;
5123 i.rem = 0;
5124 i.index = (char *) i.data - (char *) S;
5125 return i;
5128 uint16_t *
5129 xcb_input_change_device_property_items_data_16 (const xcb_input_change_device_property_items_t *S /**< */)
5131 return /* items */ S->data16;
5135 xcb_input_change_device_property_items_data_16_length (const xcb_input_change_device_property_request_t *R /**< */,
5136 const xcb_input_change_device_property_items_t *S /**< */)
5138 return R->num_items;
5141 xcb_generic_iterator_t
5142 xcb_input_change_device_property_items_data_16_end (const xcb_input_change_device_property_request_t *R /**< */,
5143 const xcb_input_change_device_property_items_t *S /**< */)
5145 xcb_generic_iterator_t i;
5146 i.data = /* items */ S->data16 + R->num_items;
5147 i.rem = 0;
5148 i.index = (char *) i.data - (char *) S;
5149 return i;
5152 uint32_t *
5153 xcb_input_change_device_property_items_data_32 (const xcb_input_change_device_property_items_t *S /**< */)
5155 return /* items */ S->data32;
5159 xcb_input_change_device_property_items_data_32_length (const xcb_input_change_device_property_request_t *R /**< */,
5160 const xcb_input_change_device_property_items_t *S /**< */)
5162 return R->num_items;
5165 xcb_generic_iterator_t
5166 xcb_input_change_device_property_items_data_32_end (const xcb_input_change_device_property_request_t *R /**< */,
5167 const xcb_input_change_device_property_items_t *S /**< */)
5169 xcb_generic_iterator_t i;
5170 i.data = /* items */ S->data32 + R->num_items;
5171 i.rem = 0;
5172 i.index = (char *) i.data - (char *) S;
5173 return i;
5177 xcb_input_change_device_property_items_serialize (void **_buffer /**< */,
5178 uint32_t num_items /**< */,
5179 uint8_t format /**< */,
5180 const xcb_input_change_device_property_items_t *_aux /**< */)
5182 char *xcb_out = *_buffer;
5183 unsigned int xcb_buffer_len = 0;
5184 unsigned int xcb_align_to = 0;
5186 unsigned int xcb_pad = 0;
5187 char xcb_pad0[3] = {0, 0, 0};
5188 struct iovec xcb_parts[7];
5189 unsigned int xcb_parts_idx = 0;
5190 unsigned int xcb_block_len = 0;
5191 unsigned int i;
5192 char *xcb_tmp;
5194 if(format & XCB_INPUT_PROPERTY_FORMAT_8_BITS) {
5195 /* insert padding */
5196 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
5197 xcb_buffer_len += xcb_block_len + xcb_pad;
5198 if (0 != xcb_pad) {
5199 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
5200 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
5201 xcb_parts_idx++;
5202 xcb_pad = 0;
5204 xcb_block_len = 0;
5205 /* data8 */
5206 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->data8;
5207 xcb_block_len += num_items * sizeof(uint8_t);
5208 xcb_parts[xcb_parts_idx].iov_len = num_items * sizeof(uint8_t);
5209 xcb_parts_idx++;
5210 xcb_align_to = ALIGNOF(uint8_t);
5212 if(format & XCB_INPUT_PROPERTY_FORMAT_16_BITS) {
5213 /* insert padding */
5214 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
5215 xcb_buffer_len += xcb_block_len + xcb_pad;
5216 if (0 != xcb_pad) {
5217 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
5218 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
5219 xcb_parts_idx++;
5220 xcb_pad = 0;
5222 xcb_block_len = 0;
5223 /* data16 */
5224 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->data16;
5225 xcb_block_len += num_items * sizeof(uint16_t);
5226 xcb_parts[xcb_parts_idx].iov_len = num_items * sizeof(uint16_t);
5227 xcb_parts_idx++;
5228 xcb_align_to = ALIGNOF(uint16_t);
5230 if(format & XCB_INPUT_PROPERTY_FORMAT_32_BITS) {
5231 /* insert padding */
5232 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
5233 xcb_buffer_len += xcb_block_len + xcb_pad;
5234 if (0 != xcb_pad) {
5235 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
5236 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
5237 xcb_parts_idx++;
5238 xcb_pad = 0;
5240 xcb_block_len = 0;
5241 /* data32 */
5242 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->data32;
5243 xcb_block_len += num_items * sizeof(uint32_t);
5244 xcb_parts[xcb_parts_idx].iov_len = num_items * sizeof(uint32_t);
5245 xcb_parts_idx++;
5246 xcb_align_to = ALIGNOF(uint32_t);
5248 /* insert padding */
5249 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
5250 xcb_buffer_len += xcb_block_len + xcb_pad;
5251 if (0 != xcb_pad) {
5252 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
5253 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
5254 xcb_parts_idx++;
5255 xcb_pad = 0;
5257 xcb_block_len = 0;
5259 if (NULL == xcb_out) {
5260 /* allocate memory */
5261 xcb_out = malloc(xcb_buffer_len);
5262 *_buffer = xcb_out;
5265 xcb_tmp = xcb_out;
5266 for(i=0; i<xcb_parts_idx; i++) {
5267 if (0 != xcb_parts[i].iov_base && 0 != xcb_parts[i].iov_len)
5268 memcpy(xcb_tmp, xcb_parts[i].iov_base, xcb_parts[i].iov_len);
5269 if (0 != xcb_parts[i].iov_len)
5270 xcb_tmp += xcb_parts[i].iov_len;
5273 return xcb_buffer_len;
5277 xcb_input_change_device_property_items_unpack (const void *_buffer /**< */,
5278 uint32_t num_items /**< */,
5279 uint8_t format /**< */,
5280 xcb_input_change_device_property_items_t *_aux /**< */)
5282 char *xcb_tmp = (char *)_buffer;
5283 unsigned int xcb_buffer_len = 0;
5284 unsigned int xcb_block_len = 0;
5285 unsigned int xcb_pad = 0;
5286 unsigned int xcb_align_to = 0;
5289 if(format & XCB_INPUT_PROPERTY_FORMAT_8_BITS) {
5290 /* insert padding */
5291 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
5292 xcb_buffer_len += xcb_block_len + xcb_pad;
5293 if (0 != xcb_pad) {
5294 xcb_tmp += xcb_pad;
5295 xcb_pad = 0;
5297 xcb_block_len = 0;
5298 /* data8 */
5299 _aux->data8 = (uint8_t *)xcb_tmp;
5300 xcb_block_len += num_items * sizeof(uint8_t);
5301 xcb_tmp += xcb_block_len;
5302 xcb_align_to = ALIGNOF(uint8_t);
5304 if(format & XCB_INPUT_PROPERTY_FORMAT_16_BITS) {
5305 /* insert padding */
5306 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
5307 xcb_buffer_len += xcb_block_len + xcb_pad;
5308 if (0 != xcb_pad) {
5309 xcb_tmp += xcb_pad;
5310 xcb_pad = 0;
5312 xcb_block_len = 0;
5313 /* data16 */
5314 _aux->data16 = (uint16_t *)xcb_tmp;
5315 xcb_block_len += num_items * sizeof(uint16_t);
5316 xcb_tmp += xcb_block_len;
5317 xcb_align_to = ALIGNOF(uint16_t);
5319 if(format & XCB_INPUT_PROPERTY_FORMAT_32_BITS) {
5320 /* insert padding */
5321 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
5322 xcb_buffer_len += xcb_block_len + xcb_pad;
5323 if (0 != xcb_pad) {
5324 xcb_tmp += xcb_pad;
5325 xcb_pad = 0;
5327 xcb_block_len = 0;
5328 /* data32 */
5329 _aux->data32 = (uint32_t *)xcb_tmp;
5330 xcb_block_len += num_items * sizeof(uint32_t);
5331 xcb_tmp += xcb_block_len;
5332 xcb_align_to = ALIGNOF(uint32_t);
5334 /* insert padding */
5335 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
5336 xcb_buffer_len += xcb_block_len + xcb_pad;
5337 if (0 != xcb_pad) {
5338 xcb_tmp += xcb_pad;
5339 xcb_pad = 0;
5341 xcb_block_len = 0;
5343 return xcb_buffer_len;
5347 xcb_input_change_device_property_items_sizeof (const void *_buffer /**< */,
5348 uint32_t num_items /**< */,
5349 uint8_t format /**< */)
5351 xcb_input_change_device_property_items_t _aux;
5352 return xcb_input_change_device_property_items_unpack(_buffer, num_items, format, &_aux);
5355 xcb_void_cookie_t
5356 xcb_input_change_device_property_checked (xcb_connection_t *c /**< */,
5357 xcb_atom_t property /**< */,
5358 xcb_atom_t type /**< */,
5359 uint8_t device_id /**< */,
5360 uint8_t format /**< */,
5361 uint8_t mode /**< */,
5362 uint32_t num_items /**< */,
5363 const void *items /**< */)
5365 static const xcb_protocol_request_t xcb_req = {
5366 /* count */ 3,
5367 /* ext */ &xcb_input_id,
5368 /* opcode */ XCB_INPUT_CHANGE_DEVICE_PROPERTY,
5369 /* isvoid */ 1
5372 struct iovec xcb_parts[5];
5373 xcb_void_cookie_t xcb_ret;
5374 xcb_input_change_device_property_request_t xcb_out;
5376 xcb_out.property = property;
5377 xcb_out.type = type;
5378 xcb_out.device_id = device_id;
5379 xcb_out.format = format;
5380 xcb_out.mode = mode;
5381 xcb_out.pad0 = 0;
5382 xcb_out.num_items = num_items;
5384 xcb_parts[2].iov_base = (char *) &xcb_out;
5385 xcb_parts[2].iov_len = sizeof(xcb_out);
5386 xcb_parts[3].iov_base = 0;
5387 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5388 /* xcb_input_change_device_property_items_t items */
5389 xcb_parts[4].iov_base = (char *) items;
5390 xcb_parts[4].iov_len =
5391 xcb_input_change_device_property_items_sizeof (items, num_items, format);
5393 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
5394 return xcb_ret;
5397 xcb_void_cookie_t
5398 xcb_input_change_device_property (xcb_connection_t *c /**< */,
5399 xcb_atom_t property /**< */,
5400 xcb_atom_t type /**< */,
5401 uint8_t device_id /**< */,
5402 uint8_t format /**< */,
5403 uint8_t mode /**< */,
5404 uint32_t num_items /**< */,
5405 const void *items /**< */)
5407 static const xcb_protocol_request_t xcb_req = {
5408 /* count */ 3,
5409 /* ext */ &xcb_input_id,
5410 /* opcode */ XCB_INPUT_CHANGE_DEVICE_PROPERTY,
5411 /* isvoid */ 1
5414 struct iovec xcb_parts[5];
5415 xcb_void_cookie_t xcb_ret;
5416 xcb_input_change_device_property_request_t xcb_out;
5418 xcb_out.property = property;
5419 xcb_out.type = type;
5420 xcb_out.device_id = device_id;
5421 xcb_out.format = format;
5422 xcb_out.mode = mode;
5423 xcb_out.pad0 = 0;
5424 xcb_out.num_items = num_items;
5426 xcb_parts[2].iov_base = (char *) &xcb_out;
5427 xcb_parts[2].iov_len = sizeof(xcb_out);
5428 xcb_parts[3].iov_base = 0;
5429 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5430 /* xcb_input_change_device_property_items_t items */
5431 xcb_parts[4].iov_base = (char *) items;
5432 xcb_parts[4].iov_len =
5433 xcb_input_change_device_property_items_sizeof (items, num_items, format);
5435 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
5436 return xcb_ret;
5439 xcb_void_cookie_t
5440 xcb_input_change_device_property_aux_checked (xcb_connection_t *c /**< */,
5441 xcb_atom_t property /**< */,
5442 xcb_atom_t type /**< */,
5443 uint8_t device_id /**< */,
5444 uint8_t format /**< */,
5445 uint8_t mode /**< */,
5446 uint32_t num_items /**< */,
5447 const xcb_input_change_device_property_items_t *items /**< */)
5449 static const xcb_protocol_request_t xcb_req = {
5450 /* count */ 3,
5451 /* ext */ &xcb_input_id,
5452 /* opcode */ XCB_INPUT_CHANGE_DEVICE_PROPERTY,
5453 /* isvoid */ 1
5456 struct iovec xcb_parts[5];
5457 xcb_void_cookie_t xcb_ret;
5458 xcb_input_change_device_property_request_t xcb_out;
5459 void *xcb_aux0 = 0;
5461 xcb_out.property = property;
5462 xcb_out.type = type;
5463 xcb_out.device_id = device_id;
5464 xcb_out.format = format;
5465 xcb_out.mode = mode;
5466 xcb_out.pad0 = 0;
5467 xcb_out.num_items = num_items;
5469 xcb_parts[2].iov_base = (char *) &xcb_out;
5470 xcb_parts[2].iov_len = sizeof(xcb_out);
5471 xcb_parts[3].iov_base = 0;
5472 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5473 /* xcb_input_change_device_property_items_t items */
5474 xcb_parts[4].iov_len =
5475 xcb_input_change_device_property_items_serialize (&xcb_aux0, num_items, format, items);
5476 xcb_parts[4].iov_base = xcb_aux0;
5478 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
5479 free(xcb_aux0);
5480 return xcb_ret;
5483 xcb_void_cookie_t
5484 xcb_input_change_device_property_aux (xcb_connection_t *c /**< */,
5485 xcb_atom_t property /**< */,
5486 xcb_atom_t type /**< */,
5487 uint8_t device_id /**< */,
5488 uint8_t format /**< */,
5489 uint8_t mode /**< */,
5490 uint32_t num_items /**< */,
5491 const xcb_input_change_device_property_items_t *items /**< */)
5493 static const xcb_protocol_request_t xcb_req = {
5494 /* count */ 3,
5495 /* ext */ &xcb_input_id,
5496 /* opcode */ XCB_INPUT_CHANGE_DEVICE_PROPERTY,
5497 /* isvoid */ 1
5500 struct iovec xcb_parts[5];
5501 xcb_void_cookie_t xcb_ret;
5502 xcb_input_change_device_property_request_t xcb_out;
5503 void *xcb_aux0 = 0;
5505 xcb_out.property = property;
5506 xcb_out.type = type;
5507 xcb_out.device_id = device_id;
5508 xcb_out.format = format;
5509 xcb_out.mode = mode;
5510 xcb_out.pad0 = 0;
5511 xcb_out.num_items = num_items;
5513 xcb_parts[2].iov_base = (char *) &xcb_out;
5514 xcb_parts[2].iov_len = sizeof(xcb_out);
5515 xcb_parts[3].iov_base = 0;
5516 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5517 /* xcb_input_change_device_property_items_t items */
5518 xcb_parts[4].iov_len =
5519 xcb_input_change_device_property_items_serialize (&xcb_aux0, num_items, format, items);
5520 xcb_parts[4].iov_base = xcb_aux0;
5522 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
5523 free(xcb_aux0);
5524 return xcb_ret;
5527 xcb_void_cookie_t
5528 xcb_input_delete_device_property_checked (xcb_connection_t *c /**< */,
5529 xcb_atom_t property /**< */,
5530 uint8_t device_id /**< */)
5532 static const xcb_protocol_request_t xcb_req = {
5533 /* count */ 2,
5534 /* ext */ &xcb_input_id,
5535 /* opcode */ XCB_INPUT_DELETE_DEVICE_PROPERTY,
5536 /* isvoid */ 1
5539 struct iovec xcb_parts[4];
5540 xcb_void_cookie_t xcb_ret;
5541 xcb_input_delete_device_property_request_t xcb_out;
5543 xcb_out.property = property;
5544 xcb_out.device_id = device_id;
5545 memset(xcb_out.pad0, 0, 3);
5547 xcb_parts[2].iov_base = (char *) &xcb_out;
5548 xcb_parts[2].iov_len = sizeof(xcb_out);
5549 xcb_parts[3].iov_base = 0;
5550 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5552 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
5553 return xcb_ret;
5556 xcb_void_cookie_t
5557 xcb_input_delete_device_property (xcb_connection_t *c /**< */,
5558 xcb_atom_t property /**< */,
5559 uint8_t device_id /**< */)
5561 static const xcb_protocol_request_t xcb_req = {
5562 /* count */ 2,
5563 /* ext */ &xcb_input_id,
5564 /* opcode */ XCB_INPUT_DELETE_DEVICE_PROPERTY,
5565 /* isvoid */ 1
5568 struct iovec xcb_parts[4];
5569 xcb_void_cookie_t xcb_ret;
5570 xcb_input_delete_device_property_request_t xcb_out;
5572 xcb_out.property = property;
5573 xcb_out.device_id = device_id;
5574 memset(xcb_out.pad0, 0, 3);
5576 xcb_parts[2].iov_base = (char *) &xcb_out;
5577 xcb_parts[2].iov_len = sizeof(xcb_out);
5578 xcb_parts[3].iov_base = 0;
5579 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5581 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
5582 return xcb_ret;
5585 uint8_t *
5586 xcb_input_get_device_property_items_data_8 (const xcb_input_get_device_property_items_t *S /**< */)
5588 return /* items */ S->data8;
5592 xcb_input_get_device_property_items_data_8_length (const xcb_input_get_device_property_reply_t *R /**< */,
5593 const xcb_input_get_device_property_items_t *S /**< */)
5595 return R->num_items;
5598 xcb_generic_iterator_t
5599 xcb_input_get_device_property_items_data_8_end (const xcb_input_get_device_property_reply_t *R /**< */,
5600 const xcb_input_get_device_property_items_t *S /**< */)
5602 xcb_generic_iterator_t i;
5603 i.data = /* items */ S->data8 + R->num_items;
5604 i.rem = 0;
5605 i.index = (char *) i.data - (char *) S;
5606 return i;
5609 uint16_t *
5610 xcb_input_get_device_property_items_data_16 (const xcb_input_get_device_property_items_t *S /**< */)
5612 return /* items */ S->data16;
5616 xcb_input_get_device_property_items_data_16_length (const xcb_input_get_device_property_reply_t *R /**< */,
5617 const xcb_input_get_device_property_items_t *S /**< */)
5619 return R->num_items;
5622 xcb_generic_iterator_t
5623 xcb_input_get_device_property_items_data_16_end (const xcb_input_get_device_property_reply_t *R /**< */,
5624 const xcb_input_get_device_property_items_t *S /**< */)
5626 xcb_generic_iterator_t i;
5627 i.data = /* items */ S->data16 + R->num_items;
5628 i.rem = 0;
5629 i.index = (char *) i.data - (char *) S;
5630 return i;
5633 uint32_t *
5634 xcb_input_get_device_property_items_data_32 (const xcb_input_get_device_property_items_t *S /**< */)
5636 return /* items */ S->data32;
5640 xcb_input_get_device_property_items_data_32_length (const xcb_input_get_device_property_reply_t *R /**< */,
5641 const xcb_input_get_device_property_items_t *S /**< */)
5643 return R->num_items;
5646 xcb_generic_iterator_t
5647 xcb_input_get_device_property_items_data_32_end (const xcb_input_get_device_property_reply_t *R /**< */,
5648 const xcb_input_get_device_property_items_t *S /**< */)
5650 xcb_generic_iterator_t i;
5651 i.data = /* items */ S->data32 + R->num_items;
5652 i.rem = 0;
5653 i.index = (char *) i.data - (char *) S;
5654 return i;
5658 xcb_input_get_device_property_items_serialize (void **_buffer /**< */,
5659 uint32_t num_items /**< */,
5660 uint8_t format /**< */,
5661 const xcb_input_get_device_property_items_t *_aux /**< */)
5663 char *xcb_out = *_buffer;
5664 unsigned int xcb_buffer_len = 0;
5665 unsigned int xcb_align_to = 0;
5667 unsigned int xcb_pad = 0;
5668 char xcb_pad0[3] = {0, 0, 0};
5669 struct iovec xcb_parts[7];
5670 unsigned int xcb_parts_idx = 0;
5671 unsigned int xcb_block_len = 0;
5672 unsigned int i;
5673 char *xcb_tmp;
5675 if(format & XCB_INPUT_PROPERTY_FORMAT_8_BITS) {
5676 /* insert padding */
5677 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
5678 xcb_buffer_len += xcb_block_len + xcb_pad;
5679 if (0 != xcb_pad) {
5680 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
5681 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
5682 xcb_parts_idx++;
5683 xcb_pad = 0;
5685 xcb_block_len = 0;
5686 /* data8 */
5687 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->data8;
5688 xcb_block_len += num_items * sizeof(uint8_t);
5689 xcb_parts[xcb_parts_idx].iov_len = num_items * sizeof(uint8_t);
5690 xcb_parts_idx++;
5691 xcb_align_to = ALIGNOF(uint8_t);
5693 if(format & XCB_INPUT_PROPERTY_FORMAT_16_BITS) {
5694 /* insert padding */
5695 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
5696 xcb_buffer_len += xcb_block_len + xcb_pad;
5697 if (0 != xcb_pad) {
5698 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
5699 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
5700 xcb_parts_idx++;
5701 xcb_pad = 0;
5703 xcb_block_len = 0;
5704 /* data16 */
5705 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->data16;
5706 xcb_block_len += num_items * sizeof(uint16_t);
5707 xcb_parts[xcb_parts_idx].iov_len = num_items * sizeof(uint16_t);
5708 xcb_parts_idx++;
5709 xcb_align_to = ALIGNOF(uint16_t);
5711 if(format & XCB_INPUT_PROPERTY_FORMAT_32_BITS) {
5712 /* insert padding */
5713 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
5714 xcb_buffer_len += xcb_block_len + xcb_pad;
5715 if (0 != xcb_pad) {
5716 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
5717 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
5718 xcb_parts_idx++;
5719 xcb_pad = 0;
5721 xcb_block_len = 0;
5722 /* data32 */
5723 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->data32;
5724 xcb_block_len += num_items * sizeof(uint32_t);
5725 xcb_parts[xcb_parts_idx].iov_len = num_items * sizeof(uint32_t);
5726 xcb_parts_idx++;
5727 xcb_align_to = ALIGNOF(uint32_t);
5729 /* insert padding */
5730 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
5731 xcb_buffer_len += xcb_block_len + xcb_pad;
5732 if (0 != xcb_pad) {
5733 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
5734 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
5735 xcb_parts_idx++;
5736 xcb_pad = 0;
5738 xcb_block_len = 0;
5740 if (NULL == xcb_out) {
5741 /* allocate memory */
5742 xcb_out = malloc(xcb_buffer_len);
5743 *_buffer = xcb_out;
5746 xcb_tmp = xcb_out;
5747 for(i=0; i<xcb_parts_idx; i++) {
5748 if (0 != xcb_parts[i].iov_base && 0 != xcb_parts[i].iov_len)
5749 memcpy(xcb_tmp, xcb_parts[i].iov_base, xcb_parts[i].iov_len);
5750 if (0 != xcb_parts[i].iov_len)
5751 xcb_tmp += xcb_parts[i].iov_len;
5754 return xcb_buffer_len;
5758 xcb_input_get_device_property_items_unpack (const void *_buffer /**< */,
5759 uint32_t num_items /**< */,
5760 uint8_t format /**< */,
5761 xcb_input_get_device_property_items_t *_aux /**< */)
5763 char *xcb_tmp = (char *)_buffer;
5764 unsigned int xcb_buffer_len = 0;
5765 unsigned int xcb_block_len = 0;
5766 unsigned int xcb_pad = 0;
5767 unsigned int xcb_align_to = 0;
5770 if(format & XCB_INPUT_PROPERTY_FORMAT_8_BITS) {
5771 /* insert padding */
5772 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
5773 xcb_buffer_len += xcb_block_len + xcb_pad;
5774 if (0 != xcb_pad) {
5775 xcb_tmp += xcb_pad;
5776 xcb_pad = 0;
5778 xcb_block_len = 0;
5779 /* data8 */
5780 _aux->data8 = (uint8_t *)xcb_tmp;
5781 xcb_block_len += num_items * sizeof(uint8_t);
5782 xcb_tmp += xcb_block_len;
5783 xcb_align_to = ALIGNOF(uint8_t);
5785 if(format & XCB_INPUT_PROPERTY_FORMAT_16_BITS) {
5786 /* insert padding */
5787 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
5788 xcb_buffer_len += xcb_block_len + xcb_pad;
5789 if (0 != xcb_pad) {
5790 xcb_tmp += xcb_pad;
5791 xcb_pad = 0;
5793 xcb_block_len = 0;
5794 /* data16 */
5795 _aux->data16 = (uint16_t *)xcb_tmp;
5796 xcb_block_len += num_items * sizeof(uint16_t);
5797 xcb_tmp += xcb_block_len;
5798 xcb_align_to = ALIGNOF(uint16_t);
5800 if(format & XCB_INPUT_PROPERTY_FORMAT_32_BITS) {
5801 /* insert padding */
5802 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
5803 xcb_buffer_len += xcb_block_len + xcb_pad;
5804 if (0 != xcb_pad) {
5805 xcb_tmp += xcb_pad;
5806 xcb_pad = 0;
5808 xcb_block_len = 0;
5809 /* data32 */
5810 _aux->data32 = (uint32_t *)xcb_tmp;
5811 xcb_block_len += num_items * sizeof(uint32_t);
5812 xcb_tmp += xcb_block_len;
5813 xcb_align_to = ALIGNOF(uint32_t);
5815 /* insert padding */
5816 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
5817 xcb_buffer_len += xcb_block_len + xcb_pad;
5818 if (0 != xcb_pad) {
5819 xcb_tmp += xcb_pad;
5820 xcb_pad = 0;
5822 xcb_block_len = 0;
5824 return xcb_buffer_len;
5828 xcb_input_get_device_property_items_sizeof (const void *_buffer /**< */,
5829 uint32_t num_items /**< */,
5830 uint8_t format /**< */)
5832 xcb_input_get_device_property_items_t _aux;
5833 return xcb_input_get_device_property_items_unpack(_buffer, num_items, format, &_aux);
5836 xcb_input_get_device_property_cookie_t
5837 xcb_input_get_device_property (xcb_connection_t *c /**< */,
5838 xcb_atom_t property /**< */,
5839 xcb_atom_t type /**< */,
5840 uint32_t offset /**< */,
5841 uint32_t len /**< */,
5842 uint8_t device_id /**< */,
5843 uint8_t _delete /**< */)
5845 static const xcb_protocol_request_t xcb_req = {
5846 /* count */ 2,
5847 /* ext */ &xcb_input_id,
5848 /* opcode */ XCB_INPUT_GET_DEVICE_PROPERTY,
5849 /* isvoid */ 0
5852 struct iovec xcb_parts[4];
5853 xcb_input_get_device_property_cookie_t xcb_ret;
5854 xcb_input_get_device_property_request_t xcb_out;
5856 xcb_out.property = property;
5857 xcb_out.type = type;
5858 xcb_out.offset = offset;
5859 xcb_out.len = len;
5860 xcb_out.device_id = device_id;
5861 xcb_out._delete = _delete;
5862 memset(xcb_out.pad0, 0, 2);
5864 xcb_parts[2].iov_base = (char *) &xcb_out;
5865 xcb_parts[2].iov_len = sizeof(xcb_out);
5866 xcb_parts[3].iov_base = 0;
5867 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5869 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
5870 return xcb_ret;
5873 xcb_input_get_device_property_cookie_t
5874 xcb_input_get_device_property_unchecked (xcb_connection_t *c /**< */,
5875 xcb_atom_t property /**< */,
5876 xcb_atom_t type /**< */,
5877 uint32_t offset /**< */,
5878 uint32_t len /**< */,
5879 uint8_t device_id /**< */,
5880 uint8_t _delete /**< */)
5882 static const xcb_protocol_request_t xcb_req = {
5883 /* count */ 2,
5884 /* ext */ &xcb_input_id,
5885 /* opcode */ XCB_INPUT_GET_DEVICE_PROPERTY,
5886 /* isvoid */ 0
5889 struct iovec xcb_parts[4];
5890 xcb_input_get_device_property_cookie_t xcb_ret;
5891 xcb_input_get_device_property_request_t xcb_out;
5893 xcb_out.property = property;
5894 xcb_out.type = type;
5895 xcb_out.offset = offset;
5896 xcb_out.len = len;
5897 xcb_out.device_id = device_id;
5898 xcb_out._delete = _delete;
5899 memset(xcb_out.pad0, 0, 2);
5901 xcb_parts[2].iov_base = (char *) &xcb_out;
5902 xcb_parts[2].iov_len = sizeof(xcb_out);
5903 xcb_parts[3].iov_base = 0;
5904 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5906 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
5907 return xcb_ret;
5910 void *
5911 xcb_input_get_device_property_items (const xcb_input_get_device_property_reply_t *R /**< */)
5913 return (void *) (R + 1);
5916 xcb_input_get_device_property_reply_t *
5917 xcb_input_get_device_property_reply (xcb_connection_t *c /**< */,
5918 xcb_input_get_device_property_cookie_t cookie /**< */,
5919 xcb_generic_error_t **e /**< */)
5921 return (xcb_input_get_device_property_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
5924 void
5925 xcb_input_group_info_next (xcb_input_group_info_iterator_t *i /**< */)
5927 --i->rem;
5928 ++i->data;
5929 i->index += sizeof(xcb_input_group_info_t);
5932 xcb_generic_iterator_t
5933 xcb_input_group_info_end (xcb_input_group_info_iterator_t i /**< */)
5935 xcb_generic_iterator_t ret;
5936 ret.data = i.data + i.rem;
5937 ret.index = i.index + ((char *) ret.data - (char *) i.data);
5938 ret.rem = 0;
5939 return ret;
5942 void
5943 xcb_input_modifier_info_next (xcb_input_modifier_info_iterator_t *i /**< */)
5945 --i->rem;
5946 ++i->data;
5947 i->index += sizeof(xcb_input_modifier_info_t);
5950 xcb_generic_iterator_t
5951 xcb_input_modifier_info_end (xcb_input_modifier_info_iterator_t i /**< */)
5953 xcb_generic_iterator_t ret;
5954 ret.data = i.data + i.rem;
5955 ret.index = i.index + ((char *) ret.data - (char *) i.data);
5956 ret.rem = 0;
5957 return ret;
5961 xcb_input_xi_query_pointer_sizeof (const void *_buffer /**< */)
5963 char *xcb_tmp = (char *)_buffer;
5964 const xcb_input_xi_query_pointer_reply_t *_aux = (xcb_input_xi_query_pointer_reply_t *)_buffer;
5965 unsigned int xcb_buffer_len = 0;
5966 unsigned int xcb_block_len = 0;
5967 unsigned int xcb_pad = 0;
5968 unsigned int xcb_align_to = 0;
5971 xcb_block_len += sizeof(xcb_input_xi_query_pointer_reply_t);
5972 xcb_tmp += xcb_block_len;
5973 xcb_buffer_len += xcb_block_len;
5974 xcb_block_len = 0;
5975 /* buttons */
5976 xcb_block_len += _aux->buttons_len * sizeof(uint32_t);
5977 xcb_tmp += xcb_block_len;
5978 xcb_align_to = ALIGNOF(uint32_t);
5979 /* insert padding */
5980 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
5981 xcb_buffer_len += xcb_block_len + xcb_pad;
5982 if (0 != xcb_pad) {
5983 xcb_tmp += xcb_pad;
5984 xcb_pad = 0;
5986 xcb_block_len = 0;
5988 return xcb_buffer_len;
5991 xcb_input_xi_query_pointer_cookie_t
5992 xcb_input_xi_query_pointer (xcb_connection_t *c /**< */,
5993 xcb_window_t window /**< */,
5994 xcb_input_device_id_t deviceid /**< */)
5996 static const xcb_protocol_request_t xcb_req = {
5997 /* count */ 2,
5998 /* ext */ &xcb_input_id,
5999 /* opcode */ XCB_INPUT_XI_QUERY_POINTER,
6000 /* isvoid */ 0
6003 struct iovec xcb_parts[4];
6004 xcb_input_xi_query_pointer_cookie_t xcb_ret;
6005 xcb_input_xi_query_pointer_request_t xcb_out;
6007 xcb_out.window = window;
6008 xcb_out.deviceid = deviceid;
6009 memset(xcb_out.pad0, 0, 2);
6011 xcb_parts[2].iov_base = (char *) &xcb_out;
6012 xcb_parts[2].iov_len = sizeof(xcb_out);
6013 xcb_parts[3].iov_base = 0;
6014 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
6016 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
6017 return xcb_ret;
6020 xcb_input_xi_query_pointer_cookie_t
6021 xcb_input_xi_query_pointer_unchecked (xcb_connection_t *c /**< */,
6022 xcb_window_t window /**< */,
6023 xcb_input_device_id_t deviceid /**< */)
6025 static const xcb_protocol_request_t xcb_req = {
6026 /* count */ 2,
6027 /* ext */ &xcb_input_id,
6028 /* opcode */ XCB_INPUT_XI_QUERY_POINTER,
6029 /* isvoid */ 0
6032 struct iovec xcb_parts[4];
6033 xcb_input_xi_query_pointer_cookie_t xcb_ret;
6034 xcb_input_xi_query_pointer_request_t xcb_out;
6036 xcb_out.window = window;
6037 xcb_out.deviceid = deviceid;
6038 memset(xcb_out.pad0, 0, 2);
6040 xcb_parts[2].iov_base = (char *) &xcb_out;
6041 xcb_parts[2].iov_len = sizeof(xcb_out);
6042 xcb_parts[3].iov_base = 0;
6043 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
6045 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
6046 return xcb_ret;
6049 uint32_t *
6050 xcb_input_xi_query_pointer_buttons (const xcb_input_xi_query_pointer_reply_t *R /**< */)
6052 return (uint32_t *) (R + 1);
6056 xcb_input_xi_query_pointer_buttons_length (const xcb_input_xi_query_pointer_reply_t *R /**< */)
6058 return R->buttons_len;
6061 xcb_generic_iterator_t
6062 xcb_input_xi_query_pointer_buttons_end (const xcb_input_xi_query_pointer_reply_t *R /**< */)
6064 xcb_generic_iterator_t i;
6065 i.data = ((uint32_t *) (R + 1)) + (R->buttons_len);
6066 i.rem = 0;
6067 i.index = (char *) i.data - (char *) R;
6068 return i;
6071 xcb_input_xi_query_pointer_reply_t *
6072 xcb_input_xi_query_pointer_reply (xcb_connection_t *c /**< */,
6073 xcb_input_xi_query_pointer_cookie_t cookie /**< */,
6074 xcb_generic_error_t **e /**< */)
6076 return (xcb_input_xi_query_pointer_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
6079 xcb_void_cookie_t
6080 xcb_input_xi_warp_pointer_checked (xcb_connection_t *c /**< */,
6081 xcb_window_t src_win /**< */,
6082 xcb_window_t dst_win /**< */,
6083 xcb_input_fp1616_t src_x /**< */,
6084 xcb_input_fp1616_t src_y /**< */,
6085 uint16_t src_width /**< */,
6086 uint16_t src_height /**< */,
6087 xcb_input_fp1616_t dst_x /**< */,
6088 xcb_input_fp1616_t dst_y /**< */,
6089 xcb_input_device_id_t deviceid /**< */)
6091 static const xcb_protocol_request_t xcb_req = {
6092 /* count */ 2,
6093 /* ext */ &xcb_input_id,
6094 /* opcode */ XCB_INPUT_XI_WARP_POINTER,
6095 /* isvoid */ 1
6098 struct iovec xcb_parts[4];
6099 xcb_void_cookie_t xcb_ret;
6100 xcb_input_xi_warp_pointer_request_t xcb_out;
6102 xcb_out.src_win = src_win;
6103 xcb_out.dst_win = dst_win;
6104 xcb_out.src_x = src_x;
6105 xcb_out.src_y = src_y;
6106 xcb_out.src_width = src_width;
6107 xcb_out.src_height = src_height;
6108 xcb_out.dst_x = dst_x;
6109 xcb_out.dst_y = dst_y;
6110 xcb_out.deviceid = deviceid;
6111 memset(xcb_out.pad0, 0, 2);
6113 xcb_parts[2].iov_base = (char *) &xcb_out;
6114 xcb_parts[2].iov_len = sizeof(xcb_out);
6115 xcb_parts[3].iov_base = 0;
6116 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
6118 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
6119 return xcb_ret;
6122 xcb_void_cookie_t
6123 xcb_input_xi_warp_pointer (xcb_connection_t *c /**< */,
6124 xcb_window_t src_win /**< */,
6125 xcb_window_t dst_win /**< */,
6126 xcb_input_fp1616_t src_x /**< */,
6127 xcb_input_fp1616_t src_y /**< */,
6128 uint16_t src_width /**< */,
6129 uint16_t src_height /**< */,
6130 xcb_input_fp1616_t dst_x /**< */,
6131 xcb_input_fp1616_t dst_y /**< */,
6132 xcb_input_device_id_t deviceid /**< */)
6134 static const xcb_protocol_request_t xcb_req = {
6135 /* count */ 2,
6136 /* ext */ &xcb_input_id,
6137 /* opcode */ XCB_INPUT_XI_WARP_POINTER,
6138 /* isvoid */ 1
6141 struct iovec xcb_parts[4];
6142 xcb_void_cookie_t xcb_ret;
6143 xcb_input_xi_warp_pointer_request_t xcb_out;
6145 xcb_out.src_win = src_win;
6146 xcb_out.dst_win = dst_win;
6147 xcb_out.src_x = src_x;
6148 xcb_out.src_y = src_y;
6149 xcb_out.src_width = src_width;
6150 xcb_out.src_height = src_height;
6151 xcb_out.dst_x = dst_x;
6152 xcb_out.dst_y = dst_y;
6153 xcb_out.deviceid = deviceid;
6154 memset(xcb_out.pad0, 0, 2);
6156 xcb_parts[2].iov_base = (char *) &xcb_out;
6157 xcb_parts[2].iov_len = sizeof(xcb_out);
6158 xcb_parts[3].iov_base = 0;
6159 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
6161 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
6162 return xcb_ret;
6165 xcb_void_cookie_t
6166 xcb_input_xi_change_cursor_checked (xcb_connection_t *c /**< */,
6167 xcb_window_t window /**< */,
6168 xcb_cursor_t cursor /**< */,
6169 xcb_input_device_id_t deviceid /**< */)
6171 static const xcb_protocol_request_t xcb_req = {
6172 /* count */ 2,
6173 /* ext */ &xcb_input_id,
6174 /* opcode */ XCB_INPUT_XI_CHANGE_CURSOR,
6175 /* isvoid */ 1
6178 struct iovec xcb_parts[4];
6179 xcb_void_cookie_t xcb_ret;
6180 xcb_input_xi_change_cursor_request_t xcb_out;
6182 xcb_out.window = window;
6183 xcb_out.cursor = cursor;
6184 xcb_out.deviceid = deviceid;
6185 memset(xcb_out.pad0, 0, 2);
6187 xcb_parts[2].iov_base = (char *) &xcb_out;
6188 xcb_parts[2].iov_len = sizeof(xcb_out);
6189 xcb_parts[3].iov_base = 0;
6190 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
6192 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
6193 return xcb_ret;
6196 xcb_void_cookie_t
6197 xcb_input_xi_change_cursor (xcb_connection_t *c /**< */,
6198 xcb_window_t window /**< */,
6199 xcb_cursor_t cursor /**< */,
6200 xcb_input_device_id_t deviceid /**< */)
6202 static const xcb_protocol_request_t xcb_req = {
6203 /* count */ 2,
6204 /* ext */ &xcb_input_id,
6205 /* opcode */ XCB_INPUT_XI_CHANGE_CURSOR,
6206 /* isvoid */ 1
6209 struct iovec xcb_parts[4];
6210 xcb_void_cookie_t xcb_ret;
6211 xcb_input_xi_change_cursor_request_t xcb_out;
6213 xcb_out.window = window;
6214 xcb_out.cursor = cursor;
6215 xcb_out.deviceid = deviceid;
6216 memset(xcb_out.pad0, 0, 2);
6218 xcb_parts[2].iov_base = (char *) &xcb_out;
6219 xcb_parts[2].iov_len = sizeof(xcb_out);
6220 xcb_parts[3].iov_base = 0;
6221 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
6223 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
6224 return xcb_ret;
6228 xcb_input_add_master_sizeof (const void *_buffer /**< */)
6230 char *xcb_tmp = (char *)_buffer;
6231 const xcb_input_add_master_t *_aux = (xcb_input_add_master_t *)_buffer;
6232 unsigned int xcb_buffer_len = 0;
6233 unsigned int xcb_block_len = 0;
6234 unsigned int xcb_pad = 0;
6235 unsigned int xcb_align_to = 0;
6238 xcb_block_len += sizeof(xcb_input_add_master_t);
6239 xcb_tmp += xcb_block_len;
6240 xcb_buffer_len += xcb_block_len;
6241 xcb_block_len = 0;
6242 /* name */
6243 xcb_block_len += _aux->name_len * sizeof(char);
6244 xcb_tmp += xcb_block_len;
6245 xcb_align_to = ALIGNOF(char);
6246 /* insert padding */
6247 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6248 xcb_buffer_len += xcb_block_len + xcb_pad;
6249 if (0 != xcb_pad) {
6250 xcb_tmp += xcb_pad;
6251 xcb_pad = 0;
6253 xcb_block_len = 0;
6255 return xcb_buffer_len;
6258 char *
6259 xcb_input_add_master_name (const xcb_input_add_master_t *R /**< */)
6261 return (char *) (R + 1);
6265 xcb_input_add_master_name_length (const xcb_input_add_master_t *R /**< */)
6267 return R->name_len;
6270 xcb_generic_iterator_t
6271 xcb_input_add_master_name_end (const xcb_input_add_master_t *R /**< */)
6273 xcb_generic_iterator_t i;
6274 i.data = ((char *) (R + 1)) + (R->name_len);
6275 i.rem = 0;
6276 i.index = (char *) i.data - (char *) R;
6277 return i;
6280 void
6281 xcb_input_add_master_next (xcb_input_add_master_iterator_t *i /**< */)
6283 xcb_input_add_master_t *R = i->data;
6284 xcb_generic_iterator_t child;
6285 child.data = (xcb_input_add_master_t *)(((char *)R) + xcb_input_add_master_sizeof(R));
6286 i->index = (char *) child.data - (char *) i->data;
6287 --i->rem;
6288 i->data = (xcb_input_add_master_t *) child.data;
6291 xcb_generic_iterator_t
6292 xcb_input_add_master_end (xcb_input_add_master_iterator_t i /**< */)
6294 xcb_generic_iterator_t ret;
6295 while(i.rem > 0)
6296 xcb_input_add_master_next(&i);
6297 ret.data = i.data;
6298 ret.rem = i.rem;
6299 ret.index = i.index;
6300 return ret;
6303 void
6304 xcb_input_remove_master_next (xcb_input_remove_master_iterator_t *i /**< */)
6306 --i->rem;
6307 ++i->data;
6308 i->index += sizeof(xcb_input_remove_master_t);
6311 xcb_generic_iterator_t
6312 xcb_input_remove_master_end (xcb_input_remove_master_iterator_t i /**< */)
6314 xcb_generic_iterator_t ret;
6315 ret.data = i.data + i.rem;
6316 ret.index = i.index + ((char *) ret.data - (char *) i.data);
6317 ret.rem = 0;
6318 return ret;
6321 void
6322 xcb_input_attach_slave_next (xcb_input_attach_slave_iterator_t *i /**< */)
6324 --i->rem;
6325 ++i->data;
6326 i->index += sizeof(xcb_input_attach_slave_t);
6329 xcb_generic_iterator_t
6330 xcb_input_attach_slave_end (xcb_input_attach_slave_iterator_t i /**< */)
6332 xcb_generic_iterator_t ret;
6333 ret.data = i.data + i.rem;
6334 ret.index = i.index + ((char *) ret.data - (char *) i.data);
6335 ret.rem = 0;
6336 return ret;
6339 void
6340 xcb_input_detach_slave_next (xcb_input_detach_slave_iterator_t *i /**< */)
6342 --i->rem;
6343 ++i->data;
6344 i->index += sizeof(xcb_input_detach_slave_t);
6347 xcb_generic_iterator_t
6348 xcb_input_detach_slave_end (xcb_input_detach_slave_iterator_t i /**< */)
6350 xcb_generic_iterator_t ret;
6351 ret.data = i.data + i.rem;
6352 ret.index = i.index + ((char *) ret.data - (char *) i.data);
6353 ret.rem = 0;
6354 return ret;
6358 xcb_input_hierarchy_change_sizeof (const void *_buffer /**< */)
6360 char *xcb_tmp = (char *)_buffer;
6361 const xcb_input_hierarchy_change_t *_aux = (xcb_input_hierarchy_change_t *)_buffer;
6362 unsigned int xcb_buffer_len = 0;
6363 unsigned int xcb_block_len = 0;
6364 unsigned int xcb_pad = 0;
6365 unsigned int xcb_align_to = 0;
6368 xcb_block_len += sizeof(xcb_input_hierarchy_change_t);
6369 xcb_tmp += xcb_block_len;
6370 xcb_buffer_len += xcb_block_len;
6371 xcb_block_len = 0;
6372 /* uninterpreted_data */
6373 xcb_block_len += ((_aux->len * 4) - 4) * sizeof(uint8_t);
6374 xcb_tmp += xcb_block_len;
6375 xcb_align_to = ALIGNOF(uint8_t);
6376 /* insert padding */
6377 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6378 xcb_buffer_len += xcb_block_len + xcb_pad;
6379 if (0 != xcb_pad) {
6380 xcb_tmp += xcb_pad;
6381 xcb_pad = 0;
6383 xcb_block_len = 0;
6385 return xcb_buffer_len;
6388 uint8_t *
6389 xcb_input_hierarchy_change_uninterpreted_data (const xcb_input_hierarchy_change_t *R /**< */)
6391 return (uint8_t *) (R + 1);
6395 xcb_input_hierarchy_change_uninterpreted_data_length (const xcb_input_hierarchy_change_t *R /**< */)
6397 return ((R->len * 4) - 4);
6400 xcb_generic_iterator_t
6401 xcb_input_hierarchy_change_uninterpreted_data_end (const xcb_input_hierarchy_change_t *R /**< */)
6403 xcb_generic_iterator_t i;
6404 i.data = ((uint8_t *) (R + 1)) + (((R->len * 4) - 4));
6405 i.rem = 0;
6406 i.index = (char *) i.data - (char *) R;
6407 return i;
6410 void
6411 xcb_input_hierarchy_change_next (xcb_input_hierarchy_change_iterator_t *i /**< */)
6413 xcb_input_hierarchy_change_t *R = i->data;
6414 xcb_generic_iterator_t child;
6415 child.data = (xcb_input_hierarchy_change_t *)(((char *)R) + xcb_input_hierarchy_change_sizeof(R));
6416 i->index = (char *) child.data - (char *) i->data;
6417 --i->rem;
6418 i->data = (xcb_input_hierarchy_change_t *) child.data;
6421 xcb_generic_iterator_t
6422 xcb_input_hierarchy_change_end (xcb_input_hierarchy_change_iterator_t i /**< */)
6424 xcb_generic_iterator_t ret;
6425 while(i.rem > 0)
6426 xcb_input_hierarchy_change_next(&i);
6427 ret.data = i.data;
6428 ret.rem = i.rem;
6429 ret.index = i.index;
6430 return ret;
6434 xcb_input_xi_change_hierarchy_sizeof (const void *_buffer /**< */)
6436 char *xcb_tmp = (char *)_buffer;
6437 const xcb_input_xi_change_hierarchy_request_t *_aux = (xcb_input_xi_change_hierarchy_request_t *)_buffer;
6438 unsigned int xcb_buffer_len = 0;
6439 unsigned int xcb_block_len = 0;
6440 unsigned int xcb_pad = 0;
6441 unsigned int xcb_align_to = 0;
6443 unsigned int i;
6444 unsigned int xcb_tmp_len;
6446 xcb_block_len += sizeof(xcb_input_xi_change_hierarchy_request_t);
6447 xcb_tmp += xcb_block_len;
6448 xcb_buffer_len += xcb_block_len;
6449 xcb_block_len = 0;
6450 /* changes */
6451 for(i=0; i<_aux->num_changes; i++) {
6452 xcb_tmp_len = xcb_input_hierarchy_change_sizeof(xcb_tmp);
6453 xcb_block_len += xcb_tmp_len;
6454 xcb_tmp += xcb_tmp_len;
6456 xcb_align_to = ALIGNOF(xcb_input_hierarchy_change_t);
6457 /* insert padding */
6458 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6459 xcb_buffer_len += xcb_block_len + xcb_pad;
6460 if (0 != xcb_pad) {
6461 xcb_tmp += xcb_pad;
6462 xcb_pad = 0;
6464 xcb_block_len = 0;
6466 return xcb_buffer_len;
6469 xcb_void_cookie_t
6470 xcb_input_xi_change_hierarchy_checked (xcb_connection_t *c /**< */,
6471 uint8_t num_changes /**< */,
6472 const xcb_input_hierarchy_change_t *changes /**< */)
6474 static const xcb_protocol_request_t xcb_req = {
6475 /* count */ 4,
6476 /* ext */ &xcb_input_id,
6477 /* opcode */ XCB_INPUT_XI_CHANGE_HIERARCHY,
6478 /* isvoid */ 1
6481 struct iovec xcb_parts[6];
6482 xcb_void_cookie_t xcb_ret;
6483 xcb_input_xi_change_hierarchy_request_t xcb_out;
6484 unsigned int i;
6485 unsigned int xcb_tmp_len;
6486 char *xcb_tmp;
6488 xcb_out.num_changes = num_changes;
6489 memset(xcb_out.pad0, 0, 3);
6491 xcb_parts[2].iov_base = (char *) &xcb_out;
6492 xcb_parts[2].iov_len = sizeof(xcb_out);
6493 xcb_parts[3].iov_base = 0;
6494 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
6495 /* xcb_input_hierarchy_change_t changes */
6496 xcb_parts[4].iov_base = (char *) changes;
6497 xcb_parts[4].iov_len = 0;
6498 xcb_tmp = (char *)changes;
6499 for(i=0; i<num_changes; i++) {
6500 xcb_tmp_len = xcb_input_hierarchy_change_sizeof(xcb_tmp);
6501 xcb_parts[4].iov_len += xcb_tmp_len;
6502 xcb_tmp += xcb_tmp_len;
6504 xcb_parts[5].iov_base = 0;
6505 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
6507 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
6508 return xcb_ret;
6511 xcb_void_cookie_t
6512 xcb_input_xi_change_hierarchy (xcb_connection_t *c /**< */,
6513 uint8_t num_changes /**< */,
6514 const xcb_input_hierarchy_change_t *changes /**< */)
6516 static const xcb_protocol_request_t xcb_req = {
6517 /* count */ 4,
6518 /* ext */ &xcb_input_id,
6519 /* opcode */ XCB_INPUT_XI_CHANGE_HIERARCHY,
6520 /* isvoid */ 1
6523 struct iovec xcb_parts[6];
6524 xcb_void_cookie_t xcb_ret;
6525 xcb_input_xi_change_hierarchy_request_t xcb_out;
6526 unsigned int i;
6527 unsigned int xcb_tmp_len;
6528 char *xcb_tmp;
6530 xcb_out.num_changes = num_changes;
6531 memset(xcb_out.pad0, 0, 3);
6533 xcb_parts[2].iov_base = (char *) &xcb_out;
6534 xcb_parts[2].iov_len = sizeof(xcb_out);
6535 xcb_parts[3].iov_base = 0;
6536 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
6537 /* xcb_input_hierarchy_change_t changes */
6538 xcb_parts[4].iov_base = (char *) changes;
6539 xcb_parts[4].iov_len = 0;
6540 xcb_tmp = (char *)changes;
6541 for(i=0; i<num_changes; i++) {
6542 xcb_tmp_len = xcb_input_hierarchy_change_sizeof(xcb_tmp);
6543 xcb_parts[4].iov_len += xcb_tmp_len;
6544 xcb_tmp += xcb_tmp_len;
6546 xcb_parts[5].iov_base = 0;
6547 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
6549 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
6550 return xcb_ret;
6553 xcb_void_cookie_t
6554 xcb_input_xi_set_client_pointer_checked (xcb_connection_t *c /**< */,
6555 xcb_window_t window /**< */,
6556 xcb_input_device_id_t deviceid /**< */)
6558 static const xcb_protocol_request_t xcb_req = {
6559 /* count */ 2,
6560 /* ext */ &xcb_input_id,
6561 /* opcode */ XCB_INPUT_XI_SET_CLIENT_POINTER,
6562 /* isvoid */ 1
6565 struct iovec xcb_parts[4];
6566 xcb_void_cookie_t xcb_ret;
6567 xcb_input_xi_set_client_pointer_request_t xcb_out;
6569 xcb_out.window = window;
6570 xcb_out.deviceid = deviceid;
6571 memset(xcb_out.pad0, 0, 2);
6573 xcb_parts[2].iov_base = (char *) &xcb_out;
6574 xcb_parts[2].iov_len = sizeof(xcb_out);
6575 xcb_parts[3].iov_base = 0;
6576 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
6578 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
6579 return xcb_ret;
6582 xcb_void_cookie_t
6583 xcb_input_xi_set_client_pointer (xcb_connection_t *c /**< */,
6584 xcb_window_t window /**< */,
6585 xcb_input_device_id_t deviceid /**< */)
6587 static const xcb_protocol_request_t xcb_req = {
6588 /* count */ 2,
6589 /* ext */ &xcb_input_id,
6590 /* opcode */ XCB_INPUT_XI_SET_CLIENT_POINTER,
6591 /* isvoid */ 1
6594 struct iovec xcb_parts[4];
6595 xcb_void_cookie_t xcb_ret;
6596 xcb_input_xi_set_client_pointer_request_t xcb_out;
6598 xcb_out.window = window;
6599 xcb_out.deviceid = deviceid;
6600 memset(xcb_out.pad0, 0, 2);
6602 xcb_parts[2].iov_base = (char *) &xcb_out;
6603 xcb_parts[2].iov_len = sizeof(xcb_out);
6604 xcb_parts[3].iov_base = 0;
6605 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
6607 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
6608 return xcb_ret;
6611 xcb_input_xi_get_client_pointer_cookie_t
6612 xcb_input_xi_get_client_pointer (xcb_connection_t *c /**< */,
6613 xcb_window_t window /**< */)
6615 static const xcb_protocol_request_t xcb_req = {
6616 /* count */ 2,
6617 /* ext */ &xcb_input_id,
6618 /* opcode */ XCB_INPUT_XI_GET_CLIENT_POINTER,
6619 /* isvoid */ 0
6622 struct iovec xcb_parts[4];
6623 xcb_input_xi_get_client_pointer_cookie_t xcb_ret;
6624 xcb_input_xi_get_client_pointer_request_t xcb_out;
6626 xcb_out.window = window;
6628 xcb_parts[2].iov_base = (char *) &xcb_out;
6629 xcb_parts[2].iov_len = sizeof(xcb_out);
6630 xcb_parts[3].iov_base = 0;
6631 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
6633 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
6634 return xcb_ret;
6637 xcb_input_xi_get_client_pointer_cookie_t
6638 xcb_input_xi_get_client_pointer_unchecked (xcb_connection_t *c /**< */,
6639 xcb_window_t window /**< */)
6641 static const xcb_protocol_request_t xcb_req = {
6642 /* count */ 2,
6643 /* ext */ &xcb_input_id,
6644 /* opcode */ XCB_INPUT_XI_GET_CLIENT_POINTER,
6645 /* isvoid */ 0
6648 struct iovec xcb_parts[4];
6649 xcb_input_xi_get_client_pointer_cookie_t xcb_ret;
6650 xcb_input_xi_get_client_pointer_request_t xcb_out;
6652 xcb_out.window = window;
6654 xcb_parts[2].iov_base = (char *) &xcb_out;
6655 xcb_parts[2].iov_len = sizeof(xcb_out);
6656 xcb_parts[3].iov_base = 0;
6657 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
6659 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
6660 return xcb_ret;
6663 xcb_input_xi_get_client_pointer_reply_t *
6664 xcb_input_xi_get_client_pointer_reply (xcb_connection_t *c /**< */,
6665 xcb_input_xi_get_client_pointer_cookie_t cookie /**< */,
6666 xcb_generic_error_t **e /**< */)
6668 return (xcb_input_xi_get_client_pointer_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
6672 xcb_input_event_mask_sizeof (const void *_buffer /**< */)
6674 char *xcb_tmp = (char *)_buffer;
6675 const xcb_input_event_mask_t *_aux = (xcb_input_event_mask_t *)_buffer;
6676 unsigned int xcb_buffer_len = 0;
6677 unsigned int xcb_block_len = 0;
6678 unsigned int xcb_pad = 0;
6679 unsigned int xcb_align_to = 0;
6682 xcb_block_len += sizeof(xcb_input_event_mask_t);
6683 xcb_tmp += xcb_block_len;
6684 xcb_buffer_len += xcb_block_len;
6685 xcb_block_len = 0;
6686 /* mask */
6687 xcb_block_len += _aux->mask_len * sizeof(uint32_t);
6688 xcb_tmp += xcb_block_len;
6689 xcb_align_to = ALIGNOF(uint32_t);
6690 /* insert padding */
6691 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6692 xcb_buffer_len += xcb_block_len + xcb_pad;
6693 if (0 != xcb_pad) {
6694 xcb_tmp += xcb_pad;
6695 xcb_pad = 0;
6697 xcb_block_len = 0;
6699 return xcb_buffer_len;
6702 uint32_t *
6703 xcb_input_event_mask_mask (const xcb_input_event_mask_t *R /**< */)
6705 return (uint32_t *) (R + 1);
6709 xcb_input_event_mask_mask_length (const xcb_input_event_mask_t *R /**< */)
6711 return R->mask_len;
6714 xcb_generic_iterator_t
6715 xcb_input_event_mask_mask_end (const xcb_input_event_mask_t *R /**< */)
6717 xcb_generic_iterator_t i;
6718 i.data = ((uint32_t *) (R + 1)) + (R->mask_len);
6719 i.rem = 0;
6720 i.index = (char *) i.data - (char *) R;
6721 return i;
6724 void
6725 xcb_input_event_mask_next (xcb_input_event_mask_iterator_t *i /**< */)
6727 xcb_input_event_mask_t *R = i->data;
6728 xcb_generic_iterator_t child;
6729 child.data = (xcb_input_event_mask_t *)(((char *)R) + xcb_input_event_mask_sizeof(R));
6730 i->index = (char *) child.data - (char *) i->data;
6731 --i->rem;
6732 i->data = (xcb_input_event_mask_t *) child.data;
6735 xcb_generic_iterator_t
6736 xcb_input_event_mask_end (xcb_input_event_mask_iterator_t i /**< */)
6738 xcb_generic_iterator_t ret;
6739 while(i.rem > 0)
6740 xcb_input_event_mask_next(&i);
6741 ret.data = i.data;
6742 ret.rem = i.rem;
6743 ret.index = i.index;
6744 return ret;
6748 xcb_input_xi_select_events_sizeof (const void *_buffer /**< */)
6750 char *xcb_tmp = (char *)_buffer;
6751 const xcb_input_xi_select_events_request_t *_aux = (xcb_input_xi_select_events_request_t *)_buffer;
6752 unsigned int xcb_buffer_len = 0;
6753 unsigned int xcb_block_len = 0;
6754 unsigned int xcb_pad = 0;
6755 unsigned int xcb_align_to = 0;
6757 unsigned int i;
6758 unsigned int xcb_tmp_len;
6760 xcb_block_len += sizeof(xcb_input_xi_select_events_request_t);
6761 xcb_tmp += xcb_block_len;
6762 xcb_buffer_len += xcb_block_len;
6763 xcb_block_len = 0;
6764 /* masks */
6765 for(i=0; i<_aux->num_mask; i++) {
6766 xcb_tmp_len = xcb_input_event_mask_sizeof(xcb_tmp);
6767 xcb_block_len += xcb_tmp_len;
6768 xcb_tmp += xcb_tmp_len;
6770 xcb_align_to = ALIGNOF(xcb_input_event_mask_t);
6771 /* insert padding */
6772 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6773 xcb_buffer_len += xcb_block_len + xcb_pad;
6774 if (0 != xcb_pad) {
6775 xcb_tmp += xcb_pad;
6776 xcb_pad = 0;
6778 xcb_block_len = 0;
6780 return xcb_buffer_len;
6783 xcb_void_cookie_t
6784 xcb_input_xi_select_events_checked (xcb_connection_t *c /**< */,
6785 xcb_window_t window /**< */,
6786 uint16_t num_mask /**< */,
6787 const xcb_input_event_mask_t *masks /**< */)
6789 static const xcb_protocol_request_t xcb_req = {
6790 /* count */ 4,
6791 /* ext */ &xcb_input_id,
6792 /* opcode */ XCB_INPUT_XI_SELECT_EVENTS,
6793 /* isvoid */ 1
6796 struct iovec xcb_parts[6];
6797 xcb_void_cookie_t xcb_ret;
6798 xcb_input_xi_select_events_request_t xcb_out;
6799 unsigned int i;
6800 unsigned int xcb_tmp_len;
6801 char *xcb_tmp;
6803 xcb_out.window = window;
6804 xcb_out.num_mask = num_mask;
6805 memset(xcb_out.pad0, 0, 2);
6807 xcb_parts[2].iov_base = (char *) &xcb_out;
6808 xcb_parts[2].iov_len = sizeof(xcb_out);
6809 xcb_parts[3].iov_base = 0;
6810 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
6811 /* xcb_input_event_mask_t masks */
6812 xcb_parts[4].iov_base = (char *) masks;
6813 xcb_parts[4].iov_len = 0;
6814 xcb_tmp = (char *)masks;
6815 for(i=0; i<num_mask; i++) {
6816 xcb_tmp_len = xcb_input_event_mask_sizeof(xcb_tmp);
6817 xcb_parts[4].iov_len += xcb_tmp_len;
6818 xcb_tmp += xcb_tmp_len;
6820 xcb_parts[5].iov_base = 0;
6821 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
6823 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
6824 return xcb_ret;
6827 xcb_void_cookie_t
6828 xcb_input_xi_select_events (xcb_connection_t *c /**< */,
6829 xcb_window_t window /**< */,
6830 uint16_t num_mask /**< */,
6831 const xcb_input_event_mask_t *masks /**< */)
6833 static const xcb_protocol_request_t xcb_req = {
6834 /* count */ 4,
6835 /* ext */ &xcb_input_id,
6836 /* opcode */ XCB_INPUT_XI_SELECT_EVENTS,
6837 /* isvoid */ 1
6840 struct iovec xcb_parts[6];
6841 xcb_void_cookie_t xcb_ret;
6842 xcb_input_xi_select_events_request_t xcb_out;
6843 unsigned int i;
6844 unsigned int xcb_tmp_len;
6845 char *xcb_tmp;
6847 xcb_out.window = window;
6848 xcb_out.num_mask = num_mask;
6849 memset(xcb_out.pad0, 0, 2);
6851 xcb_parts[2].iov_base = (char *) &xcb_out;
6852 xcb_parts[2].iov_len = sizeof(xcb_out);
6853 xcb_parts[3].iov_base = 0;
6854 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
6855 /* xcb_input_event_mask_t masks */
6856 xcb_parts[4].iov_base = (char *) masks;
6857 xcb_parts[4].iov_len = 0;
6858 xcb_tmp = (char *)masks;
6859 for(i=0; i<num_mask; i++) {
6860 xcb_tmp_len = xcb_input_event_mask_sizeof(xcb_tmp);
6861 xcb_parts[4].iov_len += xcb_tmp_len;
6862 xcb_tmp += xcb_tmp_len;
6864 xcb_parts[5].iov_base = 0;
6865 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
6867 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
6868 return xcb_ret;
6871 xcb_input_xi_query_version_cookie_t
6872 xcb_input_xi_query_version (xcb_connection_t *c /**< */,
6873 uint16_t major_version /**< */,
6874 uint16_t minor_version /**< */)
6876 static const xcb_protocol_request_t xcb_req = {
6877 /* count */ 2,
6878 /* ext */ &xcb_input_id,
6879 /* opcode */ XCB_INPUT_XI_QUERY_VERSION,
6880 /* isvoid */ 0
6883 struct iovec xcb_parts[4];
6884 xcb_input_xi_query_version_cookie_t xcb_ret;
6885 xcb_input_xi_query_version_request_t xcb_out;
6887 xcb_out.major_version = major_version;
6888 xcb_out.minor_version = minor_version;
6890 xcb_parts[2].iov_base = (char *) &xcb_out;
6891 xcb_parts[2].iov_len = sizeof(xcb_out);
6892 xcb_parts[3].iov_base = 0;
6893 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
6895 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
6896 return xcb_ret;
6899 xcb_input_xi_query_version_cookie_t
6900 xcb_input_xi_query_version_unchecked (xcb_connection_t *c /**< */,
6901 uint16_t major_version /**< */,
6902 uint16_t minor_version /**< */)
6904 static const xcb_protocol_request_t xcb_req = {
6905 /* count */ 2,
6906 /* ext */ &xcb_input_id,
6907 /* opcode */ XCB_INPUT_XI_QUERY_VERSION,
6908 /* isvoid */ 0
6911 struct iovec xcb_parts[4];
6912 xcb_input_xi_query_version_cookie_t xcb_ret;
6913 xcb_input_xi_query_version_request_t xcb_out;
6915 xcb_out.major_version = major_version;
6916 xcb_out.minor_version = minor_version;
6918 xcb_parts[2].iov_base = (char *) &xcb_out;
6919 xcb_parts[2].iov_len = sizeof(xcb_out);
6920 xcb_parts[3].iov_base = 0;
6921 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
6923 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
6924 return xcb_ret;
6927 xcb_input_xi_query_version_reply_t *
6928 xcb_input_xi_query_version_reply (xcb_connection_t *c /**< */,
6929 xcb_input_xi_query_version_cookie_t cookie /**< */,
6930 xcb_generic_error_t **e /**< */)
6932 return (xcb_input_xi_query_version_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
6936 xcb_input_button_class_sizeof (const void *_buffer /**< */)
6938 char *xcb_tmp = (char *)_buffer;
6939 const xcb_input_button_class_t *_aux = (xcb_input_button_class_t *)_buffer;
6940 unsigned int xcb_buffer_len = 0;
6941 unsigned int xcb_block_len = 0;
6942 unsigned int xcb_pad = 0;
6943 unsigned int xcb_align_to = 0;
6946 xcb_block_len += sizeof(xcb_input_button_class_t);
6947 xcb_tmp += xcb_block_len;
6948 xcb_buffer_len += xcb_block_len;
6949 xcb_block_len = 0;
6950 /* state */
6951 xcb_block_len += ((_aux->num_buttons + 31) / 32) * sizeof(xcb_atom_t);
6952 xcb_tmp += xcb_block_len;
6953 xcb_align_to = ALIGNOF(uint32_t);
6954 /* insert padding */
6955 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6956 xcb_buffer_len += xcb_block_len + xcb_pad;
6957 if (0 != xcb_pad) {
6958 xcb_tmp += xcb_pad;
6959 xcb_pad = 0;
6961 xcb_block_len = 0;
6962 /* labels */
6963 xcb_block_len += _aux->num_buttons * sizeof(xcb_atom_t);
6964 xcb_tmp += xcb_block_len;
6965 xcb_align_to = ALIGNOF(xcb_atom_t);
6966 /* insert padding */
6967 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6968 xcb_buffer_len += xcb_block_len + xcb_pad;
6969 if (0 != xcb_pad) {
6970 xcb_tmp += xcb_pad;
6971 xcb_pad = 0;
6973 xcb_block_len = 0;
6975 return xcb_buffer_len;
6978 uint32_t *
6979 xcb_input_button_class_state (const xcb_input_button_class_t *R /**< */)
6981 return (uint32_t *) (R + 1);
6985 xcb_input_button_class_state_length (const xcb_input_button_class_t *R /**< */)
6987 return ((R->num_buttons + 31) / 32);
6990 xcb_generic_iterator_t
6991 xcb_input_button_class_state_end (const xcb_input_button_class_t *R /**< */)
6993 xcb_generic_iterator_t i;
6994 i.data = ((uint32_t *) (R + 1)) + (((R->num_buttons + 31) / 32));
6995 i.rem = 0;
6996 i.index = (char *) i.data - (char *) R;
6997 return i;
7000 xcb_atom_t *
7001 xcb_input_button_class_labels (const xcb_input_button_class_t *R /**< */)
7003 xcb_generic_iterator_t prev = xcb_input_button_class_state_end(R);
7004 return (xcb_atom_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_atom_t, prev.index) + 0);
7008 xcb_input_button_class_labels_length (const xcb_input_button_class_t *R /**< */)
7010 return R->num_buttons;
7013 xcb_generic_iterator_t
7014 xcb_input_button_class_labels_end (const xcb_input_button_class_t *R /**< */)
7016 xcb_generic_iterator_t i;
7017 xcb_generic_iterator_t child = xcb_input_button_class_state_end(R);
7018 i.data = ((xcb_atom_t *) child.data) + (R->num_buttons);
7019 i.rem = 0;
7020 i.index = (char *) i.data - (char *) R;
7021 return i;
7024 void
7025 xcb_input_button_class_next (xcb_input_button_class_iterator_t *i /**< */)
7027 xcb_input_button_class_t *R = i->data;
7028 xcb_generic_iterator_t child;
7029 child.data = (xcb_input_button_class_t *)(((char *)R) + xcb_input_button_class_sizeof(R));
7030 i->index = (char *) child.data - (char *) i->data;
7031 --i->rem;
7032 i->data = (xcb_input_button_class_t *) child.data;
7035 xcb_generic_iterator_t
7036 xcb_input_button_class_end (xcb_input_button_class_iterator_t i /**< */)
7038 xcb_generic_iterator_t ret;
7039 while(i.rem > 0)
7040 xcb_input_button_class_next(&i);
7041 ret.data = i.data;
7042 ret.rem = i.rem;
7043 ret.index = i.index;
7044 return ret;
7048 xcb_input_key_class_sizeof (const void *_buffer /**< */)
7050 char *xcb_tmp = (char *)_buffer;
7051 const xcb_input_key_class_t *_aux = (xcb_input_key_class_t *)_buffer;
7052 unsigned int xcb_buffer_len = 0;
7053 unsigned int xcb_block_len = 0;
7054 unsigned int xcb_pad = 0;
7055 unsigned int xcb_align_to = 0;
7058 xcb_block_len += sizeof(xcb_input_key_class_t);
7059 xcb_tmp += xcb_block_len;
7060 xcb_buffer_len += xcb_block_len;
7061 xcb_block_len = 0;
7062 /* keys */
7063 xcb_block_len += _aux->num_keys * sizeof(uint32_t);
7064 xcb_tmp += xcb_block_len;
7065 xcb_align_to = ALIGNOF(uint32_t);
7066 /* insert padding */
7067 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
7068 xcb_buffer_len += xcb_block_len + xcb_pad;
7069 if (0 != xcb_pad) {
7070 xcb_tmp += xcb_pad;
7071 xcb_pad = 0;
7073 xcb_block_len = 0;
7075 return xcb_buffer_len;
7078 uint32_t *
7079 xcb_input_key_class_keys (const xcb_input_key_class_t *R /**< */)
7081 return (uint32_t *) (R + 1);
7085 xcb_input_key_class_keys_length (const xcb_input_key_class_t *R /**< */)
7087 return R->num_keys;
7090 xcb_generic_iterator_t
7091 xcb_input_key_class_keys_end (const xcb_input_key_class_t *R /**< */)
7093 xcb_generic_iterator_t i;
7094 i.data = ((uint32_t *) (R + 1)) + (R->num_keys);
7095 i.rem = 0;
7096 i.index = (char *) i.data - (char *) R;
7097 return i;
7100 void
7101 xcb_input_key_class_next (xcb_input_key_class_iterator_t *i /**< */)
7103 xcb_input_key_class_t *R = i->data;
7104 xcb_generic_iterator_t child;
7105 child.data = (xcb_input_key_class_t *)(((char *)R) + xcb_input_key_class_sizeof(R));
7106 i->index = (char *) child.data - (char *) i->data;
7107 --i->rem;
7108 i->data = (xcb_input_key_class_t *) child.data;
7111 xcb_generic_iterator_t
7112 xcb_input_key_class_end (xcb_input_key_class_iterator_t i /**< */)
7114 xcb_generic_iterator_t ret;
7115 while(i.rem > 0)
7116 xcb_input_key_class_next(&i);
7117 ret.data = i.data;
7118 ret.rem = i.rem;
7119 ret.index = i.index;
7120 return ret;
7123 void
7124 xcb_input_scroll_class_next (xcb_input_scroll_class_iterator_t *i /**< */)
7126 --i->rem;
7127 ++i->data;
7128 i->index += sizeof(xcb_input_scroll_class_t);
7131 xcb_generic_iterator_t
7132 xcb_input_scroll_class_end (xcb_input_scroll_class_iterator_t i /**< */)
7134 xcb_generic_iterator_t ret;
7135 ret.data = i.data + i.rem;
7136 ret.index = i.index + ((char *) ret.data - (char *) i.data);
7137 ret.rem = 0;
7138 return ret;
7141 void
7142 xcb_input_touch_class_next (xcb_input_touch_class_iterator_t *i /**< */)
7144 --i->rem;
7145 ++i->data;
7146 i->index += sizeof(xcb_input_touch_class_t);
7149 xcb_generic_iterator_t
7150 xcb_input_touch_class_end (xcb_input_touch_class_iterator_t i /**< */)
7152 xcb_generic_iterator_t ret;
7153 ret.data = i.data + i.rem;
7154 ret.index = i.index + ((char *) ret.data - (char *) i.data);
7155 ret.rem = 0;
7156 return ret;
7159 void
7160 xcb_input_valuator_class_next (xcb_input_valuator_class_iterator_t *i /**< */)
7162 --i->rem;
7163 ++i->data;
7164 i->index += sizeof(xcb_input_valuator_class_t);
7167 xcb_generic_iterator_t
7168 xcb_input_valuator_class_end (xcb_input_valuator_class_iterator_t i /**< */)
7170 xcb_generic_iterator_t ret;
7171 ret.data = i.data + i.rem;
7172 ret.index = i.index + ((char *) ret.data - (char *) i.data);
7173 ret.rem = 0;
7174 return ret;
7178 xcb_input_device_class_sizeof (const void *_buffer /**< */)
7180 char *xcb_tmp = (char *)_buffer;
7181 const xcb_input_device_class_t *_aux = (xcb_input_device_class_t *)_buffer;
7182 unsigned int xcb_buffer_len = 0;
7183 unsigned int xcb_block_len = 0;
7184 unsigned int xcb_pad = 0;
7185 unsigned int xcb_align_to = 0;
7188 xcb_block_len += sizeof(xcb_input_device_class_t);
7189 xcb_tmp += xcb_block_len;
7190 xcb_buffer_len += xcb_block_len;
7191 xcb_block_len = 0;
7192 /* uninterpreted_data */
7193 xcb_block_len += ((_aux->len * 4) - 8) * sizeof(uint8_t);
7194 xcb_tmp += xcb_block_len;
7195 xcb_align_to = ALIGNOF(uint8_t);
7196 /* insert padding */
7197 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
7198 xcb_buffer_len += xcb_block_len + xcb_pad;
7199 if (0 != xcb_pad) {
7200 xcb_tmp += xcb_pad;
7201 xcb_pad = 0;
7203 xcb_block_len = 0;
7205 return xcb_buffer_len;
7208 uint8_t *
7209 xcb_input_device_class_uninterpreted_data (const xcb_input_device_class_t *R /**< */)
7211 return (uint8_t *) (R + 1);
7215 xcb_input_device_class_uninterpreted_data_length (const xcb_input_device_class_t *R /**< */)
7217 return ((R->len * 4) - 8);
7220 xcb_generic_iterator_t
7221 xcb_input_device_class_uninterpreted_data_end (const xcb_input_device_class_t *R /**< */)
7223 xcb_generic_iterator_t i;
7224 i.data = ((uint8_t *) (R + 1)) + (((R->len * 4) - 8));
7225 i.rem = 0;
7226 i.index = (char *) i.data - (char *) R;
7227 return i;
7230 void
7231 xcb_input_device_class_next (xcb_input_device_class_iterator_t *i /**< */)
7233 xcb_input_device_class_t *R = i->data;
7234 xcb_generic_iterator_t child;
7235 child.data = (xcb_input_device_class_t *)(((char *)R) + xcb_input_device_class_sizeof(R));
7236 i->index = (char *) child.data - (char *) i->data;
7237 --i->rem;
7238 i->data = (xcb_input_device_class_t *) child.data;
7241 xcb_generic_iterator_t
7242 xcb_input_device_class_end (xcb_input_device_class_iterator_t i /**< */)
7244 xcb_generic_iterator_t ret;
7245 while(i.rem > 0)
7246 xcb_input_device_class_next(&i);
7247 ret.data = i.data;
7248 ret.rem = i.rem;
7249 ret.index = i.index;
7250 return ret;
7254 xcb_input_xi_device_info_sizeof (const void *_buffer /**< */)
7256 char *xcb_tmp = (char *)_buffer;
7257 const xcb_input_xi_device_info_t *_aux = (xcb_input_xi_device_info_t *)_buffer;
7258 unsigned int xcb_buffer_len = 0;
7259 unsigned int xcb_block_len = 0;
7260 unsigned int xcb_pad = 0;
7261 unsigned int xcb_align_to = 0;
7263 unsigned int i;
7264 unsigned int xcb_tmp_len;
7266 xcb_block_len += sizeof(xcb_input_xi_device_info_t);
7267 xcb_tmp += xcb_block_len;
7268 xcb_buffer_len += xcb_block_len;
7269 xcb_block_len = 0;
7270 /* name */
7271 xcb_block_len += (((_aux->name_len + 3) / 4) * 4) * sizeof(char);
7272 xcb_tmp += xcb_block_len;
7273 xcb_align_to = ALIGNOF(char);
7274 /* insert padding */
7275 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
7276 xcb_buffer_len += xcb_block_len + xcb_pad;
7277 if (0 != xcb_pad) {
7278 xcb_tmp += xcb_pad;
7279 xcb_pad = 0;
7281 xcb_block_len = 0;
7282 /* classes */
7283 for(i=0; i<_aux->num_classes; i++) {
7284 xcb_tmp_len = xcb_input_device_class_sizeof(xcb_tmp);
7285 xcb_block_len += xcb_tmp_len;
7286 xcb_tmp += xcb_tmp_len;
7288 xcb_align_to = ALIGNOF(xcb_input_device_class_t);
7289 /* insert padding */
7290 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
7291 xcb_buffer_len += xcb_block_len + xcb_pad;
7292 if (0 != xcb_pad) {
7293 xcb_tmp += xcb_pad;
7294 xcb_pad = 0;
7296 xcb_block_len = 0;
7298 return xcb_buffer_len;
7301 char *
7302 xcb_input_xi_device_info_name (const xcb_input_xi_device_info_t *R /**< */)
7304 return (char *) (R + 1);
7308 xcb_input_xi_device_info_name_length (const xcb_input_xi_device_info_t *R /**< */)
7310 return (((R->name_len + 3) / 4) * 4);
7313 xcb_generic_iterator_t
7314 xcb_input_xi_device_info_name_end (const xcb_input_xi_device_info_t *R /**< */)
7316 xcb_generic_iterator_t i;
7317 i.data = ((char *) (R + 1)) + ((((R->name_len + 3) / 4) * 4));
7318 i.rem = 0;
7319 i.index = (char *) i.data - (char *) R;
7320 return i;
7324 xcb_input_xi_device_info_classes_length (const xcb_input_xi_device_info_t *R /**< */)
7326 return R->num_classes;
7329 xcb_input_device_class_iterator_t
7330 xcb_input_xi_device_info_classes_iterator (const xcb_input_xi_device_info_t *R /**< */)
7332 xcb_input_device_class_iterator_t i;
7333 xcb_generic_iterator_t prev = xcb_input_xi_device_info_name_end(R);
7334 i.data = (xcb_input_device_class_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_input_device_class_t, prev.index));
7335 i.rem = R->num_classes;
7336 i.index = (char *) i.data - (char *) R;
7337 return i;
7340 void
7341 xcb_input_xi_device_info_next (xcb_input_xi_device_info_iterator_t *i /**< */)
7343 xcb_input_xi_device_info_t *R = i->data;
7344 xcb_generic_iterator_t child;
7345 child.data = (xcb_input_xi_device_info_t *)(((char *)R) + xcb_input_xi_device_info_sizeof(R));
7346 i->index = (char *) child.data - (char *) i->data;
7347 --i->rem;
7348 i->data = (xcb_input_xi_device_info_t *) child.data;
7351 xcb_generic_iterator_t
7352 xcb_input_xi_device_info_end (xcb_input_xi_device_info_iterator_t i /**< */)
7354 xcb_generic_iterator_t ret;
7355 while(i.rem > 0)
7356 xcb_input_xi_device_info_next(&i);
7357 ret.data = i.data;
7358 ret.rem = i.rem;
7359 ret.index = i.index;
7360 return ret;
7364 xcb_input_xi_query_device_sizeof (const void *_buffer /**< */)
7366 char *xcb_tmp = (char *)_buffer;
7367 const xcb_input_xi_query_device_reply_t *_aux = (xcb_input_xi_query_device_reply_t *)_buffer;
7368 unsigned int xcb_buffer_len = 0;
7369 unsigned int xcb_block_len = 0;
7370 unsigned int xcb_pad = 0;
7371 unsigned int xcb_align_to = 0;
7373 unsigned int i;
7374 unsigned int xcb_tmp_len;
7376 xcb_block_len += sizeof(xcb_input_xi_query_device_reply_t);
7377 xcb_tmp += xcb_block_len;
7378 xcb_buffer_len += xcb_block_len;
7379 xcb_block_len = 0;
7380 /* infos */
7381 for(i=0; i<_aux->num_infos; i++) {
7382 xcb_tmp_len = xcb_input_xi_device_info_sizeof(xcb_tmp);
7383 xcb_block_len += xcb_tmp_len;
7384 xcb_tmp += xcb_tmp_len;
7386 xcb_align_to = ALIGNOF(xcb_input_xi_device_info_t);
7387 /* insert padding */
7388 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
7389 xcb_buffer_len += xcb_block_len + xcb_pad;
7390 if (0 != xcb_pad) {
7391 xcb_tmp += xcb_pad;
7392 xcb_pad = 0;
7394 xcb_block_len = 0;
7396 return xcb_buffer_len;
7399 xcb_input_xi_query_device_cookie_t
7400 xcb_input_xi_query_device (xcb_connection_t *c /**< */,
7401 xcb_input_device_id_t deviceid /**< */)
7403 static const xcb_protocol_request_t xcb_req = {
7404 /* count */ 2,
7405 /* ext */ &xcb_input_id,
7406 /* opcode */ XCB_INPUT_XI_QUERY_DEVICE,
7407 /* isvoid */ 0
7410 struct iovec xcb_parts[4];
7411 xcb_input_xi_query_device_cookie_t xcb_ret;
7412 xcb_input_xi_query_device_request_t xcb_out;
7414 xcb_out.deviceid = deviceid;
7415 memset(xcb_out.pad0, 0, 2);
7417 xcb_parts[2].iov_base = (char *) &xcb_out;
7418 xcb_parts[2].iov_len = sizeof(xcb_out);
7419 xcb_parts[3].iov_base = 0;
7420 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
7422 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
7423 return xcb_ret;
7426 xcb_input_xi_query_device_cookie_t
7427 xcb_input_xi_query_device_unchecked (xcb_connection_t *c /**< */,
7428 xcb_input_device_id_t deviceid /**< */)
7430 static const xcb_protocol_request_t xcb_req = {
7431 /* count */ 2,
7432 /* ext */ &xcb_input_id,
7433 /* opcode */ XCB_INPUT_XI_QUERY_DEVICE,
7434 /* isvoid */ 0
7437 struct iovec xcb_parts[4];
7438 xcb_input_xi_query_device_cookie_t xcb_ret;
7439 xcb_input_xi_query_device_request_t xcb_out;
7441 xcb_out.deviceid = deviceid;
7442 memset(xcb_out.pad0, 0, 2);
7444 xcb_parts[2].iov_base = (char *) &xcb_out;
7445 xcb_parts[2].iov_len = sizeof(xcb_out);
7446 xcb_parts[3].iov_base = 0;
7447 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
7449 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
7450 return xcb_ret;
7454 xcb_input_xi_query_device_infos_length (const xcb_input_xi_query_device_reply_t *R /**< */)
7456 return R->num_infos;
7459 xcb_input_xi_device_info_iterator_t
7460 xcb_input_xi_query_device_infos_iterator (const xcb_input_xi_query_device_reply_t *R /**< */)
7462 xcb_input_xi_device_info_iterator_t i;
7463 i.data = (xcb_input_xi_device_info_t *) (R + 1);
7464 i.rem = R->num_infos;
7465 i.index = (char *) i.data - (char *) R;
7466 return i;
7469 xcb_input_xi_query_device_reply_t *
7470 xcb_input_xi_query_device_reply (xcb_connection_t *c /**< */,
7471 xcb_input_xi_query_device_cookie_t cookie /**< */,
7472 xcb_generic_error_t **e /**< */)
7474 return (xcb_input_xi_query_device_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
7477 xcb_void_cookie_t
7478 xcb_input_xi_set_focus_checked (xcb_connection_t *c /**< */,
7479 xcb_window_t window /**< */,
7480 xcb_timestamp_t time /**< */,
7481 xcb_input_device_id_t deviceid /**< */)
7483 static const xcb_protocol_request_t xcb_req = {
7484 /* count */ 2,
7485 /* ext */ &xcb_input_id,
7486 /* opcode */ XCB_INPUT_XI_SET_FOCUS,
7487 /* isvoid */ 1
7490 struct iovec xcb_parts[4];
7491 xcb_void_cookie_t xcb_ret;
7492 xcb_input_xi_set_focus_request_t xcb_out;
7494 xcb_out.window = window;
7495 xcb_out.time = time;
7496 xcb_out.deviceid = deviceid;
7497 memset(xcb_out.pad0, 0, 2);
7499 xcb_parts[2].iov_base = (char *) &xcb_out;
7500 xcb_parts[2].iov_len = sizeof(xcb_out);
7501 xcb_parts[3].iov_base = 0;
7502 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
7504 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
7505 return xcb_ret;
7508 xcb_void_cookie_t
7509 xcb_input_xi_set_focus (xcb_connection_t *c /**< */,
7510 xcb_window_t window /**< */,
7511 xcb_timestamp_t time /**< */,
7512 xcb_input_device_id_t deviceid /**< */)
7514 static const xcb_protocol_request_t xcb_req = {
7515 /* count */ 2,
7516 /* ext */ &xcb_input_id,
7517 /* opcode */ XCB_INPUT_XI_SET_FOCUS,
7518 /* isvoid */ 1
7521 struct iovec xcb_parts[4];
7522 xcb_void_cookie_t xcb_ret;
7523 xcb_input_xi_set_focus_request_t xcb_out;
7525 xcb_out.window = window;
7526 xcb_out.time = time;
7527 xcb_out.deviceid = deviceid;
7528 memset(xcb_out.pad0, 0, 2);
7530 xcb_parts[2].iov_base = (char *) &xcb_out;
7531 xcb_parts[2].iov_len = sizeof(xcb_out);
7532 xcb_parts[3].iov_base = 0;
7533 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
7535 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
7536 return xcb_ret;
7539 xcb_input_xi_get_focus_cookie_t
7540 xcb_input_xi_get_focus (xcb_connection_t *c /**< */,
7541 xcb_input_device_id_t deviceid /**< */)
7543 static const xcb_protocol_request_t xcb_req = {
7544 /* count */ 2,
7545 /* ext */ &xcb_input_id,
7546 /* opcode */ XCB_INPUT_XI_GET_FOCUS,
7547 /* isvoid */ 0
7550 struct iovec xcb_parts[4];
7551 xcb_input_xi_get_focus_cookie_t xcb_ret;
7552 xcb_input_xi_get_focus_request_t xcb_out;
7554 xcb_out.deviceid = deviceid;
7555 memset(xcb_out.pad0, 0, 2);
7557 xcb_parts[2].iov_base = (char *) &xcb_out;
7558 xcb_parts[2].iov_len = sizeof(xcb_out);
7559 xcb_parts[3].iov_base = 0;
7560 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
7562 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
7563 return xcb_ret;
7566 xcb_input_xi_get_focus_cookie_t
7567 xcb_input_xi_get_focus_unchecked (xcb_connection_t *c /**< */,
7568 xcb_input_device_id_t deviceid /**< */)
7570 static const xcb_protocol_request_t xcb_req = {
7571 /* count */ 2,
7572 /* ext */ &xcb_input_id,
7573 /* opcode */ XCB_INPUT_XI_GET_FOCUS,
7574 /* isvoid */ 0
7577 struct iovec xcb_parts[4];
7578 xcb_input_xi_get_focus_cookie_t xcb_ret;
7579 xcb_input_xi_get_focus_request_t xcb_out;
7581 xcb_out.deviceid = deviceid;
7582 memset(xcb_out.pad0, 0, 2);
7584 xcb_parts[2].iov_base = (char *) &xcb_out;
7585 xcb_parts[2].iov_len = sizeof(xcb_out);
7586 xcb_parts[3].iov_base = 0;
7587 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
7589 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
7590 return xcb_ret;
7593 xcb_input_xi_get_focus_reply_t *
7594 xcb_input_xi_get_focus_reply (xcb_connection_t *c /**< */,
7595 xcb_input_xi_get_focus_cookie_t cookie /**< */,
7596 xcb_generic_error_t **e /**< */)
7598 return (xcb_input_xi_get_focus_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
7602 xcb_input_xi_grab_device_sizeof (const void *_buffer /**< */)
7604 char *xcb_tmp = (char *)_buffer;
7605 const xcb_input_xi_grab_device_request_t *_aux = (xcb_input_xi_grab_device_request_t *)_buffer;
7606 unsigned int xcb_buffer_len = 0;
7607 unsigned int xcb_block_len = 0;
7608 unsigned int xcb_pad = 0;
7609 unsigned int xcb_align_to = 0;
7612 xcb_block_len += sizeof(xcb_input_xi_grab_device_request_t);
7613 xcb_tmp += xcb_block_len;
7614 xcb_buffer_len += xcb_block_len;
7615 xcb_block_len = 0;
7616 /* mask */
7617 xcb_block_len += _aux->mask_len * sizeof(uint32_t);
7618 xcb_tmp += xcb_block_len;
7619 xcb_align_to = ALIGNOF(uint32_t);
7620 /* insert padding */
7621 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
7622 xcb_buffer_len += xcb_block_len + xcb_pad;
7623 if (0 != xcb_pad) {
7624 xcb_tmp += xcb_pad;
7625 xcb_pad = 0;
7627 xcb_block_len = 0;
7629 return xcb_buffer_len;
7632 xcb_input_xi_grab_device_cookie_t
7633 xcb_input_xi_grab_device (xcb_connection_t *c /**< */,
7634 xcb_window_t window /**< */,
7635 xcb_timestamp_t time /**< */,
7636 xcb_cursor_t cursor /**< */,
7637 xcb_input_device_id_t deviceid /**< */,
7638 uint8_t mode /**< */,
7639 uint8_t paired_device_mode /**< */,
7640 uint8_t owner_events /**< */,
7641 uint16_t mask_len /**< */,
7642 const uint32_t *mask /**< */)
7644 static const xcb_protocol_request_t xcb_req = {
7645 /* count */ 4,
7646 /* ext */ &xcb_input_id,
7647 /* opcode */ XCB_INPUT_XI_GRAB_DEVICE,
7648 /* isvoid */ 0
7651 struct iovec xcb_parts[6];
7652 xcb_input_xi_grab_device_cookie_t xcb_ret;
7653 xcb_input_xi_grab_device_request_t xcb_out;
7655 xcb_out.window = window;
7656 xcb_out.time = time;
7657 xcb_out.cursor = cursor;
7658 xcb_out.deviceid = deviceid;
7659 xcb_out.mode = mode;
7660 xcb_out.paired_device_mode = paired_device_mode;
7661 xcb_out.owner_events = owner_events;
7662 xcb_out.pad0 = 0;
7663 xcb_out.mask_len = mask_len;
7665 xcb_parts[2].iov_base = (char *) &xcb_out;
7666 xcb_parts[2].iov_len = sizeof(xcb_out);
7667 xcb_parts[3].iov_base = 0;
7668 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
7669 /* uint32_t mask */
7670 xcb_parts[4].iov_base = (char *) mask;
7671 xcb_parts[4].iov_len = mask_len * sizeof(uint32_t);
7672 xcb_parts[5].iov_base = 0;
7673 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
7675 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
7676 return xcb_ret;
7679 xcb_input_xi_grab_device_cookie_t
7680 xcb_input_xi_grab_device_unchecked (xcb_connection_t *c /**< */,
7681 xcb_window_t window /**< */,
7682 xcb_timestamp_t time /**< */,
7683 xcb_cursor_t cursor /**< */,
7684 xcb_input_device_id_t deviceid /**< */,
7685 uint8_t mode /**< */,
7686 uint8_t paired_device_mode /**< */,
7687 uint8_t owner_events /**< */,
7688 uint16_t mask_len /**< */,
7689 const uint32_t *mask /**< */)
7691 static const xcb_protocol_request_t xcb_req = {
7692 /* count */ 4,
7693 /* ext */ &xcb_input_id,
7694 /* opcode */ XCB_INPUT_XI_GRAB_DEVICE,
7695 /* isvoid */ 0
7698 struct iovec xcb_parts[6];
7699 xcb_input_xi_grab_device_cookie_t xcb_ret;
7700 xcb_input_xi_grab_device_request_t xcb_out;
7702 xcb_out.window = window;
7703 xcb_out.time = time;
7704 xcb_out.cursor = cursor;
7705 xcb_out.deviceid = deviceid;
7706 xcb_out.mode = mode;
7707 xcb_out.paired_device_mode = paired_device_mode;
7708 xcb_out.owner_events = owner_events;
7709 xcb_out.pad0 = 0;
7710 xcb_out.mask_len = mask_len;
7712 xcb_parts[2].iov_base = (char *) &xcb_out;
7713 xcb_parts[2].iov_len = sizeof(xcb_out);
7714 xcb_parts[3].iov_base = 0;
7715 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
7716 /* uint32_t mask */
7717 xcb_parts[4].iov_base = (char *) mask;
7718 xcb_parts[4].iov_len = mask_len * sizeof(uint32_t);
7719 xcb_parts[5].iov_base = 0;
7720 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
7722 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
7723 return xcb_ret;
7726 xcb_input_xi_grab_device_reply_t *
7727 xcb_input_xi_grab_device_reply (xcb_connection_t *c /**< */,
7728 xcb_input_xi_grab_device_cookie_t cookie /**< */,
7729 xcb_generic_error_t **e /**< */)
7731 return (xcb_input_xi_grab_device_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
7734 xcb_void_cookie_t
7735 xcb_input_xi_ungrab_device_checked (xcb_connection_t *c /**< */,
7736 xcb_timestamp_t time /**< */,
7737 xcb_input_device_id_t deviceid /**< */)
7739 static const xcb_protocol_request_t xcb_req = {
7740 /* count */ 2,
7741 /* ext */ &xcb_input_id,
7742 /* opcode */ XCB_INPUT_XI_UNGRAB_DEVICE,
7743 /* isvoid */ 1
7746 struct iovec xcb_parts[4];
7747 xcb_void_cookie_t xcb_ret;
7748 xcb_input_xi_ungrab_device_request_t xcb_out;
7750 xcb_out.time = time;
7751 xcb_out.deviceid = deviceid;
7752 memset(xcb_out.pad0, 0, 2);
7754 xcb_parts[2].iov_base = (char *) &xcb_out;
7755 xcb_parts[2].iov_len = sizeof(xcb_out);
7756 xcb_parts[3].iov_base = 0;
7757 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
7759 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
7760 return xcb_ret;
7763 xcb_void_cookie_t
7764 xcb_input_xi_ungrab_device (xcb_connection_t *c /**< */,
7765 xcb_timestamp_t time /**< */,
7766 xcb_input_device_id_t deviceid /**< */)
7768 static const xcb_protocol_request_t xcb_req = {
7769 /* count */ 2,
7770 /* ext */ &xcb_input_id,
7771 /* opcode */ XCB_INPUT_XI_UNGRAB_DEVICE,
7772 /* isvoid */ 1
7775 struct iovec xcb_parts[4];
7776 xcb_void_cookie_t xcb_ret;
7777 xcb_input_xi_ungrab_device_request_t xcb_out;
7779 xcb_out.time = time;
7780 xcb_out.deviceid = deviceid;
7781 memset(xcb_out.pad0, 0, 2);
7783 xcb_parts[2].iov_base = (char *) &xcb_out;
7784 xcb_parts[2].iov_len = sizeof(xcb_out);
7785 xcb_parts[3].iov_base = 0;
7786 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
7788 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
7789 return xcb_ret;
7792 xcb_void_cookie_t
7793 xcb_input_xi_allow_events_checked (xcb_connection_t *c /**< */,
7794 xcb_timestamp_t time /**< */,
7795 xcb_input_device_id_t deviceid /**< */,
7796 uint8_t event_mode /**< */,
7797 uint32_t touchid /**< */,
7798 xcb_window_t grab_window /**< */)
7800 static const xcb_protocol_request_t xcb_req = {
7801 /* count */ 2,
7802 /* ext */ &xcb_input_id,
7803 /* opcode */ XCB_INPUT_XI_ALLOW_EVENTS,
7804 /* isvoid */ 1
7807 struct iovec xcb_parts[4];
7808 xcb_void_cookie_t xcb_ret;
7809 xcb_input_xi_allow_events_request_t xcb_out;
7811 xcb_out.time = time;
7812 xcb_out.deviceid = deviceid;
7813 xcb_out.event_mode = event_mode;
7814 xcb_out.pad0 = 0;
7815 xcb_out.touchid = touchid;
7816 xcb_out.grab_window = grab_window;
7818 xcb_parts[2].iov_base = (char *) &xcb_out;
7819 xcb_parts[2].iov_len = sizeof(xcb_out);
7820 xcb_parts[3].iov_base = 0;
7821 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
7823 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
7824 return xcb_ret;
7827 xcb_void_cookie_t
7828 xcb_input_xi_allow_events (xcb_connection_t *c /**< */,
7829 xcb_timestamp_t time /**< */,
7830 xcb_input_device_id_t deviceid /**< */,
7831 uint8_t event_mode /**< */,
7832 uint32_t touchid /**< */,
7833 xcb_window_t grab_window /**< */)
7835 static const xcb_protocol_request_t xcb_req = {
7836 /* count */ 2,
7837 /* ext */ &xcb_input_id,
7838 /* opcode */ XCB_INPUT_XI_ALLOW_EVENTS,
7839 /* isvoid */ 1
7842 struct iovec xcb_parts[4];
7843 xcb_void_cookie_t xcb_ret;
7844 xcb_input_xi_allow_events_request_t xcb_out;
7846 xcb_out.time = time;
7847 xcb_out.deviceid = deviceid;
7848 xcb_out.event_mode = event_mode;
7849 xcb_out.pad0 = 0;
7850 xcb_out.touchid = touchid;
7851 xcb_out.grab_window = grab_window;
7853 xcb_parts[2].iov_base = (char *) &xcb_out;
7854 xcb_parts[2].iov_len = sizeof(xcb_out);
7855 xcb_parts[3].iov_base = 0;
7856 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
7858 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
7859 return xcb_ret;
7862 void
7863 xcb_input_grab_modifier_info_next (xcb_input_grab_modifier_info_iterator_t *i /**< */)
7865 --i->rem;
7866 ++i->data;
7867 i->index += sizeof(xcb_input_grab_modifier_info_t);
7870 xcb_generic_iterator_t
7871 xcb_input_grab_modifier_info_end (xcb_input_grab_modifier_info_iterator_t i /**< */)
7873 xcb_generic_iterator_t ret;
7874 ret.data = i.data + i.rem;
7875 ret.index = i.index + ((char *) ret.data - (char *) i.data);
7876 ret.rem = 0;
7877 return ret;
7881 xcb_input_xi_passive_grab_device_sizeof (const void *_buffer /**< */)
7883 char *xcb_tmp = (char *)_buffer;
7884 const xcb_input_xi_passive_grab_device_request_t *_aux = (xcb_input_xi_passive_grab_device_request_t *)_buffer;
7885 unsigned int xcb_buffer_len = 0;
7886 unsigned int xcb_block_len = 0;
7887 unsigned int xcb_pad = 0;
7888 unsigned int xcb_align_to = 0;
7891 xcb_block_len += sizeof(xcb_input_xi_passive_grab_device_request_t);
7892 xcb_tmp += xcb_block_len;
7893 xcb_buffer_len += xcb_block_len;
7894 xcb_block_len = 0;
7895 /* mask */
7896 xcb_block_len += _aux->mask_len * sizeof(uint32_t);
7897 xcb_tmp += xcb_block_len;
7898 xcb_align_to = ALIGNOF(uint32_t);
7899 /* insert padding */
7900 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
7901 xcb_buffer_len += xcb_block_len + xcb_pad;
7902 if (0 != xcb_pad) {
7903 xcb_tmp += xcb_pad;
7904 xcb_pad = 0;
7906 xcb_block_len = 0;
7907 /* modifiers */
7908 xcb_block_len += _aux->num_modifiers * sizeof(uint32_t);
7909 xcb_tmp += xcb_block_len;
7910 xcb_align_to = ALIGNOF(uint32_t);
7911 /* insert padding */
7912 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
7913 xcb_buffer_len += xcb_block_len + xcb_pad;
7914 if (0 != xcb_pad) {
7915 xcb_tmp += xcb_pad;
7916 xcb_pad = 0;
7918 xcb_block_len = 0;
7920 return xcb_buffer_len;
7923 xcb_input_xi_passive_grab_device_cookie_t
7924 xcb_input_xi_passive_grab_device (xcb_connection_t *c /**< */,
7925 xcb_timestamp_t time /**< */,
7926 xcb_window_t grab_window /**< */,
7927 xcb_cursor_t cursor /**< */,
7928 uint32_t detail /**< */,
7929 xcb_input_device_id_t deviceid /**< */,
7930 uint16_t num_modifiers /**< */,
7931 uint16_t mask_len /**< */,
7932 uint8_t grab_type /**< */,
7933 uint8_t grab_mode /**< */,
7934 uint8_t paired_device_mode /**< */,
7935 uint8_t owner_events /**< */,
7936 const uint32_t *mask /**< */,
7937 const uint32_t *modifiers /**< */)
7939 static const xcb_protocol_request_t xcb_req = {
7940 /* count */ 6,
7941 /* ext */ &xcb_input_id,
7942 /* opcode */ XCB_INPUT_XI_PASSIVE_GRAB_DEVICE,
7943 /* isvoid */ 0
7946 struct iovec xcb_parts[8];
7947 xcb_input_xi_passive_grab_device_cookie_t xcb_ret;
7948 xcb_input_xi_passive_grab_device_request_t xcb_out;
7950 xcb_out.time = time;
7951 xcb_out.grab_window = grab_window;
7952 xcb_out.cursor = cursor;
7953 xcb_out.detail = detail;
7954 xcb_out.deviceid = deviceid;
7955 xcb_out.num_modifiers = num_modifiers;
7956 xcb_out.mask_len = mask_len;
7957 xcb_out.grab_type = grab_type;
7958 xcb_out.grab_mode = grab_mode;
7959 xcb_out.paired_device_mode = paired_device_mode;
7960 xcb_out.owner_events = owner_events;
7961 memset(xcb_out.pad0, 0, 2);
7963 xcb_parts[2].iov_base = (char *) &xcb_out;
7964 xcb_parts[2].iov_len = sizeof(xcb_out);
7965 xcb_parts[3].iov_base = 0;
7966 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
7967 /* uint32_t mask */
7968 xcb_parts[4].iov_base = (char *) mask;
7969 xcb_parts[4].iov_len = mask_len * sizeof(uint32_t);
7970 xcb_parts[5].iov_base = 0;
7971 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
7972 /* uint32_t modifiers */
7973 xcb_parts[6].iov_base = (char *) modifiers;
7974 xcb_parts[6].iov_len = num_modifiers * sizeof(uint32_t);
7975 xcb_parts[7].iov_base = 0;
7976 xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3;
7978 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
7979 return xcb_ret;
7982 xcb_input_xi_passive_grab_device_cookie_t
7983 xcb_input_xi_passive_grab_device_unchecked (xcb_connection_t *c /**< */,
7984 xcb_timestamp_t time /**< */,
7985 xcb_window_t grab_window /**< */,
7986 xcb_cursor_t cursor /**< */,
7987 uint32_t detail /**< */,
7988 xcb_input_device_id_t deviceid /**< */,
7989 uint16_t num_modifiers /**< */,
7990 uint16_t mask_len /**< */,
7991 uint8_t grab_type /**< */,
7992 uint8_t grab_mode /**< */,
7993 uint8_t paired_device_mode /**< */,
7994 uint8_t owner_events /**< */,
7995 const uint32_t *mask /**< */,
7996 const uint32_t *modifiers /**< */)
7998 static const xcb_protocol_request_t xcb_req = {
7999 /* count */ 6,
8000 /* ext */ &xcb_input_id,
8001 /* opcode */ XCB_INPUT_XI_PASSIVE_GRAB_DEVICE,
8002 /* isvoid */ 0
8005 struct iovec xcb_parts[8];
8006 xcb_input_xi_passive_grab_device_cookie_t xcb_ret;
8007 xcb_input_xi_passive_grab_device_request_t xcb_out;
8009 xcb_out.time = time;
8010 xcb_out.grab_window = grab_window;
8011 xcb_out.cursor = cursor;
8012 xcb_out.detail = detail;
8013 xcb_out.deviceid = deviceid;
8014 xcb_out.num_modifiers = num_modifiers;
8015 xcb_out.mask_len = mask_len;
8016 xcb_out.grab_type = grab_type;
8017 xcb_out.grab_mode = grab_mode;
8018 xcb_out.paired_device_mode = paired_device_mode;
8019 xcb_out.owner_events = owner_events;
8020 memset(xcb_out.pad0, 0, 2);
8022 xcb_parts[2].iov_base = (char *) &xcb_out;
8023 xcb_parts[2].iov_len = sizeof(xcb_out);
8024 xcb_parts[3].iov_base = 0;
8025 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
8026 /* uint32_t mask */
8027 xcb_parts[4].iov_base = (char *) mask;
8028 xcb_parts[4].iov_len = mask_len * sizeof(uint32_t);
8029 xcb_parts[5].iov_base = 0;
8030 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
8031 /* uint32_t modifiers */
8032 xcb_parts[6].iov_base = (char *) modifiers;
8033 xcb_parts[6].iov_len = num_modifiers * sizeof(uint32_t);
8034 xcb_parts[7].iov_base = 0;
8035 xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3;
8037 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
8038 return xcb_ret;
8041 xcb_input_grab_modifier_info_t *
8042 xcb_input_xi_passive_grab_device_modifiers (const xcb_input_xi_passive_grab_device_reply_t *R /**< */)
8044 return (xcb_input_grab_modifier_info_t *) (R + 1);
8048 xcb_input_xi_passive_grab_device_modifiers_length (const xcb_input_xi_passive_grab_device_reply_t *R /**< */)
8050 return R->num_modifiers;
8053 xcb_input_grab_modifier_info_iterator_t
8054 xcb_input_xi_passive_grab_device_modifiers_iterator (const xcb_input_xi_passive_grab_device_reply_t *R /**< */)
8056 xcb_input_grab_modifier_info_iterator_t i;
8057 i.data = (xcb_input_grab_modifier_info_t *) (R + 1);
8058 i.rem = R->num_modifiers;
8059 i.index = (char *) i.data - (char *) R;
8060 return i;
8063 xcb_input_xi_passive_grab_device_reply_t *
8064 xcb_input_xi_passive_grab_device_reply (xcb_connection_t *c /**< */,
8065 xcb_input_xi_passive_grab_device_cookie_t cookie /**< */,
8066 xcb_generic_error_t **e /**< */)
8068 return (xcb_input_xi_passive_grab_device_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
8072 xcb_input_xi_passive_ungrab_device_sizeof (const void *_buffer /**< */)
8074 char *xcb_tmp = (char *)_buffer;
8075 const xcb_input_xi_passive_ungrab_device_request_t *_aux = (xcb_input_xi_passive_ungrab_device_request_t *)_buffer;
8076 unsigned int xcb_buffer_len = 0;
8077 unsigned int xcb_block_len = 0;
8078 unsigned int xcb_pad = 0;
8079 unsigned int xcb_align_to = 0;
8082 xcb_block_len += sizeof(xcb_input_xi_passive_ungrab_device_request_t);
8083 xcb_tmp += xcb_block_len;
8084 xcb_buffer_len += xcb_block_len;
8085 xcb_block_len = 0;
8086 /* modifiers */
8087 xcb_block_len += _aux->num_modifiers * sizeof(uint32_t);
8088 xcb_tmp += xcb_block_len;
8089 xcb_align_to = ALIGNOF(uint32_t);
8090 /* insert padding */
8091 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8092 xcb_buffer_len += xcb_block_len + xcb_pad;
8093 if (0 != xcb_pad) {
8094 xcb_tmp += xcb_pad;
8095 xcb_pad = 0;
8097 xcb_block_len = 0;
8099 return xcb_buffer_len;
8102 xcb_void_cookie_t
8103 xcb_input_xi_passive_ungrab_device_checked (xcb_connection_t *c /**< */,
8104 xcb_window_t grab_window /**< */,
8105 uint32_t detail /**< */,
8106 xcb_input_device_id_t deviceid /**< */,
8107 uint16_t num_modifiers /**< */,
8108 uint8_t grab_type /**< */,
8109 const uint32_t *modifiers /**< */)
8111 static const xcb_protocol_request_t xcb_req = {
8112 /* count */ 4,
8113 /* ext */ &xcb_input_id,
8114 /* opcode */ XCB_INPUT_XI_PASSIVE_UNGRAB_DEVICE,
8115 /* isvoid */ 1
8118 struct iovec xcb_parts[6];
8119 xcb_void_cookie_t xcb_ret;
8120 xcb_input_xi_passive_ungrab_device_request_t xcb_out;
8122 xcb_out.grab_window = grab_window;
8123 xcb_out.detail = detail;
8124 xcb_out.deviceid = deviceid;
8125 xcb_out.num_modifiers = num_modifiers;
8126 xcb_out.grab_type = grab_type;
8127 memset(xcb_out.pad0, 0, 3);
8129 xcb_parts[2].iov_base = (char *) &xcb_out;
8130 xcb_parts[2].iov_len = sizeof(xcb_out);
8131 xcb_parts[3].iov_base = 0;
8132 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
8133 /* uint32_t modifiers */
8134 xcb_parts[4].iov_base = (char *) modifiers;
8135 xcb_parts[4].iov_len = num_modifiers * sizeof(uint32_t);
8136 xcb_parts[5].iov_base = 0;
8137 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
8139 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
8140 return xcb_ret;
8143 xcb_void_cookie_t
8144 xcb_input_xi_passive_ungrab_device (xcb_connection_t *c /**< */,
8145 xcb_window_t grab_window /**< */,
8146 uint32_t detail /**< */,
8147 xcb_input_device_id_t deviceid /**< */,
8148 uint16_t num_modifiers /**< */,
8149 uint8_t grab_type /**< */,
8150 const uint32_t *modifiers /**< */)
8152 static const xcb_protocol_request_t xcb_req = {
8153 /* count */ 4,
8154 /* ext */ &xcb_input_id,
8155 /* opcode */ XCB_INPUT_XI_PASSIVE_UNGRAB_DEVICE,
8156 /* isvoid */ 1
8159 struct iovec xcb_parts[6];
8160 xcb_void_cookie_t xcb_ret;
8161 xcb_input_xi_passive_ungrab_device_request_t xcb_out;
8163 xcb_out.grab_window = grab_window;
8164 xcb_out.detail = detail;
8165 xcb_out.deviceid = deviceid;
8166 xcb_out.num_modifiers = num_modifiers;
8167 xcb_out.grab_type = grab_type;
8168 memset(xcb_out.pad0, 0, 3);
8170 xcb_parts[2].iov_base = (char *) &xcb_out;
8171 xcb_parts[2].iov_len = sizeof(xcb_out);
8172 xcb_parts[3].iov_base = 0;
8173 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
8174 /* uint32_t modifiers */
8175 xcb_parts[4].iov_base = (char *) modifiers;
8176 xcb_parts[4].iov_len = num_modifiers * sizeof(uint32_t);
8177 xcb_parts[5].iov_base = 0;
8178 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
8180 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
8181 return xcb_ret;
8185 xcb_input_xi_list_properties_sizeof (const void *_buffer /**< */)
8187 char *xcb_tmp = (char *)_buffer;
8188 const xcb_input_xi_list_properties_reply_t *_aux = (xcb_input_xi_list_properties_reply_t *)_buffer;
8189 unsigned int xcb_buffer_len = 0;
8190 unsigned int xcb_block_len = 0;
8191 unsigned int xcb_pad = 0;
8192 unsigned int xcb_align_to = 0;
8195 xcb_block_len += sizeof(xcb_input_xi_list_properties_reply_t);
8196 xcb_tmp += xcb_block_len;
8197 xcb_buffer_len += xcb_block_len;
8198 xcb_block_len = 0;
8199 /* properties */
8200 xcb_block_len += _aux->num_properties * sizeof(xcb_atom_t);
8201 xcb_tmp += xcb_block_len;
8202 xcb_align_to = ALIGNOF(xcb_atom_t);
8203 /* insert padding */
8204 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8205 xcb_buffer_len += xcb_block_len + xcb_pad;
8206 if (0 != xcb_pad) {
8207 xcb_tmp += xcb_pad;
8208 xcb_pad = 0;
8210 xcb_block_len = 0;
8212 return xcb_buffer_len;
8215 xcb_input_xi_list_properties_cookie_t
8216 xcb_input_xi_list_properties (xcb_connection_t *c /**< */,
8217 xcb_input_device_id_t deviceid /**< */)
8219 static const xcb_protocol_request_t xcb_req = {
8220 /* count */ 2,
8221 /* ext */ &xcb_input_id,
8222 /* opcode */ XCB_INPUT_XI_LIST_PROPERTIES,
8223 /* isvoid */ 0
8226 struct iovec xcb_parts[4];
8227 xcb_input_xi_list_properties_cookie_t xcb_ret;
8228 xcb_input_xi_list_properties_request_t xcb_out;
8230 xcb_out.deviceid = deviceid;
8231 memset(xcb_out.pad0, 0, 2);
8233 xcb_parts[2].iov_base = (char *) &xcb_out;
8234 xcb_parts[2].iov_len = sizeof(xcb_out);
8235 xcb_parts[3].iov_base = 0;
8236 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
8238 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
8239 return xcb_ret;
8242 xcb_input_xi_list_properties_cookie_t
8243 xcb_input_xi_list_properties_unchecked (xcb_connection_t *c /**< */,
8244 xcb_input_device_id_t deviceid /**< */)
8246 static const xcb_protocol_request_t xcb_req = {
8247 /* count */ 2,
8248 /* ext */ &xcb_input_id,
8249 /* opcode */ XCB_INPUT_XI_LIST_PROPERTIES,
8250 /* isvoid */ 0
8253 struct iovec xcb_parts[4];
8254 xcb_input_xi_list_properties_cookie_t xcb_ret;
8255 xcb_input_xi_list_properties_request_t xcb_out;
8257 xcb_out.deviceid = deviceid;
8258 memset(xcb_out.pad0, 0, 2);
8260 xcb_parts[2].iov_base = (char *) &xcb_out;
8261 xcb_parts[2].iov_len = sizeof(xcb_out);
8262 xcb_parts[3].iov_base = 0;
8263 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
8265 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
8266 return xcb_ret;
8269 xcb_atom_t *
8270 xcb_input_xi_list_properties_properties (const xcb_input_xi_list_properties_reply_t *R /**< */)
8272 return (xcb_atom_t *) (R + 1);
8276 xcb_input_xi_list_properties_properties_length (const xcb_input_xi_list_properties_reply_t *R /**< */)
8278 return R->num_properties;
8281 xcb_generic_iterator_t
8282 xcb_input_xi_list_properties_properties_end (const xcb_input_xi_list_properties_reply_t *R /**< */)
8284 xcb_generic_iterator_t i;
8285 i.data = ((xcb_atom_t *) (R + 1)) + (R->num_properties);
8286 i.rem = 0;
8287 i.index = (char *) i.data - (char *) R;
8288 return i;
8291 xcb_input_xi_list_properties_reply_t *
8292 xcb_input_xi_list_properties_reply (xcb_connection_t *c /**< */,
8293 xcb_input_xi_list_properties_cookie_t cookie /**< */,
8294 xcb_generic_error_t **e /**< */)
8296 return (xcb_input_xi_list_properties_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
8299 uint8_t *
8300 xcb_input_xi_change_property_items_data_8 (const xcb_input_xi_change_property_items_t *S /**< */)
8302 return /* items */ S->data8;
8306 xcb_input_xi_change_property_items_data_8_length (const xcb_input_xi_change_property_request_t *R /**< */,
8307 const xcb_input_xi_change_property_items_t *S /**< */)
8309 return R->num_items;
8312 xcb_generic_iterator_t
8313 xcb_input_xi_change_property_items_data_8_end (const xcb_input_xi_change_property_request_t *R /**< */,
8314 const xcb_input_xi_change_property_items_t *S /**< */)
8316 xcb_generic_iterator_t i;
8317 i.data = /* items */ S->data8 + R->num_items;
8318 i.rem = 0;
8319 i.index = (char *) i.data - (char *) S;
8320 return i;
8323 uint16_t *
8324 xcb_input_xi_change_property_items_data_16 (const xcb_input_xi_change_property_items_t *S /**< */)
8326 return /* items */ S->data16;
8330 xcb_input_xi_change_property_items_data_16_length (const xcb_input_xi_change_property_request_t *R /**< */,
8331 const xcb_input_xi_change_property_items_t *S /**< */)
8333 return R->num_items;
8336 xcb_generic_iterator_t
8337 xcb_input_xi_change_property_items_data_16_end (const xcb_input_xi_change_property_request_t *R /**< */,
8338 const xcb_input_xi_change_property_items_t *S /**< */)
8340 xcb_generic_iterator_t i;
8341 i.data = /* items */ S->data16 + R->num_items;
8342 i.rem = 0;
8343 i.index = (char *) i.data - (char *) S;
8344 return i;
8347 uint32_t *
8348 xcb_input_xi_change_property_items_data_32 (const xcb_input_xi_change_property_items_t *S /**< */)
8350 return /* items */ S->data32;
8354 xcb_input_xi_change_property_items_data_32_length (const xcb_input_xi_change_property_request_t *R /**< */,
8355 const xcb_input_xi_change_property_items_t *S /**< */)
8357 return R->num_items;
8360 xcb_generic_iterator_t
8361 xcb_input_xi_change_property_items_data_32_end (const xcb_input_xi_change_property_request_t *R /**< */,
8362 const xcb_input_xi_change_property_items_t *S /**< */)
8364 xcb_generic_iterator_t i;
8365 i.data = /* items */ S->data32 + R->num_items;
8366 i.rem = 0;
8367 i.index = (char *) i.data - (char *) S;
8368 return i;
8372 xcb_input_xi_change_property_items_serialize (void **_buffer /**< */,
8373 uint32_t num_items /**< */,
8374 uint8_t format /**< */,
8375 const xcb_input_xi_change_property_items_t *_aux /**< */)
8377 char *xcb_out = *_buffer;
8378 unsigned int xcb_buffer_len = 0;
8379 unsigned int xcb_align_to = 0;
8381 unsigned int xcb_pad = 0;
8382 char xcb_pad0[3] = {0, 0, 0};
8383 struct iovec xcb_parts[7];
8384 unsigned int xcb_parts_idx = 0;
8385 unsigned int xcb_block_len = 0;
8386 unsigned int i;
8387 char *xcb_tmp;
8389 if(format & XCB_INPUT_PROPERTY_FORMAT_8_BITS) {
8390 /* insert padding */
8391 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8392 xcb_buffer_len += xcb_block_len + xcb_pad;
8393 if (0 != xcb_pad) {
8394 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
8395 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
8396 xcb_parts_idx++;
8397 xcb_pad = 0;
8399 xcb_block_len = 0;
8400 /* data8 */
8401 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->data8;
8402 xcb_block_len += num_items * sizeof(uint8_t);
8403 xcb_parts[xcb_parts_idx].iov_len = num_items * sizeof(uint8_t);
8404 xcb_parts_idx++;
8405 xcb_align_to = ALIGNOF(uint8_t);
8407 if(format & XCB_INPUT_PROPERTY_FORMAT_16_BITS) {
8408 /* insert padding */
8409 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8410 xcb_buffer_len += xcb_block_len + xcb_pad;
8411 if (0 != xcb_pad) {
8412 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
8413 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
8414 xcb_parts_idx++;
8415 xcb_pad = 0;
8417 xcb_block_len = 0;
8418 /* data16 */
8419 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->data16;
8420 xcb_block_len += num_items * sizeof(uint16_t);
8421 xcb_parts[xcb_parts_idx].iov_len = num_items * sizeof(uint16_t);
8422 xcb_parts_idx++;
8423 xcb_align_to = ALIGNOF(uint16_t);
8425 if(format & XCB_INPUT_PROPERTY_FORMAT_32_BITS) {
8426 /* insert padding */
8427 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8428 xcb_buffer_len += xcb_block_len + xcb_pad;
8429 if (0 != xcb_pad) {
8430 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
8431 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
8432 xcb_parts_idx++;
8433 xcb_pad = 0;
8435 xcb_block_len = 0;
8436 /* data32 */
8437 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->data32;
8438 xcb_block_len += num_items * sizeof(uint32_t);
8439 xcb_parts[xcb_parts_idx].iov_len = num_items * sizeof(uint32_t);
8440 xcb_parts_idx++;
8441 xcb_align_to = ALIGNOF(uint32_t);
8443 /* insert padding */
8444 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8445 xcb_buffer_len += xcb_block_len + xcb_pad;
8446 if (0 != xcb_pad) {
8447 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
8448 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
8449 xcb_parts_idx++;
8450 xcb_pad = 0;
8452 xcb_block_len = 0;
8454 if (NULL == xcb_out) {
8455 /* allocate memory */
8456 xcb_out = malloc(xcb_buffer_len);
8457 *_buffer = xcb_out;
8460 xcb_tmp = xcb_out;
8461 for(i=0; i<xcb_parts_idx; i++) {
8462 if (0 != xcb_parts[i].iov_base && 0 != xcb_parts[i].iov_len)
8463 memcpy(xcb_tmp, xcb_parts[i].iov_base, xcb_parts[i].iov_len);
8464 if (0 != xcb_parts[i].iov_len)
8465 xcb_tmp += xcb_parts[i].iov_len;
8468 return xcb_buffer_len;
8472 xcb_input_xi_change_property_items_unpack (const void *_buffer /**< */,
8473 uint32_t num_items /**< */,
8474 uint8_t format /**< */,
8475 xcb_input_xi_change_property_items_t *_aux /**< */)
8477 char *xcb_tmp = (char *)_buffer;
8478 unsigned int xcb_buffer_len = 0;
8479 unsigned int xcb_block_len = 0;
8480 unsigned int xcb_pad = 0;
8481 unsigned int xcb_align_to = 0;
8484 if(format & XCB_INPUT_PROPERTY_FORMAT_8_BITS) {
8485 /* insert padding */
8486 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8487 xcb_buffer_len += xcb_block_len + xcb_pad;
8488 if (0 != xcb_pad) {
8489 xcb_tmp += xcb_pad;
8490 xcb_pad = 0;
8492 xcb_block_len = 0;
8493 /* data8 */
8494 _aux->data8 = (uint8_t *)xcb_tmp;
8495 xcb_block_len += num_items * sizeof(uint8_t);
8496 xcb_tmp += xcb_block_len;
8497 xcb_align_to = ALIGNOF(uint8_t);
8499 if(format & XCB_INPUT_PROPERTY_FORMAT_16_BITS) {
8500 /* insert padding */
8501 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8502 xcb_buffer_len += xcb_block_len + xcb_pad;
8503 if (0 != xcb_pad) {
8504 xcb_tmp += xcb_pad;
8505 xcb_pad = 0;
8507 xcb_block_len = 0;
8508 /* data16 */
8509 _aux->data16 = (uint16_t *)xcb_tmp;
8510 xcb_block_len += num_items * sizeof(uint16_t);
8511 xcb_tmp += xcb_block_len;
8512 xcb_align_to = ALIGNOF(uint16_t);
8514 if(format & XCB_INPUT_PROPERTY_FORMAT_32_BITS) {
8515 /* insert padding */
8516 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8517 xcb_buffer_len += xcb_block_len + xcb_pad;
8518 if (0 != xcb_pad) {
8519 xcb_tmp += xcb_pad;
8520 xcb_pad = 0;
8522 xcb_block_len = 0;
8523 /* data32 */
8524 _aux->data32 = (uint32_t *)xcb_tmp;
8525 xcb_block_len += num_items * sizeof(uint32_t);
8526 xcb_tmp += xcb_block_len;
8527 xcb_align_to = ALIGNOF(uint32_t);
8529 /* insert padding */
8530 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8531 xcb_buffer_len += xcb_block_len + xcb_pad;
8532 if (0 != xcb_pad) {
8533 xcb_tmp += xcb_pad;
8534 xcb_pad = 0;
8536 xcb_block_len = 0;
8538 return xcb_buffer_len;
8542 xcb_input_xi_change_property_items_sizeof (const void *_buffer /**< */,
8543 uint32_t num_items /**< */,
8544 uint8_t format /**< */)
8546 xcb_input_xi_change_property_items_t _aux;
8547 return xcb_input_xi_change_property_items_unpack(_buffer, num_items, format, &_aux);
8550 xcb_void_cookie_t
8551 xcb_input_xi_change_property_checked (xcb_connection_t *c /**< */,
8552 xcb_input_device_id_t deviceid /**< */,
8553 uint8_t mode /**< */,
8554 uint8_t format /**< */,
8555 xcb_atom_t property /**< */,
8556 xcb_atom_t type /**< */,
8557 uint32_t num_items /**< */,
8558 const void *items /**< */)
8560 static const xcb_protocol_request_t xcb_req = {
8561 /* count */ 3,
8562 /* ext */ &xcb_input_id,
8563 /* opcode */ XCB_INPUT_XI_CHANGE_PROPERTY,
8564 /* isvoid */ 1
8567 struct iovec xcb_parts[5];
8568 xcb_void_cookie_t xcb_ret;
8569 xcb_input_xi_change_property_request_t xcb_out;
8571 xcb_out.deviceid = deviceid;
8572 xcb_out.mode = mode;
8573 xcb_out.format = format;
8574 xcb_out.property = property;
8575 xcb_out.type = type;
8576 xcb_out.num_items = num_items;
8578 xcb_parts[2].iov_base = (char *) &xcb_out;
8579 xcb_parts[2].iov_len = sizeof(xcb_out);
8580 xcb_parts[3].iov_base = 0;
8581 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
8582 /* xcb_input_xi_change_property_items_t items */
8583 xcb_parts[4].iov_base = (char *) items;
8584 xcb_parts[4].iov_len =
8585 xcb_input_xi_change_property_items_sizeof (items, num_items, format);
8587 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
8588 return xcb_ret;
8591 xcb_void_cookie_t
8592 xcb_input_xi_change_property (xcb_connection_t *c /**< */,
8593 xcb_input_device_id_t deviceid /**< */,
8594 uint8_t mode /**< */,
8595 uint8_t format /**< */,
8596 xcb_atom_t property /**< */,
8597 xcb_atom_t type /**< */,
8598 uint32_t num_items /**< */,
8599 const void *items /**< */)
8601 static const xcb_protocol_request_t xcb_req = {
8602 /* count */ 3,
8603 /* ext */ &xcb_input_id,
8604 /* opcode */ XCB_INPUT_XI_CHANGE_PROPERTY,
8605 /* isvoid */ 1
8608 struct iovec xcb_parts[5];
8609 xcb_void_cookie_t xcb_ret;
8610 xcb_input_xi_change_property_request_t xcb_out;
8612 xcb_out.deviceid = deviceid;
8613 xcb_out.mode = mode;
8614 xcb_out.format = format;
8615 xcb_out.property = property;
8616 xcb_out.type = type;
8617 xcb_out.num_items = num_items;
8619 xcb_parts[2].iov_base = (char *) &xcb_out;
8620 xcb_parts[2].iov_len = sizeof(xcb_out);
8621 xcb_parts[3].iov_base = 0;
8622 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
8623 /* xcb_input_xi_change_property_items_t items */
8624 xcb_parts[4].iov_base = (char *) items;
8625 xcb_parts[4].iov_len =
8626 xcb_input_xi_change_property_items_sizeof (items, num_items, format);
8628 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
8629 return xcb_ret;
8632 xcb_void_cookie_t
8633 xcb_input_xi_change_property_aux_checked (xcb_connection_t *c /**< */,
8634 xcb_input_device_id_t deviceid /**< */,
8635 uint8_t mode /**< */,
8636 uint8_t format /**< */,
8637 xcb_atom_t property /**< */,
8638 xcb_atom_t type /**< */,
8639 uint32_t num_items /**< */,
8640 const xcb_input_xi_change_property_items_t *items /**< */)
8642 static const xcb_protocol_request_t xcb_req = {
8643 /* count */ 3,
8644 /* ext */ &xcb_input_id,
8645 /* opcode */ XCB_INPUT_XI_CHANGE_PROPERTY,
8646 /* isvoid */ 1
8649 struct iovec xcb_parts[5];
8650 xcb_void_cookie_t xcb_ret;
8651 xcb_input_xi_change_property_request_t xcb_out;
8652 void *xcb_aux0 = 0;
8654 xcb_out.deviceid = deviceid;
8655 xcb_out.mode = mode;
8656 xcb_out.format = format;
8657 xcb_out.property = property;
8658 xcb_out.type = type;
8659 xcb_out.num_items = num_items;
8661 xcb_parts[2].iov_base = (char *) &xcb_out;
8662 xcb_parts[2].iov_len = sizeof(xcb_out);
8663 xcb_parts[3].iov_base = 0;
8664 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
8665 /* xcb_input_xi_change_property_items_t items */
8666 xcb_parts[4].iov_len =
8667 xcb_input_xi_change_property_items_serialize (&xcb_aux0, num_items, format, items);
8668 xcb_parts[4].iov_base = xcb_aux0;
8670 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
8671 free(xcb_aux0);
8672 return xcb_ret;
8675 xcb_void_cookie_t
8676 xcb_input_xi_change_property_aux (xcb_connection_t *c /**< */,
8677 xcb_input_device_id_t deviceid /**< */,
8678 uint8_t mode /**< */,
8679 uint8_t format /**< */,
8680 xcb_atom_t property /**< */,
8681 xcb_atom_t type /**< */,
8682 uint32_t num_items /**< */,
8683 const xcb_input_xi_change_property_items_t *items /**< */)
8685 static const xcb_protocol_request_t xcb_req = {
8686 /* count */ 3,
8687 /* ext */ &xcb_input_id,
8688 /* opcode */ XCB_INPUT_XI_CHANGE_PROPERTY,
8689 /* isvoid */ 1
8692 struct iovec xcb_parts[5];
8693 xcb_void_cookie_t xcb_ret;
8694 xcb_input_xi_change_property_request_t xcb_out;
8695 void *xcb_aux0 = 0;
8697 xcb_out.deviceid = deviceid;
8698 xcb_out.mode = mode;
8699 xcb_out.format = format;
8700 xcb_out.property = property;
8701 xcb_out.type = type;
8702 xcb_out.num_items = num_items;
8704 xcb_parts[2].iov_base = (char *) &xcb_out;
8705 xcb_parts[2].iov_len = sizeof(xcb_out);
8706 xcb_parts[3].iov_base = 0;
8707 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
8708 /* xcb_input_xi_change_property_items_t items */
8709 xcb_parts[4].iov_len =
8710 xcb_input_xi_change_property_items_serialize (&xcb_aux0, num_items, format, items);
8711 xcb_parts[4].iov_base = xcb_aux0;
8713 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
8714 free(xcb_aux0);
8715 return xcb_ret;
8718 xcb_void_cookie_t
8719 xcb_input_xi_delete_property_checked (xcb_connection_t *c /**< */,
8720 xcb_input_device_id_t deviceid /**< */,
8721 xcb_atom_t property /**< */)
8723 static const xcb_protocol_request_t xcb_req = {
8724 /* count */ 2,
8725 /* ext */ &xcb_input_id,
8726 /* opcode */ XCB_INPUT_XI_DELETE_PROPERTY,
8727 /* isvoid */ 1
8730 struct iovec xcb_parts[4];
8731 xcb_void_cookie_t xcb_ret;
8732 xcb_input_xi_delete_property_request_t xcb_out;
8734 xcb_out.deviceid = deviceid;
8735 memset(xcb_out.pad0, 0, 2);
8736 xcb_out.property = property;
8738 xcb_parts[2].iov_base = (char *) &xcb_out;
8739 xcb_parts[2].iov_len = sizeof(xcb_out);
8740 xcb_parts[3].iov_base = 0;
8741 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
8743 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
8744 return xcb_ret;
8747 xcb_void_cookie_t
8748 xcb_input_xi_delete_property (xcb_connection_t *c /**< */,
8749 xcb_input_device_id_t deviceid /**< */,
8750 xcb_atom_t property /**< */)
8752 static const xcb_protocol_request_t xcb_req = {
8753 /* count */ 2,
8754 /* ext */ &xcb_input_id,
8755 /* opcode */ XCB_INPUT_XI_DELETE_PROPERTY,
8756 /* isvoid */ 1
8759 struct iovec xcb_parts[4];
8760 xcb_void_cookie_t xcb_ret;
8761 xcb_input_xi_delete_property_request_t xcb_out;
8763 xcb_out.deviceid = deviceid;
8764 memset(xcb_out.pad0, 0, 2);
8765 xcb_out.property = property;
8767 xcb_parts[2].iov_base = (char *) &xcb_out;
8768 xcb_parts[2].iov_len = sizeof(xcb_out);
8769 xcb_parts[3].iov_base = 0;
8770 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
8772 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
8773 return xcb_ret;
8776 uint8_t *
8777 xcb_input_xi_get_property_items_data_8 (const xcb_input_xi_get_property_items_t *S /**< */)
8779 return /* items */ S->data8;
8783 xcb_input_xi_get_property_items_data_8_length (const xcb_input_xi_get_property_reply_t *R /**< */,
8784 const xcb_input_xi_get_property_items_t *S /**< */)
8786 return R->num_items;
8789 xcb_generic_iterator_t
8790 xcb_input_xi_get_property_items_data_8_end (const xcb_input_xi_get_property_reply_t *R /**< */,
8791 const xcb_input_xi_get_property_items_t *S /**< */)
8793 xcb_generic_iterator_t i;
8794 i.data = /* items */ S->data8 + R->num_items;
8795 i.rem = 0;
8796 i.index = (char *) i.data - (char *) S;
8797 return i;
8800 uint16_t *
8801 xcb_input_xi_get_property_items_data_16 (const xcb_input_xi_get_property_items_t *S /**< */)
8803 return /* items */ S->data16;
8807 xcb_input_xi_get_property_items_data_16_length (const xcb_input_xi_get_property_reply_t *R /**< */,
8808 const xcb_input_xi_get_property_items_t *S /**< */)
8810 return R->num_items;
8813 xcb_generic_iterator_t
8814 xcb_input_xi_get_property_items_data_16_end (const xcb_input_xi_get_property_reply_t *R /**< */,
8815 const xcb_input_xi_get_property_items_t *S /**< */)
8817 xcb_generic_iterator_t i;
8818 i.data = /* items */ S->data16 + R->num_items;
8819 i.rem = 0;
8820 i.index = (char *) i.data - (char *) S;
8821 return i;
8824 uint32_t *
8825 xcb_input_xi_get_property_items_data_32 (const xcb_input_xi_get_property_items_t *S /**< */)
8827 return /* items */ S->data32;
8831 xcb_input_xi_get_property_items_data_32_length (const xcb_input_xi_get_property_reply_t *R /**< */,
8832 const xcb_input_xi_get_property_items_t *S /**< */)
8834 return R->num_items;
8837 xcb_generic_iterator_t
8838 xcb_input_xi_get_property_items_data_32_end (const xcb_input_xi_get_property_reply_t *R /**< */,
8839 const xcb_input_xi_get_property_items_t *S /**< */)
8841 xcb_generic_iterator_t i;
8842 i.data = /* items */ S->data32 + R->num_items;
8843 i.rem = 0;
8844 i.index = (char *) i.data - (char *) S;
8845 return i;
8849 xcb_input_xi_get_property_items_serialize (void **_buffer /**< */,
8850 uint32_t num_items /**< */,
8851 uint8_t format /**< */,
8852 const xcb_input_xi_get_property_items_t *_aux /**< */)
8854 char *xcb_out = *_buffer;
8855 unsigned int xcb_buffer_len = 0;
8856 unsigned int xcb_align_to = 0;
8858 unsigned int xcb_pad = 0;
8859 char xcb_pad0[3] = {0, 0, 0};
8860 struct iovec xcb_parts[7];
8861 unsigned int xcb_parts_idx = 0;
8862 unsigned int xcb_block_len = 0;
8863 unsigned int i;
8864 char *xcb_tmp;
8866 if(format & XCB_INPUT_PROPERTY_FORMAT_8_BITS) {
8867 /* insert padding */
8868 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8869 xcb_buffer_len += xcb_block_len + xcb_pad;
8870 if (0 != xcb_pad) {
8871 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
8872 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
8873 xcb_parts_idx++;
8874 xcb_pad = 0;
8876 xcb_block_len = 0;
8877 /* data8 */
8878 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->data8;
8879 xcb_block_len += num_items * sizeof(uint8_t);
8880 xcb_parts[xcb_parts_idx].iov_len = num_items * sizeof(uint8_t);
8881 xcb_parts_idx++;
8882 xcb_align_to = ALIGNOF(uint8_t);
8884 if(format & XCB_INPUT_PROPERTY_FORMAT_16_BITS) {
8885 /* insert padding */
8886 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8887 xcb_buffer_len += xcb_block_len + xcb_pad;
8888 if (0 != xcb_pad) {
8889 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
8890 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
8891 xcb_parts_idx++;
8892 xcb_pad = 0;
8894 xcb_block_len = 0;
8895 /* data16 */
8896 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->data16;
8897 xcb_block_len += num_items * sizeof(uint16_t);
8898 xcb_parts[xcb_parts_idx].iov_len = num_items * sizeof(uint16_t);
8899 xcb_parts_idx++;
8900 xcb_align_to = ALIGNOF(uint16_t);
8902 if(format & XCB_INPUT_PROPERTY_FORMAT_32_BITS) {
8903 /* insert padding */
8904 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8905 xcb_buffer_len += xcb_block_len + xcb_pad;
8906 if (0 != xcb_pad) {
8907 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
8908 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
8909 xcb_parts_idx++;
8910 xcb_pad = 0;
8912 xcb_block_len = 0;
8913 /* data32 */
8914 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->data32;
8915 xcb_block_len += num_items * sizeof(uint32_t);
8916 xcb_parts[xcb_parts_idx].iov_len = num_items * sizeof(uint32_t);
8917 xcb_parts_idx++;
8918 xcb_align_to = ALIGNOF(uint32_t);
8920 /* insert padding */
8921 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8922 xcb_buffer_len += xcb_block_len + xcb_pad;
8923 if (0 != xcb_pad) {
8924 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
8925 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
8926 xcb_parts_idx++;
8927 xcb_pad = 0;
8929 xcb_block_len = 0;
8931 if (NULL == xcb_out) {
8932 /* allocate memory */
8933 xcb_out = malloc(xcb_buffer_len);
8934 *_buffer = xcb_out;
8937 xcb_tmp = xcb_out;
8938 for(i=0; i<xcb_parts_idx; i++) {
8939 if (0 != xcb_parts[i].iov_base && 0 != xcb_parts[i].iov_len)
8940 memcpy(xcb_tmp, xcb_parts[i].iov_base, xcb_parts[i].iov_len);
8941 if (0 != xcb_parts[i].iov_len)
8942 xcb_tmp += xcb_parts[i].iov_len;
8945 return xcb_buffer_len;
8949 xcb_input_xi_get_property_items_unpack (const void *_buffer /**< */,
8950 uint32_t num_items /**< */,
8951 uint8_t format /**< */,
8952 xcb_input_xi_get_property_items_t *_aux /**< */)
8954 char *xcb_tmp = (char *)_buffer;
8955 unsigned int xcb_buffer_len = 0;
8956 unsigned int xcb_block_len = 0;
8957 unsigned int xcb_pad = 0;
8958 unsigned int xcb_align_to = 0;
8961 if(format & XCB_INPUT_PROPERTY_FORMAT_8_BITS) {
8962 /* insert padding */
8963 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8964 xcb_buffer_len += xcb_block_len + xcb_pad;
8965 if (0 != xcb_pad) {
8966 xcb_tmp += xcb_pad;
8967 xcb_pad = 0;
8969 xcb_block_len = 0;
8970 /* data8 */
8971 _aux->data8 = (uint8_t *)xcb_tmp;
8972 xcb_block_len += num_items * sizeof(uint8_t);
8973 xcb_tmp += xcb_block_len;
8974 xcb_align_to = ALIGNOF(uint8_t);
8976 if(format & XCB_INPUT_PROPERTY_FORMAT_16_BITS) {
8977 /* insert padding */
8978 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8979 xcb_buffer_len += xcb_block_len + xcb_pad;
8980 if (0 != xcb_pad) {
8981 xcb_tmp += xcb_pad;
8982 xcb_pad = 0;
8984 xcb_block_len = 0;
8985 /* data16 */
8986 _aux->data16 = (uint16_t *)xcb_tmp;
8987 xcb_block_len += num_items * sizeof(uint16_t);
8988 xcb_tmp += xcb_block_len;
8989 xcb_align_to = ALIGNOF(uint16_t);
8991 if(format & XCB_INPUT_PROPERTY_FORMAT_32_BITS) {
8992 /* insert padding */
8993 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8994 xcb_buffer_len += xcb_block_len + xcb_pad;
8995 if (0 != xcb_pad) {
8996 xcb_tmp += xcb_pad;
8997 xcb_pad = 0;
8999 xcb_block_len = 0;
9000 /* data32 */
9001 _aux->data32 = (uint32_t *)xcb_tmp;
9002 xcb_block_len += num_items * sizeof(uint32_t);
9003 xcb_tmp += xcb_block_len;
9004 xcb_align_to = ALIGNOF(uint32_t);
9006 /* insert padding */
9007 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
9008 xcb_buffer_len += xcb_block_len + xcb_pad;
9009 if (0 != xcb_pad) {
9010 xcb_tmp += xcb_pad;
9011 xcb_pad = 0;
9013 xcb_block_len = 0;
9015 return xcb_buffer_len;
9019 xcb_input_xi_get_property_items_sizeof (const void *_buffer /**< */,
9020 uint32_t num_items /**< */,
9021 uint8_t format /**< */)
9023 xcb_input_xi_get_property_items_t _aux;
9024 return xcb_input_xi_get_property_items_unpack(_buffer, num_items, format, &_aux);
9027 xcb_input_xi_get_property_cookie_t
9028 xcb_input_xi_get_property (xcb_connection_t *c /**< */,
9029 xcb_input_device_id_t deviceid /**< */,
9030 uint8_t _delete /**< */,
9031 xcb_atom_t property /**< */,
9032 xcb_atom_t type /**< */,
9033 uint32_t offset /**< */,
9034 uint32_t len /**< */)
9036 static const xcb_protocol_request_t xcb_req = {
9037 /* count */ 2,
9038 /* ext */ &xcb_input_id,
9039 /* opcode */ XCB_INPUT_XI_GET_PROPERTY,
9040 /* isvoid */ 0
9043 struct iovec xcb_parts[4];
9044 xcb_input_xi_get_property_cookie_t xcb_ret;
9045 xcb_input_xi_get_property_request_t xcb_out;
9047 xcb_out.deviceid = deviceid;
9048 xcb_out._delete = _delete;
9049 xcb_out.pad0 = 0;
9050 xcb_out.property = property;
9051 xcb_out.type = type;
9052 xcb_out.offset = offset;
9053 xcb_out.len = len;
9055 xcb_parts[2].iov_base = (char *) &xcb_out;
9056 xcb_parts[2].iov_len = sizeof(xcb_out);
9057 xcb_parts[3].iov_base = 0;
9058 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
9060 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
9061 return xcb_ret;
9064 xcb_input_xi_get_property_cookie_t
9065 xcb_input_xi_get_property_unchecked (xcb_connection_t *c /**< */,
9066 xcb_input_device_id_t deviceid /**< */,
9067 uint8_t _delete /**< */,
9068 xcb_atom_t property /**< */,
9069 xcb_atom_t type /**< */,
9070 uint32_t offset /**< */,
9071 uint32_t len /**< */)
9073 static const xcb_protocol_request_t xcb_req = {
9074 /* count */ 2,
9075 /* ext */ &xcb_input_id,
9076 /* opcode */ XCB_INPUT_XI_GET_PROPERTY,
9077 /* isvoid */ 0
9080 struct iovec xcb_parts[4];
9081 xcb_input_xi_get_property_cookie_t xcb_ret;
9082 xcb_input_xi_get_property_request_t xcb_out;
9084 xcb_out.deviceid = deviceid;
9085 xcb_out._delete = _delete;
9086 xcb_out.pad0 = 0;
9087 xcb_out.property = property;
9088 xcb_out.type = type;
9089 xcb_out.offset = offset;
9090 xcb_out.len = len;
9092 xcb_parts[2].iov_base = (char *) &xcb_out;
9093 xcb_parts[2].iov_len = sizeof(xcb_out);
9094 xcb_parts[3].iov_base = 0;
9095 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
9097 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
9098 return xcb_ret;
9101 void *
9102 xcb_input_xi_get_property_items (const xcb_input_xi_get_property_reply_t *R /**< */)
9104 return (void *) (R + 1);
9107 xcb_input_xi_get_property_reply_t *
9108 xcb_input_xi_get_property_reply (xcb_connection_t *c /**< */,
9109 xcb_input_xi_get_property_cookie_t cookie /**< */,
9110 xcb_generic_error_t **e /**< */)
9112 return (xcb_input_xi_get_property_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
9116 xcb_input_xi_get_selected_events_sizeof (const void *_buffer /**< */)
9118 char *xcb_tmp = (char *)_buffer;
9119 const xcb_input_xi_get_selected_events_reply_t *_aux = (xcb_input_xi_get_selected_events_reply_t *)_buffer;
9120 unsigned int xcb_buffer_len = 0;
9121 unsigned int xcb_block_len = 0;
9122 unsigned int xcb_pad = 0;
9123 unsigned int xcb_align_to = 0;
9125 unsigned int i;
9126 unsigned int xcb_tmp_len;
9128 xcb_block_len += sizeof(xcb_input_xi_get_selected_events_reply_t);
9129 xcb_tmp += xcb_block_len;
9130 xcb_buffer_len += xcb_block_len;
9131 xcb_block_len = 0;
9132 /* masks */
9133 for(i=0; i<_aux->num_masks; i++) {
9134 xcb_tmp_len = xcb_input_event_mask_sizeof(xcb_tmp);
9135 xcb_block_len += xcb_tmp_len;
9136 xcb_tmp += xcb_tmp_len;
9138 xcb_align_to = ALIGNOF(xcb_input_event_mask_t);
9139 /* insert padding */
9140 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
9141 xcb_buffer_len += xcb_block_len + xcb_pad;
9142 if (0 != xcb_pad) {
9143 xcb_tmp += xcb_pad;
9144 xcb_pad = 0;
9146 xcb_block_len = 0;
9148 return xcb_buffer_len;
9151 xcb_input_xi_get_selected_events_cookie_t
9152 xcb_input_xi_get_selected_events (xcb_connection_t *c /**< */,
9153 xcb_window_t window /**< */)
9155 static const xcb_protocol_request_t xcb_req = {
9156 /* count */ 2,
9157 /* ext */ &xcb_input_id,
9158 /* opcode */ XCB_INPUT_XI_GET_SELECTED_EVENTS,
9159 /* isvoid */ 0
9162 struct iovec xcb_parts[4];
9163 xcb_input_xi_get_selected_events_cookie_t xcb_ret;
9164 xcb_input_xi_get_selected_events_request_t xcb_out;
9166 xcb_out.window = window;
9168 xcb_parts[2].iov_base = (char *) &xcb_out;
9169 xcb_parts[2].iov_len = sizeof(xcb_out);
9170 xcb_parts[3].iov_base = 0;
9171 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
9173 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
9174 return xcb_ret;
9177 xcb_input_xi_get_selected_events_cookie_t
9178 xcb_input_xi_get_selected_events_unchecked (xcb_connection_t *c /**< */,
9179 xcb_window_t window /**< */)
9181 static const xcb_protocol_request_t xcb_req = {
9182 /* count */ 2,
9183 /* ext */ &xcb_input_id,
9184 /* opcode */ XCB_INPUT_XI_GET_SELECTED_EVENTS,
9185 /* isvoid */ 0
9188 struct iovec xcb_parts[4];
9189 xcb_input_xi_get_selected_events_cookie_t xcb_ret;
9190 xcb_input_xi_get_selected_events_request_t xcb_out;
9192 xcb_out.window = window;
9194 xcb_parts[2].iov_base = (char *) &xcb_out;
9195 xcb_parts[2].iov_len = sizeof(xcb_out);
9196 xcb_parts[3].iov_base = 0;
9197 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
9199 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
9200 return xcb_ret;
9204 xcb_input_xi_get_selected_events_masks_length (const xcb_input_xi_get_selected_events_reply_t *R /**< */)
9206 return R->num_masks;
9209 xcb_input_event_mask_iterator_t
9210 xcb_input_xi_get_selected_events_masks_iterator (const xcb_input_xi_get_selected_events_reply_t *R /**< */)
9212 xcb_input_event_mask_iterator_t i;
9213 i.data = (xcb_input_event_mask_t *) (R + 1);
9214 i.rem = R->num_masks;
9215 i.index = (char *) i.data - (char *) R;
9216 return i;
9219 xcb_input_xi_get_selected_events_reply_t *
9220 xcb_input_xi_get_selected_events_reply (xcb_connection_t *c /**< */,
9221 xcb_input_xi_get_selected_events_cookie_t cookie /**< */,
9222 xcb_generic_error_t **e /**< */)
9224 return (xcb_input_xi_get_selected_events_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
9227 void
9228 xcb_input_barrier_release_pointer_info_next (xcb_input_barrier_release_pointer_info_iterator_t *i /**< */)
9230 --i->rem;
9231 ++i->data;
9232 i->index += sizeof(xcb_input_barrier_release_pointer_info_t);
9235 xcb_generic_iterator_t
9236 xcb_input_barrier_release_pointer_info_end (xcb_input_barrier_release_pointer_info_iterator_t i /**< */)
9238 xcb_generic_iterator_t ret;
9239 ret.data = i.data + i.rem;
9240 ret.index = i.index + ((char *) ret.data - (char *) i.data);
9241 ret.rem = 0;
9242 return ret;
9246 xcb_input_xi_barrier_release_pointer_sizeof (const void *_buffer /**< */)
9248 char *xcb_tmp = (char *)_buffer;
9249 const xcb_input_xi_barrier_release_pointer_request_t *_aux = (xcb_input_xi_barrier_release_pointer_request_t *)_buffer;
9250 unsigned int xcb_buffer_len = 0;
9251 unsigned int xcb_block_len = 0;
9252 unsigned int xcb_pad = 0;
9253 unsigned int xcb_align_to = 0;
9256 xcb_block_len += sizeof(xcb_input_xi_barrier_release_pointer_request_t);
9257 xcb_tmp += xcb_block_len;
9258 xcb_buffer_len += xcb_block_len;
9259 xcb_block_len = 0;
9260 /* barriers */
9261 xcb_block_len += _aux->num_barriers * sizeof(xcb_input_barrier_release_pointer_info_t);
9262 xcb_tmp += xcb_block_len;
9263 xcb_align_to = ALIGNOF(xcb_input_barrier_release_pointer_info_t);
9264 /* insert padding */
9265 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
9266 xcb_buffer_len += xcb_block_len + xcb_pad;
9267 if (0 != xcb_pad) {
9268 xcb_tmp += xcb_pad;
9269 xcb_pad = 0;
9271 xcb_block_len = 0;
9273 return xcb_buffer_len;
9276 xcb_void_cookie_t
9277 xcb_input_xi_barrier_release_pointer_checked (xcb_connection_t *c /**< */,
9278 uint32_t num_barriers /**< */,
9279 const xcb_input_barrier_release_pointer_info_t *barriers /**< */)
9281 static const xcb_protocol_request_t xcb_req = {
9282 /* count */ 4,
9283 /* ext */ &xcb_input_id,
9284 /* opcode */ XCB_INPUT_XI_BARRIER_RELEASE_POINTER,
9285 /* isvoid */ 1
9288 struct iovec xcb_parts[6];
9289 xcb_void_cookie_t xcb_ret;
9290 xcb_input_xi_barrier_release_pointer_request_t xcb_out;
9292 xcb_out.num_barriers = num_barriers;
9294 xcb_parts[2].iov_base = (char *) &xcb_out;
9295 xcb_parts[2].iov_len = sizeof(xcb_out);
9296 xcb_parts[3].iov_base = 0;
9297 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
9298 /* xcb_input_barrier_release_pointer_info_t barriers */
9299 xcb_parts[4].iov_base = (char *) barriers;
9300 xcb_parts[4].iov_len = num_barriers * sizeof(xcb_input_barrier_release_pointer_info_t);
9301 xcb_parts[5].iov_base = 0;
9302 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
9304 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
9305 return xcb_ret;
9308 xcb_void_cookie_t
9309 xcb_input_xi_barrier_release_pointer (xcb_connection_t *c /**< */,
9310 uint32_t num_barriers /**< */,
9311 const xcb_input_barrier_release_pointer_info_t *barriers /**< */)
9313 static const xcb_protocol_request_t xcb_req = {
9314 /* count */ 4,
9315 /* ext */ &xcb_input_id,
9316 /* opcode */ XCB_INPUT_XI_BARRIER_RELEASE_POINTER,
9317 /* isvoid */ 1
9320 struct iovec xcb_parts[6];
9321 xcb_void_cookie_t xcb_ret;
9322 xcb_input_xi_barrier_release_pointer_request_t xcb_out;
9324 xcb_out.num_barriers = num_barriers;
9326 xcb_parts[2].iov_base = (char *) &xcb_out;
9327 xcb_parts[2].iov_len = sizeof(xcb_out);
9328 xcb_parts[3].iov_base = 0;
9329 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
9330 /* xcb_input_barrier_release_pointer_info_t barriers */
9331 xcb_parts[4].iov_base = (char *) barriers;
9332 xcb_parts[4].iov_len = num_barriers * sizeof(xcb_input_barrier_release_pointer_info_t);
9333 xcb_parts[5].iov_base = 0;
9334 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
9336 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
9337 return xcb_ret;
9341 xcb_input_device_changed_sizeof (const void *_buffer /**< */)
9343 char *xcb_tmp = (char *)_buffer;
9344 const xcb_input_device_changed_event_t *_aux = (xcb_input_device_changed_event_t *)_buffer;
9345 unsigned int xcb_buffer_len = 0;
9346 unsigned int xcb_block_len = 0;
9347 unsigned int xcb_pad = 0;
9348 unsigned int xcb_align_to = 0;
9350 unsigned int i;
9351 unsigned int xcb_tmp_len;
9353 xcb_block_len += sizeof(xcb_input_device_changed_event_t);
9354 xcb_tmp += xcb_block_len;
9355 xcb_buffer_len += xcb_block_len;
9356 xcb_block_len = 0;
9357 /* classes */
9358 for(i=0; i<_aux->num_classes; i++) {
9359 xcb_tmp_len = xcb_input_device_class_sizeof(xcb_tmp);
9360 xcb_block_len += xcb_tmp_len;
9361 xcb_tmp += xcb_tmp_len;
9363 xcb_align_to = ALIGNOF(xcb_input_device_class_t);
9364 /* insert padding */
9365 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
9366 xcb_buffer_len += xcb_block_len + xcb_pad;
9367 if (0 != xcb_pad) {
9368 xcb_tmp += xcb_pad;
9369 xcb_pad = 0;
9371 xcb_block_len = 0;
9373 return xcb_buffer_len;
9377 xcb_input_key_press_sizeof (const void *_buffer /**< */)
9379 char *xcb_tmp = (char *)_buffer;
9380 const xcb_input_key_press_event_t *_aux = (xcb_input_key_press_event_t *)_buffer;
9381 unsigned int xcb_buffer_len = 0;
9382 unsigned int xcb_block_len = 0;
9383 unsigned int xcb_pad = 0;
9384 unsigned int xcb_align_to = 0;
9387 xcb_block_len += sizeof(xcb_input_key_press_event_t);
9388 xcb_tmp += xcb_block_len;
9389 xcb_buffer_len += xcb_block_len;
9390 xcb_block_len = 0;
9391 /* button_mask */
9392 xcb_block_len += _aux->buttons_len * sizeof(uint32_t);
9393 xcb_tmp += xcb_block_len;
9394 xcb_align_to = ALIGNOF(uint32_t);
9395 /* insert padding */
9396 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
9397 xcb_buffer_len += xcb_block_len + xcb_pad;
9398 if (0 != xcb_pad) {
9399 xcb_tmp += xcb_pad;
9400 xcb_pad = 0;
9402 xcb_block_len = 0;
9403 /* valuator_mask */
9404 xcb_block_len += _aux->valuators_len * sizeof(uint32_t);
9405 xcb_tmp += xcb_block_len;
9406 xcb_align_to = ALIGNOF(uint32_t);
9407 /* insert padding */
9408 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
9409 xcb_buffer_len += xcb_block_len + xcb_pad;
9410 if (0 != xcb_pad) {
9411 xcb_tmp += xcb_pad;
9412 xcb_pad = 0;
9414 xcb_block_len = 0;
9416 return xcb_buffer_len;
9420 xcb_input_key_release_sizeof (const void *_buffer /**< */)
9422 char *xcb_tmp = (char *)_buffer;
9423 const xcb_input_key_release_event_t *_aux = (xcb_input_key_release_event_t *)_buffer;
9424 unsigned int xcb_buffer_len = 0;
9425 unsigned int xcb_block_len = 0;
9426 unsigned int xcb_pad = 0;
9427 unsigned int xcb_align_to = 0;
9430 xcb_block_len += sizeof(xcb_input_key_release_event_t);
9431 xcb_tmp += xcb_block_len;
9432 xcb_buffer_len += xcb_block_len;
9433 xcb_block_len = 0;
9434 /* button_mask */
9435 xcb_block_len += _aux->buttons_len * sizeof(uint32_t);
9436 xcb_tmp += xcb_block_len;
9437 xcb_align_to = ALIGNOF(uint32_t);
9438 /* insert padding */
9439 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
9440 xcb_buffer_len += xcb_block_len + xcb_pad;
9441 if (0 != xcb_pad) {
9442 xcb_tmp += xcb_pad;
9443 xcb_pad = 0;
9445 xcb_block_len = 0;
9446 /* valuator_mask */
9447 xcb_block_len += _aux->valuators_len * sizeof(uint32_t);
9448 xcb_tmp += xcb_block_len;
9449 xcb_align_to = ALIGNOF(uint32_t);
9450 /* insert padding */
9451 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
9452 xcb_buffer_len += xcb_block_len + xcb_pad;
9453 if (0 != xcb_pad) {
9454 xcb_tmp += xcb_pad;
9455 xcb_pad = 0;
9457 xcb_block_len = 0;
9459 return xcb_buffer_len;
9463 xcb_input_button_press_sizeof (const void *_buffer /**< */)
9465 char *xcb_tmp = (char *)_buffer;
9466 const xcb_input_button_press_event_t *_aux = (xcb_input_button_press_event_t *)_buffer;
9467 unsigned int xcb_buffer_len = 0;
9468 unsigned int xcb_block_len = 0;
9469 unsigned int xcb_pad = 0;
9470 unsigned int xcb_align_to = 0;
9473 xcb_block_len += sizeof(xcb_input_button_press_event_t);
9474 xcb_tmp += xcb_block_len;
9475 xcb_buffer_len += xcb_block_len;
9476 xcb_block_len = 0;
9477 /* button_mask */
9478 xcb_block_len += _aux->buttons_len * sizeof(uint32_t);
9479 xcb_tmp += xcb_block_len;
9480 xcb_align_to = ALIGNOF(uint32_t);
9481 /* insert padding */
9482 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
9483 xcb_buffer_len += xcb_block_len + xcb_pad;
9484 if (0 != xcb_pad) {
9485 xcb_tmp += xcb_pad;
9486 xcb_pad = 0;
9488 xcb_block_len = 0;
9489 /* valuator_mask */
9490 xcb_block_len += _aux->valuators_len * sizeof(uint32_t);
9491 xcb_tmp += xcb_block_len;
9492 xcb_align_to = ALIGNOF(uint32_t);
9493 /* insert padding */
9494 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
9495 xcb_buffer_len += xcb_block_len + xcb_pad;
9496 if (0 != xcb_pad) {
9497 xcb_tmp += xcb_pad;
9498 xcb_pad = 0;
9500 xcb_block_len = 0;
9502 return xcb_buffer_len;
9506 xcb_input_button_release_sizeof (const void *_buffer /**< */)
9508 char *xcb_tmp = (char *)_buffer;
9509 const xcb_input_button_release_event_t *_aux = (xcb_input_button_release_event_t *)_buffer;
9510 unsigned int xcb_buffer_len = 0;
9511 unsigned int xcb_block_len = 0;
9512 unsigned int xcb_pad = 0;
9513 unsigned int xcb_align_to = 0;
9516 xcb_block_len += sizeof(xcb_input_button_release_event_t);
9517 xcb_tmp += xcb_block_len;
9518 xcb_buffer_len += xcb_block_len;
9519 xcb_block_len = 0;
9520 /* button_mask */
9521 xcb_block_len += _aux->buttons_len * sizeof(uint32_t);
9522 xcb_tmp += xcb_block_len;
9523 xcb_align_to = ALIGNOF(uint32_t);
9524 /* insert padding */
9525 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
9526 xcb_buffer_len += xcb_block_len + xcb_pad;
9527 if (0 != xcb_pad) {
9528 xcb_tmp += xcb_pad;
9529 xcb_pad = 0;
9531 xcb_block_len = 0;
9532 /* valuator_mask */
9533 xcb_block_len += _aux->valuators_len * sizeof(uint32_t);
9534 xcb_tmp += xcb_block_len;
9535 xcb_align_to = ALIGNOF(uint32_t);
9536 /* insert padding */
9537 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
9538 xcb_buffer_len += xcb_block_len + xcb_pad;
9539 if (0 != xcb_pad) {
9540 xcb_tmp += xcb_pad;
9541 xcb_pad = 0;
9543 xcb_block_len = 0;
9545 return xcb_buffer_len;
9549 xcb_input_motion_sizeof (const void *_buffer /**< */)
9551 char *xcb_tmp = (char *)_buffer;
9552 const xcb_input_motion_event_t *_aux = (xcb_input_motion_event_t *)_buffer;
9553 unsigned int xcb_buffer_len = 0;
9554 unsigned int xcb_block_len = 0;
9555 unsigned int xcb_pad = 0;
9556 unsigned int xcb_align_to = 0;
9559 xcb_block_len += sizeof(xcb_input_motion_event_t);
9560 xcb_tmp += xcb_block_len;
9561 xcb_buffer_len += xcb_block_len;
9562 xcb_block_len = 0;
9563 /* button_mask */
9564 xcb_block_len += _aux->buttons_len * sizeof(uint32_t);
9565 xcb_tmp += xcb_block_len;
9566 xcb_align_to = ALIGNOF(uint32_t);
9567 /* insert padding */
9568 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
9569 xcb_buffer_len += xcb_block_len + xcb_pad;
9570 if (0 != xcb_pad) {
9571 xcb_tmp += xcb_pad;
9572 xcb_pad = 0;
9574 xcb_block_len = 0;
9575 /* valuator_mask */
9576 xcb_block_len += _aux->valuators_len * sizeof(uint32_t);
9577 xcb_tmp += xcb_block_len;
9578 xcb_align_to = ALIGNOF(uint32_t);
9579 /* insert padding */
9580 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
9581 xcb_buffer_len += xcb_block_len + xcb_pad;
9582 if (0 != xcb_pad) {
9583 xcb_tmp += xcb_pad;
9584 xcb_pad = 0;
9586 xcb_block_len = 0;
9588 return xcb_buffer_len;
9592 xcb_input_enter_sizeof (const void *_buffer /**< */)
9594 char *xcb_tmp = (char *)_buffer;
9595 const xcb_input_enter_event_t *_aux = (xcb_input_enter_event_t *)_buffer;
9596 unsigned int xcb_buffer_len = 0;
9597 unsigned int xcb_block_len = 0;
9598 unsigned int xcb_pad = 0;
9599 unsigned int xcb_align_to = 0;
9602 xcb_block_len += sizeof(xcb_input_enter_event_t);
9603 xcb_tmp += xcb_block_len;
9604 xcb_buffer_len += xcb_block_len;
9605 xcb_block_len = 0;
9606 /* buttons */
9607 xcb_block_len += _aux->buttons_len * sizeof(uint32_t);
9608 xcb_tmp += xcb_block_len;
9609 xcb_align_to = ALIGNOF(uint32_t);
9610 /* insert padding */
9611 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
9612 xcb_buffer_len += xcb_block_len + xcb_pad;
9613 if (0 != xcb_pad) {
9614 xcb_tmp += xcb_pad;
9615 xcb_pad = 0;
9617 xcb_block_len = 0;
9619 return xcb_buffer_len;
9623 xcb_input_leave_sizeof (const void *_buffer /**< */)
9625 char *xcb_tmp = (char *)_buffer;
9626 const xcb_input_leave_event_t *_aux = (xcb_input_leave_event_t *)_buffer;
9627 unsigned int xcb_buffer_len = 0;
9628 unsigned int xcb_block_len = 0;
9629 unsigned int xcb_pad = 0;
9630 unsigned int xcb_align_to = 0;
9633 xcb_block_len += sizeof(xcb_input_leave_event_t);
9634 xcb_tmp += xcb_block_len;
9635 xcb_buffer_len += xcb_block_len;
9636 xcb_block_len = 0;
9637 /* buttons */
9638 xcb_block_len += _aux->buttons_len * sizeof(uint32_t);
9639 xcb_tmp += xcb_block_len;
9640 xcb_align_to = ALIGNOF(uint32_t);
9641 /* insert padding */
9642 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
9643 xcb_buffer_len += xcb_block_len + xcb_pad;
9644 if (0 != xcb_pad) {
9645 xcb_tmp += xcb_pad;
9646 xcb_pad = 0;
9648 xcb_block_len = 0;
9650 return xcb_buffer_len;
9654 xcb_input_focus_in_sizeof (const void *_buffer /**< */)
9656 char *xcb_tmp = (char *)_buffer;
9657 const xcb_input_focus_in_event_t *_aux = (xcb_input_focus_in_event_t *)_buffer;
9658 unsigned int xcb_buffer_len = 0;
9659 unsigned int xcb_block_len = 0;
9660 unsigned int xcb_pad = 0;
9661 unsigned int xcb_align_to = 0;
9664 xcb_block_len += sizeof(xcb_input_focus_in_event_t);
9665 xcb_tmp += xcb_block_len;
9666 xcb_buffer_len += xcb_block_len;
9667 xcb_block_len = 0;
9668 /* buttons */
9669 xcb_block_len += _aux->buttons_len * sizeof(uint32_t);
9670 xcb_tmp += xcb_block_len;
9671 xcb_align_to = ALIGNOF(uint32_t);
9672 /* insert padding */
9673 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
9674 xcb_buffer_len += xcb_block_len + xcb_pad;
9675 if (0 != xcb_pad) {
9676 xcb_tmp += xcb_pad;
9677 xcb_pad = 0;
9679 xcb_block_len = 0;
9681 return xcb_buffer_len;
9685 xcb_input_focus_out_sizeof (const void *_buffer /**< */)
9687 char *xcb_tmp = (char *)_buffer;
9688 const xcb_input_focus_out_event_t *_aux = (xcb_input_focus_out_event_t *)_buffer;
9689 unsigned int xcb_buffer_len = 0;
9690 unsigned int xcb_block_len = 0;
9691 unsigned int xcb_pad = 0;
9692 unsigned int xcb_align_to = 0;
9695 xcb_block_len += sizeof(xcb_input_focus_out_event_t);
9696 xcb_tmp += xcb_block_len;
9697 xcb_buffer_len += xcb_block_len;
9698 xcb_block_len = 0;
9699 /* buttons */
9700 xcb_block_len += _aux->buttons_len * sizeof(uint32_t);
9701 xcb_tmp += xcb_block_len;
9702 xcb_align_to = ALIGNOF(uint32_t);
9703 /* insert padding */
9704 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
9705 xcb_buffer_len += xcb_block_len + xcb_pad;
9706 if (0 != xcb_pad) {
9707 xcb_tmp += xcb_pad;
9708 xcb_pad = 0;
9710 xcb_block_len = 0;
9712 return xcb_buffer_len;
9715 void
9716 xcb_input_hierarchy_info_next (xcb_input_hierarchy_info_iterator_t *i /**< */)
9718 --i->rem;
9719 ++i->data;
9720 i->index += sizeof(xcb_input_hierarchy_info_t);
9723 xcb_generic_iterator_t
9724 xcb_input_hierarchy_info_end (xcb_input_hierarchy_info_iterator_t i /**< */)
9726 xcb_generic_iterator_t ret;
9727 ret.data = i.data + i.rem;
9728 ret.index = i.index + ((char *) ret.data - (char *) i.data);
9729 ret.rem = 0;
9730 return ret;
9734 xcb_input_hierarchy_sizeof (const void *_buffer /**< */)
9736 char *xcb_tmp = (char *)_buffer;
9737 const xcb_input_hierarchy_event_t *_aux = (xcb_input_hierarchy_event_t *)_buffer;
9738 unsigned int xcb_buffer_len = 0;
9739 unsigned int xcb_block_len = 0;
9740 unsigned int xcb_pad = 0;
9741 unsigned int xcb_align_to = 0;
9744 xcb_block_len += sizeof(xcb_input_hierarchy_event_t);
9745 xcb_tmp += xcb_block_len;
9746 xcb_buffer_len += xcb_block_len;
9747 xcb_block_len = 0;
9748 /* infos */
9749 xcb_block_len += _aux->num_infos * sizeof(xcb_input_hierarchy_info_t);
9750 xcb_tmp += xcb_block_len;
9751 xcb_align_to = ALIGNOF(xcb_input_hierarchy_info_t);
9752 /* insert padding */
9753 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
9754 xcb_buffer_len += xcb_block_len + xcb_pad;
9755 if (0 != xcb_pad) {
9756 xcb_tmp += xcb_pad;
9757 xcb_pad = 0;
9759 xcb_block_len = 0;
9761 return xcb_buffer_len;
9765 xcb_input_raw_key_press_sizeof (const void *_buffer /**< */)
9767 char *xcb_tmp = (char *)_buffer;
9768 const xcb_input_raw_key_press_event_t *_aux = (xcb_input_raw_key_press_event_t *)_buffer;
9769 unsigned int xcb_buffer_len = 0;
9770 unsigned int xcb_block_len = 0;
9771 unsigned int xcb_pad = 0;
9772 unsigned int xcb_align_to = 0;
9775 xcb_block_len += sizeof(xcb_input_raw_key_press_event_t);
9776 xcb_tmp += xcb_block_len;
9777 xcb_buffer_len += xcb_block_len;
9778 xcb_block_len = 0;
9779 /* valuator_mask */
9780 xcb_block_len += _aux->valuators_len * sizeof(uint32_t);
9781 xcb_tmp += xcb_block_len;
9782 xcb_align_to = ALIGNOF(uint32_t);
9783 /* insert padding */
9784 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
9785 xcb_buffer_len += xcb_block_len + xcb_pad;
9786 if (0 != xcb_pad) {
9787 xcb_tmp += xcb_pad;
9788 xcb_pad = 0;
9790 xcb_block_len = 0;
9792 return xcb_buffer_len;
9796 xcb_input_raw_key_release_sizeof (const void *_buffer /**< */)
9798 char *xcb_tmp = (char *)_buffer;
9799 const xcb_input_raw_key_release_event_t *_aux = (xcb_input_raw_key_release_event_t *)_buffer;
9800 unsigned int xcb_buffer_len = 0;
9801 unsigned int xcb_block_len = 0;
9802 unsigned int xcb_pad = 0;
9803 unsigned int xcb_align_to = 0;
9806 xcb_block_len += sizeof(xcb_input_raw_key_release_event_t);
9807 xcb_tmp += xcb_block_len;
9808 xcb_buffer_len += xcb_block_len;
9809 xcb_block_len = 0;
9810 /* valuator_mask */
9811 xcb_block_len += _aux->valuators_len * sizeof(uint32_t);
9812 xcb_tmp += xcb_block_len;
9813 xcb_align_to = ALIGNOF(uint32_t);
9814 /* insert padding */
9815 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
9816 xcb_buffer_len += xcb_block_len + xcb_pad;
9817 if (0 != xcb_pad) {
9818 xcb_tmp += xcb_pad;
9819 xcb_pad = 0;
9821 xcb_block_len = 0;
9823 return xcb_buffer_len;
9827 xcb_input_raw_button_press_sizeof (const void *_buffer /**< */)
9829 char *xcb_tmp = (char *)_buffer;
9830 const xcb_input_raw_button_press_event_t *_aux = (xcb_input_raw_button_press_event_t *)_buffer;
9831 unsigned int xcb_buffer_len = 0;
9832 unsigned int xcb_block_len = 0;
9833 unsigned int xcb_pad = 0;
9834 unsigned int xcb_align_to = 0;
9837 xcb_block_len += sizeof(xcb_input_raw_button_press_event_t);
9838 xcb_tmp += xcb_block_len;
9839 xcb_buffer_len += xcb_block_len;
9840 xcb_block_len = 0;
9841 /* valuator_mask */
9842 xcb_block_len += _aux->valuators_len * sizeof(uint32_t);
9843 xcb_tmp += xcb_block_len;
9844 xcb_align_to = ALIGNOF(uint32_t);
9845 /* insert padding */
9846 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
9847 xcb_buffer_len += xcb_block_len + xcb_pad;
9848 if (0 != xcb_pad) {
9849 xcb_tmp += xcb_pad;
9850 xcb_pad = 0;
9852 xcb_block_len = 0;
9854 return xcb_buffer_len;
9858 xcb_input_raw_button_release_sizeof (const void *_buffer /**< */)
9860 char *xcb_tmp = (char *)_buffer;
9861 const xcb_input_raw_button_release_event_t *_aux = (xcb_input_raw_button_release_event_t *)_buffer;
9862 unsigned int xcb_buffer_len = 0;
9863 unsigned int xcb_block_len = 0;
9864 unsigned int xcb_pad = 0;
9865 unsigned int xcb_align_to = 0;
9868 xcb_block_len += sizeof(xcb_input_raw_button_release_event_t);
9869 xcb_tmp += xcb_block_len;
9870 xcb_buffer_len += xcb_block_len;
9871 xcb_block_len = 0;
9872 /* valuator_mask */
9873 xcb_block_len += _aux->valuators_len * sizeof(uint32_t);
9874 xcb_tmp += xcb_block_len;
9875 xcb_align_to = ALIGNOF(uint32_t);
9876 /* insert padding */
9877 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
9878 xcb_buffer_len += xcb_block_len + xcb_pad;
9879 if (0 != xcb_pad) {
9880 xcb_tmp += xcb_pad;
9881 xcb_pad = 0;
9883 xcb_block_len = 0;
9885 return xcb_buffer_len;
9889 xcb_input_raw_motion_sizeof (const void *_buffer /**< */)
9891 char *xcb_tmp = (char *)_buffer;
9892 const xcb_input_raw_motion_event_t *_aux = (xcb_input_raw_motion_event_t *)_buffer;
9893 unsigned int xcb_buffer_len = 0;
9894 unsigned int xcb_block_len = 0;
9895 unsigned int xcb_pad = 0;
9896 unsigned int xcb_align_to = 0;
9899 xcb_block_len += sizeof(xcb_input_raw_motion_event_t);
9900 xcb_tmp += xcb_block_len;
9901 xcb_buffer_len += xcb_block_len;
9902 xcb_block_len = 0;
9903 /* valuator_mask */
9904 xcb_block_len += _aux->valuators_len * sizeof(uint32_t);
9905 xcb_tmp += xcb_block_len;
9906 xcb_align_to = ALIGNOF(uint32_t);
9907 /* insert padding */
9908 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
9909 xcb_buffer_len += xcb_block_len + xcb_pad;
9910 if (0 != xcb_pad) {
9911 xcb_tmp += xcb_pad;
9912 xcb_pad = 0;
9914 xcb_block_len = 0;
9916 return xcb_buffer_len;
9920 xcb_input_touch_begin_sizeof (const void *_buffer /**< */)
9922 char *xcb_tmp = (char *)_buffer;
9923 const xcb_input_touch_begin_event_t *_aux = (xcb_input_touch_begin_event_t *)_buffer;
9924 unsigned int xcb_buffer_len = 0;
9925 unsigned int xcb_block_len = 0;
9926 unsigned int xcb_pad = 0;
9927 unsigned int xcb_align_to = 0;
9930 xcb_block_len += sizeof(xcb_input_touch_begin_event_t);
9931 xcb_tmp += xcb_block_len;
9932 xcb_buffer_len += xcb_block_len;
9933 xcb_block_len = 0;
9934 /* button_mask */
9935 xcb_block_len += _aux->buttons_len * sizeof(uint32_t);
9936 xcb_tmp += xcb_block_len;
9937 xcb_align_to = ALIGNOF(uint32_t);
9938 /* insert padding */
9939 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
9940 xcb_buffer_len += xcb_block_len + xcb_pad;
9941 if (0 != xcb_pad) {
9942 xcb_tmp += xcb_pad;
9943 xcb_pad = 0;
9945 xcb_block_len = 0;
9946 /* valuator_mask */
9947 xcb_block_len += _aux->valuators_len * sizeof(uint32_t);
9948 xcb_tmp += xcb_block_len;
9949 xcb_align_to = ALIGNOF(uint32_t);
9950 /* insert padding */
9951 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
9952 xcb_buffer_len += xcb_block_len + xcb_pad;
9953 if (0 != xcb_pad) {
9954 xcb_tmp += xcb_pad;
9955 xcb_pad = 0;
9957 xcb_block_len = 0;
9959 return xcb_buffer_len;
9963 xcb_input_touch_update_sizeof (const void *_buffer /**< */)
9965 char *xcb_tmp = (char *)_buffer;
9966 const xcb_input_touch_update_event_t *_aux = (xcb_input_touch_update_event_t *)_buffer;
9967 unsigned int xcb_buffer_len = 0;
9968 unsigned int xcb_block_len = 0;
9969 unsigned int xcb_pad = 0;
9970 unsigned int xcb_align_to = 0;
9973 xcb_block_len += sizeof(xcb_input_touch_update_event_t);
9974 xcb_tmp += xcb_block_len;
9975 xcb_buffer_len += xcb_block_len;
9976 xcb_block_len = 0;
9977 /* button_mask */
9978 xcb_block_len += _aux->buttons_len * sizeof(uint32_t);
9979 xcb_tmp += xcb_block_len;
9980 xcb_align_to = ALIGNOF(uint32_t);
9981 /* insert padding */
9982 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
9983 xcb_buffer_len += xcb_block_len + xcb_pad;
9984 if (0 != xcb_pad) {
9985 xcb_tmp += xcb_pad;
9986 xcb_pad = 0;
9988 xcb_block_len = 0;
9989 /* valuator_mask */
9990 xcb_block_len += _aux->valuators_len * sizeof(uint32_t);
9991 xcb_tmp += xcb_block_len;
9992 xcb_align_to = ALIGNOF(uint32_t);
9993 /* insert padding */
9994 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
9995 xcb_buffer_len += xcb_block_len + xcb_pad;
9996 if (0 != xcb_pad) {
9997 xcb_tmp += xcb_pad;
9998 xcb_pad = 0;
10000 xcb_block_len = 0;
10002 return xcb_buffer_len;
10006 xcb_input_touch_end_sizeof (const void *_buffer /**< */)
10008 char *xcb_tmp = (char *)_buffer;
10009 const xcb_input_touch_end_event_t *_aux = (xcb_input_touch_end_event_t *)_buffer;
10010 unsigned int xcb_buffer_len = 0;
10011 unsigned int xcb_block_len = 0;
10012 unsigned int xcb_pad = 0;
10013 unsigned int xcb_align_to = 0;
10016 xcb_block_len += sizeof(xcb_input_touch_end_event_t);
10017 xcb_tmp += xcb_block_len;
10018 xcb_buffer_len += xcb_block_len;
10019 xcb_block_len = 0;
10020 /* button_mask */
10021 xcb_block_len += _aux->buttons_len * sizeof(uint32_t);
10022 xcb_tmp += xcb_block_len;
10023 xcb_align_to = ALIGNOF(uint32_t);
10024 /* insert padding */
10025 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
10026 xcb_buffer_len += xcb_block_len + xcb_pad;
10027 if (0 != xcb_pad) {
10028 xcb_tmp += xcb_pad;
10029 xcb_pad = 0;
10031 xcb_block_len = 0;
10032 /* valuator_mask */
10033 xcb_block_len += _aux->valuators_len * sizeof(uint32_t);
10034 xcb_tmp += xcb_block_len;
10035 xcb_align_to = ALIGNOF(uint32_t);
10036 /* insert padding */
10037 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
10038 xcb_buffer_len += xcb_block_len + xcb_pad;
10039 if (0 != xcb_pad) {
10040 xcb_tmp += xcb_pad;
10041 xcb_pad = 0;
10043 xcb_block_len = 0;
10045 return xcb_buffer_len;
10049 xcb_input_raw_touch_begin_sizeof (const void *_buffer /**< */)
10051 char *xcb_tmp = (char *)_buffer;
10052 const xcb_input_raw_touch_begin_event_t *_aux = (xcb_input_raw_touch_begin_event_t *)_buffer;
10053 unsigned int xcb_buffer_len = 0;
10054 unsigned int xcb_block_len = 0;
10055 unsigned int xcb_pad = 0;
10056 unsigned int xcb_align_to = 0;
10059 xcb_block_len += sizeof(xcb_input_raw_touch_begin_event_t);
10060 xcb_tmp += xcb_block_len;
10061 xcb_buffer_len += xcb_block_len;
10062 xcb_block_len = 0;
10063 /* valuator_mask */
10064 xcb_block_len += _aux->valuators_len * sizeof(uint32_t);
10065 xcb_tmp += xcb_block_len;
10066 xcb_align_to = ALIGNOF(uint32_t);
10067 /* insert padding */
10068 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
10069 xcb_buffer_len += xcb_block_len + xcb_pad;
10070 if (0 != xcb_pad) {
10071 xcb_tmp += xcb_pad;
10072 xcb_pad = 0;
10074 xcb_block_len = 0;
10076 return xcb_buffer_len;
10080 xcb_input_raw_touch_update_sizeof (const void *_buffer /**< */)
10082 char *xcb_tmp = (char *)_buffer;
10083 const xcb_input_raw_touch_update_event_t *_aux = (xcb_input_raw_touch_update_event_t *)_buffer;
10084 unsigned int xcb_buffer_len = 0;
10085 unsigned int xcb_block_len = 0;
10086 unsigned int xcb_pad = 0;
10087 unsigned int xcb_align_to = 0;
10090 xcb_block_len += sizeof(xcb_input_raw_touch_update_event_t);
10091 xcb_tmp += xcb_block_len;
10092 xcb_buffer_len += xcb_block_len;
10093 xcb_block_len = 0;
10094 /* valuator_mask */
10095 xcb_block_len += _aux->valuators_len * sizeof(uint32_t);
10096 xcb_tmp += xcb_block_len;
10097 xcb_align_to = ALIGNOF(uint32_t);
10098 /* insert padding */
10099 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
10100 xcb_buffer_len += xcb_block_len + xcb_pad;
10101 if (0 != xcb_pad) {
10102 xcb_tmp += xcb_pad;
10103 xcb_pad = 0;
10105 xcb_block_len = 0;
10107 return xcb_buffer_len;
10111 xcb_input_raw_touch_end_sizeof (const void *_buffer /**< */)
10113 char *xcb_tmp = (char *)_buffer;
10114 const xcb_input_raw_touch_end_event_t *_aux = (xcb_input_raw_touch_end_event_t *)_buffer;
10115 unsigned int xcb_buffer_len = 0;
10116 unsigned int xcb_block_len = 0;
10117 unsigned int xcb_pad = 0;
10118 unsigned int xcb_align_to = 0;
10121 xcb_block_len += sizeof(xcb_input_raw_touch_end_event_t);
10122 xcb_tmp += xcb_block_len;
10123 xcb_buffer_len += xcb_block_len;
10124 xcb_block_len = 0;
10125 /* valuator_mask */
10126 xcb_block_len += _aux->valuators_len * sizeof(uint32_t);
10127 xcb_tmp += xcb_block_len;
10128 xcb_align_to = ALIGNOF(uint32_t);
10129 /* insert padding */
10130 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
10131 xcb_buffer_len += xcb_block_len + xcb_pad;
10132 if (0 != xcb_pad) {
10133 xcb_tmp += xcb_pad;
10134 xcb_pad = 0;
10136 xcb_block_len = 0;
10138 return xcb_buffer_len;