xinput.c revision 1.1.12.2 1 /*
2 * This file generated automatically from xinput.xml by c_client.py.
3 * Edit at your peril.
4 */
5
6 #ifdef HAVE_CONFIG_H
7 #include "config.h"
8 #endif
9 #include <stdlib.h>
10 #include <string.h>
11 #include <assert.h>
12 #include <stddef.h> /* for offsetof() */
13 #include "xcbext.h"
14 #include "xinput.h"
15
16 #define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member)
17 #include "xproto.h"
18 #include "render.h"
19 #include "shape.h"
20 #include "xfixes.h"
21
22 xcb_extension_t xcb_input_id = { "XInputExtension", 0 };
23
24
25 /*****************************************************************************
26 **
27 ** void xcb_input_event_class_next
28 **
29 ** @param xcb_input_event_class_iterator_t *i
30 ** @returns void
31 **
32 *****************************************************************************/
33
34 void
35 xcb_input_event_class_next (xcb_input_event_class_iterator_t *i /**< */)
36 {
37 --i->rem;
38 ++i->data;
39 i->index += sizeof(xcb_input_event_class_t);
40 }
41
42
43 /*****************************************************************************
44 **
45 ** xcb_generic_iterator_t xcb_input_event_class_end
46 **
47 ** @param xcb_input_event_class_iterator_t i
48 ** @returns xcb_generic_iterator_t
49 **
50 *****************************************************************************/
51
52 xcb_generic_iterator_t
53 xcb_input_event_class_end (xcb_input_event_class_iterator_t i /**< */)
54 {
55 xcb_generic_iterator_t ret;
56 ret.data = i.data + i.rem;
57 ret.index = i.index + ((char *) ret.data - (char *) i.data);
58 ret.rem = 0;
59 return ret;
60 }
61
62
63 /*****************************************************************************
64 **
65 ** void xcb_input_key_code_next
66 **
67 ** @param xcb_input_key_code_iterator_t *i
68 ** @returns void
69 **
70 *****************************************************************************/
71
72 void
73 xcb_input_key_code_next (xcb_input_key_code_iterator_t *i /**< */)
74 {
75 --i->rem;
76 ++i->data;
77 i->index += sizeof(xcb_input_key_code_t);
78 }
79
80
81 /*****************************************************************************
82 **
83 ** xcb_generic_iterator_t xcb_input_key_code_end
84 **
85 ** @param xcb_input_key_code_iterator_t i
86 ** @returns xcb_generic_iterator_t
87 **
88 *****************************************************************************/
89
90 xcb_generic_iterator_t
91 xcb_input_key_code_end (xcb_input_key_code_iterator_t i /**< */)
92 {
93 xcb_generic_iterator_t ret;
94 ret.data = i.data + i.rem;
95 ret.index = i.index + ((char *) ret.data - (char *) i.data);
96 ret.rem = 0;
97 return ret;
98 }
99
100
101 /*****************************************************************************
102 **
103 ** void xcb_input_device_id_next
104 **
105 ** @param xcb_input_device_id_iterator_t *i
106 ** @returns void
107 **
108 *****************************************************************************/
109
110 void
111 xcb_input_device_id_next (xcb_input_device_id_iterator_t *i /**< */)
112 {
113 --i->rem;
114 ++i->data;
115 i->index += sizeof(xcb_input_device_id_t);
116 }
117
118
119 /*****************************************************************************
120 **
121 ** xcb_generic_iterator_t xcb_input_device_id_end
122 **
123 ** @param xcb_input_device_id_iterator_t i
124 ** @returns xcb_generic_iterator_t
125 **
126 *****************************************************************************/
127
128 xcb_generic_iterator_t
129 xcb_input_device_id_end (xcb_input_device_id_iterator_t i /**< */)
130 {
131 xcb_generic_iterator_t ret;
132 ret.data = i.data + i.rem;
133 ret.index = i.index + ((char *) ret.data - (char *) i.data);
134 ret.rem = 0;
135 return ret;
136 }
137
138
139 /*****************************************************************************
140 **
141 ** void xcb_input_fp1616_next
142 **
143 ** @param xcb_input_fp1616_iterator_t *i
144 ** @returns void
145 **
146 *****************************************************************************/
147
148 void
149 xcb_input_fp1616_next (xcb_input_fp1616_iterator_t *i /**< */)
150 {
151 --i->rem;
152 ++i->data;
153 i->index += sizeof(xcb_input_fp1616_t);
154 }
155
156
157 /*****************************************************************************
158 **
159 ** xcb_generic_iterator_t xcb_input_fp1616_end
160 **
161 ** @param xcb_input_fp1616_iterator_t i
162 ** @returns xcb_generic_iterator_t
163 **
164 *****************************************************************************/
165
166 xcb_generic_iterator_t
167 xcb_input_fp1616_end (xcb_input_fp1616_iterator_t i /**< */)
168 {
169 xcb_generic_iterator_t ret;
170 ret.data = i.data + i.rem;
171 ret.index = i.index + ((char *) ret.data - (char *) i.data);
172 ret.rem = 0;
173 return ret;
174 }
175
176
177 /*****************************************************************************
178 **
179 ** void xcb_input_fp3232_next
180 **
181 ** @param xcb_input_fp3232_iterator_t *i
182 ** @returns void
183 **
184 *****************************************************************************/
185
186 void
187 xcb_input_fp3232_next (xcb_input_fp3232_iterator_t *i /**< */)
188 {
189 --i->rem;
190 ++i->data;
191 i->index += sizeof(xcb_input_fp3232_t);
192 }
193
194
195 /*****************************************************************************
196 **
197 ** xcb_generic_iterator_t xcb_input_fp3232_end
198 **
199 ** @param xcb_input_fp3232_iterator_t i
200 ** @returns xcb_generic_iterator_t
201 **
202 *****************************************************************************/
203
204 xcb_generic_iterator_t
205 xcb_input_fp3232_end (xcb_input_fp3232_iterator_t i /**< */)
206 {
207 xcb_generic_iterator_t ret;
208 ret.data = i.data + i.rem;
209 ret.index = i.index + ((char *) ret.data - (char *) i.data);
210 ret.rem = 0;
211 return ret;
212 }
213
214 int
215 xcb_input_get_extension_version_sizeof (const void *_buffer /**< */)
216 {
217 char *xcb_tmp = (char *)_buffer;
218 const xcb_input_get_extension_version_request_t *_aux = (xcb_input_get_extension_version_request_t *)_buffer;
219 unsigned int xcb_buffer_len = 0;
220 unsigned int xcb_block_len = 0;
221 unsigned int xcb_pad = 0;
222 unsigned int xcb_align_to = 0;
223
224
225 xcb_block_len += sizeof(xcb_input_get_extension_version_request_t);
226 xcb_tmp += xcb_block_len;
227 xcb_buffer_len += xcb_block_len;
228 xcb_block_len = 0;
229 /* name */
230 xcb_block_len += _aux->name_len * sizeof(char);
231 xcb_tmp += xcb_block_len;
232 xcb_align_to = ALIGNOF(char);
233 /* insert padding */
234 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
235 xcb_buffer_len += xcb_block_len + xcb_pad;
236 if (0 != xcb_pad) {
237 xcb_tmp += xcb_pad;
238 xcb_pad = 0;
239 }
240 xcb_block_len = 0;
241
242 return xcb_buffer_len;
243 }
244
245
246 /*****************************************************************************
247 **
248 ** xcb_input_get_extension_version_cookie_t xcb_input_get_extension_version
249 **
250 ** @param xcb_connection_t *c
251 ** @param uint16_t name_len
252 ** @param const char *name
253 ** @returns xcb_input_get_extension_version_cookie_t
254 **
255 *****************************************************************************/
256
257 xcb_input_get_extension_version_cookie_t
258 xcb_input_get_extension_version (xcb_connection_t *c /**< */,
259 uint16_t name_len /**< */,
260 const char *name /**< */)
261 {
262 static const xcb_protocol_request_t xcb_req = {
263 /* count */ 4,
264 /* ext */ &xcb_input_id,
265 /* opcode */ XCB_INPUT_GET_EXTENSION_VERSION,
266 /* isvoid */ 0
267 };
268
269 struct iovec xcb_parts[6];
270 xcb_input_get_extension_version_cookie_t xcb_ret;
271 xcb_input_get_extension_version_request_t xcb_out;
272
273 xcb_out.name_len = name_len;
274 memset(xcb_out.pad0, 0, 2);
275
276 xcb_parts[2].iov_base = (char *) &xcb_out;
277 xcb_parts[2].iov_len = sizeof(xcb_out);
278 xcb_parts[3].iov_base = 0;
279 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
280 /* char name */
281 xcb_parts[4].iov_base = (char *) name;
282 xcb_parts[4].iov_len = name_len * sizeof(char);
283 xcb_parts[5].iov_base = 0;
284 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
285
286 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
287 return xcb_ret;
288 }
289
290
291 /*****************************************************************************
292 **
293 ** xcb_input_get_extension_version_cookie_t xcb_input_get_extension_version_unchecked
294 **
295 ** @param xcb_connection_t *c
296 ** @param uint16_t name_len
297 ** @param const char *name
298 ** @returns xcb_input_get_extension_version_cookie_t
299 **
300 *****************************************************************************/
301
302 xcb_input_get_extension_version_cookie_t
303 xcb_input_get_extension_version_unchecked (xcb_connection_t *c /**< */,
304 uint16_t name_len /**< */,
305 const char *name /**< */)
306 {
307 static const xcb_protocol_request_t xcb_req = {
308 /* count */ 4,
309 /* ext */ &xcb_input_id,
310 /* opcode */ XCB_INPUT_GET_EXTENSION_VERSION,
311 /* isvoid */ 0
312 };
313
314 struct iovec xcb_parts[6];
315 xcb_input_get_extension_version_cookie_t xcb_ret;
316 xcb_input_get_extension_version_request_t xcb_out;
317
318 xcb_out.name_len = name_len;
319 memset(xcb_out.pad0, 0, 2);
320
321 xcb_parts[2].iov_base = (char *) &xcb_out;
322 xcb_parts[2].iov_len = sizeof(xcb_out);
323 xcb_parts[3].iov_base = 0;
324 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
325 /* char name */
326 xcb_parts[4].iov_base = (char *) name;
327 xcb_parts[4].iov_len = name_len * sizeof(char);
328 xcb_parts[5].iov_base = 0;
329 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
330
331 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
332 return xcb_ret;
333 }
334
335
336 /*****************************************************************************
337 **
338 ** xcb_input_get_extension_version_reply_t * xcb_input_get_extension_version_reply
339 **
340 ** @param xcb_connection_t *c
341 ** @param xcb_input_get_extension_version_cookie_t cookie
342 ** @param xcb_generic_error_t **e
343 ** @returns xcb_input_get_extension_version_reply_t *
344 **
345 *****************************************************************************/
346
347 xcb_input_get_extension_version_reply_t *
348 xcb_input_get_extension_version_reply (xcb_connection_t *c /**< */,
349 xcb_input_get_extension_version_cookie_t cookie /**< */,
350 xcb_generic_error_t **e /**< */)
351 {
352 return (xcb_input_get_extension_version_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
353 }
354
355
356 /*****************************************************************************
357 **
358 ** void xcb_input_device_info_next
359 **
360 ** @param xcb_input_device_info_iterator_t *i
361 ** @returns void
362 **
363 *****************************************************************************/
364
365 void
366 xcb_input_device_info_next (xcb_input_device_info_iterator_t *i /**< */)
367 {
368 --i->rem;
369 ++i->data;
370 i->index += sizeof(xcb_input_device_info_t);
371 }
372
373
374 /*****************************************************************************
375 **
376 ** xcb_generic_iterator_t xcb_input_device_info_end
377 **
378 ** @param xcb_input_device_info_iterator_t i
379 ** @returns xcb_generic_iterator_t
380 **
381 *****************************************************************************/
382
383 xcb_generic_iterator_t
384 xcb_input_device_info_end (xcb_input_device_info_iterator_t i /**< */)
385 {
386 xcb_generic_iterator_t ret;
387 ret.data = i.data + i.rem;
388 ret.index = i.index + ((char *) ret.data - (char *) i.data);
389 ret.rem = 0;
390 return ret;
391 }
392
393
394 /*****************************************************************************
395 **
396 ** void xcb_input_key_info_next
397 **
398 ** @param xcb_input_key_info_iterator_t *i
399 ** @returns void
400 **
401 *****************************************************************************/
402
403 void
404 xcb_input_key_info_next (xcb_input_key_info_iterator_t *i /**< */)
405 {
406 --i->rem;
407 ++i->data;
408 i->index += sizeof(xcb_input_key_info_t);
409 }
410
411
412 /*****************************************************************************
413 **
414 ** xcb_generic_iterator_t xcb_input_key_info_end
415 **
416 ** @param xcb_input_key_info_iterator_t i
417 ** @returns xcb_generic_iterator_t
418 **
419 *****************************************************************************/
420
421 xcb_generic_iterator_t
422 xcb_input_key_info_end (xcb_input_key_info_iterator_t i /**< */)
423 {
424 xcb_generic_iterator_t ret;
425 ret.data = i.data + i.rem;
426 ret.index = i.index + ((char *) ret.data - (char *) i.data);
427 ret.rem = 0;
428 return ret;
429 }
430
431
432 /*****************************************************************************
433 **
434 ** void xcb_input_button_info_next
435 **
436 ** @param xcb_input_button_info_iterator_t *i
437 ** @returns void
438 **
439 *****************************************************************************/
440
441 void
442 xcb_input_button_info_next (xcb_input_button_info_iterator_t *i /**< */)
443 {
444 --i->rem;
445 ++i->data;
446 i->index += sizeof(xcb_input_button_info_t);
447 }
448
449
450 /*****************************************************************************
451 **
452 ** xcb_generic_iterator_t xcb_input_button_info_end
453 **
454 ** @param xcb_input_button_info_iterator_t i
455 ** @returns xcb_generic_iterator_t
456 **
457 *****************************************************************************/
458
459 xcb_generic_iterator_t
460 xcb_input_button_info_end (xcb_input_button_info_iterator_t i /**< */)
461 {
462 xcb_generic_iterator_t ret;
463 ret.data = i.data + i.rem;
464 ret.index = i.index + ((char *) ret.data - (char *) i.data);
465 ret.rem = 0;
466 return ret;
467 }
468
469
470 /*****************************************************************************
471 **
472 ** void xcb_input_axis_info_next
473 **
474 ** @param xcb_input_axis_info_iterator_t *i
475 ** @returns void
476 **
477 *****************************************************************************/
478
479 void
480 xcb_input_axis_info_next (xcb_input_axis_info_iterator_t *i /**< */)
481 {
482 --i->rem;
483 ++i->data;
484 i->index += sizeof(xcb_input_axis_info_t);
485 }
486
487
488 /*****************************************************************************
489 **
490 ** xcb_generic_iterator_t xcb_input_axis_info_end
491 **
492 ** @param xcb_input_axis_info_iterator_t i
493 ** @returns xcb_generic_iterator_t
494 **
495 *****************************************************************************/
496
497 xcb_generic_iterator_t
498 xcb_input_axis_info_end (xcb_input_axis_info_iterator_t i /**< */)
499 {
500 xcb_generic_iterator_t ret;
501 ret.data = i.data + i.rem;
502 ret.index = i.index + ((char *) ret.data - (char *) i.data);
503 ret.rem = 0;
504 return ret;
505 }
506
507 int
508 xcb_input_valuator_info_sizeof (const void *_buffer /**< */)
509 {
510 char *xcb_tmp = (char *)_buffer;
511 const xcb_input_valuator_info_t *_aux = (xcb_input_valuator_info_t *)_buffer;
512 unsigned int xcb_buffer_len = 0;
513 unsigned int xcb_block_len = 0;
514 unsigned int xcb_pad = 0;
515 unsigned int xcb_align_to = 0;
516
517
518 xcb_block_len += sizeof(xcb_input_valuator_info_t);
519 xcb_tmp += xcb_block_len;
520 xcb_buffer_len += xcb_block_len;
521 xcb_block_len = 0;
522 /* axes */
523 xcb_block_len += _aux->axes_len * sizeof(xcb_input_axis_info_t);
524 xcb_tmp += xcb_block_len;
525 xcb_align_to = ALIGNOF(xcb_input_axis_info_t);
526 /* insert padding */
527 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
528 xcb_buffer_len += xcb_block_len + xcb_pad;
529 if (0 != xcb_pad) {
530 xcb_tmp += xcb_pad;
531 xcb_pad = 0;
532 }
533 xcb_block_len = 0;
534
535 return xcb_buffer_len;
536 }
537
538
539 /*****************************************************************************
540 **
541 ** xcb_input_axis_info_t * xcb_input_valuator_info_axes
542 **
543 ** @param const xcb_input_valuator_info_t *R
544 ** @returns xcb_input_axis_info_t *
545 **
546 *****************************************************************************/
547
548 xcb_input_axis_info_t *
549 xcb_input_valuator_info_axes (const xcb_input_valuator_info_t *R /**< */)
550 {
551 return (xcb_input_axis_info_t *) (R + 1);
552 }
553
554
555 /*****************************************************************************
556 **
557 ** int xcb_input_valuator_info_axes_length
558 **
559 ** @param const xcb_input_valuator_info_t *R
560 ** @returns int
561 **
562 *****************************************************************************/
563
564 int
565 xcb_input_valuator_info_axes_length (const xcb_input_valuator_info_t *R /**< */)
566 {
567 return R->axes_len;
568 }
569
570
571 /*****************************************************************************
572 **
573 ** xcb_input_axis_info_iterator_t xcb_input_valuator_info_axes_iterator
574 **
575 ** @param const xcb_input_valuator_info_t *R
576 ** @returns xcb_input_axis_info_iterator_t
577 **
578 *****************************************************************************/
579
580 xcb_input_axis_info_iterator_t
581 xcb_input_valuator_info_axes_iterator (const xcb_input_valuator_info_t *R /**< */)
582 {
583 xcb_input_axis_info_iterator_t i;
584 i.data = (xcb_input_axis_info_t *) (R + 1);
585 i.rem = R->axes_len;
586 i.index = (char *) i.data - (char *) R;
587 return i;
588 }
589
590
591 /*****************************************************************************
592 **
593 ** void xcb_input_valuator_info_next
594 **
595 ** @param xcb_input_valuator_info_iterator_t *i
596 ** @returns void
597 **
598 *****************************************************************************/
599
600 void
601 xcb_input_valuator_info_next (xcb_input_valuator_info_iterator_t *i /**< */)
602 {
603 xcb_input_valuator_info_t *R = i->data;
604 xcb_generic_iterator_t child;
605 child.data = (xcb_input_valuator_info_t *)(((char *)R) + xcb_input_valuator_info_sizeof(R));
606 i->index = (char *) child.data - (char *) i->data;
607 --i->rem;
608 i->data = (xcb_input_valuator_info_t *) child.data;
609 }
610
611
612 /*****************************************************************************
613 **
614 ** xcb_generic_iterator_t xcb_input_valuator_info_end
615 **
616 ** @param xcb_input_valuator_info_iterator_t i
617 ** @returns xcb_generic_iterator_t
618 **
619 *****************************************************************************/
620
621 xcb_generic_iterator_t
622 xcb_input_valuator_info_end (xcb_input_valuator_info_iterator_t i /**< */)
623 {
624 xcb_generic_iterator_t ret;
625 while(i.rem > 0)
626 xcb_input_valuator_info_next(&i);
627 ret.data = i.data;
628 ret.rem = i.rem;
629 ret.index = i.index;
630 return ret;
631 }
632
633
634 /*****************************************************************************
635 **
636 ** void xcb_input_input_info_next
637 **
638 ** @param xcb_input_input_info_iterator_t *i
639 ** @returns void
640 **
641 *****************************************************************************/
642
643 void
644 xcb_input_input_info_next (xcb_input_input_info_iterator_t *i /**< */)
645 {
646 --i->rem;
647 ++i->data;
648 i->index += sizeof(xcb_input_input_info_t);
649 }
650
651
652 /*****************************************************************************
653 **
654 ** xcb_generic_iterator_t xcb_input_input_info_end
655 **
656 ** @param xcb_input_input_info_iterator_t i
657 ** @returns xcb_generic_iterator_t
658 **
659 *****************************************************************************/
660
661 xcb_generic_iterator_t
662 xcb_input_input_info_end (xcb_input_input_info_iterator_t i /**< */)
663 {
664 xcb_generic_iterator_t ret;
665 ret.data = i.data + i.rem;
666 ret.index = i.index + ((char *) ret.data - (char *) i.data);
667 ret.rem = 0;
668 return ret;
669 }
670
671 int
672 xcb_input_device_name_sizeof (const void *_buffer /**< */)
673 {
674 char *xcb_tmp = (char *)_buffer;
675 const xcb_input_device_name_t *_aux = (xcb_input_device_name_t *)_buffer;
676 unsigned int xcb_buffer_len = 0;
677 unsigned int xcb_block_len = 0;
678 unsigned int xcb_pad = 0;
679 unsigned int xcb_align_to = 0;
680
681
682 xcb_block_len += sizeof(xcb_input_device_name_t);
683 xcb_tmp += xcb_block_len;
684 xcb_buffer_len += xcb_block_len;
685 xcb_block_len = 0;
686 /* string */
687 xcb_block_len += _aux->len * sizeof(char);
688 xcb_tmp += xcb_block_len;
689 xcb_align_to = ALIGNOF(char);
690 /* insert padding */
691 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
692 xcb_buffer_len += xcb_block_len + xcb_pad;
693 if (0 != xcb_pad) {
694 xcb_tmp += xcb_pad;
695 xcb_pad = 0;
696 }
697 xcb_block_len = 0;
698
699 return xcb_buffer_len;
700 }
701
702
703 /*****************************************************************************
704 **
705 ** char * xcb_input_device_name_string
706 **
707 ** @param const xcb_input_device_name_t *R
708 ** @returns char *
709 **
710 *****************************************************************************/
711
712 char *
713 xcb_input_device_name_string (const xcb_input_device_name_t *R /**< */)
714 {
715 return (char *) (R + 1);
716 }
717
718
719 /*****************************************************************************
720 **
721 ** int xcb_input_device_name_string_length
722 **
723 ** @param const xcb_input_device_name_t *R
724 ** @returns int
725 **
726 *****************************************************************************/
727
728 int
729 xcb_input_device_name_string_length (const xcb_input_device_name_t *R /**< */)
730 {
731 return R->len;
732 }
733
734
735 /*****************************************************************************
736 **
737 ** xcb_generic_iterator_t xcb_input_device_name_string_end
738 **
739 ** @param const xcb_input_device_name_t *R
740 ** @returns xcb_generic_iterator_t
741 **
742 *****************************************************************************/
743
744 xcb_generic_iterator_t
745 xcb_input_device_name_string_end (const xcb_input_device_name_t *R /**< */)
746 {
747 xcb_generic_iterator_t i;
748 i.data = ((char *) (R + 1)) + (R->len);
749 i.rem = 0;
750 i.index = (char *) i.data - (char *) R;
751 return i;
752 }
753
754
755 /*****************************************************************************
756 **
757 ** void xcb_input_device_name_next
758 **
759 ** @param xcb_input_device_name_iterator_t *i
760 ** @returns void
761 **
762 *****************************************************************************/
763
764 void
765 xcb_input_device_name_next (xcb_input_device_name_iterator_t *i /**< */)
766 {
767 xcb_input_device_name_t *R = i->data;
768 xcb_generic_iterator_t child;
769 child.data = (xcb_input_device_name_t *)(((char *)R) + xcb_input_device_name_sizeof(R));
770 i->index = (char *) child.data - (char *) i->data;
771 --i->rem;
772 i->data = (xcb_input_device_name_t *) child.data;
773 }
774
775
776 /*****************************************************************************
777 **
778 ** xcb_generic_iterator_t xcb_input_device_name_end
779 **
780 ** @param xcb_input_device_name_iterator_t i
781 ** @returns xcb_generic_iterator_t
782 **
783 *****************************************************************************/
784
785 xcb_generic_iterator_t
786 xcb_input_device_name_end (xcb_input_device_name_iterator_t i /**< */)
787 {
788 xcb_generic_iterator_t ret;
789 while(i.rem > 0)
790 xcb_input_device_name_next(&i);
791 ret.data = i.data;
792 ret.rem = i.rem;
793 ret.index = i.index;
794 return ret;
795 }
796
797 int
798 xcb_input_list_input_devices_sizeof (const void *_buffer /**< */)
799 {
800 char *xcb_tmp = (char *)_buffer;
801 const xcb_input_list_input_devices_reply_t *_aux = (xcb_input_list_input_devices_reply_t *)_buffer;
802 unsigned int xcb_buffer_len = 0;
803 unsigned int xcb_block_len = 0;
804 unsigned int xcb_pad = 0;
805 unsigned int xcb_align_to = 0;
806
807
808 xcb_block_len += sizeof(xcb_input_list_input_devices_reply_t);
809 xcb_tmp += xcb_block_len;
810 xcb_buffer_len += xcb_block_len;
811 xcb_block_len = 0;
812 /* devices */
813 xcb_block_len += _aux->devices_len * sizeof(xcb_input_device_info_t);
814 xcb_tmp += xcb_block_len;
815 xcb_align_to = ALIGNOF(xcb_input_device_info_t);
816 /* insert padding */
817 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
818 xcb_buffer_len += xcb_block_len + xcb_pad;
819 if (0 != xcb_pad) {
820 xcb_tmp += xcb_pad;
821 xcb_pad = 0;
822 }
823 xcb_block_len = 0;
824
825 return xcb_buffer_len;
826 }
827
828
829 /*****************************************************************************
830 **
831 ** xcb_input_list_input_devices_cookie_t xcb_input_list_input_devices
832 **
833 ** @param xcb_connection_t *c
834 ** @returns xcb_input_list_input_devices_cookie_t
835 **
836 *****************************************************************************/
837
838 xcb_input_list_input_devices_cookie_t
839 xcb_input_list_input_devices (xcb_connection_t *c /**< */)
840 {
841 static const xcb_protocol_request_t xcb_req = {
842 /* count */ 2,
843 /* ext */ &xcb_input_id,
844 /* opcode */ XCB_INPUT_LIST_INPUT_DEVICES,
845 /* isvoid */ 0
846 };
847
848 struct iovec xcb_parts[4];
849 xcb_input_list_input_devices_cookie_t xcb_ret;
850 xcb_input_list_input_devices_request_t xcb_out;
851
852
853 xcb_parts[2].iov_base = (char *) &xcb_out;
854 xcb_parts[2].iov_len = sizeof(xcb_out);
855 xcb_parts[3].iov_base = 0;
856 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
857
858 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
859 return xcb_ret;
860 }
861
862
863 /*****************************************************************************
864 **
865 ** xcb_input_list_input_devices_cookie_t xcb_input_list_input_devices_unchecked
866 **
867 ** @param xcb_connection_t *c
868 ** @returns xcb_input_list_input_devices_cookie_t
869 **
870 *****************************************************************************/
871
872 xcb_input_list_input_devices_cookie_t
873 xcb_input_list_input_devices_unchecked (xcb_connection_t *c /**< */)
874 {
875 static const xcb_protocol_request_t xcb_req = {
876 /* count */ 2,
877 /* ext */ &xcb_input_id,
878 /* opcode */ XCB_INPUT_LIST_INPUT_DEVICES,
879 /* isvoid */ 0
880 };
881
882 struct iovec xcb_parts[4];
883 xcb_input_list_input_devices_cookie_t xcb_ret;
884 xcb_input_list_input_devices_request_t xcb_out;
885
886
887 xcb_parts[2].iov_base = (char *) &xcb_out;
888 xcb_parts[2].iov_len = sizeof(xcb_out);
889 xcb_parts[3].iov_base = 0;
890 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
891
892 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
893 return xcb_ret;
894 }
895
896
897 /*****************************************************************************
898 **
899 ** xcb_input_device_info_t * xcb_input_list_input_devices_devices
900 **
901 ** @param const xcb_input_list_input_devices_reply_t *R
902 ** @returns xcb_input_device_info_t *
903 **
904 *****************************************************************************/
905
906 xcb_input_device_info_t *
907 xcb_input_list_input_devices_devices (const xcb_input_list_input_devices_reply_t *R /**< */)
908 {
909 return (xcb_input_device_info_t *) (R + 1);
910 }
911
912
913 /*****************************************************************************
914 **
915 ** int xcb_input_list_input_devices_devices_length
916 **
917 ** @param const xcb_input_list_input_devices_reply_t *R
918 ** @returns int
919 **
920 *****************************************************************************/
921
922 int
923 xcb_input_list_input_devices_devices_length (const xcb_input_list_input_devices_reply_t *R /**< */)
924 {
925 return R->devices_len;
926 }
927
928
929 /*****************************************************************************
930 **
931 ** xcb_input_device_info_iterator_t xcb_input_list_input_devices_devices_iterator
932 **
933 ** @param const xcb_input_list_input_devices_reply_t *R
934 ** @returns xcb_input_device_info_iterator_t
935 **
936 *****************************************************************************/
937
938 xcb_input_device_info_iterator_t
939 xcb_input_list_input_devices_devices_iterator (const xcb_input_list_input_devices_reply_t *R /**< */)
940 {
941 xcb_input_device_info_iterator_t i;
942 i.data = (xcb_input_device_info_t *) (R + 1);
943 i.rem = R->devices_len;
944 i.index = (char *) i.data - (char *) R;
945 return i;
946 }
947
948
949 /*****************************************************************************
950 **
951 ** xcb_input_list_input_devices_reply_t * xcb_input_list_input_devices_reply
952 **
953 ** @param xcb_connection_t *c
954 ** @param xcb_input_list_input_devices_cookie_t cookie
955 ** @param xcb_generic_error_t **e
956 ** @returns xcb_input_list_input_devices_reply_t *
957 **
958 *****************************************************************************/
959
960 xcb_input_list_input_devices_reply_t *
961 xcb_input_list_input_devices_reply (xcb_connection_t *c /**< */,
962 xcb_input_list_input_devices_cookie_t cookie /**< */,
963 xcb_generic_error_t **e /**< */)
964 {
965 return (xcb_input_list_input_devices_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
966 }
967
968
969 /*****************************************************************************
970 **
971 ** void xcb_input_input_class_info_next
972 **
973 ** @param xcb_input_input_class_info_iterator_t *i
974 ** @returns void
975 **
976 *****************************************************************************/
977
978 void
979 xcb_input_input_class_info_next (xcb_input_input_class_info_iterator_t *i /**< */)
980 {
981 --i->rem;
982 ++i->data;
983 i->index += sizeof(xcb_input_input_class_info_t);
984 }
985
986
987 /*****************************************************************************
988 **
989 ** xcb_generic_iterator_t xcb_input_input_class_info_end
990 **
991 ** @param xcb_input_input_class_info_iterator_t i
992 ** @returns xcb_generic_iterator_t
993 **
994 *****************************************************************************/
995
996 xcb_generic_iterator_t
997 xcb_input_input_class_info_end (xcb_input_input_class_info_iterator_t i /**< */)
998 {
999 xcb_generic_iterator_t ret;
1000 ret.data = i.data + i.rem;
1001 ret.index = i.index + ((char *) ret.data - (char *) i.data);
1002 ret.rem = 0;
1003 return ret;
1004 }
1005
1006 int
1007 xcb_input_open_device_sizeof (const void *_buffer /**< */)
1008 {
1009 char *xcb_tmp = (char *)_buffer;
1010 const xcb_input_open_device_reply_t *_aux = (xcb_input_open_device_reply_t *)_buffer;
1011 unsigned int xcb_buffer_len = 0;
1012 unsigned int xcb_block_len = 0;
1013 unsigned int xcb_pad = 0;
1014 unsigned int xcb_align_to = 0;
1015
1016
1017 xcb_block_len += sizeof(xcb_input_open_device_reply_t);
1018 xcb_tmp += xcb_block_len;
1019 xcb_buffer_len += xcb_block_len;
1020 xcb_block_len = 0;
1021 /* class_info */
1022 xcb_block_len += _aux->num_classes * sizeof(xcb_input_input_class_info_t);
1023 xcb_tmp += xcb_block_len;
1024 xcb_align_to = ALIGNOF(xcb_input_input_class_info_t);
1025 /* insert padding */
1026 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1027 xcb_buffer_len += xcb_block_len + xcb_pad;
1028 if (0 != xcb_pad) {
1029 xcb_tmp += xcb_pad;
1030 xcb_pad = 0;
1031 }
1032 xcb_block_len = 0;
1033
1034 return xcb_buffer_len;
1035 }
1036
1037
1038 /*****************************************************************************
1039 **
1040 ** xcb_input_open_device_cookie_t xcb_input_open_device
1041 **
1042 ** @param xcb_connection_t *c
1043 ** @param uint8_t device_id
1044 ** @returns xcb_input_open_device_cookie_t
1045 **
1046 *****************************************************************************/
1047
1048 xcb_input_open_device_cookie_t
1049 xcb_input_open_device (xcb_connection_t *c /**< */,
1050 uint8_t device_id /**< */)
1051 {
1052 static const xcb_protocol_request_t xcb_req = {
1053 /* count */ 2,
1054 /* ext */ &xcb_input_id,
1055 /* opcode */ XCB_INPUT_OPEN_DEVICE,
1056 /* isvoid */ 0
1057 };
1058
1059 struct iovec xcb_parts[4];
1060 xcb_input_open_device_cookie_t xcb_ret;
1061 xcb_input_open_device_request_t xcb_out;
1062
1063 xcb_out.device_id = device_id;
1064 memset(xcb_out.pad0, 0, 3);
1065
1066 xcb_parts[2].iov_base = (char *) &xcb_out;
1067 xcb_parts[2].iov_len = sizeof(xcb_out);
1068 xcb_parts[3].iov_base = 0;
1069 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1070
1071 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1072 return xcb_ret;
1073 }
1074
1075
1076 /*****************************************************************************
1077 **
1078 ** xcb_input_open_device_cookie_t xcb_input_open_device_unchecked
1079 **
1080 ** @param xcb_connection_t *c
1081 ** @param uint8_t device_id
1082 ** @returns xcb_input_open_device_cookie_t
1083 **
1084 *****************************************************************************/
1085
1086 xcb_input_open_device_cookie_t
1087 xcb_input_open_device_unchecked (xcb_connection_t *c /**< */,
1088 uint8_t device_id /**< */)
1089 {
1090 static const xcb_protocol_request_t xcb_req = {
1091 /* count */ 2,
1092 /* ext */ &xcb_input_id,
1093 /* opcode */ XCB_INPUT_OPEN_DEVICE,
1094 /* isvoid */ 0
1095 };
1096
1097 struct iovec xcb_parts[4];
1098 xcb_input_open_device_cookie_t xcb_ret;
1099 xcb_input_open_device_request_t xcb_out;
1100
1101 xcb_out.device_id = device_id;
1102 memset(xcb_out.pad0, 0, 3);
1103
1104 xcb_parts[2].iov_base = (char *) &xcb_out;
1105 xcb_parts[2].iov_len = sizeof(xcb_out);
1106 xcb_parts[3].iov_base = 0;
1107 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1108
1109 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1110 return xcb_ret;
1111 }
1112
1113
1114 /*****************************************************************************
1115 **
1116 ** xcb_input_input_class_info_t * xcb_input_open_device_class_info
1117 **
1118 ** @param const xcb_input_open_device_reply_t *R
1119 ** @returns xcb_input_input_class_info_t *
1120 **
1121 *****************************************************************************/
1122
1123 xcb_input_input_class_info_t *
1124 xcb_input_open_device_class_info (const xcb_input_open_device_reply_t *R /**< */)
1125 {
1126 return (xcb_input_input_class_info_t *) (R + 1);
1127 }
1128
1129
1130 /*****************************************************************************
1131 **
1132 ** int xcb_input_open_device_class_info_length
1133 **
1134 ** @param const xcb_input_open_device_reply_t *R
1135 ** @returns int
1136 **
1137 *****************************************************************************/
1138
1139 int
1140 xcb_input_open_device_class_info_length (const xcb_input_open_device_reply_t *R /**< */)
1141 {
1142 return R->num_classes;
1143 }
1144
1145
1146 /*****************************************************************************
1147 **
1148 ** xcb_input_input_class_info_iterator_t xcb_input_open_device_class_info_iterator
1149 **
1150 ** @param const xcb_input_open_device_reply_t *R
1151 ** @returns xcb_input_input_class_info_iterator_t
1152 **
1153 *****************************************************************************/
1154
1155 xcb_input_input_class_info_iterator_t
1156 xcb_input_open_device_class_info_iterator (const xcb_input_open_device_reply_t *R /**< */)
1157 {
1158 xcb_input_input_class_info_iterator_t i;
1159 i.data = (xcb_input_input_class_info_t *) (R + 1);
1160 i.rem = R->num_classes;
1161 i.index = (char *) i.data - (char *) R;
1162 return i;
1163 }
1164
1165
1166 /*****************************************************************************
1167 **
1168 ** xcb_input_open_device_reply_t * xcb_input_open_device_reply
1169 **
1170 ** @param xcb_connection_t *c
1171 ** @param xcb_input_open_device_cookie_t cookie
1172 ** @param xcb_generic_error_t **e
1173 ** @returns xcb_input_open_device_reply_t *
1174 **
1175 *****************************************************************************/
1176
1177 xcb_input_open_device_reply_t *
1178 xcb_input_open_device_reply (xcb_connection_t *c /**< */,
1179 xcb_input_open_device_cookie_t cookie /**< */,
1180 xcb_generic_error_t **e /**< */)
1181 {
1182 return (xcb_input_open_device_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1183 }
1184
1185
1186 /*****************************************************************************
1187 **
1188 ** xcb_void_cookie_t xcb_input_close_device_checked
1189 **
1190 ** @param xcb_connection_t *c
1191 ** @param uint8_t device_id
1192 ** @returns xcb_void_cookie_t
1193 **
1194 *****************************************************************************/
1195
1196 xcb_void_cookie_t
1197 xcb_input_close_device_checked (xcb_connection_t *c /**< */,
1198 uint8_t device_id /**< */)
1199 {
1200 static const xcb_protocol_request_t xcb_req = {
1201 /* count */ 2,
1202 /* ext */ &xcb_input_id,
1203 /* opcode */ XCB_INPUT_CLOSE_DEVICE,
1204 /* isvoid */ 1
1205 };
1206
1207 struct iovec xcb_parts[4];
1208 xcb_void_cookie_t xcb_ret;
1209 xcb_input_close_device_request_t xcb_out;
1210
1211 xcb_out.device_id = device_id;
1212 memset(xcb_out.pad0, 0, 3);
1213
1214 xcb_parts[2].iov_base = (char *) &xcb_out;
1215 xcb_parts[2].iov_len = sizeof(xcb_out);
1216 xcb_parts[3].iov_base = 0;
1217 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1218
1219 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1220 return xcb_ret;
1221 }
1222
1223
1224 /*****************************************************************************
1225 **
1226 ** xcb_void_cookie_t xcb_input_close_device
1227 **
1228 ** @param xcb_connection_t *c
1229 ** @param uint8_t device_id
1230 ** @returns xcb_void_cookie_t
1231 **
1232 *****************************************************************************/
1233
1234 xcb_void_cookie_t
1235 xcb_input_close_device (xcb_connection_t *c /**< */,
1236 uint8_t device_id /**< */)
1237 {
1238 static const xcb_protocol_request_t xcb_req = {
1239 /* count */ 2,
1240 /* ext */ &xcb_input_id,
1241 /* opcode */ XCB_INPUT_CLOSE_DEVICE,
1242 /* isvoid */ 1
1243 };
1244
1245 struct iovec xcb_parts[4];
1246 xcb_void_cookie_t xcb_ret;
1247 xcb_input_close_device_request_t xcb_out;
1248
1249 xcb_out.device_id = device_id;
1250 memset(xcb_out.pad0, 0, 3);
1251
1252 xcb_parts[2].iov_base = (char *) &xcb_out;
1253 xcb_parts[2].iov_len = sizeof(xcb_out);
1254 xcb_parts[3].iov_base = 0;
1255 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1256
1257 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1258 return xcb_ret;
1259 }
1260
1261
1262 /*****************************************************************************
1263 **
1264 ** xcb_input_set_device_mode_cookie_t xcb_input_set_device_mode
1265 **
1266 ** @param xcb_connection_t *c
1267 ** @param uint8_t device_id
1268 ** @param uint8_t mode
1269 ** @returns xcb_input_set_device_mode_cookie_t
1270 **
1271 *****************************************************************************/
1272
1273 xcb_input_set_device_mode_cookie_t
1274 xcb_input_set_device_mode (xcb_connection_t *c /**< */,
1275 uint8_t device_id /**< */,
1276 uint8_t mode /**< */)
1277 {
1278 static const xcb_protocol_request_t xcb_req = {
1279 /* count */ 2,
1280 /* ext */ &xcb_input_id,
1281 /* opcode */ XCB_INPUT_SET_DEVICE_MODE,
1282 /* isvoid */ 0
1283 };
1284
1285 struct iovec xcb_parts[4];
1286 xcb_input_set_device_mode_cookie_t xcb_ret;
1287 xcb_input_set_device_mode_request_t xcb_out;
1288
1289 xcb_out.device_id = device_id;
1290 xcb_out.mode = mode;
1291 memset(xcb_out.pad0, 0, 2);
1292
1293 xcb_parts[2].iov_base = (char *) &xcb_out;
1294 xcb_parts[2].iov_len = sizeof(xcb_out);
1295 xcb_parts[3].iov_base = 0;
1296 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1297
1298 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1299 return xcb_ret;
1300 }
1301
1302
1303 /*****************************************************************************
1304 **
1305 ** xcb_input_set_device_mode_cookie_t xcb_input_set_device_mode_unchecked
1306 **
1307 ** @param xcb_connection_t *c
1308 ** @param uint8_t device_id
1309 ** @param uint8_t mode
1310 ** @returns xcb_input_set_device_mode_cookie_t
1311 **
1312 *****************************************************************************/
1313
1314 xcb_input_set_device_mode_cookie_t
1315 xcb_input_set_device_mode_unchecked (xcb_connection_t *c /**< */,
1316 uint8_t device_id /**< */,
1317 uint8_t mode /**< */)
1318 {
1319 static const xcb_protocol_request_t xcb_req = {
1320 /* count */ 2,
1321 /* ext */ &xcb_input_id,
1322 /* opcode */ XCB_INPUT_SET_DEVICE_MODE,
1323 /* isvoid */ 0
1324 };
1325
1326 struct iovec xcb_parts[4];
1327 xcb_input_set_device_mode_cookie_t xcb_ret;
1328 xcb_input_set_device_mode_request_t xcb_out;
1329
1330 xcb_out.device_id = device_id;
1331 xcb_out.mode = mode;
1332 memset(xcb_out.pad0, 0, 2);
1333
1334 xcb_parts[2].iov_base = (char *) &xcb_out;
1335 xcb_parts[2].iov_len = sizeof(xcb_out);
1336 xcb_parts[3].iov_base = 0;
1337 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1338
1339 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1340 return xcb_ret;
1341 }
1342
1343
1344 /*****************************************************************************
1345 **
1346 ** xcb_input_set_device_mode_reply_t * xcb_input_set_device_mode_reply
1347 **
1348 ** @param xcb_connection_t *c
1349 ** @param xcb_input_set_device_mode_cookie_t cookie
1350 ** @param xcb_generic_error_t **e
1351 ** @returns xcb_input_set_device_mode_reply_t *
1352 **
1353 *****************************************************************************/
1354
1355 xcb_input_set_device_mode_reply_t *
1356 xcb_input_set_device_mode_reply (xcb_connection_t *c /**< */,
1357 xcb_input_set_device_mode_cookie_t cookie /**< */,
1358 xcb_generic_error_t **e /**< */)
1359 {
1360 return (xcb_input_set_device_mode_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1361 }
1362
1363 int
1364 xcb_input_select_extension_event_sizeof (const void *_buffer /**< */)
1365 {
1366 char *xcb_tmp = (char *)_buffer;
1367 const xcb_input_select_extension_event_request_t *_aux = (xcb_input_select_extension_event_request_t *)_buffer;
1368 unsigned int xcb_buffer_len = 0;
1369 unsigned int xcb_block_len = 0;
1370 unsigned int xcb_pad = 0;
1371 unsigned int xcb_align_to = 0;
1372
1373
1374 xcb_block_len += sizeof(xcb_input_select_extension_event_request_t);
1375 xcb_tmp += xcb_block_len;
1376 xcb_buffer_len += xcb_block_len;
1377 xcb_block_len = 0;
1378 /* classes */
1379 xcb_block_len += _aux->num_classes * sizeof(xcb_input_event_class_t);
1380 xcb_tmp += xcb_block_len;
1381 xcb_align_to = ALIGNOF(xcb_input_event_class_t);
1382 /* insert padding */
1383 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1384 xcb_buffer_len += xcb_block_len + xcb_pad;
1385 if (0 != xcb_pad) {
1386 xcb_tmp += xcb_pad;
1387 xcb_pad = 0;
1388 }
1389 xcb_block_len = 0;
1390
1391 return xcb_buffer_len;
1392 }
1393
1394
1395 /*****************************************************************************
1396 **
1397 ** xcb_void_cookie_t xcb_input_select_extension_event_checked
1398 **
1399 ** @param xcb_connection_t *c
1400 ** @param xcb_window_t window
1401 ** @param uint16_t num_classes
1402 ** @param const xcb_input_event_class_t *classes
1403 ** @returns xcb_void_cookie_t
1404 **
1405 *****************************************************************************/
1406
1407 xcb_void_cookie_t
1408 xcb_input_select_extension_event_checked (xcb_connection_t *c /**< */,
1409 xcb_window_t window /**< */,
1410 uint16_t num_classes /**< */,
1411 const xcb_input_event_class_t *classes /**< */)
1412 {
1413 static const xcb_protocol_request_t xcb_req = {
1414 /* count */ 4,
1415 /* ext */ &xcb_input_id,
1416 /* opcode */ XCB_INPUT_SELECT_EXTENSION_EVENT,
1417 /* isvoid */ 1
1418 };
1419
1420 struct iovec xcb_parts[6];
1421 xcb_void_cookie_t xcb_ret;
1422 xcb_input_select_extension_event_request_t xcb_out;
1423
1424 xcb_out.window = window;
1425 xcb_out.num_classes = num_classes;
1426 memset(xcb_out.pad0, 0, 2);
1427
1428 xcb_parts[2].iov_base = (char *) &xcb_out;
1429 xcb_parts[2].iov_len = sizeof(xcb_out);
1430 xcb_parts[3].iov_base = 0;
1431 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1432 /* xcb_input_event_class_t classes */
1433 xcb_parts[4].iov_base = (char *) classes;
1434 xcb_parts[4].iov_len = num_classes * sizeof(xcb_input_event_class_t);
1435 xcb_parts[5].iov_base = 0;
1436 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1437
1438 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1439 return xcb_ret;
1440 }
1441
1442
1443 /*****************************************************************************
1444 **
1445 ** xcb_void_cookie_t xcb_input_select_extension_event
1446 **
1447 ** @param xcb_connection_t *c
1448 ** @param xcb_window_t window
1449 ** @param uint16_t num_classes
1450 ** @param const xcb_input_event_class_t *classes
1451 ** @returns xcb_void_cookie_t
1452 **
1453 *****************************************************************************/
1454
1455 xcb_void_cookie_t
1456 xcb_input_select_extension_event (xcb_connection_t *c /**< */,
1457 xcb_window_t window /**< */,
1458 uint16_t num_classes /**< */,
1459 const xcb_input_event_class_t *classes /**< */)
1460 {
1461 static const xcb_protocol_request_t xcb_req = {
1462 /* count */ 4,
1463 /* ext */ &xcb_input_id,
1464 /* opcode */ XCB_INPUT_SELECT_EXTENSION_EVENT,
1465 /* isvoid */ 1
1466 };
1467
1468 struct iovec xcb_parts[6];
1469 xcb_void_cookie_t xcb_ret;
1470 xcb_input_select_extension_event_request_t xcb_out;
1471
1472 xcb_out.window = window;
1473 xcb_out.num_classes = num_classes;
1474 memset(xcb_out.pad0, 0, 2);
1475
1476 xcb_parts[2].iov_base = (char *) &xcb_out;
1477 xcb_parts[2].iov_len = sizeof(xcb_out);
1478 xcb_parts[3].iov_base = 0;
1479 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1480 /* xcb_input_event_class_t classes */
1481 xcb_parts[4].iov_base = (char *) classes;
1482 xcb_parts[4].iov_len = num_classes * sizeof(xcb_input_event_class_t);
1483 xcb_parts[5].iov_base = 0;
1484 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1485
1486 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1487 return xcb_ret;
1488 }
1489
1490 int
1491 xcb_input_get_selected_extension_events_sizeof (const void *_buffer /**< */)
1492 {
1493 char *xcb_tmp = (char *)_buffer;
1494 const xcb_input_get_selected_extension_events_reply_t *_aux = (xcb_input_get_selected_extension_events_reply_t *)_buffer;
1495 unsigned int xcb_buffer_len = 0;
1496 unsigned int xcb_block_len = 0;
1497 unsigned int xcb_pad = 0;
1498 unsigned int xcb_align_to = 0;
1499
1500
1501 xcb_block_len += sizeof(xcb_input_get_selected_extension_events_reply_t);
1502 xcb_tmp += xcb_block_len;
1503 xcb_buffer_len += xcb_block_len;
1504 xcb_block_len = 0;
1505 /* this_classes */
1506 xcb_block_len += _aux->num_this_classes * sizeof(xcb_input_event_class_t);
1507 xcb_tmp += xcb_block_len;
1508 xcb_align_to = ALIGNOF(xcb_input_event_class_t);
1509 /* insert padding */
1510 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1511 xcb_buffer_len += xcb_block_len + xcb_pad;
1512 if (0 != xcb_pad) {
1513 xcb_tmp += xcb_pad;
1514 xcb_pad = 0;
1515 }
1516 xcb_block_len = 0;
1517 /* all_classes */
1518 xcb_block_len += _aux->num_all_classes * sizeof(xcb_input_event_class_t);
1519 xcb_tmp += xcb_block_len;
1520 xcb_align_to = ALIGNOF(xcb_input_event_class_t);
1521 /* insert padding */
1522 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1523 xcb_buffer_len += xcb_block_len + xcb_pad;
1524 if (0 != xcb_pad) {
1525 xcb_tmp += xcb_pad;
1526 xcb_pad = 0;
1527 }
1528 xcb_block_len = 0;
1529
1530 return xcb_buffer_len;
1531 }
1532
1533
1534 /*****************************************************************************
1535 **
1536 ** xcb_input_get_selected_extension_events_cookie_t xcb_input_get_selected_extension_events
1537 **
1538 ** @param xcb_connection_t *c
1539 ** @param xcb_window_t window
1540 ** @returns xcb_input_get_selected_extension_events_cookie_t
1541 **
1542 *****************************************************************************/
1543
1544 xcb_input_get_selected_extension_events_cookie_t
1545 xcb_input_get_selected_extension_events (xcb_connection_t *c /**< */,
1546 xcb_window_t window /**< */)
1547 {
1548 static const xcb_protocol_request_t xcb_req = {
1549 /* count */ 2,
1550 /* ext */ &xcb_input_id,
1551 /* opcode */ XCB_INPUT_GET_SELECTED_EXTENSION_EVENTS,
1552 /* isvoid */ 0
1553 };
1554
1555 struct iovec xcb_parts[4];
1556 xcb_input_get_selected_extension_events_cookie_t xcb_ret;
1557 xcb_input_get_selected_extension_events_request_t xcb_out;
1558
1559 xcb_out.window = window;
1560
1561 xcb_parts[2].iov_base = (char *) &xcb_out;
1562 xcb_parts[2].iov_len = sizeof(xcb_out);
1563 xcb_parts[3].iov_base = 0;
1564 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1565
1566 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1567 return xcb_ret;
1568 }
1569
1570
1571 /*****************************************************************************
1572 **
1573 ** xcb_input_get_selected_extension_events_cookie_t xcb_input_get_selected_extension_events_unchecked
1574 **
1575 ** @param xcb_connection_t *c
1576 ** @param xcb_window_t window
1577 ** @returns xcb_input_get_selected_extension_events_cookie_t
1578 **
1579 *****************************************************************************/
1580
1581 xcb_input_get_selected_extension_events_cookie_t
1582 xcb_input_get_selected_extension_events_unchecked (xcb_connection_t *c /**< */,
1583 xcb_window_t window /**< */)
1584 {
1585 static const xcb_protocol_request_t xcb_req = {
1586 /* count */ 2,
1587 /* ext */ &xcb_input_id,
1588 /* opcode */ XCB_INPUT_GET_SELECTED_EXTENSION_EVENTS,
1589 /* isvoid */ 0
1590 };
1591
1592 struct iovec xcb_parts[4];
1593 xcb_input_get_selected_extension_events_cookie_t xcb_ret;
1594 xcb_input_get_selected_extension_events_request_t xcb_out;
1595
1596 xcb_out.window = window;
1597
1598 xcb_parts[2].iov_base = (char *) &xcb_out;
1599 xcb_parts[2].iov_len = sizeof(xcb_out);
1600 xcb_parts[3].iov_base = 0;
1601 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1602
1603 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1604 return xcb_ret;
1605 }
1606
1607
1608 /*****************************************************************************
1609 **
1610 ** xcb_input_event_class_t * xcb_input_get_selected_extension_events_this_classes
1611 **
1612 ** @param const xcb_input_get_selected_extension_events_reply_t *R
1613 ** @returns xcb_input_event_class_t *
1614 **
1615 *****************************************************************************/
1616
1617 xcb_input_event_class_t *
1618 xcb_input_get_selected_extension_events_this_classes (const xcb_input_get_selected_extension_events_reply_t *R /**< */)
1619 {
1620 return (xcb_input_event_class_t *) (R + 1);
1621 }
1622
1623
1624 /*****************************************************************************
1625 **
1626 ** int xcb_input_get_selected_extension_events_this_classes_length
1627 **
1628 ** @param const xcb_input_get_selected_extension_events_reply_t *R
1629 ** @returns int
1630 **
1631 *****************************************************************************/
1632
1633 int
1634 xcb_input_get_selected_extension_events_this_classes_length (const xcb_input_get_selected_extension_events_reply_t *R /**< */)
1635 {
1636 return R->num_this_classes;
1637 }
1638
1639
1640 /*****************************************************************************
1641 **
1642 ** xcb_generic_iterator_t xcb_input_get_selected_extension_events_this_classes_end
1643 **
1644 ** @param const xcb_input_get_selected_extension_events_reply_t *R
1645 ** @returns xcb_generic_iterator_t
1646 **
1647 *****************************************************************************/
1648
1649 xcb_generic_iterator_t
1650 xcb_input_get_selected_extension_events_this_classes_end (const xcb_input_get_selected_extension_events_reply_t *R /**< */)
1651 {
1652 xcb_generic_iterator_t i;
1653 i.data = ((xcb_input_event_class_t *) (R + 1)) + (R->num_this_classes);
1654 i.rem = 0;
1655 i.index = (char *) i.data - (char *) R;
1656 return i;
1657 }
1658
1659
1660 /*****************************************************************************
1661 **
1662 ** xcb_input_event_class_t * xcb_input_get_selected_extension_events_all_classes
1663 **
1664 ** @param const xcb_input_get_selected_extension_events_reply_t *R
1665 ** @returns xcb_input_event_class_t *
1666 **
1667 *****************************************************************************/
1668
1669 xcb_input_event_class_t *
1670 xcb_input_get_selected_extension_events_all_classes (const xcb_input_get_selected_extension_events_reply_t *R /**< */)
1671 {
1672 xcb_generic_iterator_t prev = xcb_input_get_selected_extension_events_this_classes_end(R);
1673 return (xcb_input_event_class_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_input_event_class_t, prev.index) + 0);
1674 }
1675
1676
1677 /*****************************************************************************
1678 **
1679 ** int xcb_input_get_selected_extension_events_all_classes_length
1680 **
1681 ** @param const xcb_input_get_selected_extension_events_reply_t *R
1682 ** @returns int
1683 **
1684 *****************************************************************************/
1685
1686 int
1687 xcb_input_get_selected_extension_events_all_classes_length (const xcb_input_get_selected_extension_events_reply_t *R /**< */)
1688 {
1689 return R->num_all_classes;
1690 }
1691
1692
1693 /*****************************************************************************
1694 **
1695 ** xcb_generic_iterator_t xcb_input_get_selected_extension_events_all_classes_end
1696 **
1697 ** @param const xcb_input_get_selected_extension_events_reply_t *R
1698 ** @returns xcb_generic_iterator_t
1699 **
1700 *****************************************************************************/
1701
1702 xcb_generic_iterator_t
1703 xcb_input_get_selected_extension_events_all_classes_end (const xcb_input_get_selected_extension_events_reply_t *R /**< */)
1704 {
1705 xcb_generic_iterator_t i;
1706 xcb_generic_iterator_t child = xcb_input_get_selected_extension_events_this_classes_end(R);
1707 i.data = ((xcb_input_event_class_t *) child.data) + (R->num_all_classes);
1708 i.rem = 0;
1709 i.index = (char *) i.data - (char *) R;
1710 return i;
1711 }
1712
1713
1714 /*****************************************************************************
1715 **
1716 ** xcb_input_get_selected_extension_events_reply_t * xcb_input_get_selected_extension_events_reply
1717 **
1718 ** @param xcb_connection_t *c
1719 ** @param xcb_input_get_selected_extension_events_cookie_t cookie
1720 ** @param xcb_generic_error_t **e
1721 ** @returns xcb_input_get_selected_extension_events_reply_t *
1722 **
1723 *****************************************************************************/
1724
1725 xcb_input_get_selected_extension_events_reply_t *
1726 xcb_input_get_selected_extension_events_reply (xcb_connection_t *c /**< */,
1727 xcb_input_get_selected_extension_events_cookie_t cookie /**< */,
1728 xcb_generic_error_t **e /**< */)
1729 {
1730 return (xcb_input_get_selected_extension_events_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1731 }
1732
1733 int
1734 xcb_input_change_device_dont_propagate_list_sizeof (const void *_buffer /**< */)
1735 {
1736 char *xcb_tmp = (char *)_buffer;
1737 const xcb_input_change_device_dont_propagate_list_request_t *_aux = (xcb_input_change_device_dont_propagate_list_request_t *)_buffer;
1738 unsigned int xcb_buffer_len = 0;
1739 unsigned int xcb_block_len = 0;
1740 unsigned int xcb_pad = 0;
1741 unsigned int xcb_align_to = 0;
1742
1743
1744 xcb_block_len += sizeof(xcb_input_change_device_dont_propagate_list_request_t);
1745 xcb_tmp += xcb_block_len;
1746 xcb_buffer_len += xcb_block_len;
1747 xcb_block_len = 0;
1748 /* classes */
1749 xcb_block_len += _aux->num_classes * sizeof(xcb_input_event_class_t);
1750 xcb_tmp += xcb_block_len;
1751 xcb_align_to = ALIGNOF(xcb_input_event_class_t);
1752 /* insert padding */
1753 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1754 xcb_buffer_len += xcb_block_len + xcb_pad;
1755 if (0 != xcb_pad) {
1756 xcb_tmp += xcb_pad;
1757 xcb_pad = 0;
1758 }
1759 xcb_block_len = 0;
1760
1761 return xcb_buffer_len;
1762 }
1763
1764
1765 /*****************************************************************************
1766 **
1767 ** xcb_void_cookie_t xcb_input_change_device_dont_propagate_list_checked
1768 **
1769 ** @param xcb_connection_t *c
1770 ** @param xcb_window_t window
1771 ** @param uint16_t num_classes
1772 ** @param uint8_t mode
1773 ** @param const xcb_input_event_class_t *classes
1774 ** @returns xcb_void_cookie_t
1775 **
1776 *****************************************************************************/
1777
1778 xcb_void_cookie_t
1779 xcb_input_change_device_dont_propagate_list_checked (xcb_connection_t *c /**< */,
1780 xcb_window_t window /**< */,
1781 uint16_t num_classes /**< */,
1782 uint8_t mode /**< */,
1783 const xcb_input_event_class_t *classes /**< */)
1784 {
1785 static const xcb_protocol_request_t xcb_req = {
1786 /* count */ 4,
1787 /* ext */ &xcb_input_id,
1788 /* opcode */ XCB_INPUT_CHANGE_DEVICE_DONT_PROPAGATE_LIST,
1789 /* isvoid */ 1
1790 };
1791
1792 struct iovec xcb_parts[6];
1793 xcb_void_cookie_t xcb_ret;
1794 xcb_input_change_device_dont_propagate_list_request_t xcb_out;
1795
1796 xcb_out.window = window;
1797 xcb_out.num_classes = num_classes;
1798 xcb_out.mode = mode;
1799 xcb_out.pad0 = 0;
1800
1801 xcb_parts[2].iov_base = (char *) &xcb_out;
1802 xcb_parts[2].iov_len = sizeof(xcb_out);
1803 xcb_parts[3].iov_base = 0;
1804 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1805 /* xcb_input_event_class_t classes */
1806 xcb_parts[4].iov_base = (char *) classes;
1807 xcb_parts[4].iov_len = num_classes * sizeof(xcb_input_event_class_t);
1808 xcb_parts[5].iov_base = 0;
1809 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1810
1811 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1812 return xcb_ret;
1813 }
1814
1815
1816 /*****************************************************************************
1817 **
1818 ** xcb_void_cookie_t xcb_input_change_device_dont_propagate_list
1819 **
1820 ** @param xcb_connection_t *c
1821 ** @param xcb_window_t window
1822 ** @param uint16_t num_classes
1823 ** @param uint8_t mode
1824 ** @param const xcb_input_event_class_t *classes
1825 ** @returns xcb_void_cookie_t
1826 **
1827 *****************************************************************************/
1828
1829 xcb_void_cookie_t
1830 xcb_input_change_device_dont_propagate_list (xcb_connection_t *c /**< */,
1831 xcb_window_t window /**< */,
1832 uint16_t num_classes /**< */,
1833 uint8_t mode /**< */,
1834 const xcb_input_event_class_t *classes /**< */)
1835 {
1836 static const xcb_protocol_request_t xcb_req = {
1837 /* count */ 4,
1838 /* ext */ &xcb_input_id,
1839 /* opcode */ XCB_INPUT_CHANGE_DEVICE_DONT_PROPAGATE_LIST,
1840 /* isvoid */ 1
1841 };
1842
1843 struct iovec xcb_parts[6];
1844 xcb_void_cookie_t xcb_ret;
1845 xcb_input_change_device_dont_propagate_list_request_t xcb_out;
1846
1847 xcb_out.window = window;
1848 xcb_out.num_classes = num_classes;
1849 xcb_out.mode = mode;
1850 xcb_out.pad0 = 0;
1851
1852 xcb_parts[2].iov_base = (char *) &xcb_out;
1853 xcb_parts[2].iov_len = sizeof(xcb_out);
1854 xcb_parts[3].iov_base = 0;
1855 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1856 /* xcb_input_event_class_t classes */
1857 xcb_parts[4].iov_base = (char *) classes;
1858 xcb_parts[4].iov_len = num_classes * sizeof(xcb_input_event_class_t);
1859 xcb_parts[5].iov_base = 0;
1860 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1861
1862 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1863 return xcb_ret;
1864 }
1865
1866 int
1867 xcb_input_get_device_dont_propagate_list_sizeof (const void *_buffer /**< */)
1868 {
1869 char *xcb_tmp = (char *)_buffer;
1870 const xcb_input_get_device_dont_propagate_list_reply_t *_aux = (xcb_input_get_device_dont_propagate_list_reply_t *)_buffer;
1871 unsigned int xcb_buffer_len = 0;
1872 unsigned int xcb_block_len = 0;
1873 unsigned int xcb_pad = 0;
1874 unsigned int xcb_align_to = 0;
1875
1876
1877 xcb_block_len += sizeof(xcb_input_get_device_dont_propagate_list_reply_t);
1878 xcb_tmp += xcb_block_len;
1879 xcb_buffer_len += xcb_block_len;
1880 xcb_block_len = 0;
1881 /* classes */
1882 xcb_block_len += _aux->num_classes * sizeof(xcb_input_event_class_t);
1883 xcb_tmp += xcb_block_len;
1884 xcb_align_to = ALIGNOF(xcb_input_event_class_t);
1885 /* insert padding */
1886 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1887 xcb_buffer_len += xcb_block_len + xcb_pad;
1888 if (0 != xcb_pad) {
1889 xcb_tmp += xcb_pad;
1890 xcb_pad = 0;
1891 }
1892 xcb_block_len = 0;
1893
1894 return xcb_buffer_len;
1895 }
1896
1897
1898 /*****************************************************************************
1899 **
1900 ** xcb_input_get_device_dont_propagate_list_cookie_t xcb_input_get_device_dont_propagate_list
1901 **
1902 ** @param xcb_connection_t *c
1903 ** @param xcb_window_t window
1904 ** @returns xcb_input_get_device_dont_propagate_list_cookie_t
1905 **
1906 *****************************************************************************/
1907
1908 xcb_input_get_device_dont_propagate_list_cookie_t
1909 xcb_input_get_device_dont_propagate_list (xcb_connection_t *c /**< */,
1910 xcb_window_t window /**< */)
1911 {
1912 static const xcb_protocol_request_t xcb_req = {
1913 /* count */ 2,
1914 /* ext */ &xcb_input_id,
1915 /* opcode */ XCB_INPUT_GET_DEVICE_DONT_PROPAGATE_LIST,
1916 /* isvoid */ 0
1917 };
1918
1919 struct iovec xcb_parts[4];
1920 xcb_input_get_device_dont_propagate_list_cookie_t xcb_ret;
1921 xcb_input_get_device_dont_propagate_list_request_t xcb_out;
1922
1923 xcb_out.window = window;
1924
1925 xcb_parts[2].iov_base = (char *) &xcb_out;
1926 xcb_parts[2].iov_len = sizeof(xcb_out);
1927 xcb_parts[3].iov_base = 0;
1928 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1929
1930 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1931 return xcb_ret;
1932 }
1933
1934
1935 /*****************************************************************************
1936 **
1937 ** xcb_input_get_device_dont_propagate_list_cookie_t xcb_input_get_device_dont_propagate_list_unchecked
1938 **
1939 ** @param xcb_connection_t *c
1940 ** @param xcb_window_t window
1941 ** @returns xcb_input_get_device_dont_propagate_list_cookie_t
1942 **
1943 *****************************************************************************/
1944
1945 xcb_input_get_device_dont_propagate_list_cookie_t
1946 xcb_input_get_device_dont_propagate_list_unchecked (xcb_connection_t *c /**< */,
1947 xcb_window_t window /**< */)
1948 {
1949 static const xcb_protocol_request_t xcb_req = {
1950 /* count */ 2,
1951 /* ext */ &xcb_input_id,
1952 /* opcode */ XCB_INPUT_GET_DEVICE_DONT_PROPAGATE_LIST,
1953 /* isvoid */ 0
1954 };
1955
1956 struct iovec xcb_parts[4];
1957 xcb_input_get_device_dont_propagate_list_cookie_t xcb_ret;
1958 xcb_input_get_device_dont_propagate_list_request_t xcb_out;
1959
1960 xcb_out.window = window;
1961
1962 xcb_parts[2].iov_base = (char *) &xcb_out;
1963 xcb_parts[2].iov_len = sizeof(xcb_out);
1964 xcb_parts[3].iov_base = 0;
1965 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1966
1967 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1968 return xcb_ret;
1969 }
1970
1971
1972 /*****************************************************************************
1973 **
1974 ** xcb_input_event_class_t * xcb_input_get_device_dont_propagate_list_classes
1975 **
1976 ** @param const xcb_input_get_device_dont_propagate_list_reply_t *R
1977 ** @returns xcb_input_event_class_t *
1978 **
1979 *****************************************************************************/
1980
1981 xcb_input_event_class_t *
1982 xcb_input_get_device_dont_propagate_list_classes (const xcb_input_get_device_dont_propagate_list_reply_t *R /**< */)
1983 {
1984 return (xcb_input_event_class_t *) (R + 1);
1985 }
1986
1987
1988 /*****************************************************************************
1989 **
1990 ** int xcb_input_get_device_dont_propagate_list_classes_length
1991 **
1992 ** @param const xcb_input_get_device_dont_propagate_list_reply_t *R
1993 ** @returns int
1994 **
1995 *****************************************************************************/
1996
1997 int
1998 xcb_input_get_device_dont_propagate_list_classes_length (const xcb_input_get_device_dont_propagate_list_reply_t *R /**< */)
1999 {
2000 return R->num_classes;
2001 }
2002
2003
2004 /*****************************************************************************
2005 **
2006 ** xcb_generic_iterator_t xcb_input_get_device_dont_propagate_list_classes_end
2007 **
2008 ** @param const xcb_input_get_device_dont_propagate_list_reply_t *R
2009 ** @returns xcb_generic_iterator_t
2010 **
2011 *****************************************************************************/
2012
2013 xcb_generic_iterator_t
2014 xcb_input_get_device_dont_propagate_list_classes_end (const xcb_input_get_device_dont_propagate_list_reply_t *R /**< */)
2015 {
2016 xcb_generic_iterator_t i;
2017 i.data = ((xcb_input_event_class_t *) (R + 1)) + (R->num_classes);
2018 i.rem = 0;
2019 i.index = (char *) i.data - (char *) R;
2020 return i;
2021 }
2022
2023
2024 /*****************************************************************************
2025 **
2026 ** xcb_input_get_device_dont_propagate_list_reply_t * xcb_input_get_device_dont_propagate_list_reply
2027 **
2028 ** @param xcb_connection_t *c
2029 ** @param xcb_input_get_device_dont_propagate_list_cookie_t cookie
2030 ** @param xcb_generic_error_t **e
2031 ** @returns xcb_input_get_device_dont_propagate_list_reply_t *
2032 **
2033 *****************************************************************************/
2034
2035 xcb_input_get_device_dont_propagate_list_reply_t *
2036 xcb_input_get_device_dont_propagate_list_reply (xcb_connection_t *c /**< */,
2037 xcb_input_get_device_dont_propagate_list_cookie_t cookie /**< */,
2038 xcb_generic_error_t **e /**< */)
2039 {
2040 return (xcb_input_get_device_dont_propagate_list_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
2041 }
2042
2043
2044 /*****************************************************************************
2045 **
2046 ** void xcb_input_device_time_coord_next
2047 **
2048 ** @param xcb_input_device_time_coord_iterator_t *i
2049 ** @returns void
2050 **
2051 *****************************************************************************/
2052
2053 void
2054 xcb_input_device_time_coord_next (xcb_input_device_time_coord_iterator_t *i /**< */)
2055 {
2056 --i->rem;
2057 ++i->data;
2058 i->index += sizeof(xcb_input_device_time_coord_t);
2059 }
2060
2061
2062 /*****************************************************************************
2063 **
2064 ** xcb_generic_iterator_t xcb_input_device_time_coord_end
2065 **
2066 ** @param xcb_input_device_time_coord_iterator_t i
2067 ** @returns xcb_generic_iterator_t
2068 **
2069 *****************************************************************************/
2070
2071 xcb_generic_iterator_t
2072 xcb_input_device_time_coord_end (xcb_input_device_time_coord_iterator_t i /**< */)
2073 {
2074 xcb_generic_iterator_t ret;
2075 ret.data = i.data + i.rem;
2076 ret.index = i.index + ((char *) ret.data - (char *) i.data);
2077 ret.rem = 0;
2078 return ret;
2079 }
2080
2081
2082 /*****************************************************************************
2083 **
2084 ** xcb_input_get_device_motion_events_cookie_t xcb_input_get_device_motion_events
2085 **
2086 ** @param xcb_connection_t *c
2087 ** @param xcb_timestamp_t start
2088 ** @param xcb_timestamp_t stop
2089 ** @param uint8_t device_id
2090 ** @returns xcb_input_get_device_motion_events_cookie_t
2091 **
2092 *****************************************************************************/
2093
2094 xcb_input_get_device_motion_events_cookie_t
2095 xcb_input_get_device_motion_events (xcb_connection_t *c /**< */,
2096 xcb_timestamp_t start /**< */,
2097 xcb_timestamp_t stop /**< */,
2098 uint8_t device_id /**< */)
2099 {
2100 static const xcb_protocol_request_t xcb_req = {
2101 /* count */ 2,
2102 /* ext */ &xcb_input_id,
2103 /* opcode */ XCB_INPUT_GET_DEVICE_MOTION_EVENTS,
2104 /* isvoid */ 0
2105 };
2106
2107 struct iovec xcb_parts[4];
2108 xcb_input_get_device_motion_events_cookie_t xcb_ret;
2109 xcb_input_get_device_motion_events_request_t xcb_out;
2110
2111 xcb_out.start = start;
2112 xcb_out.stop = stop;
2113 xcb_out.device_id = device_id;
2114
2115 xcb_parts[2].iov_base = (char *) &xcb_out;
2116 xcb_parts[2].iov_len = sizeof(xcb_out);
2117 xcb_parts[3].iov_base = 0;
2118 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2119
2120 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2121 return xcb_ret;
2122 }
2123
2124
2125 /*****************************************************************************
2126 **
2127 ** xcb_input_get_device_motion_events_cookie_t xcb_input_get_device_motion_events_unchecked
2128 **
2129 ** @param xcb_connection_t *c
2130 ** @param xcb_timestamp_t start
2131 ** @param xcb_timestamp_t stop
2132 ** @param uint8_t device_id
2133 ** @returns xcb_input_get_device_motion_events_cookie_t
2134 **
2135 *****************************************************************************/
2136
2137 xcb_input_get_device_motion_events_cookie_t
2138 xcb_input_get_device_motion_events_unchecked (xcb_connection_t *c /**< */,
2139 xcb_timestamp_t start /**< */,
2140 xcb_timestamp_t stop /**< */,
2141 uint8_t device_id /**< */)
2142 {
2143 static const xcb_protocol_request_t xcb_req = {
2144 /* count */ 2,
2145 /* ext */ &xcb_input_id,
2146 /* opcode */ XCB_INPUT_GET_DEVICE_MOTION_EVENTS,
2147 /* isvoid */ 0
2148 };
2149
2150 struct iovec xcb_parts[4];
2151 xcb_input_get_device_motion_events_cookie_t xcb_ret;
2152 xcb_input_get_device_motion_events_request_t xcb_out;
2153
2154 xcb_out.start = start;
2155 xcb_out.stop = stop;
2156 xcb_out.device_id = device_id;
2157
2158 xcb_parts[2].iov_base = (char *) &xcb_out;
2159 xcb_parts[2].iov_len = sizeof(xcb_out);
2160 xcb_parts[3].iov_base = 0;
2161 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2162
2163 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2164 return xcb_ret;
2165 }
2166
2167
2168 /*****************************************************************************
2169 **
2170 ** xcb_input_get_device_motion_events_reply_t * xcb_input_get_device_motion_events_reply
2171 **
2172 ** @param xcb_connection_t *c
2173 ** @param xcb_input_get_device_motion_events_cookie_t cookie
2174 ** @param xcb_generic_error_t **e
2175 ** @returns xcb_input_get_device_motion_events_reply_t *
2176 **
2177 *****************************************************************************/
2178
2179 xcb_input_get_device_motion_events_reply_t *
2180 xcb_input_get_device_motion_events_reply (xcb_connection_t *c /**< */,
2181 xcb_input_get_device_motion_events_cookie_t cookie /**< */,
2182 xcb_generic_error_t **e /**< */)
2183 {
2184 return (xcb_input_get_device_motion_events_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
2185 }
2186
2187
2188 /*****************************************************************************
2189 **
2190 ** xcb_input_change_keyboard_device_cookie_t xcb_input_change_keyboard_device
2191 **
2192 ** @param xcb_connection_t *c
2193 ** @param uint8_t device_id
2194 ** @returns xcb_input_change_keyboard_device_cookie_t
2195 **
2196 *****************************************************************************/
2197
2198 xcb_input_change_keyboard_device_cookie_t
2199 xcb_input_change_keyboard_device (xcb_connection_t *c /**< */,
2200 uint8_t device_id /**< */)
2201 {
2202 static const xcb_protocol_request_t xcb_req = {
2203 /* count */ 2,
2204 /* ext */ &xcb_input_id,
2205 /* opcode */ XCB_INPUT_CHANGE_KEYBOARD_DEVICE,
2206 /* isvoid */ 0
2207 };
2208
2209 struct iovec xcb_parts[4];
2210 xcb_input_change_keyboard_device_cookie_t xcb_ret;
2211 xcb_input_change_keyboard_device_request_t xcb_out;
2212
2213 xcb_out.device_id = device_id;
2214 memset(xcb_out.pad0, 0, 3);
2215
2216 xcb_parts[2].iov_base = (char *) &xcb_out;
2217 xcb_parts[2].iov_len = sizeof(xcb_out);
2218 xcb_parts[3].iov_base = 0;
2219 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2220
2221 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2222 return xcb_ret;
2223 }
2224
2225
2226 /*****************************************************************************
2227 **
2228 ** xcb_input_change_keyboard_device_cookie_t xcb_input_change_keyboard_device_unchecked
2229 **
2230 ** @param xcb_connection_t *c
2231 ** @param uint8_t device_id
2232 ** @returns xcb_input_change_keyboard_device_cookie_t
2233 **
2234 *****************************************************************************/
2235
2236 xcb_input_change_keyboard_device_cookie_t
2237 xcb_input_change_keyboard_device_unchecked (xcb_connection_t *c /**< */,
2238 uint8_t device_id /**< */)
2239 {
2240 static const xcb_protocol_request_t xcb_req = {
2241 /* count */ 2,
2242 /* ext */ &xcb_input_id,
2243 /* opcode */ XCB_INPUT_CHANGE_KEYBOARD_DEVICE,
2244 /* isvoid */ 0
2245 };
2246
2247 struct iovec xcb_parts[4];
2248 xcb_input_change_keyboard_device_cookie_t xcb_ret;
2249 xcb_input_change_keyboard_device_request_t xcb_out;
2250
2251 xcb_out.device_id = device_id;
2252 memset(xcb_out.pad0, 0, 3);
2253
2254 xcb_parts[2].iov_base = (char *) &xcb_out;
2255 xcb_parts[2].iov_len = sizeof(xcb_out);
2256 xcb_parts[3].iov_base = 0;
2257 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2258
2259 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2260 return xcb_ret;
2261 }
2262
2263
2264 /*****************************************************************************
2265 **
2266 ** xcb_input_change_keyboard_device_reply_t * xcb_input_change_keyboard_device_reply
2267 **
2268 ** @param xcb_connection_t *c
2269 ** @param xcb_input_change_keyboard_device_cookie_t cookie
2270 ** @param xcb_generic_error_t **e
2271 ** @returns xcb_input_change_keyboard_device_reply_t *
2272 **
2273 *****************************************************************************/
2274
2275 xcb_input_change_keyboard_device_reply_t *
2276 xcb_input_change_keyboard_device_reply (xcb_connection_t *c /**< */,
2277 xcb_input_change_keyboard_device_cookie_t cookie /**< */,
2278 xcb_generic_error_t **e /**< */)
2279 {
2280 return (xcb_input_change_keyboard_device_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
2281 }
2282
2283
2284 /*****************************************************************************
2285 **
2286 ** xcb_input_change_pointer_device_cookie_t xcb_input_change_pointer_device
2287 **
2288 ** @param xcb_connection_t *c
2289 ** @param uint8_t x_axis
2290 ** @param uint8_t y_axis
2291 ** @param uint8_t device_id
2292 ** @returns xcb_input_change_pointer_device_cookie_t
2293 **
2294 *****************************************************************************/
2295
2296 xcb_input_change_pointer_device_cookie_t
2297 xcb_input_change_pointer_device (xcb_connection_t *c /**< */,
2298 uint8_t x_axis /**< */,
2299 uint8_t y_axis /**< */,
2300 uint8_t device_id /**< */)
2301 {
2302 static const xcb_protocol_request_t xcb_req = {
2303 /* count */ 2,
2304 /* ext */ &xcb_input_id,
2305 /* opcode */ XCB_INPUT_CHANGE_POINTER_DEVICE,
2306 /* isvoid */ 0
2307 };
2308
2309 struct iovec xcb_parts[4];
2310 xcb_input_change_pointer_device_cookie_t xcb_ret;
2311 xcb_input_change_pointer_device_request_t xcb_out;
2312
2313 xcb_out.x_axis = x_axis;
2314 xcb_out.y_axis = y_axis;
2315 xcb_out.device_id = device_id;
2316 xcb_out.pad0 = 0;
2317
2318 xcb_parts[2].iov_base = (char *) &xcb_out;
2319 xcb_parts[2].iov_len = sizeof(xcb_out);
2320 xcb_parts[3].iov_base = 0;
2321 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2322
2323 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2324 return xcb_ret;
2325 }
2326
2327
2328 /*****************************************************************************
2329 **
2330 ** xcb_input_change_pointer_device_cookie_t xcb_input_change_pointer_device_unchecked
2331 **
2332 ** @param xcb_connection_t *c
2333 ** @param uint8_t x_axis
2334 ** @param uint8_t y_axis
2335 ** @param uint8_t device_id
2336 ** @returns xcb_input_change_pointer_device_cookie_t
2337 **
2338 *****************************************************************************/
2339
2340 xcb_input_change_pointer_device_cookie_t
2341 xcb_input_change_pointer_device_unchecked (xcb_connection_t *c /**< */,
2342 uint8_t x_axis /**< */,
2343 uint8_t y_axis /**< */,
2344 uint8_t device_id /**< */)
2345 {
2346 static const xcb_protocol_request_t xcb_req = {
2347 /* count */ 2,
2348 /* ext */ &xcb_input_id,
2349 /* opcode */ XCB_INPUT_CHANGE_POINTER_DEVICE,
2350 /* isvoid */ 0
2351 };
2352
2353 struct iovec xcb_parts[4];
2354 xcb_input_change_pointer_device_cookie_t xcb_ret;
2355 xcb_input_change_pointer_device_request_t xcb_out;
2356
2357 xcb_out.x_axis = x_axis;
2358 xcb_out.y_axis = y_axis;
2359 xcb_out.device_id = device_id;
2360 xcb_out.pad0 = 0;
2361
2362 xcb_parts[2].iov_base = (char *) &xcb_out;
2363 xcb_parts[2].iov_len = sizeof(xcb_out);
2364 xcb_parts[3].iov_base = 0;
2365 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2366
2367 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2368 return xcb_ret;
2369 }
2370
2371
2372 /*****************************************************************************
2373 **
2374 ** xcb_input_change_pointer_device_reply_t * xcb_input_change_pointer_device_reply
2375 **
2376 ** @param xcb_connection_t *c
2377 ** @param xcb_input_change_pointer_device_cookie_t cookie
2378 ** @param xcb_generic_error_t **e
2379 ** @returns xcb_input_change_pointer_device_reply_t *
2380 **
2381 *****************************************************************************/
2382
2383 xcb_input_change_pointer_device_reply_t *
2384 xcb_input_change_pointer_device_reply (xcb_connection_t *c /**< */,
2385 xcb_input_change_pointer_device_cookie_t cookie /**< */,
2386 xcb_generic_error_t **e /**< */)
2387 {
2388 return (xcb_input_change_pointer_device_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
2389 }
2390
2391 int
2392 xcb_input_grab_device_sizeof (const void *_buffer /**< */)
2393 {
2394 char *xcb_tmp = (char *)_buffer;
2395 const xcb_input_grab_device_request_t *_aux = (xcb_input_grab_device_request_t *)_buffer;
2396 unsigned int xcb_buffer_len = 0;
2397 unsigned int xcb_block_len = 0;
2398 unsigned int xcb_pad = 0;
2399 unsigned int xcb_align_to = 0;
2400
2401
2402 xcb_block_len += sizeof(xcb_input_grab_device_request_t);
2403 xcb_tmp += xcb_block_len;
2404 xcb_buffer_len += xcb_block_len;
2405 xcb_block_len = 0;
2406 /* classes */
2407 xcb_block_len += _aux->num_classes * sizeof(xcb_input_event_class_t);
2408 xcb_tmp += xcb_block_len;
2409 xcb_align_to = ALIGNOF(xcb_input_event_class_t);
2410 /* insert padding */
2411 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2412 xcb_buffer_len += xcb_block_len + xcb_pad;
2413 if (0 != xcb_pad) {
2414 xcb_tmp += xcb_pad;
2415 xcb_pad = 0;
2416 }
2417 xcb_block_len = 0;
2418
2419 return xcb_buffer_len;
2420 }
2421
2422
2423 /*****************************************************************************
2424 **
2425 ** xcb_input_grab_device_cookie_t xcb_input_grab_device
2426 **
2427 ** @param xcb_connection_t *c
2428 ** @param xcb_window_t grab_window
2429 ** @param xcb_timestamp_t time
2430 ** @param uint16_t num_classes
2431 ** @param uint8_t this_device_mode
2432 ** @param uint8_t other_device_mode
2433 ** @param uint8_t owner_events
2434 ** @param uint8_t device_id
2435 ** @param const xcb_input_event_class_t *classes
2436 ** @returns xcb_input_grab_device_cookie_t
2437 **
2438 *****************************************************************************/
2439
2440 xcb_input_grab_device_cookie_t
2441 xcb_input_grab_device (xcb_connection_t *c /**< */,
2442 xcb_window_t grab_window /**< */,
2443 xcb_timestamp_t time /**< */,
2444 uint16_t num_classes /**< */,
2445 uint8_t this_device_mode /**< */,
2446 uint8_t other_device_mode /**< */,
2447 uint8_t owner_events /**< */,
2448 uint8_t device_id /**< */,
2449 const xcb_input_event_class_t *classes /**< */)
2450 {
2451 static const xcb_protocol_request_t xcb_req = {
2452 /* count */ 4,
2453 /* ext */ &xcb_input_id,
2454 /* opcode */ XCB_INPUT_GRAB_DEVICE,
2455 /* isvoid */ 0
2456 };
2457
2458 struct iovec xcb_parts[6];
2459 xcb_input_grab_device_cookie_t xcb_ret;
2460 xcb_input_grab_device_request_t xcb_out;
2461
2462 xcb_out.grab_window = grab_window;
2463 xcb_out.time = time;
2464 xcb_out.num_classes = num_classes;
2465 xcb_out.this_device_mode = this_device_mode;
2466 xcb_out.other_device_mode = other_device_mode;
2467 xcb_out.owner_events = owner_events;
2468 xcb_out.device_id = device_id;
2469 memset(xcb_out.pad0, 0, 2);
2470
2471 xcb_parts[2].iov_base = (char *) &xcb_out;
2472 xcb_parts[2].iov_len = sizeof(xcb_out);
2473 xcb_parts[3].iov_base = 0;
2474 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2475 /* xcb_input_event_class_t classes */
2476 xcb_parts[4].iov_base = (char *) classes;
2477 xcb_parts[4].iov_len = num_classes * sizeof(uint32_t);
2478 xcb_parts[5].iov_base = 0;
2479 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
2480
2481 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2482 return xcb_ret;
2483 }
2484
2485
2486 /*****************************************************************************
2487 **
2488 ** xcb_input_grab_device_cookie_t xcb_input_grab_device_unchecked
2489 **
2490 ** @param xcb_connection_t *c
2491 ** @param xcb_window_t grab_window
2492 ** @param xcb_timestamp_t time
2493 ** @param uint16_t num_classes
2494 ** @param uint8_t this_device_mode
2495 ** @param uint8_t other_device_mode
2496 ** @param uint8_t owner_events
2497 ** @param uint8_t device_id
2498 ** @param const xcb_input_event_class_t *classes
2499 ** @returns xcb_input_grab_device_cookie_t
2500 **
2501 *****************************************************************************/
2502
2503 xcb_input_grab_device_cookie_t
2504 xcb_input_grab_device_unchecked (xcb_connection_t *c /**< */,
2505 xcb_window_t grab_window /**< */,
2506 xcb_timestamp_t time /**< */,
2507 uint16_t num_classes /**< */,
2508 uint8_t this_device_mode /**< */,
2509 uint8_t other_device_mode /**< */,
2510 uint8_t owner_events /**< */,
2511 uint8_t device_id /**< */,
2512 const xcb_input_event_class_t *classes /**< */)
2513 {
2514 static const xcb_protocol_request_t xcb_req = {
2515 /* count */ 4,
2516 /* ext */ &xcb_input_id,
2517 /* opcode */ XCB_INPUT_GRAB_DEVICE,
2518 /* isvoid */ 0
2519 };
2520
2521 struct iovec xcb_parts[6];
2522 xcb_input_grab_device_cookie_t xcb_ret;
2523 xcb_input_grab_device_request_t xcb_out;
2524
2525 xcb_out.grab_window = grab_window;
2526 xcb_out.time = time;
2527 xcb_out.num_classes = num_classes;
2528 xcb_out.this_device_mode = this_device_mode;
2529 xcb_out.other_device_mode = other_device_mode;
2530 xcb_out.owner_events = owner_events;
2531 xcb_out.device_id = device_id;
2532 memset(xcb_out.pad0, 0, 2);
2533
2534 xcb_parts[2].iov_base = (char *) &xcb_out;
2535 xcb_parts[2].iov_len = sizeof(xcb_out);
2536 xcb_parts[3].iov_base = 0;
2537 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2538 /* xcb_input_event_class_t classes */
2539 xcb_parts[4].iov_base = (char *) classes;
2540 xcb_parts[4].iov_len = num_classes * sizeof(uint32_t);
2541 xcb_parts[5].iov_base = 0;
2542 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
2543
2544 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2545 return xcb_ret;
2546 }
2547
2548
2549 /*****************************************************************************
2550 **
2551 ** xcb_input_grab_device_reply_t * xcb_input_grab_device_reply
2552 **
2553 ** @param xcb_connection_t *c
2554 ** @param xcb_input_grab_device_cookie_t cookie
2555 ** @param xcb_generic_error_t **e
2556 ** @returns xcb_input_grab_device_reply_t *
2557 **
2558 *****************************************************************************/
2559
2560 xcb_input_grab_device_reply_t *
2561 xcb_input_grab_device_reply (xcb_connection_t *c /**< */,
2562 xcb_input_grab_device_cookie_t cookie /**< */,
2563 xcb_generic_error_t **e /**< */)
2564 {
2565 return (xcb_input_grab_device_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
2566 }
2567
2568
2569 /*****************************************************************************
2570 **
2571 ** xcb_void_cookie_t xcb_input_ungrab_device_checked
2572 **
2573 ** @param xcb_connection_t *c
2574 ** @param xcb_timestamp_t time
2575 ** @param uint8_t device_id
2576 ** @returns xcb_void_cookie_t
2577 **
2578 *****************************************************************************/
2579
2580 xcb_void_cookie_t
2581 xcb_input_ungrab_device_checked (xcb_connection_t *c /**< */,
2582 xcb_timestamp_t time /**< */,
2583 uint8_t device_id /**< */)
2584 {
2585 static const xcb_protocol_request_t xcb_req = {
2586 /* count */ 2,
2587 /* ext */ &xcb_input_id,
2588 /* opcode */ XCB_INPUT_UNGRAB_DEVICE,
2589 /* isvoid */ 1
2590 };
2591
2592 struct iovec xcb_parts[4];
2593 xcb_void_cookie_t xcb_ret;
2594 xcb_input_ungrab_device_request_t xcb_out;
2595
2596 xcb_out.time = time;
2597 xcb_out.device_id = device_id;
2598
2599 xcb_parts[2].iov_base = (char *) &xcb_out;
2600 xcb_parts[2].iov_len = sizeof(xcb_out);
2601 xcb_parts[3].iov_base = 0;
2602 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2603
2604 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2605 return xcb_ret;
2606 }
2607
2608
2609 /*****************************************************************************
2610 **
2611 ** xcb_void_cookie_t xcb_input_ungrab_device
2612 **
2613 ** @param xcb_connection_t *c
2614 ** @param xcb_timestamp_t time
2615 ** @param uint8_t device_id
2616 ** @returns xcb_void_cookie_t
2617 **
2618 *****************************************************************************/
2619
2620 xcb_void_cookie_t
2621 xcb_input_ungrab_device (xcb_connection_t *c /**< */,
2622 xcb_timestamp_t time /**< */,
2623 uint8_t device_id /**< */)
2624 {
2625 static const xcb_protocol_request_t xcb_req = {
2626 /* count */ 2,
2627 /* ext */ &xcb_input_id,
2628 /* opcode */ XCB_INPUT_UNGRAB_DEVICE,
2629 /* isvoid */ 1
2630 };
2631
2632 struct iovec xcb_parts[4];
2633 xcb_void_cookie_t xcb_ret;
2634 xcb_input_ungrab_device_request_t xcb_out;
2635
2636 xcb_out.time = time;
2637 xcb_out.device_id = device_id;
2638
2639 xcb_parts[2].iov_base = (char *) &xcb_out;
2640 xcb_parts[2].iov_len = sizeof(xcb_out);
2641 xcb_parts[3].iov_base = 0;
2642 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2643
2644 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2645 return xcb_ret;
2646 }
2647
2648 int
2649 xcb_input_grab_device_key_sizeof (const void *_buffer /**< */)
2650 {
2651 char *xcb_tmp = (char *)_buffer;
2652 const xcb_input_grab_device_key_request_t *_aux = (xcb_input_grab_device_key_request_t *)_buffer;
2653 unsigned int xcb_buffer_len = 0;
2654 unsigned int xcb_block_len = 0;
2655 unsigned int xcb_pad = 0;
2656 unsigned int xcb_align_to = 0;
2657
2658
2659 xcb_block_len += sizeof(xcb_input_grab_device_key_request_t);
2660 xcb_tmp += xcb_block_len;
2661 xcb_buffer_len += xcb_block_len;
2662 xcb_block_len = 0;
2663 /* classes */
2664 xcb_block_len += _aux->num_classes * sizeof(xcb_input_event_class_t);
2665 xcb_tmp += xcb_block_len;
2666 xcb_align_to = ALIGNOF(xcb_input_event_class_t);
2667 /* insert padding */
2668 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2669 xcb_buffer_len += xcb_block_len + xcb_pad;
2670 if (0 != xcb_pad) {
2671 xcb_tmp += xcb_pad;
2672 xcb_pad = 0;
2673 }
2674 xcb_block_len = 0;
2675
2676 return xcb_buffer_len;
2677 }
2678
2679
2680 /*****************************************************************************
2681 **
2682 ** xcb_void_cookie_t xcb_input_grab_device_key_checked
2683 **
2684 ** @param xcb_connection_t *c
2685 ** @param xcb_window_t grab_window
2686 ** @param uint16_t num_classes
2687 ** @param uint16_t modifiers
2688 ** @param uint8_t modifier_device
2689 ** @param uint8_t grabbed_device
2690 ** @param uint8_t key
2691 ** @param uint8_t this_device_mode
2692 ** @param uint8_t other_device_mode
2693 ** @param uint8_t owner_events
2694 ** @param const xcb_input_event_class_t *classes
2695 ** @returns xcb_void_cookie_t
2696 **
2697 *****************************************************************************/
2698
2699 xcb_void_cookie_t
2700 xcb_input_grab_device_key_checked (xcb_connection_t *c /**< */,
2701 xcb_window_t grab_window /**< */,
2702 uint16_t num_classes /**< */,
2703 uint16_t modifiers /**< */,
2704 uint8_t modifier_device /**< */,
2705 uint8_t grabbed_device /**< */,
2706 uint8_t key /**< */,
2707 uint8_t this_device_mode /**< */,
2708 uint8_t other_device_mode /**< */,
2709 uint8_t owner_events /**< */,
2710 const xcb_input_event_class_t *classes /**< */)
2711 {
2712 static const xcb_protocol_request_t xcb_req = {
2713 /* count */ 4,
2714 /* ext */ &xcb_input_id,
2715 /* opcode */ XCB_INPUT_GRAB_DEVICE_KEY,
2716 /* isvoid */ 1
2717 };
2718
2719 struct iovec xcb_parts[6];
2720 xcb_void_cookie_t xcb_ret;
2721 xcb_input_grab_device_key_request_t xcb_out;
2722
2723 xcb_out.grab_window = grab_window;
2724 xcb_out.num_classes = num_classes;
2725 xcb_out.modifiers = modifiers;
2726 xcb_out.modifier_device = modifier_device;
2727 xcb_out.grabbed_device = grabbed_device;
2728 xcb_out.key = key;
2729 xcb_out.this_device_mode = this_device_mode;
2730 xcb_out.other_device_mode = other_device_mode;
2731 xcb_out.owner_events = owner_events;
2732 memset(xcb_out.pad0, 0, 2);
2733
2734 xcb_parts[2].iov_base = (char *) &xcb_out;
2735 xcb_parts[2].iov_len = sizeof(xcb_out);
2736 xcb_parts[3].iov_base = 0;
2737 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2738 /* xcb_input_event_class_t classes */
2739 xcb_parts[4].iov_base = (char *) classes;
2740 xcb_parts[4].iov_len = num_classes * sizeof(xcb_input_event_class_t);
2741 xcb_parts[5].iov_base = 0;
2742 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
2743
2744 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2745 return xcb_ret;
2746 }
2747
2748
2749 /*****************************************************************************
2750 **
2751 ** xcb_void_cookie_t xcb_input_grab_device_key
2752 **
2753 ** @param xcb_connection_t *c
2754 ** @param xcb_window_t grab_window
2755 ** @param uint16_t num_classes
2756 ** @param uint16_t modifiers
2757 ** @param uint8_t modifier_device
2758 ** @param uint8_t grabbed_device
2759 ** @param uint8_t key
2760 ** @param uint8_t this_device_mode
2761 ** @param uint8_t other_device_mode
2762 ** @param uint8_t owner_events
2763 ** @param const xcb_input_event_class_t *classes
2764 ** @returns xcb_void_cookie_t
2765 **
2766 *****************************************************************************/
2767
2768 xcb_void_cookie_t
2769 xcb_input_grab_device_key (xcb_connection_t *c /**< */,
2770 xcb_window_t grab_window /**< */,
2771 uint16_t num_classes /**< */,
2772 uint16_t modifiers /**< */,
2773 uint8_t modifier_device /**< */,
2774 uint8_t grabbed_device /**< */,
2775 uint8_t key /**< */,
2776 uint8_t this_device_mode /**< */,
2777 uint8_t other_device_mode /**< */,
2778 uint8_t owner_events /**< */,
2779 const xcb_input_event_class_t *classes /**< */)
2780 {
2781 static const xcb_protocol_request_t xcb_req = {
2782 /* count */ 4,
2783 /* ext */ &xcb_input_id,
2784 /* opcode */ XCB_INPUT_GRAB_DEVICE_KEY,
2785 /* isvoid */ 1
2786 };
2787
2788 struct iovec xcb_parts[6];
2789 xcb_void_cookie_t xcb_ret;
2790 xcb_input_grab_device_key_request_t xcb_out;
2791
2792 xcb_out.grab_window = grab_window;
2793 xcb_out.num_classes = num_classes;
2794 xcb_out.modifiers = modifiers;
2795 xcb_out.modifier_device = modifier_device;
2796 xcb_out.grabbed_device = grabbed_device;
2797 xcb_out.key = key;
2798 xcb_out.this_device_mode = this_device_mode;
2799 xcb_out.other_device_mode = other_device_mode;
2800 xcb_out.owner_events = owner_events;
2801 memset(xcb_out.pad0, 0, 2);
2802
2803 xcb_parts[2].iov_base = (char *) &xcb_out;
2804 xcb_parts[2].iov_len = sizeof(xcb_out);
2805 xcb_parts[3].iov_base = 0;
2806 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2807 /* xcb_input_event_class_t classes */
2808 xcb_parts[4].iov_base = (char *) classes;
2809 xcb_parts[4].iov_len = num_classes * sizeof(xcb_input_event_class_t);
2810 xcb_parts[5].iov_base = 0;
2811 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
2812
2813 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2814 return xcb_ret;
2815 }
2816
2817
2818 /*****************************************************************************
2819 **
2820 ** xcb_void_cookie_t xcb_input_ungrab_device_key_checked
2821 **
2822 ** @param xcb_connection_t *c
2823 ** @param xcb_window_t grabWindow
2824 ** @param uint16_t modifiers
2825 ** @param uint8_t modifier_device
2826 ** @param uint8_t key
2827 ** @param uint8_t grabbed_device
2828 ** @returns xcb_void_cookie_t
2829 **
2830 *****************************************************************************/
2831
2832 xcb_void_cookie_t
2833 xcb_input_ungrab_device_key_checked (xcb_connection_t *c /**< */,
2834 xcb_window_t grabWindow /**< */,
2835 uint16_t modifiers /**< */,
2836 uint8_t modifier_device /**< */,
2837 uint8_t key /**< */,
2838 uint8_t grabbed_device /**< */)
2839 {
2840 static const xcb_protocol_request_t xcb_req = {
2841 /* count */ 2,
2842 /* ext */ &xcb_input_id,
2843 /* opcode */ XCB_INPUT_UNGRAB_DEVICE_KEY,
2844 /* isvoid */ 1
2845 };
2846
2847 struct iovec xcb_parts[4];
2848 xcb_void_cookie_t xcb_ret;
2849 xcb_input_ungrab_device_key_request_t xcb_out;
2850
2851 xcb_out.grabWindow = grabWindow;
2852 xcb_out.modifiers = modifiers;
2853 xcb_out.modifier_device = modifier_device;
2854 xcb_out.key = key;
2855 xcb_out.grabbed_device = grabbed_device;
2856
2857 xcb_parts[2].iov_base = (char *) &xcb_out;
2858 xcb_parts[2].iov_len = sizeof(xcb_out);
2859 xcb_parts[3].iov_base = 0;
2860 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2861
2862 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2863 return xcb_ret;
2864 }
2865
2866
2867 /*****************************************************************************
2868 **
2869 ** xcb_void_cookie_t xcb_input_ungrab_device_key
2870 **
2871 ** @param xcb_connection_t *c
2872 ** @param xcb_window_t grabWindow
2873 ** @param uint16_t modifiers
2874 ** @param uint8_t modifier_device
2875 ** @param uint8_t key
2876 ** @param uint8_t grabbed_device
2877 ** @returns xcb_void_cookie_t
2878 **
2879 *****************************************************************************/
2880
2881 xcb_void_cookie_t
2882 xcb_input_ungrab_device_key (xcb_connection_t *c /**< */,
2883 xcb_window_t grabWindow /**< */,
2884 uint16_t modifiers /**< */,
2885 uint8_t modifier_device /**< */,
2886 uint8_t key /**< */,
2887 uint8_t grabbed_device /**< */)
2888 {
2889 static const xcb_protocol_request_t xcb_req = {
2890 /* count */ 2,
2891 /* ext */ &xcb_input_id,
2892 /* opcode */ XCB_INPUT_UNGRAB_DEVICE_KEY,
2893 /* isvoid */ 1
2894 };
2895
2896 struct iovec xcb_parts[4];
2897 xcb_void_cookie_t xcb_ret;
2898 xcb_input_ungrab_device_key_request_t xcb_out;
2899
2900 xcb_out.grabWindow = grabWindow;
2901 xcb_out.modifiers = modifiers;
2902 xcb_out.modifier_device = modifier_device;
2903 xcb_out.key = key;
2904 xcb_out.grabbed_device = grabbed_device;
2905
2906 xcb_parts[2].iov_base = (char *) &xcb_out;
2907 xcb_parts[2].iov_len = sizeof(xcb_out);
2908 xcb_parts[3].iov_base = 0;
2909 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2910
2911 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2912 return xcb_ret;
2913 }
2914
2915 int
2916 xcb_input_grab_device_button_sizeof (const void *_buffer /**< */)
2917 {
2918 char *xcb_tmp = (char *)_buffer;
2919 const xcb_input_grab_device_button_request_t *_aux = (xcb_input_grab_device_button_request_t *)_buffer;
2920 unsigned int xcb_buffer_len = 0;
2921 unsigned int xcb_block_len = 0;
2922 unsigned int xcb_pad = 0;
2923 unsigned int xcb_align_to = 0;
2924
2925
2926 xcb_block_len += sizeof(xcb_input_grab_device_button_request_t);
2927 xcb_tmp += xcb_block_len;
2928 xcb_buffer_len += xcb_block_len;
2929 xcb_block_len = 0;
2930 /* classes */
2931 xcb_block_len += _aux->num_classes * sizeof(xcb_input_event_class_t);
2932 xcb_tmp += xcb_block_len;
2933 xcb_align_to = ALIGNOF(xcb_input_event_class_t);
2934 /* insert padding */
2935 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2936 xcb_buffer_len += xcb_block_len + xcb_pad;
2937 if (0 != xcb_pad) {
2938 xcb_tmp += xcb_pad;
2939 xcb_pad = 0;
2940 }
2941 xcb_block_len = 0;
2942
2943 return xcb_buffer_len;
2944 }
2945
2946
2947 /*****************************************************************************
2948 **
2949 ** xcb_void_cookie_t xcb_input_grab_device_button_checked
2950 **
2951 ** @param xcb_connection_t *c
2952 ** @param xcb_window_t grab_window
2953 ** @param uint8_t grabbed_device
2954 ** @param uint8_t modifier_device
2955 ** @param uint16_t num_classes
2956 ** @param uint16_t modifiers
2957 ** @param uint8_t this_device_mode
2958 ** @param uint8_t other_device_mode
2959 ** @param uint8_t button
2960 ** @param uint8_t owner_events
2961 ** @param const xcb_input_event_class_t *classes
2962 ** @returns xcb_void_cookie_t
2963 **
2964 *****************************************************************************/
2965
2966 xcb_void_cookie_t
2967 xcb_input_grab_device_button_checked (xcb_connection_t *c /**< */,
2968 xcb_window_t grab_window /**< */,
2969 uint8_t grabbed_device /**< */,
2970 uint8_t modifier_device /**< */,
2971 uint16_t num_classes /**< */,
2972 uint16_t modifiers /**< */,
2973 uint8_t this_device_mode /**< */,
2974 uint8_t other_device_mode /**< */,
2975 uint8_t button /**< */,
2976 uint8_t owner_events /**< */,
2977 const xcb_input_event_class_t *classes /**< */)
2978 {
2979 static const xcb_protocol_request_t xcb_req = {
2980 /* count */ 4,
2981 /* ext */ &xcb_input_id,
2982 /* opcode */ XCB_INPUT_GRAB_DEVICE_BUTTON,
2983 /* isvoid */ 1
2984 };
2985
2986 struct iovec xcb_parts[6];
2987 xcb_void_cookie_t xcb_ret;
2988 xcb_input_grab_device_button_request_t xcb_out;
2989
2990 xcb_out.grab_window = grab_window;
2991 xcb_out.grabbed_device = grabbed_device;
2992 xcb_out.modifier_device = modifier_device;
2993 xcb_out.num_classes = num_classes;
2994 xcb_out.modifiers = modifiers;
2995 xcb_out.this_device_mode = this_device_mode;
2996 xcb_out.other_device_mode = other_device_mode;
2997 xcb_out.button = button;
2998 xcb_out.owner_events = owner_events;
2999 memset(xcb_out.pad0, 0, 2);
3000
3001 xcb_parts[2].iov_base = (char *) &xcb_out;
3002 xcb_parts[2].iov_len = sizeof(xcb_out);
3003 xcb_parts[3].iov_base = 0;
3004 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3005 /* xcb_input_event_class_t classes */
3006 xcb_parts[4].iov_base = (char *) classes;
3007 xcb_parts[4].iov_len = num_classes * sizeof(xcb_input_event_class_t);
3008 xcb_parts[5].iov_base = 0;
3009 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
3010
3011 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3012 return xcb_ret;
3013 }
3014
3015
3016 /*****************************************************************************
3017 **
3018 ** xcb_void_cookie_t xcb_input_grab_device_button
3019 **
3020 ** @param xcb_connection_t *c
3021 ** @param xcb_window_t grab_window
3022 ** @param uint8_t grabbed_device
3023 ** @param uint8_t modifier_device
3024 ** @param uint16_t num_classes
3025 ** @param uint16_t modifiers
3026 ** @param uint8_t this_device_mode
3027 ** @param uint8_t other_device_mode
3028 ** @param uint8_t button
3029 ** @param uint8_t owner_events
3030 ** @param const xcb_input_event_class_t *classes
3031 ** @returns xcb_void_cookie_t
3032 **
3033 *****************************************************************************/
3034
3035 xcb_void_cookie_t
3036 xcb_input_grab_device_button (xcb_connection_t *c /**< */,
3037 xcb_window_t grab_window /**< */,
3038 uint8_t grabbed_device /**< */,
3039 uint8_t modifier_device /**< */,
3040 uint16_t num_classes /**< */,
3041 uint16_t modifiers /**< */,
3042 uint8_t this_device_mode /**< */,
3043 uint8_t other_device_mode /**< */,
3044 uint8_t button /**< */,
3045 uint8_t owner_events /**< */,
3046 const xcb_input_event_class_t *classes /**< */)
3047 {
3048 static const xcb_protocol_request_t xcb_req = {
3049 /* count */ 4,
3050 /* ext */ &xcb_input_id,
3051 /* opcode */ XCB_INPUT_GRAB_DEVICE_BUTTON,
3052 /* isvoid */ 1
3053 };
3054
3055 struct iovec xcb_parts[6];
3056 xcb_void_cookie_t xcb_ret;
3057 xcb_input_grab_device_button_request_t xcb_out;
3058
3059 xcb_out.grab_window = grab_window;
3060 xcb_out.grabbed_device = grabbed_device;
3061 xcb_out.modifier_device = modifier_device;
3062 xcb_out.num_classes = num_classes;
3063 xcb_out.modifiers = modifiers;
3064 xcb_out.this_device_mode = this_device_mode;
3065 xcb_out.other_device_mode = other_device_mode;
3066 xcb_out.button = button;
3067 xcb_out.owner_events = owner_events;
3068 memset(xcb_out.pad0, 0, 2);
3069
3070 xcb_parts[2].iov_base = (char *) &xcb_out;
3071 xcb_parts[2].iov_len = sizeof(xcb_out);
3072 xcb_parts[3].iov_base = 0;
3073 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3074 /* xcb_input_event_class_t classes */
3075 xcb_parts[4].iov_base = (char *) classes;
3076 xcb_parts[4].iov_len = num_classes * sizeof(xcb_input_event_class_t);
3077 xcb_parts[5].iov_base = 0;
3078 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
3079
3080 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3081 return xcb_ret;
3082 }
3083
3084
3085 /*****************************************************************************
3086 **
3087 ** xcb_void_cookie_t xcb_input_ungrab_device_button_checked
3088 **
3089 ** @param xcb_connection_t *c
3090 ** @param xcb_window_t grab_window
3091 ** @param uint16_t modifiers
3092 ** @param uint8_t modifier_device
3093 ** @param uint8_t button
3094 ** @param uint8_t grabbed_device
3095 ** @returns xcb_void_cookie_t
3096 **
3097 *****************************************************************************/
3098
3099 xcb_void_cookie_t
3100 xcb_input_ungrab_device_button_checked (xcb_connection_t *c /**< */,
3101 xcb_window_t grab_window /**< */,
3102 uint16_t modifiers /**< */,
3103 uint8_t modifier_device /**< */,
3104 uint8_t button /**< */,
3105 uint8_t grabbed_device /**< */)
3106 {
3107 static const xcb_protocol_request_t xcb_req = {
3108 /* count */ 2,
3109 /* ext */ &xcb_input_id,
3110 /* opcode */ XCB_INPUT_UNGRAB_DEVICE_BUTTON,
3111 /* isvoid */ 1
3112 };
3113
3114 struct iovec xcb_parts[4];
3115 xcb_void_cookie_t xcb_ret;
3116 xcb_input_ungrab_device_button_request_t xcb_out;
3117
3118 xcb_out.grab_window = grab_window;
3119 xcb_out.modifiers = modifiers;
3120 xcb_out.modifier_device = modifier_device;
3121 xcb_out.button = button;
3122 xcb_out.grabbed_device = grabbed_device;
3123
3124 xcb_parts[2].iov_base = (char *) &xcb_out;
3125 xcb_parts[2].iov_len = sizeof(xcb_out);
3126 xcb_parts[3].iov_base = 0;
3127 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3128
3129 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3130 return xcb_ret;
3131 }
3132
3133
3134 /*****************************************************************************
3135 **
3136 ** xcb_void_cookie_t xcb_input_ungrab_device_button
3137 **
3138 ** @param xcb_connection_t *c
3139 ** @param xcb_window_t grab_window
3140 ** @param uint16_t modifiers
3141 ** @param uint8_t modifier_device
3142 ** @param uint8_t button
3143 ** @param uint8_t grabbed_device
3144 ** @returns xcb_void_cookie_t
3145 **
3146 *****************************************************************************/
3147
3148 xcb_void_cookie_t
3149 xcb_input_ungrab_device_button (xcb_connection_t *c /**< */,
3150 xcb_window_t grab_window /**< */,
3151 uint16_t modifiers /**< */,
3152 uint8_t modifier_device /**< */,
3153 uint8_t button /**< */,
3154 uint8_t grabbed_device /**< */)
3155 {
3156 static const xcb_protocol_request_t xcb_req = {
3157 /* count */ 2,
3158 /* ext */ &xcb_input_id,
3159 /* opcode */ XCB_INPUT_UNGRAB_DEVICE_BUTTON,
3160 /* isvoid */ 1
3161 };
3162
3163 struct iovec xcb_parts[4];
3164 xcb_void_cookie_t xcb_ret;
3165 xcb_input_ungrab_device_button_request_t xcb_out;
3166
3167 xcb_out.grab_window = grab_window;
3168 xcb_out.modifiers = modifiers;
3169 xcb_out.modifier_device = modifier_device;
3170 xcb_out.button = button;
3171 xcb_out.grabbed_device = grabbed_device;
3172
3173 xcb_parts[2].iov_base = (char *) &xcb_out;
3174 xcb_parts[2].iov_len = sizeof(xcb_out);
3175 xcb_parts[3].iov_base = 0;
3176 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3177
3178 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3179 return xcb_ret;
3180 }
3181
3182
3183 /*****************************************************************************
3184 **
3185 ** xcb_void_cookie_t xcb_input_allow_device_events_checked
3186 **
3187 ** @param xcb_connection_t *c
3188 ** @param xcb_timestamp_t time
3189 ** @param uint8_t mode
3190 ** @param uint8_t device_id
3191 ** @returns xcb_void_cookie_t
3192 **
3193 *****************************************************************************/
3194
3195 xcb_void_cookie_t
3196 xcb_input_allow_device_events_checked (xcb_connection_t *c /**< */,
3197 xcb_timestamp_t time /**< */,
3198 uint8_t mode /**< */,
3199 uint8_t device_id /**< */)
3200 {
3201 static const xcb_protocol_request_t xcb_req = {
3202 /* count */ 2,
3203 /* ext */ &xcb_input_id,
3204 /* opcode */ XCB_INPUT_ALLOW_DEVICE_EVENTS,
3205 /* isvoid */ 1
3206 };
3207
3208 struct iovec xcb_parts[4];
3209 xcb_void_cookie_t xcb_ret;
3210 xcb_input_allow_device_events_request_t xcb_out;
3211
3212 xcb_out.time = time;
3213 xcb_out.mode = mode;
3214 xcb_out.device_id = device_id;
3215
3216 xcb_parts[2].iov_base = (char *) &xcb_out;
3217 xcb_parts[2].iov_len = sizeof(xcb_out);
3218 xcb_parts[3].iov_base = 0;
3219 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3220
3221 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3222 return xcb_ret;
3223 }
3224
3225
3226 /*****************************************************************************
3227 **
3228 ** xcb_void_cookie_t xcb_input_allow_device_events
3229 **
3230 ** @param xcb_connection_t *c
3231 ** @param xcb_timestamp_t time
3232 ** @param uint8_t mode
3233 ** @param uint8_t device_id
3234 ** @returns xcb_void_cookie_t
3235 **
3236 *****************************************************************************/
3237
3238 xcb_void_cookie_t
3239 xcb_input_allow_device_events (xcb_connection_t *c /**< */,
3240 xcb_timestamp_t time /**< */,
3241 uint8_t mode /**< */,
3242 uint8_t device_id /**< */)
3243 {
3244 static const xcb_protocol_request_t xcb_req = {
3245 /* count */ 2,
3246 /* ext */ &xcb_input_id,
3247 /* opcode */ XCB_INPUT_ALLOW_DEVICE_EVENTS,
3248 /* isvoid */ 1
3249 };
3250
3251 struct iovec xcb_parts[4];
3252 xcb_void_cookie_t xcb_ret;
3253 xcb_input_allow_device_events_request_t xcb_out;
3254
3255 xcb_out.time = time;
3256 xcb_out.mode = mode;
3257 xcb_out.device_id = device_id;
3258
3259 xcb_parts[2].iov_base = (char *) &xcb_out;
3260 xcb_parts[2].iov_len = sizeof(xcb_out);
3261 xcb_parts[3].iov_base = 0;
3262 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3263
3264 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3265 return xcb_ret;
3266 }
3267
3268
3269 /*****************************************************************************
3270 **
3271 ** xcb_input_get_device_focus_cookie_t xcb_input_get_device_focus
3272 **
3273 ** @param xcb_connection_t *c
3274 ** @param uint8_t device_id
3275 ** @returns xcb_input_get_device_focus_cookie_t
3276 **
3277 *****************************************************************************/
3278
3279 xcb_input_get_device_focus_cookie_t
3280 xcb_input_get_device_focus (xcb_connection_t *c /**< */,
3281 uint8_t device_id /**< */)
3282 {
3283 static const xcb_protocol_request_t xcb_req = {
3284 /* count */ 2,
3285 /* ext */ &xcb_input_id,
3286 /* opcode */ XCB_INPUT_GET_DEVICE_FOCUS,
3287 /* isvoid */ 0
3288 };
3289
3290 struct iovec xcb_parts[4];
3291 xcb_input_get_device_focus_cookie_t xcb_ret;
3292 xcb_input_get_device_focus_request_t xcb_out;
3293
3294 xcb_out.device_id = device_id;
3295 memset(xcb_out.pad0, 0, 3);
3296
3297 xcb_parts[2].iov_base = (char *) &xcb_out;
3298 xcb_parts[2].iov_len = sizeof(xcb_out);
3299 xcb_parts[3].iov_base = 0;
3300 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3301
3302 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3303 return xcb_ret;
3304 }
3305
3306
3307 /*****************************************************************************
3308 **
3309 ** xcb_input_get_device_focus_cookie_t xcb_input_get_device_focus_unchecked
3310 **
3311 ** @param xcb_connection_t *c
3312 ** @param uint8_t device_id
3313 ** @returns xcb_input_get_device_focus_cookie_t
3314 **
3315 *****************************************************************************/
3316
3317 xcb_input_get_device_focus_cookie_t
3318 xcb_input_get_device_focus_unchecked (xcb_connection_t *c /**< */,
3319 uint8_t device_id /**< */)
3320 {
3321 static const xcb_protocol_request_t xcb_req = {
3322 /* count */ 2,
3323 /* ext */ &xcb_input_id,
3324 /* opcode */ XCB_INPUT_GET_DEVICE_FOCUS,
3325 /* isvoid */ 0
3326 };
3327
3328 struct iovec xcb_parts[4];
3329 xcb_input_get_device_focus_cookie_t xcb_ret;
3330 xcb_input_get_device_focus_request_t xcb_out;
3331
3332 xcb_out.device_id = device_id;
3333 memset(xcb_out.pad0, 0, 3);
3334
3335 xcb_parts[2].iov_base = (char *) &xcb_out;
3336 xcb_parts[2].iov_len = sizeof(xcb_out);
3337 xcb_parts[3].iov_base = 0;
3338 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3339
3340 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3341 return xcb_ret;
3342 }
3343
3344
3345 /*****************************************************************************
3346 **
3347 ** xcb_input_get_device_focus_reply_t * xcb_input_get_device_focus_reply
3348 **
3349 ** @param xcb_connection_t *c
3350 ** @param xcb_input_get_device_focus_cookie_t cookie
3351 ** @param xcb_generic_error_t **e
3352 ** @returns xcb_input_get_device_focus_reply_t *
3353 **
3354 *****************************************************************************/
3355
3356 xcb_input_get_device_focus_reply_t *
3357 xcb_input_get_device_focus_reply (xcb_connection_t *c /**< */,
3358 xcb_input_get_device_focus_cookie_t cookie /**< */,
3359 xcb_generic_error_t **e /**< */)
3360 {
3361 return (xcb_input_get_device_focus_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
3362 }
3363
3364
3365 /*****************************************************************************
3366 **
3367 ** xcb_void_cookie_t xcb_input_set_device_focus_checked
3368 **
3369 ** @param xcb_connection_t *c
3370 ** @param xcb_window_t focus
3371 ** @param xcb_timestamp_t time
3372 ** @param uint8_t revert_to
3373 ** @param uint8_t device_id
3374 ** @returns xcb_void_cookie_t
3375 **
3376 *****************************************************************************/
3377
3378 xcb_void_cookie_t
3379 xcb_input_set_device_focus_checked (xcb_connection_t *c /**< */,
3380 xcb_window_t focus /**< */,
3381 xcb_timestamp_t time /**< */,
3382 uint8_t revert_to /**< */,
3383 uint8_t device_id /**< */)
3384 {
3385 static const xcb_protocol_request_t xcb_req = {
3386 /* count */ 2,
3387 /* ext */ &xcb_input_id,
3388 /* opcode */ XCB_INPUT_SET_DEVICE_FOCUS,
3389 /* isvoid */ 1
3390 };
3391
3392 struct iovec xcb_parts[4];
3393 xcb_void_cookie_t xcb_ret;
3394 xcb_input_set_device_focus_request_t xcb_out;
3395
3396 xcb_out.focus = focus;
3397 xcb_out.time = time;
3398 xcb_out.revert_to = revert_to;
3399 xcb_out.device_id = device_id;
3400
3401 xcb_parts[2].iov_base = (char *) &xcb_out;
3402 xcb_parts[2].iov_len = sizeof(xcb_out);
3403 xcb_parts[3].iov_base = 0;
3404 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3405
3406 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3407 return xcb_ret;
3408 }
3409
3410
3411 /*****************************************************************************
3412 **
3413 ** xcb_void_cookie_t xcb_input_set_device_focus
3414 **
3415 ** @param xcb_connection_t *c
3416 ** @param xcb_window_t focus
3417 ** @param xcb_timestamp_t time
3418 ** @param uint8_t revert_to
3419 ** @param uint8_t device_id
3420 ** @returns xcb_void_cookie_t
3421 **
3422 *****************************************************************************/
3423
3424 xcb_void_cookie_t
3425 xcb_input_set_device_focus (xcb_connection_t *c /**< */,
3426 xcb_window_t focus /**< */,
3427 xcb_timestamp_t time /**< */,
3428 uint8_t revert_to /**< */,
3429 uint8_t device_id /**< */)
3430 {
3431 static const xcb_protocol_request_t xcb_req = {
3432 /* count */ 2,
3433 /* ext */ &xcb_input_id,
3434 /* opcode */ XCB_INPUT_SET_DEVICE_FOCUS,
3435 /* isvoid */ 1
3436 };
3437
3438 struct iovec xcb_parts[4];
3439 xcb_void_cookie_t xcb_ret;
3440 xcb_input_set_device_focus_request_t xcb_out;
3441
3442 xcb_out.focus = focus;
3443 xcb_out.time = time;
3444 xcb_out.revert_to = revert_to;
3445 xcb_out.device_id = device_id;
3446
3447 xcb_parts[2].iov_base = (char *) &xcb_out;
3448 xcb_parts[2].iov_len = sizeof(xcb_out);
3449 xcb_parts[3].iov_base = 0;
3450 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3451
3452 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3453 return xcb_ret;
3454 }
3455
3456
3457 /*****************************************************************************
3458 **
3459 ** void xcb_input_kbd_feedback_state_next
3460 **
3461 ** @param xcb_input_kbd_feedback_state_iterator_t *i
3462 ** @returns void
3463 **
3464 *****************************************************************************/
3465
3466 void
3467 xcb_input_kbd_feedback_state_next (xcb_input_kbd_feedback_state_iterator_t *i /**< */)
3468 {
3469 --i->rem;
3470 ++i->data;
3471 i->index += sizeof(xcb_input_kbd_feedback_state_t);
3472 }
3473
3474
3475 /*****************************************************************************
3476 **
3477 ** xcb_generic_iterator_t xcb_input_kbd_feedback_state_end
3478 **
3479 ** @param xcb_input_kbd_feedback_state_iterator_t i
3480 ** @returns xcb_generic_iterator_t
3481 **
3482 *****************************************************************************/
3483
3484 xcb_generic_iterator_t
3485 xcb_input_kbd_feedback_state_end (xcb_input_kbd_feedback_state_iterator_t i /**< */)
3486 {
3487 xcb_generic_iterator_t ret;
3488 ret.data = i.data + i.rem;
3489 ret.index = i.index + ((char *) ret.data - (char *) i.data);
3490 ret.rem = 0;
3491 return ret;
3492 }
3493
3494
3495 /*****************************************************************************
3496 **
3497 ** void xcb_input_ptr_feedback_state_next
3498 **
3499 ** @param xcb_input_ptr_feedback_state_iterator_t *i
3500 ** @returns void
3501 **
3502 *****************************************************************************/
3503
3504 void
3505 xcb_input_ptr_feedback_state_next (xcb_input_ptr_feedback_state_iterator_t *i /**< */)
3506 {
3507 --i->rem;
3508 ++i->data;
3509 i->index += sizeof(xcb_input_ptr_feedback_state_t);
3510 }
3511
3512
3513 /*****************************************************************************
3514 **
3515 ** xcb_generic_iterator_t xcb_input_ptr_feedback_state_end
3516 **
3517 ** @param xcb_input_ptr_feedback_state_iterator_t i
3518 ** @returns xcb_generic_iterator_t
3519 **
3520 *****************************************************************************/
3521
3522 xcb_generic_iterator_t
3523 xcb_input_ptr_feedback_state_end (xcb_input_ptr_feedback_state_iterator_t i /**< */)
3524 {
3525 xcb_generic_iterator_t ret;
3526 ret.data = i.data + i.rem;
3527 ret.index = i.index + ((char *) ret.data - (char *) i.data);
3528 ret.rem = 0;
3529 return ret;
3530 }
3531
3532
3533 /*****************************************************************************
3534 **
3535 ** void xcb_input_integer_feedback_state_next
3536 **
3537 ** @param xcb_input_integer_feedback_state_iterator_t *i
3538 ** @returns void
3539 **
3540 *****************************************************************************/
3541
3542 void
3543 xcb_input_integer_feedback_state_next (xcb_input_integer_feedback_state_iterator_t *i /**< */)
3544 {
3545 --i->rem;
3546 ++i->data;
3547 i->index += sizeof(xcb_input_integer_feedback_state_t);
3548 }
3549
3550
3551 /*****************************************************************************
3552 **
3553 ** xcb_generic_iterator_t xcb_input_integer_feedback_state_end
3554 **
3555 ** @param xcb_input_integer_feedback_state_iterator_t i
3556 ** @returns xcb_generic_iterator_t
3557 **
3558 *****************************************************************************/
3559
3560 xcb_generic_iterator_t
3561 xcb_input_integer_feedback_state_end (xcb_input_integer_feedback_state_iterator_t i /**< */)
3562 {
3563 xcb_generic_iterator_t ret;
3564 ret.data = i.data + i.rem;
3565 ret.index = i.index + ((char *) ret.data - (char *) i.data);
3566 ret.rem = 0;
3567 return ret;
3568 }
3569
3570 int
3571 xcb_input_string_feedback_state_sizeof (const void *_buffer /**< */)
3572 {
3573 char *xcb_tmp = (char *)_buffer;
3574 const xcb_input_string_feedback_state_t *_aux = (xcb_input_string_feedback_state_t *)_buffer;
3575 unsigned int xcb_buffer_len = 0;
3576 unsigned int xcb_block_len = 0;
3577 unsigned int xcb_pad = 0;
3578 unsigned int xcb_align_to = 0;
3579
3580
3581 xcb_block_len += sizeof(xcb_input_string_feedback_state_t);
3582 xcb_tmp += xcb_block_len;
3583 xcb_buffer_len += xcb_block_len;
3584 xcb_block_len = 0;
3585 /* keysyms */
3586 xcb_block_len += _aux->num_keysyms * sizeof(xcb_keysym_t);
3587 xcb_tmp += xcb_block_len;
3588 xcb_align_to = ALIGNOF(xcb_keysym_t);
3589 /* insert padding */
3590 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3591 xcb_buffer_len += xcb_block_len + xcb_pad;
3592 if (0 != xcb_pad) {
3593 xcb_tmp += xcb_pad;
3594 xcb_pad = 0;
3595 }
3596 xcb_block_len = 0;
3597
3598 return xcb_buffer_len;
3599 }
3600
3601
3602 /*****************************************************************************
3603 **
3604 ** xcb_keysym_t * xcb_input_string_feedback_state_keysyms
3605 **
3606 ** @param const xcb_input_string_feedback_state_t *R
3607 ** @returns xcb_keysym_t *
3608 **
3609 *****************************************************************************/
3610
3611 xcb_keysym_t *
3612 xcb_input_string_feedback_state_keysyms (const xcb_input_string_feedback_state_t *R /**< */)
3613 {
3614 return (xcb_keysym_t *) (R + 1);
3615 }
3616
3617
3618 /*****************************************************************************
3619 **
3620 ** int xcb_input_string_feedback_state_keysyms_length
3621 **
3622 ** @param const xcb_input_string_feedback_state_t *R
3623 ** @returns int
3624 **
3625 *****************************************************************************/
3626
3627 int
3628 xcb_input_string_feedback_state_keysyms_length (const xcb_input_string_feedback_state_t *R /**< */)
3629 {
3630 return R->num_keysyms;
3631 }
3632
3633
3634 /*****************************************************************************
3635 **
3636 ** xcb_generic_iterator_t xcb_input_string_feedback_state_keysyms_end
3637 **
3638 ** @param const xcb_input_string_feedback_state_t *R
3639 ** @returns xcb_generic_iterator_t
3640 **
3641 *****************************************************************************/
3642
3643 xcb_generic_iterator_t
3644 xcb_input_string_feedback_state_keysyms_end (const xcb_input_string_feedback_state_t *R /**< */)
3645 {
3646 xcb_generic_iterator_t i;
3647 i.data = ((xcb_keysym_t *) (R + 1)) + (R->num_keysyms);
3648 i.rem = 0;
3649 i.index = (char *) i.data - (char *) R;
3650 return i;
3651 }
3652
3653
3654 /*****************************************************************************
3655 **
3656 ** void xcb_input_string_feedback_state_next
3657 **
3658 ** @param xcb_input_string_feedback_state_iterator_t *i
3659 ** @returns void
3660 **
3661 *****************************************************************************/
3662
3663 void
3664 xcb_input_string_feedback_state_next (xcb_input_string_feedback_state_iterator_t *i /**< */)
3665 {
3666 xcb_input_string_feedback_state_t *R = i->data;
3667 xcb_generic_iterator_t child;
3668 child.data = (xcb_input_string_feedback_state_t *)(((char *)R) + xcb_input_string_feedback_state_sizeof(R));
3669 i->index = (char *) child.data - (char *) i->data;
3670 --i->rem;
3671 i->data = (xcb_input_string_feedback_state_t *) child.data;
3672 }
3673
3674
3675 /*****************************************************************************
3676 **
3677 ** xcb_generic_iterator_t xcb_input_string_feedback_state_end
3678 **
3679 ** @param xcb_input_string_feedback_state_iterator_t i
3680 ** @returns xcb_generic_iterator_t
3681 **
3682 *****************************************************************************/
3683
3684 xcb_generic_iterator_t
3685 xcb_input_string_feedback_state_end (xcb_input_string_feedback_state_iterator_t i /**< */)
3686 {
3687 xcb_generic_iterator_t ret;
3688 while(i.rem > 0)
3689 xcb_input_string_feedback_state_next(&i);
3690 ret.data = i.data;
3691 ret.rem = i.rem;
3692 ret.index = i.index;
3693 return ret;
3694 }
3695
3696
3697 /*****************************************************************************
3698 **
3699 ** void xcb_input_bell_feedback_state_next
3700 **
3701 ** @param xcb_input_bell_feedback_state_iterator_t *i
3702 ** @returns void
3703 **
3704 *****************************************************************************/
3705
3706 void
3707 xcb_input_bell_feedback_state_next (xcb_input_bell_feedback_state_iterator_t *i /**< */)
3708 {
3709 --i->rem;
3710 ++i->data;
3711 i->index += sizeof(xcb_input_bell_feedback_state_t);
3712 }
3713
3714
3715 /*****************************************************************************
3716 **
3717 ** xcb_generic_iterator_t xcb_input_bell_feedback_state_end
3718 **
3719 ** @param xcb_input_bell_feedback_state_iterator_t i
3720 ** @returns xcb_generic_iterator_t
3721 **
3722 *****************************************************************************/
3723
3724 xcb_generic_iterator_t
3725 xcb_input_bell_feedback_state_end (xcb_input_bell_feedback_state_iterator_t i /**< */)
3726 {
3727 xcb_generic_iterator_t ret;
3728 ret.data = i.data + i.rem;
3729 ret.index = i.index + ((char *) ret.data - (char *) i.data);
3730 ret.rem = 0;
3731 return ret;
3732 }
3733
3734
3735 /*****************************************************************************
3736 **
3737 ** void xcb_input_led_feedback_state_next
3738 **
3739 ** @param xcb_input_led_feedback_state_iterator_t *i
3740 ** @returns void
3741 **
3742 *****************************************************************************/
3743
3744 void
3745 xcb_input_led_feedback_state_next (xcb_input_led_feedback_state_iterator_t *i /**< */)
3746 {
3747 --i->rem;
3748 ++i->data;
3749 i->index += sizeof(xcb_input_led_feedback_state_t);
3750 }
3751
3752
3753 /*****************************************************************************
3754 **
3755 ** xcb_generic_iterator_t xcb_input_led_feedback_state_end
3756 **
3757 ** @param xcb_input_led_feedback_state_iterator_t i
3758 ** @returns xcb_generic_iterator_t
3759 **
3760 *****************************************************************************/
3761
3762 xcb_generic_iterator_t
3763 xcb_input_led_feedback_state_end (xcb_input_led_feedback_state_iterator_t i /**< */)
3764 {
3765 xcb_generic_iterator_t ret;
3766 ret.data = i.data + i.rem;
3767 ret.index = i.index + ((char *) ret.data - (char *) i.data);
3768 ret.rem = 0;
3769 return ret;
3770 }
3771
3772 int
3773 xcb_input_feedback_state_sizeof (const void *_buffer /**< */)
3774 {
3775 char *xcb_tmp = (char *)_buffer;
3776 const xcb_input_feedback_state_t *_aux = (xcb_input_feedback_state_t *)_buffer;
3777 unsigned int xcb_buffer_len = 0;
3778 unsigned int xcb_block_len = 0;
3779 unsigned int xcb_pad = 0;
3780 unsigned int xcb_align_to = 0;
3781
3782
3783 xcb_block_len += sizeof(xcb_input_feedback_state_t);
3784 xcb_tmp += xcb_block_len;
3785 xcb_buffer_len += xcb_block_len;
3786 xcb_block_len = 0;
3787 /* uninterpreted_data */
3788 xcb_block_len += (_aux->len - 4) * sizeof(uint8_t);
3789 xcb_tmp += xcb_block_len;
3790 xcb_align_to = ALIGNOF(uint8_t);
3791 /* insert padding */
3792 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3793 xcb_buffer_len += xcb_block_len + xcb_pad;
3794 if (0 != xcb_pad) {
3795 xcb_tmp += xcb_pad;
3796 xcb_pad = 0;
3797 }
3798 xcb_block_len = 0;
3799
3800 return xcb_buffer_len;
3801 }
3802
3803
3804 /*****************************************************************************
3805 **
3806 ** uint8_t * xcb_input_feedback_state_uninterpreted_data
3807 **
3808 ** @param const xcb_input_feedback_state_t *R
3809 ** @returns uint8_t *
3810 **
3811 *****************************************************************************/
3812
3813 uint8_t *
3814 xcb_input_feedback_state_uninterpreted_data (const xcb_input_feedback_state_t *R /**< */)
3815 {
3816 return (uint8_t *) (R + 1);
3817 }
3818
3819
3820 /*****************************************************************************
3821 **
3822 ** int xcb_input_feedback_state_uninterpreted_data_length
3823 **
3824 ** @param const xcb_input_feedback_state_t *R
3825 ** @returns int
3826 **
3827 *****************************************************************************/
3828
3829 int
3830 xcb_input_feedback_state_uninterpreted_data_length (const xcb_input_feedback_state_t *R /**< */)
3831 {
3832 return (R->len - 4);
3833 }
3834
3835
3836 /*****************************************************************************
3837 **
3838 ** xcb_generic_iterator_t xcb_input_feedback_state_uninterpreted_data_end
3839 **
3840 ** @param const xcb_input_feedback_state_t *R
3841 ** @returns xcb_generic_iterator_t
3842 **
3843 *****************************************************************************/
3844
3845 xcb_generic_iterator_t
3846 xcb_input_feedback_state_uninterpreted_data_end (const xcb_input_feedback_state_t *R /**< */)
3847 {
3848 xcb_generic_iterator_t i;
3849 i.data = ((uint8_t *) (R + 1)) + ((R->len - 4));
3850 i.rem = 0;
3851 i.index = (char *) i.data - (char *) R;
3852 return i;
3853 }
3854
3855
3856 /*****************************************************************************
3857 **
3858 ** void xcb_input_feedback_state_next
3859 **
3860 ** @param xcb_input_feedback_state_iterator_t *i
3861 ** @returns void
3862 **
3863 *****************************************************************************/
3864
3865 void
3866 xcb_input_feedback_state_next (xcb_input_feedback_state_iterator_t *i /**< */)
3867 {
3868 xcb_input_feedback_state_t *R = i->data;
3869 xcb_generic_iterator_t child;
3870 child.data = (xcb_input_feedback_state_t *)(((char *)R) + xcb_input_feedback_state_sizeof(R));
3871 i->index = (char *) child.data - (char *) i->data;
3872 --i->rem;
3873 i->data = (xcb_input_feedback_state_t *) child.data;
3874 }
3875
3876
3877 /*****************************************************************************
3878 **
3879 ** xcb_generic_iterator_t xcb_input_feedback_state_end
3880 **
3881 ** @param xcb_input_feedback_state_iterator_t i
3882 ** @returns xcb_generic_iterator_t
3883 **
3884 *****************************************************************************/
3885
3886 xcb_generic_iterator_t
3887 xcb_input_feedback_state_end (xcb_input_feedback_state_iterator_t i /**< */)
3888 {
3889 xcb_generic_iterator_t ret;
3890 while(i.rem > 0)
3891 xcb_input_feedback_state_next(&i);
3892 ret.data = i.data;
3893 ret.rem = i.rem;
3894 ret.index = i.index;
3895 return ret;
3896 }
3897
3898 int
3899 xcb_input_get_feedback_control_sizeof (const void *_buffer /**< */)
3900 {
3901 char *xcb_tmp = (char *)_buffer;
3902 const xcb_input_get_feedback_control_reply_t *_aux = (xcb_input_get_feedback_control_reply_t *)_buffer;
3903 unsigned int xcb_buffer_len = 0;
3904 unsigned int xcb_block_len = 0;
3905 unsigned int xcb_pad = 0;
3906 unsigned int xcb_align_to = 0;
3907
3908 unsigned int i;
3909 unsigned int xcb_tmp_len;
3910
3911 xcb_block_len += sizeof(xcb_input_get_feedback_control_reply_t);
3912 xcb_tmp += xcb_block_len;
3913 xcb_buffer_len += xcb_block_len;
3914 xcb_block_len = 0;
3915 /* feedbacks */
3916 for(i=0; i<_aux->num_feedbacks; i++) {
3917 xcb_tmp_len = xcb_input_feedback_state_sizeof(xcb_tmp);
3918 xcb_block_len += xcb_tmp_len;
3919 xcb_tmp += xcb_tmp_len;
3920 }
3921 xcb_align_to = ALIGNOF(xcb_input_feedback_state_t);
3922 /* insert padding */
3923 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3924 xcb_buffer_len += xcb_block_len + xcb_pad;
3925 if (0 != xcb_pad) {
3926 xcb_tmp += xcb_pad;
3927 xcb_pad = 0;
3928 }
3929 xcb_block_len = 0;
3930
3931 return xcb_buffer_len;
3932 }
3933
3934
3935 /*****************************************************************************
3936 **
3937 ** xcb_input_get_feedback_control_cookie_t xcb_input_get_feedback_control
3938 **
3939 ** @param xcb_connection_t *c
3940 ** @param uint8_t device_id
3941 ** @returns xcb_input_get_feedback_control_cookie_t
3942 **
3943 *****************************************************************************/
3944
3945 xcb_input_get_feedback_control_cookie_t
3946 xcb_input_get_feedback_control (xcb_connection_t *c /**< */,
3947 uint8_t device_id /**< */)
3948 {
3949 static const xcb_protocol_request_t xcb_req = {
3950 /* count */ 2,
3951 /* ext */ &xcb_input_id,
3952 /* opcode */ XCB_INPUT_GET_FEEDBACK_CONTROL,
3953 /* isvoid */ 0
3954 };
3955
3956 struct iovec xcb_parts[4];
3957 xcb_input_get_feedback_control_cookie_t xcb_ret;
3958 xcb_input_get_feedback_control_request_t xcb_out;
3959
3960 xcb_out.device_id = device_id;
3961 memset(xcb_out.pad0, 0, 3);
3962
3963 xcb_parts[2].iov_base = (char *) &xcb_out;
3964 xcb_parts[2].iov_len = sizeof(xcb_out);
3965 xcb_parts[3].iov_base = 0;
3966 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3967
3968 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3969 return xcb_ret;
3970 }
3971
3972
3973 /*****************************************************************************
3974 **
3975 ** xcb_input_get_feedback_control_cookie_t xcb_input_get_feedback_control_unchecked
3976 **
3977 ** @param xcb_connection_t *c
3978 ** @param uint8_t device_id
3979 ** @returns xcb_input_get_feedback_control_cookie_t
3980 **
3981 *****************************************************************************/
3982
3983 xcb_input_get_feedback_control_cookie_t
3984 xcb_input_get_feedback_control_unchecked (xcb_connection_t *c /**< */,
3985 uint8_t device_id /**< */)
3986 {
3987 static const xcb_protocol_request_t xcb_req = {
3988 /* count */ 2,
3989 /* ext */ &xcb_input_id,
3990 /* opcode */ XCB_INPUT_GET_FEEDBACK_CONTROL,
3991 /* isvoid */ 0
3992 };
3993
3994 struct iovec xcb_parts[4];
3995 xcb_input_get_feedback_control_cookie_t xcb_ret;
3996 xcb_input_get_feedback_control_request_t xcb_out;
3997
3998 xcb_out.device_id = device_id;
3999 memset(xcb_out.pad0, 0, 3);
4000
4001 xcb_parts[2].iov_base = (char *) &xcb_out;
4002 xcb_parts[2].iov_len = sizeof(xcb_out);
4003 xcb_parts[3].iov_base = 0;
4004 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4005
4006 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
4007 return xcb_ret;
4008 }
4009
4010
4011 /*****************************************************************************
4012 **
4013 ** int xcb_input_get_feedback_control_feedbacks_length
4014 **
4015 ** @param const xcb_input_get_feedback_control_reply_t *R
4016 ** @returns int
4017 **
4018 *****************************************************************************/
4019
4020 int
4021 xcb_input_get_feedback_control_feedbacks_length (const xcb_input_get_feedback_control_reply_t *R /**< */)
4022 {
4023 return R->num_feedbacks;
4024 }
4025
4026
4027 /*****************************************************************************
4028 **
4029 ** xcb_input_feedback_state_iterator_t xcb_input_get_feedback_control_feedbacks_iterator
4030 **
4031 ** @param const xcb_input_get_feedback_control_reply_t *R
4032 ** @returns xcb_input_feedback_state_iterator_t
4033 **
4034 *****************************************************************************/
4035
4036 xcb_input_feedback_state_iterator_t
4037 xcb_input_get_feedback_control_feedbacks_iterator (const xcb_input_get_feedback_control_reply_t *R /**< */)
4038 {
4039 xcb_input_feedback_state_iterator_t i;
4040 i.data = (xcb_input_feedback_state_t *) (R + 1);
4041 i.rem = R->num_feedbacks;
4042 i.index = (char *) i.data - (char *) R;
4043 return i;
4044 }
4045
4046
4047 /*****************************************************************************
4048 **
4049 ** xcb_input_get_feedback_control_reply_t * xcb_input_get_feedback_control_reply
4050 **
4051 ** @param xcb_connection_t *c
4052 ** @param xcb_input_get_feedback_control_cookie_t cookie
4053 ** @param xcb_generic_error_t **e
4054 ** @returns xcb_input_get_feedback_control_reply_t *
4055 **
4056 *****************************************************************************/
4057
4058 xcb_input_get_feedback_control_reply_t *
4059 xcb_input_get_feedback_control_reply (xcb_connection_t *c /**< */,
4060 xcb_input_get_feedback_control_cookie_t cookie /**< */,
4061 xcb_generic_error_t **e /**< */)
4062 {
4063 return (xcb_input_get_feedback_control_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
4064 }
4065
4066
4067 /*****************************************************************************
4068 **
4069 ** void xcb_input_kbd_feedback_ctl_next
4070 **
4071 ** @param xcb_input_kbd_feedback_ctl_iterator_t *i
4072 ** @returns void
4073 **
4074 *****************************************************************************/
4075
4076 void
4077 xcb_input_kbd_feedback_ctl_next (xcb_input_kbd_feedback_ctl_iterator_t *i /**< */)
4078 {
4079 --i->rem;
4080 ++i->data;
4081 i->index += sizeof(xcb_input_kbd_feedback_ctl_t);
4082 }
4083
4084
4085 /*****************************************************************************
4086 **
4087 ** xcb_generic_iterator_t xcb_input_kbd_feedback_ctl_end
4088 **
4089 ** @param xcb_input_kbd_feedback_ctl_iterator_t i
4090 ** @returns xcb_generic_iterator_t
4091 **
4092 *****************************************************************************/
4093
4094 xcb_generic_iterator_t
4095 xcb_input_kbd_feedback_ctl_end (xcb_input_kbd_feedback_ctl_iterator_t i /**< */)
4096 {
4097 xcb_generic_iterator_t ret;
4098 ret.data = i.data + i.rem;
4099 ret.index = i.index + ((char *) ret.data - (char *) i.data);
4100 ret.rem = 0;
4101 return ret;
4102 }
4103
4104
4105 /*****************************************************************************
4106 **
4107 ** void xcb_input_ptr_feedback_ctl_next
4108 **
4109 ** @param xcb_input_ptr_feedback_ctl_iterator_t *i
4110 ** @returns void
4111 **
4112 *****************************************************************************/
4113
4114 void
4115 xcb_input_ptr_feedback_ctl_next (xcb_input_ptr_feedback_ctl_iterator_t *i /**< */)
4116 {
4117 --i->rem;
4118 ++i->data;
4119 i->index += sizeof(xcb_input_ptr_feedback_ctl_t);
4120 }
4121
4122
4123 /*****************************************************************************
4124 **
4125 ** xcb_generic_iterator_t xcb_input_ptr_feedback_ctl_end
4126 **
4127 ** @param xcb_input_ptr_feedback_ctl_iterator_t i
4128 ** @returns xcb_generic_iterator_t
4129 **
4130 *****************************************************************************/
4131
4132 xcb_generic_iterator_t
4133 xcb_input_ptr_feedback_ctl_end (xcb_input_ptr_feedback_ctl_iterator_t i /**< */)
4134 {
4135 xcb_generic_iterator_t ret;
4136 ret.data = i.data + i.rem;
4137 ret.index = i.index + ((char *) ret.data - (char *) i.data);
4138 ret.rem = 0;
4139 return ret;
4140 }
4141
4142
4143 /*****************************************************************************
4144 **
4145 ** void xcb_input_integer_feedback_ctl_next
4146 **
4147 ** @param xcb_input_integer_feedback_ctl_iterator_t *i
4148 ** @returns void
4149 **
4150 *****************************************************************************/
4151
4152 void
4153 xcb_input_integer_feedback_ctl_next (xcb_input_integer_feedback_ctl_iterator_t *i /**< */)
4154 {
4155 --i->rem;
4156 ++i->data;
4157 i->index += sizeof(xcb_input_integer_feedback_ctl_t);
4158 }
4159
4160
4161 /*****************************************************************************
4162 **
4163 ** xcb_generic_iterator_t xcb_input_integer_feedback_ctl_end
4164 **
4165 ** @param xcb_input_integer_feedback_ctl_iterator_t i
4166 ** @returns xcb_generic_iterator_t
4167 **
4168 *****************************************************************************/
4169
4170 xcb_generic_iterator_t
4171 xcb_input_integer_feedback_ctl_end (xcb_input_integer_feedback_ctl_iterator_t i /**< */)
4172 {
4173 xcb_generic_iterator_t ret;
4174 ret.data = i.data + i.rem;
4175 ret.index = i.index + ((char *) ret.data - (char *) i.data);
4176 ret.rem = 0;
4177 return ret;
4178 }
4179
4180 int
4181 xcb_input_string_feedback_ctl_sizeof (const void *_buffer /**< */)
4182 {
4183 char *xcb_tmp = (char *)_buffer;
4184 const xcb_input_string_feedback_ctl_t *_aux = (xcb_input_string_feedback_ctl_t *)_buffer;
4185 unsigned int xcb_buffer_len = 0;
4186 unsigned int xcb_block_len = 0;
4187 unsigned int xcb_pad = 0;
4188 unsigned int xcb_align_to = 0;
4189
4190
4191 xcb_block_len += sizeof(xcb_input_string_feedback_ctl_t);
4192 xcb_tmp += xcb_block_len;
4193 xcb_buffer_len += xcb_block_len;
4194 xcb_block_len = 0;
4195 /* keysyms */
4196 xcb_block_len += _aux->num_keysyms * sizeof(xcb_keysym_t);
4197 xcb_tmp += xcb_block_len;
4198 xcb_align_to = ALIGNOF(xcb_keysym_t);
4199 /* insert padding */
4200 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4201 xcb_buffer_len += xcb_block_len + xcb_pad;
4202 if (0 != xcb_pad) {
4203 xcb_tmp += xcb_pad;
4204 xcb_pad = 0;
4205 }
4206 xcb_block_len = 0;
4207
4208 return xcb_buffer_len;
4209 }
4210
4211
4212 /*****************************************************************************
4213 **
4214 ** xcb_keysym_t * xcb_input_string_feedback_ctl_keysyms
4215 **
4216 ** @param const xcb_input_string_feedback_ctl_t *R
4217 ** @returns xcb_keysym_t *
4218 **
4219 *****************************************************************************/
4220
4221 xcb_keysym_t *
4222 xcb_input_string_feedback_ctl_keysyms (const xcb_input_string_feedback_ctl_t *R /**< */)
4223 {
4224 return (xcb_keysym_t *) (R + 1);
4225 }
4226
4227
4228 /*****************************************************************************
4229 **
4230 ** int xcb_input_string_feedback_ctl_keysyms_length
4231 **
4232 ** @param const xcb_input_string_feedback_ctl_t *R
4233 ** @returns int
4234 **
4235 *****************************************************************************/
4236
4237 int
4238 xcb_input_string_feedback_ctl_keysyms_length (const xcb_input_string_feedback_ctl_t *R /**< */)
4239 {
4240 return R->num_keysyms;
4241 }
4242
4243
4244 /*****************************************************************************
4245 **
4246 ** xcb_generic_iterator_t xcb_input_string_feedback_ctl_keysyms_end
4247 **
4248 ** @param const xcb_input_string_feedback_ctl_t *R
4249 ** @returns xcb_generic_iterator_t
4250 **
4251 *****************************************************************************/
4252
4253 xcb_generic_iterator_t
4254 xcb_input_string_feedback_ctl_keysyms_end (const xcb_input_string_feedback_ctl_t *R /**< */)
4255 {
4256 xcb_generic_iterator_t i;
4257 i.data = ((xcb_keysym_t *) (R + 1)) + (R->num_keysyms);
4258 i.rem = 0;
4259 i.index = (char *) i.data - (char *) R;
4260 return i;
4261 }
4262
4263
4264 /*****************************************************************************
4265 **
4266 ** void xcb_input_string_feedback_ctl_next
4267 **
4268 ** @param xcb_input_string_feedback_ctl_iterator_t *i
4269 ** @returns void
4270 **
4271 *****************************************************************************/
4272
4273 void
4274 xcb_input_string_feedback_ctl_next (xcb_input_string_feedback_ctl_iterator_t *i /**< */)
4275 {
4276 xcb_input_string_feedback_ctl_t *R = i->data;
4277 xcb_generic_iterator_t child;
4278 child.data = (xcb_input_string_feedback_ctl_t *)(((char *)R) + xcb_input_string_feedback_ctl_sizeof(R));
4279 i->index = (char *) child.data - (char *) i->data;
4280 --i->rem;
4281 i->data = (xcb_input_string_feedback_ctl_t *) child.data;
4282 }
4283
4284
4285 /*****************************************************************************
4286 **
4287 ** xcb_generic_iterator_t xcb_input_string_feedback_ctl_end
4288 **
4289 ** @param xcb_input_string_feedback_ctl_iterator_t i
4290 ** @returns xcb_generic_iterator_t
4291 **
4292 *****************************************************************************/
4293
4294 xcb_generic_iterator_t
4295 xcb_input_string_feedback_ctl_end (xcb_input_string_feedback_ctl_iterator_t i /**< */)
4296 {
4297 xcb_generic_iterator_t ret;
4298 while(i.rem > 0)
4299 xcb_input_string_feedback_ctl_next(&i);
4300 ret.data = i.data;
4301 ret.rem = i.rem;
4302 ret.index = i.index;
4303 return ret;
4304 }
4305
4306
4307 /*****************************************************************************
4308 **
4309 ** void xcb_input_bell_feedback_ctl_next
4310 **
4311 ** @param xcb_input_bell_feedback_ctl_iterator_t *i
4312 ** @returns void
4313 **
4314 *****************************************************************************/
4315
4316 void
4317 xcb_input_bell_feedback_ctl_next (xcb_input_bell_feedback_ctl_iterator_t *i /**< */)
4318 {
4319 --i->rem;
4320 ++i->data;
4321 i->index += sizeof(xcb_input_bell_feedback_ctl_t);
4322 }
4323
4324
4325 /*****************************************************************************
4326 **
4327 ** xcb_generic_iterator_t xcb_input_bell_feedback_ctl_end
4328 **
4329 ** @param xcb_input_bell_feedback_ctl_iterator_t i
4330 ** @returns xcb_generic_iterator_t
4331 **
4332 *****************************************************************************/
4333
4334 xcb_generic_iterator_t
4335 xcb_input_bell_feedback_ctl_end (xcb_input_bell_feedback_ctl_iterator_t i /**< */)
4336 {
4337 xcb_generic_iterator_t ret;
4338 ret.data = i.data + i.rem;
4339 ret.index = i.index + ((char *) ret.data - (char *) i.data);
4340 ret.rem = 0;
4341 return ret;
4342 }
4343
4344
4345 /*****************************************************************************
4346 **
4347 ** void xcb_input_led_feedback_ctl_next
4348 **
4349 ** @param xcb_input_led_feedback_ctl_iterator_t *i
4350 ** @returns void
4351 **
4352 *****************************************************************************/
4353
4354 void
4355 xcb_input_led_feedback_ctl_next (xcb_input_led_feedback_ctl_iterator_t *i /**< */)
4356 {
4357 --i->rem;
4358 ++i->data;
4359 i->index += sizeof(xcb_input_led_feedback_ctl_t);
4360 }
4361
4362
4363 /*****************************************************************************
4364 **
4365 ** xcb_generic_iterator_t xcb_input_led_feedback_ctl_end
4366 **
4367 ** @param xcb_input_led_feedback_ctl_iterator_t i
4368 ** @returns xcb_generic_iterator_t
4369 **
4370 *****************************************************************************/
4371
4372 xcb_generic_iterator_t
4373 xcb_input_led_feedback_ctl_end (xcb_input_led_feedback_ctl_iterator_t i /**< */)
4374 {
4375 xcb_generic_iterator_t ret;
4376 ret.data = i.data + i.rem;
4377 ret.index = i.index + ((char *) ret.data - (char *) i.data);
4378 ret.rem = 0;
4379 return ret;
4380 }
4381
4382 int
4383 xcb_input_feedback_ctl_sizeof (const void *_buffer /**< */)
4384 {
4385 char *xcb_tmp = (char *)_buffer;
4386 const xcb_input_feedback_ctl_t *_aux = (xcb_input_feedback_ctl_t *)_buffer;
4387 unsigned int xcb_buffer_len = 0;
4388 unsigned int xcb_block_len = 0;
4389 unsigned int xcb_pad = 0;
4390 unsigned int xcb_align_to = 0;
4391
4392
4393 xcb_block_len += sizeof(xcb_input_feedback_ctl_t);
4394 xcb_tmp += xcb_block_len;
4395 xcb_buffer_len += xcb_block_len;
4396 xcb_block_len = 0;
4397 /* uninterpreted_data */
4398 xcb_block_len += (_aux->len - 4) * sizeof(uint8_t);
4399 xcb_tmp += xcb_block_len;
4400 xcb_align_to = ALIGNOF(uint8_t);
4401 /* insert padding */
4402 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4403 xcb_buffer_len += xcb_block_len + xcb_pad;
4404 if (0 != xcb_pad) {
4405 xcb_tmp += xcb_pad;
4406 xcb_pad = 0;
4407 }
4408 xcb_block_len = 0;
4409
4410 return xcb_buffer_len;
4411 }
4412
4413
4414 /*****************************************************************************
4415 **
4416 ** uint8_t * xcb_input_feedback_ctl_uninterpreted_data
4417 **
4418 ** @param const xcb_input_feedback_ctl_t *R
4419 ** @returns uint8_t *
4420 **
4421 *****************************************************************************/
4422
4423 uint8_t *
4424 xcb_input_feedback_ctl_uninterpreted_data (const xcb_input_feedback_ctl_t *R /**< */)
4425 {
4426 return (uint8_t *) (R + 1);
4427 }
4428
4429
4430 /*****************************************************************************
4431 **
4432 ** int xcb_input_feedback_ctl_uninterpreted_data_length
4433 **
4434 ** @param const xcb_input_feedback_ctl_t *R
4435 ** @returns int
4436 **
4437 *****************************************************************************/
4438
4439 int
4440 xcb_input_feedback_ctl_uninterpreted_data_length (const xcb_input_feedback_ctl_t *R /**< */)
4441 {
4442 return (R->len - 4);
4443 }
4444
4445
4446 /*****************************************************************************
4447 **
4448 ** xcb_generic_iterator_t xcb_input_feedback_ctl_uninterpreted_data_end
4449 **
4450 ** @param const xcb_input_feedback_ctl_t *R
4451 ** @returns xcb_generic_iterator_t
4452 **
4453 *****************************************************************************/
4454
4455 xcb_generic_iterator_t
4456 xcb_input_feedback_ctl_uninterpreted_data_end (const xcb_input_feedback_ctl_t *R /**< */)
4457 {
4458 xcb_generic_iterator_t i;
4459 i.data = ((uint8_t *) (R + 1)) + ((R->len - 4));
4460 i.rem = 0;
4461 i.index = (char *) i.data - (char *) R;
4462 return i;
4463 }
4464
4465
4466 /*****************************************************************************
4467 **
4468 ** void xcb_input_feedback_ctl_next
4469 **
4470 ** @param xcb_input_feedback_ctl_iterator_t *i
4471 ** @returns void
4472 **
4473 *****************************************************************************/
4474
4475 void
4476 xcb_input_feedback_ctl_next (xcb_input_feedback_ctl_iterator_t *i /**< */)
4477 {
4478 xcb_input_feedback_ctl_t *R = i->data;
4479 xcb_generic_iterator_t child;
4480 child.data = (xcb_input_feedback_ctl_t *)(((char *)R) + xcb_input_feedback_ctl_sizeof(R));
4481 i->index = (char *) child.data - (char *) i->data;
4482 --i->rem;
4483 i->data = (xcb_input_feedback_ctl_t *) child.data;
4484 }
4485
4486
4487 /*****************************************************************************
4488 **
4489 ** xcb_generic_iterator_t xcb_input_feedback_ctl_end
4490 **
4491 ** @param xcb_input_feedback_ctl_iterator_t i
4492 ** @returns xcb_generic_iterator_t
4493 **
4494 *****************************************************************************/
4495
4496 xcb_generic_iterator_t
4497 xcb_input_feedback_ctl_end (xcb_input_feedback_ctl_iterator_t i /**< */)
4498 {
4499 xcb_generic_iterator_t ret;
4500 while(i.rem > 0)
4501 xcb_input_feedback_ctl_next(&i);
4502 ret.data = i.data;
4503 ret.rem = i.rem;
4504 ret.index = i.index;
4505 return ret;
4506 }
4507
4508 int
4509 xcb_input_change_feedback_control_sizeof (const void *_buffer /**< */)
4510 {
4511 char *xcb_tmp = (char *)_buffer;
4512 unsigned int xcb_buffer_len = 0;
4513 unsigned int xcb_block_len = 0;
4514 unsigned int xcb_pad = 0;
4515 unsigned int xcb_align_to = 0;
4516
4517
4518 xcb_block_len += sizeof(xcb_input_change_feedback_control_request_t);
4519 xcb_tmp += xcb_block_len;
4520 xcb_buffer_len += xcb_block_len;
4521 xcb_block_len = 0;
4522 /* feedback */
4523 xcb_block_len += xcb_input_feedback_ctl_sizeof(xcb_tmp);
4524 xcb_tmp += xcb_block_len;
4525 xcb_align_to = ALIGNOF(xcb_input_feedback_ctl_t);
4526 /* insert padding */
4527 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4528 xcb_buffer_len += xcb_block_len + xcb_pad;
4529 if (0 != xcb_pad) {
4530 xcb_tmp += xcb_pad;
4531 xcb_pad = 0;
4532 }
4533 xcb_block_len = 0;
4534
4535 return xcb_buffer_len;
4536 }
4537
4538
4539 /*****************************************************************************
4540 **
4541 ** xcb_void_cookie_t xcb_input_change_feedback_control_checked
4542 **
4543 ** @param xcb_connection_t *c
4544 ** @param uint32_t mask
4545 ** @param uint8_t device_id
4546 ** @param uint8_t feedback_id
4547 ** @param xcb_input_feedback_ctl_t *feedback
4548 ** @returns xcb_void_cookie_t
4549 **
4550 *****************************************************************************/
4551
4552 xcb_void_cookie_t
4553 xcb_input_change_feedback_control_checked (xcb_connection_t *c /**< */,
4554 uint32_t mask /**< */,
4555 uint8_t device_id /**< */,
4556 uint8_t feedback_id /**< */,
4557 xcb_input_feedback_ctl_t *feedback /**< */)
4558 {
4559 static const xcb_protocol_request_t xcb_req = {
4560 /* count */ 4,
4561 /* ext */ &xcb_input_id,
4562 /* opcode */ XCB_INPUT_CHANGE_FEEDBACK_CONTROL,
4563 /* isvoid */ 1
4564 };
4565
4566 struct iovec xcb_parts[6];
4567 xcb_void_cookie_t xcb_ret;
4568 xcb_input_change_feedback_control_request_t xcb_out;
4569
4570 xcb_out.mask = mask;
4571 xcb_out.device_id = device_id;
4572 xcb_out.feedback_id = feedback_id;
4573
4574 xcb_parts[2].iov_base = (char *) &xcb_out;
4575 xcb_parts[2].iov_len = sizeof(xcb_out);
4576 xcb_parts[3].iov_base = 0;
4577 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4578 /* xcb_input_feedback_ctl_t feedback */
4579 xcb_parts[4].iov_base = (char *) feedback;
4580 xcb_parts[4].iov_len =
4581 xcb_input_feedback_ctl_sizeof (feedback);
4582
4583 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
4584 return xcb_ret;
4585 }
4586
4587
4588 /*****************************************************************************
4589 **
4590 ** xcb_void_cookie_t xcb_input_change_feedback_control
4591 **
4592 ** @param xcb_connection_t *c
4593 ** @param uint32_t mask
4594 ** @param uint8_t device_id
4595 ** @param uint8_t feedback_id
4596 ** @param xcb_input_feedback_ctl_t *feedback
4597 ** @returns xcb_void_cookie_t
4598 **
4599 *****************************************************************************/
4600
4601 xcb_void_cookie_t
4602 xcb_input_change_feedback_control (xcb_connection_t *c /**< */,
4603 uint32_t mask /**< */,
4604 uint8_t device_id /**< */,
4605 uint8_t feedback_id /**< */,
4606 xcb_input_feedback_ctl_t *feedback /**< */)
4607 {
4608 static const xcb_protocol_request_t xcb_req = {
4609 /* count */ 4,
4610 /* ext */ &xcb_input_id,
4611 /* opcode */ XCB_INPUT_CHANGE_FEEDBACK_CONTROL,
4612 /* isvoid */ 1
4613 };
4614
4615 struct iovec xcb_parts[6];
4616 xcb_void_cookie_t xcb_ret;
4617 xcb_input_change_feedback_control_request_t xcb_out;
4618
4619 xcb_out.mask = mask;
4620 xcb_out.device_id = device_id;
4621 xcb_out.feedback_id = feedback_id;
4622
4623 xcb_parts[2].iov_base = (char *) &xcb_out;
4624 xcb_parts[2].iov_len = sizeof(xcb_out);
4625 xcb_parts[3].iov_base = 0;
4626 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4627 /* xcb_input_feedback_ctl_t feedback */
4628 xcb_parts[4].iov_base = (char *) feedback;
4629 xcb_parts[4].iov_len =
4630 xcb_input_feedback_ctl_sizeof (feedback);
4631
4632 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
4633 return xcb_ret;
4634 }
4635
4636 int
4637 xcb_input_get_device_key_mapping_sizeof (const void *_buffer /**< */)
4638 {
4639 char *xcb_tmp = (char *)_buffer;
4640 const xcb_input_get_device_key_mapping_reply_t *_aux = (xcb_input_get_device_key_mapping_reply_t *)_buffer;
4641 unsigned int xcb_buffer_len = 0;
4642 unsigned int xcb_block_len = 0;
4643 unsigned int xcb_pad = 0;
4644 unsigned int xcb_align_to = 0;
4645
4646
4647 xcb_block_len += sizeof(xcb_input_get_device_key_mapping_reply_t);
4648 xcb_tmp += xcb_block_len;
4649 xcb_buffer_len += xcb_block_len;
4650 xcb_block_len = 0;
4651 /* keysyms */
4652 xcb_block_len += _aux->length * sizeof(xcb_keysym_t);
4653 xcb_tmp += xcb_block_len;
4654 xcb_align_to = ALIGNOF(xcb_keysym_t);
4655 /* insert padding */
4656 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4657 xcb_buffer_len += xcb_block_len + xcb_pad;
4658 if (0 != xcb_pad) {
4659 xcb_tmp += xcb_pad;
4660 xcb_pad = 0;
4661 }
4662 xcb_block_len = 0;
4663
4664 return xcb_buffer_len;
4665 }
4666
4667
4668 /*****************************************************************************
4669 **
4670 ** xcb_input_get_device_key_mapping_cookie_t xcb_input_get_device_key_mapping
4671 **
4672 ** @param xcb_connection_t *c
4673 ** @param uint8_t device_id
4674 ** @param xcb_input_key_code_t first_keycode
4675 ** @param uint8_t count
4676 ** @returns xcb_input_get_device_key_mapping_cookie_t
4677 **
4678 *****************************************************************************/
4679
4680 xcb_input_get_device_key_mapping_cookie_t
4681 xcb_input_get_device_key_mapping (xcb_connection_t *c /**< */,
4682 uint8_t device_id /**< */,
4683 xcb_input_key_code_t first_keycode /**< */,
4684 uint8_t count /**< */)
4685 {
4686 static const xcb_protocol_request_t xcb_req = {
4687 /* count */ 2,
4688 /* ext */ &xcb_input_id,
4689 /* opcode */ XCB_INPUT_GET_DEVICE_KEY_MAPPING,
4690 /* isvoid */ 0
4691 };
4692
4693 struct iovec xcb_parts[4];
4694 xcb_input_get_device_key_mapping_cookie_t xcb_ret;
4695 xcb_input_get_device_key_mapping_request_t xcb_out;
4696
4697 xcb_out.device_id = device_id;
4698 xcb_out.first_keycode = first_keycode;
4699 xcb_out.count = count;
4700
4701 xcb_parts[2].iov_base = (char *) &xcb_out;
4702 xcb_parts[2].iov_len = sizeof(xcb_out);
4703 xcb_parts[3].iov_base = 0;
4704 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4705
4706 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
4707 return xcb_ret;
4708 }
4709
4710
4711 /*****************************************************************************
4712 **
4713 ** xcb_input_get_device_key_mapping_cookie_t xcb_input_get_device_key_mapping_unchecked
4714 **
4715 ** @param xcb_connection_t *c
4716 ** @param uint8_t device_id
4717 ** @param xcb_input_key_code_t first_keycode
4718 ** @param uint8_t count
4719 ** @returns xcb_input_get_device_key_mapping_cookie_t
4720 **
4721 *****************************************************************************/
4722
4723 xcb_input_get_device_key_mapping_cookie_t
4724 xcb_input_get_device_key_mapping_unchecked (xcb_connection_t *c /**< */,
4725 uint8_t device_id /**< */,
4726 xcb_input_key_code_t first_keycode /**< */,
4727 uint8_t count /**< */)
4728 {
4729 static const xcb_protocol_request_t xcb_req = {
4730 /* count */ 2,
4731 /* ext */ &xcb_input_id,
4732 /* opcode */ XCB_INPUT_GET_DEVICE_KEY_MAPPING,
4733 /* isvoid */ 0
4734 };
4735
4736 struct iovec xcb_parts[4];
4737 xcb_input_get_device_key_mapping_cookie_t xcb_ret;
4738 xcb_input_get_device_key_mapping_request_t xcb_out;
4739
4740 xcb_out.device_id = device_id;
4741 xcb_out.first_keycode = first_keycode;
4742 xcb_out.count = count;
4743
4744 xcb_parts[2].iov_base = (char *) &xcb_out;
4745 xcb_parts[2].iov_len = sizeof(xcb_out);
4746 xcb_parts[3].iov_base = 0;
4747 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4748
4749 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
4750 return xcb_ret;
4751 }
4752
4753
4754 /*****************************************************************************
4755 **
4756 ** xcb_keysym_t * xcb_input_get_device_key_mapping_keysyms
4757 **
4758 ** @param const xcb_input_get_device_key_mapping_reply_t *R
4759 ** @returns xcb_keysym_t *
4760 **
4761 *****************************************************************************/
4762
4763 xcb_keysym_t *
4764 xcb_input_get_device_key_mapping_keysyms (const xcb_input_get_device_key_mapping_reply_t *R /**< */)
4765 {
4766 return (xcb_keysym_t *) (R + 1);
4767 }
4768
4769
4770 /*****************************************************************************
4771 **
4772 ** int xcb_input_get_device_key_mapping_keysyms_length
4773 **
4774 ** @param const xcb_input_get_device_key_mapping_reply_t *R
4775 ** @returns int
4776 **
4777 *****************************************************************************/
4778
4779 int
4780 xcb_input_get_device_key_mapping_keysyms_length (const xcb_input_get_device_key_mapping_reply_t *R /**< */)
4781 {
4782 return R->length;
4783 }
4784
4785
4786 /*****************************************************************************
4787 **
4788 ** xcb_generic_iterator_t xcb_input_get_device_key_mapping_keysyms_end
4789 **
4790 ** @param const xcb_input_get_device_key_mapping_reply_t *R
4791 ** @returns xcb_generic_iterator_t
4792 **
4793 *****************************************************************************/
4794
4795 xcb_generic_iterator_t
4796 xcb_input_get_device_key_mapping_keysyms_end (const xcb_input_get_device_key_mapping_reply_t *R /**< */)
4797 {
4798 xcb_generic_iterator_t i;
4799 i.data = ((xcb_keysym_t *) (R + 1)) + (R->length);
4800 i.rem = 0;
4801 i.index = (char *) i.data - (char *) R;
4802 return i;
4803 }
4804
4805
4806 /*****************************************************************************
4807 **
4808 ** xcb_input_get_device_key_mapping_reply_t * xcb_input_get_device_key_mapping_reply
4809 **
4810 ** @param xcb_connection_t *c
4811 ** @param xcb_input_get_device_key_mapping_cookie_t cookie
4812 ** @param xcb_generic_error_t **e
4813 ** @returns xcb_input_get_device_key_mapping_reply_t *
4814 **
4815 *****************************************************************************/
4816
4817 xcb_input_get_device_key_mapping_reply_t *
4818 xcb_input_get_device_key_mapping_reply (xcb_connection_t *c /**< */,
4819 xcb_input_get_device_key_mapping_cookie_t cookie /**< */,
4820 xcb_generic_error_t **e /**< */)
4821 {
4822 return (xcb_input_get_device_key_mapping_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
4823 }
4824
4825 int
4826 xcb_input_change_device_key_mapping_sizeof (const void *_buffer /**< */)
4827 {
4828 char *xcb_tmp = (char *)_buffer;
4829 const xcb_input_change_device_key_mapping_request_t *_aux = (xcb_input_change_device_key_mapping_request_t *)_buffer;
4830 unsigned int xcb_buffer_len = 0;
4831 unsigned int xcb_block_len = 0;
4832 unsigned int xcb_pad = 0;
4833 unsigned int xcb_align_to = 0;
4834
4835
4836 xcb_block_len += sizeof(xcb_input_change_device_key_mapping_request_t);
4837 xcb_tmp += xcb_block_len;
4838 xcb_buffer_len += xcb_block_len;
4839 xcb_block_len = 0;
4840 /* keysyms */
4841 xcb_block_len += (_aux->keycode_count * _aux->keysyms_per_keycode) * sizeof(xcb_keysym_t);
4842 xcb_tmp += xcb_block_len;
4843 xcb_align_to = ALIGNOF(xcb_keysym_t);
4844 /* insert padding */
4845 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4846 xcb_buffer_len += xcb_block_len + xcb_pad;
4847 if (0 != xcb_pad) {
4848 xcb_tmp += xcb_pad;
4849 xcb_pad = 0;
4850 }
4851 xcb_block_len = 0;
4852
4853 return xcb_buffer_len;
4854 }
4855
4856
4857 /*****************************************************************************
4858 **
4859 ** xcb_void_cookie_t xcb_input_change_device_key_mapping_checked
4860 **
4861 ** @param xcb_connection_t *c
4862 ** @param uint8_t device_id
4863 ** @param xcb_input_key_code_t first_keycode
4864 ** @param uint8_t keysyms_per_keycode
4865 ** @param uint8_t keycode_count
4866 ** @param const xcb_keysym_t *keysyms
4867 ** @returns xcb_void_cookie_t
4868 **
4869 *****************************************************************************/
4870
4871 xcb_void_cookie_t
4872 xcb_input_change_device_key_mapping_checked (xcb_connection_t *c /**< */,
4873 uint8_t device_id /**< */,
4874 xcb_input_key_code_t first_keycode /**< */,
4875 uint8_t keysyms_per_keycode /**< */,
4876 uint8_t keycode_count /**< */,
4877 const xcb_keysym_t *keysyms /**< */)
4878 {
4879 static const xcb_protocol_request_t xcb_req = {
4880 /* count */ 4,
4881 /* ext */ &xcb_input_id,
4882 /* opcode */ XCB_INPUT_CHANGE_DEVICE_KEY_MAPPING,
4883 /* isvoid */ 1
4884 };
4885
4886 struct iovec xcb_parts[6];
4887 xcb_void_cookie_t xcb_ret;
4888 xcb_input_change_device_key_mapping_request_t xcb_out;
4889
4890 xcb_out.device_id = device_id;
4891 xcb_out.first_keycode = first_keycode;
4892 xcb_out.keysyms_per_keycode = keysyms_per_keycode;
4893 xcb_out.keycode_count = keycode_count;
4894
4895 xcb_parts[2].iov_base = (char *) &xcb_out;
4896 xcb_parts[2].iov_len = sizeof(xcb_out);
4897 xcb_parts[3].iov_base = 0;
4898 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4899 /* xcb_keysym_t keysyms */
4900 xcb_parts[4].iov_base = (char *) keysyms;
4901 xcb_parts[4].iov_len = (keycode_count * keysyms_per_keycode) * sizeof(xcb_keysym_t);
4902 xcb_parts[5].iov_base = 0;
4903 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
4904
4905 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
4906 return xcb_ret;
4907 }
4908
4909
4910 /*****************************************************************************
4911 **
4912 ** xcb_void_cookie_t xcb_input_change_device_key_mapping
4913 **
4914 ** @param xcb_connection_t *c
4915 ** @param uint8_t device_id
4916 ** @param xcb_input_key_code_t first_keycode
4917 ** @param uint8_t keysyms_per_keycode
4918 ** @param uint8_t keycode_count
4919 ** @param const xcb_keysym_t *keysyms
4920 ** @returns xcb_void_cookie_t
4921 **
4922 *****************************************************************************/
4923
4924 xcb_void_cookie_t
4925 xcb_input_change_device_key_mapping (xcb_connection_t *c /**< */,
4926 uint8_t device_id /**< */,
4927 xcb_input_key_code_t first_keycode /**< */,
4928 uint8_t keysyms_per_keycode /**< */,
4929 uint8_t keycode_count /**< */,
4930 const xcb_keysym_t *keysyms /**< */)
4931 {
4932 static const xcb_protocol_request_t xcb_req = {
4933 /* count */ 4,
4934 /* ext */ &xcb_input_id,
4935 /* opcode */ XCB_INPUT_CHANGE_DEVICE_KEY_MAPPING,
4936 /* isvoid */ 1
4937 };
4938
4939 struct iovec xcb_parts[6];
4940 xcb_void_cookie_t xcb_ret;
4941 xcb_input_change_device_key_mapping_request_t xcb_out;
4942
4943 xcb_out.device_id = device_id;
4944 xcb_out.first_keycode = first_keycode;
4945 xcb_out.keysyms_per_keycode = keysyms_per_keycode;
4946 xcb_out.keycode_count = keycode_count;
4947
4948 xcb_parts[2].iov_base = (char *) &xcb_out;
4949 xcb_parts[2].iov_len = sizeof(xcb_out);
4950 xcb_parts[3].iov_base = 0;
4951 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4952 /* xcb_keysym_t keysyms */
4953 xcb_parts[4].iov_base = (char *) keysyms;
4954 xcb_parts[4].iov_len = (keycode_count * keysyms_per_keycode) * sizeof(xcb_keysym_t);
4955 xcb_parts[5].iov_base = 0;
4956 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
4957
4958 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
4959 return xcb_ret;
4960 }
4961
4962 int
4963 xcb_input_get_device_modifier_mapping_sizeof (const void *_buffer /**< */)
4964 {
4965 char *xcb_tmp = (char *)_buffer;
4966 const xcb_input_get_device_modifier_mapping_reply_t *_aux = (xcb_input_get_device_modifier_mapping_reply_t *)_buffer;
4967 unsigned int xcb_buffer_len = 0;
4968 unsigned int xcb_block_len = 0;
4969 unsigned int xcb_pad = 0;
4970 unsigned int xcb_align_to = 0;
4971
4972
4973 xcb_block_len += sizeof(xcb_input_get_device_modifier_mapping_reply_t);
4974 xcb_tmp += xcb_block_len;
4975 xcb_buffer_len += xcb_block_len;
4976 xcb_block_len = 0;
4977 /* keymaps */
4978 xcb_block_len += (_aux->keycodes_per_modifier * 8) * sizeof(uint8_t);
4979 xcb_tmp += xcb_block_len;
4980 xcb_align_to = ALIGNOF(uint8_t);
4981 /* insert padding */
4982 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4983 xcb_buffer_len += xcb_block_len + xcb_pad;
4984 if (0 != xcb_pad) {
4985 xcb_tmp += xcb_pad;
4986 xcb_pad = 0;
4987 }
4988 xcb_block_len = 0;
4989
4990 return xcb_buffer_len;
4991 }
4992
4993
4994 /*****************************************************************************
4995 **
4996 ** xcb_input_get_device_modifier_mapping_cookie_t xcb_input_get_device_modifier_mapping
4997 **
4998 ** @param xcb_connection_t *c
4999 ** @param uint8_t device_id
5000 ** @returns xcb_input_get_device_modifier_mapping_cookie_t
5001 **
5002 *****************************************************************************/
5003
5004 xcb_input_get_device_modifier_mapping_cookie_t
5005 xcb_input_get_device_modifier_mapping (xcb_connection_t *c /**< */,
5006 uint8_t device_id /**< */)
5007 {
5008 static const xcb_protocol_request_t xcb_req = {
5009 /* count */ 2,
5010 /* ext */ &xcb_input_id,
5011 /* opcode */ XCB_INPUT_GET_DEVICE_MODIFIER_MAPPING,
5012 /* isvoid */ 0
5013 };
5014
5015 struct iovec xcb_parts[4];
5016 xcb_input_get_device_modifier_mapping_cookie_t xcb_ret;
5017 xcb_input_get_device_modifier_mapping_request_t xcb_out;
5018
5019 xcb_out.device_id = device_id;
5020 memset(xcb_out.pad0, 0, 3);
5021
5022 xcb_parts[2].iov_base = (char *) &xcb_out;
5023 xcb_parts[2].iov_len = sizeof(xcb_out);
5024 xcb_parts[3].iov_base = 0;
5025 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5026
5027 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
5028 return xcb_ret;
5029 }
5030
5031
5032 /*****************************************************************************
5033 **
5034 ** xcb_input_get_device_modifier_mapping_cookie_t xcb_input_get_device_modifier_mapping_unchecked
5035 **
5036 ** @param xcb_connection_t *c
5037 ** @param uint8_t device_id
5038 ** @returns xcb_input_get_device_modifier_mapping_cookie_t
5039 **
5040 *****************************************************************************/
5041
5042 xcb_input_get_device_modifier_mapping_cookie_t
5043 xcb_input_get_device_modifier_mapping_unchecked (xcb_connection_t *c /**< */,
5044 uint8_t device_id /**< */)
5045 {
5046 static const xcb_protocol_request_t xcb_req = {
5047 /* count */ 2,
5048 /* ext */ &xcb_input_id,
5049 /* opcode */ XCB_INPUT_GET_DEVICE_MODIFIER_MAPPING,
5050 /* isvoid */ 0
5051 };
5052
5053 struct iovec xcb_parts[4];
5054 xcb_input_get_device_modifier_mapping_cookie_t xcb_ret;
5055 xcb_input_get_device_modifier_mapping_request_t xcb_out;
5056
5057 xcb_out.device_id = device_id;
5058 memset(xcb_out.pad0, 0, 3);
5059
5060 xcb_parts[2].iov_base = (char *) &xcb_out;
5061 xcb_parts[2].iov_len = sizeof(xcb_out);
5062 xcb_parts[3].iov_base = 0;
5063 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5064
5065 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
5066 return xcb_ret;
5067 }
5068
5069
5070 /*****************************************************************************
5071 **
5072 ** uint8_t * xcb_input_get_device_modifier_mapping_keymaps
5073 **
5074 ** @param const xcb_input_get_device_modifier_mapping_reply_t *R
5075 ** @returns uint8_t *
5076 **
5077 *****************************************************************************/
5078
5079 uint8_t *
5080 xcb_input_get_device_modifier_mapping_keymaps (const xcb_input_get_device_modifier_mapping_reply_t *R /**< */)
5081 {
5082 return (uint8_t *) (R + 1);
5083 }
5084
5085
5086 /*****************************************************************************
5087 **
5088 ** int xcb_input_get_device_modifier_mapping_keymaps_length
5089 **
5090 ** @param const xcb_input_get_device_modifier_mapping_reply_t *R
5091 ** @returns int
5092 **
5093 *****************************************************************************/
5094
5095 int
5096 xcb_input_get_device_modifier_mapping_keymaps_length (const xcb_input_get_device_modifier_mapping_reply_t *R /**< */)
5097 {
5098 return (R->keycodes_per_modifier * 8);
5099 }
5100
5101
5102 /*****************************************************************************
5103 **
5104 ** xcb_generic_iterator_t xcb_input_get_device_modifier_mapping_keymaps_end
5105 **
5106 ** @param const xcb_input_get_device_modifier_mapping_reply_t *R
5107 ** @returns xcb_generic_iterator_t
5108 **
5109 *****************************************************************************/
5110
5111 xcb_generic_iterator_t
5112 xcb_input_get_device_modifier_mapping_keymaps_end (const xcb_input_get_device_modifier_mapping_reply_t *R /**< */)
5113 {
5114 xcb_generic_iterator_t i;
5115 i.data = ((uint8_t *) (R + 1)) + ((R->keycodes_per_modifier * 8));
5116 i.rem = 0;
5117 i.index = (char *) i.data - (char *) R;
5118 return i;
5119 }
5120
5121
5122 /*****************************************************************************
5123 **
5124 ** xcb_input_get_device_modifier_mapping_reply_t * xcb_input_get_device_modifier_mapping_reply
5125 **
5126 ** @param xcb_connection_t *c
5127 ** @param xcb_input_get_device_modifier_mapping_cookie_t cookie
5128 ** @param xcb_generic_error_t **e
5129 ** @returns xcb_input_get_device_modifier_mapping_reply_t *
5130 **
5131 *****************************************************************************/
5132
5133 xcb_input_get_device_modifier_mapping_reply_t *
5134 xcb_input_get_device_modifier_mapping_reply (xcb_connection_t *c /**< */,
5135 xcb_input_get_device_modifier_mapping_cookie_t cookie /**< */,
5136 xcb_generic_error_t **e /**< */)
5137 {
5138 return (xcb_input_get_device_modifier_mapping_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
5139 }
5140
5141 int
5142 xcb_input_set_device_modifier_mapping_sizeof (const void *_buffer /**< */)
5143 {
5144 char *xcb_tmp = (char *)_buffer;
5145 const xcb_input_set_device_modifier_mapping_request_t *_aux = (xcb_input_set_device_modifier_mapping_request_t *)_buffer;
5146 unsigned int xcb_buffer_len = 0;
5147 unsigned int xcb_block_len = 0;
5148 unsigned int xcb_pad = 0;
5149 unsigned int xcb_align_to = 0;
5150
5151
5152 xcb_block_len += sizeof(xcb_input_set_device_modifier_mapping_request_t);
5153 xcb_tmp += xcb_block_len;
5154 xcb_buffer_len += xcb_block_len;
5155 xcb_block_len = 0;
5156 /* keymaps */
5157 xcb_block_len += (_aux->keycodes_per_modifier * 8) * sizeof(uint8_t);
5158 xcb_tmp += xcb_block_len;
5159 xcb_align_to = ALIGNOF(uint8_t);
5160 /* insert padding */
5161 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
5162 xcb_buffer_len += xcb_block_len + xcb_pad;
5163 if (0 != xcb_pad) {
5164 xcb_tmp += xcb_pad;
5165 xcb_pad = 0;
5166 }
5167 xcb_block_len = 0;
5168
5169 return xcb_buffer_len;
5170 }
5171
5172
5173 /*****************************************************************************
5174 **
5175 ** xcb_input_set_device_modifier_mapping_cookie_t xcb_input_set_device_modifier_mapping
5176 **
5177 ** @param xcb_connection_t *c
5178 ** @param uint8_t device_id
5179 ** @param uint8_t keycodes_per_modifier
5180 ** @param const uint8_t *keymaps
5181 ** @returns xcb_input_set_device_modifier_mapping_cookie_t
5182 **
5183 *****************************************************************************/
5184
5185 xcb_input_set_device_modifier_mapping_cookie_t
5186 xcb_input_set_device_modifier_mapping (xcb_connection_t *c /**< */,
5187 uint8_t device_id /**< */,
5188 uint8_t keycodes_per_modifier /**< */,
5189 const uint8_t *keymaps /**< */)
5190 {
5191 static const xcb_protocol_request_t xcb_req = {
5192 /* count */ 4,
5193 /* ext */ &xcb_input_id,
5194 /* opcode */ XCB_INPUT_SET_DEVICE_MODIFIER_MAPPING,
5195 /* isvoid */ 0
5196 };
5197
5198 struct iovec xcb_parts[6];
5199 xcb_input_set_device_modifier_mapping_cookie_t xcb_ret;
5200 xcb_input_set_device_modifier_mapping_request_t xcb_out;
5201
5202 xcb_out.device_id = device_id;
5203 xcb_out.keycodes_per_modifier = keycodes_per_modifier;
5204 xcb_out.pad0 = 0;
5205
5206 xcb_parts[2].iov_base = (char *) &xcb_out;
5207 xcb_parts[2].iov_len = sizeof(xcb_out);
5208 xcb_parts[3].iov_base = 0;
5209 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5210 /* uint8_t keymaps */
5211 xcb_parts[4].iov_base = (char *) keymaps;
5212 xcb_parts[4].iov_len = (keycodes_per_modifier * 8) * sizeof(uint8_t);
5213 xcb_parts[5].iov_base = 0;
5214 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
5215
5216 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
5217 return xcb_ret;
5218 }
5219
5220
5221 /*****************************************************************************
5222 **
5223 ** xcb_input_set_device_modifier_mapping_cookie_t xcb_input_set_device_modifier_mapping_unchecked
5224 **
5225 ** @param xcb_connection_t *c
5226 ** @param uint8_t device_id
5227 ** @param uint8_t keycodes_per_modifier
5228 ** @param const uint8_t *keymaps
5229 ** @returns xcb_input_set_device_modifier_mapping_cookie_t
5230 **
5231 *****************************************************************************/
5232
5233 xcb_input_set_device_modifier_mapping_cookie_t
5234 xcb_input_set_device_modifier_mapping_unchecked (xcb_connection_t *c /**< */,
5235 uint8_t device_id /**< */,
5236 uint8_t keycodes_per_modifier /**< */,
5237 const uint8_t *keymaps /**< */)
5238 {
5239 static const xcb_protocol_request_t xcb_req = {
5240 /* count */ 4,
5241 /* ext */ &xcb_input_id,
5242 /* opcode */ XCB_INPUT_SET_DEVICE_MODIFIER_MAPPING,
5243 /* isvoid */ 0
5244 };
5245
5246 struct iovec xcb_parts[6];
5247 xcb_input_set_device_modifier_mapping_cookie_t xcb_ret;
5248 xcb_input_set_device_modifier_mapping_request_t xcb_out;
5249
5250 xcb_out.device_id = device_id;
5251 xcb_out.keycodes_per_modifier = keycodes_per_modifier;
5252 xcb_out.pad0 = 0;
5253
5254 xcb_parts[2].iov_base = (char *) &xcb_out;
5255 xcb_parts[2].iov_len = sizeof(xcb_out);
5256 xcb_parts[3].iov_base = 0;
5257 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5258 /* uint8_t keymaps */
5259 xcb_parts[4].iov_base = (char *) keymaps;
5260 xcb_parts[4].iov_len = (keycodes_per_modifier * 8) * sizeof(uint8_t);
5261 xcb_parts[5].iov_base = 0;
5262 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
5263
5264 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
5265 return xcb_ret;
5266 }
5267
5268
5269 /*****************************************************************************
5270 **
5271 ** xcb_input_set_device_modifier_mapping_reply_t * xcb_input_set_device_modifier_mapping_reply
5272 **
5273 ** @param xcb_connection_t *c
5274 ** @param xcb_input_set_device_modifier_mapping_cookie_t cookie
5275 ** @param xcb_generic_error_t **e
5276 ** @returns xcb_input_set_device_modifier_mapping_reply_t *
5277 **
5278 *****************************************************************************/
5279
5280 xcb_input_set_device_modifier_mapping_reply_t *
5281 xcb_input_set_device_modifier_mapping_reply (xcb_connection_t *c /**< */,
5282 xcb_input_set_device_modifier_mapping_cookie_t cookie /**< */,
5283 xcb_generic_error_t **e /**< */)
5284 {
5285 return (xcb_input_set_device_modifier_mapping_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
5286 }
5287
5288 int
5289 xcb_input_get_device_button_mapping_sizeof (const void *_buffer /**< */)
5290 {
5291 char *xcb_tmp = (char *)_buffer;
5292 const xcb_input_get_device_button_mapping_reply_t *_aux = (xcb_input_get_device_button_mapping_reply_t *)_buffer;
5293 unsigned int xcb_buffer_len = 0;
5294 unsigned int xcb_block_len = 0;
5295 unsigned int xcb_pad = 0;
5296 unsigned int xcb_align_to = 0;
5297
5298
5299 xcb_block_len += sizeof(xcb_input_get_device_button_mapping_reply_t);
5300 xcb_tmp += xcb_block_len;
5301 xcb_buffer_len += xcb_block_len;
5302 xcb_block_len = 0;
5303 /* map */
5304 xcb_block_len += _aux->map_size * sizeof(uint8_t);
5305 xcb_tmp += xcb_block_len;
5306 xcb_align_to = ALIGNOF(uint8_t);
5307 /* insert padding */
5308 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
5309 xcb_buffer_len += xcb_block_len + xcb_pad;
5310 if (0 != xcb_pad) {
5311 xcb_tmp += xcb_pad;
5312 xcb_pad = 0;
5313 }
5314 xcb_block_len = 0;
5315
5316 return xcb_buffer_len;
5317 }
5318
5319
5320 /*****************************************************************************
5321 **
5322 ** xcb_input_get_device_button_mapping_cookie_t xcb_input_get_device_button_mapping
5323 **
5324 ** @param xcb_connection_t *c
5325 ** @param uint8_t device_id
5326 ** @returns xcb_input_get_device_button_mapping_cookie_t
5327 **
5328 *****************************************************************************/
5329
5330 xcb_input_get_device_button_mapping_cookie_t
5331 xcb_input_get_device_button_mapping (xcb_connection_t *c /**< */,
5332 uint8_t device_id /**< */)
5333 {
5334 static const xcb_protocol_request_t xcb_req = {
5335 /* count */ 2,
5336 /* ext */ &xcb_input_id,
5337 /* opcode */ XCB_INPUT_GET_DEVICE_BUTTON_MAPPING,
5338 /* isvoid */ 0
5339 };
5340
5341 struct iovec xcb_parts[4];
5342 xcb_input_get_device_button_mapping_cookie_t xcb_ret;
5343 xcb_input_get_device_button_mapping_request_t xcb_out;
5344
5345 xcb_out.device_id = device_id;
5346 memset(xcb_out.pad0, 0, 3);
5347
5348 xcb_parts[2].iov_base = (char *) &xcb_out;
5349 xcb_parts[2].iov_len = sizeof(xcb_out);
5350 xcb_parts[3].iov_base = 0;
5351 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5352
5353 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
5354 return xcb_ret;
5355 }
5356
5357
5358 /*****************************************************************************
5359 **
5360 ** xcb_input_get_device_button_mapping_cookie_t xcb_input_get_device_button_mapping_unchecked
5361 **
5362 ** @param xcb_connection_t *c
5363 ** @param uint8_t device_id
5364 ** @returns xcb_input_get_device_button_mapping_cookie_t
5365 **
5366 *****************************************************************************/
5367
5368 xcb_input_get_device_button_mapping_cookie_t
5369 xcb_input_get_device_button_mapping_unchecked (xcb_connection_t *c /**< */,
5370 uint8_t device_id /**< */)
5371 {
5372 static const xcb_protocol_request_t xcb_req = {
5373 /* count */ 2,
5374 /* ext */ &xcb_input_id,
5375 /* opcode */ XCB_INPUT_GET_DEVICE_BUTTON_MAPPING,
5376 /* isvoid */ 0
5377 };
5378
5379 struct iovec xcb_parts[4];
5380 xcb_input_get_device_button_mapping_cookie_t xcb_ret;
5381 xcb_input_get_device_button_mapping_request_t xcb_out;
5382
5383 xcb_out.device_id = device_id;
5384 memset(xcb_out.pad0, 0, 3);
5385
5386 xcb_parts[2].iov_base = (char *) &xcb_out;
5387 xcb_parts[2].iov_len = sizeof(xcb_out);
5388 xcb_parts[3].iov_base = 0;
5389 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5390
5391 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
5392 return xcb_ret;
5393 }
5394
5395
5396 /*****************************************************************************
5397 **
5398 ** uint8_t * xcb_input_get_device_button_mapping_map
5399 **
5400 ** @param const xcb_input_get_device_button_mapping_reply_t *R
5401 ** @returns uint8_t *
5402 **
5403 *****************************************************************************/
5404
5405 uint8_t *
5406 xcb_input_get_device_button_mapping_map (const xcb_input_get_device_button_mapping_reply_t *R /**< */)
5407 {
5408 return (uint8_t *) (R + 1);
5409 }
5410
5411
5412 /*****************************************************************************
5413 **
5414 ** int xcb_input_get_device_button_mapping_map_length
5415 **
5416 ** @param const xcb_input_get_device_button_mapping_reply_t *R
5417 ** @returns int
5418 **
5419 *****************************************************************************/
5420
5421 int
5422 xcb_input_get_device_button_mapping_map_length (const xcb_input_get_device_button_mapping_reply_t *R /**< */)
5423 {
5424 return R->map_size;
5425 }
5426
5427
5428 /*****************************************************************************
5429 **
5430 ** xcb_generic_iterator_t xcb_input_get_device_button_mapping_map_end
5431 **
5432 ** @param const xcb_input_get_device_button_mapping_reply_t *R
5433 ** @returns xcb_generic_iterator_t
5434 **
5435 *****************************************************************************/
5436
5437 xcb_generic_iterator_t
5438 xcb_input_get_device_button_mapping_map_end (const xcb_input_get_device_button_mapping_reply_t *R /**< */)
5439 {
5440 xcb_generic_iterator_t i;
5441 i.data = ((uint8_t *) (R + 1)) + (R->map_size);
5442 i.rem = 0;
5443 i.index = (char *) i.data - (char *) R;
5444 return i;
5445 }
5446
5447
5448 /*****************************************************************************
5449 **
5450 ** xcb_input_get_device_button_mapping_reply_t * xcb_input_get_device_button_mapping_reply
5451 **
5452 ** @param xcb_connection_t *c
5453 ** @param xcb_input_get_device_button_mapping_cookie_t cookie
5454 ** @param xcb_generic_error_t **e
5455 ** @returns xcb_input_get_device_button_mapping_reply_t *
5456 **
5457 *****************************************************************************/
5458
5459 xcb_input_get_device_button_mapping_reply_t *
5460 xcb_input_get_device_button_mapping_reply (xcb_connection_t *c /**< */,
5461 xcb_input_get_device_button_mapping_cookie_t cookie /**< */,
5462 xcb_generic_error_t **e /**< */)
5463 {
5464 return (xcb_input_get_device_button_mapping_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
5465 }
5466
5467 int
5468 xcb_input_set_device_button_mapping_sizeof (const void *_buffer /**< */)
5469 {
5470 char *xcb_tmp = (char *)_buffer;
5471 const xcb_input_set_device_button_mapping_request_t *_aux = (xcb_input_set_device_button_mapping_request_t *)_buffer;
5472 unsigned int xcb_buffer_len = 0;
5473 unsigned int xcb_block_len = 0;
5474 unsigned int xcb_pad = 0;
5475 unsigned int xcb_align_to = 0;
5476
5477
5478 xcb_block_len += sizeof(xcb_input_set_device_button_mapping_request_t);
5479 xcb_tmp += xcb_block_len;
5480 xcb_buffer_len += xcb_block_len;
5481 xcb_block_len = 0;
5482 /* map */
5483 xcb_block_len += _aux->map_size * sizeof(uint8_t);
5484 xcb_tmp += xcb_block_len;
5485 xcb_align_to = ALIGNOF(uint8_t);
5486 /* insert padding */
5487 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
5488 xcb_buffer_len += xcb_block_len + xcb_pad;
5489 if (0 != xcb_pad) {
5490 xcb_tmp += xcb_pad;
5491 xcb_pad = 0;
5492 }
5493 xcb_block_len = 0;
5494
5495 return xcb_buffer_len;
5496 }
5497
5498
5499 /*****************************************************************************
5500 **
5501 ** xcb_input_set_device_button_mapping_cookie_t xcb_input_set_device_button_mapping
5502 **
5503 ** @param xcb_connection_t *c
5504 ** @param uint8_t device_id
5505 ** @param uint8_t map_size
5506 ** @param const uint8_t *map
5507 ** @returns xcb_input_set_device_button_mapping_cookie_t
5508 **
5509 *****************************************************************************/
5510
5511 xcb_input_set_device_button_mapping_cookie_t
5512 xcb_input_set_device_button_mapping (xcb_connection_t *c /**< */,
5513 uint8_t device_id /**< */,
5514 uint8_t map_size /**< */,
5515 const uint8_t *map /**< */)
5516 {
5517 static const xcb_protocol_request_t xcb_req = {
5518 /* count */ 4,
5519 /* ext */ &xcb_input_id,
5520 /* opcode */ XCB_INPUT_SET_DEVICE_BUTTON_MAPPING,
5521 /* isvoid */ 0
5522 };
5523
5524 struct iovec xcb_parts[6];
5525 xcb_input_set_device_button_mapping_cookie_t xcb_ret;
5526 xcb_input_set_device_button_mapping_request_t xcb_out;
5527
5528 xcb_out.device_id = device_id;
5529 xcb_out.map_size = map_size;
5530 memset(xcb_out.pad0, 0, 2);
5531
5532 xcb_parts[2].iov_base = (char *) &xcb_out;
5533 xcb_parts[2].iov_len = sizeof(xcb_out);
5534 xcb_parts[3].iov_base = 0;
5535 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5536 /* uint8_t map */
5537 xcb_parts[4].iov_base = (char *) map;
5538 xcb_parts[4].iov_len = map_size * sizeof(uint8_t);
5539 xcb_parts[5].iov_base = 0;
5540 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
5541
5542 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
5543 return xcb_ret;
5544 }
5545
5546
5547 /*****************************************************************************
5548 **
5549 ** xcb_input_set_device_button_mapping_cookie_t xcb_input_set_device_button_mapping_unchecked
5550 **
5551 ** @param xcb_connection_t *c
5552 ** @param uint8_t device_id
5553 ** @param uint8_t map_size
5554 ** @param const uint8_t *map
5555 ** @returns xcb_input_set_device_button_mapping_cookie_t
5556 **
5557 *****************************************************************************/
5558
5559 xcb_input_set_device_button_mapping_cookie_t
5560 xcb_input_set_device_button_mapping_unchecked (xcb_connection_t *c /**< */,
5561 uint8_t device_id /**< */,
5562 uint8_t map_size /**< */,
5563 const uint8_t *map /**< */)
5564 {
5565 static const xcb_protocol_request_t xcb_req = {
5566 /* count */ 4,
5567 /* ext */ &xcb_input_id,
5568 /* opcode */ XCB_INPUT_SET_DEVICE_BUTTON_MAPPING,
5569 /* isvoid */ 0
5570 };
5571
5572 struct iovec xcb_parts[6];
5573 xcb_input_set_device_button_mapping_cookie_t xcb_ret;
5574 xcb_input_set_device_button_mapping_request_t xcb_out;
5575
5576 xcb_out.device_id = device_id;
5577 xcb_out.map_size = map_size;
5578 memset(xcb_out.pad0, 0, 2);
5579
5580 xcb_parts[2].iov_base = (char *) &xcb_out;
5581 xcb_parts[2].iov_len = sizeof(xcb_out);
5582 xcb_parts[3].iov_base = 0;
5583 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5584 /* uint8_t map */
5585 xcb_parts[4].iov_base = (char *) map;
5586 xcb_parts[4].iov_len = map_size * sizeof(uint8_t);
5587 xcb_parts[5].iov_base = 0;
5588 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
5589
5590 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
5591 return xcb_ret;
5592 }
5593
5594
5595 /*****************************************************************************
5596 **
5597 ** xcb_input_set_device_button_mapping_reply_t * xcb_input_set_device_button_mapping_reply
5598 **
5599 ** @param xcb_connection_t *c
5600 ** @param xcb_input_set_device_button_mapping_cookie_t cookie
5601 ** @param xcb_generic_error_t **e
5602 ** @returns xcb_input_set_device_button_mapping_reply_t *
5603 **
5604 *****************************************************************************/
5605
5606 xcb_input_set_device_button_mapping_reply_t *
5607 xcb_input_set_device_button_mapping_reply (xcb_connection_t *c /**< */,
5608 xcb_input_set_device_button_mapping_cookie_t cookie /**< */,
5609 xcb_generic_error_t **e /**< */)
5610 {
5611 return (xcb_input_set_device_button_mapping_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
5612 }
5613
5614
5615 /*****************************************************************************
5616 **
5617 ** void xcb_input_key_state_next
5618 **
5619 ** @param xcb_input_key_state_iterator_t *i
5620 ** @returns void
5621 **
5622 *****************************************************************************/
5623
5624 void
5625 xcb_input_key_state_next (xcb_input_key_state_iterator_t *i /**< */)
5626 {
5627 --i->rem;
5628 ++i->data;
5629 i->index += sizeof(xcb_input_key_state_t);
5630 }
5631
5632
5633 /*****************************************************************************
5634 **
5635 ** xcb_generic_iterator_t xcb_input_key_state_end
5636 **
5637 ** @param xcb_input_key_state_iterator_t i
5638 ** @returns xcb_generic_iterator_t
5639 **
5640 *****************************************************************************/
5641
5642 xcb_generic_iterator_t
5643 xcb_input_key_state_end (xcb_input_key_state_iterator_t i /**< */)
5644 {
5645 xcb_generic_iterator_t ret;
5646 ret.data = i.data + i.rem;
5647 ret.index = i.index + ((char *) ret.data - (char *) i.data);
5648 ret.rem = 0;
5649 return ret;
5650 }
5651
5652
5653 /*****************************************************************************
5654 **
5655 ** void xcb_input_button_state_next
5656 **
5657 ** @param xcb_input_button_state_iterator_t *i
5658 ** @returns void
5659 **
5660 *****************************************************************************/
5661
5662 void
5663 xcb_input_button_state_next (xcb_input_button_state_iterator_t *i /**< */)
5664 {
5665 --i->rem;
5666 ++i->data;
5667 i->index += sizeof(xcb_input_button_state_t);
5668 }
5669
5670
5671 /*****************************************************************************
5672 **
5673 ** xcb_generic_iterator_t xcb_input_button_state_end
5674 **
5675 ** @param xcb_input_button_state_iterator_t i
5676 ** @returns xcb_generic_iterator_t
5677 **
5678 *****************************************************************************/
5679
5680 xcb_generic_iterator_t
5681 xcb_input_button_state_end (xcb_input_button_state_iterator_t i /**< */)
5682 {
5683 xcb_generic_iterator_t ret;
5684 ret.data = i.data + i.rem;
5685 ret.index = i.index + ((char *) ret.data - (char *) i.data);
5686 ret.rem = 0;
5687 return ret;
5688 }
5689
5690 int
5691 xcb_input_valuator_state_sizeof (const void *_buffer /**< */)
5692 {
5693 char *xcb_tmp = (char *)_buffer;
5694 const xcb_input_valuator_state_t *_aux = (xcb_input_valuator_state_t *)_buffer;
5695 unsigned int xcb_buffer_len = 0;
5696 unsigned int xcb_block_len = 0;
5697 unsigned int xcb_pad = 0;
5698 unsigned int xcb_align_to = 0;
5699
5700
5701 xcb_block_len += sizeof(xcb_input_valuator_state_t);
5702 xcb_tmp += xcb_block_len;
5703 xcb_buffer_len += xcb_block_len;
5704 xcb_block_len = 0;
5705 /* valuators */
5706 xcb_block_len += _aux->num_valuators * sizeof(uint32_t);
5707 xcb_tmp += xcb_block_len;
5708 xcb_align_to = ALIGNOF(uint32_t);
5709 /* insert padding */
5710 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
5711 xcb_buffer_len += xcb_block_len + xcb_pad;
5712 if (0 != xcb_pad) {
5713 xcb_tmp += xcb_pad;
5714 xcb_pad = 0;
5715 }
5716 xcb_block_len = 0;
5717
5718 return xcb_buffer_len;
5719 }
5720
5721
5722 /*****************************************************************************
5723 **
5724 ** uint32_t * xcb_input_valuator_state_valuators
5725 **
5726 ** @param const xcb_input_valuator_state_t *R
5727 ** @returns uint32_t *
5728 **
5729 *****************************************************************************/
5730
5731 uint32_t *
5732 xcb_input_valuator_state_valuators (const xcb_input_valuator_state_t *R /**< */)
5733 {
5734 return (uint32_t *) (R + 1);
5735 }
5736
5737
5738 /*****************************************************************************
5739 **
5740 ** int xcb_input_valuator_state_valuators_length
5741 **
5742 ** @param const xcb_input_valuator_state_t *R
5743 ** @returns int
5744 **
5745 *****************************************************************************/
5746
5747 int
5748 xcb_input_valuator_state_valuators_length (const xcb_input_valuator_state_t *R /**< */)
5749 {
5750 return R->num_valuators;
5751 }
5752
5753
5754 /*****************************************************************************
5755 **
5756 ** xcb_generic_iterator_t xcb_input_valuator_state_valuators_end
5757 **
5758 ** @param const xcb_input_valuator_state_t *R
5759 ** @returns xcb_generic_iterator_t
5760 **
5761 *****************************************************************************/
5762
5763 xcb_generic_iterator_t
5764 xcb_input_valuator_state_valuators_end (const xcb_input_valuator_state_t *R /**< */)
5765 {
5766 xcb_generic_iterator_t i;
5767 i.data = ((uint32_t *) (R + 1)) + (R->num_valuators);
5768 i.rem = 0;
5769 i.index = (char *) i.data - (char *) R;
5770 return i;
5771 }
5772
5773
5774 /*****************************************************************************
5775 **
5776 ** void xcb_input_valuator_state_next
5777 **
5778 ** @param xcb_input_valuator_state_iterator_t *i
5779 ** @returns void
5780 **
5781 *****************************************************************************/
5782
5783 void
5784 xcb_input_valuator_state_next (xcb_input_valuator_state_iterator_t *i /**< */)
5785 {
5786 xcb_input_valuator_state_t *R = i->data;
5787 xcb_generic_iterator_t child;
5788 child.data = (xcb_input_valuator_state_t *)(((char *)R) + xcb_input_valuator_state_sizeof(R));
5789 i->index = (char *) child.data - (char *) i->data;
5790 --i->rem;
5791 i->data = (xcb_input_valuator_state_t *) child.data;
5792 }
5793
5794
5795 /*****************************************************************************
5796 **
5797 ** xcb_generic_iterator_t xcb_input_valuator_state_end
5798 **
5799 ** @param xcb_input_valuator_state_iterator_t i
5800 ** @returns xcb_generic_iterator_t
5801 **
5802 *****************************************************************************/
5803
5804 xcb_generic_iterator_t
5805 xcb_input_valuator_state_end (xcb_input_valuator_state_iterator_t i /**< */)
5806 {
5807 xcb_generic_iterator_t ret;
5808 while(i.rem > 0)
5809 xcb_input_valuator_state_next(&i);
5810 ret.data = i.data;
5811 ret.rem = i.rem;
5812 ret.index = i.index;
5813 return ret;
5814 }
5815
5816 int
5817 xcb_input_input_state_sizeof (const void *_buffer /**< */)
5818 {
5819 char *xcb_tmp = (char *)_buffer;
5820 const xcb_input_input_state_t *_aux = (xcb_input_input_state_t *)_buffer;
5821 unsigned int xcb_buffer_len = 0;
5822 unsigned int xcb_block_len = 0;
5823 unsigned int xcb_pad = 0;
5824 unsigned int xcb_align_to = 0;
5825
5826
5827 xcb_block_len += sizeof(xcb_input_input_state_t);
5828 xcb_tmp += xcb_block_len;
5829 xcb_buffer_len += xcb_block_len;
5830 xcb_block_len = 0;
5831 /* uninterpreted_data */
5832 xcb_block_len += (_aux->len - 4) * sizeof(uint8_t);
5833 xcb_tmp += xcb_block_len;
5834 xcb_align_to = ALIGNOF(uint8_t);
5835 /* insert padding */
5836 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
5837 xcb_buffer_len += xcb_block_len + xcb_pad;
5838 if (0 != xcb_pad) {
5839 xcb_tmp += xcb_pad;
5840 xcb_pad = 0;
5841 }
5842 xcb_block_len = 0;
5843
5844 return xcb_buffer_len;
5845 }
5846
5847
5848 /*****************************************************************************
5849 **
5850 ** uint8_t * xcb_input_input_state_uninterpreted_data
5851 **
5852 ** @param const xcb_input_input_state_t *R
5853 ** @returns uint8_t *
5854 **
5855 *****************************************************************************/
5856
5857 uint8_t *
5858 xcb_input_input_state_uninterpreted_data (const xcb_input_input_state_t *R /**< */)
5859 {
5860 return (uint8_t *) (R + 1);
5861 }
5862
5863
5864 /*****************************************************************************
5865 **
5866 ** int xcb_input_input_state_uninterpreted_data_length
5867 **
5868 ** @param const xcb_input_input_state_t *R
5869 ** @returns int
5870 **
5871 *****************************************************************************/
5872
5873 int
5874 xcb_input_input_state_uninterpreted_data_length (const xcb_input_input_state_t *R /**< */)
5875 {
5876 return (R->len - 4);
5877 }
5878
5879
5880 /*****************************************************************************
5881 **
5882 ** xcb_generic_iterator_t xcb_input_input_state_uninterpreted_data_end
5883 **
5884 ** @param const xcb_input_input_state_t *R
5885 ** @returns xcb_generic_iterator_t
5886 **
5887 *****************************************************************************/
5888
5889 xcb_generic_iterator_t
5890 xcb_input_input_state_uninterpreted_data_end (const xcb_input_input_state_t *R /**< */)
5891 {
5892 xcb_generic_iterator_t i;
5893 i.data = ((uint8_t *) (R + 1)) + ((R->len - 4));
5894 i.rem = 0;
5895 i.index = (char *) i.data - (char *) R;
5896 return i;
5897 }
5898
5899
5900 /*****************************************************************************
5901 **
5902 ** void xcb_input_input_state_next
5903 **
5904 ** @param xcb_input_input_state_iterator_t *i
5905 ** @returns void
5906 **
5907 *****************************************************************************/
5908
5909 void
5910 xcb_input_input_state_next (xcb_input_input_state_iterator_t *i /**< */)
5911 {
5912 xcb_input_input_state_t *R = i->data;
5913 xcb_generic_iterator_t child;
5914 child.data = (xcb_input_input_state_t *)(((char *)R) + xcb_input_input_state_sizeof(R));
5915 i->index = (char *) child.data - (char *) i->data;
5916 --i->rem;
5917 i->data = (xcb_input_input_state_t *) child.data;
5918 }
5919
5920
5921 /*****************************************************************************
5922 **
5923 ** xcb_generic_iterator_t xcb_input_input_state_end
5924 **
5925 ** @param xcb_input_input_state_iterator_t i
5926 ** @returns xcb_generic_iterator_t
5927 **
5928 *****************************************************************************/
5929
5930 xcb_generic_iterator_t
5931 xcb_input_input_state_end (xcb_input_input_state_iterator_t i /**< */)
5932 {
5933 xcb_generic_iterator_t ret;
5934 while(i.rem > 0)
5935 xcb_input_input_state_next(&i);
5936 ret.data = i.data;
5937 ret.rem = i.rem;
5938 ret.index = i.index;
5939 return ret;
5940 }
5941
5942 int
5943 xcb_input_query_device_state_sizeof (const void *_buffer /**< */)
5944 {
5945 char *xcb_tmp = (char *)_buffer;
5946 const xcb_input_query_device_state_reply_t *_aux = (xcb_input_query_device_state_reply_t *)_buffer;
5947 unsigned int xcb_buffer_len = 0;
5948 unsigned int xcb_block_len = 0;
5949 unsigned int xcb_pad = 0;
5950 unsigned int xcb_align_to = 0;
5951
5952 unsigned int i;
5953 unsigned int xcb_tmp_len;
5954
5955 xcb_block_len += sizeof(xcb_input_query_device_state_reply_t);
5956 xcb_tmp += xcb_block_len;
5957 xcb_buffer_len += xcb_block_len;
5958 xcb_block_len = 0;
5959 /* classes */
5960 for(i=0; i<_aux->num_classes; i++) {
5961 xcb_tmp_len = xcb_input_input_state_sizeof(xcb_tmp);
5962 xcb_block_len += xcb_tmp_len;
5963 xcb_tmp += xcb_tmp_len;
5964 }
5965 xcb_align_to = ALIGNOF(xcb_input_input_state_t);
5966 /* insert padding */
5967 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
5968 xcb_buffer_len += xcb_block_len + xcb_pad;
5969 if (0 != xcb_pad) {
5970 xcb_tmp += xcb_pad;
5971 xcb_pad = 0;
5972 }
5973 xcb_block_len = 0;
5974
5975 return xcb_buffer_len;
5976 }
5977
5978
5979 /*****************************************************************************
5980 **
5981 ** xcb_input_query_device_state_cookie_t xcb_input_query_device_state
5982 **
5983 ** @param xcb_connection_t *c
5984 ** @param uint8_t device_id
5985 ** @returns xcb_input_query_device_state_cookie_t
5986 **
5987 *****************************************************************************/
5988
5989 xcb_input_query_device_state_cookie_t
5990 xcb_input_query_device_state (xcb_connection_t *c /**< */,
5991 uint8_t device_id /**< */)
5992 {
5993 static const xcb_protocol_request_t xcb_req = {
5994 /* count */ 2,
5995 /* ext */ &xcb_input_id,
5996 /* opcode */ XCB_INPUT_QUERY_DEVICE_STATE,
5997 /* isvoid */ 0
5998 };
5999
6000 struct iovec xcb_parts[4];
6001 xcb_input_query_device_state_cookie_t xcb_ret;
6002 xcb_input_query_device_state_request_t xcb_out;
6003
6004 xcb_out.device_id = device_id;
6005 memset(xcb_out.pad0, 0, 3);
6006
6007 xcb_parts[2].iov_base = (char *) &xcb_out;
6008 xcb_parts[2].iov_len = sizeof(xcb_out);
6009 xcb_parts[3].iov_base = 0;
6010 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
6011
6012 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
6013 return xcb_ret;
6014 }
6015
6016
6017 /*****************************************************************************
6018 **
6019 ** xcb_input_query_device_state_cookie_t xcb_input_query_device_state_unchecked
6020 **
6021 ** @param xcb_connection_t *c
6022 ** @param uint8_t device_id
6023 ** @returns xcb_input_query_device_state_cookie_t
6024 **
6025 *****************************************************************************/
6026
6027 xcb_input_query_device_state_cookie_t
6028 xcb_input_query_device_state_unchecked (xcb_connection_t *c /**< */,
6029 uint8_t device_id /**< */)
6030 {
6031 static const xcb_protocol_request_t xcb_req = {
6032 /* count */ 2,
6033 /* ext */ &xcb_input_id,
6034 /* opcode */ XCB_INPUT_QUERY_DEVICE_STATE,
6035 /* isvoid */ 0
6036 };
6037
6038 struct iovec xcb_parts[4];
6039 xcb_input_query_device_state_cookie_t xcb_ret;
6040 xcb_input_query_device_state_request_t xcb_out;
6041
6042 xcb_out.device_id = device_id;
6043 memset(xcb_out.pad0, 0, 3);
6044
6045 xcb_parts[2].iov_base = (char *) &xcb_out;
6046 xcb_parts[2].iov_len = sizeof(xcb_out);
6047 xcb_parts[3].iov_base = 0;
6048 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
6049
6050 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
6051 return xcb_ret;
6052 }
6053
6054
6055 /*****************************************************************************
6056 **
6057 ** int xcb_input_query_device_state_classes_length
6058 **
6059 ** @param const xcb_input_query_device_state_reply_t *R
6060 ** @returns int
6061 **
6062 *****************************************************************************/
6063
6064 int
6065 xcb_input_query_device_state_classes_length (const xcb_input_query_device_state_reply_t *R /**< */)
6066 {
6067 return R->num_classes;
6068 }
6069
6070
6071 /*****************************************************************************
6072 **
6073 ** xcb_input_input_state_iterator_t xcb_input_query_device_state_classes_iterator
6074 **
6075 ** @param const xcb_input_query_device_state_reply_t *R
6076 ** @returns xcb_input_input_state_iterator_t
6077 **
6078 *****************************************************************************/
6079
6080 xcb_input_input_state_iterator_t
6081 xcb_input_query_device_state_classes_iterator (const xcb_input_query_device_state_reply_t *R /**< */)
6082 {
6083 xcb_input_input_state_iterator_t i;
6084 i.data = (xcb_input_input_state_t *) (R + 1);
6085 i.rem = R->num_classes;
6086 i.index = (char *) i.data - (char *) R;
6087 return i;
6088 }
6089
6090
6091 /*****************************************************************************
6092 **
6093 ** xcb_input_query_device_state_reply_t * xcb_input_query_device_state_reply
6094 **
6095 ** @param xcb_connection_t *c
6096 ** @param xcb_input_query_device_state_cookie_t cookie
6097 ** @param xcb_generic_error_t **e
6098 ** @returns xcb_input_query_device_state_reply_t *
6099 **
6100 *****************************************************************************/
6101
6102 xcb_input_query_device_state_reply_t *
6103 xcb_input_query_device_state_reply (xcb_connection_t *c /**< */,
6104 xcb_input_query_device_state_cookie_t cookie /**< */,
6105 xcb_generic_error_t **e /**< */)
6106 {
6107 return (xcb_input_query_device_state_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
6108 }
6109
6110 int
6111 xcb_input_send_extension_event_sizeof (const void *_buffer /**< */)
6112 {
6113 char *xcb_tmp = (char *)_buffer;
6114 const xcb_input_send_extension_event_request_t *_aux = (xcb_input_send_extension_event_request_t *)_buffer;
6115 unsigned int xcb_buffer_len = 0;
6116 unsigned int xcb_block_len = 0;
6117 unsigned int xcb_pad = 0;
6118 unsigned int xcb_align_to = 0;
6119
6120
6121 xcb_block_len += sizeof(xcb_input_send_extension_event_request_t);
6122 xcb_tmp += xcb_block_len;
6123 xcb_buffer_len += xcb_block_len;
6124 xcb_block_len = 0;
6125 /* events */
6126 xcb_block_len += (_aux->num_events * 32) * sizeof(uint8_t);
6127 xcb_tmp += xcb_block_len;
6128 xcb_align_to = ALIGNOF(uint8_t);
6129 /* insert padding */
6130 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6131 xcb_buffer_len += xcb_block_len + xcb_pad;
6132 if (0 != xcb_pad) {
6133 xcb_tmp += xcb_pad;
6134 xcb_pad = 0;
6135 }
6136 xcb_block_len = 0;
6137 /* classes */
6138 xcb_block_len += _aux->num_classes * sizeof(xcb_input_event_class_t);
6139 xcb_tmp += xcb_block_len;
6140 xcb_align_to = ALIGNOF(xcb_input_event_class_t);
6141 /* insert padding */
6142 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6143 xcb_buffer_len += xcb_block_len + xcb_pad;
6144 if (0 != xcb_pad) {
6145 xcb_tmp += xcb_pad;
6146 xcb_pad = 0;
6147 }
6148 xcb_block_len = 0;
6149
6150 return xcb_buffer_len;
6151 }
6152
6153
6154 /*****************************************************************************
6155 **
6156 ** xcb_void_cookie_t xcb_input_send_extension_event_checked
6157 **
6158 ** @param xcb_connection_t *c
6159 ** @param xcb_window_t destination
6160 ** @param uint8_t device_id
6161 ** @param uint8_t propagate
6162 ** @param uint16_t num_classes
6163 ** @param uint8_t num_events
6164 ** @param const uint8_t *events
6165 ** @param const xcb_input_event_class_t *classes
6166 ** @returns xcb_void_cookie_t
6167 **
6168 *****************************************************************************/
6169
6170 xcb_void_cookie_t
6171 xcb_input_send_extension_event_checked (xcb_connection_t *c /**< */,
6172 xcb_window_t destination /**< */,
6173 uint8_t device_id /**< */,
6174 uint8_t propagate /**< */,
6175 uint16_t num_classes /**< */,
6176 uint8_t num_events /**< */,
6177 const uint8_t *events /**< */,
6178 const xcb_input_event_class_t *classes /**< */)
6179 {
6180 static const xcb_protocol_request_t xcb_req = {
6181 /* count */ 6,
6182 /* ext */ &xcb_input_id,
6183 /* opcode */ XCB_INPUT_SEND_EXTENSION_EVENT,
6184 /* isvoid */ 1
6185 };
6186
6187 struct iovec xcb_parts[8];
6188 xcb_void_cookie_t xcb_ret;
6189 xcb_input_send_extension_event_request_t xcb_out;
6190
6191 xcb_out.destination = destination;
6192 xcb_out.device_id = device_id;
6193 xcb_out.propagate = propagate;
6194 xcb_out.num_classes = num_classes;
6195 xcb_out.num_events = num_events;
6196 memset(xcb_out.pad0, 0, 3);
6197
6198 xcb_parts[2].iov_base = (char *) &xcb_out;
6199 xcb_parts[2].iov_len = sizeof(xcb_out);
6200 xcb_parts[3].iov_base = 0;
6201 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
6202 /* uint8_t events */
6203 xcb_parts[4].iov_base = (char *) events;
6204 xcb_parts[4].iov_len = (num_events * 32) * sizeof(uint8_t);
6205 xcb_parts[5].iov_base = 0;
6206 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
6207 /* xcb_input_event_class_t classes */
6208 xcb_parts[6].iov_base = (char *) classes;
6209 xcb_parts[6].iov_len = num_classes * sizeof(xcb_input_event_class_t);
6210 xcb_parts[7].iov_base = 0;
6211 xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3;
6212
6213 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
6214 return xcb_ret;
6215 }
6216
6217
6218 /*****************************************************************************
6219 **
6220 ** xcb_void_cookie_t xcb_input_send_extension_event
6221 **
6222 ** @param xcb_connection_t *c
6223 ** @param xcb_window_t destination
6224 ** @param uint8_t device_id
6225 ** @param uint8_t propagate
6226 ** @param uint16_t num_classes
6227 ** @param uint8_t num_events
6228 ** @param const uint8_t *events
6229 ** @param const xcb_input_event_class_t *classes
6230 ** @returns xcb_void_cookie_t
6231 **
6232 *****************************************************************************/
6233
6234 xcb_void_cookie_t
6235 xcb_input_send_extension_event (xcb_connection_t *c /**< */,
6236 xcb_window_t destination /**< */,
6237 uint8_t device_id /**< */,
6238 uint8_t propagate /**< */,
6239 uint16_t num_classes /**< */,
6240 uint8_t num_events /**< */,
6241 const uint8_t *events /**< */,
6242 const xcb_input_event_class_t *classes /**< */)
6243 {
6244 static const xcb_protocol_request_t xcb_req = {
6245 /* count */ 6,
6246 /* ext */ &xcb_input_id,
6247 /* opcode */ XCB_INPUT_SEND_EXTENSION_EVENT,
6248 /* isvoid */ 1
6249 };
6250
6251 struct iovec xcb_parts[8];
6252 xcb_void_cookie_t xcb_ret;
6253 xcb_input_send_extension_event_request_t xcb_out;
6254
6255 xcb_out.destination = destination;
6256 xcb_out.device_id = device_id;
6257 xcb_out.propagate = propagate;
6258 xcb_out.num_classes = num_classes;
6259 xcb_out.num_events = num_events;
6260 memset(xcb_out.pad0, 0, 3);
6261
6262 xcb_parts[2].iov_base = (char *) &xcb_out;
6263 xcb_parts[2].iov_len = sizeof(xcb_out);
6264 xcb_parts[3].iov_base = 0;
6265 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
6266 /* uint8_t events */
6267 xcb_parts[4].iov_base = (char *) events;
6268 xcb_parts[4].iov_len = (num_events * 32) * sizeof(uint8_t);
6269 xcb_parts[5].iov_base = 0;
6270 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
6271 /* xcb_input_event_class_t classes */
6272 xcb_parts[6].iov_base = (char *) classes;
6273 xcb_parts[6].iov_len = num_classes * sizeof(xcb_input_event_class_t);
6274 xcb_parts[7].iov_base = 0;
6275 xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3;
6276
6277 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
6278 return xcb_ret;
6279 }
6280
6281
6282 /*****************************************************************************
6283 **
6284 ** xcb_void_cookie_t xcb_input_device_bell_checked
6285 **
6286 ** @param xcb_connection_t *c
6287 ** @param uint8_t device_id
6288 ** @param uint8_t feedback_id
6289 ** @param uint8_t feedback_class
6290 ** @param int8_t percent
6291 ** @returns xcb_void_cookie_t
6292 **
6293 *****************************************************************************/
6294
6295 xcb_void_cookie_t
6296 xcb_input_device_bell_checked (xcb_connection_t *c /**< */,
6297 uint8_t device_id /**< */,
6298 uint8_t feedback_id /**< */,
6299 uint8_t feedback_class /**< */,
6300 int8_t percent /**< */)
6301 {
6302 static const xcb_protocol_request_t xcb_req = {
6303 /* count */ 2,
6304 /* ext */ &xcb_input_id,
6305 /* opcode */ XCB_INPUT_DEVICE_BELL,
6306 /* isvoid */ 1
6307 };
6308
6309 struct iovec xcb_parts[4];
6310 xcb_void_cookie_t xcb_ret;
6311 xcb_input_device_bell_request_t xcb_out;
6312
6313 xcb_out.device_id = device_id;
6314 xcb_out.feedback_id = feedback_id;
6315 xcb_out.feedback_class = feedback_class;
6316 xcb_out.percent = percent;
6317
6318 xcb_parts[2].iov_base = (char *) &xcb_out;
6319 xcb_parts[2].iov_len = sizeof(xcb_out);
6320 xcb_parts[3].iov_base = 0;
6321 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
6322
6323 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
6324 return xcb_ret;
6325 }
6326
6327
6328 /*****************************************************************************
6329 **
6330 ** xcb_void_cookie_t xcb_input_device_bell
6331 **
6332 ** @param xcb_connection_t *c
6333 ** @param uint8_t device_id
6334 ** @param uint8_t feedback_id
6335 ** @param uint8_t feedback_class
6336 ** @param int8_t percent
6337 ** @returns xcb_void_cookie_t
6338 **
6339 *****************************************************************************/
6340
6341 xcb_void_cookie_t
6342 xcb_input_device_bell (xcb_connection_t *c /**< */,
6343 uint8_t device_id /**< */,
6344 uint8_t feedback_id /**< */,
6345 uint8_t feedback_class /**< */,
6346 int8_t percent /**< */)
6347 {
6348 static const xcb_protocol_request_t xcb_req = {
6349 /* count */ 2,
6350 /* ext */ &xcb_input_id,
6351 /* opcode */ XCB_INPUT_DEVICE_BELL,
6352 /* isvoid */ 1
6353 };
6354
6355 struct iovec xcb_parts[4];
6356 xcb_void_cookie_t xcb_ret;
6357 xcb_input_device_bell_request_t xcb_out;
6358
6359 xcb_out.device_id = device_id;
6360 xcb_out.feedback_id = feedback_id;
6361 xcb_out.feedback_class = feedback_class;
6362 xcb_out.percent = percent;
6363
6364 xcb_parts[2].iov_base = (char *) &xcb_out;
6365 xcb_parts[2].iov_len = sizeof(xcb_out);
6366 xcb_parts[3].iov_base = 0;
6367 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
6368
6369 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
6370 return xcb_ret;
6371 }
6372
6373 int
6374 xcb_input_set_device_valuators_sizeof (const void *_buffer /**< */)
6375 {
6376 char *xcb_tmp = (char *)_buffer;
6377 const xcb_input_set_device_valuators_request_t *_aux = (xcb_input_set_device_valuators_request_t *)_buffer;
6378 unsigned int xcb_buffer_len = 0;
6379 unsigned int xcb_block_len = 0;
6380 unsigned int xcb_pad = 0;
6381 unsigned int xcb_align_to = 0;
6382
6383
6384 xcb_block_len += sizeof(xcb_input_set_device_valuators_request_t);
6385 xcb_tmp += xcb_block_len;
6386 xcb_buffer_len += xcb_block_len;
6387 xcb_block_len = 0;
6388 /* valuators */
6389 xcb_block_len += _aux->num_valuators * sizeof(int32_t);
6390 xcb_tmp += xcb_block_len;
6391 xcb_align_to = ALIGNOF(int32_t);
6392 /* insert padding */
6393 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6394 xcb_buffer_len += xcb_block_len + xcb_pad;
6395 if (0 != xcb_pad) {
6396 xcb_tmp += xcb_pad;
6397 xcb_pad = 0;
6398 }
6399 xcb_block_len = 0;
6400
6401 return xcb_buffer_len;
6402 }
6403
6404
6405 /*****************************************************************************
6406 **
6407 ** xcb_input_set_device_valuators_cookie_t xcb_input_set_device_valuators
6408 **
6409 ** @param xcb_connection_t *c
6410 ** @param uint8_t device_id
6411 ** @param uint8_t first_valuator
6412 ** @param uint8_t num_valuators
6413 ** @param const int32_t *valuators
6414 ** @returns xcb_input_set_device_valuators_cookie_t
6415 **
6416 *****************************************************************************/
6417
6418 xcb_input_set_device_valuators_cookie_t
6419 xcb_input_set_device_valuators (xcb_connection_t *c /**< */,
6420 uint8_t device_id /**< */,
6421 uint8_t first_valuator /**< */,
6422 uint8_t num_valuators /**< */,
6423 const int32_t *valuators /**< */)
6424 {
6425 static const xcb_protocol_request_t xcb_req = {
6426 /* count */ 4,
6427 /* ext */ &xcb_input_id,
6428 /* opcode */ XCB_INPUT_SET_DEVICE_VALUATORS,
6429 /* isvoid */ 0
6430 };
6431
6432 struct iovec xcb_parts[6];
6433 xcb_input_set_device_valuators_cookie_t xcb_ret;
6434 xcb_input_set_device_valuators_request_t xcb_out;
6435
6436 xcb_out.device_id = device_id;
6437 xcb_out.first_valuator = first_valuator;
6438 xcb_out.num_valuators = num_valuators;
6439 xcb_out.pad0 = 0;
6440
6441 xcb_parts[2].iov_base = (char *) &xcb_out;
6442 xcb_parts[2].iov_len = sizeof(xcb_out);
6443 xcb_parts[3].iov_base = 0;
6444 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
6445 /* int32_t valuators */
6446 xcb_parts[4].iov_base = (char *) valuators;
6447 xcb_parts[4].iov_len = num_valuators * sizeof(int32_t);
6448 xcb_parts[5].iov_base = 0;
6449 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
6450
6451 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
6452 return xcb_ret;
6453 }
6454
6455
6456 /*****************************************************************************
6457 **
6458 ** xcb_input_set_device_valuators_cookie_t xcb_input_set_device_valuators_unchecked
6459 **
6460 ** @param xcb_connection_t *c
6461 ** @param uint8_t device_id
6462 ** @param uint8_t first_valuator
6463 ** @param uint8_t num_valuators
6464 ** @param const int32_t *valuators
6465 ** @returns xcb_input_set_device_valuators_cookie_t
6466 **
6467 *****************************************************************************/
6468
6469 xcb_input_set_device_valuators_cookie_t
6470 xcb_input_set_device_valuators_unchecked (xcb_connection_t *c /**< */,
6471 uint8_t device_id /**< */,
6472 uint8_t first_valuator /**< */,
6473 uint8_t num_valuators /**< */,
6474 const int32_t *valuators /**< */)
6475 {
6476 static const xcb_protocol_request_t xcb_req = {
6477 /* count */ 4,
6478 /* ext */ &xcb_input_id,
6479 /* opcode */ XCB_INPUT_SET_DEVICE_VALUATORS,
6480 /* isvoid */ 0
6481 };
6482
6483 struct iovec xcb_parts[6];
6484 xcb_input_set_device_valuators_cookie_t xcb_ret;
6485 xcb_input_set_device_valuators_request_t xcb_out;
6486
6487 xcb_out.device_id = device_id;
6488 xcb_out.first_valuator = first_valuator;
6489 xcb_out.num_valuators = num_valuators;
6490 xcb_out.pad0 = 0;
6491
6492 xcb_parts[2].iov_base = (char *) &xcb_out;
6493 xcb_parts[2].iov_len = sizeof(xcb_out);
6494 xcb_parts[3].iov_base = 0;
6495 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
6496 /* int32_t valuators */
6497 xcb_parts[4].iov_base = (char *) valuators;
6498 xcb_parts[4].iov_len = num_valuators * sizeof(int32_t);
6499 xcb_parts[5].iov_base = 0;
6500 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
6501
6502 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
6503 return xcb_ret;
6504 }
6505
6506
6507 /*****************************************************************************
6508 **
6509 ** xcb_input_set_device_valuators_reply_t * xcb_input_set_device_valuators_reply
6510 **
6511 ** @param xcb_connection_t *c
6512 ** @param xcb_input_set_device_valuators_cookie_t cookie
6513 ** @param xcb_generic_error_t **e
6514 ** @returns xcb_input_set_device_valuators_reply_t *
6515 **
6516 *****************************************************************************/
6517
6518 xcb_input_set_device_valuators_reply_t *
6519 xcb_input_set_device_valuators_reply (xcb_connection_t *c /**< */,
6520 xcb_input_set_device_valuators_cookie_t cookie /**< */,
6521 xcb_generic_error_t **e /**< */)
6522 {
6523 return (xcb_input_set_device_valuators_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
6524 }
6525
6526 int
6527 xcb_input_device_resolution_state_sizeof (const void *_buffer /**< */)
6528 {
6529 char *xcb_tmp = (char *)_buffer;
6530 const xcb_input_device_resolution_state_t *_aux = (xcb_input_device_resolution_state_t *)_buffer;
6531 unsigned int xcb_buffer_len = 0;
6532 unsigned int xcb_block_len = 0;
6533 unsigned int xcb_pad = 0;
6534 unsigned int xcb_align_to = 0;
6535
6536
6537 xcb_block_len += sizeof(xcb_input_device_resolution_state_t);
6538 xcb_tmp += xcb_block_len;
6539 xcb_buffer_len += xcb_block_len;
6540 xcb_block_len = 0;
6541 /* resolution_values */
6542 xcb_block_len += _aux->num_valuators * sizeof(uint32_t);
6543 xcb_tmp += xcb_block_len;
6544 xcb_align_to = ALIGNOF(uint32_t);
6545 /* insert padding */
6546 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6547 xcb_buffer_len += xcb_block_len + xcb_pad;
6548 if (0 != xcb_pad) {
6549 xcb_tmp += xcb_pad;
6550 xcb_pad = 0;
6551 }
6552 xcb_block_len = 0;
6553 /* resolution_min */
6554 xcb_block_len += _aux->num_valuators * sizeof(uint32_t);
6555 xcb_tmp += xcb_block_len;
6556 xcb_align_to = ALIGNOF(uint32_t);
6557 /* insert padding */
6558 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6559 xcb_buffer_len += xcb_block_len + xcb_pad;
6560 if (0 != xcb_pad) {
6561 xcb_tmp += xcb_pad;
6562 xcb_pad = 0;
6563 }
6564 xcb_block_len = 0;
6565 /* resolution_max */
6566 xcb_block_len += _aux->num_valuators * sizeof(uint32_t);
6567 xcb_tmp += xcb_block_len;
6568 xcb_align_to = ALIGNOF(uint32_t);
6569 /* insert padding */
6570 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6571 xcb_buffer_len += xcb_block_len + xcb_pad;
6572 if (0 != xcb_pad) {
6573 xcb_tmp += xcb_pad;
6574 xcb_pad = 0;
6575 }
6576 xcb_block_len = 0;
6577
6578 return xcb_buffer_len;
6579 }
6580
6581
6582 /*****************************************************************************
6583 **
6584 ** uint32_t * xcb_input_device_resolution_state_resolution_values
6585 **
6586 ** @param const xcb_input_device_resolution_state_t *R
6587 ** @returns uint32_t *
6588 **
6589 *****************************************************************************/
6590
6591 uint32_t *
6592 xcb_input_device_resolution_state_resolution_values (const xcb_input_device_resolution_state_t *R /**< */)
6593 {
6594 return (uint32_t *) (R + 1);
6595 }
6596
6597
6598 /*****************************************************************************
6599 **
6600 ** int xcb_input_device_resolution_state_resolution_values_length
6601 **
6602 ** @param const xcb_input_device_resolution_state_t *R
6603 ** @returns int
6604 **
6605 *****************************************************************************/
6606
6607 int
6608 xcb_input_device_resolution_state_resolution_values_length (const xcb_input_device_resolution_state_t *R /**< */)
6609 {
6610 return R->num_valuators;
6611 }
6612
6613
6614 /*****************************************************************************
6615 **
6616 ** xcb_generic_iterator_t xcb_input_device_resolution_state_resolution_values_end
6617 **
6618 ** @param const xcb_input_device_resolution_state_t *R
6619 ** @returns xcb_generic_iterator_t
6620 **
6621 *****************************************************************************/
6622
6623 xcb_generic_iterator_t
6624 xcb_input_device_resolution_state_resolution_values_end (const xcb_input_device_resolution_state_t *R /**< */)
6625 {
6626 xcb_generic_iterator_t i;
6627 i.data = ((uint32_t *) (R + 1)) + (R->num_valuators);
6628 i.rem = 0;
6629 i.index = (char *) i.data - (char *) R;
6630 return i;
6631 }
6632
6633
6634 /*****************************************************************************
6635 **
6636 ** uint32_t * xcb_input_device_resolution_state_resolution_min
6637 **
6638 ** @param const xcb_input_device_resolution_state_t *R
6639 ** @returns uint32_t *
6640 **
6641 *****************************************************************************/
6642
6643 uint32_t *
6644 xcb_input_device_resolution_state_resolution_min (const xcb_input_device_resolution_state_t *R /**< */)
6645 {
6646 xcb_generic_iterator_t prev = xcb_input_device_resolution_state_resolution_values_end(R);
6647 return (uint32_t *) ((char *) prev.data + XCB_TYPE_PAD(uint32_t, prev.index) + 0);
6648 }
6649
6650
6651 /*****************************************************************************
6652 **
6653 ** int xcb_input_device_resolution_state_resolution_min_length
6654 **
6655 ** @param const xcb_input_device_resolution_state_t *R
6656 ** @returns int
6657 **
6658 *****************************************************************************/
6659
6660 int
6661 xcb_input_device_resolution_state_resolution_min_length (const xcb_input_device_resolution_state_t *R /**< */)
6662 {
6663 return R->num_valuators;
6664 }
6665
6666
6667 /*****************************************************************************
6668 **
6669 ** xcb_generic_iterator_t xcb_input_device_resolution_state_resolution_min_end
6670 **
6671 ** @param const xcb_input_device_resolution_state_t *R
6672 ** @returns xcb_generic_iterator_t
6673 **
6674 *****************************************************************************/
6675
6676 xcb_generic_iterator_t
6677 xcb_input_device_resolution_state_resolution_min_end (const xcb_input_device_resolution_state_t *R /**< */)
6678 {
6679 xcb_generic_iterator_t i;
6680 xcb_generic_iterator_t child = xcb_input_device_resolution_state_resolution_values_end(R);
6681 i.data = ((uint32_t *) child.data) + (R->num_valuators);
6682 i.rem = 0;
6683 i.index = (char *) i.data - (char *) R;
6684 return i;
6685 }
6686
6687
6688 /*****************************************************************************
6689 **
6690 ** uint32_t * xcb_input_device_resolution_state_resolution_max
6691 **
6692 ** @param const xcb_input_device_resolution_state_t *R
6693 ** @returns uint32_t *
6694 **
6695 *****************************************************************************/
6696
6697 uint32_t *
6698 xcb_input_device_resolution_state_resolution_max (const xcb_input_device_resolution_state_t *R /**< */)
6699 {
6700 xcb_generic_iterator_t prev = xcb_input_device_resolution_state_resolution_min_end(R);
6701 return (uint32_t *) ((char *) prev.data + XCB_TYPE_PAD(uint32_t, prev.index) + 0);
6702 }
6703
6704
6705 /*****************************************************************************
6706 **
6707 ** int xcb_input_device_resolution_state_resolution_max_length
6708 **
6709 ** @param const xcb_input_device_resolution_state_t *R
6710 ** @returns int
6711 **
6712 *****************************************************************************/
6713
6714 int
6715 xcb_input_device_resolution_state_resolution_max_length (const xcb_input_device_resolution_state_t *R /**< */)
6716 {
6717 return R->num_valuators;
6718 }
6719
6720
6721 /*****************************************************************************
6722 **
6723 ** xcb_generic_iterator_t xcb_input_device_resolution_state_resolution_max_end
6724 **
6725 ** @param const xcb_input_device_resolution_state_t *R
6726 ** @returns xcb_generic_iterator_t
6727 **
6728 *****************************************************************************/
6729
6730 xcb_generic_iterator_t
6731 xcb_input_device_resolution_state_resolution_max_end (const xcb_input_device_resolution_state_t *R /**< */)
6732 {
6733 xcb_generic_iterator_t i;
6734 xcb_generic_iterator_t child = xcb_input_device_resolution_state_resolution_min_end(R);
6735 i.data = ((uint32_t *) child.data) + (R->num_valuators);
6736 i.rem = 0;
6737 i.index = (char *) i.data - (char *) R;
6738 return i;
6739 }
6740
6741
6742 /*****************************************************************************
6743 **
6744 ** void xcb_input_device_resolution_state_next
6745 **
6746 ** @param xcb_input_device_resolution_state_iterator_t *i
6747 ** @returns void
6748 **
6749 *****************************************************************************/
6750
6751 void
6752 xcb_input_device_resolution_state_next (xcb_input_device_resolution_state_iterator_t *i /**< */)
6753 {
6754 xcb_input_device_resolution_state_t *R = i->data;
6755 xcb_generic_iterator_t child;
6756 child.data = (xcb_input_device_resolution_state_t *)(((char *)R) + xcb_input_device_resolution_state_sizeof(R));
6757 i->index = (char *) child.data - (char *) i->data;
6758 --i->rem;
6759 i->data = (xcb_input_device_resolution_state_t *) child.data;
6760 }
6761
6762
6763 /*****************************************************************************
6764 **
6765 ** xcb_generic_iterator_t xcb_input_device_resolution_state_end
6766 **
6767 ** @param xcb_input_device_resolution_state_iterator_t i
6768 ** @returns xcb_generic_iterator_t
6769 **
6770 *****************************************************************************/
6771
6772 xcb_generic_iterator_t
6773 xcb_input_device_resolution_state_end (xcb_input_device_resolution_state_iterator_t i /**< */)
6774 {
6775 xcb_generic_iterator_t ret;
6776 while(i.rem > 0)
6777 xcb_input_device_resolution_state_next(&i);
6778 ret.data = i.data;
6779 ret.rem = i.rem;
6780 ret.index = i.index;
6781 return ret;
6782 }
6783
6784
6785 /*****************************************************************************
6786 **
6787 ** void xcb_input_device_abs_calib_state_next
6788 **
6789 ** @param xcb_input_device_abs_calib_state_iterator_t *i
6790 ** @returns void
6791 **
6792 *****************************************************************************/
6793
6794 void
6795 xcb_input_device_abs_calib_state_next (xcb_input_device_abs_calib_state_iterator_t *i /**< */)
6796 {
6797 --i->rem;
6798 ++i->data;
6799 i->index += sizeof(xcb_input_device_abs_calib_state_t);
6800 }
6801
6802
6803 /*****************************************************************************
6804 **
6805 ** xcb_generic_iterator_t xcb_input_device_abs_calib_state_end
6806 **
6807 ** @param xcb_input_device_abs_calib_state_iterator_t i
6808 ** @returns xcb_generic_iterator_t
6809 **
6810 *****************************************************************************/
6811
6812 xcb_generic_iterator_t
6813 xcb_input_device_abs_calib_state_end (xcb_input_device_abs_calib_state_iterator_t i /**< */)
6814 {
6815 xcb_generic_iterator_t ret;
6816 ret.data = i.data + i.rem;
6817 ret.index = i.index + ((char *) ret.data - (char *) i.data);
6818 ret.rem = 0;
6819 return ret;
6820 }
6821
6822
6823 /*****************************************************************************
6824 **
6825 ** void xcb_input_device_abs_area_state_next
6826 **
6827 ** @param xcb_input_device_abs_area_state_iterator_t *i
6828 ** @returns void
6829 **
6830 *****************************************************************************/
6831
6832 void
6833 xcb_input_device_abs_area_state_next (xcb_input_device_abs_area_state_iterator_t *i /**< */)
6834 {
6835 --i->rem;
6836 ++i->data;
6837 i->index += sizeof(xcb_input_device_abs_area_state_t);
6838 }
6839
6840
6841 /*****************************************************************************
6842 **
6843 ** xcb_generic_iterator_t xcb_input_device_abs_area_state_end
6844 **
6845 ** @param xcb_input_device_abs_area_state_iterator_t i
6846 ** @returns xcb_generic_iterator_t
6847 **
6848 *****************************************************************************/
6849
6850 xcb_generic_iterator_t
6851 xcb_input_device_abs_area_state_end (xcb_input_device_abs_area_state_iterator_t i /**< */)
6852 {
6853 xcb_generic_iterator_t ret;
6854 ret.data = i.data + i.rem;
6855 ret.index = i.index + ((char *) ret.data - (char *) i.data);
6856 ret.rem = 0;
6857 return ret;
6858 }
6859
6860
6861 /*****************************************************************************
6862 **
6863 ** void xcb_input_device_core_state_next
6864 **
6865 ** @param xcb_input_device_core_state_iterator_t *i
6866 ** @returns void
6867 **
6868 *****************************************************************************/
6869
6870 void
6871 xcb_input_device_core_state_next (xcb_input_device_core_state_iterator_t *i /**< */)
6872 {
6873 --i->rem;
6874 ++i->data;
6875 i->index += sizeof(xcb_input_device_core_state_t);
6876 }
6877
6878
6879 /*****************************************************************************
6880 **
6881 ** xcb_generic_iterator_t xcb_input_device_core_state_end
6882 **
6883 ** @param xcb_input_device_core_state_iterator_t i
6884 ** @returns xcb_generic_iterator_t
6885 **
6886 *****************************************************************************/
6887
6888 xcb_generic_iterator_t
6889 xcb_input_device_core_state_end (xcb_input_device_core_state_iterator_t i /**< */)
6890 {
6891 xcb_generic_iterator_t ret;
6892 ret.data = i.data + i.rem;
6893 ret.index = i.index + ((char *) ret.data - (char *) i.data);
6894 ret.rem = 0;
6895 return ret;
6896 }
6897
6898
6899 /*****************************************************************************
6900 **
6901 ** void xcb_input_device_enable_state_next
6902 **
6903 ** @param xcb_input_device_enable_state_iterator_t *i
6904 ** @returns void
6905 **
6906 *****************************************************************************/
6907
6908 void
6909 xcb_input_device_enable_state_next (xcb_input_device_enable_state_iterator_t *i /**< */)
6910 {
6911 --i->rem;
6912 ++i->data;
6913 i->index += sizeof(xcb_input_device_enable_state_t);
6914 }
6915
6916
6917 /*****************************************************************************
6918 **
6919 ** xcb_generic_iterator_t xcb_input_device_enable_state_end
6920 **
6921 ** @param xcb_input_device_enable_state_iterator_t i
6922 ** @returns xcb_generic_iterator_t
6923 **
6924 *****************************************************************************/
6925
6926 xcb_generic_iterator_t
6927 xcb_input_device_enable_state_end (xcb_input_device_enable_state_iterator_t i /**< */)
6928 {
6929 xcb_generic_iterator_t ret;
6930 ret.data = i.data + i.rem;
6931 ret.index = i.index + ((char *) ret.data - (char *) i.data);
6932 ret.rem = 0;
6933 return ret;
6934 }
6935
6936 int
6937 xcb_input_device_state_sizeof (const void *_buffer /**< */)
6938 {
6939 char *xcb_tmp = (char *)_buffer;
6940 const xcb_input_device_state_t *_aux = (xcb_input_device_state_t *)_buffer;
6941 unsigned int xcb_buffer_len = 0;
6942 unsigned int xcb_block_len = 0;
6943 unsigned int xcb_pad = 0;
6944 unsigned int xcb_align_to = 0;
6945
6946
6947 xcb_block_len += sizeof(xcb_input_device_state_t);
6948 xcb_tmp += xcb_block_len;
6949 xcb_buffer_len += xcb_block_len;
6950 xcb_block_len = 0;
6951 /* uninterpreted_data */
6952 xcb_block_len += (_aux->len - 4) * sizeof(uint8_t);
6953 xcb_tmp += xcb_block_len;
6954 xcb_align_to = ALIGNOF(uint8_t);
6955 /* insert padding */
6956 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6957 xcb_buffer_len += xcb_block_len + xcb_pad;
6958 if (0 != xcb_pad) {
6959 xcb_tmp += xcb_pad;
6960 xcb_pad = 0;
6961 }
6962 xcb_block_len = 0;
6963
6964 return xcb_buffer_len;
6965 }
6966
6967
6968 /*****************************************************************************
6969 **
6970 ** uint8_t * xcb_input_device_state_uninterpreted_data
6971 **
6972 ** @param const xcb_input_device_state_t *R
6973 ** @returns uint8_t *
6974 **
6975 *****************************************************************************/
6976
6977 uint8_t *
6978 xcb_input_device_state_uninterpreted_data (const xcb_input_device_state_t *R /**< */)
6979 {
6980 return (uint8_t *) (R + 1);
6981 }
6982
6983
6984 /*****************************************************************************
6985 **
6986 ** int xcb_input_device_state_uninterpreted_data_length
6987 **
6988 ** @param const xcb_input_device_state_t *R
6989 ** @returns int
6990 **
6991 *****************************************************************************/
6992
6993 int
6994 xcb_input_device_state_uninterpreted_data_length (const xcb_input_device_state_t *R /**< */)
6995 {
6996 return (R->len - 4);
6997 }
6998
6999
7000 /*****************************************************************************
7001 **
7002 ** xcb_generic_iterator_t xcb_input_device_state_uninterpreted_data_end
7003 **
7004 ** @param const xcb_input_device_state_t *R
7005 ** @returns xcb_generic_iterator_t
7006 **
7007 *****************************************************************************/
7008
7009 xcb_generic_iterator_t
7010 xcb_input_device_state_uninterpreted_data_end (const xcb_input_device_state_t *R /**< */)
7011 {
7012 xcb_generic_iterator_t i;
7013 i.data = ((uint8_t *) (R + 1)) + ((R->len - 4));
7014 i.rem = 0;
7015 i.index = (char *) i.data - (char *) R;
7016 return i;
7017 }
7018
7019
7020 /*****************************************************************************
7021 **
7022 ** void xcb_input_device_state_next
7023 **
7024 ** @param xcb_input_device_state_iterator_t *i
7025 ** @returns void
7026 **
7027 *****************************************************************************/
7028
7029 void
7030 xcb_input_device_state_next (xcb_input_device_state_iterator_t *i /**< */)
7031 {
7032 xcb_input_device_state_t *R = i->data;
7033 xcb_generic_iterator_t child;
7034 child.data = (xcb_input_device_state_t *)(((char *)R) + xcb_input_device_state_sizeof(R));
7035 i->index = (char *) child.data - (char *) i->data;
7036 --i->rem;
7037 i->data = (xcb_input_device_state_t *) child.data;
7038 }
7039
7040
7041 /*****************************************************************************
7042 **
7043 ** xcb_generic_iterator_t xcb_input_device_state_end
7044 **
7045 ** @param xcb_input_device_state_iterator_t i
7046 ** @returns xcb_generic_iterator_t
7047 **
7048 *****************************************************************************/
7049
7050 xcb_generic_iterator_t
7051 xcb_input_device_state_end (xcb_input_device_state_iterator_t i /**< */)
7052 {
7053 xcb_generic_iterator_t ret;
7054 while(i.rem > 0)
7055 xcb_input_device_state_next(&i);
7056 ret.data = i.data;
7057 ret.rem = i.rem;
7058 ret.index = i.index;
7059 return ret;
7060 }
7061
7062 int
7063 xcb_input_get_device_control_sizeof (const void *_buffer /**< */)
7064 {
7065 char *xcb_tmp = (char *)_buffer;
7066 unsigned int xcb_buffer_len = 0;
7067 unsigned int xcb_block_len = 0;
7068 unsigned int xcb_pad = 0;
7069 unsigned int xcb_align_to = 0;
7070
7071
7072 xcb_block_len += sizeof(xcb_input_get_device_control_reply_t);
7073 xcb_tmp += xcb_block_len;
7074 xcb_buffer_len += xcb_block_len;
7075 xcb_block_len = 0;
7076 /* control */
7077 xcb_block_len += xcb_input_device_state_sizeof(xcb_tmp);
7078 xcb_tmp += xcb_block_len;
7079 xcb_align_to = ALIGNOF(xcb_input_device_state_t);
7080 /* insert padding */
7081 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
7082 xcb_buffer_len += xcb_block_len + xcb_pad;
7083 if (0 != xcb_pad) {
7084 xcb_tmp += xcb_pad;
7085 xcb_pad = 0;
7086 }
7087 xcb_block_len = 0;
7088
7089 return xcb_buffer_len;
7090 }
7091
7092
7093 /*****************************************************************************
7094 **
7095 ** xcb_input_get_device_control_cookie_t xcb_input_get_device_control
7096 **
7097 ** @param xcb_connection_t *c
7098 ** @param uint16_t control_id
7099 ** @param uint8_t device_id
7100 ** @returns xcb_input_get_device_control_cookie_t
7101 **
7102 *****************************************************************************/
7103
7104 xcb_input_get_device_control_cookie_t
7105 xcb_input_get_device_control (xcb_connection_t *c /**< */,
7106 uint16_t control_id /**< */,
7107 uint8_t device_id /**< */)
7108 {
7109 static const xcb_protocol_request_t xcb_req = {
7110 /* count */ 2,
7111 /* ext */ &xcb_input_id,
7112 /* opcode */ XCB_INPUT_GET_DEVICE_CONTROL,
7113 /* isvoid */ 0
7114 };
7115
7116 struct iovec xcb_parts[4];
7117 xcb_input_get_device_control_cookie_t xcb_ret;
7118 xcb_input_get_device_control_request_t xcb_out;
7119
7120 xcb_out.control_id = control_id;
7121 xcb_out.device_id = device_id;
7122 xcb_out.pad0 = 0;
7123
7124 xcb_parts[2].iov_base = (char *) &xcb_out;
7125 xcb_parts[2].iov_len = sizeof(xcb_out);
7126 xcb_parts[3].iov_base = 0;
7127 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
7128
7129 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
7130 return xcb_ret;
7131 }
7132
7133
7134 /*****************************************************************************
7135 **
7136 ** xcb_input_get_device_control_cookie_t xcb_input_get_device_control_unchecked
7137 **
7138 ** @param xcb_connection_t *c
7139 ** @param uint16_t control_id
7140 ** @param uint8_t device_id
7141 ** @returns xcb_input_get_device_control_cookie_t
7142 **
7143 *****************************************************************************/
7144
7145 xcb_input_get_device_control_cookie_t
7146 xcb_input_get_device_control_unchecked (xcb_connection_t *c /**< */,
7147 uint16_t control_id /**< */,
7148 uint8_t device_id /**< */)
7149 {
7150 static const xcb_protocol_request_t xcb_req = {
7151 /* count */ 2,
7152 /* ext */ &xcb_input_id,
7153 /* opcode */ XCB_INPUT_GET_DEVICE_CONTROL,
7154 /* isvoid */ 0
7155 };
7156
7157 struct iovec xcb_parts[4];
7158 xcb_input_get_device_control_cookie_t xcb_ret;
7159 xcb_input_get_device_control_request_t xcb_out;
7160
7161 xcb_out.control_id = control_id;
7162 xcb_out.device_id = device_id;
7163 xcb_out.pad0 = 0;
7164
7165 xcb_parts[2].iov_base = (char *) &xcb_out;
7166 xcb_parts[2].iov_len = sizeof(xcb_out);
7167 xcb_parts[3].iov_base = 0;
7168 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
7169
7170 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
7171 return xcb_ret;
7172 }
7173
7174
7175 /*****************************************************************************
7176 **
7177 ** xcb_input_device_state_t * xcb_input_get_device_control_control
7178 **
7179 ** @param const xcb_input_get_device_control_reply_t *R
7180 ** @returns xcb_input_device_state_t *
7181 **
7182 *****************************************************************************/
7183
7184 xcb_input_device_state_t *
7185 xcb_input_get_device_control_control (const xcb_input_get_device_control_reply_t *R /**< */)
7186 {
7187 return (xcb_input_device_state_t *) (R + 1);
7188 }
7189
7190
7191 /*****************************************************************************
7192 **
7193 ** xcb_input_get_device_control_reply_t * xcb_input_get_device_control_reply
7194 **
7195 ** @param xcb_connection_t *c
7196 ** @param xcb_input_get_device_control_cookie_t cookie
7197 ** @param xcb_generic_error_t **e
7198 ** @returns xcb_input_get_device_control_reply_t *
7199 **
7200 *****************************************************************************/
7201
7202 xcb_input_get_device_control_reply_t *
7203 xcb_input_get_device_control_reply (xcb_connection_t *c /**< */,
7204 xcb_input_get_device_control_cookie_t cookie /**< */,
7205 xcb_generic_error_t **e /**< */)
7206 {
7207 return (xcb_input_get_device_control_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
7208 }
7209
7210 int
7211 xcb_input_device_resolution_ctl_sizeof (const void *_buffer /**< */)
7212 {
7213 char *xcb_tmp = (char *)_buffer;
7214 const xcb_input_device_resolution_ctl_t *_aux = (xcb_input_device_resolution_ctl_t *)_buffer;
7215 unsigned int xcb_buffer_len = 0;
7216 unsigned int xcb_block_len = 0;
7217 unsigned int xcb_pad = 0;
7218 unsigned int xcb_align_to = 0;
7219
7220
7221 xcb_block_len += sizeof(xcb_input_device_resolution_ctl_t);
7222 xcb_tmp += xcb_block_len;
7223 xcb_buffer_len += xcb_block_len;
7224 xcb_block_len = 0;
7225 /* resolution_values */
7226 xcb_block_len += _aux->num_valuators * sizeof(uint32_t);
7227 xcb_tmp += xcb_block_len;
7228 xcb_align_to = ALIGNOF(uint32_t);
7229 /* insert padding */
7230 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
7231 xcb_buffer_len += xcb_block_len + xcb_pad;
7232 if (0 != xcb_pad) {
7233 xcb_tmp += xcb_pad;
7234 xcb_pad = 0;
7235 }
7236 xcb_block_len = 0;
7237
7238 return xcb_buffer_len;
7239 }
7240
7241
7242 /*****************************************************************************
7243 **
7244 ** uint32_t * xcb_input_device_resolution_ctl_resolution_values
7245 **
7246 ** @param const xcb_input_device_resolution_ctl_t *R
7247 ** @returns uint32_t *
7248 **
7249 *****************************************************************************/
7250
7251 uint32_t *
7252 xcb_input_device_resolution_ctl_resolution_values (const xcb_input_device_resolution_ctl_t *R /**< */)
7253 {
7254 return (uint32_t *) (R + 1);
7255 }
7256
7257
7258 /*****************************************************************************
7259 **
7260 ** int xcb_input_device_resolution_ctl_resolution_values_length
7261 **
7262 ** @param const xcb_input_device_resolution_ctl_t *R
7263 ** @returns int
7264 **
7265 *****************************************************************************/
7266
7267 int
7268 xcb_input_device_resolution_ctl_resolution_values_length (const xcb_input_device_resolution_ctl_t *R /**< */)
7269 {
7270 return R->num_valuators;
7271 }
7272
7273
7274 /*****************************************************************************
7275 **
7276 ** xcb_generic_iterator_t xcb_input_device_resolution_ctl_resolution_values_end
7277 **
7278 ** @param const xcb_input_device_resolution_ctl_t *R
7279 ** @returns xcb_generic_iterator_t
7280 **
7281 *****************************************************************************/
7282
7283 xcb_generic_iterator_t
7284 xcb_input_device_resolution_ctl_resolution_values_end (const xcb_input_device_resolution_ctl_t *R /**< */)
7285 {
7286 xcb_generic_iterator_t i;
7287 i.data = ((uint32_t *) (R + 1)) + (R->num_valuators);
7288 i.rem = 0;
7289 i.index = (char *) i.data - (char *) R;
7290 return i;
7291 }
7292
7293
7294 /*****************************************************************************
7295 **
7296 ** void xcb_input_device_resolution_ctl_next
7297 **
7298 ** @param xcb_input_device_resolution_ctl_iterator_t *i
7299 ** @returns void
7300 **
7301 *****************************************************************************/
7302
7303 void
7304 xcb_input_device_resolution_ctl_next (xcb_input_device_resolution_ctl_iterator_t *i /**< */)
7305 {
7306 xcb_input_device_resolution_ctl_t *R = i->data;
7307 xcb_generic_iterator_t child;
7308 child.data = (xcb_input_device_resolution_ctl_t *)(((char *)R) + xcb_input_device_resolution_ctl_sizeof(R));
7309 i->index = (char *) child.data - (char *) i->data;
7310 --i->rem;
7311 i->data = (xcb_input_device_resolution_ctl_t *) child.data;
7312 }
7313
7314
7315 /*****************************************************************************
7316 **
7317 ** xcb_generic_iterator_t xcb_input_device_resolution_ctl_end
7318 **
7319 ** @param xcb_input_device_resolution_ctl_iterator_t i
7320 ** @returns xcb_generic_iterator_t
7321 **
7322 *****************************************************************************/
7323
7324 xcb_generic_iterator_t
7325 xcb_input_device_resolution_ctl_end (xcb_input_device_resolution_ctl_iterator_t i /**< */)
7326 {
7327 xcb_generic_iterator_t ret;
7328 while(i.rem > 0)
7329 xcb_input_device_resolution_ctl_next(&i);
7330 ret.data = i.data;
7331 ret.rem = i.rem;
7332 ret.index = i.index;
7333 return ret;
7334 }
7335
7336
7337 /*****************************************************************************
7338 **
7339 ** void xcb_input_device_abs_calib_ctl_next
7340 **
7341 ** @param xcb_input_device_abs_calib_ctl_iterator_t *i
7342 ** @returns void
7343 **
7344 *****************************************************************************/
7345
7346 void
7347 xcb_input_device_abs_calib_ctl_next (xcb_input_device_abs_calib_ctl_iterator_t *i /**< */)
7348 {
7349 --i->rem;
7350 ++i->data;
7351 i->index += sizeof(xcb_input_device_abs_calib_ctl_t);
7352 }
7353
7354
7355 /*****************************************************************************
7356 **
7357 ** xcb_generic_iterator_t xcb_input_device_abs_calib_ctl_end
7358 **
7359 ** @param xcb_input_device_abs_calib_ctl_iterator_t i
7360 ** @returns xcb_generic_iterator_t
7361 **
7362 *****************************************************************************/
7363
7364 xcb_generic_iterator_t
7365 xcb_input_device_abs_calib_ctl_end (xcb_input_device_abs_calib_ctl_iterator_t i /**< */)
7366 {
7367 xcb_generic_iterator_t ret;
7368 ret.data = i.data + i.rem;
7369 ret.index = i.index + ((char *) ret.data - (char *) i.data);
7370 ret.rem = 0;
7371 return ret;
7372 }
7373
7374
7375 /*****************************************************************************
7376 **
7377 ** void xcb_input_device_abs_area_ctrl_next
7378 **
7379 ** @param xcb_input_device_abs_area_ctrl_iterator_t *i
7380 ** @returns void
7381 **
7382 *****************************************************************************/
7383
7384 void
7385 xcb_input_device_abs_area_ctrl_next (xcb_input_device_abs_area_ctrl_iterator_t *i /**< */)
7386 {
7387 --i->rem;
7388 ++i->data;
7389 i->index += sizeof(xcb_input_device_abs_area_ctrl_t);
7390 }
7391
7392
7393 /*****************************************************************************
7394 **
7395 ** xcb_generic_iterator_t xcb_input_device_abs_area_ctrl_end
7396 **
7397 ** @param xcb_input_device_abs_area_ctrl_iterator_t i
7398 ** @returns xcb_generic_iterator_t
7399 **
7400 *****************************************************************************/
7401
7402 xcb_generic_iterator_t
7403 xcb_input_device_abs_area_ctrl_end (xcb_input_device_abs_area_ctrl_iterator_t i /**< */)
7404 {
7405 xcb_generic_iterator_t ret;
7406 ret.data = i.data + i.rem;
7407 ret.index = i.index + ((char *) ret.data - (char *) i.data);
7408 ret.rem = 0;
7409 return ret;
7410 }
7411
7412
7413 /*****************************************************************************
7414 **
7415 ** void xcb_input_device_core_ctrl_next
7416 **
7417 ** @param xcb_input_device_core_ctrl_iterator_t *i
7418 ** @returns void
7419 **
7420 *****************************************************************************/
7421
7422 void
7423 xcb_input_device_core_ctrl_next (xcb_input_device_core_ctrl_iterator_t *i /**< */)
7424 {
7425 --i->rem;
7426 ++i->data;
7427 i->index += sizeof(xcb_input_device_core_ctrl_t);
7428 }
7429
7430
7431 /*****************************************************************************
7432 **
7433 ** xcb_generic_iterator_t xcb_input_device_core_ctrl_end
7434 **
7435 ** @param xcb_input_device_core_ctrl_iterator_t i
7436 ** @returns xcb_generic_iterator_t
7437 **
7438 *****************************************************************************/
7439
7440 xcb_generic_iterator_t
7441 xcb_input_device_core_ctrl_end (xcb_input_device_core_ctrl_iterator_t i /**< */)
7442 {
7443 xcb_generic_iterator_t ret;
7444 ret.data = i.data + i.rem;
7445 ret.index = i.index + ((char *) ret.data - (char *) i.data);
7446 ret.rem = 0;
7447 return ret;
7448 }
7449
7450
7451 /*****************************************************************************
7452 **
7453 ** void xcb_input_device_enable_ctrl_next
7454 **
7455 ** @param xcb_input_device_enable_ctrl_iterator_t *i
7456 ** @returns void
7457 **
7458 *****************************************************************************/
7459
7460 void
7461 xcb_input_device_enable_ctrl_next (xcb_input_device_enable_ctrl_iterator_t *i /**< */)
7462 {
7463 --i->rem;
7464 ++i->data;
7465 i->index += sizeof(xcb_input_device_enable_ctrl_t);
7466 }
7467
7468
7469 /*****************************************************************************
7470 **
7471 ** xcb_generic_iterator_t xcb_input_device_enable_ctrl_end
7472 **
7473 ** @param xcb_input_device_enable_ctrl_iterator_t i
7474 ** @returns xcb_generic_iterator_t
7475 **
7476 *****************************************************************************/
7477
7478 xcb_generic_iterator_t
7479 xcb_input_device_enable_ctrl_end (xcb_input_device_enable_ctrl_iterator_t i /**< */)
7480 {
7481 xcb_generic_iterator_t ret;
7482 ret.data = i.data + i.rem;
7483 ret.index = i.index + ((char *) ret.data - (char *) i.data);
7484 ret.rem = 0;
7485 return ret;
7486 }
7487
7488 int
7489 xcb_input_device_ctl_sizeof (const void *_buffer /**< */)
7490 {
7491 char *xcb_tmp = (char *)_buffer;
7492 const xcb_input_device_ctl_t *_aux = (xcb_input_device_ctl_t *)_buffer;
7493 unsigned int xcb_buffer_len = 0;
7494 unsigned int xcb_block_len = 0;
7495 unsigned int xcb_pad = 0;
7496 unsigned int xcb_align_to = 0;
7497
7498
7499 xcb_block_len += sizeof(xcb_input_device_ctl_t);
7500 xcb_tmp += xcb_block_len;
7501 xcb_buffer_len += xcb_block_len;
7502 xcb_block_len = 0;
7503 /* uninterpreted_data */
7504 xcb_block_len += (_aux->len - 4) * sizeof(uint8_t);
7505 xcb_tmp += xcb_block_len;
7506 xcb_align_to = ALIGNOF(uint8_t);
7507 /* insert padding */
7508 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
7509 xcb_buffer_len += xcb_block_len + xcb_pad;
7510 if (0 != xcb_pad) {
7511 xcb_tmp += xcb_pad;
7512 xcb_pad = 0;
7513 }
7514 xcb_block_len = 0;
7515
7516 return xcb_buffer_len;
7517 }
7518
7519
7520 /*****************************************************************************
7521 **
7522 ** uint8_t * xcb_input_device_ctl_uninterpreted_data
7523 **
7524 ** @param const xcb_input_device_ctl_t *R
7525 ** @returns uint8_t *
7526 **
7527 *****************************************************************************/
7528
7529 uint8_t *
7530 xcb_input_device_ctl_uninterpreted_data (const xcb_input_device_ctl_t *R /**< */)
7531 {
7532 return (uint8_t *) (R + 1);
7533 }
7534
7535
7536 /*****************************************************************************
7537 **
7538 ** int xcb_input_device_ctl_uninterpreted_data_length
7539 **
7540 ** @param const xcb_input_device_ctl_t *R
7541 ** @returns int
7542 **
7543 *****************************************************************************/
7544
7545 int
7546 xcb_input_device_ctl_uninterpreted_data_length (const xcb_input_device_ctl_t *R /**< */)
7547 {
7548 return (R->len - 4);
7549 }
7550
7551
7552 /*****************************************************************************
7553 **
7554 ** xcb_generic_iterator_t xcb_input_device_ctl_uninterpreted_data_end
7555 **
7556 ** @param const xcb_input_device_ctl_t *R
7557 ** @returns xcb_generic_iterator_t
7558 **
7559 *****************************************************************************/
7560
7561 xcb_generic_iterator_t
7562 xcb_input_device_ctl_uninterpreted_data_end (const xcb_input_device_ctl_t *R /**< */)
7563 {
7564 xcb_generic_iterator_t i;
7565 i.data = ((uint8_t *) (R + 1)) + ((R->len - 4));
7566 i.rem = 0;
7567 i.index = (char *) i.data - (char *) R;
7568 return i;
7569 }
7570
7571
7572 /*****************************************************************************
7573 **
7574 ** void xcb_input_device_ctl_next
7575 **
7576 ** @param xcb_input_device_ctl_iterator_t *i
7577 ** @returns void
7578 **
7579 *****************************************************************************/
7580
7581 void
7582 xcb_input_device_ctl_next (xcb_input_device_ctl_iterator_t *i /**< */)
7583 {
7584 xcb_input_device_ctl_t *R = i->data;
7585 xcb_generic_iterator_t child;
7586 child.data = (xcb_input_device_ctl_t *)(((char *)R) + xcb_input_device_ctl_sizeof(R));
7587 i->index = (char *) child.data - (char *) i->data;
7588 --i->rem;
7589 i->data = (xcb_input_device_ctl_t *) child.data;
7590 }
7591
7592
7593 /*****************************************************************************
7594 **
7595 ** xcb_generic_iterator_t xcb_input_device_ctl_end
7596 **
7597 ** @param xcb_input_device_ctl_iterator_t i
7598 ** @returns xcb_generic_iterator_t
7599 **
7600 *****************************************************************************/
7601
7602 xcb_generic_iterator_t
7603 xcb_input_device_ctl_end (xcb_input_device_ctl_iterator_t i /**< */)
7604 {
7605 xcb_generic_iterator_t ret;
7606 while(i.rem > 0)
7607 xcb_input_device_ctl_next(&i);
7608 ret.data = i.data;
7609 ret.rem = i.rem;
7610 ret.index = i.index;
7611 return ret;
7612 }
7613
7614 int
7615 xcb_input_change_device_control_sizeof (const void *_buffer /**< */)
7616 {
7617 char *xcb_tmp = (char *)_buffer;
7618 unsigned int xcb_buffer_len = 0;
7619 unsigned int xcb_block_len = 0;
7620 unsigned int xcb_pad = 0;
7621 unsigned int xcb_align_to = 0;
7622
7623
7624 xcb_block_len += sizeof(xcb_input_change_device_control_request_t);
7625 xcb_tmp += xcb_block_len;
7626 xcb_buffer_len += xcb_block_len;
7627 xcb_block_len = 0;
7628 /* control */
7629 xcb_block_len += xcb_input_device_ctl_sizeof(xcb_tmp);
7630 xcb_tmp += xcb_block_len;
7631 xcb_align_to = ALIGNOF(xcb_input_device_ctl_t);
7632 /* insert padding */
7633 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
7634 xcb_buffer_len += xcb_block_len + xcb_pad;
7635 if (0 != xcb_pad) {
7636 xcb_tmp += xcb_pad;
7637 xcb_pad = 0;
7638 }
7639 xcb_block_len = 0;
7640
7641 return xcb_buffer_len;
7642 }
7643
7644
7645 /*****************************************************************************
7646 **
7647 ** xcb_input_change_device_control_cookie_t xcb_input_change_device_control
7648 **
7649 ** @param xcb_connection_t *c
7650 ** @param uint16_t control_id
7651 ** @param uint8_t device_id
7652 ** @param xcb_input_device_ctl_t *control
7653 ** @returns xcb_input_change_device_control_cookie_t
7654 **
7655 *****************************************************************************/
7656
7657 xcb_input_change_device_control_cookie_t
7658 xcb_input_change_device_control (xcb_connection_t *c /**< */,
7659 uint16_t control_id /**< */,
7660 uint8_t device_id /**< */,
7661 xcb_input_device_ctl_t *control /**< */)
7662 {
7663 static const xcb_protocol_request_t xcb_req = {
7664 /* count */ 4,
7665 /* ext */ &xcb_input_id,
7666 /* opcode */ XCB_INPUT_CHANGE_DEVICE_CONTROL,
7667 /* isvoid */ 0
7668 };
7669
7670 struct iovec xcb_parts[6];
7671 xcb_input_change_device_control_cookie_t xcb_ret;
7672 xcb_input_change_device_control_request_t xcb_out;
7673
7674 xcb_out.control_id = control_id;
7675 xcb_out.device_id = device_id;
7676 xcb_out.pad0 = 0;
7677
7678 xcb_parts[2].iov_base = (char *) &xcb_out;
7679 xcb_parts[2].iov_len = sizeof(xcb_out);
7680 xcb_parts[3].iov_base = 0;
7681 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
7682 /* xcb_input_device_ctl_t control */
7683 xcb_parts[4].iov_base = (char *) control;
7684 xcb_parts[4].iov_len =
7685 xcb_input_device_ctl_sizeof (control);
7686
7687 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
7688 return xcb_ret;
7689 }
7690
7691
7692 /*****************************************************************************
7693 **
7694 ** xcb_input_change_device_control_cookie_t xcb_input_change_device_control_unchecked
7695 **
7696 ** @param xcb_connection_t *c
7697 ** @param uint16_t control_id
7698 ** @param uint8_t device_id
7699 ** @param xcb_input_device_ctl_t *control
7700 ** @returns xcb_input_change_device_control_cookie_t
7701 **
7702 *****************************************************************************/
7703
7704 xcb_input_change_device_control_cookie_t
7705 xcb_input_change_device_control_unchecked (xcb_connection_t *c /**< */,
7706 uint16_t control_id /**< */,
7707 uint8_t device_id /**< */,
7708 xcb_input_device_ctl_t *control /**< */)
7709 {
7710 static const xcb_protocol_request_t xcb_req = {
7711 /* count */ 4,
7712 /* ext */ &xcb_input_id,
7713 /* opcode */ XCB_INPUT_CHANGE_DEVICE_CONTROL,
7714 /* isvoid */ 0
7715 };
7716
7717 struct iovec xcb_parts[6];
7718 xcb_input_change_device_control_cookie_t xcb_ret;
7719 xcb_input_change_device_control_request_t xcb_out;
7720
7721 xcb_out.control_id = control_id;
7722 xcb_out.device_id = device_id;
7723 xcb_out.pad0 = 0;
7724
7725 xcb_parts[2].iov_base = (char *) &xcb_out;
7726 xcb_parts[2].iov_len = sizeof(xcb_out);
7727 xcb_parts[3].iov_base = 0;
7728 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
7729 /* xcb_input_device_ctl_t control */
7730 xcb_parts[4].iov_base = (char *) control;
7731 xcb_parts[4].iov_len =
7732 xcb_input_device_ctl_sizeof (control);
7733
7734 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
7735 return xcb_ret;
7736 }
7737
7738
7739 /*****************************************************************************
7740 **
7741 ** xcb_input_change_device_control_reply_t * xcb_input_change_device_control_reply
7742 **
7743 ** @param xcb_connection_t *c
7744 ** @param xcb_input_change_device_control_cookie_t cookie
7745 ** @param xcb_generic_error_t **e
7746 ** @returns xcb_input_change_device_control_reply_t *
7747 **
7748 *****************************************************************************/
7749
7750 xcb_input_change_device_control_reply_t *
7751 xcb_input_change_device_control_reply (xcb_connection_t *c /**< */,
7752 xcb_input_change_device_control_cookie_t cookie /**< */,
7753 xcb_generic_error_t **e /**< */)
7754 {
7755 return (xcb_input_change_device_control_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
7756 }
7757
7758 int
7759 xcb_input_list_device_properties_sizeof (const void *_buffer /**< */)
7760 {
7761 char *xcb_tmp = (char *)_buffer;
7762 const xcb_input_list_device_properties_reply_t *_aux = (xcb_input_list_device_properties_reply_t *)_buffer;
7763 unsigned int xcb_buffer_len = 0;
7764 unsigned int xcb_block_len = 0;
7765 unsigned int xcb_pad = 0;
7766 unsigned int xcb_align_to = 0;
7767
7768
7769 xcb_block_len += sizeof(xcb_input_list_device_properties_reply_t);
7770 xcb_tmp += xcb_block_len;
7771 xcb_buffer_len += xcb_block_len;
7772 xcb_block_len = 0;
7773 /* atoms */
7774 xcb_block_len += _aux->num_atoms * sizeof(xcb_atom_t);
7775 xcb_tmp += xcb_block_len;
7776 xcb_align_to = ALIGNOF(xcb_atom_t);
7777 /* insert padding */
7778 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
7779 xcb_buffer_len += xcb_block_len + xcb_pad;
7780 if (0 != xcb_pad) {
7781 xcb_tmp += xcb_pad;
7782 xcb_pad = 0;
7783 }
7784 xcb_block_len = 0;
7785
7786 return xcb_buffer_len;
7787 }
7788
7789
7790 /*****************************************************************************
7791 **
7792 ** xcb_input_list_device_properties_cookie_t xcb_input_list_device_properties
7793 **
7794 ** @param xcb_connection_t *c
7795 ** @param uint8_t device_id
7796 ** @returns xcb_input_list_device_properties_cookie_t
7797 **
7798 *****************************************************************************/
7799
7800 xcb_input_list_device_properties_cookie_t
7801 xcb_input_list_device_properties (xcb_connection_t *c /**< */,
7802 uint8_t device_id /**< */)
7803 {
7804 static const xcb_protocol_request_t xcb_req = {
7805 /* count */ 2,
7806 /* ext */ &xcb_input_id,
7807 /* opcode */ XCB_INPUT_LIST_DEVICE_PROPERTIES,
7808 /* isvoid */ 0
7809 };
7810
7811 struct iovec xcb_parts[4];
7812 xcb_input_list_device_properties_cookie_t xcb_ret;
7813 xcb_input_list_device_properties_request_t xcb_out;
7814
7815 xcb_out.device_id = device_id;
7816 memset(xcb_out.pad0, 0, 3);
7817
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;
7822
7823 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
7824 return xcb_ret;
7825 }
7826
7827
7828 /*****************************************************************************
7829 **
7830 ** xcb_input_list_device_properties_cookie_t xcb_input_list_device_properties_unchecked
7831 **
7832 ** @param xcb_connection_t *c
7833 ** @param uint8_t device_id
7834 ** @returns xcb_input_list_device_properties_cookie_t
7835 **
7836 *****************************************************************************/
7837
7838 xcb_input_list_device_properties_cookie_t
7839 xcb_input_list_device_properties_unchecked (xcb_connection_t *c /**< */,
7840 uint8_t device_id /**< */)
7841 {
7842 static const xcb_protocol_request_t xcb_req = {
7843 /* count */ 2,
7844 /* ext */ &xcb_input_id,
7845 /* opcode */ XCB_INPUT_LIST_DEVICE_PROPERTIES,
7846 /* isvoid */ 0
7847 };
7848
7849 struct iovec xcb_parts[4];
7850 xcb_input_list_device_properties_cookie_t xcb_ret;
7851 xcb_input_list_device_properties_request_t xcb_out;
7852
7853 xcb_out.device_id = device_id;
7854 memset(xcb_out.pad0, 0, 3);
7855
7856 xcb_parts[2].iov_base = (char *) &xcb_out;
7857 xcb_parts[2].iov_len = sizeof(xcb_out);
7858 xcb_parts[3].iov_base = 0;
7859 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
7860
7861 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
7862 return xcb_ret;
7863 }
7864
7865
7866 /*****************************************************************************
7867 **
7868 ** xcb_atom_t * xcb_input_list_device_properties_atoms
7869 **
7870 ** @param const xcb_input_list_device_properties_reply_t *R
7871 ** @returns xcb_atom_t *
7872 **
7873 *****************************************************************************/
7874
7875 xcb_atom_t *
7876 xcb_input_list_device_properties_atoms (const xcb_input_list_device_properties_reply_t *R /**< */)
7877 {
7878 return (xcb_atom_t *) (R + 1);
7879 }
7880
7881
7882 /*****************************************************************************
7883 **
7884 ** int xcb_input_list_device_properties_atoms_length
7885 **
7886 ** @param const xcb_input_list_device_properties_reply_t *R
7887 ** @returns int
7888 **
7889 *****************************************************************************/
7890
7891 int
7892 xcb_input_list_device_properties_atoms_length (const xcb_input_list_device_properties_reply_t *R /**< */)
7893 {
7894 return R->num_atoms;
7895 }
7896
7897
7898 /*****************************************************************************
7899 **
7900 ** xcb_generic_iterator_t xcb_input_list_device_properties_atoms_end
7901 **
7902 ** @param const xcb_input_list_device_properties_reply_t *R
7903 ** @returns xcb_generic_iterator_t
7904 **
7905 *****************************************************************************/
7906
7907 xcb_generic_iterator_t
7908 xcb_input_list_device_properties_atoms_end (const xcb_input_list_device_properties_reply_t *R /**< */)
7909 {
7910 xcb_generic_iterator_t i;
7911 i.data = ((xcb_atom_t *) (R + 1)) + (R->num_atoms);
7912 i.rem = 0;
7913 i.index = (char *) i.data - (char *) R;
7914 return i;
7915 }
7916
7917
7918 /*****************************************************************************
7919 **
7920 ** xcb_input_list_device_properties_reply_t * xcb_input_list_device_properties_reply
7921 **
7922 ** @param xcb_connection_t *c
7923 ** @param xcb_input_list_device_properties_cookie_t cookie
7924 ** @param xcb_generic_error_t **e
7925 ** @returns xcb_input_list_device_properties_reply_t *
7926 **
7927 *****************************************************************************/
7928
7929 xcb_input_list_device_properties_reply_t *
7930 xcb_input_list_device_properties_reply (xcb_connection_t *c /**< */,
7931 xcb_input_list_device_properties_cookie_t cookie /**< */,
7932 xcb_generic_error_t **e /**< */)
7933 {
7934 return (xcb_input_list_device_properties_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
7935 }
7936
7937
7938 /*****************************************************************************
7939 **
7940 ** uint8_t * xcb_input_change_device_property_items_data_8
7941 **
7942 ** @param const xcb_input_change_device_property_items_t *S
7943 ** @returns uint8_t *
7944 **
7945 *****************************************************************************/
7946
7947 uint8_t *
7948 xcb_input_change_device_property_items_data_8 (const xcb_input_change_device_property_items_t *S /**< */)
7949 {
7950 return /* items */ S->data8;
7951 }
7952
7953
7954 /*****************************************************************************
7955 **
7956 ** int xcb_input_change_device_property_items_data_8_length
7957 **
7958 ** @param const xcb_input_change_device_property_items_t *R
7959 ** @returns int
7960 **
7961 *****************************************************************************/
7962
7963 int
7964 xcb_input_change_device_property_items_data_8_length (const xcb_input_change_device_property_request_t *R /**< */,
7965 const xcb_input_change_device_property_items_t *S /**< */)
7966 {
7967 return R->num_items;
7968 }
7969
7970
7971 /*****************************************************************************
7972 **
7973 ** xcb_generic_iterator_t xcb_input_change_device_property_items_data_8_end
7974 **
7975 ** @param const xcb_input_change_device_property_items_t *R
7976 ** @returns xcb_generic_iterator_t
7977 **
7978 *****************************************************************************/
7979
7980 xcb_generic_iterator_t
7981 xcb_input_change_device_property_items_data_8_end (const xcb_input_change_device_property_request_t *R /**< */,
7982 const xcb_input_change_device_property_items_t *S /**< */)
7983 {
7984 xcb_generic_iterator_t i;
7985 i.data = /* items */ S->data8 + R->num_items;
7986 i.rem = 0;
7987 i.index = (char *) i.data - (char *) S;
7988 return i;
7989 }
7990
7991
7992 /*****************************************************************************
7993 **
7994 ** uint16_t * xcb_input_change_device_property_items_data_16
7995 **
7996 ** @param const xcb_input_change_device_property_items_t *S
7997 ** @returns uint16_t *
7998 **
7999 *****************************************************************************/
8000
8001 uint16_t *
8002 xcb_input_change_device_property_items_data_16 (const xcb_input_change_device_property_items_t *S /**< */)
8003 {
8004 return /* items */ S->data16;
8005 }
8006
8007
8008 /*****************************************************************************
8009 **
8010 ** int xcb_input_change_device_property_items_data_16_length
8011 **
8012 ** @param const xcb_input_change_device_property_items_t *R
8013 ** @returns int
8014 **
8015 *****************************************************************************/
8016
8017 int
8018 xcb_input_change_device_property_items_data_16_length (const xcb_input_change_device_property_request_t *R /**< */,
8019 const xcb_input_change_device_property_items_t *S /**< */)
8020 {
8021 return R->num_items;
8022 }
8023
8024
8025 /*****************************************************************************
8026 **
8027 ** xcb_generic_iterator_t xcb_input_change_device_property_items_data_16_end
8028 **
8029 ** @param const xcb_input_change_device_property_items_t *R
8030 ** @returns xcb_generic_iterator_t
8031 **
8032 *****************************************************************************/
8033
8034 xcb_generic_iterator_t
8035 xcb_input_change_device_property_items_data_16_end (const xcb_input_change_device_property_request_t *R /**< */,
8036 const xcb_input_change_device_property_items_t *S /**< */)
8037 {
8038 xcb_generic_iterator_t i;
8039 i.data = /* items */ S->data16 + R->num_items;
8040 i.rem = 0;
8041 i.index = (char *) i.data - (char *) S;
8042 return i;
8043 }
8044
8045
8046 /*****************************************************************************
8047 **
8048 ** uint32_t * xcb_input_change_device_property_items_data_32
8049 **
8050 ** @param const xcb_input_change_device_property_items_t *S
8051 ** @returns uint32_t *
8052 **
8053 *****************************************************************************/
8054
8055 uint32_t *
8056 xcb_input_change_device_property_items_data_32 (const xcb_input_change_device_property_items_t *S /**< */)
8057 {
8058 return /* items */ S->data32;
8059 }
8060
8061
8062 /*****************************************************************************
8063 **
8064 ** int xcb_input_change_device_property_items_data_32_length
8065 **
8066 ** @param const xcb_input_change_device_property_items_t *R
8067 ** @returns int
8068 **
8069 *****************************************************************************/
8070
8071 int
8072 xcb_input_change_device_property_items_data_32_length (const xcb_input_change_device_property_request_t *R /**< */,
8073 const xcb_input_change_device_property_items_t *S /**< */)
8074 {
8075 return R->num_items;
8076 }
8077
8078
8079 /*****************************************************************************
8080 **
8081 ** xcb_generic_iterator_t xcb_input_change_device_property_items_data_32_end
8082 **
8083 ** @param const xcb_input_change_device_property_items_t *R
8084 ** @returns xcb_generic_iterator_t
8085 **
8086 *****************************************************************************/
8087
8088 xcb_generic_iterator_t
8089 xcb_input_change_device_property_items_data_32_end (const xcb_input_change_device_property_request_t *R /**< */,
8090 const xcb_input_change_device_property_items_t *S /**< */)
8091 {
8092 xcb_generic_iterator_t i;
8093 i.data = /* items */ S->data32 + R->num_items;
8094 i.rem = 0;
8095 i.index = (char *) i.data - (char *) S;
8096 return i;
8097 }
8098
8099 int
8100 xcb_input_change_device_property_items_serialize (void **_buffer /**< */,
8101 uint32_t num_items /**< */,
8102 uint8_t format /**< */,
8103 const xcb_input_change_device_property_items_t *_aux /**< */)
8104 {
8105 char *xcb_out = *_buffer;
8106 unsigned int xcb_buffer_len = 0;
8107 unsigned int xcb_align_to = 0;
8108
8109 unsigned int xcb_pad = 0;
8110 char xcb_pad0[3] = {0, 0, 0};
8111 struct iovec xcb_parts[7];
8112 unsigned int xcb_parts_idx = 0;
8113 unsigned int xcb_block_len = 0;
8114 unsigned int i;
8115 char *xcb_tmp;
8116
8117 if(format & XCB_INPUT_PROPERTY_FORMAT_8_BITS) {
8118 /* insert padding */
8119 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8120 xcb_buffer_len += xcb_block_len + xcb_pad;
8121 if (0 != xcb_pad) {
8122 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
8123 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
8124 xcb_parts_idx++;
8125 xcb_pad = 0;
8126 }
8127 xcb_block_len = 0;
8128 /* data8 */
8129 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->data8;
8130 xcb_block_len += num_items * sizeof(uint8_t);
8131 xcb_parts[xcb_parts_idx].iov_len = num_items * sizeof(uint8_t);
8132 xcb_parts_idx++;
8133 xcb_align_to = ALIGNOF(uint8_t);
8134 }
8135 if(format & XCB_INPUT_PROPERTY_FORMAT_16_BITS) {
8136 /* insert padding */
8137 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8138 xcb_buffer_len += xcb_block_len + xcb_pad;
8139 if (0 != xcb_pad) {
8140 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
8141 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
8142 xcb_parts_idx++;
8143 xcb_pad = 0;
8144 }
8145 xcb_block_len = 0;
8146 /* data16 */
8147 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->data16;
8148 xcb_block_len += num_items * sizeof(uint16_t);
8149 xcb_parts[xcb_parts_idx].iov_len = num_items * sizeof(uint16_t);
8150 xcb_parts_idx++;
8151 xcb_align_to = ALIGNOF(uint16_t);
8152 }
8153 if(format & XCB_INPUT_PROPERTY_FORMAT_32_BITS) {
8154 /* insert padding */
8155 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8156 xcb_buffer_len += xcb_block_len + xcb_pad;
8157 if (0 != xcb_pad) {
8158 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
8159 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
8160 xcb_parts_idx++;
8161 xcb_pad = 0;
8162 }
8163 xcb_block_len = 0;
8164 /* data32 */
8165 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->data32;
8166 xcb_block_len += num_items * sizeof(uint32_t);
8167 xcb_parts[xcb_parts_idx].iov_len = num_items * sizeof(uint32_t);
8168 xcb_parts_idx++;
8169 xcb_align_to = ALIGNOF(uint32_t);
8170 }
8171 /* insert padding */
8172 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8173 xcb_buffer_len += xcb_block_len + xcb_pad;
8174 if (0 != xcb_pad) {
8175 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
8176 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
8177 xcb_parts_idx++;
8178 xcb_pad = 0;
8179 }
8180 xcb_block_len = 0;
8181
8182 if (NULL == xcb_out) {
8183 /* allocate memory */
8184 xcb_out = malloc(xcb_buffer_len);
8185 *_buffer = xcb_out;
8186 }
8187
8188 xcb_tmp = xcb_out;
8189 for(i=0; i<xcb_parts_idx; i++) {
8190 if (0 != xcb_parts[i].iov_base && 0 != xcb_parts[i].iov_len)
8191 memcpy(xcb_tmp, xcb_parts[i].iov_base, xcb_parts[i].iov_len);
8192 if (0 != xcb_parts[i].iov_len)
8193 xcb_tmp += xcb_parts[i].iov_len;
8194 }
8195
8196 return xcb_buffer_len;
8197 }
8198
8199 int
8200 xcb_input_change_device_property_items_unpack (const void *_buffer /**< */,
8201 uint32_t num_items /**< */,
8202 uint8_t format /**< */,
8203 xcb_input_change_device_property_items_t *_aux /**< */)
8204 {
8205 char *xcb_tmp = (char *)_buffer;
8206 unsigned int xcb_buffer_len = 0;
8207 unsigned int xcb_block_len = 0;
8208 unsigned int xcb_pad = 0;
8209 unsigned int xcb_align_to = 0;
8210
8211
8212 if(format & XCB_INPUT_PROPERTY_FORMAT_8_BITS) {
8213 /* insert padding */
8214 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8215 xcb_buffer_len += xcb_block_len + xcb_pad;
8216 if (0 != xcb_pad) {
8217 xcb_tmp += xcb_pad;
8218 xcb_pad = 0;
8219 }
8220 xcb_block_len = 0;
8221 /* data8 */
8222 _aux->data8 = (uint8_t *)xcb_tmp;
8223 xcb_block_len += num_items * sizeof(uint8_t);
8224 xcb_tmp += xcb_block_len;
8225 xcb_align_to = ALIGNOF(uint8_t);
8226 }
8227 if(format & XCB_INPUT_PROPERTY_FORMAT_16_BITS) {
8228 /* insert padding */
8229 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8230 xcb_buffer_len += xcb_block_len + xcb_pad;
8231 if (0 != xcb_pad) {
8232 xcb_tmp += xcb_pad;
8233 xcb_pad = 0;
8234 }
8235 xcb_block_len = 0;
8236 /* data16 */
8237 _aux->data16 = (uint16_t *)xcb_tmp;
8238 xcb_block_len += num_items * sizeof(uint16_t);
8239 xcb_tmp += xcb_block_len;
8240 xcb_align_to = ALIGNOF(uint16_t);
8241 }
8242 if(format & XCB_INPUT_PROPERTY_FORMAT_32_BITS) {
8243 /* insert padding */
8244 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8245 xcb_buffer_len += xcb_block_len + xcb_pad;
8246 if (0 != xcb_pad) {
8247 xcb_tmp += xcb_pad;
8248 xcb_pad = 0;
8249 }
8250 xcb_block_len = 0;
8251 /* data32 */
8252 _aux->data32 = (uint32_t *)xcb_tmp;
8253 xcb_block_len += num_items * sizeof(uint32_t);
8254 xcb_tmp += xcb_block_len;
8255 xcb_align_to = ALIGNOF(uint32_t);
8256 }
8257 /* insert padding */
8258 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8259 xcb_buffer_len += xcb_block_len + xcb_pad;
8260 if (0 != xcb_pad) {
8261 xcb_tmp += xcb_pad;
8262 xcb_pad = 0;
8263 }
8264 xcb_block_len = 0;
8265
8266 return xcb_buffer_len;
8267 }
8268
8269 int
8270 xcb_input_change_device_property_items_sizeof (const void *_buffer /**< */,
8271 uint32_t num_items /**< */,
8272 uint8_t format /**< */)
8273 {
8274 xcb_input_change_device_property_items_t _aux;
8275 return xcb_input_change_device_property_items_unpack(_buffer, num_items, format, &_aux);
8276 }
8277
8278
8279 /*****************************************************************************
8280 **
8281 ** xcb_void_cookie_t xcb_input_change_device_property_checked
8282 **
8283 ** @param xcb_connection_t *c
8284 ** @param xcb_atom_t property
8285 ** @param xcb_atom_t type
8286 ** @param uint8_t device_id
8287 ** @param uint8_t format
8288 ** @param uint8_t mode
8289 ** @param uint32_t num_items
8290 ** @param const void *items
8291 ** @returns xcb_void_cookie_t
8292 **
8293 *****************************************************************************/
8294
8295 xcb_void_cookie_t
8296 xcb_input_change_device_property_checked (xcb_connection_t *c /**< */,
8297 xcb_atom_t property /**< */,
8298 xcb_atom_t type /**< */,
8299 uint8_t device_id /**< */,
8300 uint8_t format /**< */,
8301 uint8_t mode /**< */,
8302 uint32_t num_items /**< */,
8303 const void *items /**< */)
8304 {
8305 static const xcb_protocol_request_t xcb_req = {
8306 /* count */ 3,
8307 /* ext */ &xcb_input_id,
8308 /* opcode */ XCB_INPUT_CHANGE_DEVICE_PROPERTY,
8309 /* isvoid */ 1
8310 };
8311
8312 struct iovec xcb_parts[5];
8313 xcb_void_cookie_t xcb_ret;
8314 xcb_input_change_device_property_request_t xcb_out;
8315
8316 xcb_out.property = property;
8317 xcb_out.type = type;
8318 xcb_out.device_id = device_id;
8319 xcb_out.format = format;
8320 xcb_out.mode = mode;
8321 xcb_out.pad0 = 0;
8322 xcb_out.num_items = num_items;
8323
8324 xcb_parts[2].iov_base = (char *) &xcb_out;
8325 xcb_parts[2].iov_len = sizeof(xcb_out);
8326 xcb_parts[3].iov_base = 0;
8327 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
8328 /* xcb_input_change_device_property_items_t items */
8329 xcb_parts[4].iov_base = (char *) items;
8330 xcb_parts[4].iov_len =
8331 xcb_input_change_device_property_items_sizeof (items, num_items, format);
8332
8333 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
8334 return xcb_ret;
8335 }
8336
8337
8338 /*****************************************************************************
8339 **
8340 ** xcb_void_cookie_t xcb_input_change_device_property
8341 **
8342 ** @param xcb_connection_t *c
8343 ** @param xcb_atom_t property
8344 ** @param xcb_atom_t type
8345 ** @param uint8_t device_id
8346 ** @param uint8_t format
8347 ** @param uint8_t mode
8348 ** @param uint32_t num_items
8349 ** @param const void *items
8350 ** @returns xcb_void_cookie_t
8351 **
8352 *****************************************************************************/
8353
8354 xcb_void_cookie_t
8355 xcb_input_change_device_property (xcb_connection_t *c /**< */,
8356 xcb_atom_t property /**< */,
8357 xcb_atom_t type /**< */,
8358 uint8_t device_id /**< */,
8359 uint8_t format /**< */,
8360 uint8_t mode /**< */,
8361 uint32_t num_items /**< */,
8362 const void *items /**< */)
8363 {
8364 static const xcb_protocol_request_t xcb_req = {
8365 /* count */ 3,
8366 /* ext */ &xcb_input_id,
8367 /* opcode */ XCB_INPUT_CHANGE_DEVICE_PROPERTY,
8368 /* isvoid */ 1
8369 };
8370
8371 struct iovec xcb_parts[5];
8372 xcb_void_cookie_t xcb_ret;
8373 xcb_input_change_device_property_request_t xcb_out;
8374
8375 xcb_out.property = property;
8376 xcb_out.type = type;
8377 xcb_out.device_id = device_id;
8378 xcb_out.format = format;
8379 xcb_out.mode = mode;
8380 xcb_out.pad0 = 0;
8381 xcb_out.num_items = num_items;
8382
8383 xcb_parts[2].iov_base = (char *) &xcb_out;
8384 xcb_parts[2].iov_len = sizeof(xcb_out);
8385 xcb_parts[3].iov_base = 0;
8386 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
8387 /* xcb_input_change_device_property_items_t items */
8388 xcb_parts[4].iov_base = (char *) items;
8389 xcb_parts[4].iov_len =
8390 xcb_input_change_device_property_items_sizeof (items, num_items, format);
8391
8392 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
8393 return xcb_ret;
8394 }
8395
8396
8397 /*****************************************************************************
8398 **
8399 ** xcb_void_cookie_t xcb_input_change_device_property_aux_checked
8400 **
8401 ** @param xcb_connection_t *c
8402 ** @param xcb_atom_t property
8403 ** @param xcb_atom_t type
8404 ** @param uint8_t device_id
8405 ** @param uint8_t format
8406 ** @param uint8_t mode
8407 ** @param uint32_t num_items
8408 ** @param const xcb_input_change_device_property_items_t *items
8409 ** @returns xcb_void_cookie_t
8410 **
8411 *****************************************************************************/
8412
8413 xcb_void_cookie_t
8414 xcb_input_change_device_property_aux_checked (xcb_connection_t *c /**< */,
8415 xcb_atom_t property /**< */,
8416 xcb_atom_t type /**< */,
8417 uint8_t device_id /**< */,
8418 uint8_t format /**< */,
8419 uint8_t mode /**< */,
8420 uint32_t num_items /**< */,
8421 const xcb_input_change_device_property_items_t *items /**< */)
8422 {
8423 static const xcb_protocol_request_t xcb_req = {
8424 /* count */ 3,
8425 /* ext */ &xcb_input_id,
8426 /* opcode */ XCB_INPUT_CHANGE_DEVICE_PROPERTY,
8427 /* isvoid */ 1
8428 };
8429
8430 struct iovec xcb_parts[5];
8431 xcb_void_cookie_t xcb_ret;
8432 xcb_input_change_device_property_request_t xcb_out;
8433 void *xcb_aux0 = 0;
8434
8435 xcb_out.property = property;
8436 xcb_out.type = type;
8437 xcb_out.device_id = device_id;
8438 xcb_out.format = format;
8439 xcb_out.mode = mode;
8440 xcb_out.pad0 = 0;
8441 xcb_out.num_items = num_items;
8442
8443 xcb_parts[2].iov_base = (char *) &xcb_out;
8444 xcb_parts[2].iov_len = sizeof(xcb_out);
8445 xcb_parts[3].iov_base = 0;
8446 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
8447 /* xcb_input_change_device_property_items_t items */
8448 xcb_parts[4].iov_len =
8449 xcb_input_change_device_property_items_serialize (&xcb_aux0, num_items, format, items);
8450 xcb_parts[4].iov_base = xcb_aux0;
8451
8452 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
8453 free(xcb_aux0);
8454 return xcb_ret;
8455 }
8456
8457
8458 /*****************************************************************************
8459 **
8460 ** xcb_void_cookie_t xcb_input_change_device_property_aux
8461 **
8462 ** @param xcb_connection_t *c
8463 ** @param xcb_atom_t property
8464 ** @param xcb_atom_t type
8465 ** @param uint8_t device_id
8466 ** @param uint8_t format
8467 ** @param uint8_t mode
8468 ** @param uint32_t num_items
8469 ** @param const xcb_input_change_device_property_items_t *items
8470 ** @returns xcb_void_cookie_t
8471 **
8472 *****************************************************************************/
8473
8474 xcb_void_cookie_t
8475 xcb_input_change_device_property_aux (xcb_connection_t *c /**< */,
8476 xcb_atom_t property /**< */,
8477 xcb_atom_t type /**< */,
8478 uint8_t device_id /**< */,
8479 uint8_t format /**< */,
8480 uint8_t mode /**< */,
8481 uint32_t num_items /**< */,
8482 const xcb_input_change_device_property_items_t *items /**< */)
8483 {
8484 static const xcb_protocol_request_t xcb_req = {
8485 /* count */ 3,
8486 /* ext */ &xcb_input_id,
8487 /* opcode */ XCB_INPUT_CHANGE_DEVICE_PROPERTY,
8488 /* isvoid */ 1
8489 };
8490
8491 struct iovec xcb_parts[5];
8492 xcb_void_cookie_t xcb_ret;
8493 xcb_input_change_device_property_request_t xcb_out;
8494 void *xcb_aux0 = 0;
8495
8496 xcb_out.property = property;
8497 xcb_out.type = type;
8498 xcb_out.device_id = device_id;
8499 xcb_out.format = format;
8500 xcb_out.mode = mode;
8501 xcb_out.pad0 = 0;
8502 xcb_out.num_items = num_items;
8503
8504 xcb_parts[2].iov_base = (char *) &xcb_out;
8505 xcb_parts[2].iov_len = sizeof(xcb_out);
8506 xcb_parts[3].iov_base = 0;
8507 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
8508 /* xcb_input_change_device_property_items_t items */
8509 xcb_parts[4].iov_len =
8510 xcb_input_change_device_property_items_serialize (&xcb_aux0, num_items, format, items);
8511 xcb_parts[4].iov_base = xcb_aux0;
8512
8513 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
8514 free(xcb_aux0);
8515 return xcb_ret;
8516 }
8517
8518
8519 /*****************************************************************************
8520 **
8521 ** xcb_void_cookie_t xcb_input_delete_device_property_checked
8522 **
8523 ** @param xcb_connection_t *c
8524 ** @param xcb_atom_t property
8525 ** @param uint8_t device_id
8526 ** @returns xcb_void_cookie_t
8527 **
8528 *****************************************************************************/
8529
8530 xcb_void_cookie_t
8531 xcb_input_delete_device_property_checked (xcb_connection_t *c /**< */,
8532 xcb_atom_t property /**< */,
8533 uint8_t device_id /**< */)
8534 {
8535 static const xcb_protocol_request_t xcb_req = {
8536 /* count */ 2,
8537 /* ext */ &xcb_input_id,
8538 /* opcode */ XCB_INPUT_DELETE_DEVICE_PROPERTY,
8539 /* isvoid */ 1
8540 };
8541
8542 struct iovec xcb_parts[4];
8543 xcb_void_cookie_t xcb_ret;
8544 xcb_input_delete_device_property_request_t xcb_out;
8545
8546 xcb_out.property = property;
8547 xcb_out.device_id = device_id;
8548 memset(xcb_out.pad0, 0, 3);
8549
8550 xcb_parts[2].iov_base = (char *) &xcb_out;
8551 xcb_parts[2].iov_len = sizeof(xcb_out);
8552 xcb_parts[3].iov_base = 0;
8553 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
8554
8555 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
8556 return xcb_ret;
8557 }
8558
8559
8560 /*****************************************************************************
8561 **
8562 ** xcb_void_cookie_t xcb_input_delete_device_property
8563 **
8564 ** @param xcb_connection_t *c
8565 ** @param xcb_atom_t property
8566 ** @param uint8_t device_id
8567 ** @returns xcb_void_cookie_t
8568 **
8569 *****************************************************************************/
8570
8571 xcb_void_cookie_t
8572 xcb_input_delete_device_property (xcb_connection_t *c /**< */,
8573 xcb_atom_t property /**< */,
8574 uint8_t device_id /**< */)
8575 {
8576 static const xcb_protocol_request_t xcb_req = {
8577 /* count */ 2,
8578 /* ext */ &xcb_input_id,
8579 /* opcode */ XCB_INPUT_DELETE_DEVICE_PROPERTY,
8580 /* isvoid */ 1
8581 };
8582
8583 struct iovec xcb_parts[4];
8584 xcb_void_cookie_t xcb_ret;
8585 xcb_input_delete_device_property_request_t xcb_out;
8586
8587 xcb_out.property = property;
8588 xcb_out.device_id = device_id;
8589 memset(xcb_out.pad0, 0, 3);
8590
8591 xcb_parts[2].iov_base = (char *) &xcb_out;
8592 xcb_parts[2].iov_len = sizeof(xcb_out);
8593 xcb_parts[3].iov_base = 0;
8594 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
8595
8596 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
8597 return xcb_ret;
8598 }
8599
8600
8601 /*****************************************************************************
8602 **
8603 ** uint8_t * xcb_input_get_device_property_items_data_8
8604 **
8605 ** @param const xcb_input_get_device_property_items_t *S
8606 ** @returns uint8_t *
8607 **
8608 *****************************************************************************/
8609
8610 uint8_t *
8611 xcb_input_get_device_property_items_data_8 (const xcb_input_get_device_property_items_t *S /**< */)
8612 {
8613 return /* items */ S->data8;
8614 }
8615
8616
8617 /*****************************************************************************
8618 **
8619 ** int xcb_input_get_device_property_items_data_8_length
8620 **
8621 ** @param const xcb_input_get_device_property_items_t *R
8622 ** @returns int
8623 **
8624 *****************************************************************************/
8625
8626 int
8627 xcb_input_get_device_property_items_data_8_length (const xcb_input_get_device_property_reply_t *R /**< */,
8628 const xcb_input_get_device_property_items_t *S /**< */)
8629 {
8630 return R->num_items;
8631 }
8632
8633
8634 /*****************************************************************************
8635 **
8636 ** xcb_generic_iterator_t xcb_input_get_device_property_items_data_8_end
8637 **
8638 ** @param const xcb_input_get_device_property_items_t *R
8639 ** @returns xcb_generic_iterator_t
8640 **
8641 *****************************************************************************/
8642
8643 xcb_generic_iterator_t
8644 xcb_input_get_device_property_items_data_8_end (const xcb_input_get_device_property_reply_t *R /**< */,
8645 const xcb_input_get_device_property_items_t *S /**< */)
8646 {
8647 xcb_generic_iterator_t i;
8648 i.data = /* items */ S->data8 + R->num_items;
8649 i.rem = 0;
8650 i.index = (char *) i.data - (char *) S;
8651 return i;
8652 }
8653
8654
8655 /*****************************************************************************
8656 **
8657 ** uint16_t * xcb_input_get_device_property_items_data_16
8658 **
8659 ** @param const xcb_input_get_device_property_items_t *S
8660 ** @returns uint16_t *
8661 **
8662 *****************************************************************************/
8663
8664 uint16_t *
8665 xcb_input_get_device_property_items_data_16 (const xcb_input_get_device_property_items_t *S /**< */)
8666 {
8667 return /* items */ S->data16;
8668 }
8669
8670
8671 /*****************************************************************************
8672 **
8673 ** int xcb_input_get_device_property_items_data_16_length
8674 **
8675 ** @param const xcb_input_get_device_property_items_t *R
8676 ** @returns int
8677 **
8678 *****************************************************************************/
8679
8680 int
8681 xcb_input_get_device_property_items_data_16_length (const xcb_input_get_device_property_reply_t *R /**< */,
8682 const xcb_input_get_device_property_items_t *S /**< */)
8683 {
8684 return R->num_items;
8685 }
8686
8687
8688 /*****************************************************************************
8689 **
8690 ** xcb_generic_iterator_t xcb_input_get_device_property_items_data_16_end
8691 **
8692 ** @param const xcb_input_get_device_property_items_t *R
8693 ** @returns xcb_generic_iterator_t
8694 **
8695 *****************************************************************************/
8696
8697 xcb_generic_iterator_t
8698 xcb_input_get_device_property_items_data_16_end (const xcb_input_get_device_property_reply_t *R /**< */,
8699 const xcb_input_get_device_property_items_t *S /**< */)
8700 {
8701 xcb_generic_iterator_t i;
8702 i.data = /* items */ S->data16 + R->num_items;
8703 i.rem = 0;
8704 i.index = (char *) i.data - (char *) S;
8705 return i;
8706 }
8707
8708
8709 /*****************************************************************************
8710 **
8711 ** uint32_t * xcb_input_get_device_property_items_data_32
8712 **
8713 ** @param const xcb_input_get_device_property_items_t *S
8714 ** @returns uint32_t *
8715 **
8716 *****************************************************************************/
8717
8718 uint32_t *
8719 xcb_input_get_device_property_items_data_32 (const xcb_input_get_device_property_items_t *S /**< */)
8720 {
8721 return /* items */ S->data32;
8722 }
8723
8724
8725 /*****************************************************************************
8726 **
8727 ** int xcb_input_get_device_property_items_data_32_length
8728 **
8729 ** @param const xcb_input_get_device_property_items_t *R
8730 ** @returns int
8731 **
8732 *****************************************************************************/
8733
8734 int
8735 xcb_input_get_device_property_items_data_32_length (const xcb_input_get_device_property_reply_t *R /**< */,
8736 const xcb_input_get_device_property_items_t *S /**< */)
8737 {
8738 return R->num_items;
8739 }
8740
8741
8742 /*****************************************************************************
8743 **
8744 ** xcb_generic_iterator_t xcb_input_get_device_property_items_data_32_end
8745 **
8746 ** @param const xcb_input_get_device_property_items_t *R
8747 ** @returns xcb_generic_iterator_t
8748 **
8749 *****************************************************************************/
8750
8751 xcb_generic_iterator_t
8752 xcb_input_get_device_property_items_data_32_end (const xcb_input_get_device_property_reply_t *R /**< */,
8753 const xcb_input_get_device_property_items_t *S /**< */)
8754 {
8755 xcb_generic_iterator_t i;
8756 i.data = /* items */ S->data32 + R->num_items;
8757 i.rem = 0;
8758 i.index = (char *) i.data - (char *) S;
8759 return i;
8760 }
8761
8762 int
8763 xcb_input_get_device_property_items_serialize (void **_buffer /**< */,
8764 uint32_t num_items /**< */,
8765 uint8_t format /**< */,
8766 const xcb_input_get_device_property_items_t *_aux /**< */)
8767 {
8768 char *xcb_out = *_buffer;
8769 unsigned int xcb_buffer_len = 0;
8770 unsigned int xcb_align_to = 0;
8771
8772 unsigned int xcb_pad = 0;
8773 char xcb_pad0[3] = {0, 0, 0};
8774 struct iovec xcb_parts[7];
8775 unsigned int xcb_parts_idx = 0;
8776 unsigned int xcb_block_len = 0;
8777 unsigned int i;
8778 char *xcb_tmp;
8779
8780 if(format & XCB_INPUT_PROPERTY_FORMAT_8_BITS) {
8781 /* insert padding */
8782 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8783 xcb_buffer_len += xcb_block_len + xcb_pad;
8784 if (0 != xcb_pad) {
8785 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
8786 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
8787 xcb_parts_idx++;
8788 xcb_pad = 0;
8789 }
8790 xcb_block_len = 0;
8791 /* data8 */
8792 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->data8;
8793 xcb_block_len += num_items * sizeof(uint8_t);
8794 xcb_parts[xcb_parts_idx].iov_len = num_items * sizeof(uint8_t);
8795 xcb_parts_idx++;
8796 xcb_align_to = ALIGNOF(uint8_t);
8797 }
8798 if(format & XCB_INPUT_PROPERTY_FORMAT_16_BITS) {
8799 /* insert padding */
8800 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8801 xcb_buffer_len += xcb_block_len + xcb_pad;
8802 if (0 != xcb_pad) {
8803 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
8804 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
8805 xcb_parts_idx++;
8806 xcb_pad = 0;
8807 }
8808 xcb_block_len = 0;
8809 /* data16 */
8810 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->data16;
8811 xcb_block_len += num_items * sizeof(uint16_t);
8812 xcb_parts[xcb_parts_idx].iov_len = num_items * sizeof(uint16_t);
8813 xcb_parts_idx++;
8814 xcb_align_to = ALIGNOF(uint16_t);
8815 }
8816 if(format & XCB_INPUT_PROPERTY_FORMAT_32_BITS) {
8817 /* insert padding */
8818 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8819 xcb_buffer_len += xcb_block_len + xcb_pad;
8820 if (0 != xcb_pad) {
8821 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
8822 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
8823 xcb_parts_idx++;
8824 xcb_pad = 0;
8825 }
8826 xcb_block_len = 0;
8827 /* data32 */
8828 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->data32;
8829 xcb_block_len += num_items * sizeof(uint32_t);
8830 xcb_parts[xcb_parts_idx].iov_len = num_items * sizeof(uint32_t);
8831 xcb_parts_idx++;
8832 xcb_align_to = ALIGNOF(uint32_t);
8833 }
8834 /* insert padding */
8835 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8836 xcb_buffer_len += xcb_block_len + xcb_pad;
8837 if (0 != xcb_pad) {
8838 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
8839 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
8840 xcb_parts_idx++;
8841 xcb_pad = 0;
8842 }
8843 xcb_block_len = 0;
8844
8845 if (NULL == xcb_out) {
8846 /* allocate memory */
8847 xcb_out = malloc(xcb_buffer_len);
8848 *_buffer = xcb_out;
8849 }
8850
8851 xcb_tmp = xcb_out;
8852 for(i=0; i<xcb_parts_idx; i++) {
8853 if (0 != xcb_parts[i].iov_base && 0 != xcb_parts[i].iov_len)
8854 memcpy(xcb_tmp, xcb_parts[i].iov_base, xcb_parts[i].iov_len);
8855 if (0 != xcb_parts[i].iov_len)
8856 xcb_tmp += xcb_parts[i].iov_len;
8857 }
8858
8859 return xcb_buffer_len;
8860 }
8861
8862 int
8863 xcb_input_get_device_property_items_unpack (const void *_buffer /**< */,
8864 uint32_t num_items /**< */,
8865 uint8_t format /**< */,
8866 xcb_input_get_device_property_items_t *_aux /**< */)
8867 {
8868 char *xcb_tmp = (char *)_buffer;
8869 unsigned int xcb_buffer_len = 0;
8870 unsigned int xcb_block_len = 0;
8871 unsigned int xcb_pad = 0;
8872 unsigned int xcb_align_to = 0;
8873
8874
8875 if(format & XCB_INPUT_PROPERTY_FORMAT_8_BITS) {
8876 /* insert padding */
8877 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8878 xcb_buffer_len += xcb_block_len + xcb_pad;
8879 if (0 != xcb_pad) {
8880 xcb_tmp += xcb_pad;
8881 xcb_pad = 0;
8882 }
8883 xcb_block_len = 0;
8884 /* data8 */
8885 _aux->data8 = (uint8_t *)xcb_tmp;
8886 xcb_block_len += num_items * sizeof(uint8_t);
8887 xcb_tmp += xcb_block_len;
8888 xcb_align_to = ALIGNOF(uint8_t);
8889 }
8890 if(format & XCB_INPUT_PROPERTY_FORMAT_16_BITS) {
8891 /* insert padding */
8892 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8893 xcb_buffer_len += xcb_block_len + xcb_pad;
8894 if (0 != xcb_pad) {
8895 xcb_tmp += xcb_pad;
8896 xcb_pad = 0;
8897 }
8898 xcb_block_len = 0;
8899 /* data16 */
8900 _aux->data16 = (uint16_t *)xcb_tmp;
8901 xcb_block_len += num_items * sizeof(uint16_t);
8902 xcb_tmp += xcb_block_len;
8903 xcb_align_to = ALIGNOF(uint16_t);
8904 }
8905 if(format & XCB_INPUT_PROPERTY_FORMAT_32_BITS) {
8906 /* insert padding */
8907 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8908 xcb_buffer_len += xcb_block_len + xcb_pad;
8909 if (0 != xcb_pad) {
8910 xcb_tmp += xcb_pad;
8911 xcb_pad = 0;
8912 }
8913 xcb_block_len = 0;
8914 /* data32 */
8915 _aux->data32 = (uint32_t *)xcb_tmp;
8916 xcb_block_len += num_items * sizeof(uint32_t);
8917 xcb_tmp += xcb_block_len;
8918 xcb_align_to = ALIGNOF(uint32_t);
8919 }
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_tmp += xcb_pad;
8925 xcb_pad = 0;
8926 }
8927 xcb_block_len = 0;
8928
8929 return xcb_buffer_len;
8930 }
8931
8932 int
8933 xcb_input_get_device_property_items_sizeof (const void *_buffer /**< */,
8934 uint32_t num_items /**< */,
8935 uint8_t format /**< */)
8936 {
8937 xcb_input_get_device_property_items_t _aux;
8938 return xcb_input_get_device_property_items_unpack(_buffer, num_items, format, &_aux);
8939 }
8940
8941
8942 /*****************************************************************************
8943 **
8944 ** xcb_input_get_device_property_cookie_t xcb_input_get_device_property
8945 **
8946 ** @param xcb_connection_t *c
8947 ** @param xcb_atom_t property
8948 ** @param xcb_atom_t type
8949 ** @param uint32_t offset
8950 ** @param uint32_t len
8951 ** @param uint8_t device_id
8952 ** @param uint8_t _delete
8953 ** @returns xcb_input_get_device_property_cookie_t
8954 **
8955 *****************************************************************************/
8956
8957 xcb_input_get_device_property_cookie_t
8958 xcb_input_get_device_property (xcb_connection_t *c /**< */,
8959 xcb_atom_t property /**< */,
8960 xcb_atom_t type /**< */,
8961 uint32_t offset /**< */,
8962 uint32_t len /**< */,
8963 uint8_t device_id /**< */,
8964 uint8_t _delete /**< */)
8965 {
8966 static const xcb_protocol_request_t xcb_req = {
8967 /* count */ 2,
8968 /* ext */ &xcb_input_id,
8969 /* opcode */ XCB_INPUT_GET_DEVICE_PROPERTY,
8970 /* isvoid */ 0
8971 };
8972
8973 struct iovec xcb_parts[4];
8974 xcb_input_get_device_property_cookie_t xcb_ret;
8975 xcb_input_get_device_property_request_t xcb_out;
8976
8977 xcb_out.property = property;
8978 xcb_out.type = type;
8979 xcb_out.offset = offset;
8980 xcb_out.len = len;
8981 xcb_out.device_id = device_id;
8982 xcb_out._delete = _delete;
8983 memset(xcb_out.pad0, 0, 2);
8984
8985 xcb_parts[2].iov_base = (char *) &xcb_out;
8986 xcb_parts[2].iov_len = sizeof(xcb_out);
8987 xcb_parts[3].iov_base = 0;
8988 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
8989
8990 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
8991 return xcb_ret;
8992 }
8993
8994
8995 /*****************************************************************************
8996 **
8997 ** xcb_input_get_device_property_cookie_t xcb_input_get_device_property_unchecked
8998 **
8999 ** @param xcb_connection_t *c
9000 ** @param xcb_atom_t property
9001 ** @param xcb_atom_t type
9002 ** @param uint32_t offset
9003 ** @param uint32_t len
9004 ** @param uint8_t device_id
9005 ** @param uint8_t _delete
9006 ** @returns xcb_input_get_device_property_cookie_t
9007 **
9008 *****************************************************************************/
9009
9010 xcb_input_get_device_property_cookie_t
9011 xcb_input_get_device_property_unchecked (xcb_connection_t *c /**< */,
9012 xcb_atom_t property /**< */,
9013 xcb_atom_t type /**< */,
9014 uint32_t offset /**< */,
9015 uint32_t len /**< */,
9016 uint8_t device_id /**< */,
9017 uint8_t _delete /**< */)
9018 {
9019 static const xcb_protocol_request_t xcb_req = {
9020 /* count */ 2,
9021 /* ext */ &xcb_input_id,
9022 /* opcode */ XCB_INPUT_GET_DEVICE_PROPERTY,
9023 /* isvoid */ 0
9024 };
9025
9026 struct iovec xcb_parts[4];
9027 xcb_input_get_device_property_cookie_t xcb_ret;
9028 xcb_input_get_device_property_request_t xcb_out;
9029
9030 xcb_out.property = property;
9031 xcb_out.type = type;
9032 xcb_out.offset = offset;
9033 xcb_out.len = len;
9034 xcb_out.device_id = device_id;
9035 xcb_out._delete = _delete;
9036 memset(xcb_out.pad0, 0, 2);
9037
9038 xcb_parts[2].iov_base = (char *) &xcb_out;
9039 xcb_parts[2].iov_len = sizeof(xcb_out);
9040 xcb_parts[3].iov_base = 0;
9041 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
9042
9043 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
9044 return xcb_ret;
9045 }
9046
9047
9048 /*****************************************************************************
9049 **
9050 ** xcb_input_get_device_property_items_t * xcb_input_get_device_property_items
9051 **
9052 ** @param const xcb_input_get_device_property_reply_t *R
9053 ** @returns xcb_input_get_device_property_items_t *
9054 **
9055 *****************************************************************************/
9056
9057 void *
9058 xcb_input_get_device_property_items (const xcb_input_get_device_property_reply_t *R /**< */)
9059 {
9060 return (void *) (R + 1);
9061 }
9062
9063
9064 /*****************************************************************************
9065 **
9066 ** xcb_input_get_device_property_reply_t * xcb_input_get_device_property_reply
9067 **
9068 ** @param xcb_connection_t *c
9069 ** @param xcb_input_get_device_property_cookie_t cookie
9070 ** @param xcb_generic_error_t **e
9071 ** @returns xcb_input_get_device_property_reply_t *
9072 **
9073 *****************************************************************************/
9074
9075 xcb_input_get_device_property_reply_t *
9076 xcb_input_get_device_property_reply (xcb_connection_t *c /**< */,
9077 xcb_input_get_device_property_cookie_t cookie /**< */,
9078 xcb_generic_error_t **e /**< */)
9079 {
9080 return (xcb_input_get_device_property_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
9081 }
9082
9083
9084 /*****************************************************************************
9085 **
9086 ** void xcb_input_group_info_next
9087 **
9088 ** @param xcb_input_group_info_iterator_t *i
9089 ** @returns void
9090 **
9091 *****************************************************************************/
9092
9093 void
9094 xcb_input_group_info_next (xcb_input_group_info_iterator_t *i /**< */)
9095 {
9096 --i->rem;
9097 ++i->data;
9098 i->index += sizeof(xcb_input_group_info_t);
9099 }
9100
9101
9102 /*****************************************************************************
9103 **
9104 ** xcb_generic_iterator_t xcb_input_group_info_end
9105 **
9106 ** @param xcb_input_group_info_iterator_t i
9107 ** @returns xcb_generic_iterator_t
9108 **
9109 *****************************************************************************/
9110
9111 xcb_generic_iterator_t
9112 xcb_input_group_info_end (xcb_input_group_info_iterator_t i /**< */)
9113 {
9114 xcb_generic_iterator_t ret;
9115 ret.data = i.data + i.rem;
9116 ret.index = i.index + ((char *) ret.data - (char *) i.data);
9117 ret.rem = 0;
9118 return ret;
9119 }
9120
9121
9122 /*****************************************************************************
9123 **
9124 ** void xcb_input_modifier_info_next
9125 **
9126 ** @param xcb_input_modifier_info_iterator_t *i
9127 ** @returns void
9128 **
9129 *****************************************************************************/
9130
9131 void
9132 xcb_input_modifier_info_next (xcb_input_modifier_info_iterator_t *i /**< */)
9133 {
9134 --i->rem;
9135 ++i->data;
9136 i->index += sizeof(xcb_input_modifier_info_t);
9137 }
9138
9139
9140 /*****************************************************************************
9141 **
9142 ** xcb_generic_iterator_t xcb_input_modifier_info_end
9143 **
9144 ** @param xcb_input_modifier_info_iterator_t i
9145 ** @returns xcb_generic_iterator_t
9146 **
9147 *****************************************************************************/
9148
9149 xcb_generic_iterator_t
9150 xcb_input_modifier_info_end (xcb_input_modifier_info_iterator_t i /**< */)
9151 {
9152 xcb_generic_iterator_t ret;
9153 ret.data = i.data + i.rem;
9154 ret.index = i.index + ((char *) ret.data - (char *) i.data);
9155 ret.rem = 0;
9156 return ret;
9157 }
9158
9159 int
9160 xcb_input_xi_query_pointer_sizeof (const void *_buffer /**< */)
9161 {
9162 char *xcb_tmp = (char *)_buffer;
9163 const xcb_input_xi_query_pointer_reply_t *_aux = (xcb_input_xi_query_pointer_reply_t *)_buffer;
9164 unsigned int xcb_buffer_len = 0;
9165 unsigned int xcb_block_len = 0;
9166 unsigned int xcb_pad = 0;
9167 unsigned int xcb_align_to = 0;
9168
9169
9170 xcb_block_len += sizeof(xcb_input_xi_query_pointer_reply_t);
9171 xcb_tmp += xcb_block_len;
9172 xcb_buffer_len += xcb_block_len;
9173 xcb_block_len = 0;
9174 /* buttons */
9175 xcb_block_len += _aux->buttons_len * sizeof(uint32_t);
9176 xcb_tmp += xcb_block_len;
9177 xcb_align_to = ALIGNOF(uint32_t);
9178 /* insert padding */
9179 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
9180 xcb_buffer_len += xcb_block_len + xcb_pad;
9181 if (0 != xcb_pad) {
9182 xcb_tmp += xcb_pad;
9183 xcb_pad = 0;
9184 }
9185 xcb_block_len = 0;
9186
9187 return xcb_buffer_len;
9188 }
9189
9190
9191 /*****************************************************************************
9192 **
9193 ** xcb_input_xi_query_pointer_cookie_t xcb_input_xi_query_pointer
9194 **
9195 ** @param xcb_connection_t *c
9196 ** @param xcb_window_t window
9197 ** @param xcb_input_device_id_t deviceid
9198 ** @returns xcb_input_xi_query_pointer_cookie_t
9199 **
9200 *****************************************************************************/
9201
9202 xcb_input_xi_query_pointer_cookie_t
9203 xcb_input_xi_query_pointer (xcb_connection_t *c /**< */,
9204 xcb_window_t window /**< */,
9205 xcb_input_device_id_t deviceid /**< */)
9206 {
9207 static const xcb_protocol_request_t xcb_req = {
9208 /* count */ 2,
9209 /* ext */ &xcb_input_id,
9210 /* opcode */ XCB_INPUT_XI_QUERY_POINTER,
9211 /* isvoid */ 0
9212 };
9213
9214 struct iovec xcb_parts[4];
9215 xcb_input_xi_query_pointer_cookie_t xcb_ret;
9216 xcb_input_xi_query_pointer_request_t xcb_out;
9217
9218 xcb_out.window = window;
9219 xcb_out.deviceid = deviceid;
9220 memset(xcb_out.pad0, 0, 2);
9221
9222 xcb_parts[2].iov_base = (char *) &xcb_out;
9223 xcb_parts[2].iov_len = sizeof(xcb_out);
9224 xcb_parts[3].iov_base = 0;
9225 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
9226
9227 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
9228 return xcb_ret;
9229 }
9230
9231
9232 /*****************************************************************************
9233 **
9234 ** xcb_input_xi_query_pointer_cookie_t xcb_input_xi_query_pointer_unchecked
9235 **
9236 ** @param xcb_connection_t *c
9237 ** @param xcb_window_t window
9238 ** @param xcb_input_device_id_t deviceid
9239 ** @returns xcb_input_xi_query_pointer_cookie_t
9240 **
9241 *****************************************************************************/
9242
9243 xcb_input_xi_query_pointer_cookie_t
9244 xcb_input_xi_query_pointer_unchecked (xcb_connection_t *c /**< */,
9245 xcb_window_t window /**< */,
9246 xcb_input_device_id_t deviceid /**< */)
9247 {
9248 static const xcb_protocol_request_t xcb_req = {
9249 /* count */ 2,
9250 /* ext */ &xcb_input_id,
9251 /* opcode */ XCB_INPUT_XI_QUERY_POINTER,
9252 /* isvoid */ 0
9253 };
9254
9255 struct iovec xcb_parts[4];
9256 xcb_input_xi_query_pointer_cookie_t xcb_ret;
9257 xcb_input_xi_query_pointer_request_t xcb_out;
9258
9259 xcb_out.window = window;
9260 xcb_out.deviceid = deviceid;
9261 memset(xcb_out.pad0, 0, 2);
9262
9263 xcb_parts[2].iov_base = (char *) &xcb_out;
9264 xcb_parts[2].iov_len = sizeof(xcb_out);
9265 xcb_parts[3].iov_base = 0;
9266 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
9267
9268 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
9269 return xcb_ret;
9270 }
9271
9272
9273 /*****************************************************************************
9274 **
9275 ** uint32_t * xcb_input_xi_query_pointer_buttons
9276 **
9277 ** @param const xcb_input_xi_query_pointer_reply_t *R
9278 ** @returns uint32_t *
9279 **
9280 *****************************************************************************/
9281
9282 uint32_t *
9283 xcb_input_xi_query_pointer_buttons (const xcb_input_xi_query_pointer_reply_t *R /**< */)
9284 {
9285 return (uint32_t *) (R + 1);
9286 }
9287
9288
9289 /*****************************************************************************
9290 **
9291 ** int xcb_input_xi_query_pointer_buttons_length
9292 **
9293 ** @param const xcb_input_xi_query_pointer_reply_t *R
9294 ** @returns int
9295 **
9296 *****************************************************************************/
9297
9298 int
9299 xcb_input_xi_query_pointer_buttons_length (const xcb_input_xi_query_pointer_reply_t *R /**< */)
9300 {
9301 return R->buttons_len;
9302 }
9303
9304
9305 /*****************************************************************************
9306 **
9307 ** xcb_generic_iterator_t xcb_input_xi_query_pointer_buttons_end
9308 **
9309 ** @param const xcb_input_xi_query_pointer_reply_t *R
9310 ** @returns xcb_generic_iterator_t
9311 **
9312 *****************************************************************************/
9313
9314 xcb_generic_iterator_t
9315 xcb_input_xi_query_pointer_buttons_end (const xcb_input_xi_query_pointer_reply_t *R /**< */)
9316 {
9317 xcb_generic_iterator_t i;
9318 i.data = ((uint32_t *) (R + 1)) + (R->buttons_len);
9319 i.rem = 0;
9320 i.index = (char *) i.data - (char *) R;
9321 return i;
9322 }
9323
9324
9325 /*****************************************************************************
9326 **
9327 ** xcb_input_xi_query_pointer_reply_t * xcb_input_xi_query_pointer_reply
9328 **
9329 ** @param xcb_connection_t *c
9330 ** @param xcb_input_xi_query_pointer_cookie_t cookie
9331 ** @param xcb_generic_error_t **e
9332 ** @returns xcb_input_xi_query_pointer_reply_t *
9333 **
9334 *****************************************************************************/
9335
9336 xcb_input_xi_query_pointer_reply_t *
9337 xcb_input_xi_query_pointer_reply (xcb_connection_t *c /**< */,
9338 xcb_input_xi_query_pointer_cookie_t cookie /**< */,
9339 xcb_generic_error_t **e /**< */)
9340 {
9341 return (xcb_input_xi_query_pointer_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
9342 }
9343
9344
9345 /*****************************************************************************
9346 **
9347 ** xcb_void_cookie_t xcb_input_xi_warp_pointer_checked
9348 **
9349 ** @param xcb_connection_t *c
9350 ** @param xcb_window_t src_win
9351 ** @param xcb_window_t dst_win
9352 ** @param xcb_input_fp1616_t src_x
9353 ** @param xcb_input_fp1616_t src_y
9354 ** @param uint16_t src_width
9355 ** @param uint16_t src_height
9356 ** @param xcb_input_fp1616_t dst_x
9357 ** @param xcb_input_fp1616_t dst_y
9358 ** @param xcb_input_device_id_t deviceid
9359 ** @returns xcb_void_cookie_t
9360 **
9361 *****************************************************************************/
9362
9363 xcb_void_cookie_t
9364 xcb_input_xi_warp_pointer_checked (xcb_connection_t *c /**< */,
9365 xcb_window_t src_win /**< */,
9366 xcb_window_t dst_win /**< */,
9367 xcb_input_fp1616_t src_x /**< */,
9368 xcb_input_fp1616_t src_y /**< */,
9369 uint16_t src_width /**< */,
9370 uint16_t src_height /**< */,
9371 xcb_input_fp1616_t dst_x /**< */,
9372 xcb_input_fp1616_t dst_y /**< */,
9373 xcb_input_device_id_t deviceid /**< */)
9374 {
9375 static const xcb_protocol_request_t xcb_req = {
9376 /* count */ 2,
9377 /* ext */ &xcb_input_id,
9378 /* opcode */ XCB_INPUT_XI_WARP_POINTER,
9379 /* isvoid */ 1
9380 };
9381
9382 struct iovec xcb_parts[4];
9383 xcb_void_cookie_t xcb_ret;
9384 xcb_input_xi_warp_pointer_request_t xcb_out;
9385
9386 xcb_out.src_win = src_win;
9387 xcb_out.dst_win = dst_win;
9388 xcb_out.src_x = src_x;
9389 xcb_out.src_y = src_y;
9390 xcb_out.src_width = src_width;
9391 xcb_out.src_height = src_height;
9392 xcb_out.dst_x = dst_x;
9393 xcb_out.dst_y = dst_y;
9394 xcb_out.deviceid = deviceid;
9395 memset(xcb_out.pad0, 0, 2);
9396
9397 xcb_parts[2].iov_base = (char *) &xcb_out;
9398 xcb_parts[2].iov_len = sizeof(xcb_out);
9399 xcb_parts[3].iov_base = 0;
9400 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
9401
9402 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
9403 return xcb_ret;
9404 }
9405
9406
9407 /*****************************************************************************
9408 **
9409 ** xcb_void_cookie_t xcb_input_xi_warp_pointer
9410 **
9411 ** @param xcb_connection_t *c
9412 ** @param xcb_window_t src_win
9413 ** @param xcb_window_t dst_win
9414 ** @param xcb_input_fp1616_t src_x
9415 ** @param xcb_input_fp1616_t src_y
9416 ** @param uint16_t src_width
9417 ** @param uint16_t src_height
9418 ** @param xcb_input_fp1616_t dst_x
9419 ** @param xcb_input_fp1616_t dst_y
9420 ** @param xcb_input_device_id_t deviceid
9421 ** @returns xcb_void_cookie_t
9422 **
9423 *****************************************************************************/
9424
9425 xcb_void_cookie_t
9426 xcb_input_xi_warp_pointer (xcb_connection_t *c /**< */,
9427 xcb_window_t src_win /**< */,
9428 xcb_window_t dst_win /**< */,
9429 xcb_input_fp1616_t src_x /**< */,
9430 xcb_input_fp1616_t src_y /**< */,
9431 uint16_t src_width /**< */,
9432 uint16_t src_height /**< */,
9433 xcb_input_fp1616_t dst_x /**< */,
9434 xcb_input_fp1616_t dst_y /**< */,
9435 xcb_input_device_id_t deviceid /**< */)
9436 {
9437 static const xcb_protocol_request_t xcb_req = {
9438 /* count */ 2,
9439 /* ext */ &xcb_input_id,
9440 /* opcode */ XCB_INPUT_XI_WARP_POINTER,
9441 /* isvoid */ 1
9442 };
9443
9444 struct iovec xcb_parts[4];
9445 xcb_void_cookie_t xcb_ret;
9446 xcb_input_xi_warp_pointer_request_t xcb_out;
9447
9448 xcb_out.src_win = src_win;
9449 xcb_out.dst_win = dst_win;
9450 xcb_out.src_x = src_x;
9451 xcb_out.src_y = src_y;
9452 xcb_out.src_width = src_width;
9453 xcb_out.src_height = src_height;
9454 xcb_out.dst_x = dst_x;
9455 xcb_out.dst_y = dst_y;
9456 xcb_out.deviceid = deviceid;
9457 memset(xcb_out.pad0, 0, 2);
9458
9459 xcb_parts[2].iov_base = (char *) &xcb_out;
9460 xcb_parts[2].iov_len = sizeof(xcb_out);
9461 xcb_parts[3].iov_base = 0;
9462 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
9463
9464 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
9465 return xcb_ret;
9466 }
9467
9468
9469 /*****************************************************************************
9470 **
9471 ** xcb_void_cookie_t xcb_input_xi_change_cursor_checked
9472 **
9473 ** @param xcb_connection_t *c
9474 ** @param xcb_window_t window
9475 ** @param xcb_cursor_t cursor
9476 ** @param xcb_input_device_id_t deviceid
9477 ** @returns xcb_void_cookie_t
9478 **
9479 *****************************************************************************/
9480
9481 xcb_void_cookie_t
9482 xcb_input_xi_change_cursor_checked (xcb_connection_t *c /**< */,
9483 xcb_window_t window /**< */,
9484 xcb_cursor_t cursor /**< */,
9485 xcb_input_device_id_t deviceid /**< */)
9486 {
9487 static const xcb_protocol_request_t xcb_req = {
9488 /* count */ 2,
9489 /* ext */ &xcb_input_id,
9490 /* opcode */ XCB_INPUT_XI_CHANGE_CURSOR,
9491 /* isvoid */ 1
9492 };
9493
9494 struct iovec xcb_parts[4];
9495 xcb_void_cookie_t xcb_ret;
9496 xcb_input_xi_change_cursor_request_t xcb_out;
9497
9498 xcb_out.window = window;
9499 xcb_out.cursor = cursor;
9500 xcb_out.deviceid = deviceid;
9501 memset(xcb_out.pad0, 0, 2);
9502
9503 xcb_parts[2].iov_base = (char *) &xcb_out;
9504 xcb_parts[2].iov_len = sizeof(xcb_out);
9505 xcb_parts[3].iov_base = 0;
9506 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
9507
9508 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
9509 return xcb_ret;
9510 }
9511
9512
9513 /*****************************************************************************
9514 **
9515 ** xcb_void_cookie_t xcb_input_xi_change_cursor
9516 **
9517 ** @param xcb_connection_t *c
9518 ** @param xcb_window_t window
9519 ** @param xcb_cursor_t cursor
9520 ** @param xcb_input_device_id_t deviceid
9521 ** @returns xcb_void_cookie_t
9522 **
9523 *****************************************************************************/
9524
9525 xcb_void_cookie_t
9526 xcb_input_xi_change_cursor (xcb_connection_t *c /**< */,
9527 xcb_window_t window /**< */,
9528 xcb_cursor_t cursor /**< */,
9529 xcb_input_device_id_t deviceid /**< */)
9530 {
9531 static const xcb_protocol_request_t xcb_req = {
9532 /* count */ 2,
9533 /* ext */ &xcb_input_id,
9534 /* opcode */ XCB_INPUT_XI_CHANGE_CURSOR,
9535 /* isvoid */ 1
9536 };
9537
9538 struct iovec xcb_parts[4];
9539 xcb_void_cookie_t xcb_ret;
9540 xcb_input_xi_change_cursor_request_t xcb_out;
9541
9542 xcb_out.window = window;
9543 xcb_out.cursor = cursor;
9544 xcb_out.deviceid = deviceid;
9545 memset(xcb_out.pad0, 0, 2);
9546
9547 xcb_parts[2].iov_base = (char *) &xcb_out;
9548 xcb_parts[2].iov_len = sizeof(xcb_out);
9549 xcb_parts[3].iov_base = 0;
9550 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
9551
9552 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
9553 return xcb_ret;
9554 }
9555
9556 int
9557 xcb_input_add_master_sizeof (const void *_buffer /**< */)
9558 {
9559 char *xcb_tmp = (char *)_buffer;
9560 const xcb_input_add_master_t *_aux = (xcb_input_add_master_t *)_buffer;
9561 unsigned int xcb_buffer_len = 0;
9562 unsigned int xcb_block_len = 0;
9563 unsigned int xcb_pad = 0;
9564 unsigned int xcb_align_to = 0;
9565
9566
9567 xcb_block_len += sizeof(xcb_input_add_master_t);
9568 xcb_tmp += xcb_block_len;
9569 xcb_buffer_len += xcb_block_len;
9570 xcb_block_len = 0;
9571 /* name */
9572 xcb_block_len += _aux->name_len * sizeof(char);
9573 xcb_tmp += xcb_block_len;
9574 xcb_align_to = ALIGNOF(char);
9575 /* insert padding */
9576 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
9577 xcb_buffer_len += xcb_block_len + xcb_pad;
9578 if (0 != xcb_pad) {
9579 xcb_tmp += xcb_pad;
9580 xcb_pad = 0;
9581 }
9582 xcb_block_len = 0;
9583
9584 return xcb_buffer_len;
9585 }
9586
9587
9588 /*****************************************************************************
9589 **
9590 ** char * xcb_input_add_master_name
9591 **
9592 ** @param const xcb_input_add_master_t *R
9593 ** @returns char *
9594 **
9595 *****************************************************************************/
9596
9597 char *
9598 xcb_input_add_master_name (const xcb_input_add_master_t *R /**< */)
9599 {
9600 return (char *) (R + 1);
9601 }
9602
9603
9604 /*****************************************************************************
9605 **
9606 ** int xcb_input_add_master_name_length
9607 **
9608 ** @param const xcb_input_add_master_t *R
9609 ** @returns int
9610 **
9611 *****************************************************************************/
9612
9613 int
9614 xcb_input_add_master_name_length (const xcb_input_add_master_t *R /**< */)
9615 {
9616 return R->name_len;
9617 }
9618
9619
9620 /*****************************************************************************
9621 **
9622 ** xcb_generic_iterator_t xcb_input_add_master_name_end
9623 **
9624 ** @param const xcb_input_add_master_t *R
9625 ** @returns xcb_generic_iterator_t
9626 **
9627 *****************************************************************************/
9628
9629 xcb_generic_iterator_t
9630 xcb_input_add_master_name_end (const xcb_input_add_master_t *R /**< */)
9631 {
9632 xcb_generic_iterator_t i;
9633 i.data = ((char *) (R + 1)) + (R->name_len);
9634 i.rem = 0;
9635 i.index = (char *) i.data - (char *) R;
9636 return i;
9637 }
9638
9639
9640 /*****************************************************************************
9641 **
9642 ** void xcb_input_add_master_next
9643 **
9644 ** @param xcb_input_add_master_iterator_t *i
9645 ** @returns void
9646 **
9647 *****************************************************************************/
9648
9649 void
9650 xcb_input_add_master_next (xcb_input_add_master_iterator_t *i /**< */)
9651 {
9652 xcb_input_add_master_t *R = i->data;
9653 xcb_generic_iterator_t child;
9654 child.data = (xcb_input_add_master_t *)(((char *)R) + xcb_input_add_master_sizeof(R));
9655 i->index = (char *) child.data - (char *) i->data;
9656 --i->rem;
9657 i->data = (xcb_input_add_master_t *) child.data;
9658 }
9659
9660
9661 /*****************************************************************************
9662 **
9663 ** xcb_generic_iterator_t xcb_input_add_master_end
9664 **
9665 ** @param xcb_input_add_master_iterator_t i
9666 ** @returns xcb_generic_iterator_t
9667 **
9668 *****************************************************************************/
9669
9670 xcb_generic_iterator_t
9671 xcb_input_add_master_end (xcb_input_add_master_iterator_t i /**< */)
9672 {
9673 xcb_generic_iterator_t ret;
9674 while(i.rem > 0)
9675 xcb_input_add_master_next(&i);
9676 ret.data = i.data;
9677 ret.rem = i.rem;
9678 ret.index = i.index;
9679 return ret;
9680 }
9681
9682
9683 /*****************************************************************************
9684 **
9685 ** void xcb_input_remove_master_next
9686 **
9687 ** @param xcb_input_remove_master_iterator_t *i
9688 ** @returns void
9689 **
9690 *****************************************************************************/
9691
9692 void
9693 xcb_input_remove_master_next (xcb_input_remove_master_iterator_t *i /**< */)
9694 {
9695 --i->rem;
9696 ++i->data;
9697 i->index += sizeof(xcb_input_remove_master_t);
9698 }
9699
9700
9701 /*****************************************************************************
9702 **
9703 ** xcb_generic_iterator_t xcb_input_remove_master_end
9704 **
9705 ** @param xcb_input_remove_master_iterator_t i
9706 ** @returns xcb_generic_iterator_t
9707 **
9708 *****************************************************************************/
9709
9710 xcb_generic_iterator_t
9711 xcb_input_remove_master_end (xcb_input_remove_master_iterator_t i /**< */)
9712 {
9713 xcb_generic_iterator_t ret;
9714 ret.data = i.data + i.rem;
9715 ret.index = i.index + ((char *) ret.data - (char *) i.data);
9716 ret.rem = 0;
9717 return ret;
9718 }
9719
9720
9721 /*****************************************************************************
9722 **
9723 ** void xcb_input_attach_slave_next
9724 **
9725 ** @param xcb_input_attach_slave_iterator_t *i
9726 ** @returns void
9727 **
9728 *****************************************************************************/
9729
9730 void
9731 xcb_input_attach_slave_next (xcb_input_attach_slave_iterator_t *i /**< */)
9732 {
9733 --i->rem;
9734 ++i->data;
9735 i->index += sizeof(xcb_input_attach_slave_t);
9736 }
9737
9738
9739 /*****************************************************************************
9740 **
9741 ** xcb_generic_iterator_t xcb_input_attach_slave_end
9742 **
9743 ** @param xcb_input_attach_slave_iterator_t i
9744 ** @returns xcb_generic_iterator_t
9745 **
9746 *****************************************************************************/
9747
9748 xcb_generic_iterator_t
9749 xcb_input_attach_slave_end (xcb_input_attach_slave_iterator_t i /**< */)
9750 {
9751 xcb_generic_iterator_t ret;
9752 ret.data = i.data + i.rem;
9753 ret.index = i.index + ((char *) ret.data - (char *) i.data);
9754 ret.rem = 0;
9755 return ret;
9756 }
9757
9758
9759 /*****************************************************************************
9760 **
9761 ** void xcb_input_detach_slave_next
9762 **
9763 ** @param xcb_input_detach_slave_iterator_t *i
9764 ** @returns void
9765 **
9766 *****************************************************************************/
9767
9768 void
9769 xcb_input_detach_slave_next (xcb_input_detach_slave_iterator_t *i /**< */)
9770 {
9771 --i->rem;
9772 ++i->data;
9773 i->index += sizeof(xcb_input_detach_slave_t);
9774 }
9775
9776
9777 /*****************************************************************************
9778 **
9779 ** xcb_generic_iterator_t xcb_input_detach_slave_end
9780 **
9781 ** @param xcb_input_detach_slave_iterator_t i
9782 ** @returns xcb_generic_iterator_t
9783 **
9784 *****************************************************************************/
9785
9786 xcb_generic_iterator_t
9787 xcb_input_detach_slave_end (xcb_input_detach_slave_iterator_t i /**< */)
9788 {
9789 xcb_generic_iterator_t ret;
9790 ret.data = i.data + i.rem;
9791 ret.index = i.index + ((char *) ret.data - (char *) i.data);
9792 ret.rem = 0;
9793 return ret;
9794 }
9795
9796 int
9797 xcb_input_hierarchy_change_sizeof (const void *_buffer /**< */)
9798 {
9799 char *xcb_tmp = (char *)_buffer;
9800 const xcb_input_hierarchy_change_t *_aux = (xcb_input_hierarchy_change_t *)_buffer;
9801 unsigned int xcb_buffer_len = 0;
9802 unsigned int xcb_block_len = 0;
9803 unsigned int xcb_pad = 0;
9804 unsigned int xcb_align_to = 0;
9805
9806
9807 xcb_block_len += sizeof(xcb_input_hierarchy_change_t);
9808 xcb_tmp += xcb_block_len;
9809 xcb_buffer_len += xcb_block_len;
9810 xcb_block_len = 0;
9811 /* uninterpreted_data */
9812 xcb_block_len += ((_aux->len * 4) - 4) * sizeof(uint8_t);
9813 xcb_tmp += xcb_block_len;
9814 xcb_align_to = ALIGNOF(uint8_t);
9815 /* insert padding */
9816 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
9817 xcb_buffer_len += xcb_block_len + xcb_pad;
9818 if (0 != xcb_pad) {
9819 xcb_tmp += xcb_pad;
9820 xcb_pad = 0;
9821 }
9822 xcb_block_len = 0;
9823
9824 return xcb_buffer_len;
9825 }
9826
9827
9828 /*****************************************************************************
9829 **
9830 ** uint8_t * xcb_input_hierarchy_change_uninterpreted_data
9831 **
9832 ** @param const xcb_input_hierarchy_change_t *R
9833 ** @returns uint8_t *
9834 **
9835 *****************************************************************************/
9836
9837 uint8_t *
9838 xcb_input_hierarchy_change_uninterpreted_data (const xcb_input_hierarchy_change_t *R /**< */)
9839 {
9840 return (uint8_t *) (R + 1);
9841 }
9842
9843
9844 /*****************************************************************************
9845 **
9846 ** int xcb_input_hierarchy_change_uninterpreted_data_length
9847 **
9848 ** @param const xcb_input_hierarchy_change_t *R
9849 ** @returns int
9850 **
9851 *****************************************************************************/
9852
9853 int
9854 xcb_input_hierarchy_change_uninterpreted_data_length (const xcb_input_hierarchy_change_t *R /**< */)
9855 {
9856 return ((R->len * 4) - 4);
9857 }
9858
9859
9860 /*****************************************************************************
9861 **
9862 ** xcb_generic_iterator_t xcb_input_hierarchy_change_uninterpreted_data_end
9863 **
9864 ** @param const xcb_input_hierarchy_change_t *R
9865 ** @returns xcb_generic_iterator_t
9866 **
9867 *****************************************************************************/
9868
9869 xcb_generic_iterator_t
9870 xcb_input_hierarchy_change_uninterpreted_data_end (const xcb_input_hierarchy_change_t *R /**< */)
9871 {
9872 xcb_generic_iterator_t i;
9873 i.data = ((uint8_t *) (R + 1)) + (((R->len * 4) - 4));
9874 i.rem = 0;
9875 i.index = (char *) i.data - (char *) R;
9876 return i;
9877 }
9878
9879
9880 /*****************************************************************************
9881 **
9882 ** void xcb_input_hierarchy_change_next
9883 **
9884 ** @param xcb_input_hierarchy_change_iterator_t *i
9885 ** @returns void
9886 **
9887 *****************************************************************************/
9888
9889 void
9890 xcb_input_hierarchy_change_next (xcb_input_hierarchy_change_iterator_t *i /**< */)
9891 {
9892 xcb_input_hierarchy_change_t *R = i->data;
9893 xcb_generic_iterator_t child;
9894 child.data = (xcb_input_hierarchy_change_t *)(((char *)R) + xcb_input_hierarchy_change_sizeof(R));
9895 i->index = (char *) child.data - (char *) i->data;
9896 --i->rem;
9897 i->data = (xcb_input_hierarchy_change_t *) child.data;
9898 }
9899
9900
9901 /*****************************************************************************
9902 **
9903 ** xcb_generic_iterator_t xcb_input_hierarchy_change_end
9904 **
9905 ** @param xcb_input_hierarchy_change_iterator_t i
9906 ** @returns xcb_generic_iterator_t
9907 **
9908 *****************************************************************************/
9909
9910 xcb_generic_iterator_t
9911 xcb_input_hierarchy_change_end (xcb_input_hierarchy_change_iterator_t i /**< */)
9912 {
9913 xcb_generic_iterator_t ret;
9914 while(i.rem > 0)
9915 xcb_input_hierarchy_change_next(&i);
9916 ret.data = i.data;
9917 ret.rem = i.rem;
9918 ret.index = i.index;
9919 return ret;
9920 }
9921
9922 int
9923 xcb_input_xi_change_hierarchy_sizeof (const void *_buffer /**< */)
9924 {
9925 char *xcb_tmp = (char *)_buffer;
9926 const xcb_input_xi_change_hierarchy_request_t *_aux = (xcb_input_xi_change_hierarchy_request_t *)_buffer;
9927 unsigned int xcb_buffer_len = 0;
9928 unsigned int xcb_block_len = 0;
9929 unsigned int xcb_pad = 0;
9930 unsigned int xcb_align_to = 0;
9931
9932 unsigned int i;
9933 unsigned int xcb_tmp_len;
9934
9935 xcb_block_len += sizeof(xcb_input_xi_change_hierarchy_request_t);
9936 xcb_tmp += xcb_block_len;
9937 xcb_buffer_len += xcb_block_len;
9938 xcb_block_len = 0;
9939 /* changes */
9940 for(i=0; i<_aux->num_changes; i++) {
9941 xcb_tmp_len = xcb_input_hierarchy_change_sizeof(xcb_tmp);
9942 xcb_block_len += xcb_tmp_len;
9943 xcb_tmp += xcb_tmp_len;
9944 }
9945 xcb_align_to = ALIGNOF(xcb_input_hierarchy_change_t);
9946 /* insert padding */
9947 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
9948 xcb_buffer_len += xcb_block_len + xcb_pad;
9949 if (0 != xcb_pad) {
9950 xcb_tmp += xcb_pad;
9951 xcb_pad = 0;
9952 }
9953 xcb_block_len = 0;
9954
9955 return xcb_buffer_len;
9956 }
9957
9958
9959 /*****************************************************************************
9960 **
9961 ** xcb_void_cookie_t xcb_input_xi_change_hierarchy_checked
9962 **
9963 ** @param xcb_connection_t *c
9964 ** @param uint8_t num_changes
9965 ** @param const xcb_input_hierarchy_change_t *changes
9966 ** @returns xcb_void_cookie_t
9967 **
9968 *****************************************************************************/
9969
9970 xcb_void_cookie_t
9971 xcb_input_xi_change_hierarchy_checked (xcb_connection_t *c /**< */,
9972 uint8_t num_changes /**< */,
9973 const xcb_input_hierarchy_change_t *changes /**< */)
9974 {
9975 static const xcb_protocol_request_t xcb_req = {
9976 /* count */ 4,
9977 /* ext */ &xcb_input_id,
9978 /* opcode */ XCB_INPUT_XI_CHANGE_HIERARCHY,
9979 /* isvoid */ 1
9980 };
9981
9982 struct iovec xcb_parts[6];
9983 xcb_void_cookie_t xcb_ret;
9984 xcb_input_xi_change_hierarchy_request_t xcb_out;
9985 unsigned int i;
9986 unsigned int xcb_tmp_len;
9987 char *xcb_tmp;
9988
9989 xcb_out.num_changes = num_changes;
9990
9991 xcb_parts[2].iov_base = (char *) &xcb_out;
9992 xcb_parts[2].iov_len = sizeof(xcb_out);
9993 xcb_parts[3].iov_base = 0;
9994 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
9995 /* xcb_input_hierarchy_change_t changes */
9996 xcb_parts[4].iov_base = (char *) changes;
9997 xcb_parts[4].iov_len = 0;
9998 xcb_tmp = (char *)changes;
9999 for(i=0; i<num_changes; i++) {
10000 xcb_tmp_len = xcb_input_hierarchy_change_sizeof(xcb_tmp);
10001 xcb_parts[4].iov_len += xcb_tmp_len;
10002 xcb_tmp += xcb_tmp_len;
10003 }
10004 xcb_parts[5].iov_base = 0;
10005 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
10006
10007 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
10008 return xcb_ret;
10009 }
10010
10011
10012 /*****************************************************************************
10013 **
10014 ** xcb_void_cookie_t xcb_input_xi_change_hierarchy
10015 **
10016 ** @param xcb_connection_t *c
10017 ** @param uint8_t num_changes
10018 ** @param const xcb_input_hierarchy_change_t *changes
10019 ** @returns xcb_void_cookie_t
10020 **
10021 *****************************************************************************/
10022
10023 xcb_void_cookie_t
10024 xcb_input_xi_change_hierarchy (xcb_connection_t *c /**< */,
10025 uint8_t num_changes /**< */,
10026 const xcb_input_hierarchy_change_t *changes /**< */)
10027 {
10028 static const xcb_protocol_request_t xcb_req = {
10029 /* count */ 4,
10030 /* ext */ &xcb_input_id,
10031 /* opcode */ XCB_INPUT_XI_CHANGE_HIERARCHY,
10032 /* isvoid */ 1
10033 };
10034
10035 struct iovec xcb_parts[6];
10036 xcb_void_cookie_t xcb_ret;
10037 xcb_input_xi_change_hierarchy_request_t xcb_out;
10038 unsigned int i;
10039 unsigned int xcb_tmp_len;
10040 char *xcb_tmp;
10041
10042 xcb_out.num_changes = num_changes;
10043
10044 xcb_parts[2].iov_base = (char *) &xcb_out;
10045 xcb_parts[2].iov_len = sizeof(xcb_out);
10046 xcb_parts[3].iov_base = 0;
10047 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
10048 /* xcb_input_hierarchy_change_t changes */
10049 xcb_parts[4].iov_base = (char *) changes;
10050 xcb_parts[4].iov_len = 0;
10051 xcb_tmp = (char *)changes;
10052 for(i=0; i<num_changes; i++) {
10053 xcb_tmp_len = xcb_input_hierarchy_change_sizeof(xcb_tmp);
10054 xcb_parts[4].iov_len += xcb_tmp_len;
10055 xcb_tmp += xcb_tmp_len;
10056 }
10057 xcb_parts[5].iov_base = 0;
10058 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
10059
10060 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
10061 return xcb_ret;
10062 }
10063
10064
10065 /*****************************************************************************
10066 **
10067 ** xcb_void_cookie_t xcb_input_xi_set_client_pointer_checked
10068 **
10069 ** @param xcb_connection_t *c
10070 ** @param xcb_window_t window
10071 ** @param xcb_input_device_id_t deviceid
10072 ** @returns xcb_void_cookie_t
10073 **
10074 *****************************************************************************/
10075
10076 xcb_void_cookie_t
10077 xcb_input_xi_set_client_pointer_checked (xcb_connection_t *c /**< */,
10078 xcb_window_t window /**< */,
10079 xcb_input_device_id_t deviceid /**< */)
10080 {
10081 static const xcb_protocol_request_t xcb_req = {
10082 /* count */ 2,
10083 /* ext */ &xcb_input_id,
10084 /* opcode */ XCB_INPUT_XI_SET_CLIENT_POINTER,
10085 /* isvoid */ 1
10086 };
10087
10088 struct iovec xcb_parts[4];
10089 xcb_void_cookie_t xcb_ret;
10090 xcb_input_xi_set_client_pointer_request_t xcb_out;
10091
10092 xcb_out.window = window;
10093 xcb_out.deviceid = deviceid;
10094 memset(xcb_out.pad0, 0, 2);
10095
10096 xcb_parts[2].iov_base = (char *) &xcb_out;
10097 xcb_parts[2].iov_len = sizeof(xcb_out);
10098 xcb_parts[3].iov_base = 0;
10099 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
10100
10101 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
10102 return xcb_ret;
10103 }
10104
10105
10106 /*****************************************************************************
10107 **
10108 ** xcb_void_cookie_t xcb_input_xi_set_client_pointer
10109 **
10110 ** @param xcb_connection_t *c
10111 ** @param xcb_window_t window
10112 ** @param xcb_input_device_id_t deviceid
10113 ** @returns xcb_void_cookie_t
10114 **
10115 *****************************************************************************/
10116
10117 xcb_void_cookie_t
10118 xcb_input_xi_set_client_pointer (xcb_connection_t *c /**< */,
10119 xcb_window_t window /**< */,
10120 xcb_input_device_id_t deviceid /**< */)
10121 {
10122 static const xcb_protocol_request_t xcb_req = {
10123 /* count */ 2,
10124 /* ext */ &xcb_input_id,
10125 /* opcode */ XCB_INPUT_XI_SET_CLIENT_POINTER,
10126 /* isvoid */ 1
10127 };
10128
10129 struct iovec xcb_parts[4];
10130 xcb_void_cookie_t xcb_ret;
10131 xcb_input_xi_set_client_pointer_request_t xcb_out;
10132
10133 xcb_out.window = window;
10134 xcb_out.deviceid = deviceid;
10135 memset(xcb_out.pad0, 0, 2);
10136
10137 xcb_parts[2].iov_base = (char *) &xcb_out;
10138 xcb_parts[2].iov_len = sizeof(xcb_out);
10139 xcb_parts[3].iov_base = 0;
10140 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
10141
10142 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
10143 return xcb_ret;
10144 }
10145
10146
10147 /*****************************************************************************
10148 **
10149 ** xcb_input_xi_get_client_pointer_cookie_t xcb_input_xi_get_client_pointer
10150 **
10151 ** @param xcb_connection_t *c
10152 ** @param xcb_window_t window
10153 ** @returns xcb_input_xi_get_client_pointer_cookie_t
10154 **
10155 *****************************************************************************/
10156
10157 xcb_input_xi_get_client_pointer_cookie_t
10158 xcb_input_xi_get_client_pointer (xcb_connection_t *c /**< */,
10159 xcb_window_t window /**< */)
10160 {
10161 static const xcb_protocol_request_t xcb_req = {
10162 /* count */ 2,
10163 /* ext */ &xcb_input_id,
10164 /* opcode */ XCB_INPUT_XI_GET_CLIENT_POINTER,
10165 /* isvoid */ 0
10166 };
10167
10168 struct iovec xcb_parts[4];
10169 xcb_input_xi_get_client_pointer_cookie_t xcb_ret;
10170 xcb_input_xi_get_client_pointer_request_t xcb_out;
10171
10172 xcb_out.window = window;
10173
10174 xcb_parts[2].iov_base = (char *) &xcb_out;
10175 xcb_parts[2].iov_len = sizeof(xcb_out);
10176 xcb_parts[3].iov_base = 0;
10177 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
10178
10179 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
10180 return xcb_ret;
10181 }
10182
10183
10184 /*****************************************************************************
10185 **
10186 ** xcb_input_xi_get_client_pointer_cookie_t xcb_input_xi_get_client_pointer_unchecked
10187 **
10188 ** @param xcb_connection_t *c
10189 ** @param xcb_window_t window
10190 ** @returns xcb_input_xi_get_client_pointer_cookie_t
10191 **
10192 *****************************************************************************/
10193
10194 xcb_input_xi_get_client_pointer_cookie_t
10195 xcb_input_xi_get_client_pointer_unchecked (xcb_connection_t *c /**< */,
10196 xcb_window_t window /**< */)
10197 {
10198 static const xcb_protocol_request_t xcb_req = {
10199 /* count */ 2,
10200 /* ext */ &xcb_input_id,
10201 /* opcode */ XCB_INPUT_XI_GET_CLIENT_POINTER,
10202 /* isvoid */ 0
10203 };
10204
10205 struct iovec xcb_parts[4];
10206 xcb_input_xi_get_client_pointer_cookie_t xcb_ret;
10207 xcb_input_xi_get_client_pointer_request_t xcb_out;
10208
10209 xcb_out.window = window;
10210
10211 xcb_parts[2].iov_base = (char *) &xcb_out;
10212 xcb_parts[2].iov_len = sizeof(xcb_out);
10213 xcb_parts[3].iov_base = 0;
10214 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
10215
10216 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
10217 return xcb_ret;
10218 }
10219
10220
10221 /*****************************************************************************
10222 **
10223 ** xcb_input_xi_get_client_pointer_reply_t * xcb_input_xi_get_client_pointer_reply
10224 **
10225 ** @param xcb_connection_t *c
10226 ** @param xcb_input_xi_get_client_pointer_cookie_t cookie
10227 ** @param xcb_generic_error_t **e
10228 ** @returns xcb_input_xi_get_client_pointer_reply_t *
10229 **
10230 *****************************************************************************/
10231
10232 xcb_input_xi_get_client_pointer_reply_t *
10233 xcb_input_xi_get_client_pointer_reply (xcb_connection_t *c /**< */,
10234 xcb_input_xi_get_client_pointer_cookie_t cookie /**< */,
10235 xcb_generic_error_t **e /**< */)
10236 {
10237 return (xcb_input_xi_get_client_pointer_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
10238 }
10239
10240 int
10241 xcb_input_event_mask_sizeof (const void *_buffer /**< */)
10242 {
10243 char *xcb_tmp = (char *)_buffer;
10244 const xcb_input_event_mask_t *_aux = (xcb_input_event_mask_t *)_buffer;
10245 unsigned int xcb_buffer_len = 0;
10246 unsigned int xcb_block_len = 0;
10247 unsigned int xcb_pad = 0;
10248 unsigned int xcb_align_to = 0;
10249
10250
10251 xcb_block_len += sizeof(xcb_input_event_mask_t);
10252 xcb_tmp += xcb_block_len;
10253 xcb_buffer_len += xcb_block_len;
10254 xcb_block_len = 0;
10255 /* mask */
10256 xcb_block_len += _aux->mask_len * sizeof(uint32_t);
10257 xcb_tmp += xcb_block_len;
10258 xcb_align_to = ALIGNOF(uint32_t);
10259 /* insert padding */
10260 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
10261 xcb_buffer_len += xcb_block_len + xcb_pad;
10262 if (0 != xcb_pad) {
10263 xcb_tmp += xcb_pad;
10264 xcb_pad = 0;
10265 }
10266 xcb_block_len = 0;
10267
10268 return xcb_buffer_len;
10269 }
10270
10271
10272 /*****************************************************************************
10273 **
10274 ** uint32_t * xcb_input_event_mask_mask
10275 **
10276 ** @param const xcb_input_event_mask_t *R
10277 ** @returns uint32_t *
10278 **
10279 *****************************************************************************/
10280
10281 uint32_t *
10282 xcb_input_event_mask_mask (const xcb_input_event_mask_t *R /**< */)
10283 {
10284 return (uint32_t *) (R + 1);
10285 }
10286
10287
10288 /*****************************************************************************
10289 **
10290 ** int xcb_input_event_mask_mask_length
10291 **
10292 ** @param const xcb_input_event_mask_t *R
10293 ** @returns int
10294 **
10295 *****************************************************************************/
10296
10297 int
10298 xcb_input_event_mask_mask_length (const xcb_input_event_mask_t *R /**< */)
10299 {
10300 return R->mask_len;
10301 }
10302
10303
10304 /*****************************************************************************
10305 **
10306 ** xcb_generic_iterator_t xcb_input_event_mask_mask_end
10307 **
10308 ** @param const xcb_input_event_mask_t *R
10309 ** @returns xcb_generic_iterator_t
10310 **
10311 *****************************************************************************/
10312
10313 xcb_generic_iterator_t
10314 xcb_input_event_mask_mask_end (const xcb_input_event_mask_t *R /**< */)
10315 {
10316 xcb_generic_iterator_t i;
10317 i.data = ((uint32_t *) (R + 1)) + (R->mask_len);
10318 i.rem = 0;
10319 i.index = (char *) i.data - (char *) R;
10320 return i;
10321 }
10322
10323
10324 /*****************************************************************************
10325 **
10326 ** void xcb_input_event_mask_next
10327 **
10328 ** @param xcb_input_event_mask_iterator_t *i
10329 ** @returns void
10330 **
10331 *****************************************************************************/
10332
10333 void
10334 xcb_input_event_mask_next (xcb_input_event_mask_iterator_t *i /**< */)
10335 {
10336 xcb_input_event_mask_t *R = i->data;
10337 xcb_generic_iterator_t child;
10338 child.data = (xcb_input_event_mask_t *)(((char *)R) + xcb_input_event_mask_sizeof(R));
10339 i->index = (char *) child.data - (char *) i->data;
10340 --i->rem;
10341 i->data = (xcb_input_event_mask_t *) child.data;
10342 }
10343
10344
10345 /*****************************************************************************
10346 **
10347 ** xcb_generic_iterator_t xcb_input_event_mask_end
10348 **
10349 ** @param xcb_input_event_mask_iterator_t i
10350 ** @returns xcb_generic_iterator_t
10351 **
10352 *****************************************************************************/
10353
10354 xcb_generic_iterator_t
10355 xcb_input_event_mask_end (xcb_input_event_mask_iterator_t i /**< */)
10356 {
10357 xcb_generic_iterator_t ret;
10358 while(i.rem > 0)
10359 xcb_input_event_mask_next(&i);
10360 ret.data = i.data;
10361 ret.rem = i.rem;
10362 ret.index = i.index;
10363 return ret;
10364 }
10365
10366 int
10367 xcb_input_xi_select_events_sizeof (const void *_buffer /**< */)
10368 {
10369 char *xcb_tmp = (char *)_buffer;
10370 const xcb_input_xi_select_events_request_t *_aux = (xcb_input_xi_select_events_request_t *)_buffer;
10371 unsigned int xcb_buffer_len = 0;
10372 unsigned int xcb_block_len = 0;
10373 unsigned int xcb_pad = 0;
10374 unsigned int xcb_align_to = 0;
10375
10376 unsigned int i;
10377 unsigned int xcb_tmp_len;
10378
10379 xcb_block_len += sizeof(xcb_input_xi_select_events_request_t);
10380 xcb_tmp += xcb_block_len;
10381 xcb_buffer_len += xcb_block_len;
10382 xcb_block_len = 0;
10383 /* masks */
10384 for(i=0; i<_aux->num_mask; i++) {
10385 xcb_tmp_len = xcb_input_event_mask_sizeof(xcb_tmp);
10386 xcb_block_len += xcb_tmp_len;
10387 xcb_tmp += xcb_tmp_len;
10388 }
10389 xcb_align_to = ALIGNOF(xcb_input_event_mask_t);
10390 /* insert padding */
10391 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
10392 xcb_buffer_len += xcb_block_len + xcb_pad;
10393 if (0 != xcb_pad) {
10394 xcb_tmp += xcb_pad;
10395 xcb_pad = 0;
10396 }
10397 xcb_block_len = 0;
10398
10399 return xcb_buffer_len;
10400 }
10401
10402
10403 /*****************************************************************************
10404 **
10405 ** xcb_void_cookie_t xcb_input_xi_select_events_checked
10406 **
10407 ** @param xcb_connection_t *c
10408 ** @param xcb_window_t window
10409 ** @param uint16_t num_mask
10410 ** @param const xcb_input_event_mask_t *masks
10411 ** @returns xcb_void_cookie_t
10412 **
10413 *****************************************************************************/
10414
10415 xcb_void_cookie_t
10416 xcb_input_xi_select_events_checked (xcb_connection_t *c /**< */,
10417 xcb_window_t window /**< */,
10418 uint16_t num_mask /**< */,
10419 const xcb_input_event_mask_t *masks /**< */)
10420 {
10421 static const xcb_protocol_request_t xcb_req = {
10422 /* count */ 4,
10423 /* ext */ &xcb_input_id,
10424 /* opcode */ XCB_INPUT_XI_SELECT_EVENTS,
10425 /* isvoid */ 1
10426 };
10427
10428 struct iovec xcb_parts[6];
10429 xcb_void_cookie_t xcb_ret;
10430 xcb_input_xi_select_events_request_t xcb_out;
10431 unsigned int i;
10432 unsigned int xcb_tmp_len;
10433 char *xcb_tmp;
10434
10435 xcb_out.window = window;
10436 xcb_out.num_mask = num_mask;
10437 memset(xcb_out.pad0, 0, 2);
10438
10439 xcb_parts[2].iov_base = (char *) &xcb_out;
10440 xcb_parts[2].iov_len = sizeof(xcb_out);
10441 xcb_parts[3].iov_base = 0;
10442 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
10443 /* xcb_input_event_mask_t masks */
10444 xcb_parts[4].iov_base = (char *) masks;
10445 xcb_parts[4].iov_len = 0;
10446 xcb_tmp = (char *)masks;
10447 for(i=0; i<num_mask; i++) {
10448 xcb_tmp_len = xcb_input_event_mask_sizeof(xcb_tmp);
10449 xcb_parts[4].iov_len += xcb_tmp_len;
10450 xcb_tmp += xcb_tmp_len;
10451 }
10452 xcb_parts[5].iov_base = 0;
10453 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
10454
10455 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
10456 return xcb_ret;
10457 }
10458
10459
10460 /*****************************************************************************
10461 **
10462 ** xcb_void_cookie_t xcb_input_xi_select_events
10463 **
10464 ** @param xcb_connection_t *c
10465 ** @param xcb_window_t window
10466 ** @param uint16_t num_mask
10467 ** @param const xcb_input_event_mask_t *masks
10468 ** @returns xcb_void_cookie_t
10469 **
10470 *****************************************************************************/
10471
10472 xcb_void_cookie_t
10473 xcb_input_xi_select_events (xcb_connection_t *c /**< */,
10474 xcb_window_t window /**< */,
10475 uint16_t num_mask /**< */,
10476 const xcb_input_event_mask_t *masks /**< */)
10477 {
10478 static const xcb_protocol_request_t xcb_req = {
10479 /* count */ 4,
10480 /* ext */ &xcb_input_id,
10481 /* opcode */ XCB_INPUT_XI_SELECT_EVENTS,
10482 /* isvoid */ 1
10483 };
10484
10485 struct iovec xcb_parts[6];
10486 xcb_void_cookie_t xcb_ret;
10487 xcb_input_xi_select_events_request_t xcb_out;
10488 unsigned int i;
10489 unsigned int xcb_tmp_len;
10490 char *xcb_tmp;
10491
10492 xcb_out.window = window;
10493 xcb_out.num_mask = num_mask;
10494 memset(xcb_out.pad0, 0, 2);
10495
10496 xcb_parts[2].iov_base = (char *) &xcb_out;
10497 xcb_parts[2].iov_len = sizeof(xcb_out);
10498 xcb_parts[3].iov_base = 0;
10499 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
10500 /* xcb_input_event_mask_t masks */
10501 xcb_parts[4].iov_base = (char *) masks;
10502 xcb_parts[4].iov_len = 0;
10503 xcb_tmp = (char *)masks;
10504 for(i=0; i<num_mask; i++) {
10505 xcb_tmp_len = xcb_input_event_mask_sizeof(xcb_tmp);
10506 xcb_parts[4].iov_len += xcb_tmp_len;
10507 xcb_tmp += xcb_tmp_len;
10508 }
10509 xcb_parts[5].iov_base = 0;
10510 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
10511
10512 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
10513 return xcb_ret;
10514 }
10515
10516
10517 /*****************************************************************************
10518 **
10519 ** xcb_input_xi_query_version_cookie_t xcb_input_xi_query_version
10520 **
10521 ** @param xcb_connection_t *c
10522 ** @param uint16_t major_version
10523 ** @param uint16_t minor_version
10524 ** @returns xcb_input_xi_query_version_cookie_t
10525 **
10526 *****************************************************************************/
10527
10528 xcb_input_xi_query_version_cookie_t
10529 xcb_input_xi_query_version (xcb_connection_t *c /**< */,
10530 uint16_t major_version /**< */,
10531 uint16_t minor_version /**< */)
10532 {
10533 static const xcb_protocol_request_t xcb_req = {
10534 /* count */ 2,
10535 /* ext */ &xcb_input_id,
10536 /* opcode */ XCB_INPUT_XI_QUERY_VERSION,
10537 /* isvoid */ 0
10538 };
10539
10540 struct iovec xcb_parts[4];
10541 xcb_input_xi_query_version_cookie_t xcb_ret;
10542 xcb_input_xi_query_version_request_t xcb_out;
10543
10544 xcb_out.major_version = major_version;
10545 xcb_out.minor_version = minor_version;
10546
10547 xcb_parts[2].iov_base = (char *) &xcb_out;
10548 xcb_parts[2].iov_len = sizeof(xcb_out);
10549 xcb_parts[3].iov_base = 0;
10550 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
10551
10552 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
10553 return xcb_ret;
10554 }
10555
10556
10557 /*****************************************************************************
10558 **
10559 ** xcb_input_xi_query_version_cookie_t xcb_input_xi_query_version_unchecked
10560 **
10561 ** @param xcb_connection_t *c
10562 ** @param uint16_t major_version
10563 ** @param uint16_t minor_version
10564 ** @returns xcb_input_xi_query_version_cookie_t
10565 **
10566 *****************************************************************************/
10567
10568 xcb_input_xi_query_version_cookie_t
10569 xcb_input_xi_query_version_unchecked (xcb_connection_t *c /**< */,
10570 uint16_t major_version /**< */,
10571 uint16_t minor_version /**< */)
10572 {
10573 static const xcb_protocol_request_t xcb_req = {
10574 /* count */ 2,
10575 /* ext */ &xcb_input_id,
10576 /* opcode */ XCB_INPUT_XI_QUERY_VERSION,
10577 /* isvoid */ 0
10578 };
10579
10580 struct iovec xcb_parts[4];
10581 xcb_input_xi_query_version_cookie_t xcb_ret;
10582 xcb_input_xi_query_version_request_t xcb_out;
10583
10584 xcb_out.major_version = major_version;
10585 xcb_out.minor_version = minor_version;
10586
10587 xcb_parts[2].iov_base = (char *) &xcb_out;
10588 xcb_parts[2].iov_len = sizeof(xcb_out);
10589 xcb_parts[3].iov_base = 0;
10590 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
10591
10592 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
10593 return xcb_ret;
10594 }
10595
10596
10597 /*****************************************************************************
10598 **
10599 ** xcb_input_xi_query_version_reply_t * xcb_input_xi_query_version_reply
10600 **
10601 ** @param xcb_connection_t *c
10602 ** @param xcb_input_xi_query_version_cookie_t cookie
10603 ** @param xcb_generic_error_t **e
10604 ** @returns xcb_input_xi_query_version_reply_t *
10605 **
10606 *****************************************************************************/
10607
10608 xcb_input_xi_query_version_reply_t *
10609 xcb_input_xi_query_version_reply (xcb_connection_t *c /**< */,
10610 xcb_input_xi_query_version_cookie_t cookie /**< */,
10611 xcb_generic_error_t **e /**< */)
10612 {
10613 return (xcb_input_xi_query_version_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
10614 }
10615
10616 int
10617 xcb_input_button_class_sizeof (const void *_buffer /**< */)
10618 {
10619 char *xcb_tmp = (char *)_buffer;
10620 const xcb_input_button_class_t *_aux = (xcb_input_button_class_t *)_buffer;
10621 unsigned int xcb_buffer_len = 0;
10622 unsigned int xcb_block_len = 0;
10623 unsigned int xcb_pad = 0;
10624 unsigned int xcb_align_to = 0;
10625
10626
10627 xcb_block_len += sizeof(xcb_input_button_class_t);
10628 xcb_tmp += xcb_block_len;
10629 xcb_buffer_len += xcb_block_len;
10630 xcb_block_len = 0;
10631 /* state */
10632 xcb_block_len += ((_aux->num_buttons + 31) / 32) * sizeof(xcb_atom_t);
10633 xcb_tmp += xcb_block_len;
10634 xcb_align_to = ALIGNOF(uint32_t);
10635 /* insert padding */
10636 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
10637 xcb_buffer_len += xcb_block_len + xcb_pad;
10638 if (0 != xcb_pad) {
10639 xcb_tmp += xcb_pad;
10640 xcb_pad = 0;
10641 }
10642 xcb_block_len = 0;
10643 /* labels */
10644 xcb_block_len += _aux->num_buttons * sizeof(xcb_atom_t);
10645 xcb_tmp += xcb_block_len;
10646 xcb_align_to = ALIGNOF(xcb_atom_t);
10647 /* insert padding */
10648 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
10649 xcb_buffer_len += xcb_block_len + xcb_pad;
10650 if (0 != xcb_pad) {
10651 xcb_tmp += xcb_pad;
10652 xcb_pad = 0;
10653 }
10654 xcb_block_len = 0;
10655
10656 return xcb_buffer_len;
10657 }
10658
10659
10660 /*****************************************************************************
10661 **
10662 ** uint32_t * xcb_input_button_class_state
10663 **
10664 ** @param const xcb_input_button_class_t *R
10665 ** @returns uint32_t *
10666 **
10667 *****************************************************************************/
10668
10669 uint32_t *
10670 xcb_input_button_class_state (const xcb_input_button_class_t *R /**< */)
10671 {
10672 return (uint32_t *) (R + 1);
10673 }
10674
10675
10676 /*****************************************************************************
10677 **
10678 ** int xcb_input_button_class_state_length
10679 **
10680 ** @param const xcb_input_button_class_t *R
10681 ** @returns int
10682 **
10683 *****************************************************************************/
10684
10685 int
10686 xcb_input_button_class_state_length (const xcb_input_button_class_t *R /**< */)
10687 {
10688 return ((R->num_buttons + 31) / 32);
10689 }
10690
10691
10692 /*****************************************************************************
10693 **
10694 ** xcb_generic_iterator_t xcb_input_button_class_state_end
10695 **
10696 ** @param const xcb_input_button_class_t *R
10697 ** @returns xcb_generic_iterator_t
10698 **
10699 *****************************************************************************/
10700
10701 xcb_generic_iterator_t
10702 xcb_input_button_class_state_end (const xcb_input_button_class_t *R /**< */)
10703 {
10704 xcb_generic_iterator_t i;
10705 i.data = ((uint32_t *) (R + 1)) + (((R->num_buttons + 31) / 32));
10706 i.rem = 0;
10707 i.index = (char *) i.data - (char *) R;
10708 return i;
10709 }
10710
10711
10712 /*****************************************************************************
10713 **
10714 ** xcb_atom_t * xcb_input_button_class_labels
10715 **
10716 ** @param const xcb_input_button_class_t *R
10717 ** @returns xcb_atom_t *
10718 **
10719 *****************************************************************************/
10720
10721 xcb_atom_t *
10722 xcb_input_button_class_labels (const xcb_input_button_class_t *R /**< */)
10723 {
10724 xcb_generic_iterator_t prev = xcb_input_button_class_state_end(R);
10725 return (xcb_atom_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_atom_t, prev.index) + 0);
10726 }
10727
10728
10729 /*****************************************************************************
10730 **
10731 ** int xcb_input_button_class_labels_length
10732 **
10733 ** @param const xcb_input_button_class_t *R
10734 ** @returns int
10735 **
10736 *****************************************************************************/
10737
10738 int
10739 xcb_input_button_class_labels_length (const xcb_input_button_class_t *R /**< */)
10740 {
10741 return R->num_buttons;
10742 }
10743
10744
10745 /*****************************************************************************
10746 **
10747 ** xcb_generic_iterator_t xcb_input_button_class_labels_end
10748 **
10749 ** @param const xcb_input_button_class_t *R
10750 ** @returns xcb_generic_iterator_t
10751 **
10752 *****************************************************************************/
10753
10754 xcb_generic_iterator_t
10755 xcb_input_button_class_labels_end (const xcb_input_button_class_t *R /**< */)
10756 {
10757 xcb_generic_iterator_t i;
10758 xcb_generic_iterator_t child = xcb_input_button_class_state_end(R);
10759 i.data = ((xcb_atom_t *) child.data) + (R->num_buttons);
10760 i.rem = 0;
10761 i.index = (char *) i.data - (char *) R;
10762 return i;
10763 }
10764
10765
10766 /*****************************************************************************
10767 **
10768 ** void xcb_input_button_class_next
10769 **
10770 ** @param xcb_input_button_class_iterator_t *i
10771 ** @returns void
10772 **
10773 *****************************************************************************/
10774
10775 void
10776 xcb_input_button_class_next (xcb_input_button_class_iterator_t *i /**< */)
10777 {
10778 xcb_input_button_class_t *R = i->data;
10779 xcb_generic_iterator_t child;
10780 child.data = (xcb_input_button_class_t *)(((char *)R) + xcb_input_button_class_sizeof(R));
10781 i->index = (char *) child.data - (char *) i->data;
10782 --i->rem;
10783 i->data = (xcb_input_button_class_t *) child.data;
10784 }
10785
10786
10787 /*****************************************************************************
10788 **
10789 ** xcb_generic_iterator_t xcb_input_button_class_end
10790 **
10791 ** @param xcb_input_button_class_iterator_t i
10792 ** @returns xcb_generic_iterator_t
10793 **
10794 *****************************************************************************/
10795
10796 xcb_generic_iterator_t
10797 xcb_input_button_class_end (xcb_input_button_class_iterator_t i /**< */)
10798 {
10799 xcb_generic_iterator_t ret;
10800 while(i.rem > 0)
10801 xcb_input_button_class_next(&i);
10802 ret.data = i.data;
10803 ret.rem = i.rem;
10804 ret.index = i.index;
10805 return ret;
10806 }
10807
10808 int
10809 xcb_input_key_class_sizeof (const void *_buffer /**< */)
10810 {
10811 char *xcb_tmp = (char *)_buffer;
10812 const xcb_input_key_class_t *_aux = (xcb_input_key_class_t *)_buffer;
10813 unsigned int xcb_buffer_len = 0;
10814 unsigned int xcb_block_len = 0;
10815 unsigned int xcb_pad = 0;
10816 unsigned int xcb_align_to = 0;
10817
10818
10819 xcb_block_len += sizeof(xcb_input_key_class_t);
10820 xcb_tmp += xcb_block_len;
10821 xcb_buffer_len += xcb_block_len;
10822 xcb_block_len = 0;
10823 /* keys */
10824 xcb_block_len += _aux->num_keys * sizeof(uint32_t);
10825 xcb_tmp += xcb_block_len;
10826 xcb_align_to = ALIGNOF(uint32_t);
10827 /* insert padding */
10828 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
10829 xcb_buffer_len += xcb_block_len + xcb_pad;
10830 if (0 != xcb_pad) {
10831 xcb_tmp += xcb_pad;
10832 xcb_pad = 0;
10833 }
10834 xcb_block_len = 0;
10835
10836 return xcb_buffer_len;
10837 }
10838
10839
10840 /*****************************************************************************
10841 **
10842 ** uint32_t * xcb_input_key_class_keys
10843 **
10844 ** @param const xcb_input_key_class_t *R
10845 ** @returns uint32_t *
10846 **
10847 *****************************************************************************/
10848
10849 uint32_t *
10850 xcb_input_key_class_keys (const xcb_input_key_class_t *R /**< */)
10851 {
10852 return (uint32_t *) (R + 1);
10853 }
10854
10855
10856 /*****************************************************************************
10857 **
10858 ** int xcb_input_key_class_keys_length
10859 **
10860 ** @param const xcb_input_key_class_t *R
10861 ** @returns int
10862 **
10863 *****************************************************************************/
10864
10865 int
10866 xcb_input_key_class_keys_length (const xcb_input_key_class_t *R /**< */)
10867 {
10868 return R->num_keys;
10869 }
10870
10871
10872 /*****************************************************************************
10873 **
10874 ** xcb_generic_iterator_t xcb_input_key_class_keys_end
10875 **
10876 ** @param const xcb_input_key_class_t *R
10877 ** @returns xcb_generic_iterator_t
10878 **
10879 *****************************************************************************/
10880
10881 xcb_generic_iterator_t
10882 xcb_input_key_class_keys_end (const xcb_input_key_class_t *R /**< */)
10883 {
10884 xcb_generic_iterator_t i;
10885 i.data = ((uint32_t *) (R + 1)) + (R->num_keys);
10886 i.rem = 0;
10887 i.index = (char *) i.data - (char *) R;
10888 return i;
10889 }
10890
10891
10892 /*****************************************************************************
10893 **
10894 ** void xcb_input_key_class_next
10895 **
10896 ** @param xcb_input_key_class_iterator_t *i
10897 ** @returns void
10898 **
10899 *****************************************************************************/
10900
10901 void
10902 xcb_input_key_class_next (xcb_input_key_class_iterator_t *i /**< */)
10903 {
10904 xcb_input_key_class_t *R = i->data;
10905 xcb_generic_iterator_t child;
10906 child.data = (xcb_input_key_class_t *)(((char *)R) + xcb_input_key_class_sizeof(R));
10907 i->index = (char *) child.data - (char *) i->data;
10908 --i->rem;
10909 i->data = (xcb_input_key_class_t *) child.data;
10910 }
10911
10912
10913 /*****************************************************************************
10914 **
10915 ** xcb_generic_iterator_t xcb_input_key_class_end
10916 **
10917 ** @param xcb_input_key_class_iterator_t i
10918 ** @returns xcb_generic_iterator_t
10919 **
10920 *****************************************************************************/
10921
10922 xcb_generic_iterator_t
10923 xcb_input_key_class_end (xcb_input_key_class_iterator_t i /**< */)
10924 {
10925 xcb_generic_iterator_t ret;
10926 while(i.rem > 0)
10927 xcb_input_key_class_next(&i);
10928 ret.data = i.data;
10929 ret.rem = i.rem;
10930 ret.index = i.index;
10931 return ret;
10932 }
10933
10934
10935 /*****************************************************************************
10936 **
10937 ** void xcb_input_scroll_class_next
10938 **
10939 ** @param xcb_input_scroll_class_iterator_t *i
10940 ** @returns void
10941 **
10942 *****************************************************************************/
10943
10944 void
10945 xcb_input_scroll_class_next (xcb_input_scroll_class_iterator_t *i /**< */)
10946 {
10947 --i->rem;
10948 ++i->data;
10949 i->index += sizeof(xcb_input_scroll_class_t);
10950 }
10951
10952
10953 /*****************************************************************************
10954 **
10955 ** xcb_generic_iterator_t xcb_input_scroll_class_end
10956 **
10957 ** @param xcb_input_scroll_class_iterator_t i
10958 ** @returns xcb_generic_iterator_t
10959 **
10960 *****************************************************************************/
10961
10962 xcb_generic_iterator_t
10963 xcb_input_scroll_class_end (xcb_input_scroll_class_iterator_t i /**< */)
10964 {
10965 xcb_generic_iterator_t ret;
10966 ret.data = i.data + i.rem;
10967 ret.index = i.index + ((char *) ret.data - (char *) i.data);
10968 ret.rem = 0;
10969 return ret;
10970 }
10971
10972
10973 /*****************************************************************************
10974 **
10975 ** void xcb_input_touch_class_next
10976 **
10977 ** @param xcb_input_touch_class_iterator_t *i
10978 ** @returns void
10979 **
10980 *****************************************************************************/
10981
10982 void
10983 xcb_input_touch_class_next (xcb_input_touch_class_iterator_t *i /**< */)
10984 {
10985 --i->rem;
10986 ++i->data;
10987 i->index += sizeof(xcb_input_touch_class_t);
10988 }
10989
10990
10991 /*****************************************************************************
10992 **
10993 ** xcb_generic_iterator_t xcb_input_touch_class_end
10994 **
10995 ** @param xcb_input_touch_class_iterator_t i
10996 ** @returns xcb_generic_iterator_t
10997 **
10998 *****************************************************************************/
10999
11000 xcb_generic_iterator_t
11001 xcb_input_touch_class_end (xcb_input_touch_class_iterator_t i /**< */)
11002 {
11003 xcb_generic_iterator_t ret;
11004 ret.data = i.data + i.rem;
11005 ret.index = i.index + ((char *) ret.data - (char *) i.data);
11006 ret.rem = 0;
11007 return ret;
11008 }
11009
11010
11011 /*****************************************************************************
11012 **
11013 ** void xcb_input_valuator_class_next
11014 **
11015 ** @param xcb_input_valuator_class_iterator_t *i
11016 ** @returns void
11017 **
11018 *****************************************************************************/
11019
11020 void
11021 xcb_input_valuator_class_next (xcb_input_valuator_class_iterator_t *i /**< */)
11022 {
11023 --i->rem;
11024 ++i->data;
11025 i->index += sizeof(xcb_input_valuator_class_t);
11026 }
11027
11028
11029 /*****************************************************************************
11030 **
11031 ** xcb_generic_iterator_t xcb_input_valuator_class_end
11032 **
11033 ** @param xcb_input_valuator_class_iterator_t i
11034 ** @returns xcb_generic_iterator_t
11035 **
11036 *****************************************************************************/
11037
11038 xcb_generic_iterator_t
11039 xcb_input_valuator_class_end (xcb_input_valuator_class_iterator_t i /**< */)
11040 {
11041 xcb_generic_iterator_t ret;
11042 ret.data = i.data + i.rem;
11043 ret.index = i.index + ((char *) ret.data - (char *) i.data);
11044 ret.rem = 0;
11045 return ret;
11046 }
11047
11048 int
11049 xcb_input_device_class_sizeof (const void *_buffer /**< */)
11050 {
11051 char *xcb_tmp = (char *)_buffer;
11052 const xcb_input_device_class_t *_aux = (xcb_input_device_class_t *)_buffer;
11053 unsigned int xcb_buffer_len = 0;
11054 unsigned int xcb_block_len = 0;
11055 unsigned int xcb_pad = 0;
11056 unsigned int xcb_align_to = 0;
11057
11058
11059 xcb_block_len += sizeof(xcb_input_device_class_t);
11060 xcb_tmp += xcb_block_len;
11061 xcb_buffer_len += xcb_block_len;
11062 xcb_block_len = 0;
11063 /* uninterpreted_data */
11064 xcb_block_len += ((_aux->len * 4) - 8) * sizeof(uint8_t);
11065 xcb_tmp += xcb_block_len;
11066 xcb_align_to = ALIGNOF(uint8_t);
11067 /* insert padding */
11068 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
11069 xcb_buffer_len += xcb_block_len + xcb_pad;
11070 if (0 != xcb_pad) {
11071 xcb_tmp += xcb_pad;
11072 xcb_pad = 0;
11073 }
11074 xcb_block_len = 0;
11075
11076 return xcb_buffer_len;
11077 }
11078
11079
11080 /*****************************************************************************
11081 **
11082 ** uint8_t * xcb_input_device_class_uninterpreted_data
11083 **
11084 ** @param const xcb_input_device_class_t *R
11085 ** @returns uint8_t *
11086 **
11087 *****************************************************************************/
11088
11089 uint8_t *
11090 xcb_input_device_class_uninterpreted_data (const xcb_input_device_class_t *R /**< */)
11091 {
11092 return (uint8_t *) (R + 1);
11093 }
11094
11095
11096 /*****************************************************************************
11097 **
11098 ** int xcb_input_device_class_uninterpreted_data_length
11099 **
11100 ** @param const xcb_input_device_class_t *R
11101 ** @returns int
11102 **
11103 *****************************************************************************/
11104
11105 int
11106 xcb_input_device_class_uninterpreted_data_length (const xcb_input_device_class_t *R /**< */)
11107 {
11108 return ((R->len * 4) - 8);
11109 }
11110
11111
11112 /*****************************************************************************
11113 **
11114 ** xcb_generic_iterator_t xcb_input_device_class_uninterpreted_data_end
11115 **
11116 ** @param const xcb_input_device_class_t *R
11117 ** @returns xcb_generic_iterator_t
11118 **
11119 *****************************************************************************/
11120
11121 xcb_generic_iterator_t
11122 xcb_input_device_class_uninterpreted_data_end (const xcb_input_device_class_t *R /**< */)
11123 {
11124 xcb_generic_iterator_t i;
11125 i.data = ((uint8_t *) (R + 1)) + (((R->len * 4) - 8));
11126 i.rem = 0;
11127 i.index = (char *) i.data - (char *) R;
11128 return i;
11129 }
11130
11131
11132 /*****************************************************************************
11133 **
11134 ** void xcb_input_device_class_next
11135 **
11136 ** @param xcb_input_device_class_iterator_t *i
11137 ** @returns void
11138 **
11139 *****************************************************************************/
11140
11141 void
11142 xcb_input_device_class_next (xcb_input_device_class_iterator_t *i /**< */)
11143 {
11144 xcb_input_device_class_t *R = i->data;
11145 xcb_generic_iterator_t child;
11146 child.data = (xcb_input_device_class_t *)(((char *)R) + xcb_input_device_class_sizeof(R));
11147 i->index = (char *) child.data - (char *) i->data;
11148 --i->rem;
11149 i->data = (xcb_input_device_class_t *) child.data;
11150 }
11151
11152
11153 /*****************************************************************************
11154 **
11155 ** xcb_generic_iterator_t xcb_input_device_class_end
11156 **
11157 ** @param xcb_input_device_class_iterator_t i
11158 ** @returns xcb_generic_iterator_t
11159 **
11160 *****************************************************************************/
11161
11162 xcb_generic_iterator_t
11163 xcb_input_device_class_end (xcb_input_device_class_iterator_t i /**< */)
11164 {
11165 xcb_generic_iterator_t ret;
11166 while(i.rem > 0)
11167 xcb_input_device_class_next(&i);
11168 ret.data = i.data;
11169 ret.rem = i.rem;
11170 ret.index = i.index;
11171 return ret;
11172 }
11173
11174 int
11175 xcb_input_xi_device_info_sizeof (const void *_buffer /**< */)
11176 {
11177 char *xcb_tmp = (char *)_buffer;
11178 const xcb_input_xi_device_info_t *_aux = (xcb_input_xi_device_info_t *)_buffer;
11179 unsigned int xcb_buffer_len = 0;
11180 unsigned int xcb_block_len = 0;
11181 unsigned int xcb_pad = 0;
11182 unsigned int xcb_align_to = 0;
11183
11184 unsigned int i;
11185 unsigned int xcb_tmp_len;
11186
11187 xcb_block_len += sizeof(xcb_input_xi_device_info_t);
11188 xcb_tmp += xcb_block_len;
11189 xcb_buffer_len += xcb_block_len;
11190 xcb_block_len = 0;
11191 /* name */
11192 xcb_block_len += (((_aux->name_len + 3) / 4) * 4) * sizeof(char);
11193 xcb_tmp += xcb_block_len;
11194 xcb_align_to = ALIGNOF(char);
11195 /* insert padding */
11196 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
11197 xcb_buffer_len += xcb_block_len + xcb_pad;
11198 if (0 != xcb_pad) {
11199 xcb_tmp += xcb_pad;
11200 xcb_pad = 0;
11201 }
11202 xcb_block_len = 0;
11203 /* classes */
11204 for(i=0; i<_aux->num_classes; i++) {
11205 xcb_tmp_len = xcb_input_device_class_sizeof(xcb_tmp);
11206 xcb_block_len += xcb_tmp_len;
11207 xcb_tmp += xcb_tmp_len;
11208 }
11209 xcb_align_to = ALIGNOF(xcb_input_device_class_t);
11210 /* insert padding */
11211 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
11212 xcb_buffer_len += xcb_block_len + xcb_pad;
11213 if (0 != xcb_pad) {
11214 xcb_tmp += xcb_pad;
11215 xcb_pad = 0;
11216 }
11217 xcb_block_len = 0;
11218
11219 return xcb_buffer_len;
11220 }
11221
11222
11223 /*****************************************************************************
11224 **
11225 ** char * xcb_input_xi_device_info_name
11226 **
11227 ** @param const xcb_input_xi_device_info_t *R
11228 ** @returns char *
11229 **
11230 *****************************************************************************/
11231
11232 char *
11233 xcb_input_xi_device_info_name (const xcb_input_xi_device_info_t *R /**< */)
11234 {
11235 return (char *) (R + 1);
11236 }
11237
11238
11239 /*****************************************************************************
11240 **
11241 ** int xcb_input_xi_device_info_name_length
11242 **
11243 ** @param const xcb_input_xi_device_info_t *R
11244 ** @returns int
11245 **
11246 *****************************************************************************/
11247
11248 int
11249 xcb_input_xi_device_info_name_length (const xcb_input_xi_device_info_t *R /**< */)
11250 {
11251 return (((R->name_len + 3) / 4) * 4);
11252 }
11253
11254
11255 /*****************************************************************************
11256 **
11257 ** xcb_generic_iterator_t xcb_input_xi_device_info_name_end
11258 **
11259 ** @param const xcb_input_xi_device_info_t *R
11260 ** @returns xcb_generic_iterator_t
11261 **
11262 *****************************************************************************/
11263
11264 xcb_generic_iterator_t
11265 xcb_input_xi_device_info_name_end (const xcb_input_xi_device_info_t *R /**< */)
11266 {
11267 xcb_generic_iterator_t i;
11268 i.data = ((char *) (R + 1)) + ((((R->name_len + 3) / 4) * 4));
11269 i.rem = 0;
11270 i.index = (char *) i.data - (char *) R;
11271 return i;
11272 }
11273
11274
11275 /*****************************************************************************
11276 **
11277 ** int xcb_input_xi_device_info_classes_length
11278 **
11279 ** @param const xcb_input_xi_device_info_t *R
11280 ** @returns int
11281 **
11282 *****************************************************************************/
11283
11284 int
11285 xcb_input_xi_device_info_classes_length (const xcb_input_xi_device_info_t *R /**< */)
11286 {
11287 return R->num_classes;
11288 }
11289
11290
11291 /*****************************************************************************
11292 **
11293 ** xcb_input_device_class_iterator_t xcb_input_xi_device_info_classes_iterator
11294 **
11295 ** @param const xcb_input_xi_device_info_t *R
11296 ** @returns xcb_input_device_class_iterator_t
11297 **
11298 *****************************************************************************/
11299
11300 xcb_input_device_class_iterator_t
11301 xcb_input_xi_device_info_classes_iterator (const xcb_input_xi_device_info_t *R /**< */)
11302 {
11303 xcb_input_device_class_iterator_t i;
11304 xcb_generic_iterator_t prev = xcb_input_xi_device_info_name_end(R);
11305 i.data = (xcb_input_device_class_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_input_device_class_t, prev.index));
11306 i.rem = R->num_classes;
11307 i.index = (char *) i.data - (char *) R;
11308 return i;
11309 }
11310
11311
11312 /*****************************************************************************
11313 **
11314 ** void xcb_input_xi_device_info_next
11315 **
11316 ** @param xcb_input_xi_device_info_iterator_t *i
11317 ** @returns void
11318 **
11319 *****************************************************************************/
11320
11321 void
11322 xcb_input_xi_device_info_next (xcb_input_xi_device_info_iterator_t *i /**< */)
11323 {
11324 xcb_input_xi_device_info_t *R = i->data;
11325 xcb_generic_iterator_t child;
11326 child.data = (xcb_input_xi_device_info_t *)(((char *)R) + xcb_input_xi_device_info_sizeof(R));
11327 i->index = (char *) child.data - (char *) i->data;
11328 --i->rem;
11329 i->data = (xcb_input_xi_device_info_t *) child.data;
11330 }
11331
11332
11333 /*****************************************************************************
11334 **
11335 ** xcb_generic_iterator_t xcb_input_xi_device_info_end
11336 **
11337 ** @param xcb_input_xi_device_info_iterator_t i
11338 ** @returns xcb_generic_iterator_t
11339 **
11340 *****************************************************************************/
11341
11342 xcb_generic_iterator_t
11343 xcb_input_xi_device_info_end (xcb_input_xi_device_info_iterator_t i /**< */)
11344 {
11345 xcb_generic_iterator_t ret;
11346 while(i.rem > 0)
11347 xcb_input_xi_device_info_next(&i);
11348 ret.data = i.data;
11349 ret.rem = i.rem;
11350 ret.index = i.index;
11351 return ret;
11352 }
11353
11354 int
11355 xcb_input_xi_query_device_sizeof (const void *_buffer /**< */)
11356 {
11357 char *xcb_tmp = (char *)_buffer;
11358 const xcb_input_xi_query_device_reply_t *_aux = (xcb_input_xi_query_device_reply_t *)_buffer;
11359 unsigned int xcb_buffer_len = 0;
11360 unsigned int xcb_block_len = 0;
11361 unsigned int xcb_pad = 0;
11362 unsigned int xcb_align_to = 0;
11363
11364 unsigned int i;
11365 unsigned int xcb_tmp_len;
11366
11367 xcb_block_len += sizeof(xcb_input_xi_query_device_reply_t);
11368 xcb_tmp += xcb_block_len;
11369 xcb_buffer_len += xcb_block_len;
11370 xcb_block_len = 0;
11371 /* infos */
11372 for(i=0; i<_aux->num_infos; i++) {
11373 xcb_tmp_len = xcb_input_xi_device_info_sizeof(xcb_tmp);
11374 xcb_block_len += xcb_tmp_len;
11375 xcb_tmp += xcb_tmp_len;
11376 }
11377 xcb_align_to = ALIGNOF(xcb_input_xi_device_info_t);
11378 /* insert padding */
11379 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
11380 xcb_buffer_len += xcb_block_len + xcb_pad;
11381 if (0 != xcb_pad) {
11382 xcb_tmp += xcb_pad;
11383 xcb_pad = 0;
11384 }
11385 xcb_block_len = 0;
11386
11387 return xcb_buffer_len;
11388 }
11389
11390
11391 /*****************************************************************************
11392 **
11393 ** xcb_input_xi_query_device_cookie_t xcb_input_xi_query_device
11394 **
11395 ** @param xcb_connection_t *c
11396 ** @param xcb_input_device_id_t deviceid
11397 ** @returns xcb_input_xi_query_device_cookie_t
11398 **
11399 *****************************************************************************/
11400
11401 xcb_input_xi_query_device_cookie_t
11402 xcb_input_xi_query_device (xcb_connection_t *c /**< */,
11403 xcb_input_device_id_t deviceid /**< */)
11404 {
11405 static const xcb_protocol_request_t xcb_req = {
11406 /* count */ 2,
11407 /* ext */ &xcb_input_id,
11408 /* opcode */ XCB_INPUT_XI_QUERY_DEVICE,
11409 /* isvoid */ 0
11410 };
11411
11412 struct iovec xcb_parts[4];
11413 xcb_input_xi_query_device_cookie_t xcb_ret;
11414 xcb_input_xi_query_device_request_t xcb_out;
11415
11416 xcb_out.deviceid = deviceid;
11417 memset(xcb_out.pad0, 0, 2);
11418
11419 xcb_parts[2].iov_base = (char *) &xcb_out;
11420 xcb_parts[2].iov_len = sizeof(xcb_out);
11421 xcb_parts[3].iov_base = 0;
11422 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
11423
11424 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
11425 return xcb_ret;
11426 }
11427
11428
11429 /*****************************************************************************
11430 **
11431 ** xcb_input_xi_query_device_cookie_t xcb_input_xi_query_device_unchecked
11432 **
11433 ** @param xcb_connection_t *c
11434 ** @param xcb_input_device_id_t deviceid
11435 ** @returns xcb_input_xi_query_device_cookie_t
11436 **
11437 *****************************************************************************/
11438
11439 xcb_input_xi_query_device_cookie_t
11440 xcb_input_xi_query_device_unchecked (xcb_connection_t *c /**< */,
11441 xcb_input_device_id_t deviceid /**< */)
11442 {
11443 static const xcb_protocol_request_t xcb_req = {
11444 /* count */ 2,
11445 /* ext */ &xcb_input_id,
11446 /* opcode */ XCB_INPUT_XI_QUERY_DEVICE,
11447 /* isvoid */ 0
11448 };
11449
11450 struct iovec xcb_parts[4];
11451 xcb_input_xi_query_device_cookie_t xcb_ret;
11452 xcb_input_xi_query_device_request_t xcb_out;
11453
11454 xcb_out.deviceid = deviceid;
11455 memset(xcb_out.pad0, 0, 2);
11456
11457 xcb_parts[2].iov_base = (char *) &xcb_out;
11458 xcb_parts[2].iov_len = sizeof(xcb_out);
11459 xcb_parts[3].iov_base = 0;
11460 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
11461
11462 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
11463 return xcb_ret;
11464 }
11465
11466
11467 /*****************************************************************************
11468 **
11469 ** int xcb_input_xi_query_device_infos_length
11470 **
11471 ** @param const xcb_input_xi_query_device_reply_t *R
11472 ** @returns int
11473 **
11474 *****************************************************************************/
11475
11476 int
11477 xcb_input_xi_query_device_infos_length (const xcb_input_xi_query_device_reply_t *R /**< */)
11478 {
11479 return R->num_infos;
11480 }
11481
11482
11483 /*****************************************************************************
11484 **
11485 ** xcb_input_xi_device_info_iterator_t xcb_input_xi_query_device_infos_iterator
11486 **
11487 ** @param const xcb_input_xi_query_device_reply_t *R
11488 ** @returns xcb_input_xi_device_info_iterator_t
11489 **
11490 *****************************************************************************/
11491
11492 xcb_input_xi_device_info_iterator_t
11493 xcb_input_xi_query_device_infos_iterator (const xcb_input_xi_query_device_reply_t *R /**< */)
11494 {
11495 xcb_input_xi_device_info_iterator_t i;
11496 i.data = (xcb_input_xi_device_info_t *) (R + 1);
11497 i.rem = R->num_infos;
11498 i.index = (char *) i.data - (char *) R;
11499 return i;
11500 }
11501
11502
11503 /*****************************************************************************
11504 **
11505 ** xcb_input_xi_query_device_reply_t * xcb_input_xi_query_device_reply
11506 **
11507 ** @param xcb_connection_t *c
11508 ** @param xcb_input_xi_query_device_cookie_t cookie
11509 ** @param xcb_generic_error_t **e
11510 ** @returns xcb_input_xi_query_device_reply_t *
11511 **
11512 *****************************************************************************/
11513
11514 xcb_input_xi_query_device_reply_t *
11515 xcb_input_xi_query_device_reply (xcb_connection_t *c /**< */,
11516 xcb_input_xi_query_device_cookie_t cookie /**< */,
11517 xcb_generic_error_t **e /**< */)
11518 {
11519 return (xcb_input_xi_query_device_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
11520 }
11521
11522
11523 /*****************************************************************************
11524 **
11525 ** xcb_void_cookie_t xcb_input_xi_set_focus_checked
11526 **
11527 ** @param xcb_connection_t *c
11528 ** @param xcb_window_t window
11529 ** @param xcb_timestamp_t time
11530 ** @param xcb_input_device_id_t deviceid
11531 ** @returns xcb_void_cookie_t
11532 **
11533 *****************************************************************************/
11534
11535 xcb_void_cookie_t
11536 xcb_input_xi_set_focus_checked (xcb_connection_t *c /**< */,
11537 xcb_window_t window /**< */,
11538 xcb_timestamp_t time /**< */,
11539 xcb_input_device_id_t deviceid /**< */)
11540 {
11541 static const xcb_protocol_request_t xcb_req = {
11542 /* count */ 2,
11543 /* ext */ &xcb_input_id,
11544 /* opcode */ XCB_INPUT_XI_SET_FOCUS,
11545 /* isvoid */ 1
11546 };
11547
11548 struct iovec xcb_parts[4];
11549 xcb_void_cookie_t xcb_ret;
11550 xcb_input_xi_set_focus_request_t xcb_out;
11551
11552 xcb_out.window = window;
11553 xcb_out.time = time;
11554 xcb_out.deviceid = deviceid;
11555 memset(xcb_out.pad0, 0, 2);
11556
11557 xcb_parts[2].iov_base = (char *) &xcb_out;
11558 xcb_parts[2].iov_len = sizeof(xcb_out);
11559 xcb_parts[3].iov_base = 0;
11560 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
11561
11562 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
11563 return xcb_ret;
11564 }
11565
11566
11567 /*****************************************************************************
11568 **
11569 ** xcb_void_cookie_t xcb_input_xi_set_focus
11570 **
11571 ** @param xcb_connection_t *c
11572 ** @param xcb_window_t window
11573 ** @param xcb_timestamp_t time
11574 ** @param xcb_input_device_id_t deviceid
11575 ** @returns xcb_void_cookie_t
11576 **
11577 *****************************************************************************/
11578
11579 xcb_void_cookie_t
11580 xcb_input_xi_set_focus (xcb_connection_t *c /**< */,
11581 xcb_window_t window /**< */,
11582 xcb_timestamp_t time /**< */,
11583 xcb_input_device_id_t deviceid /**< */)
11584 {
11585 static const xcb_protocol_request_t xcb_req = {
11586 /* count */ 2,
11587 /* ext */ &xcb_input_id,
11588 /* opcode */ XCB_INPUT_XI_SET_FOCUS,
11589 /* isvoid */ 1
11590 };
11591
11592 struct iovec xcb_parts[4];
11593 xcb_void_cookie_t xcb_ret;
11594 xcb_input_xi_set_focus_request_t xcb_out;
11595
11596 xcb_out.window = window;
11597 xcb_out.time = time;
11598 xcb_out.deviceid = deviceid;
11599 memset(xcb_out.pad0, 0, 2);
11600
11601 xcb_parts[2].iov_base = (char *) &xcb_out;
11602 xcb_parts[2].iov_len = sizeof(xcb_out);
11603 xcb_parts[3].iov_base = 0;
11604 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
11605
11606 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
11607 return xcb_ret;
11608 }
11609
11610
11611 /*****************************************************************************
11612 **
11613 ** xcb_input_xi_get_focus_cookie_t xcb_input_xi_get_focus
11614 **
11615 ** @param xcb_connection_t *c
11616 ** @param xcb_input_device_id_t deviceid
11617 ** @returns xcb_input_xi_get_focus_cookie_t
11618 **
11619 *****************************************************************************/
11620
11621 xcb_input_xi_get_focus_cookie_t
11622 xcb_input_xi_get_focus (xcb_connection_t *c /**< */,
11623 xcb_input_device_id_t deviceid /**< */)
11624 {
11625 static const xcb_protocol_request_t xcb_req = {
11626 /* count */ 2,
11627 /* ext */ &xcb_input_id,
11628 /* opcode */ XCB_INPUT_XI_GET_FOCUS,
11629 /* isvoid */ 0
11630 };
11631
11632 struct iovec xcb_parts[4];
11633 xcb_input_xi_get_focus_cookie_t xcb_ret;
11634 xcb_input_xi_get_focus_request_t xcb_out;
11635
11636 xcb_out.deviceid = deviceid;
11637 memset(xcb_out.pad0, 0, 2);
11638
11639 xcb_parts[2].iov_base = (char *) &xcb_out;
11640 xcb_parts[2].iov_len = sizeof(xcb_out);
11641 xcb_parts[3].iov_base = 0;
11642 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
11643
11644 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
11645 return xcb_ret;
11646 }
11647
11648
11649 /*****************************************************************************
11650 **
11651 ** xcb_input_xi_get_focus_cookie_t xcb_input_xi_get_focus_unchecked
11652 **
11653 ** @param xcb_connection_t *c
11654 ** @param xcb_input_device_id_t deviceid
11655 ** @returns xcb_input_xi_get_focus_cookie_t
11656 **
11657 *****************************************************************************/
11658
11659 xcb_input_xi_get_focus_cookie_t
11660 xcb_input_xi_get_focus_unchecked (xcb_connection_t *c /**< */,
11661 xcb_input_device_id_t deviceid /**< */)
11662 {
11663 static const xcb_protocol_request_t xcb_req = {
11664 /* count */ 2,
11665 /* ext */ &xcb_input_id,
11666 /* opcode */ XCB_INPUT_XI_GET_FOCUS,
11667 /* isvoid */ 0
11668 };
11669
11670 struct iovec xcb_parts[4];
11671 xcb_input_xi_get_focus_cookie_t xcb_ret;
11672 xcb_input_xi_get_focus_request_t xcb_out;
11673
11674 xcb_out.deviceid = deviceid;
11675 memset(xcb_out.pad0, 0, 2);
11676
11677 xcb_parts[2].iov_base = (char *) &xcb_out;
11678 xcb_parts[2].iov_len = sizeof(xcb_out);
11679 xcb_parts[3].iov_base = 0;
11680 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
11681
11682 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
11683 return xcb_ret;
11684 }
11685
11686
11687 /*****************************************************************************
11688 **
11689 ** xcb_input_xi_get_focus_reply_t * xcb_input_xi_get_focus_reply
11690 **
11691 ** @param xcb_connection_t *c
11692 ** @param xcb_input_xi_get_focus_cookie_t cookie
11693 ** @param xcb_generic_error_t **e
11694 ** @returns xcb_input_xi_get_focus_reply_t *
11695 **
11696 *****************************************************************************/
11697
11698 xcb_input_xi_get_focus_reply_t *
11699 xcb_input_xi_get_focus_reply (xcb_connection_t *c /**< */,
11700 xcb_input_xi_get_focus_cookie_t cookie /**< */,
11701 xcb_generic_error_t **e /**< */)
11702 {
11703 return (xcb_input_xi_get_focus_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
11704 }
11705
11706 int
11707 xcb_input_xi_grab_device_sizeof (const void *_buffer /**< */)
11708 {
11709 char *xcb_tmp = (char *)_buffer;
11710 const xcb_input_xi_grab_device_request_t *_aux = (xcb_input_xi_grab_device_request_t *)_buffer;
11711 unsigned int xcb_buffer_len = 0;
11712 unsigned int xcb_block_len = 0;
11713 unsigned int xcb_pad = 0;
11714 unsigned int xcb_align_to = 0;
11715
11716
11717 xcb_block_len += sizeof(xcb_input_xi_grab_device_request_t);
11718 xcb_tmp += xcb_block_len;
11719 xcb_buffer_len += xcb_block_len;
11720 xcb_block_len = 0;
11721 /* mask */
11722 xcb_block_len += _aux->mask_len * sizeof(uint32_t);
11723 xcb_tmp += xcb_block_len;
11724 xcb_align_to = ALIGNOF(uint32_t);
11725 /* insert padding */
11726 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
11727 xcb_buffer_len += xcb_block_len + xcb_pad;
11728 if (0 != xcb_pad) {
11729 xcb_tmp += xcb_pad;
11730 xcb_pad = 0;
11731 }
11732 xcb_block_len = 0;
11733
11734 return xcb_buffer_len;
11735 }
11736
11737
11738 /*****************************************************************************
11739 **
11740 ** xcb_input_xi_grab_device_cookie_t xcb_input_xi_grab_device
11741 **
11742 ** @param xcb_connection_t *c
11743 ** @param xcb_window_t window
11744 ** @param xcb_timestamp_t time
11745 ** @param xcb_cursor_t cursor
11746 ** @param xcb_input_device_id_t deviceid
11747 ** @param uint8_t mode
11748 ** @param uint8_t paired_device_mode
11749 ** @param uint8_t owner_events
11750 ** @param uint16_t mask_len
11751 ** @param const uint32_t *mask
11752 ** @returns xcb_input_xi_grab_device_cookie_t
11753 **
11754 *****************************************************************************/
11755
11756 xcb_input_xi_grab_device_cookie_t
11757 xcb_input_xi_grab_device (xcb_connection_t *c /**< */,
11758 xcb_window_t window /**< */,
11759 xcb_timestamp_t time /**< */,
11760 xcb_cursor_t cursor /**< */,
11761 xcb_input_device_id_t deviceid /**< */,
11762 uint8_t mode /**< */,
11763 uint8_t paired_device_mode /**< */,
11764 uint8_t owner_events /**< */,
11765 uint16_t mask_len /**< */,
11766 const uint32_t *mask /**< */)
11767 {
11768 static const xcb_protocol_request_t xcb_req = {
11769 /* count */ 4,
11770 /* ext */ &xcb_input_id,
11771 /* opcode */ XCB_INPUT_XI_GRAB_DEVICE,
11772 /* isvoid */ 0
11773 };
11774
11775 struct iovec xcb_parts[6];
11776 xcb_input_xi_grab_device_cookie_t xcb_ret;
11777 xcb_input_xi_grab_device_request_t xcb_out;
11778
11779 xcb_out.window = window;
11780 xcb_out.time = time;
11781 xcb_out.cursor = cursor;
11782 xcb_out.deviceid = deviceid;
11783 xcb_out.mode = mode;
11784 xcb_out.paired_device_mode = paired_device_mode;
11785 xcb_out.owner_events = owner_events;
11786 xcb_out.pad0 = 0;
11787 xcb_out.mask_len = mask_len;
11788
11789 xcb_parts[2].iov_base = (char *) &xcb_out;
11790 xcb_parts[2].iov_len = sizeof(xcb_out);
11791 xcb_parts[3].iov_base = 0;
11792 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
11793 /* uint32_t mask */
11794 xcb_parts[4].iov_base = (char *) mask;
11795 xcb_parts[4].iov_len = mask_len * sizeof(uint32_t);
11796 xcb_parts[5].iov_base = 0;
11797 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
11798
11799 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
11800 return xcb_ret;
11801 }
11802
11803
11804 /*****************************************************************************
11805 **
11806 ** xcb_input_xi_grab_device_cookie_t xcb_input_xi_grab_device_unchecked
11807 **
11808 ** @param xcb_connection_t *c
11809 ** @param xcb_window_t window
11810 ** @param xcb_timestamp_t time
11811 ** @param xcb_cursor_t cursor
11812 ** @param xcb_input_device_id_t deviceid
11813 ** @param uint8_t mode
11814 ** @param uint8_t paired_device_mode
11815 ** @param uint8_t owner_events
11816 ** @param uint16_t mask_len
11817 ** @param const uint32_t *mask
11818 ** @returns xcb_input_xi_grab_device_cookie_t
11819 **
11820 *****************************************************************************/
11821
11822 xcb_input_xi_grab_device_cookie_t
11823 xcb_input_xi_grab_device_unchecked (xcb_connection_t *c /**< */,
11824 xcb_window_t window /**< */,
11825 xcb_timestamp_t time /**< */,
11826 xcb_cursor_t cursor /**< */,
11827 xcb_input_device_id_t deviceid /**< */,
11828 uint8_t mode /**< */,
11829 uint8_t paired_device_mode /**< */,
11830 uint8_t owner_events /**< */,
11831 uint16_t mask_len /**< */,
11832 const uint32_t *mask /**< */)
11833 {
11834 static const xcb_protocol_request_t xcb_req = {
11835 /* count */ 4,
11836 /* ext */ &xcb_input_id,
11837 /* opcode */ XCB_INPUT_XI_GRAB_DEVICE,
11838 /* isvoid */ 0
11839 };
11840
11841 struct iovec xcb_parts[6];
11842 xcb_input_xi_grab_device_cookie_t xcb_ret;
11843 xcb_input_xi_grab_device_request_t xcb_out;
11844
11845 xcb_out.window = window;
11846 xcb_out.time = time;
11847 xcb_out.cursor = cursor;
11848 xcb_out.deviceid = deviceid;
11849 xcb_out.mode = mode;
11850 xcb_out.paired_device_mode = paired_device_mode;
11851 xcb_out.owner_events = owner_events;
11852 xcb_out.pad0 = 0;
11853 xcb_out.mask_len = mask_len;
11854
11855 xcb_parts[2].iov_base = (char *) &xcb_out;
11856 xcb_parts[2].iov_len = sizeof(xcb_out);
11857 xcb_parts[3].iov_base = 0;
11858 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
11859 /* uint32_t mask */
11860 xcb_parts[4].iov_base = (char *) mask;
11861 xcb_parts[4].iov_len = mask_len * sizeof(uint32_t);
11862 xcb_parts[5].iov_base = 0;
11863 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
11864
11865 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
11866 return xcb_ret;
11867 }
11868
11869
11870 /*****************************************************************************
11871 **
11872 ** xcb_input_xi_grab_device_reply_t * xcb_input_xi_grab_device_reply
11873 **
11874 ** @param xcb_connection_t *c
11875 ** @param xcb_input_xi_grab_device_cookie_t cookie
11876 ** @param xcb_generic_error_t **e
11877 ** @returns xcb_input_xi_grab_device_reply_t *
11878 **
11879 *****************************************************************************/
11880
11881 xcb_input_xi_grab_device_reply_t *
11882 xcb_input_xi_grab_device_reply (xcb_connection_t *c /**< */,
11883 xcb_input_xi_grab_device_cookie_t cookie /**< */,
11884 xcb_generic_error_t **e /**< */)
11885 {
11886 return (xcb_input_xi_grab_device_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
11887 }
11888
11889
11890 /*****************************************************************************
11891 **
11892 ** xcb_void_cookie_t xcb_input_xi_ungrab_device_checked
11893 **
11894 ** @param xcb_connection_t *c
11895 ** @param xcb_timestamp_t time
11896 ** @param xcb_input_device_id_t deviceid
11897 ** @returns xcb_void_cookie_t
11898 **
11899 *****************************************************************************/
11900
11901 xcb_void_cookie_t
11902 xcb_input_xi_ungrab_device_checked (xcb_connection_t *c /**< */,
11903 xcb_timestamp_t time /**< */,
11904 xcb_input_device_id_t deviceid /**< */)
11905 {
11906 static const xcb_protocol_request_t xcb_req = {
11907 /* count */ 2,
11908 /* ext */ &xcb_input_id,
11909 /* opcode */ XCB_INPUT_XI_UNGRAB_DEVICE,
11910 /* isvoid */ 1
11911 };
11912
11913 struct iovec xcb_parts[4];
11914 xcb_void_cookie_t xcb_ret;
11915 xcb_input_xi_ungrab_device_request_t xcb_out;
11916
11917 xcb_out.time = time;
11918 xcb_out.deviceid = deviceid;
11919 memset(xcb_out.pad0, 0, 2);
11920
11921 xcb_parts[2].iov_base = (char *) &xcb_out;
11922 xcb_parts[2].iov_len = sizeof(xcb_out);
11923 xcb_parts[3].iov_base = 0;
11924 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
11925
11926 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
11927 return xcb_ret;
11928 }
11929
11930
11931 /*****************************************************************************
11932 **
11933 ** xcb_void_cookie_t xcb_input_xi_ungrab_device
11934 **
11935 ** @param xcb_connection_t *c
11936 ** @param xcb_timestamp_t time
11937 ** @param xcb_input_device_id_t deviceid
11938 ** @returns xcb_void_cookie_t
11939 **
11940 *****************************************************************************/
11941
11942 xcb_void_cookie_t
11943 xcb_input_xi_ungrab_device (xcb_connection_t *c /**< */,
11944 xcb_timestamp_t time /**< */,
11945 xcb_input_device_id_t deviceid /**< */)
11946 {
11947 static const xcb_protocol_request_t xcb_req = {
11948 /* count */ 2,
11949 /* ext */ &xcb_input_id,
11950 /* opcode */ XCB_INPUT_XI_UNGRAB_DEVICE,
11951 /* isvoid */ 1
11952 };
11953
11954 struct iovec xcb_parts[4];
11955 xcb_void_cookie_t xcb_ret;
11956 xcb_input_xi_ungrab_device_request_t xcb_out;
11957
11958 xcb_out.time = time;
11959 xcb_out.deviceid = deviceid;
11960 memset(xcb_out.pad0, 0, 2);
11961
11962 xcb_parts[2].iov_base = (char *) &xcb_out;
11963 xcb_parts[2].iov_len = sizeof(xcb_out);
11964 xcb_parts[3].iov_base = 0;
11965 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
11966
11967 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
11968 return xcb_ret;
11969 }
11970
11971
11972 /*****************************************************************************
11973 **
11974 ** xcb_void_cookie_t xcb_input_xi_allow_events_checked
11975 **
11976 ** @param xcb_connection_t *c
11977 ** @param xcb_timestamp_t time
11978 ** @param xcb_input_device_id_t deviceid
11979 ** @param uint8_t event_mode
11980 ** @param uint32_t touchid
11981 ** @param xcb_window_t grab_window
11982 ** @returns xcb_void_cookie_t
11983 **
11984 *****************************************************************************/
11985
11986 xcb_void_cookie_t
11987 xcb_input_xi_allow_events_checked (xcb_connection_t *c /**< */,
11988 xcb_timestamp_t time /**< */,
11989 xcb_input_device_id_t deviceid /**< */,
11990 uint8_t event_mode /**< */,
11991 uint32_t touchid /**< */,
11992 xcb_window_t grab_window /**< */)
11993 {
11994 static const xcb_protocol_request_t xcb_req = {
11995 /* count */ 2,
11996 /* ext */ &xcb_input_id,
11997 /* opcode */ XCB_INPUT_XI_ALLOW_EVENTS,
11998 /* isvoid */ 1
11999 };
12000
12001 struct iovec xcb_parts[4];
12002 xcb_void_cookie_t xcb_ret;
12003 xcb_input_xi_allow_events_request_t xcb_out;
12004
12005 xcb_out.time = time;
12006 xcb_out.deviceid = deviceid;
12007 xcb_out.event_mode = event_mode;
12008 xcb_out.pad0 = 0;
12009 xcb_out.touchid = touchid;
12010 xcb_out.grab_window = grab_window;
12011
12012 xcb_parts[2].iov_base = (char *) &xcb_out;
12013 xcb_parts[2].iov_len = sizeof(xcb_out);
12014 xcb_parts[3].iov_base = 0;
12015 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
12016
12017 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
12018 return xcb_ret;
12019 }
12020
12021
12022 /*****************************************************************************
12023 **
12024 ** xcb_void_cookie_t xcb_input_xi_allow_events
12025 **
12026 ** @param xcb_connection_t *c
12027 ** @param xcb_timestamp_t time
12028 ** @param xcb_input_device_id_t deviceid
12029 ** @param uint8_t event_mode
12030 ** @param uint32_t touchid
12031 ** @param xcb_window_t grab_window
12032 ** @returns xcb_void_cookie_t
12033 **
12034 *****************************************************************************/
12035
12036 xcb_void_cookie_t
12037 xcb_input_xi_allow_events (xcb_connection_t *c /**< */,
12038 xcb_timestamp_t time /**< */,
12039 xcb_input_device_id_t deviceid /**< */,
12040 uint8_t event_mode /**< */,
12041 uint32_t touchid /**< */,
12042 xcb_window_t grab_window /**< */)
12043 {
12044 static const xcb_protocol_request_t xcb_req = {
12045 /* count */ 2,
12046 /* ext */ &xcb_input_id,
12047 /* opcode */ XCB_INPUT_XI_ALLOW_EVENTS,
12048 /* isvoid */ 1
12049 };
12050
12051 struct iovec xcb_parts[4];
12052 xcb_void_cookie_t xcb_ret;
12053 xcb_input_xi_allow_events_request_t xcb_out;
12054
12055 xcb_out.time = time;
12056 xcb_out.deviceid = deviceid;
12057 xcb_out.event_mode = event_mode;
12058 xcb_out.pad0 = 0;
12059 xcb_out.touchid = touchid;
12060 xcb_out.grab_window = grab_window;
12061
12062 xcb_parts[2].iov_base = (char *) &xcb_out;
12063 xcb_parts[2].iov_len = sizeof(xcb_out);
12064 xcb_parts[3].iov_base = 0;
12065 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
12066
12067 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
12068 return xcb_ret;
12069 }
12070
12071
12072 /*****************************************************************************
12073 **
12074 ** void xcb_input_grab_modifier_info_next
12075 **
12076 ** @param xcb_input_grab_modifier_info_iterator_t *i
12077 ** @returns void
12078 **
12079 *****************************************************************************/
12080
12081 void
12082 xcb_input_grab_modifier_info_next (xcb_input_grab_modifier_info_iterator_t *i /**< */)
12083 {
12084 --i->rem;
12085 ++i->data;
12086 i->index += sizeof(xcb_input_grab_modifier_info_t);
12087 }
12088
12089
12090 /*****************************************************************************
12091 **
12092 ** xcb_generic_iterator_t xcb_input_grab_modifier_info_end
12093 **
12094 ** @param xcb_input_grab_modifier_info_iterator_t i
12095 ** @returns xcb_generic_iterator_t
12096 **
12097 *****************************************************************************/
12098
12099 xcb_generic_iterator_t
12100 xcb_input_grab_modifier_info_end (xcb_input_grab_modifier_info_iterator_t i /**< */)
12101 {
12102 xcb_generic_iterator_t ret;
12103 ret.data = i.data + i.rem;
12104 ret.index = i.index + ((char *) ret.data - (char *) i.data);
12105 ret.rem = 0;
12106 return ret;
12107 }
12108
12109 int
12110 xcb_input_xi_passive_grab_device_sizeof (const void *_buffer /**< */)
12111 {
12112 char *xcb_tmp = (char *)_buffer;
12113 const xcb_input_xi_passive_grab_device_request_t *_aux = (xcb_input_xi_passive_grab_device_request_t *)_buffer;
12114 unsigned int xcb_buffer_len = 0;
12115 unsigned int xcb_block_len = 0;
12116 unsigned int xcb_pad = 0;
12117 unsigned int xcb_align_to = 0;
12118
12119
12120 xcb_block_len += sizeof(xcb_input_xi_passive_grab_device_request_t);
12121 xcb_tmp += xcb_block_len;
12122 xcb_buffer_len += xcb_block_len;
12123 xcb_block_len = 0;
12124 /* mask */
12125 xcb_block_len += _aux->mask_len * sizeof(uint32_t);
12126 xcb_tmp += xcb_block_len;
12127 xcb_align_to = ALIGNOF(uint32_t);
12128 /* insert padding */
12129 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
12130 xcb_buffer_len += xcb_block_len + xcb_pad;
12131 if (0 != xcb_pad) {
12132 xcb_tmp += xcb_pad;
12133 xcb_pad = 0;
12134 }
12135 xcb_block_len = 0;
12136 /* modifiers */
12137 xcb_block_len += _aux->num_modifiers * sizeof(uint32_t);
12138 xcb_tmp += xcb_block_len;
12139 xcb_align_to = ALIGNOF(uint32_t);
12140 /* insert padding */
12141 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
12142 xcb_buffer_len += xcb_block_len + xcb_pad;
12143 if (0 != xcb_pad) {
12144 xcb_tmp += xcb_pad;
12145 xcb_pad = 0;
12146 }
12147 xcb_block_len = 0;
12148
12149 return xcb_buffer_len;
12150 }
12151
12152
12153 /*****************************************************************************
12154 **
12155 ** xcb_input_xi_passive_grab_device_cookie_t xcb_input_xi_passive_grab_device
12156 **
12157 ** @param xcb_connection_t *c
12158 ** @param xcb_timestamp_t time
12159 ** @param xcb_window_t grab_window
12160 ** @param xcb_cursor_t cursor
12161 ** @param uint32_t detail
12162 ** @param xcb_input_device_id_t deviceid
12163 ** @param uint16_t num_modifiers
12164 ** @param uint16_t mask_len
12165 ** @param uint8_t grab_type
12166 ** @param uint8_t grab_mode
12167 ** @param uint8_t paired_device_mode
12168 ** @param uint8_t owner_events
12169 ** @param const uint32_t *mask
12170 ** @param const uint32_t *modifiers
12171 ** @returns xcb_input_xi_passive_grab_device_cookie_t
12172 **
12173 *****************************************************************************/
12174
12175 xcb_input_xi_passive_grab_device_cookie_t
12176 xcb_input_xi_passive_grab_device (xcb_connection_t *c /**< */,
12177 xcb_timestamp_t time /**< */,
12178 xcb_window_t grab_window /**< */,
12179 xcb_cursor_t cursor /**< */,
12180 uint32_t detail /**< */,
12181 xcb_input_device_id_t deviceid /**< */,
12182 uint16_t num_modifiers /**< */,
12183 uint16_t mask_len /**< */,
12184 uint8_t grab_type /**< */,
12185 uint8_t grab_mode /**< */,
12186 uint8_t paired_device_mode /**< */,
12187 uint8_t owner_events /**< */,
12188 const uint32_t *mask /**< */,
12189 const uint32_t *modifiers /**< */)
12190 {
12191 static const xcb_protocol_request_t xcb_req = {
12192 /* count */ 6,
12193 /* ext */ &xcb_input_id,
12194 /* opcode */ XCB_INPUT_XI_PASSIVE_GRAB_DEVICE,
12195 /* isvoid */ 0
12196 };
12197
12198 struct iovec xcb_parts[8];
12199 xcb_input_xi_passive_grab_device_cookie_t xcb_ret;
12200 xcb_input_xi_passive_grab_device_request_t xcb_out;
12201
12202 xcb_out.time = time;
12203 xcb_out.grab_window = grab_window;
12204 xcb_out.cursor = cursor;
12205 xcb_out.detail = detail;
12206 xcb_out.deviceid = deviceid;
12207 xcb_out.num_modifiers = num_modifiers;
12208 xcb_out.mask_len = mask_len;
12209 xcb_out.grab_type = grab_type;
12210 xcb_out.grab_mode = grab_mode;
12211 xcb_out.paired_device_mode = paired_device_mode;
12212 xcb_out.owner_events = owner_events;
12213 memset(xcb_out.pad0, 0, 2);
12214
12215 xcb_parts[2].iov_base = (char *) &xcb_out;
12216 xcb_parts[2].iov_len = sizeof(xcb_out);
12217 xcb_parts[3].iov_base = 0;
12218 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
12219 /* uint32_t mask */
12220 xcb_parts[4].iov_base = (char *) mask;
12221 xcb_parts[4].iov_len = mask_len * sizeof(uint32_t);
12222 xcb_parts[5].iov_base = 0;
12223 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
12224 /* uint32_t modifiers */
12225 xcb_parts[6].iov_base = (char *) modifiers;
12226 xcb_parts[6].iov_len = num_modifiers * sizeof(uint32_t);
12227 xcb_parts[7].iov_base = 0;
12228 xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3;
12229
12230 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
12231 return xcb_ret;
12232 }
12233
12234
12235 /*****************************************************************************
12236 **
12237 ** xcb_input_xi_passive_grab_device_cookie_t xcb_input_xi_passive_grab_device_unchecked
12238 **
12239 ** @param xcb_connection_t *c
12240 ** @param xcb_timestamp_t time
12241 ** @param xcb_window_t grab_window
12242 ** @param xcb_cursor_t cursor
12243 ** @param uint32_t detail
12244 ** @param xcb_input_device_id_t deviceid
12245 ** @param uint16_t num_modifiers
12246 ** @param uint16_t mask_len
12247 ** @param uint8_t grab_type
12248 ** @param uint8_t grab_mode
12249 ** @param uint8_t paired_device_mode
12250 ** @param uint8_t owner_events
12251 ** @param const uint32_t *mask
12252 ** @param const uint32_t *modifiers
12253 ** @returns xcb_input_xi_passive_grab_device_cookie_t
12254 **
12255 *****************************************************************************/
12256
12257 xcb_input_xi_passive_grab_device_cookie_t
12258 xcb_input_xi_passive_grab_device_unchecked (xcb_connection_t *c /**< */,
12259 xcb_timestamp_t time /**< */,
12260 xcb_window_t grab_window /**< */,
12261 xcb_cursor_t cursor /**< */,
12262 uint32_t detail /**< */,
12263 xcb_input_device_id_t deviceid /**< */,
12264 uint16_t num_modifiers /**< */,
12265 uint16_t mask_len /**< */,
12266 uint8_t grab_type /**< */,
12267 uint8_t grab_mode /**< */,
12268 uint8_t paired_device_mode /**< */,
12269 uint8_t owner_events /**< */,
12270 const uint32_t *mask /**< */,
12271 const uint32_t *modifiers /**< */)
12272 {
12273 static const xcb_protocol_request_t xcb_req = {
12274 /* count */ 6,
12275 /* ext */ &xcb_input_id,
12276 /* opcode */ XCB_INPUT_XI_PASSIVE_GRAB_DEVICE,
12277 /* isvoid */ 0
12278 };
12279
12280 struct iovec xcb_parts[8];
12281 xcb_input_xi_passive_grab_device_cookie_t xcb_ret;
12282 xcb_input_xi_passive_grab_device_request_t xcb_out;
12283
12284 xcb_out.time = time;
12285 xcb_out.grab_window = grab_window;
12286 xcb_out.cursor = cursor;
12287 xcb_out.detail = detail;
12288 xcb_out.deviceid = deviceid;
12289 xcb_out.num_modifiers = num_modifiers;
12290 xcb_out.mask_len = mask_len;
12291 xcb_out.grab_type = grab_type;
12292 xcb_out.grab_mode = grab_mode;
12293 xcb_out.paired_device_mode = paired_device_mode;
12294 xcb_out.owner_events = owner_events;
12295 memset(xcb_out.pad0, 0, 2);
12296
12297 xcb_parts[2].iov_base = (char *) &xcb_out;
12298 xcb_parts[2].iov_len = sizeof(xcb_out);
12299 xcb_parts[3].iov_base = 0;
12300 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
12301 /* uint32_t mask */
12302 xcb_parts[4].iov_base = (char *) mask;
12303 xcb_parts[4].iov_len = mask_len * sizeof(uint32_t);
12304 xcb_parts[5].iov_base = 0;
12305 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
12306 /* uint32_t modifiers */
12307 xcb_parts[6].iov_base = (char *) modifiers;
12308 xcb_parts[6].iov_len = num_modifiers * sizeof(uint32_t);
12309 xcb_parts[7].iov_base = 0;
12310 xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3;
12311
12312 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
12313 return xcb_ret;
12314 }
12315
12316
12317 /*****************************************************************************
12318 **
12319 ** xcb_input_grab_modifier_info_t * xcb_input_xi_passive_grab_device_modifiers
12320 **
12321 ** @param const xcb_input_xi_passive_grab_device_reply_t *R
12322 ** @returns xcb_input_grab_modifier_info_t *
12323 **
12324 *****************************************************************************/
12325
12326 xcb_input_grab_modifier_info_t *
12327 xcb_input_xi_passive_grab_device_modifiers (const xcb_input_xi_passive_grab_device_reply_t *R /**< */)
12328 {
12329 return (xcb_input_grab_modifier_info_t *) (R + 1);
12330 }
12331
12332
12333 /*****************************************************************************
12334 **
12335 ** int xcb_input_xi_passive_grab_device_modifiers_length
12336 **
12337 ** @param const xcb_input_xi_passive_grab_device_reply_t *R
12338 ** @returns int
12339 **
12340 *****************************************************************************/
12341
12342 int
12343 xcb_input_xi_passive_grab_device_modifiers_length (const xcb_input_xi_passive_grab_device_reply_t *R /**< */)
12344 {
12345 return R->num_modifiers;
12346 }
12347
12348
12349 /*****************************************************************************
12350 **
12351 ** xcb_input_grab_modifier_info_iterator_t xcb_input_xi_passive_grab_device_modifiers_iterator
12352 **
12353 ** @param const xcb_input_xi_passive_grab_device_reply_t *R
12354 ** @returns xcb_input_grab_modifier_info_iterator_t
12355 **
12356 *****************************************************************************/
12357
12358 xcb_input_grab_modifier_info_iterator_t
12359 xcb_input_xi_passive_grab_device_modifiers_iterator (const xcb_input_xi_passive_grab_device_reply_t *R /**< */)
12360 {
12361 xcb_input_grab_modifier_info_iterator_t i;
12362 i.data = (xcb_input_grab_modifier_info_t *) (R + 1);
12363 i.rem = R->num_modifiers;
12364 i.index = (char *) i.data - (char *) R;
12365 return i;
12366 }
12367
12368
12369 /*****************************************************************************
12370 **
12371 ** xcb_input_xi_passive_grab_device_reply_t * xcb_input_xi_passive_grab_device_reply
12372 **
12373 ** @param xcb_connection_t *c
12374 ** @param xcb_input_xi_passive_grab_device_cookie_t cookie
12375 ** @param xcb_generic_error_t **e
12376 ** @returns xcb_input_xi_passive_grab_device_reply_t *
12377 **
12378 *****************************************************************************/
12379
12380 xcb_input_xi_passive_grab_device_reply_t *
12381 xcb_input_xi_passive_grab_device_reply (xcb_connection_t *c /**< */,
12382 xcb_input_xi_passive_grab_device_cookie_t cookie /**< */,
12383 xcb_generic_error_t **e /**< */)
12384 {
12385 return (xcb_input_xi_passive_grab_device_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
12386 }
12387
12388 int
12389 xcb_input_xi_passive_ungrab_device_sizeof (const void *_buffer /**< */)
12390 {
12391 char *xcb_tmp = (char *)_buffer;
12392 const xcb_input_xi_passive_ungrab_device_request_t *_aux = (xcb_input_xi_passive_ungrab_device_request_t *)_buffer;
12393 unsigned int xcb_buffer_len = 0;
12394 unsigned int xcb_block_len = 0;
12395 unsigned int xcb_pad = 0;
12396 unsigned int xcb_align_to = 0;
12397
12398
12399 xcb_block_len += sizeof(xcb_input_xi_passive_ungrab_device_request_t);
12400 xcb_tmp += xcb_block_len;
12401 xcb_buffer_len += xcb_block_len;
12402 xcb_block_len = 0;
12403 /* modifiers */
12404 xcb_block_len += _aux->num_modifiers * sizeof(uint32_t);
12405 xcb_tmp += xcb_block_len;
12406 xcb_align_to = ALIGNOF(uint32_t);
12407 /* insert padding */
12408 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
12409 xcb_buffer_len += xcb_block_len + xcb_pad;
12410 if (0 != xcb_pad) {
12411 xcb_tmp += xcb_pad;
12412 xcb_pad = 0;
12413 }
12414 xcb_block_len = 0;
12415
12416 return xcb_buffer_len;
12417 }
12418
12419
12420 /*****************************************************************************
12421 **
12422 ** xcb_void_cookie_t xcb_input_xi_passive_ungrab_device_checked
12423 **
12424 ** @param xcb_connection_t *c
12425 ** @param xcb_window_t grab_window
12426 ** @param uint32_t detail
12427 ** @param xcb_input_device_id_t deviceid
12428 ** @param uint16_t num_modifiers
12429 ** @param uint8_t grab_type
12430 ** @param const uint32_t *modifiers
12431 ** @returns xcb_void_cookie_t
12432 **
12433 *****************************************************************************/
12434
12435 xcb_void_cookie_t
12436 xcb_input_xi_passive_ungrab_device_checked (xcb_connection_t *c /**< */,
12437 xcb_window_t grab_window /**< */,
12438 uint32_t detail /**< */,
12439 xcb_input_device_id_t deviceid /**< */,
12440 uint16_t num_modifiers /**< */,
12441 uint8_t grab_type /**< */,
12442 const uint32_t *modifiers /**< */)
12443 {
12444 static const xcb_protocol_request_t xcb_req = {
12445 /* count */ 4,
12446 /* ext */ &xcb_input_id,
12447 /* opcode */ XCB_INPUT_XI_PASSIVE_UNGRAB_DEVICE,
12448 /* isvoid */ 1
12449 };
12450
12451 struct iovec xcb_parts[6];
12452 xcb_void_cookie_t xcb_ret;
12453 xcb_input_xi_passive_ungrab_device_request_t xcb_out;
12454
12455 xcb_out.grab_window = grab_window;
12456 xcb_out.detail = detail;
12457 xcb_out.deviceid = deviceid;
12458 xcb_out.num_modifiers = num_modifiers;
12459 xcb_out.grab_type = grab_type;
12460 memset(xcb_out.pad0, 0, 3);
12461
12462 xcb_parts[2].iov_base = (char *) &xcb_out;
12463 xcb_parts[2].iov_len = sizeof(xcb_out);
12464 xcb_parts[3].iov_base = 0;
12465 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
12466 /* uint32_t modifiers */
12467 xcb_parts[4].iov_base = (char *) modifiers;
12468 xcb_parts[4].iov_len = num_modifiers * sizeof(uint32_t);
12469 xcb_parts[5].iov_base = 0;
12470 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
12471
12472 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
12473 return xcb_ret;
12474 }
12475
12476
12477 /*****************************************************************************
12478 **
12479 ** xcb_void_cookie_t xcb_input_xi_passive_ungrab_device
12480 **
12481 ** @param xcb_connection_t *c
12482 ** @param xcb_window_t grab_window
12483 ** @param uint32_t detail
12484 ** @param xcb_input_device_id_t deviceid
12485 ** @param uint16_t num_modifiers
12486 ** @param uint8_t grab_type
12487 ** @param const uint32_t *modifiers
12488 ** @returns xcb_void_cookie_t
12489 **
12490 *****************************************************************************/
12491
12492 xcb_void_cookie_t
12493 xcb_input_xi_passive_ungrab_device (xcb_connection_t *c /**< */,
12494 xcb_window_t grab_window /**< */,
12495 uint32_t detail /**< */,
12496 xcb_input_device_id_t deviceid /**< */,
12497 uint16_t num_modifiers /**< */,
12498 uint8_t grab_type /**< */,
12499 const uint32_t *modifiers /**< */)
12500 {
12501 static const xcb_protocol_request_t xcb_req = {
12502 /* count */ 4,
12503 /* ext */ &xcb_input_id,
12504 /* opcode */ XCB_INPUT_XI_PASSIVE_UNGRAB_DEVICE,
12505 /* isvoid */ 1
12506 };
12507
12508 struct iovec xcb_parts[6];
12509 xcb_void_cookie_t xcb_ret;
12510 xcb_input_xi_passive_ungrab_device_request_t xcb_out;
12511
12512 xcb_out.grab_window = grab_window;
12513 xcb_out.detail = detail;
12514 xcb_out.deviceid = deviceid;
12515 xcb_out.num_modifiers = num_modifiers;
12516 xcb_out.grab_type = grab_type;
12517 memset(xcb_out.pad0, 0, 3);
12518
12519 xcb_parts[2].iov_base = (char *) &xcb_out;
12520 xcb_parts[2].iov_len = sizeof(xcb_out);
12521 xcb_parts[3].iov_base = 0;
12522 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
12523 /* uint32_t modifiers */
12524 xcb_parts[4].iov_base = (char *) modifiers;
12525 xcb_parts[4].iov_len = num_modifiers * sizeof(uint32_t);
12526 xcb_parts[5].iov_base = 0;
12527 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
12528
12529 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
12530 return xcb_ret;
12531 }
12532
12533 int
12534 xcb_input_xi_list_properties_sizeof (const void *_buffer /**< */)
12535 {
12536 char *xcb_tmp = (char *)_buffer;
12537 const xcb_input_xi_list_properties_reply_t *_aux = (xcb_input_xi_list_properties_reply_t *)_buffer;
12538 unsigned int xcb_buffer_len = 0;
12539 unsigned int xcb_block_len = 0;
12540 unsigned int xcb_pad = 0;
12541 unsigned int xcb_align_to = 0;
12542
12543
12544 xcb_block_len += sizeof(xcb_input_xi_list_properties_reply_t);
12545 xcb_tmp += xcb_block_len;
12546 xcb_buffer_len += xcb_block_len;
12547 xcb_block_len = 0;
12548 /* properties */
12549 xcb_block_len += _aux->num_properties * sizeof(xcb_atom_t);
12550 xcb_tmp += xcb_block_len;
12551 xcb_align_to = ALIGNOF(xcb_atom_t);
12552 /* insert padding */
12553 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
12554 xcb_buffer_len += xcb_block_len + xcb_pad;
12555 if (0 != xcb_pad) {
12556 xcb_tmp += xcb_pad;
12557 xcb_pad = 0;
12558 }
12559 xcb_block_len = 0;
12560
12561 return xcb_buffer_len;
12562 }
12563
12564
12565 /*****************************************************************************
12566 **
12567 ** xcb_input_xi_list_properties_cookie_t xcb_input_xi_list_properties
12568 **
12569 ** @param xcb_connection_t *c
12570 ** @param xcb_input_device_id_t deviceid
12571 ** @returns xcb_input_xi_list_properties_cookie_t
12572 **
12573 *****************************************************************************/
12574
12575 xcb_input_xi_list_properties_cookie_t
12576 xcb_input_xi_list_properties (xcb_connection_t *c /**< */,
12577 xcb_input_device_id_t deviceid /**< */)
12578 {
12579 static const xcb_protocol_request_t xcb_req = {
12580 /* count */ 2,
12581 /* ext */ &xcb_input_id,
12582 /* opcode */ XCB_INPUT_XI_LIST_PROPERTIES,
12583 /* isvoid */ 0
12584 };
12585
12586 struct iovec xcb_parts[4];
12587 xcb_input_xi_list_properties_cookie_t xcb_ret;
12588 xcb_input_xi_list_properties_request_t xcb_out;
12589
12590 xcb_out.deviceid = deviceid;
12591 memset(xcb_out.pad0, 0, 2);
12592
12593 xcb_parts[2].iov_base = (char *) &xcb_out;
12594 xcb_parts[2].iov_len = sizeof(xcb_out);
12595 xcb_parts[3].iov_base = 0;
12596 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
12597
12598 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
12599 return xcb_ret;
12600 }
12601
12602
12603 /*****************************************************************************
12604 **
12605 ** xcb_input_xi_list_properties_cookie_t xcb_input_xi_list_properties_unchecked
12606 **
12607 ** @param xcb_connection_t *c
12608 ** @param xcb_input_device_id_t deviceid
12609 ** @returns xcb_input_xi_list_properties_cookie_t
12610 **
12611 *****************************************************************************/
12612
12613 xcb_input_xi_list_properties_cookie_t
12614 xcb_input_xi_list_properties_unchecked (xcb_connection_t *c /**< */,
12615 xcb_input_device_id_t deviceid /**< */)
12616 {
12617 static const xcb_protocol_request_t xcb_req = {
12618 /* count */ 2,
12619 /* ext */ &xcb_input_id,
12620 /* opcode */ XCB_INPUT_XI_LIST_PROPERTIES,
12621 /* isvoid */ 0
12622 };
12623
12624 struct iovec xcb_parts[4];
12625 xcb_input_xi_list_properties_cookie_t xcb_ret;
12626 xcb_input_xi_list_properties_request_t xcb_out;
12627
12628 xcb_out.deviceid = deviceid;
12629 memset(xcb_out.pad0, 0, 2);
12630
12631 xcb_parts[2].iov_base = (char *) &xcb_out;
12632 xcb_parts[2].iov_len = sizeof(xcb_out);
12633 xcb_parts[3].iov_base = 0;
12634 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
12635
12636 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
12637 return xcb_ret;
12638 }
12639
12640
12641 /*****************************************************************************
12642 **
12643 ** xcb_atom_t * xcb_input_xi_list_properties_properties
12644 **
12645 ** @param const xcb_input_xi_list_properties_reply_t *R
12646 ** @returns xcb_atom_t *
12647 **
12648 *****************************************************************************/
12649
12650 xcb_atom_t *
12651 xcb_input_xi_list_properties_properties (const xcb_input_xi_list_properties_reply_t *R /**< */)
12652 {
12653 return (xcb_atom_t *) (R + 1);
12654 }
12655
12656
12657 /*****************************************************************************
12658 **
12659 ** int xcb_input_xi_list_properties_properties_length
12660 **
12661 ** @param const xcb_input_xi_list_properties_reply_t *R
12662 ** @returns int
12663 **
12664 *****************************************************************************/
12665
12666 int
12667 xcb_input_xi_list_properties_properties_length (const xcb_input_xi_list_properties_reply_t *R /**< */)
12668 {
12669 return R->num_properties;
12670 }
12671
12672
12673 /*****************************************************************************
12674 **
12675 ** xcb_generic_iterator_t xcb_input_xi_list_properties_properties_end
12676 **
12677 ** @param const xcb_input_xi_list_properties_reply_t *R
12678 ** @returns xcb_generic_iterator_t
12679 **
12680 *****************************************************************************/
12681
12682 xcb_generic_iterator_t
12683 xcb_input_xi_list_properties_properties_end (const xcb_input_xi_list_properties_reply_t *R /**< */)
12684 {
12685 xcb_generic_iterator_t i;
12686 i.data = ((xcb_atom_t *) (R + 1)) + (R->num_properties);
12687 i.rem = 0;
12688 i.index = (char *) i.data - (char *) R;
12689 return i;
12690 }
12691
12692
12693 /*****************************************************************************
12694 **
12695 ** xcb_input_xi_list_properties_reply_t * xcb_input_xi_list_properties_reply
12696 **
12697 ** @param xcb_connection_t *c
12698 ** @param xcb_input_xi_list_properties_cookie_t cookie
12699 ** @param xcb_generic_error_t **e
12700 ** @returns xcb_input_xi_list_properties_reply_t *
12701 **
12702 *****************************************************************************/
12703
12704 xcb_input_xi_list_properties_reply_t *
12705 xcb_input_xi_list_properties_reply (xcb_connection_t *c /**< */,
12706 xcb_input_xi_list_properties_cookie_t cookie /**< */,
12707 xcb_generic_error_t **e /**< */)
12708 {
12709 return (xcb_input_xi_list_properties_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
12710 }
12711
12712
12713 /*****************************************************************************
12714 **
12715 ** uint8_t * xcb_input_xi_change_property_items_data_8
12716 **
12717 ** @param const xcb_input_xi_change_property_items_t *S
12718 ** @returns uint8_t *
12719 **
12720 *****************************************************************************/
12721
12722 uint8_t *
12723 xcb_input_xi_change_property_items_data_8 (const xcb_input_xi_change_property_items_t *S /**< */)
12724 {
12725 return /* items */ S->data8;
12726 }
12727
12728
12729 /*****************************************************************************
12730 **
12731 ** int xcb_input_xi_change_property_items_data_8_length
12732 **
12733 ** @param const xcb_input_xi_change_property_items_t *R
12734 ** @returns int
12735 **
12736 *****************************************************************************/
12737
12738 int
12739 xcb_input_xi_change_property_items_data_8_length (const xcb_input_xi_change_property_request_t *R /**< */,
12740 const xcb_input_xi_change_property_items_t *S /**< */)
12741 {
12742 return R->num_items;
12743 }
12744
12745
12746 /*****************************************************************************
12747 **
12748 ** xcb_generic_iterator_t xcb_input_xi_change_property_items_data_8_end
12749 **
12750 ** @param const xcb_input_xi_change_property_items_t *R
12751 ** @returns xcb_generic_iterator_t
12752 **
12753 *****************************************************************************/
12754
12755 xcb_generic_iterator_t
12756 xcb_input_xi_change_property_items_data_8_end (const xcb_input_xi_change_property_request_t *R /**< */,
12757 const xcb_input_xi_change_property_items_t *S /**< */)
12758 {
12759 xcb_generic_iterator_t i;
12760 i.data = /* items */ S->data8 + R->num_items;
12761 i.rem = 0;
12762 i.index = (char *) i.data - (char *) S;
12763 return i;
12764 }
12765
12766
12767 /*****************************************************************************
12768 **
12769 ** uint16_t * xcb_input_xi_change_property_items_data_16
12770 **
12771 ** @param const xcb_input_xi_change_property_items_t *S
12772 ** @returns uint16_t *
12773 **
12774 *****************************************************************************/
12775
12776 uint16_t *
12777 xcb_input_xi_change_property_items_data_16 (const xcb_input_xi_change_property_items_t *S /**< */)
12778 {
12779 return /* items */ S->data16;
12780 }
12781
12782
12783 /*****************************************************************************
12784 **
12785 ** int xcb_input_xi_change_property_items_data_16_length
12786 **
12787 ** @param const xcb_input_xi_change_property_items_t *R
12788 ** @returns int
12789 **
12790 *****************************************************************************/
12791
12792 int
12793 xcb_input_xi_change_property_items_data_16_length (const xcb_input_xi_change_property_request_t *R /**< */,
12794 const xcb_input_xi_change_property_items_t *S /**< */)
12795 {
12796 return R->num_items;
12797 }
12798
12799
12800 /*****************************************************************************
12801 **
12802 ** xcb_generic_iterator_t xcb_input_xi_change_property_items_data_16_end
12803 **
12804 ** @param const xcb_input_xi_change_property_items_t *R
12805 ** @returns xcb_generic_iterator_t
12806 **
12807 *****************************************************************************/
12808
12809 xcb_generic_iterator_t
12810 xcb_input_xi_change_property_items_data_16_end (const xcb_input_xi_change_property_request_t *R /**< */,
12811 const xcb_input_xi_change_property_items_t *S /**< */)
12812 {
12813 xcb_generic_iterator_t i;
12814 i.data = /* items */ S->data16 + R->num_items;
12815 i.rem = 0;
12816 i.index = (char *) i.data - (char *) S;
12817 return i;
12818 }
12819
12820
12821 /*****************************************************************************
12822 **
12823 ** uint32_t * xcb_input_xi_change_property_items_data_32
12824 **
12825 ** @param const xcb_input_xi_change_property_items_t *S
12826 ** @returns uint32_t *
12827 **
12828 *****************************************************************************/
12829
12830 uint32_t *
12831 xcb_input_xi_change_property_items_data_32 (const xcb_input_xi_change_property_items_t *S /**< */)
12832 {
12833 return /* items */ S->data32;
12834 }
12835
12836
12837 /*****************************************************************************
12838 **
12839 ** int xcb_input_xi_change_property_items_data_32_length
12840 **
12841 ** @param const xcb_input_xi_change_property_items_t *R
12842 ** @returns int
12843 **
12844 *****************************************************************************/
12845
12846 int
12847 xcb_input_xi_change_property_items_data_32_length (const xcb_input_xi_change_property_request_t *R /**< */,
12848 const xcb_input_xi_change_property_items_t *S /**< */)
12849 {
12850 return R->num_items;
12851 }
12852
12853
12854 /*****************************************************************************
12855 **
12856 ** xcb_generic_iterator_t xcb_input_xi_change_property_items_data_32_end
12857 **
12858 ** @param const xcb_input_xi_change_property_items_t *R
12859 ** @returns xcb_generic_iterator_t
12860 **
12861 *****************************************************************************/
12862
12863 xcb_generic_iterator_t
12864 xcb_input_xi_change_property_items_data_32_end (const xcb_input_xi_change_property_request_t *R /**< */,
12865 const xcb_input_xi_change_property_items_t *S /**< */)
12866 {
12867 xcb_generic_iterator_t i;
12868 i.data = /* items */ S->data32 + R->num_items;
12869 i.rem = 0;
12870 i.index = (char *) i.data - (char *) S;
12871 return i;
12872 }
12873
12874 int
12875 xcb_input_xi_change_property_items_serialize (void **_buffer /**< */,
12876 uint32_t num_items /**< */,
12877 uint8_t format /**< */,
12878 const xcb_input_xi_change_property_items_t *_aux /**< */)
12879 {
12880 char *xcb_out = *_buffer;
12881 unsigned int xcb_buffer_len = 0;
12882 unsigned int xcb_align_to = 0;
12883
12884 unsigned int xcb_pad = 0;
12885 char xcb_pad0[3] = {0, 0, 0};
12886 struct iovec xcb_parts[7];
12887 unsigned int xcb_parts_idx = 0;
12888 unsigned int xcb_block_len = 0;
12889 unsigned int i;
12890 char *xcb_tmp;
12891
12892 if(format & XCB_INPUT_PROPERTY_FORMAT_8_BITS) {
12893 /* insert padding */
12894 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
12895 xcb_buffer_len += xcb_block_len + xcb_pad;
12896 if (0 != xcb_pad) {
12897 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
12898 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
12899 xcb_parts_idx++;
12900 xcb_pad = 0;
12901 }
12902 xcb_block_len = 0;
12903 /* data8 */
12904 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->data8;
12905 xcb_block_len += num_items * sizeof(uint8_t);
12906 xcb_parts[xcb_parts_idx].iov_len = num_items * sizeof(uint8_t);
12907 xcb_parts_idx++;
12908 xcb_align_to = ALIGNOF(uint8_t);
12909 }
12910 if(format & XCB_INPUT_PROPERTY_FORMAT_16_BITS) {
12911 /* insert padding */
12912 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
12913 xcb_buffer_len += xcb_block_len + xcb_pad;
12914 if (0 != xcb_pad) {
12915 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
12916 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
12917 xcb_parts_idx++;
12918 xcb_pad = 0;
12919 }
12920 xcb_block_len = 0;
12921 /* data16 */
12922 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->data16;
12923 xcb_block_len += num_items * sizeof(uint16_t);
12924 xcb_parts[xcb_parts_idx].iov_len = num_items * sizeof(uint16_t);
12925 xcb_parts_idx++;
12926 xcb_align_to = ALIGNOF(uint16_t);
12927 }
12928 if(format & XCB_INPUT_PROPERTY_FORMAT_32_BITS) {
12929 /* insert padding */
12930 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
12931 xcb_buffer_len += xcb_block_len + xcb_pad;
12932 if (0 != xcb_pad) {
12933 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
12934 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
12935 xcb_parts_idx++;
12936 xcb_pad = 0;
12937 }
12938 xcb_block_len = 0;
12939 /* data32 */
12940 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->data32;
12941 xcb_block_len += num_items * sizeof(uint32_t);
12942 xcb_parts[xcb_parts_idx].iov_len = num_items * sizeof(uint32_t);
12943 xcb_parts_idx++;
12944 xcb_align_to = ALIGNOF(uint32_t);
12945 }
12946 /* insert padding */
12947 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
12948 xcb_buffer_len += xcb_block_len + xcb_pad;
12949 if (0 != xcb_pad) {
12950 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
12951 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
12952 xcb_parts_idx++;
12953 xcb_pad = 0;
12954 }
12955 xcb_block_len = 0;
12956
12957 if (NULL == xcb_out) {
12958 /* allocate memory */
12959 xcb_out = malloc(xcb_buffer_len);
12960 *_buffer = xcb_out;
12961 }
12962
12963 xcb_tmp = xcb_out;
12964 for(i=0; i<xcb_parts_idx; i++) {
12965 if (0 != xcb_parts[i].iov_base && 0 != xcb_parts[i].iov_len)
12966 memcpy(xcb_tmp, xcb_parts[i].iov_base, xcb_parts[i].iov_len);
12967 if (0 != xcb_parts[i].iov_len)
12968 xcb_tmp += xcb_parts[i].iov_len;
12969 }
12970
12971 return xcb_buffer_len;
12972 }
12973
12974 int
12975 xcb_input_xi_change_property_items_unpack (const void *_buffer /**< */,
12976 uint32_t num_items /**< */,
12977 uint8_t format /**< */,
12978 xcb_input_xi_change_property_items_t *_aux /**< */)
12979 {
12980 char *xcb_tmp = (char *)_buffer;
12981 unsigned int xcb_buffer_len = 0;
12982 unsigned int xcb_block_len = 0;
12983 unsigned int xcb_pad = 0;
12984 unsigned int xcb_align_to = 0;
12985
12986
12987 if(format & XCB_INPUT_PROPERTY_FORMAT_8_BITS) {
12988 /* insert padding */
12989 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
12990 xcb_buffer_len += xcb_block_len + xcb_pad;
12991 if (0 != xcb_pad) {
12992 xcb_tmp += xcb_pad;
12993 xcb_pad = 0;
12994 }
12995 xcb_block_len = 0;
12996 /* data8 */
12997 _aux->data8 = (uint8_t *)xcb_tmp;
12998 xcb_block_len += num_items * sizeof(uint8_t);
12999 xcb_tmp += xcb_block_len;
13000 xcb_align_to = ALIGNOF(uint8_t);
13001 }
13002 if(format & XCB_INPUT_PROPERTY_FORMAT_16_BITS) {
13003 /* insert padding */
13004 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
13005 xcb_buffer_len += xcb_block_len + xcb_pad;
13006 if (0 != xcb_pad) {
13007 xcb_tmp += xcb_pad;
13008 xcb_pad = 0;
13009 }
13010 xcb_block_len = 0;
13011 /* data16 */
13012 _aux->data16 = (uint16_t *)xcb_tmp;
13013 xcb_block_len += num_items * sizeof(uint16_t);
13014 xcb_tmp += xcb_block_len;
13015 xcb_align_to = ALIGNOF(uint16_t);
13016 }
13017 if(format & XCB_INPUT_PROPERTY_FORMAT_32_BITS) {
13018 /* insert padding */
13019 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
13020 xcb_buffer_len += xcb_block_len + xcb_pad;
13021 if (0 != xcb_pad) {
13022 xcb_tmp += xcb_pad;
13023 xcb_pad = 0;
13024 }
13025 xcb_block_len = 0;
13026 /* data32 */
13027 _aux->data32 = (uint32_t *)xcb_tmp;
13028 xcb_block_len += num_items * sizeof(uint32_t);
13029 xcb_tmp += xcb_block_len;
13030 xcb_align_to = ALIGNOF(uint32_t);
13031 }
13032 /* insert padding */
13033 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
13034 xcb_buffer_len += xcb_block_len + xcb_pad;
13035 if (0 != xcb_pad) {
13036 xcb_tmp += xcb_pad;
13037 xcb_pad = 0;
13038 }
13039 xcb_block_len = 0;
13040
13041 return xcb_buffer_len;
13042 }
13043
13044 int
13045 xcb_input_xi_change_property_items_sizeof (const void *_buffer /**< */,
13046 uint32_t num_items /**< */,
13047 uint8_t format /**< */)
13048 {
13049 xcb_input_xi_change_property_items_t _aux;
13050 return xcb_input_xi_change_property_items_unpack(_buffer, num_items, format, &_aux);
13051 }
13052
13053
13054 /*****************************************************************************
13055 **
13056 ** xcb_void_cookie_t xcb_input_xi_change_property_checked
13057 **
13058 ** @param xcb_connection_t *c
13059 ** @param xcb_input_device_id_t deviceid
13060 ** @param uint8_t mode
13061 ** @param uint8_t format
13062 ** @param xcb_atom_t property
13063 ** @param xcb_atom_t type
13064 ** @param uint32_t num_items
13065 ** @param const void *items
13066 ** @returns xcb_void_cookie_t
13067 **
13068 *****************************************************************************/
13069
13070 xcb_void_cookie_t
13071 xcb_input_xi_change_property_checked (xcb_connection_t *c /**< */,
13072 xcb_input_device_id_t deviceid /**< */,
13073 uint8_t mode /**< */,
13074 uint8_t format /**< */,
13075 xcb_atom_t property /**< */,
13076 xcb_atom_t type /**< */,
13077 uint32_t num_items /**< */,
13078 const void *items /**< */)
13079 {
13080 static const xcb_protocol_request_t xcb_req = {
13081 /* count */ 3,
13082 /* ext */ &xcb_input_id,
13083 /* opcode */ XCB_INPUT_XI_CHANGE_PROPERTY,
13084 /* isvoid */ 1
13085 };
13086
13087 struct iovec xcb_parts[5];
13088 xcb_void_cookie_t xcb_ret;
13089 xcb_input_xi_change_property_request_t xcb_out;
13090
13091 xcb_out.deviceid = deviceid;
13092 xcb_out.mode = mode;
13093 xcb_out.format = format;
13094 xcb_out.property = property;
13095 xcb_out.type = type;
13096 xcb_out.num_items = num_items;
13097
13098 xcb_parts[2].iov_base = (char *) &xcb_out;
13099 xcb_parts[2].iov_len = sizeof(xcb_out);
13100 xcb_parts[3].iov_base = 0;
13101 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
13102 /* xcb_input_xi_change_property_items_t items */
13103 xcb_parts[4].iov_base = (char *) items;
13104 xcb_parts[4].iov_len =
13105 xcb_input_xi_change_property_items_sizeof (items, num_items, format);
13106
13107 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
13108 return xcb_ret;
13109 }
13110
13111
13112 /*****************************************************************************
13113 **
13114 ** xcb_void_cookie_t xcb_input_xi_change_property
13115 **
13116 ** @param xcb_connection_t *c
13117 ** @param xcb_input_device_id_t deviceid
13118 ** @param uint8_t mode
13119 ** @param uint8_t format
13120 ** @param xcb_atom_t property
13121 ** @param xcb_atom_t type
13122 ** @param uint32_t num_items
13123 ** @param const void *items
13124 ** @returns xcb_void_cookie_t
13125 **
13126 *****************************************************************************/
13127
13128 xcb_void_cookie_t
13129 xcb_input_xi_change_property (xcb_connection_t *c /**< */,
13130 xcb_input_device_id_t deviceid /**< */,
13131 uint8_t mode /**< */,
13132 uint8_t format /**< */,
13133 xcb_atom_t property /**< */,
13134 xcb_atom_t type /**< */,
13135 uint32_t num_items /**< */,
13136 const void *items /**< */)
13137 {
13138 static const xcb_protocol_request_t xcb_req = {
13139 /* count */ 3,
13140 /* ext */ &xcb_input_id,
13141 /* opcode */ XCB_INPUT_XI_CHANGE_PROPERTY,
13142 /* isvoid */ 1
13143 };
13144
13145 struct iovec xcb_parts[5];
13146 xcb_void_cookie_t xcb_ret;
13147 xcb_input_xi_change_property_request_t xcb_out;
13148
13149 xcb_out.deviceid = deviceid;
13150 xcb_out.mode = mode;
13151 xcb_out.format = format;
13152 xcb_out.property = property;
13153 xcb_out.type = type;
13154 xcb_out.num_items = num_items;
13155
13156 xcb_parts[2].iov_base = (char *) &xcb_out;
13157 xcb_parts[2].iov_len = sizeof(xcb_out);
13158 xcb_parts[3].iov_base = 0;
13159 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
13160 /* xcb_input_xi_change_property_items_t items */
13161 xcb_parts[4].iov_base = (char *) items;
13162 xcb_parts[4].iov_len =
13163 xcb_input_xi_change_property_items_sizeof (items, num_items, format);
13164
13165 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
13166 return xcb_ret;
13167 }
13168
13169
13170 /*****************************************************************************
13171 **
13172 ** xcb_void_cookie_t xcb_input_xi_change_property_aux_checked
13173 **
13174 ** @param xcb_connection_t *c
13175 ** @param xcb_input_device_id_t deviceid
13176 ** @param uint8_t mode
13177 ** @param uint8_t format
13178 ** @param xcb_atom_t property
13179 ** @param xcb_atom_t type
13180 ** @param uint32_t num_items
13181 ** @param const xcb_input_xi_change_property_items_t *items
13182 ** @returns xcb_void_cookie_t
13183 **
13184 *****************************************************************************/
13185
13186 xcb_void_cookie_t
13187 xcb_input_xi_change_property_aux_checked (xcb_connection_t *c /**< */,
13188 xcb_input_device_id_t deviceid /**< */,
13189 uint8_t mode /**< */,
13190 uint8_t format /**< */,
13191 xcb_atom_t property /**< */,
13192 xcb_atom_t type /**< */,
13193 uint32_t num_items /**< */,
13194 const xcb_input_xi_change_property_items_t *items /**< */)
13195 {
13196 static const xcb_protocol_request_t xcb_req = {
13197 /* count */ 3,
13198 /* ext */ &xcb_input_id,
13199 /* opcode */ XCB_INPUT_XI_CHANGE_PROPERTY,
13200 /* isvoid */ 1
13201 };
13202
13203 struct iovec xcb_parts[5];
13204 xcb_void_cookie_t xcb_ret;
13205 xcb_input_xi_change_property_request_t xcb_out;
13206 void *xcb_aux0 = 0;
13207
13208 xcb_out.deviceid = deviceid;
13209 xcb_out.mode = mode;
13210 xcb_out.format = format;
13211 xcb_out.property = property;
13212 xcb_out.type = type;
13213 xcb_out.num_items = num_items;
13214
13215 xcb_parts[2].iov_base = (char *) &xcb_out;
13216 xcb_parts[2].iov_len = sizeof(xcb_out);
13217 xcb_parts[3].iov_base = 0;
13218 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
13219 /* xcb_input_xi_change_property_items_t items */
13220 xcb_parts[4].iov_len =
13221 xcb_input_xi_change_property_items_serialize (&xcb_aux0, num_items, format, items);
13222 xcb_parts[4].iov_base = xcb_aux0;
13223
13224 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
13225 free(xcb_aux0);
13226 return xcb_ret;
13227 }
13228
13229
13230 /*****************************************************************************
13231 **
13232 ** xcb_void_cookie_t xcb_input_xi_change_property_aux
13233 **
13234 ** @param xcb_connection_t *c
13235 ** @param xcb_input_device_id_t deviceid
13236 ** @param uint8_t mode
13237 ** @param uint8_t format
13238 ** @param xcb_atom_t property
13239 ** @param xcb_atom_t type
13240 ** @param uint32_t num_items
13241 ** @param const xcb_input_xi_change_property_items_t *items
13242 ** @returns xcb_void_cookie_t
13243 **
13244 *****************************************************************************/
13245
13246 xcb_void_cookie_t
13247 xcb_input_xi_change_property_aux (xcb_connection_t *c /**< */,
13248 xcb_input_device_id_t deviceid /**< */,
13249 uint8_t mode /**< */,
13250 uint8_t format /**< */,
13251 xcb_atom_t property /**< */,
13252 xcb_atom_t type /**< */,
13253 uint32_t num_items /**< */,
13254 const xcb_input_xi_change_property_items_t *items /**< */)
13255 {
13256 static const xcb_protocol_request_t xcb_req = {
13257 /* count */ 3,
13258 /* ext */ &xcb_input_id,
13259 /* opcode */ XCB_INPUT_XI_CHANGE_PROPERTY,
13260 /* isvoid */ 1
13261 };
13262
13263 struct iovec xcb_parts[5];
13264 xcb_void_cookie_t xcb_ret;
13265 xcb_input_xi_change_property_request_t xcb_out;
13266 void *xcb_aux0 = 0;
13267
13268 xcb_out.deviceid = deviceid;
13269 xcb_out.mode = mode;
13270 xcb_out.format = format;
13271 xcb_out.property = property;
13272 xcb_out.type = type;
13273 xcb_out.num_items = num_items;
13274
13275 xcb_parts[2].iov_base = (char *) &xcb_out;
13276 xcb_parts[2].iov_len = sizeof(xcb_out);
13277 xcb_parts[3].iov_base = 0;
13278 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
13279 /* xcb_input_xi_change_property_items_t items */
13280 xcb_parts[4].iov_len =
13281 xcb_input_xi_change_property_items_serialize (&xcb_aux0, num_items, format, items);
13282 xcb_parts[4].iov_base = xcb_aux0;
13283
13284 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
13285 free(xcb_aux0);
13286 return xcb_ret;
13287 }
13288
13289
13290 /*****************************************************************************
13291 **
13292 ** xcb_void_cookie_t xcb_input_xi_delete_property_checked
13293 **
13294 ** @param xcb_connection_t *c
13295 ** @param xcb_input_device_id_t deviceid
13296 ** @param xcb_atom_t property
13297 ** @returns xcb_void_cookie_t
13298 **
13299 *****************************************************************************/
13300
13301 xcb_void_cookie_t
13302 xcb_input_xi_delete_property_checked (xcb_connection_t *c /**< */,
13303 xcb_input_device_id_t deviceid /**< */,
13304 xcb_atom_t property /**< */)
13305 {
13306 static const xcb_protocol_request_t xcb_req = {
13307 /* count */ 2,
13308 /* ext */ &xcb_input_id,
13309 /* opcode */ XCB_INPUT_XI_DELETE_PROPERTY,
13310 /* isvoid */ 1
13311 };
13312
13313 struct iovec xcb_parts[4];
13314 xcb_void_cookie_t xcb_ret;
13315 xcb_input_xi_delete_property_request_t xcb_out;
13316
13317 xcb_out.deviceid = deviceid;
13318 memset(xcb_out.pad0, 0, 2);
13319 xcb_out.property = property;
13320
13321 xcb_parts[2].iov_base = (char *) &xcb_out;
13322 xcb_parts[2].iov_len = sizeof(xcb_out);
13323 xcb_parts[3].iov_base = 0;
13324 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
13325
13326 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
13327 return xcb_ret;
13328 }
13329
13330
13331 /*****************************************************************************
13332 **
13333 ** xcb_void_cookie_t xcb_input_xi_delete_property
13334 **
13335 ** @param xcb_connection_t *c
13336 ** @param xcb_input_device_id_t deviceid
13337 ** @param xcb_atom_t property
13338 ** @returns xcb_void_cookie_t
13339 **
13340 *****************************************************************************/
13341
13342 xcb_void_cookie_t
13343 xcb_input_xi_delete_property (xcb_connection_t *c /**< */,
13344 xcb_input_device_id_t deviceid /**< */,
13345 xcb_atom_t property /**< */)
13346 {
13347 static const xcb_protocol_request_t xcb_req = {
13348 /* count */ 2,
13349 /* ext */ &xcb_input_id,
13350 /* opcode */ XCB_INPUT_XI_DELETE_PROPERTY,
13351 /* isvoid */ 1
13352 };
13353
13354 struct iovec xcb_parts[4];
13355 xcb_void_cookie_t xcb_ret;
13356 xcb_input_xi_delete_property_request_t xcb_out;
13357
13358 xcb_out.deviceid = deviceid;
13359 memset(xcb_out.pad0, 0, 2);
13360 xcb_out.property = property;
13361
13362 xcb_parts[2].iov_base = (char *) &xcb_out;
13363 xcb_parts[2].iov_len = sizeof(xcb_out);
13364 xcb_parts[3].iov_base = 0;
13365 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
13366
13367 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
13368 return xcb_ret;
13369 }
13370
13371
13372 /*****************************************************************************
13373 **
13374 ** uint8_t * xcb_input_xi_get_property_items_data_8
13375 **
13376 ** @param const xcb_input_xi_get_property_items_t *S
13377 ** @returns uint8_t *
13378 **
13379 *****************************************************************************/
13380
13381 uint8_t *
13382 xcb_input_xi_get_property_items_data_8 (const xcb_input_xi_get_property_items_t *S /**< */)
13383 {
13384 return /* items */ S->data8;
13385 }
13386
13387
13388 /*****************************************************************************
13389 **
13390 ** int xcb_input_xi_get_property_items_data_8_length
13391 **
13392 ** @param const xcb_input_xi_get_property_items_t *R
13393 ** @returns int
13394 **
13395 *****************************************************************************/
13396
13397 int
13398 xcb_input_xi_get_property_items_data_8_length (const xcb_input_xi_get_property_reply_t *R /**< */,
13399 const xcb_input_xi_get_property_items_t *S /**< */)
13400 {
13401 return R->num_items;
13402 }
13403
13404
13405 /*****************************************************************************
13406 **
13407 ** xcb_generic_iterator_t xcb_input_xi_get_property_items_data_8_end
13408 **
13409 ** @param const xcb_input_xi_get_property_items_t *R
13410 ** @returns xcb_generic_iterator_t
13411 **
13412 *****************************************************************************/
13413
13414 xcb_generic_iterator_t
13415 xcb_input_xi_get_property_items_data_8_end (const xcb_input_xi_get_property_reply_t *R /**< */,
13416 const xcb_input_xi_get_property_items_t *S /**< */)
13417 {
13418 xcb_generic_iterator_t i;
13419 i.data = /* items */ S->data8 + R->num_items;
13420 i.rem = 0;
13421 i.index = (char *) i.data - (char *) S;
13422 return i;
13423 }
13424
13425
13426 /*****************************************************************************
13427 **
13428 ** uint16_t * xcb_input_xi_get_property_items_data_16
13429 **
13430 ** @param const xcb_input_xi_get_property_items_t *S
13431 ** @returns uint16_t *
13432 **
13433 *****************************************************************************/
13434
13435 uint16_t *
13436 xcb_input_xi_get_property_items_data_16 (const xcb_input_xi_get_property_items_t *S /**< */)
13437 {
13438 return /* items */ S->data16;
13439 }
13440
13441
13442 /*****************************************************************************
13443 **
13444 ** int xcb_input_xi_get_property_items_data_16_length
13445 **
13446 ** @param const xcb_input_xi_get_property_items_t *R
13447 ** @returns int
13448 **
13449 *****************************************************************************/
13450
13451 int
13452 xcb_input_xi_get_property_items_data_16_length (const xcb_input_xi_get_property_reply_t *R /**< */,
13453 const xcb_input_xi_get_property_items_t *S /**< */)
13454 {
13455 return R->num_items;
13456 }
13457
13458
13459 /*****************************************************************************
13460 **
13461 ** xcb_generic_iterator_t xcb_input_xi_get_property_items_data_16_end
13462 **
13463 ** @param const xcb_input_xi_get_property_items_t *R
13464 ** @returns xcb_generic_iterator_t
13465 **
13466 *****************************************************************************/
13467
13468 xcb_generic_iterator_t
13469 xcb_input_xi_get_property_items_data_16_end (const xcb_input_xi_get_property_reply_t *R /**< */,
13470 const xcb_input_xi_get_property_items_t *S /**< */)
13471 {
13472 xcb_generic_iterator_t i;
13473 i.data = /* items */ S->data16 + R->num_items;
13474 i.rem = 0;
13475 i.index = (char *) i.data - (char *) S;
13476 return i;
13477 }
13478
13479
13480 /*****************************************************************************
13481 **
13482 ** uint32_t * xcb_input_xi_get_property_items_data_32
13483 **
13484 ** @param const xcb_input_xi_get_property_items_t *S
13485 ** @returns uint32_t *
13486 **
13487 *****************************************************************************/
13488
13489 uint32_t *
13490 xcb_input_xi_get_property_items_data_32 (const xcb_input_xi_get_property_items_t *S /**< */)
13491 {
13492 return /* items */ S->data32;
13493 }
13494
13495
13496 /*****************************************************************************
13497 **
13498 ** int xcb_input_xi_get_property_items_data_32_length
13499 **
13500 ** @param const xcb_input_xi_get_property_items_t *R
13501 ** @returns int
13502 **
13503 *****************************************************************************/
13504
13505 int
13506 xcb_input_xi_get_property_items_data_32_length (const xcb_input_xi_get_property_reply_t *R /**< */,
13507 const xcb_input_xi_get_property_items_t *S /**< */)
13508 {
13509 return R->num_items;
13510 }
13511
13512
13513 /*****************************************************************************
13514 **
13515 ** xcb_generic_iterator_t xcb_input_xi_get_property_items_data_32_end
13516 **
13517 ** @param const xcb_input_xi_get_property_items_t *R
13518 ** @returns xcb_generic_iterator_t
13519 **
13520 *****************************************************************************/
13521
13522 xcb_generic_iterator_t
13523 xcb_input_xi_get_property_items_data_32_end (const xcb_input_xi_get_property_reply_t *R /**< */,
13524 const xcb_input_xi_get_property_items_t *S /**< */)
13525 {
13526 xcb_generic_iterator_t i;
13527 i.data = /* items */ S->data32 + R->num_items;
13528 i.rem = 0;
13529 i.index = (char *) i.data - (char *) S;
13530 return i;
13531 }
13532
13533 int
13534 xcb_input_xi_get_property_items_serialize (void **_buffer /**< */,
13535 uint32_t num_items /**< */,
13536 uint8_t format /**< */,
13537 const xcb_input_xi_get_property_items_t *_aux /**< */)
13538 {
13539 char *xcb_out = *_buffer;
13540 unsigned int xcb_buffer_len = 0;
13541 unsigned int xcb_align_to = 0;
13542
13543 unsigned int xcb_pad = 0;
13544 char xcb_pad0[3] = {0, 0, 0};
13545 struct iovec xcb_parts[7];
13546 unsigned int xcb_parts_idx = 0;
13547 unsigned int xcb_block_len = 0;
13548 unsigned int i;
13549 char *xcb_tmp;
13550
13551 if(format & XCB_INPUT_PROPERTY_FORMAT_8_BITS) {
13552 /* insert padding */
13553 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
13554 xcb_buffer_len += xcb_block_len + xcb_pad;
13555 if (0 != xcb_pad) {
13556 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
13557 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
13558 xcb_parts_idx++;
13559 xcb_pad = 0;
13560 }
13561 xcb_block_len = 0;
13562 /* data8 */
13563 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->data8;
13564 xcb_block_len += num_items * sizeof(uint8_t);
13565 xcb_parts[xcb_parts_idx].iov_len = num_items * sizeof(uint8_t);
13566 xcb_parts_idx++;
13567 xcb_align_to = ALIGNOF(uint8_t);
13568 }
13569 if(format & XCB_INPUT_PROPERTY_FORMAT_16_BITS) {
13570 /* insert padding */
13571 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
13572 xcb_buffer_len += xcb_block_len + xcb_pad;
13573 if (0 != xcb_pad) {
13574 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
13575 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
13576 xcb_parts_idx++;
13577 xcb_pad = 0;
13578 }
13579 xcb_block_len = 0;
13580 /* data16 */
13581 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->data16;
13582 xcb_block_len += num_items * sizeof(uint16_t);
13583 xcb_parts[xcb_parts_idx].iov_len = num_items * sizeof(uint16_t);
13584 xcb_parts_idx++;
13585 xcb_align_to = ALIGNOF(uint16_t);
13586 }
13587 if(format & XCB_INPUT_PROPERTY_FORMAT_32_BITS) {
13588 /* insert padding */
13589 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
13590 xcb_buffer_len += xcb_block_len + xcb_pad;
13591 if (0 != xcb_pad) {
13592 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
13593 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
13594 xcb_parts_idx++;
13595 xcb_pad = 0;
13596 }
13597 xcb_block_len = 0;
13598 /* data32 */
13599 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->data32;
13600 xcb_block_len += num_items * sizeof(uint32_t);
13601 xcb_parts[xcb_parts_idx].iov_len = num_items * sizeof(uint32_t);
13602 xcb_parts_idx++;
13603 xcb_align_to = ALIGNOF(uint32_t);
13604 }
13605 /* insert padding */
13606 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
13607 xcb_buffer_len += xcb_block_len + xcb_pad;
13608 if (0 != xcb_pad) {
13609 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
13610 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
13611 xcb_parts_idx++;
13612 xcb_pad = 0;
13613 }
13614 xcb_block_len = 0;
13615
13616 if (NULL == xcb_out) {
13617 /* allocate memory */
13618 xcb_out = malloc(xcb_buffer_len);
13619 *_buffer = xcb_out;
13620 }
13621
13622 xcb_tmp = xcb_out;
13623 for(i=0; i<xcb_parts_idx; i++) {
13624 if (0 != xcb_parts[i].iov_base && 0 != xcb_parts[i].iov_len)
13625 memcpy(xcb_tmp, xcb_parts[i].iov_base, xcb_parts[i].iov_len);
13626 if (0 != xcb_parts[i].iov_len)
13627 xcb_tmp += xcb_parts[i].iov_len;
13628 }
13629
13630 return xcb_buffer_len;
13631 }
13632
13633 int
13634 xcb_input_xi_get_property_items_unpack (const void *_buffer /**< */,
13635 uint32_t num_items /**< */,
13636 uint8_t format /**< */,
13637 xcb_input_xi_get_property_items_t *_aux /**< */)
13638 {
13639 char *xcb_tmp = (char *)_buffer;
13640 unsigned int xcb_buffer_len = 0;
13641 unsigned int xcb_block_len = 0;
13642 unsigned int xcb_pad = 0;
13643 unsigned int xcb_align_to = 0;
13644
13645
13646 if(format & XCB_INPUT_PROPERTY_FORMAT_8_BITS) {
13647 /* insert padding */
13648 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
13649 xcb_buffer_len += xcb_block_len + xcb_pad;
13650 if (0 != xcb_pad) {
13651 xcb_tmp += xcb_pad;
13652 xcb_pad = 0;
13653 }
13654 xcb_block_len = 0;
13655 /* data8 */
13656 _aux->data8 = (uint8_t *)xcb_tmp;
13657 xcb_block_len += num_items * sizeof(uint8_t);
13658 xcb_tmp += xcb_block_len;
13659 xcb_align_to = ALIGNOF(uint8_t);
13660 }
13661 if(format & XCB_INPUT_PROPERTY_FORMAT_16_BITS) {
13662 /* insert padding */
13663 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
13664 xcb_buffer_len += xcb_block_len + xcb_pad;
13665 if (0 != xcb_pad) {
13666 xcb_tmp += xcb_pad;
13667 xcb_pad = 0;
13668 }
13669 xcb_block_len = 0;
13670 /* data16 */
13671 _aux->data16 = (uint16_t *)xcb_tmp;
13672 xcb_block_len += num_items * sizeof(uint16_t);
13673 xcb_tmp += xcb_block_len;
13674 xcb_align_to = ALIGNOF(uint16_t);
13675 }
13676 if(format & XCB_INPUT_PROPERTY_FORMAT_32_BITS) {
13677 /* insert padding */
13678 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
13679 xcb_buffer_len += xcb_block_len + xcb_pad;
13680 if (0 != xcb_pad) {
13681 xcb_tmp += xcb_pad;
13682 xcb_pad = 0;
13683 }
13684 xcb_block_len = 0;
13685 /* data32 */
13686 _aux->data32 = (uint32_t *)xcb_tmp;
13687 xcb_block_len += num_items * sizeof(uint32_t);
13688 xcb_tmp += xcb_block_len;
13689 xcb_align_to = ALIGNOF(uint32_t);
13690 }
13691 /* insert padding */
13692 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
13693 xcb_buffer_len += xcb_block_len + xcb_pad;
13694 if (0 != xcb_pad) {
13695 xcb_tmp += xcb_pad;
13696 xcb_pad = 0;
13697 }
13698 xcb_block_len = 0;
13699
13700 return xcb_buffer_len;
13701 }
13702
13703 int
13704 xcb_input_xi_get_property_items_sizeof (const void *_buffer /**< */,
13705 uint32_t num_items /**< */,
13706 uint8_t format /**< */)
13707 {
13708 xcb_input_xi_get_property_items_t _aux;
13709 return xcb_input_xi_get_property_items_unpack(_buffer, num_items, format, &_aux);
13710 }
13711
13712
13713 /*****************************************************************************
13714 **
13715 ** xcb_input_xi_get_property_cookie_t xcb_input_xi_get_property
13716 **
13717 ** @param xcb_connection_t *c
13718 ** @param xcb_input_device_id_t deviceid
13719 ** @param uint8_t _delete
13720 ** @param xcb_atom_t property
13721 ** @param xcb_atom_t type
13722 ** @param uint32_t offset
13723 ** @param uint32_t len
13724 ** @returns xcb_input_xi_get_property_cookie_t
13725 **
13726 *****************************************************************************/
13727
13728 xcb_input_xi_get_property_cookie_t
13729 xcb_input_xi_get_property (xcb_connection_t *c /**< */,
13730 xcb_input_device_id_t deviceid /**< */,
13731 uint8_t _delete /**< */,
13732 xcb_atom_t property /**< */,
13733 xcb_atom_t type /**< */,
13734 uint32_t offset /**< */,
13735 uint32_t len /**< */)
13736 {
13737 static const xcb_protocol_request_t xcb_req = {
13738 /* count */ 2,
13739 /* ext */ &xcb_input_id,
13740 /* opcode */ XCB_INPUT_XI_GET_PROPERTY,
13741 /* isvoid */ 0
13742 };
13743
13744 struct iovec xcb_parts[4];
13745 xcb_input_xi_get_property_cookie_t xcb_ret;
13746 xcb_input_xi_get_property_request_t xcb_out;
13747
13748 xcb_out.deviceid = deviceid;
13749 xcb_out._delete = _delete;
13750 xcb_out.pad0 = 0;
13751 xcb_out.property = property;
13752 xcb_out.type = type;
13753 xcb_out.offset = offset;
13754 xcb_out.len = len;
13755
13756 xcb_parts[2].iov_base = (char *) &xcb_out;
13757 xcb_parts[2].iov_len = sizeof(xcb_out);
13758 xcb_parts[3].iov_base = 0;
13759 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
13760
13761 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
13762 return xcb_ret;
13763 }
13764
13765
13766 /*****************************************************************************
13767 **
13768 ** xcb_input_xi_get_property_cookie_t xcb_input_xi_get_property_unchecked
13769 **
13770 ** @param xcb_connection_t *c
13771 ** @param xcb_input_device_id_t deviceid
13772 ** @param uint8_t _delete
13773 ** @param xcb_atom_t property
13774 ** @param xcb_atom_t type
13775 ** @param uint32_t offset
13776 ** @param uint32_t len
13777 ** @returns xcb_input_xi_get_property_cookie_t
13778 **
13779 *****************************************************************************/
13780
13781 xcb_input_xi_get_property_cookie_t
13782 xcb_input_xi_get_property_unchecked (xcb_connection_t *c /**< */,
13783 xcb_input_device_id_t deviceid /**< */,
13784 uint8_t _delete /**< */,
13785 xcb_atom_t property /**< */,
13786 xcb_atom_t type /**< */,
13787 uint32_t offset /**< */,
13788 uint32_t len /**< */)
13789 {
13790 static const xcb_protocol_request_t xcb_req = {
13791 /* count */ 2,
13792 /* ext */ &xcb_input_id,
13793 /* opcode */ XCB_INPUT_XI_GET_PROPERTY,
13794 /* isvoid */ 0
13795 };
13796
13797 struct iovec xcb_parts[4];
13798 xcb_input_xi_get_property_cookie_t xcb_ret;
13799 xcb_input_xi_get_property_request_t xcb_out;
13800
13801 xcb_out.deviceid = deviceid;
13802 xcb_out._delete = _delete;
13803 xcb_out.pad0 = 0;
13804 xcb_out.property = property;
13805 xcb_out.type = type;
13806 xcb_out.offset = offset;
13807 xcb_out.len = len;
13808
13809 xcb_parts[2].iov_base = (char *) &xcb_out;
13810 xcb_parts[2].iov_len = sizeof(xcb_out);
13811 xcb_parts[3].iov_base = 0;
13812 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
13813
13814 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
13815 return xcb_ret;
13816 }
13817
13818
13819 /*****************************************************************************
13820 **
13821 ** xcb_input_xi_get_property_items_t * xcb_input_xi_get_property_items
13822 **
13823 ** @param const xcb_input_xi_get_property_reply_t *R
13824 ** @returns xcb_input_xi_get_property_items_t *
13825 **
13826 *****************************************************************************/
13827
13828 void *
13829 xcb_input_xi_get_property_items (const xcb_input_xi_get_property_reply_t *R /**< */)
13830 {
13831 return (void *) (R + 1);
13832 }
13833
13834
13835 /*****************************************************************************
13836 **
13837 ** xcb_input_xi_get_property_reply_t * xcb_input_xi_get_property_reply
13838 **
13839 ** @param xcb_connection_t *c
13840 ** @param xcb_input_xi_get_property_cookie_t cookie
13841 ** @param xcb_generic_error_t **e
13842 ** @returns xcb_input_xi_get_property_reply_t *
13843 **
13844 *****************************************************************************/
13845
13846 xcb_input_xi_get_property_reply_t *
13847 xcb_input_xi_get_property_reply (xcb_connection_t *c /**< */,
13848 xcb_input_xi_get_property_cookie_t cookie /**< */,
13849 xcb_generic_error_t **e /**< */)
13850 {
13851 return (xcb_input_xi_get_property_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
13852 }
13853
13854 int
13855 xcb_input_xi_get_selected_events_sizeof (const void *_buffer /**< */)
13856 {
13857 char *xcb_tmp = (char *)_buffer;
13858 const xcb_input_xi_get_selected_events_reply_t *_aux = (xcb_input_xi_get_selected_events_reply_t *)_buffer;
13859 unsigned int xcb_buffer_len = 0;
13860 unsigned int xcb_block_len = 0;
13861 unsigned int xcb_pad = 0;
13862 unsigned int xcb_align_to = 0;
13863
13864 unsigned int i;
13865 unsigned int xcb_tmp_len;
13866
13867 xcb_block_len += sizeof(xcb_input_xi_get_selected_events_reply_t);
13868 xcb_tmp += xcb_block_len;
13869 xcb_buffer_len += xcb_block_len;
13870 xcb_block_len = 0;
13871 /* masks */
13872 for(i=0; i<_aux->num_masks; i++) {
13873 xcb_tmp_len = xcb_input_event_mask_sizeof(xcb_tmp);
13874 xcb_block_len += xcb_tmp_len;
13875 xcb_tmp += xcb_tmp_len;
13876 }
13877 xcb_align_to = ALIGNOF(xcb_input_event_mask_t);
13878 /* insert padding */
13879 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
13880 xcb_buffer_len += xcb_block_len + xcb_pad;
13881 if (0 != xcb_pad) {
13882 xcb_tmp += xcb_pad;
13883 xcb_pad = 0;
13884 }
13885 xcb_block_len = 0;
13886
13887 return xcb_buffer_len;
13888 }
13889
13890
13891 /*****************************************************************************
13892 **
13893 ** xcb_input_xi_get_selected_events_cookie_t xcb_input_xi_get_selected_events
13894 **
13895 ** @param xcb_connection_t *c
13896 ** @param xcb_window_t window
13897 ** @returns xcb_input_xi_get_selected_events_cookie_t
13898 **
13899 *****************************************************************************/
13900
13901 xcb_input_xi_get_selected_events_cookie_t
13902 xcb_input_xi_get_selected_events (xcb_connection_t *c /**< */,
13903 xcb_window_t window /**< */)
13904 {
13905 static const xcb_protocol_request_t xcb_req = {
13906 /* count */ 2,
13907 /* ext */ &xcb_input_id,
13908 /* opcode */ XCB_INPUT_XI_GET_SELECTED_EVENTS,
13909 /* isvoid */ 0
13910 };
13911
13912 struct iovec xcb_parts[4];
13913 xcb_input_xi_get_selected_events_cookie_t xcb_ret;
13914 xcb_input_xi_get_selected_events_request_t xcb_out;
13915
13916 xcb_out.window = window;
13917
13918 xcb_parts[2].iov_base = (char *) &xcb_out;
13919 xcb_parts[2].iov_len = sizeof(xcb_out);
13920 xcb_parts[3].iov_base = 0;
13921 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
13922
13923 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
13924 return xcb_ret;
13925 }
13926
13927
13928 /*****************************************************************************
13929 **
13930 ** xcb_input_xi_get_selected_events_cookie_t xcb_input_xi_get_selected_events_unchecked
13931 **
13932 ** @param xcb_connection_t *c
13933 ** @param xcb_window_t window
13934 ** @returns xcb_input_xi_get_selected_events_cookie_t
13935 **
13936 *****************************************************************************/
13937
13938 xcb_input_xi_get_selected_events_cookie_t
13939 xcb_input_xi_get_selected_events_unchecked (xcb_connection_t *c /**< */,
13940 xcb_window_t window /**< */)
13941 {
13942 static const xcb_protocol_request_t xcb_req = {
13943 /* count */ 2,
13944 /* ext */ &xcb_input_id,
13945 /* opcode */ XCB_INPUT_XI_GET_SELECTED_EVENTS,
13946 /* isvoid */ 0
13947 };
13948
13949 struct iovec xcb_parts[4];
13950 xcb_input_xi_get_selected_events_cookie_t xcb_ret;
13951 xcb_input_xi_get_selected_events_request_t xcb_out;
13952
13953 xcb_out.window = window;
13954
13955 xcb_parts[2].iov_base = (char *) &xcb_out;
13956 xcb_parts[2].iov_len = sizeof(xcb_out);
13957 xcb_parts[3].iov_base = 0;
13958 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
13959
13960 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
13961 return xcb_ret;
13962 }
13963
13964
13965 /*****************************************************************************
13966 **
13967 ** int xcb_input_xi_get_selected_events_masks_length
13968 **
13969 ** @param const xcb_input_xi_get_selected_events_reply_t *R
13970 ** @returns int
13971 **
13972 *****************************************************************************/
13973
13974 int
13975 xcb_input_xi_get_selected_events_masks_length (const xcb_input_xi_get_selected_events_reply_t *R /**< */)
13976 {
13977 return R->num_masks;
13978 }
13979
13980
13981 /*****************************************************************************
13982 **
13983 ** xcb_input_event_mask_iterator_t xcb_input_xi_get_selected_events_masks_iterator
13984 **
13985 ** @param const xcb_input_xi_get_selected_events_reply_t *R
13986 ** @returns xcb_input_event_mask_iterator_t
13987 **
13988 *****************************************************************************/
13989
13990 xcb_input_event_mask_iterator_t
13991 xcb_input_xi_get_selected_events_masks_iterator (const xcb_input_xi_get_selected_events_reply_t *R /**< */)
13992 {
13993 xcb_input_event_mask_iterator_t i;
13994 i.data = (xcb_input_event_mask_t *) (R + 1);
13995 i.rem = R->num_masks;
13996 i.index = (char *) i.data - (char *) R;
13997 return i;
13998 }
13999
14000
14001 /*****************************************************************************
14002 **
14003 ** xcb_input_xi_get_selected_events_reply_t * xcb_input_xi_get_selected_events_reply
14004 **
14005 ** @param xcb_connection_t *c
14006 ** @param xcb_input_xi_get_selected_events_cookie_t cookie
14007 ** @param xcb_generic_error_t **e
14008 ** @returns xcb_input_xi_get_selected_events_reply_t *
14009 **
14010 *****************************************************************************/
14011
14012 xcb_input_xi_get_selected_events_reply_t *
14013 xcb_input_xi_get_selected_events_reply (xcb_connection_t *c /**< */,
14014 xcb_input_xi_get_selected_events_cookie_t cookie /**< */,
14015 xcb_generic_error_t **e /**< */)
14016 {
14017 return (xcb_input_xi_get_selected_events_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
14018 }
14019
14020
14021 /*****************************************************************************
14022 **
14023 ** void xcb_input_barrier_release_pointer_info_next
14024 **
14025 ** @param xcb_input_barrier_release_pointer_info_iterator_t *i
14026 ** @returns void
14027 **
14028 *****************************************************************************/
14029
14030 void
14031 xcb_input_barrier_release_pointer_info_next (xcb_input_barrier_release_pointer_info_iterator_t *i /**< */)
14032 {
14033 --i->rem;
14034 ++i->data;
14035 i->index += sizeof(xcb_input_barrier_release_pointer_info_t);
14036 }
14037
14038
14039 /*****************************************************************************
14040 **
14041 ** xcb_generic_iterator_t xcb_input_barrier_release_pointer_info_end
14042 **
14043 ** @param xcb_input_barrier_release_pointer_info_iterator_t i
14044 ** @returns xcb_generic_iterator_t
14045 **
14046 *****************************************************************************/
14047
14048 xcb_generic_iterator_t
14049 xcb_input_barrier_release_pointer_info_end (xcb_input_barrier_release_pointer_info_iterator_t i /**< */)
14050 {
14051 xcb_generic_iterator_t ret;
14052 ret.data = i.data + i.rem;
14053 ret.index = i.index + ((char *) ret.data - (char *) i.data);
14054 ret.rem = 0;
14055 return ret;
14056 }
14057
14058 int
14059 xcb_input_xi_barrier_release_pointer_sizeof (const void *_buffer /**< */)
14060 {
14061 char *xcb_tmp = (char *)_buffer;
14062 const xcb_input_xi_barrier_release_pointer_request_t *_aux = (xcb_input_xi_barrier_release_pointer_request_t *)_buffer;
14063 unsigned int xcb_buffer_len = 0;
14064 unsigned int xcb_block_len = 0;
14065 unsigned int xcb_pad = 0;
14066 unsigned int xcb_align_to = 0;
14067
14068
14069 xcb_block_len += sizeof(xcb_input_xi_barrier_release_pointer_request_t);
14070 xcb_tmp += xcb_block_len;
14071 xcb_buffer_len += xcb_block_len;
14072 xcb_block_len = 0;
14073 /* barriers */
14074 xcb_block_len += _aux->num_barriers * sizeof(xcb_input_barrier_release_pointer_info_t);
14075 xcb_tmp += xcb_block_len;
14076 xcb_align_to = ALIGNOF(xcb_input_barrier_release_pointer_info_t);
14077 /* insert padding */
14078 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
14079 xcb_buffer_len += xcb_block_len + xcb_pad;
14080 if (0 != xcb_pad) {
14081 xcb_tmp += xcb_pad;
14082 xcb_pad = 0;
14083 }
14084 xcb_block_len = 0;
14085
14086 return xcb_buffer_len;
14087 }
14088
14089
14090 /*****************************************************************************
14091 **
14092 ** xcb_void_cookie_t xcb_input_xi_barrier_release_pointer_checked
14093 **
14094 ** @param xcb_connection_t *c
14095 ** @param uint32_t num_barriers
14096 ** @param const xcb_input_barrier_release_pointer_info_t *barriers
14097 ** @returns xcb_void_cookie_t
14098 **
14099 *****************************************************************************/
14100
14101 xcb_void_cookie_t
14102 xcb_input_xi_barrier_release_pointer_checked (xcb_connection_t *c /**< */,
14103 uint32_t num_barriers /**< */,
14104 const xcb_input_barrier_release_pointer_info_t *barriers /**< */)
14105 {
14106 static const xcb_protocol_request_t xcb_req = {
14107 /* count */ 4,
14108 /* ext */ &xcb_input_id,
14109 /* opcode */ XCB_INPUT_XI_BARRIER_RELEASE_POINTER,
14110 /* isvoid */ 1
14111 };
14112
14113 struct iovec xcb_parts[6];
14114 xcb_void_cookie_t xcb_ret;
14115 xcb_input_xi_barrier_release_pointer_request_t xcb_out;
14116
14117 xcb_out.num_barriers = num_barriers;
14118
14119 xcb_parts[2].iov_base = (char *) &xcb_out;
14120 xcb_parts[2].iov_len = sizeof(xcb_out);
14121 xcb_parts[3].iov_base = 0;
14122 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
14123 /* xcb_input_barrier_release_pointer_info_t barriers */
14124 xcb_parts[4].iov_base = (char *) barriers;
14125 xcb_parts[4].iov_len = num_barriers * sizeof(xcb_input_barrier_release_pointer_info_t);
14126 xcb_parts[5].iov_base = 0;
14127 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
14128
14129 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
14130 return xcb_ret;
14131 }
14132
14133
14134 /*****************************************************************************
14135 **
14136 ** xcb_void_cookie_t xcb_input_xi_barrier_release_pointer
14137 **
14138 ** @param xcb_connection_t *c
14139 ** @param uint32_t num_barriers
14140 ** @param const xcb_input_barrier_release_pointer_info_t *barriers
14141 ** @returns xcb_void_cookie_t
14142 **
14143 *****************************************************************************/
14144
14145 xcb_void_cookie_t
14146 xcb_input_xi_barrier_release_pointer (xcb_connection_t *c /**< */,
14147 uint32_t num_barriers /**< */,
14148 const xcb_input_barrier_release_pointer_info_t *barriers /**< */)
14149 {
14150 static const xcb_protocol_request_t xcb_req = {
14151 /* count */ 4,
14152 /* ext */ &xcb_input_id,
14153 /* opcode */ XCB_INPUT_XI_BARRIER_RELEASE_POINTER,
14154 /* isvoid */ 1
14155 };
14156
14157 struct iovec xcb_parts[6];
14158 xcb_void_cookie_t xcb_ret;
14159 xcb_input_xi_barrier_release_pointer_request_t xcb_out;
14160
14161 xcb_out.num_barriers = num_barriers;
14162
14163 xcb_parts[2].iov_base = (char *) &xcb_out;
14164 xcb_parts[2].iov_len = sizeof(xcb_out);
14165 xcb_parts[3].iov_base = 0;
14166 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
14167 /* xcb_input_barrier_release_pointer_info_t barriers */
14168 xcb_parts[4].iov_base = (char *) barriers;
14169 xcb_parts[4].iov_len = num_barriers * sizeof(xcb_input_barrier_release_pointer_info_t);
14170 xcb_parts[5].iov_base = 0;
14171 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
14172
14173 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
14174 return xcb_ret;
14175 }
14176
14177 int
14178 xcb_input_device_changed_sizeof (const void *_buffer /**< */)
14179 {
14180 char *xcb_tmp = (char *)_buffer;
14181 const xcb_input_device_changed_event_t *_aux = (xcb_input_device_changed_event_t *)_buffer;
14182 unsigned int xcb_buffer_len = 0;
14183 unsigned int xcb_block_len = 0;
14184 unsigned int xcb_pad = 0;
14185 unsigned int xcb_align_to = 0;
14186
14187 unsigned int i;
14188 unsigned int xcb_tmp_len;
14189
14190 xcb_block_len += sizeof(xcb_input_device_changed_event_t);
14191 xcb_tmp += xcb_block_len;
14192 xcb_buffer_len += xcb_block_len;
14193 xcb_block_len = 0;
14194 /* classes */
14195 for(i=0; i<_aux->num_classes; i++) {
14196 xcb_tmp_len = xcb_input_device_class_sizeof(xcb_tmp);
14197 xcb_block_len += xcb_tmp_len;
14198 xcb_tmp += xcb_tmp_len;
14199 }
14200 xcb_align_to = ALIGNOF(xcb_input_device_class_t);
14201 /* insert padding */
14202 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
14203 xcb_buffer_len += xcb_block_len + xcb_pad;
14204 if (0 != xcb_pad) {
14205 xcb_tmp += xcb_pad;
14206 xcb_pad = 0;
14207 }
14208 xcb_block_len = 0;
14209
14210 return xcb_buffer_len;
14211 }
14212
14213 int
14214 xcb_input_key_press_sizeof (const void *_buffer /**< */)
14215 {
14216 char *xcb_tmp = (char *)_buffer;
14217 const xcb_input_key_press_event_t *_aux = (xcb_input_key_press_event_t *)_buffer;
14218 unsigned int xcb_buffer_len = 0;
14219 unsigned int xcb_block_len = 0;
14220 unsigned int xcb_pad = 0;
14221 unsigned int xcb_align_to = 0;
14222
14223
14224 xcb_block_len += sizeof(xcb_input_key_press_event_t);
14225 xcb_tmp += xcb_block_len;
14226 xcb_buffer_len += xcb_block_len;
14227 xcb_block_len = 0;
14228 /* button_mask */
14229 xcb_block_len += _aux->buttons_len * sizeof(uint32_t);
14230 xcb_tmp += xcb_block_len;
14231 xcb_align_to = ALIGNOF(uint32_t);
14232 /* insert padding */
14233 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
14234 xcb_buffer_len += xcb_block_len + xcb_pad;
14235 if (0 != xcb_pad) {
14236 xcb_tmp += xcb_pad;
14237 xcb_pad = 0;
14238 }
14239 xcb_block_len = 0;
14240 /* valuator_mask */
14241 xcb_block_len += _aux->valuators_len * sizeof(uint32_t);
14242 xcb_tmp += xcb_block_len;
14243 xcb_align_to = ALIGNOF(uint32_t);
14244 /* insert padding */
14245 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
14246 xcb_buffer_len += xcb_block_len + xcb_pad;
14247 if (0 != xcb_pad) {
14248 xcb_tmp += xcb_pad;
14249 xcb_pad = 0;
14250 }
14251 xcb_block_len = 0;
14252
14253 return xcb_buffer_len;
14254 }
14255
14256 int
14257 xcb_input_key_release_sizeof (const void *_buffer /**< */)
14258 {
14259 char *xcb_tmp = (char *)_buffer;
14260 const xcb_input_key_release_event_t *_aux = (xcb_input_key_release_event_t *)_buffer;
14261 unsigned int xcb_buffer_len = 0;
14262 unsigned int xcb_block_len = 0;
14263 unsigned int xcb_pad = 0;
14264 unsigned int xcb_align_to = 0;
14265
14266
14267 xcb_block_len += sizeof(xcb_input_key_release_event_t);
14268 xcb_tmp += xcb_block_len;
14269 xcb_buffer_len += xcb_block_len;
14270 xcb_block_len = 0;
14271 /* button_mask */
14272 xcb_block_len += _aux->buttons_len * sizeof(uint32_t);
14273 xcb_tmp += xcb_block_len;
14274 xcb_align_to = ALIGNOF(uint32_t);
14275 /* insert padding */
14276 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
14277 xcb_buffer_len += xcb_block_len + xcb_pad;
14278 if (0 != xcb_pad) {
14279 xcb_tmp += xcb_pad;
14280 xcb_pad = 0;
14281 }
14282 xcb_block_len = 0;
14283 /* valuator_mask */
14284 xcb_block_len += _aux->valuators_len * sizeof(uint32_t);
14285 xcb_tmp += xcb_block_len;
14286 xcb_align_to = ALIGNOF(uint32_t);
14287 /* insert padding */
14288 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
14289 xcb_buffer_len += xcb_block_len + xcb_pad;
14290 if (0 != xcb_pad) {
14291 xcb_tmp += xcb_pad;
14292 xcb_pad = 0;
14293 }
14294 xcb_block_len = 0;
14295
14296 return xcb_buffer_len;
14297 }
14298
14299 int
14300 xcb_input_button_press_sizeof (const void *_buffer /**< */)
14301 {
14302 char *xcb_tmp = (char *)_buffer;
14303 const xcb_input_button_press_event_t *_aux = (xcb_input_button_press_event_t *)_buffer;
14304 unsigned int xcb_buffer_len = 0;
14305 unsigned int xcb_block_len = 0;
14306 unsigned int xcb_pad = 0;
14307 unsigned int xcb_align_to = 0;
14308
14309
14310 xcb_block_len += sizeof(xcb_input_button_press_event_t);
14311 xcb_tmp += xcb_block_len;
14312 xcb_buffer_len += xcb_block_len;
14313 xcb_block_len = 0;
14314 /* button_mask */
14315 xcb_block_len += _aux->buttons_len * sizeof(uint32_t);
14316 xcb_tmp += xcb_block_len;
14317 xcb_align_to = ALIGNOF(uint32_t);
14318 /* insert padding */
14319 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
14320 xcb_buffer_len += xcb_block_len + xcb_pad;
14321 if (0 != xcb_pad) {
14322 xcb_tmp += xcb_pad;
14323 xcb_pad = 0;
14324 }
14325 xcb_block_len = 0;
14326 /* valuator_mask */
14327 xcb_block_len += _aux->valuators_len * sizeof(uint32_t);
14328 xcb_tmp += xcb_block_len;
14329 xcb_align_to = ALIGNOF(uint32_t);
14330 /* insert padding */
14331 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
14332 xcb_buffer_len += xcb_block_len + xcb_pad;
14333 if (0 != xcb_pad) {
14334 xcb_tmp += xcb_pad;
14335 xcb_pad = 0;
14336 }
14337 xcb_block_len = 0;
14338
14339 return xcb_buffer_len;
14340 }
14341
14342 int
14343 xcb_input_button_release_sizeof (const void *_buffer /**< */)
14344 {
14345 char *xcb_tmp = (char *)_buffer;
14346 const xcb_input_button_release_event_t *_aux = (xcb_input_button_release_event_t *)_buffer;
14347 unsigned int xcb_buffer_len = 0;
14348 unsigned int xcb_block_len = 0;
14349 unsigned int xcb_pad = 0;
14350 unsigned int xcb_align_to = 0;
14351
14352
14353 xcb_block_len += sizeof(xcb_input_button_release_event_t);
14354 xcb_tmp += xcb_block_len;
14355 xcb_buffer_len += xcb_block_len;
14356 xcb_block_len = 0;
14357 /* button_mask */
14358 xcb_block_len += _aux->buttons_len * sizeof(uint32_t);
14359 xcb_tmp += xcb_block_len;
14360 xcb_align_to = ALIGNOF(uint32_t);
14361 /* insert padding */
14362 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
14363 xcb_buffer_len += xcb_block_len + xcb_pad;
14364 if (0 != xcb_pad) {
14365 xcb_tmp += xcb_pad;
14366 xcb_pad = 0;
14367 }
14368 xcb_block_len = 0;
14369 /* valuator_mask */
14370 xcb_block_len += _aux->valuators_len * sizeof(uint32_t);
14371 xcb_tmp += xcb_block_len;
14372 xcb_align_to = ALIGNOF(uint32_t);
14373 /* insert padding */
14374 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
14375 xcb_buffer_len += xcb_block_len + xcb_pad;
14376 if (0 != xcb_pad) {
14377 xcb_tmp += xcb_pad;
14378 xcb_pad = 0;
14379 }
14380 xcb_block_len = 0;
14381
14382 return xcb_buffer_len;
14383 }
14384
14385 int
14386 xcb_input_motion_sizeof (const void *_buffer /**< */)
14387 {
14388 char *xcb_tmp = (char *)_buffer;
14389 const xcb_input_motion_event_t *_aux = (xcb_input_motion_event_t *)_buffer;
14390 unsigned int xcb_buffer_len = 0;
14391 unsigned int xcb_block_len = 0;
14392 unsigned int xcb_pad = 0;
14393 unsigned int xcb_align_to = 0;
14394
14395
14396 xcb_block_len += sizeof(xcb_input_motion_event_t);
14397 xcb_tmp += xcb_block_len;
14398 xcb_buffer_len += xcb_block_len;
14399 xcb_block_len = 0;
14400 /* button_mask */
14401 xcb_block_len += _aux->buttons_len * sizeof(uint32_t);
14402 xcb_tmp += xcb_block_len;
14403 xcb_align_to = ALIGNOF(uint32_t);
14404 /* insert padding */
14405 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
14406 xcb_buffer_len += xcb_block_len + xcb_pad;
14407 if (0 != xcb_pad) {
14408 xcb_tmp += xcb_pad;
14409 xcb_pad = 0;
14410 }
14411 xcb_block_len = 0;
14412 /* valuator_mask */
14413 xcb_block_len += _aux->valuators_len * sizeof(uint32_t);
14414 xcb_tmp += xcb_block_len;
14415 xcb_align_to = ALIGNOF(uint32_t);
14416 /* insert padding */
14417 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
14418 xcb_buffer_len += xcb_block_len + xcb_pad;
14419 if (0 != xcb_pad) {
14420 xcb_tmp += xcb_pad;
14421 xcb_pad = 0;
14422 }
14423 xcb_block_len = 0;
14424
14425 return xcb_buffer_len;
14426 }
14427
14428 int
14429 xcb_input_enter_sizeof (const void *_buffer /**< */)
14430 {
14431 char *xcb_tmp = (char *)_buffer;
14432 const xcb_input_enter_event_t *_aux = (xcb_input_enter_event_t *)_buffer;
14433 unsigned int xcb_buffer_len = 0;
14434 unsigned int xcb_block_len = 0;
14435 unsigned int xcb_pad = 0;
14436 unsigned int xcb_align_to = 0;
14437
14438
14439 xcb_block_len += sizeof(xcb_input_enter_event_t);
14440 xcb_tmp += xcb_block_len;
14441 xcb_buffer_len += xcb_block_len;
14442 xcb_block_len = 0;
14443 /* buttons */
14444 xcb_block_len += _aux->buttons_len * sizeof(uint32_t);
14445 xcb_tmp += xcb_block_len;
14446 xcb_align_to = ALIGNOF(uint32_t);
14447 /* insert padding */
14448 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
14449 xcb_buffer_len += xcb_block_len + xcb_pad;
14450 if (0 != xcb_pad) {
14451 xcb_tmp += xcb_pad;
14452 xcb_pad = 0;
14453 }
14454 xcb_block_len = 0;
14455
14456 return xcb_buffer_len;
14457 }
14458
14459 int
14460 xcb_input_leave_sizeof (const void *_buffer /**< */)
14461 {
14462 char *xcb_tmp = (char *)_buffer;
14463 const xcb_input_leave_event_t *_aux = (xcb_input_leave_event_t *)_buffer;
14464 unsigned int xcb_buffer_len = 0;
14465 unsigned int xcb_block_len = 0;
14466 unsigned int xcb_pad = 0;
14467 unsigned int xcb_align_to = 0;
14468
14469
14470 xcb_block_len += sizeof(xcb_input_leave_event_t);
14471 xcb_tmp += xcb_block_len;
14472 xcb_buffer_len += xcb_block_len;
14473 xcb_block_len = 0;
14474 /* buttons */
14475 xcb_block_len += _aux->buttons_len * sizeof(uint32_t);
14476 xcb_tmp += xcb_block_len;
14477 xcb_align_to = ALIGNOF(uint32_t);
14478 /* insert padding */
14479 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
14480 xcb_buffer_len += xcb_block_len + xcb_pad;
14481 if (0 != xcb_pad) {
14482 xcb_tmp += xcb_pad;
14483 xcb_pad = 0;
14484 }
14485 xcb_block_len = 0;
14486
14487 return xcb_buffer_len;
14488 }
14489
14490 int
14491 xcb_input_focus_in_sizeof (const void *_buffer /**< */)
14492 {
14493 char *xcb_tmp = (char *)_buffer;
14494 const xcb_input_focus_in_event_t *_aux = (xcb_input_focus_in_event_t *)_buffer;
14495 unsigned int xcb_buffer_len = 0;
14496 unsigned int xcb_block_len = 0;
14497 unsigned int xcb_pad = 0;
14498 unsigned int xcb_align_to = 0;
14499
14500
14501 xcb_block_len += sizeof(xcb_input_focus_in_event_t);
14502 xcb_tmp += xcb_block_len;
14503 xcb_buffer_len += xcb_block_len;
14504 xcb_block_len = 0;
14505 /* buttons */
14506 xcb_block_len += _aux->buttons_len * sizeof(uint32_t);
14507 xcb_tmp += xcb_block_len;
14508 xcb_align_to = ALIGNOF(uint32_t);
14509 /* insert padding */
14510 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
14511 xcb_buffer_len += xcb_block_len + xcb_pad;
14512 if (0 != xcb_pad) {
14513 xcb_tmp += xcb_pad;
14514 xcb_pad = 0;
14515 }
14516 xcb_block_len = 0;
14517
14518 return xcb_buffer_len;
14519 }
14520
14521 int
14522 xcb_input_focus_out_sizeof (const void *_buffer /**< */)
14523 {
14524 char *xcb_tmp = (char *)_buffer;
14525 const xcb_input_focus_out_event_t *_aux = (xcb_input_focus_out_event_t *)_buffer;
14526 unsigned int xcb_buffer_len = 0;
14527 unsigned int xcb_block_len = 0;
14528 unsigned int xcb_pad = 0;
14529 unsigned int xcb_align_to = 0;
14530
14531
14532 xcb_block_len += sizeof(xcb_input_focus_out_event_t);
14533 xcb_tmp += xcb_block_len;
14534 xcb_buffer_len += xcb_block_len;
14535 xcb_block_len = 0;
14536 /* buttons */
14537 xcb_block_len += _aux->buttons_len * sizeof(uint32_t);
14538 xcb_tmp += xcb_block_len;
14539 xcb_align_to = ALIGNOF(uint32_t);
14540 /* insert padding */
14541 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
14542 xcb_buffer_len += xcb_block_len + xcb_pad;
14543 if (0 != xcb_pad) {
14544 xcb_tmp += xcb_pad;
14545 xcb_pad = 0;
14546 }
14547 xcb_block_len = 0;
14548
14549 return xcb_buffer_len;
14550 }
14551
14552
14553 /*****************************************************************************
14554 **
14555 ** void xcb_input_hierarchy_info_next
14556 **
14557 ** @param xcb_input_hierarchy_info_iterator_t *i
14558 ** @returns void
14559 **
14560 *****************************************************************************/
14561
14562 void
14563 xcb_input_hierarchy_info_next (xcb_input_hierarchy_info_iterator_t *i /**< */)
14564 {
14565 --i->rem;
14566 ++i->data;
14567 i->index += sizeof(xcb_input_hierarchy_info_t);
14568 }
14569
14570
14571 /*****************************************************************************
14572 **
14573 ** xcb_generic_iterator_t xcb_input_hierarchy_info_end
14574 **
14575 ** @param xcb_input_hierarchy_info_iterator_t i
14576 ** @returns xcb_generic_iterator_t
14577 **
14578 *****************************************************************************/
14579
14580 xcb_generic_iterator_t
14581 xcb_input_hierarchy_info_end (xcb_input_hierarchy_info_iterator_t i /**< */)
14582 {
14583 xcb_generic_iterator_t ret;
14584 ret.data = i.data + i.rem;
14585 ret.index = i.index + ((char *) ret.data - (char *) i.data);
14586 ret.rem = 0;
14587 return ret;
14588 }
14589
14590 int
14591 xcb_input_hierarchy_sizeof (const void *_buffer /**< */)
14592 {
14593 char *xcb_tmp = (char *)_buffer;
14594 const xcb_input_hierarchy_event_t *_aux = (xcb_input_hierarchy_event_t *)_buffer;
14595 unsigned int xcb_buffer_len = 0;
14596 unsigned int xcb_block_len = 0;
14597 unsigned int xcb_pad = 0;
14598 unsigned int xcb_align_to = 0;
14599
14600
14601 xcb_block_len += sizeof(xcb_input_hierarchy_event_t);
14602 xcb_tmp += xcb_block_len;
14603 xcb_buffer_len += xcb_block_len;
14604 xcb_block_len = 0;
14605 /* infos */
14606 xcb_block_len += _aux->num_infos * sizeof(xcb_input_hierarchy_info_t);
14607 xcb_tmp += xcb_block_len;
14608 xcb_align_to = ALIGNOF(xcb_input_hierarchy_info_t);
14609 /* insert padding */
14610 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
14611 xcb_buffer_len += xcb_block_len + xcb_pad;
14612 if (0 != xcb_pad) {
14613 xcb_tmp += xcb_pad;
14614 xcb_pad = 0;
14615 }
14616 xcb_block_len = 0;
14617
14618 return xcb_buffer_len;
14619 }
14620
14621 int
14622 xcb_input_raw_key_press_sizeof (const void *_buffer /**< */)
14623 {
14624 char *xcb_tmp = (char *)_buffer;
14625 const xcb_input_raw_key_press_event_t *_aux = (xcb_input_raw_key_press_event_t *)_buffer;
14626 unsigned int xcb_buffer_len = 0;
14627 unsigned int xcb_block_len = 0;
14628 unsigned int xcb_pad = 0;
14629 unsigned int xcb_align_to = 0;
14630
14631
14632 xcb_block_len += sizeof(xcb_input_raw_key_press_event_t);
14633 xcb_tmp += xcb_block_len;
14634 xcb_buffer_len += xcb_block_len;
14635 xcb_block_len = 0;
14636 /* valuator_mask */
14637 xcb_block_len += _aux->valuators_len * sizeof(uint32_t);
14638 xcb_tmp += xcb_block_len;
14639 xcb_align_to = ALIGNOF(uint32_t);
14640 /* insert padding */
14641 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
14642 xcb_buffer_len += xcb_block_len + xcb_pad;
14643 if (0 != xcb_pad) {
14644 xcb_tmp += xcb_pad;
14645 xcb_pad = 0;
14646 }
14647 xcb_block_len = 0;
14648
14649 return xcb_buffer_len;
14650 }
14651
14652 int
14653 xcb_input_raw_key_release_sizeof (const void *_buffer /**< */)
14654 {
14655 char *xcb_tmp = (char *)_buffer;
14656 const xcb_input_raw_key_release_event_t *_aux = (xcb_input_raw_key_release_event_t *)_buffer;
14657 unsigned int xcb_buffer_len = 0;
14658 unsigned int xcb_block_len = 0;
14659 unsigned int xcb_pad = 0;
14660 unsigned int xcb_align_to = 0;
14661
14662
14663 xcb_block_len += sizeof(xcb_input_raw_key_release_event_t);
14664 xcb_tmp += xcb_block_len;
14665 xcb_buffer_len += xcb_block_len;
14666 xcb_block_len = 0;
14667 /* valuator_mask */
14668 xcb_block_len += _aux->valuators_len * sizeof(uint32_t);
14669 xcb_tmp += xcb_block_len;
14670 xcb_align_to = ALIGNOF(uint32_t);
14671 /* insert padding */
14672 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
14673 xcb_buffer_len += xcb_block_len + xcb_pad;
14674 if (0 != xcb_pad) {
14675 xcb_tmp += xcb_pad;
14676 xcb_pad = 0;
14677 }
14678 xcb_block_len = 0;
14679
14680 return xcb_buffer_len;
14681 }
14682
14683 int
14684 xcb_input_raw_button_press_sizeof (const void *_buffer /**< */)
14685 {
14686 char *xcb_tmp = (char *)_buffer;
14687 const xcb_input_raw_button_press_event_t *_aux = (xcb_input_raw_button_press_event_t *)_buffer;
14688 unsigned int xcb_buffer_len = 0;
14689 unsigned int xcb_block_len = 0;
14690 unsigned int xcb_pad = 0;
14691 unsigned int xcb_align_to = 0;
14692
14693
14694 xcb_block_len += sizeof(xcb_input_raw_button_press_event_t);
14695 xcb_tmp += xcb_block_len;
14696 xcb_buffer_len += xcb_block_len;
14697 xcb_block_len = 0;
14698 /* valuator_mask */
14699 xcb_block_len += _aux->valuators_len * sizeof(uint32_t);
14700 xcb_tmp += xcb_block_len;
14701 xcb_align_to = ALIGNOF(uint32_t);
14702 /* insert padding */
14703 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
14704 xcb_buffer_len += xcb_block_len + xcb_pad;
14705 if (0 != xcb_pad) {
14706 xcb_tmp += xcb_pad;
14707 xcb_pad = 0;
14708 }
14709 xcb_block_len = 0;
14710
14711 return xcb_buffer_len;
14712 }
14713
14714 int
14715 xcb_input_raw_button_release_sizeof (const void *_buffer /**< */)
14716 {
14717 char *xcb_tmp = (char *)_buffer;
14718 const xcb_input_raw_button_release_event_t *_aux = (xcb_input_raw_button_release_event_t *)_buffer;
14719 unsigned int xcb_buffer_len = 0;
14720 unsigned int xcb_block_len = 0;
14721 unsigned int xcb_pad = 0;
14722 unsigned int xcb_align_to = 0;
14723
14724
14725 xcb_block_len += sizeof(xcb_input_raw_button_release_event_t);
14726 xcb_tmp += xcb_block_len;
14727 xcb_buffer_len += xcb_block_len;
14728 xcb_block_len = 0;
14729 /* valuator_mask */
14730 xcb_block_len += _aux->valuators_len * sizeof(uint32_t);
14731 xcb_tmp += xcb_block_len;
14732 xcb_align_to = ALIGNOF(uint32_t);
14733 /* insert padding */
14734 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
14735 xcb_buffer_len += xcb_block_len + xcb_pad;
14736 if (0 != xcb_pad) {
14737 xcb_tmp += xcb_pad;
14738 xcb_pad = 0;
14739 }
14740 xcb_block_len = 0;
14741
14742 return xcb_buffer_len;
14743 }
14744
14745 int
14746 xcb_input_raw_motion_sizeof (const void *_buffer /**< */)
14747 {
14748 char *xcb_tmp = (char *)_buffer;
14749 const xcb_input_raw_motion_event_t *_aux = (xcb_input_raw_motion_event_t *)_buffer;
14750 unsigned int xcb_buffer_len = 0;
14751 unsigned int xcb_block_len = 0;
14752 unsigned int xcb_pad = 0;
14753 unsigned int xcb_align_to = 0;
14754
14755
14756 xcb_block_len += sizeof(xcb_input_raw_motion_event_t);
14757 xcb_tmp += xcb_block_len;
14758 xcb_buffer_len += xcb_block_len;
14759 xcb_block_len = 0;
14760 /* valuator_mask */
14761 xcb_block_len += _aux->valuators_len * sizeof(uint32_t);
14762 xcb_tmp += xcb_block_len;
14763 xcb_align_to = ALIGNOF(uint32_t);
14764 /* insert padding */
14765 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
14766 xcb_buffer_len += xcb_block_len + xcb_pad;
14767 if (0 != xcb_pad) {
14768 xcb_tmp += xcb_pad;
14769 xcb_pad = 0;
14770 }
14771 xcb_block_len = 0;
14772
14773 return xcb_buffer_len;
14774 }
14775
14776 int
14777 xcb_input_touch_begin_sizeof (const void *_buffer /**< */)
14778 {
14779 char *xcb_tmp = (char *)_buffer;
14780 const xcb_input_touch_begin_event_t *_aux = (xcb_input_touch_begin_event_t *)_buffer;
14781 unsigned int xcb_buffer_len = 0;
14782 unsigned int xcb_block_len = 0;
14783 unsigned int xcb_pad = 0;
14784 unsigned int xcb_align_to = 0;
14785
14786
14787 xcb_block_len += sizeof(xcb_input_touch_begin_event_t);
14788 xcb_tmp += xcb_block_len;
14789 xcb_buffer_len += xcb_block_len;
14790 xcb_block_len = 0;
14791 /* button_mask */
14792 xcb_block_len += _aux->buttons_len * sizeof(uint32_t);
14793 xcb_tmp += xcb_block_len;
14794 xcb_align_to = ALIGNOF(uint32_t);
14795 /* insert padding */
14796 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
14797 xcb_buffer_len += xcb_block_len + xcb_pad;
14798 if (0 != xcb_pad) {
14799 xcb_tmp += xcb_pad;
14800 xcb_pad = 0;
14801 }
14802 xcb_block_len = 0;
14803 /* valuator_mask */
14804 xcb_block_len += _aux->valuators_len * sizeof(uint32_t);
14805 xcb_tmp += xcb_block_len;
14806 xcb_align_to = ALIGNOF(uint32_t);
14807 /* insert padding */
14808 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
14809 xcb_buffer_len += xcb_block_len + xcb_pad;
14810 if (0 != xcb_pad) {
14811 xcb_tmp += xcb_pad;
14812 xcb_pad = 0;
14813 }
14814 xcb_block_len = 0;
14815
14816 return xcb_buffer_len;
14817 }
14818
14819 int
14820 xcb_input_touch_update_sizeof (const void *_buffer /**< */)
14821 {
14822 char *xcb_tmp = (char *)_buffer;
14823 const xcb_input_touch_update_event_t *_aux = (xcb_input_touch_update_event_t *)_buffer;
14824 unsigned int xcb_buffer_len = 0;
14825 unsigned int xcb_block_len = 0;
14826 unsigned int xcb_pad = 0;
14827 unsigned int xcb_align_to = 0;
14828
14829
14830 xcb_block_len += sizeof(xcb_input_touch_update_event_t);
14831 xcb_tmp += xcb_block_len;
14832 xcb_buffer_len += xcb_block_len;
14833 xcb_block_len = 0;
14834 /* button_mask */
14835 xcb_block_len += _aux->buttons_len * sizeof(uint32_t);
14836 xcb_tmp += xcb_block_len;
14837 xcb_align_to = ALIGNOF(uint32_t);
14838 /* insert padding */
14839 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
14840 xcb_buffer_len += xcb_block_len + xcb_pad;
14841 if (0 != xcb_pad) {
14842 xcb_tmp += xcb_pad;
14843 xcb_pad = 0;
14844 }
14845 xcb_block_len = 0;
14846 /* valuator_mask */
14847 xcb_block_len += _aux->valuators_len * sizeof(uint32_t);
14848 xcb_tmp += xcb_block_len;
14849 xcb_align_to = ALIGNOF(uint32_t);
14850 /* insert padding */
14851 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
14852 xcb_buffer_len += xcb_block_len + xcb_pad;
14853 if (0 != xcb_pad) {
14854 xcb_tmp += xcb_pad;
14855 xcb_pad = 0;
14856 }
14857 xcb_block_len = 0;
14858
14859 return xcb_buffer_len;
14860 }
14861
14862 int
14863 xcb_input_touch_end_sizeof (const void *_buffer /**< */)
14864 {
14865 char *xcb_tmp = (char *)_buffer;
14866 const xcb_input_touch_end_event_t *_aux = (xcb_input_touch_end_event_t *)_buffer;
14867 unsigned int xcb_buffer_len = 0;
14868 unsigned int xcb_block_len = 0;
14869 unsigned int xcb_pad = 0;
14870 unsigned int xcb_align_to = 0;
14871
14872
14873 xcb_block_len += sizeof(xcb_input_touch_end_event_t);
14874 xcb_tmp += xcb_block_len;
14875 xcb_buffer_len += xcb_block_len;
14876 xcb_block_len = 0;
14877 /* button_mask */
14878 xcb_block_len += _aux->buttons_len * sizeof(uint32_t);
14879 xcb_tmp += xcb_block_len;
14880 xcb_align_to = ALIGNOF(uint32_t);
14881 /* insert padding */
14882 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
14883 xcb_buffer_len += xcb_block_len + xcb_pad;
14884 if (0 != xcb_pad) {
14885 xcb_tmp += xcb_pad;
14886 xcb_pad = 0;
14887 }
14888 xcb_block_len = 0;
14889 /* valuator_mask */
14890 xcb_block_len += _aux->valuators_len * sizeof(uint32_t);
14891 xcb_tmp += xcb_block_len;
14892 xcb_align_to = ALIGNOF(uint32_t);
14893 /* insert padding */
14894 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
14895 xcb_buffer_len += xcb_block_len + xcb_pad;
14896 if (0 != xcb_pad) {
14897 xcb_tmp += xcb_pad;
14898 xcb_pad = 0;
14899 }
14900 xcb_block_len = 0;
14901
14902 return xcb_buffer_len;
14903 }
14904
14905 int
14906 xcb_input_raw_touch_begin_sizeof (const void *_buffer /**< */)
14907 {
14908 char *xcb_tmp = (char *)_buffer;
14909 const xcb_input_raw_touch_begin_event_t *_aux = (xcb_input_raw_touch_begin_event_t *)_buffer;
14910 unsigned int xcb_buffer_len = 0;
14911 unsigned int xcb_block_len = 0;
14912 unsigned int xcb_pad = 0;
14913 unsigned int xcb_align_to = 0;
14914
14915
14916 xcb_block_len += sizeof(xcb_input_raw_touch_begin_event_t);
14917 xcb_tmp += xcb_block_len;
14918 xcb_buffer_len += xcb_block_len;
14919 xcb_block_len = 0;
14920 /* valuator_mask */
14921 xcb_block_len += _aux->valuators_len * sizeof(uint32_t);
14922 xcb_tmp += xcb_block_len;
14923 xcb_align_to = ALIGNOF(uint32_t);
14924 /* insert padding */
14925 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
14926 xcb_buffer_len += xcb_block_len + xcb_pad;
14927 if (0 != xcb_pad) {
14928 xcb_tmp += xcb_pad;
14929 xcb_pad = 0;
14930 }
14931 xcb_block_len = 0;
14932
14933 return xcb_buffer_len;
14934 }
14935
14936 int
14937 xcb_input_raw_touch_update_sizeof (const void *_buffer /**< */)
14938 {
14939 char *xcb_tmp = (char *)_buffer;
14940 const xcb_input_raw_touch_update_event_t *_aux = (xcb_input_raw_touch_update_event_t *)_buffer;
14941 unsigned int xcb_buffer_len = 0;
14942 unsigned int xcb_block_len = 0;
14943 unsigned int xcb_pad = 0;
14944 unsigned int xcb_align_to = 0;
14945
14946
14947 xcb_block_len += sizeof(xcb_input_raw_touch_update_event_t);
14948 xcb_tmp += xcb_block_len;
14949 xcb_buffer_len += xcb_block_len;
14950 xcb_block_len = 0;
14951 /* valuator_mask */
14952 xcb_block_len += _aux->valuators_len * sizeof(uint32_t);
14953 xcb_tmp += xcb_block_len;
14954 xcb_align_to = ALIGNOF(uint32_t);
14955 /* insert padding */
14956 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
14957 xcb_buffer_len += xcb_block_len + xcb_pad;
14958 if (0 != xcb_pad) {
14959 xcb_tmp += xcb_pad;
14960 xcb_pad = 0;
14961 }
14962 xcb_block_len = 0;
14963
14964 return xcb_buffer_len;
14965 }
14966
14967 int
14968 xcb_input_raw_touch_end_sizeof (const void *_buffer /**< */)
14969 {
14970 char *xcb_tmp = (char *)_buffer;
14971 const xcb_input_raw_touch_end_event_t *_aux = (xcb_input_raw_touch_end_event_t *)_buffer;
14972 unsigned int xcb_buffer_len = 0;
14973 unsigned int xcb_block_len = 0;
14974 unsigned int xcb_pad = 0;
14975 unsigned int xcb_align_to = 0;
14976
14977
14978 xcb_block_len += sizeof(xcb_input_raw_touch_end_event_t);
14979 xcb_tmp += xcb_block_len;
14980 xcb_buffer_len += xcb_block_len;
14981 xcb_block_len = 0;
14982 /* valuator_mask */
14983 xcb_block_len += _aux->valuators_len * sizeof(uint32_t);
14984 xcb_tmp += xcb_block_len;
14985 xcb_align_to = ALIGNOF(uint32_t);
14986 /* insert padding */
14987 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
14988 xcb_buffer_len += xcb_block_len + xcb_pad;
14989 if (0 != xcb_pad) {
14990 xcb_tmp += xcb_pad;
14991 xcb_pad = 0;
14992 }
14993 xcb_block_len = 0;
14994
14995 return xcb_buffer_len;
14996 }
14997
14998