Remove building with NOCRYPTO option
[minix.git] / external / mit / xorg / lib / libxcb / files / xkb.c
blobc03ea83b3a2e7b0c8639b5e4d9acac8aca6927f9
1 /*
2 * This file generated automatically from xkb.xml by c_client.py.
3 * Edit at your peril.
4 */
6 #ifdef HAVE_CONFIG_H
7 #include "config.h"
8 #endif
9 #include <stdlib.h>
10 #include <string.h>
11 #include <assert.h>
12 #include <stddef.h> /* for offsetof() */
13 #include "xcbext.h"
14 #include "xkb.h"
16 #define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member)
17 #include "xproto.h"
19 xcb_extension_t xcb_xkb_id = { "XKEYBOARD", 0 };
21 void
22 xcb_xkb_device_spec_next (xcb_xkb_device_spec_iterator_t *i /**< */)
24 --i->rem;
25 ++i->data;
26 i->index += sizeof(xcb_xkb_device_spec_t);
29 xcb_generic_iterator_t
30 xcb_xkb_device_spec_end (xcb_xkb_device_spec_iterator_t i /**< */)
32 xcb_generic_iterator_t ret;
33 ret.data = i.data + i.rem;
34 ret.index = i.index + ((char *) ret.data - (char *) i.data);
35 ret.rem = 0;
36 return ret;
39 void
40 xcb_xkb_led_class_spec_next (xcb_xkb_led_class_spec_iterator_t *i /**< */)
42 --i->rem;
43 ++i->data;
44 i->index += sizeof(xcb_xkb_led_class_spec_t);
47 xcb_generic_iterator_t
48 xcb_xkb_led_class_spec_end (xcb_xkb_led_class_spec_iterator_t i /**< */)
50 xcb_generic_iterator_t ret;
51 ret.data = i.data + i.rem;
52 ret.index = i.index + ((char *) ret.data - (char *) i.data);
53 ret.rem = 0;
54 return ret;
57 void
58 xcb_xkb_bell_class_spec_next (xcb_xkb_bell_class_spec_iterator_t *i /**< */)
60 --i->rem;
61 ++i->data;
62 i->index += sizeof(xcb_xkb_bell_class_spec_t);
65 xcb_generic_iterator_t
66 xcb_xkb_bell_class_spec_end (xcb_xkb_bell_class_spec_iterator_t i /**< */)
68 xcb_generic_iterator_t ret;
69 ret.data = i.data + i.rem;
70 ret.index = i.index + ((char *) ret.data - (char *) i.data);
71 ret.rem = 0;
72 return ret;
75 void
76 xcb_xkb_id_spec_next (xcb_xkb_id_spec_iterator_t *i /**< */)
78 --i->rem;
79 ++i->data;
80 i->index += sizeof(xcb_xkb_id_spec_t);
83 xcb_generic_iterator_t
84 xcb_xkb_id_spec_end (xcb_xkb_id_spec_iterator_t i /**< */)
86 xcb_generic_iterator_t ret;
87 ret.data = i.data + i.rem;
88 ret.index = i.index + ((char *) ret.data - (char *) i.data);
89 ret.rem = 0;
90 return ret;
93 void
94 xcb_xkb_indicator_map_next (xcb_xkb_indicator_map_iterator_t *i /**< */)
96 --i->rem;
97 ++i->data;
98 i->index += sizeof(xcb_xkb_indicator_map_t);
101 xcb_generic_iterator_t
102 xcb_xkb_indicator_map_end (xcb_xkb_indicator_map_iterator_t i /**< */)
104 xcb_generic_iterator_t ret;
105 ret.data = i.data + i.rem;
106 ret.index = i.index + ((char *) ret.data - (char *) i.data);
107 ret.rem = 0;
108 return ret;
111 void
112 xcb_xkb_mod_def_next (xcb_xkb_mod_def_iterator_t *i /**< */)
114 --i->rem;
115 ++i->data;
116 i->index += sizeof(xcb_xkb_mod_def_t);
119 xcb_generic_iterator_t
120 xcb_xkb_mod_def_end (xcb_xkb_mod_def_iterator_t i /**< */)
122 xcb_generic_iterator_t ret;
123 ret.data = i.data + i.rem;
124 ret.index = i.index + ((char *) ret.data - (char *) i.data);
125 ret.rem = 0;
126 return ret;
129 void
130 xcb_xkb_key_name_next (xcb_xkb_key_name_iterator_t *i /**< */)
132 --i->rem;
133 ++i->data;
134 i->index += sizeof(xcb_xkb_key_name_t);
137 xcb_generic_iterator_t
138 xcb_xkb_key_name_end (xcb_xkb_key_name_iterator_t i /**< */)
140 xcb_generic_iterator_t ret;
141 ret.data = i.data + i.rem;
142 ret.index = i.index + ((char *) ret.data - (char *) i.data);
143 ret.rem = 0;
144 return ret;
147 void
148 xcb_xkb_key_alias_next (xcb_xkb_key_alias_iterator_t *i /**< */)
150 --i->rem;
151 ++i->data;
152 i->index += sizeof(xcb_xkb_key_alias_t);
155 xcb_generic_iterator_t
156 xcb_xkb_key_alias_end (xcb_xkb_key_alias_iterator_t i /**< */)
158 xcb_generic_iterator_t ret;
159 ret.data = i.data + i.rem;
160 ret.index = i.index + ((char *) ret.data - (char *) i.data);
161 ret.rem = 0;
162 return ret;
166 xcb_xkb_counted_string_16_sizeof (const void *_buffer /**< */)
168 char *xcb_tmp = (char *)_buffer;
169 const xcb_xkb_counted_string_16_t *_aux = (xcb_xkb_counted_string_16_t *)_buffer;
170 unsigned int xcb_buffer_len = 0;
171 unsigned int xcb_block_len = 0;
172 unsigned int xcb_pad = 0;
173 unsigned int xcb_align_to = 0;
176 xcb_block_len += sizeof(xcb_xkb_counted_string_16_t);
177 xcb_tmp += xcb_block_len;
178 xcb_buffer_len += xcb_block_len;
179 xcb_block_len = 0;
180 /* string */
181 xcb_block_len += _aux->length * sizeof(char);
182 xcb_tmp += xcb_block_len;
183 xcb_align_to = ALIGNOF(char);
184 /* insert padding */
185 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
186 xcb_buffer_len += xcb_block_len + xcb_pad;
187 if (0 != xcb_pad) {
188 xcb_tmp += xcb_pad;
189 xcb_pad = 0;
191 xcb_block_len = 0;
192 /* alignment_pad */
193 xcb_block_len += (((_aux->length + 5) & (~3)) - (_aux->length + 2)) * sizeof(char);
194 xcb_tmp += xcb_block_len;
195 xcb_align_to = ALIGNOF(char);
196 /* insert padding */
197 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
198 xcb_buffer_len += xcb_block_len + xcb_pad;
199 if (0 != xcb_pad) {
200 xcb_tmp += xcb_pad;
201 xcb_pad = 0;
203 xcb_block_len = 0;
205 return xcb_buffer_len;
208 char *
209 xcb_xkb_counted_string_16_string (const xcb_xkb_counted_string_16_t *R /**< */)
211 return (char *) (R + 1);
215 xcb_xkb_counted_string_16_string_length (const xcb_xkb_counted_string_16_t *R /**< */)
217 return R->length;
220 xcb_generic_iterator_t
221 xcb_xkb_counted_string_16_string_end (const xcb_xkb_counted_string_16_t *R /**< */)
223 xcb_generic_iterator_t i;
224 i.data = ((char *) (R + 1)) + (R->length);
225 i.rem = 0;
226 i.index = (char *) i.data - (char *) R;
227 return i;
230 void *
231 xcb_xkb_counted_string_16_alignment_pad (const xcb_xkb_counted_string_16_t *R /**< */)
233 xcb_generic_iterator_t prev = xcb_xkb_counted_string_16_string_end(R);
234 return (void *) ((char *) prev.data + XCB_TYPE_PAD(char, prev.index) + 0);
238 xcb_xkb_counted_string_16_alignment_pad_length (const xcb_xkb_counted_string_16_t *R /**< */)
240 return (((R->length + 5) & (~3)) - (R->length + 2));
243 xcb_generic_iterator_t
244 xcb_xkb_counted_string_16_alignment_pad_end (const xcb_xkb_counted_string_16_t *R /**< */)
246 xcb_generic_iterator_t i;
247 xcb_generic_iterator_t child = xcb_xkb_counted_string_16_string_end(R);
248 i.data = ((char *) child.data) + ((((R->length + 5) & (~3)) - (R->length + 2)));
249 i.rem = 0;
250 i.index = (char *) i.data - (char *) R;
251 return i;
254 void
255 xcb_xkb_counted_string_16_next (xcb_xkb_counted_string_16_iterator_t *i /**< */)
257 xcb_xkb_counted_string_16_t *R = i->data;
258 xcb_generic_iterator_t child;
259 child.data = (xcb_xkb_counted_string_16_t *)(((char *)R) + xcb_xkb_counted_string_16_sizeof(R));
260 i->index = (char *) child.data - (char *) i->data;
261 --i->rem;
262 i->data = (xcb_xkb_counted_string_16_t *) child.data;
265 xcb_generic_iterator_t
266 xcb_xkb_counted_string_16_end (xcb_xkb_counted_string_16_iterator_t i /**< */)
268 xcb_generic_iterator_t ret;
269 while(i.rem > 0)
270 xcb_xkb_counted_string_16_next(&i);
271 ret.data = i.data;
272 ret.rem = i.rem;
273 ret.index = i.index;
274 return ret;
277 void
278 xcb_xkb_kt_map_entry_next (xcb_xkb_kt_map_entry_iterator_t *i /**< */)
280 --i->rem;
281 ++i->data;
282 i->index += sizeof(xcb_xkb_kt_map_entry_t);
285 xcb_generic_iterator_t
286 xcb_xkb_kt_map_entry_end (xcb_xkb_kt_map_entry_iterator_t i /**< */)
288 xcb_generic_iterator_t ret;
289 ret.data = i.data + i.rem;
290 ret.index = i.index + ((char *) ret.data - (char *) i.data);
291 ret.rem = 0;
292 return ret;
296 xcb_xkb_key_type_sizeof (const void *_buffer /**< */)
298 char *xcb_tmp = (char *)_buffer;
299 const xcb_xkb_key_type_t *_aux = (xcb_xkb_key_type_t *)_buffer;
300 unsigned int xcb_buffer_len = 0;
301 unsigned int xcb_block_len = 0;
302 unsigned int xcb_pad = 0;
303 unsigned int xcb_align_to = 0;
306 xcb_block_len += sizeof(xcb_xkb_key_type_t);
307 xcb_tmp += xcb_block_len;
308 xcb_buffer_len += xcb_block_len;
309 xcb_block_len = 0;
310 /* map */
311 xcb_block_len += _aux->nMapEntries * sizeof(xcb_xkb_kt_map_entry_t);
312 xcb_tmp += xcb_block_len;
313 xcb_align_to = ALIGNOF(xcb_xkb_kt_map_entry_t);
314 /* insert padding */
315 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
316 xcb_buffer_len += xcb_block_len + xcb_pad;
317 if (0 != xcb_pad) {
318 xcb_tmp += xcb_pad;
319 xcb_pad = 0;
321 xcb_block_len = 0;
322 /* preserve */
323 xcb_block_len += (_aux->hasPreserve * _aux->nMapEntries) * sizeof(xcb_xkb_mod_def_t);
324 xcb_tmp += xcb_block_len;
325 xcb_align_to = ALIGNOF(xcb_xkb_mod_def_t);
326 /* insert padding */
327 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
328 xcb_buffer_len += xcb_block_len + xcb_pad;
329 if (0 != xcb_pad) {
330 xcb_tmp += xcb_pad;
331 xcb_pad = 0;
333 xcb_block_len = 0;
335 return xcb_buffer_len;
338 xcb_xkb_kt_map_entry_t *
339 xcb_xkb_key_type_map (const xcb_xkb_key_type_t *R /**< */)
341 return (xcb_xkb_kt_map_entry_t *) (R + 1);
345 xcb_xkb_key_type_map_length (const xcb_xkb_key_type_t *R /**< */)
347 return R->nMapEntries;
350 xcb_xkb_kt_map_entry_iterator_t
351 xcb_xkb_key_type_map_iterator (const xcb_xkb_key_type_t *R /**< */)
353 xcb_xkb_kt_map_entry_iterator_t i;
354 i.data = (xcb_xkb_kt_map_entry_t *) (R + 1);
355 i.rem = R->nMapEntries;
356 i.index = (char *) i.data - (char *) R;
357 return i;
360 xcb_xkb_mod_def_t *
361 xcb_xkb_key_type_preserve (const xcb_xkb_key_type_t *R /**< */)
363 xcb_generic_iterator_t prev = xcb_xkb_kt_map_entry_end(xcb_xkb_key_type_map_iterator(R));
364 return (xcb_xkb_mod_def_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xkb_mod_def_t, prev.index) + 0);
368 xcb_xkb_key_type_preserve_length (const xcb_xkb_key_type_t *R /**< */)
370 return (R->hasPreserve * R->nMapEntries);
373 xcb_xkb_mod_def_iterator_t
374 xcb_xkb_key_type_preserve_iterator (const xcb_xkb_key_type_t *R /**< */)
376 xcb_xkb_mod_def_iterator_t i;
377 xcb_generic_iterator_t prev = xcb_xkb_kt_map_entry_end(xcb_xkb_key_type_map_iterator(R));
378 i.data = (xcb_xkb_mod_def_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xkb_mod_def_t, prev.index));
379 i.rem = (R->hasPreserve * R->nMapEntries);
380 i.index = (char *) i.data - (char *) R;
381 return i;
384 void
385 xcb_xkb_key_type_next (xcb_xkb_key_type_iterator_t *i /**< */)
387 xcb_xkb_key_type_t *R = i->data;
388 xcb_generic_iterator_t child;
389 child.data = (xcb_xkb_key_type_t *)(((char *)R) + xcb_xkb_key_type_sizeof(R));
390 i->index = (char *) child.data - (char *) i->data;
391 --i->rem;
392 i->data = (xcb_xkb_key_type_t *) child.data;
395 xcb_generic_iterator_t
396 xcb_xkb_key_type_end (xcb_xkb_key_type_iterator_t i /**< */)
398 xcb_generic_iterator_t ret;
399 while(i.rem > 0)
400 xcb_xkb_key_type_next(&i);
401 ret.data = i.data;
402 ret.rem = i.rem;
403 ret.index = i.index;
404 return ret;
408 xcb_xkb_key_sym_map_sizeof (const void *_buffer /**< */)
410 char *xcb_tmp = (char *)_buffer;
411 const xcb_xkb_key_sym_map_t *_aux = (xcb_xkb_key_sym_map_t *)_buffer;
412 unsigned int xcb_buffer_len = 0;
413 unsigned int xcb_block_len = 0;
414 unsigned int xcb_pad = 0;
415 unsigned int xcb_align_to = 0;
418 xcb_block_len += sizeof(xcb_xkb_key_sym_map_t);
419 xcb_tmp += xcb_block_len;
420 xcb_buffer_len += xcb_block_len;
421 xcb_block_len = 0;
422 /* syms */
423 xcb_block_len += _aux->nSyms * sizeof(xcb_keysym_t);
424 xcb_tmp += xcb_block_len;
425 xcb_align_to = ALIGNOF(xcb_keysym_t);
426 /* insert padding */
427 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
428 xcb_buffer_len += xcb_block_len + xcb_pad;
429 if (0 != xcb_pad) {
430 xcb_tmp += xcb_pad;
431 xcb_pad = 0;
433 xcb_block_len = 0;
435 return xcb_buffer_len;
438 xcb_keysym_t *
439 xcb_xkb_key_sym_map_syms (const xcb_xkb_key_sym_map_t *R /**< */)
441 return (xcb_keysym_t *) (R + 1);
445 xcb_xkb_key_sym_map_syms_length (const xcb_xkb_key_sym_map_t *R /**< */)
447 return R->nSyms;
450 xcb_generic_iterator_t
451 xcb_xkb_key_sym_map_syms_end (const xcb_xkb_key_sym_map_t *R /**< */)
453 xcb_generic_iterator_t i;
454 i.data = ((xcb_keysym_t *) (R + 1)) + (R->nSyms);
455 i.rem = 0;
456 i.index = (char *) i.data - (char *) R;
457 return i;
460 void
461 xcb_xkb_key_sym_map_next (xcb_xkb_key_sym_map_iterator_t *i /**< */)
463 xcb_xkb_key_sym_map_t *R = i->data;
464 xcb_generic_iterator_t child;
465 child.data = (xcb_xkb_key_sym_map_t *)(((char *)R) + xcb_xkb_key_sym_map_sizeof(R));
466 i->index = (char *) child.data - (char *) i->data;
467 --i->rem;
468 i->data = (xcb_xkb_key_sym_map_t *) child.data;
471 xcb_generic_iterator_t
472 xcb_xkb_key_sym_map_end (xcb_xkb_key_sym_map_iterator_t i /**< */)
474 xcb_generic_iterator_t ret;
475 while(i.rem > 0)
476 xcb_xkb_key_sym_map_next(&i);
477 ret.data = i.data;
478 ret.rem = i.rem;
479 ret.index = i.index;
480 return ret;
483 void
484 xcb_xkb_common_behavior_next (xcb_xkb_common_behavior_iterator_t *i /**< */)
486 --i->rem;
487 ++i->data;
488 i->index += sizeof(xcb_xkb_common_behavior_t);
491 xcb_generic_iterator_t
492 xcb_xkb_common_behavior_end (xcb_xkb_common_behavior_iterator_t i /**< */)
494 xcb_generic_iterator_t ret;
495 ret.data = i.data + i.rem;
496 ret.index = i.index + ((char *) ret.data - (char *) i.data);
497 ret.rem = 0;
498 return ret;
501 void
502 xcb_xkb_default_behavior_next (xcb_xkb_default_behavior_iterator_t *i /**< */)
504 --i->rem;
505 ++i->data;
506 i->index += sizeof(xcb_xkb_default_behavior_t);
509 xcb_generic_iterator_t
510 xcb_xkb_default_behavior_end (xcb_xkb_default_behavior_iterator_t i /**< */)
512 xcb_generic_iterator_t ret;
513 ret.data = i.data + i.rem;
514 ret.index = i.index + ((char *) ret.data - (char *) i.data);
515 ret.rem = 0;
516 return ret;
519 void
520 xcb_xkb_lock_behavior_next (xcb_xkb_lock_behavior_iterator_t *i /**< */)
522 --i->rem;
523 ++i->data;
524 i->index += sizeof(xcb_xkb_lock_behavior_t);
527 xcb_generic_iterator_t
528 xcb_xkb_lock_behavior_end (xcb_xkb_lock_behavior_iterator_t i /**< */)
530 xcb_generic_iterator_t ret;
531 ret.data = i.data + i.rem;
532 ret.index = i.index + ((char *) ret.data - (char *) i.data);
533 ret.rem = 0;
534 return ret;
537 void
538 xcb_xkb_radio_group_behavior_next (xcb_xkb_radio_group_behavior_iterator_t *i /**< */)
540 --i->rem;
541 ++i->data;
542 i->index += sizeof(xcb_xkb_radio_group_behavior_t);
545 xcb_generic_iterator_t
546 xcb_xkb_radio_group_behavior_end (xcb_xkb_radio_group_behavior_iterator_t i /**< */)
548 xcb_generic_iterator_t ret;
549 ret.data = i.data + i.rem;
550 ret.index = i.index + ((char *) ret.data - (char *) i.data);
551 ret.rem = 0;
552 return ret;
555 void
556 xcb_xkb_overlay_behavior_next (xcb_xkb_overlay_behavior_iterator_t *i /**< */)
558 --i->rem;
559 ++i->data;
560 i->index += sizeof(xcb_xkb_overlay_behavior_t);
563 xcb_generic_iterator_t
564 xcb_xkb_overlay_behavior_end (xcb_xkb_overlay_behavior_iterator_t i /**< */)
566 xcb_generic_iterator_t ret;
567 ret.data = i.data + i.rem;
568 ret.index = i.index + ((char *) ret.data - (char *) i.data);
569 ret.rem = 0;
570 return ret;
573 void
574 xcb_xkb_permament_lock_behavior_next (xcb_xkb_permament_lock_behavior_iterator_t *i /**< */)
576 --i->rem;
577 ++i->data;
578 i->index += sizeof(xcb_xkb_permament_lock_behavior_t);
581 xcb_generic_iterator_t
582 xcb_xkb_permament_lock_behavior_end (xcb_xkb_permament_lock_behavior_iterator_t i /**< */)
584 xcb_generic_iterator_t ret;
585 ret.data = i.data + i.rem;
586 ret.index = i.index + ((char *) ret.data - (char *) i.data);
587 ret.rem = 0;
588 return ret;
591 void
592 xcb_xkb_permament_radio_group_behavior_next (xcb_xkb_permament_radio_group_behavior_iterator_t *i /**< */)
594 --i->rem;
595 ++i->data;
596 i->index += sizeof(xcb_xkb_permament_radio_group_behavior_t);
599 xcb_generic_iterator_t
600 xcb_xkb_permament_radio_group_behavior_end (xcb_xkb_permament_radio_group_behavior_iterator_t i /**< */)
602 xcb_generic_iterator_t ret;
603 ret.data = i.data + i.rem;
604 ret.index = i.index + ((char *) ret.data - (char *) i.data);
605 ret.rem = 0;
606 return ret;
609 void
610 xcb_xkb_permament_overlay_behavior_next (xcb_xkb_permament_overlay_behavior_iterator_t *i /**< */)
612 --i->rem;
613 ++i->data;
614 i->index += sizeof(xcb_xkb_permament_overlay_behavior_t);
617 xcb_generic_iterator_t
618 xcb_xkb_permament_overlay_behavior_end (xcb_xkb_permament_overlay_behavior_iterator_t i /**< */)
620 xcb_generic_iterator_t ret;
621 ret.data = i.data + i.rem;
622 ret.index = i.index + ((char *) ret.data - (char *) i.data);
623 ret.rem = 0;
624 return ret;
627 void
628 xcb_xkb_behavior_next (xcb_xkb_behavior_iterator_t *i /**< */)
630 --i->rem;
631 ++i->data;
632 i->index += sizeof(xcb_xkb_behavior_t);
635 xcb_generic_iterator_t
636 xcb_xkb_behavior_end (xcb_xkb_behavior_iterator_t i /**< */)
638 xcb_generic_iterator_t ret;
639 ret.data = i.data + i.rem;
640 ret.index = i.index + ((char *) ret.data - (char *) i.data);
641 ret.rem = 0;
642 return ret;
645 void
646 xcb_xkb_set_behavior_next (xcb_xkb_set_behavior_iterator_t *i /**< */)
648 --i->rem;
649 ++i->data;
650 i->index += sizeof(xcb_xkb_set_behavior_t);
653 xcb_generic_iterator_t
654 xcb_xkb_set_behavior_end (xcb_xkb_set_behavior_iterator_t i /**< */)
656 xcb_generic_iterator_t ret;
657 ret.data = i.data + i.rem;
658 ret.index = i.index + ((char *) ret.data - (char *) i.data);
659 ret.rem = 0;
660 return ret;
663 void
664 xcb_xkb_set_explicit_next (xcb_xkb_set_explicit_iterator_t *i /**< */)
666 --i->rem;
667 ++i->data;
668 i->index += sizeof(xcb_xkb_set_explicit_t);
671 xcb_generic_iterator_t
672 xcb_xkb_set_explicit_end (xcb_xkb_set_explicit_iterator_t i /**< */)
674 xcb_generic_iterator_t ret;
675 ret.data = i.data + i.rem;
676 ret.index = i.index + ((char *) ret.data - (char *) i.data);
677 ret.rem = 0;
678 return ret;
681 void
682 xcb_xkb_key_mod_map_next (xcb_xkb_key_mod_map_iterator_t *i /**< */)
684 --i->rem;
685 ++i->data;
686 i->index += sizeof(xcb_xkb_key_mod_map_t);
689 xcb_generic_iterator_t
690 xcb_xkb_key_mod_map_end (xcb_xkb_key_mod_map_iterator_t i /**< */)
692 xcb_generic_iterator_t ret;
693 ret.data = i.data + i.rem;
694 ret.index = i.index + ((char *) ret.data - (char *) i.data);
695 ret.rem = 0;
696 return ret;
699 void
700 xcb_xkb_key_v_mod_map_next (xcb_xkb_key_v_mod_map_iterator_t *i /**< */)
702 --i->rem;
703 ++i->data;
704 i->index += sizeof(xcb_xkb_key_v_mod_map_t);
707 xcb_generic_iterator_t
708 xcb_xkb_key_v_mod_map_end (xcb_xkb_key_v_mod_map_iterator_t i /**< */)
710 xcb_generic_iterator_t ret;
711 ret.data = i.data + i.rem;
712 ret.index = i.index + ((char *) ret.data - (char *) i.data);
713 ret.rem = 0;
714 return ret;
717 void
718 xcb_xkb_kt_set_map_entry_next (xcb_xkb_kt_set_map_entry_iterator_t *i /**< */)
720 --i->rem;
721 ++i->data;
722 i->index += sizeof(xcb_xkb_kt_set_map_entry_t);
725 xcb_generic_iterator_t
726 xcb_xkb_kt_set_map_entry_end (xcb_xkb_kt_set_map_entry_iterator_t i /**< */)
728 xcb_generic_iterator_t ret;
729 ret.data = i.data + i.rem;
730 ret.index = i.index + ((char *) ret.data - (char *) i.data);
731 ret.rem = 0;
732 return ret;
736 xcb_xkb_set_key_type_sizeof (const void *_buffer /**< */)
738 char *xcb_tmp = (char *)_buffer;
739 const xcb_xkb_set_key_type_t *_aux = (xcb_xkb_set_key_type_t *)_buffer;
740 unsigned int xcb_buffer_len = 0;
741 unsigned int xcb_block_len = 0;
742 unsigned int xcb_pad = 0;
743 unsigned int xcb_align_to = 0;
746 xcb_block_len += sizeof(xcb_xkb_set_key_type_t);
747 xcb_tmp += xcb_block_len;
748 xcb_buffer_len += xcb_block_len;
749 xcb_block_len = 0;
750 /* entries */
751 xcb_block_len += _aux->nMapEntries * sizeof(xcb_xkb_kt_set_map_entry_t);
752 xcb_tmp += xcb_block_len;
753 xcb_align_to = ALIGNOF(xcb_xkb_kt_set_map_entry_t);
754 /* insert padding */
755 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
756 xcb_buffer_len += xcb_block_len + xcb_pad;
757 if (0 != xcb_pad) {
758 xcb_tmp += xcb_pad;
759 xcb_pad = 0;
761 xcb_block_len = 0;
762 /* preserve_entries */
763 xcb_block_len += (_aux->preserve * _aux->nMapEntries) * sizeof(xcb_xkb_kt_set_map_entry_t);
764 xcb_tmp += xcb_block_len;
765 xcb_align_to = ALIGNOF(xcb_xkb_kt_set_map_entry_t);
766 /* insert padding */
767 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
768 xcb_buffer_len += xcb_block_len + xcb_pad;
769 if (0 != xcb_pad) {
770 xcb_tmp += xcb_pad;
771 xcb_pad = 0;
773 xcb_block_len = 0;
775 return xcb_buffer_len;
778 xcb_xkb_kt_set_map_entry_t *
779 xcb_xkb_set_key_type_entries (const xcb_xkb_set_key_type_t *R /**< */)
781 return (xcb_xkb_kt_set_map_entry_t *) (R + 1);
785 xcb_xkb_set_key_type_entries_length (const xcb_xkb_set_key_type_t *R /**< */)
787 return R->nMapEntries;
790 xcb_xkb_kt_set_map_entry_iterator_t
791 xcb_xkb_set_key_type_entries_iterator (const xcb_xkb_set_key_type_t *R /**< */)
793 xcb_xkb_kt_set_map_entry_iterator_t i;
794 i.data = (xcb_xkb_kt_set_map_entry_t *) (R + 1);
795 i.rem = R->nMapEntries;
796 i.index = (char *) i.data - (char *) R;
797 return i;
800 xcb_xkb_kt_set_map_entry_t *
801 xcb_xkb_set_key_type_preserve_entries (const xcb_xkb_set_key_type_t *R /**< */)
803 xcb_generic_iterator_t prev = xcb_xkb_kt_set_map_entry_end(xcb_xkb_set_key_type_entries_iterator(R));
804 return (xcb_xkb_kt_set_map_entry_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xkb_kt_set_map_entry_t, prev.index) + 0);
808 xcb_xkb_set_key_type_preserve_entries_length (const xcb_xkb_set_key_type_t *R /**< */)
810 return (R->preserve * R->nMapEntries);
813 xcb_xkb_kt_set_map_entry_iterator_t
814 xcb_xkb_set_key_type_preserve_entries_iterator (const xcb_xkb_set_key_type_t *R /**< */)
816 xcb_xkb_kt_set_map_entry_iterator_t i;
817 xcb_generic_iterator_t prev = xcb_xkb_kt_set_map_entry_end(xcb_xkb_set_key_type_entries_iterator(R));
818 i.data = (xcb_xkb_kt_set_map_entry_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xkb_kt_set_map_entry_t, prev.index));
819 i.rem = (R->preserve * R->nMapEntries);
820 i.index = (char *) i.data - (char *) R;
821 return i;
824 void
825 xcb_xkb_set_key_type_next (xcb_xkb_set_key_type_iterator_t *i /**< */)
827 xcb_xkb_set_key_type_t *R = i->data;
828 xcb_generic_iterator_t child;
829 child.data = (xcb_xkb_set_key_type_t *)(((char *)R) + xcb_xkb_set_key_type_sizeof(R));
830 i->index = (char *) child.data - (char *) i->data;
831 --i->rem;
832 i->data = (xcb_xkb_set_key_type_t *) child.data;
835 xcb_generic_iterator_t
836 xcb_xkb_set_key_type_end (xcb_xkb_set_key_type_iterator_t i /**< */)
838 xcb_generic_iterator_t ret;
839 while(i.rem > 0)
840 xcb_xkb_set_key_type_next(&i);
841 ret.data = i.data;
842 ret.rem = i.rem;
843 ret.index = i.index;
844 return ret;
847 void
848 xcb_xkb_string8_next (xcb_xkb_string8_iterator_t *i /**< */)
850 --i->rem;
851 ++i->data;
852 i->index += sizeof(xcb_xkb_string8_t);
855 xcb_generic_iterator_t
856 xcb_xkb_string8_end (xcb_xkb_string8_iterator_t i /**< */)
858 xcb_generic_iterator_t ret;
859 ret.data = i.data + i.rem;
860 ret.index = i.index + ((char *) ret.data - (char *) i.data);
861 ret.rem = 0;
862 return ret;
866 xcb_xkb_outline_sizeof (const void *_buffer /**< */)
868 char *xcb_tmp = (char *)_buffer;
869 const xcb_xkb_outline_t *_aux = (xcb_xkb_outline_t *)_buffer;
870 unsigned int xcb_buffer_len = 0;
871 unsigned int xcb_block_len = 0;
872 unsigned int xcb_pad = 0;
873 unsigned int xcb_align_to = 0;
876 xcb_block_len += sizeof(xcb_xkb_outline_t);
877 xcb_tmp += xcb_block_len;
878 xcb_buffer_len += xcb_block_len;
879 xcb_block_len = 0;
880 /* points */
881 xcb_block_len += _aux->nPoints * sizeof(xcb_point_t);
882 xcb_tmp += xcb_block_len;
883 xcb_align_to = ALIGNOF(xcb_point_t);
884 /* insert padding */
885 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
886 xcb_buffer_len += xcb_block_len + xcb_pad;
887 if (0 != xcb_pad) {
888 xcb_tmp += xcb_pad;
889 xcb_pad = 0;
891 xcb_block_len = 0;
893 return xcb_buffer_len;
896 xcb_point_t *
897 xcb_xkb_outline_points (const xcb_xkb_outline_t *R /**< */)
899 return (xcb_point_t *) (R + 1);
903 xcb_xkb_outline_points_length (const xcb_xkb_outline_t *R /**< */)
905 return R->nPoints;
908 xcb_point_iterator_t
909 xcb_xkb_outline_points_iterator (const xcb_xkb_outline_t *R /**< */)
911 xcb_point_iterator_t i;
912 i.data = (xcb_point_t *) (R + 1);
913 i.rem = R->nPoints;
914 i.index = (char *) i.data - (char *) R;
915 return i;
918 void
919 xcb_xkb_outline_next (xcb_xkb_outline_iterator_t *i /**< */)
921 xcb_xkb_outline_t *R = i->data;
922 xcb_generic_iterator_t child;
923 child.data = (xcb_xkb_outline_t *)(((char *)R) + xcb_xkb_outline_sizeof(R));
924 i->index = (char *) child.data - (char *) i->data;
925 --i->rem;
926 i->data = (xcb_xkb_outline_t *) child.data;
929 xcb_generic_iterator_t
930 xcb_xkb_outline_end (xcb_xkb_outline_iterator_t i /**< */)
932 xcb_generic_iterator_t ret;
933 while(i.rem > 0)
934 xcb_xkb_outline_next(&i);
935 ret.data = i.data;
936 ret.rem = i.rem;
937 ret.index = i.index;
938 return ret;
942 xcb_xkb_shape_sizeof (const void *_buffer /**< */)
944 char *xcb_tmp = (char *)_buffer;
945 const xcb_xkb_shape_t *_aux = (xcb_xkb_shape_t *)_buffer;
946 unsigned int xcb_buffer_len = 0;
947 unsigned int xcb_block_len = 0;
948 unsigned int xcb_pad = 0;
949 unsigned int xcb_align_to = 0;
951 unsigned int i;
952 unsigned int xcb_tmp_len;
954 xcb_block_len += sizeof(xcb_xkb_shape_t);
955 xcb_tmp += xcb_block_len;
956 xcb_buffer_len += xcb_block_len;
957 xcb_block_len = 0;
958 /* outlines */
959 for(i=0; i<_aux->nOutlines; i++) {
960 xcb_tmp_len = xcb_xkb_outline_sizeof(xcb_tmp);
961 xcb_block_len += xcb_tmp_len;
962 xcb_tmp += xcb_tmp_len;
964 xcb_align_to = ALIGNOF(xcb_xkb_outline_t);
965 /* insert padding */
966 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
967 xcb_buffer_len += xcb_block_len + xcb_pad;
968 if (0 != xcb_pad) {
969 xcb_tmp += xcb_pad;
970 xcb_pad = 0;
972 xcb_block_len = 0;
974 return xcb_buffer_len;
978 xcb_xkb_shape_outlines_length (const xcb_xkb_shape_t *R /**< */)
980 return R->nOutlines;
983 xcb_xkb_outline_iterator_t
984 xcb_xkb_shape_outlines_iterator (const xcb_xkb_shape_t *R /**< */)
986 xcb_xkb_outline_iterator_t i;
987 i.data = (xcb_xkb_outline_t *) (R + 1);
988 i.rem = R->nOutlines;
989 i.index = (char *) i.data - (char *) R;
990 return i;
993 void
994 xcb_xkb_shape_next (xcb_xkb_shape_iterator_t *i /**< */)
996 xcb_xkb_shape_t *R = i->data;
997 xcb_generic_iterator_t child;
998 child.data = (xcb_xkb_shape_t *)(((char *)R) + xcb_xkb_shape_sizeof(R));
999 i->index = (char *) child.data - (char *) i->data;
1000 --i->rem;
1001 i->data = (xcb_xkb_shape_t *) child.data;
1004 xcb_generic_iterator_t
1005 xcb_xkb_shape_end (xcb_xkb_shape_iterator_t i /**< */)
1007 xcb_generic_iterator_t ret;
1008 while(i.rem > 0)
1009 xcb_xkb_shape_next(&i);
1010 ret.data = i.data;
1011 ret.rem = i.rem;
1012 ret.index = i.index;
1013 return ret;
1016 void
1017 xcb_xkb_key_next (xcb_xkb_key_iterator_t *i /**< */)
1019 --i->rem;
1020 ++i->data;
1021 i->index += sizeof(xcb_xkb_key_t);
1024 xcb_generic_iterator_t
1025 xcb_xkb_key_end (xcb_xkb_key_iterator_t i /**< */)
1027 xcb_generic_iterator_t ret;
1028 ret.data = i.data + i.rem;
1029 ret.index = i.index + ((char *) ret.data - (char *) i.data);
1030 ret.rem = 0;
1031 return ret;
1034 void
1035 xcb_xkb_overlay_key_next (xcb_xkb_overlay_key_iterator_t *i /**< */)
1037 --i->rem;
1038 ++i->data;
1039 i->index += sizeof(xcb_xkb_overlay_key_t);
1042 xcb_generic_iterator_t
1043 xcb_xkb_overlay_key_end (xcb_xkb_overlay_key_iterator_t i /**< */)
1045 xcb_generic_iterator_t ret;
1046 ret.data = i.data + i.rem;
1047 ret.index = i.index + ((char *) ret.data - (char *) i.data);
1048 ret.rem = 0;
1049 return ret;
1053 xcb_xkb_overlay_row_sizeof (const void *_buffer /**< */)
1055 char *xcb_tmp = (char *)_buffer;
1056 const xcb_xkb_overlay_row_t *_aux = (xcb_xkb_overlay_row_t *)_buffer;
1057 unsigned int xcb_buffer_len = 0;
1058 unsigned int xcb_block_len = 0;
1059 unsigned int xcb_pad = 0;
1060 unsigned int xcb_align_to = 0;
1063 xcb_block_len += sizeof(xcb_xkb_overlay_row_t);
1064 xcb_tmp += xcb_block_len;
1065 xcb_buffer_len += xcb_block_len;
1066 xcb_block_len = 0;
1067 /* keys */
1068 xcb_block_len += _aux->nKeys * sizeof(xcb_xkb_overlay_key_t);
1069 xcb_tmp += xcb_block_len;
1070 xcb_align_to = ALIGNOF(xcb_xkb_overlay_key_t);
1071 /* insert padding */
1072 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1073 xcb_buffer_len += xcb_block_len + xcb_pad;
1074 if (0 != xcb_pad) {
1075 xcb_tmp += xcb_pad;
1076 xcb_pad = 0;
1078 xcb_block_len = 0;
1080 return xcb_buffer_len;
1083 xcb_xkb_overlay_key_t *
1084 xcb_xkb_overlay_row_keys (const xcb_xkb_overlay_row_t *R /**< */)
1086 return (xcb_xkb_overlay_key_t *) (R + 1);
1090 xcb_xkb_overlay_row_keys_length (const xcb_xkb_overlay_row_t *R /**< */)
1092 return R->nKeys;
1095 xcb_xkb_overlay_key_iterator_t
1096 xcb_xkb_overlay_row_keys_iterator (const xcb_xkb_overlay_row_t *R /**< */)
1098 xcb_xkb_overlay_key_iterator_t i;
1099 i.data = (xcb_xkb_overlay_key_t *) (R + 1);
1100 i.rem = R->nKeys;
1101 i.index = (char *) i.data - (char *) R;
1102 return i;
1105 void
1106 xcb_xkb_overlay_row_next (xcb_xkb_overlay_row_iterator_t *i /**< */)
1108 xcb_xkb_overlay_row_t *R = i->data;
1109 xcb_generic_iterator_t child;
1110 child.data = (xcb_xkb_overlay_row_t *)(((char *)R) + xcb_xkb_overlay_row_sizeof(R));
1111 i->index = (char *) child.data - (char *) i->data;
1112 --i->rem;
1113 i->data = (xcb_xkb_overlay_row_t *) child.data;
1116 xcb_generic_iterator_t
1117 xcb_xkb_overlay_row_end (xcb_xkb_overlay_row_iterator_t i /**< */)
1119 xcb_generic_iterator_t ret;
1120 while(i.rem > 0)
1121 xcb_xkb_overlay_row_next(&i);
1122 ret.data = i.data;
1123 ret.rem = i.rem;
1124 ret.index = i.index;
1125 return ret;
1129 xcb_xkb_overlay_sizeof (const void *_buffer /**< */)
1131 char *xcb_tmp = (char *)_buffer;
1132 const xcb_xkb_overlay_t *_aux = (xcb_xkb_overlay_t *)_buffer;
1133 unsigned int xcb_buffer_len = 0;
1134 unsigned int xcb_block_len = 0;
1135 unsigned int xcb_pad = 0;
1136 unsigned int xcb_align_to = 0;
1138 unsigned int i;
1139 unsigned int xcb_tmp_len;
1141 xcb_block_len += sizeof(xcb_xkb_overlay_t);
1142 xcb_tmp += xcb_block_len;
1143 xcb_buffer_len += xcb_block_len;
1144 xcb_block_len = 0;
1145 /* rows */
1146 for(i=0; i<_aux->nRows; i++) {
1147 xcb_tmp_len = xcb_xkb_overlay_row_sizeof(xcb_tmp);
1148 xcb_block_len += xcb_tmp_len;
1149 xcb_tmp += xcb_tmp_len;
1151 xcb_align_to = ALIGNOF(xcb_xkb_overlay_row_t);
1152 /* insert padding */
1153 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1154 xcb_buffer_len += xcb_block_len + xcb_pad;
1155 if (0 != xcb_pad) {
1156 xcb_tmp += xcb_pad;
1157 xcb_pad = 0;
1159 xcb_block_len = 0;
1161 return xcb_buffer_len;
1165 xcb_xkb_overlay_rows_length (const xcb_xkb_overlay_t *R /**< */)
1167 return R->nRows;
1170 xcb_xkb_overlay_row_iterator_t
1171 xcb_xkb_overlay_rows_iterator (const xcb_xkb_overlay_t *R /**< */)
1173 xcb_xkb_overlay_row_iterator_t i;
1174 i.data = (xcb_xkb_overlay_row_t *) (R + 1);
1175 i.rem = R->nRows;
1176 i.index = (char *) i.data - (char *) R;
1177 return i;
1180 void
1181 xcb_xkb_overlay_next (xcb_xkb_overlay_iterator_t *i /**< */)
1183 xcb_xkb_overlay_t *R = i->data;
1184 xcb_generic_iterator_t child;
1185 child.data = (xcb_xkb_overlay_t *)(((char *)R) + xcb_xkb_overlay_sizeof(R));
1186 i->index = (char *) child.data - (char *) i->data;
1187 --i->rem;
1188 i->data = (xcb_xkb_overlay_t *) child.data;
1191 xcb_generic_iterator_t
1192 xcb_xkb_overlay_end (xcb_xkb_overlay_iterator_t i /**< */)
1194 xcb_generic_iterator_t ret;
1195 while(i.rem > 0)
1196 xcb_xkb_overlay_next(&i);
1197 ret.data = i.data;
1198 ret.rem = i.rem;
1199 ret.index = i.index;
1200 return ret;
1204 xcb_xkb_row_sizeof (const void *_buffer /**< */)
1206 char *xcb_tmp = (char *)_buffer;
1207 const xcb_xkb_row_t *_aux = (xcb_xkb_row_t *)_buffer;
1208 unsigned int xcb_buffer_len = 0;
1209 unsigned int xcb_block_len = 0;
1210 unsigned int xcb_pad = 0;
1211 unsigned int xcb_align_to = 0;
1214 xcb_block_len += sizeof(xcb_xkb_row_t);
1215 xcb_tmp += xcb_block_len;
1216 xcb_buffer_len += xcb_block_len;
1217 xcb_block_len = 0;
1218 /* keys */
1219 xcb_block_len += _aux->nKeys * sizeof(xcb_xkb_key_t);
1220 xcb_tmp += xcb_block_len;
1221 xcb_align_to = ALIGNOF(xcb_xkb_key_t);
1222 /* insert padding */
1223 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1224 xcb_buffer_len += xcb_block_len + xcb_pad;
1225 if (0 != xcb_pad) {
1226 xcb_tmp += xcb_pad;
1227 xcb_pad = 0;
1229 xcb_block_len = 0;
1231 return xcb_buffer_len;
1234 xcb_xkb_key_t *
1235 xcb_xkb_row_keys (const xcb_xkb_row_t *R /**< */)
1237 return (xcb_xkb_key_t *) (R + 1);
1241 xcb_xkb_row_keys_length (const xcb_xkb_row_t *R /**< */)
1243 return R->nKeys;
1246 xcb_xkb_key_iterator_t
1247 xcb_xkb_row_keys_iterator (const xcb_xkb_row_t *R /**< */)
1249 xcb_xkb_key_iterator_t i;
1250 i.data = (xcb_xkb_key_t *) (R + 1);
1251 i.rem = R->nKeys;
1252 i.index = (char *) i.data - (char *) R;
1253 return i;
1256 void
1257 xcb_xkb_row_next (xcb_xkb_row_iterator_t *i /**< */)
1259 xcb_xkb_row_t *R = i->data;
1260 xcb_generic_iterator_t child;
1261 child.data = (xcb_xkb_row_t *)(((char *)R) + xcb_xkb_row_sizeof(R));
1262 i->index = (char *) child.data - (char *) i->data;
1263 --i->rem;
1264 i->data = (xcb_xkb_row_t *) child.data;
1267 xcb_generic_iterator_t
1268 xcb_xkb_row_end (xcb_xkb_row_iterator_t i /**< */)
1270 xcb_generic_iterator_t ret;
1271 while(i.rem > 0)
1272 xcb_xkb_row_next(&i);
1273 ret.data = i.data;
1274 ret.rem = i.rem;
1275 ret.index = i.index;
1276 return ret;
1280 xcb_xkb_listing_sizeof (const void *_buffer /**< */)
1282 char *xcb_tmp = (char *)_buffer;
1283 const xcb_xkb_listing_t *_aux = (xcb_xkb_listing_t *)_buffer;
1284 unsigned int xcb_buffer_len = 0;
1285 unsigned int xcb_block_len = 0;
1286 unsigned int xcb_pad = 0;
1287 unsigned int xcb_align_to = 0;
1290 xcb_block_len += sizeof(xcb_xkb_listing_t);
1291 xcb_tmp += xcb_block_len;
1292 xcb_buffer_len += xcb_block_len;
1293 xcb_block_len = 0;
1294 /* string */
1295 xcb_block_len += _aux->length * sizeof(xcb_xkb_string8_t);
1296 xcb_tmp += xcb_block_len;
1297 xcb_align_to = ALIGNOF(xcb_xkb_string8_t);
1298 /* insert padding */
1299 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1300 xcb_buffer_len += xcb_block_len + xcb_pad;
1301 if (0 != xcb_pad) {
1302 xcb_tmp += xcb_pad;
1303 xcb_pad = 0;
1305 xcb_block_len = 0;
1307 return xcb_buffer_len;
1310 xcb_xkb_string8_t *
1311 xcb_xkb_listing_string (const xcb_xkb_listing_t *R /**< */)
1313 return (xcb_xkb_string8_t *) (R + 1);
1317 xcb_xkb_listing_string_length (const xcb_xkb_listing_t *R /**< */)
1319 return R->length;
1322 xcb_generic_iterator_t
1323 xcb_xkb_listing_string_end (const xcb_xkb_listing_t *R /**< */)
1325 xcb_generic_iterator_t i;
1326 i.data = ((xcb_xkb_string8_t *) (R + 1)) + (R->length);
1327 i.rem = 0;
1328 i.index = (char *) i.data - (char *) R;
1329 return i;
1332 void
1333 xcb_xkb_listing_next (xcb_xkb_listing_iterator_t *i /**< */)
1335 xcb_xkb_listing_t *R = i->data;
1336 xcb_generic_iterator_t child;
1337 child.data = (xcb_xkb_listing_t *)(((char *)R) + xcb_xkb_listing_sizeof(R));
1338 i->index = (char *) child.data - (char *) i->data;
1339 --i->rem;
1340 i->data = (xcb_xkb_listing_t *) child.data;
1343 xcb_generic_iterator_t
1344 xcb_xkb_listing_end (xcb_xkb_listing_iterator_t i /**< */)
1346 xcb_generic_iterator_t ret;
1347 while(i.rem > 0)
1348 xcb_xkb_listing_next(&i);
1349 ret.data = i.data;
1350 ret.rem = i.rem;
1351 ret.index = i.index;
1352 return ret;
1356 xcb_xkb_device_led_info_sizeof (const void *_buffer /**< */)
1358 char *xcb_tmp = (char *)_buffer;
1359 const xcb_xkb_device_led_info_t *_aux = (xcb_xkb_device_led_info_t *)_buffer;
1360 unsigned int xcb_buffer_len = 0;
1361 unsigned int xcb_block_len = 0;
1362 unsigned int xcb_pad = 0;
1363 unsigned int xcb_align_to = 0;
1366 xcb_block_len += sizeof(xcb_xkb_device_led_info_t);
1367 xcb_tmp += xcb_block_len;
1368 xcb_buffer_len += xcb_block_len;
1369 xcb_block_len = 0;
1370 /* names */
1371 xcb_block_len += xcb_popcount(_aux->namesPresent) * sizeof(uint32_t);
1372 xcb_tmp += xcb_block_len;
1373 xcb_align_to = ALIGNOF(xcb_atom_t);
1374 /* insert padding */
1375 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1376 xcb_buffer_len += xcb_block_len + xcb_pad;
1377 if (0 != xcb_pad) {
1378 xcb_tmp += xcb_pad;
1379 xcb_pad = 0;
1381 xcb_block_len = 0;
1382 /* maps */
1383 xcb_block_len += xcb_popcount(_aux->mapsPresent) * sizeof(xcb_xkb_indicator_map_t);
1384 xcb_tmp += xcb_block_len;
1385 xcb_align_to = ALIGNOF(xcb_xkb_indicator_map_t);
1386 /* insert padding */
1387 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1388 xcb_buffer_len += xcb_block_len + xcb_pad;
1389 if (0 != xcb_pad) {
1390 xcb_tmp += xcb_pad;
1391 xcb_pad = 0;
1393 xcb_block_len = 0;
1395 return xcb_buffer_len;
1398 xcb_atom_t *
1399 xcb_xkb_device_led_info_names (const xcb_xkb_device_led_info_t *R /**< */)
1401 return (xcb_atom_t *) (R + 1);
1405 xcb_xkb_device_led_info_names_length (const xcb_xkb_device_led_info_t *R /**< */)
1407 return xcb_popcount(R->namesPresent);
1410 xcb_generic_iterator_t
1411 xcb_xkb_device_led_info_names_end (const xcb_xkb_device_led_info_t *R /**< */)
1413 xcb_generic_iterator_t i;
1414 i.data = ((xcb_atom_t *) (R + 1)) + (xcb_popcount(R->namesPresent));
1415 i.rem = 0;
1416 i.index = (char *) i.data - (char *) R;
1417 return i;
1420 xcb_xkb_indicator_map_t *
1421 xcb_xkb_device_led_info_maps (const xcb_xkb_device_led_info_t *R /**< */)
1423 xcb_generic_iterator_t prev = xcb_xkb_device_led_info_names_end(R);
1424 return (xcb_xkb_indicator_map_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xkb_indicator_map_t, prev.index) + 0);
1428 xcb_xkb_device_led_info_maps_length (const xcb_xkb_device_led_info_t *R /**< */)
1430 return xcb_popcount(R->mapsPresent);
1433 xcb_xkb_indicator_map_iterator_t
1434 xcb_xkb_device_led_info_maps_iterator (const xcb_xkb_device_led_info_t *R /**< */)
1436 xcb_xkb_indicator_map_iterator_t i;
1437 xcb_generic_iterator_t prev = xcb_xkb_device_led_info_names_end(R);
1438 i.data = (xcb_xkb_indicator_map_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xkb_indicator_map_t, prev.index));
1439 i.rem = xcb_popcount(R->mapsPresent);
1440 i.index = (char *) i.data - (char *) R;
1441 return i;
1444 void
1445 xcb_xkb_device_led_info_next (xcb_xkb_device_led_info_iterator_t *i /**< */)
1447 xcb_xkb_device_led_info_t *R = i->data;
1448 xcb_generic_iterator_t child;
1449 child.data = (xcb_xkb_device_led_info_t *)(((char *)R) + xcb_xkb_device_led_info_sizeof(R));
1450 i->index = (char *) child.data - (char *) i->data;
1451 --i->rem;
1452 i->data = (xcb_xkb_device_led_info_t *) child.data;
1455 xcb_generic_iterator_t
1456 xcb_xkb_device_led_info_end (xcb_xkb_device_led_info_iterator_t i /**< */)
1458 xcb_generic_iterator_t ret;
1459 while(i.rem > 0)
1460 xcb_xkb_device_led_info_next(&i);
1461 ret.data = i.data;
1462 ret.rem = i.rem;
1463 ret.index = i.index;
1464 return ret;
1467 void
1468 xcb_xkb_sa_no_action_next (xcb_xkb_sa_no_action_iterator_t *i /**< */)
1470 --i->rem;
1471 ++i->data;
1472 i->index += sizeof(xcb_xkb_sa_no_action_t);
1475 xcb_generic_iterator_t
1476 xcb_xkb_sa_no_action_end (xcb_xkb_sa_no_action_iterator_t i /**< */)
1478 xcb_generic_iterator_t ret;
1479 ret.data = i.data + i.rem;
1480 ret.index = i.index + ((char *) ret.data - (char *) i.data);
1481 ret.rem = 0;
1482 return ret;
1485 void
1486 xcb_xkb_sa_set_mods_next (xcb_xkb_sa_set_mods_iterator_t *i /**< */)
1488 --i->rem;
1489 ++i->data;
1490 i->index += sizeof(xcb_xkb_sa_set_mods_t);
1493 xcb_generic_iterator_t
1494 xcb_xkb_sa_set_mods_end (xcb_xkb_sa_set_mods_iterator_t i /**< */)
1496 xcb_generic_iterator_t ret;
1497 ret.data = i.data + i.rem;
1498 ret.index = i.index + ((char *) ret.data - (char *) i.data);
1499 ret.rem = 0;
1500 return ret;
1503 void
1504 xcb_xkb_sa_latch_mods_next (xcb_xkb_sa_latch_mods_iterator_t *i /**< */)
1506 --i->rem;
1507 ++i->data;
1508 i->index += sizeof(xcb_xkb_sa_latch_mods_t);
1511 xcb_generic_iterator_t
1512 xcb_xkb_sa_latch_mods_end (xcb_xkb_sa_latch_mods_iterator_t i /**< */)
1514 xcb_generic_iterator_t ret;
1515 ret.data = i.data + i.rem;
1516 ret.index = i.index + ((char *) ret.data - (char *) i.data);
1517 ret.rem = 0;
1518 return ret;
1521 void
1522 xcb_xkb_sa_lock_mods_next (xcb_xkb_sa_lock_mods_iterator_t *i /**< */)
1524 --i->rem;
1525 ++i->data;
1526 i->index += sizeof(xcb_xkb_sa_lock_mods_t);
1529 xcb_generic_iterator_t
1530 xcb_xkb_sa_lock_mods_end (xcb_xkb_sa_lock_mods_iterator_t i /**< */)
1532 xcb_generic_iterator_t ret;
1533 ret.data = i.data + i.rem;
1534 ret.index = i.index + ((char *) ret.data - (char *) i.data);
1535 ret.rem = 0;
1536 return ret;
1539 void
1540 xcb_xkb_sa_set_group_next (xcb_xkb_sa_set_group_iterator_t *i /**< */)
1542 --i->rem;
1543 ++i->data;
1544 i->index += sizeof(xcb_xkb_sa_set_group_t);
1547 xcb_generic_iterator_t
1548 xcb_xkb_sa_set_group_end (xcb_xkb_sa_set_group_iterator_t i /**< */)
1550 xcb_generic_iterator_t ret;
1551 ret.data = i.data + i.rem;
1552 ret.index = i.index + ((char *) ret.data - (char *) i.data);
1553 ret.rem = 0;
1554 return ret;
1557 void
1558 xcb_xkb_sa_latch_group_next (xcb_xkb_sa_latch_group_iterator_t *i /**< */)
1560 --i->rem;
1561 ++i->data;
1562 i->index += sizeof(xcb_xkb_sa_latch_group_t);
1565 xcb_generic_iterator_t
1566 xcb_xkb_sa_latch_group_end (xcb_xkb_sa_latch_group_iterator_t i /**< */)
1568 xcb_generic_iterator_t ret;
1569 ret.data = i.data + i.rem;
1570 ret.index = i.index + ((char *) ret.data - (char *) i.data);
1571 ret.rem = 0;
1572 return ret;
1575 void
1576 xcb_xkb_sa_lock_group_next (xcb_xkb_sa_lock_group_iterator_t *i /**< */)
1578 --i->rem;
1579 ++i->data;
1580 i->index += sizeof(xcb_xkb_sa_lock_group_t);
1583 xcb_generic_iterator_t
1584 xcb_xkb_sa_lock_group_end (xcb_xkb_sa_lock_group_iterator_t i /**< */)
1586 xcb_generic_iterator_t ret;
1587 ret.data = i.data + i.rem;
1588 ret.index = i.index + ((char *) ret.data - (char *) i.data);
1589 ret.rem = 0;
1590 return ret;
1593 void
1594 xcb_xkb_sa_move_ptr_next (xcb_xkb_sa_move_ptr_iterator_t *i /**< */)
1596 --i->rem;
1597 ++i->data;
1598 i->index += sizeof(xcb_xkb_sa_move_ptr_t);
1601 xcb_generic_iterator_t
1602 xcb_xkb_sa_move_ptr_end (xcb_xkb_sa_move_ptr_iterator_t i /**< */)
1604 xcb_generic_iterator_t ret;
1605 ret.data = i.data + i.rem;
1606 ret.index = i.index + ((char *) ret.data - (char *) i.data);
1607 ret.rem = 0;
1608 return ret;
1611 void
1612 xcb_xkb_sa_ptr_btn_next (xcb_xkb_sa_ptr_btn_iterator_t *i /**< */)
1614 --i->rem;
1615 ++i->data;
1616 i->index += sizeof(xcb_xkb_sa_ptr_btn_t);
1619 xcb_generic_iterator_t
1620 xcb_xkb_sa_ptr_btn_end (xcb_xkb_sa_ptr_btn_iterator_t i /**< */)
1622 xcb_generic_iterator_t ret;
1623 ret.data = i.data + i.rem;
1624 ret.index = i.index + ((char *) ret.data - (char *) i.data);
1625 ret.rem = 0;
1626 return ret;
1629 void
1630 xcb_xkb_sa_lock_ptr_btn_next (xcb_xkb_sa_lock_ptr_btn_iterator_t *i /**< */)
1632 --i->rem;
1633 ++i->data;
1634 i->index += sizeof(xcb_xkb_sa_lock_ptr_btn_t);
1637 xcb_generic_iterator_t
1638 xcb_xkb_sa_lock_ptr_btn_end (xcb_xkb_sa_lock_ptr_btn_iterator_t i /**< */)
1640 xcb_generic_iterator_t ret;
1641 ret.data = i.data + i.rem;
1642 ret.index = i.index + ((char *) ret.data - (char *) i.data);
1643 ret.rem = 0;
1644 return ret;
1647 void
1648 xcb_xkb_sa_set_ptr_dflt_next (xcb_xkb_sa_set_ptr_dflt_iterator_t *i /**< */)
1650 --i->rem;
1651 ++i->data;
1652 i->index += sizeof(xcb_xkb_sa_set_ptr_dflt_t);
1655 xcb_generic_iterator_t
1656 xcb_xkb_sa_set_ptr_dflt_end (xcb_xkb_sa_set_ptr_dflt_iterator_t i /**< */)
1658 xcb_generic_iterator_t ret;
1659 ret.data = i.data + i.rem;
1660 ret.index = i.index + ((char *) ret.data - (char *) i.data);
1661 ret.rem = 0;
1662 return ret;
1665 void
1666 xcb_xkb_sa_iso_lock_next (xcb_xkb_sa_iso_lock_iterator_t *i /**< */)
1668 --i->rem;
1669 ++i->data;
1670 i->index += sizeof(xcb_xkb_sa_iso_lock_t);
1673 xcb_generic_iterator_t
1674 xcb_xkb_sa_iso_lock_end (xcb_xkb_sa_iso_lock_iterator_t i /**< */)
1676 xcb_generic_iterator_t ret;
1677 ret.data = i.data + i.rem;
1678 ret.index = i.index + ((char *) ret.data - (char *) i.data);
1679 ret.rem = 0;
1680 return ret;
1683 void
1684 xcb_xkb_sa_terminate_next (xcb_xkb_sa_terminate_iterator_t *i /**< */)
1686 --i->rem;
1687 ++i->data;
1688 i->index += sizeof(xcb_xkb_sa_terminate_t);
1691 xcb_generic_iterator_t
1692 xcb_xkb_sa_terminate_end (xcb_xkb_sa_terminate_iterator_t i /**< */)
1694 xcb_generic_iterator_t ret;
1695 ret.data = i.data + i.rem;
1696 ret.index = i.index + ((char *) ret.data - (char *) i.data);
1697 ret.rem = 0;
1698 return ret;
1701 void
1702 xcb_xkb_sa_switch_screen_next (xcb_xkb_sa_switch_screen_iterator_t *i /**< */)
1704 --i->rem;
1705 ++i->data;
1706 i->index += sizeof(xcb_xkb_sa_switch_screen_t);
1709 xcb_generic_iterator_t
1710 xcb_xkb_sa_switch_screen_end (xcb_xkb_sa_switch_screen_iterator_t i /**< */)
1712 xcb_generic_iterator_t ret;
1713 ret.data = i.data + i.rem;
1714 ret.index = i.index + ((char *) ret.data - (char *) i.data);
1715 ret.rem = 0;
1716 return ret;
1719 void
1720 xcb_xkb_sa_set_controls_next (xcb_xkb_sa_set_controls_iterator_t *i /**< */)
1722 --i->rem;
1723 ++i->data;
1724 i->index += sizeof(xcb_xkb_sa_set_controls_t);
1727 xcb_generic_iterator_t
1728 xcb_xkb_sa_set_controls_end (xcb_xkb_sa_set_controls_iterator_t i /**< */)
1730 xcb_generic_iterator_t ret;
1731 ret.data = i.data + i.rem;
1732 ret.index = i.index + ((char *) ret.data - (char *) i.data);
1733 ret.rem = 0;
1734 return ret;
1737 void
1738 xcb_xkb_sa_lock_controls_next (xcb_xkb_sa_lock_controls_iterator_t *i /**< */)
1740 --i->rem;
1741 ++i->data;
1742 i->index += sizeof(xcb_xkb_sa_lock_controls_t);
1745 xcb_generic_iterator_t
1746 xcb_xkb_sa_lock_controls_end (xcb_xkb_sa_lock_controls_iterator_t i /**< */)
1748 xcb_generic_iterator_t ret;
1749 ret.data = i.data + i.rem;
1750 ret.index = i.index + ((char *) ret.data - (char *) i.data);
1751 ret.rem = 0;
1752 return ret;
1755 void
1756 xcb_xkb_sa_action_message_next (xcb_xkb_sa_action_message_iterator_t *i /**< */)
1758 --i->rem;
1759 ++i->data;
1760 i->index += sizeof(xcb_xkb_sa_action_message_t);
1763 xcb_generic_iterator_t
1764 xcb_xkb_sa_action_message_end (xcb_xkb_sa_action_message_iterator_t i /**< */)
1766 xcb_generic_iterator_t ret;
1767 ret.data = i.data + i.rem;
1768 ret.index = i.index + ((char *) ret.data - (char *) i.data);
1769 ret.rem = 0;
1770 return ret;
1773 void
1774 xcb_xkb_sa_redirect_key_next (xcb_xkb_sa_redirect_key_iterator_t *i /**< */)
1776 --i->rem;
1777 ++i->data;
1778 i->index += sizeof(xcb_xkb_sa_redirect_key_t);
1781 xcb_generic_iterator_t
1782 xcb_xkb_sa_redirect_key_end (xcb_xkb_sa_redirect_key_iterator_t i /**< */)
1784 xcb_generic_iterator_t ret;
1785 ret.data = i.data + i.rem;
1786 ret.index = i.index + ((char *) ret.data - (char *) i.data);
1787 ret.rem = 0;
1788 return ret;
1791 void
1792 xcb_xkb_sa_device_btn_next (xcb_xkb_sa_device_btn_iterator_t *i /**< */)
1794 --i->rem;
1795 ++i->data;
1796 i->index += sizeof(xcb_xkb_sa_device_btn_t);
1799 xcb_generic_iterator_t
1800 xcb_xkb_sa_device_btn_end (xcb_xkb_sa_device_btn_iterator_t i /**< */)
1802 xcb_generic_iterator_t ret;
1803 ret.data = i.data + i.rem;
1804 ret.index = i.index + ((char *) ret.data - (char *) i.data);
1805 ret.rem = 0;
1806 return ret;
1809 void
1810 xcb_xkb_sa_lock_device_btn_next (xcb_xkb_sa_lock_device_btn_iterator_t *i /**< */)
1812 --i->rem;
1813 ++i->data;
1814 i->index += sizeof(xcb_xkb_sa_lock_device_btn_t);
1817 xcb_generic_iterator_t
1818 xcb_xkb_sa_lock_device_btn_end (xcb_xkb_sa_lock_device_btn_iterator_t i /**< */)
1820 xcb_generic_iterator_t ret;
1821 ret.data = i.data + i.rem;
1822 ret.index = i.index + ((char *) ret.data - (char *) i.data);
1823 ret.rem = 0;
1824 return ret;
1827 void
1828 xcb_xkb_sa_device_valuator_next (xcb_xkb_sa_device_valuator_iterator_t *i /**< */)
1830 --i->rem;
1831 ++i->data;
1832 i->index += sizeof(xcb_xkb_sa_device_valuator_t);
1835 xcb_generic_iterator_t
1836 xcb_xkb_sa_device_valuator_end (xcb_xkb_sa_device_valuator_iterator_t i /**< */)
1838 xcb_generic_iterator_t ret;
1839 ret.data = i.data + i.rem;
1840 ret.index = i.index + ((char *) ret.data - (char *) i.data);
1841 ret.rem = 0;
1842 return ret;
1845 void
1846 xcb_xkb_si_action_next (xcb_xkb_si_action_iterator_t *i /**< */)
1848 --i->rem;
1849 ++i->data;
1850 i->index += sizeof(xcb_xkb_si_action_t);
1853 xcb_generic_iterator_t
1854 xcb_xkb_si_action_end (xcb_xkb_si_action_iterator_t i /**< */)
1856 xcb_generic_iterator_t ret;
1857 ret.data = i.data + i.rem;
1858 ret.index = i.index + ((char *) ret.data - (char *) i.data);
1859 ret.rem = 0;
1860 return ret;
1863 void
1864 xcb_xkb_sym_interpret_next (xcb_xkb_sym_interpret_iterator_t *i /**< */)
1866 --i->rem;
1867 ++i->data;
1868 i->index += sizeof(xcb_xkb_sym_interpret_t);
1871 xcb_generic_iterator_t
1872 xcb_xkb_sym_interpret_end (xcb_xkb_sym_interpret_iterator_t i /**< */)
1874 xcb_generic_iterator_t ret;
1875 ret.data = i.data + i.rem;
1876 ret.index = i.index + ((char *) ret.data - (char *) i.data);
1877 ret.rem = 0;
1878 return ret;
1881 void
1882 xcb_xkb_action_next (xcb_xkb_action_iterator_t *i /**< */)
1884 --i->rem;
1885 ++i->data;
1886 i->index += sizeof(xcb_xkb_action_t);
1889 xcb_generic_iterator_t
1890 xcb_xkb_action_end (xcb_xkb_action_iterator_t i /**< */)
1892 xcb_generic_iterator_t ret;
1893 ret.data = i.data + i.rem;
1894 ret.index = i.index + ((char *) ret.data - (char *) i.data);
1895 ret.rem = 0;
1896 return ret;
1899 xcb_xkb_use_extension_cookie_t
1900 xcb_xkb_use_extension (xcb_connection_t *c /**< */,
1901 uint16_t wantedMajor /**< */,
1902 uint16_t wantedMinor /**< */)
1904 static const xcb_protocol_request_t xcb_req = {
1905 /* count */ 2,
1906 /* ext */ &xcb_xkb_id,
1907 /* opcode */ XCB_XKB_USE_EXTENSION,
1908 /* isvoid */ 0
1911 struct iovec xcb_parts[4];
1912 xcb_xkb_use_extension_cookie_t xcb_ret;
1913 xcb_xkb_use_extension_request_t xcb_out;
1915 xcb_out.wantedMajor = wantedMajor;
1916 xcb_out.wantedMinor = wantedMinor;
1918 xcb_parts[2].iov_base = (char *) &xcb_out;
1919 xcb_parts[2].iov_len = sizeof(xcb_out);
1920 xcb_parts[3].iov_base = 0;
1921 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1923 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1924 return xcb_ret;
1927 xcb_xkb_use_extension_cookie_t
1928 xcb_xkb_use_extension_unchecked (xcb_connection_t *c /**< */,
1929 uint16_t wantedMajor /**< */,
1930 uint16_t wantedMinor /**< */)
1932 static const xcb_protocol_request_t xcb_req = {
1933 /* count */ 2,
1934 /* ext */ &xcb_xkb_id,
1935 /* opcode */ XCB_XKB_USE_EXTENSION,
1936 /* isvoid */ 0
1939 struct iovec xcb_parts[4];
1940 xcb_xkb_use_extension_cookie_t xcb_ret;
1941 xcb_xkb_use_extension_request_t xcb_out;
1943 xcb_out.wantedMajor = wantedMajor;
1944 xcb_out.wantedMinor = wantedMinor;
1946 xcb_parts[2].iov_base = (char *) &xcb_out;
1947 xcb_parts[2].iov_len = sizeof(xcb_out);
1948 xcb_parts[3].iov_base = 0;
1949 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1951 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1952 return xcb_ret;
1955 xcb_xkb_use_extension_reply_t *
1956 xcb_xkb_use_extension_reply (xcb_connection_t *c /**< */,
1957 xcb_xkb_use_extension_cookie_t cookie /**< */,
1958 xcb_generic_error_t **e /**< */)
1960 return (xcb_xkb_use_extension_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1964 xcb_xkb_select_events_details_serialize (void **_buffer /**< */,
1965 uint16_t affectWhich /**< */,
1966 uint16_t clear /**< */,
1967 uint16_t selectAll /**< */,
1968 const xcb_xkb_select_events_details_t *_aux /**< */)
1970 char *xcb_out = *_buffer;
1971 unsigned int xcb_buffer_len = 0;
1972 unsigned int xcb_align_to = 0;
1974 unsigned int xcb_pad = 0;
1975 char xcb_pad0[3] = {0, 0, 0};
1976 struct iovec xcb_parts[23];
1977 unsigned int xcb_parts_idx = 0;
1978 unsigned int xcb_block_len = 0;
1979 unsigned int i;
1980 char *xcb_tmp;
1982 if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_NEW_KEYBOARD_NOTIFY) {
1983 /* xcb_xkb_select_events_details_t.affectNewKeyboard */
1984 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->affectNewKeyboard;
1985 xcb_block_len += sizeof(uint16_t);
1986 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
1987 xcb_parts_idx++;
1988 xcb_align_to = ALIGNOF(uint16_t);
1989 /* xcb_xkb_select_events_details_t.newKeyboardDetails */
1990 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->newKeyboardDetails;
1991 xcb_block_len += sizeof(uint16_t);
1992 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
1993 xcb_parts_idx++;
1994 xcb_align_to = ALIGNOF(uint16_t);
1996 if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_STATE_NOTIFY) {
1997 /* xcb_xkb_select_events_details_t.affectState */
1998 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->affectState;
1999 xcb_block_len += sizeof(uint16_t);
2000 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
2001 xcb_parts_idx++;
2002 xcb_align_to = ALIGNOF(uint16_t);
2003 /* xcb_xkb_select_events_details_t.stateDetails */
2004 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->stateDetails;
2005 xcb_block_len += sizeof(uint16_t);
2006 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
2007 xcb_parts_idx++;
2008 xcb_align_to = ALIGNOF(uint16_t);
2010 if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_CONTROLS_NOTIFY) {
2011 /* xcb_xkb_select_events_details_t.affectCtrls */
2012 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->affectCtrls;
2013 xcb_block_len += sizeof(uint32_t);
2014 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t);
2015 xcb_parts_idx++;
2016 xcb_align_to = ALIGNOF(uint32_t);
2017 /* xcb_xkb_select_events_details_t.ctrlDetails */
2018 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->ctrlDetails;
2019 xcb_block_len += sizeof(uint32_t);
2020 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t);
2021 xcb_parts_idx++;
2022 xcb_align_to = ALIGNOF(uint32_t);
2024 if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_INDICATOR_STATE_NOTIFY) {
2025 /* xcb_xkb_select_events_details_t.affectIndicatorState */
2026 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->affectIndicatorState;
2027 xcb_block_len += sizeof(uint32_t);
2028 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t);
2029 xcb_parts_idx++;
2030 xcb_align_to = ALIGNOF(uint32_t);
2031 /* xcb_xkb_select_events_details_t.indicatorStateDetails */
2032 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->indicatorStateDetails;
2033 xcb_block_len += sizeof(uint32_t);
2034 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t);
2035 xcb_parts_idx++;
2036 xcb_align_to = ALIGNOF(uint32_t);
2038 if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_INDICATOR_MAP_NOTIFY) {
2039 /* xcb_xkb_select_events_details_t.affectIndicatorMap */
2040 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->affectIndicatorMap;
2041 xcb_block_len += sizeof(uint32_t);
2042 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t);
2043 xcb_parts_idx++;
2044 xcb_align_to = ALIGNOF(uint32_t);
2045 /* xcb_xkb_select_events_details_t.indicatorMapDetails */
2046 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->indicatorMapDetails;
2047 xcb_block_len += sizeof(uint32_t);
2048 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t);
2049 xcb_parts_idx++;
2050 xcb_align_to = ALIGNOF(uint32_t);
2052 if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_NAMES_NOTIFY) {
2053 /* xcb_xkb_select_events_details_t.affectNames */
2054 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->affectNames;
2055 xcb_block_len += sizeof(uint16_t);
2056 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
2057 xcb_parts_idx++;
2058 xcb_align_to = ALIGNOF(uint16_t);
2059 /* xcb_xkb_select_events_details_t.namesDetails */
2060 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->namesDetails;
2061 xcb_block_len += sizeof(uint16_t);
2062 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
2063 xcb_parts_idx++;
2064 xcb_align_to = ALIGNOF(uint16_t);
2066 if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_COMPAT_MAP_NOTIFY) {
2067 /* xcb_xkb_select_events_details_t.affectCompat */
2068 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->affectCompat;
2069 xcb_block_len += sizeof(uint8_t);
2070 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
2071 xcb_parts_idx++;
2072 xcb_align_to = ALIGNOF(uint8_t);
2073 /* xcb_xkb_select_events_details_t.compatDetails */
2074 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->compatDetails;
2075 xcb_block_len += sizeof(uint8_t);
2076 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
2077 xcb_parts_idx++;
2078 xcb_align_to = ALIGNOF(uint8_t);
2080 if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_BELL_NOTIFY) {
2081 /* xcb_xkb_select_events_details_t.affectBell */
2082 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->affectBell;
2083 xcb_block_len += sizeof(uint8_t);
2084 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
2085 xcb_parts_idx++;
2086 xcb_align_to = ALIGNOF(uint8_t);
2087 /* xcb_xkb_select_events_details_t.bellDetails */
2088 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->bellDetails;
2089 xcb_block_len += sizeof(uint8_t);
2090 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
2091 xcb_parts_idx++;
2092 xcb_align_to = ALIGNOF(uint8_t);
2094 if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_ACTION_MESSAGE) {
2095 /* xcb_xkb_select_events_details_t.affectMsgDetails */
2096 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->affectMsgDetails;
2097 xcb_block_len += sizeof(uint8_t);
2098 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
2099 xcb_parts_idx++;
2100 xcb_align_to = ALIGNOF(uint8_t);
2101 /* xcb_xkb_select_events_details_t.msgDetails */
2102 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->msgDetails;
2103 xcb_block_len += sizeof(uint8_t);
2104 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
2105 xcb_parts_idx++;
2106 xcb_align_to = ALIGNOF(uint8_t);
2108 if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_ACCESS_X_NOTIFY) {
2109 /* xcb_xkb_select_events_details_t.affectAccessX */
2110 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->affectAccessX;
2111 xcb_block_len += sizeof(uint16_t);
2112 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
2113 xcb_parts_idx++;
2114 xcb_align_to = ALIGNOF(uint16_t);
2115 /* xcb_xkb_select_events_details_t.accessXDetails */
2116 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->accessXDetails;
2117 xcb_block_len += sizeof(uint16_t);
2118 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
2119 xcb_parts_idx++;
2120 xcb_align_to = ALIGNOF(uint16_t);
2122 if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_EXTENSION_DEVICE_NOTIFY) {
2123 /* xcb_xkb_select_events_details_t.affectExtDev */
2124 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->affectExtDev;
2125 xcb_block_len += sizeof(uint16_t);
2126 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
2127 xcb_parts_idx++;
2128 xcb_align_to = ALIGNOF(uint16_t);
2129 /* xcb_xkb_select_events_details_t.extdevDetails */
2130 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->extdevDetails;
2131 xcb_block_len += sizeof(uint16_t);
2132 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
2133 xcb_parts_idx++;
2134 xcb_align_to = ALIGNOF(uint16_t);
2136 /* insert padding */
2137 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2138 xcb_buffer_len += xcb_block_len + xcb_pad;
2139 if (0 != xcb_pad) {
2140 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
2141 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
2142 xcb_parts_idx++;
2143 xcb_pad = 0;
2145 xcb_block_len = 0;
2147 if (NULL == xcb_out) {
2148 /* allocate memory */
2149 xcb_out = malloc(xcb_buffer_len);
2150 *_buffer = xcb_out;
2153 xcb_tmp = xcb_out;
2154 for(i=0; i<xcb_parts_idx; i++) {
2155 if (0 != xcb_parts[i].iov_base && 0 != xcb_parts[i].iov_len)
2156 memcpy(xcb_tmp, xcb_parts[i].iov_base, xcb_parts[i].iov_len);
2157 if (0 != xcb_parts[i].iov_len)
2158 xcb_tmp += xcb_parts[i].iov_len;
2161 return xcb_buffer_len;
2165 xcb_xkb_select_events_details_unpack (const void *_buffer /**< */,
2166 uint16_t affectWhich /**< */,
2167 uint16_t clear /**< */,
2168 uint16_t selectAll /**< */,
2169 xcb_xkb_select_events_details_t *_aux /**< */)
2171 char *xcb_tmp = (char *)_buffer;
2172 unsigned int xcb_buffer_len = 0;
2173 unsigned int xcb_block_len = 0;
2174 unsigned int xcb_pad = 0;
2175 unsigned int xcb_align_to = 0;
2178 if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_NEW_KEYBOARD_NOTIFY) {
2179 /* xcb_xkb_select_events_details_t.affectNewKeyboard */
2180 _aux->affectNewKeyboard = *(uint16_t *)xcb_tmp;
2181 xcb_block_len += sizeof(uint16_t);
2182 xcb_tmp += sizeof(uint16_t);
2183 xcb_align_to = ALIGNOF(uint16_t);
2184 /* xcb_xkb_select_events_details_t.newKeyboardDetails */
2185 _aux->newKeyboardDetails = *(uint16_t *)xcb_tmp;
2186 xcb_block_len += sizeof(uint16_t);
2187 xcb_tmp += sizeof(uint16_t);
2188 xcb_align_to = ALIGNOF(uint16_t);
2190 if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_STATE_NOTIFY) {
2191 /* xcb_xkb_select_events_details_t.affectState */
2192 _aux->affectState = *(uint16_t *)xcb_tmp;
2193 xcb_block_len += sizeof(uint16_t);
2194 xcb_tmp += sizeof(uint16_t);
2195 xcb_align_to = ALIGNOF(uint16_t);
2196 /* xcb_xkb_select_events_details_t.stateDetails */
2197 _aux->stateDetails = *(uint16_t *)xcb_tmp;
2198 xcb_block_len += sizeof(uint16_t);
2199 xcb_tmp += sizeof(uint16_t);
2200 xcb_align_to = ALIGNOF(uint16_t);
2202 if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_CONTROLS_NOTIFY) {
2203 /* xcb_xkb_select_events_details_t.affectCtrls */
2204 _aux->affectCtrls = *(uint32_t *)xcb_tmp;
2205 xcb_block_len += sizeof(uint32_t);
2206 xcb_tmp += sizeof(uint32_t);
2207 xcb_align_to = ALIGNOF(uint32_t);
2208 /* xcb_xkb_select_events_details_t.ctrlDetails */
2209 _aux->ctrlDetails = *(uint32_t *)xcb_tmp;
2210 xcb_block_len += sizeof(uint32_t);
2211 xcb_tmp += sizeof(uint32_t);
2212 xcb_align_to = ALIGNOF(uint32_t);
2214 if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_INDICATOR_STATE_NOTIFY) {
2215 /* xcb_xkb_select_events_details_t.affectIndicatorState */
2216 _aux->affectIndicatorState = *(uint32_t *)xcb_tmp;
2217 xcb_block_len += sizeof(uint32_t);
2218 xcb_tmp += sizeof(uint32_t);
2219 xcb_align_to = ALIGNOF(uint32_t);
2220 /* xcb_xkb_select_events_details_t.indicatorStateDetails */
2221 _aux->indicatorStateDetails = *(uint32_t *)xcb_tmp;
2222 xcb_block_len += sizeof(uint32_t);
2223 xcb_tmp += sizeof(uint32_t);
2224 xcb_align_to = ALIGNOF(uint32_t);
2226 if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_INDICATOR_MAP_NOTIFY) {
2227 /* xcb_xkb_select_events_details_t.affectIndicatorMap */
2228 _aux->affectIndicatorMap = *(uint32_t *)xcb_tmp;
2229 xcb_block_len += sizeof(uint32_t);
2230 xcb_tmp += sizeof(uint32_t);
2231 xcb_align_to = ALIGNOF(uint32_t);
2232 /* xcb_xkb_select_events_details_t.indicatorMapDetails */
2233 _aux->indicatorMapDetails = *(uint32_t *)xcb_tmp;
2234 xcb_block_len += sizeof(uint32_t);
2235 xcb_tmp += sizeof(uint32_t);
2236 xcb_align_to = ALIGNOF(uint32_t);
2238 if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_NAMES_NOTIFY) {
2239 /* xcb_xkb_select_events_details_t.affectNames */
2240 _aux->affectNames = *(uint16_t *)xcb_tmp;
2241 xcb_block_len += sizeof(uint16_t);
2242 xcb_tmp += sizeof(uint16_t);
2243 xcb_align_to = ALIGNOF(uint16_t);
2244 /* xcb_xkb_select_events_details_t.namesDetails */
2245 _aux->namesDetails = *(uint16_t *)xcb_tmp;
2246 xcb_block_len += sizeof(uint16_t);
2247 xcb_tmp += sizeof(uint16_t);
2248 xcb_align_to = ALIGNOF(uint16_t);
2250 if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_COMPAT_MAP_NOTIFY) {
2251 /* xcb_xkb_select_events_details_t.affectCompat */
2252 _aux->affectCompat = *(uint8_t *)xcb_tmp;
2253 xcb_block_len += sizeof(uint8_t);
2254 xcb_tmp += sizeof(uint8_t);
2255 xcb_align_to = ALIGNOF(uint8_t);
2256 /* xcb_xkb_select_events_details_t.compatDetails */
2257 _aux->compatDetails = *(uint8_t *)xcb_tmp;
2258 xcb_block_len += sizeof(uint8_t);
2259 xcb_tmp += sizeof(uint8_t);
2260 xcb_align_to = ALIGNOF(uint8_t);
2262 if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_BELL_NOTIFY) {
2263 /* xcb_xkb_select_events_details_t.affectBell */
2264 _aux->affectBell = *(uint8_t *)xcb_tmp;
2265 xcb_block_len += sizeof(uint8_t);
2266 xcb_tmp += sizeof(uint8_t);
2267 xcb_align_to = ALIGNOF(uint8_t);
2268 /* xcb_xkb_select_events_details_t.bellDetails */
2269 _aux->bellDetails = *(uint8_t *)xcb_tmp;
2270 xcb_block_len += sizeof(uint8_t);
2271 xcb_tmp += sizeof(uint8_t);
2272 xcb_align_to = ALIGNOF(uint8_t);
2274 if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_ACTION_MESSAGE) {
2275 /* xcb_xkb_select_events_details_t.affectMsgDetails */
2276 _aux->affectMsgDetails = *(uint8_t *)xcb_tmp;
2277 xcb_block_len += sizeof(uint8_t);
2278 xcb_tmp += sizeof(uint8_t);
2279 xcb_align_to = ALIGNOF(uint8_t);
2280 /* xcb_xkb_select_events_details_t.msgDetails */
2281 _aux->msgDetails = *(uint8_t *)xcb_tmp;
2282 xcb_block_len += sizeof(uint8_t);
2283 xcb_tmp += sizeof(uint8_t);
2284 xcb_align_to = ALIGNOF(uint8_t);
2286 if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_ACCESS_X_NOTIFY) {
2287 /* xcb_xkb_select_events_details_t.affectAccessX */
2288 _aux->affectAccessX = *(uint16_t *)xcb_tmp;
2289 xcb_block_len += sizeof(uint16_t);
2290 xcb_tmp += sizeof(uint16_t);
2291 xcb_align_to = ALIGNOF(uint16_t);
2292 /* xcb_xkb_select_events_details_t.accessXDetails */
2293 _aux->accessXDetails = *(uint16_t *)xcb_tmp;
2294 xcb_block_len += sizeof(uint16_t);
2295 xcb_tmp += sizeof(uint16_t);
2296 xcb_align_to = ALIGNOF(uint16_t);
2298 if((affectWhich & ((~clear) & (~selectAll))) & XCB_XKB_EVENT_TYPE_EXTENSION_DEVICE_NOTIFY) {
2299 /* xcb_xkb_select_events_details_t.affectExtDev */
2300 _aux->affectExtDev = *(uint16_t *)xcb_tmp;
2301 xcb_block_len += sizeof(uint16_t);
2302 xcb_tmp += sizeof(uint16_t);
2303 xcb_align_to = ALIGNOF(uint16_t);
2304 /* xcb_xkb_select_events_details_t.extdevDetails */
2305 _aux->extdevDetails = *(uint16_t *)xcb_tmp;
2306 xcb_block_len += sizeof(uint16_t);
2307 xcb_tmp += sizeof(uint16_t);
2308 xcb_align_to = ALIGNOF(uint16_t);
2310 /* insert padding */
2311 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2312 xcb_buffer_len += xcb_block_len + xcb_pad;
2313 if (0 != xcb_pad) {
2314 xcb_tmp += xcb_pad;
2315 xcb_pad = 0;
2317 xcb_block_len = 0;
2319 return xcb_buffer_len;
2323 xcb_xkb_select_events_details_sizeof (const void *_buffer /**< */,
2324 uint16_t affectWhich /**< */,
2325 uint16_t clear /**< */,
2326 uint16_t selectAll /**< */)
2328 xcb_xkb_select_events_details_t _aux;
2329 return xcb_xkb_select_events_details_unpack(_buffer, affectWhich, clear, selectAll, &_aux);
2332 xcb_void_cookie_t
2333 xcb_xkb_select_events_checked (xcb_connection_t *c /**< */,
2334 xcb_xkb_device_spec_t deviceSpec /**< */,
2335 uint16_t affectWhich /**< */,
2336 uint16_t clear /**< */,
2337 uint16_t selectAll /**< */,
2338 uint16_t affectMap /**< */,
2339 uint16_t map /**< */,
2340 const void *details /**< */)
2342 static const xcb_protocol_request_t xcb_req = {
2343 /* count */ 3,
2344 /* ext */ &xcb_xkb_id,
2345 /* opcode */ XCB_XKB_SELECT_EVENTS,
2346 /* isvoid */ 1
2349 struct iovec xcb_parts[5];
2350 xcb_void_cookie_t xcb_ret;
2351 xcb_xkb_select_events_request_t xcb_out;
2353 xcb_out.deviceSpec = deviceSpec;
2354 xcb_out.affectWhich = affectWhich;
2355 xcb_out.clear = clear;
2356 xcb_out.selectAll = selectAll;
2357 xcb_out.affectMap = affectMap;
2358 xcb_out.map = map;
2360 xcb_parts[2].iov_base = (char *) &xcb_out;
2361 xcb_parts[2].iov_len = sizeof(xcb_out);
2362 xcb_parts[3].iov_base = 0;
2363 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2364 /* xcb_xkb_select_events_details_t details */
2365 xcb_parts[4].iov_base = (char *) details;
2366 xcb_parts[4].iov_len =
2367 xcb_xkb_select_events_details_sizeof (details, affectWhich, clear, selectAll);
2369 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2370 return xcb_ret;
2373 xcb_void_cookie_t
2374 xcb_xkb_select_events (xcb_connection_t *c /**< */,
2375 xcb_xkb_device_spec_t deviceSpec /**< */,
2376 uint16_t affectWhich /**< */,
2377 uint16_t clear /**< */,
2378 uint16_t selectAll /**< */,
2379 uint16_t affectMap /**< */,
2380 uint16_t map /**< */,
2381 const void *details /**< */)
2383 static const xcb_protocol_request_t xcb_req = {
2384 /* count */ 3,
2385 /* ext */ &xcb_xkb_id,
2386 /* opcode */ XCB_XKB_SELECT_EVENTS,
2387 /* isvoid */ 1
2390 struct iovec xcb_parts[5];
2391 xcb_void_cookie_t xcb_ret;
2392 xcb_xkb_select_events_request_t xcb_out;
2394 xcb_out.deviceSpec = deviceSpec;
2395 xcb_out.affectWhich = affectWhich;
2396 xcb_out.clear = clear;
2397 xcb_out.selectAll = selectAll;
2398 xcb_out.affectMap = affectMap;
2399 xcb_out.map = map;
2401 xcb_parts[2].iov_base = (char *) &xcb_out;
2402 xcb_parts[2].iov_len = sizeof(xcb_out);
2403 xcb_parts[3].iov_base = 0;
2404 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2405 /* xcb_xkb_select_events_details_t details */
2406 xcb_parts[4].iov_base = (char *) details;
2407 xcb_parts[4].iov_len =
2408 xcb_xkb_select_events_details_sizeof (details, affectWhich, clear, selectAll);
2410 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2411 return xcb_ret;
2414 xcb_void_cookie_t
2415 xcb_xkb_select_events_aux_checked (xcb_connection_t *c /**< */,
2416 xcb_xkb_device_spec_t deviceSpec /**< */,
2417 uint16_t affectWhich /**< */,
2418 uint16_t clear /**< */,
2419 uint16_t selectAll /**< */,
2420 uint16_t affectMap /**< */,
2421 uint16_t map /**< */,
2422 const xcb_xkb_select_events_details_t *details /**< */)
2424 static const xcb_protocol_request_t xcb_req = {
2425 /* count */ 3,
2426 /* ext */ &xcb_xkb_id,
2427 /* opcode */ XCB_XKB_SELECT_EVENTS,
2428 /* isvoid */ 1
2431 struct iovec xcb_parts[5];
2432 xcb_void_cookie_t xcb_ret;
2433 xcb_xkb_select_events_request_t xcb_out;
2434 void *xcb_aux0 = 0;
2436 xcb_out.deviceSpec = deviceSpec;
2437 xcb_out.affectWhich = affectWhich;
2438 xcb_out.clear = clear;
2439 xcb_out.selectAll = selectAll;
2440 xcb_out.affectMap = affectMap;
2441 xcb_out.map = map;
2443 xcb_parts[2].iov_base = (char *) &xcb_out;
2444 xcb_parts[2].iov_len = sizeof(xcb_out);
2445 xcb_parts[3].iov_base = 0;
2446 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2447 /* xcb_xkb_select_events_details_t details */
2448 xcb_parts[4].iov_len =
2449 xcb_xkb_select_events_details_serialize (&xcb_aux0, affectWhich, clear, selectAll, details);
2450 xcb_parts[4].iov_base = xcb_aux0;
2452 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2453 free(xcb_aux0);
2454 return xcb_ret;
2457 xcb_void_cookie_t
2458 xcb_xkb_select_events_aux (xcb_connection_t *c /**< */,
2459 xcb_xkb_device_spec_t deviceSpec /**< */,
2460 uint16_t affectWhich /**< */,
2461 uint16_t clear /**< */,
2462 uint16_t selectAll /**< */,
2463 uint16_t affectMap /**< */,
2464 uint16_t map /**< */,
2465 const xcb_xkb_select_events_details_t *details /**< */)
2467 static const xcb_protocol_request_t xcb_req = {
2468 /* count */ 3,
2469 /* ext */ &xcb_xkb_id,
2470 /* opcode */ XCB_XKB_SELECT_EVENTS,
2471 /* isvoid */ 1
2474 struct iovec xcb_parts[5];
2475 xcb_void_cookie_t xcb_ret;
2476 xcb_xkb_select_events_request_t xcb_out;
2477 void *xcb_aux0 = 0;
2479 xcb_out.deviceSpec = deviceSpec;
2480 xcb_out.affectWhich = affectWhich;
2481 xcb_out.clear = clear;
2482 xcb_out.selectAll = selectAll;
2483 xcb_out.affectMap = affectMap;
2484 xcb_out.map = map;
2486 xcb_parts[2].iov_base = (char *) &xcb_out;
2487 xcb_parts[2].iov_len = sizeof(xcb_out);
2488 xcb_parts[3].iov_base = 0;
2489 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2490 /* xcb_xkb_select_events_details_t details */
2491 xcb_parts[4].iov_len =
2492 xcb_xkb_select_events_details_serialize (&xcb_aux0, affectWhich, clear, selectAll, details);
2493 xcb_parts[4].iov_base = xcb_aux0;
2495 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2496 free(xcb_aux0);
2497 return xcb_ret;
2500 xcb_void_cookie_t
2501 xcb_xkb_bell_checked (xcb_connection_t *c /**< */,
2502 xcb_xkb_device_spec_t deviceSpec /**< */,
2503 xcb_xkb_bell_class_spec_t bellClass /**< */,
2504 xcb_xkb_id_spec_t bellID /**< */,
2505 int8_t percent /**< */,
2506 uint8_t forceSound /**< */,
2507 uint8_t eventOnly /**< */,
2508 int16_t pitch /**< */,
2509 int16_t duration /**< */,
2510 xcb_atom_t name /**< */,
2511 xcb_window_t window /**< */)
2513 static const xcb_protocol_request_t xcb_req = {
2514 /* count */ 2,
2515 /* ext */ &xcb_xkb_id,
2516 /* opcode */ XCB_XKB_BELL,
2517 /* isvoid */ 1
2520 struct iovec xcb_parts[4];
2521 xcb_void_cookie_t xcb_ret;
2522 xcb_xkb_bell_request_t xcb_out;
2524 xcb_out.deviceSpec = deviceSpec;
2525 xcb_out.bellClass = bellClass;
2526 xcb_out.bellID = bellID;
2527 xcb_out.percent = percent;
2528 xcb_out.forceSound = forceSound;
2529 xcb_out.eventOnly = eventOnly;
2530 xcb_out.pad0 = 0;
2531 xcb_out.pitch = pitch;
2532 xcb_out.duration = duration;
2533 memset(xcb_out.pad1, 0, 2);
2534 xcb_out.name = name;
2535 xcb_out.window = window;
2537 xcb_parts[2].iov_base = (char *) &xcb_out;
2538 xcb_parts[2].iov_len = sizeof(xcb_out);
2539 xcb_parts[3].iov_base = 0;
2540 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2542 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2543 return xcb_ret;
2546 xcb_void_cookie_t
2547 xcb_xkb_bell (xcb_connection_t *c /**< */,
2548 xcb_xkb_device_spec_t deviceSpec /**< */,
2549 xcb_xkb_bell_class_spec_t bellClass /**< */,
2550 xcb_xkb_id_spec_t bellID /**< */,
2551 int8_t percent /**< */,
2552 uint8_t forceSound /**< */,
2553 uint8_t eventOnly /**< */,
2554 int16_t pitch /**< */,
2555 int16_t duration /**< */,
2556 xcb_atom_t name /**< */,
2557 xcb_window_t window /**< */)
2559 static const xcb_protocol_request_t xcb_req = {
2560 /* count */ 2,
2561 /* ext */ &xcb_xkb_id,
2562 /* opcode */ XCB_XKB_BELL,
2563 /* isvoid */ 1
2566 struct iovec xcb_parts[4];
2567 xcb_void_cookie_t xcb_ret;
2568 xcb_xkb_bell_request_t xcb_out;
2570 xcb_out.deviceSpec = deviceSpec;
2571 xcb_out.bellClass = bellClass;
2572 xcb_out.bellID = bellID;
2573 xcb_out.percent = percent;
2574 xcb_out.forceSound = forceSound;
2575 xcb_out.eventOnly = eventOnly;
2576 xcb_out.pad0 = 0;
2577 xcb_out.pitch = pitch;
2578 xcb_out.duration = duration;
2579 memset(xcb_out.pad1, 0, 2);
2580 xcb_out.name = name;
2581 xcb_out.window = window;
2583 xcb_parts[2].iov_base = (char *) &xcb_out;
2584 xcb_parts[2].iov_len = sizeof(xcb_out);
2585 xcb_parts[3].iov_base = 0;
2586 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2588 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2589 return xcb_ret;
2592 xcb_xkb_get_state_cookie_t
2593 xcb_xkb_get_state (xcb_connection_t *c /**< */,
2594 xcb_xkb_device_spec_t deviceSpec /**< */)
2596 static const xcb_protocol_request_t xcb_req = {
2597 /* count */ 2,
2598 /* ext */ &xcb_xkb_id,
2599 /* opcode */ XCB_XKB_GET_STATE,
2600 /* isvoid */ 0
2603 struct iovec xcb_parts[4];
2604 xcb_xkb_get_state_cookie_t xcb_ret;
2605 xcb_xkb_get_state_request_t xcb_out;
2607 xcb_out.deviceSpec = deviceSpec;
2608 memset(xcb_out.pad0, 0, 2);
2610 xcb_parts[2].iov_base = (char *) &xcb_out;
2611 xcb_parts[2].iov_len = sizeof(xcb_out);
2612 xcb_parts[3].iov_base = 0;
2613 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2615 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2616 return xcb_ret;
2619 xcb_xkb_get_state_cookie_t
2620 xcb_xkb_get_state_unchecked (xcb_connection_t *c /**< */,
2621 xcb_xkb_device_spec_t deviceSpec /**< */)
2623 static const xcb_protocol_request_t xcb_req = {
2624 /* count */ 2,
2625 /* ext */ &xcb_xkb_id,
2626 /* opcode */ XCB_XKB_GET_STATE,
2627 /* isvoid */ 0
2630 struct iovec xcb_parts[4];
2631 xcb_xkb_get_state_cookie_t xcb_ret;
2632 xcb_xkb_get_state_request_t xcb_out;
2634 xcb_out.deviceSpec = deviceSpec;
2635 memset(xcb_out.pad0, 0, 2);
2637 xcb_parts[2].iov_base = (char *) &xcb_out;
2638 xcb_parts[2].iov_len = sizeof(xcb_out);
2639 xcb_parts[3].iov_base = 0;
2640 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2642 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2643 return xcb_ret;
2646 xcb_xkb_get_state_reply_t *
2647 xcb_xkb_get_state_reply (xcb_connection_t *c /**< */,
2648 xcb_xkb_get_state_cookie_t cookie /**< */,
2649 xcb_generic_error_t **e /**< */)
2651 return (xcb_xkb_get_state_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
2654 xcb_void_cookie_t
2655 xcb_xkb_latch_lock_state_checked (xcb_connection_t *c /**< */,
2656 xcb_xkb_device_spec_t deviceSpec /**< */,
2657 uint8_t affectModLocks /**< */,
2658 uint8_t modLocks /**< */,
2659 uint8_t lockGroup /**< */,
2660 uint8_t groupLock /**< */,
2661 uint8_t affectModLatches /**< */,
2662 uint8_t latchGroup /**< */,
2663 uint16_t groupLatch /**< */)
2665 static const xcb_protocol_request_t xcb_req = {
2666 /* count */ 2,
2667 /* ext */ &xcb_xkb_id,
2668 /* opcode */ XCB_XKB_LATCH_LOCK_STATE,
2669 /* isvoid */ 1
2672 struct iovec xcb_parts[4];
2673 xcb_void_cookie_t xcb_ret;
2674 xcb_xkb_latch_lock_state_request_t xcb_out;
2676 xcb_out.deviceSpec = deviceSpec;
2677 xcb_out.affectModLocks = affectModLocks;
2678 xcb_out.modLocks = modLocks;
2679 xcb_out.lockGroup = lockGroup;
2680 xcb_out.groupLock = groupLock;
2681 xcb_out.affectModLatches = affectModLatches;
2682 xcb_out.pad0 = 0;
2683 xcb_out.pad1 = 0;
2684 xcb_out.latchGroup = latchGroup;
2685 xcb_out.groupLatch = groupLatch;
2687 xcb_parts[2].iov_base = (char *) &xcb_out;
2688 xcb_parts[2].iov_len = sizeof(xcb_out);
2689 xcb_parts[3].iov_base = 0;
2690 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2692 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2693 return xcb_ret;
2696 xcb_void_cookie_t
2697 xcb_xkb_latch_lock_state (xcb_connection_t *c /**< */,
2698 xcb_xkb_device_spec_t deviceSpec /**< */,
2699 uint8_t affectModLocks /**< */,
2700 uint8_t modLocks /**< */,
2701 uint8_t lockGroup /**< */,
2702 uint8_t groupLock /**< */,
2703 uint8_t affectModLatches /**< */,
2704 uint8_t latchGroup /**< */,
2705 uint16_t groupLatch /**< */)
2707 static const xcb_protocol_request_t xcb_req = {
2708 /* count */ 2,
2709 /* ext */ &xcb_xkb_id,
2710 /* opcode */ XCB_XKB_LATCH_LOCK_STATE,
2711 /* isvoid */ 1
2714 struct iovec xcb_parts[4];
2715 xcb_void_cookie_t xcb_ret;
2716 xcb_xkb_latch_lock_state_request_t xcb_out;
2718 xcb_out.deviceSpec = deviceSpec;
2719 xcb_out.affectModLocks = affectModLocks;
2720 xcb_out.modLocks = modLocks;
2721 xcb_out.lockGroup = lockGroup;
2722 xcb_out.groupLock = groupLock;
2723 xcb_out.affectModLatches = affectModLatches;
2724 xcb_out.pad0 = 0;
2725 xcb_out.pad1 = 0;
2726 xcb_out.latchGroup = latchGroup;
2727 xcb_out.groupLatch = groupLatch;
2729 xcb_parts[2].iov_base = (char *) &xcb_out;
2730 xcb_parts[2].iov_len = sizeof(xcb_out);
2731 xcb_parts[3].iov_base = 0;
2732 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2734 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2735 return xcb_ret;
2738 xcb_xkb_get_controls_cookie_t
2739 xcb_xkb_get_controls (xcb_connection_t *c /**< */,
2740 xcb_xkb_device_spec_t deviceSpec /**< */)
2742 static const xcb_protocol_request_t xcb_req = {
2743 /* count */ 2,
2744 /* ext */ &xcb_xkb_id,
2745 /* opcode */ XCB_XKB_GET_CONTROLS,
2746 /* isvoid */ 0
2749 struct iovec xcb_parts[4];
2750 xcb_xkb_get_controls_cookie_t xcb_ret;
2751 xcb_xkb_get_controls_request_t xcb_out;
2753 xcb_out.deviceSpec = deviceSpec;
2754 memset(xcb_out.pad0, 0, 2);
2756 xcb_parts[2].iov_base = (char *) &xcb_out;
2757 xcb_parts[2].iov_len = sizeof(xcb_out);
2758 xcb_parts[3].iov_base = 0;
2759 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2761 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2762 return xcb_ret;
2765 xcb_xkb_get_controls_cookie_t
2766 xcb_xkb_get_controls_unchecked (xcb_connection_t *c /**< */,
2767 xcb_xkb_device_spec_t deviceSpec /**< */)
2769 static const xcb_protocol_request_t xcb_req = {
2770 /* count */ 2,
2771 /* ext */ &xcb_xkb_id,
2772 /* opcode */ XCB_XKB_GET_CONTROLS,
2773 /* isvoid */ 0
2776 struct iovec xcb_parts[4];
2777 xcb_xkb_get_controls_cookie_t xcb_ret;
2778 xcb_xkb_get_controls_request_t xcb_out;
2780 xcb_out.deviceSpec = deviceSpec;
2781 memset(xcb_out.pad0, 0, 2);
2783 xcb_parts[2].iov_base = (char *) &xcb_out;
2784 xcb_parts[2].iov_len = sizeof(xcb_out);
2785 xcb_parts[3].iov_base = 0;
2786 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2788 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2789 return xcb_ret;
2792 xcb_xkb_get_controls_reply_t *
2793 xcb_xkb_get_controls_reply (xcb_connection_t *c /**< */,
2794 xcb_xkb_get_controls_cookie_t cookie /**< */,
2795 xcb_generic_error_t **e /**< */)
2797 return (xcb_xkb_get_controls_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
2800 xcb_void_cookie_t
2801 xcb_xkb_set_controls_checked (xcb_connection_t *c /**< */,
2802 xcb_xkb_device_spec_t deviceSpec /**< */,
2803 uint8_t affectInternalRealMods /**< */,
2804 uint8_t internalRealMods /**< */,
2805 uint8_t affectIgnoreLockRealMods /**< */,
2806 uint8_t ignoreLockRealMods /**< */,
2807 uint16_t affectInternalVirtualMods /**< */,
2808 uint16_t internalVirtualMods /**< */,
2809 uint16_t affectIgnoreLockVirtualMods /**< */,
2810 uint16_t ignoreLockVirtualMods /**< */,
2811 uint8_t mouseKeysDfltBtn /**< */,
2812 uint8_t groupsWrap /**< */,
2813 uint16_t accessXOptions /**< */,
2814 uint32_t affectEnabledControls /**< */,
2815 uint32_t enabledControls /**< */,
2816 uint32_t changeControls /**< */,
2817 uint16_t repeatDelay /**< */,
2818 uint16_t repeatInterval /**< */,
2819 uint16_t slowKeysDelay /**< */,
2820 uint16_t debounceDelay /**< */,
2821 uint16_t mouseKeysDelay /**< */,
2822 uint16_t mouseKeysInterval /**< */,
2823 uint16_t mouseKeysTimeToMax /**< */,
2824 uint16_t mouseKeysMaxSpeed /**< */,
2825 int16_t mouseKeysCurve /**< */,
2826 uint16_t accessXTimeout /**< */,
2827 uint32_t accessXTimeoutMask /**< */,
2828 uint32_t accessXTimeoutValues /**< */,
2829 uint16_t accessXTimeoutOptionsMask /**< */,
2830 uint16_t accessXTimeoutOptionsValues /**< */,
2831 const uint8_t *perKeyRepeat /**< */)
2833 static const xcb_protocol_request_t xcb_req = {
2834 /* count */ 2,
2835 /* ext */ &xcb_xkb_id,
2836 /* opcode */ XCB_XKB_SET_CONTROLS,
2837 /* isvoid */ 1
2840 struct iovec xcb_parts[4];
2841 xcb_void_cookie_t xcb_ret;
2842 xcb_xkb_set_controls_request_t xcb_out;
2844 xcb_out.deviceSpec = deviceSpec;
2845 xcb_out.affectInternalRealMods = affectInternalRealMods;
2846 xcb_out.internalRealMods = internalRealMods;
2847 xcb_out.affectIgnoreLockRealMods = affectIgnoreLockRealMods;
2848 xcb_out.ignoreLockRealMods = ignoreLockRealMods;
2849 xcb_out.affectInternalVirtualMods = affectInternalVirtualMods;
2850 xcb_out.internalVirtualMods = internalVirtualMods;
2851 xcb_out.affectIgnoreLockVirtualMods = affectIgnoreLockVirtualMods;
2852 xcb_out.ignoreLockVirtualMods = ignoreLockVirtualMods;
2853 xcb_out.mouseKeysDfltBtn = mouseKeysDfltBtn;
2854 xcb_out.groupsWrap = groupsWrap;
2855 xcb_out.accessXOptions = accessXOptions;
2856 memset(xcb_out.pad0, 0, 2);
2857 xcb_out.affectEnabledControls = affectEnabledControls;
2858 xcb_out.enabledControls = enabledControls;
2859 xcb_out.changeControls = changeControls;
2860 xcb_out.repeatDelay = repeatDelay;
2861 xcb_out.repeatInterval = repeatInterval;
2862 xcb_out.slowKeysDelay = slowKeysDelay;
2863 xcb_out.debounceDelay = debounceDelay;
2864 xcb_out.mouseKeysDelay = mouseKeysDelay;
2865 xcb_out.mouseKeysInterval = mouseKeysInterval;
2866 xcb_out.mouseKeysTimeToMax = mouseKeysTimeToMax;
2867 xcb_out.mouseKeysMaxSpeed = mouseKeysMaxSpeed;
2868 xcb_out.mouseKeysCurve = mouseKeysCurve;
2869 xcb_out.accessXTimeout = accessXTimeout;
2870 xcb_out.accessXTimeoutMask = accessXTimeoutMask;
2871 xcb_out.accessXTimeoutValues = accessXTimeoutValues;
2872 xcb_out.accessXTimeoutOptionsMask = accessXTimeoutOptionsMask;
2873 xcb_out.accessXTimeoutOptionsValues = accessXTimeoutOptionsValues;
2874 memcpy(xcb_out.perKeyRepeat, perKeyRepeat, 32);
2876 xcb_parts[2].iov_base = (char *) &xcb_out;
2877 xcb_parts[2].iov_len = sizeof(xcb_out);
2878 xcb_parts[3].iov_base = 0;
2879 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2881 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2882 return xcb_ret;
2885 xcb_void_cookie_t
2886 xcb_xkb_set_controls (xcb_connection_t *c /**< */,
2887 xcb_xkb_device_spec_t deviceSpec /**< */,
2888 uint8_t affectInternalRealMods /**< */,
2889 uint8_t internalRealMods /**< */,
2890 uint8_t affectIgnoreLockRealMods /**< */,
2891 uint8_t ignoreLockRealMods /**< */,
2892 uint16_t affectInternalVirtualMods /**< */,
2893 uint16_t internalVirtualMods /**< */,
2894 uint16_t affectIgnoreLockVirtualMods /**< */,
2895 uint16_t ignoreLockVirtualMods /**< */,
2896 uint8_t mouseKeysDfltBtn /**< */,
2897 uint8_t groupsWrap /**< */,
2898 uint16_t accessXOptions /**< */,
2899 uint32_t affectEnabledControls /**< */,
2900 uint32_t enabledControls /**< */,
2901 uint32_t changeControls /**< */,
2902 uint16_t repeatDelay /**< */,
2903 uint16_t repeatInterval /**< */,
2904 uint16_t slowKeysDelay /**< */,
2905 uint16_t debounceDelay /**< */,
2906 uint16_t mouseKeysDelay /**< */,
2907 uint16_t mouseKeysInterval /**< */,
2908 uint16_t mouseKeysTimeToMax /**< */,
2909 uint16_t mouseKeysMaxSpeed /**< */,
2910 int16_t mouseKeysCurve /**< */,
2911 uint16_t accessXTimeout /**< */,
2912 uint32_t accessXTimeoutMask /**< */,
2913 uint32_t accessXTimeoutValues /**< */,
2914 uint16_t accessXTimeoutOptionsMask /**< */,
2915 uint16_t accessXTimeoutOptionsValues /**< */,
2916 const uint8_t *perKeyRepeat /**< */)
2918 static const xcb_protocol_request_t xcb_req = {
2919 /* count */ 2,
2920 /* ext */ &xcb_xkb_id,
2921 /* opcode */ XCB_XKB_SET_CONTROLS,
2922 /* isvoid */ 1
2925 struct iovec xcb_parts[4];
2926 xcb_void_cookie_t xcb_ret;
2927 xcb_xkb_set_controls_request_t xcb_out;
2929 xcb_out.deviceSpec = deviceSpec;
2930 xcb_out.affectInternalRealMods = affectInternalRealMods;
2931 xcb_out.internalRealMods = internalRealMods;
2932 xcb_out.affectIgnoreLockRealMods = affectIgnoreLockRealMods;
2933 xcb_out.ignoreLockRealMods = ignoreLockRealMods;
2934 xcb_out.affectInternalVirtualMods = affectInternalVirtualMods;
2935 xcb_out.internalVirtualMods = internalVirtualMods;
2936 xcb_out.affectIgnoreLockVirtualMods = affectIgnoreLockVirtualMods;
2937 xcb_out.ignoreLockVirtualMods = ignoreLockVirtualMods;
2938 xcb_out.mouseKeysDfltBtn = mouseKeysDfltBtn;
2939 xcb_out.groupsWrap = groupsWrap;
2940 xcb_out.accessXOptions = accessXOptions;
2941 memset(xcb_out.pad0, 0, 2);
2942 xcb_out.affectEnabledControls = affectEnabledControls;
2943 xcb_out.enabledControls = enabledControls;
2944 xcb_out.changeControls = changeControls;
2945 xcb_out.repeatDelay = repeatDelay;
2946 xcb_out.repeatInterval = repeatInterval;
2947 xcb_out.slowKeysDelay = slowKeysDelay;
2948 xcb_out.debounceDelay = debounceDelay;
2949 xcb_out.mouseKeysDelay = mouseKeysDelay;
2950 xcb_out.mouseKeysInterval = mouseKeysInterval;
2951 xcb_out.mouseKeysTimeToMax = mouseKeysTimeToMax;
2952 xcb_out.mouseKeysMaxSpeed = mouseKeysMaxSpeed;
2953 xcb_out.mouseKeysCurve = mouseKeysCurve;
2954 xcb_out.accessXTimeout = accessXTimeout;
2955 xcb_out.accessXTimeoutMask = accessXTimeoutMask;
2956 xcb_out.accessXTimeoutValues = accessXTimeoutValues;
2957 xcb_out.accessXTimeoutOptionsMask = accessXTimeoutOptionsMask;
2958 xcb_out.accessXTimeoutOptionsValues = accessXTimeoutOptionsValues;
2959 memcpy(xcb_out.perKeyRepeat, perKeyRepeat, 32);
2961 xcb_parts[2].iov_base = (char *) &xcb_out;
2962 xcb_parts[2].iov_len = sizeof(xcb_out);
2963 xcb_parts[3].iov_base = 0;
2964 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2966 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2967 return xcb_ret;
2971 xcb_xkb_get_map_map_types_rtrn_length (const xcb_xkb_get_map_reply_t *R /**< */,
2972 const xcb_xkb_get_map_map_t *S /**< */)
2974 return R->nTypes;
2977 xcb_xkb_key_type_iterator_t
2978 xcb_xkb_get_map_map_types_rtrn_iterator (const xcb_xkb_get_map_reply_t *R /**< */,
2979 const xcb_xkb_get_map_map_t *S /**< */)
2981 xcb_xkb_key_type_iterator_t i;
2982 i.data = /* map */ S->types_rtrn;
2983 i.rem = R->nTypes;
2984 i.index = (char *) i.data - (char *) S;
2985 return i;
2989 xcb_xkb_get_map_map_syms_rtrn_length (const xcb_xkb_get_map_reply_t *R /**< */,
2990 const xcb_xkb_get_map_map_t *S /**< */)
2992 return R->nKeySyms;
2995 xcb_xkb_key_sym_map_iterator_t
2996 xcb_xkb_get_map_map_syms_rtrn_iterator (const xcb_xkb_get_map_reply_t *R /**< */,
2997 const xcb_xkb_get_map_map_t *S /**< */)
2999 xcb_xkb_key_sym_map_iterator_t i;
3000 i.data = /* map */ S->syms_rtrn;
3001 i.rem = R->nKeySyms;
3002 i.index = (char *) i.data - (char *) S;
3003 return i;
3006 uint8_t *
3007 xcb_xkb_get_map_map_acts_rtrn_count (const xcb_xkb_get_map_map_t *S /**< */)
3009 return /* map */ S->acts_rtrn_count;
3013 xcb_xkb_get_map_map_acts_rtrn_count_length (const xcb_xkb_get_map_reply_t *R /**< */,
3014 const xcb_xkb_get_map_map_t *S /**< */)
3016 return R->nKeyActions;
3019 xcb_generic_iterator_t
3020 xcb_xkb_get_map_map_acts_rtrn_count_end (const xcb_xkb_get_map_reply_t *R /**< */,
3021 const xcb_xkb_get_map_map_t *S /**< */)
3023 xcb_generic_iterator_t i;
3024 i.data = /* map */ S->acts_rtrn_count + R->nKeyActions;
3025 i.rem = 0;
3026 i.index = (char *) i.data - (char *) S;
3027 return i;
3030 xcb_xkb_action_t *
3031 xcb_xkb_get_map_map_acts_rtrn_acts (const xcb_xkb_get_map_map_t *S /**< */)
3033 return /* map */ S->acts_rtrn_acts;
3037 xcb_xkb_get_map_map_acts_rtrn_acts_length (const xcb_xkb_get_map_reply_t *R /**< */,
3038 const xcb_xkb_get_map_map_t *S /**< */)
3040 return R->totalActions;
3043 xcb_xkb_action_iterator_t
3044 xcb_xkb_get_map_map_acts_rtrn_acts_iterator (const xcb_xkb_get_map_reply_t *R /**< */,
3045 const xcb_xkb_get_map_map_t *S /**< */)
3047 xcb_xkb_action_iterator_t i;
3048 i.data = /* map */ S->acts_rtrn_acts;
3049 i.rem = R->totalActions;
3050 i.index = (char *) i.data - (char *) S;
3051 return i;
3054 xcb_xkb_set_behavior_t *
3055 xcb_xkb_get_map_map_behaviors_rtrn (const xcb_xkb_get_map_map_t *S /**< */)
3057 return /* map */ S->behaviors_rtrn;
3061 xcb_xkb_get_map_map_behaviors_rtrn_length (const xcb_xkb_get_map_reply_t *R /**< */,
3062 const xcb_xkb_get_map_map_t *S /**< */)
3064 return R->totalKeyBehaviors;
3067 xcb_xkb_set_behavior_iterator_t
3068 xcb_xkb_get_map_map_behaviors_rtrn_iterator (const xcb_xkb_get_map_reply_t *R /**< */,
3069 const xcb_xkb_get_map_map_t *S /**< */)
3071 xcb_xkb_set_behavior_iterator_t i;
3072 i.data = /* map */ S->behaviors_rtrn;
3073 i.rem = R->totalKeyBehaviors;
3074 i.index = (char *) i.data - (char *) S;
3075 return i;
3078 uint8_t *
3079 xcb_xkb_get_map_map_vmods_rtrn (const xcb_xkb_get_map_map_t *S /**< */)
3081 return /* map */ S->vmods_rtrn;
3085 xcb_xkb_get_map_map_vmods_rtrn_length (const xcb_xkb_get_map_reply_t *R /**< */,
3086 const xcb_xkb_get_map_map_t *S /**< */)
3088 return xcb_popcount(R->virtualMods);
3091 xcb_generic_iterator_t
3092 xcb_xkb_get_map_map_vmods_rtrn_end (const xcb_xkb_get_map_reply_t *R /**< */,
3093 const xcb_xkb_get_map_map_t *S /**< */)
3095 xcb_generic_iterator_t i;
3096 i.data = /* map */ S->vmods_rtrn + xcb_popcount(R->virtualMods);
3097 i.rem = 0;
3098 i.index = (char *) i.data - (char *) S;
3099 return i;
3102 xcb_xkb_set_explicit_t *
3103 xcb_xkb_get_map_map_explicit_rtrn (const xcb_xkb_get_map_map_t *S /**< */)
3105 return /* map */ S->explicit_rtrn;
3109 xcb_xkb_get_map_map_explicit_rtrn_length (const xcb_xkb_get_map_reply_t *R /**< */,
3110 const xcb_xkb_get_map_map_t *S /**< */)
3112 return R->totalKeyExplicit;
3115 xcb_xkb_set_explicit_iterator_t
3116 xcb_xkb_get_map_map_explicit_rtrn_iterator (const xcb_xkb_get_map_reply_t *R /**< */,
3117 const xcb_xkb_get_map_map_t *S /**< */)
3119 xcb_xkb_set_explicit_iterator_t i;
3120 i.data = /* map */ S->explicit_rtrn;
3121 i.rem = R->totalKeyExplicit;
3122 i.index = (char *) i.data - (char *) S;
3123 return i;
3126 xcb_xkb_key_mod_map_t *
3127 xcb_xkb_get_map_map_modmap_rtrn (const xcb_xkb_get_map_map_t *S /**< */)
3129 return /* map */ S->modmap_rtrn;
3133 xcb_xkb_get_map_map_modmap_rtrn_length (const xcb_xkb_get_map_reply_t *R /**< */,
3134 const xcb_xkb_get_map_map_t *S /**< */)
3136 return R->totalModMapKeys;
3139 xcb_xkb_key_mod_map_iterator_t
3140 xcb_xkb_get_map_map_modmap_rtrn_iterator (const xcb_xkb_get_map_reply_t *R /**< */,
3141 const xcb_xkb_get_map_map_t *S /**< */)
3143 xcb_xkb_key_mod_map_iterator_t i;
3144 i.data = /* map */ S->modmap_rtrn;
3145 i.rem = R->totalModMapKeys;
3146 i.index = (char *) i.data - (char *) S;
3147 return i;
3150 xcb_xkb_key_v_mod_map_t *
3151 xcb_xkb_get_map_map_vmodmap_rtrn (const xcb_xkb_get_map_map_t *S /**< */)
3153 return /* map */ S->vmodmap_rtrn;
3157 xcb_xkb_get_map_map_vmodmap_rtrn_length (const xcb_xkb_get_map_reply_t *R /**< */,
3158 const xcb_xkb_get_map_map_t *S /**< */)
3160 return R->totalVModMapKeys;
3163 xcb_xkb_key_v_mod_map_iterator_t
3164 xcb_xkb_get_map_map_vmodmap_rtrn_iterator (const xcb_xkb_get_map_reply_t *R /**< */,
3165 const xcb_xkb_get_map_map_t *S /**< */)
3167 xcb_xkb_key_v_mod_map_iterator_t i;
3168 i.data = /* map */ S->vmodmap_rtrn;
3169 i.rem = R->totalVModMapKeys;
3170 i.index = (char *) i.data - (char *) S;
3171 return i;
3175 xcb_xkb_get_map_map_serialize (void **_buffer /**< */,
3176 uint8_t nTypes /**< */,
3177 uint8_t nKeySyms /**< */,
3178 uint8_t nKeyActions /**< */,
3179 uint16_t totalActions /**< */,
3180 uint8_t totalKeyBehaviors /**< */,
3181 uint16_t virtualMods /**< */,
3182 uint8_t totalKeyExplicit /**< */,
3183 uint8_t totalModMapKeys /**< */,
3184 uint8_t totalVModMapKeys /**< */,
3185 uint16_t present /**< */,
3186 const xcb_xkb_get_map_map_t *_aux /**< */)
3188 char *xcb_out = *_buffer;
3189 unsigned int xcb_buffer_len = 0;
3190 unsigned int xcb_align_to = 0;
3192 unsigned int xcb_pad = 0;
3193 char xcb_pad0[3] = {0, 0, 0};
3194 struct iovec xcb_parts[23];
3195 unsigned int xcb_parts_idx = 0;
3196 unsigned int xcb_block_len = 0;
3197 unsigned int i;
3198 char *xcb_tmp;
3200 if(present & XCB_XKB_MAP_PART_KEY_TYPES) {
3201 /* insert padding */
3202 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3203 xcb_buffer_len += xcb_block_len + xcb_pad;
3204 if (0 != xcb_pad) {
3205 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
3206 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
3207 xcb_parts_idx++;
3208 xcb_pad = 0;
3210 xcb_block_len = 0;
3211 /* types_rtrn */
3212 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->types_rtrn;
3213 xcb_parts[xcb_parts_idx].iov_len = 0;
3214 xcb_tmp = (char *) _aux->types_rtrn;
3215 for(i=0; i<nTypes; i++) {
3216 xcb_block_len = xcb_xkb_key_type_sizeof(xcb_tmp);
3217 xcb_parts[xcb_parts_idx].iov_len += xcb_block_len;
3219 xcb_block_len = xcb_parts[xcb_parts_idx].iov_len;
3220 xcb_parts_idx++;
3221 xcb_align_to = ALIGNOF(xcb_xkb_key_type_t);
3223 if(present & XCB_XKB_MAP_PART_KEY_SYMS) {
3224 /* insert padding */
3225 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3226 xcb_buffer_len += xcb_block_len + xcb_pad;
3227 if (0 != xcb_pad) {
3228 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
3229 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
3230 xcb_parts_idx++;
3231 xcb_pad = 0;
3233 xcb_block_len = 0;
3234 /* syms_rtrn */
3235 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->syms_rtrn;
3236 xcb_parts[xcb_parts_idx].iov_len = 0;
3237 xcb_tmp = (char *) _aux->syms_rtrn;
3238 for(i=0; i<nKeySyms; i++) {
3239 xcb_block_len = xcb_xkb_key_sym_map_sizeof(xcb_tmp);
3240 xcb_parts[xcb_parts_idx].iov_len += xcb_block_len;
3242 xcb_block_len = xcb_parts[xcb_parts_idx].iov_len;
3243 xcb_parts_idx++;
3244 xcb_align_to = ALIGNOF(xcb_xkb_key_sym_map_t);
3246 if(present & XCB_XKB_MAP_PART_KEY_ACTIONS) {
3247 /* insert padding */
3248 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3249 xcb_buffer_len += xcb_block_len + xcb_pad;
3250 if (0 != xcb_pad) {
3251 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
3252 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
3253 xcb_parts_idx++;
3254 xcb_pad = 0;
3256 xcb_block_len = 0;
3257 /* acts_rtrn_count */
3258 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->acts_rtrn_count;
3259 xcb_block_len += nKeyActions * sizeof(xcb_keycode_t);
3260 xcb_parts[xcb_parts_idx].iov_len = nKeyActions * sizeof(xcb_keycode_t);
3261 xcb_parts_idx++;
3262 xcb_align_to = ALIGNOF(uint8_t);
3263 xcb_align_to = 4;
3264 /* insert padding */
3265 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3266 xcb_buffer_len += xcb_block_len + xcb_pad;
3267 if (0 != xcb_pad) {
3268 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
3269 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
3270 xcb_parts_idx++;
3271 xcb_pad = 0;
3273 xcb_block_len = 0;
3274 /* insert padding */
3275 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3276 xcb_buffer_len += xcb_block_len + xcb_pad;
3277 if (0 != xcb_pad) {
3278 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
3279 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
3280 xcb_parts_idx++;
3281 xcb_pad = 0;
3283 xcb_block_len = 0;
3284 /* acts_rtrn_acts */
3285 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->acts_rtrn_acts;
3286 xcb_block_len += totalActions * sizeof(xcb_xkb_action_t);
3287 xcb_parts[xcb_parts_idx].iov_len = totalActions * sizeof(xcb_xkb_action_t);
3288 xcb_parts_idx++;
3289 xcb_align_to = ALIGNOF(xcb_xkb_action_t);
3291 if(present & XCB_XKB_MAP_PART_KEY_BEHAVIORS) {
3292 /* insert padding */
3293 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3294 xcb_buffer_len += xcb_block_len + xcb_pad;
3295 if (0 != xcb_pad) {
3296 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
3297 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
3298 xcb_parts_idx++;
3299 xcb_pad = 0;
3301 xcb_block_len = 0;
3302 /* behaviors_rtrn */
3303 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->behaviors_rtrn;
3304 xcb_block_len += totalKeyBehaviors * sizeof(xcb_xkb_set_behavior_t);
3305 xcb_parts[xcb_parts_idx].iov_len = totalKeyBehaviors * sizeof(xcb_xkb_set_behavior_t);
3306 xcb_parts_idx++;
3307 xcb_align_to = ALIGNOF(xcb_xkb_set_behavior_t);
3309 if(present & XCB_XKB_MAP_PART_VIRTUAL_MODS) {
3310 /* insert padding */
3311 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3312 xcb_buffer_len += xcb_block_len + xcb_pad;
3313 if (0 != xcb_pad) {
3314 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
3315 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
3316 xcb_parts_idx++;
3317 xcb_pad = 0;
3319 xcb_block_len = 0;
3320 /* vmods_rtrn */
3321 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->vmods_rtrn;
3322 xcb_block_len += xcb_popcount(virtualMods) * sizeof(xcb_keycode_t);
3323 xcb_parts[xcb_parts_idx].iov_len = xcb_popcount(virtualMods) * sizeof(xcb_keycode_t);
3324 xcb_parts_idx++;
3325 xcb_align_to = ALIGNOF(uint8_t);
3326 xcb_align_to = 4;
3327 /* insert padding */
3328 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3329 xcb_buffer_len += xcb_block_len + xcb_pad;
3330 if (0 != xcb_pad) {
3331 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
3332 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
3333 xcb_parts_idx++;
3334 xcb_pad = 0;
3336 xcb_block_len = 0;
3338 if(present & XCB_XKB_MAP_PART_EXPLICIT_COMPONENTS) {
3339 /* insert padding */
3340 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3341 xcb_buffer_len += xcb_block_len + xcb_pad;
3342 if (0 != xcb_pad) {
3343 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
3344 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
3345 xcb_parts_idx++;
3346 xcb_pad = 0;
3348 xcb_block_len = 0;
3349 /* explicit_rtrn */
3350 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->explicit_rtrn;
3351 xcb_block_len += totalKeyExplicit * sizeof(xcb_xkb_set_explicit_t);
3352 xcb_parts[xcb_parts_idx].iov_len = totalKeyExplicit * sizeof(xcb_xkb_set_explicit_t);
3353 xcb_parts_idx++;
3354 xcb_align_to = ALIGNOF(xcb_xkb_set_explicit_t);
3355 xcb_align_to = 4;
3356 /* insert padding */
3357 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3358 xcb_buffer_len += xcb_block_len + xcb_pad;
3359 if (0 != xcb_pad) {
3360 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
3361 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
3362 xcb_parts_idx++;
3363 xcb_pad = 0;
3365 xcb_block_len = 0;
3367 if(present & XCB_XKB_MAP_PART_MODIFIER_MAP) {
3368 /* insert padding */
3369 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3370 xcb_buffer_len += xcb_block_len + xcb_pad;
3371 if (0 != xcb_pad) {
3372 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
3373 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
3374 xcb_parts_idx++;
3375 xcb_pad = 0;
3377 xcb_block_len = 0;
3378 /* modmap_rtrn */
3379 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->modmap_rtrn;
3380 xcb_block_len += totalModMapKeys * sizeof(xcb_xkb_key_mod_map_t);
3381 xcb_parts[xcb_parts_idx].iov_len = totalModMapKeys * sizeof(xcb_xkb_key_mod_map_t);
3382 xcb_parts_idx++;
3383 xcb_align_to = ALIGNOF(xcb_xkb_key_mod_map_t);
3384 xcb_align_to = 4;
3385 /* insert padding */
3386 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3387 xcb_buffer_len += xcb_block_len + xcb_pad;
3388 if (0 != xcb_pad) {
3389 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
3390 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
3391 xcb_parts_idx++;
3392 xcb_pad = 0;
3394 xcb_block_len = 0;
3396 if(present & XCB_XKB_MAP_PART_VIRTUAL_MOD_MAP) {
3397 /* insert padding */
3398 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3399 xcb_buffer_len += xcb_block_len + xcb_pad;
3400 if (0 != xcb_pad) {
3401 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
3402 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
3403 xcb_parts_idx++;
3404 xcb_pad = 0;
3406 xcb_block_len = 0;
3407 /* vmodmap_rtrn */
3408 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->vmodmap_rtrn;
3409 xcb_block_len += totalVModMapKeys * sizeof(xcb_xkb_key_v_mod_map_t);
3410 xcb_parts[xcb_parts_idx].iov_len = totalVModMapKeys * sizeof(xcb_xkb_key_v_mod_map_t);
3411 xcb_parts_idx++;
3412 xcb_align_to = ALIGNOF(xcb_xkb_key_v_mod_map_t);
3414 /* insert padding */
3415 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3416 xcb_buffer_len += xcb_block_len + xcb_pad;
3417 if (0 != xcb_pad) {
3418 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
3419 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
3420 xcb_parts_idx++;
3421 xcb_pad = 0;
3423 xcb_block_len = 0;
3425 if (NULL == xcb_out) {
3426 /* allocate memory */
3427 xcb_out = malloc(xcb_buffer_len);
3428 *_buffer = xcb_out;
3431 xcb_tmp = xcb_out;
3432 for(i=0; i<xcb_parts_idx; i++) {
3433 if (0 != xcb_parts[i].iov_base && 0 != xcb_parts[i].iov_len)
3434 memcpy(xcb_tmp, xcb_parts[i].iov_base, xcb_parts[i].iov_len);
3435 if (0 != xcb_parts[i].iov_len)
3436 xcb_tmp += xcb_parts[i].iov_len;
3439 return xcb_buffer_len;
3443 xcb_xkb_get_map_map_unpack (const void *_buffer /**< */,
3444 uint8_t nTypes /**< */,
3445 uint8_t nKeySyms /**< */,
3446 uint8_t nKeyActions /**< */,
3447 uint16_t totalActions /**< */,
3448 uint8_t totalKeyBehaviors /**< */,
3449 uint16_t virtualMods /**< */,
3450 uint8_t totalKeyExplicit /**< */,
3451 uint8_t totalModMapKeys /**< */,
3452 uint8_t totalVModMapKeys /**< */,
3453 uint16_t present /**< */,
3454 xcb_xkb_get_map_map_t *_aux /**< */)
3456 char *xcb_tmp = (char *)_buffer;
3457 unsigned int xcb_buffer_len = 0;
3458 unsigned int xcb_block_len = 0;
3459 unsigned int xcb_pad = 0;
3460 unsigned int xcb_align_to = 0;
3462 unsigned int i;
3463 unsigned int xcb_tmp_len;
3465 if(present & XCB_XKB_MAP_PART_KEY_TYPES) {
3466 /* insert padding */
3467 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3468 xcb_buffer_len += xcb_block_len + xcb_pad;
3469 if (0 != xcb_pad) {
3470 xcb_tmp += xcb_pad;
3471 xcb_pad = 0;
3473 xcb_block_len = 0;
3474 /* types_rtrn */
3475 _aux->types_rtrn = (xcb_xkb_key_type_t *)xcb_tmp;
3476 for(i=0; i<nTypes; i++) {
3477 xcb_tmp_len = xcb_xkb_key_type_sizeof(xcb_tmp);
3478 xcb_block_len += xcb_tmp_len;
3479 xcb_tmp += xcb_tmp_len;
3481 xcb_align_to = ALIGNOF(xcb_xkb_key_type_t);
3483 if(present & XCB_XKB_MAP_PART_KEY_SYMS) {
3484 /* insert padding */
3485 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3486 xcb_buffer_len += xcb_block_len + xcb_pad;
3487 if (0 != xcb_pad) {
3488 xcb_tmp += xcb_pad;
3489 xcb_pad = 0;
3491 xcb_block_len = 0;
3492 /* syms_rtrn */
3493 _aux->syms_rtrn = (xcb_xkb_key_sym_map_t *)xcb_tmp;
3494 for(i=0; i<nKeySyms; i++) {
3495 xcb_tmp_len = xcb_xkb_key_sym_map_sizeof(xcb_tmp);
3496 xcb_block_len += xcb_tmp_len;
3497 xcb_tmp += xcb_tmp_len;
3499 xcb_align_to = ALIGNOF(xcb_xkb_key_sym_map_t);
3501 if(present & XCB_XKB_MAP_PART_KEY_ACTIONS) {
3502 /* insert padding */
3503 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3504 xcb_buffer_len += xcb_block_len + xcb_pad;
3505 if (0 != xcb_pad) {
3506 xcb_tmp += xcb_pad;
3507 xcb_pad = 0;
3509 xcb_block_len = 0;
3510 /* acts_rtrn_count */
3511 _aux->acts_rtrn_count = (uint8_t *)xcb_tmp;
3512 xcb_block_len += nKeyActions * sizeof(xcb_keycode_t);
3513 xcb_tmp += xcb_block_len;
3514 xcb_align_to = ALIGNOF(uint8_t);
3515 xcb_align_to = 4;
3516 /* insert padding */
3517 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3518 xcb_buffer_len += xcb_block_len + xcb_pad;
3519 if (0 != xcb_pad) {
3520 xcb_tmp += xcb_pad;
3521 xcb_pad = 0;
3523 xcb_block_len = 0;
3524 /* insert padding */
3525 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3526 xcb_buffer_len += xcb_block_len + xcb_pad;
3527 if (0 != xcb_pad) {
3528 xcb_tmp += xcb_pad;
3529 xcb_pad = 0;
3531 xcb_block_len = 0;
3532 /* acts_rtrn_acts */
3533 _aux->acts_rtrn_acts = (xcb_xkb_action_t *)xcb_tmp;
3534 xcb_block_len += totalActions * sizeof(xcb_xkb_action_t);
3535 xcb_tmp += xcb_block_len;
3536 xcb_align_to = ALIGNOF(xcb_xkb_action_t);
3538 if(present & XCB_XKB_MAP_PART_KEY_BEHAVIORS) {
3539 /* insert padding */
3540 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3541 xcb_buffer_len += xcb_block_len + xcb_pad;
3542 if (0 != xcb_pad) {
3543 xcb_tmp += xcb_pad;
3544 xcb_pad = 0;
3546 xcb_block_len = 0;
3547 /* behaviors_rtrn */
3548 _aux->behaviors_rtrn = (xcb_xkb_set_behavior_t *)xcb_tmp;
3549 xcb_block_len += totalKeyBehaviors * sizeof(xcb_xkb_set_behavior_t);
3550 xcb_tmp += xcb_block_len;
3551 xcb_align_to = ALIGNOF(xcb_xkb_set_behavior_t);
3553 if(present & XCB_XKB_MAP_PART_VIRTUAL_MODS) {
3554 /* insert padding */
3555 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3556 xcb_buffer_len += xcb_block_len + xcb_pad;
3557 if (0 != xcb_pad) {
3558 xcb_tmp += xcb_pad;
3559 xcb_pad = 0;
3561 xcb_block_len = 0;
3562 /* vmods_rtrn */
3563 _aux->vmods_rtrn = (uint8_t *)xcb_tmp;
3564 xcb_block_len += xcb_popcount(virtualMods) * sizeof(xcb_keycode_t);
3565 xcb_tmp += xcb_block_len;
3566 xcb_align_to = ALIGNOF(uint8_t);
3567 xcb_align_to = 4;
3568 /* insert padding */
3569 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3570 xcb_buffer_len += xcb_block_len + xcb_pad;
3571 if (0 != xcb_pad) {
3572 xcb_tmp += xcb_pad;
3573 xcb_pad = 0;
3575 xcb_block_len = 0;
3577 if(present & XCB_XKB_MAP_PART_EXPLICIT_COMPONENTS) {
3578 /* insert padding */
3579 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3580 xcb_buffer_len += xcb_block_len + xcb_pad;
3581 if (0 != xcb_pad) {
3582 xcb_tmp += xcb_pad;
3583 xcb_pad = 0;
3585 xcb_block_len = 0;
3586 /* explicit_rtrn */
3587 _aux->explicit_rtrn = (xcb_xkb_set_explicit_t *)xcb_tmp;
3588 xcb_block_len += totalKeyExplicit * sizeof(xcb_xkb_set_explicit_t);
3589 xcb_tmp += xcb_block_len;
3590 xcb_align_to = ALIGNOF(xcb_xkb_set_explicit_t);
3591 xcb_align_to = 4;
3592 /* insert padding */
3593 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3594 xcb_buffer_len += xcb_block_len + xcb_pad;
3595 if (0 != xcb_pad) {
3596 xcb_tmp += xcb_pad;
3597 xcb_pad = 0;
3599 xcb_block_len = 0;
3601 if(present & XCB_XKB_MAP_PART_MODIFIER_MAP) {
3602 /* insert padding */
3603 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3604 xcb_buffer_len += xcb_block_len + xcb_pad;
3605 if (0 != xcb_pad) {
3606 xcb_tmp += xcb_pad;
3607 xcb_pad = 0;
3609 xcb_block_len = 0;
3610 /* modmap_rtrn */
3611 _aux->modmap_rtrn = (xcb_xkb_key_mod_map_t *)xcb_tmp;
3612 xcb_block_len += totalModMapKeys * sizeof(xcb_xkb_key_mod_map_t);
3613 xcb_tmp += xcb_block_len;
3614 xcb_align_to = ALIGNOF(xcb_xkb_key_mod_map_t);
3615 xcb_align_to = 4;
3616 /* insert padding */
3617 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3618 xcb_buffer_len += xcb_block_len + xcb_pad;
3619 if (0 != xcb_pad) {
3620 xcb_tmp += xcb_pad;
3621 xcb_pad = 0;
3623 xcb_block_len = 0;
3625 if(present & XCB_XKB_MAP_PART_VIRTUAL_MOD_MAP) {
3626 /* insert padding */
3627 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3628 xcb_buffer_len += xcb_block_len + xcb_pad;
3629 if (0 != xcb_pad) {
3630 xcb_tmp += xcb_pad;
3631 xcb_pad = 0;
3633 xcb_block_len = 0;
3634 /* vmodmap_rtrn */
3635 _aux->vmodmap_rtrn = (xcb_xkb_key_v_mod_map_t *)xcb_tmp;
3636 xcb_block_len += totalVModMapKeys * sizeof(xcb_xkb_key_v_mod_map_t);
3637 xcb_tmp += xcb_block_len;
3638 xcb_align_to = ALIGNOF(xcb_xkb_key_v_mod_map_t);
3640 /* insert padding */
3641 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3642 xcb_buffer_len += xcb_block_len + xcb_pad;
3643 if (0 != xcb_pad) {
3644 xcb_tmp += xcb_pad;
3645 xcb_pad = 0;
3647 xcb_block_len = 0;
3649 return xcb_buffer_len;
3653 xcb_xkb_get_map_map_sizeof (const void *_buffer /**< */,
3654 uint8_t nTypes /**< */,
3655 uint8_t nKeySyms /**< */,
3656 uint8_t nKeyActions /**< */,
3657 uint16_t totalActions /**< */,
3658 uint8_t totalKeyBehaviors /**< */,
3659 uint16_t virtualMods /**< */,
3660 uint8_t totalKeyExplicit /**< */,
3661 uint8_t totalModMapKeys /**< */,
3662 uint8_t totalVModMapKeys /**< */,
3663 uint16_t present /**< */)
3665 xcb_xkb_get_map_map_t _aux;
3666 return xcb_xkb_get_map_map_unpack(_buffer, nTypes, nKeySyms, nKeyActions, totalActions, totalKeyBehaviors, virtualMods, totalKeyExplicit, totalModMapKeys, totalVModMapKeys, present, &_aux);
3669 xcb_xkb_get_map_cookie_t
3670 xcb_xkb_get_map (xcb_connection_t *c /**< */,
3671 xcb_xkb_device_spec_t deviceSpec /**< */,
3672 uint16_t full /**< */,
3673 uint16_t partial /**< */,
3674 uint8_t firstType /**< */,
3675 uint8_t nTypes /**< */,
3676 xcb_keycode_t firstKeySym /**< */,
3677 uint8_t nKeySyms /**< */,
3678 xcb_keycode_t firstKeyAction /**< */,
3679 uint8_t nKeyActions /**< */,
3680 xcb_keycode_t firstKeyBehavior /**< */,
3681 uint8_t nKeyBehaviors /**< */,
3682 uint16_t virtualMods /**< */,
3683 xcb_keycode_t firstKeyExplicit /**< */,
3684 uint8_t nKeyExplicit /**< */,
3685 xcb_keycode_t firstModMapKey /**< */,
3686 uint8_t nModMapKeys /**< */,
3687 xcb_keycode_t firstVModMapKey /**< */,
3688 uint8_t nVModMapKeys /**< */)
3690 static const xcb_protocol_request_t xcb_req = {
3691 /* count */ 2,
3692 /* ext */ &xcb_xkb_id,
3693 /* opcode */ XCB_XKB_GET_MAP,
3694 /* isvoid */ 0
3697 struct iovec xcb_parts[4];
3698 xcb_xkb_get_map_cookie_t xcb_ret;
3699 xcb_xkb_get_map_request_t xcb_out;
3701 xcb_out.deviceSpec = deviceSpec;
3702 xcb_out.full = full;
3703 xcb_out.partial = partial;
3704 xcb_out.firstType = firstType;
3705 xcb_out.nTypes = nTypes;
3706 xcb_out.firstKeySym = firstKeySym;
3707 xcb_out.nKeySyms = nKeySyms;
3708 xcb_out.firstKeyAction = firstKeyAction;
3709 xcb_out.nKeyActions = nKeyActions;
3710 xcb_out.firstKeyBehavior = firstKeyBehavior;
3711 xcb_out.nKeyBehaviors = nKeyBehaviors;
3712 xcb_out.virtualMods = virtualMods;
3713 xcb_out.firstKeyExplicit = firstKeyExplicit;
3714 xcb_out.nKeyExplicit = nKeyExplicit;
3715 xcb_out.firstModMapKey = firstModMapKey;
3716 xcb_out.nModMapKeys = nModMapKeys;
3717 xcb_out.firstVModMapKey = firstVModMapKey;
3718 xcb_out.nVModMapKeys = nVModMapKeys;
3719 memset(xcb_out.pad0, 0, 2);
3721 xcb_parts[2].iov_base = (char *) &xcb_out;
3722 xcb_parts[2].iov_len = sizeof(xcb_out);
3723 xcb_parts[3].iov_base = 0;
3724 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3726 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3727 return xcb_ret;
3730 xcb_xkb_get_map_cookie_t
3731 xcb_xkb_get_map_unchecked (xcb_connection_t *c /**< */,
3732 xcb_xkb_device_spec_t deviceSpec /**< */,
3733 uint16_t full /**< */,
3734 uint16_t partial /**< */,
3735 uint8_t firstType /**< */,
3736 uint8_t nTypes /**< */,
3737 xcb_keycode_t firstKeySym /**< */,
3738 uint8_t nKeySyms /**< */,
3739 xcb_keycode_t firstKeyAction /**< */,
3740 uint8_t nKeyActions /**< */,
3741 xcb_keycode_t firstKeyBehavior /**< */,
3742 uint8_t nKeyBehaviors /**< */,
3743 uint16_t virtualMods /**< */,
3744 xcb_keycode_t firstKeyExplicit /**< */,
3745 uint8_t nKeyExplicit /**< */,
3746 xcb_keycode_t firstModMapKey /**< */,
3747 uint8_t nModMapKeys /**< */,
3748 xcb_keycode_t firstVModMapKey /**< */,
3749 uint8_t nVModMapKeys /**< */)
3751 static const xcb_protocol_request_t xcb_req = {
3752 /* count */ 2,
3753 /* ext */ &xcb_xkb_id,
3754 /* opcode */ XCB_XKB_GET_MAP,
3755 /* isvoid */ 0
3758 struct iovec xcb_parts[4];
3759 xcb_xkb_get_map_cookie_t xcb_ret;
3760 xcb_xkb_get_map_request_t xcb_out;
3762 xcb_out.deviceSpec = deviceSpec;
3763 xcb_out.full = full;
3764 xcb_out.partial = partial;
3765 xcb_out.firstType = firstType;
3766 xcb_out.nTypes = nTypes;
3767 xcb_out.firstKeySym = firstKeySym;
3768 xcb_out.nKeySyms = nKeySyms;
3769 xcb_out.firstKeyAction = firstKeyAction;
3770 xcb_out.nKeyActions = nKeyActions;
3771 xcb_out.firstKeyBehavior = firstKeyBehavior;
3772 xcb_out.nKeyBehaviors = nKeyBehaviors;
3773 xcb_out.virtualMods = virtualMods;
3774 xcb_out.firstKeyExplicit = firstKeyExplicit;
3775 xcb_out.nKeyExplicit = nKeyExplicit;
3776 xcb_out.firstModMapKey = firstModMapKey;
3777 xcb_out.nModMapKeys = nModMapKeys;
3778 xcb_out.firstVModMapKey = firstVModMapKey;
3779 xcb_out.nVModMapKeys = nVModMapKeys;
3780 memset(xcb_out.pad0, 0, 2);
3782 xcb_parts[2].iov_base = (char *) &xcb_out;
3783 xcb_parts[2].iov_len = sizeof(xcb_out);
3784 xcb_parts[3].iov_base = 0;
3785 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3787 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3788 return xcb_ret;
3791 void *
3792 xcb_xkb_get_map_map (const xcb_xkb_get_map_reply_t *R /**< */)
3794 return (void *) (R + 1);
3797 xcb_xkb_get_map_reply_t *
3798 xcb_xkb_get_map_reply (xcb_connection_t *c /**< */,
3799 xcb_xkb_get_map_cookie_t cookie /**< */,
3800 xcb_generic_error_t **e /**< */)
3802 return (xcb_xkb_get_map_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
3806 xcb_xkb_set_map_values_types_length (const xcb_xkb_set_map_request_t *R /**< */,
3807 const xcb_xkb_set_map_values_t *S /**< */)
3809 return R->nTypes;
3812 xcb_xkb_set_key_type_iterator_t
3813 xcb_xkb_set_map_values_types_iterator (const xcb_xkb_set_map_request_t *R /**< */,
3814 const xcb_xkb_set_map_values_t *S /**< */)
3816 xcb_xkb_set_key_type_iterator_t i;
3817 i.data = /* values */ S->types;
3818 i.rem = R->nTypes;
3819 i.index = (char *) i.data - (char *) S;
3820 return i;
3824 xcb_xkb_set_map_values_syms_length (const xcb_xkb_set_map_request_t *R /**< */,
3825 const xcb_xkb_set_map_values_t *S /**< */)
3827 return R->nKeySyms;
3830 xcb_xkb_key_sym_map_iterator_t
3831 xcb_xkb_set_map_values_syms_iterator (const xcb_xkb_set_map_request_t *R /**< */,
3832 const xcb_xkb_set_map_values_t *S /**< */)
3834 xcb_xkb_key_sym_map_iterator_t i;
3835 i.data = /* values */ S->syms;
3836 i.rem = R->nKeySyms;
3837 i.index = (char *) i.data - (char *) S;
3838 return i;
3841 uint8_t *
3842 xcb_xkb_set_map_values_actions_count (const xcb_xkb_set_map_values_t *S /**< */)
3844 return /* values */ S->actionsCount;
3848 xcb_xkb_set_map_values_actions_count_length (const xcb_xkb_set_map_request_t *R /**< */,
3849 const xcb_xkb_set_map_values_t *S /**< */)
3851 return R->nKeyActions;
3854 xcb_generic_iterator_t
3855 xcb_xkb_set_map_values_actions_count_end (const xcb_xkb_set_map_request_t *R /**< */,
3856 const xcb_xkb_set_map_values_t *S /**< */)
3858 xcb_generic_iterator_t i;
3859 i.data = /* values */ S->actionsCount + R->nKeyActions;
3860 i.rem = 0;
3861 i.index = (char *) i.data - (char *) S;
3862 return i;
3865 xcb_xkb_action_t *
3866 xcb_xkb_set_map_values_actions (const xcb_xkb_set_map_values_t *S /**< */)
3868 return /* values */ S->actions;
3872 xcb_xkb_set_map_values_actions_length (const xcb_xkb_set_map_request_t *R /**< */,
3873 const xcb_xkb_set_map_values_t *S /**< */)
3875 return R->totalActions;
3878 xcb_xkb_action_iterator_t
3879 xcb_xkb_set_map_values_actions_iterator (const xcb_xkb_set_map_request_t *R /**< */,
3880 const xcb_xkb_set_map_values_t *S /**< */)
3882 xcb_xkb_action_iterator_t i;
3883 i.data = /* values */ S->actions;
3884 i.rem = R->totalActions;
3885 i.index = (char *) i.data - (char *) S;
3886 return i;
3889 xcb_xkb_set_behavior_t *
3890 xcb_xkb_set_map_values_behaviors (const xcb_xkb_set_map_values_t *S /**< */)
3892 return /* values */ S->behaviors;
3896 xcb_xkb_set_map_values_behaviors_length (const xcb_xkb_set_map_request_t *R /**< */,
3897 const xcb_xkb_set_map_values_t *S /**< */)
3899 return R->totalKeyBehaviors;
3902 xcb_xkb_set_behavior_iterator_t
3903 xcb_xkb_set_map_values_behaviors_iterator (const xcb_xkb_set_map_request_t *R /**< */,
3904 const xcb_xkb_set_map_values_t *S /**< */)
3906 xcb_xkb_set_behavior_iterator_t i;
3907 i.data = /* values */ S->behaviors;
3908 i.rem = R->totalKeyBehaviors;
3909 i.index = (char *) i.data - (char *) S;
3910 return i;
3913 uint8_t *
3914 xcb_xkb_set_map_values_vmods (const xcb_xkb_set_map_values_t *S /**< */)
3916 return /* values */ S->vmods;
3920 xcb_xkb_set_map_values_vmods_length (const xcb_xkb_set_map_request_t *R /**< */,
3921 const xcb_xkb_set_map_values_t *S /**< */)
3923 return xcb_popcount(R->virtualMods);
3926 xcb_generic_iterator_t
3927 xcb_xkb_set_map_values_vmods_end (const xcb_xkb_set_map_request_t *R /**< */,
3928 const xcb_xkb_set_map_values_t *S /**< */)
3930 xcb_generic_iterator_t i;
3931 i.data = /* values */ S->vmods + xcb_popcount(R->virtualMods);
3932 i.rem = 0;
3933 i.index = (char *) i.data - (char *) S;
3934 return i;
3937 xcb_xkb_set_explicit_t *
3938 xcb_xkb_set_map_values_explicit (const xcb_xkb_set_map_values_t *S /**< */)
3940 return /* values */ S->explicit;
3944 xcb_xkb_set_map_values_explicit_length (const xcb_xkb_set_map_request_t *R /**< */,
3945 const xcb_xkb_set_map_values_t *S /**< */)
3947 return R->totalKeyExplicit;
3950 xcb_xkb_set_explicit_iterator_t
3951 xcb_xkb_set_map_values_explicit_iterator (const xcb_xkb_set_map_request_t *R /**< */,
3952 const xcb_xkb_set_map_values_t *S /**< */)
3954 xcb_xkb_set_explicit_iterator_t i;
3955 i.data = /* values */ S->explicit;
3956 i.rem = R->totalKeyExplicit;
3957 i.index = (char *) i.data - (char *) S;
3958 return i;
3961 xcb_xkb_key_mod_map_t *
3962 xcb_xkb_set_map_values_modmap (const xcb_xkb_set_map_values_t *S /**< */)
3964 return /* values */ S->modmap;
3968 xcb_xkb_set_map_values_modmap_length (const xcb_xkb_set_map_request_t *R /**< */,
3969 const xcb_xkb_set_map_values_t *S /**< */)
3971 return R->totalModMapKeys;
3974 xcb_xkb_key_mod_map_iterator_t
3975 xcb_xkb_set_map_values_modmap_iterator (const xcb_xkb_set_map_request_t *R /**< */,
3976 const xcb_xkb_set_map_values_t *S /**< */)
3978 xcb_xkb_key_mod_map_iterator_t i;
3979 i.data = /* values */ S->modmap;
3980 i.rem = R->totalModMapKeys;
3981 i.index = (char *) i.data - (char *) S;
3982 return i;
3985 xcb_xkb_key_v_mod_map_t *
3986 xcb_xkb_set_map_values_vmodmap (const xcb_xkb_set_map_values_t *S /**< */)
3988 return /* values */ S->vmodmap;
3992 xcb_xkb_set_map_values_vmodmap_length (const xcb_xkb_set_map_request_t *R /**< */,
3993 const xcb_xkb_set_map_values_t *S /**< */)
3995 return R->totalVModMapKeys;
3998 xcb_xkb_key_v_mod_map_iterator_t
3999 xcb_xkb_set_map_values_vmodmap_iterator (const xcb_xkb_set_map_request_t *R /**< */,
4000 const xcb_xkb_set_map_values_t *S /**< */)
4002 xcb_xkb_key_v_mod_map_iterator_t i;
4003 i.data = /* values */ S->vmodmap;
4004 i.rem = R->totalVModMapKeys;
4005 i.index = (char *) i.data - (char *) S;
4006 return i;
4010 xcb_xkb_set_map_values_serialize (void **_buffer /**< */,
4011 uint8_t nTypes /**< */,
4012 uint8_t nKeySyms /**< */,
4013 uint8_t nKeyActions /**< */,
4014 uint16_t totalActions /**< */,
4015 uint8_t totalKeyBehaviors /**< */,
4016 uint16_t virtualMods /**< */,
4017 uint8_t totalKeyExplicit /**< */,
4018 uint8_t totalModMapKeys /**< */,
4019 uint8_t totalVModMapKeys /**< */,
4020 uint16_t present /**< */,
4021 const xcb_xkb_set_map_values_t *_aux /**< */)
4023 char *xcb_out = *_buffer;
4024 unsigned int xcb_buffer_len = 0;
4025 unsigned int xcb_align_to = 0;
4027 unsigned int xcb_pad = 0;
4028 char xcb_pad0[3] = {0, 0, 0};
4029 struct iovec xcb_parts[19];
4030 unsigned int xcb_parts_idx = 0;
4031 unsigned int xcb_block_len = 0;
4032 unsigned int i;
4033 char *xcb_tmp;
4035 if(present & XCB_XKB_MAP_PART_KEY_TYPES) {
4036 /* insert padding */
4037 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4038 xcb_buffer_len += xcb_block_len + xcb_pad;
4039 if (0 != xcb_pad) {
4040 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
4041 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
4042 xcb_parts_idx++;
4043 xcb_pad = 0;
4045 xcb_block_len = 0;
4046 /* types */
4047 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->types;
4048 xcb_parts[xcb_parts_idx].iov_len = 0;
4049 xcb_tmp = (char *) _aux->types;
4050 for(i=0; i<nTypes; i++) {
4051 xcb_block_len = xcb_xkb_set_key_type_sizeof(xcb_tmp);
4052 xcb_parts[xcb_parts_idx].iov_len += xcb_block_len;
4054 xcb_block_len = xcb_parts[xcb_parts_idx].iov_len;
4055 xcb_parts_idx++;
4056 xcb_align_to = ALIGNOF(xcb_xkb_set_key_type_t);
4058 if(present & XCB_XKB_MAP_PART_KEY_SYMS) {
4059 /* insert padding */
4060 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4061 xcb_buffer_len += xcb_block_len + xcb_pad;
4062 if (0 != xcb_pad) {
4063 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
4064 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
4065 xcb_parts_idx++;
4066 xcb_pad = 0;
4068 xcb_block_len = 0;
4069 /* syms */
4070 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->syms;
4071 xcb_parts[xcb_parts_idx].iov_len = 0;
4072 xcb_tmp = (char *) _aux->syms;
4073 for(i=0; i<nKeySyms; i++) {
4074 xcb_block_len = xcb_xkb_key_sym_map_sizeof(xcb_tmp);
4075 xcb_parts[xcb_parts_idx].iov_len += xcb_block_len;
4077 xcb_block_len = xcb_parts[xcb_parts_idx].iov_len;
4078 xcb_parts_idx++;
4079 xcb_align_to = ALIGNOF(xcb_xkb_key_sym_map_t);
4081 if(present & XCB_XKB_MAP_PART_KEY_ACTIONS) {
4082 /* insert padding */
4083 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4084 xcb_buffer_len += xcb_block_len + xcb_pad;
4085 if (0 != xcb_pad) {
4086 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
4087 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
4088 xcb_parts_idx++;
4089 xcb_pad = 0;
4091 xcb_block_len = 0;
4092 /* actionsCount */
4093 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->actionsCount;
4094 xcb_block_len += nKeyActions * sizeof(xcb_keycode_t);
4095 xcb_parts[xcb_parts_idx].iov_len = nKeyActions * sizeof(xcb_keycode_t);
4096 xcb_parts_idx++;
4097 xcb_align_to = ALIGNOF(uint8_t);
4098 /* insert padding */
4099 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4100 xcb_buffer_len += xcb_block_len + xcb_pad;
4101 if (0 != xcb_pad) {
4102 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
4103 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
4104 xcb_parts_idx++;
4105 xcb_pad = 0;
4107 xcb_block_len = 0;
4108 /* actions */
4109 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->actions;
4110 xcb_block_len += totalActions * sizeof(xcb_xkb_action_t);
4111 xcb_parts[xcb_parts_idx].iov_len = totalActions * sizeof(xcb_xkb_action_t);
4112 xcb_parts_idx++;
4113 xcb_align_to = ALIGNOF(xcb_xkb_action_t);
4115 if(present & XCB_XKB_MAP_PART_KEY_BEHAVIORS) {
4116 /* insert padding */
4117 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4118 xcb_buffer_len += xcb_block_len + xcb_pad;
4119 if (0 != xcb_pad) {
4120 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
4121 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
4122 xcb_parts_idx++;
4123 xcb_pad = 0;
4125 xcb_block_len = 0;
4126 /* behaviors */
4127 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->behaviors;
4128 xcb_block_len += totalKeyBehaviors * sizeof(xcb_xkb_set_behavior_t);
4129 xcb_parts[xcb_parts_idx].iov_len = totalKeyBehaviors * sizeof(xcb_xkb_set_behavior_t);
4130 xcb_parts_idx++;
4131 xcb_align_to = ALIGNOF(xcb_xkb_set_behavior_t);
4133 if(present & XCB_XKB_MAP_PART_VIRTUAL_MODS) {
4134 /* insert padding */
4135 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4136 xcb_buffer_len += xcb_block_len + xcb_pad;
4137 if (0 != xcb_pad) {
4138 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
4139 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
4140 xcb_parts_idx++;
4141 xcb_pad = 0;
4143 xcb_block_len = 0;
4144 /* vmods */
4145 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->vmods;
4146 xcb_block_len += xcb_popcount(virtualMods) * sizeof(xcb_keycode_t);
4147 xcb_parts[xcb_parts_idx].iov_len = xcb_popcount(virtualMods) * sizeof(xcb_keycode_t);
4148 xcb_parts_idx++;
4149 xcb_align_to = ALIGNOF(uint8_t);
4151 if(present & XCB_XKB_MAP_PART_EXPLICIT_COMPONENTS) {
4152 /* insert padding */
4153 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4154 xcb_buffer_len += xcb_block_len + xcb_pad;
4155 if (0 != xcb_pad) {
4156 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
4157 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
4158 xcb_parts_idx++;
4159 xcb_pad = 0;
4161 xcb_block_len = 0;
4162 /* explicit */
4163 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->explicit;
4164 xcb_block_len += totalKeyExplicit * sizeof(xcb_xkb_set_explicit_t);
4165 xcb_parts[xcb_parts_idx].iov_len = totalKeyExplicit * sizeof(xcb_xkb_set_explicit_t);
4166 xcb_parts_idx++;
4167 xcb_align_to = ALIGNOF(xcb_xkb_set_explicit_t);
4169 if(present & XCB_XKB_MAP_PART_MODIFIER_MAP) {
4170 /* insert padding */
4171 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4172 xcb_buffer_len += xcb_block_len + xcb_pad;
4173 if (0 != xcb_pad) {
4174 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
4175 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
4176 xcb_parts_idx++;
4177 xcb_pad = 0;
4179 xcb_block_len = 0;
4180 /* modmap */
4181 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->modmap;
4182 xcb_block_len += totalModMapKeys * sizeof(xcb_xkb_key_mod_map_t);
4183 xcb_parts[xcb_parts_idx].iov_len = totalModMapKeys * sizeof(xcb_xkb_key_mod_map_t);
4184 xcb_parts_idx++;
4185 xcb_align_to = ALIGNOF(xcb_xkb_key_mod_map_t);
4187 if(present & XCB_XKB_MAP_PART_VIRTUAL_MOD_MAP) {
4188 /* insert padding */
4189 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4190 xcb_buffer_len += xcb_block_len + xcb_pad;
4191 if (0 != xcb_pad) {
4192 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
4193 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
4194 xcb_parts_idx++;
4195 xcb_pad = 0;
4197 xcb_block_len = 0;
4198 /* vmodmap */
4199 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->vmodmap;
4200 xcb_block_len += totalVModMapKeys * sizeof(xcb_xkb_key_v_mod_map_t);
4201 xcb_parts[xcb_parts_idx].iov_len = totalVModMapKeys * sizeof(xcb_xkb_key_v_mod_map_t);
4202 xcb_parts_idx++;
4203 xcb_align_to = ALIGNOF(xcb_xkb_key_v_mod_map_t);
4205 /* insert padding */
4206 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4207 xcb_buffer_len += xcb_block_len + xcb_pad;
4208 if (0 != xcb_pad) {
4209 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
4210 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
4211 xcb_parts_idx++;
4212 xcb_pad = 0;
4214 xcb_block_len = 0;
4216 if (NULL == xcb_out) {
4217 /* allocate memory */
4218 xcb_out = malloc(xcb_buffer_len);
4219 *_buffer = xcb_out;
4222 xcb_tmp = xcb_out;
4223 for(i=0; i<xcb_parts_idx; i++) {
4224 if (0 != xcb_parts[i].iov_base && 0 != xcb_parts[i].iov_len)
4225 memcpy(xcb_tmp, xcb_parts[i].iov_base, xcb_parts[i].iov_len);
4226 if (0 != xcb_parts[i].iov_len)
4227 xcb_tmp += xcb_parts[i].iov_len;
4230 return xcb_buffer_len;
4234 xcb_xkb_set_map_values_unpack (const void *_buffer /**< */,
4235 uint8_t nTypes /**< */,
4236 uint8_t nKeySyms /**< */,
4237 uint8_t nKeyActions /**< */,
4238 uint16_t totalActions /**< */,
4239 uint8_t totalKeyBehaviors /**< */,
4240 uint16_t virtualMods /**< */,
4241 uint8_t totalKeyExplicit /**< */,
4242 uint8_t totalModMapKeys /**< */,
4243 uint8_t totalVModMapKeys /**< */,
4244 uint16_t present /**< */,
4245 xcb_xkb_set_map_values_t *_aux /**< */)
4247 char *xcb_tmp = (char *)_buffer;
4248 unsigned int xcb_buffer_len = 0;
4249 unsigned int xcb_block_len = 0;
4250 unsigned int xcb_pad = 0;
4251 unsigned int xcb_align_to = 0;
4253 unsigned int i;
4254 unsigned int xcb_tmp_len;
4256 if(present & XCB_XKB_MAP_PART_KEY_TYPES) {
4257 /* insert padding */
4258 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4259 xcb_buffer_len += xcb_block_len + xcb_pad;
4260 if (0 != xcb_pad) {
4261 xcb_tmp += xcb_pad;
4262 xcb_pad = 0;
4264 xcb_block_len = 0;
4265 /* types */
4266 _aux->types = (xcb_xkb_set_key_type_t *)xcb_tmp;
4267 for(i=0; i<nTypes; i++) {
4268 xcb_tmp_len = xcb_xkb_set_key_type_sizeof(xcb_tmp);
4269 xcb_block_len += xcb_tmp_len;
4270 xcb_tmp += xcb_tmp_len;
4272 xcb_align_to = ALIGNOF(xcb_xkb_set_key_type_t);
4274 if(present & XCB_XKB_MAP_PART_KEY_SYMS) {
4275 /* insert padding */
4276 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4277 xcb_buffer_len += xcb_block_len + xcb_pad;
4278 if (0 != xcb_pad) {
4279 xcb_tmp += xcb_pad;
4280 xcb_pad = 0;
4282 xcb_block_len = 0;
4283 /* syms */
4284 _aux->syms = (xcb_xkb_key_sym_map_t *)xcb_tmp;
4285 for(i=0; i<nKeySyms; i++) {
4286 xcb_tmp_len = xcb_xkb_key_sym_map_sizeof(xcb_tmp);
4287 xcb_block_len += xcb_tmp_len;
4288 xcb_tmp += xcb_tmp_len;
4290 xcb_align_to = ALIGNOF(xcb_xkb_key_sym_map_t);
4292 if(present & XCB_XKB_MAP_PART_KEY_ACTIONS) {
4293 /* insert padding */
4294 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4295 xcb_buffer_len += xcb_block_len + xcb_pad;
4296 if (0 != xcb_pad) {
4297 xcb_tmp += xcb_pad;
4298 xcb_pad = 0;
4300 xcb_block_len = 0;
4301 /* actionsCount */
4302 _aux->actionsCount = (uint8_t *)xcb_tmp;
4303 xcb_block_len += nKeyActions * sizeof(xcb_keycode_t);
4304 xcb_tmp += xcb_block_len;
4305 xcb_align_to = ALIGNOF(uint8_t);
4306 /* insert padding */
4307 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4308 xcb_buffer_len += xcb_block_len + xcb_pad;
4309 if (0 != xcb_pad) {
4310 xcb_tmp += xcb_pad;
4311 xcb_pad = 0;
4313 xcb_block_len = 0;
4314 /* actions */
4315 _aux->actions = (xcb_xkb_action_t *)xcb_tmp;
4316 xcb_block_len += totalActions * sizeof(xcb_xkb_action_t);
4317 xcb_tmp += xcb_block_len;
4318 xcb_align_to = ALIGNOF(xcb_xkb_action_t);
4320 if(present & XCB_XKB_MAP_PART_KEY_BEHAVIORS) {
4321 /* insert padding */
4322 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4323 xcb_buffer_len += xcb_block_len + xcb_pad;
4324 if (0 != xcb_pad) {
4325 xcb_tmp += xcb_pad;
4326 xcb_pad = 0;
4328 xcb_block_len = 0;
4329 /* behaviors */
4330 _aux->behaviors = (xcb_xkb_set_behavior_t *)xcb_tmp;
4331 xcb_block_len += totalKeyBehaviors * sizeof(xcb_xkb_set_behavior_t);
4332 xcb_tmp += xcb_block_len;
4333 xcb_align_to = ALIGNOF(xcb_xkb_set_behavior_t);
4335 if(present & XCB_XKB_MAP_PART_VIRTUAL_MODS) {
4336 /* insert padding */
4337 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4338 xcb_buffer_len += xcb_block_len + xcb_pad;
4339 if (0 != xcb_pad) {
4340 xcb_tmp += xcb_pad;
4341 xcb_pad = 0;
4343 xcb_block_len = 0;
4344 /* vmods */
4345 _aux->vmods = (uint8_t *)xcb_tmp;
4346 xcb_block_len += xcb_popcount(virtualMods) * sizeof(xcb_keycode_t);
4347 xcb_tmp += xcb_block_len;
4348 xcb_align_to = ALIGNOF(uint8_t);
4350 if(present & XCB_XKB_MAP_PART_EXPLICIT_COMPONENTS) {
4351 /* insert padding */
4352 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4353 xcb_buffer_len += xcb_block_len + xcb_pad;
4354 if (0 != xcb_pad) {
4355 xcb_tmp += xcb_pad;
4356 xcb_pad = 0;
4358 xcb_block_len = 0;
4359 /* explicit */
4360 _aux->explicit = (xcb_xkb_set_explicit_t *)xcb_tmp;
4361 xcb_block_len += totalKeyExplicit * sizeof(xcb_xkb_set_explicit_t);
4362 xcb_tmp += xcb_block_len;
4363 xcb_align_to = ALIGNOF(xcb_xkb_set_explicit_t);
4365 if(present & XCB_XKB_MAP_PART_MODIFIER_MAP) {
4366 /* insert padding */
4367 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4368 xcb_buffer_len += xcb_block_len + xcb_pad;
4369 if (0 != xcb_pad) {
4370 xcb_tmp += xcb_pad;
4371 xcb_pad = 0;
4373 xcb_block_len = 0;
4374 /* modmap */
4375 _aux->modmap = (xcb_xkb_key_mod_map_t *)xcb_tmp;
4376 xcb_block_len += totalModMapKeys * sizeof(xcb_xkb_key_mod_map_t);
4377 xcb_tmp += xcb_block_len;
4378 xcb_align_to = ALIGNOF(xcb_xkb_key_mod_map_t);
4380 if(present & XCB_XKB_MAP_PART_VIRTUAL_MOD_MAP) {
4381 /* insert padding */
4382 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4383 xcb_buffer_len += xcb_block_len + xcb_pad;
4384 if (0 != xcb_pad) {
4385 xcb_tmp += xcb_pad;
4386 xcb_pad = 0;
4388 xcb_block_len = 0;
4389 /* vmodmap */
4390 _aux->vmodmap = (xcb_xkb_key_v_mod_map_t *)xcb_tmp;
4391 xcb_block_len += totalVModMapKeys * sizeof(xcb_xkb_key_v_mod_map_t);
4392 xcb_tmp += xcb_block_len;
4393 xcb_align_to = ALIGNOF(xcb_xkb_key_v_mod_map_t);
4395 /* insert padding */
4396 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4397 xcb_buffer_len += xcb_block_len + xcb_pad;
4398 if (0 != xcb_pad) {
4399 xcb_tmp += xcb_pad;
4400 xcb_pad = 0;
4402 xcb_block_len = 0;
4404 return xcb_buffer_len;
4408 xcb_xkb_set_map_values_sizeof (const void *_buffer /**< */,
4409 uint8_t nTypes /**< */,
4410 uint8_t nKeySyms /**< */,
4411 uint8_t nKeyActions /**< */,
4412 uint16_t totalActions /**< */,
4413 uint8_t totalKeyBehaviors /**< */,
4414 uint16_t virtualMods /**< */,
4415 uint8_t totalKeyExplicit /**< */,
4416 uint8_t totalModMapKeys /**< */,
4417 uint8_t totalVModMapKeys /**< */,
4418 uint16_t present /**< */)
4420 xcb_xkb_set_map_values_t _aux;
4421 return xcb_xkb_set_map_values_unpack(_buffer, nTypes, nKeySyms, nKeyActions, totalActions, totalKeyBehaviors, virtualMods, totalKeyExplicit, totalModMapKeys, totalVModMapKeys, present, &_aux);
4424 xcb_void_cookie_t
4425 xcb_xkb_set_map_checked (xcb_connection_t *c /**< */,
4426 xcb_xkb_device_spec_t deviceSpec /**< */,
4427 uint16_t present /**< */,
4428 uint16_t flags /**< */,
4429 xcb_keycode_t minKeyCode /**< */,
4430 xcb_keycode_t maxKeyCode /**< */,
4431 uint8_t firstType /**< */,
4432 uint8_t nTypes /**< */,
4433 xcb_keycode_t firstKeySym /**< */,
4434 uint8_t nKeySyms /**< */,
4435 uint16_t totalSyms /**< */,
4436 xcb_keycode_t firstKeyAction /**< */,
4437 uint8_t nKeyActions /**< */,
4438 uint16_t totalActions /**< */,
4439 xcb_keycode_t firstKeyBehavior /**< */,
4440 uint8_t nKeyBehaviors /**< */,
4441 uint8_t totalKeyBehaviors /**< */,
4442 xcb_keycode_t firstKeyExplicit /**< */,
4443 uint8_t nKeyExplicit /**< */,
4444 uint8_t totalKeyExplicit /**< */,
4445 xcb_keycode_t firstModMapKey /**< */,
4446 uint8_t nModMapKeys /**< */,
4447 uint8_t totalModMapKeys /**< */,
4448 xcb_keycode_t firstVModMapKey /**< */,
4449 uint8_t nVModMapKeys /**< */,
4450 uint8_t totalVModMapKeys /**< */,
4451 uint16_t virtualMods /**< */,
4452 const void *values /**< */)
4454 static const xcb_protocol_request_t xcb_req = {
4455 /* count */ 3,
4456 /* ext */ &xcb_xkb_id,
4457 /* opcode */ XCB_XKB_SET_MAP,
4458 /* isvoid */ 1
4461 struct iovec xcb_parts[5];
4462 xcb_void_cookie_t xcb_ret;
4463 xcb_xkb_set_map_request_t xcb_out;
4465 xcb_out.deviceSpec = deviceSpec;
4466 xcb_out.present = present;
4467 xcb_out.flags = flags;
4468 xcb_out.minKeyCode = minKeyCode;
4469 xcb_out.maxKeyCode = maxKeyCode;
4470 xcb_out.firstType = firstType;
4471 xcb_out.nTypes = nTypes;
4472 xcb_out.firstKeySym = firstKeySym;
4473 xcb_out.nKeySyms = nKeySyms;
4474 xcb_out.totalSyms = totalSyms;
4475 xcb_out.firstKeyAction = firstKeyAction;
4476 xcb_out.nKeyActions = nKeyActions;
4477 xcb_out.totalActions = totalActions;
4478 xcb_out.firstKeyBehavior = firstKeyBehavior;
4479 xcb_out.nKeyBehaviors = nKeyBehaviors;
4480 xcb_out.totalKeyBehaviors = totalKeyBehaviors;
4481 xcb_out.firstKeyExplicit = firstKeyExplicit;
4482 xcb_out.nKeyExplicit = nKeyExplicit;
4483 xcb_out.totalKeyExplicit = totalKeyExplicit;
4484 xcb_out.firstModMapKey = firstModMapKey;
4485 xcb_out.nModMapKeys = nModMapKeys;
4486 xcb_out.totalModMapKeys = totalModMapKeys;
4487 xcb_out.firstVModMapKey = firstVModMapKey;
4488 xcb_out.nVModMapKeys = nVModMapKeys;
4489 xcb_out.totalVModMapKeys = totalVModMapKeys;
4490 xcb_out.virtualMods = virtualMods;
4492 xcb_parts[2].iov_base = (char *) &xcb_out;
4493 xcb_parts[2].iov_len = sizeof(xcb_out);
4494 xcb_parts[3].iov_base = 0;
4495 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4496 /* xcb_xkb_set_map_values_t values */
4497 xcb_parts[4].iov_base = (char *) values;
4498 xcb_parts[4].iov_len =
4499 xcb_xkb_set_map_values_sizeof (values, nTypes, nKeySyms, nKeyActions, totalActions, totalKeyBehaviors, virtualMods, totalKeyExplicit, totalModMapKeys, totalVModMapKeys, present);
4501 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
4502 return xcb_ret;
4505 xcb_void_cookie_t
4506 xcb_xkb_set_map (xcb_connection_t *c /**< */,
4507 xcb_xkb_device_spec_t deviceSpec /**< */,
4508 uint16_t present /**< */,
4509 uint16_t flags /**< */,
4510 xcb_keycode_t minKeyCode /**< */,
4511 xcb_keycode_t maxKeyCode /**< */,
4512 uint8_t firstType /**< */,
4513 uint8_t nTypes /**< */,
4514 xcb_keycode_t firstKeySym /**< */,
4515 uint8_t nKeySyms /**< */,
4516 uint16_t totalSyms /**< */,
4517 xcb_keycode_t firstKeyAction /**< */,
4518 uint8_t nKeyActions /**< */,
4519 uint16_t totalActions /**< */,
4520 xcb_keycode_t firstKeyBehavior /**< */,
4521 uint8_t nKeyBehaviors /**< */,
4522 uint8_t totalKeyBehaviors /**< */,
4523 xcb_keycode_t firstKeyExplicit /**< */,
4524 uint8_t nKeyExplicit /**< */,
4525 uint8_t totalKeyExplicit /**< */,
4526 xcb_keycode_t firstModMapKey /**< */,
4527 uint8_t nModMapKeys /**< */,
4528 uint8_t totalModMapKeys /**< */,
4529 xcb_keycode_t firstVModMapKey /**< */,
4530 uint8_t nVModMapKeys /**< */,
4531 uint8_t totalVModMapKeys /**< */,
4532 uint16_t virtualMods /**< */,
4533 const void *values /**< */)
4535 static const xcb_protocol_request_t xcb_req = {
4536 /* count */ 3,
4537 /* ext */ &xcb_xkb_id,
4538 /* opcode */ XCB_XKB_SET_MAP,
4539 /* isvoid */ 1
4542 struct iovec xcb_parts[5];
4543 xcb_void_cookie_t xcb_ret;
4544 xcb_xkb_set_map_request_t xcb_out;
4546 xcb_out.deviceSpec = deviceSpec;
4547 xcb_out.present = present;
4548 xcb_out.flags = flags;
4549 xcb_out.minKeyCode = minKeyCode;
4550 xcb_out.maxKeyCode = maxKeyCode;
4551 xcb_out.firstType = firstType;
4552 xcb_out.nTypes = nTypes;
4553 xcb_out.firstKeySym = firstKeySym;
4554 xcb_out.nKeySyms = nKeySyms;
4555 xcb_out.totalSyms = totalSyms;
4556 xcb_out.firstKeyAction = firstKeyAction;
4557 xcb_out.nKeyActions = nKeyActions;
4558 xcb_out.totalActions = totalActions;
4559 xcb_out.firstKeyBehavior = firstKeyBehavior;
4560 xcb_out.nKeyBehaviors = nKeyBehaviors;
4561 xcb_out.totalKeyBehaviors = totalKeyBehaviors;
4562 xcb_out.firstKeyExplicit = firstKeyExplicit;
4563 xcb_out.nKeyExplicit = nKeyExplicit;
4564 xcb_out.totalKeyExplicit = totalKeyExplicit;
4565 xcb_out.firstModMapKey = firstModMapKey;
4566 xcb_out.nModMapKeys = nModMapKeys;
4567 xcb_out.totalModMapKeys = totalModMapKeys;
4568 xcb_out.firstVModMapKey = firstVModMapKey;
4569 xcb_out.nVModMapKeys = nVModMapKeys;
4570 xcb_out.totalVModMapKeys = totalVModMapKeys;
4571 xcb_out.virtualMods = virtualMods;
4573 xcb_parts[2].iov_base = (char *) &xcb_out;
4574 xcb_parts[2].iov_len = sizeof(xcb_out);
4575 xcb_parts[3].iov_base = 0;
4576 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4577 /* xcb_xkb_set_map_values_t values */
4578 xcb_parts[4].iov_base = (char *) values;
4579 xcb_parts[4].iov_len =
4580 xcb_xkb_set_map_values_sizeof (values, nTypes, nKeySyms, nKeyActions, totalActions, totalKeyBehaviors, virtualMods, totalKeyExplicit, totalModMapKeys, totalVModMapKeys, present);
4582 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
4583 return xcb_ret;
4586 xcb_void_cookie_t
4587 xcb_xkb_set_map_aux_checked (xcb_connection_t *c /**< */,
4588 xcb_xkb_device_spec_t deviceSpec /**< */,
4589 uint16_t present /**< */,
4590 uint16_t flags /**< */,
4591 xcb_keycode_t minKeyCode /**< */,
4592 xcb_keycode_t maxKeyCode /**< */,
4593 uint8_t firstType /**< */,
4594 uint8_t nTypes /**< */,
4595 xcb_keycode_t firstKeySym /**< */,
4596 uint8_t nKeySyms /**< */,
4597 uint16_t totalSyms /**< */,
4598 xcb_keycode_t firstKeyAction /**< */,
4599 uint8_t nKeyActions /**< */,
4600 uint16_t totalActions /**< */,
4601 xcb_keycode_t firstKeyBehavior /**< */,
4602 uint8_t nKeyBehaviors /**< */,
4603 uint8_t totalKeyBehaviors /**< */,
4604 xcb_keycode_t firstKeyExplicit /**< */,
4605 uint8_t nKeyExplicit /**< */,
4606 uint8_t totalKeyExplicit /**< */,
4607 xcb_keycode_t firstModMapKey /**< */,
4608 uint8_t nModMapKeys /**< */,
4609 uint8_t totalModMapKeys /**< */,
4610 xcb_keycode_t firstVModMapKey /**< */,
4611 uint8_t nVModMapKeys /**< */,
4612 uint8_t totalVModMapKeys /**< */,
4613 uint16_t virtualMods /**< */,
4614 const xcb_xkb_set_map_values_t *values /**< */)
4616 static const xcb_protocol_request_t xcb_req = {
4617 /* count */ 3,
4618 /* ext */ &xcb_xkb_id,
4619 /* opcode */ XCB_XKB_SET_MAP,
4620 /* isvoid */ 1
4623 struct iovec xcb_parts[5];
4624 xcb_void_cookie_t xcb_ret;
4625 xcb_xkb_set_map_request_t xcb_out;
4626 void *xcb_aux0 = 0;
4628 xcb_out.deviceSpec = deviceSpec;
4629 xcb_out.present = present;
4630 xcb_out.flags = flags;
4631 xcb_out.minKeyCode = minKeyCode;
4632 xcb_out.maxKeyCode = maxKeyCode;
4633 xcb_out.firstType = firstType;
4634 xcb_out.nTypes = nTypes;
4635 xcb_out.firstKeySym = firstKeySym;
4636 xcb_out.nKeySyms = nKeySyms;
4637 xcb_out.totalSyms = totalSyms;
4638 xcb_out.firstKeyAction = firstKeyAction;
4639 xcb_out.nKeyActions = nKeyActions;
4640 xcb_out.totalActions = totalActions;
4641 xcb_out.firstKeyBehavior = firstKeyBehavior;
4642 xcb_out.nKeyBehaviors = nKeyBehaviors;
4643 xcb_out.totalKeyBehaviors = totalKeyBehaviors;
4644 xcb_out.firstKeyExplicit = firstKeyExplicit;
4645 xcb_out.nKeyExplicit = nKeyExplicit;
4646 xcb_out.totalKeyExplicit = totalKeyExplicit;
4647 xcb_out.firstModMapKey = firstModMapKey;
4648 xcb_out.nModMapKeys = nModMapKeys;
4649 xcb_out.totalModMapKeys = totalModMapKeys;
4650 xcb_out.firstVModMapKey = firstVModMapKey;
4651 xcb_out.nVModMapKeys = nVModMapKeys;
4652 xcb_out.totalVModMapKeys = totalVModMapKeys;
4653 xcb_out.virtualMods = virtualMods;
4655 xcb_parts[2].iov_base = (char *) &xcb_out;
4656 xcb_parts[2].iov_len = sizeof(xcb_out);
4657 xcb_parts[3].iov_base = 0;
4658 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4659 /* xcb_xkb_set_map_values_t values */
4660 xcb_parts[4].iov_len =
4661 xcb_xkb_set_map_values_serialize (&xcb_aux0, nTypes, nKeySyms, nKeyActions, totalActions, totalKeyBehaviors, virtualMods, totalKeyExplicit, totalModMapKeys, totalVModMapKeys, present, values);
4662 xcb_parts[4].iov_base = xcb_aux0;
4664 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
4665 free(xcb_aux0);
4666 return xcb_ret;
4669 xcb_void_cookie_t
4670 xcb_xkb_set_map_aux (xcb_connection_t *c /**< */,
4671 xcb_xkb_device_spec_t deviceSpec /**< */,
4672 uint16_t present /**< */,
4673 uint16_t flags /**< */,
4674 xcb_keycode_t minKeyCode /**< */,
4675 xcb_keycode_t maxKeyCode /**< */,
4676 uint8_t firstType /**< */,
4677 uint8_t nTypes /**< */,
4678 xcb_keycode_t firstKeySym /**< */,
4679 uint8_t nKeySyms /**< */,
4680 uint16_t totalSyms /**< */,
4681 xcb_keycode_t firstKeyAction /**< */,
4682 uint8_t nKeyActions /**< */,
4683 uint16_t totalActions /**< */,
4684 xcb_keycode_t firstKeyBehavior /**< */,
4685 uint8_t nKeyBehaviors /**< */,
4686 uint8_t totalKeyBehaviors /**< */,
4687 xcb_keycode_t firstKeyExplicit /**< */,
4688 uint8_t nKeyExplicit /**< */,
4689 uint8_t totalKeyExplicit /**< */,
4690 xcb_keycode_t firstModMapKey /**< */,
4691 uint8_t nModMapKeys /**< */,
4692 uint8_t totalModMapKeys /**< */,
4693 xcb_keycode_t firstVModMapKey /**< */,
4694 uint8_t nVModMapKeys /**< */,
4695 uint8_t totalVModMapKeys /**< */,
4696 uint16_t virtualMods /**< */,
4697 const xcb_xkb_set_map_values_t *values /**< */)
4699 static const xcb_protocol_request_t xcb_req = {
4700 /* count */ 3,
4701 /* ext */ &xcb_xkb_id,
4702 /* opcode */ XCB_XKB_SET_MAP,
4703 /* isvoid */ 1
4706 struct iovec xcb_parts[5];
4707 xcb_void_cookie_t xcb_ret;
4708 xcb_xkb_set_map_request_t xcb_out;
4709 void *xcb_aux0 = 0;
4711 xcb_out.deviceSpec = deviceSpec;
4712 xcb_out.present = present;
4713 xcb_out.flags = flags;
4714 xcb_out.minKeyCode = minKeyCode;
4715 xcb_out.maxKeyCode = maxKeyCode;
4716 xcb_out.firstType = firstType;
4717 xcb_out.nTypes = nTypes;
4718 xcb_out.firstKeySym = firstKeySym;
4719 xcb_out.nKeySyms = nKeySyms;
4720 xcb_out.totalSyms = totalSyms;
4721 xcb_out.firstKeyAction = firstKeyAction;
4722 xcb_out.nKeyActions = nKeyActions;
4723 xcb_out.totalActions = totalActions;
4724 xcb_out.firstKeyBehavior = firstKeyBehavior;
4725 xcb_out.nKeyBehaviors = nKeyBehaviors;
4726 xcb_out.totalKeyBehaviors = totalKeyBehaviors;
4727 xcb_out.firstKeyExplicit = firstKeyExplicit;
4728 xcb_out.nKeyExplicit = nKeyExplicit;
4729 xcb_out.totalKeyExplicit = totalKeyExplicit;
4730 xcb_out.firstModMapKey = firstModMapKey;
4731 xcb_out.nModMapKeys = nModMapKeys;
4732 xcb_out.totalModMapKeys = totalModMapKeys;
4733 xcb_out.firstVModMapKey = firstVModMapKey;
4734 xcb_out.nVModMapKeys = nVModMapKeys;
4735 xcb_out.totalVModMapKeys = totalVModMapKeys;
4736 xcb_out.virtualMods = virtualMods;
4738 xcb_parts[2].iov_base = (char *) &xcb_out;
4739 xcb_parts[2].iov_len = sizeof(xcb_out);
4740 xcb_parts[3].iov_base = 0;
4741 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4742 /* xcb_xkb_set_map_values_t values */
4743 xcb_parts[4].iov_len =
4744 xcb_xkb_set_map_values_serialize (&xcb_aux0, nTypes, nKeySyms, nKeyActions, totalActions, totalKeyBehaviors, virtualMods, totalKeyExplicit, totalModMapKeys, totalVModMapKeys, present, values);
4745 xcb_parts[4].iov_base = xcb_aux0;
4747 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
4748 free(xcb_aux0);
4749 return xcb_ret;
4753 xcb_xkb_get_compat_map_sizeof (const void *_buffer /**< */)
4755 char *xcb_tmp = (char *)_buffer;
4756 const xcb_xkb_get_compat_map_reply_t *_aux = (xcb_xkb_get_compat_map_reply_t *)_buffer;
4757 unsigned int xcb_buffer_len = 0;
4758 unsigned int xcb_block_len = 0;
4759 unsigned int xcb_pad = 0;
4760 unsigned int xcb_align_to = 0;
4763 xcb_block_len += sizeof(xcb_xkb_get_compat_map_reply_t);
4764 xcb_tmp += xcb_block_len;
4765 xcb_buffer_len += xcb_block_len;
4766 xcb_block_len = 0;
4767 /* si_rtrn */
4768 xcb_block_len += _aux->nSIRtrn * sizeof(xcb_xkb_sym_interpret_t);
4769 xcb_tmp += xcb_block_len;
4770 xcb_align_to = ALIGNOF(xcb_xkb_sym_interpret_t);
4771 /* insert padding */
4772 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4773 xcb_buffer_len += xcb_block_len + xcb_pad;
4774 if (0 != xcb_pad) {
4775 xcb_tmp += xcb_pad;
4776 xcb_pad = 0;
4778 xcb_block_len = 0;
4779 /* group_rtrn */
4780 xcb_block_len += xcb_popcount(_aux->groupsRtrn) * sizeof(xcb_xkb_mod_def_t);
4781 xcb_tmp += xcb_block_len;
4782 xcb_align_to = ALIGNOF(xcb_xkb_mod_def_t);
4783 /* insert padding */
4784 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4785 xcb_buffer_len += xcb_block_len + xcb_pad;
4786 if (0 != xcb_pad) {
4787 xcb_tmp += xcb_pad;
4788 xcb_pad = 0;
4790 xcb_block_len = 0;
4792 return xcb_buffer_len;
4795 xcb_xkb_get_compat_map_cookie_t
4796 xcb_xkb_get_compat_map (xcb_connection_t *c /**< */,
4797 xcb_xkb_device_spec_t deviceSpec /**< */,
4798 uint8_t groups /**< */,
4799 uint8_t getAllSI /**< */,
4800 uint16_t firstSI /**< */,
4801 uint16_t nSI /**< */)
4803 static const xcb_protocol_request_t xcb_req = {
4804 /* count */ 2,
4805 /* ext */ &xcb_xkb_id,
4806 /* opcode */ XCB_XKB_GET_COMPAT_MAP,
4807 /* isvoid */ 0
4810 struct iovec xcb_parts[4];
4811 xcb_xkb_get_compat_map_cookie_t xcb_ret;
4812 xcb_xkb_get_compat_map_request_t xcb_out;
4814 xcb_out.deviceSpec = deviceSpec;
4815 xcb_out.groups = groups;
4816 xcb_out.getAllSI = getAllSI;
4817 xcb_out.firstSI = firstSI;
4818 xcb_out.nSI = nSI;
4820 xcb_parts[2].iov_base = (char *) &xcb_out;
4821 xcb_parts[2].iov_len = sizeof(xcb_out);
4822 xcb_parts[3].iov_base = 0;
4823 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4825 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
4826 return xcb_ret;
4829 xcb_xkb_get_compat_map_cookie_t
4830 xcb_xkb_get_compat_map_unchecked (xcb_connection_t *c /**< */,
4831 xcb_xkb_device_spec_t deviceSpec /**< */,
4832 uint8_t groups /**< */,
4833 uint8_t getAllSI /**< */,
4834 uint16_t firstSI /**< */,
4835 uint16_t nSI /**< */)
4837 static const xcb_protocol_request_t xcb_req = {
4838 /* count */ 2,
4839 /* ext */ &xcb_xkb_id,
4840 /* opcode */ XCB_XKB_GET_COMPAT_MAP,
4841 /* isvoid */ 0
4844 struct iovec xcb_parts[4];
4845 xcb_xkb_get_compat_map_cookie_t xcb_ret;
4846 xcb_xkb_get_compat_map_request_t xcb_out;
4848 xcb_out.deviceSpec = deviceSpec;
4849 xcb_out.groups = groups;
4850 xcb_out.getAllSI = getAllSI;
4851 xcb_out.firstSI = firstSI;
4852 xcb_out.nSI = nSI;
4854 xcb_parts[2].iov_base = (char *) &xcb_out;
4855 xcb_parts[2].iov_len = sizeof(xcb_out);
4856 xcb_parts[3].iov_base = 0;
4857 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4859 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
4860 return xcb_ret;
4863 xcb_xkb_sym_interpret_t *
4864 xcb_xkb_get_compat_map_si_rtrn (const xcb_xkb_get_compat_map_reply_t *R /**< */)
4866 return (xcb_xkb_sym_interpret_t *) (R + 1);
4870 xcb_xkb_get_compat_map_si_rtrn_length (const xcb_xkb_get_compat_map_reply_t *R /**< */)
4872 return R->nSIRtrn;
4875 xcb_xkb_sym_interpret_iterator_t
4876 xcb_xkb_get_compat_map_si_rtrn_iterator (const xcb_xkb_get_compat_map_reply_t *R /**< */)
4878 xcb_xkb_sym_interpret_iterator_t i;
4879 i.data = (xcb_xkb_sym_interpret_t *) (R + 1);
4880 i.rem = R->nSIRtrn;
4881 i.index = (char *) i.data - (char *) R;
4882 return i;
4885 xcb_xkb_mod_def_t *
4886 xcb_xkb_get_compat_map_group_rtrn (const xcb_xkb_get_compat_map_reply_t *R /**< */)
4888 xcb_generic_iterator_t prev = xcb_xkb_sym_interpret_end(xcb_xkb_get_compat_map_si_rtrn_iterator(R));
4889 return (xcb_xkb_mod_def_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xkb_mod_def_t, prev.index) + 0);
4893 xcb_xkb_get_compat_map_group_rtrn_length (const xcb_xkb_get_compat_map_reply_t *R /**< */)
4895 return xcb_popcount(R->groupsRtrn);
4898 xcb_xkb_mod_def_iterator_t
4899 xcb_xkb_get_compat_map_group_rtrn_iterator (const xcb_xkb_get_compat_map_reply_t *R /**< */)
4901 xcb_xkb_mod_def_iterator_t i;
4902 xcb_generic_iterator_t prev = xcb_xkb_sym_interpret_end(xcb_xkb_get_compat_map_si_rtrn_iterator(R));
4903 i.data = (xcb_xkb_mod_def_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xkb_mod_def_t, prev.index));
4904 i.rem = xcb_popcount(R->groupsRtrn);
4905 i.index = (char *) i.data - (char *) R;
4906 return i;
4909 xcb_xkb_get_compat_map_reply_t *
4910 xcb_xkb_get_compat_map_reply (xcb_connection_t *c /**< */,
4911 xcb_xkb_get_compat_map_cookie_t cookie /**< */,
4912 xcb_generic_error_t **e /**< */)
4914 return (xcb_xkb_get_compat_map_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
4918 xcb_xkb_set_compat_map_sizeof (const void *_buffer /**< */)
4920 char *xcb_tmp = (char *)_buffer;
4921 const xcb_xkb_set_compat_map_request_t *_aux = (xcb_xkb_set_compat_map_request_t *)_buffer;
4922 unsigned int xcb_buffer_len = 0;
4923 unsigned int xcb_block_len = 0;
4924 unsigned int xcb_pad = 0;
4925 unsigned int xcb_align_to = 0;
4928 xcb_block_len += sizeof(xcb_xkb_set_compat_map_request_t);
4929 xcb_tmp += xcb_block_len;
4930 xcb_buffer_len += xcb_block_len;
4931 xcb_block_len = 0;
4932 /* si */
4933 xcb_block_len += _aux->nSI * sizeof(xcb_xkb_sym_interpret_t);
4934 xcb_tmp += xcb_block_len;
4935 xcb_align_to = ALIGNOF(xcb_xkb_sym_interpret_t);
4936 /* insert padding */
4937 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4938 xcb_buffer_len += xcb_block_len + xcb_pad;
4939 if (0 != xcb_pad) {
4940 xcb_tmp += xcb_pad;
4941 xcb_pad = 0;
4943 xcb_block_len = 0;
4944 /* groupMaps */
4945 xcb_block_len += xcb_popcount(_aux->groups) * sizeof(xcb_xkb_mod_def_t);
4946 xcb_tmp += xcb_block_len;
4947 xcb_align_to = ALIGNOF(xcb_xkb_mod_def_t);
4948 /* insert padding */
4949 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4950 xcb_buffer_len += xcb_block_len + xcb_pad;
4951 if (0 != xcb_pad) {
4952 xcb_tmp += xcb_pad;
4953 xcb_pad = 0;
4955 xcb_block_len = 0;
4957 return xcb_buffer_len;
4960 xcb_void_cookie_t
4961 xcb_xkb_set_compat_map_checked (xcb_connection_t *c /**< */,
4962 xcb_xkb_device_spec_t deviceSpec /**< */,
4963 uint8_t recomputeActions /**< */,
4964 uint8_t truncateSI /**< */,
4965 uint8_t groups /**< */,
4966 uint16_t firstSI /**< */,
4967 uint16_t nSI /**< */,
4968 const xcb_xkb_sym_interpret_t *si /**< */,
4969 const xcb_xkb_mod_def_t *groupMaps /**< */)
4971 static const xcb_protocol_request_t xcb_req = {
4972 /* count */ 6,
4973 /* ext */ &xcb_xkb_id,
4974 /* opcode */ XCB_XKB_SET_COMPAT_MAP,
4975 /* isvoid */ 1
4978 struct iovec xcb_parts[8];
4979 xcb_void_cookie_t xcb_ret;
4980 xcb_xkb_set_compat_map_request_t xcb_out;
4982 xcb_out.deviceSpec = deviceSpec;
4983 xcb_out.pad0 = 0;
4984 xcb_out.recomputeActions = recomputeActions;
4985 xcb_out.truncateSI = truncateSI;
4986 xcb_out.groups = groups;
4987 xcb_out.firstSI = firstSI;
4988 xcb_out.nSI = nSI;
4989 memset(xcb_out.pad1, 0, 2);
4991 xcb_parts[2].iov_base = (char *) &xcb_out;
4992 xcb_parts[2].iov_len = sizeof(xcb_out);
4993 xcb_parts[3].iov_base = 0;
4994 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4995 /* xcb_xkb_sym_interpret_t si */
4996 xcb_parts[4].iov_base = (char *) si;
4997 xcb_parts[4].iov_len = nSI * sizeof(xcb_xkb_sym_interpret_t);
4998 xcb_parts[5].iov_base = 0;
4999 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
5000 /* xcb_xkb_mod_def_t groupMaps */
5001 xcb_parts[6].iov_base = (char *) groupMaps;
5002 xcb_parts[6].iov_len = xcb_popcount(groups) * sizeof(xcb_xkb_mod_def_t);
5003 xcb_parts[7].iov_base = 0;
5004 xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3;
5006 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
5007 return xcb_ret;
5010 xcb_void_cookie_t
5011 xcb_xkb_set_compat_map (xcb_connection_t *c /**< */,
5012 xcb_xkb_device_spec_t deviceSpec /**< */,
5013 uint8_t recomputeActions /**< */,
5014 uint8_t truncateSI /**< */,
5015 uint8_t groups /**< */,
5016 uint16_t firstSI /**< */,
5017 uint16_t nSI /**< */,
5018 const xcb_xkb_sym_interpret_t *si /**< */,
5019 const xcb_xkb_mod_def_t *groupMaps /**< */)
5021 static const xcb_protocol_request_t xcb_req = {
5022 /* count */ 6,
5023 /* ext */ &xcb_xkb_id,
5024 /* opcode */ XCB_XKB_SET_COMPAT_MAP,
5025 /* isvoid */ 1
5028 struct iovec xcb_parts[8];
5029 xcb_void_cookie_t xcb_ret;
5030 xcb_xkb_set_compat_map_request_t xcb_out;
5032 xcb_out.deviceSpec = deviceSpec;
5033 xcb_out.pad0 = 0;
5034 xcb_out.recomputeActions = recomputeActions;
5035 xcb_out.truncateSI = truncateSI;
5036 xcb_out.groups = groups;
5037 xcb_out.firstSI = firstSI;
5038 xcb_out.nSI = nSI;
5039 memset(xcb_out.pad1, 0, 2);
5041 xcb_parts[2].iov_base = (char *) &xcb_out;
5042 xcb_parts[2].iov_len = sizeof(xcb_out);
5043 xcb_parts[3].iov_base = 0;
5044 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5045 /* xcb_xkb_sym_interpret_t si */
5046 xcb_parts[4].iov_base = (char *) si;
5047 xcb_parts[4].iov_len = nSI * sizeof(xcb_xkb_sym_interpret_t);
5048 xcb_parts[5].iov_base = 0;
5049 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
5050 /* xcb_xkb_mod_def_t groupMaps */
5051 xcb_parts[6].iov_base = (char *) groupMaps;
5052 xcb_parts[6].iov_len = xcb_popcount(groups) * sizeof(xcb_xkb_mod_def_t);
5053 xcb_parts[7].iov_base = 0;
5054 xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3;
5056 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
5057 return xcb_ret;
5060 xcb_xkb_get_indicator_state_cookie_t
5061 xcb_xkb_get_indicator_state (xcb_connection_t *c /**< */,
5062 xcb_xkb_device_spec_t deviceSpec /**< */)
5064 static const xcb_protocol_request_t xcb_req = {
5065 /* count */ 2,
5066 /* ext */ &xcb_xkb_id,
5067 /* opcode */ XCB_XKB_GET_INDICATOR_STATE,
5068 /* isvoid */ 0
5071 struct iovec xcb_parts[4];
5072 xcb_xkb_get_indicator_state_cookie_t xcb_ret;
5073 xcb_xkb_get_indicator_state_request_t xcb_out;
5075 xcb_out.deviceSpec = deviceSpec;
5076 memset(xcb_out.pad0, 0, 2);
5078 xcb_parts[2].iov_base = (char *) &xcb_out;
5079 xcb_parts[2].iov_len = sizeof(xcb_out);
5080 xcb_parts[3].iov_base = 0;
5081 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5083 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
5084 return xcb_ret;
5087 xcb_xkb_get_indicator_state_cookie_t
5088 xcb_xkb_get_indicator_state_unchecked (xcb_connection_t *c /**< */,
5089 xcb_xkb_device_spec_t deviceSpec /**< */)
5091 static const xcb_protocol_request_t xcb_req = {
5092 /* count */ 2,
5093 /* ext */ &xcb_xkb_id,
5094 /* opcode */ XCB_XKB_GET_INDICATOR_STATE,
5095 /* isvoid */ 0
5098 struct iovec xcb_parts[4];
5099 xcb_xkb_get_indicator_state_cookie_t xcb_ret;
5100 xcb_xkb_get_indicator_state_request_t xcb_out;
5102 xcb_out.deviceSpec = deviceSpec;
5103 memset(xcb_out.pad0, 0, 2);
5105 xcb_parts[2].iov_base = (char *) &xcb_out;
5106 xcb_parts[2].iov_len = sizeof(xcb_out);
5107 xcb_parts[3].iov_base = 0;
5108 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5110 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
5111 return xcb_ret;
5114 xcb_xkb_get_indicator_state_reply_t *
5115 xcb_xkb_get_indicator_state_reply (xcb_connection_t *c /**< */,
5116 xcb_xkb_get_indicator_state_cookie_t cookie /**< */,
5117 xcb_generic_error_t **e /**< */)
5119 return (xcb_xkb_get_indicator_state_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
5123 xcb_xkb_get_indicator_map_sizeof (const void *_buffer /**< */)
5125 char *xcb_tmp = (char *)_buffer;
5126 const xcb_xkb_get_indicator_map_reply_t *_aux = (xcb_xkb_get_indicator_map_reply_t *)_buffer;
5127 unsigned int xcb_buffer_len = 0;
5128 unsigned int xcb_block_len = 0;
5129 unsigned int xcb_pad = 0;
5130 unsigned int xcb_align_to = 0;
5133 xcb_block_len += sizeof(xcb_xkb_get_indicator_map_reply_t);
5134 xcb_tmp += xcb_block_len;
5135 xcb_buffer_len += xcb_block_len;
5136 xcb_block_len = 0;
5137 /* maps */
5138 xcb_block_len += xcb_popcount(_aux->which) * sizeof(xcb_xkb_indicator_map_t);
5139 xcb_tmp += xcb_block_len;
5140 xcb_align_to = ALIGNOF(xcb_xkb_indicator_map_t);
5141 /* insert padding */
5142 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
5143 xcb_buffer_len += xcb_block_len + xcb_pad;
5144 if (0 != xcb_pad) {
5145 xcb_tmp += xcb_pad;
5146 xcb_pad = 0;
5148 xcb_block_len = 0;
5150 return xcb_buffer_len;
5153 xcb_xkb_get_indicator_map_cookie_t
5154 xcb_xkb_get_indicator_map (xcb_connection_t *c /**< */,
5155 xcb_xkb_device_spec_t deviceSpec /**< */,
5156 uint32_t which /**< */)
5158 static const xcb_protocol_request_t xcb_req = {
5159 /* count */ 2,
5160 /* ext */ &xcb_xkb_id,
5161 /* opcode */ XCB_XKB_GET_INDICATOR_MAP,
5162 /* isvoid */ 0
5165 struct iovec xcb_parts[4];
5166 xcb_xkb_get_indicator_map_cookie_t xcb_ret;
5167 xcb_xkb_get_indicator_map_request_t xcb_out;
5169 xcb_out.deviceSpec = deviceSpec;
5170 memset(xcb_out.pad0, 0, 2);
5171 xcb_out.which = which;
5173 xcb_parts[2].iov_base = (char *) &xcb_out;
5174 xcb_parts[2].iov_len = sizeof(xcb_out);
5175 xcb_parts[3].iov_base = 0;
5176 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5178 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
5179 return xcb_ret;
5182 xcb_xkb_get_indicator_map_cookie_t
5183 xcb_xkb_get_indicator_map_unchecked (xcb_connection_t *c /**< */,
5184 xcb_xkb_device_spec_t deviceSpec /**< */,
5185 uint32_t which /**< */)
5187 static const xcb_protocol_request_t xcb_req = {
5188 /* count */ 2,
5189 /* ext */ &xcb_xkb_id,
5190 /* opcode */ XCB_XKB_GET_INDICATOR_MAP,
5191 /* isvoid */ 0
5194 struct iovec xcb_parts[4];
5195 xcb_xkb_get_indicator_map_cookie_t xcb_ret;
5196 xcb_xkb_get_indicator_map_request_t xcb_out;
5198 xcb_out.deviceSpec = deviceSpec;
5199 memset(xcb_out.pad0, 0, 2);
5200 xcb_out.which = which;
5202 xcb_parts[2].iov_base = (char *) &xcb_out;
5203 xcb_parts[2].iov_len = sizeof(xcb_out);
5204 xcb_parts[3].iov_base = 0;
5205 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5207 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
5208 return xcb_ret;
5211 xcb_xkb_indicator_map_t *
5212 xcb_xkb_get_indicator_map_maps (const xcb_xkb_get_indicator_map_reply_t *R /**< */)
5214 return (xcb_xkb_indicator_map_t *) (R + 1);
5218 xcb_xkb_get_indicator_map_maps_length (const xcb_xkb_get_indicator_map_reply_t *R /**< */)
5220 return xcb_popcount(R->which);
5223 xcb_xkb_indicator_map_iterator_t
5224 xcb_xkb_get_indicator_map_maps_iterator (const xcb_xkb_get_indicator_map_reply_t *R /**< */)
5226 xcb_xkb_indicator_map_iterator_t i;
5227 i.data = (xcb_xkb_indicator_map_t *) (R + 1);
5228 i.rem = xcb_popcount(R->which);
5229 i.index = (char *) i.data - (char *) R;
5230 return i;
5233 xcb_xkb_get_indicator_map_reply_t *
5234 xcb_xkb_get_indicator_map_reply (xcb_connection_t *c /**< */,
5235 xcb_xkb_get_indicator_map_cookie_t cookie /**< */,
5236 xcb_generic_error_t **e /**< */)
5238 return (xcb_xkb_get_indicator_map_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
5242 xcb_xkb_set_indicator_map_sizeof (const void *_buffer /**< */)
5244 char *xcb_tmp = (char *)_buffer;
5245 const xcb_xkb_set_indicator_map_request_t *_aux = (xcb_xkb_set_indicator_map_request_t *)_buffer;
5246 unsigned int xcb_buffer_len = 0;
5247 unsigned int xcb_block_len = 0;
5248 unsigned int xcb_pad = 0;
5249 unsigned int xcb_align_to = 0;
5252 xcb_block_len += sizeof(xcb_xkb_set_indicator_map_request_t);
5253 xcb_tmp += xcb_block_len;
5254 xcb_buffer_len += xcb_block_len;
5255 xcb_block_len = 0;
5256 /* maps */
5257 xcb_block_len += xcb_popcount(_aux->which) * sizeof(xcb_xkb_indicator_map_t);
5258 xcb_tmp += xcb_block_len;
5259 xcb_align_to = ALIGNOF(xcb_xkb_indicator_map_t);
5260 /* insert padding */
5261 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
5262 xcb_buffer_len += xcb_block_len + xcb_pad;
5263 if (0 != xcb_pad) {
5264 xcb_tmp += xcb_pad;
5265 xcb_pad = 0;
5267 xcb_block_len = 0;
5269 return xcb_buffer_len;
5272 xcb_void_cookie_t
5273 xcb_xkb_set_indicator_map_checked (xcb_connection_t *c /**< */,
5274 xcb_xkb_device_spec_t deviceSpec /**< */,
5275 uint32_t which /**< */,
5276 const xcb_xkb_indicator_map_t *maps /**< */)
5278 static const xcb_protocol_request_t xcb_req = {
5279 /* count */ 4,
5280 /* ext */ &xcb_xkb_id,
5281 /* opcode */ XCB_XKB_SET_INDICATOR_MAP,
5282 /* isvoid */ 1
5285 struct iovec xcb_parts[6];
5286 xcb_void_cookie_t xcb_ret;
5287 xcb_xkb_set_indicator_map_request_t xcb_out;
5289 xcb_out.deviceSpec = deviceSpec;
5290 memset(xcb_out.pad0, 0, 2);
5291 xcb_out.which = which;
5293 xcb_parts[2].iov_base = (char *) &xcb_out;
5294 xcb_parts[2].iov_len = sizeof(xcb_out);
5295 xcb_parts[3].iov_base = 0;
5296 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5297 /* xcb_xkb_indicator_map_t maps */
5298 xcb_parts[4].iov_base = (char *) maps;
5299 xcb_parts[4].iov_len = xcb_popcount(which) * sizeof(xcb_xkb_indicator_map_t);
5300 xcb_parts[5].iov_base = 0;
5301 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
5303 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
5304 return xcb_ret;
5307 xcb_void_cookie_t
5308 xcb_xkb_set_indicator_map (xcb_connection_t *c /**< */,
5309 xcb_xkb_device_spec_t deviceSpec /**< */,
5310 uint32_t which /**< */,
5311 const xcb_xkb_indicator_map_t *maps /**< */)
5313 static const xcb_protocol_request_t xcb_req = {
5314 /* count */ 4,
5315 /* ext */ &xcb_xkb_id,
5316 /* opcode */ XCB_XKB_SET_INDICATOR_MAP,
5317 /* isvoid */ 1
5320 struct iovec xcb_parts[6];
5321 xcb_void_cookie_t xcb_ret;
5322 xcb_xkb_set_indicator_map_request_t xcb_out;
5324 xcb_out.deviceSpec = deviceSpec;
5325 memset(xcb_out.pad0, 0, 2);
5326 xcb_out.which = which;
5328 xcb_parts[2].iov_base = (char *) &xcb_out;
5329 xcb_parts[2].iov_len = sizeof(xcb_out);
5330 xcb_parts[3].iov_base = 0;
5331 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5332 /* xcb_xkb_indicator_map_t maps */
5333 xcb_parts[4].iov_base = (char *) maps;
5334 xcb_parts[4].iov_len = xcb_popcount(which) * sizeof(xcb_xkb_indicator_map_t);
5335 xcb_parts[5].iov_base = 0;
5336 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
5338 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
5339 return xcb_ret;
5342 xcb_xkb_get_named_indicator_cookie_t
5343 xcb_xkb_get_named_indicator (xcb_connection_t *c /**< */,
5344 xcb_xkb_device_spec_t deviceSpec /**< */,
5345 xcb_xkb_led_class_spec_t ledClass /**< */,
5346 xcb_xkb_id_spec_t ledID /**< */,
5347 xcb_atom_t indicator /**< */)
5349 static const xcb_protocol_request_t xcb_req = {
5350 /* count */ 2,
5351 /* ext */ &xcb_xkb_id,
5352 /* opcode */ XCB_XKB_GET_NAMED_INDICATOR,
5353 /* isvoid */ 0
5356 struct iovec xcb_parts[4];
5357 xcb_xkb_get_named_indicator_cookie_t xcb_ret;
5358 xcb_xkb_get_named_indicator_request_t xcb_out;
5360 xcb_out.deviceSpec = deviceSpec;
5361 xcb_out.ledClass = ledClass;
5362 xcb_out.ledID = ledID;
5363 memset(xcb_out.pad0, 0, 2);
5364 xcb_out.indicator = indicator;
5366 xcb_parts[2].iov_base = (char *) &xcb_out;
5367 xcb_parts[2].iov_len = sizeof(xcb_out);
5368 xcb_parts[3].iov_base = 0;
5369 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5371 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
5372 return xcb_ret;
5375 xcb_xkb_get_named_indicator_cookie_t
5376 xcb_xkb_get_named_indicator_unchecked (xcb_connection_t *c /**< */,
5377 xcb_xkb_device_spec_t deviceSpec /**< */,
5378 xcb_xkb_led_class_spec_t ledClass /**< */,
5379 xcb_xkb_id_spec_t ledID /**< */,
5380 xcb_atom_t indicator /**< */)
5382 static const xcb_protocol_request_t xcb_req = {
5383 /* count */ 2,
5384 /* ext */ &xcb_xkb_id,
5385 /* opcode */ XCB_XKB_GET_NAMED_INDICATOR,
5386 /* isvoid */ 0
5389 struct iovec xcb_parts[4];
5390 xcb_xkb_get_named_indicator_cookie_t xcb_ret;
5391 xcb_xkb_get_named_indicator_request_t xcb_out;
5393 xcb_out.deviceSpec = deviceSpec;
5394 xcb_out.ledClass = ledClass;
5395 xcb_out.ledID = ledID;
5396 memset(xcb_out.pad0, 0, 2);
5397 xcb_out.indicator = indicator;
5399 xcb_parts[2].iov_base = (char *) &xcb_out;
5400 xcb_parts[2].iov_len = sizeof(xcb_out);
5401 xcb_parts[3].iov_base = 0;
5402 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5404 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
5405 return xcb_ret;
5408 xcb_xkb_get_named_indicator_reply_t *
5409 xcb_xkb_get_named_indicator_reply (xcb_connection_t *c /**< */,
5410 xcb_xkb_get_named_indicator_cookie_t cookie /**< */,
5411 xcb_generic_error_t **e /**< */)
5413 return (xcb_xkb_get_named_indicator_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
5416 xcb_void_cookie_t
5417 xcb_xkb_set_named_indicator_checked (xcb_connection_t *c /**< */,
5418 xcb_xkb_device_spec_t deviceSpec /**< */,
5419 xcb_xkb_led_class_spec_t ledClass /**< */,
5420 xcb_xkb_id_spec_t ledID /**< */,
5421 xcb_atom_t indicator /**< */,
5422 uint8_t setState /**< */,
5423 uint8_t on /**< */,
5424 uint8_t setMap /**< */,
5425 uint8_t createMap /**< */,
5426 uint8_t map_flags /**< */,
5427 uint8_t map_whichGroups /**< */,
5428 uint8_t map_groups /**< */,
5429 uint8_t map_whichMods /**< */,
5430 uint8_t map_realMods /**< */,
5431 uint16_t map_vmods /**< */,
5432 uint32_t map_ctrls /**< */)
5434 static const xcb_protocol_request_t xcb_req = {
5435 /* count */ 2,
5436 /* ext */ &xcb_xkb_id,
5437 /* opcode */ XCB_XKB_SET_NAMED_INDICATOR,
5438 /* isvoid */ 1
5441 struct iovec xcb_parts[4];
5442 xcb_void_cookie_t xcb_ret;
5443 xcb_xkb_set_named_indicator_request_t xcb_out;
5445 xcb_out.deviceSpec = deviceSpec;
5446 xcb_out.ledClass = ledClass;
5447 xcb_out.ledID = ledID;
5448 memset(xcb_out.pad0, 0, 2);
5449 xcb_out.indicator = indicator;
5450 xcb_out.setState = setState;
5451 xcb_out.on = on;
5452 xcb_out.setMap = setMap;
5453 xcb_out.createMap = createMap;
5454 xcb_out.pad1 = 0;
5455 xcb_out.map_flags = map_flags;
5456 xcb_out.map_whichGroups = map_whichGroups;
5457 xcb_out.map_groups = map_groups;
5458 xcb_out.map_whichMods = map_whichMods;
5459 xcb_out.map_realMods = map_realMods;
5460 xcb_out.map_vmods = map_vmods;
5461 xcb_out.map_ctrls = map_ctrls;
5463 xcb_parts[2].iov_base = (char *) &xcb_out;
5464 xcb_parts[2].iov_len = sizeof(xcb_out);
5465 xcb_parts[3].iov_base = 0;
5466 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5468 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
5469 return xcb_ret;
5472 xcb_void_cookie_t
5473 xcb_xkb_set_named_indicator (xcb_connection_t *c /**< */,
5474 xcb_xkb_device_spec_t deviceSpec /**< */,
5475 xcb_xkb_led_class_spec_t ledClass /**< */,
5476 xcb_xkb_id_spec_t ledID /**< */,
5477 xcb_atom_t indicator /**< */,
5478 uint8_t setState /**< */,
5479 uint8_t on /**< */,
5480 uint8_t setMap /**< */,
5481 uint8_t createMap /**< */,
5482 uint8_t map_flags /**< */,
5483 uint8_t map_whichGroups /**< */,
5484 uint8_t map_groups /**< */,
5485 uint8_t map_whichMods /**< */,
5486 uint8_t map_realMods /**< */,
5487 uint16_t map_vmods /**< */,
5488 uint32_t map_ctrls /**< */)
5490 static const xcb_protocol_request_t xcb_req = {
5491 /* count */ 2,
5492 /* ext */ &xcb_xkb_id,
5493 /* opcode */ XCB_XKB_SET_NAMED_INDICATOR,
5494 /* isvoid */ 1
5497 struct iovec xcb_parts[4];
5498 xcb_void_cookie_t xcb_ret;
5499 xcb_xkb_set_named_indicator_request_t xcb_out;
5501 xcb_out.deviceSpec = deviceSpec;
5502 xcb_out.ledClass = ledClass;
5503 xcb_out.ledID = ledID;
5504 memset(xcb_out.pad0, 0, 2);
5505 xcb_out.indicator = indicator;
5506 xcb_out.setState = setState;
5507 xcb_out.on = on;
5508 xcb_out.setMap = setMap;
5509 xcb_out.createMap = createMap;
5510 xcb_out.pad1 = 0;
5511 xcb_out.map_flags = map_flags;
5512 xcb_out.map_whichGroups = map_whichGroups;
5513 xcb_out.map_groups = map_groups;
5514 xcb_out.map_whichMods = map_whichMods;
5515 xcb_out.map_realMods = map_realMods;
5516 xcb_out.map_vmods = map_vmods;
5517 xcb_out.map_ctrls = map_ctrls;
5519 xcb_parts[2].iov_base = (char *) &xcb_out;
5520 xcb_parts[2].iov_len = sizeof(xcb_out);
5521 xcb_parts[3].iov_base = 0;
5522 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5524 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
5525 return xcb_ret;
5528 xcb_atom_t *
5529 xcb_xkb_get_names_value_list_type_names (const xcb_xkb_get_names_value_list_t *S /**< */)
5531 return /* valueList */ S->typeNames;
5535 xcb_xkb_get_names_value_list_type_names_length (const xcb_xkb_get_names_reply_t *R /**< */,
5536 const xcb_xkb_get_names_value_list_t *S /**< */)
5538 return R->nTypes;
5541 xcb_generic_iterator_t
5542 xcb_xkb_get_names_value_list_type_names_end (const xcb_xkb_get_names_reply_t *R /**< */,
5543 const xcb_xkb_get_names_value_list_t *S /**< */)
5545 xcb_generic_iterator_t i;
5546 i.data = /* valueList */ S->typeNames + R->nTypes;
5547 i.rem = 0;
5548 i.index = (char *) i.data - (char *) S;
5549 return i;
5552 uint8_t *
5553 xcb_xkb_get_names_value_list_n_levels_per_type (const xcb_xkb_get_names_value_list_t *S /**< */)
5555 return /* valueList */ S->nLevelsPerType;
5559 xcb_xkb_get_names_value_list_n_levels_per_type_length (const xcb_xkb_get_names_reply_t *R /**< */,
5560 const xcb_xkb_get_names_value_list_t *S /**< */)
5562 return R->nTypes;
5565 xcb_generic_iterator_t
5566 xcb_xkb_get_names_value_list_n_levels_per_type_end (const xcb_xkb_get_names_reply_t *R /**< */,
5567 const xcb_xkb_get_names_value_list_t *S /**< */)
5569 xcb_generic_iterator_t i;
5570 i.data = /* valueList */ S->nLevelsPerType + R->nTypes;
5571 i.rem = 0;
5572 i.index = (char *) i.data - (char *) S;
5573 return i;
5576 uint8_t *
5577 xcb_xkb_get_names_value_list_alignment_pad (const xcb_xkb_get_names_value_list_t *S /**< */)
5579 return /* valueList */ S->alignment_pad;
5583 xcb_xkb_get_names_value_list_alignment_pad_length (const xcb_xkb_get_names_reply_t *R /**< */,
5584 const xcb_xkb_get_names_value_list_t *S /**< */)
5586 return (((R->nTypes + 3) & (~3)) - R->nTypes);
5589 xcb_generic_iterator_t
5590 xcb_xkb_get_names_value_list_alignment_pad_end (const xcb_xkb_get_names_reply_t *R /**< */,
5591 const xcb_xkb_get_names_value_list_t *S /**< */)
5593 xcb_generic_iterator_t i;
5594 i.data = /* valueList */ S->alignment_pad + (((R->nTypes + 3) & (~3)) - R->nTypes);
5595 i.rem = 0;
5596 i.index = (char *) i.data - (char *) S;
5597 return i;
5600 xcb_atom_t *
5601 xcb_xkb_get_names_value_list_kt_level_names (const xcb_xkb_get_names_value_list_t *S /**< */)
5603 return /* valueList */ S->ktLevelNames;
5607 xcb_xkb_get_names_value_list_kt_level_names_length (const xcb_xkb_get_names_reply_t *R /**< */,
5608 const xcb_xkb_get_names_value_list_t *S /**< */)
5610 return xcb_sumof(/* valueList */ S->nLevelsPerType, R->nTypes);
5613 xcb_generic_iterator_t
5614 xcb_xkb_get_names_value_list_kt_level_names_end (const xcb_xkb_get_names_reply_t *R /**< */,
5615 const xcb_xkb_get_names_value_list_t *S /**< */)
5617 xcb_generic_iterator_t i;
5618 i.data = /* valueList */ S->ktLevelNames + xcb_sumof(/* valueList */ S->nLevelsPerType, R->nTypes);
5619 i.rem = 0;
5620 i.index = (char *) i.data - (char *) S;
5621 return i;
5624 xcb_atom_t *
5625 xcb_xkb_get_names_value_list_indicator_names (const xcb_xkb_get_names_value_list_t *S /**< */)
5627 return /* valueList */ S->indicatorNames;
5631 xcb_xkb_get_names_value_list_indicator_names_length (const xcb_xkb_get_names_reply_t *R /**< */,
5632 const xcb_xkb_get_names_value_list_t *S /**< */)
5634 return xcb_popcount(R->indicators);
5637 xcb_generic_iterator_t
5638 xcb_xkb_get_names_value_list_indicator_names_end (const xcb_xkb_get_names_reply_t *R /**< */,
5639 const xcb_xkb_get_names_value_list_t *S /**< */)
5641 xcb_generic_iterator_t i;
5642 i.data = /* valueList */ S->indicatorNames + xcb_popcount(R->indicators);
5643 i.rem = 0;
5644 i.index = (char *) i.data - (char *) S;
5645 return i;
5648 xcb_atom_t *
5649 xcb_xkb_get_names_value_list_virtual_mod_names (const xcb_xkb_get_names_value_list_t *S /**< */)
5651 return /* valueList */ S->virtualModNames;
5655 xcb_xkb_get_names_value_list_virtual_mod_names_length (const xcb_xkb_get_names_reply_t *R /**< */,
5656 const xcb_xkb_get_names_value_list_t *S /**< */)
5658 return xcb_popcount(R->virtualMods);
5661 xcb_generic_iterator_t
5662 xcb_xkb_get_names_value_list_virtual_mod_names_end (const xcb_xkb_get_names_reply_t *R /**< */,
5663 const xcb_xkb_get_names_value_list_t *S /**< */)
5665 xcb_generic_iterator_t i;
5666 i.data = /* valueList */ S->virtualModNames + xcb_popcount(R->virtualMods);
5667 i.rem = 0;
5668 i.index = (char *) i.data - (char *) S;
5669 return i;
5672 xcb_atom_t *
5673 xcb_xkb_get_names_value_list_groups (const xcb_xkb_get_names_value_list_t *S /**< */)
5675 return /* valueList */ S->groups;
5679 xcb_xkb_get_names_value_list_groups_length (const xcb_xkb_get_names_reply_t *R /**< */,
5680 const xcb_xkb_get_names_value_list_t *S /**< */)
5682 return xcb_popcount(R->groupNames);
5685 xcb_generic_iterator_t
5686 xcb_xkb_get_names_value_list_groups_end (const xcb_xkb_get_names_reply_t *R /**< */,
5687 const xcb_xkb_get_names_value_list_t *S /**< */)
5689 xcb_generic_iterator_t i;
5690 i.data = /* valueList */ S->groups + xcb_popcount(R->groupNames);
5691 i.rem = 0;
5692 i.index = (char *) i.data - (char *) S;
5693 return i;
5696 xcb_xkb_key_name_t *
5697 xcb_xkb_get_names_value_list_key_names (const xcb_xkb_get_names_value_list_t *S /**< */)
5699 return /* valueList */ S->keyNames;
5703 xcb_xkb_get_names_value_list_key_names_length (const xcb_xkb_get_names_reply_t *R /**< */,
5704 const xcb_xkb_get_names_value_list_t *S /**< */)
5706 return R->nKeys;
5709 xcb_xkb_key_name_iterator_t
5710 xcb_xkb_get_names_value_list_key_names_iterator (const xcb_xkb_get_names_reply_t *R /**< */,
5711 const xcb_xkb_get_names_value_list_t *S /**< */)
5713 xcb_xkb_key_name_iterator_t i;
5714 i.data = /* valueList */ S->keyNames;
5715 i.rem = R->nKeys;
5716 i.index = (char *) i.data - (char *) S;
5717 return i;
5720 xcb_xkb_key_alias_t *
5721 xcb_xkb_get_names_value_list_key_aliases (const xcb_xkb_get_names_value_list_t *S /**< */)
5723 return /* valueList */ S->keyAliases;
5727 xcb_xkb_get_names_value_list_key_aliases_length (const xcb_xkb_get_names_reply_t *R /**< */,
5728 const xcb_xkb_get_names_value_list_t *S /**< */)
5730 return R->nKeyAliases;
5733 xcb_xkb_key_alias_iterator_t
5734 xcb_xkb_get_names_value_list_key_aliases_iterator (const xcb_xkb_get_names_reply_t *R /**< */,
5735 const xcb_xkb_get_names_value_list_t *S /**< */)
5737 xcb_xkb_key_alias_iterator_t i;
5738 i.data = /* valueList */ S->keyAliases;
5739 i.rem = R->nKeyAliases;
5740 i.index = (char *) i.data - (char *) S;
5741 return i;
5744 xcb_atom_t *
5745 xcb_xkb_get_names_value_list_radio_group_names (const xcb_xkb_get_names_value_list_t *S /**< */)
5747 return /* valueList */ S->radioGroupNames;
5751 xcb_xkb_get_names_value_list_radio_group_names_length (const xcb_xkb_get_names_reply_t *R /**< */,
5752 const xcb_xkb_get_names_value_list_t *S /**< */)
5754 return R->nRadioGroups;
5757 xcb_generic_iterator_t
5758 xcb_xkb_get_names_value_list_radio_group_names_end (const xcb_xkb_get_names_reply_t *R /**< */,
5759 const xcb_xkb_get_names_value_list_t *S /**< */)
5761 xcb_generic_iterator_t i;
5762 i.data = /* valueList */ S->radioGroupNames + R->nRadioGroups;
5763 i.rem = 0;
5764 i.index = (char *) i.data - (char *) S;
5765 return i;
5769 xcb_xkb_get_names_value_list_serialize (void **_buffer /**< */,
5770 uint8_t nTypes /**< */,
5771 uint32_t indicators /**< */,
5772 uint16_t virtualMods /**< */,
5773 uint8_t groupNames /**< */,
5774 uint8_t nKeys /**< */,
5775 uint8_t nKeyAliases /**< */,
5776 uint8_t nRadioGroups /**< */,
5777 uint32_t which /**< */,
5778 const xcb_xkb_get_names_value_list_t *_aux /**< */)
5780 char *xcb_out = *_buffer;
5781 unsigned int xcb_buffer_len = 0;
5782 unsigned int xcb_align_to = 0;
5784 unsigned int xcb_pad = 0;
5785 char xcb_pad0[3] = {0, 0, 0};
5786 struct iovec xcb_parts[27];
5787 unsigned int xcb_parts_idx = 0;
5788 unsigned int xcb_block_len = 0;
5789 unsigned int i;
5790 char *xcb_tmp;
5792 if(which & XCB_XKB_NAME_DETAIL_KEYCODES) {
5793 /* xcb_xkb_get_names_value_list_t.keycodesName */
5794 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->keycodesName;
5795 xcb_block_len += sizeof(xcb_atom_t);
5796 xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t);
5797 xcb_parts_idx++;
5798 xcb_align_to = ALIGNOF(xcb_atom_t);
5800 if(which & XCB_XKB_NAME_DETAIL_GEOMETRY) {
5801 /* xcb_xkb_get_names_value_list_t.geometryName */
5802 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometryName;
5803 xcb_block_len += sizeof(xcb_atom_t);
5804 xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t);
5805 xcb_parts_idx++;
5806 xcb_align_to = ALIGNOF(xcb_atom_t);
5808 if(which & XCB_XKB_NAME_DETAIL_SYMBOLS) {
5809 /* xcb_xkb_get_names_value_list_t.symbolsName */
5810 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->symbolsName;
5811 xcb_block_len += sizeof(xcb_atom_t);
5812 xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t);
5813 xcb_parts_idx++;
5814 xcb_align_to = ALIGNOF(xcb_atom_t);
5816 if(which & XCB_XKB_NAME_DETAIL_PHYS_SYMBOLS) {
5817 /* xcb_xkb_get_names_value_list_t.physSymbolsName */
5818 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->physSymbolsName;
5819 xcb_block_len += sizeof(xcb_atom_t);
5820 xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t);
5821 xcb_parts_idx++;
5822 xcb_align_to = ALIGNOF(xcb_atom_t);
5824 if(which & XCB_XKB_NAME_DETAIL_TYPES) {
5825 /* xcb_xkb_get_names_value_list_t.typesName */
5826 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->typesName;
5827 xcb_block_len += sizeof(xcb_atom_t);
5828 xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t);
5829 xcb_parts_idx++;
5830 xcb_align_to = ALIGNOF(xcb_atom_t);
5832 if(which & XCB_XKB_NAME_DETAIL_COMPAT) {
5833 /* xcb_xkb_get_names_value_list_t.compatName */
5834 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->compatName;
5835 xcb_block_len += sizeof(xcb_atom_t);
5836 xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t);
5837 xcb_parts_idx++;
5838 xcb_align_to = ALIGNOF(xcb_atom_t);
5840 if(which & XCB_XKB_NAME_DETAIL_KEY_TYPE_NAMES) {
5841 /* insert padding */
5842 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
5843 xcb_buffer_len += xcb_block_len + xcb_pad;
5844 if (0 != xcb_pad) {
5845 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
5846 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
5847 xcb_parts_idx++;
5848 xcb_pad = 0;
5850 xcb_block_len = 0;
5851 /* typeNames */
5852 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->typeNames;
5853 xcb_block_len += nTypes * sizeof(xcb_atom_t);
5854 xcb_parts[xcb_parts_idx].iov_len = nTypes * sizeof(xcb_atom_t);
5855 xcb_parts_idx++;
5856 xcb_align_to = ALIGNOF(xcb_atom_t);
5858 if(which & XCB_XKB_NAME_DETAIL_KT_LEVEL_NAMES) {
5859 /* insert padding */
5860 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
5861 xcb_buffer_len += xcb_block_len + xcb_pad;
5862 if (0 != xcb_pad) {
5863 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
5864 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
5865 xcb_parts_idx++;
5866 xcb_pad = 0;
5868 xcb_block_len = 0;
5869 /* nLevelsPerType */
5870 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->nLevelsPerType;
5871 xcb_block_len += nTypes * sizeof(uint8_t);
5872 xcb_parts[xcb_parts_idx].iov_len = nTypes * sizeof(uint8_t);
5873 xcb_parts_idx++;
5874 xcb_align_to = ALIGNOF(uint8_t);
5875 /* insert padding */
5876 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
5877 xcb_buffer_len += xcb_block_len + xcb_pad;
5878 if (0 != xcb_pad) {
5879 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
5880 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
5881 xcb_parts_idx++;
5882 xcb_pad = 0;
5884 xcb_block_len = 0;
5885 /* alignment_pad */
5886 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->alignment_pad;
5887 xcb_block_len += (((nTypes + 3) & (~3)) - nTypes) * sizeof(uint8_t);
5888 xcb_parts[xcb_parts_idx].iov_len = (((nTypes + 3) & (~3)) - nTypes) * sizeof(uint8_t);
5889 xcb_parts_idx++;
5890 xcb_align_to = ALIGNOF(uint8_t);
5891 /* insert padding */
5892 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
5893 xcb_buffer_len += xcb_block_len + xcb_pad;
5894 if (0 != xcb_pad) {
5895 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
5896 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
5897 xcb_parts_idx++;
5898 xcb_pad = 0;
5900 xcb_block_len = 0;
5901 /* ktLevelNames */
5902 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->ktLevelNames;
5903 xcb_block_len += xcb_sumof(_aux->nLevelsPerType, nTypes) * sizeof(xcb_atom_t);
5904 xcb_parts[xcb_parts_idx].iov_len = xcb_sumof(_aux->nLevelsPerType, nTypes) * sizeof(xcb_atom_t);
5905 xcb_parts_idx++;
5906 xcb_align_to = ALIGNOF(xcb_atom_t);
5908 if(which & XCB_XKB_NAME_DETAIL_INDICATOR_NAMES) {
5909 /* insert padding */
5910 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
5911 xcb_buffer_len += xcb_block_len + xcb_pad;
5912 if (0 != xcb_pad) {
5913 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
5914 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
5915 xcb_parts_idx++;
5916 xcb_pad = 0;
5918 xcb_block_len = 0;
5919 /* indicatorNames */
5920 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->indicatorNames;
5921 xcb_block_len += xcb_popcount(indicators) * sizeof(xcb_atom_t);
5922 xcb_parts[xcb_parts_idx].iov_len = xcb_popcount(indicators) * sizeof(xcb_atom_t);
5923 xcb_parts_idx++;
5924 xcb_align_to = ALIGNOF(xcb_atom_t);
5926 if(which & XCB_XKB_NAME_DETAIL_VIRTUAL_MOD_NAMES) {
5927 /* insert padding */
5928 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
5929 xcb_buffer_len += xcb_block_len + xcb_pad;
5930 if (0 != xcb_pad) {
5931 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
5932 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
5933 xcb_parts_idx++;
5934 xcb_pad = 0;
5936 xcb_block_len = 0;
5937 /* virtualModNames */
5938 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->virtualModNames;
5939 xcb_block_len += xcb_popcount(virtualMods) * sizeof(xcb_atom_t);
5940 xcb_parts[xcb_parts_idx].iov_len = xcb_popcount(virtualMods) * sizeof(xcb_atom_t);
5941 xcb_parts_idx++;
5942 xcb_align_to = ALIGNOF(xcb_atom_t);
5944 if(which & XCB_XKB_NAME_DETAIL_GROUP_NAMES) {
5945 /* insert padding */
5946 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
5947 xcb_buffer_len += xcb_block_len + xcb_pad;
5948 if (0 != xcb_pad) {
5949 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
5950 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
5951 xcb_parts_idx++;
5952 xcb_pad = 0;
5954 xcb_block_len = 0;
5955 /* groups */
5956 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->groups;
5957 xcb_block_len += xcb_popcount(groupNames) * sizeof(xcb_atom_t);
5958 xcb_parts[xcb_parts_idx].iov_len = xcb_popcount(groupNames) * sizeof(xcb_atom_t);
5959 xcb_parts_idx++;
5960 xcb_align_to = ALIGNOF(xcb_atom_t);
5962 if(which & XCB_XKB_NAME_DETAIL_KEY_NAMES) {
5963 /* insert padding */
5964 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
5965 xcb_buffer_len += xcb_block_len + xcb_pad;
5966 if (0 != xcb_pad) {
5967 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
5968 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
5969 xcb_parts_idx++;
5970 xcb_pad = 0;
5972 xcb_block_len = 0;
5973 /* keyNames */
5974 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->keyNames;
5975 xcb_block_len += nKeys * sizeof(xcb_xkb_key_name_t);
5976 xcb_parts[xcb_parts_idx].iov_len = nKeys * sizeof(xcb_xkb_key_name_t);
5977 xcb_parts_idx++;
5978 xcb_align_to = ALIGNOF(xcb_xkb_key_name_t);
5980 if(which & XCB_XKB_NAME_DETAIL_KEY_ALIASES) {
5981 /* insert padding */
5982 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
5983 xcb_buffer_len += xcb_block_len + xcb_pad;
5984 if (0 != xcb_pad) {
5985 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
5986 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
5987 xcb_parts_idx++;
5988 xcb_pad = 0;
5990 xcb_block_len = 0;
5991 /* keyAliases */
5992 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->keyAliases;
5993 xcb_block_len += nKeyAliases * sizeof(xcb_xkb_key_alias_t);
5994 xcb_parts[xcb_parts_idx].iov_len = nKeyAliases * sizeof(xcb_xkb_key_alias_t);
5995 xcb_parts_idx++;
5996 xcb_align_to = ALIGNOF(xcb_xkb_key_alias_t);
5998 if(which & XCB_XKB_NAME_DETAIL_RG_NAMES) {
5999 /* insert padding */
6000 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6001 xcb_buffer_len += xcb_block_len + xcb_pad;
6002 if (0 != xcb_pad) {
6003 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
6004 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
6005 xcb_parts_idx++;
6006 xcb_pad = 0;
6008 xcb_block_len = 0;
6009 /* radioGroupNames */
6010 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->radioGroupNames;
6011 xcb_block_len += nRadioGroups * sizeof(xcb_atom_t);
6012 xcb_parts[xcb_parts_idx].iov_len = nRadioGroups * sizeof(xcb_atom_t);
6013 xcb_parts_idx++;
6014 xcb_align_to = ALIGNOF(xcb_atom_t);
6016 /* insert padding */
6017 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6018 xcb_buffer_len += xcb_block_len + xcb_pad;
6019 if (0 != xcb_pad) {
6020 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
6021 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
6022 xcb_parts_idx++;
6023 xcb_pad = 0;
6025 xcb_block_len = 0;
6027 if (NULL == xcb_out) {
6028 /* allocate memory */
6029 xcb_out = malloc(xcb_buffer_len);
6030 *_buffer = xcb_out;
6033 xcb_tmp = xcb_out;
6034 for(i=0; i<xcb_parts_idx; i++) {
6035 if (0 != xcb_parts[i].iov_base && 0 != xcb_parts[i].iov_len)
6036 memcpy(xcb_tmp, xcb_parts[i].iov_base, xcb_parts[i].iov_len);
6037 if (0 != xcb_parts[i].iov_len)
6038 xcb_tmp += xcb_parts[i].iov_len;
6041 return xcb_buffer_len;
6045 xcb_xkb_get_names_value_list_unpack (const void *_buffer /**< */,
6046 uint8_t nTypes /**< */,
6047 uint32_t indicators /**< */,
6048 uint16_t virtualMods /**< */,
6049 uint8_t groupNames /**< */,
6050 uint8_t nKeys /**< */,
6051 uint8_t nKeyAliases /**< */,
6052 uint8_t nRadioGroups /**< */,
6053 uint32_t which /**< */,
6054 xcb_xkb_get_names_value_list_t *_aux /**< */)
6056 char *xcb_tmp = (char *)_buffer;
6057 unsigned int xcb_buffer_len = 0;
6058 unsigned int xcb_block_len = 0;
6059 unsigned int xcb_pad = 0;
6060 unsigned int xcb_align_to = 0;
6063 if(which & XCB_XKB_NAME_DETAIL_KEYCODES) {
6064 /* xcb_xkb_get_names_value_list_t.keycodesName */
6065 _aux->keycodesName = *(xcb_atom_t *)xcb_tmp;
6066 xcb_block_len += sizeof(xcb_atom_t);
6067 xcb_tmp += sizeof(xcb_atom_t);
6068 xcb_align_to = ALIGNOF(xcb_atom_t);
6070 if(which & XCB_XKB_NAME_DETAIL_GEOMETRY) {
6071 /* xcb_xkb_get_names_value_list_t.geometryName */
6072 _aux->geometryName = *(xcb_atom_t *)xcb_tmp;
6073 xcb_block_len += sizeof(xcb_atom_t);
6074 xcb_tmp += sizeof(xcb_atom_t);
6075 xcb_align_to = ALIGNOF(xcb_atom_t);
6077 if(which & XCB_XKB_NAME_DETAIL_SYMBOLS) {
6078 /* xcb_xkb_get_names_value_list_t.symbolsName */
6079 _aux->symbolsName = *(xcb_atom_t *)xcb_tmp;
6080 xcb_block_len += sizeof(xcb_atom_t);
6081 xcb_tmp += sizeof(xcb_atom_t);
6082 xcb_align_to = ALIGNOF(xcb_atom_t);
6084 if(which & XCB_XKB_NAME_DETAIL_PHYS_SYMBOLS) {
6085 /* xcb_xkb_get_names_value_list_t.physSymbolsName */
6086 _aux->physSymbolsName = *(xcb_atom_t *)xcb_tmp;
6087 xcb_block_len += sizeof(xcb_atom_t);
6088 xcb_tmp += sizeof(xcb_atom_t);
6089 xcb_align_to = ALIGNOF(xcb_atom_t);
6091 if(which & XCB_XKB_NAME_DETAIL_TYPES) {
6092 /* xcb_xkb_get_names_value_list_t.typesName */
6093 _aux->typesName = *(xcb_atom_t *)xcb_tmp;
6094 xcb_block_len += sizeof(xcb_atom_t);
6095 xcb_tmp += sizeof(xcb_atom_t);
6096 xcb_align_to = ALIGNOF(xcb_atom_t);
6098 if(which & XCB_XKB_NAME_DETAIL_COMPAT) {
6099 /* xcb_xkb_get_names_value_list_t.compatName */
6100 _aux->compatName = *(xcb_atom_t *)xcb_tmp;
6101 xcb_block_len += sizeof(xcb_atom_t);
6102 xcb_tmp += sizeof(xcb_atom_t);
6103 xcb_align_to = ALIGNOF(xcb_atom_t);
6105 if(which & XCB_XKB_NAME_DETAIL_KEY_TYPE_NAMES) {
6106 /* insert padding */
6107 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6108 xcb_buffer_len += xcb_block_len + xcb_pad;
6109 if (0 != xcb_pad) {
6110 xcb_tmp += xcb_pad;
6111 xcb_pad = 0;
6113 xcb_block_len = 0;
6114 /* typeNames */
6115 _aux->typeNames = (xcb_atom_t *)xcb_tmp;
6116 xcb_block_len += nTypes * sizeof(xcb_atom_t);
6117 xcb_tmp += xcb_block_len;
6118 xcb_align_to = ALIGNOF(xcb_atom_t);
6120 if(which & XCB_XKB_NAME_DETAIL_KT_LEVEL_NAMES) {
6121 /* insert padding */
6122 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6123 xcb_buffer_len += xcb_block_len + xcb_pad;
6124 if (0 != xcb_pad) {
6125 xcb_tmp += xcb_pad;
6126 xcb_pad = 0;
6128 xcb_block_len = 0;
6129 /* nLevelsPerType */
6130 _aux->nLevelsPerType = (uint8_t *)xcb_tmp;
6131 xcb_block_len += nTypes * sizeof(uint8_t);
6132 xcb_tmp += xcb_block_len;
6133 xcb_align_to = ALIGNOF(uint8_t);
6134 /* insert padding */
6135 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6136 xcb_buffer_len += xcb_block_len + xcb_pad;
6137 if (0 != xcb_pad) {
6138 xcb_tmp += xcb_pad;
6139 xcb_pad = 0;
6141 xcb_block_len = 0;
6142 /* alignment_pad */
6143 _aux->alignment_pad = (uint8_t *)xcb_tmp;
6144 xcb_block_len += (((nTypes + 3) & (~3)) - nTypes) * sizeof(uint8_t);
6145 xcb_tmp += xcb_block_len;
6146 xcb_align_to = ALIGNOF(uint8_t);
6147 /* insert padding */
6148 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6149 xcb_buffer_len += xcb_block_len + xcb_pad;
6150 if (0 != xcb_pad) {
6151 xcb_tmp += xcb_pad;
6152 xcb_pad = 0;
6154 xcb_block_len = 0;
6155 /* ktLevelNames */
6156 _aux->ktLevelNames = (xcb_atom_t *)xcb_tmp;
6157 xcb_block_len += xcb_sumof(_aux->nLevelsPerType, nTypes) * sizeof(xcb_atom_t);
6158 xcb_tmp += xcb_block_len;
6159 xcb_align_to = ALIGNOF(xcb_atom_t);
6161 if(which & XCB_XKB_NAME_DETAIL_INDICATOR_NAMES) {
6162 /* insert padding */
6163 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6164 xcb_buffer_len += xcb_block_len + xcb_pad;
6165 if (0 != xcb_pad) {
6166 xcb_tmp += xcb_pad;
6167 xcb_pad = 0;
6169 xcb_block_len = 0;
6170 /* indicatorNames */
6171 _aux->indicatorNames = (xcb_atom_t *)xcb_tmp;
6172 xcb_block_len += xcb_popcount(indicators) * sizeof(xcb_atom_t);
6173 xcb_tmp += xcb_block_len;
6174 xcb_align_to = ALIGNOF(xcb_atom_t);
6176 if(which & XCB_XKB_NAME_DETAIL_VIRTUAL_MOD_NAMES) {
6177 /* insert padding */
6178 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6179 xcb_buffer_len += xcb_block_len + xcb_pad;
6180 if (0 != xcb_pad) {
6181 xcb_tmp += xcb_pad;
6182 xcb_pad = 0;
6184 xcb_block_len = 0;
6185 /* virtualModNames */
6186 _aux->virtualModNames = (xcb_atom_t *)xcb_tmp;
6187 xcb_block_len += xcb_popcount(virtualMods) * sizeof(xcb_atom_t);
6188 xcb_tmp += xcb_block_len;
6189 xcb_align_to = ALIGNOF(xcb_atom_t);
6191 if(which & XCB_XKB_NAME_DETAIL_GROUP_NAMES) {
6192 /* insert padding */
6193 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6194 xcb_buffer_len += xcb_block_len + xcb_pad;
6195 if (0 != xcb_pad) {
6196 xcb_tmp += xcb_pad;
6197 xcb_pad = 0;
6199 xcb_block_len = 0;
6200 /* groups */
6201 _aux->groups = (xcb_atom_t *)xcb_tmp;
6202 xcb_block_len += xcb_popcount(groupNames) * sizeof(xcb_atom_t);
6203 xcb_tmp += xcb_block_len;
6204 xcb_align_to = ALIGNOF(xcb_atom_t);
6206 if(which & XCB_XKB_NAME_DETAIL_KEY_NAMES) {
6207 /* insert padding */
6208 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6209 xcb_buffer_len += xcb_block_len + xcb_pad;
6210 if (0 != xcb_pad) {
6211 xcb_tmp += xcb_pad;
6212 xcb_pad = 0;
6214 xcb_block_len = 0;
6215 /* keyNames */
6216 _aux->keyNames = (xcb_xkb_key_name_t *)xcb_tmp;
6217 xcb_block_len += nKeys * sizeof(xcb_xkb_key_name_t);
6218 xcb_tmp += xcb_block_len;
6219 xcb_align_to = ALIGNOF(xcb_xkb_key_name_t);
6221 if(which & XCB_XKB_NAME_DETAIL_KEY_ALIASES) {
6222 /* insert padding */
6223 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6224 xcb_buffer_len += xcb_block_len + xcb_pad;
6225 if (0 != xcb_pad) {
6226 xcb_tmp += xcb_pad;
6227 xcb_pad = 0;
6229 xcb_block_len = 0;
6230 /* keyAliases */
6231 _aux->keyAliases = (xcb_xkb_key_alias_t *)xcb_tmp;
6232 xcb_block_len += nKeyAliases * sizeof(xcb_xkb_key_alias_t);
6233 xcb_tmp += xcb_block_len;
6234 xcb_align_to = ALIGNOF(xcb_xkb_key_alias_t);
6236 if(which & XCB_XKB_NAME_DETAIL_RG_NAMES) {
6237 /* insert padding */
6238 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6239 xcb_buffer_len += xcb_block_len + xcb_pad;
6240 if (0 != xcb_pad) {
6241 xcb_tmp += xcb_pad;
6242 xcb_pad = 0;
6244 xcb_block_len = 0;
6245 /* radioGroupNames */
6246 _aux->radioGroupNames = (xcb_atom_t *)xcb_tmp;
6247 xcb_block_len += nRadioGroups * sizeof(xcb_atom_t);
6248 xcb_tmp += xcb_block_len;
6249 xcb_align_to = ALIGNOF(xcb_atom_t);
6251 /* insert padding */
6252 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6253 xcb_buffer_len += xcb_block_len + xcb_pad;
6254 if (0 != xcb_pad) {
6255 xcb_tmp += xcb_pad;
6256 xcb_pad = 0;
6258 xcb_block_len = 0;
6260 return xcb_buffer_len;
6264 xcb_xkb_get_names_value_list_sizeof (const void *_buffer /**< */,
6265 uint8_t nTypes /**< */,
6266 uint32_t indicators /**< */,
6267 uint16_t virtualMods /**< */,
6268 uint8_t groupNames /**< */,
6269 uint8_t nKeys /**< */,
6270 uint8_t nKeyAliases /**< */,
6271 uint8_t nRadioGroups /**< */,
6272 uint32_t which /**< */)
6274 xcb_xkb_get_names_value_list_t _aux;
6275 return xcb_xkb_get_names_value_list_unpack(_buffer, nTypes, indicators, virtualMods, groupNames, nKeys, nKeyAliases, nRadioGroups, which, &_aux);
6278 xcb_xkb_get_names_cookie_t
6279 xcb_xkb_get_names (xcb_connection_t *c /**< */,
6280 xcb_xkb_device_spec_t deviceSpec /**< */,
6281 uint32_t which /**< */)
6283 static const xcb_protocol_request_t xcb_req = {
6284 /* count */ 2,
6285 /* ext */ &xcb_xkb_id,
6286 /* opcode */ XCB_XKB_GET_NAMES,
6287 /* isvoid */ 0
6290 struct iovec xcb_parts[4];
6291 xcb_xkb_get_names_cookie_t xcb_ret;
6292 xcb_xkb_get_names_request_t xcb_out;
6294 xcb_out.deviceSpec = deviceSpec;
6295 memset(xcb_out.pad0, 0, 2);
6296 xcb_out.which = which;
6298 xcb_parts[2].iov_base = (char *) &xcb_out;
6299 xcb_parts[2].iov_len = sizeof(xcb_out);
6300 xcb_parts[3].iov_base = 0;
6301 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
6303 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
6304 return xcb_ret;
6307 xcb_xkb_get_names_cookie_t
6308 xcb_xkb_get_names_unchecked (xcb_connection_t *c /**< */,
6309 xcb_xkb_device_spec_t deviceSpec /**< */,
6310 uint32_t which /**< */)
6312 static const xcb_protocol_request_t xcb_req = {
6313 /* count */ 2,
6314 /* ext */ &xcb_xkb_id,
6315 /* opcode */ XCB_XKB_GET_NAMES,
6316 /* isvoid */ 0
6319 struct iovec xcb_parts[4];
6320 xcb_xkb_get_names_cookie_t xcb_ret;
6321 xcb_xkb_get_names_request_t xcb_out;
6323 xcb_out.deviceSpec = deviceSpec;
6324 memset(xcb_out.pad0, 0, 2);
6325 xcb_out.which = which;
6327 xcb_parts[2].iov_base = (char *) &xcb_out;
6328 xcb_parts[2].iov_len = sizeof(xcb_out);
6329 xcb_parts[3].iov_base = 0;
6330 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
6332 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
6333 return xcb_ret;
6336 void *
6337 xcb_xkb_get_names_value_list (const xcb_xkb_get_names_reply_t *R /**< */)
6339 return (void *) (R + 1);
6342 xcb_xkb_get_names_reply_t *
6343 xcb_xkb_get_names_reply (xcb_connection_t *c /**< */,
6344 xcb_xkb_get_names_cookie_t cookie /**< */,
6345 xcb_generic_error_t **e /**< */)
6347 return (xcb_xkb_get_names_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
6350 xcb_atom_t *
6351 xcb_xkb_set_names_values_type_names (const xcb_xkb_set_names_values_t *S /**< */)
6353 return /* values */ S->typeNames;
6357 xcb_xkb_set_names_values_type_names_length (const xcb_xkb_set_names_request_t *R /**< */,
6358 const xcb_xkb_set_names_values_t *S /**< */)
6360 return R->nTypes;
6363 xcb_generic_iterator_t
6364 xcb_xkb_set_names_values_type_names_end (const xcb_xkb_set_names_request_t *R /**< */,
6365 const xcb_xkb_set_names_values_t *S /**< */)
6367 xcb_generic_iterator_t i;
6368 i.data = /* values */ S->typeNames + R->nTypes;
6369 i.rem = 0;
6370 i.index = (char *) i.data - (char *) S;
6371 return i;
6374 uint8_t *
6375 xcb_xkb_set_names_values_n_levels_per_type (const xcb_xkb_set_names_values_t *S /**< */)
6377 return /* values */ S->nLevelsPerType;
6381 xcb_xkb_set_names_values_n_levels_per_type_length (const xcb_xkb_set_names_request_t *R /**< */,
6382 const xcb_xkb_set_names_values_t *S /**< */)
6384 return R->nTypes;
6387 xcb_generic_iterator_t
6388 xcb_xkb_set_names_values_n_levels_per_type_end (const xcb_xkb_set_names_request_t *R /**< */,
6389 const xcb_xkb_set_names_values_t *S /**< */)
6391 xcb_generic_iterator_t i;
6392 i.data = /* values */ S->nLevelsPerType + R->nTypes;
6393 i.rem = 0;
6394 i.index = (char *) i.data - (char *) S;
6395 return i;
6398 xcb_atom_t *
6399 xcb_xkb_set_names_values_kt_level_names (const xcb_xkb_set_names_values_t *S /**< */)
6401 return /* values */ S->ktLevelNames;
6405 xcb_xkb_set_names_values_kt_level_names_length (const xcb_xkb_set_names_request_t *R /**< */,
6406 const xcb_xkb_set_names_values_t *S /**< */)
6408 return xcb_sumof(/* values */ S->nLevelsPerType, R->nTypes);
6411 xcb_generic_iterator_t
6412 xcb_xkb_set_names_values_kt_level_names_end (const xcb_xkb_set_names_request_t *R /**< */,
6413 const xcb_xkb_set_names_values_t *S /**< */)
6415 xcb_generic_iterator_t i;
6416 i.data = /* values */ S->ktLevelNames + xcb_sumof(/* values */ S->nLevelsPerType, R->nTypes);
6417 i.rem = 0;
6418 i.index = (char *) i.data - (char *) S;
6419 return i;
6422 xcb_atom_t *
6423 xcb_xkb_set_names_values_indicator_names (const xcb_xkb_set_names_values_t *S /**< */)
6425 return /* values */ S->indicatorNames;
6429 xcb_xkb_set_names_values_indicator_names_length (const xcb_xkb_set_names_request_t *R /**< */,
6430 const xcb_xkb_set_names_values_t *S /**< */)
6432 return xcb_popcount(R->indicators);
6435 xcb_generic_iterator_t
6436 xcb_xkb_set_names_values_indicator_names_end (const xcb_xkb_set_names_request_t *R /**< */,
6437 const xcb_xkb_set_names_values_t *S /**< */)
6439 xcb_generic_iterator_t i;
6440 i.data = /* values */ S->indicatorNames + xcb_popcount(R->indicators);
6441 i.rem = 0;
6442 i.index = (char *) i.data - (char *) S;
6443 return i;
6446 xcb_atom_t *
6447 xcb_xkb_set_names_values_virtual_mod_names (const xcb_xkb_set_names_values_t *S /**< */)
6449 return /* values */ S->virtualModNames;
6453 xcb_xkb_set_names_values_virtual_mod_names_length (const xcb_xkb_set_names_request_t *R /**< */,
6454 const xcb_xkb_set_names_values_t *S /**< */)
6456 return xcb_popcount(R->virtualMods);
6459 xcb_generic_iterator_t
6460 xcb_xkb_set_names_values_virtual_mod_names_end (const xcb_xkb_set_names_request_t *R /**< */,
6461 const xcb_xkb_set_names_values_t *S /**< */)
6463 xcb_generic_iterator_t i;
6464 i.data = /* values */ S->virtualModNames + xcb_popcount(R->virtualMods);
6465 i.rem = 0;
6466 i.index = (char *) i.data - (char *) S;
6467 return i;
6470 xcb_atom_t *
6471 xcb_xkb_set_names_values_groups (const xcb_xkb_set_names_values_t *S /**< */)
6473 return /* values */ S->groups;
6477 xcb_xkb_set_names_values_groups_length (const xcb_xkb_set_names_request_t *R /**< */,
6478 const xcb_xkb_set_names_values_t *S /**< */)
6480 return xcb_popcount(R->groupNames);
6483 xcb_generic_iterator_t
6484 xcb_xkb_set_names_values_groups_end (const xcb_xkb_set_names_request_t *R /**< */,
6485 const xcb_xkb_set_names_values_t *S /**< */)
6487 xcb_generic_iterator_t i;
6488 i.data = /* values */ S->groups + xcb_popcount(R->groupNames);
6489 i.rem = 0;
6490 i.index = (char *) i.data - (char *) S;
6491 return i;
6494 xcb_xkb_key_name_t *
6495 xcb_xkb_set_names_values_key_names (const xcb_xkb_set_names_values_t *S /**< */)
6497 return /* values */ S->keyNames;
6501 xcb_xkb_set_names_values_key_names_length (const xcb_xkb_set_names_request_t *R /**< */,
6502 const xcb_xkb_set_names_values_t *S /**< */)
6504 return R->nKeys;
6507 xcb_xkb_key_name_iterator_t
6508 xcb_xkb_set_names_values_key_names_iterator (const xcb_xkb_set_names_request_t *R /**< */,
6509 const xcb_xkb_set_names_values_t *S /**< */)
6511 xcb_xkb_key_name_iterator_t i;
6512 i.data = /* values */ S->keyNames;
6513 i.rem = R->nKeys;
6514 i.index = (char *) i.data - (char *) S;
6515 return i;
6518 xcb_xkb_key_alias_t *
6519 xcb_xkb_set_names_values_key_aliases (const xcb_xkb_set_names_values_t *S /**< */)
6521 return /* values */ S->keyAliases;
6525 xcb_xkb_set_names_values_key_aliases_length (const xcb_xkb_set_names_request_t *R /**< */,
6526 const xcb_xkb_set_names_values_t *S /**< */)
6528 return R->nKeyAliases;
6531 xcb_xkb_key_alias_iterator_t
6532 xcb_xkb_set_names_values_key_aliases_iterator (const xcb_xkb_set_names_request_t *R /**< */,
6533 const xcb_xkb_set_names_values_t *S /**< */)
6535 xcb_xkb_key_alias_iterator_t i;
6536 i.data = /* values */ S->keyAliases;
6537 i.rem = R->nKeyAliases;
6538 i.index = (char *) i.data - (char *) S;
6539 return i;
6542 xcb_atom_t *
6543 xcb_xkb_set_names_values_radio_group_names (const xcb_xkb_set_names_values_t *S /**< */)
6545 return /* values */ S->radioGroupNames;
6549 xcb_xkb_set_names_values_radio_group_names_length (const xcb_xkb_set_names_request_t *R /**< */,
6550 const xcb_xkb_set_names_values_t *S /**< */)
6552 return R->nRadioGroups;
6555 xcb_generic_iterator_t
6556 xcb_xkb_set_names_values_radio_group_names_end (const xcb_xkb_set_names_request_t *R /**< */,
6557 const xcb_xkb_set_names_values_t *S /**< */)
6559 xcb_generic_iterator_t i;
6560 i.data = /* values */ S->radioGroupNames + R->nRadioGroups;
6561 i.rem = 0;
6562 i.index = (char *) i.data - (char *) S;
6563 return i;
6567 xcb_xkb_set_names_values_serialize (void **_buffer /**< */,
6568 uint8_t nTypes /**< */,
6569 uint32_t indicators /**< */,
6570 uint16_t virtualMods /**< */,
6571 uint8_t groupNames /**< */,
6572 uint8_t nKeys /**< */,
6573 uint8_t nKeyAliases /**< */,
6574 uint8_t nRadioGroups /**< */,
6575 uint32_t which /**< */,
6576 const xcb_xkb_set_names_values_t *_aux /**< */)
6578 char *xcb_out = *_buffer;
6579 unsigned int xcb_buffer_len = 0;
6580 unsigned int xcb_align_to = 0;
6582 unsigned int xcb_pad = 0;
6583 char xcb_pad0[3] = {0, 0, 0};
6584 struct iovec xcb_parts[25];
6585 unsigned int xcb_parts_idx = 0;
6586 unsigned int xcb_block_len = 0;
6587 unsigned int i;
6588 char *xcb_tmp;
6590 if(which & XCB_XKB_NAME_DETAIL_KEYCODES) {
6591 /* xcb_xkb_set_names_values_t.keycodesName */
6592 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->keycodesName;
6593 xcb_block_len += sizeof(xcb_atom_t);
6594 xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t);
6595 xcb_parts_idx++;
6596 xcb_align_to = ALIGNOF(xcb_atom_t);
6598 if(which & XCB_XKB_NAME_DETAIL_GEOMETRY) {
6599 /* xcb_xkb_set_names_values_t.geometryName */
6600 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometryName;
6601 xcb_block_len += sizeof(xcb_atom_t);
6602 xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t);
6603 xcb_parts_idx++;
6604 xcb_align_to = ALIGNOF(xcb_atom_t);
6606 if(which & XCB_XKB_NAME_DETAIL_SYMBOLS) {
6607 /* xcb_xkb_set_names_values_t.symbolsName */
6608 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->symbolsName;
6609 xcb_block_len += sizeof(xcb_atom_t);
6610 xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t);
6611 xcb_parts_idx++;
6612 xcb_align_to = ALIGNOF(xcb_atom_t);
6614 if(which & XCB_XKB_NAME_DETAIL_PHYS_SYMBOLS) {
6615 /* xcb_xkb_set_names_values_t.physSymbolsName */
6616 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->physSymbolsName;
6617 xcb_block_len += sizeof(xcb_atom_t);
6618 xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t);
6619 xcb_parts_idx++;
6620 xcb_align_to = ALIGNOF(xcb_atom_t);
6622 if(which & XCB_XKB_NAME_DETAIL_TYPES) {
6623 /* xcb_xkb_set_names_values_t.typesName */
6624 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->typesName;
6625 xcb_block_len += sizeof(xcb_atom_t);
6626 xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t);
6627 xcb_parts_idx++;
6628 xcb_align_to = ALIGNOF(xcb_atom_t);
6630 if(which & XCB_XKB_NAME_DETAIL_COMPAT) {
6631 /* xcb_xkb_set_names_values_t.compatName */
6632 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->compatName;
6633 xcb_block_len += sizeof(xcb_atom_t);
6634 xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t);
6635 xcb_parts_idx++;
6636 xcb_align_to = ALIGNOF(xcb_atom_t);
6638 if(which & XCB_XKB_NAME_DETAIL_KEY_TYPE_NAMES) {
6639 /* insert padding */
6640 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6641 xcb_buffer_len += xcb_block_len + xcb_pad;
6642 if (0 != xcb_pad) {
6643 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
6644 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
6645 xcb_parts_idx++;
6646 xcb_pad = 0;
6648 xcb_block_len = 0;
6649 /* typeNames */
6650 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->typeNames;
6651 xcb_block_len += nTypes * sizeof(xcb_atom_t);
6652 xcb_parts[xcb_parts_idx].iov_len = nTypes * sizeof(xcb_atom_t);
6653 xcb_parts_idx++;
6654 xcb_align_to = ALIGNOF(xcb_atom_t);
6656 if(which & XCB_XKB_NAME_DETAIL_KT_LEVEL_NAMES) {
6657 /* insert padding */
6658 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6659 xcb_buffer_len += xcb_block_len + xcb_pad;
6660 if (0 != xcb_pad) {
6661 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
6662 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
6663 xcb_parts_idx++;
6664 xcb_pad = 0;
6666 xcb_block_len = 0;
6667 /* nLevelsPerType */
6668 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->nLevelsPerType;
6669 xcb_block_len += nTypes * sizeof(uint8_t);
6670 xcb_parts[xcb_parts_idx].iov_len = nTypes * sizeof(uint8_t);
6671 xcb_parts_idx++;
6672 xcb_align_to = ALIGNOF(uint8_t);
6673 /* insert padding */
6674 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6675 xcb_buffer_len += xcb_block_len + xcb_pad;
6676 if (0 != xcb_pad) {
6677 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
6678 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
6679 xcb_parts_idx++;
6680 xcb_pad = 0;
6682 xcb_block_len = 0;
6683 /* ktLevelNames */
6684 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->ktLevelNames;
6685 xcb_block_len += xcb_sumof(_aux->nLevelsPerType, nTypes) * sizeof(xcb_atom_t);
6686 xcb_parts[xcb_parts_idx].iov_len = xcb_sumof(_aux->nLevelsPerType, nTypes) * sizeof(xcb_atom_t);
6687 xcb_parts_idx++;
6688 xcb_align_to = ALIGNOF(xcb_atom_t);
6690 if(which & XCB_XKB_NAME_DETAIL_INDICATOR_NAMES) {
6691 /* insert padding */
6692 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6693 xcb_buffer_len += xcb_block_len + xcb_pad;
6694 if (0 != xcb_pad) {
6695 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
6696 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
6697 xcb_parts_idx++;
6698 xcb_pad = 0;
6700 xcb_block_len = 0;
6701 /* indicatorNames */
6702 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->indicatorNames;
6703 xcb_block_len += xcb_popcount(indicators) * sizeof(xcb_atom_t);
6704 xcb_parts[xcb_parts_idx].iov_len = xcb_popcount(indicators) * sizeof(xcb_atom_t);
6705 xcb_parts_idx++;
6706 xcb_align_to = ALIGNOF(xcb_atom_t);
6708 if(which & XCB_XKB_NAME_DETAIL_VIRTUAL_MOD_NAMES) {
6709 /* insert padding */
6710 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6711 xcb_buffer_len += xcb_block_len + xcb_pad;
6712 if (0 != xcb_pad) {
6713 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
6714 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
6715 xcb_parts_idx++;
6716 xcb_pad = 0;
6718 xcb_block_len = 0;
6719 /* virtualModNames */
6720 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->virtualModNames;
6721 xcb_block_len += xcb_popcount(virtualMods) * sizeof(xcb_atom_t);
6722 xcb_parts[xcb_parts_idx].iov_len = xcb_popcount(virtualMods) * sizeof(xcb_atom_t);
6723 xcb_parts_idx++;
6724 xcb_align_to = ALIGNOF(xcb_atom_t);
6726 if(which & XCB_XKB_NAME_DETAIL_GROUP_NAMES) {
6727 /* insert padding */
6728 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6729 xcb_buffer_len += xcb_block_len + xcb_pad;
6730 if (0 != xcb_pad) {
6731 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
6732 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
6733 xcb_parts_idx++;
6734 xcb_pad = 0;
6736 xcb_block_len = 0;
6737 /* groups */
6738 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->groups;
6739 xcb_block_len += xcb_popcount(groupNames) * sizeof(xcb_atom_t);
6740 xcb_parts[xcb_parts_idx].iov_len = xcb_popcount(groupNames) * sizeof(xcb_atom_t);
6741 xcb_parts_idx++;
6742 xcb_align_to = ALIGNOF(xcb_atom_t);
6744 if(which & XCB_XKB_NAME_DETAIL_KEY_NAMES) {
6745 /* insert padding */
6746 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6747 xcb_buffer_len += xcb_block_len + xcb_pad;
6748 if (0 != xcb_pad) {
6749 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
6750 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
6751 xcb_parts_idx++;
6752 xcb_pad = 0;
6754 xcb_block_len = 0;
6755 /* keyNames */
6756 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->keyNames;
6757 xcb_block_len += nKeys * sizeof(xcb_xkb_key_name_t);
6758 xcb_parts[xcb_parts_idx].iov_len = nKeys * sizeof(xcb_xkb_key_name_t);
6759 xcb_parts_idx++;
6760 xcb_align_to = ALIGNOF(xcb_xkb_key_name_t);
6762 if(which & XCB_XKB_NAME_DETAIL_KEY_ALIASES) {
6763 /* insert padding */
6764 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6765 xcb_buffer_len += xcb_block_len + xcb_pad;
6766 if (0 != xcb_pad) {
6767 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
6768 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
6769 xcb_parts_idx++;
6770 xcb_pad = 0;
6772 xcb_block_len = 0;
6773 /* keyAliases */
6774 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->keyAliases;
6775 xcb_block_len += nKeyAliases * sizeof(xcb_xkb_key_alias_t);
6776 xcb_parts[xcb_parts_idx].iov_len = nKeyAliases * sizeof(xcb_xkb_key_alias_t);
6777 xcb_parts_idx++;
6778 xcb_align_to = ALIGNOF(xcb_xkb_key_alias_t);
6780 if(which & XCB_XKB_NAME_DETAIL_RG_NAMES) {
6781 /* insert padding */
6782 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6783 xcb_buffer_len += xcb_block_len + xcb_pad;
6784 if (0 != xcb_pad) {
6785 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
6786 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
6787 xcb_parts_idx++;
6788 xcb_pad = 0;
6790 xcb_block_len = 0;
6791 /* radioGroupNames */
6792 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->radioGroupNames;
6793 xcb_block_len += nRadioGroups * sizeof(xcb_atom_t);
6794 xcb_parts[xcb_parts_idx].iov_len = nRadioGroups * sizeof(xcb_atom_t);
6795 xcb_parts_idx++;
6796 xcb_align_to = ALIGNOF(xcb_atom_t);
6798 /* insert padding */
6799 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6800 xcb_buffer_len += xcb_block_len + xcb_pad;
6801 if (0 != xcb_pad) {
6802 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
6803 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
6804 xcb_parts_idx++;
6805 xcb_pad = 0;
6807 xcb_block_len = 0;
6809 if (NULL == xcb_out) {
6810 /* allocate memory */
6811 xcb_out = malloc(xcb_buffer_len);
6812 *_buffer = xcb_out;
6815 xcb_tmp = xcb_out;
6816 for(i=0; i<xcb_parts_idx; i++) {
6817 if (0 != xcb_parts[i].iov_base && 0 != xcb_parts[i].iov_len)
6818 memcpy(xcb_tmp, xcb_parts[i].iov_base, xcb_parts[i].iov_len);
6819 if (0 != xcb_parts[i].iov_len)
6820 xcb_tmp += xcb_parts[i].iov_len;
6823 return xcb_buffer_len;
6827 xcb_xkb_set_names_values_unpack (const void *_buffer /**< */,
6828 uint8_t nTypes /**< */,
6829 uint32_t indicators /**< */,
6830 uint16_t virtualMods /**< */,
6831 uint8_t groupNames /**< */,
6832 uint8_t nKeys /**< */,
6833 uint8_t nKeyAliases /**< */,
6834 uint8_t nRadioGroups /**< */,
6835 uint32_t which /**< */,
6836 xcb_xkb_set_names_values_t *_aux /**< */)
6838 char *xcb_tmp = (char *)_buffer;
6839 unsigned int xcb_buffer_len = 0;
6840 unsigned int xcb_block_len = 0;
6841 unsigned int xcb_pad = 0;
6842 unsigned int xcb_align_to = 0;
6845 if(which & XCB_XKB_NAME_DETAIL_KEYCODES) {
6846 /* xcb_xkb_set_names_values_t.keycodesName */
6847 _aux->keycodesName = *(xcb_atom_t *)xcb_tmp;
6848 xcb_block_len += sizeof(xcb_atom_t);
6849 xcb_tmp += sizeof(xcb_atom_t);
6850 xcb_align_to = ALIGNOF(xcb_atom_t);
6852 if(which & XCB_XKB_NAME_DETAIL_GEOMETRY) {
6853 /* xcb_xkb_set_names_values_t.geometryName */
6854 _aux->geometryName = *(xcb_atom_t *)xcb_tmp;
6855 xcb_block_len += sizeof(xcb_atom_t);
6856 xcb_tmp += sizeof(xcb_atom_t);
6857 xcb_align_to = ALIGNOF(xcb_atom_t);
6859 if(which & XCB_XKB_NAME_DETAIL_SYMBOLS) {
6860 /* xcb_xkb_set_names_values_t.symbolsName */
6861 _aux->symbolsName = *(xcb_atom_t *)xcb_tmp;
6862 xcb_block_len += sizeof(xcb_atom_t);
6863 xcb_tmp += sizeof(xcb_atom_t);
6864 xcb_align_to = ALIGNOF(xcb_atom_t);
6866 if(which & XCB_XKB_NAME_DETAIL_PHYS_SYMBOLS) {
6867 /* xcb_xkb_set_names_values_t.physSymbolsName */
6868 _aux->physSymbolsName = *(xcb_atom_t *)xcb_tmp;
6869 xcb_block_len += sizeof(xcb_atom_t);
6870 xcb_tmp += sizeof(xcb_atom_t);
6871 xcb_align_to = ALIGNOF(xcb_atom_t);
6873 if(which & XCB_XKB_NAME_DETAIL_TYPES) {
6874 /* xcb_xkb_set_names_values_t.typesName */
6875 _aux->typesName = *(xcb_atom_t *)xcb_tmp;
6876 xcb_block_len += sizeof(xcb_atom_t);
6877 xcb_tmp += sizeof(xcb_atom_t);
6878 xcb_align_to = ALIGNOF(xcb_atom_t);
6880 if(which & XCB_XKB_NAME_DETAIL_COMPAT) {
6881 /* xcb_xkb_set_names_values_t.compatName */
6882 _aux->compatName = *(xcb_atom_t *)xcb_tmp;
6883 xcb_block_len += sizeof(xcb_atom_t);
6884 xcb_tmp += sizeof(xcb_atom_t);
6885 xcb_align_to = ALIGNOF(xcb_atom_t);
6887 if(which & XCB_XKB_NAME_DETAIL_KEY_TYPE_NAMES) {
6888 /* insert padding */
6889 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6890 xcb_buffer_len += xcb_block_len + xcb_pad;
6891 if (0 != xcb_pad) {
6892 xcb_tmp += xcb_pad;
6893 xcb_pad = 0;
6895 xcb_block_len = 0;
6896 /* typeNames */
6897 _aux->typeNames = (xcb_atom_t *)xcb_tmp;
6898 xcb_block_len += nTypes * sizeof(xcb_atom_t);
6899 xcb_tmp += xcb_block_len;
6900 xcb_align_to = ALIGNOF(xcb_atom_t);
6902 if(which & XCB_XKB_NAME_DETAIL_KT_LEVEL_NAMES) {
6903 /* insert padding */
6904 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6905 xcb_buffer_len += xcb_block_len + xcb_pad;
6906 if (0 != xcb_pad) {
6907 xcb_tmp += xcb_pad;
6908 xcb_pad = 0;
6910 xcb_block_len = 0;
6911 /* nLevelsPerType */
6912 _aux->nLevelsPerType = (uint8_t *)xcb_tmp;
6913 xcb_block_len += nTypes * sizeof(uint8_t);
6914 xcb_tmp += xcb_block_len;
6915 xcb_align_to = ALIGNOF(uint8_t);
6916 /* insert padding */
6917 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6918 xcb_buffer_len += xcb_block_len + xcb_pad;
6919 if (0 != xcb_pad) {
6920 xcb_tmp += xcb_pad;
6921 xcb_pad = 0;
6923 xcb_block_len = 0;
6924 /* ktLevelNames */
6925 _aux->ktLevelNames = (xcb_atom_t *)xcb_tmp;
6926 xcb_block_len += xcb_sumof(_aux->nLevelsPerType, nTypes) * sizeof(xcb_atom_t);
6927 xcb_tmp += xcb_block_len;
6928 xcb_align_to = ALIGNOF(xcb_atom_t);
6930 if(which & XCB_XKB_NAME_DETAIL_INDICATOR_NAMES) {
6931 /* insert padding */
6932 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6933 xcb_buffer_len += xcb_block_len + xcb_pad;
6934 if (0 != xcb_pad) {
6935 xcb_tmp += xcb_pad;
6936 xcb_pad = 0;
6938 xcb_block_len = 0;
6939 /* indicatorNames */
6940 _aux->indicatorNames = (xcb_atom_t *)xcb_tmp;
6941 xcb_block_len += xcb_popcount(indicators) * sizeof(xcb_atom_t);
6942 xcb_tmp += xcb_block_len;
6943 xcb_align_to = ALIGNOF(xcb_atom_t);
6945 if(which & XCB_XKB_NAME_DETAIL_VIRTUAL_MOD_NAMES) {
6946 /* insert padding */
6947 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6948 xcb_buffer_len += xcb_block_len + xcb_pad;
6949 if (0 != xcb_pad) {
6950 xcb_tmp += xcb_pad;
6951 xcb_pad = 0;
6953 xcb_block_len = 0;
6954 /* virtualModNames */
6955 _aux->virtualModNames = (xcb_atom_t *)xcb_tmp;
6956 xcb_block_len += xcb_popcount(virtualMods) * sizeof(xcb_atom_t);
6957 xcb_tmp += xcb_block_len;
6958 xcb_align_to = ALIGNOF(xcb_atom_t);
6960 if(which & XCB_XKB_NAME_DETAIL_GROUP_NAMES) {
6961 /* insert padding */
6962 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6963 xcb_buffer_len += xcb_block_len + xcb_pad;
6964 if (0 != xcb_pad) {
6965 xcb_tmp += xcb_pad;
6966 xcb_pad = 0;
6968 xcb_block_len = 0;
6969 /* groups */
6970 _aux->groups = (xcb_atom_t *)xcb_tmp;
6971 xcb_block_len += xcb_popcount(groupNames) * sizeof(xcb_atom_t);
6972 xcb_tmp += xcb_block_len;
6973 xcb_align_to = ALIGNOF(xcb_atom_t);
6975 if(which & XCB_XKB_NAME_DETAIL_KEY_NAMES) {
6976 /* insert padding */
6977 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6978 xcb_buffer_len += xcb_block_len + xcb_pad;
6979 if (0 != xcb_pad) {
6980 xcb_tmp += xcb_pad;
6981 xcb_pad = 0;
6983 xcb_block_len = 0;
6984 /* keyNames */
6985 _aux->keyNames = (xcb_xkb_key_name_t *)xcb_tmp;
6986 xcb_block_len += nKeys * sizeof(xcb_xkb_key_name_t);
6987 xcb_tmp += xcb_block_len;
6988 xcb_align_to = ALIGNOF(xcb_xkb_key_name_t);
6990 if(which & XCB_XKB_NAME_DETAIL_KEY_ALIASES) {
6991 /* insert padding */
6992 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6993 xcb_buffer_len += xcb_block_len + xcb_pad;
6994 if (0 != xcb_pad) {
6995 xcb_tmp += xcb_pad;
6996 xcb_pad = 0;
6998 xcb_block_len = 0;
6999 /* keyAliases */
7000 _aux->keyAliases = (xcb_xkb_key_alias_t *)xcb_tmp;
7001 xcb_block_len += nKeyAliases * sizeof(xcb_xkb_key_alias_t);
7002 xcb_tmp += xcb_block_len;
7003 xcb_align_to = ALIGNOF(xcb_xkb_key_alias_t);
7005 if(which & XCB_XKB_NAME_DETAIL_RG_NAMES) {
7006 /* insert padding */
7007 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
7008 xcb_buffer_len += xcb_block_len + xcb_pad;
7009 if (0 != xcb_pad) {
7010 xcb_tmp += xcb_pad;
7011 xcb_pad = 0;
7013 xcb_block_len = 0;
7014 /* radioGroupNames */
7015 _aux->radioGroupNames = (xcb_atom_t *)xcb_tmp;
7016 xcb_block_len += nRadioGroups * sizeof(xcb_atom_t);
7017 xcb_tmp += xcb_block_len;
7018 xcb_align_to = ALIGNOF(xcb_atom_t);
7020 /* insert padding */
7021 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
7022 xcb_buffer_len += xcb_block_len + xcb_pad;
7023 if (0 != xcb_pad) {
7024 xcb_tmp += xcb_pad;
7025 xcb_pad = 0;
7027 xcb_block_len = 0;
7029 return xcb_buffer_len;
7033 xcb_xkb_set_names_values_sizeof (const void *_buffer /**< */,
7034 uint8_t nTypes /**< */,
7035 uint32_t indicators /**< */,
7036 uint16_t virtualMods /**< */,
7037 uint8_t groupNames /**< */,
7038 uint8_t nKeys /**< */,
7039 uint8_t nKeyAliases /**< */,
7040 uint8_t nRadioGroups /**< */,
7041 uint32_t which /**< */)
7043 xcb_xkb_set_names_values_t _aux;
7044 return xcb_xkb_set_names_values_unpack(_buffer, nTypes, indicators, virtualMods, groupNames, nKeys, nKeyAliases, nRadioGroups, which, &_aux);
7047 xcb_void_cookie_t
7048 xcb_xkb_set_names_checked (xcb_connection_t *c /**< */,
7049 xcb_xkb_device_spec_t deviceSpec /**< */,
7050 uint16_t virtualMods /**< */,
7051 uint32_t which /**< */,
7052 uint8_t firstType /**< */,
7053 uint8_t nTypes /**< */,
7054 uint8_t firstKTLevelt /**< */,
7055 uint8_t nKTLevels /**< */,
7056 uint32_t indicators /**< */,
7057 uint8_t groupNames /**< */,
7058 uint8_t nRadioGroups /**< */,
7059 xcb_keycode_t firstKey /**< */,
7060 uint8_t nKeys /**< */,
7061 uint8_t nKeyAliases /**< */,
7062 uint16_t totalKTLevelNames /**< */,
7063 const void *values /**< */)
7065 static const xcb_protocol_request_t xcb_req = {
7066 /* count */ 3,
7067 /* ext */ &xcb_xkb_id,
7068 /* opcode */ XCB_XKB_SET_NAMES,
7069 /* isvoid */ 1
7072 struct iovec xcb_parts[5];
7073 xcb_void_cookie_t xcb_ret;
7074 xcb_xkb_set_names_request_t xcb_out;
7076 xcb_out.deviceSpec = deviceSpec;
7077 xcb_out.virtualMods = virtualMods;
7078 xcb_out.which = which;
7079 xcb_out.firstType = firstType;
7080 xcb_out.nTypes = nTypes;
7081 xcb_out.firstKTLevelt = firstKTLevelt;
7082 xcb_out.nKTLevels = nKTLevels;
7083 xcb_out.indicators = indicators;
7084 xcb_out.groupNames = groupNames;
7085 xcb_out.nRadioGroups = nRadioGroups;
7086 xcb_out.firstKey = firstKey;
7087 xcb_out.nKeys = nKeys;
7088 xcb_out.nKeyAliases = nKeyAliases;
7089 xcb_out.pad0 = 0;
7090 xcb_out.totalKTLevelNames = totalKTLevelNames;
7092 xcb_parts[2].iov_base = (char *) &xcb_out;
7093 xcb_parts[2].iov_len = sizeof(xcb_out);
7094 xcb_parts[3].iov_base = 0;
7095 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
7096 /* xcb_xkb_set_names_values_t values */
7097 xcb_parts[4].iov_base = (char *) values;
7098 xcb_parts[4].iov_len =
7099 xcb_xkb_set_names_values_sizeof (values, nTypes, indicators, virtualMods, groupNames, nKeys, nKeyAliases, nRadioGroups, which);
7101 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
7102 return xcb_ret;
7105 xcb_void_cookie_t
7106 xcb_xkb_set_names (xcb_connection_t *c /**< */,
7107 xcb_xkb_device_spec_t deviceSpec /**< */,
7108 uint16_t virtualMods /**< */,
7109 uint32_t which /**< */,
7110 uint8_t firstType /**< */,
7111 uint8_t nTypes /**< */,
7112 uint8_t firstKTLevelt /**< */,
7113 uint8_t nKTLevels /**< */,
7114 uint32_t indicators /**< */,
7115 uint8_t groupNames /**< */,
7116 uint8_t nRadioGroups /**< */,
7117 xcb_keycode_t firstKey /**< */,
7118 uint8_t nKeys /**< */,
7119 uint8_t nKeyAliases /**< */,
7120 uint16_t totalKTLevelNames /**< */,
7121 const void *values /**< */)
7123 static const xcb_protocol_request_t xcb_req = {
7124 /* count */ 3,
7125 /* ext */ &xcb_xkb_id,
7126 /* opcode */ XCB_XKB_SET_NAMES,
7127 /* isvoid */ 1
7130 struct iovec xcb_parts[5];
7131 xcb_void_cookie_t xcb_ret;
7132 xcb_xkb_set_names_request_t xcb_out;
7134 xcb_out.deviceSpec = deviceSpec;
7135 xcb_out.virtualMods = virtualMods;
7136 xcb_out.which = which;
7137 xcb_out.firstType = firstType;
7138 xcb_out.nTypes = nTypes;
7139 xcb_out.firstKTLevelt = firstKTLevelt;
7140 xcb_out.nKTLevels = nKTLevels;
7141 xcb_out.indicators = indicators;
7142 xcb_out.groupNames = groupNames;
7143 xcb_out.nRadioGroups = nRadioGroups;
7144 xcb_out.firstKey = firstKey;
7145 xcb_out.nKeys = nKeys;
7146 xcb_out.nKeyAliases = nKeyAliases;
7147 xcb_out.pad0 = 0;
7148 xcb_out.totalKTLevelNames = totalKTLevelNames;
7150 xcb_parts[2].iov_base = (char *) &xcb_out;
7151 xcb_parts[2].iov_len = sizeof(xcb_out);
7152 xcb_parts[3].iov_base = 0;
7153 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
7154 /* xcb_xkb_set_names_values_t values */
7155 xcb_parts[4].iov_base = (char *) values;
7156 xcb_parts[4].iov_len =
7157 xcb_xkb_set_names_values_sizeof (values, nTypes, indicators, virtualMods, groupNames, nKeys, nKeyAliases, nRadioGroups, which);
7159 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
7160 return xcb_ret;
7163 xcb_void_cookie_t
7164 xcb_xkb_set_names_aux_checked (xcb_connection_t *c /**< */,
7165 xcb_xkb_device_spec_t deviceSpec /**< */,
7166 uint16_t virtualMods /**< */,
7167 uint32_t which /**< */,
7168 uint8_t firstType /**< */,
7169 uint8_t nTypes /**< */,
7170 uint8_t firstKTLevelt /**< */,
7171 uint8_t nKTLevels /**< */,
7172 uint32_t indicators /**< */,
7173 uint8_t groupNames /**< */,
7174 uint8_t nRadioGroups /**< */,
7175 xcb_keycode_t firstKey /**< */,
7176 uint8_t nKeys /**< */,
7177 uint8_t nKeyAliases /**< */,
7178 uint16_t totalKTLevelNames /**< */,
7179 const xcb_xkb_set_names_values_t *values /**< */)
7181 static const xcb_protocol_request_t xcb_req = {
7182 /* count */ 3,
7183 /* ext */ &xcb_xkb_id,
7184 /* opcode */ XCB_XKB_SET_NAMES,
7185 /* isvoid */ 1
7188 struct iovec xcb_parts[5];
7189 xcb_void_cookie_t xcb_ret;
7190 xcb_xkb_set_names_request_t xcb_out;
7191 void *xcb_aux0 = 0;
7193 xcb_out.deviceSpec = deviceSpec;
7194 xcb_out.virtualMods = virtualMods;
7195 xcb_out.which = which;
7196 xcb_out.firstType = firstType;
7197 xcb_out.nTypes = nTypes;
7198 xcb_out.firstKTLevelt = firstKTLevelt;
7199 xcb_out.nKTLevels = nKTLevels;
7200 xcb_out.indicators = indicators;
7201 xcb_out.groupNames = groupNames;
7202 xcb_out.nRadioGroups = nRadioGroups;
7203 xcb_out.firstKey = firstKey;
7204 xcb_out.nKeys = nKeys;
7205 xcb_out.nKeyAliases = nKeyAliases;
7206 xcb_out.pad0 = 0;
7207 xcb_out.totalKTLevelNames = totalKTLevelNames;
7209 xcb_parts[2].iov_base = (char *) &xcb_out;
7210 xcb_parts[2].iov_len = sizeof(xcb_out);
7211 xcb_parts[3].iov_base = 0;
7212 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
7213 /* xcb_xkb_set_names_values_t values */
7214 xcb_parts[4].iov_len =
7215 xcb_xkb_set_names_values_serialize (&xcb_aux0, nTypes, indicators, virtualMods, groupNames, nKeys, nKeyAliases, nRadioGroups, which, values);
7216 xcb_parts[4].iov_base = xcb_aux0;
7218 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
7219 free(xcb_aux0);
7220 return xcb_ret;
7223 xcb_void_cookie_t
7224 xcb_xkb_set_names_aux (xcb_connection_t *c /**< */,
7225 xcb_xkb_device_spec_t deviceSpec /**< */,
7226 uint16_t virtualMods /**< */,
7227 uint32_t which /**< */,
7228 uint8_t firstType /**< */,
7229 uint8_t nTypes /**< */,
7230 uint8_t firstKTLevelt /**< */,
7231 uint8_t nKTLevels /**< */,
7232 uint32_t indicators /**< */,
7233 uint8_t groupNames /**< */,
7234 uint8_t nRadioGroups /**< */,
7235 xcb_keycode_t firstKey /**< */,
7236 uint8_t nKeys /**< */,
7237 uint8_t nKeyAliases /**< */,
7238 uint16_t totalKTLevelNames /**< */,
7239 const xcb_xkb_set_names_values_t *values /**< */)
7241 static const xcb_protocol_request_t xcb_req = {
7242 /* count */ 3,
7243 /* ext */ &xcb_xkb_id,
7244 /* opcode */ XCB_XKB_SET_NAMES,
7245 /* isvoid */ 1
7248 struct iovec xcb_parts[5];
7249 xcb_void_cookie_t xcb_ret;
7250 xcb_xkb_set_names_request_t xcb_out;
7251 void *xcb_aux0 = 0;
7253 xcb_out.deviceSpec = deviceSpec;
7254 xcb_out.virtualMods = virtualMods;
7255 xcb_out.which = which;
7256 xcb_out.firstType = firstType;
7257 xcb_out.nTypes = nTypes;
7258 xcb_out.firstKTLevelt = firstKTLevelt;
7259 xcb_out.nKTLevels = nKTLevels;
7260 xcb_out.indicators = indicators;
7261 xcb_out.groupNames = groupNames;
7262 xcb_out.nRadioGroups = nRadioGroups;
7263 xcb_out.firstKey = firstKey;
7264 xcb_out.nKeys = nKeys;
7265 xcb_out.nKeyAliases = nKeyAliases;
7266 xcb_out.pad0 = 0;
7267 xcb_out.totalKTLevelNames = totalKTLevelNames;
7269 xcb_parts[2].iov_base = (char *) &xcb_out;
7270 xcb_parts[2].iov_len = sizeof(xcb_out);
7271 xcb_parts[3].iov_base = 0;
7272 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
7273 /* xcb_xkb_set_names_values_t values */
7274 xcb_parts[4].iov_len =
7275 xcb_xkb_set_names_values_serialize (&xcb_aux0, nTypes, indicators, virtualMods, groupNames, nKeys, nKeyAliases, nRadioGroups, which, values);
7276 xcb_parts[4].iov_base = xcb_aux0;
7278 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
7279 free(xcb_aux0);
7280 return xcb_ret;
7283 xcb_xkb_per_client_flags_cookie_t
7284 xcb_xkb_per_client_flags (xcb_connection_t *c /**< */,
7285 xcb_xkb_device_spec_t deviceSpec /**< */,
7286 uint32_t change /**< */,
7287 uint32_t value /**< */,
7288 uint32_t ctrlsToChange /**< */,
7289 uint32_t autoCtrls /**< */,
7290 uint32_t autoCtrlsValues /**< */)
7292 static const xcb_protocol_request_t xcb_req = {
7293 /* count */ 2,
7294 /* ext */ &xcb_xkb_id,
7295 /* opcode */ XCB_XKB_PER_CLIENT_FLAGS,
7296 /* isvoid */ 0
7299 struct iovec xcb_parts[4];
7300 xcb_xkb_per_client_flags_cookie_t xcb_ret;
7301 xcb_xkb_per_client_flags_request_t xcb_out;
7303 xcb_out.deviceSpec = deviceSpec;
7304 memset(xcb_out.pad0, 0, 2);
7305 xcb_out.change = change;
7306 xcb_out.value = value;
7307 xcb_out.ctrlsToChange = ctrlsToChange;
7308 xcb_out.autoCtrls = autoCtrls;
7309 xcb_out.autoCtrlsValues = autoCtrlsValues;
7311 xcb_parts[2].iov_base = (char *) &xcb_out;
7312 xcb_parts[2].iov_len = sizeof(xcb_out);
7313 xcb_parts[3].iov_base = 0;
7314 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
7316 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
7317 return xcb_ret;
7320 xcb_xkb_per_client_flags_cookie_t
7321 xcb_xkb_per_client_flags_unchecked (xcb_connection_t *c /**< */,
7322 xcb_xkb_device_spec_t deviceSpec /**< */,
7323 uint32_t change /**< */,
7324 uint32_t value /**< */,
7325 uint32_t ctrlsToChange /**< */,
7326 uint32_t autoCtrls /**< */,
7327 uint32_t autoCtrlsValues /**< */)
7329 static const xcb_protocol_request_t xcb_req = {
7330 /* count */ 2,
7331 /* ext */ &xcb_xkb_id,
7332 /* opcode */ XCB_XKB_PER_CLIENT_FLAGS,
7333 /* isvoid */ 0
7336 struct iovec xcb_parts[4];
7337 xcb_xkb_per_client_flags_cookie_t xcb_ret;
7338 xcb_xkb_per_client_flags_request_t xcb_out;
7340 xcb_out.deviceSpec = deviceSpec;
7341 memset(xcb_out.pad0, 0, 2);
7342 xcb_out.change = change;
7343 xcb_out.value = value;
7344 xcb_out.ctrlsToChange = ctrlsToChange;
7345 xcb_out.autoCtrls = autoCtrls;
7346 xcb_out.autoCtrlsValues = autoCtrlsValues;
7348 xcb_parts[2].iov_base = (char *) &xcb_out;
7349 xcb_parts[2].iov_len = sizeof(xcb_out);
7350 xcb_parts[3].iov_base = 0;
7351 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
7353 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
7354 return xcb_ret;
7357 xcb_xkb_per_client_flags_reply_t *
7358 xcb_xkb_per_client_flags_reply (xcb_connection_t *c /**< */,
7359 xcb_xkb_per_client_flags_cookie_t cookie /**< */,
7360 xcb_generic_error_t **e /**< */)
7362 return (xcb_xkb_per_client_flags_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
7366 xcb_xkb_list_components_sizeof (const void *_buffer /**< */)
7368 char *xcb_tmp = (char *)_buffer;
7369 const xcb_xkb_list_components_reply_t *_aux = (xcb_xkb_list_components_reply_t *)_buffer;
7370 unsigned int xcb_buffer_len = 0;
7371 unsigned int xcb_block_len = 0;
7372 unsigned int xcb_pad = 0;
7373 unsigned int xcb_align_to = 0;
7375 unsigned int i;
7376 unsigned int xcb_tmp_len;
7378 xcb_block_len += sizeof(xcb_xkb_list_components_reply_t);
7379 xcb_tmp += xcb_block_len;
7380 xcb_buffer_len += xcb_block_len;
7381 xcb_block_len = 0;
7382 /* keymaps */
7383 for(i=0; i<_aux->nKeymaps; i++) {
7384 xcb_tmp_len = xcb_xkb_listing_sizeof(xcb_tmp);
7385 xcb_block_len += xcb_tmp_len;
7386 xcb_tmp += xcb_tmp_len;
7388 xcb_align_to = ALIGNOF(xcb_xkb_listing_t);
7389 /* insert padding */
7390 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
7391 xcb_buffer_len += xcb_block_len + xcb_pad;
7392 if (0 != xcb_pad) {
7393 xcb_tmp += xcb_pad;
7394 xcb_pad = 0;
7396 xcb_block_len = 0;
7397 /* keycodes */
7398 for(i=0; i<_aux->nKeycodes; i++) {
7399 xcb_tmp_len = xcb_xkb_listing_sizeof(xcb_tmp);
7400 xcb_block_len += xcb_tmp_len;
7401 xcb_tmp += xcb_tmp_len;
7403 xcb_align_to = ALIGNOF(xcb_xkb_listing_t);
7404 /* insert padding */
7405 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
7406 xcb_buffer_len += xcb_block_len + xcb_pad;
7407 if (0 != xcb_pad) {
7408 xcb_tmp += xcb_pad;
7409 xcb_pad = 0;
7411 xcb_block_len = 0;
7412 /* types */
7413 for(i=0; i<_aux->nTypes; i++) {
7414 xcb_tmp_len = xcb_xkb_listing_sizeof(xcb_tmp);
7415 xcb_block_len += xcb_tmp_len;
7416 xcb_tmp += xcb_tmp_len;
7418 xcb_align_to = ALIGNOF(xcb_xkb_listing_t);
7419 /* insert padding */
7420 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
7421 xcb_buffer_len += xcb_block_len + xcb_pad;
7422 if (0 != xcb_pad) {
7423 xcb_tmp += xcb_pad;
7424 xcb_pad = 0;
7426 xcb_block_len = 0;
7427 /* compatMaps */
7428 for(i=0; i<_aux->nCompatMaps; i++) {
7429 xcb_tmp_len = xcb_xkb_listing_sizeof(xcb_tmp);
7430 xcb_block_len += xcb_tmp_len;
7431 xcb_tmp += xcb_tmp_len;
7433 xcb_align_to = ALIGNOF(xcb_xkb_listing_t);
7434 /* insert padding */
7435 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
7436 xcb_buffer_len += xcb_block_len + xcb_pad;
7437 if (0 != xcb_pad) {
7438 xcb_tmp += xcb_pad;
7439 xcb_pad = 0;
7441 xcb_block_len = 0;
7442 /* symbols */
7443 for(i=0; i<_aux->nSymbols; i++) {
7444 xcb_tmp_len = xcb_xkb_listing_sizeof(xcb_tmp);
7445 xcb_block_len += xcb_tmp_len;
7446 xcb_tmp += xcb_tmp_len;
7448 xcb_align_to = ALIGNOF(xcb_xkb_listing_t);
7449 /* insert padding */
7450 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
7451 xcb_buffer_len += xcb_block_len + xcb_pad;
7452 if (0 != xcb_pad) {
7453 xcb_tmp += xcb_pad;
7454 xcb_pad = 0;
7456 xcb_block_len = 0;
7457 /* geometries */
7458 for(i=0; i<_aux->nGeometries; i++) {
7459 xcb_tmp_len = xcb_xkb_listing_sizeof(xcb_tmp);
7460 xcb_block_len += xcb_tmp_len;
7461 xcb_tmp += xcb_tmp_len;
7463 xcb_align_to = ALIGNOF(xcb_xkb_listing_t);
7464 /* insert padding */
7465 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
7466 xcb_buffer_len += xcb_block_len + xcb_pad;
7467 if (0 != xcb_pad) {
7468 xcb_tmp += xcb_pad;
7469 xcb_pad = 0;
7471 xcb_block_len = 0;
7473 return xcb_buffer_len;
7476 xcb_xkb_list_components_cookie_t
7477 xcb_xkb_list_components (xcb_connection_t *c /**< */,
7478 xcb_xkb_device_spec_t deviceSpec /**< */,
7479 uint16_t maxNames /**< */)
7481 static const xcb_protocol_request_t xcb_req = {
7482 /* count */ 2,
7483 /* ext */ &xcb_xkb_id,
7484 /* opcode */ XCB_XKB_LIST_COMPONENTS,
7485 /* isvoid */ 0
7488 struct iovec xcb_parts[4];
7489 xcb_xkb_list_components_cookie_t xcb_ret;
7490 xcb_xkb_list_components_request_t xcb_out;
7492 xcb_out.deviceSpec = deviceSpec;
7493 xcb_out.maxNames = maxNames;
7495 xcb_parts[2].iov_base = (char *) &xcb_out;
7496 xcb_parts[2].iov_len = sizeof(xcb_out);
7497 xcb_parts[3].iov_base = 0;
7498 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
7500 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
7501 return xcb_ret;
7504 xcb_xkb_list_components_cookie_t
7505 xcb_xkb_list_components_unchecked (xcb_connection_t *c /**< */,
7506 xcb_xkb_device_spec_t deviceSpec /**< */,
7507 uint16_t maxNames /**< */)
7509 static const xcb_protocol_request_t xcb_req = {
7510 /* count */ 2,
7511 /* ext */ &xcb_xkb_id,
7512 /* opcode */ XCB_XKB_LIST_COMPONENTS,
7513 /* isvoid */ 0
7516 struct iovec xcb_parts[4];
7517 xcb_xkb_list_components_cookie_t xcb_ret;
7518 xcb_xkb_list_components_request_t xcb_out;
7520 xcb_out.deviceSpec = deviceSpec;
7521 xcb_out.maxNames = maxNames;
7523 xcb_parts[2].iov_base = (char *) &xcb_out;
7524 xcb_parts[2].iov_len = sizeof(xcb_out);
7525 xcb_parts[3].iov_base = 0;
7526 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
7528 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
7529 return xcb_ret;
7533 xcb_xkb_list_components_keymaps_length (const xcb_xkb_list_components_reply_t *R /**< */)
7535 return R->nKeymaps;
7538 xcb_xkb_listing_iterator_t
7539 xcb_xkb_list_components_keymaps_iterator (const xcb_xkb_list_components_reply_t *R /**< */)
7541 xcb_xkb_listing_iterator_t i;
7542 i.data = (xcb_xkb_listing_t *) (R + 1);
7543 i.rem = R->nKeymaps;
7544 i.index = (char *) i.data - (char *) R;
7545 return i;
7549 xcb_xkb_list_components_keycodes_length (const xcb_xkb_list_components_reply_t *R /**< */)
7551 return R->nKeycodes;
7554 xcb_xkb_listing_iterator_t
7555 xcb_xkb_list_components_keycodes_iterator (const xcb_xkb_list_components_reply_t *R /**< */)
7557 xcb_xkb_listing_iterator_t i;
7558 xcb_generic_iterator_t prev = xcb_xkb_listing_end(xcb_xkb_list_components_keymaps_iterator(R));
7559 i.data = (xcb_xkb_listing_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xkb_listing_t, prev.index));
7560 i.rem = R->nKeycodes;
7561 i.index = (char *) i.data - (char *) R;
7562 return i;
7566 xcb_xkb_list_components_types_length (const xcb_xkb_list_components_reply_t *R /**< */)
7568 return R->nTypes;
7571 xcb_xkb_listing_iterator_t
7572 xcb_xkb_list_components_types_iterator (const xcb_xkb_list_components_reply_t *R /**< */)
7574 xcb_xkb_listing_iterator_t i;
7575 xcb_generic_iterator_t prev = xcb_xkb_listing_end(xcb_xkb_list_components_keycodes_iterator(R));
7576 i.data = (xcb_xkb_listing_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xkb_listing_t, prev.index));
7577 i.rem = R->nTypes;
7578 i.index = (char *) i.data - (char *) R;
7579 return i;
7583 xcb_xkb_list_components_compat_maps_length (const xcb_xkb_list_components_reply_t *R /**< */)
7585 return R->nCompatMaps;
7588 xcb_xkb_listing_iterator_t
7589 xcb_xkb_list_components_compat_maps_iterator (const xcb_xkb_list_components_reply_t *R /**< */)
7591 xcb_xkb_listing_iterator_t i;
7592 xcb_generic_iterator_t prev = xcb_xkb_listing_end(xcb_xkb_list_components_types_iterator(R));
7593 i.data = (xcb_xkb_listing_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xkb_listing_t, prev.index));
7594 i.rem = R->nCompatMaps;
7595 i.index = (char *) i.data - (char *) R;
7596 return i;
7600 xcb_xkb_list_components_symbols_length (const xcb_xkb_list_components_reply_t *R /**< */)
7602 return R->nSymbols;
7605 xcb_xkb_listing_iterator_t
7606 xcb_xkb_list_components_symbols_iterator (const xcb_xkb_list_components_reply_t *R /**< */)
7608 xcb_xkb_listing_iterator_t i;
7609 xcb_generic_iterator_t prev = xcb_xkb_listing_end(xcb_xkb_list_components_compat_maps_iterator(R));
7610 i.data = (xcb_xkb_listing_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xkb_listing_t, prev.index));
7611 i.rem = R->nSymbols;
7612 i.index = (char *) i.data - (char *) R;
7613 return i;
7617 xcb_xkb_list_components_geometries_length (const xcb_xkb_list_components_reply_t *R /**< */)
7619 return R->nGeometries;
7622 xcb_xkb_listing_iterator_t
7623 xcb_xkb_list_components_geometries_iterator (const xcb_xkb_list_components_reply_t *R /**< */)
7625 xcb_xkb_listing_iterator_t i;
7626 xcb_generic_iterator_t prev = xcb_xkb_listing_end(xcb_xkb_list_components_symbols_iterator(R));
7627 i.data = (xcb_xkb_listing_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xkb_listing_t, prev.index));
7628 i.rem = R->nGeometries;
7629 i.index = (char *) i.data - (char *) R;
7630 return i;
7633 xcb_xkb_list_components_reply_t *
7634 xcb_xkb_list_components_reply (xcb_connection_t *c /**< */,
7635 xcb_xkb_list_components_cookie_t cookie /**< */,
7636 xcb_generic_error_t **e /**< */)
7638 return (xcb_xkb_list_components_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
7642 xcb_xkb_get_kbd_by_name_replies_types_map_types_rtrn_length (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */,
7643 const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
7645 return /* replies */ S->types.nTypes;
7648 xcb_xkb_key_type_iterator_t
7649 xcb_xkb_get_kbd_by_name_replies_types_map_types_rtrn_iterator (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */,
7650 const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
7652 xcb_xkb_key_type_iterator_t i;
7653 i.data = /* replies */ S->types.map.types_rtrn;
7654 i.rem = /* replies */ S->types.nTypes;
7655 i.index = (char *) i.data - (char *) S;
7656 return i;
7660 xcb_xkb_get_kbd_by_name_replies_types_map_syms_rtrn_length (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */,
7661 const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
7663 return /* replies */ S->types.nKeySyms;
7666 xcb_xkb_key_sym_map_iterator_t
7667 xcb_xkb_get_kbd_by_name_replies_types_map_syms_rtrn_iterator (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */,
7668 const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
7670 xcb_xkb_key_sym_map_iterator_t i;
7671 i.data = /* replies */ S->types.map.syms_rtrn;
7672 i.rem = /* replies */ S->types.nKeySyms;
7673 i.index = (char *) i.data - (char *) S;
7674 return i;
7677 uint8_t *
7678 xcb_xkb_get_kbd_by_name_replies_types_map_acts_rtrn_count (const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
7680 return /* replies */ S->types.map.acts_rtrn_count;
7684 xcb_xkb_get_kbd_by_name_replies_types_map_acts_rtrn_count_length (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */,
7685 const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
7687 return /* replies */ S->types.nKeyActions;
7690 xcb_generic_iterator_t
7691 xcb_xkb_get_kbd_by_name_replies_types_map_acts_rtrn_count_end (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */,
7692 const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
7694 xcb_generic_iterator_t i;
7695 i.data = /* replies */ S->types.map.acts_rtrn_count + /* replies */ S->types.nKeyActions;
7696 i.rem = 0;
7697 i.index = (char *) i.data - (char *) S;
7698 return i;
7701 xcb_xkb_action_t *
7702 xcb_xkb_get_kbd_by_name_replies_types_map_acts_rtrn_acts (const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
7704 return /* replies */ S->types.map.acts_rtrn_acts;
7708 xcb_xkb_get_kbd_by_name_replies_types_map_acts_rtrn_acts_length (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */,
7709 const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
7711 return /* replies */ S->types.totalActions;
7714 xcb_xkb_action_iterator_t
7715 xcb_xkb_get_kbd_by_name_replies_types_map_acts_rtrn_acts_iterator (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */,
7716 const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
7718 xcb_xkb_action_iterator_t i;
7719 i.data = /* replies */ S->types.map.acts_rtrn_acts;
7720 i.rem = /* replies */ S->types.totalActions;
7721 i.index = (char *) i.data - (char *) S;
7722 return i;
7725 xcb_xkb_set_behavior_t *
7726 xcb_xkb_get_kbd_by_name_replies_types_map_behaviors_rtrn (const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
7728 return /* replies */ S->types.map.behaviors_rtrn;
7732 xcb_xkb_get_kbd_by_name_replies_types_map_behaviors_rtrn_length (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */,
7733 const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
7735 return /* replies */ S->types.totalKeyBehaviors;
7738 xcb_xkb_set_behavior_iterator_t
7739 xcb_xkb_get_kbd_by_name_replies_types_map_behaviors_rtrn_iterator (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */,
7740 const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
7742 xcb_xkb_set_behavior_iterator_t i;
7743 i.data = /* replies */ S->types.map.behaviors_rtrn;
7744 i.rem = /* replies */ S->types.totalKeyBehaviors;
7745 i.index = (char *) i.data - (char *) S;
7746 return i;
7749 uint8_t *
7750 xcb_xkb_get_kbd_by_name_replies_types_map_vmods_rtrn (const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
7752 return /* replies */ S->types.map.vmods_rtrn;
7756 xcb_xkb_get_kbd_by_name_replies_types_map_vmods_rtrn_length (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */,
7757 const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
7759 return xcb_popcount(/* replies */ S->types.virtualMods);
7762 xcb_generic_iterator_t
7763 xcb_xkb_get_kbd_by_name_replies_types_map_vmods_rtrn_end (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */,
7764 const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
7766 xcb_generic_iterator_t i;
7767 i.data = /* replies */ S->types.map.vmods_rtrn + xcb_popcount(/* replies */ S->types.virtualMods);
7768 i.rem = 0;
7769 i.index = (char *) i.data - (char *) S;
7770 return i;
7773 xcb_xkb_set_explicit_t *
7774 xcb_xkb_get_kbd_by_name_replies_types_map_explicit_rtrn (const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
7776 return /* replies */ S->types.map.explicit_rtrn;
7780 xcb_xkb_get_kbd_by_name_replies_types_map_explicit_rtrn_length (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */,
7781 const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
7783 return /* replies */ S->types.totalKeyExplicit;
7786 xcb_xkb_set_explicit_iterator_t
7787 xcb_xkb_get_kbd_by_name_replies_types_map_explicit_rtrn_iterator (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */,
7788 const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
7790 xcb_xkb_set_explicit_iterator_t i;
7791 i.data = /* replies */ S->types.map.explicit_rtrn;
7792 i.rem = /* replies */ S->types.totalKeyExplicit;
7793 i.index = (char *) i.data - (char *) S;
7794 return i;
7797 xcb_xkb_key_mod_map_t *
7798 xcb_xkb_get_kbd_by_name_replies_types_map_modmap_rtrn (const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
7800 return /* replies */ S->types.map.modmap_rtrn;
7804 xcb_xkb_get_kbd_by_name_replies_types_map_modmap_rtrn_length (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */,
7805 const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
7807 return /* replies */ S->types.totalModMapKeys;
7810 xcb_xkb_key_mod_map_iterator_t
7811 xcb_xkb_get_kbd_by_name_replies_types_map_modmap_rtrn_iterator (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */,
7812 const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
7814 xcb_xkb_key_mod_map_iterator_t i;
7815 i.data = /* replies */ S->types.map.modmap_rtrn;
7816 i.rem = /* replies */ S->types.totalModMapKeys;
7817 i.index = (char *) i.data - (char *) S;
7818 return i;
7821 xcb_xkb_key_v_mod_map_t *
7822 xcb_xkb_get_kbd_by_name_replies_types_map_vmodmap_rtrn (const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
7824 return /* replies */ S->types.map.vmodmap_rtrn;
7828 xcb_xkb_get_kbd_by_name_replies_types_map_vmodmap_rtrn_length (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */,
7829 const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
7831 return /* replies */ S->types.totalVModMapKeys;
7834 xcb_xkb_key_v_mod_map_iterator_t
7835 xcb_xkb_get_kbd_by_name_replies_types_map_vmodmap_rtrn_iterator (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */,
7836 const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
7838 xcb_xkb_key_v_mod_map_iterator_t i;
7839 i.data = /* replies */ S->types.map.vmodmap_rtrn;
7840 i.rem = /* replies */ S->types.totalVModMapKeys;
7841 i.index = (char *) i.data - (char *) S;
7842 return i;
7846 xcb_xkb_get_kbd_by_name_replies_types_map_serialize (void **_buffer /**< */,
7847 uint8_t nTypes /**< */,
7848 uint8_t nKeySyms /**< */,
7849 uint8_t nKeyActions /**< */,
7850 uint16_t totalActions /**< */,
7851 uint8_t totalKeyBehaviors /**< */,
7852 uint16_t virtualMods /**< */,
7853 uint8_t totalKeyExplicit /**< */,
7854 uint8_t totalModMapKeys /**< */,
7855 uint8_t totalVModMapKeys /**< */,
7856 uint16_t present /**< */,
7857 const xcb_xkb_get_kbd_by_name_replies_types_map_t *_aux /**< */)
7859 char *xcb_out = *_buffer;
7860 unsigned int xcb_buffer_len = 0;
7861 unsigned int xcb_align_to = 0;
7863 unsigned int xcb_pad = 0;
7864 char xcb_pad0[3] = {0, 0, 0};
7865 struct iovec xcb_parts[19];
7866 unsigned int xcb_parts_idx = 0;
7867 unsigned int xcb_block_len = 0;
7868 unsigned int i;
7869 char *xcb_tmp;
7871 if(present & XCB_XKB_MAP_PART_KEY_TYPES) {
7872 /* insert padding */
7873 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
7874 xcb_buffer_len += xcb_block_len + xcb_pad;
7875 if (0 != xcb_pad) {
7876 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
7877 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
7878 xcb_parts_idx++;
7879 xcb_pad = 0;
7881 xcb_block_len = 0;
7882 /* types_rtrn */
7883 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->types_rtrn;
7884 xcb_parts[xcb_parts_idx].iov_len = 0;
7885 xcb_tmp = (char *) _aux->types_rtrn;
7886 for(i=0; i<nTypes; i++) {
7887 xcb_block_len = xcb_xkb_key_type_sizeof(xcb_tmp);
7888 xcb_parts[xcb_parts_idx].iov_len += xcb_block_len;
7890 xcb_block_len = xcb_parts[xcb_parts_idx].iov_len;
7891 xcb_parts_idx++;
7892 xcb_align_to = ALIGNOF(xcb_xkb_key_type_t);
7894 if(present & XCB_XKB_MAP_PART_KEY_SYMS) {
7895 /* insert padding */
7896 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
7897 xcb_buffer_len += xcb_block_len + xcb_pad;
7898 if (0 != xcb_pad) {
7899 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
7900 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
7901 xcb_parts_idx++;
7902 xcb_pad = 0;
7904 xcb_block_len = 0;
7905 /* syms_rtrn */
7906 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->syms_rtrn;
7907 xcb_parts[xcb_parts_idx].iov_len = 0;
7908 xcb_tmp = (char *) _aux->syms_rtrn;
7909 for(i=0; i<nKeySyms; i++) {
7910 xcb_block_len = xcb_xkb_key_sym_map_sizeof(xcb_tmp);
7911 xcb_parts[xcb_parts_idx].iov_len += xcb_block_len;
7913 xcb_block_len = xcb_parts[xcb_parts_idx].iov_len;
7914 xcb_parts_idx++;
7915 xcb_align_to = ALIGNOF(xcb_xkb_key_sym_map_t);
7917 if(present & XCB_XKB_MAP_PART_KEY_ACTIONS) {
7918 /* insert padding */
7919 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
7920 xcb_buffer_len += xcb_block_len + xcb_pad;
7921 if (0 != xcb_pad) {
7922 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
7923 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
7924 xcb_parts_idx++;
7925 xcb_pad = 0;
7927 xcb_block_len = 0;
7928 /* acts_rtrn_count */
7929 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->acts_rtrn_count;
7930 xcb_block_len += nKeyActions * sizeof(xcb_keycode_t);
7931 xcb_parts[xcb_parts_idx].iov_len = nKeyActions * sizeof(xcb_keycode_t);
7932 xcb_parts_idx++;
7933 xcb_align_to = ALIGNOF(uint8_t);
7934 /* insert padding */
7935 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
7936 xcb_buffer_len += xcb_block_len + xcb_pad;
7937 if (0 != xcb_pad) {
7938 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
7939 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
7940 xcb_parts_idx++;
7941 xcb_pad = 0;
7943 xcb_block_len = 0;
7944 /* acts_rtrn_acts */
7945 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->acts_rtrn_acts;
7946 xcb_block_len += totalActions * sizeof(xcb_xkb_action_t);
7947 xcb_parts[xcb_parts_idx].iov_len = totalActions * sizeof(xcb_xkb_action_t);
7948 xcb_parts_idx++;
7949 xcb_align_to = ALIGNOF(xcb_xkb_action_t);
7951 if(present & XCB_XKB_MAP_PART_KEY_BEHAVIORS) {
7952 /* insert padding */
7953 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
7954 xcb_buffer_len += xcb_block_len + xcb_pad;
7955 if (0 != xcb_pad) {
7956 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
7957 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
7958 xcb_parts_idx++;
7959 xcb_pad = 0;
7961 xcb_block_len = 0;
7962 /* behaviors_rtrn */
7963 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->behaviors_rtrn;
7964 xcb_block_len += totalKeyBehaviors * sizeof(xcb_xkb_set_behavior_t);
7965 xcb_parts[xcb_parts_idx].iov_len = totalKeyBehaviors * sizeof(xcb_xkb_set_behavior_t);
7966 xcb_parts_idx++;
7967 xcb_align_to = ALIGNOF(xcb_xkb_set_behavior_t);
7969 if(present & XCB_XKB_MAP_PART_VIRTUAL_MODS) {
7970 /* insert padding */
7971 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
7972 xcb_buffer_len += xcb_block_len + xcb_pad;
7973 if (0 != xcb_pad) {
7974 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
7975 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
7976 xcb_parts_idx++;
7977 xcb_pad = 0;
7979 xcb_block_len = 0;
7980 /* vmods_rtrn */
7981 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->vmods_rtrn;
7982 xcb_block_len += xcb_popcount(virtualMods) * sizeof(xcb_keycode_t);
7983 xcb_parts[xcb_parts_idx].iov_len = xcb_popcount(virtualMods) * sizeof(xcb_keycode_t);
7984 xcb_parts_idx++;
7985 xcb_align_to = ALIGNOF(uint8_t);
7987 if(present & XCB_XKB_MAP_PART_EXPLICIT_COMPONENTS) {
7988 /* insert padding */
7989 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
7990 xcb_buffer_len += xcb_block_len + xcb_pad;
7991 if (0 != xcb_pad) {
7992 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
7993 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
7994 xcb_parts_idx++;
7995 xcb_pad = 0;
7997 xcb_block_len = 0;
7998 /* explicit_rtrn */
7999 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->explicit_rtrn;
8000 xcb_block_len += totalKeyExplicit * sizeof(xcb_xkb_set_explicit_t);
8001 xcb_parts[xcb_parts_idx].iov_len = totalKeyExplicit * sizeof(xcb_xkb_set_explicit_t);
8002 xcb_parts_idx++;
8003 xcb_align_to = ALIGNOF(xcb_xkb_set_explicit_t);
8005 if(present & XCB_XKB_MAP_PART_MODIFIER_MAP) {
8006 /* insert padding */
8007 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8008 xcb_buffer_len += xcb_block_len + xcb_pad;
8009 if (0 != xcb_pad) {
8010 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
8011 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
8012 xcb_parts_idx++;
8013 xcb_pad = 0;
8015 xcb_block_len = 0;
8016 /* modmap_rtrn */
8017 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->modmap_rtrn;
8018 xcb_block_len += totalModMapKeys * sizeof(xcb_xkb_key_mod_map_t);
8019 xcb_parts[xcb_parts_idx].iov_len = totalModMapKeys * sizeof(xcb_xkb_key_mod_map_t);
8020 xcb_parts_idx++;
8021 xcb_align_to = ALIGNOF(xcb_xkb_key_mod_map_t);
8023 if(present & XCB_XKB_MAP_PART_VIRTUAL_MOD_MAP) {
8024 /* insert padding */
8025 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8026 xcb_buffer_len += xcb_block_len + xcb_pad;
8027 if (0 != xcb_pad) {
8028 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
8029 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
8030 xcb_parts_idx++;
8031 xcb_pad = 0;
8033 xcb_block_len = 0;
8034 /* vmodmap_rtrn */
8035 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->vmodmap_rtrn;
8036 xcb_block_len += totalVModMapKeys * sizeof(xcb_xkb_key_v_mod_map_t);
8037 xcb_parts[xcb_parts_idx].iov_len = totalVModMapKeys * sizeof(xcb_xkb_key_v_mod_map_t);
8038 xcb_parts_idx++;
8039 xcb_align_to = ALIGNOF(xcb_xkb_key_v_mod_map_t);
8041 /* insert padding */
8042 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8043 xcb_buffer_len += xcb_block_len + xcb_pad;
8044 if (0 != xcb_pad) {
8045 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
8046 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
8047 xcb_parts_idx++;
8048 xcb_pad = 0;
8050 xcb_block_len = 0;
8052 if (NULL == xcb_out) {
8053 /* allocate memory */
8054 xcb_out = malloc(xcb_buffer_len);
8055 *_buffer = xcb_out;
8058 xcb_tmp = xcb_out;
8059 for(i=0; i<xcb_parts_idx; i++) {
8060 if (0 != xcb_parts[i].iov_base && 0 != xcb_parts[i].iov_len)
8061 memcpy(xcb_tmp, xcb_parts[i].iov_base, xcb_parts[i].iov_len);
8062 if (0 != xcb_parts[i].iov_len)
8063 xcb_tmp += xcb_parts[i].iov_len;
8066 return xcb_buffer_len;
8070 xcb_xkb_get_kbd_by_name_replies_types_map_unpack (const void *_buffer /**< */,
8071 uint8_t nTypes /**< */,
8072 uint8_t nKeySyms /**< */,
8073 uint8_t nKeyActions /**< */,
8074 uint16_t totalActions /**< */,
8075 uint8_t totalKeyBehaviors /**< */,
8076 uint16_t virtualMods /**< */,
8077 uint8_t totalKeyExplicit /**< */,
8078 uint8_t totalModMapKeys /**< */,
8079 uint8_t totalVModMapKeys /**< */,
8080 uint16_t present /**< */,
8081 xcb_xkb_get_kbd_by_name_replies_types_map_t *_aux /**< */)
8083 char *xcb_tmp = (char *)_buffer;
8084 unsigned int xcb_buffer_len = 0;
8085 unsigned int xcb_block_len = 0;
8086 unsigned int xcb_pad = 0;
8087 unsigned int xcb_align_to = 0;
8089 unsigned int i;
8090 unsigned int xcb_tmp_len;
8092 if(present & XCB_XKB_MAP_PART_KEY_TYPES) {
8093 /* insert padding */
8094 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8095 xcb_buffer_len += xcb_block_len + xcb_pad;
8096 if (0 != xcb_pad) {
8097 xcb_tmp += xcb_pad;
8098 xcb_pad = 0;
8100 xcb_block_len = 0;
8101 /* types_rtrn */
8102 _aux->types_rtrn = (xcb_xkb_key_type_t *)xcb_tmp;
8103 for(i=0; i<nTypes; i++) {
8104 xcb_tmp_len = xcb_xkb_key_type_sizeof(xcb_tmp);
8105 xcb_block_len += xcb_tmp_len;
8106 xcb_tmp += xcb_tmp_len;
8108 xcb_align_to = ALIGNOF(xcb_xkb_key_type_t);
8110 if(present & XCB_XKB_MAP_PART_KEY_SYMS) {
8111 /* insert padding */
8112 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8113 xcb_buffer_len += xcb_block_len + xcb_pad;
8114 if (0 != xcb_pad) {
8115 xcb_tmp += xcb_pad;
8116 xcb_pad = 0;
8118 xcb_block_len = 0;
8119 /* syms_rtrn */
8120 _aux->syms_rtrn = (xcb_xkb_key_sym_map_t *)xcb_tmp;
8121 for(i=0; i<nKeySyms; i++) {
8122 xcb_tmp_len = xcb_xkb_key_sym_map_sizeof(xcb_tmp);
8123 xcb_block_len += xcb_tmp_len;
8124 xcb_tmp += xcb_tmp_len;
8126 xcb_align_to = ALIGNOF(xcb_xkb_key_sym_map_t);
8128 if(present & XCB_XKB_MAP_PART_KEY_ACTIONS) {
8129 /* insert padding */
8130 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8131 xcb_buffer_len += xcb_block_len + xcb_pad;
8132 if (0 != xcb_pad) {
8133 xcb_tmp += xcb_pad;
8134 xcb_pad = 0;
8136 xcb_block_len = 0;
8137 /* acts_rtrn_count */
8138 _aux->acts_rtrn_count = (uint8_t *)xcb_tmp;
8139 xcb_block_len += nKeyActions * sizeof(xcb_keycode_t);
8140 xcb_tmp += xcb_block_len;
8141 xcb_align_to = ALIGNOF(uint8_t);
8142 /* insert padding */
8143 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8144 xcb_buffer_len += xcb_block_len + xcb_pad;
8145 if (0 != xcb_pad) {
8146 xcb_tmp += xcb_pad;
8147 xcb_pad = 0;
8149 xcb_block_len = 0;
8150 /* acts_rtrn_acts */
8151 _aux->acts_rtrn_acts = (xcb_xkb_action_t *)xcb_tmp;
8152 xcb_block_len += totalActions * sizeof(xcb_xkb_action_t);
8153 xcb_tmp += xcb_block_len;
8154 xcb_align_to = ALIGNOF(xcb_xkb_action_t);
8156 if(present & XCB_XKB_MAP_PART_KEY_BEHAVIORS) {
8157 /* insert padding */
8158 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8159 xcb_buffer_len += xcb_block_len + xcb_pad;
8160 if (0 != xcb_pad) {
8161 xcb_tmp += xcb_pad;
8162 xcb_pad = 0;
8164 xcb_block_len = 0;
8165 /* behaviors_rtrn */
8166 _aux->behaviors_rtrn = (xcb_xkb_set_behavior_t *)xcb_tmp;
8167 xcb_block_len += totalKeyBehaviors * sizeof(xcb_xkb_set_behavior_t);
8168 xcb_tmp += xcb_block_len;
8169 xcb_align_to = ALIGNOF(xcb_xkb_set_behavior_t);
8171 if(present & XCB_XKB_MAP_PART_VIRTUAL_MODS) {
8172 /* insert padding */
8173 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8174 xcb_buffer_len += xcb_block_len + xcb_pad;
8175 if (0 != xcb_pad) {
8176 xcb_tmp += xcb_pad;
8177 xcb_pad = 0;
8179 xcb_block_len = 0;
8180 /* vmods_rtrn */
8181 _aux->vmods_rtrn = (uint8_t *)xcb_tmp;
8182 xcb_block_len += xcb_popcount(virtualMods) * sizeof(xcb_keycode_t);
8183 xcb_tmp += xcb_block_len;
8184 xcb_align_to = ALIGNOF(uint8_t);
8186 if(present & XCB_XKB_MAP_PART_EXPLICIT_COMPONENTS) {
8187 /* insert padding */
8188 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8189 xcb_buffer_len += xcb_block_len + xcb_pad;
8190 if (0 != xcb_pad) {
8191 xcb_tmp += xcb_pad;
8192 xcb_pad = 0;
8194 xcb_block_len = 0;
8195 /* explicit_rtrn */
8196 _aux->explicit_rtrn = (xcb_xkb_set_explicit_t *)xcb_tmp;
8197 xcb_block_len += totalKeyExplicit * sizeof(xcb_xkb_set_explicit_t);
8198 xcb_tmp += xcb_block_len;
8199 xcb_align_to = ALIGNOF(xcb_xkb_set_explicit_t);
8201 if(present & XCB_XKB_MAP_PART_MODIFIER_MAP) {
8202 /* insert padding */
8203 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8204 xcb_buffer_len += xcb_block_len + xcb_pad;
8205 if (0 != xcb_pad) {
8206 xcb_tmp += xcb_pad;
8207 xcb_pad = 0;
8209 xcb_block_len = 0;
8210 /* modmap_rtrn */
8211 _aux->modmap_rtrn = (xcb_xkb_key_mod_map_t *)xcb_tmp;
8212 xcb_block_len += totalModMapKeys * sizeof(xcb_xkb_key_mod_map_t);
8213 xcb_tmp += xcb_block_len;
8214 xcb_align_to = ALIGNOF(xcb_xkb_key_mod_map_t);
8216 if(present & XCB_XKB_MAP_PART_VIRTUAL_MOD_MAP) {
8217 /* insert padding */
8218 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8219 xcb_buffer_len += xcb_block_len + xcb_pad;
8220 if (0 != xcb_pad) {
8221 xcb_tmp += xcb_pad;
8222 xcb_pad = 0;
8224 xcb_block_len = 0;
8225 /* vmodmap_rtrn */
8226 _aux->vmodmap_rtrn = (xcb_xkb_key_v_mod_map_t *)xcb_tmp;
8227 xcb_block_len += totalVModMapKeys * sizeof(xcb_xkb_key_v_mod_map_t);
8228 xcb_tmp += xcb_block_len;
8229 xcb_align_to = ALIGNOF(xcb_xkb_key_v_mod_map_t);
8231 /* insert padding */
8232 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8233 xcb_buffer_len += xcb_block_len + xcb_pad;
8234 if (0 != xcb_pad) {
8235 xcb_tmp += xcb_pad;
8236 xcb_pad = 0;
8238 xcb_block_len = 0;
8240 return xcb_buffer_len;
8244 xcb_xkb_get_kbd_by_name_replies_types_map_sizeof (const void *_buffer /**< */,
8245 uint8_t nTypes /**< */,
8246 uint8_t nKeySyms /**< */,
8247 uint8_t nKeyActions /**< */,
8248 uint16_t totalActions /**< */,
8249 uint8_t totalKeyBehaviors /**< */,
8250 uint16_t virtualMods /**< */,
8251 uint8_t totalKeyExplicit /**< */,
8252 uint8_t totalModMapKeys /**< */,
8253 uint8_t totalVModMapKeys /**< */,
8254 uint16_t present /**< */)
8256 xcb_xkb_get_kbd_by_name_replies_types_map_t _aux;
8257 return xcb_xkb_get_kbd_by_name_replies_types_map_unpack(_buffer, nTypes, nKeySyms, nKeyActions, totalActions, totalKeyBehaviors, virtualMods, totalKeyExplicit, totalModMapKeys, totalVModMapKeys, present, &_aux);
8260 xcb_atom_t *
8261 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_type_names (const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
8263 return /* replies */ S->key_names.valueList.typeNames;
8267 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_type_names_length (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */,
8268 const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
8270 return /* replies */ S->key_names.nTypes;
8273 xcb_generic_iterator_t
8274 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_type_names_end (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */,
8275 const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
8277 xcb_generic_iterator_t i;
8278 i.data = /* replies */ S->key_names.valueList.typeNames + /* replies */ S->key_names.nTypes;
8279 i.rem = 0;
8280 i.index = (char *) i.data - (char *) S;
8281 return i;
8284 uint8_t *
8285 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_n_levels_per_type (const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
8287 return /* replies */ S->key_names.valueList.nLevelsPerType;
8291 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_n_levels_per_type_length (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */,
8292 const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
8294 return /* replies */ S->key_names.nTypes;
8297 xcb_generic_iterator_t
8298 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_n_levels_per_type_end (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */,
8299 const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
8301 xcb_generic_iterator_t i;
8302 i.data = /* replies */ S->key_names.valueList.nLevelsPerType + /* replies */ S->key_names.nTypes;
8303 i.rem = 0;
8304 i.index = (char *) i.data - (char *) S;
8305 return i;
8308 xcb_atom_t *
8309 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_kt_level_names (const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
8311 return /* replies */ S->key_names.valueList.ktLevelNames;
8315 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_kt_level_names_length (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */,
8316 const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
8318 return xcb_sumof(/* replies */ S->key_names.valueList.nLevelsPerType, /* replies */ S->key_names.nTypes);
8321 xcb_generic_iterator_t
8322 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_kt_level_names_end (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */,
8323 const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
8325 xcb_generic_iterator_t i;
8326 i.data = /* replies */ S->key_names.valueList.ktLevelNames + xcb_sumof(/* replies */ S->key_names.valueList.nLevelsPerType, /* replies */ S->key_names.nTypes);
8327 i.rem = 0;
8328 i.index = (char *) i.data - (char *) S;
8329 return i;
8332 xcb_atom_t *
8333 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_indicator_names (const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
8335 return /* replies */ S->key_names.valueList.indicatorNames;
8339 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_indicator_names_length (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */,
8340 const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
8342 return xcb_popcount(/* replies */ S->key_names.indicators);
8345 xcb_generic_iterator_t
8346 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_indicator_names_end (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */,
8347 const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
8349 xcb_generic_iterator_t i;
8350 i.data = /* replies */ S->key_names.valueList.indicatorNames + xcb_popcount(/* replies */ S->key_names.indicators);
8351 i.rem = 0;
8352 i.index = (char *) i.data - (char *) S;
8353 return i;
8356 xcb_atom_t *
8357 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_virtual_mod_names (const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
8359 return /* replies */ S->key_names.valueList.virtualModNames;
8363 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_virtual_mod_names_length (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */,
8364 const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
8366 return xcb_popcount(/* replies */ S->key_names.virtualMods);
8369 xcb_generic_iterator_t
8370 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_virtual_mod_names_end (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */,
8371 const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
8373 xcb_generic_iterator_t i;
8374 i.data = /* replies */ S->key_names.valueList.virtualModNames + xcb_popcount(/* replies */ S->key_names.virtualMods);
8375 i.rem = 0;
8376 i.index = (char *) i.data - (char *) S;
8377 return i;
8380 xcb_atom_t *
8381 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_groups (const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
8383 return /* replies */ S->key_names.valueList.groups;
8387 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_groups_length (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */,
8388 const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
8390 return xcb_popcount(/* replies */ S->key_names.groupNames);
8393 xcb_generic_iterator_t
8394 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_groups_end (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */,
8395 const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
8397 xcb_generic_iterator_t i;
8398 i.data = /* replies */ S->key_names.valueList.groups + xcb_popcount(/* replies */ S->key_names.groupNames);
8399 i.rem = 0;
8400 i.index = (char *) i.data - (char *) S;
8401 return i;
8404 xcb_xkb_key_name_t *
8405 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_key_names (const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
8407 return /* replies */ S->key_names.valueList.keyNames;
8411 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_key_names_length (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */,
8412 const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
8414 return /* replies */ S->key_names.nKeys;
8417 xcb_xkb_key_name_iterator_t
8418 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_key_names_iterator (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */,
8419 const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
8421 xcb_xkb_key_name_iterator_t i;
8422 i.data = /* replies */ S->key_names.valueList.keyNames;
8423 i.rem = /* replies */ S->key_names.nKeys;
8424 i.index = (char *) i.data - (char *) S;
8425 return i;
8428 xcb_xkb_key_alias_t *
8429 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_key_aliases (const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
8431 return /* replies */ S->key_names.valueList.keyAliases;
8435 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_key_aliases_length (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */,
8436 const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
8438 return /* replies */ S->key_names.nKeyAliases;
8441 xcb_xkb_key_alias_iterator_t
8442 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_key_aliases_iterator (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */,
8443 const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
8445 xcb_xkb_key_alias_iterator_t i;
8446 i.data = /* replies */ S->key_names.valueList.keyAliases;
8447 i.rem = /* replies */ S->key_names.nKeyAliases;
8448 i.index = (char *) i.data - (char *) S;
8449 return i;
8452 xcb_atom_t *
8453 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_radio_group_names (const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
8455 return /* replies */ S->key_names.valueList.radioGroupNames;
8459 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_radio_group_names_length (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */,
8460 const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
8462 return /* replies */ S->key_names.nRadioGroups;
8465 xcb_generic_iterator_t
8466 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_radio_group_names_end (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */,
8467 const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
8469 xcb_generic_iterator_t i;
8470 i.data = /* replies */ S->key_names.valueList.radioGroupNames + /* replies */ S->key_names.nRadioGroups;
8471 i.rem = 0;
8472 i.index = (char *) i.data - (char *) S;
8473 return i;
8477 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_serialize (void **_buffer /**< */,
8478 uint8_t nTypes /**< */,
8479 uint32_t indicators /**< */,
8480 uint16_t virtualMods /**< */,
8481 uint8_t groupNames /**< */,
8482 uint8_t nKeys /**< */,
8483 uint8_t nKeyAliases /**< */,
8484 uint8_t nRadioGroups /**< */,
8485 uint32_t which /**< */,
8486 const xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t *_aux /**< */)
8488 char *xcb_out = *_buffer;
8489 unsigned int xcb_buffer_len = 0;
8490 unsigned int xcb_align_to = 0;
8492 unsigned int xcb_pad = 0;
8493 char xcb_pad0[3] = {0, 0, 0};
8494 struct iovec xcb_parts[25];
8495 unsigned int xcb_parts_idx = 0;
8496 unsigned int xcb_block_len = 0;
8497 unsigned int i;
8498 char *xcb_tmp;
8500 if(which & XCB_XKB_NAME_DETAIL_KEYCODES) {
8501 /* xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t.keycodesName */
8502 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->keycodesName;
8503 xcb_block_len += sizeof(xcb_atom_t);
8504 xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t);
8505 xcb_parts_idx++;
8506 xcb_align_to = ALIGNOF(xcb_atom_t);
8508 if(which & XCB_XKB_NAME_DETAIL_GEOMETRY) {
8509 /* xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t.geometryName */
8510 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometryName;
8511 xcb_block_len += sizeof(xcb_atom_t);
8512 xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t);
8513 xcb_parts_idx++;
8514 xcb_align_to = ALIGNOF(xcb_atom_t);
8516 if(which & XCB_XKB_NAME_DETAIL_SYMBOLS) {
8517 /* xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t.symbolsName */
8518 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->symbolsName;
8519 xcb_block_len += sizeof(xcb_atom_t);
8520 xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t);
8521 xcb_parts_idx++;
8522 xcb_align_to = ALIGNOF(xcb_atom_t);
8524 if(which & XCB_XKB_NAME_DETAIL_PHYS_SYMBOLS) {
8525 /* xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t.physSymbolsName */
8526 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->physSymbolsName;
8527 xcb_block_len += sizeof(xcb_atom_t);
8528 xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t);
8529 xcb_parts_idx++;
8530 xcb_align_to = ALIGNOF(xcb_atom_t);
8532 if(which & XCB_XKB_NAME_DETAIL_TYPES) {
8533 /* xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t.typesName */
8534 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->typesName;
8535 xcb_block_len += sizeof(xcb_atom_t);
8536 xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t);
8537 xcb_parts_idx++;
8538 xcb_align_to = ALIGNOF(xcb_atom_t);
8540 if(which & XCB_XKB_NAME_DETAIL_COMPAT) {
8541 /* xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t.compatName */
8542 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->compatName;
8543 xcb_block_len += sizeof(xcb_atom_t);
8544 xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t);
8545 xcb_parts_idx++;
8546 xcb_align_to = ALIGNOF(xcb_atom_t);
8548 if(which & XCB_XKB_NAME_DETAIL_KEY_TYPE_NAMES) {
8549 /* insert padding */
8550 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8551 xcb_buffer_len += xcb_block_len + xcb_pad;
8552 if (0 != xcb_pad) {
8553 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
8554 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
8555 xcb_parts_idx++;
8556 xcb_pad = 0;
8558 xcb_block_len = 0;
8559 /* typeNames */
8560 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->typeNames;
8561 xcb_block_len += nTypes * sizeof(xcb_atom_t);
8562 xcb_parts[xcb_parts_idx].iov_len = nTypes * sizeof(xcb_atom_t);
8563 xcb_parts_idx++;
8564 xcb_align_to = ALIGNOF(xcb_atom_t);
8566 if(which & XCB_XKB_NAME_DETAIL_KT_LEVEL_NAMES) {
8567 /* insert padding */
8568 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8569 xcb_buffer_len += xcb_block_len + xcb_pad;
8570 if (0 != xcb_pad) {
8571 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
8572 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
8573 xcb_parts_idx++;
8574 xcb_pad = 0;
8576 xcb_block_len = 0;
8577 /* nLevelsPerType */
8578 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->nLevelsPerType;
8579 xcb_block_len += nTypes * sizeof(uint8_t);
8580 xcb_parts[xcb_parts_idx].iov_len = nTypes * sizeof(uint8_t);
8581 xcb_parts_idx++;
8582 xcb_align_to = ALIGNOF(uint8_t);
8583 /* insert padding */
8584 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8585 xcb_buffer_len += xcb_block_len + xcb_pad;
8586 if (0 != xcb_pad) {
8587 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
8588 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
8589 xcb_parts_idx++;
8590 xcb_pad = 0;
8592 xcb_block_len = 0;
8593 /* ktLevelNames */
8594 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->ktLevelNames;
8595 xcb_block_len += xcb_sumof(_aux->nLevelsPerType, nTypes) * sizeof(xcb_atom_t);
8596 xcb_parts[xcb_parts_idx].iov_len = xcb_sumof(_aux->nLevelsPerType, nTypes) * sizeof(xcb_atom_t);
8597 xcb_parts_idx++;
8598 xcb_align_to = ALIGNOF(xcb_atom_t);
8600 if(which & XCB_XKB_NAME_DETAIL_INDICATOR_NAMES) {
8601 /* insert padding */
8602 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8603 xcb_buffer_len += xcb_block_len + xcb_pad;
8604 if (0 != xcb_pad) {
8605 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
8606 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
8607 xcb_parts_idx++;
8608 xcb_pad = 0;
8610 xcb_block_len = 0;
8611 /* indicatorNames */
8612 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->indicatorNames;
8613 xcb_block_len += xcb_popcount(indicators) * sizeof(xcb_atom_t);
8614 xcb_parts[xcb_parts_idx].iov_len = xcb_popcount(indicators) * sizeof(xcb_atom_t);
8615 xcb_parts_idx++;
8616 xcb_align_to = ALIGNOF(xcb_atom_t);
8618 if(which & XCB_XKB_NAME_DETAIL_VIRTUAL_MOD_NAMES) {
8619 /* insert padding */
8620 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8621 xcb_buffer_len += xcb_block_len + xcb_pad;
8622 if (0 != xcb_pad) {
8623 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
8624 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
8625 xcb_parts_idx++;
8626 xcb_pad = 0;
8628 xcb_block_len = 0;
8629 /* virtualModNames */
8630 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->virtualModNames;
8631 xcb_block_len += xcb_popcount(virtualMods) * sizeof(xcb_atom_t);
8632 xcb_parts[xcb_parts_idx].iov_len = xcb_popcount(virtualMods) * sizeof(xcb_atom_t);
8633 xcb_parts_idx++;
8634 xcb_align_to = ALIGNOF(xcb_atom_t);
8636 if(which & XCB_XKB_NAME_DETAIL_GROUP_NAMES) {
8637 /* insert padding */
8638 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8639 xcb_buffer_len += xcb_block_len + xcb_pad;
8640 if (0 != xcb_pad) {
8641 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
8642 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
8643 xcb_parts_idx++;
8644 xcb_pad = 0;
8646 xcb_block_len = 0;
8647 /* groups */
8648 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->groups;
8649 xcb_block_len += xcb_popcount(groupNames) * sizeof(xcb_atom_t);
8650 xcb_parts[xcb_parts_idx].iov_len = xcb_popcount(groupNames) * sizeof(xcb_atom_t);
8651 xcb_parts_idx++;
8652 xcb_align_to = ALIGNOF(xcb_atom_t);
8654 if(which & XCB_XKB_NAME_DETAIL_KEY_NAMES) {
8655 /* insert padding */
8656 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8657 xcb_buffer_len += xcb_block_len + xcb_pad;
8658 if (0 != xcb_pad) {
8659 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
8660 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
8661 xcb_parts_idx++;
8662 xcb_pad = 0;
8664 xcb_block_len = 0;
8665 /* keyNames */
8666 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->keyNames;
8667 xcb_block_len += nKeys * sizeof(xcb_xkb_key_name_t);
8668 xcb_parts[xcb_parts_idx].iov_len = nKeys * sizeof(xcb_xkb_key_name_t);
8669 xcb_parts_idx++;
8670 xcb_align_to = ALIGNOF(xcb_xkb_key_name_t);
8672 if(which & XCB_XKB_NAME_DETAIL_KEY_ALIASES) {
8673 /* insert padding */
8674 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8675 xcb_buffer_len += xcb_block_len + xcb_pad;
8676 if (0 != xcb_pad) {
8677 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
8678 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
8679 xcb_parts_idx++;
8680 xcb_pad = 0;
8682 xcb_block_len = 0;
8683 /* keyAliases */
8684 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->keyAliases;
8685 xcb_block_len += nKeyAliases * sizeof(xcb_xkb_key_alias_t);
8686 xcb_parts[xcb_parts_idx].iov_len = nKeyAliases * sizeof(xcb_xkb_key_alias_t);
8687 xcb_parts_idx++;
8688 xcb_align_to = ALIGNOF(xcb_xkb_key_alias_t);
8690 if(which & XCB_XKB_NAME_DETAIL_RG_NAMES) {
8691 /* insert padding */
8692 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8693 xcb_buffer_len += xcb_block_len + xcb_pad;
8694 if (0 != xcb_pad) {
8695 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
8696 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
8697 xcb_parts_idx++;
8698 xcb_pad = 0;
8700 xcb_block_len = 0;
8701 /* radioGroupNames */
8702 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->radioGroupNames;
8703 xcb_block_len += nRadioGroups * sizeof(xcb_atom_t);
8704 xcb_parts[xcb_parts_idx].iov_len = nRadioGroups * sizeof(xcb_atom_t);
8705 xcb_parts_idx++;
8706 xcb_align_to = ALIGNOF(xcb_atom_t);
8708 /* insert padding */
8709 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8710 xcb_buffer_len += xcb_block_len + xcb_pad;
8711 if (0 != xcb_pad) {
8712 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
8713 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
8714 xcb_parts_idx++;
8715 xcb_pad = 0;
8717 xcb_block_len = 0;
8719 if (NULL == xcb_out) {
8720 /* allocate memory */
8721 xcb_out = malloc(xcb_buffer_len);
8722 *_buffer = xcb_out;
8725 xcb_tmp = xcb_out;
8726 for(i=0; i<xcb_parts_idx; i++) {
8727 if (0 != xcb_parts[i].iov_base && 0 != xcb_parts[i].iov_len)
8728 memcpy(xcb_tmp, xcb_parts[i].iov_base, xcb_parts[i].iov_len);
8729 if (0 != xcb_parts[i].iov_len)
8730 xcb_tmp += xcb_parts[i].iov_len;
8733 return xcb_buffer_len;
8737 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_unpack (const void *_buffer /**< */,
8738 uint8_t nTypes /**< */,
8739 uint32_t indicators /**< */,
8740 uint16_t virtualMods /**< */,
8741 uint8_t groupNames /**< */,
8742 uint8_t nKeys /**< */,
8743 uint8_t nKeyAliases /**< */,
8744 uint8_t nRadioGroups /**< */,
8745 uint32_t which /**< */,
8746 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t *_aux /**< */)
8748 char *xcb_tmp = (char *)_buffer;
8749 unsigned int xcb_buffer_len = 0;
8750 unsigned int xcb_block_len = 0;
8751 unsigned int xcb_pad = 0;
8752 unsigned int xcb_align_to = 0;
8755 if(which & XCB_XKB_NAME_DETAIL_KEYCODES) {
8756 /* xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t.keycodesName */
8757 _aux->keycodesName = *(xcb_atom_t *)xcb_tmp;
8758 xcb_block_len += sizeof(xcb_atom_t);
8759 xcb_tmp += sizeof(xcb_atom_t);
8760 xcb_align_to = ALIGNOF(xcb_atom_t);
8762 if(which & XCB_XKB_NAME_DETAIL_GEOMETRY) {
8763 /* xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t.geometryName */
8764 _aux->geometryName = *(xcb_atom_t *)xcb_tmp;
8765 xcb_block_len += sizeof(xcb_atom_t);
8766 xcb_tmp += sizeof(xcb_atom_t);
8767 xcb_align_to = ALIGNOF(xcb_atom_t);
8769 if(which & XCB_XKB_NAME_DETAIL_SYMBOLS) {
8770 /* xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t.symbolsName */
8771 _aux->symbolsName = *(xcb_atom_t *)xcb_tmp;
8772 xcb_block_len += sizeof(xcb_atom_t);
8773 xcb_tmp += sizeof(xcb_atom_t);
8774 xcb_align_to = ALIGNOF(xcb_atom_t);
8776 if(which & XCB_XKB_NAME_DETAIL_PHYS_SYMBOLS) {
8777 /* xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t.physSymbolsName */
8778 _aux->physSymbolsName = *(xcb_atom_t *)xcb_tmp;
8779 xcb_block_len += sizeof(xcb_atom_t);
8780 xcb_tmp += sizeof(xcb_atom_t);
8781 xcb_align_to = ALIGNOF(xcb_atom_t);
8783 if(which & XCB_XKB_NAME_DETAIL_TYPES) {
8784 /* xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t.typesName */
8785 _aux->typesName = *(xcb_atom_t *)xcb_tmp;
8786 xcb_block_len += sizeof(xcb_atom_t);
8787 xcb_tmp += sizeof(xcb_atom_t);
8788 xcb_align_to = ALIGNOF(xcb_atom_t);
8790 if(which & XCB_XKB_NAME_DETAIL_COMPAT) {
8791 /* xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t.compatName */
8792 _aux->compatName = *(xcb_atom_t *)xcb_tmp;
8793 xcb_block_len += sizeof(xcb_atom_t);
8794 xcb_tmp += sizeof(xcb_atom_t);
8795 xcb_align_to = ALIGNOF(xcb_atom_t);
8797 if(which & XCB_XKB_NAME_DETAIL_KEY_TYPE_NAMES) {
8798 /* insert padding */
8799 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8800 xcb_buffer_len += xcb_block_len + xcb_pad;
8801 if (0 != xcb_pad) {
8802 xcb_tmp += xcb_pad;
8803 xcb_pad = 0;
8805 xcb_block_len = 0;
8806 /* typeNames */
8807 _aux->typeNames = (xcb_atom_t *)xcb_tmp;
8808 xcb_block_len += nTypes * sizeof(xcb_atom_t);
8809 xcb_tmp += xcb_block_len;
8810 xcb_align_to = ALIGNOF(xcb_atom_t);
8812 if(which & XCB_XKB_NAME_DETAIL_KT_LEVEL_NAMES) {
8813 /* insert padding */
8814 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8815 xcb_buffer_len += xcb_block_len + xcb_pad;
8816 if (0 != xcb_pad) {
8817 xcb_tmp += xcb_pad;
8818 xcb_pad = 0;
8820 xcb_block_len = 0;
8821 /* nLevelsPerType */
8822 _aux->nLevelsPerType = (uint8_t *)xcb_tmp;
8823 xcb_block_len += nTypes * sizeof(uint8_t);
8824 xcb_tmp += xcb_block_len;
8825 xcb_align_to = ALIGNOF(uint8_t);
8826 /* insert padding */
8827 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8828 xcb_buffer_len += xcb_block_len + xcb_pad;
8829 if (0 != xcb_pad) {
8830 xcb_tmp += xcb_pad;
8831 xcb_pad = 0;
8833 xcb_block_len = 0;
8834 /* ktLevelNames */
8835 _aux->ktLevelNames = (xcb_atom_t *)xcb_tmp;
8836 xcb_block_len += xcb_sumof(_aux->nLevelsPerType, nTypes) * sizeof(xcb_atom_t);
8837 xcb_tmp += xcb_block_len;
8838 xcb_align_to = ALIGNOF(xcb_atom_t);
8840 if(which & XCB_XKB_NAME_DETAIL_INDICATOR_NAMES) {
8841 /* insert padding */
8842 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8843 xcb_buffer_len += xcb_block_len + xcb_pad;
8844 if (0 != xcb_pad) {
8845 xcb_tmp += xcb_pad;
8846 xcb_pad = 0;
8848 xcb_block_len = 0;
8849 /* indicatorNames */
8850 _aux->indicatorNames = (xcb_atom_t *)xcb_tmp;
8851 xcb_block_len += xcb_popcount(indicators) * sizeof(xcb_atom_t);
8852 xcb_tmp += xcb_block_len;
8853 xcb_align_to = ALIGNOF(xcb_atom_t);
8855 if(which & XCB_XKB_NAME_DETAIL_VIRTUAL_MOD_NAMES) {
8856 /* insert padding */
8857 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8858 xcb_buffer_len += xcb_block_len + xcb_pad;
8859 if (0 != xcb_pad) {
8860 xcb_tmp += xcb_pad;
8861 xcb_pad = 0;
8863 xcb_block_len = 0;
8864 /* virtualModNames */
8865 _aux->virtualModNames = (xcb_atom_t *)xcb_tmp;
8866 xcb_block_len += xcb_popcount(virtualMods) * sizeof(xcb_atom_t);
8867 xcb_tmp += xcb_block_len;
8868 xcb_align_to = ALIGNOF(xcb_atom_t);
8870 if(which & XCB_XKB_NAME_DETAIL_GROUP_NAMES) {
8871 /* insert padding */
8872 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8873 xcb_buffer_len += xcb_block_len + xcb_pad;
8874 if (0 != xcb_pad) {
8875 xcb_tmp += xcb_pad;
8876 xcb_pad = 0;
8878 xcb_block_len = 0;
8879 /* groups */
8880 _aux->groups = (xcb_atom_t *)xcb_tmp;
8881 xcb_block_len += xcb_popcount(groupNames) * sizeof(xcb_atom_t);
8882 xcb_tmp += xcb_block_len;
8883 xcb_align_to = ALIGNOF(xcb_atom_t);
8885 if(which & XCB_XKB_NAME_DETAIL_KEY_NAMES) {
8886 /* insert padding */
8887 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8888 xcb_buffer_len += xcb_block_len + xcb_pad;
8889 if (0 != xcb_pad) {
8890 xcb_tmp += xcb_pad;
8891 xcb_pad = 0;
8893 xcb_block_len = 0;
8894 /* keyNames */
8895 _aux->keyNames = (xcb_xkb_key_name_t *)xcb_tmp;
8896 xcb_block_len += nKeys * sizeof(xcb_xkb_key_name_t);
8897 xcb_tmp += xcb_block_len;
8898 xcb_align_to = ALIGNOF(xcb_xkb_key_name_t);
8900 if(which & XCB_XKB_NAME_DETAIL_KEY_ALIASES) {
8901 /* insert padding */
8902 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8903 xcb_buffer_len += xcb_block_len + xcb_pad;
8904 if (0 != xcb_pad) {
8905 xcb_tmp += xcb_pad;
8906 xcb_pad = 0;
8908 xcb_block_len = 0;
8909 /* keyAliases */
8910 _aux->keyAliases = (xcb_xkb_key_alias_t *)xcb_tmp;
8911 xcb_block_len += nKeyAliases * sizeof(xcb_xkb_key_alias_t);
8912 xcb_tmp += xcb_block_len;
8913 xcb_align_to = ALIGNOF(xcb_xkb_key_alias_t);
8915 if(which & XCB_XKB_NAME_DETAIL_RG_NAMES) {
8916 /* insert padding */
8917 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8918 xcb_buffer_len += xcb_block_len + xcb_pad;
8919 if (0 != xcb_pad) {
8920 xcb_tmp += xcb_pad;
8921 xcb_pad = 0;
8923 xcb_block_len = 0;
8924 /* radioGroupNames */
8925 _aux->radioGroupNames = (xcb_atom_t *)xcb_tmp;
8926 xcb_block_len += nRadioGroups * sizeof(xcb_atom_t);
8927 xcb_tmp += xcb_block_len;
8928 xcb_align_to = ALIGNOF(xcb_atom_t);
8930 /* insert padding */
8931 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8932 xcb_buffer_len += xcb_block_len + xcb_pad;
8933 if (0 != xcb_pad) {
8934 xcb_tmp += xcb_pad;
8935 xcb_pad = 0;
8937 xcb_block_len = 0;
8939 return xcb_buffer_len;
8943 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_sizeof (const void *_buffer /**< */,
8944 uint8_t nTypes /**< */,
8945 uint32_t indicators /**< */,
8946 uint16_t virtualMods /**< */,
8947 uint8_t groupNames /**< */,
8948 uint8_t nKeys /**< */,
8949 uint8_t nKeyAliases /**< */,
8950 uint8_t nRadioGroups /**< */,
8951 uint32_t which /**< */)
8953 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t _aux;
8954 return xcb_xkb_get_kbd_by_name_replies_key_names_value_list_unpack(_buffer, nTypes, indicators, virtualMods, groupNames, nKeys, nKeyAliases, nRadioGroups, which, &_aux);
8957 xcb_xkb_get_kbd_by_name_replies_types_map_t *
8958 xcb_xkb_get_kbd_by_name_replies_types_map (const xcb_xkb_get_kbd_by_name_replies_t *R /**< */)
8960 return (xcb_xkb_get_kbd_by_name_replies_types_map_t *) (R + 1);
8963 xcb_xkb_sym_interpret_t *
8964 xcb_xkb_get_kbd_by_name_replies_compat_map_si_rtrn (const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
8966 return /* replies */ S->compat_map.si_rtrn;
8970 xcb_xkb_get_kbd_by_name_replies_compat_map_si_rtrn_length (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */,
8971 const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
8973 return /* replies */ S->compat_map.nSIRtrn;
8976 xcb_xkb_sym_interpret_iterator_t
8977 xcb_xkb_get_kbd_by_name_replies_compat_map_si_rtrn_iterator (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */,
8978 const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
8980 xcb_xkb_sym_interpret_iterator_t i;
8981 i.data = /* replies */ S->compat_map.si_rtrn;
8982 i.rem = /* replies */ S->compat_map.nSIRtrn;
8983 i.index = (char *) i.data - (char *) S;
8984 return i;
8987 xcb_xkb_mod_def_t *
8988 xcb_xkb_get_kbd_by_name_replies_compat_map_group_rtrn (const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
8990 return /* replies */ S->compat_map.group_rtrn;
8994 xcb_xkb_get_kbd_by_name_replies_compat_map_group_rtrn_length (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */,
8995 const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
8997 return xcb_popcount(/* replies */ S->compat_map.groupsRtrn);
9000 xcb_xkb_mod_def_iterator_t
9001 xcb_xkb_get_kbd_by_name_replies_compat_map_group_rtrn_iterator (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */,
9002 const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
9004 xcb_xkb_mod_def_iterator_t i;
9005 i.data = /* replies */ S->compat_map.group_rtrn;
9006 i.rem = xcb_popcount(/* replies */ S->compat_map.groupsRtrn);
9007 i.index = (char *) i.data - (char *) S;
9008 return i;
9011 xcb_xkb_indicator_map_t *
9012 xcb_xkb_get_kbd_by_name_replies_indicator_maps_maps (const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
9014 return /* replies */ S->indicator_maps.maps;
9018 xcb_xkb_get_kbd_by_name_replies_indicator_maps_maps_length (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */,
9019 const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
9021 return /* replies */ S->indicator_maps.nIndicators;
9024 xcb_xkb_indicator_map_iterator_t
9025 xcb_xkb_get_kbd_by_name_replies_indicator_maps_maps_iterator (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */,
9026 const xcb_xkb_get_kbd_by_name_replies_t *S /**< */)
9028 xcb_xkb_indicator_map_iterator_t i;
9029 i.data = /* replies */ S->indicator_maps.maps;
9030 i.rem = /* replies */ S->indicator_maps.nIndicators;
9031 i.index = (char *) i.data - (char *) S;
9032 return i;
9035 xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t *
9036 xcb_xkb_get_kbd_by_name_replies_key_names_value_list (const xcb_xkb_get_kbd_by_name_replies_t *R /**< */)
9038 return (xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t *) (R + 1);
9041 xcb_xkb_counted_string_16_t *
9042 xcb_xkb_get_kbd_by_name_replies_geometry_label_font (const xcb_xkb_get_kbd_by_name_replies_t *R /**< */)
9044 return (xcb_xkb_counted_string_16_t *) (R + 1);
9048 xcb_xkb_get_kbd_by_name_replies_serialize (void **_buffer /**< */,
9049 uint16_t reported /**< */,
9050 const xcb_xkb_get_kbd_by_name_replies_t *_aux /**< */)
9052 char *xcb_out = *_buffer;
9053 unsigned int xcb_buffer_len = 0;
9054 unsigned int xcb_align_to = 0;
9056 unsigned int xcb_pad = 0;
9057 char xcb_pad0[3] = {0, 0, 0};
9058 struct iovec xcb_parts[96];
9059 unsigned int xcb_parts_idx = 0;
9060 unsigned int xcb_block_len = 0;
9061 unsigned int i;
9062 char *xcb_tmp;
9064 if((reported & XCB_XKB_GBN_DETAIL_TYPES) ||
9065 (reported & XCB_XKB_GBN_DETAIL_CLIENT_SYMBOLS) ||
9066 (reported & XCB_XKB_GBN_DETAIL_SERVER_SYMBOLS)) {
9067 /* xcb_xkb_get_kbd_by_name_replies_t.types.getmap_type */
9068 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.getmap_type;
9069 xcb_block_len += sizeof(uint8_t);
9070 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
9071 xcb_parts_idx++;
9072 xcb_align_to = ALIGNOF(uint8_t);
9073 /* xcb_xkb_get_kbd_by_name_replies_t.types.typeDeviceID */
9074 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.typeDeviceID;
9075 xcb_block_len += sizeof(uint8_t);
9076 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
9077 xcb_parts_idx++;
9078 xcb_align_to = ALIGNOF(uint8_t);
9079 /* xcb_xkb_get_kbd_by_name_replies_t.types.getmap_sequence */
9080 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.getmap_sequence;
9081 xcb_block_len += sizeof(uint16_t);
9082 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
9083 xcb_parts_idx++;
9084 xcb_align_to = ALIGNOF(uint16_t);
9085 /* xcb_xkb_get_kbd_by_name_replies_t.types.getmap_length */
9086 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.getmap_length;
9087 xcb_block_len += sizeof(uint32_t);
9088 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t);
9089 xcb_parts_idx++;
9090 xcb_align_to = ALIGNOF(uint32_t);
9091 /* xcb_xkb_get_kbd_by_name_replies_t.types.pad1 */
9092 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
9093 xcb_block_len += sizeof(uint8_t)*2;
9094 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t)*2;
9095 xcb_parts_idx++;
9096 xcb_align_to = ALIGNOF(uint8_t);
9097 /* xcb_xkb_get_kbd_by_name_replies_t.types.typeMinKeyCode */
9098 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.typeMinKeyCode;
9099 xcb_block_len += sizeof(xcb_keycode_t);
9100 xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_keycode_t);
9101 xcb_parts_idx++;
9102 xcb_align_to = ALIGNOF(xcb_keycode_t);
9103 /* xcb_xkb_get_kbd_by_name_replies_t.types.typeMaxKeyCode */
9104 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.typeMaxKeyCode;
9105 xcb_block_len += sizeof(xcb_keycode_t);
9106 xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_keycode_t);
9107 xcb_parts_idx++;
9108 xcb_align_to = ALIGNOF(xcb_keycode_t);
9109 /* xcb_xkb_get_kbd_by_name_replies_t.types.present */
9110 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.present;
9111 xcb_block_len += sizeof(uint16_t);
9112 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
9113 xcb_parts_idx++;
9114 xcb_align_to = ALIGNOF(uint16_t);
9115 /* xcb_xkb_get_kbd_by_name_replies_t.types.firstType */
9116 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.firstType;
9117 xcb_block_len += sizeof(uint8_t);
9118 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
9119 xcb_parts_idx++;
9120 xcb_align_to = ALIGNOF(uint8_t);
9121 /* xcb_xkb_get_kbd_by_name_replies_t.types.nTypes */
9122 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.nTypes;
9123 xcb_block_len += sizeof(uint8_t);
9124 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
9125 xcb_parts_idx++;
9126 xcb_align_to = ALIGNOF(uint8_t);
9127 /* xcb_xkb_get_kbd_by_name_replies_t.types.totalTypes */
9128 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.totalTypes;
9129 xcb_block_len += sizeof(uint8_t);
9130 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
9131 xcb_parts_idx++;
9132 xcb_align_to = ALIGNOF(uint8_t);
9133 /* xcb_xkb_get_kbd_by_name_replies_t.types.firstKeySym */
9134 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.firstKeySym;
9135 xcb_block_len += sizeof(xcb_keycode_t);
9136 xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_keycode_t);
9137 xcb_parts_idx++;
9138 xcb_align_to = ALIGNOF(xcb_keycode_t);
9139 /* xcb_xkb_get_kbd_by_name_replies_t.types.totalSyms */
9140 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.totalSyms;
9141 xcb_block_len += sizeof(uint16_t);
9142 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
9143 xcb_parts_idx++;
9144 xcb_align_to = ALIGNOF(uint16_t);
9145 /* xcb_xkb_get_kbd_by_name_replies_t.types.nKeySyms */
9146 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.nKeySyms;
9147 xcb_block_len += sizeof(uint8_t);
9148 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
9149 xcb_parts_idx++;
9150 xcb_align_to = ALIGNOF(uint8_t);
9151 /* xcb_xkb_get_kbd_by_name_replies_t.types.firstKeyAction */
9152 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.firstKeyAction;
9153 xcb_block_len += sizeof(xcb_keycode_t);
9154 xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_keycode_t);
9155 xcb_parts_idx++;
9156 xcb_align_to = ALIGNOF(xcb_keycode_t);
9157 /* xcb_xkb_get_kbd_by_name_replies_t.types.totalActions */
9158 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.totalActions;
9159 xcb_block_len += sizeof(uint16_t);
9160 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
9161 xcb_parts_idx++;
9162 xcb_align_to = ALIGNOF(uint16_t);
9163 /* xcb_xkb_get_kbd_by_name_replies_t.types.nKeyActions */
9164 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.nKeyActions;
9165 xcb_block_len += sizeof(uint8_t);
9166 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
9167 xcb_parts_idx++;
9168 xcb_align_to = ALIGNOF(uint8_t);
9169 /* xcb_xkb_get_kbd_by_name_replies_t.types.firstKeyBehavior */
9170 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.firstKeyBehavior;
9171 xcb_block_len += sizeof(xcb_keycode_t);
9172 xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_keycode_t);
9173 xcb_parts_idx++;
9174 xcb_align_to = ALIGNOF(xcb_keycode_t);
9175 /* xcb_xkb_get_kbd_by_name_replies_t.types.nKeyBehaviors */
9176 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.nKeyBehaviors;
9177 xcb_block_len += sizeof(uint8_t);
9178 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
9179 xcb_parts_idx++;
9180 xcb_align_to = ALIGNOF(uint8_t);
9181 /* xcb_xkb_get_kbd_by_name_replies_t.types.totalKeyBehaviors */
9182 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.totalKeyBehaviors;
9183 xcb_block_len += sizeof(uint8_t);
9184 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
9185 xcb_parts_idx++;
9186 xcb_align_to = ALIGNOF(uint8_t);
9187 /* xcb_xkb_get_kbd_by_name_replies_t.types.firstKeyExplicit */
9188 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.firstKeyExplicit;
9189 xcb_block_len += sizeof(xcb_keycode_t);
9190 xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_keycode_t);
9191 xcb_parts_idx++;
9192 xcb_align_to = ALIGNOF(xcb_keycode_t);
9193 /* xcb_xkb_get_kbd_by_name_replies_t.types.nKeyExplicit */
9194 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.nKeyExplicit;
9195 xcb_block_len += sizeof(uint8_t);
9196 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
9197 xcb_parts_idx++;
9198 xcb_align_to = ALIGNOF(uint8_t);
9199 /* xcb_xkb_get_kbd_by_name_replies_t.types.totalKeyExplicit */
9200 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.totalKeyExplicit;
9201 xcb_block_len += sizeof(uint8_t);
9202 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
9203 xcb_parts_idx++;
9204 xcb_align_to = ALIGNOF(uint8_t);
9205 /* xcb_xkb_get_kbd_by_name_replies_t.types.firstModMapKey */
9206 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.firstModMapKey;
9207 xcb_block_len += sizeof(xcb_keycode_t);
9208 xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_keycode_t);
9209 xcb_parts_idx++;
9210 xcb_align_to = ALIGNOF(xcb_keycode_t);
9211 /* xcb_xkb_get_kbd_by_name_replies_t.types.nModMapKeys */
9212 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.nModMapKeys;
9213 xcb_block_len += sizeof(uint8_t);
9214 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
9215 xcb_parts_idx++;
9216 xcb_align_to = ALIGNOF(uint8_t);
9217 /* xcb_xkb_get_kbd_by_name_replies_t.types.totalModMapKeys */
9218 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.totalModMapKeys;
9219 xcb_block_len += sizeof(uint8_t);
9220 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
9221 xcb_parts_idx++;
9222 xcb_align_to = ALIGNOF(uint8_t);
9223 /* xcb_xkb_get_kbd_by_name_replies_t.types.firstVModMapKey */
9224 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.firstVModMapKey;
9225 xcb_block_len += sizeof(xcb_keycode_t);
9226 xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_keycode_t);
9227 xcb_parts_idx++;
9228 xcb_align_to = ALIGNOF(xcb_keycode_t);
9229 /* xcb_xkb_get_kbd_by_name_replies_t.types.nVModMapKeys */
9230 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.nVModMapKeys;
9231 xcb_block_len += sizeof(uint8_t);
9232 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
9233 xcb_parts_idx++;
9234 xcb_align_to = ALIGNOF(uint8_t);
9235 /* xcb_xkb_get_kbd_by_name_replies_t.types.totalVModMapKeys */
9236 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.totalVModMapKeys;
9237 xcb_block_len += sizeof(uint8_t);
9238 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
9239 xcb_parts_idx++;
9240 xcb_align_to = ALIGNOF(uint8_t);
9241 /* xcb_xkb_get_kbd_by_name_replies_t.types.pad2 */
9242 xcb_parts[xcb_parts_idx].iov_base = (char *) &xcb_pad;
9243 xcb_block_len += sizeof(uint8_t);
9244 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
9245 xcb_parts_idx++;
9246 xcb_align_to = ALIGNOF(uint8_t);
9247 /* xcb_xkb_get_kbd_by_name_replies_t.types.virtualMods */
9248 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->types.virtualMods;
9249 xcb_block_len += sizeof(uint16_t);
9250 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
9251 xcb_parts_idx++;
9252 xcb_align_to = ALIGNOF(uint16_t);
9253 /* insert padding */
9254 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
9255 xcb_buffer_len += xcb_block_len + xcb_pad;
9256 if (0 != xcb_pad) {
9257 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
9258 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
9259 xcb_parts_idx++;
9260 xcb_pad = 0;
9262 xcb_block_len = 0;
9263 /* map */
9264 xcb_parts[xcb_parts_idx].iov_base = (char *)0;
9265 xcb_block_len += xcb_xkb_get_kbd_by_name_replies_types_map_serialize(&xcb_parts[xcb_parts_idx].iov_base, _aux->types.nTypes, _aux->types.nKeySyms, _aux->types.nKeyActions, _aux->types.totalActions, _aux->types.totalKeyBehaviors, _aux->types.virtualMods, _aux->types.totalKeyExplicit, _aux->types.totalModMapKeys, _aux->types.totalVModMapKeys, _aux->types.present, &_aux->types.map);
9266 xcb_parts[xcb_parts_idx].iov_len = xcb_xkb_get_kbd_by_name_replies_types_map_serialize(&xcb_parts[xcb_parts_idx].iov_base, _aux->types.nTypes, _aux->types.nKeySyms, _aux->types.nKeyActions, _aux->types.totalActions, _aux->types.totalKeyBehaviors, _aux->types.virtualMods, _aux->types.totalKeyExplicit, _aux->types.totalModMapKeys, _aux->types.totalVModMapKeys, _aux->types.present, &_aux->types.map);
9267 xcb_parts_idx++;
9268 xcb_align_to = ALIGNOF(xcb_xkb_get_kbd_by_name_replies_types_map_t);
9270 if(reported & XCB_XKB_GBN_DETAIL_COMPAT_MAP) {
9271 /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.compatmap_type */
9272 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->compat_map.compatmap_type;
9273 xcb_block_len += sizeof(uint8_t);
9274 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
9275 xcb_parts_idx++;
9276 xcb_align_to = ALIGNOF(uint8_t);
9277 /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.compatDeviceID */
9278 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->compat_map.compatDeviceID;
9279 xcb_block_len += sizeof(uint8_t);
9280 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
9281 xcb_parts_idx++;
9282 xcb_align_to = ALIGNOF(uint8_t);
9283 /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.compatmap_sequence */
9284 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->compat_map.compatmap_sequence;
9285 xcb_block_len += sizeof(uint16_t);
9286 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
9287 xcb_parts_idx++;
9288 xcb_align_to = ALIGNOF(uint16_t);
9289 /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.compatmap_length */
9290 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->compat_map.compatmap_length;
9291 xcb_block_len += sizeof(uint32_t);
9292 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t);
9293 xcb_parts_idx++;
9294 xcb_align_to = ALIGNOF(uint32_t);
9295 /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.groupsRtrn */
9296 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->compat_map.groupsRtrn;
9297 xcb_block_len += sizeof(uint8_t);
9298 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
9299 xcb_parts_idx++;
9300 xcb_align_to = ALIGNOF(uint8_t);
9301 /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.pad3 */
9302 xcb_parts[xcb_parts_idx].iov_base = (char *) &xcb_pad;
9303 xcb_block_len += sizeof(uint8_t);
9304 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
9305 xcb_parts_idx++;
9306 xcb_align_to = ALIGNOF(uint8_t);
9307 /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.firstSIRtrn */
9308 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->compat_map.firstSIRtrn;
9309 xcb_block_len += sizeof(uint16_t);
9310 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
9311 xcb_parts_idx++;
9312 xcb_align_to = ALIGNOF(uint16_t);
9313 /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.nSIRtrn */
9314 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->compat_map.nSIRtrn;
9315 xcb_block_len += sizeof(uint16_t);
9316 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
9317 xcb_parts_idx++;
9318 xcb_align_to = ALIGNOF(uint16_t);
9319 /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.nTotalSI */
9320 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->compat_map.nTotalSI;
9321 xcb_block_len += sizeof(uint16_t);
9322 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
9323 xcb_parts_idx++;
9324 xcb_align_to = ALIGNOF(uint16_t);
9325 /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.pad4 */
9326 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
9327 xcb_block_len += sizeof(uint8_t)*16;
9328 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t)*16;
9329 xcb_parts_idx++;
9330 xcb_align_to = ALIGNOF(uint8_t);
9331 /* insert padding */
9332 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
9333 xcb_buffer_len += xcb_block_len + xcb_pad;
9334 if (0 != xcb_pad) {
9335 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
9336 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
9337 xcb_parts_idx++;
9338 xcb_pad = 0;
9340 xcb_block_len = 0;
9341 /* si_rtrn */
9342 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->compat_map.si_rtrn;
9343 xcb_block_len += _aux->compat_map.nSIRtrn * sizeof(xcb_xkb_sym_interpret_t);
9344 xcb_parts[xcb_parts_idx].iov_len = _aux->compat_map.nSIRtrn * sizeof(xcb_xkb_sym_interpret_t);
9345 xcb_parts_idx++;
9346 xcb_align_to = ALIGNOF(xcb_xkb_sym_interpret_t);
9347 /* insert padding */
9348 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
9349 xcb_buffer_len += xcb_block_len + xcb_pad;
9350 if (0 != xcb_pad) {
9351 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
9352 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
9353 xcb_parts_idx++;
9354 xcb_pad = 0;
9356 xcb_block_len = 0;
9357 /* group_rtrn */
9358 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->compat_map.group_rtrn;
9359 xcb_block_len += xcb_popcount(_aux->compat_map.groupsRtrn) * sizeof(xcb_xkb_mod_def_t);
9360 xcb_parts[xcb_parts_idx].iov_len = xcb_popcount(_aux->compat_map.groupsRtrn) * sizeof(xcb_xkb_mod_def_t);
9361 xcb_parts_idx++;
9362 xcb_align_to = ALIGNOF(xcb_xkb_mod_def_t);
9364 if(reported & XCB_XKB_GBN_DETAIL_INDICATOR_MAPS) {
9365 /* xcb_xkb_get_kbd_by_name_replies_t.indicator_maps.indicatormap_type */
9366 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->indicator_maps.indicatormap_type;
9367 xcb_block_len += sizeof(uint8_t);
9368 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
9369 xcb_parts_idx++;
9370 xcb_align_to = ALIGNOF(uint8_t);
9371 /* xcb_xkb_get_kbd_by_name_replies_t.indicator_maps.indicatorDeviceID */
9372 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->indicator_maps.indicatorDeviceID;
9373 xcb_block_len += sizeof(uint8_t);
9374 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
9375 xcb_parts_idx++;
9376 xcb_align_to = ALIGNOF(uint8_t);
9377 /* xcb_xkb_get_kbd_by_name_replies_t.indicator_maps.indicatormap_sequence */
9378 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->indicator_maps.indicatormap_sequence;
9379 xcb_block_len += sizeof(uint16_t);
9380 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
9381 xcb_parts_idx++;
9382 xcb_align_to = ALIGNOF(uint16_t);
9383 /* xcb_xkb_get_kbd_by_name_replies_t.indicator_maps.indicatormap_length */
9384 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->indicator_maps.indicatormap_length;
9385 xcb_block_len += sizeof(uint32_t);
9386 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t);
9387 xcb_parts_idx++;
9388 xcb_align_to = ALIGNOF(uint32_t);
9389 /* xcb_xkb_get_kbd_by_name_replies_t.indicator_maps.which */
9390 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->indicator_maps.which;
9391 xcb_block_len += sizeof(uint32_t);
9392 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t);
9393 xcb_parts_idx++;
9394 xcb_align_to = ALIGNOF(uint32_t);
9395 /* xcb_xkb_get_kbd_by_name_replies_t.indicator_maps.realIndicators */
9396 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->indicator_maps.realIndicators;
9397 xcb_block_len += sizeof(uint32_t);
9398 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t);
9399 xcb_parts_idx++;
9400 xcb_align_to = ALIGNOF(uint32_t);
9401 /* xcb_xkb_get_kbd_by_name_replies_t.indicator_maps.nIndicators */
9402 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->indicator_maps.nIndicators;
9403 xcb_block_len += sizeof(uint8_t);
9404 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
9405 xcb_parts_idx++;
9406 xcb_align_to = ALIGNOF(uint8_t);
9407 /* xcb_xkb_get_kbd_by_name_replies_t.indicator_maps.pad5 */
9408 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
9409 xcb_block_len += sizeof(uint8_t)*15;
9410 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t)*15;
9411 xcb_parts_idx++;
9412 xcb_align_to = ALIGNOF(uint8_t);
9413 /* insert padding */
9414 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
9415 xcb_buffer_len += xcb_block_len + xcb_pad;
9416 if (0 != xcb_pad) {
9417 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
9418 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
9419 xcb_parts_idx++;
9420 xcb_pad = 0;
9422 xcb_block_len = 0;
9423 /* maps */
9424 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->indicator_maps.maps;
9425 xcb_block_len += _aux->indicator_maps.nIndicators * sizeof(xcb_xkb_indicator_map_t);
9426 xcb_parts[xcb_parts_idx].iov_len = _aux->indicator_maps.nIndicators * sizeof(xcb_xkb_indicator_map_t);
9427 xcb_parts_idx++;
9428 xcb_align_to = ALIGNOF(xcb_xkb_indicator_map_t);
9430 if((reported & XCB_XKB_GBN_DETAIL_KEY_NAMES) ||
9431 (reported & XCB_XKB_GBN_DETAIL_OTHER_NAMES)) {
9432 /* xcb_xkb_get_kbd_by_name_replies_t.key_names.keyname_type */
9433 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->key_names.keyname_type;
9434 xcb_block_len += sizeof(uint8_t);
9435 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
9436 xcb_parts_idx++;
9437 xcb_align_to = ALIGNOF(uint8_t);
9438 /* xcb_xkb_get_kbd_by_name_replies_t.key_names.keyDeviceID */
9439 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->key_names.keyDeviceID;
9440 xcb_block_len += sizeof(uint8_t);
9441 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
9442 xcb_parts_idx++;
9443 xcb_align_to = ALIGNOF(uint8_t);
9444 /* xcb_xkb_get_kbd_by_name_replies_t.key_names.keyname_sequence */
9445 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->key_names.keyname_sequence;
9446 xcb_block_len += sizeof(uint16_t);
9447 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
9448 xcb_parts_idx++;
9449 xcb_align_to = ALIGNOF(uint16_t);
9450 /* xcb_xkb_get_kbd_by_name_replies_t.key_names.keyname_length */
9451 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->key_names.keyname_length;
9452 xcb_block_len += sizeof(uint32_t);
9453 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t);
9454 xcb_parts_idx++;
9455 xcb_align_to = ALIGNOF(uint32_t);
9456 /* xcb_xkb_get_kbd_by_name_replies_t.key_names.which */
9457 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->key_names.which;
9458 xcb_block_len += sizeof(uint32_t);
9459 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t);
9460 xcb_parts_idx++;
9461 xcb_align_to = ALIGNOF(uint32_t);
9462 /* xcb_xkb_get_kbd_by_name_replies_t.key_names.keyMinKeyCode */
9463 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->key_names.keyMinKeyCode;
9464 xcb_block_len += sizeof(xcb_keycode_t);
9465 xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_keycode_t);
9466 xcb_parts_idx++;
9467 xcb_align_to = ALIGNOF(xcb_keycode_t);
9468 /* xcb_xkb_get_kbd_by_name_replies_t.key_names.keyMaxKeyCode */
9469 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->key_names.keyMaxKeyCode;
9470 xcb_block_len += sizeof(xcb_keycode_t);
9471 xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_keycode_t);
9472 xcb_parts_idx++;
9473 xcb_align_to = ALIGNOF(xcb_keycode_t);
9474 /* xcb_xkb_get_kbd_by_name_replies_t.key_names.nTypes */
9475 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->key_names.nTypes;
9476 xcb_block_len += sizeof(uint8_t);
9477 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
9478 xcb_parts_idx++;
9479 xcb_align_to = ALIGNOF(uint8_t);
9480 /* xcb_xkb_get_kbd_by_name_replies_t.key_names.groupNames */
9481 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->key_names.groupNames;
9482 xcb_block_len += sizeof(uint8_t);
9483 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
9484 xcb_parts_idx++;
9485 xcb_align_to = ALIGNOF(uint8_t);
9486 /* xcb_xkb_get_kbd_by_name_replies_t.key_names.virtualMods */
9487 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->key_names.virtualMods;
9488 xcb_block_len += sizeof(uint16_t);
9489 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
9490 xcb_parts_idx++;
9491 xcb_align_to = ALIGNOF(uint16_t);
9492 /* xcb_xkb_get_kbd_by_name_replies_t.key_names.firstKey */
9493 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->key_names.firstKey;
9494 xcb_block_len += sizeof(xcb_keycode_t);
9495 xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_keycode_t);
9496 xcb_parts_idx++;
9497 xcb_align_to = ALIGNOF(xcb_keycode_t);
9498 /* xcb_xkb_get_kbd_by_name_replies_t.key_names.nKeys */
9499 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->key_names.nKeys;
9500 xcb_block_len += sizeof(uint8_t);
9501 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
9502 xcb_parts_idx++;
9503 xcb_align_to = ALIGNOF(uint8_t);
9504 /* xcb_xkb_get_kbd_by_name_replies_t.key_names.indicators */
9505 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->key_names.indicators;
9506 xcb_block_len += sizeof(uint32_t);
9507 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t);
9508 xcb_parts_idx++;
9509 xcb_align_to = ALIGNOF(uint32_t);
9510 /* xcb_xkb_get_kbd_by_name_replies_t.key_names.nRadioGroups */
9511 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->key_names.nRadioGroups;
9512 xcb_block_len += sizeof(uint8_t);
9513 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
9514 xcb_parts_idx++;
9515 xcb_align_to = ALIGNOF(uint8_t);
9516 /* xcb_xkb_get_kbd_by_name_replies_t.key_names.nKeyAliases */
9517 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->key_names.nKeyAliases;
9518 xcb_block_len += sizeof(uint8_t);
9519 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
9520 xcb_parts_idx++;
9521 xcb_align_to = ALIGNOF(uint8_t);
9522 /* xcb_xkb_get_kbd_by_name_replies_t.key_names.nKTLevels */
9523 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->key_names.nKTLevels;
9524 xcb_block_len += sizeof(uint16_t);
9525 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
9526 xcb_parts_idx++;
9527 xcb_align_to = ALIGNOF(uint16_t);
9528 /* xcb_xkb_get_kbd_by_name_replies_t.key_names.pad6 */
9529 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
9530 xcb_block_len += sizeof(uint8_t)*4;
9531 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t)*4;
9532 xcb_parts_idx++;
9533 xcb_align_to = ALIGNOF(uint8_t);
9534 /* insert padding */
9535 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
9536 xcb_buffer_len += xcb_block_len + xcb_pad;
9537 if (0 != xcb_pad) {
9538 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
9539 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
9540 xcb_parts_idx++;
9541 xcb_pad = 0;
9543 xcb_block_len = 0;
9544 /* valueList */
9545 xcb_parts[xcb_parts_idx].iov_base = (char *)0;
9546 xcb_block_len += xcb_xkb_get_kbd_by_name_replies_key_names_value_list_serialize(&xcb_parts[xcb_parts_idx].iov_base, _aux->key_names.nTypes, _aux->key_names.indicators, _aux->key_names.virtualMods, _aux->key_names.groupNames, _aux->key_names.nKeys, _aux->key_names.nKeyAliases, _aux->key_names.nRadioGroups, _aux->key_names.which, &_aux->key_names.valueList);
9547 xcb_parts[xcb_parts_idx].iov_len = xcb_xkb_get_kbd_by_name_replies_key_names_value_list_serialize(&xcb_parts[xcb_parts_idx].iov_base, _aux->key_names.nTypes, _aux->key_names.indicators, _aux->key_names.virtualMods, _aux->key_names.groupNames, _aux->key_names.nKeys, _aux->key_names.nKeyAliases, _aux->key_names.nRadioGroups, _aux->key_names.which, &_aux->key_names.valueList);
9548 xcb_parts_idx++;
9549 xcb_align_to = ALIGNOF(xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t);
9551 if(reported & XCB_XKB_GBN_DETAIL_GEOMETRY) {
9552 /* xcb_xkb_get_kbd_by_name_replies_t.geometry.geometry_type */
9553 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometry.geometry_type;
9554 xcb_block_len += sizeof(uint8_t);
9555 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
9556 xcb_parts_idx++;
9557 xcb_align_to = ALIGNOF(uint8_t);
9558 /* xcb_xkb_get_kbd_by_name_replies_t.geometry.geometryDeviceID */
9559 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometry.geometryDeviceID;
9560 xcb_block_len += sizeof(uint8_t);
9561 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
9562 xcb_parts_idx++;
9563 xcb_align_to = ALIGNOF(uint8_t);
9564 /* xcb_xkb_get_kbd_by_name_replies_t.geometry.geometry_sequence */
9565 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometry.geometry_sequence;
9566 xcb_block_len += sizeof(uint16_t);
9567 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
9568 xcb_parts_idx++;
9569 xcb_align_to = ALIGNOF(uint16_t);
9570 /* xcb_xkb_get_kbd_by_name_replies_t.geometry.geometry_length */
9571 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometry.geometry_length;
9572 xcb_block_len += sizeof(uint32_t);
9573 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t);
9574 xcb_parts_idx++;
9575 xcb_align_to = ALIGNOF(uint32_t);
9576 /* xcb_xkb_get_kbd_by_name_replies_t.geometry.name */
9577 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometry.name;
9578 xcb_block_len += sizeof(xcb_atom_t);
9579 xcb_parts[xcb_parts_idx].iov_len = sizeof(xcb_atom_t);
9580 xcb_parts_idx++;
9581 xcb_align_to = ALIGNOF(xcb_atom_t);
9582 /* xcb_xkb_get_kbd_by_name_replies_t.geometry.geometryFound */
9583 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometry.geometryFound;
9584 xcb_block_len += sizeof(uint8_t);
9585 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
9586 xcb_parts_idx++;
9587 xcb_align_to = ALIGNOF(uint8_t);
9588 /* xcb_xkb_get_kbd_by_name_replies_t.geometry.pad7 */
9589 xcb_parts[xcb_parts_idx].iov_base = (char *) &xcb_pad;
9590 xcb_block_len += sizeof(uint8_t);
9591 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
9592 xcb_parts_idx++;
9593 xcb_align_to = ALIGNOF(uint8_t);
9594 /* xcb_xkb_get_kbd_by_name_replies_t.geometry.widthMM */
9595 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometry.widthMM;
9596 xcb_block_len += sizeof(uint16_t);
9597 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
9598 xcb_parts_idx++;
9599 xcb_align_to = ALIGNOF(uint16_t);
9600 /* xcb_xkb_get_kbd_by_name_replies_t.geometry.heightMM */
9601 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometry.heightMM;
9602 xcb_block_len += sizeof(uint16_t);
9603 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
9604 xcb_parts_idx++;
9605 xcb_align_to = ALIGNOF(uint16_t);
9606 /* xcb_xkb_get_kbd_by_name_replies_t.geometry.nProperties */
9607 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometry.nProperties;
9608 xcb_block_len += sizeof(uint16_t);
9609 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
9610 xcb_parts_idx++;
9611 xcb_align_to = ALIGNOF(uint16_t);
9612 /* xcb_xkb_get_kbd_by_name_replies_t.geometry.nColors */
9613 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometry.nColors;
9614 xcb_block_len += sizeof(uint16_t);
9615 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
9616 xcb_parts_idx++;
9617 xcb_align_to = ALIGNOF(uint16_t);
9618 /* xcb_xkb_get_kbd_by_name_replies_t.geometry.nShapes */
9619 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometry.nShapes;
9620 xcb_block_len += sizeof(uint16_t);
9621 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
9622 xcb_parts_idx++;
9623 xcb_align_to = ALIGNOF(uint16_t);
9624 /* xcb_xkb_get_kbd_by_name_replies_t.geometry.nSections */
9625 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometry.nSections;
9626 xcb_block_len += sizeof(uint16_t);
9627 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
9628 xcb_parts_idx++;
9629 xcb_align_to = ALIGNOF(uint16_t);
9630 /* xcb_xkb_get_kbd_by_name_replies_t.geometry.nDoodads */
9631 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometry.nDoodads;
9632 xcb_block_len += sizeof(uint16_t);
9633 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
9634 xcb_parts_idx++;
9635 xcb_align_to = ALIGNOF(uint16_t);
9636 /* xcb_xkb_get_kbd_by_name_replies_t.geometry.nKeyAliases */
9637 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometry.nKeyAliases;
9638 xcb_block_len += sizeof(uint16_t);
9639 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint16_t);
9640 xcb_parts_idx++;
9641 xcb_align_to = ALIGNOF(uint16_t);
9642 /* xcb_xkb_get_kbd_by_name_replies_t.geometry.baseColorNdx */
9643 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometry.baseColorNdx;
9644 xcb_block_len += sizeof(uint8_t);
9645 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
9646 xcb_parts_idx++;
9647 xcb_align_to = ALIGNOF(uint8_t);
9648 /* xcb_xkb_get_kbd_by_name_replies_t.geometry.labelColorNdx */
9649 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->geometry.labelColorNdx;
9650 xcb_block_len += sizeof(uint8_t);
9651 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
9652 xcb_parts_idx++;
9653 xcb_align_to = ALIGNOF(uint8_t);
9654 /* insert padding */
9655 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
9656 xcb_buffer_len += xcb_block_len + xcb_pad;
9657 if (0 != xcb_pad) {
9658 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
9659 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
9660 xcb_parts_idx++;
9661 xcb_pad = 0;
9663 xcb_block_len = 0;
9664 /* labelFont */
9665 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->geometry.labelFont;
9666 xcb_block_len += xcb_xkb_counted_string_16_sizeof(_aux->geometry.labelFont);
9667 xcb_parts[xcb_parts_idx].iov_len = xcb_xkb_counted_string_16_sizeof(_aux->geometry.labelFont);
9668 xcb_parts_idx++;
9669 xcb_align_to = ALIGNOF(xcb_xkb_counted_string_16_t);
9671 /* insert padding */
9672 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
9673 xcb_buffer_len += xcb_block_len + xcb_pad;
9674 if (0 != xcb_pad) {
9675 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
9676 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
9677 xcb_parts_idx++;
9678 xcb_pad = 0;
9680 xcb_block_len = 0;
9682 if (NULL == xcb_out) {
9683 /* allocate memory */
9684 xcb_out = malloc(xcb_buffer_len);
9685 *_buffer = xcb_out;
9688 xcb_tmp = xcb_out;
9689 for(i=0; i<xcb_parts_idx; i++) {
9690 if (0 != xcb_parts[i].iov_base && 0 != xcb_parts[i].iov_len)
9691 memcpy(xcb_tmp, xcb_parts[i].iov_base, xcb_parts[i].iov_len);
9692 if (0 != xcb_parts[i].iov_len)
9693 xcb_tmp += xcb_parts[i].iov_len;
9696 return xcb_buffer_len;
9700 xcb_xkb_get_kbd_by_name_replies_unpack (const void *_buffer /**< */,
9701 uint16_t reported /**< */,
9702 xcb_xkb_get_kbd_by_name_replies_t *_aux /**< */)
9704 char *xcb_tmp = (char *)_buffer;
9705 unsigned int xcb_buffer_len = 0;
9706 unsigned int xcb_block_len = 0;
9707 unsigned int xcb_pad = 0;
9708 unsigned int xcb_align_to = 0;
9711 if((reported & XCB_XKB_GBN_DETAIL_TYPES) ||
9712 (reported & XCB_XKB_GBN_DETAIL_CLIENT_SYMBOLS) ||
9713 (reported & XCB_XKB_GBN_DETAIL_SERVER_SYMBOLS)) {
9714 /* xcb_xkb_get_kbd_by_name_replies_t.types.getmap_type */
9715 _aux->types.getmap_type = *(uint8_t *)xcb_tmp;
9716 xcb_block_len += sizeof(uint8_t);
9717 xcb_tmp += sizeof(uint8_t);
9718 xcb_align_to = ALIGNOF(uint8_t);
9719 /* xcb_xkb_get_kbd_by_name_replies_t.types.typeDeviceID */
9720 _aux->types.typeDeviceID = *(uint8_t *)xcb_tmp;
9721 xcb_block_len += sizeof(uint8_t);
9722 xcb_tmp += sizeof(uint8_t);
9723 xcb_align_to = ALIGNOF(uint8_t);
9724 /* xcb_xkb_get_kbd_by_name_replies_t.types.getmap_sequence */
9725 _aux->types.getmap_sequence = *(uint16_t *)xcb_tmp;
9726 xcb_block_len += sizeof(uint16_t);
9727 xcb_tmp += sizeof(uint16_t);
9728 xcb_align_to = ALIGNOF(uint16_t);
9729 /* xcb_xkb_get_kbd_by_name_replies_t.types.getmap_length */
9730 _aux->types.getmap_length = *(uint32_t *)xcb_tmp;
9731 xcb_block_len += sizeof(uint32_t);
9732 xcb_tmp += sizeof(uint32_t);
9733 xcb_align_to = ALIGNOF(uint32_t);
9734 /* xcb_xkb_get_kbd_by_name_replies_t.types.pad1 */
9735 _aux->types.pad1[0] = *(uint8_t *)xcb_tmp;
9736 _aux->types.pad1[1] = *(uint8_t *)xcb_tmp;
9737 xcb_block_len += sizeof(uint8_t) * 2;
9738 xcb_tmp += sizeof(uint8_t) * 2;
9739 xcb_align_to = ALIGNOF(uint8_t);
9740 /* xcb_xkb_get_kbd_by_name_replies_t.types.typeMinKeyCode */
9741 _aux->types.typeMinKeyCode = *(xcb_keycode_t *)xcb_tmp;
9742 xcb_block_len += sizeof(xcb_keycode_t);
9743 xcb_tmp += sizeof(xcb_keycode_t);
9744 xcb_align_to = ALIGNOF(xcb_keycode_t);
9745 /* xcb_xkb_get_kbd_by_name_replies_t.types.typeMaxKeyCode */
9746 _aux->types.typeMaxKeyCode = *(xcb_keycode_t *)xcb_tmp;
9747 xcb_block_len += sizeof(xcb_keycode_t);
9748 xcb_tmp += sizeof(xcb_keycode_t);
9749 xcb_align_to = ALIGNOF(xcb_keycode_t);
9750 /* xcb_xkb_get_kbd_by_name_replies_t.types.present */
9751 _aux->types.present = *(uint16_t *)xcb_tmp;
9752 xcb_block_len += sizeof(uint16_t);
9753 xcb_tmp += sizeof(uint16_t);
9754 xcb_align_to = ALIGNOF(uint16_t);
9755 /* xcb_xkb_get_kbd_by_name_replies_t.types.firstType */
9756 _aux->types.firstType = *(uint8_t *)xcb_tmp;
9757 xcb_block_len += sizeof(uint8_t);
9758 xcb_tmp += sizeof(uint8_t);
9759 xcb_align_to = ALIGNOF(uint8_t);
9760 /* xcb_xkb_get_kbd_by_name_replies_t.types.nTypes */
9761 _aux->types.nTypes = *(uint8_t *)xcb_tmp;
9762 xcb_block_len += sizeof(uint8_t);
9763 xcb_tmp += sizeof(uint8_t);
9764 xcb_align_to = ALIGNOF(uint8_t);
9765 /* xcb_xkb_get_kbd_by_name_replies_t.types.totalTypes */
9766 _aux->types.totalTypes = *(uint8_t *)xcb_tmp;
9767 xcb_block_len += sizeof(uint8_t);
9768 xcb_tmp += sizeof(uint8_t);
9769 xcb_align_to = ALIGNOF(uint8_t);
9770 /* xcb_xkb_get_kbd_by_name_replies_t.types.firstKeySym */
9771 _aux->types.firstKeySym = *(xcb_keycode_t *)xcb_tmp;
9772 xcb_block_len += sizeof(xcb_keycode_t);
9773 xcb_tmp += sizeof(xcb_keycode_t);
9774 xcb_align_to = ALIGNOF(xcb_keycode_t);
9775 /* xcb_xkb_get_kbd_by_name_replies_t.types.totalSyms */
9776 _aux->types.totalSyms = *(uint16_t *)xcb_tmp;
9777 xcb_block_len += sizeof(uint16_t);
9778 xcb_tmp += sizeof(uint16_t);
9779 xcb_align_to = ALIGNOF(uint16_t);
9780 /* xcb_xkb_get_kbd_by_name_replies_t.types.nKeySyms */
9781 _aux->types.nKeySyms = *(uint8_t *)xcb_tmp;
9782 xcb_block_len += sizeof(uint8_t);
9783 xcb_tmp += sizeof(uint8_t);
9784 xcb_align_to = ALIGNOF(uint8_t);
9785 /* xcb_xkb_get_kbd_by_name_replies_t.types.firstKeyAction */
9786 _aux->types.firstKeyAction = *(xcb_keycode_t *)xcb_tmp;
9787 xcb_block_len += sizeof(xcb_keycode_t);
9788 xcb_tmp += sizeof(xcb_keycode_t);
9789 xcb_align_to = ALIGNOF(xcb_keycode_t);
9790 /* xcb_xkb_get_kbd_by_name_replies_t.types.totalActions */
9791 _aux->types.totalActions = *(uint16_t *)xcb_tmp;
9792 xcb_block_len += sizeof(uint16_t);
9793 xcb_tmp += sizeof(uint16_t);
9794 xcb_align_to = ALIGNOF(uint16_t);
9795 /* xcb_xkb_get_kbd_by_name_replies_t.types.nKeyActions */
9796 _aux->types.nKeyActions = *(uint8_t *)xcb_tmp;
9797 xcb_block_len += sizeof(uint8_t);
9798 xcb_tmp += sizeof(uint8_t);
9799 xcb_align_to = ALIGNOF(uint8_t);
9800 /* xcb_xkb_get_kbd_by_name_replies_t.types.firstKeyBehavior */
9801 _aux->types.firstKeyBehavior = *(xcb_keycode_t *)xcb_tmp;
9802 xcb_block_len += sizeof(xcb_keycode_t);
9803 xcb_tmp += sizeof(xcb_keycode_t);
9804 xcb_align_to = ALIGNOF(xcb_keycode_t);
9805 /* xcb_xkb_get_kbd_by_name_replies_t.types.nKeyBehaviors */
9806 _aux->types.nKeyBehaviors = *(uint8_t *)xcb_tmp;
9807 xcb_block_len += sizeof(uint8_t);
9808 xcb_tmp += sizeof(uint8_t);
9809 xcb_align_to = ALIGNOF(uint8_t);
9810 /* xcb_xkb_get_kbd_by_name_replies_t.types.totalKeyBehaviors */
9811 _aux->types.totalKeyBehaviors = *(uint8_t *)xcb_tmp;
9812 xcb_block_len += sizeof(uint8_t);
9813 xcb_tmp += sizeof(uint8_t);
9814 xcb_align_to = ALIGNOF(uint8_t);
9815 /* xcb_xkb_get_kbd_by_name_replies_t.types.firstKeyExplicit */
9816 _aux->types.firstKeyExplicit = *(xcb_keycode_t *)xcb_tmp;
9817 xcb_block_len += sizeof(xcb_keycode_t);
9818 xcb_tmp += sizeof(xcb_keycode_t);
9819 xcb_align_to = ALIGNOF(xcb_keycode_t);
9820 /* xcb_xkb_get_kbd_by_name_replies_t.types.nKeyExplicit */
9821 _aux->types.nKeyExplicit = *(uint8_t *)xcb_tmp;
9822 xcb_block_len += sizeof(uint8_t);
9823 xcb_tmp += sizeof(uint8_t);
9824 xcb_align_to = ALIGNOF(uint8_t);
9825 /* xcb_xkb_get_kbd_by_name_replies_t.types.totalKeyExplicit */
9826 _aux->types.totalKeyExplicit = *(uint8_t *)xcb_tmp;
9827 xcb_block_len += sizeof(uint8_t);
9828 xcb_tmp += sizeof(uint8_t);
9829 xcb_align_to = ALIGNOF(uint8_t);
9830 /* xcb_xkb_get_kbd_by_name_replies_t.types.firstModMapKey */
9831 _aux->types.firstModMapKey = *(xcb_keycode_t *)xcb_tmp;
9832 xcb_block_len += sizeof(xcb_keycode_t);
9833 xcb_tmp += sizeof(xcb_keycode_t);
9834 xcb_align_to = ALIGNOF(xcb_keycode_t);
9835 /* xcb_xkb_get_kbd_by_name_replies_t.types.nModMapKeys */
9836 _aux->types.nModMapKeys = *(uint8_t *)xcb_tmp;
9837 xcb_block_len += sizeof(uint8_t);
9838 xcb_tmp += sizeof(uint8_t);
9839 xcb_align_to = ALIGNOF(uint8_t);
9840 /* xcb_xkb_get_kbd_by_name_replies_t.types.totalModMapKeys */
9841 _aux->types.totalModMapKeys = *(uint8_t *)xcb_tmp;
9842 xcb_block_len += sizeof(uint8_t);
9843 xcb_tmp += sizeof(uint8_t);
9844 xcb_align_to = ALIGNOF(uint8_t);
9845 /* xcb_xkb_get_kbd_by_name_replies_t.types.firstVModMapKey */
9846 _aux->types.firstVModMapKey = *(xcb_keycode_t *)xcb_tmp;
9847 xcb_block_len += sizeof(xcb_keycode_t);
9848 xcb_tmp += sizeof(xcb_keycode_t);
9849 xcb_align_to = ALIGNOF(xcb_keycode_t);
9850 /* xcb_xkb_get_kbd_by_name_replies_t.types.nVModMapKeys */
9851 _aux->types.nVModMapKeys = *(uint8_t *)xcb_tmp;
9852 xcb_block_len += sizeof(uint8_t);
9853 xcb_tmp += sizeof(uint8_t);
9854 xcb_align_to = ALIGNOF(uint8_t);
9855 /* xcb_xkb_get_kbd_by_name_replies_t.types.totalVModMapKeys */
9856 _aux->types.totalVModMapKeys = *(uint8_t *)xcb_tmp;
9857 xcb_block_len += sizeof(uint8_t);
9858 xcb_tmp += sizeof(uint8_t);
9859 xcb_align_to = ALIGNOF(uint8_t);
9860 /* xcb_xkb_get_kbd_by_name_replies_t.types.pad2 */
9861 _aux->types.pad2 = *(uint8_t *)xcb_tmp;
9862 xcb_block_len += sizeof(uint8_t);
9863 xcb_tmp += sizeof(uint8_t);
9864 xcb_align_to = ALIGNOF(uint8_t);
9865 /* xcb_xkb_get_kbd_by_name_replies_t.types.virtualMods */
9866 _aux->types.virtualMods = *(uint16_t *)xcb_tmp;
9867 xcb_block_len += sizeof(uint16_t);
9868 xcb_tmp += sizeof(uint16_t);
9869 xcb_align_to = ALIGNOF(uint16_t);
9870 /* insert padding */
9871 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
9872 xcb_buffer_len += xcb_block_len + xcb_pad;
9873 if (0 != xcb_pad) {
9874 xcb_tmp += xcb_pad;
9875 xcb_pad = 0;
9877 xcb_block_len = 0;
9878 /* map */
9879 xcb_block_len += xcb_xkb_get_kbd_by_name_replies_types_map_unpack(xcb_tmp, _aux->types.nTypes, _aux->types.nKeySyms, _aux->types.nKeyActions, _aux->types.totalActions, _aux->types.totalKeyBehaviors, _aux->types.virtualMods, _aux->types.totalKeyExplicit, _aux->types.totalModMapKeys, _aux->types.totalVModMapKeys, _aux->types.present, &_aux->types.map);
9880 xcb_tmp += xcb_block_len;
9881 xcb_align_to = ALIGNOF(xcb_xkb_get_kbd_by_name_replies_types_map_t);
9883 if(reported & XCB_XKB_GBN_DETAIL_COMPAT_MAP) {
9884 /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.compatmap_type */
9885 _aux->compat_map.compatmap_type = *(uint8_t *)xcb_tmp;
9886 xcb_block_len += sizeof(uint8_t);
9887 xcb_tmp += sizeof(uint8_t);
9888 xcb_align_to = ALIGNOF(uint8_t);
9889 /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.compatDeviceID */
9890 _aux->compat_map.compatDeviceID = *(uint8_t *)xcb_tmp;
9891 xcb_block_len += sizeof(uint8_t);
9892 xcb_tmp += sizeof(uint8_t);
9893 xcb_align_to = ALIGNOF(uint8_t);
9894 /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.compatmap_sequence */
9895 _aux->compat_map.compatmap_sequence = *(uint16_t *)xcb_tmp;
9896 xcb_block_len += sizeof(uint16_t);
9897 xcb_tmp += sizeof(uint16_t);
9898 xcb_align_to = ALIGNOF(uint16_t);
9899 /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.compatmap_length */
9900 _aux->compat_map.compatmap_length = *(uint32_t *)xcb_tmp;
9901 xcb_block_len += sizeof(uint32_t);
9902 xcb_tmp += sizeof(uint32_t);
9903 xcb_align_to = ALIGNOF(uint32_t);
9904 /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.groupsRtrn */
9905 _aux->compat_map.groupsRtrn = *(uint8_t *)xcb_tmp;
9906 xcb_block_len += sizeof(uint8_t);
9907 xcb_tmp += sizeof(uint8_t);
9908 xcb_align_to = ALIGNOF(uint8_t);
9909 /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.pad3 */
9910 _aux->compat_map.pad3 = *(uint8_t *)xcb_tmp;
9911 xcb_block_len += sizeof(uint8_t);
9912 xcb_tmp += sizeof(uint8_t);
9913 xcb_align_to = ALIGNOF(uint8_t);
9914 /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.firstSIRtrn */
9915 _aux->compat_map.firstSIRtrn = *(uint16_t *)xcb_tmp;
9916 xcb_block_len += sizeof(uint16_t);
9917 xcb_tmp += sizeof(uint16_t);
9918 xcb_align_to = ALIGNOF(uint16_t);
9919 /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.nSIRtrn */
9920 _aux->compat_map.nSIRtrn = *(uint16_t *)xcb_tmp;
9921 xcb_block_len += sizeof(uint16_t);
9922 xcb_tmp += sizeof(uint16_t);
9923 xcb_align_to = ALIGNOF(uint16_t);
9924 /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.nTotalSI */
9925 _aux->compat_map.nTotalSI = *(uint16_t *)xcb_tmp;
9926 xcb_block_len += sizeof(uint16_t);
9927 xcb_tmp += sizeof(uint16_t);
9928 xcb_align_to = ALIGNOF(uint16_t);
9929 /* xcb_xkb_get_kbd_by_name_replies_t.compat_map.pad4 */
9930 _aux->compat_map.pad4[0] = *(uint8_t *)xcb_tmp;
9931 _aux->compat_map.pad4[1] = *(uint8_t *)xcb_tmp;
9932 _aux->compat_map.pad4[2] = *(uint8_t *)xcb_tmp;
9933 _aux->compat_map.pad4[3] = *(uint8_t *)xcb_tmp;
9934 _aux->compat_map.pad4[4] = *(uint8_t *)xcb_tmp;
9935 _aux->compat_map.pad4[5] = *(uint8_t *)xcb_tmp;
9936 _aux->compat_map.pad4[6] = *(uint8_t *)xcb_tmp;
9937 _aux->compat_map.pad4[7] = *(uint8_t *)xcb_tmp;
9938 _aux->compat_map.pad4[8] = *(uint8_t *)xcb_tmp;
9939 _aux->compat_map.pad4[9] = *(uint8_t *)xcb_tmp;
9940 _aux->compat_map.pad4[10] = *(uint8_t *)xcb_tmp;
9941 _aux->compat_map.pad4[11] = *(uint8_t *)xcb_tmp;
9942 _aux->compat_map.pad4[12] = *(uint8_t *)xcb_tmp;
9943 _aux->compat_map.pad4[13] = *(uint8_t *)xcb_tmp;
9944 _aux->compat_map.pad4[14] = *(uint8_t *)xcb_tmp;
9945 _aux->compat_map.pad4[15] = *(uint8_t *)xcb_tmp;
9946 xcb_block_len += sizeof(uint8_t) * 16;
9947 xcb_tmp += sizeof(uint8_t) * 16;
9948 xcb_align_to = ALIGNOF(uint8_t);
9949 /* insert padding */
9950 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
9951 xcb_buffer_len += xcb_block_len + xcb_pad;
9952 if (0 != xcb_pad) {
9953 xcb_tmp += xcb_pad;
9954 xcb_pad = 0;
9956 xcb_block_len = 0;
9957 /* si_rtrn */
9958 _aux->compat_map.si_rtrn = (xcb_xkb_sym_interpret_t *)xcb_tmp;
9959 xcb_block_len += _aux->compat_map.nSIRtrn * sizeof(xcb_xkb_sym_interpret_t);
9960 xcb_tmp += xcb_block_len;
9961 xcb_align_to = ALIGNOF(xcb_xkb_sym_interpret_t);
9962 /* insert padding */
9963 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
9964 xcb_buffer_len += xcb_block_len + xcb_pad;
9965 if (0 != xcb_pad) {
9966 xcb_tmp += xcb_pad;
9967 xcb_pad = 0;
9969 xcb_block_len = 0;
9970 /* group_rtrn */
9971 _aux->compat_map.group_rtrn = (xcb_xkb_mod_def_t *)xcb_tmp;
9972 xcb_block_len += xcb_popcount(_aux->compat_map.groupsRtrn) * sizeof(xcb_xkb_mod_def_t);
9973 xcb_tmp += xcb_block_len;
9974 xcb_align_to = ALIGNOF(xcb_xkb_mod_def_t);
9976 if(reported & XCB_XKB_GBN_DETAIL_INDICATOR_MAPS) {
9977 /* xcb_xkb_get_kbd_by_name_replies_t.indicator_maps.indicatormap_type */
9978 _aux->indicator_maps.indicatormap_type = *(uint8_t *)xcb_tmp;
9979 xcb_block_len += sizeof(uint8_t);
9980 xcb_tmp += sizeof(uint8_t);
9981 xcb_align_to = ALIGNOF(uint8_t);
9982 /* xcb_xkb_get_kbd_by_name_replies_t.indicator_maps.indicatorDeviceID */
9983 _aux->indicator_maps.indicatorDeviceID = *(uint8_t *)xcb_tmp;
9984 xcb_block_len += sizeof(uint8_t);
9985 xcb_tmp += sizeof(uint8_t);
9986 xcb_align_to = ALIGNOF(uint8_t);
9987 /* xcb_xkb_get_kbd_by_name_replies_t.indicator_maps.indicatormap_sequence */
9988 _aux->indicator_maps.indicatormap_sequence = *(uint16_t *)xcb_tmp;
9989 xcb_block_len += sizeof(uint16_t);
9990 xcb_tmp += sizeof(uint16_t);
9991 xcb_align_to = ALIGNOF(uint16_t);
9992 /* xcb_xkb_get_kbd_by_name_replies_t.indicator_maps.indicatormap_length */
9993 _aux->indicator_maps.indicatormap_length = *(uint32_t *)xcb_tmp;
9994 xcb_block_len += sizeof(uint32_t);
9995 xcb_tmp += sizeof(uint32_t);
9996 xcb_align_to = ALIGNOF(uint32_t);
9997 /* xcb_xkb_get_kbd_by_name_replies_t.indicator_maps.which */
9998 _aux->indicator_maps.which = *(uint32_t *)xcb_tmp;
9999 xcb_block_len += sizeof(uint32_t);
10000 xcb_tmp += sizeof(uint32_t);
10001 xcb_align_to = ALIGNOF(uint32_t);
10002 /* xcb_xkb_get_kbd_by_name_replies_t.indicator_maps.realIndicators */
10003 _aux->indicator_maps.realIndicators = *(uint32_t *)xcb_tmp;
10004 xcb_block_len += sizeof(uint32_t);
10005 xcb_tmp += sizeof(uint32_t);
10006 xcb_align_to = ALIGNOF(uint32_t);
10007 /* xcb_xkb_get_kbd_by_name_replies_t.indicator_maps.nIndicators */
10008 _aux->indicator_maps.nIndicators = *(uint8_t *)xcb_tmp;
10009 xcb_block_len += sizeof(uint8_t);
10010 xcb_tmp += sizeof(uint8_t);
10011 xcb_align_to = ALIGNOF(uint8_t);
10012 /* xcb_xkb_get_kbd_by_name_replies_t.indicator_maps.pad5 */
10013 _aux->indicator_maps.pad5[0] = *(uint8_t *)xcb_tmp;
10014 _aux->indicator_maps.pad5[1] = *(uint8_t *)xcb_tmp;
10015 _aux->indicator_maps.pad5[2] = *(uint8_t *)xcb_tmp;
10016 _aux->indicator_maps.pad5[3] = *(uint8_t *)xcb_tmp;
10017 _aux->indicator_maps.pad5[4] = *(uint8_t *)xcb_tmp;
10018 _aux->indicator_maps.pad5[5] = *(uint8_t *)xcb_tmp;
10019 _aux->indicator_maps.pad5[6] = *(uint8_t *)xcb_tmp;
10020 _aux->indicator_maps.pad5[7] = *(uint8_t *)xcb_tmp;
10021 _aux->indicator_maps.pad5[8] = *(uint8_t *)xcb_tmp;
10022 _aux->indicator_maps.pad5[9] = *(uint8_t *)xcb_tmp;
10023 _aux->indicator_maps.pad5[10] = *(uint8_t *)xcb_tmp;
10024 _aux->indicator_maps.pad5[11] = *(uint8_t *)xcb_tmp;
10025 _aux->indicator_maps.pad5[12] = *(uint8_t *)xcb_tmp;
10026 _aux->indicator_maps.pad5[13] = *(uint8_t *)xcb_tmp;
10027 _aux->indicator_maps.pad5[14] = *(uint8_t *)xcb_tmp;
10028 xcb_block_len += sizeof(uint8_t) * 15;
10029 xcb_tmp += sizeof(uint8_t) * 15;
10030 xcb_align_to = ALIGNOF(uint8_t);
10031 /* insert padding */
10032 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
10033 xcb_buffer_len += xcb_block_len + xcb_pad;
10034 if (0 != xcb_pad) {
10035 xcb_tmp += xcb_pad;
10036 xcb_pad = 0;
10038 xcb_block_len = 0;
10039 /* maps */
10040 _aux->indicator_maps.maps = (xcb_xkb_indicator_map_t *)xcb_tmp;
10041 xcb_block_len += _aux->indicator_maps.nIndicators * sizeof(xcb_xkb_indicator_map_t);
10042 xcb_tmp += xcb_block_len;
10043 xcb_align_to = ALIGNOF(xcb_xkb_indicator_map_t);
10045 if((reported & XCB_XKB_GBN_DETAIL_KEY_NAMES) ||
10046 (reported & XCB_XKB_GBN_DETAIL_OTHER_NAMES)) {
10047 /* xcb_xkb_get_kbd_by_name_replies_t.key_names.keyname_type */
10048 _aux->key_names.keyname_type = *(uint8_t *)xcb_tmp;
10049 xcb_block_len += sizeof(uint8_t);
10050 xcb_tmp += sizeof(uint8_t);
10051 xcb_align_to = ALIGNOF(uint8_t);
10052 /* xcb_xkb_get_kbd_by_name_replies_t.key_names.keyDeviceID */
10053 _aux->key_names.keyDeviceID = *(uint8_t *)xcb_tmp;
10054 xcb_block_len += sizeof(uint8_t);
10055 xcb_tmp += sizeof(uint8_t);
10056 xcb_align_to = ALIGNOF(uint8_t);
10057 /* xcb_xkb_get_kbd_by_name_replies_t.key_names.keyname_sequence */
10058 _aux->key_names.keyname_sequence = *(uint16_t *)xcb_tmp;
10059 xcb_block_len += sizeof(uint16_t);
10060 xcb_tmp += sizeof(uint16_t);
10061 xcb_align_to = ALIGNOF(uint16_t);
10062 /* xcb_xkb_get_kbd_by_name_replies_t.key_names.keyname_length */
10063 _aux->key_names.keyname_length = *(uint32_t *)xcb_tmp;
10064 xcb_block_len += sizeof(uint32_t);
10065 xcb_tmp += sizeof(uint32_t);
10066 xcb_align_to = ALIGNOF(uint32_t);
10067 /* xcb_xkb_get_kbd_by_name_replies_t.key_names.which */
10068 _aux->key_names.which = *(uint32_t *)xcb_tmp;
10069 xcb_block_len += sizeof(uint32_t);
10070 xcb_tmp += sizeof(uint32_t);
10071 xcb_align_to = ALIGNOF(uint32_t);
10072 /* xcb_xkb_get_kbd_by_name_replies_t.key_names.keyMinKeyCode */
10073 _aux->key_names.keyMinKeyCode = *(xcb_keycode_t *)xcb_tmp;
10074 xcb_block_len += sizeof(xcb_keycode_t);
10075 xcb_tmp += sizeof(xcb_keycode_t);
10076 xcb_align_to = ALIGNOF(xcb_keycode_t);
10077 /* xcb_xkb_get_kbd_by_name_replies_t.key_names.keyMaxKeyCode */
10078 _aux->key_names.keyMaxKeyCode = *(xcb_keycode_t *)xcb_tmp;
10079 xcb_block_len += sizeof(xcb_keycode_t);
10080 xcb_tmp += sizeof(xcb_keycode_t);
10081 xcb_align_to = ALIGNOF(xcb_keycode_t);
10082 /* xcb_xkb_get_kbd_by_name_replies_t.key_names.nTypes */
10083 _aux->key_names.nTypes = *(uint8_t *)xcb_tmp;
10084 xcb_block_len += sizeof(uint8_t);
10085 xcb_tmp += sizeof(uint8_t);
10086 xcb_align_to = ALIGNOF(uint8_t);
10087 /* xcb_xkb_get_kbd_by_name_replies_t.key_names.groupNames */
10088 _aux->key_names.groupNames = *(uint8_t *)xcb_tmp;
10089 xcb_block_len += sizeof(uint8_t);
10090 xcb_tmp += sizeof(uint8_t);
10091 xcb_align_to = ALIGNOF(uint8_t);
10092 /* xcb_xkb_get_kbd_by_name_replies_t.key_names.virtualMods */
10093 _aux->key_names.virtualMods = *(uint16_t *)xcb_tmp;
10094 xcb_block_len += sizeof(uint16_t);
10095 xcb_tmp += sizeof(uint16_t);
10096 xcb_align_to = ALIGNOF(uint16_t);
10097 /* xcb_xkb_get_kbd_by_name_replies_t.key_names.firstKey */
10098 _aux->key_names.firstKey = *(xcb_keycode_t *)xcb_tmp;
10099 xcb_block_len += sizeof(xcb_keycode_t);
10100 xcb_tmp += sizeof(xcb_keycode_t);
10101 xcb_align_to = ALIGNOF(xcb_keycode_t);
10102 /* xcb_xkb_get_kbd_by_name_replies_t.key_names.nKeys */
10103 _aux->key_names.nKeys = *(uint8_t *)xcb_tmp;
10104 xcb_block_len += sizeof(uint8_t);
10105 xcb_tmp += sizeof(uint8_t);
10106 xcb_align_to = ALIGNOF(uint8_t);
10107 /* xcb_xkb_get_kbd_by_name_replies_t.key_names.indicators */
10108 _aux->key_names.indicators = *(uint32_t *)xcb_tmp;
10109 xcb_block_len += sizeof(uint32_t);
10110 xcb_tmp += sizeof(uint32_t);
10111 xcb_align_to = ALIGNOF(uint32_t);
10112 /* xcb_xkb_get_kbd_by_name_replies_t.key_names.nRadioGroups */
10113 _aux->key_names.nRadioGroups = *(uint8_t *)xcb_tmp;
10114 xcb_block_len += sizeof(uint8_t);
10115 xcb_tmp += sizeof(uint8_t);
10116 xcb_align_to = ALIGNOF(uint8_t);
10117 /* xcb_xkb_get_kbd_by_name_replies_t.key_names.nKeyAliases */
10118 _aux->key_names.nKeyAliases = *(uint8_t *)xcb_tmp;
10119 xcb_block_len += sizeof(uint8_t);
10120 xcb_tmp += sizeof(uint8_t);
10121 xcb_align_to = ALIGNOF(uint8_t);
10122 /* xcb_xkb_get_kbd_by_name_replies_t.key_names.nKTLevels */
10123 _aux->key_names.nKTLevels = *(uint16_t *)xcb_tmp;
10124 xcb_block_len += sizeof(uint16_t);
10125 xcb_tmp += sizeof(uint16_t);
10126 xcb_align_to = ALIGNOF(uint16_t);
10127 /* xcb_xkb_get_kbd_by_name_replies_t.key_names.pad6 */
10128 _aux->key_names.pad6[0] = *(uint8_t *)xcb_tmp;
10129 _aux->key_names.pad6[1] = *(uint8_t *)xcb_tmp;
10130 _aux->key_names.pad6[2] = *(uint8_t *)xcb_tmp;
10131 _aux->key_names.pad6[3] = *(uint8_t *)xcb_tmp;
10132 xcb_block_len += sizeof(uint8_t) * 4;
10133 xcb_tmp += sizeof(uint8_t) * 4;
10134 xcb_align_to = ALIGNOF(uint8_t);
10135 /* insert padding */
10136 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
10137 xcb_buffer_len += xcb_block_len + xcb_pad;
10138 if (0 != xcb_pad) {
10139 xcb_tmp += xcb_pad;
10140 xcb_pad = 0;
10142 xcb_block_len = 0;
10143 /* valueList */
10144 xcb_block_len += xcb_xkb_get_kbd_by_name_replies_key_names_value_list_unpack(xcb_tmp, _aux->key_names.nTypes, _aux->key_names.indicators, _aux->key_names.virtualMods, _aux->key_names.groupNames, _aux->key_names.nKeys, _aux->key_names.nKeyAliases, _aux->key_names.nRadioGroups, _aux->key_names.which, &_aux->key_names.valueList);
10145 xcb_tmp += xcb_block_len;
10146 xcb_align_to = ALIGNOF(xcb_xkb_get_kbd_by_name_replies_key_names_value_list_t);
10148 if(reported & XCB_XKB_GBN_DETAIL_GEOMETRY) {
10149 /* xcb_xkb_get_kbd_by_name_replies_t.geometry.geometry_type */
10150 _aux->geometry.geometry_type = *(uint8_t *)xcb_tmp;
10151 xcb_block_len += sizeof(uint8_t);
10152 xcb_tmp += sizeof(uint8_t);
10153 xcb_align_to = ALIGNOF(uint8_t);
10154 /* xcb_xkb_get_kbd_by_name_replies_t.geometry.geometryDeviceID */
10155 _aux->geometry.geometryDeviceID = *(uint8_t *)xcb_tmp;
10156 xcb_block_len += sizeof(uint8_t);
10157 xcb_tmp += sizeof(uint8_t);
10158 xcb_align_to = ALIGNOF(uint8_t);
10159 /* xcb_xkb_get_kbd_by_name_replies_t.geometry.geometry_sequence */
10160 _aux->geometry.geometry_sequence = *(uint16_t *)xcb_tmp;
10161 xcb_block_len += sizeof(uint16_t);
10162 xcb_tmp += sizeof(uint16_t);
10163 xcb_align_to = ALIGNOF(uint16_t);
10164 /* xcb_xkb_get_kbd_by_name_replies_t.geometry.geometry_length */
10165 _aux->geometry.geometry_length = *(uint32_t *)xcb_tmp;
10166 xcb_block_len += sizeof(uint32_t);
10167 xcb_tmp += sizeof(uint32_t);
10168 xcb_align_to = ALIGNOF(uint32_t);
10169 /* xcb_xkb_get_kbd_by_name_replies_t.geometry.name */
10170 _aux->geometry.name = *(xcb_atom_t *)xcb_tmp;
10171 xcb_block_len += sizeof(xcb_atom_t);
10172 xcb_tmp += sizeof(xcb_atom_t);
10173 xcb_align_to = ALIGNOF(xcb_atom_t);
10174 /* xcb_xkb_get_kbd_by_name_replies_t.geometry.geometryFound */
10175 _aux->geometry.geometryFound = *(uint8_t *)xcb_tmp;
10176 xcb_block_len += sizeof(uint8_t);
10177 xcb_tmp += sizeof(uint8_t);
10178 xcb_align_to = ALIGNOF(uint8_t);
10179 /* xcb_xkb_get_kbd_by_name_replies_t.geometry.pad7 */
10180 _aux->geometry.pad7 = *(uint8_t *)xcb_tmp;
10181 xcb_block_len += sizeof(uint8_t);
10182 xcb_tmp += sizeof(uint8_t);
10183 xcb_align_to = ALIGNOF(uint8_t);
10184 /* xcb_xkb_get_kbd_by_name_replies_t.geometry.widthMM */
10185 _aux->geometry.widthMM = *(uint16_t *)xcb_tmp;
10186 xcb_block_len += sizeof(uint16_t);
10187 xcb_tmp += sizeof(uint16_t);
10188 xcb_align_to = ALIGNOF(uint16_t);
10189 /* xcb_xkb_get_kbd_by_name_replies_t.geometry.heightMM */
10190 _aux->geometry.heightMM = *(uint16_t *)xcb_tmp;
10191 xcb_block_len += sizeof(uint16_t);
10192 xcb_tmp += sizeof(uint16_t);
10193 xcb_align_to = ALIGNOF(uint16_t);
10194 /* xcb_xkb_get_kbd_by_name_replies_t.geometry.nProperties */
10195 _aux->geometry.nProperties = *(uint16_t *)xcb_tmp;
10196 xcb_block_len += sizeof(uint16_t);
10197 xcb_tmp += sizeof(uint16_t);
10198 xcb_align_to = ALIGNOF(uint16_t);
10199 /* xcb_xkb_get_kbd_by_name_replies_t.geometry.nColors */
10200 _aux->geometry.nColors = *(uint16_t *)xcb_tmp;
10201 xcb_block_len += sizeof(uint16_t);
10202 xcb_tmp += sizeof(uint16_t);
10203 xcb_align_to = ALIGNOF(uint16_t);
10204 /* xcb_xkb_get_kbd_by_name_replies_t.geometry.nShapes */
10205 _aux->geometry.nShapes = *(uint16_t *)xcb_tmp;
10206 xcb_block_len += sizeof(uint16_t);
10207 xcb_tmp += sizeof(uint16_t);
10208 xcb_align_to = ALIGNOF(uint16_t);
10209 /* xcb_xkb_get_kbd_by_name_replies_t.geometry.nSections */
10210 _aux->geometry.nSections = *(uint16_t *)xcb_tmp;
10211 xcb_block_len += sizeof(uint16_t);
10212 xcb_tmp += sizeof(uint16_t);
10213 xcb_align_to = ALIGNOF(uint16_t);
10214 /* xcb_xkb_get_kbd_by_name_replies_t.geometry.nDoodads */
10215 _aux->geometry.nDoodads = *(uint16_t *)xcb_tmp;
10216 xcb_block_len += sizeof(uint16_t);
10217 xcb_tmp += sizeof(uint16_t);
10218 xcb_align_to = ALIGNOF(uint16_t);
10219 /* xcb_xkb_get_kbd_by_name_replies_t.geometry.nKeyAliases */
10220 _aux->geometry.nKeyAliases = *(uint16_t *)xcb_tmp;
10221 xcb_block_len += sizeof(uint16_t);
10222 xcb_tmp += sizeof(uint16_t);
10223 xcb_align_to = ALIGNOF(uint16_t);
10224 /* xcb_xkb_get_kbd_by_name_replies_t.geometry.baseColorNdx */
10225 _aux->geometry.baseColorNdx = *(uint8_t *)xcb_tmp;
10226 xcb_block_len += sizeof(uint8_t);
10227 xcb_tmp += sizeof(uint8_t);
10228 xcb_align_to = ALIGNOF(uint8_t);
10229 /* xcb_xkb_get_kbd_by_name_replies_t.geometry.labelColorNdx */
10230 _aux->geometry.labelColorNdx = *(uint8_t *)xcb_tmp;
10231 xcb_block_len += sizeof(uint8_t);
10232 xcb_tmp += sizeof(uint8_t);
10233 xcb_align_to = ALIGNOF(uint8_t);
10234 /* insert padding */
10235 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
10236 xcb_buffer_len += xcb_block_len + xcb_pad;
10237 if (0 != xcb_pad) {
10238 xcb_tmp += xcb_pad;
10239 xcb_pad = 0;
10241 xcb_block_len = 0;
10242 /* labelFont */
10243 _aux->geometry.labelFont = (xcb_xkb_counted_string_16_t *)xcb_tmp;
10244 xcb_block_len += xcb_xkb_counted_string_16_sizeof(xcb_tmp);
10245 xcb_tmp += xcb_block_len;
10246 xcb_align_to = ALIGNOF(xcb_xkb_counted_string_16_t);
10248 /* insert padding */
10249 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
10250 xcb_buffer_len += xcb_block_len + xcb_pad;
10251 if (0 != xcb_pad) {
10252 xcb_tmp += xcb_pad;
10253 xcb_pad = 0;
10255 xcb_block_len = 0;
10257 return xcb_buffer_len;
10261 xcb_xkb_get_kbd_by_name_replies_sizeof (const void *_buffer /**< */,
10262 uint16_t reported /**< */)
10264 xcb_xkb_get_kbd_by_name_replies_t _aux;
10265 return xcb_xkb_get_kbd_by_name_replies_unpack(_buffer, reported, &_aux);
10268 xcb_xkb_get_kbd_by_name_cookie_t
10269 xcb_xkb_get_kbd_by_name (xcb_connection_t *c /**< */,
10270 xcb_xkb_device_spec_t deviceSpec /**< */,
10271 uint16_t need /**< */,
10272 uint16_t want /**< */,
10273 uint8_t load /**< */)
10275 static const xcb_protocol_request_t xcb_req = {
10276 /* count */ 2,
10277 /* ext */ &xcb_xkb_id,
10278 /* opcode */ XCB_XKB_GET_KBD_BY_NAME,
10279 /* isvoid */ 0
10282 struct iovec xcb_parts[4];
10283 xcb_xkb_get_kbd_by_name_cookie_t xcb_ret;
10284 xcb_xkb_get_kbd_by_name_request_t xcb_out;
10286 xcb_out.deviceSpec = deviceSpec;
10287 xcb_out.need = need;
10288 xcb_out.want = want;
10289 xcb_out.load = load;
10290 xcb_out.pad0 = 0;
10292 xcb_parts[2].iov_base = (char *) &xcb_out;
10293 xcb_parts[2].iov_len = sizeof(xcb_out);
10294 xcb_parts[3].iov_base = 0;
10295 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
10297 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
10298 return xcb_ret;
10301 xcb_xkb_get_kbd_by_name_cookie_t
10302 xcb_xkb_get_kbd_by_name_unchecked (xcb_connection_t *c /**< */,
10303 xcb_xkb_device_spec_t deviceSpec /**< */,
10304 uint16_t need /**< */,
10305 uint16_t want /**< */,
10306 uint8_t load /**< */)
10308 static const xcb_protocol_request_t xcb_req = {
10309 /* count */ 2,
10310 /* ext */ &xcb_xkb_id,
10311 /* opcode */ XCB_XKB_GET_KBD_BY_NAME,
10312 /* isvoid */ 0
10315 struct iovec xcb_parts[4];
10316 xcb_xkb_get_kbd_by_name_cookie_t xcb_ret;
10317 xcb_xkb_get_kbd_by_name_request_t xcb_out;
10319 xcb_out.deviceSpec = deviceSpec;
10320 xcb_out.need = need;
10321 xcb_out.want = want;
10322 xcb_out.load = load;
10323 xcb_out.pad0 = 0;
10325 xcb_parts[2].iov_base = (char *) &xcb_out;
10326 xcb_parts[2].iov_len = sizeof(xcb_out);
10327 xcb_parts[3].iov_base = 0;
10328 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
10330 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
10331 return xcb_ret;
10334 void *
10335 xcb_xkb_get_kbd_by_name_replies (const xcb_xkb_get_kbd_by_name_reply_t *R /**< */)
10337 return (void *) (R + 1);
10340 xcb_xkb_get_kbd_by_name_reply_t *
10341 xcb_xkb_get_kbd_by_name_reply (xcb_connection_t *c /**< */,
10342 xcb_xkb_get_kbd_by_name_cookie_t cookie /**< */,
10343 xcb_generic_error_t **e /**< */)
10345 return (xcb_xkb_get_kbd_by_name_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
10349 xcb_xkb_get_device_info_sizeof (const void *_buffer /**< */)
10351 char *xcb_tmp = (char *)_buffer;
10352 const xcb_xkb_get_device_info_reply_t *_aux = (xcb_xkb_get_device_info_reply_t *)_buffer;
10353 unsigned int xcb_buffer_len = 0;
10354 unsigned int xcb_block_len = 0;
10355 unsigned int xcb_pad = 0;
10356 unsigned int xcb_align_to = 0;
10358 unsigned int i;
10359 unsigned int xcb_tmp_len;
10361 xcb_block_len += sizeof(xcb_xkb_get_device_info_reply_t);
10362 xcb_tmp += xcb_block_len;
10363 xcb_buffer_len += xcb_block_len;
10364 xcb_block_len = 0;
10365 /* name */
10366 xcb_block_len += _aux->nameLen * sizeof(xcb_xkb_string8_t);
10367 xcb_tmp += xcb_block_len;
10368 xcb_align_to = ALIGNOF(xcb_xkb_string8_t);
10369 /* insert padding */
10370 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
10371 xcb_buffer_len += xcb_block_len + xcb_pad;
10372 if (0 != xcb_pad) {
10373 xcb_tmp += xcb_pad;
10374 xcb_pad = 0;
10376 xcb_block_len = 0;
10377 /* btnActions */
10378 xcb_block_len += _aux->nBtnsRtrn * sizeof(xcb_xkb_action_t);
10379 xcb_tmp += xcb_block_len;
10380 xcb_align_to = ALIGNOF(xcb_xkb_action_t);
10381 /* insert padding */
10382 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
10383 xcb_buffer_len += xcb_block_len + xcb_pad;
10384 if (0 != xcb_pad) {
10385 xcb_tmp += xcb_pad;
10386 xcb_pad = 0;
10388 xcb_block_len = 0;
10389 /* leds */
10390 for(i=0; i<_aux->nDeviceLedFBs; i++) {
10391 xcb_tmp_len = xcb_xkb_device_led_info_sizeof(xcb_tmp);
10392 xcb_block_len += xcb_tmp_len;
10393 xcb_tmp += xcb_tmp_len;
10395 xcb_align_to = ALIGNOF(xcb_xkb_device_led_info_t);
10396 /* insert padding */
10397 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
10398 xcb_buffer_len += xcb_block_len + xcb_pad;
10399 if (0 != xcb_pad) {
10400 xcb_tmp += xcb_pad;
10401 xcb_pad = 0;
10403 xcb_block_len = 0;
10405 return xcb_buffer_len;
10408 xcb_xkb_get_device_info_cookie_t
10409 xcb_xkb_get_device_info (xcb_connection_t *c /**< */,
10410 xcb_xkb_device_spec_t deviceSpec /**< */,
10411 uint16_t wanted /**< */,
10412 uint8_t allButtons /**< */,
10413 uint8_t firstButton /**< */,
10414 uint8_t nButtons /**< */,
10415 xcb_xkb_led_class_spec_t ledClass /**< */,
10416 xcb_xkb_id_spec_t ledID /**< */)
10418 static const xcb_protocol_request_t xcb_req = {
10419 /* count */ 2,
10420 /* ext */ &xcb_xkb_id,
10421 /* opcode */ XCB_XKB_GET_DEVICE_INFO,
10422 /* isvoid */ 0
10425 struct iovec xcb_parts[4];
10426 xcb_xkb_get_device_info_cookie_t xcb_ret;
10427 xcb_xkb_get_device_info_request_t xcb_out;
10429 xcb_out.deviceSpec = deviceSpec;
10430 xcb_out.wanted = wanted;
10431 xcb_out.allButtons = allButtons;
10432 xcb_out.firstButton = firstButton;
10433 xcb_out.nButtons = nButtons;
10434 xcb_out.pad0 = 0;
10435 xcb_out.ledClass = ledClass;
10436 xcb_out.ledID = ledID;
10438 xcb_parts[2].iov_base = (char *) &xcb_out;
10439 xcb_parts[2].iov_len = sizeof(xcb_out);
10440 xcb_parts[3].iov_base = 0;
10441 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
10443 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
10444 return xcb_ret;
10447 xcb_xkb_get_device_info_cookie_t
10448 xcb_xkb_get_device_info_unchecked (xcb_connection_t *c /**< */,
10449 xcb_xkb_device_spec_t deviceSpec /**< */,
10450 uint16_t wanted /**< */,
10451 uint8_t allButtons /**< */,
10452 uint8_t firstButton /**< */,
10453 uint8_t nButtons /**< */,
10454 xcb_xkb_led_class_spec_t ledClass /**< */,
10455 xcb_xkb_id_spec_t ledID /**< */)
10457 static const xcb_protocol_request_t xcb_req = {
10458 /* count */ 2,
10459 /* ext */ &xcb_xkb_id,
10460 /* opcode */ XCB_XKB_GET_DEVICE_INFO,
10461 /* isvoid */ 0
10464 struct iovec xcb_parts[4];
10465 xcb_xkb_get_device_info_cookie_t xcb_ret;
10466 xcb_xkb_get_device_info_request_t xcb_out;
10468 xcb_out.deviceSpec = deviceSpec;
10469 xcb_out.wanted = wanted;
10470 xcb_out.allButtons = allButtons;
10471 xcb_out.firstButton = firstButton;
10472 xcb_out.nButtons = nButtons;
10473 xcb_out.pad0 = 0;
10474 xcb_out.ledClass = ledClass;
10475 xcb_out.ledID = ledID;
10477 xcb_parts[2].iov_base = (char *) &xcb_out;
10478 xcb_parts[2].iov_len = sizeof(xcb_out);
10479 xcb_parts[3].iov_base = 0;
10480 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
10482 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
10483 return xcb_ret;
10486 xcb_xkb_string8_t *
10487 xcb_xkb_get_device_info_name (const xcb_xkb_get_device_info_reply_t *R /**< */)
10489 return (xcb_xkb_string8_t *) (R + 1);
10493 xcb_xkb_get_device_info_name_length (const xcb_xkb_get_device_info_reply_t *R /**< */)
10495 return R->nameLen;
10498 xcb_generic_iterator_t
10499 xcb_xkb_get_device_info_name_end (const xcb_xkb_get_device_info_reply_t *R /**< */)
10501 xcb_generic_iterator_t i;
10502 i.data = ((xcb_xkb_string8_t *) (R + 1)) + (R->nameLen);
10503 i.rem = 0;
10504 i.index = (char *) i.data - (char *) R;
10505 return i;
10508 xcb_xkb_action_t *
10509 xcb_xkb_get_device_info_btn_actions (const xcb_xkb_get_device_info_reply_t *R /**< */)
10511 xcb_generic_iterator_t prev = xcb_xkb_get_device_info_name_end(R);
10512 return (xcb_xkb_action_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xkb_action_t, prev.index) + 0);
10516 xcb_xkb_get_device_info_btn_actions_length (const xcb_xkb_get_device_info_reply_t *R /**< */)
10518 return R->nBtnsRtrn;
10521 xcb_xkb_action_iterator_t
10522 xcb_xkb_get_device_info_btn_actions_iterator (const xcb_xkb_get_device_info_reply_t *R /**< */)
10524 xcb_xkb_action_iterator_t i;
10525 xcb_generic_iterator_t prev = xcb_xkb_get_device_info_name_end(R);
10526 i.data = (xcb_xkb_action_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xkb_action_t, prev.index));
10527 i.rem = R->nBtnsRtrn;
10528 i.index = (char *) i.data - (char *) R;
10529 return i;
10533 xcb_xkb_get_device_info_leds_length (const xcb_xkb_get_device_info_reply_t *R /**< */)
10535 return R->nDeviceLedFBs;
10538 xcb_xkb_device_led_info_iterator_t
10539 xcb_xkb_get_device_info_leds_iterator (const xcb_xkb_get_device_info_reply_t *R /**< */)
10541 xcb_xkb_device_led_info_iterator_t i;
10542 xcb_generic_iterator_t prev = xcb_xkb_action_end(xcb_xkb_get_device_info_btn_actions_iterator(R));
10543 i.data = (xcb_xkb_device_led_info_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xkb_device_led_info_t, prev.index));
10544 i.rem = R->nDeviceLedFBs;
10545 i.index = (char *) i.data - (char *) R;
10546 return i;
10549 xcb_xkb_get_device_info_reply_t *
10550 xcb_xkb_get_device_info_reply (xcb_connection_t *c /**< */,
10551 xcb_xkb_get_device_info_cookie_t cookie /**< */,
10552 xcb_generic_error_t **e /**< */)
10554 return (xcb_xkb_get_device_info_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
10558 xcb_xkb_set_device_info_sizeof (const void *_buffer /**< */)
10560 char *xcb_tmp = (char *)_buffer;
10561 const xcb_xkb_set_device_info_request_t *_aux = (xcb_xkb_set_device_info_request_t *)_buffer;
10562 unsigned int xcb_buffer_len = 0;
10563 unsigned int xcb_block_len = 0;
10564 unsigned int xcb_pad = 0;
10565 unsigned int xcb_align_to = 0;
10567 unsigned int i;
10568 unsigned int xcb_tmp_len;
10570 xcb_block_len += sizeof(xcb_xkb_set_device_info_request_t);
10571 xcb_tmp += xcb_block_len;
10572 xcb_buffer_len += xcb_block_len;
10573 xcb_block_len = 0;
10574 /* btnActions */
10575 xcb_block_len += _aux->nBtns * sizeof(xcb_xkb_action_t);
10576 xcb_tmp += xcb_block_len;
10577 xcb_align_to = ALIGNOF(xcb_xkb_action_t);
10578 /* insert padding */
10579 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
10580 xcb_buffer_len += xcb_block_len + xcb_pad;
10581 if (0 != xcb_pad) {
10582 xcb_tmp += xcb_pad;
10583 xcb_pad = 0;
10585 xcb_block_len = 0;
10586 /* leds */
10587 for(i=0; i<_aux->nDeviceLedFBs; i++) {
10588 xcb_tmp_len = xcb_xkb_device_led_info_sizeof(xcb_tmp);
10589 xcb_block_len += xcb_tmp_len;
10590 xcb_tmp += xcb_tmp_len;
10592 xcb_align_to = ALIGNOF(xcb_xkb_device_led_info_t);
10593 /* insert padding */
10594 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
10595 xcb_buffer_len += xcb_block_len + xcb_pad;
10596 if (0 != xcb_pad) {
10597 xcb_tmp += xcb_pad;
10598 xcb_pad = 0;
10600 xcb_block_len = 0;
10602 return xcb_buffer_len;
10605 xcb_void_cookie_t
10606 xcb_xkb_set_device_info_checked (xcb_connection_t *c /**< */,
10607 xcb_xkb_device_spec_t deviceSpec /**< */,
10608 uint8_t firstBtn /**< */,
10609 uint8_t nBtns /**< */,
10610 uint16_t change /**< */,
10611 uint16_t nDeviceLedFBs /**< */,
10612 const xcb_xkb_action_t *btnActions /**< */,
10613 const xcb_xkb_device_led_info_t *leds /**< */)
10615 static const xcb_protocol_request_t xcb_req = {
10616 /* count */ 6,
10617 /* ext */ &xcb_xkb_id,
10618 /* opcode */ XCB_XKB_SET_DEVICE_INFO,
10619 /* isvoid */ 1
10622 struct iovec xcb_parts[8];
10623 xcb_void_cookie_t xcb_ret;
10624 xcb_xkb_set_device_info_request_t xcb_out;
10625 unsigned int i;
10626 unsigned int xcb_tmp_len;
10627 char *xcb_tmp;
10629 xcb_out.deviceSpec = deviceSpec;
10630 xcb_out.firstBtn = firstBtn;
10631 xcb_out.nBtns = nBtns;
10632 xcb_out.change = change;
10633 xcb_out.nDeviceLedFBs = nDeviceLedFBs;
10635 xcb_parts[2].iov_base = (char *) &xcb_out;
10636 xcb_parts[2].iov_len = sizeof(xcb_out);
10637 xcb_parts[3].iov_base = 0;
10638 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
10639 /* xcb_xkb_action_t btnActions */
10640 xcb_parts[4].iov_base = (char *) btnActions;
10641 xcb_parts[4].iov_len = nBtns * sizeof(xcb_xkb_action_t);
10642 xcb_parts[5].iov_base = 0;
10643 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
10644 /* xcb_xkb_device_led_info_t leds */
10645 xcb_parts[6].iov_base = (char *) leds;
10646 xcb_parts[6].iov_len = 0;
10647 xcb_tmp = (char *)leds;
10648 for(i=0; i<nDeviceLedFBs; i++) {
10649 xcb_tmp_len = xcb_xkb_device_led_info_sizeof(xcb_tmp);
10650 xcb_parts[6].iov_len += xcb_tmp_len;
10651 xcb_tmp += xcb_tmp_len;
10653 xcb_parts[7].iov_base = 0;
10654 xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3;
10656 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
10657 return xcb_ret;
10660 xcb_void_cookie_t
10661 xcb_xkb_set_device_info (xcb_connection_t *c /**< */,
10662 xcb_xkb_device_spec_t deviceSpec /**< */,
10663 uint8_t firstBtn /**< */,
10664 uint8_t nBtns /**< */,
10665 uint16_t change /**< */,
10666 uint16_t nDeviceLedFBs /**< */,
10667 const xcb_xkb_action_t *btnActions /**< */,
10668 const xcb_xkb_device_led_info_t *leds /**< */)
10670 static const xcb_protocol_request_t xcb_req = {
10671 /* count */ 6,
10672 /* ext */ &xcb_xkb_id,
10673 /* opcode */ XCB_XKB_SET_DEVICE_INFO,
10674 /* isvoid */ 1
10677 struct iovec xcb_parts[8];
10678 xcb_void_cookie_t xcb_ret;
10679 xcb_xkb_set_device_info_request_t xcb_out;
10680 unsigned int i;
10681 unsigned int xcb_tmp_len;
10682 char *xcb_tmp;
10684 xcb_out.deviceSpec = deviceSpec;
10685 xcb_out.firstBtn = firstBtn;
10686 xcb_out.nBtns = nBtns;
10687 xcb_out.change = change;
10688 xcb_out.nDeviceLedFBs = nDeviceLedFBs;
10690 xcb_parts[2].iov_base = (char *) &xcb_out;
10691 xcb_parts[2].iov_len = sizeof(xcb_out);
10692 xcb_parts[3].iov_base = 0;
10693 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
10694 /* xcb_xkb_action_t btnActions */
10695 xcb_parts[4].iov_base = (char *) btnActions;
10696 xcb_parts[4].iov_len = nBtns * sizeof(xcb_xkb_action_t);
10697 xcb_parts[5].iov_base = 0;
10698 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
10699 /* xcb_xkb_device_led_info_t leds */
10700 xcb_parts[6].iov_base = (char *) leds;
10701 xcb_parts[6].iov_len = 0;
10702 xcb_tmp = (char *)leds;
10703 for(i=0; i<nDeviceLedFBs; i++) {
10704 xcb_tmp_len = xcb_xkb_device_led_info_sizeof(xcb_tmp);
10705 xcb_parts[6].iov_len += xcb_tmp_len;
10706 xcb_tmp += xcb_tmp_len;
10708 xcb_parts[7].iov_base = 0;
10709 xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3;
10711 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
10712 return xcb_ret;
10716 xcb_xkb_set_debugging_flags_sizeof (const void *_buffer /**< */)
10718 char *xcb_tmp = (char *)_buffer;
10719 const xcb_xkb_set_debugging_flags_request_t *_aux = (xcb_xkb_set_debugging_flags_request_t *)_buffer;
10720 unsigned int xcb_buffer_len = 0;
10721 unsigned int xcb_block_len = 0;
10722 unsigned int xcb_pad = 0;
10723 unsigned int xcb_align_to = 0;
10726 xcb_block_len += sizeof(xcb_xkb_set_debugging_flags_request_t);
10727 xcb_tmp += xcb_block_len;
10728 xcb_buffer_len += xcb_block_len;
10729 xcb_block_len = 0;
10730 /* message */
10731 xcb_block_len += _aux->msgLength * sizeof(xcb_xkb_string8_t);
10732 xcb_tmp += xcb_block_len;
10733 xcb_align_to = ALIGNOF(xcb_xkb_string8_t);
10734 /* insert padding */
10735 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
10736 xcb_buffer_len += xcb_block_len + xcb_pad;
10737 if (0 != xcb_pad) {
10738 xcb_tmp += xcb_pad;
10739 xcb_pad = 0;
10741 xcb_block_len = 0;
10743 return xcb_buffer_len;
10746 xcb_xkb_set_debugging_flags_cookie_t
10747 xcb_xkb_set_debugging_flags (xcb_connection_t *c /**< */,
10748 uint16_t msgLength /**< */,
10749 uint32_t affectFlags /**< */,
10750 uint32_t flags /**< */,
10751 uint32_t affectCtrls /**< */,
10752 uint32_t ctrls /**< */,
10753 const xcb_xkb_string8_t *message /**< */)
10755 static const xcb_protocol_request_t xcb_req = {
10756 /* count */ 4,
10757 /* ext */ &xcb_xkb_id,
10758 /* opcode */ XCB_XKB_SET_DEBUGGING_FLAGS,
10759 /* isvoid */ 0
10762 struct iovec xcb_parts[6];
10763 xcb_xkb_set_debugging_flags_cookie_t xcb_ret;
10764 xcb_xkb_set_debugging_flags_request_t xcb_out;
10766 xcb_out.msgLength = msgLength;
10767 memset(xcb_out.pad0, 0, 2);
10768 xcb_out.affectFlags = affectFlags;
10769 xcb_out.flags = flags;
10770 xcb_out.affectCtrls = affectCtrls;
10771 xcb_out.ctrls = ctrls;
10773 xcb_parts[2].iov_base = (char *) &xcb_out;
10774 xcb_parts[2].iov_len = sizeof(xcb_out);
10775 xcb_parts[3].iov_base = 0;
10776 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
10777 /* xcb_xkb_string8_t message */
10778 xcb_parts[4].iov_base = (char *) message;
10779 xcb_parts[4].iov_len = msgLength * sizeof(xcb_xkb_string8_t);
10780 xcb_parts[5].iov_base = 0;
10781 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
10783 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
10784 return xcb_ret;
10787 xcb_xkb_set_debugging_flags_cookie_t
10788 xcb_xkb_set_debugging_flags_unchecked (xcb_connection_t *c /**< */,
10789 uint16_t msgLength /**< */,
10790 uint32_t affectFlags /**< */,
10791 uint32_t flags /**< */,
10792 uint32_t affectCtrls /**< */,
10793 uint32_t ctrls /**< */,
10794 const xcb_xkb_string8_t *message /**< */)
10796 static const xcb_protocol_request_t xcb_req = {
10797 /* count */ 4,
10798 /* ext */ &xcb_xkb_id,
10799 /* opcode */ XCB_XKB_SET_DEBUGGING_FLAGS,
10800 /* isvoid */ 0
10803 struct iovec xcb_parts[6];
10804 xcb_xkb_set_debugging_flags_cookie_t xcb_ret;
10805 xcb_xkb_set_debugging_flags_request_t xcb_out;
10807 xcb_out.msgLength = msgLength;
10808 memset(xcb_out.pad0, 0, 2);
10809 xcb_out.affectFlags = affectFlags;
10810 xcb_out.flags = flags;
10811 xcb_out.affectCtrls = affectCtrls;
10812 xcb_out.ctrls = ctrls;
10814 xcb_parts[2].iov_base = (char *) &xcb_out;
10815 xcb_parts[2].iov_len = sizeof(xcb_out);
10816 xcb_parts[3].iov_base = 0;
10817 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
10818 /* xcb_xkb_string8_t message */
10819 xcb_parts[4].iov_base = (char *) message;
10820 xcb_parts[4].iov_len = msgLength * sizeof(xcb_xkb_string8_t);
10821 xcb_parts[5].iov_base = 0;
10822 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
10824 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
10825 return xcb_ret;
10828 xcb_xkb_set_debugging_flags_reply_t *
10829 xcb_xkb_set_debugging_flags_reply (xcb_connection_t *c /**< */,
10830 xcb_xkb_set_debugging_flags_cookie_t cookie /**< */,
10831 xcb_generic_error_t **e /**< */)
10833 return (xcb_xkb_set_debugging_flags_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);