etc/protocols - sync with NetBSD-8
[minix.git] / external / mit / xorg / lib / libxcb / files / xproto.c
blob4feb89d959697c3a1399f111a6e492a44ea32bbe
1 /*
2 * This file generated automatically from xproto.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 "xproto.h"
16 #define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member)
18 void
19 xcb_char2b_next (xcb_char2b_iterator_t *i /**< */)
21 --i->rem;
22 ++i->data;
23 i->index += sizeof(xcb_char2b_t);
26 xcb_generic_iterator_t
27 xcb_char2b_end (xcb_char2b_iterator_t i /**< */)
29 xcb_generic_iterator_t ret;
30 ret.data = i.data + i.rem;
31 ret.index = i.index + ((char *) ret.data - (char *) i.data);
32 ret.rem = 0;
33 return ret;
36 void
37 xcb_window_next (xcb_window_iterator_t *i /**< */)
39 --i->rem;
40 ++i->data;
41 i->index += sizeof(xcb_window_t);
44 xcb_generic_iterator_t
45 xcb_window_end (xcb_window_iterator_t i /**< */)
47 xcb_generic_iterator_t ret;
48 ret.data = i.data + i.rem;
49 ret.index = i.index + ((char *) ret.data - (char *) i.data);
50 ret.rem = 0;
51 return ret;
54 void
55 xcb_pixmap_next (xcb_pixmap_iterator_t *i /**< */)
57 --i->rem;
58 ++i->data;
59 i->index += sizeof(xcb_pixmap_t);
62 xcb_generic_iterator_t
63 xcb_pixmap_end (xcb_pixmap_iterator_t i /**< */)
65 xcb_generic_iterator_t ret;
66 ret.data = i.data + i.rem;
67 ret.index = i.index + ((char *) ret.data - (char *) i.data);
68 ret.rem = 0;
69 return ret;
72 void
73 xcb_cursor_next (xcb_cursor_iterator_t *i /**< */)
75 --i->rem;
76 ++i->data;
77 i->index += sizeof(xcb_cursor_t);
80 xcb_generic_iterator_t
81 xcb_cursor_end (xcb_cursor_iterator_t i /**< */)
83 xcb_generic_iterator_t ret;
84 ret.data = i.data + i.rem;
85 ret.index = i.index + ((char *) ret.data - (char *) i.data);
86 ret.rem = 0;
87 return ret;
90 void
91 xcb_font_next (xcb_font_iterator_t *i /**< */)
93 --i->rem;
94 ++i->data;
95 i->index += sizeof(xcb_font_t);
98 xcb_generic_iterator_t
99 xcb_font_end (xcb_font_iterator_t i /**< */)
101 xcb_generic_iterator_t ret;
102 ret.data = i.data + i.rem;
103 ret.index = i.index + ((char *) ret.data - (char *) i.data);
104 ret.rem = 0;
105 return ret;
108 void
109 xcb_gcontext_next (xcb_gcontext_iterator_t *i /**< */)
111 --i->rem;
112 ++i->data;
113 i->index += sizeof(xcb_gcontext_t);
116 xcb_generic_iterator_t
117 xcb_gcontext_end (xcb_gcontext_iterator_t i /**< */)
119 xcb_generic_iterator_t ret;
120 ret.data = i.data + i.rem;
121 ret.index = i.index + ((char *) ret.data - (char *) i.data);
122 ret.rem = 0;
123 return ret;
126 void
127 xcb_colormap_next (xcb_colormap_iterator_t *i /**< */)
129 --i->rem;
130 ++i->data;
131 i->index += sizeof(xcb_colormap_t);
134 xcb_generic_iterator_t
135 xcb_colormap_end (xcb_colormap_iterator_t i /**< */)
137 xcb_generic_iterator_t ret;
138 ret.data = i.data + i.rem;
139 ret.index = i.index + ((char *) ret.data - (char *) i.data);
140 ret.rem = 0;
141 return ret;
144 void
145 xcb_atom_next (xcb_atom_iterator_t *i /**< */)
147 --i->rem;
148 ++i->data;
149 i->index += sizeof(xcb_atom_t);
152 xcb_generic_iterator_t
153 xcb_atom_end (xcb_atom_iterator_t i /**< */)
155 xcb_generic_iterator_t ret;
156 ret.data = i.data + i.rem;
157 ret.index = i.index + ((char *) ret.data - (char *) i.data);
158 ret.rem = 0;
159 return ret;
162 void
163 xcb_drawable_next (xcb_drawable_iterator_t *i /**< */)
165 --i->rem;
166 ++i->data;
167 i->index += sizeof(xcb_drawable_t);
170 xcb_generic_iterator_t
171 xcb_drawable_end (xcb_drawable_iterator_t i /**< */)
173 xcb_generic_iterator_t ret;
174 ret.data = i.data + i.rem;
175 ret.index = i.index + ((char *) ret.data - (char *) i.data);
176 ret.rem = 0;
177 return ret;
180 void
181 xcb_fontable_next (xcb_fontable_iterator_t *i /**< */)
183 --i->rem;
184 ++i->data;
185 i->index += sizeof(xcb_fontable_t);
188 xcb_generic_iterator_t
189 xcb_fontable_end (xcb_fontable_iterator_t i /**< */)
191 xcb_generic_iterator_t ret;
192 ret.data = i.data + i.rem;
193 ret.index = i.index + ((char *) ret.data - (char *) i.data);
194 ret.rem = 0;
195 return ret;
198 void
199 xcb_visualid_next (xcb_visualid_iterator_t *i /**< */)
201 --i->rem;
202 ++i->data;
203 i->index += sizeof(xcb_visualid_t);
206 xcb_generic_iterator_t
207 xcb_visualid_end (xcb_visualid_iterator_t i /**< */)
209 xcb_generic_iterator_t ret;
210 ret.data = i.data + i.rem;
211 ret.index = i.index + ((char *) ret.data - (char *) i.data);
212 ret.rem = 0;
213 return ret;
216 void
217 xcb_timestamp_next (xcb_timestamp_iterator_t *i /**< */)
219 --i->rem;
220 ++i->data;
221 i->index += sizeof(xcb_timestamp_t);
224 xcb_generic_iterator_t
225 xcb_timestamp_end (xcb_timestamp_iterator_t i /**< */)
227 xcb_generic_iterator_t ret;
228 ret.data = i.data + i.rem;
229 ret.index = i.index + ((char *) ret.data - (char *) i.data);
230 ret.rem = 0;
231 return ret;
234 void
235 xcb_keysym_next (xcb_keysym_iterator_t *i /**< */)
237 --i->rem;
238 ++i->data;
239 i->index += sizeof(xcb_keysym_t);
242 xcb_generic_iterator_t
243 xcb_keysym_end (xcb_keysym_iterator_t i /**< */)
245 xcb_generic_iterator_t ret;
246 ret.data = i.data + i.rem;
247 ret.index = i.index + ((char *) ret.data - (char *) i.data);
248 ret.rem = 0;
249 return ret;
252 void
253 xcb_keycode_next (xcb_keycode_iterator_t *i /**< */)
255 --i->rem;
256 ++i->data;
257 i->index += sizeof(xcb_keycode_t);
260 xcb_generic_iterator_t
261 xcb_keycode_end (xcb_keycode_iterator_t i /**< */)
263 xcb_generic_iterator_t ret;
264 ret.data = i.data + i.rem;
265 ret.index = i.index + ((char *) ret.data - (char *) i.data);
266 ret.rem = 0;
267 return ret;
270 void
271 xcb_button_next (xcb_button_iterator_t *i /**< */)
273 --i->rem;
274 ++i->data;
275 i->index += sizeof(xcb_button_t);
278 xcb_generic_iterator_t
279 xcb_button_end (xcb_button_iterator_t i /**< */)
281 xcb_generic_iterator_t ret;
282 ret.data = i.data + i.rem;
283 ret.index = i.index + ((char *) ret.data - (char *) i.data);
284 ret.rem = 0;
285 return ret;
288 void
289 xcb_point_next (xcb_point_iterator_t *i /**< */)
291 --i->rem;
292 ++i->data;
293 i->index += sizeof(xcb_point_t);
296 xcb_generic_iterator_t
297 xcb_point_end (xcb_point_iterator_t i /**< */)
299 xcb_generic_iterator_t ret;
300 ret.data = i.data + i.rem;
301 ret.index = i.index + ((char *) ret.data - (char *) i.data);
302 ret.rem = 0;
303 return ret;
306 void
307 xcb_rectangle_next (xcb_rectangle_iterator_t *i /**< */)
309 --i->rem;
310 ++i->data;
311 i->index += sizeof(xcb_rectangle_t);
314 xcb_generic_iterator_t
315 xcb_rectangle_end (xcb_rectangle_iterator_t i /**< */)
317 xcb_generic_iterator_t ret;
318 ret.data = i.data + i.rem;
319 ret.index = i.index + ((char *) ret.data - (char *) i.data);
320 ret.rem = 0;
321 return ret;
324 void
325 xcb_arc_next (xcb_arc_iterator_t *i /**< */)
327 --i->rem;
328 ++i->data;
329 i->index += sizeof(xcb_arc_t);
332 xcb_generic_iterator_t
333 xcb_arc_end (xcb_arc_iterator_t i /**< */)
335 xcb_generic_iterator_t ret;
336 ret.data = i.data + i.rem;
337 ret.index = i.index + ((char *) ret.data - (char *) i.data);
338 ret.rem = 0;
339 return ret;
342 void
343 xcb_format_next (xcb_format_iterator_t *i /**< */)
345 --i->rem;
346 ++i->data;
347 i->index += sizeof(xcb_format_t);
350 xcb_generic_iterator_t
351 xcb_format_end (xcb_format_iterator_t i /**< */)
353 xcb_generic_iterator_t ret;
354 ret.data = i.data + i.rem;
355 ret.index = i.index + ((char *) ret.data - (char *) i.data);
356 ret.rem = 0;
357 return ret;
360 void
361 xcb_visualtype_next (xcb_visualtype_iterator_t *i /**< */)
363 --i->rem;
364 ++i->data;
365 i->index += sizeof(xcb_visualtype_t);
368 xcb_generic_iterator_t
369 xcb_visualtype_end (xcb_visualtype_iterator_t i /**< */)
371 xcb_generic_iterator_t ret;
372 ret.data = i.data + i.rem;
373 ret.index = i.index + ((char *) ret.data - (char *) i.data);
374 ret.rem = 0;
375 return ret;
379 xcb_depth_sizeof (const void *_buffer /**< */)
381 char *xcb_tmp = (char *)_buffer;
382 const xcb_depth_t *_aux = (xcb_depth_t *)_buffer;
383 unsigned int xcb_buffer_len = 0;
384 unsigned int xcb_block_len = 0;
385 unsigned int xcb_pad = 0;
386 unsigned int xcb_align_to = 0;
389 xcb_block_len += sizeof(xcb_depth_t);
390 xcb_tmp += xcb_block_len;
391 xcb_buffer_len += xcb_block_len;
392 xcb_block_len = 0;
393 /* visuals */
394 xcb_block_len += _aux->visuals_len * sizeof(xcb_visualtype_t);
395 xcb_tmp += xcb_block_len;
396 xcb_align_to = ALIGNOF(xcb_visualtype_t);
397 /* insert padding */
398 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
399 xcb_buffer_len += xcb_block_len + xcb_pad;
400 if (0 != xcb_pad) {
401 xcb_tmp += xcb_pad;
402 xcb_pad = 0;
404 xcb_block_len = 0;
406 return xcb_buffer_len;
409 xcb_visualtype_t *
410 xcb_depth_visuals (const xcb_depth_t *R /**< */)
412 return (xcb_visualtype_t *) (R + 1);
416 xcb_depth_visuals_length (const xcb_depth_t *R /**< */)
418 return R->visuals_len;
421 xcb_visualtype_iterator_t
422 xcb_depth_visuals_iterator (const xcb_depth_t *R /**< */)
424 xcb_visualtype_iterator_t i;
425 i.data = (xcb_visualtype_t *) (R + 1);
426 i.rem = R->visuals_len;
427 i.index = (char *) i.data - (char *) R;
428 return i;
431 void
432 xcb_depth_next (xcb_depth_iterator_t *i /**< */)
434 xcb_depth_t *R = i->data;
435 xcb_generic_iterator_t child;
436 child.data = (xcb_depth_t *)(((char *)R) + xcb_depth_sizeof(R));
437 i->index = (char *) child.data - (char *) i->data;
438 --i->rem;
439 i->data = (xcb_depth_t *) child.data;
442 xcb_generic_iterator_t
443 xcb_depth_end (xcb_depth_iterator_t i /**< */)
445 xcb_generic_iterator_t ret;
446 while(i.rem > 0)
447 xcb_depth_next(&i);
448 ret.data = i.data;
449 ret.rem = i.rem;
450 ret.index = i.index;
451 return ret;
455 xcb_screen_sizeof (const void *_buffer /**< */)
457 char *xcb_tmp = (char *)_buffer;
458 const xcb_screen_t *_aux = (xcb_screen_t *)_buffer;
459 unsigned int xcb_buffer_len = 0;
460 unsigned int xcb_block_len = 0;
461 unsigned int xcb_pad = 0;
462 unsigned int xcb_align_to = 0;
464 unsigned int i;
465 unsigned int xcb_tmp_len;
467 xcb_block_len += sizeof(xcb_screen_t);
468 xcb_tmp += xcb_block_len;
469 xcb_buffer_len += xcb_block_len;
470 xcb_block_len = 0;
471 /* allowed_depths */
472 for(i=0; i<_aux->allowed_depths_len; i++) {
473 xcb_tmp_len = xcb_depth_sizeof(xcb_tmp);
474 xcb_block_len += xcb_tmp_len;
475 xcb_tmp += xcb_tmp_len;
477 xcb_align_to = ALIGNOF(xcb_depth_t);
478 /* insert padding */
479 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
480 xcb_buffer_len += xcb_block_len + xcb_pad;
481 if (0 != xcb_pad) {
482 xcb_tmp += xcb_pad;
483 xcb_pad = 0;
485 xcb_block_len = 0;
487 return xcb_buffer_len;
491 xcb_screen_allowed_depths_length (const xcb_screen_t *R /**< */)
493 return R->allowed_depths_len;
496 xcb_depth_iterator_t
497 xcb_screen_allowed_depths_iterator (const xcb_screen_t *R /**< */)
499 xcb_depth_iterator_t i;
500 i.data = (xcb_depth_t *) (R + 1);
501 i.rem = R->allowed_depths_len;
502 i.index = (char *) i.data - (char *) R;
503 return i;
506 void
507 xcb_screen_next (xcb_screen_iterator_t *i /**< */)
509 xcb_screen_t *R = i->data;
510 xcb_generic_iterator_t child;
511 child.data = (xcb_screen_t *)(((char *)R) + xcb_screen_sizeof(R));
512 i->index = (char *) child.data - (char *) i->data;
513 --i->rem;
514 i->data = (xcb_screen_t *) child.data;
517 xcb_generic_iterator_t
518 xcb_screen_end (xcb_screen_iterator_t i /**< */)
520 xcb_generic_iterator_t ret;
521 while(i.rem > 0)
522 xcb_screen_next(&i);
523 ret.data = i.data;
524 ret.rem = i.rem;
525 ret.index = i.index;
526 return ret;
530 xcb_setup_request_sizeof (const void *_buffer /**< */)
532 char *xcb_tmp = (char *)_buffer;
533 const xcb_setup_request_t *_aux = (xcb_setup_request_t *)_buffer;
534 unsigned int xcb_buffer_len = 0;
535 unsigned int xcb_block_len = 0;
536 unsigned int xcb_pad = 0;
537 unsigned int xcb_align_to = 0;
540 xcb_block_len += sizeof(xcb_setup_request_t);
541 xcb_tmp += xcb_block_len;
542 xcb_buffer_len += xcb_block_len;
543 xcb_block_len = 0;
544 /* authorization_protocol_name */
545 xcb_block_len += _aux->authorization_protocol_name_len * sizeof(char);
546 xcb_tmp += xcb_block_len;
547 xcb_align_to = ALIGNOF(char);
548 /* insert padding */
549 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
550 xcb_buffer_len += xcb_block_len + xcb_pad;
551 if (0 != xcb_pad) {
552 xcb_tmp += xcb_pad;
553 xcb_pad = 0;
555 xcb_block_len = 0;
556 /* authorization_protocol_data */
557 xcb_block_len += _aux->authorization_protocol_data_len * sizeof(char);
558 xcb_tmp += xcb_block_len;
559 xcb_align_to = ALIGNOF(char);
560 /* insert padding */
561 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
562 xcb_buffer_len += xcb_block_len + xcb_pad;
563 if (0 != xcb_pad) {
564 xcb_tmp += xcb_pad;
565 xcb_pad = 0;
567 xcb_block_len = 0;
569 return xcb_buffer_len;
572 char *
573 xcb_setup_request_authorization_protocol_name (const xcb_setup_request_t *R /**< */)
575 return (char *) (R + 1);
579 xcb_setup_request_authorization_protocol_name_length (const xcb_setup_request_t *R /**< */)
581 return R->authorization_protocol_name_len;
584 xcb_generic_iterator_t
585 xcb_setup_request_authorization_protocol_name_end (const xcb_setup_request_t *R /**< */)
587 xcb_generic_iterator_t i;
588 i.data = ((char *) (R + 1)) + (R->authorization_protocol_name_len);
589 i.rem = 0;
590 i.index = (char *) i.data - (char *) R;
591 return i;
594 char *
595 xcb_setup_request_authorization_protocol_data (const xcb_setup_request_t *R /**< */)
597 xcb_generic_iterator_t prev = xcb_setup_request_authorization_protocol_name_end(R);
598 return (char *) ((char *) prev.data + XCB_TYPE_PAD(char, prev.index) + 0);
602 xcb_setup_request_authorization_protocol_data_length (const xcb_setup_request_t *R /**< */)
604 return R->authorization_protocol_data_len;
607 xcb_generic_iterator_t
608 xcb_setup_request_authorization_protocol_data_end (const xcb_setup_request_t *R /**< */)
610 xcb_generic_iterator_t i;
611 xcb_generic_iterator_t child = xcb_setup_request_authorization_protocol_name_end(R);
612 i.data = ((char *) child.data) + (R->authorization_protocol_data_len);
613 i.rem = 0;
614 i.index = (char *) i.data - (char *) R;
615 return i;
618 void
619 xcb_setup_request_next (xcb_setup_request_iterator_t *i /**< */)
621 xcb_setup_request_t *R = i->data;
622 xcb_generic_iterator_t child;
623 child.data = (xcb_setup_request_t *)(((char *)R) + xcb_setup_request_sizeof(R));
624 i->index = (char *) child.data - (char *) i->data;
625 --i->rem;
626 i->data = (xcb_setup_request_t *) child.data;
629 xcb_generic_iterator_t
630 xcb_setup_request_end (xcb_setup_request_iterator_t i /**< */)
632 xcb_generic_iterator_t ret;
633 while(i.rem > 0)
634 xcb_setup_request_next(&i);
635 ret.data = i.data;
636 ret.rem = i.rem;
637 ret.index = i.index;
638 return ret;
642 xcb_setup_failed_sizeof (const void *_buffer /**< */)
644 char *xcb_tmp = (char *)_buffer;
645 const xcb_setup_failed_t *_aux = (xcb_setup_failed_t *)_buffer;
646 unsigned int xcb_buffer_len = 0;
647 unsigned int xcb_block_len = 0;
648 unsigned int xcb_pad = 0;
649 unsigned int xcb_align_to = 0;
652 xcb_block_len += sizeof(xcb_setup_failed_t);
653 xcb_tmp += xcb_block_len;
654 xcb_buffer_len += xcb_block_len;
655 xcb_block_len = 0;
656 /* reason */
657 xcb_block_len += _aux->reason_len * sizeof(char);
658 xcb_tmp += xcb_block_len;
659 xcb_align_to = ALIGNOF(char);
660 /* insert padding */
661 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
662 xcb_buffer_len += xcb_block_len + xcb_pad;
663 if (0 != xcb_pad) {
664 xcb_tmp += xcb_pad;
665 xcb_pad = 0;
667 xcb_block_len = 0;
669 return xcb_buffer_len;
672 char *
673 xcb_setup_failed_reason (const xcb_setup_failed_t *R /**< */)
675 return (char *) (R + 1);
679 xcb_setup_failed_reason_length (const xcb_setup_failed_t *R /**< */)
681 return R->reason_len;
684 xcb_generic_iterator_t
685 xcb_setup_failed_reason_end (const xcb_setup_failed_t *R /**< */)
687 xcb_generic_iterator_t i;
688 i.data = ((char *) (R + 1)) + (R->reason_len);
689 i.rem = 0;
690 i.index = (char *) i.data - (char *) R;
691 return i;
694 void
695 xcb_setup_failed_next (xcb_setup_failed_iterator_t *i /**< */)
697 xcb_setup_failed_t *R = i->data;
698 xcb_generic_iterator_t child;
699 child.data = (xcb_setup_failed_t *)(((char *)R) + xcb_setup_failed_sizeof(R));
700 i->index = (char *) child.data - (char *) i->data;
701 --i->rem;
702 i->data = (xcb_setup_failed_t *) child.data;
705 xcb_generic_iterator_t
706 xcb_setup_failed_end (xcb_setup_failed_iterator_t i /**< */)
708 xcb_generic_iterator_t ret;
709 while(i.rem > 0)
710 xcb_setup_failed_next(&i);
711 ret.data = i.data;
712 ret.rem = i.rem;
713 ret.index = i.index;
714 return ret;
718 xcb_setup_authenticate_sizeof (const void *_buffer /**< */)
720 char *xcb_tmp = (char *)_buffer;
721 const xcb_setup_authenticate_t *_aux = (xcb_setup_authenticate_t *)_buffer;
722 unsigned int xcb_buffer_len = 0;
723 unsigned int xcb_block_len = 0;
724 unsigned int xcb_pad = 0;
725 unsigned int xcb_align_to = 0;
728 xcb_block_len += sizeof(xcb_setup_authenticate_t);
729 xcb_tmp += xcb_block_len;
730 xcb_buffer_len += xcb_block_len;
731 xcb_block_len = 0;
732 /* reason */
733 xcb_block_len += (_aux->length * 4) * sizeof(char);
734 xcb_tmp += xcb_block_len;
735 xcb_align_to = ALIGNOF(char);
736 /* insert padding */
737 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
738 xcb_buffer_len += xcb_block_len + xcb_pad;
739 if (0 != xcb_pad) {
740 xcb_tmp += xcb_pad;
741 xcb_pad = 0;
743 xcb_block_len = 0;
745 return xcb_buffer_len;
748 char *
749 xcb_setup_authenticate_reason (const xcb_setup_authenticate_t *R /**< */)
751 return (char *) (R + 1);
755 xcb_setup_authenticate_reason_length (const xcb_setup_authenticate_t *R /**< */)
757 return (R->length * 4);
760 xcb_generic_iterator_t
761 xcb_setup_authenticate_reason_end (const xcb_setup_authenticate_t *R /**< */)
763 xcb_generic_iterator_t i;
764 i.data = ((char *) (R + 1)) + ((R->length * 4));
765 i.rem = 0;
766 i.index = (char *) i.data - (char *) R;
767 return i;
770 void
771 xcb_setup_authenticate_next (xcb_setup_authenticate_iterator_t *i /**< */)
773 xcb_setup_authenticate_t *R = i->data;
774 xcb_generic_iterator_t child;
775 child.data = (xcb_setup_authenticate_t *)(((char *)R) + xcb_setup_authenticate_sizeof(R));
776 i->index = (char *) child.data - (char *) i->data;
777 --i->rem;
778 i->data = (xcb_setup_authenticate_t *) child.data;
781 xcb_generic_iterator_t
782 xcb_setup_authenticate_end (xcb_setup_authenticate_iterator_t i /**< */)
784 xcb_generic_iterator_t ret;
785 while(i.rem > 0)
786 xcb_setup_authenticate_next(&i);
787 ret.data = i.data;
788 ret.rem = i.rem;
789 ret.index = i.index;
790 return ret;
794 xcb_setup_sizeof (const void *_buffer /**< */)
796 char *xcb_tmp = (char *)_buffer;
797 const xcb_setup_t *_aux = (xcb_setup_t *)_buffer;
798 unsigned int xcb_buffer_len = 0;
799 unsigned int xcb_block_len = 0;
800 unsigned int xcb_pad = 0;
801 unsigned int xcb_align_to = 0;
803 unsigned int i;
804 unsigned int xcb_tmp_len;
806 xcb_block_len += sizeof(xcb_setup_t);
807 xcb_tmp += xcb_block_len;
808 xcb_buffer_len += xcb_block_len;
809 xcb_block_len = 0;
810 /* vendor */
811 xcb_block_len += _aux->vendor_len * sizeof(char);
812 xcb_tmp += xcb_block_len;
813 xcb_align_to = ALIGNOF(char);
814 /* insert padding */
815 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
816 xcb_buffer_len += xcb_block_len + xcb_pad;
817 if (0 != xcb_pad) {
818 xcb_tmp += xcb_pad;
819 xcb_pad = 0;
821 xcb_block_len = 0;
822 /* pixmap_formats */
823 xcb_block_len += _aux->pixmap_formats_len * sizeof(xcb_format_t);
824 xcb_tmp += xcb_block_len;
825 xcb_align_to = ALIGNOF(xcb_format_t);
826 /* insert padding */
827 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
828 xcb_buffer_len += xcb_block_len + xcb_pad;
829 if (0 != xcb_pad) {
830 xcb_tmp += xcb_pad;
831 xcb_pad = 0;
833 xcb_block_len = 0;
834 /* roots */
835 for(i=0; i<_aux->roots_len; i++) {
836 xcb_tmp_len = xcb_screen_sizeof(xcb_tmp);
837 xcb_block_len += xcb_tmp_len;
838 xcb_tmp += xcb_tmp_len;
840 xcb_align_to = ALIGNOF(xcb_screen_t);
841 /* insert padding */
842 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
843 xcb_buffer_len += xcb_block_len + xcb_pad;
844 if (0 != xcb_pad) {
845 xcb_tmp += xcb_pad;
846 xcb_pad = 0;
848 xcb_block_len = 0;
850 return xcb_buffer_len;
853 char *
854 xcb_setup_vendor (const xcb_setup_t *R /**< */)
856 return (char *) (R + 1);
860 xcb_setup_vendor_length (const xcb_setup_t *R /**< */)
862 return R->vendor_len;
865 xcb_generic_iterator_t
866 xcb_setup_vendor_end (const xcb_setup_t *R /**< */)
868 xcb_generic_iterator_t i;
869 i.data = ((char *) (R + 1)) + (R->vendor_len);
870 i.rem = 0;
871 i.index = (char *) i.data - (char *) R;
872 return i;
875 xcb_format_t *
876 xcb_setup_pixmap_formats (const xcb_setup_t *R /**< */)
878 xcb_generic_iterator_t prev = xcb_setup_vendor_end(R);
879 return (xcb_format_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_format_t, prev.index) + 0);
883 xcb_setup_pixmap_formats_length (const xcb_setup_t *R /**< */)
885 return R->pixmap_formats_len;
888 xcb_format_iterator_t
889 xcb_setup_pixmap_formats_iterator (const xcb_setup_t *R /**< */)
891 xcb_format_iterator_t i;
892 xcb_generic_iterator_t prev = xcb_setup_vendor_end(R);
893 i.data = (xcb_format_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_format_t, prev.index));
894 i.rem = R->pixmap_formats_len;
895 i.index = (char *) i.data - (char *) R;
896 return i;
900 xcb_setup_roots_length (const xcb_setup_t *R /**< */)
902 return R->roots_len;
905 xcb_screen_iterator_t
906 xcb_setup_roots_iterator (const xcb_setup_t *R /**< */)
908 xcb_screen_iterator_t i;
909 xcb_generic_iterator_t prev = xcb_format_end(xcb_setup_pixmap_formats_iterator(R));
910 i.data = (xcb_screen_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_screen_t, prev.index));
911 i.rem = R->roots_len;
912 i.index = (char *) i.data - (char *) R;
913 return i;
916 void
917 xcb_setup_next (xcb_setup_iterator_t *i /**< */)
919 xcb_setup_t *R = i->data;
920 xcb_generic_iterator_t child;
921 child.data = (xcb_setup_t *)(((char *)R) + xcb_setup_sizeof(R));
922 i->index = (char *) child.data - (char *) i->data;
923 --i->rem;
924 i->data = (xcb_setup_t *) child.data;
927 xcb_generic_iterator_t
928 xcb_setup_end (xcb_setup_iterator_t i /**< */)
930 xcb_generic_iterator_t ret;
931 while(i.rem > 0)
932 xcb_setup_next(&i);
933 ret.data = i.data;
934 ret.rem = i.rem;
935 ret.index = i.index;
936 return ret;
939 void
940 xcb_client_message_data_next (xcb_client_message_data_iterator_t *i /**< */)
942 --i->rem;
943 ++i->data;
944 i->index += sizeof(xcb_client_message_data_t);
947 xcb_generic_iterator_t
948 xcb_client_message_data_end (xcb_client_message_data_iterator_t i /**< */)
950 xcb_generic_iterator_t ret;
951 ret.data = i.data + i.rem;
952 ret.index = i.index + ((char *) ret.data - (char *) i.data);
953 ret.rem = 0;
954 return ret;
958 xcb_create_window_sizeof (const void *_buffer /**< */)
960 char *xcb_tmp = (char *)_buffer;
961 const xcb_create_window_request_t *_aux = (xcb_create_window_request_t *)_buffer;
962 unsigned int xcb_buffer_len = 0;
963 unsigned int xcb_block_len = 0;
964 unsigned int xcb_pad = 0;
965 unsigned int xcb_align_to = 0;
968 xcb_block_len += sizeof(xcb_create_window_request_t);
969 xcb_tmp += xcb_block_len;
970 xcb_buffer_len += xcb_block_len;
971 xcb_block_len = 0;
972 /* value_list */
973 xcb_block_len += xcb_popcount(_aux->value_mask) * sizeof(uint32_t);
974 xcb_tmp += xcb_block_len;
975 xcb_align_to = ALIGNOF(uint32_t);
976 /* insert padding */
977 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
978 xcb_buffer_len += xcb_block_len + xcb_pad;
979 if (0 != xcb_pad) {
980 xcb_tmp += xcb_pad;
981 xcb_pad = 0;
983 xcb_block_len = 0;
985 return xcb_buffer_len;
988 xcb_void_cookie_t
989 xcb_create_window_checked (xcb_connection_t *c /**< */,
990 uint8_t depth /**< */,
991 xcb_window_t wid /**< */,
992 xcb_window_t parent /**< */,
993 int16_t x /**< */,
994 int16_t y /**< */,
995 uint16_t width /**< */,
996 uint16_t height /**< */,
997 uint16_t border_width /**< */,
998 uint16_t _class /**< */,
999 xcb_visualid_t visual /**< */,
1000 uint32_t value_mask /**< */,
1001 const uint32_t *value_list /**< */)
1003 static const xcb_protocol_request_t xcb_req = {
1004 /* count */ 4,
1005 /* ext */ 0,
1006 /* opcode */ XCB_CREATE_WINDOW,
1007 /* isvoid */ 1
1010 struct iovec xcb_parts[6];
1011 xcb_void_cookie_t xcb_ret;
1012 xcb_create_window_request_t xcb_out;
1014 xcb_out.depth = depth;
1015 xcb_out.wid = wid;
1016 xcb_out.parent = parent;
1017 xcb_out.x = x;
1018 xcb_out.y = y;
1019 xcb_out.width = width;
1020 xcb_out.height = height;
1021 xcb_out.border_width = border_width;
1022 xcb_out._class = _class;
1023 xcb_out.visual = visual;
1024 xcb_out.value_mask = value_mask;
1026 xcb_parts[2].iov_base = (char *) &xcb_out;
1027 xcb_parts[2].iov_len = sizeof(xcb_out);
1028 xcb_parts[3].iov_base = 0;
1029 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1030 /* uint32_t value_list */
1031 xcb_parts[4].iov_base = (char *) value_list;
1032 xcb_parts[4].iov_len = xcb_popcount(value_mask) * sizeof(uint32_t);
1033 xcb_parts[5].iov_base = 0;
1034 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1036 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1037 return xcb_ret;
1040 xcb_void_cookie_t
1041 xcb_create_window (xcb_connection_t *c /**< */,
1042 uint8_t depth /**< */,
1043 xcb_window_t wid /**< */,
1044 xcb_window_t parent /**< */,
1045 int16_t x /**< */,
1046 int16_t y /**< */,
1047 uint16_t width /**< */,
1048 uint16_t height /**< */,
1049 uint16_t border_width /**< */,
1050 uint16_t _class /**< */,
1051 xcb_visualid_t visual /**< */,
1052 uint32_t value_mask /**< */,
1053 const uint32_t *value_list /**< */)
1055 static const xcb_protocol_request_t xcb_req = {
1056 /* count */ 4,
1057 /* ext */ 0,
1058 /* opcode */ XCB_CREATE_WINDOW,
1059 /* isvoid */ 1
1062 struct iovec xcb_parts[6];
1063 xcb_void_cookie_t xcb_ret;
1064 xcb_create_window_request_t xcb_out;
1066 xcb_out.depth = depth;
1067 xcb_out.wid = wid;
1068 xcb_out.parent = parent;
1069 xcb_out.x = x;
1070 xcb_out.y = y;
1071 xcb_out.width = width;
1072 xcb_out.height = height;
1073 xcb_out.border_width = border_width;
1074 xcb_out._class = _class;
1075 xcb_out.visual = visual;
1076 xcb_out.value_mask = value_mask;
1078 xcb_parts[2].iov_base = (char *) &xcb_out;
1079 xcb_parts[2].iov_len = sizeof(xcb_out);
1080 xcb_parts[3].iov_base = 0;
1081 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1082 /* uint32_t value_list */
1083 xcb_parts[4].iov_base = (char *) value_list;
1084 xcb_parts[4].iov_len = xcb_popcount(value_mask) * sizeof(uint32_t);
1085 xcb_parts[5].iov_base = 0;
1086 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1088 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1089 return xcb_ret;
1093 xcb_change_window_attributes_sizeof (const void *_buffer /**< */)
1095 char *xcb_tmp = (char *)_buffer;
1096 const xcb_change_window_attributes_request_t *_aux = (xcb_change_window_attributes_request_t *)_buffer;
1097 unsigned int xcb_buffer_len = 0;
1098 unsigned int xcb_block_len = 0;
1099 unsigned int xcb_pad = 0;
1100 unsigned int xcb_align_to = 0;
1103 xcb_block_len += sizeof(xcb_change_window_attributes_request_t);
1104 xcb_tmp += xcb_block_len;
1105 xcb_buffer_len += xcb_block_len;
1106 xcb_block_len = 0;
1107 /* value_list */
1108 xcb_block_len += xcb_popcount(_aux->value_mask) * sizeof(uint32_t);
1109 xcb_tmp += xcb_block_len;
1110 xcb_align_to = ALIGNOF(uint32_t);
1111 /* insert padding */
1112 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1113 xcb_buffer_len += xcb_block_len + xcb_pad;
1114 if (0 != xcb_pad) {
1115 xcb_tmp += xcb_pad;
1116 xcb_pad = 0;
1118 xcb_block_len = 0;
1120 return xcb_buffer_len;
1123 xcb_void_cookie_t
1124 xcb_change_window_attributes_checked (xcb_connection_t *c /**< */,
1125 xcb_window_t window /**< */,
1126 uint32_t value_mask /**< */,
1127 const uint32_t *value_list /**< */)
1129 static const xcb_protocol_request_t xcb_req = {
1130 /* count */ 4,
1131 /* ext */ 0,
1132 /* opcode */ XCB_CHANGE_WINDOW_ATTRIBUTES,
1133 /* isvoid */ 1
1136 struct iovec xcb_parts[6];
1137 xcb_void_cookie_t xcb_ret;
1138 xcb_change_window_attributes_request_t xcb_out;
1140 xcb_out.pad0 = 0;
1141 xcb_out.window = window;
1142 xcb_out.value_mask = value_mask;
1144 xcb_parts[2].iov_base = (char *) &xcb_out;
1145 xcb_parts[2].iov_len = sizeof(xcb_out);
1146 xcb_parts[3].iov_base = 0;
1147 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1148 /* uint32_t value_list */
1149 xcb_parts[4].iov_base = (char *) value_list;
1150 xcb_parts[4].iov_len = xcb_popcount(value_mask) * sizeof(uint32_t);
1151 xcb_parts[5].iov_base = 0;
1152 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1154 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1155 return xcb_ret;
1158 xcb_void_cookie_t
1159 xcb_change_window_attributes (xcb_connection_t *c /**< */,
1160 xcb_window_t window /**< */,
1161 uint32_t value_mask /**< */,
1162 const uint32_t *value_list /**< */)
1164 static const xcb_protocol_request_t xcb_req = {
1165 /* count */ 4,
1166 /* ext */ 0,
1167 /* opcode */ XCB_CHANGE_WINDOW_ATTRIBUTES,
1168 /* isvoid */ 1
1171 struct iovec xcb_parts[6];
1172 xcb_void_cookie_t xcb_ret;
1173 xcb_change_window_attributes_request_t xcb_out;
1175 xcb_out.pad0 = 0;
1176 xcb_out.window = window;
1177 xcb_out.value_mask = value_mask;
1179 xcb_parts[2].iov_base = (char *) &xcb_out;
1180 xcb_parts[2].iov_len = sizeof(xcb_out);
1181 xcb_parts[3].iov_base = 0;
1182 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1183 /* uint32_t value_list */
1184 xcb_parts[4].iov_base = (char *) value_list;
1185 xcb_parts[4].iov_len = xcb_popcount(value_mask) * sizeof(uint32_t);
1186 xcb_parts[5].iov_base = 0;
1187 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1189 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1190 return xcb_ret;
1193 xcb_get_window_attributes_cookie_t
1194 xcb_get_window_attributes (xcb_connection_t *c /**< */,
1195 xcb_window_t window /**< */)
1197 static const xcb_protocol_request_t xcb_req = {
1198 /* count */ 2,
1199 /* ext */ 0,
1200 /* opcode */ XCB_GET_WINDOW_ATTRIBUTES,
1201 /* isvoid */ 0
1204 struct iovec xcb_parts[4];
1205 xcb_get_window_attributes_cookie_t xcb_ret;
1206 xcb_get_window_attributes_request_t xcb_out;
1208 xcb_out.pad0 = 0;
1209 xcb_out.window = window;
1211 xcb_parts[2].iov_base = (char *) &xcb_out;
1212 xcb_parts[2].iov_len = sizeof(xcb_out);
1213 xcb_parts[3].iov_base = 0;
1214 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1216 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1217 return xcb_ret;
1220 xcb_get_window_attributes_cookie_t
1221 xcb_get_window_attributes_unchecked (xcb_connection_t *c /**< */,
1222 xcb_window_t window /**< */)
1224 static const xcb_protocol_request_t xcb_req = {
1225 /* count */ 2,
1226 /* ext */ 0,
1227 /* opcode */ XCB_GET_WINDOW_ATTRIBUTES,
1228 /* isvoid */ 0
1231 struct iovec xcb_parts[4];
1232 xcb_get_window_attributes_cookie_t xcb_ret;
1233 xcb_get_window_attributes_request_t xcb_out;
1235 xcb_out.pad0 = 0;
1236 xcb_out.window = window;
1238 xcb_parts[2].iov_base = (char *) &xcb_out;
1239 xcb_parts[2].iov_len = sizeof(xcb_out);
1240 xcb_parts[3].iov_base = 0;
1241 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1243 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1244 return xcb_ret;
1247 xcb_get_window_attributes_reply_t *
1248 xcb_get_window_attributes_reply (xcb_connection_t *c /**< */,
1249 xcb_get_window_attributes_cookie_t cookie /**< */,
1250 xcb_generic_error_t **e /**< */)
1252 return (xcb_get_window_attributes_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1255 xcb_void_cookie_t
1256 xcb_destroy_window_checked (xcb_connection_t *c /**< */,
1257 xcb_window_t window /**< */)
1259 static const xcb_protocol_request_t xcb_req = {
1260 /* count */ 2,
1261 /* ext */ 0,
1262 /* opcode */ XCB_DESTROY_WINDOW,
1263 /* isvoid */ 1
1266 struct iovec xcb_parts[4];
1267 xcb_void_cookie_t xcb_ret;
1268 xcb_destroy_window_request_t xcb_out;
1270 xcb_out.pad0 = 0;
1271 xcb_out.window = window;
1273 xcb_parts[2].iov_base = (char *) &xcb_out;
1274 xcb_parts[2].iov_len = sizeof(xcb_out);
1275 xcb_parts[3].iov_base = 0;
1276 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1278 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1279 return xcb_ret;
1282 xcb_void_cookie_t
1283 xcb_destroy_window (xcb_connection_t *c /**< */,
1284 xcb_window_t window /**< */)
1286 static const xcb_protocol_request_t xcb_req = {
1287 /* count */ 2,
1288 /* ext */ 0,
1289 /* opcode */ XCB_DESTROY_WINDOW,
1290 /* isvoid */ 1
1293 struct iovec xcb_parts[4];
1294 xcb_void_cookie_t xcb_ret;
1295 xcb_destroy_window_request_t xcb_out;
1297 xcb_out.pad0 = 0;
1298 xcb_out.window = window;
1300 xcb_parts[2].iov_base = (char *) &xcb_out;
1301 xcb_parts[2].iov_len = sizeof(xcb_out);
1302 xcb_parts[3].iov_base = 0;
1303 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1305 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1306 return xcb_ret;
1309 xcb_void_cookie_t
1310 xcb_destroy_subwindows_checked (xcb_connection_t *c /**< */,
1311 xcb_window_t window /**< */)
1313 static const xcb_protocol_request_t xcb_req = {
1314 /* count */ 2,
1315 /* ext */ 0,
1316 /* opcode */ XCB_DESTROY_SUBWINDOWS,
1317 /* isvoid */ 1
1320 struct iovec xcb_parts[4];
1321 xcb_void_cookie_t xcb_ret;
1322 xcb_destroy_subwindows_request_t xcb_out;
1324 xcb_out.pad0 = 0;
1325 xcb_out.window = window;
1327 xcb_parts[2].iov_base = (char *) &xcb_out;
1328 xcb_parts[2].iov_len = sizeof(xcb_out);
1329 xcb_parts[3].iov_base = 0;
1330 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1332 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1333 return xcb_ret;
1336 xcb_void_cookie_t
1337 xcb_destroy_subwindows (xcb_connection_t *c /**< */,
1338 xcb_window_t window /**< */)
1340 static const xcb_protocol_request_t xcb_req = {
1341 /* count */ 2,
1342 /* ext */ 0,
1343 /* opcode */ XCB_DESTROY_SUBWINDOWS,
1344 /* isvoid */ 1
1347 struct iovec xcb_parts[4];
1348 xcb_void_cookie_t xcb_ret;
1349 xcb_destroy_subwindows_request_t xcb_out;
1351 xcb_out.pad0 = 0;
1352 xcb_out.window = window;
1354 xcb_parts[2].iov_base = (char *) &xcb_out;
1355 xcb_parts[2].iov_len = sizeof(xcb_out);
1356 xcb_parts[3].iov_base = 0;
1357 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1359 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1360 return xcb_ret;
1363 xcb_void_cookie_t
1364 xcb_change_save_set_checked (xcb_connection_t *c /**< */,
1365 uint8_t mode /**< */,
1366 xcb_window_t window /**< */)
1368 static const xcb_protocol_request_t xcb_req = {
1369 /* count */ 2,
1370 /* ext */ 0,
1371 /* opcode */ XCB_CHANGE_SAVE_SET,
1372 /* isvoid */ 1
1375 struct iovec xcb_parts[4];
1376 xcb_void_cookie_t xcb_ret;
1377 xcb_change_save_set_request_t xcb_out;
1379 xcb_out.mode = mode;
1380 xcb_out.window = window;
1382 xcb_parts[2].iov_base = (char *) &xcb_out;
1383 xcb_parts[2].iov_len = sizeof(xcb_out);
1384 xcb_parts[3].iov_base = 0;
1385 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1387 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1388 return xcb_ret;
1391 xcb_void_cookie_t
1392 xcb_change_save_set (xcb_connection_t *c /**< */,
1393 uint8_t mode /**< */,
1394 xcb_window_t window /**< */)
1396 static const xcb_protocol_request_t xcb_req = {
1397 /* count */ 2,
1398 /* ext */ 0,
1399 /* opcode */ XCB_CHANGE_SAVE_SET,
1400 /* isvoid */ 1
1403 struct iovec xcb_parts[4];
1404 xcb_void_cookie_t xcb_ret;
1405 xcb_change_save_set_request_t xcb_out;
1407 xcb_out.mode = mode;
1408 xcb_out.window = window;
1410 xcb_parts[2].iov_base = (char *) &xcb_out;
1411 xcb_parts[2].iov_len = sizeof(xcb_out);
1412 xcb_parts[3].iov_base = 0;
1413 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1415 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1416 return xcb_ret;
1419 xcb_void_cookie_t
1420 xcb_reparent_window_checked (xcb_connection_t *c /**< */,
1421 xcb_window_t window /**< */,
1422 xcb_window_t parent /**< */,
1423 int16_t x /**< */,
1424 int16_t y /**< */)
1426 static const xcb_protocol_request_t xcb_req = {
1427 /* count */ 2,
1428 /* ext */ 0,
1429 /* opcode */ XCB_REPARENT_WINDOW,
1430 /* isvoid */ 1
1433 struct iovec xcb_parts[4];
1434 xcb_void_cookie_t xcb_ret;
1435 xcb_reparent_window_request_t xcb_out;
1437 xcb_out.pad0 = 0;
1438 xcb_out.window = window;
1439 xcb_out.parent = parent;
1440 xcb_out.x = x;
1441 xcb_out.y = y;
1443 xcb_parts[2].iov_base = (char *) &xcb_out;
1444 xcb_parts[2].iov_len = sizeof(xcb_out);
1445 xcb_parts[3].iov_base = 0;
1446 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1448 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1449 return xcb_ret;
1452 xcb_void_cookie_t
1453 xcb_reparent_window (xcb_connection_t *c /**< */,
1454 xcb_window_t window /**< */,
1455 xcb_window_t parent /**< */,
1456 int16_t x /**< */,
1457 int16_t y /**< */)
1459 static const xcb_protocol_request_t xcb_req = {
1460 /* count */ 2,
1461 /* ext */ 0,
1462 /* opcode */ XCB_REPARENT_WINDOW,
1463 /* isvoid */ 1
1466 struct iovec xcb_parts[4];
1467 xcb_void_cookie_t xcb_ret;
1468 xcb_reparent_window_request_t xcb_out;
1470 xcb_out.pad0 = 0;
1471 xcb_out.window = window;
1472 xcb_out.parent = parent;
1473 xcb_out.x = x;
1474 xcb_out.y = y;
1476 xcb_parts[2].iov_base = (char *) &xcb_out;
1477 xcb_parts[2].iov_len = sizeof(xcb_out);
1478 xcb_parts[3].iov_base = 0;
1479 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1481 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1482 return xcb_ret;
1485 xcb_void_cookie_t
1486 xcb_map_window_checked (xcb_connection_t *c /**< */,
1487 xcb_window_t window /**< */)
1489 static const xcb_protocol_request_t xcb_req = {
1490 /* count */ 2,
1491 /* ext */ 0,
1492 /* opcode */ XCB_MAP_WINDOW,
1493 /* isvoid */ 1
1496 struct iovec xcb_parts[4];
1497 xcb_void_cookie_t xcb_ret;
1498 xcb_map_window_request_t xcb_out;
1500 xcb_out.pad0 = 0;
1501 xcb_out.window = window;
1503 xcb_parts[2].iov_base = (char *) &xcb_out;
1504 xcb_parts[2].iov_len = sizeof(xcb_out);
1505 xcb_parts[3].iov_base = 0;
1506 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1508 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1509 return xcb_ret;
1512 xcb_void_cookie_t
1513 xcb_map_window (xcb_connection_t *c /**< */,
1514 xcb_window_t window /**< */)
1516 static const xcb_protocol_request_t xcb_req = {
1517 /* count */ 2,
1518 /* ext */ 0,
1519 /* opcode */ XCB_MAP_WINDOW,
1520 /* isvoid */ 1
1523 struct iovec xcb_parts[4];
1524 xcb_void_cookie_t xcb_ret;
1525 xcb_map_window_request_t xcb_out;
1527 xcb_out.pad0 = 0;
1528 xcb_out.window = window;
1530 xcb_parts[2].iov_base = (char *) &xcb_out;
1531 xcb_parts[2].iov_len = sizeof(xcb_out);
1532 xcb_parts[3].iov_base = 0;
1533 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1535 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1536 return xcb_ret;
1539 xcb_void_cookie_t
1540 xcb_map_subwindows_checked (xcb_connection_t *c /**< */,
1541 xcb_window_t window /**< */)
1543 static const xcb_protocol_request_t xcb_req = {
1544 /* count */ 2,
1545 /* ext */ 0,
1546 /* opcode */ XCB_MAP_SUBWINDOWS,
1547 /* isvoid */ 1
1550 struct iovec xcb_parts[4];
1551 xcb_void_cookie_t xcb_ret;
1552 xcb_map_subwindows_request_t xcb_out;
1554 xcb_out.pad0 = 0;
1555 xcb_out.window = window;
1557 xcb_parts[2].iov_base = (char *) &xcb_out;
1558 xcb_parts[2].iov_len = sizeof(xcb_out);
1559 xcb_parts[3].iov_base = 0;
1560 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1562 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1563 return xcb_ret;
1566 xcb_void_cookie_t
1567 xcb_map_subwindows (xcb_connection_t *c /**< */,
1568 xcb_window_t window /**< */)
1570 static const xcb_protocol_request_t xcb_req = {
1571 /* count */ 2,
1572 /* ext */ 0,
1573 /* opcode */ XCB_MAP_SUBWINDOWS,
1574 /* isvoid */ 1
1577 struct iovec xcb_parts[4];
1578 xcb_void_cookie_t xcb_ret;
1579 xcb_map_subwindows_request_t xcb_out;
1581 xcb_out.pad0 = 0;
1582 xcb_out.window = window;
1584 xcb_parts[2].iov_base = (char *) &xcb_out;
1585 xcb_parts[2].iov_len = sizeof(xcb_out);
1586 xcb_parts[3].iov_base = 0;
1587 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1589 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1590 return xcb_ret;
1593 xcb_void_cookie_t
1594 xcb_unmap_window_checked (xcb_connection_t *c /**< */,
1595 xcb_window_t window /**< */)
1597 static const xcb_protocol_request_t xcb_req = {
1598 /* count */ 2,
1599 /* ext */ 0,
1600 /* opcode */ XCB_UNMAP_WINDOW,
1601 /* isvoid */ 1
1604 struct iovec xcb_parts[4];
1605 xcb_void_cookie_t xcb_ret;
1606 xcb_unmap_window_request_t xcb_out;
1608 xcb_out.pad0 = 0;
1609 xcb_out.window = window;
1611 xcb_parts[2].iov_base = (char *) &xcb_out;
1612 xcb_parts[2].iov_len = sizeof(xcb_out);
1613 xcb_parts[3].iov_base = 0;
1614 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1616 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1617 return xcb_ret;
1620 xcb_void_cookie_t
1621 xcb_unmap_window (xcb_connection_t *c /**< */,
1622 xcb_window_t window /**< */)
1624 static const xcb_protocol_request_t xcb_req = {
1625 /* count */ 2,
1626 /* ext */ 0,
1627 /* opcode */ XCB_UNMAP_WINDOW,
1628 /* isvoid */ 1
1631 struct iovec xcb_parts[4];
1632 xcb_void_cookie_t xcb_ret;
1633 xcb_unmap_window_request_t xcb_out;
1635 xcb_out.pad0 = 0;
1636 xcb_out.window = window;
1638 xcb_parts[2].iov_base = (char *) &xcb_out;
1639 xcb_parts[2].iov_len = sizeof(xcb_out);
1640 xcb_parts[3].iov_base = 0;
1641 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1643 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1644 return xcb_ret;
1647 xcb_void_cookie_t
1648 xcb_unmap_subwindows_checked (xcb_connection_t *c /**< */,
1649 xcb_window_t window /**< */)
1651 static const xcb_protocol_request_t xcb_req = {
1652 /* count */ 2,
1653 /* ext */ 0,
1654 /* opcode */ XCB_UNMAP_SUBWINDOWS,
1655 /* isvoid */ 1
1658 struct iovec xcb_parts[4];
1659 xcb_void_cookie_t xcb_ret;
1660 xcb_unmap_subwindows_request_t xcb_out;
1662 xcb_out.pad0 = 0;
1663 xcb_out.window = window;
1665 xcb_parts[2].iov_base = (char *) &xcb_out;
1666 xcb_parts[2].iov_len = sizeof(xcb_out);
1667 xcb_parts[3].iov_base = 0;
1668 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1670 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1671 return xcb_ret;
1674 xcb_void_cookie_t
1675 xcb_unmap_subwindows (xcb_connection_t *c /**< */,
1676 xcb_window_t window /**< */)
1678 static const xcb_protocol_request_t xcb_req = {
1679 /* count */ 2,
1680 /* ext */ 0,
1681 /* opcode */ XCB_UNMAP_SUBWINDOWS,
1682 /* isvoid */ 1
1685 struct iovec xcb_parts[4];
1686 xcb_void_cookie_t xcb_ret;
1687 xcb_unmap_subwindows_request_t xcb_out;
1689 xcb_out.pad0 = 0;
1690 xcb_out.window = window;
1692 xcb_parts[2].iov_base = (char *) &xcb_out;
1693 xcb_parts[2].iov_len = sizeof(xcb_out);
1694 xcb_parts[3].iov_base = 0;
1695 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1697 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1698 return xcb_ret;
1702 xcb_configure_window_sizeof (const void *_buffer /**< */)
1704 char *xcb_tmp = (char *)_buffer;
1705 const xcb_configure_window_request_t *_aux = (xcb_configure_window_request_t *)_buffer;
1706 unsigned int xcb_buffer_len = 0;
1707 unsigned int xcb_block_len = 0;
1708 unsigned int xcb_pad = 0;
1709 unsigned int xcb_align_to = 0;
1712 xcb_block_len += sizeof(xcb_configure_window_request_t);
1713 xcb_tmp += xcb_block_len;
1714 xcb_buffer_len += xcb_block_len;
1715 xcb_block_len = 0;
1716 /* value_list */
1717 xcb_block_len += xcb_popcount(_aux->value_mask) * sizeof(uint32_t);
1718 xcb_tmp += xcb_block_len;
1719 xcb_align_to = ALIGNOF(uint32_t);
1720 /* insert padding */
1721 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1722 xcb_buffer_len += xcb_block_len + xcb_pad;
1723 if (0 != xcb_pad) {
1724 xcb_tmp += xcb_pad;
1725 xcb_pad = 0;
1727 xcb_block_len = 0;
1729 return xcb_buffer_len;
1732 xcb_void_cookie_t
1733 xcb_configure_window_checked (xcb_connection_t *c /**< */,
1734 xcb_window_t window /**< */,
1735 uint16_t value_mask /**< */,
1736 const uint32_t *value_list /**< */)
1738 static const xcb_protocol_request_t xcb_req = {
1739 /* count */ 4,
1740 /* ext */ 0,
1741 /* opcode */ XCB_CONFIGURE_WINDOW,
1742 /* isvoid */ 1
1745 struct iovec xcb_parts[6];
1746 xcb_void_cookie_t xcb_ret;
1747 xcb_configure_window_request_t xcb_out;
1749 xcb_out.pad0 = 0;
1750 xcb_out.window = window;
1751 xcb_out.value_mask = value_mask;
1752 memset(xcb_out.pad1, 0, 2);
1754 xcb_parts[2].iov_base = (char *) &xcb_out;
1755 xcb_parts[2].iov_len = sizeof(xcb_out);
1756 xcb_parts[3].iov_base = 0;
1757 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1758 /* uint32_t value_list */
1759 xcb_parts[4].iov_base = (char *) value_list;
1760 xcb_parts[4].iov_len = xcb_popcount(value_mask) * sizeof(uint32_t);
1761 xcb_parts[5].iov_base = 0;
1762 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1764 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1765 return xcb_ret;
1768 xcb_void_cookie_t
1769 xcb_configure_window (xcb_connection_t *c /**< */,
1770 xcb_window_t window /**< */,
1771 uint16_t value_mask /**< */,
1772 const uint32_t *value_list /**< */)
1774 static const xcb_protocol_request_t xcb_req = {
1775 /* count */ 4,
1776 /* ext */ 0,
1777 /* opcode */ XCB_CONFIGURE_WINDOW,
1778 /* isvoid */ 1
1781 struct iovec xcb_parts[6];
1782 xcb_void_cookie_t xcb_ret;
1783 xcb_configure_window_request_t xcb_out;
1785 xcb_out.pad0 = 0;
1786 xcb_out.window = window;
1787 xcb_out.value_mask = value_mask;
1788 memset(xcb_out.pad1, 0, 2);
1790 xcb_parts[2].iov_base = (char *) &xcb_out;
1791 xcb_parts[2].iov_len = sizeof(xcb_out);
1792 xcb_parts[3].iov_base = 0;
1793 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1794 /* uint32_t value_list */
1795 xcb_parts[4].iov_base = (char *) value_list;
1796 xcb_parts[4].iov_len = xcb_popcount(value_mask) * sizeof(uint32_t);
1797 xcb_parts[5].iov_base = 0;
1798 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1800 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1801 return xcb_ret;
1804 xcb_void_cookie_t
1805 xcb_circulate_window_checked (xcb_connection_t *c /**< */,
1806 uint8_t direction /**< */,
1807 xcb_window_t window /**< */)
1809 static const xcb_protocol_request_t xcb_req = {
1810 /* count */ 2,
1811 /* ext */ 0,
1812 /* opcode */ XCB_CIRCULATE_WINDOW,
1813 /* isvoid */ 1
1816 struct iovec xcb_parts[4];
1817 xcb_void_cookie_t xcb_ret;
1818 xcb_circulate_window_request_t xcb_out;
1820 xcb_out.direction = direction;
1821 xcb_out.window = window;
1823 xcb_parts[2].iov_base = (char *) &xcb_out;
1824 xcb_parts[2].iov_len = sizeof(xcb_out);
1825 xcb_parts[3].iov_base = 0;
1826 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1828 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1829 return xcb_ret;
1832 xcb_void_cookie_t
1833 xcb_circulate_window (xcb_connection_t *c /**< */,
1834 uint8_t direction /**< */,
1835 xcb_window_t window /**< */)
1837 static const xcb_protocol_request_t xcb_req = {
1838 /* count */ 2,
1839 /* ext */ 0,
1840 /* opcode */ XCB_CIRCULATE_WINDOW,
1841 /* isvoid */ 1
1844 struct iovec xcb_parts[4];
1845 xcb_void_cookie_t xcb_ret;
1846 xcb_circulate_window_request_t xcb_out;
1848 xcb_out.direction = direction;
1849 xcb_out.window = window;
1851 xcb_parts[2].iov_base = (char *) &xcb_out;
1852 xcb_parts[2].iov_len = sizeof(xcb_out);
1853 xcb_parts[3].iov_base = 0;
1854 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1856 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1857 return xcb_ret;
1860 xcb_get_geometry_cookie_t
1861 xcb_get_geometry (xcb_connection_t *c /**< */,
1862 xcb_drawable_t drawable /**< */)
1864 static const xcb_protocol_request_t xcb_req = {
1865 /* count */ 2,
1866 /* ext */ 0,
1867 /* opcode */ XCB_GET_GEOMETRY,
1868 /* isvoid */ 0
1871 struct iovec xcb_parts[4];
1872 xcb_get_geometry_cookie_t xcb_ret;
1873 xcb_get_geometry_request_t xcb_out;
1875 xcb_out.pad0 = 0;
1876 xcb_out.drawable = drawable;
1878 xcb_parts[2].iov_base = (char *) &xcb_out;
1879 xcb_parts[2].iov_len = sizeof(xcb_out);
1880 xcb_parts[3].iov_base = 0;
1881 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1883 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1884 return xcb_ret;
1887 xcb_get_geometry_cookie_t
1888 xcb_get_geometry_unchecked (xcb_connection_t *c /**< */,
1889 xcb_drawable_t drawable /**< */)
1891 static const xcb_protocol_request_t xcb_req = {
1892 /* count */ 2,
1893 /* ext */ 0,
1894 /* opcode */ XCB_GET_GEOMETRY,
1895 /* isvoid */ 0
1898 struct iovec xcb_parts[4];
1899 xcb_get_geometry_cookie_t xcb_ret;
1900 xcb_get_geometry_request_t xcb_out;
1902 xcb_out.pad0 = 0;
1903 xcb_out.drawable = drawable;
1905 xcb_parts[2].iov_base = (char *) &xcb_out;
1906 xcb_parts[2].iov_len = sizeof(xcb_out);
1907 xcb_parts[3].iov_base = 0;
1908 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1910 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1911 return xcb_ret;
1914 xcb_get_geometry_reply_t *
1915 xcb_get_geometry_reply (xcb_connection_t *c /**< */,
1916 xcb_get_geometry_cookie_t cookie /**< */,
1917 xcb_generic_error_t **e /**< */)
1919 return (xcb_get_geometry_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1923 xcb_query_tree_sizeof (const void *_buffer /**< */)
1925 char *xcb_tmp = (char *)_buffer;
1926 const xcb_query_tree_reply_t *_aux = (xcb_query_tree_reply_t *)_buffer;
1927 unsigned int xcb_buffer_len = 0;
1928 unsigned int xcb_block_len = 0;
1929 unsigned int xcb_pad = 0;
1930 unsigned int xcb_align_to = 0;
1933 xcb_block_len += sizeof(xcb_query_tree_reply_t);
1934 xcb_tmp += xcb_block_len;
1935 xcb_buffer_len += xcb_block_len;
1936 xcb_block_len = 0;
1937 /* children */
1938 xcb_block_len += _aux->children_len * sizeof(xcb_window_t);
1939 xcb_tmp += xcb_block_len;
1940 xcb_align_to = ALIGNOF(xcb_window_t);
1941 /* insert padding */
1942 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1943 xcb_buffer_len += xcb_block_len + xcb_pad;
1944 if (0 != xcb_pad) {
1945 xcb_tmp += xcb_pad;
1946 xcb_pad = 0;
1948 xcb_block_len = 0;
1950 return xcb_buffer_len;
1953 xcb_query_tree_cookie_t
1954 xcb_query_tree (xcb_connection_t *c /**< */,
1955 xcb_window_t window /**< */)
1957 static const xcb_protocol_request_t xcb_req = {
1958 /* count */ 2,
1959 /* ext */ 0,
1960 /* opcode */ XCB_QUERY_TREE,
1961 /* isvoid */ 0
1964 struct iovec xcb_parts[4];
1965 xcb_query_tree_cookie_t xcb_ret;
1966 xcb_query_tree_request_t xcb_out;
1968 xcb_out.pad0 = 0;
1969 xcb_out.window = window;
1971 xcb_parts[2].iov_base = (char *) &xcb_out;
1972 xcb_parts[2].iov_len = sizeof(xcb_out);
1973 xcb_parts[3].iov_base = 0;
1974 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1976 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1977 return xcb_ret;
1980 xcb_query_tree_cookie_t
1981 xcb_query_tree_unchecked (xcb_connection_t *c /**< */,
1982 xcb_window_t window /**< */)
1984 static const xcb_protocol_request_t xcb_req = {
1985 /* count */ 2,
1986 /* ext */ 0,
1987 /* opcode */ XCB_QUERY_TREE,
1988 /* isvoid */ 0
1991 struct iovec xcb_parts[4];
1992 xcb_query_tree_cookie_t xcb_ret;
1993 xcb_query_tree_request_t xcb_out;
1995 xcb_out.pad0 = 0;
1996 xcb_out.window = window;
1998 xcb_parts[2].iov_base = (char *) &xcb_out;
1999 xcb_parts[2].iov_len = sizeof(xcb_out);
2000 xcb_parts[3].iov_base = 0;
2001 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2003 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2004 return xcb_ret;
2007 xcb_window_t *
2008 xcb_query_tree_children (const xcb_query_tree_reply_t *R /**< */)
2010 return (xcb_window_t *) (R + 1);
2014 xcb_query_tree_children_length (const xcb_query_tree_reply_t *R /**< */)
2016 return R->children_len;
2019 xcb_generic_iterator_t
2020 xcb_query_tree_children_end (const xcb_query_tree_reply_t *R /**< */)
2022 xcb_generic_iterator_t i;
2023 i.data = ((xcb_window_t *) (R + 1)) + (R->children_len);
2024 i.rem = 0;
2025 i.index = (char *) i.data - (char *) R;
2026 return i;
2029 xcb_query_tree_reply_t *
2030 xcb_query_tree_reply (xcb_connection_t *c /**< */,
2031 xcb_query_tree_cookie_t cookie /**< */,
2032 xcb_generic_error_t **e /**< */)
2034 return (xcb_query_tree_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
2038 xcb_intern_atom_sizeof (const void *_buffer /**< */)
2040 char *xcb_tmp = (char *)_buffer;
2041 const xcb_intern_atom_request_t *_aux = (xcb_intern_atom_request_t *)_buffer;
2042 unsigned int xcb_buffer_len = 0;
2043 unsigned int xcb_block_len = 0;
2044 unsigned int xcb_pad = 0;
2045 unsigned int xcb_align_to = 0;
2048 xcb_block_len += sizeof(xcb_intern_atom_request_t);
2049 xcb_tmp += xcb_block_len;
2050 xcb_buffer_len += xcb_block_len;
2051 xcb_block_len = 0;
2052 /* name */
2053 xcb_block_len += _aux->name_len * sizeof(char);
2054 xcb_tmp += xcb_block_len;
2055 xcb_align_to = ALIGNOF(char);
2056 /* insert padding */
2057 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2058 xcb_buffer_len += xcb_block_len + xcb_pad;
2059 if (0 != xcb_pad) {
2060 xcb_tmp += xcb_pad;
2061 xcb_pad = 0;
2063 xcb_block_len = 0;
2065 return xcb_buffer_len;
2068 xcb_intern_atom_cookie_t
2069 xcb_intern_atom (xcb_connection_t *c /**< */,
2070 uint8_t only_if_exists /**< */,
2071 uint16_t name_len /**< */,
2072 const char *name /**< */)
2074 static const xcb_protocol_request_t xcb_req = {
2075 /* count */ 4,
2076 /* ext */ 0,
2077 /* opcode */ XCB_INTERN_ATOM,
2078 /* isvoid */ 0
2081 struct iovec xcb_parts[6];
2082 xcb_intern_atom_cookie_t xcb_ret;
2083 xcb_intern_atom_request_t xcb_out;
2085 xcb_out.only_if_exists = only_if_exists;
2086 xcb_out.name_len = name_len;
2087 memset(xcb_out.pad0, 0, 2);
2089 xcb_parts[2].iov_base = (char *) &xcb_out;
2090 xcb_parts[2].iov_len = sizeof(xcb_out);
2091 xcb_parts[3].iov_base = 0;
2092 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2093 /* char name */
2094 xcb_parts[4].iov_base = (char *) name;
2095 xcb_parts[4].iov_len = name_len * sizeof(char);
2096 xcb_parts[5].iov_base = 0;
2097 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
2099 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2100 return xcb_ret;
2103 xcb_intern_atom_cookie_t
2104 xcb_intern_atom_unchecked (xcb_connection_t *c /**< */,
2105 uint8_t only_if_exists /**< */,
2106 uint16_t name_len /**< */,
2107 const char *name /**< */)
2109 static const xcb_protocol_request_t xcb_req = {
2110 /* count */ 4,
2111 /* ext */ 0,
2112 /* opcode */ XCB_INTERN_ATOM,
2113 /* isvoid */ 0
2116 struct iovec xcb_parts[6];
2117 xcb_intern_atom_cookie_t xcb_ret;
2118 xcb_intern_atom_request_t xcb_out;
2120 xcb_out.only_if_exists = only_if_exists;
2121 xcb_out.name_len = name_len;
2122 memset(xcb_out.pad0, 0, 2);
2124 xcb_parts[2].iov_base = (char *) &xcb_out;
2125 xcb_parts[2].iov_len = sizeof(xcb_out);
2126 xcb_parts[3].iov_base = 0;
2127 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2128 /* char name */
2129 xcb_parts[4].iov_base = (char *) name;
2130 xcb_parts[4].iov_len = name_len * sizeof(char);
2131 xcb_parts[5].iov_base = 0;
2132 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
2134 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2135 return xcb_ret;
2138 xcb_intern_atom_reply_t *
2139 xcb_intern_atom_reply (xcb_connection_t *c /**< */,
2140 xcb_intern_atom_cookie_t cookie /**< */,
2141 xcb_generic_error_t **e /**< */)
2143 return (xcb_intern_atom_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
2147 xcb_get_atom_name_sizeof (const void *_buffer /**< */)
2149 char *xcb_tmp = (char *)_buffer;
2150 const xcb_get_atom_name_reply_t *_aux = (xcb_get_atom_name_reply_t *)_buffer;
2151 unsigned int xcb_buffer_len = 0;
2152 unsigned int xcb_block_len = 0;
2153 unsigned int xcb_pad = 0;
2154 unsigned int xcb_align_to = 0;
2157 xcb_block_len += sizeof(xcb_get_atom_name_reply_t);
2158 xcb_tmp += xcb_block_len;
2159 xcb_buffer_len += xcb_block_len;
2160 xcb_block_len = 0;
2161 /* name */
2162 xcb_block_len += _aux->name_len * sizeof(char);
2163 xcb_tmp += xcb_block_len;
2164 xcb_align_to = ALIGNOF(char);
2165 /* insert padding */
2166 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2167 xcb_buffer_len += xcb_block_len + xcb_pad;
2168 if (0 != xcb_pad) {
2169 xcb_tmp += xcb_pad;
2170 xcb_pad = 0;
2172 xcb_block_len = 0;
2174 return xcb_buffer_len;
2177 xcb_get_atom_name_cookie_t
2178 xcb_get_atom_name (xcb_connection_t *c /**< */,
2179 xcb_atom_t atom /**< */)
2181 static const xcb_protocol_request_t xcb_req = {
2182 /* count */ 2,
2183 /* ext */ 0,
2184 /* opcode */ XCB_GET_ATOM_NAME,
2185 /* isvoid */ 0
2188 struct iovec xcb_parts[4];
2189 xcb_get_atom_name_cookie_t xcb_ret;
2190 xcb_get_atom_name_request_t xcb_out;
2192 xcb_out.pad0 = 0;
2193 xcb_out.atom = atom;
2195 xcb_parts[2].iov_base = (char *) &xcb_out;
2196 xcb_parts[2].iov_len = sizeof(xcb_out);
2197 xcb_parts[3].iov_base = 0;
2198 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2200 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2201 return xcb_ret;
2204 xcb_get_atom_name_cookie_t
2205 xcb_get_atom_name_unchecked (xcb_connection_t *c /**< */,
2206 xcb_atom_t atom /**< */)
2208 static const xcb_protocol_request_t xcb_req = {
2209 /* count */ 2,
2210 /* ext */ 0,
2211 /* opcode */ XCB_GET_ATOM_NAME,
2212 /* isvoid */ 0
2215 struct iovec xcb_parts[4];
2216 xcb_get_atom_name_cookie_t xcb_ret;
2217 xcb_get_atom_name_request_t xcb_out;
2219 xcb_out.pad0 = 0;
2220 xcb_out.atom = atom;
2222 xcb_parts[2].iov_base = (char *) &xcb_out;
2223 xcb_parts[2].iov_len = sizeof(xcb_out);
2224 xcb_parts[3].iov_base = 0;
2225 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2227 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2228 return xcb_ret;
2231 char *
2232 xcb_get_atom_name_name (const xcb_get_atom_name_reply_t *R /**< */)
2234 return (char *) (R + 1);
2238 xcb_get_atom_name_name_length (const xcb_get_atom_name_reply_t *R /**< */)
2240 return R->name_len;
2243 xcb_generic_iterator_t
2244 xcb_get_atom_name_name_end (const xcb_get_atom_name_reply_t *R /**< */)
2246 xcb_generic_iterator_t i;
2247 i.data = ((char *) (R + 1)) + (R->name_len);
2248 i.rem = 0;
2249 i.index = (char *) i.data - (char *) R;
2250 return i;
2253 xcb_get_atom_name_reply_t *
2254 xcb_get_atom_name_reply (xcb_connection_t *c /**< */,
2255 xcb_get_atom_name_cookie_t cookie /**< */,
2256 xcb_generic_error_t **e /**< */)
2258 return (xcb_get_atom_name_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
2262 xcb_change_property_sizeof (const void *_buffer /**< */)
2264 char *xcb_tmp = (char *)_buffer;
2265 const xcb_change_property_request_t *_aux = (xcb_change_property_request_t *)_buffer;
2266 unsigned int xcb_buffer_len = 0;
2267 unsigned int xcb_block_len = 0;
2268 unsigned int xcb_pad = 0;
2269 unsigned int xcb_align_to = 0;
2272 xcb_block_len += sizeof(xcb_change_property_request_t);
2273 xcb_tmp += xcb_block_len;
2274 xcb_buffer_len += xcb_block_len;
2275 xcb_block_len = 0;
2276 /* data */
2277 xcb_block_len += ((_aux->data_len * _aux->format) / 8) * sizeof(char);
2278 xcb_tmp += xcb_block_len;
2279 xcb_align_to = ALIGNOF(char);
2280 /* insert padding */
2281 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2282 xcb_buffer_len += xcb_block_len + xcb_pad;
2283 if (0 != xcb_pad) {
2284 xcb_tmp += xcb_pad;
2285 xcb_pad = 0;
2287 xcb_block_len = 0;
2289 return xcb_buffer_len;
2292 xcb_void_cookie_t
2293 xcb_change_property_checked (xcb_connection_t *c /**< */,
2294 uint8_t mode /**< */,
2295 xcb_window_t window /**< */,
2296 xcb_atom_t property /**< */,
2297 xcb_atom_t type /**< */,
2298 uint8_t format /**< */,
2299 uint32_t data_len /**< */,
2300 const void *data /**< */)
2302 static const xcb_protocol_request_t xcb_req = {
2303 /* count */ 4,
2304 /* ext */ 0,
2305 /* opcode */ XCB_CHANGE_PROPERTY,
2306 /* isvoid */ 1
2309 struct iovec xcb_parts[6];
2310 xcb_void_cookie_t xcb_ret;
2311 xcb_change_property_request_t xcb_out;
2313 xcb_out.mode = mode;
2314 xcb_out.window = window;
2315 xcb_out.property = property;
2316 xcb_out.type = type;
2317 xcb_out.format = format;
2318 memset(xcb_out.pad0, 0, 3);
2319 xcb_out.data_len = data_len;
2321 xcb_parts[2].iov_base = (char *) &xcb_out;
2322 xcb_parts[2].iov_len = sizeof(xcb_out);
2323 xcb_parts[3].iov_base = 0;
2324 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2325 /* void data */
2326 xcb_parts[4].iov_base = (char *) data;
2327 xcb_parts[4].iov_len = ((data_len * format) / 8) * sizeof(char);
2328 xcb_parts[5].iov_base = 0;
2329 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
2331 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2332 return xcb_ret;
2335 xcb_void_cookie_t
2336 xcb_change_property (xcb_connection_t *c /**< */,
2337 uint8_t mode /**< */,
2338 xcb_window_t window /**< */,
2339 xcb_atom_t property /**< */,
2340 xcb_atom_t type /**< */,
2341 uint8_t format /**< */,
2342 uint32_t data_len /**< */,
2343 const void *data /**< */)
2345 static const xcb_protocol_request_t xcb_req = {
2346 /* count */ 4,
2347 /* ext */ 0,
2348 /* opcode */ XCB_CHANGE_PROPERTY,
2349 /* isvoid */ 1
2352 struct iovec xcb_parts[6];
2353 xcb_void_cookie_t xcb_ret;
2354 xcb_change_property_request_t xcb_out;
2356 xcb_out.mode = mode;
2357 xcb_out.window = window;
2358 xcb_out.property = property;
2359 xcb_out.type = type;
2360 xcb_out.format = format;
2361 memset(xcb_out.pad0, 0, 3);
2362 xcb_out.data_len = data_len;
2364 xcb_parts[2].iov_base = (char *) &xcb_out;
2365 xcb_parts[2].iov_len = sizeof(xcb_out);
2366 xcb_parts[3].iov_base = 0;
2367 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2368 /* void data */
2369 xcb_parts[4].iov_base = (char *) data;
2370 xcb_parts[4].iov_len = ((data_len * format) / 8) * sizeof(char);
2371 xcb_parts[5].iov_base = 0;
2372 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
2374 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2375 return xcb_ret;
2378 xcb_void_cookie_t
2379 xcb_delete_property_checked (xcb_connection_t *c /**< */,
2380 xcb_window_t window /**< */,
2381 xcb_atom_t property /**< */)
2383 static const xcb_protocol_request_t xcb_req = {
2384 /* count */ 2,
2385 /* ext */ 0,
2386 /* opcode */ XCB_DELETE_PROPERTY,
2387 /* isvoid */ 1
2390 struct iovec xcb_parts[4];
2391 xcb_void_cookie_t xcb_ret;
2392 xcb_delete_property_request_t xcb_out;
2394 xcb_out.pad0 = 0;
2395 xcb_out.window = window;
2396 xcb_out.property = property;
2398 xcb_parts[2].iov_base = (char *) &xcb_out;
2399 xcb_parts[2].iov_len = sizeof(xcb_out);
2400 xcb_parts[3].iov_base = 0;
2401 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2403 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2404 return xcb_ret;
2407 xcb_void_cookie_t
2408 xcb_delete_property (xcb_connection_t *c /**< */,
2409 xcb_window_t window /**< */,
2410 xcb_atom_t property /**< */)
2412 static const xcb_protocol_request_t xcb_req = {
2413 /* count */ 2,
2414 /* ext */ 0,
2415 /* opcode */ XCB_DELETE_PROPERTY,
2416 /* isvoid */ 1
2419 struct iovec xcb_parts[4];
2420 xcb_void_cookie_t xcb_ret;
2421 xcb_delete_property_request_t xcb_out;
2423 xcb_out.pad0 = 0;
2424 xcb_out.window = window;
2425 xcb_out.property = property;
2427 xcb_parts[2].iov_base = (char *) &xcb_out;
2428 xcb_parts[2].iov_len = sizeof(xcb_out);
2429 xcb_parts[3].iov_base = 0;
2430 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2432 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2433 return xcb_ret;
2437 xcb_get_property_sizeof (const void *_buffer /**< */)
2439 char *xcb_tmp = (char *)_buffer;
2440 const xcb_get_property_reply_t *_aux = (xcb_get_property_reply_t *)_buffer;
2441 unsigned int xcb_buffer_len = 0;
2442 unsigned int xcb_block_len = 0;
2443 unsigned int xcb_pad = 0;
2444 unsigned int xcb_align_to = 0;
2447 xcb_block_len += sizeof(xcb_get_property_reply_t);
2448 xcb_tmp += xcb_block_len;
2449 xcb_buffer_len += xcb_block_len;
2450 xcb_block_len = 0;
2451 /* value */
2452 xcb_block_len += (_aux->value_len * (_aux->format / 8)) * sizeof(char);
2453 xcb_tmp += xcb_block_len;
2454 xcb_align_to = ALIGNOF(char);
2455 /* insert padding */
2456 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2457 xcb_buffer_len += xcb_block_len + xcb_pad;
2458 if (0 != xcb_pad) {
2459 xcb_tmp += xcb_pad;
2460 xcb_pad = 0;
2462 xcb_block_len = 0;
2464 return xcb_buffer_len;
2467 xcb_get_property_cookie_t
2468 xcb_get_property (xcb_connection_t *c /**< */,
2469 uint8_t _delete /**< */,
2470 xcb_window_t window /**< */,
2471 xcb_atom_t property /**< */,
2472 xcb_atom_t type /**< */,
2473 uint32_t long_offset /**< */,
2474 uint32_t long_length /**< */)
2476 static const xcb_protocol_request_t xcb_req = {
2477 /* count */ 2,
2478 /* ext */ 0,
2479 /* opcode */ XCB_GET_PROPERTY,
2480 /* isvoid */ 0
2483 struct iovec xcb_parts[4];
2484 xcb_get_property_cookie_t xcb_ret;
2485 xcb_get_property_request_t xcb_out;
2487 xcb_out._delete = _delete;
2488 xcb_out.window = window;
2489 xcb_out.property = property;
2490 xcb_out.type = type;
2491 xcb_out.long_offset = long_offset;
2492 xcb_out.long_length = long_length;
2494 xcb_parts[2].iov_base = (char *) &xcb_out;
2495 xcb_parts[2].iov_len = sizeof(xcb_out);
2496 xcb_parts[3].iov_base = 0;
2497 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2499 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2500 return xcb_ret;
2503 xcb_get_property_cookie_t
2504 xcb_get_property_unchecked (xcb_connection_t *c /**< */,
2505 uint8_t _delete /**< */,
2506 xcb_window_t window /**< */,
2507 xcb_atom_t property /**< */,
2508 xcb_atom_t type /**< */,
2509 uint32_t long_offset /**< */,
2510 uint32_t long_length /**< */)
2512 static const xcb_protocol_request_t xcb_req = {
2513 /* count */ 2,
2514 /* ext */ 0,
2515 /* opcode */ XCB_GET_PROPERTY,
2516 /* isvoid */ 0
2519 struct iovec xcb_parts[4];
2520 xcb_get_property_cookie_t xcb_ret;
2521 xcb_get_property_request_t xcb_out;
2523 xcb_out._delete = _delete;
2524 xcb_out.window = window;
2525 xcb_out.property = property;
2526 xcb_out.type = type;
2527 xcb_out.long_offset = long_offset;
2528 xcb_out.long_length = long_length;
2530 xcb_parts[2].iov_base = (char *) &xcb_out;
2531 xcb_parts[2].iov_len = sizeof(xcb_out);
2532 xcb_parts[3].iov_base = 0;
2533 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2535 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2536 return xcb_ret;
2539 void *
2540 xcb_get_property_value (const xcb_get_property_reply_t *R /**< */)
2542 return (void *) (R + 1);
2546 xcb_get_property_value_length (const xcb_get_property_reply_t *R /**< */)
2548 return (R->value_len * (R->format / 8));
2551 xcb_generic_iterator_t
2552 xcb_get_property_value_end (const xcb_get_property_reply_t *R /**< */)
2554 xcb_generic_iterator_t i;
2555 i.data = ((char *) (R + 1)) + ((R->value_len * (R->format / 8)));
2556 i.rem = 0;
2557 i.index = (char *) i.data - (char *) R;
2558 return i;
2561 xcb_get_property_reply_t *
2562 xcb_get_property_reply (xcb_connection_t *c /**< */,
2563 xcb_get_property_cookie_t cookie /**< */,
2564 xcb_generic_error_t **e /**< */)
2566 return (xcb_get_property_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
2570 xcb_list_properties_sizeof (const void *_buffer /**< */)
2572 char *xcb_tmp = (char *)_buffer;
2573 const xcb_list_properties_reply_t *_aux = (xcb_list_properties_reply_t *)_buffer;
2574 unsigned int xcb_buffer_len = 0;
2575 unsigned int xcb_block_len = 0;
2576 unsigned int xcb_pad = 0;
2577 unsigned int xcb_align_to = 0;
2580 xcb_block_len += sizeof(xcb_list_properties_reply_t);
2581 xcb_tmp += xcb_block_len;
2582 xcb_buffer_len += xcb_block_len;
2583 xcb_block_len = 0;
2584 /* atoms */
2585 xcb_block_len += _aux->atoms_len * sizeof(xcb_atom_t);
2586 xcb_tmp += xcb_block_len;
2587 xcb_align_to = ALIGNOF(xcb_atom_t);
2588 /* insert padding */
2589 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2590 xcb_buffer_len += xcb_block_len + xcb_pad;
2591 if (0 != xcb_pad) {
2592 xcb_tmp += xcb_pad;
2593 xcb_pad = 0;
2595 xcb_block_len = 0;
2597 return xcb_buffer_len;
2600 xcb_list_properties_cookie_t
2601 xcb_list_properties (xcb_connection_t *c /**< */,
2602 xcb_window_t window /**< */)
2604 static const xcb_protocol_request_t xcb_req = {
2605 /* count */ 2,
2606 /* ext */ 0,
2607 /* opcode */ XCB_LIST_PROPERTIES,
2608 /* isvoid */ 0
2611 struct iovec xcb_parts[4];
2612 xcb_list_properties_cookie_t xcb_ret;
2613 xcb_list_properties_request_t xcb_out;
2615 xcb_out.pad0 = 0;
2616 xcb_out.window = window;
2618 xcb_parts[2].iov_base = (char *) &xcb_out;
2619 xcb_parts[2].iov_len = sizeof(xcb_out);
2620 xcb_parts[3].iov_base = 0;
2621 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2623 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2624 return xcb_ret;
2627 xcb_list_properties_cookie_t
2628 xcb_list_properties_unchecked (xcb_connection_t *c /**< */,
2629 xcb_window_t window /**< */)
2631 static const xcb_protocol_request_t xcb_req = {
2632 /* count */ 2,
2633 /* ext */ 0,
2634 /* opcode */ XCB_LIST_PROPERTIES,
2635 /* isvoid */ 0
2638 struct iovec xcb_parts[4];
2639 xcb_list_properties_cookie_t xcb_ret;
2640 xcb_list_properties_request_t xcb_out;
2642 xcb_out.pad0 = 0;
2643 xcb_out.window = window;
2645 xcb_parts[2].iov_base = (char *) &xcb_out;
2646 xcb_parts[2].iov_len = sizeof(xcb_out);
2647 xcb_parts[3].iov_base = 0;
2648 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2650 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2651 return xcb_ret;
2654 xcb_atom_t *
2655 xcb_list_properties_atoms (const xcb_list_properties_reply_t *R /**< */)
2657 return (xcb_atom_t *) (R + 1);
2661 xcb_list_properties_atoms_length (const xcb_list_properties_reply_t *R /**< */)
2663 return R->atoms_len;
2666 xcb_generic_iterator_t
2667 xcb_list_properties_atoms_end (const xcb_list_properties_reply_t *R /**< */)
2669 xcb_generic_iterator_t i;
2670 i.data = ((xcb_atom_t *) (R + 1)) + (R->atoms_len);
2671 i.rem = 0;
2672 i.index = (char *) i.data - (char *) R;
2673 return i;
2676 xcb_list_properties_reply_t *
2677 xcb_list_properties_reply (xcb_connection_t *c /**< */,
2678 xcb_list_properties_cookie_t cookie /**< */,
2679 xcb_generic_error_t **e /**< */)
2681 return (xcb_list_properties_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
2684 xcb_void_cookie_t
2685 xcb_set_selection_owner_checked (xcb_connection_t *c /**< */,
2686 xcb_window_t owner /**< */,
2687 xcb_atom_t selection /**< */,
2688 xcb_timestamp_t time /**< */)
2690 static const xcb_protocol_request_t xcb_req = {
2691 /* count */ 2,
2692 /* ext */ 0,
2693 /* opcode */ XCB_SET_SELECTION_OWNER,
2694 /* isvoid */ 1
2697 struct iovec xcb_parts[4];
2698 xcb_void_cookie_t xcb_ret;
2699 xcb_set_selection_owner_request_t xcb_out;
2701 xcb_out.pad0 = 0;
2702 xcb_out.owner = owner;
2703 xcb_out.selection = selection;
2704 xcb_out.time = time;
2706 xcb_parts[2].iov_base = (char *) &xcb_out;
2707 xcb_parts[2].iov_len = sizeof(xcb_out);
2708 xcb_parts[3].iov_base = 0;
2709 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2711 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2712 return xcb_ret;
2715 xcb_void_cookie_t
2716 xcb_set_selection_owner (xcb_connection_t *c /**< */,
2717 xcb_window_t owner /**< */,
2718 xcb_atom_t selection /**< */,
2719 xcb_timestamp_t time /**< */)
2721 static const xcb_protocol_request_t xcb_req = {
2722 /* count */ 2,
2723 /* ext */ 0,
2724 /* opcode */ XCB_SET_SELECTION_OWNER,
2725 /* isvoid */ 1
2728 struct iovec xcb_parts[4];
2729 xcb_void_cookie_t xcb_ret;
2730 xcb_set_selection_owner_request_t xcb_out;
2732 xcb_out.pad0 = 0;
2733 xcb_out.owner = owner;
2734 xcb_out.selection = selection;
2735 xcb_out.time = time;
2737 xcb_parts[2].iov_base = (char *) &xcb_out;
2738 xcb_parts[2].iov_len = sizeof(xcb_out);
2739 xcb_parts[3].iov_base = 0;
2740 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2742 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2743 return xcb_ret;
2746 xcb_get_selection_owner_cookie_t
2747 xcb_get_selection_owner (xcb_connection_t *c /**< */,
2748 xcb_atom_t selection /**< */)
2750 static const xcb_protocol_request_t xcb_req = {
2751 /* count */ 2,
2752 /* ext */ 0,
2753 /* opcode */ XCB_GET_SELECTION_OWNER,
2754 /* isvoid */ 0
2757 struct iovec xcb_parts[4];
2758 xcb_get_selection_owner_cookie_t xcb_ret;
2759 xcb_get_selection_owner_request_t xcb_out;
2761 xcb_out.pad0 = 0;
2762 xcb_out.selection = selection;
2764 xcb_parts[2].iov_base = (char *) &xcb_out;
2765 xcb_parts[2].iov_len = sizeof(xcb_out);
2766 xcb_parts[3].iov_base = 0;
2767 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2769 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2770 return xcb_ret;
2773 xcb_get_selection_owner_cookie_t
2774 xcb_get_selection_owner_unchecked (xcb_connection_t *c /**< */,
2775 xcb_atom_t selection /**< */)
2777 static const xcb_protocol_request_t xcb_req = {
2778 /* count */ 2,
2779 /* ext */ 0,
2780 /* opcode */ XCB_GET_SELECTION_OWNER,
2781 /* isvoid */ 0
2784 struct iovec xcb_parts[4];
2785 xcb_get_selection_owner_cookie_t xcb_ret;
2786 xcb_get_selection_owner_request_t xcb_out;
2788 xcb_out.pad0 = 0;
2789 xcb_out.selection = selection;
2791 xcb_parts[2].iov_base = (char *) &xcb_out;
2792 xcb_parts[2].iov_len = sizeof(xcb_out);
2793 xcb_parts[3].iov_base = 0;
2794 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2796 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2797 return xcb_ret;
2800 xcb_get_selection_owner_reply_t *
2801 xcb_get_selection_owner_reply (xcb_connection_t *c /**< */,
2802 xcb_get_selection_owner_cookie_t cookie /**< */,
2803 xcb_generic_error_t **e /**< */)
2805 return (xcb_get_selection_owner_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
2808 xcb_void_cookie_t
2809 xcb_convert_selection_checked (xcb_connection_t *c /**< */,
2810 xcb_window_t requestor /**< */,
2811 xcb_atom_t selection /**< */,
2812 xcb_atom_t target /**< */,
2813 xcb_atom_t property /**< */,
2814 xcb_timestamp_t time /**< */)
2816 static const xcb_protocol_request_t xcb_req = {
2817 /* count */ 2,
2818 /* ext */ 0,
2819 /* opcode */ XCB_CONVERT_SELECTION,
2820 /* isvoid */ 1
2823 struct iovec xcb_parts[4];
2824 xcb_void_cookie_t xcb_ret;
2825 xcb_convert_selection_request_t xcb_out;
2827 xcb_out.pad0 = 0;
2828 xcb_out.requestor = requestor;
2829 xcb_out.selection = selection;
2830 xcb_out.target = target;
2831 xcb_out.property = property;
2832 xcb_out.time = time;
2834 xcb_parts[2].iov_base = (char *) &xcb_out;
2835 xcb_parts[2].iov_len = sizeof(xcb_out);
2836 xcb_parts[3].iov_base = 0;
2837 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2839 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2840 return xcb_ret;
2843 xcb_void_cookie_t
2844 xcb_convert_selection (xcb_connection_t *c /**< */,
2845 xcb_window_t requestor /**< */,
2846 xcb_atom_t selection /**< */,
2847 xcb_atom_t target /**< */,
2848 xcb_atom_t property /**< */,
2849 xcb_timestamp_t time /**< */)
2851 static const xcb_protocol_request_t xcb_req = {
2852 /* count */ 2,
2853 /* ext */ 0,
2854 /* opcode */ XCB_CONVERT_SELECTION,
2855 /* isvoid */ 1
2858 struct iovec xcb_parts[4];
2859 xcb_void_cookie_t xcb_ret;
2860 xcb_convert_selection_request_t xcb_out;
2862 xcb_out.pad0 = 0;
2863 xcb_out.requestor = requestor;
2864 xcb_out.selection = selection;
2865 xcb_out.target = target;
2866 xcb_out.property = property;
2867 xcb_out.time = time;
2869 xcb_parts[2].iov_base = (char *) &xcb_out;
2870 xcb_parts[2].iov_len = sizeof(xcb_out);
2871 xcb_parts[3].iov_base = 0;
2872 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2874 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2875 return xcb_ret;
2878 xcb_void_cookie_t
2879 xcb_send_event_checked (xcb_connection_t *c /**< */,
2880 uint8_t propagate /**< */,
2881 xcb_window_t destination /**< */,
2882 uint32_t event_mask /**< */,
2883 const char *event /**< */)
2885 static const xcb_protocol_request_t xcb_req = {
2886 /* count */ 2,
2887 /* ext */ 0,
2888 /* opcode */ XCB_SEND_EVENT,
2889 /* isvoid */ 1
2892 struct iovec xcb_parts[4];
2893 xcb_void_cookie_t xcb_ret;
2894 xcb_send_event_request_t xcb_out;
2896 xcb_out.propagate = propagate;
2897 xcb_out.destination = destination;
2898 xcb_out.event_mask = event_mask;
2899 memcpy(xcb_out.event, event, 32);
2901 xcb_parts[2].iov_base = (char *) &xcb_out;
2902 xcb_parts[2].iov_len = sizeof(xcb_out);
2903 xcb_parts[3].iov_base = 0;
2904 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2906 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2907 return xcb_ret;
2910 xcb_void_cookie_t
2911 xcb_send_event (xcb_connection_t *c /**< */,
2912 uint8_t propagate /**< */,
2913 xcb_window_t destination /**< */,
2914 uint32_t event_mask /**< */,
2915 const char *event /**< */)
2917 static const xcb_protocol_request_t xcb_req = {
2918 /* count */ 2,
2919 /* ext */ 0,
2920 /* opcode */ XCB_SEND_EVENT,
2921 /* isvoid */ 1
2924 struct iovec xcb_parts[4];
2925 xcb_void_cookie_t xcb_ret;
2926 xcb_send_event_request_t xcb_out;
2928 xcb_out.propagate = propagate;
2929 xcb_out.destination = destination;
2930 xcb_out.event_mask = event_mask;
2931 memcpy(xcb_out.event, event, 32);
2933 xcb_parts[2].iov_base = (char *) &xcb_out;
2934 xcb_parts[2].iov_len = sizeof(xcb_out);
2935 xcb_parts[3].iov_base = 0;
2936 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2938 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2939 return xcb_ret;
2942 xcb_grab_pointer_cookie_t
2943 xcb_grab_pointer (xcb_connection_t *c /**< */,
2944 uint8_t owner_events /**< */,
2945 xcb_window_t grab_window /**< */,
2946 uint16_t event_mask /**< */,
2947 uint8_t pointer_mode /**< */,
2948 uint8_t keyboard_mode /**< */,
2949 xcb_window_t confine_to /**< */,
2950 xcb_cursor_t cursor /**< */,
2951 xcb_timestamp_t time /**< */)
2953 static const xcb_protocol_request_t xcb_req = {
2954 /* count */ 2,
2955 /* ext */ 0,
2956 /* opcode */ XCB_GRAB_POINTER,
2957 /* isvoid */ 0
2960 struct iovec xcb_parts[4];
2961 xcb_grab_pointer_cookie_t xcb_ret;
2962 xcb_grab_pointer_request_t xcb_out;
2964 xcb_out.owner_events = owner_events;
2965 xcb_out.grab_window = grab_window;
2966 xcb_out.event_mask = event_mask;
2967 xcb_out.pointer_mode = pointer_mode;
2968 xcb_out.keyboard_mode = keyboard_mode;
2969 xcb_out.confine_to = confine_to;
2970 xcb_out.cursor = cursor;
2971 xcb_out.time = time;
2973 xcb_parts[2].iov_base = (char *) &xcb_out;
2974 xcb_parts[2].iov_len = sizeof(xcb_out);
2975 xcb_parts[3].iov_base = 0;
2976 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2978 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2979 return xcb_ret;
2982 xcb_grab_pointer_cookie_t
2983 xcb_grab_pointer_unchecked (xcb_connection_t *c /**< */,
2984 uint8_t owner_events /**< */,
2985 xcb_window_t grab_window /**< */,
2986 uint16_t event_mask /**< */,
2987 uint8_t pointer_mode /**< */,
2988 uint8_t keyboard_mode /**< */,
2989 xcb_window_t confine_to /**< */,
2990 xcb_cursor_t cursor /**< */,
2991 xcb_timestamp_t time /**< */)
2993 static const xcb_protocol_request_t xcb_req = {
2994 /* count */ 2,
2995 /* ext */ 0,
2996 /* opcode */ XCB_GRAB_POINTER,
2997 /* isvoid */ 0
3000 struct iovec xcb_parts[4];
3001 xcb_grab_pointer_cookie_t xcb_ret;
3002 xcb_grab_pointer_request_t xcb_out;
3004 xcb_out.owner_events = owner_events;
3005 xcb_out.grab_window = grab_window;
3006 xcb_out.event_mask = event_mask;
3007 xcb_out.pointer_mode = pointer_mode;
3008 xcb_out.keyboard_mode = keyboard_mode;
3009 xcb_out.confine_to = confine_to;
3010 xcb_out.cursor = cursor;
3011 xcb_out.time = time;
3013 xcb_parts[2].iov_base = (char *) &xcb_out;
3014 xcb_parts[2].iov_len = sizeof(xcb_out);
3015 xcb_parts[3].iov_base = 0;
3016 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3018 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3019 return xcb_ret;
3022 xcb_grab_pointer_reply_t *
3023 xcb_grab_pointer_reply (xcb_connection_t *c /**< */,
3024 xcb_grab_pointer_cookie_t cookie /**< */,
3025 xcb_generic_error_t **e /**< */)
3027 return (xcb_grab_pointer_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
3030 xcb_void_cookie_t
3031 xcb_ungrab_pointer_checked (xcb_connection_t *c /**< */,
3032 xcb_timestamp_t time /**< */)
3034 static const xcb_protocol_request_t xcb_req = {
3035 /* count */ 2,
3036 /* ext */ 0,
3037 /* opcode */ XCB_UNGRAB_POINTER,
3038 /* isvoid */ 1
3041 struct iovec xcb_parts[4];
3042 xcb_void_cookie_t xcb_ret;
3043 xcb_ungrab_pointer_request_t xcb_out;
3045 xcb_out.pad0 = 0;
3046 xcb_out.time = time;
3048 xcb_parts[2].iov_base = (char *) &xcb_out;
3049 xcb_parts[2].iov_len = sizeof(xcb_out);
3050 xcb_parts[3].iov_base = 0;
3051 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3053 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3054 return xcb_ret;
3057 xcb_void_cookie_t
3058 xcb_ungrab_pointer (xcb_connection_t *c /**< */,
3059 xcb_timestamp_t time /**< */)
3061 static const xcb_protocol_request_t xcb_req = {
3062 /* count */ 2,
3063 /* ext */ 0,
3064 /* opcode */ XCB_UNGRAB_POINTER,
3065 /* isvoid */ 1
3068 struct iovec xcb_parts[4];
3069 xcb_void_cookie_t xcb_ret;
3070 xcb_ungrab_pointer_request_t xcb_out;
3072 xcb_out.pad0 = 0;
3073 xcb_out.time = time;
3075 xcb_parts[2].iov_base = (char *) &xcb_out;
3076 xcb_parts[2].iov_len = sizeof(xcb_out);
3077 xcb_parts[3].iov_base = 0;
3078 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3080 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3081 return xcb_ret;
3084 xcb_void_cookie_t
3085 xcb_grab_button_checked (xcb_connection_t *c /**< */,
3086 uint8_t owner_events /**< */,
3087 xcb_window_t grab_window /**< */,
3088 uint16_t event_mask /**< */,
3089 uint8_t pointer_mode /**< */,
3090 uint8_t keyboard_mode /**< */,
3091 xcb_window_t confine_to /**< */,
3092 xcb_cursor_t cursor /**< */,
3093 uint8_t button /**< */,
3094 uint16_t modifiers /**< */)
3096 static const xcb_protocol_request_t xcb_req = {
3097 /* count */ 2,
3098 /* ext */ 0,
3099 /* opcode */ XCB_GRAB_BUTTON,
3100 /* isvoid */ 1
3103 struct iovec xcb_parts[4];
3104 xcb_void_cookie_t xcb_ret;
3105 xcb_grab_button_request_t xcb_out;
3107 xcb_out.owner_events = owner_events;
3108 xcb_out.grab_window = grab_window;
3109 xcb_out.event_mask = event_mask;
3110 xcb_out.pointer_mode = pointer_mode;
3111 xcb_out.keyboard_mode = keyboard_mode;
3112 xcb_out.confine_to = confine_to;
3113 xcb_out.cursor = cursor;
3114 xcb_out.button = button;
3115 xcb_out.pad0 = 0;
3116 xcb_out.modifiers = modifiers;
3118 xcb_parts[2].iov_base = (char *) &xcb_out;
3119 xcb_parts[2].iov_len = sizeof(xcb_out);
3120 xcb_parts[3].iov_base = 0;
3121 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3123 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3124 return xcb_ret;
3127 xcb_void_cookie_t
3128 xcb_grab_button (xcb_connection_t *c /**< */,
3129 uint8_t owner_events /**< */,
3130 xcb_window_t grab_window /**< */,
3131 uint16_t event_mask /**< */,
3132 uint8_t pointer_mode /**< */,
3133 uint8_t keyboard_mode /**< */,
3134 xcb_window_t confine_to /**< */,
3135 xcb_cursor_t cursor /**< */,
3136 uint8_t button /**< */,
3137 uint16_t modifiers /**< */)
3139 static const xcb_protocol_request_t xcb_req = {
3140 /* count */ 2,
3141 /* ext */ 0,
3142 /* opcode */ XCB_GRAB_BUTTON,
3143 /* isvoid */ 1
3146 struct iovec xcb_parts[4];
3147 xcb_void_cookie_t xcb_ret;
3148 xcb_grab_button_request_t xcb_out;
3150 xcb_out.owner_events = owner_events;
3151 xcb_out.grab_window = grab_window;
3152 xcb_out.event_mask = event_mask;
3153 xcb_out.pointer_mode = pointer_mode;
3154 xcb_out.keyboard_mode = keyboard_mode;
3155 xcb_out.confine_to = confine_to;
3156 xcb_out.cursor = cursor;
3157 xcb_out.button = button;
3158 xcb_out.pad0 = 0;
3159 xcb_out.modifiers = modifiers;
3161 xcb_parts[2].iov_base = (char *) &xcb_out;
3162 xcb_parts[2].iov_len = sizeof(xcb_out);
3163 xcb_parts[3].iov_base = 0;
3164 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3166 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3167 return xcb_ret;
3170 xcb_void_cookie_t
3171 xcb_ungrab_button_checked (xcb_connection_t *c /**< */,
3172 uint8_t button /**< */,
3173 xcb_window_t grab_window /**< */,
3174 uint16_t modifiers /**< */)
3176 static const xcb_protocol_request_t xcb_req = {
3177 /* count */ 2,
3178 /* ext */ 0,
3179 /* opcode */ XCB_UNGRAB_BUTTON,
3180 /* isvoid */ 1
3183 struct iovec xcb_parts[4];
3184 xcb_void_cookie_t xcb_ret;
3185 xcb_ungrab_button_request_t xcb_out;
3187 xcb_out.button = button;
3188 xcb_out.grab_window = grab_window;
3189 xcb_out.modifiers = modifiers;
3190 memset(xcb_out.pad0, 0, 2);
3192 xcb_parts[2].iov_base = (char *) &xcb_out;
3193 xcb_parts[2].iov_len = sizeof(xcb_out);
3194 xcb_parts[3].iov_base = 0;
3195 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3197 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3198 return xcb_ret;
3201 xcb_void_cookie_t
3202 xcb_ungrab_button (xcb_connection_t *c /**< */,
3203 uint8_t button /**< */,
3204 xcb_window_t grab_window /**< */,
3205 uint16_t modifiers /**< */)
3207 static const xcb_protocol_request_t xcb_req = {
3208 /* count */ 2,
3209 /* ext */ 0,
3210 /* opcode */ XCB_UNGRAB_BUTTON,
3211 /* isvoid */ 1
3214 struct iovec xcb_parts[4];
3215 xcb_void_cookie_t xcb_ret;
3216 xcb_ungrab_button_request_t xcb_out;
3218 xcb_out.button = button;
3219 xcb_out.grab_window = grab_window;
3220 xcb_out.modifiers = modifiers;
3221 memset(xcb_out.pad0, 0, 2);
3223 xcb_parts[2].iov_base = (char *) &xcb_out;
3224 xcb_parts[2].iov_len = sizeof(xcb_out);
3225 xcb_parts[3].iov_base = 0;
3226 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3228 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3229 return xcb_ret;
3232 xcb_void_cookie_t
3233 xcb_change_active_pointer_grab_checked (xcb_connection_t *c /**< */,
3234 xcb_cursor_t cursor /**< */,
3235 xcb_timestamp_t time /**< */,
3236 uint16_t event_mask /**< */)
3238 static const xcb_protocol_request_t xcb_req = {
3239 /* count */ 2,
3240 /* ext */ 0,
3241 /* opcode */ XCB_CHANGE_ACTIVE_POINTER_GRAB,
3242 /* isvoid */ 1
3245 struct iovec xcb_parts[4];
3246 xcb_void_cookie_t xcb_ret;
3247 xcb_change_active_pointer_grab_request_t xcb_out;
3249 xcb_out.pad0 = 0;
3250 xcb_out.cursor = cursor;
3251 xcb_out.time = time;
3252 xcb_out.event_mask = event_mask;
3253 memset(xcb_out.pad1, 0, 2);
3255 xcb_parts[2].iov_base = (char *) &xcb_out;
3256 xcb_parts[2].iov_len = sizeof(xcb_out);
3257 xcb_parts[3].iov_base = 0;
3258 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3260 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3261 return xcb_ret;
3264 xcb_void_cookie_t
3265 xcb_change_active_pointer_grab (xcb_connection_t *c /**< */,
3266 xcb_cursor_t cursor /**< */,
3267 xcb_timestamp_t time /**< */,
3268 uint16_t event_mask /**< */)
3270 static const xcb_protocol_request_t xcb_req = {
3271 /* count */ 2,
3272 /* ext */ 0,
3273 /* opcode */ XCB_CHANGE_ACTIVE_POINTER_GRAB,
3274 /* isvoid */ 1
3277 struct iovec xcb_parts[4];
3278 xcb_void_cookie_t xcb_ret;
3279 xcb_change_active_pointer_grab_request_t xcb_out;
3281 xcb_out.pad0 = 0;
3282 xcb_out.cursor = cursor;
3283 xcb_out.time = time;
3284 xcb_out.event_mask = event_mask;
3285 memset(xcb_out.pad1, 0, 2);
3287 xcb_parts[2].iov_base = (char *) &xcb_out;
3288 xcb_parts[2].iov_len = sizeof(xcb_out);
3289 xcb_parts[3].iov_base = 0;
3290 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3292 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3293 return xcb_ret;
3296 xcb_grab_keyboard_cookie_t
3297 xcb_grab_keyboard (xcb_connection_t *c /**< */,
3298 uint8_t owner_events /**< */,
3299 xcb_window_t grab_window /**< */,
3300 xcb_timestamp_t time /**< */,
3301 uint8_t pointer_mode /**< */,
3302 uint8_t keyboard_mode /**< */)
3304 static const xcb_protocol_request_t xcb_req = {
3305 /* count */ 2,
3306 /* ext */ 0,
3307 /* opcode */ XCB_GRAB_KEYBOARD,
3308 /* isvoid */ 0
3311 struct iovec xcb_parts[4];
3312 xcb_grab_keyboard_cookie_t xcb_ret;
3313 xcb_grab_keyboard_request_t xcb_out;
3315 xcb_out.owner_events = owner_events;
3316 xcb_out.grab_window = grab_window;
3317 xcb_out.time = time;
3318 xcb_out.pointer_mode = pointer_mode;
3319 xcb_out.keyboard_mode = keyboard_mode;
3320 memset(xcb_out.pad0, 0, 2);
3322 xcb_parts[2].iov_base = (char *) &xcb_out;
3323 xcb_parts[2].iov_len = sizeof(xcb_out);
3324 xcb_parts[3].iov_base = 0;
3325 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3327 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3328 return xcb_ret;
3331 xcb_grab_keyboard_cookie_t
3332 xcb_grab_keyboard_unchecked (xcb_connection_t *c /**< */,
3333 uint8_t owner_events /**< */,
3334 xcb_window_t grab_window /**< */,
3335 xcb_timestamp_t time /**< */,
3336 uint8_t pointer_mode /**< */,
3337 uint8_t keyboard_mode /**< */)
3339 static const xcb_protocol_request_t xcb_req = {
3340 /* count */ 2,
3341 /* ext */ 0,
3342 /* opcode */ XCB_GRAB_KEYBOARD,
3343 /* isvoid */ 0
3346 struct iovec xcb_parts[4];
3347 xcb_grab_keyboard_cookie_t xcb_ret;
3348 xcb_grab_keyboard_request_t xcb_out;
3350 xcb_out.owner_events = owner_events;
3351 xcb_out.grab_window = grab_window;
3352 xcb_out.time = time;
3353 xcb_out.pointer_mode = pointer_mode;
3354 xcb_out.keyboard_mode = keyboard_mode;
3355 memset(xcb_out.pad0, 0, 2);
3357 xcb_parts[2].iov_base = (char *) &xcb_out;
3358 xcb_parts[2].iov_len = sizeof(xcb_out);
3359 xcb_parts[3].iov_base = 0;
3360 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3362 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3363 return xcb_ret;
3366 xcb_grab_keyboard_reply_t *
3367 xcb_grab_keyboard_reply (xcb_connection_t *c /**< */,
3368 xcb_grab_keyboard_cookie_t cookie /**< */,
3369 xcb_generic_error_t **e /**< */)
3371 return (xcb_grab_keyboard_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
3374 xcb_void_cookie_t
3375 xcb_ungrab_keyboard_checked (xcb_connection_t *c /**< */,
3376 xcb_timestamp_t time /**< */)
3378 static const xcb_protocol_request_t xcb_req = {
3379 /* count */ 2,
3380 /* ext */ 0,
3381 /* opcode */ XCB_UNGRAB_KEYBOARD,
3382 /* isvoid */ 1
3385 struct iovec xcb_parts[4];
3386 xcb_void_cookie_t xcb_ret;
3387 xcb_ungrab_keyboard_request_t xcb_out;
3389 xcb_out.pad0 = 0;
3390 xcb_out.time = time;
3392 xcb_parts[2].iov_base = (char *) &xcb_out;
3393 xcb_parts[2].iov_len = sizeof(xcb_out);
3394 xcb_parts[3].iov_base = 0;
3395 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3397 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3398 return xcb_ret;
3401 xcb_void_cookie_t
3402 xcb_ungrab_keyboard (xcb_connection_t *c /**< */,
3403 xcb_timestamp_t time /**< */)
3405 static const xcb_protocol_request_t xcb_req = {
3406 /* count */ 2,
3407 /* ext */ 0,
3408 /* opcode */ XCB_UNGRAB_KEYBOARD,
3409 /* isvoid */ 1
3412 struct iovec xcb_parts[4];
3413 xcb_void_cookie_t xcb_ret;
3414 xcb_ungrab_keyboard_request_t xcb_out;
3416 xcb_out.pad0 = 0;
3417 xcb_out.time = time;
3419 xcb_parts[2].iov_base = (char *) &xcb_out;
3420 xcb_parts[2].iov_len = sizeof(xcb_out);
3421 xcb_parts[3].iov_base = 0;
3422 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3424 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3425 return xcb_ret;
3428 xcb_void_cookie_t
3429 xcb_grab_key_checked (xcb_connection_t *c /**< */,
3430 uint8_t owner_events /**< */,
3431 xcb_window_t grab_window /**< */,
3432 uint16_t modifiers /**< */,
3433 xcb_keycode_t key /**< */,
3434 uint8_t pointer_mode /**< */,
3435 uint8_t keyboard_mode /**< */)
3437 static const xcb_protocol_request_t xcb_req = {
3438 /* count */ 2,
3439 /* ext */ 0,
3440 /* opcode */ XCB_GRAB_KEY,
3441 /* isvoid */ 1
3444 struct iovec xcb_parts[4];
3445 xcb_void_cookie_t xcb_ret;
3446 xcb_grab_key_request_t xcb_out;
3448 xcb_out.owner_events = owner_events;
3449 xcb_out.grab_window = grab_window;
3450 xcb_out.modifiers = modifiers;
3451 xcb_out.key = key;
3452 xcb_out.pointer_mode = pointer_mode;
3453 xcb_out.keyboard_mode = keyboard_mode;
3454 memset(xcb_out.pad0, 0, 3);
3456 xcb_parts[2].iov_base = (char *) &xcb_out;
3457 xcb_parts[2].iov_len = sizeof(xcb_out);
3458 xcb_parts[3].iov_base = 0;
3459 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3461 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3462 return xcb_ret;
3465 xcb_void_cookie_t
3466 xcb_grab_key (xcb_connection_t *c /**< */,
3467 uint8_t owner_events /**< */,
3468 xcb_window_t grab_window /**< */,
3469 uint16_t modifiers /**< */,
3470 xcb_keycode_t key /**< */,
3471 uint8_t pointer_mode /**< */,
3472 uint8_t keyboard_mode /**< */)
3474 static const xcb_protocol_request_t xcb_req = {
3475 /* count */ 2,
3476 /* ext */ 0,
3477 /* opcode */ XCB_GRAB_KEY,
3478 /* isvoid */ 1
3481 struct iovec xcb_parts[4];
3482 xcb_void_cookie_t xcb_ret;
3483 xcb_grab_key_request_t xcb_out;
3485 xcb_out.owner_events = owner_events;
3486 xcb_out.grab_window = grab_window;
3487 xcb_out.modifiers = modifiers;
3488 xcb_out.key = key;
3489 xcb_out.pointer_mode = pointer_mode;
3490 xcb_out.keyboard_mode = keyboard_mode;
3491 memset(xcb_out.pad0, 0, 3);
3493 xcb_parts[2].iov_base = (char *) &xcb_out;
3494 xcb_parts[2].iov_len = sizeof(xcb_out);
3495 xcb_parts[3].iov_base = 0;
3496 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3498 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3499 return xcb_ret;
3502 xcb_void_cookie_t
3503 xcb_ungrab_key_checked (xcb_connection_t *c /**< */,
3504 xcb_keycode_t key /**< */,
3505 xcb_window_t grab_window /**< */,
3506 uint16_t modifiers /**< */)
3508 static const xcb_protocol_request_t xcb_req = {
3509 /* count */ 2,
3510 /* ext */ 0,
3511 /* opcode */ XCB_UNGRAB_KEY,
3512 /* isvoid */ 1
3515 struct iovec xcb_parts[4];
3516 xcb_void_cookie_t xcb_ret;
3517 xcb_ungrab_key_request_t xcb_out;
3519 xcb_out.key = key;
3520 xcb_out.grab_window = grab_window;
3521 xcb_out.modifiers = modifiers;
3522 memset(xcb_out.pad0, 0, 2);
3524 xcb_parts[2].iov_base = (char *) &xcb_out;
3525 xcb_parts[2].iov_len = sizeof(xcb_out);
3526 xcb_parts[3].iov_base = 0;
3527 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3529 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3530 return xcb_ret;
3533 xcb_void_cookie_t
3534 xcb_ungrab_key (xcb_connection_t *c /**< */,
3535 xcb_keycode_t key /**< */,
3536 xcb_window_t grab_window /**< */,
3537 uint16_t modifiers /**< */)
3539 static const xcb_protocol_request_t xcb_req = {
3540 /* count */ 2,
3541 /* ext */ 0,
3542 /* opcode */ XCB_UNGRAB_KEY,
3543 /* isvoid */ 1
3546 struct iovec xcb_parts[4];
3547 xcb_void_cookie_t xcb_ret;
3548 xcb_ungrab_key_request_t xcb_out;
3550 xcb_out.key = key;
3551 xcb_out.grab_window = grab_window;
3552 xcb_out.modifiers = modifiers;
3553 memset(xcb_out.pad0, 0, 2);
3555 xcb_parts[2].iov_base = (char *) &xcb_out;
3556 xcb_parts[2].iov_len = sizeof(xcb_out);
3557 xcb_parts[3].iov_base = 0;
3558 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3560 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3561 return xcb_ret;
3564 xcb_void_cookie_t
3565 xcb_allow_events_checked (xcb_connection_t *c /**< */,
3566 uint8_t mode /**< */,
3567 xcb_timestamp_t time /**< */)
3569 static const xcb_protocol_request_t xcb_req = {
3570 /* count */ 2,
3571 /* ext */ 0,
3572 /* opcode */ XCB_ALLOW_EVENTS,
3573 /* isvoid */ 1
3576 struct iovec xcb_parts[4];
3577 xcb_void_cookie_t xcb_ret;
3578 xcb_allow_events_request_t xcb_out;
3580 xcb_out.mode = mode;
3581 xcb_out.time = time;
3583 xcb_parts[2].iov_base = (char *) &xcb_out;
3584 xcb_parts[2].iov_len = sizeof(xcb_out);
3585 xcb_parts[3].iov_base = 0;
3586 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3588 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3589 return xcb_ret;
3592 xcb_void_cookie_t
3593 xcb_allow_events (xcb_connection_t *c /**< */,
3594 uint8_t mode /**< */,
3595 xcb_timestamp_t time /**< */)
3597 static const xcb_protocol_request_t xcb_req = {
3598 /* count */ 2,
3599 /* ext */ 0,
3600 /* opcode */ XCB_ALLOW_EVENTS,
3601 /* isvoid */ 1
3604 struct iovec xcb_parts[4];
3605 xcb_void_cookie_t xcb_ret;
3606 xcb_allow_events_request_t xcb_out;
3608 xcb_out.mode = mode;
3609 xcb_out.time = time;
3611 xcb_parts[2].iov_base = (char *) &xcb_out;
3612 xcb_parts[2].iov_len = sizeof(xcb_out);
3613 xcb_parts[3].iov_base = 0;
3614 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3616 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3617 return xcb_ret;
3620 xcb_void_cookie_t
3621 xcb_grab_server_checked (xcb_connection_t *c /**< */)
3623 static const xcb_protocol_request_t xcb_req = {
3624 /* count */ 2,
3625 /* ext */ 0,
3626 /* opcode */ XCB_GRAB_SERVER,
3627 /* isvoid */ 1
3630 struct iovec xcb_parts[4];
3631 xcb_void_cookie_t xcb_ret;
3632 xcb_grab_server_request_t xcb_out;
3634 xcb_out.pad0 = 0;
3636 xcb_parts[2].iov_base = (char *) &xcb_out;
3637 xcb_parts[2].iov_len = sizeof(xcb_out);
3638 xcb_parts[3].iov_base = 0;
3639 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3641 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3642 return xcb_ret;
3645 xcb_void_cookie_t
3646 xcb_grab_server (xcb_connection_t *c /**< */)
3648 static const xcb_protocol_request_t xcb_req = {
3649 /* count */ 2,
3650 /* ext */ 0,
3651 /* opcode */ XCB_GRAB_SERVER,
3652 /* isvoid */ 1
3655 struct iovec xcb_parts[4];
3656 xcb_void_cookie_t xcb_ret;
3657 xcb_grab_server_request_t xcb_out;
3659 xcb_out.pad0 = 0;
3661 xcb_parts[2].iov_base = (char *) &xcb_out;
3662 xcb_parts[2].iov_len = sizeof(xcb_out);
3663 xcb_parts[3].iov_base = 0;
3664 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3666 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3667 return xcb_ret;
3670 xcb_void_cookie_t
3671 xcb_ungrab_server_checked (xcb_connection_t *c /**< */)
3673 static const xcb_protocol_request_t xcb_req = {
3674 /* count */ 2,
3675 /* ext */ 0,
3676 /* opcode */ XCB_UNGRAB_SERVER,
3677 /* isvoid */ 1
3680 struct iovec xcb_parts[4];
3681 xcb_void_cookie_t xcb_ret;
3682 xcb_ungrab_server_request_t xcb_out;
3684 xcb_out.pad0 = 0;
3686 xcb_parts[2].iov_base = (char *) &xcb_out;
3687 xcb_parts[2].iov_len = sizeof(xcb_out);
3688 xcb_parts[3].iov_base = 0;
3689 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3691 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3692 return xcb_ret;
3695 xcb_void_cookie_t
3696 xcb_ungrab_server (xcb_connection_t *c /**< */)
3698 static const xcb_protocol_request_t xcb_req = {
3699 /* count */ 2,
3700 /* ext */ 0,
3701 /* opcode */ XCB_UNGRAB_SERVER,
3702 /* isvoid */ 1
3705 struct iovec xcb_parts[4];
3706 xcb_void_cookie_t xcb_ret;
3707 xcb_ungrab_server_request_t xcb_out;
3709 xcb_out.pad0 = 0;
3711 xcb_parts[2].iov_base = (char *) &xcb_out;
3712 xcb_parts[2].iov_len = sizeof(xcb_out);
3713 xcb_parts[3].iov_base = 0;
3714 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3716 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3717 return xcb_ret;
3720 xcb_query_pointer_cookie_t
3721 xcb_query_pointer (xcb_connection_t *c /**< */,
3722 xcb_window_t window /**< */)
3724 static const xcb_protocol_request_t xcb_req = {
3725 /* count */ 2,
3726 /* ext */ 0,
3727 /* opcode */ XCB_QUERY_POINTER,
3728 /* isvoid */ 0
3731 struct iovec xcb_parts[4];
3732 xcb_query_pointer_cookie_t xcb_ret;
3733 xcb_query_pointer_request_t xcb_out;
3735 xcb_out.pad0 = 0;
3736 xcb_out.window = window;
3738 xcb_parts[2].iov_base = (char *) &xcb_out;
3739 xcb_parts[2].iov_len = sizeof(xcb_out);
3740 xcb_parts[3].iov_base = 0;
3741 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3743 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3744 return xcb_ret;
3747 xcb_query_pointer_cookie_t
3748 xcb_query_pointer_unchecked (xcb_connection_t *c /**< */,
3749 xcb_window_t window /**< */)
3751 static const xcb_protocol_request_t xcb_req = {
3752 /* count */ 2,
3753 /* ext */ 0,
3754 /* opcode */ XCB_QUERY_POINTER,
3755 /* isvoid */ 0
3758 struct iovec xcb_parts[4];
3759 xcb_query_pointer_cookie_t xcb_ret;
3760 xcb_query_pointer_request_t xcb_out;
3762 xcb_out.pad0 = 0;
3763 xcb_out.window = window;
3765 xcb_parts[2].iov_base = (char *) &xcb_out;
3766 xcb_parts[2].iov_len = sizeof(xcb_out);
3767 xcb_parts[3].iov_base = 0;
3768 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3770 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3771 return xcb_ret;
3774 xcb_query_pointer_reply_t *
3775 xcb_query_pointer_reply (xcb_connection_t *c /**< */,
3776 xcb_query_pointer_cookie_t cookie /**< */,
3777 xcb_generic_error_t **e /**< */)
3779 return (xcb_query_pointer_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
3782 void
3783 xcb_timecoord_next (xcb_timecoord_iterator_t *i /**< */)
3785 --i->rem;
3786 ++i->data;
3787 i->index += sizeof(xcb_timecoord_t);
3790 xcb_generic_iterator_t
3791 xcb_timecoord_end (xcb_timecoord_iterator_t i /**< */)
3793 xcb_generic_iterator_t ret;
3794 ret.data = i.data + i.rem;
3795 ret.index = i.index + ((char *) ret.data - (char *) i.data);
3796 ret.rem = 0;
3797 return ret;
3801 xcb_get_motion_events_sizeof (const void *_buffer /**< */)
3803 char *xcb_tmp = (char *)_buffer;
3804 const xcb_get_motion_events_reply_t *_aux = (xcb_get_motion_events_reply_t *)_buffer;
3805 unsigned int xcb_buffer_len = 0;
3806 unsigned int xcb_block_len = 0;
3807 unsigned int xcb_pad = 0;
3808 unsigned int xcb_align_to = 0;
3811 xcb_block_len += sizeof(xcb_get_motion_events_reply_t);
3812 xcb_tmp += xcb_block_len;
3813 xcb_buffer_len += xcb_block_len;
3814 xcb_block_len = 0;
3815 /* events */
3816 xcb_block_len += _aux->events_len * sizeof(xcb_timecoord_t);
3817 xcb_tmp += xcb_block_len;
3818 xcb_align_to = ALIGNOF(xcb_timecoord_t);
3819 /* insert padding */
3820 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3821 xcb_buffer_len += xcb_block_len + xcb_pad;
3822 if (0 != xcb_pad) {
3823 xcb_tmp += xcb_pad;
3824 xcb_pad = 0;
3826 xcb_block_len = 0;
3828 return xcb_buffer_len;
3831 xcb_get_motion_events_cookie_t
3832 xcb_get_motion_events (xcb_connection_t *c /**< */,
3833 xcb_window_t window /**< */,
3834 xcb_timestamp_t start /**< */,
3835 xcb_timestamp_t stop /**< */)
3837 static const xcb_protocol_request_t xcb_req = {
3838 /* count */ 2,
3839 /* ext */ 0,
3840 /* opcode */ XCB_GET_MOTION_EVENTS,
3841 /* isvoid */ 0
3844 struct iovec xcb_parts[4];
3845 xcb_get_motion_events_cookie_t xcb_ret;
3846 xcb_get_motion_events_request_t xcb_out;
3848 xcb_out.pad0 = 0;
3849 xcb_out.window = window;
3850 xcb_out.start = start;
3851 xcb_out.stop = stop;
3853 xcb_parts[2].iov_base = (char *) &xcb_out;
3854 xcb_parts[2].iov_len = sizeof(xcb_out);
3855 xcb_parts[3].iov_base = 0;
3856 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3858 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3859 return xcb_ret;
3862 xcb_get_motion_events_cookie_t
3863 xcb_get_motion_events_unchecked (xcb_connection_t *c /**< */,
3864 xcb_window_t window /**< */,
3865 xcb_timestamp_t start /**< */,
3866 xcb_timestamp_t stop /**< */)
3868 static const xcb_protocol_request_t xcb_req = {
3869 /* count */ 2,
3870 /* ext */ 0,
3871 /* opcode */ XCB_GET_MOTION_EVENTS,
3872 /* isvoid */ 0
3875 struct iovec xcb_parts[4];
3876 xcb_get_motion_events_cookie_t xcb_ret;
3877 xcb_get_motion_events_request_t xcb_out;
3879 xcb_out.pad0 = 0;
3880 xcb_out.window = window;
3881 xcb_out.start = start;
3882 xcb_out.stop = stop;
3884 xcb_parts[2].iov_base = (char *) &xcb_out;
3885 xcb_parts[2].iov_len = sizeof(xcb_out);
3886 xcb_parts[3].iov_base = 0;
3887 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3889 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3890 return xcb_ret;
3893 xcb_timecoord_t *
3894 xcb_get_motion_events_events (const xcb_get_motion_events_reply_t *R /**< */)
3896 return (xcb_timecoord_t *) (R + 1);
3900 xcb_get_motion_events_events_length (const xcb_get_motion_events_reply_t *R /**< */)
3902 return R->events_len;
3905 xcb_timecoord_iterator_t
3906 xcb_get_motion_events_events_iterator (const xcb_get_motion_events_reply_t *R /**< */)
3908 xcb_timecoord_iterator_t i;
3909 i.data = (xcb_timecoord_t *) (R + 1);
3910 i.rem = R->events_len;
3911 i.index = (char *) i.data - (char *) R;
3912 return i;
3915 xcb_get_motion_events_reply_t *
3916 xcb_get_motion_events_reply (xcb_connection_t *c /**< */,
3917 xcb_get_motion_events_cookie_t cookie /**< */,
3918 xcb_generic_error_t **e /**< */)
3920 return (xcb_get_motion_events_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
3923 xcb_translate_coordinates_cookie_t
3924 xcb_translate_coordinates (xcb_connection_t *c /**< */,
3925 xcb_window_t src_window /**< */,
3926 xcb_window_t dst_window /**< */,
3927 int16_t src_x /**< */,
3928 int16_t src_y /**< */)
3930 static const xcb_protocol_request_t xcb_req = {
3931 /* count */ 2,
3932 /* ext */ 0,
3933 /* opcode */ XCB_TRANSLATE_COORDINATES,
3934 /* isvoid */ 0
3937 struct iovec xcb_parts[4];
3938 xcb_translate_coordinates_cookie_t xcb_ret;
3939 xcb_translate_coordinates_request_t xcb_out;
3941 xcb_out.pad0 = 0;
3942 xcb_out.src_window = src_window;
3943 xcb_out.dst_window = dst_window;
3944 xcb_out.src_x = src_x;
3945 xcb_out.src_y = src_y;
3947 xcb_parts[2].iov_base = (char *) &xcb_out;
3948 xcb_parts[2].iov_len = sizeof(xcb_out);
3949 xcb_parts[3].iov_base = 0;
3950 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3952 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3953 return xcb_ret;
3956 xcb_translate_coordinates_cookie_t
3957 xcb_translate_coordinates_unchecked (xcb_connection_t *c /**< */,
3958 xcb_window_t src_window /**< */,
3959 xcb_window_t dst_window /**< */,
3960 int16_t src_x /**< */,
3961 int16_t src_y /**< */)
3963 static const xcb_protocol_request_t xcb_req = {
3964 /* count */ 2,
3965 /* ext */ 0,
3966 /* opcode */ XCB_TRANSLATE_COORDINATES,
3967 /* isvoid */ 0
3970 struct iovec xcb_parts[4];
3971 xcb_translate_coordinates_cookie_t xcb_ret;
3972 xcb_translate_coordinates_request_t xcb_out;
3974 xcb_out.pad0 = 0;
3975 xcb_out.src_window = src_window;
3976 xcb_out.dst_window = dst_window;
3977 xcb_out.src_x = src_x;
3978 xcb_out.src_y = src_y;
3980 xcb_parts[2].iov_base = (char *) &xcb_out;
3981 xcb_parts[2].iov_len = sizeof(xcb_out);
3982 xcb_parts[3].iov_base = 0;
3983 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3985 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3986 return xcb_ret;
3989 xcb_translate_coordinates_reply_t *
3990 xcb_translate_coordinates_reply (xcb_connection_t *c /**< */,
3991 xcb_translate_coordinates_cookie_t cookie /**< */,
3992 xcb_generic_error_t **e /**< */)
3994 return (xcb_translate_coordinates_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
3997 xcb_void_cookie_t
3998 xcb_warp_pointer_checked (xcb_connection_t *c /**< */,
3999 xcb_window_t src_window /**< */,
4000 xcb_window_t dst_window /**< */,
4001 int16_t src_x /**< */,
4002 int16_t src_y /**< */,
4003 uint16_t src_width /**< */,
4004 uint16_t src_height /**< */,
4005 int16_t dst_x /**< */,
4006 int16_t dst_y /**< */)
4008 static const xcb_protocol_request_t xcb_req = {
4009 /* count */ 2,
4010 /* ext */ 0,
4011 /* opcode */ XCB_WARP_POINTER,
4012 /* isvoid */ 1
4015 struct iovec xcb_parts[4];
4016 xcb_void_cookie_t xcb_ret;
4017 xcb_warp_pointer_request_t xcb_out;
4019 xcb_out.pad0 = 0;
4020 xcb_out.src_window = src_window;
4021 xcb_out.dst_window = dst_window;
4022 xcb_out.src_x = src_x;
4023 xcb_out.src_y = src_y;
4024 xcb_out.src_width = src_width;
4025 xcb_out.src_height = src_height;
4026 xcb_out.dst_x = dst_x;
4027 xcb_out.dst_y = dst_y;
4029 xcb_parts[2].iov_base = (char *) &xcb_out;
4030 xcb_parts[2].iov_len = sizeof(xcb_out);
4031 xcb_parts[3].iov_base = 0;
4032 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4034 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
4035 return xcb_ret;
4038 xcb_void_cookie_t
4039 xcb_warp_pointer (xcb_connection_t *c /**< */,
4040 xcb_window_t src_window /**< */,
4041 xcb_window_t dst_window /**< */,
4042 int16_t src_x /**< */,
4043 int16_t src_y /**< */,
4044 uint16_t src_width /**< */,
4045 uint16_t src_height /**< */,
4046 int16_t dst_x /**< */,
4047 int16_t dst_y /**< */)
4049 static const xcb_protocol_request_t xcb_req = {
4050 /* count */ 2,
4051 /* ext */ 0,
4052 /* opcode */ XCB_WARP_POINTER,
4053 /* isvoid */ 1
4056 struct iovec xcb_parts[4];
4057 xcb_void_cookie_t xcb_ret;
4058 xcb_warp_pointer_request_t xcb_out;
4060 xcb_out.pad0 = 0;
4061 xcb_out.src_window = src_window;
4062 xcb_out.dst_window = dst_window;
4063 xcb_out.src_x = src_x;
4064 xcb_out.src_y = src_y;
4065 xcb_out.src_width = src_width;
4066 xcb_out.src_height = src_height;
4067 xcb_out.dst_x = dst_x;
4068 xcb_out.dst_y = dst_y;
4070 xcb_parts[2].iov_base = (char *) &xcb_out;
4071 xcb_parts[2].iov_len = sizeof(xcb_out);
4072 xcb_parts[3].iov_base = 0;
4073 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4075 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
4076 return xcb_ret;
4079 xcb_void_cookie_t
4080 xcb_set_input_focus_checked (xcb_connection_t *c /**< */,
4081 uint8_t revert_to /**< */,
4082 xcb_window_t focus /**< */,
4083 xcb_timestamp_t time /**< */)
4085 static const xcb_protocol_request_t xcb_req = {
4086 /* count */ 2,
4087 /* ext */ 0,
4088 /* opcode */ XCB_SET_INPUT_FOCUS,
4089 /* isvoid */ 1
4092 struct iovec xcb_parts[4];
4093 xcb_void_cookie_t xcb_ret;
4094 xcb_set_input_focus_request_t xcb_out;
4096 xcb_out.revert_to = revert_to;
4097 xcb_out.focus = focus;
4098 xcb_out.time = time;
4100 xcb_parts[2].iov_base = (char *) &xcb_out;
4101 xcb_parts[2].iov_len = sizeof(xcb_out);
4102 xcb_parts[3].iov_base = 0;
4103 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4105 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
4106 return xcb_ret;
4109 xcb_void_cookie_t
4110 xcb_set_input_focus (xcb_connection_t *c /**< */,
4111 uint8_t revert_to /**< */,
4112 xcb_window_t focus /**< */,
4113 xcb_timestamp_t time /**< */)
4115 static const xcb_protocol_request_t xcb_req = {
4116 /* count */ 2,
4117 /* ext */ 0,
4118 /* opcode */ XCB_SET_INPUT_FOCUS,
4119 /* isvoid */ 1
4122 struct iovec xcb_parts[4];
4123 xcb_void_cookie_t xcb_ret;
4124 xcb_set_input_focus_request_t xcb_out;
4126 xcb_out.revert_to = revert_to;
4127 xcb_out.focus = focus;
4128 xcb_out.time = time;
4130 xcb_parts[2].iov_base = (char *) &xcb_out;
4131 xcb_parts[2].iov_len = sizeof(xcb_out);
4132 xcb_parts[3].iov_base = 0;
4133 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4135 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
4136 return xcb_ret;
4139 xcb_get_input_focus_cookie_t
4140 xcb_get_input_focus (xcb_connection_t *c /**< */)
4142 static const xcb_protocol_request_t xcb_req = {
4143 /* count */ 2,
4144 /* ext */ 0,
4145 /* opcode */ XCB_GET_INPUT_FOCUS,
4146 /* isvoid */ 0
4149 struct iovec xcb_parts[4];
4150 xcb_get_input_focus_cookie_t xcb_ret;
4151 xcb_get_input_focus_request_t xcb_out;
4153 xcb_out.pad0 = 0;
4155 xcb_parts[2].iov_base = (char *) &xcb_out;
4156 xcb_parts[2].iov_len = sizeof(xcb_out);
4157 xcb_parts[3].iov_base = 0;
4158 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4160 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
4161 return xcb_ret;
4164 xcb_get_input_focus_cookie_t
4165 xcb_get_input_focus_unchecked (xcb_connection_t *c /**< */)
4167 static const xcb_protocol_request_t xcb_req = {
4168 /* count */ 2,
4169 /* ext */ 0,
4170 /* opcode */ XCB_GET_INPUT_FOCUS,
4171 /* isvoid */ 0
4174 struct iovec xcb_parts[4];
4175 xcb_get_input_focus_cookie_t xcb_ret;
4176 xcb_get_input_focus_request_t xcb_out;
4178 xcb_out.pad0 = 0;
4180 xcb_parts[2].iov_base = (char *) &xcb_out;
4181 xcb_parts[2].iov_len = sizeof(xcb_out);
4182 xcb_parts[3].iov_base = 0;
4183 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4185 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
4186 return xcb_ret;
4189 xcb_get_input_focus_reply_t *
4190 xcb_get_input_focus_reply (xcb_connection_t *c /**< */,
4191 xcb_get_input_focus_cookie_t cookie /**< */,
4192 xcb_generic_error_t **e /**< */)
4194 return (xcb_get_input_focus_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
4197 xcb_query_keymap_cookie_t
4198 xcb_query_keymap (xcb_connection_t *c /**< */)
4200 static const xcb_protocol_request_t xcb_req = {
4201 /* count */ 2,
4202 /* ext */ 0,
4203 /* opcode */ XCB_QUERY_KEYMAP,
4204 /* isvoid */ 0
4207 struct iovec xcb_parts[4];
4208 xcb_query_keymap_cookie_t xcb_ret;
4209 xcb_query_keymap_request_t xcb_out;
4211 xcb_out.pad0 = 0;
4213 xcb_parts[2].iov_base = (char *) &xcb_out;
4214 xcb_parts[2].iov_len = sizeof(xcb_out);
4215 xcb_parts[3].iov_base = 0;
4216 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4218 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
4219 return xcb_ret;
4222 xcb_query_keymap_cookie_t
4223 xcb_query_keymap_unchecked (xcb_connection_t *c /**< */)
4225 static const xcb_protocol_request_t xcb_req = {
4226 /* count */ 2,
4227 /* ext */ 0,
4228 /* opcode */ XCB_QUERY_KEYMAP,
4229 /* isvoid */ 0
4232 struct iovec xcb_parts[4];
4233 xcb_query_keymap_cookie_t xcb_ret;
4234 xcb_query_keymap_request_t xcb_out;
4236 xcb_out.pad0 = 0;
4238 xcb_parts[2].iov_base = (char *) &xcb_out;
4239 xcb_parts[2].iov_len = sizeof(xcb_out);
4240 xcb_parts[3].iov_base = 0;
4241 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4243 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
4244 return xcb_ret;
4247 xcb_query_keymap_reply_t *
4248 xcb_query_keymap_reply (xcb_connection_t *c /**< */,
4249 xcb_query_keymap_cookie_t cookie /**< */,
4250 xcb_generic_error_t **e /**< */)
4252 return (xcb_query_keymap_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
4256 xcb_open_font_sizeof (const void *_buffer /**< */)
4258 char *xcb_tmp = (char *)_buffer;
4259 const xcb_open_font_request_t *_aux = (xcb_open_font_request_t *)_buffer;
4260 unsigned int xcb_buffer_len = 0;
4261 unsigned int xcb_block_len = 0;
4262 unsigned int xcb_pad = 0;
4263 unsigned int xcb_align_to = 0;
4266 xcb_block_len += sizeof(xcb_open_font_request_t);
4267 xcb_tmp += xcb_block_len;
4268 xcb_buffer_len += xcb_block_len;
4269 xcb_block_len = 0;
4270 /* name */
4271 xcb_block_len += _aux->name_len * sizeof(char);
4272 xcb_tmp += xcb_block_len;
4273 xcb_align_to = ALIGNOF(char);
4274 /* insert padding */
4275 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4276 xcb_buffer_len += xcb_block_len + xcb_pad;
4277 if (0 != xcb_pad) {
4278 xcb_tmp += xcb_pad;
4279 xcb_pad = 0;
4281 xcb_block_len = 0;
4283 return xcb_buffer_len;
4286 xcb_void_cookie_t
4287 xcb_open_font_checked (xcb_connection_t *c /**< */,
4288 xcb_font_t fid /**< */,
4289 uint16_t name_len /**< */,
4290 const char *name /**< */)
4292 static const xcb_protocol_request_t xcb_req = {
4293 /* count */ 4,
4294 /* ext */ 0,
4295 /* opcode */ XCB_OPEN_FONT,
4296 /* isvoid */ 1
4299 struct iovec xcb_parts[6];
4300 xcb_void_cookie_t xcb_ret;
4301 xcb_open_font_request_t xcb_out;
4303 xcb_out.pad0 = 0;
4304 xcb_out.fid = fid;
4305 xcb_out.name_len = name_len;
4306 memset(xcb_out.pad1, 0, 2);
4308 xcb_parts[2].iov_base = (char *) &xcb_out;
4309 xcb_parts[2].iov_len = sizeof(xcb_out);
4310 xcb_parts[3].iov_base = 0;
4311 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4312 /* char name */
4313 xcb_parts[4].iov_base = (char *) name;
4314 xcb_parts[4].iov_len = name_len * sizeof(char);
4315 xcb_parts[5].iov_base = 0;
4316 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
4318 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
4319 return xcb_ret;
4322 xcb_void_cookie_t
4323 xcb_open_font (xcb_connection_t *c /**< */,
4324 xcb_font_t fid /**< */,
4325 uint16_t name_len /**< */,
4326 const char *name /**< */)
4328 static const xcb_protocol_request_t xcb_req = {
4329 /* count */ 4,
4330 /* ext */ 0,
4331 /* opcode */ XCB_OPEN_FONT,
4332 /* isvoid */ 1
4335 struct iovec xcb_parts[6];
4336 xcb_void_cookie_t xcb_ret;
4337 xcb_open_font_request_t xcb_out;
4339 xcb_out.pad0 = 0;
4340 xcb_out.fid = fid;
4341 xcb_out.name_len = name_len;
4342 memset(xcb_out.pad1, 0, 2);
4344 xcb_parts[2].iov_base = (char *) &xcb_out;
4345 xcb_parts[2].iov_len = sizeof(xcb_out);
4346 xcb_parts[3].iov_base = 0;
4347 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4348 /* char name */
4349 xcb_parts[4].iov_base = (char *) name;
4350 xcb_parts[4].iov_len = name_len * sizeof(char);
4351 xcb_parts[5].iov_base = 0;
4352 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
4354 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
4355 return xcb_ret;
4358 xcb_void_cookie_t
4359 xcb_close_font_checked (xcb_connection_t *c /**< */,
4360 xcb_font_t font /**< */)
4362 static const xcb_protocol_request_t xcb_req = {
4363 /* count */ 2,
4364 /* ext */ 0,
4365 /* opcode */ XCB_CLOSE_FONT,
4366 /* isvoid */ 1
4369 struct iovec xcb_parts[4];
4370 xcb_void_cookie_t xcb_ret;
4371 xcb_close_font_request_t xcb_out;
4373 xcb_out.pad0 = 0;
4374 xcb_out.font = font;
4376 xcb_parts[2].iov_base = (char *) &xcb_out;
4377 xcb_parts[2].iov_len = sizeof(xcb_out);
4378 xcb_parts[3].iov_base = 0;
4379 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4381 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
4382 return xcb_ret;
4385 xcb_void_cookie_t
4386 xcb_close_font (xcb_connection_t *c /**< */,
4387 xcb_font_t font /**< */)
4389 static const xcb_protocol_request_t xcb_req = {
4390 /* count */ 2,
4391 /* ext */ 0,
4392 /* opcode */ XCB_CLOSE_FONT,
4393 /* isvoid */ 1
4396 struct iovec xcb_parts[4];
4397 xcb_void_cookie_t xcb_ret;
4398 xcb_close_font_request_t xcb_out;
4400 xcb_out.pad0 = 0;
4401 xcb_out.font = font;
4403 xcb_parts[2].iov_base = (char *) &xcb_out;
4404 xcb_parts[2].iov_len = sizeof(xcb_out);
4405 xcb_parts[3].iov_base = 0;
4406 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4408 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
4409 return xcb_ret;
4412 void
4413 xcb_fontprop_next (xcb_fontprop_iterator_t *i /**< */)
4415 --i->rem;
4416 ++i->data;
4417 i->index += sizeof(xcb_fontprop_t);
4420 xcb_generic_iterator_t
4421 xcb_fontprop_end (xcb_fontprop_iterator_t i /**< */)
4423 xcb_generic_iterator_t ret;
4424 ret.data = i.data + i.rem;
4425 ret.index = i.index + ((char *) ret.data - (char *) i.data);
4426 ret.rem = 0;
4427 return ret;
4430 void
4431 xcb_charinfo_next (xcb_charinfo_iterator_t *i /**< */)
4433 --i->rem;
4434 ++i->data;
4435 i->index += sizeof(xcb_charinfo_t);
4438 xcb_generic_iterator_t
4439 xcb_charinfo_end (xcb_charinfo_iterator_t i /**< */)
4441 xcb_generic_iterator_t ret;
4442 ret.data = i.data + i.rem;
4443 ret.index = i.index + ((char *) ret.data - (char *) i.data);
4444 ret.rem = 0;
4445 return ret;
4449 xcb_query_font_sizeof (const void *_buffer /**< */)
4451 char *xcb_tmp = (char *)_buffer;
4452 const xcb_query_font_reply_t *_aux = (xcb_query_font_reply_t *)_buffer;
4453 unsigned int xcb_buffer_len = 0;
4454 unsigned int xcb_block_len = 0;
4455 unsigned int xcb_pad = 0;
4456 unsigned int xcb_align_to = 0;
4459 xcb_block_len += sizeof(xcb_query_font_reply_t);
4460 xcb_tmp += xcb_block_len;
4461 xcb_buffer_len += xcb_block_len;
4462 xcb_block_len = 0;
4463 /* properties */
4464 xcb_block_len += _aux->properties_len * sizeof(xcb_fontprop_t);
4465 xcb_tmp += xcb_block_len;
4466 xcb_align_to = ALIGNOF(xcb_fontprop_t);
4467 /* insert padding */
4468 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4469 xcb_buffer_len += xcb_block_len + xcb_pad;
4470 if (0 != xcb_pad) {
4471 xcb_tmp += xcb_pad;
4472 xcb_pad = 0;
4474 xcb_block_len = 0;
4475 /* char_infos */
4476 xcb_block_len += _aux->char_infos_len * sizeof(xcb_charinfo_t);
4477 xcb_tmp += xcb_block_len;
4478 xcb_align_to = ALIGNOF(xcb_charinfo_t);
4479 /* insert padding */
4480 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4481 xcb_buffer_len += xcb_block_len + xcb_pad;
4482 if (0 != xcb_pad) {
4483 xcb_tmp += xcb_pad;
4484 xcb_pad = 0;
4486 xcb_block_len = 0;
4488 return xcb_buffer_len;
4491 xcb_query_font_cookie_t
4492 xcb_query_font (xcb_connection_t *c /**< */,
4493 xcb_fontable_t font /**< */)
4495 static const xcb_protocol_request_t xcb_req = {
4496 /* count */ 2,
4497 /* ext */ 0,
4498 /* opcode */ XCB_QUERY_FONT,
4499 /* isvoid */ 0
4502 struct iovec xcb_parts[4];
4503 xcb_query_font_cookie_t xcb_ret;
4504 xcb_query_font_request_t xcb_out;
4506 xcb_out.pad0 = 0;
4507 xcb_out.font = font;
4509 xcb_parts[2].iov_base = (char *) &xcb_out;
4510 xcb_parts[2].iov_len = sizeof(xcb_out);
4511 xcb_parts[3].iov_base = 0;
4512 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4514 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
4515 return xcb_ret;
4518 xcb_query_font_cookie_t
4519 xcb_query_font_unchecked (xcb_connection_t *c /**< */,
4520 xcb_fontable_t font /**< */)
4522 static const xcb_protocol_request_t xcb_req = {
4523 /* count */ 2,
4524 /* ext */ 0,
4525 /* opcode */ XCB_QUERY_FONT,
4526 /* isvoid */ 0
4529 struct iovec xcb_parts[4];
4530 xcb_query_font_cookie_t xcb_ret;
4531 xcb_query_font_request_t xcb_out;
4533 xcb_out.pad0 = 0;
4534 xcb_out.font = font;
4536 xcb_parts[2].iov_base = (char *) &xcb_out;
4537 xcb_parts[2].iov_len = sizeof(xcb_out);
4538 xcb_parts[3].iov_base = 0;
4539 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4541 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
4542 return xcb_ret;
4545 xcb_fontprop_t *
4546 xcb_query_font_properties (const xcb_query_font_reply_t *R /**< */)
4548 return (xcb_fontprop_t *) (R + 1);
4552 xcb_query_font_properties_length (const xcb_query_font_reply_t *R /**< */)
4554 return R->properties_len;
4557 xcb_fontprop_iterator_t
4558 xcb_query_font_properties_iterator (const xcb_query_font_reply_t *R /**< */)
4560 xcb_fontprop_iterator_t i;
4561 i.data = (xcb_fontprop_t *) (R + 1);
4562 i.rem = R->properties_len;
4563 i.index = (char *) i.data - (char *) R;
4564 return i;
4567 xcb_charinfo_t *
4568 xcb_query_font_char_infos (const xcb_query_font_reply_t *R /**< */)
4570 xcb_generic_iterator_t prev = xcb_fontprop_end(xcb_query_font_properties_iterator(R));
4571 return (xcb_charinfo_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_charinfo_t, prev.index) + 0);
4575 xcb_query_font_char_infos_length (const xcb_query_font_reply_t *R /**< */)
4577 return R->char_infos_len;
4580 xcb_charinfo_iterator_t
4581 xcb_query_font_char_infos_iterator (const xcb_query_font_reply_t *R /**< */)
4583 xcb_charinfo_iterator_t i;
4584 xcb_generic_iterator_t prev = xcb_fontprop_end(xcb_query_font_properties_iterator(R));
4585 i.data = (xcb_charinfo_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_charinfo_t, prev.index));
4586 i.rem = R->char_infos_len;
4587 i.index = (char *) i.data - (char *) R;
4588 return i;
4591 xcb_query_font_reply_t *
4592 xcb_query_font_reply (xcb_connection_t *c /**< */,
4593 xcb_query_font_cookie_t cookie /**< */,
4594 xcb_generic_error_t **e /**< */)
4596 return (xcb_query_font_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
4600 xcb_query_text_extents_sizeof (const void *_buffer /**< */,
4601 uint32_t string_len /**< */)
4603 char *xcb_tmp = (char *)_buffer;
4604 unsigned int xcb_buffer_len = 0;
4605 unsigned int xcb_block_len = 0;
4606 unsigned int xcb_pad = 0;
4607 unsigned int xcb_align_to = 0;
4610 xcb_block_len += sizeof(xcb_query_text_extents_request_t);
4611 xcb_tmp += xcb_block_len;
4612 xcb_buffer_len += xcb_block_len;
4613 xcb_block_len = 0;
4614 /* string */
4615 xcb_block_len += string_len * sizeof(xcb_char2b_t);
4616 xcb_tmp += xcb_block_len;
4617 xcb_align_to = ALIGNOF(xcb_char2b_t);
4618 /* insert padding */
4619 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4620 xcb_buffer_len += xcb_block_len + xcb_pad;
4621 if (0 != xcb_pad) {
4622 xcb_tmp += xcb_pad;
4623 xcb_pad = 0;
4625 xcb_block_len = 0;
4627 return xcb_buffer_len;
4630 xcb_query_text_extents_cookie_t
4631 xcb_query_text_extents (xcb_connection_t *c /**< */,
4632 xcb_fontable_t font /**< */,
4633 uint32_t string_len /**< */,
4634 const xcb_char2b_t *string /**< */)
4636 static const xcb_protocol_request_t xcb_req = {
4637 /* count */ 4,
4638 /* ext */ 0,
4639 /* opcode */ XCB_QUERY_TEXT_EXTENTS,
4640 /* isvoid */ 0
4643 struct iovec xcb_parts[6];
4644 xcb_query_text_extents_cookie_t xcb_ret;
4645 xcb_query_text_extents_request_t xcb_out;
4647 xcb_out.odd_length = (string_len & 1);
4648 xcb_out.font = font;
4650 xcb_parts[2].iov_base = (char *) &xcb_out;
4651 xcb_parts[2].iov_len = sizeof(xcb_out);
4652 xcb_parts[3].iov_base = 0;
4653 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4654 /* xcb_char2b_t string */
4655 xcb_parts[4].iov_base = (char *) string;
4656 xcb_parts[4].iov_len = string_len * sizeof(xcb_char2b_t);
4657 xcb_parts[5].iov_base = 0;
4658 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
4660 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
4661 return xcb_ret;
4664 xcb_query_text_extents_cookie_t
4665 xcb_query_text_extents_unchecked (xcb_connection_t *c /**< */,
4666 xcb_fontable_t font /**< */,
4667 uint32_t string_len /**< */,
4668 const xcb_char2b_t *string /**< */)
4670 static const xcb_protocol_request_t xcb_req = {
4671 /* count */ 4,
4672 /* ext */ 0,
4673 /* opcode */ XCB_QUERY_TEXT_EXTENTS,
4674 /* isvoid */ 0
4677 struct iovec xcb_parts[6];
4678 xcb_query_text_extents_cookie_t xcb_ret;
4679 xcb_query_text_extents_request_t xcb_out;
4681 xcb_out.odd_length = (string_len & 1);
4682 xcb_out.font = font;
4684 xcb_parts[2].iov_base = (char *) &xcb_out;
4685 xcb_parts[2].iov_len = sizeof(xcb_out);
4686 xcb_parts[3].iov_base = 0;
4687 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4688 /* xcb_char2b_t string */
4689 xcb_parts[4].iov_base = (char *) string;
4690 xcb_parts[4].iov_len = string_len * sizeof(xcb_char2b_t);
4691 xcb_parts[5].iov_base = 0;
4692 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
4694 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
4695 return xcb_ret;
4698 xcb_query_text_extents_reply_t *
4699 xcb_query_text_extents_reply (xcb_connection_t *c /**< */,
4700 xcb_query_text_extents_cookie_t cookie /**< */,
4701 xcb_generic_error_t **e /**< */)
4703 return (xcb_query_text_extents_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
4707 xcb_str_sizeof (const void *_buffer /**< */)
4709 char *xcb_tmp = (char *)_buffer;
4710 const xcb_str_t *_aux = (xcb_str_t *)_buffer;
4711 unsigned int xcb_buffer_len = 0;
4712 unsigned int xcb_block_len = 0;
4713 unsigned int xcb_pad = 0;
4714 unsigned int xcb_align_to = 0;
4717 xcb_block_len += sizeof(xcb_str_t);
4718 xcb_tmp += xcb_block_len;
4719 xcb_buffer_len += xcb_block_len;
4720 xcb_block_len = 0;
4721 /* name */
4722 xcb_block_len += _aux->name_len * sizeof(char);
4723 xcb_tmp += xcb_block_len;
4724 xcb_align_to = ALIGNOF(char);
4725 /* insert padding */
4726 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4727 xcb_buffer_len += xcb_block_len + xcb_pad;
4728 if (0 != xcb_pad) {
4729 xcb_tmp += xcb_pad;
4730 xcb_pad = 0;
4732 xcb_block_len = 0;
4734 return xcb_buffer_len;
4737 char *
4738 xcb_str_name (const xcb_str_t *R /**< */)
4740 return (char *) (R + 1);
4744 xcb_str_name_length (const xcb_str_t *R /**< */)
4746 return R->name_len;
4749 xcb_generic_iterator_t
4750 xcb_str_name_end (const xcb_str_t *R /**< */)
4752 xcb_generic_iterator_t i;
4753 i.data = ((char *) (R + 1)) + (R->name_len);
4754 i.rem = 0;
4755 i.index = (char *) i.data - (char *) R;
4756 return i;
4759 void
4760 xcb_str_next (xcb_str_iterator_t *i /**< */)
4762 xcb_str_t *R = i->data;
4763 xcb_generic_iterator_t child;
4764 child.data = (xcb_str_t *)(((char *)R) + xcb_str_sizeof(R));
4765 i->index = (char *) child.data - (char *) i->data;
4766 --i->rem;
4767 i->data = (xcb_str_t *) child.data;
4770 xcb_generic_iterator_t
4771 xcb_str_end (xcb_str_iterator_t i /**< */)
4773 xcb_generic_iterator_t ret;
4774 while(i.rem > 0)
4775 xcb_str_next(&i);
4776 ret.data = i.data;
4777 ret.rem = i.rem;
4778 ret.index = i.index;
4779 return ret;
4783 xcb_list_fonts_sizeof (const void *_buffer /**< */)
4785 char *xcb_tmp = (char *)_buffer;
4786 const xcb_list_fonts_request_t *_aux = (xcb_list_fonts_request_t *)_buffer;
4787 unsigned int xcb_buffer_len = 0;
4788 unsigned int xcb_block_len = 0;
4789 unsigned int xcb_pad = 0;
4790 unsigned int xcb_align_to = 0;
4793 xcb_block_len += sizeof(xcb_list_fonts_request_t);
4794 xcb_tmp += xcb_block_len;
4795 xcb_buffer_len += xcb_block_len;
4796 xcb_block_len = 0;
4797 /* pattern */
4798 xcb_block_len += _aux->pattern_len * sizeof(char);
4799 xcb_tmp += xcb_block_len;
4800 xcb_align_to = ALIGNOF(char);
4801 /* insert padding */
4802 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4803 xcb_buffer_len += xcb_block_len + xcb_pad;
4804 if (0 != xcb_pad) {
4805 xcb_tmp += xcb_pad;
4806 xcb_pad = 0;
4808 xcb_block_len = 0;
4810 return xcb_buffer_len;
4813 xcb_list_fonts_cookie_t
4814 xcb_list_fonts (xcb_connection_t *c /**< */,
4815 uint16_t max_names /**< */,
4816 uint16_t pattern_len /**< */,
4817 const char *pattern /**< */)
4819 static const xcb_protocol_request_t xcb_req = {
4820 /* count */ 4,
4821 /* ext */ 0,
4822 /* opcode */ XCB_LIST_FONTS,
4823 /* isvoid */ 0
4826 struct iovec xcb_parts[6];
4827 xcb_list_fonts_cookie_t xcb_ret;
4828 xcb_list_fonts_request_t xcb_out;
4830 xcb_out.pad0 = 0;
4831 xcb_out.max_names = max_names;
4832 xcb_out.pattern_len = pattern_len;
4834 xcb_parts[2].iov_base = (char *) &xcb_out;
4835 xcb_parts[2].iov_len = sizeof(xcb_out);
4836 xcb_parts[3].iov_base = 0;
4837 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4838 /* char pattern */
4839 xcb_parts[4].iov_base = (char *) pattern;
4840 xcb_parts[4].iov_len = pattern_len * sizeof(char);
4841 xcb_parts[5].iov_base = 0;
4842 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
4844 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
4845 return xcb_ret;
4848 xcb_list_fonts_cookie_t
4849 xcb_list_fonts_unchecked (xcb_connection_t *c /**< */,
4850 uint16_t max_names /**< */,
4851 uint16_t pattern_len /**< */,
4852 const char *pattern /**< */)
4854 static const xcb_protocol_request_t xcb_req = {
4855 /* count */ 4,
4856 /* ext */ 0,
4857 /* opcode */ XCB_LIST_FONTS,
4858 /* isvoid */ 0
4861 struct iovec xcb_parts[6];
4862 xcb_list_fonts_cookie_t xcb_ret;
4863 xcb_list_fonts_request_t xcb_out;
4865 xcb_out.pad0 = 0;
4866 xcb_out.max_names = max_names;
4867 xcb_out.pattern_len = pattern_len;
4869 xcb_parts[2].iov_base = (char *) &xcb_out;
4870 xcb_parts[2].iov_len = sizeof(xcb_out);
4871 xcb_parts[3].iov_base = 0;
4872 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4873 /* char pattern */
4874 xcb_parts[4].iov_base = (char *) pattern;
4875 xcb_parts[4].iov_len = pattern_len * sizeof(char);
4876 xcb_parts[5].iov_base = 0;
4877 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
4879 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
4880 return xcb_ret;
4884 xcb_list_fonts_names_length (const xcb_list_fonts_reply_t *R /**< */)
4886 return R->names_len;
4889 xcb_str_iterator_t
4890 xcb_list_fonts_names_iterator (const xcb_list_fonts_reply_t *R /**< */)
4892 xcb_str_iterator_t i;
4893 i.data = (xcb_str_t *) (R + 1);
4894 i.rem = R->names_len;
4895 i.index = (char *) i.data - (char *) R;
4896 return i;
4899 xcb_list_fonts_reply_t *
4900 xcb_list_fonts_reply (xcb_connection_t *c /**< */,
4901 xcb_list_fonts_cookie_t cookie /**< */,
4902 xcb_generic_error_t **e /**< */)
4904 return (xcb_list_fonts_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
4908 xcb_list_fonts_with_info_sizeof (const void *_buffer /**< */)
4910 char *xcb_tmp = (char *)_buffer;
4911 const xcb_list_fonts_with_info_request_t *_aux = (xcb_list_fonts_with_info_request_t *)_buffer;
4912 unsigned int xcb_buffer_len = 0;
4913 unsigned int xcb_block_len = 0;
4914 unsigned int xcb_pad = 0;
4915 unsigned int xcb_align_to = 0;
4918 xcb_block_len += sizeof(xcb_list_fonts_with_info_request_t);
4919 xcb_tmp += xcb_block_len;
4920 xcb_buffer_len += xcb_block_len;
4921 xcb_block_len = 0;
4922 /* pattern */
4923 xcb_block_len += _aux->pattern_len * sizeof(char);
4924 xcb_tmp += xcb_block_len;
4925 xcb_align_to = ALIGNOF(char);
4926 /* insert padding */
4927 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4928 xcb_buffer_len += xcb_block_len + xcb_pad;
4929 if (0 != xcb_pad) {
4930 xcb_tmp += xcb_pad;
4931 xcb_pad = 0;
4933 xcb_block_len = 0;
4935 return xcb_buffer_len;
4938 xcb_list_fonts_with_info_cookie_t
4939 xcb_list_fonts_with_info (xcb_connection_t *c /**< */,
4940 uint16_t max_names /**< */,
4941 uint16_t pattern_len /**< */,
4942 const char *pattern /**< */)
4944 static const xcb_protocol_request_t xcb_req = {
4945 /* count */ 4,
4946 /* ext */ 0,
4947 /* opcode */ XCB_LIST_FONTS_WITH_INFO,
4948 /* isvoid */ 0
4951 struct iovec xcb_parts[6];
4952 xcb_list_fonts_with_info_cookie_t xcb_ret;
4953 xcb_list_fonts_with_info_request_t xcb_out;
4955 xcb_out.pad0 = 0;
4956 xcb_out.max_names = max_names;
4957 xcb_out.pattern_len = pattern_len;
4959 xcb_parts[2].iov_base = (char *) &xcb_out;
4960 xcb_parts[2].iov_len = sizeof(xcb_out);
4961 xcb_parts[3].iov_base = 0;
4962 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4963 /* char pattern */
4964 xcb_parts[4].iov_base = (char *) pattern;
4965 xcb_parts[4].iov_len = pattern_len * sizeof(char);
4966 xcb_parts[5].iov_base = 0;
4967 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
4969 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
4970 return xcb_ret;
4973 xcb_list_fonts_with_info_cookie_t
4974 xcb_list_fonts_with_info_unchecked (xcb_connection_t *c /**< */,
4975 uint16_t max_names /**< */,
4976 uint16_t pattern_len /**< */,
4977 const char *pattern /**< */)
4979 static const xcb_protocol_request_t xcb_req = {
4980 /* count */ 4,
4981 /* ext */ 0,
4982 /* opcode */ XCB_LIST_FONTS_WITH_INFO,
4983 /* isvoid */ 0
4986 struct iovec xcb_parts[6];
4987 xcb_list_fonts_with_info_cookie_t xcb_ret;
4988 xcb_list_fonts_with_info_request_t xcb_out;
4990 xcb_out.pad0 = 0;
4991 xcb_out.max_names = max_names;
4992 xcb_out.pattern_len = pattern_len;
4994 xcb_parts[2].iov_base = (char *) &xcb_out;
4995 xcb_parts[2].iov_len = sizeof(xcb_out);
4996 xcb_parts[3].iov_base = 0;
4997 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4998 /* char pattern */
4999 xcb_parts[4].iov_base = (char *) pattern;
5000 xcb_parts[4].iov_len = pattern_len * sizeof(char);
5001 xcb_parts[5].iov_base = 0;
5002 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
5004 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
5005 return xcb_ret;
5008 xcb_fontprop_t *
5009 xcb_list_fonts_with_info_properties (const xcb_list_fonts_with_info_reply_t *R /**< */)
5011 return (xcb_fontprop_t *) (R + 1);
5015 xcb_list_fonts_with_info_properties_length (const xcb_list_fonts_with_info_reply_t *R /**< */)
5017 return R->properties_len;
5020 xcb_fontprop_iterator_t
5021 xcb_list_fonts_with_info_properties_iterator (const xcb_list_fonts_with_info_reply_t *R /**< */)
5023 xcb_fontprop_iterator_t i;
5024 i.data = (xcb_fontprop_t *) (R + 1);
5025 i.rem = R->properties_len;
5026 i.index = (char *) i.data - (char *) R;
5027 return i;
5030 char *
5031 xcb_list_fonts_with_info_name (const xcb_list_fonts_with_info_reply_t *R /**< */)
5033 xcb_generic_iterator_t prev = xcb_fontprop_end(xcb_list_fonts_with_info_properties_iterator(R));
5034 return (char *) ((char *) prev.data + XCB_TYPE_PAD(char, prev.index) + 0);
5038 xcb_list_fonts_with_info_name_length (const xcb_list_fonts_with_info_reply_t *R /**< */)
5040 return R->name_len;
5043 xcb_generic_iterator_t
5044 xcb_list_fonts_with_info_name_end (const xcb_list_fonts_with_info_reply_t *R /**< */)
5046 xcb_generic_iterator_t i;
5047 xcb_generic_iterator_t child = xcb_fontprop_end(xcb_list_fonts_with_info_properties_iterator(R));
5048 i.data = ((char *) child.data) + (R->name_len);
5049 i.rem = 0;
5050 i.index = (char *) i.data - (char *) R;
5051 return i;
5054 xcb_list_fonts_with_info_reply_t *
5055 xcb_list_fonts_with_info_reply (xcb_connection_t *c /**< */,
5056 xcb_list_fonts_with_info_cookie_t cookie /**< */,
5057 xcb_generic_error_t **e /**< */)
5059 return (xcb_list_fonts_with_info_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
5063 xcb_set_font_path_sizeof (const void *_buffer /**< */)
5065 char *xcb_tmp = (char *)_buffer;
5066 const xcb_set_font_path_request_t *_aux = (xcb_set_font_path_request_t *)_buffer;
5067 unsigned int xcb_buffer_len = 0;
5068 unsigned int xcb_block_len = 0;
5069 unsigned int xcb_pad = 0;
5070 unsigned int xcb_align_to = 0;
5072 unsigned int i;
5073 unsigned int xcb_tmp_len;
5075 xcb_block_len += sizeof(xcb_set_font_path_request_t);
5076 xcb_tmp += xcb_block_len;
5077 xcb_buffer_len += xcb_block_len;
5078 xcb_block_len = 0;
5079 /* font */
5080 for(i=0; i<_aux->font_qty; i++) {
5081 xcb_tmp_len = xcb_str_sizeof(xcb_tmp);
5082 xcb_block_len += xcb_tmp_len;
5083 xcb_tmp += xcb_tmp_len;
5085 xcb_align_to = ALIGNOF(xcb_str_t);
5086 /* insert padding */
5087 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
5088 xcb_buffer_len += xcb_block_len + xcb_pad;
5089 if (0 != xcb_pad) {
5090 xcb_tmp += xcb_pad;
5091 xcb_pad = 0;
5093 xcb_block_len = 0;
5095 return xcb_buffer_len;
5098 xcb_void_cookie_t
5099 xcb_set_font_path_checked (xcb_connection_t *c /**< */,
5100 uint16_t font_qty /**< */,
5101 const xcb_str_t *font /**< */)
5103 static const xcb_protocol_request_t xcb_req = {
5104 /* count */ 4,
5105 /* ext */ 0,
5106 /* opcode */ XCB_SET_FONT_PATH,
5107 /* isvoid */ 1
5110 struct iovec xcb_parts[6];
5111 xcb_void_cookie_t xcb_ret;
5112 xcb_set_font_path_request_t xcb_out;
5113 unsigned int i;
5114 unsigned int xcb_tmp_len;
5115 char *xcb_tmp;
5117 xcb_out.pad0 = 0;
5118 xcb_out.font_qty = font_qty;
5119 memset(xcb_out.pad1, 0, 2);
5121 xcb_parts[2].iov_base = (char *) &xcb_out;
5122 xcb_parts[2].iov_len = sizeof(xcb_out);
5123 xcb_parts[3].iov_base = 0;
5124 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5125 /* xcb_str_t font */
5126 xcb_parts[4].iov_base = (char *) font;
5127 xcb_parts[4].iov_len = 0;
5128 xcb_tmp = (char *)font;
5129 for(i=0; i<font_qty; i++) {
5130 xcb_tmp_len = xcb_str_sizeof(xcb_tmp);
5131 xcb_parts[4].iov_len += xcb_tmp_len;
5132 xcb_tmp += xcb_tmp_len;
5134 xcb_parts[5].iov_base = 0;
5135 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
5137 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
5138 return xcb_ret;
5141 xcb_void_cookie_t
5142 xcb_set_font_path (xcb_connection_t *c /**< */,
5143 uint16_t font_qty /**< */,
5144 const xcb_str_t *font /**< */)
5146 static const xcb_protocol_request_t xcb_req = {
5147 /* count */ 4,
5148 /* ext */ 0,
5149 /* opcode */ XCB_SET_FONT_PATH,
5150 /* isvoid */ 1
5153 struct iovec xcb_parts[6];
5154 xcb_void_cookie_t xcb_ret;
5155 xcb_set_font_path_request_t xcb_out;
5156 unsigned int i;
5157 unsigned int xcb_tmp_len;
5158 char *xcb_tmp;
5160 xcb_out.pad0 = 0;
5161 xcb_out.font_qty = font_qty;
5162 memset(xcb_out.pad1, 0, 2);
5164 xcb_parts[2].iov_base = (char *) &xcb_out;
5165 xcb_parts[2].iov_len = sizeof(xcb_out);
5166 xcb_parts[3].iov_base = 0;
5167 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5168 /* xcb_str_t font */
5169 xcb_parts[4].iov_base = (char *) font;
5170 xcb_parts[4].iov_len = 0;
5171 xcb_tmp = (char *)font;
5172 for(i=0; i<font_qty; i++) {
5173 xcb_tmp_len = xcb_str_sizeof(xcb_tmp);
5174 xcb_parts[4].iov_len += xcb_tmp_len;
5175 xcb_tmp += xcb_tmp_len;
5177 xcb_parts[5].iov_base = 0;
5178 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
5180 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
5181 return xcb_ret;
5185 xcb_get_font_path_sizeof (const void *_buffer /**< */)
5187 char *xcb_tmp = (char *)_buffer;
5188 const xcb_get_font_path_reply_t *_aux = (xcb_get_font_path_reply_t *)_buffer;
5189 unsigned int xcb_buffer_len = 0;
5190 unsigned int xcb_block_len = 0;
5191 unsigned int xcb_pad = 0;
5192 unsigned int xcb_align_to = 0;
5194 unsigned int i;
5195 unsigned int xcb_tmp_len;
5197 xcb_block_len += sizeof(xcb_get_font_path_reply_t);
5198 xcb_tmp += xcb_block_len;
5199 xcb_buffer_len += xcb_block_len;
5200 xcb_block_len = 0;
5201 /* path */
5202 for(i=0; i<_aux->path_len; i++) {
5203 xcb_tmp_len = xcb_str_sizeof(xcb_tmp);
5204 xcb_block_len += xcb_tmp_len;
5205 xcb_tmp += xcb_tmp_len;
5207 xcb_align_to = ALIGNOF(xcb_str_t);
5208 /* insert padding */
5209 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
5210 xcb_buffer_len += xcb_block_len + xcb_pad;
5211 if (0 != xcb_pad) {
5212 xcb_tmp += xcb_pad;
5213 xcb_pad = 0;
5215 xcb_block_len = 0;
5217 return xcb_buffer_len;
5220 xcb_get_font_path_cookie_t
5221 xcb_get_font_path (xcb_connection_t *c /**< */)
5223 static const xcb_protocol_request_t xcb_req = {
5224 /* count */ 2,
5225 /* ext */ 0,
5226 /* opcode */ XCB_GET_FONT_PATH,
5227 /* isvoid */ 0
5230 struct iovec xcb_parts[4];
5231 xcb_get_font_path_cookie_t xcb_ret;
5232 xcb_get_font_path_request_t xcb_out;
5234 xcb_out.pad0 = 0;
5236 xcb_parts[2].iov_base = (char *) &xcb_out;
5237 xcb_parts[2].iov_len = sizeof(xcb_out);
5238 xcb_parts[3].iov_base = 0;
5239 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5241 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
5242 return xcb_ret;
5245 xcb_get_font_path_cookie_t
5246 xcb_get_font_path_unchecked (xcb_connection_t *c /**< */)
5248 static const xcb_protocol_request_t xcb_req = {
5249 /* count */ 2,
5250 /* ext */ 0,
5251 /* opcode */ XCB_GET_FONT_PATH,
5252 /* isvoid */ 0
5255 struct iovec xcb_parts[4];
5256 xcb_get_font_path_cookie_t xcb_ret;
5257 xcb_get_font_path_request_t xcb_out;
5259 xcb_out.pad0 = 0;
5261 xcb_parts[2].iov_base = (char *) &xcb_out;
5262 xcb_parts[2].iov_len = sizeof(xcb_out);
5263 xcb_parts[3].iov_base = 0;
5264 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5266 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
5267 return xcb_ret;
5271 xcb_get_font_path_path_length (const xcb_get_font_path_reply_t *R /**< */)
5273 return R->path_len;
5276 xcb_str_iterator_t
5277 xcb_get_font_path_path_iterator (const xcb_get_font_path_reply_t *R /**< */)
5279 xcb_str_iterator_t i;
5280 i.data = (xcb_str_t *) (R + 1);
5281 i.rem = R->path_len;
5282 i.index = (char *) i.data - (char *) R;
5283 return i;
5286 xcb_get_font_path_reply_t *
5287 xcb_get_font_path_reply (xcb_connection_t *c /**< */,
5288 xcb_get_font_path_cookie_t cookie /**< */,
5289 xcb_generic_error_t **e /**< */)
5291 return (xcb_get_font_path_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
5294 xcb_void_cookie_t
5295 xcb_create_pixmap_checked (xcb_connection_t *c /**< */,
5296 uint8_t depth /**< */,
5297 xcb_pixmap_t pid /**< */,
5298 xcb_drawable_t drawable /**< */,
5299 uint16_t width /**< */,
5300 uint16_t height /**< */)
5302 static const xcb_protocol_request_t xcb_req = {
5303 /* count */ 2,
5304 /* ext */ 0,
5305 /* opcode */ XCB_CREATE_PIXMAP,
5306 /* isvoid */ 1
5309 struct iovec xcb_parts[4];
5310 xcb_void_cookie_t xcb_ret;
5311 xcb_create_pixmap_request_t xcb_out;
5313 xcb_out.depth = depth;
5314 xcb_out.pid = pid;
5315 xcb_out.drawable = drawable;
5316 xcb_out.width = width;
5317 xcb_out.height = height;
5319 xcb_parts[2].iov_base = (char *) &xcb_out;
5320 xcb_parts[2].iov_len = sizeof(xcb_out);
5321 xcb_parts[3].iov_base = 0;
5322 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5324 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
5325 return xcb_ret;
5328 xcb_void_cookie_t
5329 xcb_create_pixmap (xcb_connection_t *c /**< */,
5330 uint8_t depth /**< */,
5331 xcb_pixmap_t pid /**< */,
5332 xcb_drawable_t drawable /**< */,
5333 uint16_t width /**< */,
5334 uint16_t height /**< */)
5336 static const xcb_protocol_request_t xcb_req = {
5337 /* count */ 2,
5338 /* ext */ 0,
5339 /* opcode */ XCB_CREATE_PIXMAP,
5340 /* isvoid */ 1
5343 struct iovec xcb_parts[4];
5344 xcb_void_cookie_t xcb_ret;
5345 xcb_create_pixmap_request_t xcb_out;
5347 xcb_out.depth = depth;
5348 xcb_out.pid = pid;
5349 xcb_out.drawable = drawable;
5350 xcb_out.width = width;
5351 xcb_out.height = height;
5353 xcb_parts[2].iov_base = (char *) &xcb_out;
5354 xcb_parts[2].iov_len = sizeof(xcb_out);
5355 xcb_parts[3].iov_base = 0;
5356 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5358 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
5359 return xcb_ret;
5362 xcb_void_cookie_t
5363 xcb_free_pixmap_checked (xcb_connection_t *c /**< */,
5364 xcb_pixmap_t pixmap /**< */)
5366 static const xcb_protocol_request_t xcb_req = {
5367 /* count */ 2,
5368 /* ext */ 0,
5369 /* opcode */ XCB_FREE_PIXMAP,
5370 /* isvoid */ 1
5373 struct iovec xcb_parts[4];
5374 xcb_void_cookie_t xcb_ret;
5375 xcb_free_pixmap_request_t xcb_out;
5377 xcb_out.pad0 = 0;
5378 xcb_out.pixmap = pixmap;
5380 xcb_parts[2].iov_base = (char *) &xcb_out;
5381 xcb_parts[2].iov_len = sizeof(xcb_out);
5382 xcb_parts[3].iov_base = 0;
5383 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5385 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
5386 return xcb_ret;
5389 xcb_void_cookie_t
5390 xcb_free_pixmap (xcb_connection_t *c /**< */,
5391 xcb_pixmap_t pixmap /**< */)
5393 static const xcb_protocol_request_t xcb_req = {
5394 /* count */ 2,
5395 /* ext */ 0,
5396 /* opcode */ XCB_FREE_PIXMAP,
5397 /* isvoid */ 1
5400 struct iovec xcb_parts[4];
5401 xcb_void_cookie_t xcb_ret;
5402 xcb_free_pixmap_request_t xcb_out;
5404 xcb_out.pad0 = 0;
5405 xcb_out.pixmap = pixmap;
5407 xcb_parts[2].iov_base = (char *) &xcb_out;
5408 xcb_parts[2].iov_len = sizeof(xcb_out);
5409 xcb_parts[3].iov_base = 0;
5410 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5412 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
5413 return xcb_ret;
5417 xcb_create_gc_sizeof (const void *_buffer /**< */)
5419 char *xcb_tmp = (char *)_buffer;
5420 const xcb_create_gc_request_t *_aux = (xcb_create_gc_request_t *)_buffer;
5421 unsigned int xcb_buffer_len = 0;
5422 unsigned int xcb_block_len = 0;
5423 unsigned int xcb_pad = 0;
5424 unsigned int xcb_align_to = 0;
5427 xcb_block_len += sizeof(xcb_create_gc_request_t);
5428 xcb_tmp += xcb_block_len;
5429 xcb_buffer_len += xcb_block_len;
5430 xcb_block_len = 0;
5431 /* value_list */
5432 xcb_block_len += xcb_popcount(_aux->value_mask) * sizeof(uint32_t);
5433 xcb_tmp += xcb_block_len;
5434 xcb_align_to = ALIGNOF(uint32_t);
5435 /* insert padding */
5436 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
5437 xcb_buffer_len += xcb_block_len + xcb_pad;
5438 if (0 != xcb_pad) {
5439 xcb_tmp += xcb_pad;
5440 xcb_pad = 0;
5442 xcb_block_len = 0;
5444 return xcb_buffer_len;
5447 xcb_void_cookie_t
5448 xcb_create_gc_checked (xcb_connection_t *c /**< */,
5449 xcb_gcontext_t cid /**< */,
5450 xcb_drawable_t drawable /**< */,
5451 uint32_t value_mask /**< */,
5452 const uint32_t *value_list /**< */)
5454 static const xcb_protocol_request_t xcb_req = {
5455 /* count */ 4,
5456 /* ext */ 0,
5457 /* opcode */ XCB_CREATE_GC,
5458 /* isvoid */ 1
5461 struct iovec xcb_parts[6];
5462 xcb_void_cookie_t xcb_ret;
5463 xcb_create_gc_request_t xcb_out;
5465 xcb_out.pad0 = 0;
5466 xcb_out.cid = cid;
5467 xcb_out.drawable = drawable;
5468 xcb_out.value_mask = value_mask;
5470 xcb_parts[2].iov_base = (char *) &xcb_out;
5471 xcb_parts[2].iov_len = sizeof(xcb_out);
5472 xcb_parts[3].iov_base = 0;
5473 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5474 /* uint32_t value_list */
5475 xcb_parts[4].iov_base = (char *) value_list;
5476 xcb_parts[4].iov_len = xcb_popcount(value_mask) * sizeof(uint32_t);
5477 xcb_parts[5].iov_base = 0;
5478 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
5480 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
5481 return xcb_ret;
5484 xcb_void_cookie_t
5485 xcb_create_gc (xcb_connection_t *c /**< */,
5486 xcb_gcontext_t cid /**< */,
5487 xcb_drawable_t drawable /**< */,
5488 uint32_t value_mask /**< */,
5489 const uint32_t *value_list /**< */)
5491 static const xcb_protocol_request_t xcb_req = {
5492 /* count */ 4,
5493 /* ext */ 0,
5494 /* opcode */ XCB_CREATE_GC,
5495 /* isvoid */ 1
5498 struct iovec xcb_parts[6];
5499 xcb_void_cookie_t xcb_ret;
5500 xcb_create_gc_request_t xcb_out;
5502 xcb_out.pad0 = 0;
5503 xcb_out.cid = cid;
5504 xcb_out.drawable = drawable;
5505 xcb_out.value_mask = value_mask;
5507 xcb_parts[2].iov_base = (char *) &xcb_out;
5508 xcb_parts[2].iov_len = sizeof(xcb_out);
5509 xcb_parts[3].iov_base = 0;
5510 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5511 /* uint32_t value_list */
5512 xcb_parts[4].iov_base = (char *) value_list;
5513 xcb_parts[4].iov_len = xcb_popcount(value_mask) * sizeof(uint32_t);
5514 xcb_parts[5].iov_base = 0;
5515 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
5517 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
5518 return xcb_ret;
5522 xcb_change_gc_sizeof (const void *_buffer /**< */)
5524 char *xcb_tmp = (char *)_buffer;
5525 const xcb_change_gc_request_t *_aux = (xcb_change_gc_request_t *)_buffer;
5526 unsigned int xcb_buffer_len = 0;
5527 unsigned int xcb_block_len = 0;
5528 unsigned int xcb_pad = 0;
5529 unsigned int xcb_align_to = 0;
5532 xcb_block_len += sizeof(xcb_change_gc_request_t);
5533 xcb_tmp += xcb_block_len;
5534 xcb_buffer_len += xcb_block_len;
5535 xcb_block_len = 0;
5536 /* value_list */
5537 xcb_block_len += xcb_popcount(_aux->value_mask) * sizeof(uint32_t);
5538 xcb_tmp += xcb_block_len;
5539 xcb_align_to = ALIGNOF(uint32_t);
5540 /* insert padding */
5541 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
5542 xcb_buffer_len += xcb_block_len + xcb_pad;
5543 if (0 != xcb_pad) {
5544 xcb_tmp += xcb_pad;
5545 xcb_pad = 0;
5547 xcb_block_len = 0;
5549 return xcb_buffer_len;
5552 xcb_void_cookie_t
5553 xcb_change_gc_checked (xcb_connection_t *c /**< */,
5554 xcb_gcontext_t gc /**< */,
5555 uint32_t value_mask /**< */,
5556 const uint32_t *value_list /**< */)
5558 static const xcb_protocol_request_t xcb_req = {
5559 /* count */ 4,
5560 /* ext */ 0,
5561 /* opcode */ XCB_CHANGE_GC,
5562 /* isvoid */ 1
5565 struct iovec xcb_parts[6];
5566 xcb_void_cookie_t xcb_ret;
5567 xcb_change_gc_request_t xcb_out;
5569 xcb_out.pad0 = 0;
5570 xcb_out.gc = gc;
5571 xcb_out.value_mask = value_mask;
5573 xcb_parts[2].iov_base = (char *) &xcb_out;
5574 xcb_parts[2].iov_len = sizeof(xcb_out);
5575 xcb_parts[3].iov_base = 0;
5576 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5577 /* uint32_t value_list */
5578 xcb_parts[4].iov_base = (char *) value_list;
5579 xcb_parts[4].iov_len = xcb_popcount(value_mask) * sizeof(uint32_t);
5580 xcb_parts[5].iov_base = 0;
5581 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
5583 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
5584 return xcb_ret;
5587 xcb_void_cookie_t
5588 xcb_change_gc (xcb_connection_t *c /**< */,
5589 xcb_gcontext_t gc /**< */,
5590 uint32_t value_mask /**< */,
5591 const uint32_t *value_list /**< */)
5593 static const xcb_protocol_request_t xcb_req = {
5594 /* count */ 4,
5595 /* ext */ 0,
5596 /* opcode */ XCB_CHANGE_GC,
5597 /* isvoid */ 1
5600 struct iovec xcb_parts[6];
5601 xcb_void_cookie_t xcb_ret;
5602 xcb_change_gc_request_t xcb_out;
5604 xcb_out.pad0 = 0;
5605 xcb_out.gc = gc;
5606 xcb_out.value_mask = value_mask;
5608 xcb_parts[2].iov_base = (char *) &xcb_out;
5609 xcb_parts[2].iov_len = sizeof(xcb_out);
5610 xcb_parts[3].iov_base = 0;
5611 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5612 /* uint32_t value_list */
5613 xcb_parts[4].iov_base = (char *) value_list;
5614 xcb_parts[4].iov_len = xcb_popcount(value_mask) * sizeof(uint32_t);
5615 xcb_parts[5].iov_base = 0;
5616 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
5618 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
5619 return xcb_ret;
5622 xcb_void_cookie_t
5623 xcb_copy_gc_checked (xcb_connection_t *c /**< */,
5624 xcb_gcontext_t src_gc /**< */,
5625 xcb_gcontext_t dst_gc /**< */,
5626 uint32_t value_mask /**< */)
5628 static const xcb_protocol_request_t xcb_req = {
5629 /* count */ 2,
5630 /* ext */ 0,
5631 /* opcode */ XCB_COPY_GC,
5632 /* isvoid */ 1
5635 struct iovec xcb_parts[4];
5636 xcb_void_cookie_t xcb_ret;
5637 xcb_copy_gc_request_t xcb_out;
5639 xcb_out.pad0 = 0;
5640 xcb_out.src_gc = src_gc;
5641 xcb_out.dst_gc = dst_gc;
5642 xcb_out.value_mask = value_mask;
5644 xcb_parts[2].iov_base = (char *) &xcb_out;
5645 xcb_parts[2].iov_len = sizeof(xcb_out);
5646 xcb_parts[3].iov_base = 0;
5647 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5649 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
5650 return xcb_ret;
5653 xcb_void_cookie_t
5654 xcb_copy_gc (xcb_connection_t *c /**< */,
5655 xcb_gcontext_t src_gc /**< */,
5656 xcb_gcontext_t dst_gc /**< */,
5657 uint32_t value_mask /**< */)
5659 static const xcb_protocol_request_t xcb_req = {
5660 /* count */ 2,
5661 /* ext */ 0,
5662 /* opcode */ XCB_COPY_GC,
5663 /* isvoid */ 1
5666 struct iovec xcb_parts[4];
5667 xcb_void_cookie_t xcb_ret;
5668 xcb_copy_gc_request_t xcb_out;
5670 xcb_out.pad0 = 0;
5671 xcb_out.src_gc = src_gc;
5672 xcb_out.dst_gc = dst_gc;
5673 xcb_out.value_mask = value_mask;
5675 xcb_parts[2].iov_base = (char *) &xcb_out;
5676 xcb_parts[2].iov_len = sizeof(xcb_out);
5677 xcb_parts[3].iov_base = 0;
5678 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5680 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
5681 return xcb_ret;
5685 xcb_set_dashes_sizeof (const void *_buffer /**< */)
5687 char *xcb_tmp = (char *)_buffer;
5688 const xcb_set_dashes_request_t *_aux = (xcb_set_dashes_request_t *)_buffer;
5689 unsigned int xcb_buffer_len = 0;
5690 unsigned int xcb_block_len = 0;
5691 unsigned int xcb_pad = 0;
5692 unsigned int xcb_align_to = 0;
5695 xcb_block_len += sizeof(xcb_set_dashes_request_t);
5696 xcb_tmp += xcb_block_len;
5697 xcb_buffer_len += xcb_block_len;
5698 xcb_block_len = 0;
5699 /* dashes */
5700 xcb_block_len += _aux->dashes_len * sizeof(uint8_t);
5701 xcb_tmp += xcb_block_len;
5702 xcb_align_to = ALIGNOF(uint8_t);
5703 /* insert padding */
5704 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
5705 xcb_buffer_len += xcb_block_len + xcb_pad;
5706 if (0 != xcb_pad) {
5707 xcb_tmp += xcb_pad;
5708 xcb_pad = 0;
5710 xcb_block_len = 0;
5712 return xcb_buffer_len;
5715 xcb_void_cookie_t
5716 xcb_set_dashes_checked (xcb_connection_t *c /**< */,
5717 xcb_gcontext_t gc /**< */,
5718 uint16_t dash_offset /**< */,
5719 uint16_t dashes_len /**< */,
5720 const uint8_t *dashes /**< */)
5722 static const xcb_protocol_request_t xcb_req = {
5723 /* count */ 4,
5724 /* ext */ 0,
5725 /* opcode */ XCB_SET_DASHES,
5726 /* isvoid */ 1
5729 struct iovec xcb_parts[6];
5730 xcb_void_cookie_t xcb_ret;
5731 xcb_set_dashes_request_t xcb_out;
5733 xcb_out.pad0 = 0;
5734 xcb_out.gc = gc;
5735 xcb_out.dash_offset = dash_offset;
5736 xcb_out.dashes_len = dashes_len;
5738 xcb_parts[2].iov_base = (char *) &xcb_out;
5739 xcb_parts[2].iov_len = sizeof(xcb_out);
5740 xcb_parts[3].iov_base = 0;
5741 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5742 /* uint8_t dashes */
5743 xcb_parts[4].iov_base = (char *) dashes;
5744 xcb_parts[4].iov_len = dashes_len * sizeof(uint8_t);
5745 xcb_parts[5].iov_base = 0;
5746 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
5748 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
5749 return xcb_ret;
5752 xcb_void_cookie_t
5753 xcb_set_dashes (xcb_connection_t *c /**< */,
5754 xcb_gcontext_t gc /**< */,
5755 uint16_t dash_offset /**< */,
5756 uint16_t dashes_len /**< */,
5757 const uint8_t *dashes /**< */)
5759 static const xcb_protocol_request_t xcb_req = {
5760 /* count */ 4,
5761 /* ext */ 0,
5762 /* opcode */ XCB_SET_DASHES,
5763 /* isvoid */ 1
5766 struct iovec xcb_parts[6];
5767 xcb_void_cookie_t xcb_ret;
5768 xcb_set_dashes_request_t xcb_out;
5770 xcb_out.pad0 = 0;
5771 xcb_out.gc = gc;
5772 xcb_out.dash_offset = dash_offset;
5773 xcb_out.dashes_len = dashes_len;
5775 xcb_parts[2].iov_base = (char *) &xcb_out;
5776 xcb_parts[2].iov_len = sizeof(xcb_out);
5777 xcb_parts[3].iov_base = 0;
5778 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5779 /* uint8_t dashes */
5780 xcb_parts[4].iov_base = (char *) dashes;
5781 xcb_parts[4].iov_len = dashes_len * sizeof(uint8_t);
5782 xcb_parts[5].iov_base = 0;
5783 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
5785 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
5786 return xcb_ret;
5790 xcb_set_clip_rectangles_sizeof (const void *_buffer /**< */,
5791 uint32_t rectangles_len /**< */)
5793 char *xcb_tmp = (char *)_buffer;
5794 unsigned int xcb_buffer_len = 0;
5795 unsigned int xcb_block_len = 0;
5796 unsigned int xcb_pad = 0;
5797 unsigned int xcb_align_to = 0;
5800 xcb_block_len += sizeof(xcb_set_clip_rectangles_request_t);
5801 xcb_tmp += xcb_block_len;
5802 xcb_buffer_len += xcb_block_len;
5803 xcb_block_len = 0;
5804 /* rectangles */
5805 xcb_block_len += rectangles_len * sizeof(xcb_rectangle_t);
5806 xcb_tmp += xcb_block_len;
5807 xcb_align_to = ALIGNOF(xcb_rectangle_t);
5808 /* insert padding */
5809 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
5810 xcb_buffer_len += xcb_block_len + xcb_pad;
5811 if (0 != xcb_pad) {
5812 xcb_tmp += xcb_pad;
5813 xcb_pad = 0;
5815 xcb_block_len = 0;
5817 return xcb_buffer_len;
5820 xcb_void_cookie_t
5821 xcb_set_clip_rectangles_checked (xcb_connection_t *c /**< */,
5822 uint8_t ordering /**< */,
5823 xcb_gcontext_t gc /**< */,
5824 int16_t clip_x_origin /**< */,
5825 int16_t clip_y_origin /**< */,
5826 uint32_t rectangles_len /**< */,
5827 const xcb_rectangle_t *rectangles /**< */)
5829 static const xcb_protocol_request_t xcb_req = {
5830 /* count */ 4,
5831 /* ext */ 0,
5832 /* opcode */ XCB_SET_CLIP_RECTANGLES,
5833 /* isvoid */ 1
5836 struct iovec xcb_parts[6];
5837 xcb_void_cookie_t xcb_ret;
5838 xcb_set_clip_rectangles_request_t xcb_out;
5840 xcb_out.ordering = ordering;
5841 xcb_out.gc = gc;
5842 xcb_out.clip_x_origin = clip_x_origin;
5843 xcb_out.clip_y_origin = clip_y_origin;
5845 xcb_parts[2].iov_base = (char *) &xcb_out;
5846 xcb_parts[2].iov_len = sizeof(xcb_out);
5847 xcb_parts[3].iov_base = 0;
5848 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5849 /* xcb_rectangle_t rectangles */
5850 xcb_parts[4].iov_base = (char *) rectangles;
5851 xcb_parts[4].iov_len = rectangles_len * sizeof(xcb_rectangle_t);
5852 xcb_parts[5].iov_base = 0;
5853 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
5855 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
5856 return xcb_ret;
5859 xcb_void_cookie_t
5860 xcb_set_clip_rectangles (xcb_connection_t *c /**< */,
5861 uint8_t ordering /**< */,
5862 xcb_gcontext_t gc /**< */,
5863 int16_t clip_x_origin /**< */,
5864 int16_t clip_y_origin /**< */,
5865 uint32_t rectangles_len /**< */,
5866 const xcb_rectangle_t *rectangles /**< */)
5868 static const xcb_protocol_request_t xcb_req = {
5869 /* count */ 4,
5870 /* ext */ 0,
5871 /* opcode */ XCB_SET_CLIP_RECTANGLES,
5872 /* isvoid */ 1
5875 struct iovec xcb_parts[6];
5876 xcb_void_cookie_t xcb_ret;
5877 xcb_set_clip_rectangles_request_t xcb_out;
5879 xcb_out.ordering = ordering;
5880 xcb_out.gc = gc;
5881 xcb_out.clip_x_origin = clip_x_origin;
5882 xcb_out.clip_y_origin = clip_y_origin;
5884 xcb_parts[2].iov_base = (char *) &xcb_out;
5885 xcb_parts[2].iov_len = sizeof(xcb_out);
5886 xcb_parts[3].iov_base = 0;
5887 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5888 /* xcb_rectangle_t rectangles */
5889 xcb_parts[4].iov_base = (char *) rectangles;
5890 xcb_parts[4].iov_len = rectangles_len * sizeof(xcb_rectangle_t);
5891 xcb_parts[5].iov_base = 0;
5892 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
5894 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
5895 return xcb_ret;
5898 xcb_void_cookie_t
5899 xcb_free_gc_checked (xcb_connection_t *c /**< */,
5900 xcb_gcontext_t gc /**< */)
5902 static const xcb_protocol_request_t xcb_req = {
5903 /* count */ 2,
5904 /* ext */ 0,
5905 /* opcode */ XCB_FREE_GC,
5906 /* isvoid */ 1
5909 struct iovec xcb_parts[4];
5910 xcb_void_cookie_t xcb_ret;
5911 xcb_free_gc_request_t xcb_out;
5913 xcb_out.pad0 = 0;
5914 xcb_out.gc = gc;
5916 xcb_parts[2].iov_base = (char *) &xcb_out;
5917 xcb_parts[2].iov_len = sizeof(xcb_out);
5918 xcb_parts[3].iov_base = 0;
5919 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5921 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
5922 return xcb_ret;
5925 xcb_void_cookie_t
5926 xcb_free_gc (xcb_connection_t *c /**< */,
5927 xcb_gcontext_t gc /**< */)
5929 static const xcb_protocol_request_t xcb_req = {
5930 /* count */ 2,
5931 /* ext */ 0,
5932 /* opcode */ XCB_FREE_GC,
5933 /* isvoid */ 1
5936 struct iovec xcb_parts[4];
5937 xcb_void_cookie_t xcb_ret;
5938 xcb_free_gc_request_t xcb_out;
5940 xcb_out.pad0 = 0;
5941 xcb_out.gc = gc;
5943 xcb_parts[2].iov_base = (char *) &xcb_out;
5944 xcb_parts[2].iov_len = sizeof(xcb_out);
5945 xcb_parts[3].iov_base = 0;
5946 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5948 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
5949 return xcb_ret;
5952 xcb_void_cookie_t
5953 xcb_clear_area_checked (xcb_connection_t *c /**< */,
5954 uint8_t exposures /**< */,
5955 xcb_window_t window /**< */,
5956 int16_t x /**< */,
5957 int16_t y /**< */,
5958 uint16_t width /**< */,
5959 uint16_t height /**< */)
5961 static const xcb_protocol_request_t xcb_req = {
5962 /* count */ 2,
5963 /* ext */ 0,
5964 /* opcode */ XCB_CLEAR_AREA,
5965 /* isvoid */ 1
5968 struct iovec xcb_parts[4];
5969 xcb_void_cookie_t xcb_ret;
5970 xcb_clear_area_request_t xcb_out;
5972 xcb_out.exposures = exposures;
5973 xcb_out.window = window;
5974 xcb_out.x = x;
5975 xcb_out.y = y;
5976 xcb_out.width = width;
5977 xcb_out.height = height;
5979 xcb_parts[2].iov_base = (char *) &xcb_out;
5980 xcb_parts[2].iov_len = sizeof(xcb_out);
5981 xcb_parts[3].iov_base = 0;
5982 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
5984 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
5985 return xcb_ret;
5988 xcb_void_cookie_t
5989 xcb_clear_area (xcb_connection_t *c /**< */,
5990 uint8_t exposures /**< */,
5991 xcb_window_t window /**< */,
5992 int16_t x /**< */,
5993 int16_t y /**< */,
5994 uint16_t width /**< */,
5995 uint16_t height /**< */)
5997 static const xcb_protocol_request_t xcb_req = {
5998 /* count */ 2,
5999 /* ext */ 0,
6000 /* opcode */ XCB_CLEAR_AREA,
6001 /* isvoid */ 1
6004 struct iovec xcb_parts[4];
6005 xcb_void_cookie_t xcb_ret;
6006 xcb_clear_area_request_t xcb_out;
6008 xcb_out.exposures = exposures;
6009 xcb_out.window = window;
6010 xcb_out.x = x;
6011 xcb_out.y = y;
6012 xcb_out.width = width;
6013 xcb_out.height = height;
6015 xcb_parts[2].iov_base = (char *) &xcb_out;
6016 xcb_parts[2].iov_len = sizeof(xcb_out);
6017 xcb_parts[3].iov_base = 0;
6018 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
6020 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
6021 return xcb_ret;
6024 xcb_void_cookie_t
6025 xcb_copy_area_checked (xcb_connection_t *c /**< */,
6026 xcb_drawable_t src_drawable /**< */,
6027 xcb_drawable_t dst_drawable /**< */,
6028 xcb_gcontext_t gc /**< */,
6029 int16_t src_x /**< */,
6030 int16_t src_y /**< */,
6031 int16_t dst_x /**< */,
6032 int16_t dst_y /**< */,
6033 uint16_t width /**< */,
6034 uint16_t height /**< */)
6036 static const xcb_protocol_request_t xcb_req = {
6037 /* count */ 2,
6038 /* ext */ 0,
6039 /* opcode */ XCB_COPY_AREA,
6040 /* isvoid */ 1
6043 struct iovec xcb_parts[4];
6044 xcb_void_cookie_t xcb_ret;
6045 xcb_copy_area_request_t xcb_out;
6047 xcb_out.pad0 = 0;
6048 xcb_out.src_drawable = src_drawable;
6049 xcb_out.dst_drawable = dst_drawable;
6050 xcb_out.gc = gc;
6051 xcb_out.src_x = src_x;
6052 xcb_out.src_y = src_y;
6053 xcb_out.dst_x = dst_x;
6054 xcb_out.dst_y = dst_y;
6055 xcb_out.width = width;
6056 xcb_out.height = height;
6058 xcb_parts[2].iov_base = (char *) &xcb_out;
6059 xcb_parts[2].iov_len = sizeof(xcb_out);
6060 xcb_parts[3].iov_base = 0;
6061 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
6063 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
6064 return xcb_ret;
6067 xcb_void_cookie_t
6068 xcb_copy_area (xcb_connection_t *c /**< */,
6069 xcb_drawable_t src_drawable /**< */,
6070 xcb_drawable_t dst_drawable /**< */,
6071 xcb_gcontext_t gc /**< */,
6072 int16_t src_x /**< */,
6073 int16_t src_y /**< */,
6074 int16_t dst_x /**< */,
6075 int16_t dst_y /**< */,
6076 uint16_t width /**< */,
6077 uint16_t height /**< */)
6079 static const xcb_protocol_request_t xcb_req = {
6080 /* count */ 2,
6081 /* ext */ 0,
6082 /* opcode */ XCB_COPY_AREA,
6083 /* isvoid */ 1
6086 struct iovec xcb_parts[4];
6087 xcb_void_cookie_t xcb_ret;
6088 xcb_copy_area_request_t xcb_out;
6090 xcb_out.pad0 = 0;
6091 xcb_out.src_drawable = src_drawable;
6092 xcb_out.dst_drawable = dst_drawable;
6093 xcb_out.gc = gc;
6094 xcb_out.src_x = src_x;
6095 xcb_out.src_y = src_y;
6096 xcb_out.dst_x = dst_x;
6097 xcb_out.dst_y = dst_y;
6098 xcb_out.width = width;
6099 xcb_out.height = height;
6101 xcb_parts[2].iov_base = (char *) &xcb_out;
6102 xcb_parts[2].iov_len = sizeof(xcb_out);
6103 xcb_parts[3].iov_base = 0;
6104 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
6106 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
6107 return xcb_ret;
6110 xcb_void_cookie_t
6111 xcb_copy_plane_checked (xcb_connection_t *c /**< */,
6112 xcb_drawable_t src_drawable /**< */,
6113 xcb_drawable_t dst_drawable /**< */,
6114 xcb_gcontext_t gc /**< */,
6115 int16_t src_x /**< */,
6116 int16_t src_y /**< */,
6117 int16_t dst_x /**< */,
6118 int16_t dst_y /**< */,
6119 uint16_t width /**< */,
6120 uint16_t height /**< */,
6121 uint32_t bit_plane /**< */)
6123 static const xcb_protocol_request_t xcb_req = {
6124 /* count */ 2,
6125 /* ext */ 0,
6126 /* opcode */ XCB_COPY_PLANE,
6127 /* isvoid */ 1
6130 struct iovec xcb_parts[4];
6131 xcb_void_cookie_t xcb_ret;
6132 xcb_copy_plane_request_t xcb_out;
6134 xcb_out.pad0 = 0;
6135 xcb_out.src_drawable = src_drawable;
6136 xcb_out.dst_drawable = dst_drawable;
6137 xcb_out.gc = gc;
6138 xcb_out.src_x = src_x;
6139 xcb_out.src_y = src_y;
6140 xcb_out.dst_x = dst_x;
6141 xcb_out.dst_y = dst_y;
6142 xcb_out.width = width;
6143 xcb_out.height = height;
6144 xcb_out.bit_plane = bit_plane;
6146 xcb_parts[2].iov_base = (char *) &xcb_out;
6147 xcb_parts[2].iov_len = sizeof(xcb_out);
6148 xcb_parts[3].iov_base = 0;
6149 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
6151 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
6152 return xcb_ret;
6155 xcb_void_cookie_t
6156 xcb_copy_plane (xcb_connection_t *c /**< */,
6157 xcb_drawable_t src_drawable /**< */,
6158 xcb_drawable_t dst_drawable /**< */,
6159 xcb_gcontext_t gc /**< */,
6160 int16_t src_x /**< */,
6161 int16_t src_y /**< */,
6162 int16_t dst_x /**< */,
6163 int16_t dst_y /**< */,
6164 uint16_t width /**< */,
6165 uint16_t height /**< */,
6166 uint32_t bit_plane /**< */)
6168 static const xcb_protocol_request_t xcb_req = {
6169 /* count */ 2,
6170 /* ext */ 0,
6171 /* opcode */ XCB_COPY_PLANE,
6172 /* isvoid */ 1
6175 struct iovec xcb_parts[4];
6176 xcb_void_cookie_t xcb_ret;
6177 xcb_copy_plane_request_t xcb_out;
6179 xcb_out.pad0 = 0;
6180 xcb_out.src_drawable = src_drawable;
6181 xcb_out.dst_drawable = dst_drawable;
6182 xcb_out.gc = gc;
6183 xcb_out.src_x = src_x;
6184 xcb_out.src_y = src_y;
6185 xcb_out.dst_x = dst_x;
6186 xcb_out.dst_y = dst_y;
6187 xcb_out.width = width;
6188 xcb_out.height = height;
6189 xcb_out.bit_plane = bit_plane;
6191 xcb_parts[2].iov_base = (char *) &xcb_out;
6192 xcb_parts[2].iov_len = sizeof(xcb_out);
6193 xcb_parts[3].iov_base = 0;
6194 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
6196 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
6197 return xcb_ret;
6201 xcb_poly_point_sizeof (const void *_buffer /**< */,
6202 uint32_t points_len /**< */)
6204 char *xcb_tmp = (char *)_buffer;
6205 unsigned int xcb_buffer_len = 0;
6206 unsigned int xcb_block_len = 0;
6207 unsigned int xcb_pad = 0;
6208 unsigned int xcb_align_to = 0;
6211 xcb_block_len += sizeof(xcb_poly_point_request_t);
6212 xcb_tmp += xcb_block_len;
6213 xcb_buffer_len += xcb_block_len;
6214 xcb_block_len = 0;
6215 /* points */
6216 xcb_block_len += points_len * sizeof(xcb_point_t);
6217 xcb_tmp += xcb_block_len;
6218 xcb_align_to = ALIGNOF(xcb_point_t);
6219 /* insert padding */
6220 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6221 xcb_buffer_len += xcb_block_len + xcb_pad;
6222 if (0 != xcb_pad) {
6223 xcb_tmp += xcb_pad;
6224 xcb_pad = 0;
6226 xcb_block_len = 0;
6228 return xcb_buffer_len;
6231 xcb_void_cookie_t
6232 xcb_poly_point_checked (xcb_connection_t *c /**< */,
6233 uint8_t coordinate_mode /**< */,
6234 xcb_drawable_t drawable /**< */,
6235 xcb_gcontext_t gc /**< */,
6236 uint32_t points_len /**< */,
6237 const xcb_point_t *points /**< */)
6239 static const xcb_protocol_request_t xcb_req = {
6240 /* count */ 4,
6241 /* ext */ 0,
6242 /* opcode */ XCB_POLY_POINT,
6243 /* isvoid */ 1
6246 struct iovec xcb_parts[6];
6247 xcb_void_cookie_t xcb_ret;
6248 xcb_poly_point_request_t xcb_out;
6250 xcb_out.coordinate_mode = coordinate_mode;
6251 xcb_out.drawable = drawable;
6252 xcb_out.gc = gc;
6254 xcb_parts[2].iov_base = (char *) &xcb_out;
6255 xcb_parts[2].iov_len = sizeof(xcb_out);
6256 xcb_parts[3].iov_base = 0;
6257 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
6258 /* xcb_point_t points */
6259 xcb_parts[4].iov_base = (char *) points;
6260 xcb_parts[4].iov_len = points_len * sizeof(xcb_point_t);
6261 xcb_parts[5].iov_base = 0;
6262 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
6264 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
6265 return xcb_ret;
6268 xcb_void_cookie_t
6269 xcb_poly_point (xcb_connection_t *c /**< */,
6270 uint8_t coordinate_mode /**< */,
6271 xcb_drawable_t drawable /**< */,
6272 xcb_gcontext_t gc /**< */,
6273 uint32_t points_len /**< */,
6274 const xcb_point_t *points /**< */)
6276 static const xcb_protocol_request_t xcb_req = {
6277 /* count */ 4,
6278 /* ext */ 0,
6279 /* opcode */ XCB_POLY_POINT,
6280 /* isvoid */ 1
6283 struct iovec xcb_parts[6];
6284 xcb_void_cookie_t xcb_ret;
6285 xcb_poly_point_request_t xcb_out;
6287 xcb_out.coordinate_mode = coordinate_mode;
6288 xcb_out.drawable = drawable;
6289 xcb_out.gc = gc;
6291 xcb_parts[2].iov_base = (char *) &xcb_out;
6292 xcb_parts[2].iov_len = sizeof(xcb_out);
6293 xcb_parts[3].iov_base = 0;
6294 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
6295 /* xcb_point_t points */
6296 xcb_parts[4].iov_base = (char *) points;
6297 xcb_parts[4].iov_len = points_len * sizeof(xcb_point_t);
6298 xcb_parts[5].iov_base = 0;
6299 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
6301 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
6302 return xcb_ret;
6306 xcb_poly_line_sizeof (const void *_buffer /**< */,
6307 uint32_t points_len /**< */)
6309 char *xcb_tmp = (char *)_buffer;
6310 unsigned int xcb_buffer_len = 0;
6311 unsigned int xcb_block_len = 0;
6312 unsigned int xcb_pad = 0;
6313 unsigned int xcb_align_to = 0;
6316 xcb_block_len += sizeof(xcb_poly_line_request_t);
6317 xcb_tmp += xcb_block_len;
6318 xcb_buffer_len += xcb_block_len;
6319 xcb_block_len = 0;
6320 /* points */
6321 xcb_block_len += points_len * sizeof(xcb_point_t);
6322 xcb_tmp += xcb_block_len;
6323 xcb_align_to = ALIGNOF(xcb_point_t);
6324 /* insert padding */
6325 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6326 xcb_buffer_len += xcb_block_len + xcb_pad;
6327 if (0 != xcb_pad) {
6328 xcb_tmp += xcb_pad;
6329 xcb_pad = 0;
6331 xcb_block_len = 0;
6333 return xcb_buffer_len;
6336 xcb_void_cookie_t
6337 xcb_poly_line_checked (xcb_connection_t *c /**< */,
6338 uint8_t coordinate_mode /**< */,
6339 xcb_drawable_t drawable /**< */,
6340 xcb_gcontext_t gc /**< */,
6341 uint32_t points_len /**< */,
6342 const xcb_point_t *points /**< */)
6344 static const xcb_protocol_request_t xcb_req = {
6345 /* count */ 4,
6346 /* ext */ 0,
6347 /* opcode */ XCB_POLY_LINE,
6348 /* isvoid */ 1
6351 struct iovec xcb_parts[6];
6352 xcb_void_cookie_t xcb_ret;
6353 xcb_poly_line_request_t xcb_out;
6355 xcb_out.coordinate_mode = coordinate_mode;
6356 xcb_out.drawable = drawable;
6357 xcb_out.gc = gc;
6359 xcb_parts[2].iov_base = (char *) &xcb_out;
6360 xcb_parts[2].iov_len = sizeof(xcb_out);
6361 xcb_parts[3].iov_base = 0;
6362 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
6363 /* xcb_point_t points */
6364 xcb_parts[4].iov_base = (char *) points;
6365 xcb_parts[4].iov_len = points_len * sizeof(xcb_point_t);
6366 xcb_parts[5].iov_base = 0;
6367 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
6369 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
6370 return xcb_ret;
6373 xcb_void_cookie_t
6374 xcb_poly_line (xcb_connection_t *c /**< */,
6375 uint8_t coordinate_mode /**< */,
6376 xcb_drawable_t drawable /**< */,
6377 xcb_gcontext_t gc /**< */,
6378 uint32_t points_len /**< */,
6379 const xcb_point_t *points /**< */)
6381 static const xcb_protocol_request_t xcb_req = {
6382 /* count */ 4,
6383 /* ext */ 0,
6384 /* opcode */ XCB_POLY_LINE,
6385 /* isvoid */ 1
6388 struct iovec xcb_parts[6];
6389 xcb_void_cookie_t xcb_ret;
6390 xcb_poly_line_request_t xcb_out;
6392 xcb_out.coordinate_mode = coordinate_mode;
6393 xcb_out.drawable = drawable;
6394 xcb_out.gc = gc;
6396 xcb_parts[2].iov_base = (char *) &xcb_out;
6397 xcb_parts[2].iov_len = sizeof(xcb_out);
6398 xcb_parts[3].iov_base = 0;
6399 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
6400 /* xcb_point_t points */
6401 xcb_parts[4].iov_base = (char *) points;
6402 xcb_parts[4].iov_len = points_len * sizeof(xcb_point_t);
6403 xcb_parts[5].iov_base = 0;
6404 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
6406 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
6407 return xcb_ret;
6410 void
6411 xcb_segment_next (xcb_segment_iterator_t *i /**< */)
6413 --i->rem;
6414 ++i->data;
6415 i->index += sizeof(xcb_segment_t);
6418 xcb_generic_iterator_t
6419 xcb_segment_end (xcb_segment_iterator_t i /**< */)
6421 xcb_generic_iterator_t ret;
6422 ret.data = i.data + i.rem;
6423 ret.index = i.index + ((char *) ret.data - (char *) i.data);
6424 ret.rem = 0;
6425 return ret;
6429 xcb_poly_segment_sizeof (const void *_buffer /**< */,
6430 uint32_t segments_len /**< */)
6432 char *xcb_tmp = (char *)_buffer;
6433 unsigned int xcb_buffer_len = 0;
6434 unsigned int xcb_block_len = 0;
6435 unsigned int xcb_pad = 0;
6436 unsigned int xcb_align_to = 0;
6439 xcb_block_len += sizeof(xcb_poly_segment_request_t);
6440 xcb_tmp += xcb_block_len;
6441 xcb_buffer_len += xcb_block_len;
6442 xcb_block_len = 0;
6443 /* segments */
6444 xcb_block_len += segments_len * sizeof(xcb_segment_t);
6445 xcb_tmp += xcb_block_len;
6446 xcb_align_to = ALIGNOF(xcb_segment_t);
6447 /* insert padding */
6448 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6449 xcb_buffer_len += xcb_block_len + xcb_pad;
6450 if (0 != xcb_pad) {
6451 xcb_tmp += xcb_pad;
6452 xcb_pad = 0;
6454 xcb_block_len = 0;
6456 return xcb_buffer_len;
6459 xcb_void_cookie_t
6460 xcb_poly_segment_checked (xcb_connection_t *c /**< */,
6461 xcb_drawable_t drawable /**< */,
6462 xcb_gcontext_t gc /**< */,
6463 uint32_t segments_len /**< */,
6464 const xcb_segment_t *segments /**< */)
6466 static const xcb_protocol_request_t xcb_req = {
6467 /* count */ 4,
6468 /* ext */ 0,
6469 /* opcode */ XCB_POLY_SEGMENT,
6470 /* isvoid */ 1
6473 struct iovec xcb_parts[6];
6474 xcb_void_cookie_t xcb_ret;
6475 xcb_poly_segment_request_t xcb_out;
6477 xcb_out.pad0 = 0;
6478 xcb_out.drawable = drawable;
6479 xcb_out.gc = gc;
6481 xcb_parts[2].iov_base = (char *) &xcb_out;
6482 xcb_parts[2].iov_len = sizeof(xcb_out);
6483 xcb_parts[3].iov_base = 0;
6484 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
6485 /* xcb_segment_t segments */
6486 xcb_parts[4].iov_base = (char *) segments;
6487 xcb_parts[4].iov_len = segments_len * sizeof(xcb_segment_t);
6488 xcb_parts[5].iov_base = 0;
6489 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
6491 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
6492 return xcb_ret;
6495 xcb_void_cookie_t
6496 xcb_poly_segment (xcb_connection_t *c /**< */,
6497 xcb_drawable_t drawable /**< */,
6498 xcb_gcontext_t gc /**< */,
6499 uint32_t segments_len /**< */,
6500 const xcb_segment_t *segments /**< */)
6502 static const xcb_protocol_request_t xcb_req = {
6503 /* count */ 4,
6504 /* ext */ 0,
6505 /* opcode */ XCB_POLY_SEGMENT,
6506 /* isvoid */ 1
6509 struct iovec xcb_parts[6];
6510 xcb_void_cookie_t xcb_ret;
6511 xcb_poly_segment_request_t xcb_out;
6513 xcb_out.pad0 = 0;
6514 xcb_out.drawable = drawable;
6515 xcb_out.gc = gc;
6517 xcb_parts[2].iov_base = (char *) &xcb_out;
6518 xcb_parts[2].iov_len = sizeof(xcb_out);
6519 xcb_parts[3].iov_base = 0;
6520 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
6521 /* xcb_segment_t segments */
6522 xcb_parts[4].iov_base = (char *) segments;
6523 xcb_parts[4].iov_len = segments_len * sizeof(xcb_segment_t);
6524 xcb_parts[5].iov_base = 0;
6525 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
6527 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
6528 return xcb_ret;
6532 xcb_poly_rectangle_sizeof (const void *_buffer /**< */,
6533 uint32_t rectangles_len /**< */)
6535 char *xcb_tmp = (char *)_buffer;
6536 unsigned int xcb_buffer_len = 0;
6537 unsigned int xcb_block_len = 0;
6538 unsigned int xcb_pad = 0;
6539 unsigned int xcb_align_to = 0;
6542 xcb_block_len += sizeof(xcb_poly_rectangle_request_t);
6543 xcb_tmp += xcb_block_len;
6544 xcb_buffer_len += xcb_block_len;
6545 xcb_block_len = 0;
6546 /* rectangles */
6547 xcb_block_len += rectangles_len * sizeof(xcb_rectangle_t);
6548 xcb_tmp += xcb_block_len;
6549 xcb_align_to = ALIGNOF(xcb_rectangle_t);
6550 /* insert padding */
6551 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6552 xcb_buffer_len += xcb_block_len + xcb_pad;
6553 if (0 != xcb_pad) {
6554 xcb_tmp += xcb_pad;
6555 xcb_pad = 0;
6557 xcb_block_len = 0;
6559 return xcb_buffer_len;
6562 xcb_void_cookie_t
6563 xcb_poly_rectangle_checked (xcb_connection_t *c /**< */,
6564 xcb_drawable_t drawable /**< */,
6565 xcb_gcontext_t gc /**< */,
6566 uint32_t rectangles_len /**< */,
6567 const xcb_rectangle_t *rectangles /**< */)
6569 static const xcb_protocol_request_t xcb_req = {
6570 /* count */ 4,
6571 /* ext */ 0,
6572 /* opcode */ XCB_POLY_RECTANGLE,
6573 /* isvoid */ 1
6576 struct iovec xcb_parts[6];
6577 xcb_void_cookie_t xcb_ret;
6578 xcb_poly_rectangle_request_t xcb_out;
6580 xcb_out.pad0 = 0;
6581 xcb_out.drawable = drawable;
6582 xcb_out.gc = gc;
6584 xcb_parts[2].iov_base = (char *) &xcb_out;
6585 xcb_parts[2].iov_len = sizeof(xcb_out);
6586 xcb_parts[3].iov_base = 0;
6587 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
6588 /* xcb_rectangle_t rectangles */
6589 xcb_parts[4].iov_base = (char *) rectangles;
6590 xcb_parts[4].iov_len = rectangles_len * sizeof(xcb_rectangle_t);
6591 xcb_parts[5].iov_base = 0;
6592 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
6594 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
6595 return xcb_ret;
6598 xcb_void_cookie_t
6599 xcb_poly_rectangle (xcb_connection_t *c /**< */,
6600 xcb_drawable_t drawable /**< */,
6601 xcb_gcontext_t gc /**< */,
6602 uint32_t rectangles_len /**< */,
6603 const xcb_rectangle_t *rectangles /**< */)
6605 static const xcb_protocol_request_t xcb_req = {
6606 /* count */ 4,
6607 /* ext */ 0,
6608 /* opcode */ XCB_POLY_RECTANGLE,
6609 /* isvoid */ 1
6612 struct iovec xcb_parts[6];
6613 xcb_void_cookie_t xcb_ret;
6614 xcb_poly_rectangle_request_t xcb_out;
6616 xcb_out.pad0 = 0;
6617 xcb_out.drawable = drawable;
6618 xcb_out.gc = gc;
6620 xcb_parts[2].iov_base = (char *) &xcb_out;
6621 xcb_parts[2].iov_len = sizeof(xcb_out);
6622 xcb_parts[3].iov_base = 0;
6623 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
6624 /* xcb_rectangle_t rectangles */
6625 xcb_parts[4].iov_base = (char *) rectangles;
6626 xcb_parts[4].iov_len = rectangles_len * sizeof(xcb_rectangle_t);
6627 xcb_parts[5].iov_base = 0;
6628 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
6630 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
6631 return xcb_ret;
6635 xcb_poly_arc_sizeof (const void *_buffer /**< */,
6636 uint32_t arcs_len /**< */)
6638 char *xcb_tmp = (char *)_buffer;
6639 unsigned int xcb_buffer_len = 0;
6640 unsigned int xcb_block_len = 0;
6641 unsigned int xcb_pad = 0;
6642 unsigned int xcb_align_to = 0;
6645 xcb_block_len += sizeof(xcb_poly_arc_request_t);
6646 xcb_tmp += xcb_block_len;
6647 xcb_buffer_len += xcb_block_len;
6648 xcb_block_len = 0;
6649 /* arcs */
6650 xcb_block_len += arcs_len * sizeof(xcb_arc_t);
6651 xcb_tmp += xcb_block_len;
6652 xcb_align_to = ALIGNOF(xcb_arc_t);
6653 /* insert padding */
6654 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6655 xcb_buffer_len += xcb_block_len + xcb_pad;
6656 if (0 != xcb_pad) {
6657 xcb_tmp += xcb_pad;
6658 xcb_pad = 0;
6660 xcb_block_len = 0;
6662 return xcb_buffer_len;
6665 xcb_void_cookie_t
6666 xcb_poly_arc_checked (xcb_connection_t *c /**< */,
6667 xcb_drawable_t drawable /**< */,
6668 xcb_gcontext_t gc /**< */,
6669 uint32_t arcs_len /**< */,
6670 const xcb_arc_t *arcs /**< */)
6672 static const xcb_protocol_request_t xcb_req = {
6673 /* count */ 4,
6674 /* ext */ 0,
6675 /* opcode */ XCB_POLY_ARC,
6676 /* isvoid */ 1
6679 struct iovec xcb_parts[6];
6680 xcb_void_cookie_t xcb_ret;
6681 xcb_poly_arc_request_t xcb_out;
6683 xcb_out.pad0 = 0;
6684 xcb_out.drawable = drawable;
6685 xcb_out.gc = gc;
6687 xcb_parts[2].iov_base = (char *) &xcb_out;
6688 xcb_parts[2].iov_len = sizeof(xcb_out);
6689 xcb_parts[3].iov_base = 0;
6690 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
6691 /* xcb_arc_t arcs */
6692 xcb_parts[4].iov_base = (char *) arcs;
6693 xcb_parts[4].iov_len = arcs_len * sizeof(xcb_arc_t);
6694 xcb_parts[5].iov_base = 0;
6695 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
6697 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
6698 return xcb_ret;
6701 xcb_void_cookie_t
6702 xcb_poly_arc (xcb_connection_t *c /**< */,
6703 xcb_drawable_t drawable /**< */,
6704 xcb_gcontext_t gc /**< */,
6705 uint32_t arcs_len /**< */,
6706 const xcb_arc_t *arcs /**< */)
6708 static const xcb_protocol_request_t xcb_req = {
6709 /* count */ 4,
6710 /* ext */ 0,
6711 /* opcode */ XCB_POLY_ARC,
6712 /* isvoid */ 1
6715 struct iovec xcb_parts[6];
6716 xcb_void_cookie_t xcb_ret;
6717 xcb_poly_arc_request_t xcb_out;
6719 xcb_out.pad0 = 0;
6720 xcb_out.drawable = drawable;
6721 xcb_out.gc = gc;
6723 xcb_parts[2].iov_base = (char *) &xcb_out;
6724 xcb_parts[2].iov_len = sizeof(xcb_out);
6725 xcb_parts[3].iov_base = 0;
6726 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
6727 /* xcb_arc_t arcs */
6728 xcb_parts[4].iov_base = (char *) arcs;
6729 xcb_parts[4].iov_len = arcs_len * sizeof(xcb_arc_t);
6730 xcb_parts[5].iov_base = 0;
6731 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
6733 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
6734 return xcb_ret;
6738 xcb_fill_poly_sizeof (const void *_buffer /**< */,
6739 uint32_t points_len /**< */)
6741 char *xcb_tmp = (char *)_buffer;
6742 unsigned int xcb_buffer_len = 0;
6743 unsigned int xcb_block_len = 0;
6744 unsigned int xcb_pad = 0;
6745 unsigned int xcb_align_to = 0;
6748 xcb_block_len += sizeof(xcb_fill_poly_request_t);
6749 xcb_tmp += xcb_block_len;
6750 xcb_buffer_len += xcb_block_len;
6751 xcb_block_len = 0;
6752 /* points */
6753 xcb_block_len += points_len * sizeof(xcb_point_t);
6754 xcb_tmp += xcb_block_len;
6755 xcb_align_to = ALIGNOF(xcb_point_t);
6756 /* insert padding */
6757 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6758 xcb_buffer_len += xcb_block_len + xcb_pad;
6759 if (0 != xcb_pad) {
6760 xcb_tmp += xcb_pad;
6761 xcb_pad = 0;
6763 xcb_block_len = 0;
6765 return xcb_buffer_len;
6768 xcb_void_cookie_t
6769 xcb_fill_poly_checked (xcb_connection_t *c /**< */,
6770 xcb_drawable_t drawable /**< */,
6771 xcb_gcontext_t gc /**< */,
6772 uint8_t shape /**< */,
6773 uint8_t coordinate_mode /**< */,
6774 uint32_t points_len /**< */,
6775 const xcb_point_t *points /**< */)
6777 static const xcb_protocol_request_t xcb_req = {
6778 /* count */ 4,
6779 /* ext */ 0,
6780 /* opcode */ XCB_FILL_POLY,
6781 /* isvoid */ 1
6784 struct iovec xcb_parts[6];
6785 xcb_void_cookie_t xcb_ret;
6786 xcb_fill_poly_request_t xcb_out;
6788 xcb_out.pad0 = 0;
6789 xcb_out.drawable = drawable;
6790 xcb_out.gc = gc;
6791 xcb_out.shape = shape;
6792 xcb_out.coordinate_mode = coordinate_mode;
6793 memset(xcb_out.pad1, 0, 2);
6795 xcb_parts[2].iov_base = (char *) &xcb_out;
6796 xcb_parts[2].iov_len = sizeof(xcb_out);
6797 xcb_parts[3].iov_base = 0;
6798 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
6799 /* xcb_point_t points */
6800 xcb_parts[4].iov_base = (char *) points;
6801 xcb_parts[4].iov_len = points_len * sizeof(xcb_point_t);
6802 xcb_parts[5].iov_base = 0;
6803 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
6805 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
6806 return xcb_ret;
6809 xcb_void_cookie_t
6810 xcb_fill_poly (xcb_connection_t *c /**< */,
6811 xcb_drawable_t drawable /**< */,
6812 xcb_gcontext_t gc /**< */,
6813 uint8_t shape /**< */,
6814 uint8_t coordinate_mode /**< */,
6815 uint32_t points_len /**< */,
6816 const xcb_point_t *points /**< */)
6818 static const xcb_protocol_request_t xcb_req = {
6819 /* count */ 4,
6820 /* ext */ 0,
6821 /* opcode */ XCB_FILL_POLY,
6822 /* isvoid */ 1
6825 struct iovec xcb_parts[6];
6826 xcb_void_cookie_t xcb_ret;
6827 xcb_fill_poly_request_t xcb_out;
6829 xcb_out.pad0 = 0;
6830 xcb_out.drawable = drawable;
6831 xcb_out.gc = gc;
6832 xcb_out.shape = shape;
6833 xcb_out.coordinate_mode = coordinate_mode;
6834 memset(xcb_out.pad1, 0, 2);
6836 xcb_parts[2].iov_base = (char *) &xcb_out;
6837 xcb_parts[2].iov_len = sizeof(xcb_out);
6838 xcb_parts[3].iov_base = 0;
6839 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
6840 /* xcb_point_t points */
6841 xcb_parts[4].iov_base = (char *) points;
6842 xcb_parts[4].iov_len = points_len * sizeof(xcb_point_t);
6843 xcb_parts[5].iov_base = 0;
6844 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
6846 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
6847 return xcb_ret;
6851 xcb_poly_fill_rectangle_sizeof (const void *_buffer /**< */,
6852 uint32_t rectangles_len /**< */)
6854 char *xcb_tmp = (char *)_buffer;
6855 unsigned int xcb_buffer_len = 0;
6856 unsigned int xcb_block_len = 0;
6857 unsigned int xcb_pad = 0;
6858 unsigned int xcb_align_to = 0;
6861 xcb_block_len += sizeof(xcb_poly_fill_rectangle_request_t);
6862 xcb_tmp += xcb_block_len;
6863 xcb_buffer_len += xcb_block_len;
6864 xcb_block_len = 0;
6865 /* rectangles */
6866 xcb_block_len += rectangles_len * sizeof(xcb_rectangle_t);
6867 xcb_tmp += xcb_block_len;
6868 xcb_align_to = ALIGNOF(xcb_rectangle_t);
6869 /* insert padding */
6870 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6871 xcb_buffer_len += xcb_block_len + xcb_pad;
6872 if (0 != xcb_pad) {
6873 xcb_tmp += xcb_pad;
6874 xcb_pad = 0;
6876 xcb_block_len = 0;
6878 return xcb_buffer_len;
6881 xcb_void_cookie_t
6882 xcb_poly_fill_rectangle_checked (xcb_connection_t *c /**< */,
6883 xcb_drawable_t drawable /**< */,
6884 xcb_gcontext_t gc /**< */,
6885 uint32_t rectangles_len /**< */,
6886 const xcb_rectangle_t *rectangles /**< */)
6888 static const xcb_protocol_request_t xcb_req = {
6889 /* count */ 4,
6890 /* ext */ 0,
6891 /* opcode */ XCB_POLY_FILL_RECTANGLE,
6892 /* isvoid */ 1
6895 struct iovec xcb_parts[6];
6896 xcb_void_cookie_t xcb_ret;
6897 xcb_poly_fill_rectangle_request_t xcb_out;
6899 xcb_out.pad0 = 0;
6900 xcb_out.drawable = drawable;
6901 xcb_out.gc = gc;
6903 xcb_parts[2].iov_base = (char *) &xcb_out;
6904 xcb_parts[2].iov_len = sizeof(xcb_out);
6905 xcb_parts[3].iov_base = 0;
6906 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
6907 /* xcb_rectangle_t rectangles */
6908 xcb_parts[4].iov_base = (char *) rectangles;
6909 xcb_parts[4].iov_len = rectangles_len * sizeof(xcb_rectangle_t);
6910 xcb_parts[5].iov_base = 0;
6911 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
6913 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
6914 return xcb_ret;
6917 xcb_void_cookie_t
6918 xcb_poly_fill_rectangle (xcb_connection_t *c /**< */,
6919 xcb_drawable_t drawable /**< */,
6920 xcb_gcontext_t gc /**< */,
6921 uint32_t rectangles_len /**< */,
6922 const xcb_rectangle_t *rectangles /**< */)
6924 static const xcb_protocol_request_t xcb_req = {
6925 /* count */ 4,
6926 /* ext */ 0,
6927 /* opcode */ XCB_POLY_FILL_RECTANGLE,
6928 /* isvoid */ 1
6931 struct iovec xcb_parts[6];
6932 xcb_void_cookie_t xcb_ret;
6933 xcb_poly_fill_rectangle_request_t xcb_out;
6935 xcb_out.pad0 = 0;
6936 xcb_out.drawable = drawable;
6937 xcb_out.gc = gc;
6939 xcb_parts[2].iov_base = (char *) &xcb_out;
6940 xcb_parts[2].iov_len = sizeof(xcb_out);
6941 xcb_parts[3].iov_base = 0;
6942 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
6943 /* xcb_rectangle_t rectangles */
6944 xcb_parts[4].iov_base = (char *) rectangles;
6945 xcb_parts[4].iov_len = rectangles_len * sizeof(xcb_rectangle_t);
6946 xcb_parts[5].iov_base = 0;
6947 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
6949 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
6950 return xcb_ret;
6954 xcb_poly_fill_arc_sizeof (const void *_buffer /**< */,
6955 uint32_t arcs_len /**< */)
6957 char *xcb_tmp = (char *)_buffer;
6958 unsigned int xcb_buffer_len = 0;
6959 unsigned int xcb_block_len = 0;
6960 unsigned int xcb_pad = 0;
6961 unsigned int xcb_align_to = 0;
6964 xcb_block_len += sizeof(xcb_poly_fill_arc_request_t);
6965 xcb_tmp += xcb_block_len;
6966 xcb_buffer_len += xcb_block_len;
6967 xcb_block_len = 0;
6968 /* arcs */
6969 xcb_block_len += arcs_len * sizeof(xcb_arc_t);
6970 xcb_tmp += xcb_block_len;
6971 xcb_align_to = ALIGNOF(xcb_arc_t);
6972 /* insert padding */
6973 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
6974 xcb_buffer_len += xcb_block_len + xcb_pad;
6975 if (0 != xcb_pad) {
6976 xcb_tmp += xcb_pad;
6977 xcb_pad = 0;
6979 xcb_block_len = 0;
6981 return xcb_buffer_len;
6984 xcb_void_cookie_t
6985 xcb_poly_fill_arc_checked (xcb_connection_t *c /**< */,
6986 xcb_drawable_t drawable /**< */,
6987 xcb_gcontext_t gc /**< */,
6988 uint32_t arcs_len /**< */,
6989 const xcb_arc_t *arcs /**< */)
6991 static const xcb_protocol_request_t xcb_req = {
6992 /* count */ 4,
6993 /* ext */ 0,
6994 /* opcode */ XCB_POLY_FILL_ARC,
6995 /* isvoid */ 1
6998 struct iovec xcb_parts[6];
6999 xcb_void_cookie_t xcb_ret;
7000 xcb_poly_fill_arc_request_t xcb_out;
7002 xcb_out.pad0 = 0;
7003 xcb_out.drawable = drawable;
7004 xcb_out.gc = gc;
7006 xcb_parts[2].iov_base = (char *) &xcb_out;
7007 xcb_parts[2].iov_len = sizeof(xcb_out);
7008 xcb_parts[3].iov_base = 0;
7009 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
7010 /* xcb_arc_t arcs */
7011 xcb_parts[4].iov_base = (char *) arcs;
7012 xcb_parts[4].iov_len = arcs_len * sizeof(xcb_arc_t);
7013 xcb_parts[5].iov_base = 0;
7014 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
7016 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
7017 return xcb_ret;
7020 xcb_void_cookie_t
7021 xcb_poly_fill_arc (xcb_connection_t *c /**< */,
7022 xcb_drawable_t drawable /**< */,
7023 xcb_gcontext_t gc /**< */,
7024 uint32_t arcs_len /**< */,
7025 const xcb_arc_t *arcs /**< */)
7027 static const xcb_protocol_request_t xcb_req = {
7028 /* count */ 4,
7029 /* ext */ 0,
7030 /* opcode */ XCB_POLY_FILL_ARC,
7031 /* isvoid */ 1
7034 struct iovec xcb_parts[6];
7035 xcb_void_cookie_t xcb_ret;
7036 xcb_poly_fill_arc_request_t xcb_out;
7038 xcb_out.pad0 = 0;
7039 xcb_out.drawable = drawable;
7040 xcb_out.gc = gc;
7042 xcb_parts[2].iov_base = (char *) &xcb_out;
7043 xcb_parts[2].iov_len = sizeof(xcb_out);
7044 xcb_parts[3].iov_base = 0;
7045 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
7046 /* xcb_arc_t arcs */
7047 xcb_parts[4].iov_base = (char *) arcs;
7048 xcb_parts[4].iov_len = arcs_len * sizeof(xcb_arc_t);
7049 xcb_parts[5].iov_base = 0;
7050 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
7052 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
7053 return xcb_ret;
7057 xcb_put_image_sizeof (const void *_buffer /**< */,
7058 uint32_t data_len /**< */)
7060 char *xcb_tmp = (char *)_buffer;
7061 unsigned int xcb_buffer_len = 0;
7062 unsigned int xcb_block_len = 0;
7063 unsigned int xcb_pad = 0;
7064 unsigned int xcb_align_to = 0;
7067 xcb_block_len += sizeof(xcb_put_image_request_t);
7068 xcb_tmp += xcb_block_len;
7069 xcb_buffer_len += xcb_block_len;
7070 xcb_block_len = 0;
7071 /* data */
7072 xcb_block_len += data_len * sizeof(uint8_t);
7073 xcb_tmp += xcb_block_len;
7074 xcb_align_to = ALIGNOF(uint8_t);
7075 /* insert padding */
7076 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
7077 xcb_buffer_len += xcb_block_len + xcb_pad;
7078 if (0 != xcb_pad) {
7079 xcb_tmp += xcb_pad;
7080 xcb_pad = 0;
7082 xcb_block_len = 0;
7084 return xcb_buffer_len;
7087 xcb_void_cookie_t
7088 xcb_put_image_checked (xcb_connection_t *c /**< */,
7089 uint8_t format /**< */,
7090 xcb_drawable_t drawable /**< */,
7091 xcb_gcontext_t gc /**< */,
7092 uint16_t width /**< */,
7093 uint16_t height /**< */,
7094 int16_t dst_x /**< */,
7095 int16_t dst_y /**< */,
7096 uint8_t left_pad /**< */,
7097 uint8_t depth /**< */,
7098 uint32_t data_len /**< */,
7099 const uint8_t *data /**< */)
7101 static const xcb_protocol_request_t xcb_req = {
7102 /* count */ 4,
7103 /* ext */ 0,
7104 /* opcode */ XCB_PUT_IMAGE,
7105 /* isvoid */ 1
7108 struct iovec xcb_parts[6];
7109 xcb_void_cookie_t xcb_ret;
7110 xcb_put_image_request_t xcb_out;
7112 xcb_out.format = format;
7113 xcb_out.drawable = drawable;
7114 xcb_out.gc = gc;
7115 xcb_out.width = width;
7116 xcb_out.height = height;
7117 xcb_out.dst_x = dst_x;
7118 xcb_out.dst_y = dst_y;
7119 xcb_out.left_pad = left_pad;
7120 xcb_out.depth = depth;
7121 memset(xcb_out.pad0, 0, 2);
7123 xcb_parts[2].iov_base = (char *) &xcb_out;
7124 xcb_parts[2].iov_len = sizeof(xcb_out);
7125 xcb_parts[3].iov_base = 0;
7126 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
7127 /* uint8_t data */
7128 xcb_parts[4].iov_base = (char *) data;
7129 xcb_parts[4].iov_len = data_len * sizeof(uint8_t);
7130 xcb_parts[5].iov_base = 0;
7131 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
7133 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
7134 return xcb_ret;
7137 xcb_void_cookie_t
7138 xcb_put_image (xcb_connection_t *c /**< */,
7139 uint8_t format /**< */,
7140 xcb_drawable_t drawable /**< */,
7141 xcb_gcontext_t gc /**< */,
7142 uint16_t width /**< */,
7143 uint16_t height /**< */,
7144 int16_t dst_x /**< */,
7145 int16_t dst_y /**< */,
7146 uint8_t left_pad /**< */,
7147 uint8_t depth /**< */,
7148 uint32_t data_len /**< */,
7149 const uint8_t *data /**< */)
7151 static const xcb_protocol_request_t xcb_req = {
7152 /* count */ 4,
7153 /* ext */ 0,
7154 /* opcode */ XCB_PUT_IMAGE,
7155 /* isvoid */ 1
7158 struct iovec xcb_parts[6];
7159 xcb_void_cookie_t xcb_ret;
7160 xcb_put_image_request_t xcb_out;
7162 xcb_out.format = format;
7163 xcb_out.drawable = drawable;
7164 xcb_out.gc = gc;
7165 xcb_out.width = width;
7166 xcb_out.height = height;
7167 xcb_out.dst_x = dst_x;
7168 xcb_out.dst_y = dst_y;
7169 xcb_out.left_pad = left_pad;
7170 xcb_out.depth = depth;
7171 memset(xcb_out.pad0, 0, 2);
7173 xcb_parts[2].iov_base = (char *) &xcb_out;
7174 xcb_parts[2].iov_len = sizeof(xcb_out);
7175 xcb_parts[3].iov_base = 0;
7176 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
7177 /* uint8_t data */
7178 xcb_parts[4].iov_base = (char *) data;
7179 xcb_parts[4].iov_len = data_len * sizeof(uint8_t);
7180 xcb_parts[5].iov_base = 0;
7181 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
7183 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
7184 return xcb_ret;
7188 xcb_get_image_sizeof (const void *_buffer /**< */)
7190 char *xcb_tmp = (char *)_buffer;
7191 const xcb_get_image_reply_t *_aux = (xcb_get_image_reply_t *)_buffer;
7192 unsigned int xcb_buffer_len = 0;
7193 unsigned int xcb_block_len = 0;
7194 unsigned int xcb_pad = 0;
7195 unsigned int xcb_align_to = 0;
7198 xcb_block_len += sizeof(xcb_get_image_reply_t);
7199 xcb_tmp += xcb_block_len;
7200 xcb_buffer_len += xcb_block_len;
7201 xcb_block_len = 0;
7202 /* data */
7203 xcb_block_len += (_aux->length * 4) * sizeof(uint8_t);
7204 xcb_tmp += xcb_block_len;
7205 xcb_align_to = ALIGNOF(uint8_t);
7206 /* insert padding */
7207 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
7208 xcb_buffer_len += xcb_block_len + xcb_pad;
7209 if (0 != xcb_pad) {
7210 xcb_tmp += xcb_pad;
7211 xcb_pad = 0;
7213 xcb_block_len = 0;
7215 return xcb_buffer_len;
7218 xcb_get_image_cookie_t
7219 xcb_get_image (xcb_connection_t *c /**< */,
7220 uint8_t format /**< */,
7221 xcb_drawable_t drawable /**< */,
7222 int16_t x /**< */,
7223 int16_t y /**< */,
7224 uint16_t width /**< */,
7225 uint16_t height /**< */,
7226 uint32_t plane_mask /**< */)
7228 static const xcb_protocol_request_t xcb_req = {
7229 /* count */ 2,
7230 /* ext */ 0,
7231 /* opcode */ XCB_GET_IMAGE,
7232 /* isvoid */ 0
7235 struct iovec xcb_parts[4];
7236 xcb_get_image_cookie_t xcb_ret;
7237 xcb_get_image_request_t xcb_out;
7239 xcb_out.format = format;
7240 xcb_out.drawable = drawable;
7241 xcb_out.x = x;
7242 xcb_out.y = y;
7243 xcb_out.width = width;
7244 xcb_out.height = height;
7245 xcb_out.plane_mask = plane_mask;
7247 xcb_parts[2].iov_base = (char *) &xcb_out;
7248 xcb_parts[2].iov_len = sizeof(xcb_out);
7249 xcb_parts[3].iov_base = 0;
7250 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
7252 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
7253 return xcb_ret;
7256 xcb_get_image_cookie_t
7257 xcb_get_image_unchecked (xcb_connection_t *c /**< */,
7258 uint8_t format /**< */,
7259 xcb_drawable_t drawable /**< */,
7260 int16_t x /**< */,
7261 int16_t y /**< */,
7262 uint16_t width /**< */,
7263 uint16_t height /**< */,
7264 uint32_t plane_mask /**< */)
7266 static const xcb_protocol_request_t xcb_req = {
7267 /* count */ 2,
7268 /* ext */ 0,
7269 /* opcode */ XCB_GET_IMAGE,
7270 /* isvoid */ 0
7273 struct iovec xcb_parts[4];
7274 xcb_get_image_cookie_t xcb_ret;
7275 xcb_get_image_request_t xcb_out;
7277 xcb_out.format = format;
7278 xcb_out.drawable = drawable;
7279 xcb_out.x = x;
7280 xcb_out.y = y;
7281 xcb_out.width = width;
7282 xcb_out.height = height;
7283 xcb_out.plane_mask = plane_mask;
7285 xcb_parts[2].iov_base = (char *) &xcb_out;
7286 xcb_parts[2].iov_len = sizeof(xcb_out);
7287 xcb_parts[3].iov_base = 0;
7288 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
7290 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
7291 return xcb_ret;
7294 uint8_t *
7295 xcb_get_image_data (const xcb_get_image_reply_t *R /**< */)
7297 return (uint8_t *) (R + 1);
7301 xcb_get_image_data_length (const xcb_get_image_reply_t *R /**< */)
7303 return (R->length * 4);
7306 xcb_generic_iterator_t
7307 xcb_get_image_data_end (const xcb_get_image_reply_t *R /**< */)
7309 xcb_generic_iterator_t i;
7310 i.data = ((uint8_t *) (R + 1)) + ((R->length * 4));
7311 i.rem = 0;
7312 i.index = (char *) i.data - (char *) R;
7313 return i;
7316 xcb_get_image_reply_t *
7317 xcb_get_image_reply (xcb_connection_t *c /**< */,
7318 xcb_get_image_cookie_t cookie /**< */,
7319 xcb_generic_error_t **e /**< */)
7321 return (xcb_get_image_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
7325 xcb_poly_text_8_sizeof (const void *_buffer /**< */,
7326 uint32_t items_len /**< */)
7328 char *xcb_tmp = (char *)_buffer;
7329 unsigned int xcb_buffer_len = 0;
7330 unsigned int xcb_block_len = 0;
7331 unsigned int xcb_pad = 0;
7332 unsigned int xcb_align_to = 0;
7335 xcb_block_len += sizeof(xcb_poly_text_8_request_t);
7336 xcb_tmp += xcb_block_len;
7337 xcb_buffer_len += xcb_block_len;
7338 xcb_block_len = 0;
7339 /* items */
7340 xcb_block_len += items_len * sizeof(uint8_t);
7341 xcb_tmp += xcb_block_len;
7342 xcb_align_to = ALIGNOF(uint8_t);
7343 /* insert padding */
7344 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
7345 xcb_buffer_len += xcb_block_len + xcb_pad;
7346 if (0 != xcb_pad) {
7347 xcb_tmp += xcb_pad;
7348 xcb_pad = 0;
7350 xcb_block_len = 0;
7352 return xcb_buffer_len;
7355 xcb_void_cookie_t
7356 xcb_poly_text_8_checked (xcb_connection_t *c /**< */,
7357 xcb_drawable_t drawable /**< */,
7358 xcb_gcontext_t gc /**< */,
7359 int16_t x /**< */,
7360 int16_t y /**< */,
7361 uint32_t items_len /**< */,
7362 const uint8_t *items /**< */)
7364 static const xcb_protocol_request_t xcb_req = {
7365 /* count */ 4,
7366 /* ext */ 0,
7367 /* opcode */ XCB_POLY_TEXT_8,
7368 /* isvoid */ 1
7371 struct iovec xcb_parts[6];
7372 xcb_void_cookie_t xcb_ret;
7373 xcb_poly_text_8_request_t xcb_out;
7375 xcb_out.pad0 = 0;
7376 xcb_out.drawable = drawable;
7377 xcb_out.gc = gc;
7378 xcb_out.x = x;
7379 xcb_out.y = y;
7381 xcb_parts[2].iov_base = (char *) &xcb_out;
7382 xcb_parts[2].iov_len = sizeof(xcb_out);
7383 xcb_parts[3].iov_base = 0;
7384 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
7385 /* uint8_t items */
7386 xcb_parts[4].iov_base = (char *) items;
7387 xcb_parts[4].iov_len = items_len * sizeof(uint8_t);
7388 xcb_parts[5].iov_base = 0;
7389 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
7391 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
7392 return xcb_ret;
7395 xcb_void_cookie_t
7396 xcb_poly_text_8 (xcb_connection_t *c /**< */,
7397 xcb_drawable_t drawable /**< */,
7398 xcb_gcontext_t gc /**< */,
7399 int16_t x /**< */,
7400 int16_t y /**< */,
7401 uint32_t items_len /**< */,
7402 const uint8_t *items /**< */)
7404 static const xcb_protocol_request_t xcb_req = {
7405 /* count */ 4,
7406 /* ext */ 0,
7407 /* opcode */ XCB_POLY_TEXT_8,
7408 /* isvoid */ 1
7411 struct iovec xcb_parts[6];
7412 xcb_void_cookie_t xcb_ret;
7413 xcb_poly_text_8_request_t xcb_out;
7415 xcb_out.pad0 = 0;
7416 xcb_out.drawable = drawable;
7417 xcb_out.gc = gc;
7418 xcb_out.x = x;
7419 xcb_out.y = y;
7421 xcb_parts[2].iov_base = (char *) &xcb_out;
7422 xcb_parts[2].iov_len = sizeof(xcb_out);
7423 xcb_parts[3].iov_base = 0;
7424 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
7425 /* uint8_t items */
7426 xcb_parts[4].iov_base = (char *) items;
7427 xcb_parts[4].iov_len = items_len * sizeof(uint8_t);
7428 xcb_parts[5].iov_base = 0;
7429 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
7431 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
7432 return xcb_ret;
7436 xcb_poly_text_16_sizeof (const void *_buffer /**< */,
7437 uint32_t items_len /**< */)
7439 char *xcb_tmp = (char *)_buffer;
7440 unsigned int xcb_buffer_len = 0;
7441 unsigned int xcb_block_len = 0;
7442 unsigned int xcb_pad = 0;
7443 unsigned int xcb_align_to = 0;
7446 xcb_block_len += sizeof(xcb_poly_text_16_request_t);
7447 xcb_tmp += xcb_block_len;
7448 xcb_buffer_len += xcb_block_len;
7449 xcb_block_len = 0;
7450 /* items */
7451 xcb_block_len += items_len * sizeof(uint8_t);
7452 xcb_tmp += xcb_block_len;
7453 xcb_align_to = ALIGNOF(uint8_t);
7454 /* insert padding */
7455 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
7456 xcb_buffer_len += xcb_block_len + xcb_pad;
7457 if (0 != xcb_pad) {
7458 xcb_tmp += xcb_pad;
7459 xcb_pad = 0;
7461 xcb_block_len = 0;
7463 return xcb_buffer_len;
7466 xcb_void_cookie_t
7467 xcb_poly_text_16_checked (xcb_connection_t *c /**< */,
7468 xcb_drawable_t drawable /**< */,
7469 xcb_gcontext_t gc /**< */,
7470 int16_t x /**< */,
7471 int16_t y /**< */,
7472 uint32_t items_len /**< */,
7473 const uint8_t *items /**< */)
7475 static const xcb_protocol_request_t xcb_req = {
7476 /* count */ 4,
7477 /* ext */ 0,
7478 /* opcode */ XCB_POLY_TEXT_16,
7479 /* isvoid */ 1
7482 struct iovec xcb_parts[6];
7483 xcb_void_cookie_t xcb_ret;
7484 xcb_poly_text_16_request_t xcb_out;
7486 xcb_out.pad0 = 0;
7487 xcb_out.drawable = drawable;
7488 xcb_out.gc = gc;
7489 xcb_out.x = x;
7490 xcb_out.y = y;
7492 xcb_parts[2].iov_base = (char *) &xcb_out;
7493 xcb_parts[2].iov_len = sizeof(xcb_out);
7494 xcb_parts[3].iov_base = 0;
7495 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
7496 /* uint8_t items */
7497 xcb_parts[4].iov_base = (char *) items;
7498 xcb_parts[4].iov_len = items_len * sizeof(uint8_t);
7499 xcb_parts[5].iov_base = 0;
7500 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
7502 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
7503 return xcb_ret;
7506 xcb_void_cookie_t
7507 xcb_poly_text_16 (xcb_connection_t *c /**< */,
7508 xcb_drawable_t drawable /**< */,
7509 xcb_gcontext_t gc /**< */,
7510 int16_t x /**< */,
7511 int16_t y /**< */,
7512 uint32_t items_len /**< */,
7513 const uint8_t *items /**< */)
7515 static const xcb_protocol_request_t xcb_req = {
7516 /* count */ 4,
7517 /* ext */ 0,
7518 /* opcode */ XCB_POLY_TEXT_16,
7519 /* isvoid */ 1
7522 struct iovec xcb_parts[6];
7523 xcb_void_cookie_t xcb_ret;
7524 xcb_poly_text_16_request_t xcb_out;
7526 xcb_out.pad0 = 0;
7527 xcb_out.drawable = drawable;
7528 xcb_out.gc = gc;
7529 xcb_out.x = x;
7530 xcb_out.y = y;
7532 xcb_parts[2].iov_base = (char *) &xcb_out;
7533 xcb_parts[2].iov_len = sizeof(xcb_out);
7534 xcb_parts[3].iov_base = 0;
7535 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
7536 /* uint8_t items */
7537 xcb_parts[4].iov_base = (char *) items;
7538 xcb_parts[4].iov_len = items_len * sizeof(uint8_t);
7539 xcb_parts[5].iov_base = 0;
7540 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
7542 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
7543 return xcb_ret;
7547 xcb_image_text_8_sizeof (const void *_buffer /**< */)
7549 char *xcb_tmp = (char *)_buffer;
7550 const xcb_image_text_8_request_t *_aux = (xcb_image_text_8_request_t *)_buffer;
7551 unsigned int xcb_buffer_len = 0;
7552 unsigned int xcb_block_len = 0;
7553 unsigned int xcb_pad = 0;
7554 unsigned int xcb_align_to = 0;
7557 xcb_block_len += sizeof(xcb_image_text_8_request_t);
7558 xcb_tmp += xcb_block_len;
7559 xcb_buffer_len += xcb_block_len;
7560 xcb_block_len = 0;
7561 /* string */
7562 xcb_block_len += _aux->string_len * sizeof(char);
7563 xcb_tmp += xcb_block_len;
7564 xcb_align_to = ALIGNOF(char);
7565 /* insert padding */
7566 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
7567 xcb_buffer_len += xcb_block_len + xcb_pad;
7568 if (0 != xcb_pad) {
7569 xcb_tmp += xcb_pad;
7570 xcb_pad = 0;
7572 xcb_block_len = 0;
7574 return xcb_buffer_len;
7577 xcb_void_cookie_t
7578 xcb_image_text_8_checked (xcb_connection_t *c /**< */,
7579 uint8_t string_len /**< */,
7580 xcb_drawable_t drawable /**< */,
7581 xcb_gcontext_t gc /**< */,
7582 int16_t x /**< */,
7583 int16_t y /**< */,
7584 const char *string /**< */)
7586 static const xcb_protocol_request_t xcb_req = {
7587 /* count */ 4,
7588 /* ext */ 0,
7589 /* opcode */ XCB_IMAGE_TEXT_8,
7590 /* isvoid */ 1
7593 struct iovec xcb_parts[6];
7594 xcb_void_cookie_t xcb_ret;
7595 xcb_image_text_8_request_t xcb_out;
7597 xcb_out.string_len = string_len;
7598 xcb_out.drawable = drawable;
7599 xcb_out.gc = gc;
7600 xcb_out.x = x;
7601 xcb_out.y = y;
7603 xcb_parts[2].iov_base = (char *) &xcb_out;
7604 xcb_parts[2].iov_len = sizeof(xcb_out);
7605 xcb_parts[3].iov_base = 0;
7606 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
7607 /* char string */
7608 xcb_parts[4].iov_base = (char *) string;
7609 xcb_parts[4].iov_len = string_len * sizeof(char);
7610 xcb_parts[5].iov_base = 0;
7611 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
7613 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
7614 return xcb_ret;
7617 xcb_void_cookie_t
7618 xcb_image_text_8 (xcb_connection_t *c /**< */,
7619 uint8_t string_len /**< */,
7620 xcb_drawable_t drawable /**< */,
7621 xcb_gcontext_t gc /**< */,
7622 int16_t x /**< */,
7623 int16_t y /**< */,
7624 const char *string /**< */)
7626 static const xcb_protocol_request_t xcb_req = {
7627 /* count */ 4,
7628 /* ext */ 0,
7629 /* opcode */ XCB_IMAGE_TEXT_8,
7630 /* isvoid */ 1
7633 struct iovec xcb_parts[6];
7634 xcb_void_cookie_t xcb_ret;
7635 xcb_image_text_8_request_t xcb_out;
7637 xcb_out.string_len = string_len;
7638 xcb_out.drawable = drawable;
7639 xcb_out.gc = gc;
7640 xcb_out.x = x;
7641 xcb_out.y = y;
7643 xcb_parts[2].iov_base = (char *) &xcb_out;
7644 xcb_parts[2].iov_len = sizeof(xcb_out);
7645 xcb_parts[3].iov_base = 0;
7646 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
7647 /* char string */
7648 xcb_parts[4].iov_base = (char *) string;
7649 xcb_parts[4].iov_len = string_len * sizeof(char);
7650 xcb_parts[5].iov_base = 0;
7651 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
7653 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
7654 return xcb_ret;
7658 xcb_image_text_16_sizeof (const void *_buffer /**< */)
7660 char *xcb_tmp = (char *)_buffer;
7661 const xcb_image_text_16_request_t *_aux = (xcb_image_text_16_request_t *)_buffer;
7662 unsigned int xcb_buffer_len = 0;
7663 unsigned int xcb_block_len = 0;
7664 unsigned int xcb_pad = 0;
7665 unsigned int xcb_align_to = 0;
7668 xcb_block_len += sizeof(xcb_image_text_16_request_t);
7669 xcb_tmp += xcb_block_len;
7670 xcb_buffer_len += xcb_block_len;
7671 xcb_block_len = 0;
7672 /* string */
7673 xcb_block_len += _aux->string_len * sizeof(xcb_char2b_t);
7674 xcb_tmp += xcb_block_len;
7675 xcb_align_to = ALIGNOF(xcb_char2b_t);
7676 /* insert padding */
7677 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
7678 xcb_buffer_len += xcb_block_len + xcb_pad;
7679 if (0 != xcb_pad) {
7680 xcb_tmp += xcb_pad;
7681 xcb_pad = 0;
7683 xcb_block_len = 0;
7685 return xcb_buffer_len;
7688 xcb_void_cookie_t
7689 xcb_image_text_16_checked (xcb_connection_t *c /**< */,
7690 uint8_t string_len /**< */,
7691 xcb_drawable_t drawable /**< */,
7692 xcb_gcontext_t gc /**< */,
7693 int16_t x /**< */,
7694 int16_t y /**< */,
7695 const xcb_char2b_t *string /**< */)
7697 static const xcb_protocol_request_t xcb_req = {
7698 /* count */ 4,
7699 /* ext */ 0,
7700 /* opcode */ XCB_IMAGE_TEXT_16,
7701 /* isvoid */ 1
7704 struct iovec xcb_parts[6];
7705 xcb_void_cookie_t xcb_ret;
7706 xcb_image_text_16_request_t xcb_out;
7708 xcb_out.string_len = string_len;
7709 xcb_out.drawable = drawable;
7710 xcb_out.gc = gc;
7711 xcb_out.x = x;
7712 xcb_out.y = y;
7714 xcb_parts[2].iov_base = (char *) &xcb_out;
7715 xcb_parts[2].iov_len = sizeof(xcb_out);
7716 xcb_parts[3].iov_base = 0;
7717 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
7718 /* xcb_char2b_t string */
7719 xcb_parts[4].iov_base = (char *) string;
7720 xcb_parts[4].iov_len = string_len * sizeof(xcb_char2b_t);
7721 xcb_parts[5].iov_base = 0;
7722 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
7724 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
7725 return xcb_ret;
7728 xcb_void_cookie_t
7729 xcb_image_text_16 (xcb_connection_t *c /**< */,
7730 uint8_t string_len /**< */,
7731 xcb_drawable_t drawable /**< */,
7732 xcb_gcontext_t gc /**< */,
7733 int16_t x /**< */,
7734 int16_t y /**< */,
7735 const xcb_char2b_t *string /**< */)
7737 static const xcb_protocol_request_t xcb_req = {
7738 /* count */ 4,
7739 /* ext */ 0,
7740 /* opcode */ XCB_IMAGE_TEXT_16,
7741 /* isvoid */ 1
7744 struct iovec xcb_parts[6];
7745 xcb_void_cookie_t xcb_ret;
7746 xcb_image_text_16_request_t xcb_out;
7748 xcb_out.string_len = string_len;
7749 xcb_out.drawable = drawable;
7750 xcb_out.gc = gc;
7751 xcb_out.x = x;
7752 xcb_out.y = y;
7754 xcb_parts[2].iov_base = (char *) &xcb_out;
7755 xcb_parts[2].iov_len = sizeof(xcb_out);
7756 xcb_parts[3].iov_base = 0;
7757 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
7758 /* xcb_char2b_t string */
7759 xcb_parts[4].iov_base = (char *) string;
7760 xcb_parts[4].iov_len = string_len * sizeof(xcb_char2b_t);
7761 xcb_parts[5].iov_base = 0;
7762 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
7764 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
7765 return xcb_ret;
7768 xcb_void_cookie_t
7769 xcb_create_colormap_checked (xcb_connection_t *c /**< */,
7770 uint8_t alloc /**< */,
7771 xcb_colormap_t mid /**< */,
7772 xcb_window_t window /**< */,
7773 xcb_visualid_t visual /**< */)
7775 static const xcb_protocol_request_t xcb_req = {
7776 /* count */ 2,
7777 /* ext */ 0,
7778 /* opcode */ XCB_CREATE_COLORMAP,
7779 /* isvoid */ 1
7782 struct iovec xcb_parts[4];
7783 xcb_void_cookie_t xcb_ret;
7784 xcb_create_colormap_request_t xcb_out;
7786 xcb_out.alloc = alloc;
7787 xcb_out.mid = mid;
7788 xcb_out.window = window;
7789 xcb_out.visual = visual;
7791 xcb_parts[2].iov_base = (char *) &xcb_out;
7792 xcb_parts[2].iov_len = sizeof(xcb_out);
7793 xcb_parts[3].iov_base = 0;
7794 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
7796 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
7797 return xcb_ret;
7800 xcb_void_cookie_t
7801 xcb_create_colormap (xcb_connection_t *c /**< */,
7802 uint8_t alloc /**< */,
7803 xcb_colormap_t mid /**< */,
7804 xcb_window_t window /**< */,
7805 xcb_visualid_t visual /**< */)
7807 static const xcb_protocol_request_t xcb_req = {
7808 /* count */ 2,
7809 /* ext */ 0,
7810 /* opcode */ XCB_CREATE_COLORMAP,
7811 /* isvoid */ 1
7814 struct iovec xcb_parts[4];
7815 xcb_void_cookie_t xcb_ret;
7816 xcb_create_colormap_request_t xcb_out;
7818 xcb_out.alloc = alloc;
7819 xcb_out.mid = mid;
7820 xcb_out.window = window;
7821 xcb_out.visual = visual;
7823 xcb_parts[2].iov_base = (char *) &xcb_out;
7824 xcb_parts[2].iov_len = sizeof(xcb_out);
7825 xcb_parts[3].iov_base = 0;
7826 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
7828 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
7829 return xcb_ret;
7832 xcb_void_cookie_t
7833 xcb_free_colormap_checked (xcb_connection_t *c /**< */,
7834 xcb_colormap_t cmap /**< */)
7836 static const xcb_protocol_request_t xcb_req = {
7837 /* count */ 2,
7838 /* ext */ 0,
7839 /* opcode */ XCB_FREE_COLORMAP,
7840 /* isvoid */ 1
7843 struct iovec xcb_parts[4];
7844 xcb_void_cookie_t xcb_ret;
7845 xcb_free_colormap_request_t xcb_out;
7847 xcb_out.pad0 = 0;
7848 xcb_out.cmap = cmap;
7850 xcb_parts[2].iov_base = (char *) &xcb_out;
7851 xcb_parts[2].iov_len = sizeof(xcb_out);
7852 xcb_parts[3].iov_base = 0;
7853 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
7855 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
7856 return xcb_ret;
7859 xcb_void_cookie_t
7860 xcb_free_colormap (xcb_connection_t *c /**< */,
7861 xcb_colormap_t cmap /**< */)
7863 static const xcb_protocol_request_t xcb_req = {
7864 /* count */ 2,
7865 /* ext */ 0,
7866 /* opcode */ XCB_FREE_COLORMAP,
7867 /* isvoid */ 1
7870 struct iovec xcb_parts[4];
7871 xcb_void_cookie_t xcb_ret;
7872 xcb_free_colormap_request_t xcb_out;
7874 xcb_out.pad0 = 0;
7875 xcb_out.cmap = cmap;
7877 xcb_parts[2].iov_base = (char *) &xcb_out;
7878 xcb_parts[2].iov_len = sizeof(xcb_out);
7879 xcb_parts[3].iov_base = 0;
7880 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
7882 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
7883 return xcb_ret;
7886 xcb_void_cookie_t
7887 xcb_copy_colormap_and_free_checked (xcb_connection_t *c /**< */,
7888 xcb_colormap_t mid /**< */,
7889 xcb_colormap_t src_cmap /**< */)
7891 static const xcb_protocol_request_t xcb_req = {
7892 /* count */ 2,
7893 /* ext */ 0,
7894 /* opcode */ XCB_COPY_COLORMAP_AND_FREE,
7895 /* isvoid */ 1
7898 struct iovec xcb_parts[4];
7899 xcb_void_cookie_t xcb_ret;
7900 xcb_copy_colormap_and_free_request_t xcb_out;
7902 xcb_out.pad0 = 0;
7903 xcb_out.mid = mid;
7904 xcb_out.src_cmap = src_cmap;
7906 xcb_parts[2].iov_base = (char *) &xcb_out;
7907 xcb_parts[2].iov_len = sizeof(xcb_out);
7908 xcb_parts[3].iov_base = 0;
7909 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
7911 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
7912 return xcb_ret;
7915 xcb_void_cookie_t
7916 xcb_copy_colormap_and_free (xcb_connection_t *c /**< */,
7917 xcb_colormap_t mid /**< */,
7918 xcb_colormap_t src_cmap /**< */)
7920 static const xcb_protocol_request_t xcb_req = {
7921 /* count */ 2,
7922 /* ext */ 0,
7923 /* opcode */ XCB_COPY_COLORMAP_AND_FREE,
7924 /* isvoid */ 1
7927 struct iovec xcb_parts[4];
7928 xcb_void_cookie_t xcb_ret;
7929 xcb_copy_colormap_and_free_request_t xcb_out;
7931 xcb_out.pad0 = 0;
7932 xcb_out.mid = mid;
7933 xcb_out.src_cmap = src_cmap;
7935 xcb_parts[2].iov_base = (char *) &xcb_out;
7936 xcb_parts[2].iov_len = sizeof(xcb_out);
7937 xcb_parts[3].iov_base = 0;
7938 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
7940 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
7941 return xcb_ret;
7944 xcb_void_cookie_t
7945 xcb_install_colormap_checked (xcb_connection_t *c /**< */,
7946 xcb_colormap_t cmap /**< */)
7948 static const xcb_protocol_request_t xcb_req = {
7949 /* count */ 2,
7950 /* ext */ 0,
7951 /* opcode */ XCB_INSTALL_COLORMAP,
7952 /* isvoid */ 1
7955 struct iovec xcb_parts[4];
7956 xcb_void_cookie_t xcb_ret;
7957 xcb_install_colormap_request_t xcb_out;
7959 xcb_out.pad0 = 0;
7960 xcb_out.cmap = cmap;
7962 xcb_parts[2].iov_base = (char *) &xcb_out;
7963 xcb_parts[2].iov_len = sizeof(xcb_out);
7964 xcb_parts[3].iov_base = 0;
7965 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
7967 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
7968 return xcb_ret;
7971 xcb_void_cookie_t
7972 xcb_install_colormap (xcb_connection_t *c /**< */,
7973 xcb_colormap_t cmap /**< */)
7975 static const xcb_protocol_request_t xcb_req = {
7976 /* count */ 2,
7977 /* ext */ 0,
7978 /* opcode */ XCB_INSTALL_COLORMAP,
7979 /* isvoid */ 1
7982 struct iovec xcb_parts[4];
7983 xcb_void_cookie_t xcb_ret;
7984 xcb_install_colormap_request_t xcb_out;
7986 xcb_out.pad0 = 0;
7987 xcb_out.cmap = cmap;
7989 xcb_parts[2].iov_base = (char *) &xcb_out;
7990 xcb_parts[2].iov_len = sizeof(xcb_out);
7991 xcb_parts[3].iov_base = 0;
7992 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
7994 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
7995 return xcb_ret;
7998 xcb_void_cookie_t
7999 xcb_uninstall_colormap_checked (xcb_connection_t *c /**< */,
8000 xcb_colormap_t cmap /**< */)
8002 static const xcb_protocol_request_t xcb_req = {
8003 /* count */ 2,
8004 /* ext */ 0,
8005 /* opcode */ XCB_UNINSTALL_COLORMAP,
8006 /* isvoid */ 1
8009 struct iovec xcb_parts[4];
8010 xcb_void_cookie_t xcb_ret;
8011 xcb_uninstall_colormap_request_t xcb_out;
8013 xcb_out.pad0 = 0;
8014 xcb_out.cmap = cmap;
8016 xcb_parts[2].iov_base = (char *) &xcb_out;
8017 xcb_parts[2].iov_len = sizeof(xcb_out);
8018 xcb_parts[3].iov_base = 0;
8019 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
8021 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
8022 return xcb_ret;
8025 xcb_void_cookie_t
8026 xcb_uninstall_colormap (xcb_connection_t *c /**< */,
8027 xcb_colormap_t cmap /**< */)
8029 static const xcb_protocol_request_t xcb_req = {
8030 /* count */ 2,
8031 /* ext */ 0,
8032 /* opcode */ XCB_UNINSTALL_COLORMAP,
8033 /* isvoid */ 1
8036 struct iovec xcb_parts[4];
8037 xcb_void_cookie_t xcb_ret;
8038 xcb_uninstall_colormap_request_t xcb_out;
8040 xcb_out.pad0 = 0;
8041 xcb_out.cmap = cmap;
8043 xcb_parts[2].iov_base = (char *) &xcb_out;
8044 xcb_parts[2].iov_len = sizeof(xcb_out);
8045 xcb_parts[3].iov_base = 0;
8046 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
8048 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
8049 return xcb_ret;
8053 xcb_list_installed_colormaps_sizeof (const void *_buffer /**< */)
8055 char *xcb_tmp = (char *)_buffer;
8056 const xcb_list_installed_colormaps_reply_t *_aux = (xcb_list_installed_colormaps_reply_t *)_buffer;
8057 unsigned int xcb_buffer_len = 0;
8058 unsigned int xcb_block_len = 0;
8059 unsigned int xcb_pad = 0;
8060 unsigned int xcb_align_to = 0;
8063 xcb_block_len += sizeof(xcb_list_installed_colormaps_reply_t);
8064 xcb_tmp += xcb_block_len;
8065 xcb_buffer_len += xcb_block_len;
8066 xcb_block_len = 0;
8067 /* cmaps */
8068 xcb_block_len += _aux->cmaps_len * sizeof(xcb_colormap_t);
8069 xcb_tmp += xcb_block_len;
8070 xcb_align_to = ALIGNOF(xcb_colormap_t);
8071 /* insert padding */
8072 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8073 xcb_buffer_len += xcb_block_len + xcb_pad;
8074 if (0 != xcb_pad) {
8075 xcb_tmp += xcb_pad;
8076 xcb_pad = 0;
8078 xcb_block_len = 0;
8080 return xcb_buffer_len;
8083 xcb_list_installed_colormaps_cookie_t
8084 xcb_list_installed_colormaps (xcb_connection_t *c /**< */,
8085 xcb_window_t window /**< */)
8087 static const xcb_protocol_request_t xcb_req = {
8088 /* count */ 2,
8089 /* ext */ 0,
8090 /* opcode */ XCB_LIST_INSTALLED_COLORMAPS,
8091 /* isvoid */ 0
8094 struct iovec xcb_parts[4];
8095 xcb_list_installed_colormaps_cookie_t xcb_ret;
8096 xcb_list_installed_colormaps_request_t xcb_out;
8098 xcb_out.pad0 = 0;
8099 xcb_out.window = window;
8101 xcb_parts[2].iov_base = (char *) &xcb_out;
8102 xcb_parts[2].iov_len = sizeof(xcb_out);
8103 xcb_parts[3].iov_base = 0;
8104 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
8106 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
8107 return xcb_ret;
8110 xcb_list_installed_colormaps_cookie_t
8111 xcb_list_installed_colormaps_unchecked (xcb_connection_t *c /**< */,
8112 xcb_window_t window /**< */)
8114 static const xcb_protocol_request_t xcb_req = {
8115 /* count */ 2,
8116 /* ext */ 0,
8117 /* opcode */ XCB_LIST_INSTALLED_COLORMAPS,
8118 /* isvoid */ 0
8121 struct iovec xcb_parts[4];
8122 xcb_list_installed_colormaps_cookie_t xcb_ret;
8123 xcb_list_installed_colormaps_request_t xcb_out;
8125 xcb_out.pad0 = 0;
8126 xcb_out.window = window;
8128 xcb_parts[2].iov_base = (char *) &xcb_out;
8129 xcb_parts[2].iov_len = sizeof(xcb_out);
8130 xcb_parts[3].iov_base = 0;
8131 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
8133 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
8134 return xcb_ret;
8137 xcb_colormap_t *
8138 xcb_list_installed_colormaps_cmaps (const xcb_list_installed_colormaps_reply_t *R /**< */)
8140 return (xcb_colormap_t *) (R + 1);
8144 xcb_list_installed_colormaps_cmaps_length (const xcb_list_installed_colormaps_reply_t *R /**< */)
8146 return R->cmaps_len;
8149 xcb_generic_iterator_t
8150 xcb_list_installed_colormaps_cmaps_end (const xcb_list_installed_colormaps_reply_t *R /**< */)
8152 xcb_generic_iterator_t i;
8153 i.data = ((xcb_colormap_t *) (R + 1)) + (R->cmaps_len);
8154 i.rem = 0;
8155 i.index = (char *) i.data - (char *) R;
8156 return i;
8159 xcb_list_installed_colormaps_reply_t *
8160 xcb_list_installed_colormaps_reply (xcb_connection_t *c /**< */,
8161 xcb_list_installed_colormaps_cookie_t cookie /**< */,
8162 xcb_generic_error_t **e /**< */)
8164 return (xcb_list_installed_colormaps_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
8167 xcb_alloc_color_cookie_t
8168 xcb_alloc_color (xcb_connection_t *c /**< */,
8169 xcb_colormap_t cmap /**< */,
8170 uint16_t red /**< */,
8171 uint16_t green /**< */,
8172 uint16_t blue /**< */)
8174 static const xcb_protocol_request_t xcb_req = {
8175 /* count */ 2,
8176 /* ext */ 0,
8177 /* opcode */ XCB_ALLOC_COLOR,
8178 /* isvoid */ 0
8181 struct iovec xcb_parts[4];
8182 xcb_alloc_color_cookie_t xcb_ret;
8183 xcb_alloc_color_request_t xcb_out;
8185 xcb_out.pad0 = 0;
8186 xcb_out.cmap = cmap;
8187 xcb_out.red = red;
8188 xcb_out.green = green;
8189 xcb_out.blue = blue;
8190 memset(xcb_out.pad1, 0, 2);
8192 xcb_parts[2].iov_base = (char *) &xcb_out;
8193 xcb_parts[2].iov_len = sizeof(xcb_out);
8194 xcb_parts[3].iov_base = 0;
8195 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
8197 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
8198 return xcb_ret;
8201 xcb_alloc_color_cookie_t
8202 xcb_alloc_color_unchecked (xcb_connection_t *c /**< */,
8203 xcb_colormap_t cmap /**< */,
8204 uint16_t red /**< */,
8205 uint16_t green /**< */,
8206 uint16_t blue /**< */)
8208 static const xcb_protocol_request_t xcb_req = {
8209 /* count */ 2,
8210 /* ext */ 0,
8211 /* opcode */ XCB_ALLOC_COLOR,
8212 /* isvoid */ 0
8215 struct iovec xcb_parts[4];
8216 xcb_alloc_color_cookie_t xcb_ret;
8217 xcb_alloc_color_request_t xcb_out;
8219 xcb_out.pad0 = 0;
8220 xcb_out.cmap = cmap;
8221 xcb_out.red = red;
8222 xcb_out.green = green;
8223 xcb_out.blue = blue;
8224 memset(xcb_out.pad1, 0, 2);
8226 xcb_parts[2].iov_base = (char *) &xcb_out;
8227 xcb_parts[2].iov_len = sizeof(xcb_out);
8228 xcb_parts[3].iov_base = 0;
8229 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
8231 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
8232 return xcb_ret;
8235 xcb_alloc_color_reply_t *
8236 xcb_alloc_color_reply (xcb_connection_t *c /**< */,
8237 xcb_alloc_color_cookie_t cookie /**< */,
8238 xcb_generic_error_t **e /**< */)
8240 return (xcb_alloc_color_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
8244 xcb_alloc_named_color_sizeof (const void *_buffer /**< */)
8246 char *xcb_tmp = (char *)_buffer;
8247 const xcb_alloc_named_color_request_t *_aux = (xcb_alloc_named_color_request_t *)_buffer;
8248 unsigned int xcb_buffer_len = 0;
8249 unsigned int xcb_block_len = 0;
8250 unsigned int xcb_pad = 0;
8251 unsigned int xcb_align_to = 0;
8254 xcb_block_len += sizeof(xcb_alloc_named_color_request_t);
8255 xcb_tmp += xcb_block_len;
8256 xcb_buffer_len += xcb_block_len;
8257 xcb_block_len = 0;
8258 /* name */
8259 xcb_block_len += _aux->name_len * sizeof(char);
8260 xcb_tmp += xcb_block_len;
8261 xcb_align_to = ALIGNOF(char);
8262 /* insert padding */
8263 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8264 xcb_buffer_len += xcb_block_len + xcb_pad;
8265 if (0 != xcb_pad) {
8266 xcb_tmp += xcb_pad;
8267 xcb_pad = 0;
8269 xcb_block_len = 0;
8271 return xcb_buffer_len;
8274 xcb_alloc_named_color_cookie_t
8275 xcb_alloc_named_color (xcb_connection_t *c /**< */,
8276 xcb_colormap_t cmap /**< */,
8277 uint16_t name_len /**< */,
8278 const char *name /**< */)
8280 static const xcb_protocol_request_t xcb_req = {
8281 /* count */ 4,
8282 /* ext */ 0,
8283 /* opcode */ XCB_ALLOC_NAMED_COLOR,
8284 /* isvoid */ 0
8287 struct iovec xcb_parts[6];
8288 xcb_alloc_named_color_cookie_t xcb_ret;
8289 xcb_alloc_named_color_request_t xcb_out;
8291 xcb_out.pad0 = 0;
8292 xcb_out.cmap = cmap;
8293 xcb_out.name_len = name_len;
8294 memset(xcb_out.pad1, 0, 2);
8296 xcb_parts[2].iov_base = (char *) &xcb_out;
8297 xcb_parts[2].iov_len = sizeof(xcb_out);
8298 xcb_parts[3].iov_base = 0;
8299 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
8300 /* char name */
8301 xcb_parts[4].iov_base = (char *) name;
8302 xcb_parts[4].iov_len = name_len * sizeof(char);
8303 xcb_parts[5].iov_base = 0;
8304 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
8306 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
8307 return xcb_ret;
8310 xcb_alloc_named_color_cookie_t
8311 xcb_alloc_named_color_unchecked (xcb_connection_t *c /**< */,
8312 xcb_colormap_t cmap /**< */,
8313 uint16_t name_len /**< */,
8314 const char *name /**< */)
8316 static const xcb_protocol_request_t xcb_req = {
8317 /* count */ 4,
8318 /* ext */ 0,
8319 /* opcode */ XCB_ALLOC_NAMED_COLOR,
8320 /* isvoid */ 0
8323 struct iovec xcb_parts[6];
8324 xcb_alloc_named_color_cookie_t xcb_ret;
8325 xcb_alloc_named_color_request_t xcb_out;
8327 xcb_out.pad0 = 0;
8328 xcb_out.cmap = cmap;
8329 xcb_out.name_len = name_len;
8330 memset(xcb_out.pad1, 0, 2);
8332 xcb_parts[2].iov_base = (char *) &xcb_out;
8333 xcb_parts[2].iov_len = sizeof(xcb_out);
8334 xcb_parts[3].iov_base = 0;
8335 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
8336 /* char name */
8337 xcb_parts[4].iov_base = (char *) name;
8338 xcb_parts[4].iov_len = name_len * sizeof(char);
8339 xcb_parts[5].iov_base = 0;
8340 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
8342 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
8343 return xcb_ret;
8346 xcb_alloc_named_color_reply_t *
8347 xcb_alloc_named_color_reply (xcb_connection_t *c /**< */,
8348 xcb_alloc_named_color_cookie_t cookie /**< */,
8349 xcb_generic_error_t **e /**< */)
8351 return (xcb_alloc_named_color_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
8355 xcb_alloc_color_cells_sizeof (const void *_buffer /**< */)
8357 char *xcb_tmp = (char *)_buffer;
8358 const xcb_alloc_color_cells_reply_t *_aux = (xcb_alloc_color_cells_reply_t *)_buffer;
8359 unsigned int xcb_buffer_len = 0;
8360 unsigned int xcb_block_len = 0;
8361 unsigned int xcb_pad = 0;
8362 unsigned int xcb_align_to = 0;
8365 xcb_block_len += sizeof(xcb_alloc_color_cells_reply_t);
8366 xcb_tmp += xcb_block_len;
8367 xcb_buffer_len += xcb_block_len;
8368 xcb_block_len = 0;
8369 /* pixels */
8370 xcb_block_len += _aux->pixels_len * sizeof(uint32_t);
8371 xcb_tmp += xcb_block_len;
8372 xcb_align_to = ALIGNOF(uint32_t);
8373 /* insert padding */
8374 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8375 xcb_buffer_len += xcb_block_len + xcb_pad;
8376 if (0 != xcb_pad) {
8377 xcb_tmp += xcb_pad;
8378 xcb_pad = 0;
8380 xcb_block_len = 0;
8381 /* masks */
8382 xcb_block_len += _aux->masks_len * sizeof(uint32_t);
8383 xcb_tmp += xcb_block_len;
8384 xcb_align_to = ALIGNOF(uint32_t);
8385 /* insert padding */
8386 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8387 xcb_buffer_len += xcb_block_len + xcb_pad;
8388 if (0 != xcb_pad) {
8389 xcb_tmp += xcb_pad;
8390 xcb_pad = 0;
8392 xcb_block_len = 0;
8394 return xcb_buffer_len;
8397 xcb_alloc_color_cells_cookie_t
8398 xcb_alloc_color_cells (xcb_connection_t *c /**< */,
8399 uint8_t contiguous /**< */,
8400 xcb_colormap_t cmap /**< */,
8401 uint16_t colors /**< */,
8402 uint16_t planes /**< */)
8404 static const xcb_protocol_request_t xcb_req = {
8405 /* count */ 2,
8406 /* ext */ 0,
8407 /* opcode */ XCB_ALLOC_COLOR_CELLS,
8408 /* isvoid */ 0
8411 struct iovec xcb_parts[4];
8412 xcb_alloc_color_cells_cookie_t xcb_ret;
8413 xcb_alloc_color_cells_request_t xcb_out;
8415 xcb_out.contiguous = contiguous;
8416 xcb_out.cmap = cmap;
8417 xcb_out.colors = colors;
8418 xcb_out.planes = planes;
8420 xcb_parts[2].iov_base = (char *) &xcb_out;
8421 xcb_parts[2].iov_len = sizeof(xcb_out);
8422 xcb_parts[3].iov_base = 0;
8423 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
8425 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
8426 return xcb_ret;
8429 xcb_alloc_color_cells_cookie_t
8430 xcb_alloc_color_cells_unchecked (xcb_connection_t *c /**< */,
8431 uint8_t contiguous /**< */,
8432 xcb_colormap_t cmap /**< */,
8433 uint16_t colors /**< */,
8434 uint16_t planes /**< */)
8436 static const xcb_protocol_request_t xcb_req = {
8437 /* count */ 2,
8438 /* ext */ 0,
8439 /* opcode */ XCB_ALLOC_COLOR_CELLS,
8440 /* isvoid */ 0
8443 struct iovec xcb_parts[4];
8444 xcb_alloc_color_cells_cookie_t xcb_ret;
8445 xcb_alloc_color_cells_request_t xcb_out;
8447 xcb_out.contiguous = contiguous;
8448 xcb_out.cmap = cmap;
8449 xcb_out.colors = colors;
8450 xcb_out.planes = planes;
8452 xcb_parts[2].iov_base = (char *) &xcb_out;
8453 xcb_parts[2].iov_len = sizeof(xcb_out);
8454 xcb_parts[3].iov_base = 0;
8455 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
8457 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
8458 return xcb_ret;
8461 uint32_t *
8462 xcb_alloc_color_cells_pixels (const xcb_alloc_color_cells_reply_t *R /**< */)
8464 return (uint32_t *) (R + 1);
8468 xcb_alloc_color_cells_pixels_length (const xcb_alloc_color_cells_reply_t *R /**< */)
8470 return R->pixels_len;
8473 xcb_generic_iterator_t
8474 xcb_alloc_color_cells_pixels_end (const xcb_alloc_color_cells_reply_t *R /**< */)
8476 xcb_generic_iterator_t i;
8477 i.data = ((uint32_t *) (R + 1)) + (R->pixels_len);
8478 i.rem = 0;
8479 i.index = (char *) i.data - (char *) R;
8480 return i;
8483 uint32_t *
8484 xcb_alloc_color_cells_masks (const xcb_alloc_color_cells_reply_t *R /**< */)
8486 xcb_generic_iterator_t prev = xcb_alloc_color_cells_pixels_end(R);
8487 return (uint32_t *) ((char *) prev.data + XCB_TYPE_PAD(uint32_t, prev.index) + 0);
8491 xcb_alloc_color_cells_masks_length (const xcb_alloc_color_cells_reply_t *R /**< */)
8493 return R->masks_len;
8496 xcb_generic_iterator_t
8497 xcb_alloc_color_cells_masks_end (const xcb_alloc_color_cells_reply_t *R /**< */)
8499 xcb_generic_iterator_t i;
8500 xcb_generic_iterator_t child = xcb_alloc_color_cells_pixels_end(R);
8501 i.data = ((uint32_t *) child.data) + (R->masks_len);
8502 i.rem = 0;
8503 i.index = (char *) i.data - (char *) R;
8504 return i;
8507 xcb_alloc_color_cells_reply_t *
8508 xcb_alloc_color_cells_reply (xcb_connection_t *c /**< */,
8509 xcb_alloc_color_cells_cookie_t cookie /**< */,
8510 xcb_generic_error_t **e /**< */)
8512 return (xcb_alloc_color_cells_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
8516 xcb_alloc_color_planes_sizeof (const void *_buffer /**< */)
8518 char *xcb_tmp = (char *)_buffer;
8519 const xcb_alloc_color_planes_reply_t *_aux = (xcb_alloc_color_planes_reply_t *)_buffer;
8520 unsigned int xcb_buffer_len = 0;
8521 unsigned int xcb_block_len = 0;
8522 unsigned int xcb_pad = 0;
8523 unsigned int xcb_align_to = 0;
8526 xcb_block_len += sizeof(xcb_alloc_color_planes_reply_t);
8527 xcb_tmp += xcb_block_len;
8528 xcb_buffer_len += xcb_block_len;
8529 xcb_block_len = 0;
8530 /* pixels */
8531 xcb_block_len += _aux->pixels_len * sizeof(uint32_t);
8532 xcb_tmp += xcb_block_len;
8533 xcb_align_to = ALIGNOF(uint32_t);
8534 /* insert padding */
8535 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8536 xcb_buffer_len += xcb_block_len + xcb_pad;
8537 if (0 != xcb_pad) {
8538 xcb_tmp += xcb_pad;
8539 xcb_pad = 0;
8541 xcb_block_len = 0;
8543 return xcb_buffer_len;
8546 xcb_alloc_color_planes_cookie_t
8547 xcb_alloc_color_planes (xcb_connection_t *c /**< */,
8548 uint8_t contiguous /**< */,
8549 xcb_colormap_t cmap /**< */,
8550 uint16_t colors /**< */,
8551 uint16_t reds /**< */,
8552 uint16_t greens /**< */,
8553 uint16_t blues /**< */)
8555 static const xcb_protocol_request_t xcb_req = {
8556 /* count */ 2,
8557 /* ext */ 0,
8558 /* opcode */ XCB_ALLOC_COLOR_PLANES,
8559 /* isvoid */ 0
8562 struct iovec xcb_parts[4];
8563 xcb_alloc_color_planes_cookie_t xcb_ret;
8564 xcb_alloc_color_planes_request_t xcb_out;
8566 xcb_out.contiguous = contiguous;
8567 xcb_out.cmap = cmap;
8568 xcb_out.colors = colors;
8569 xcb_out.reds = reds;
8570 xcb_out.greens = greens;
8571 xcb_out.blues = blues;
8573 xcb_parts[2].iov_base = (char *) &xcb_out;
8574 xcb_parts[2].iov_len = sizeof(xcb_out);
8575 xcb_parts[3].iov_base = 0;
8576 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
8578 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
8579 return xcb_ret;
8582 xcb_alloc_color_planes_cookie_t
8583 xcb_alloc_color_planes_unchecked (xcb_connection_t *c /**< */,
8584 uint8_t contiguous /**< */,
8585 xcb_colormap_t cmap /**< */,
8586 uint16_t colors /**< */,
8587 uint16_t reds /**< */,
8588 uint16_t greens /**< */,
8589 uint16_t blues /**< */)
8591 static const xcb_protocol_request_t xcb_req = {
8592 /* count */ 2,
8593 /* ext */ 0,
8594 /* opcode */ XCB_ALLOC_COLOR_PLANES,
8595 /* isvoid */ 0
8598 struct iovec xcb_parts[4];
8599 xcb_alloc_color_planes_cookie_t xcb_ret;
8600 xcb_alloc_color_planes_request_t xcb_out;
8602 xcb_out.contiguous = contiguous;
8603 xcb_out.cmap = cmap;
8604 xcb_out.colors = colors;
8605 xcb_out.reds = reds;
8606 xcb_out.greens = greens;
8607 xcb_out.blues = blues;
8609 xcb_parts[2].iov_base = (char *) &xcb_out;
8610 xcb_parts[2].iov_len = sizeof(xcb_out);
8611 xcb_parts[3].iov_base = 0;
8612 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
8614 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
8615 return xcb_ret;
8618 uint32_t *
8619 xcb_alloc_color_planes_pixels (const xcb_alloc_color_planes_reply_t *R /**< */)
8621 return (uint32_t *) (R + 1);
8625 xcb_alloc_color_planes_pixels_length (const xcb_alloc_color_planes_reply_t *R /**< */)
8627 return R->pixels_len;
8630 xcb_generic_iterator_t
8631 xcb_alloc_color_planes_pixels_end (const xcb_alloc_color_planes_reply_t *R /**< */)
8633 xcb_generic_iterator_t i;
8634 i.data = ((uint32_t *) (R + 1)) + (R->pixels_len);
8635 i.rem = 0;
8636 i.index = (char *) i.data - (char *) R;
8637 return i;
8640 xcb_alloc_color_planes_reply_t *
8641 xcb_alloc_color_planes_reply (xcb_connection_t *c /**< */,
8642 xcb_alloc_color_planes_cookie_t cookie /**< */,
8643 xcb_generic_error_t **e /**< */)
8645 return (xcb_alloc_color_planes_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
8649 xcb_free_colors_sizeof (const void *_buffer /**< */,
8650 uint32_t pixels_len /**< */)
8652 char *xcb_tmp = (char *)_buffer;
8653 unsigned int xcb_buffer_len = 0;
8654 unsigned int xcb_block_len = 0;
8655 unsigned int xcb_pad = 0;
8656 unsigned int xcb_align_to = 0;
8659 xcb_block_len += sizeof(xcb_free_colors_request_t);
8660 xcb_tmp += xcb_block_len;
8661 xcb_buffer_len += xcb_block_len;
8662 xcb_block_len = 0;
8663 /* pixels */
8664 xcb_block_len += pixels_len * sizeof(uint32_t);
8665 xcb_tmp += xcb_block_len;
8666 xcb_align_to = ALIGNOF(uint32_t);
8667 /* insert padding */
8668 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8669 xcb_buffer_len += xcb_block_len + xcb_pad;
8670 if (0 != xcb_pad) {
8671 xcb_tmp += xcb_pad;
8672 xcb_pad = 0;
8674 xcb_block_len = 0;
8676 return xcb_buffer_len;
8679 xcb_void_cookie_t
8680 xcb_free_colors_checked (xcb_connection_t *c /**< */,
8681 xcb_colormap_t cmap /**< */,
8682 uint32_t plane_mask /**< */,
8683 uint32_t pixels_len /**< */,
8684 const uint32_t *pixels /**< */)
8686 static const xcb_protocol_request_t xcb_req = {
8687 /* count */ 4,
8688 /* ext */ 0,
8689 /* opcode */ XCB_FREE_COLORS,
8690 /* isvoid */ 1
8693 struct iovec xcb_parts[6];
8694 xcb_void_cookie_t xcb_ret;
8695 xcb_free_colors_request_t xcb_out;
8697 xcb_out.pad0 = 0;
8698 xcb_out.cmap = cmap;
8699 xcb_out.plane_mask = plane_mask;
8701 xcb_parts[2].iov_base = (char *) &xcb_out;
8702 xcb_parts[2].iov_len = sizeof(xcb_out);
8703 xcb_parts[3].iov_base = 0;
8704 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
8705 /* uint32_t pixels */
8706 xcb_parts[4].iov_base = (char *) pixels;
8707 xcb_parts[4].iov_len = pixels_len * sizeof(uint32_t);
8708 xcb_parts[5].iov_base = 0;
8709 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
8711 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
8712 return xcb_ret;
8715 xcb_void_cookie_t
8716 xcb_free_colors (xcb_connection_t *c /**< */,
8717 xcb_colormap_t cmap /**< */,
8718 uint32_t plane_mask /**< */,
8719 uint32_t pixels_len /**< */,
8720 const uint32_t *pixels /**< */)
8722 static const xcb_protocol_request_t xcb_req = {
8723 /* count */ 4,
8724 /* ext */ 0,
8725 /* opcode */ XCB_FREE_COLORS,
8726 /* isvoid */ 1
8729 struct iovec xcb_parts[6];
8730 xcb_void_cookie_t xcb_ret;
8731 xcb_free_colors_request_t xcb_out;
8733 xcb_out.pad0 = 0;
8734 xcb_out.cmap = cmap;
8735 xcb_out.plane_mask = plane_mask;
8737 xcb_parts[2].iov_base = (char *) &xcb_out;
8738 xcb_parts[2].iov_len = sizeof(xcb_out);
8739 xcb_parts[3].iov_base = 0;
8740 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
8741 /* uint32_t pixels */
8742 xcb_parts[4].iov_base = (char *) pixels;
8743 xcb_parts[4].iov_len = pixels_len * sizeof(uint32_t);
8744 xcb_parts[5].iov_base = 0;
8745 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
8747 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
8748 return xcb_ret;
8751 void
8752 xcb_coloritem_next (xcb_coloritem_iterator_t *i /**< */)
8754 --i->rem;
8755 ++i->data;
8756 i->index += sizeof(xcb_coloritem_t);
8759 xcb_generic_iterator_t
8760 xcb_coloritem_end (xcb_coloritem_iterator_t i /**< */)
8762 xcb_generic_iterator_t ret;
8763 ret.data = i.data + i.rem;
8764 ret.index = i.index + ((char *) ret.data - (char *) i.data);
8765 ret.rem = 0;
8766 return ret;
8770 xcb_store_colors_sizeof (const void *_buffer /**< */,
8771 uint32_t items_len /**< */)
8773 char *xcb_tmp = (char *)_buffer;
8774 unsigned int xcb_buffer_len = 0;
8775 unsigned int xcb_block_len = 0;
8776 unsigned int xcb_pad = 0;
8777 unsigned int xcb_align_to = 0;
8780 xcb_block_len += sizeof(xcb_store_colors_request_t);
8781 xcb_tmp += xcb_block_len;
8782 xcb_buffer_len += xcb_block_len;
8783 xcb_block_len = 0;
8784 /* items */
8785 xcb_block_len += items_len * sizeof(xcb_coloritem_t);
8786 xcb_tmp += xcb_block_len;
8787 xcb_align_to = ALIGNOF(xcb_coloritem_t);
8788 /* insert padding */
8789 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8790 xcb_buffer_len += xcb_block_len + xcb_pad;
8791 if (0 != xcb_pad) {
8792 xcb_tmp += xcb_pad;
8793 xcb_pad = 0;
8795 xcb_block_len = 0;
8797 return xcb_buffer_len;
8800 xcb_void_cookie_t
8801 xcb_store_colors_checked (xcb_connection_t *c /**< */,
8802 xcb_colormap_t cmap /**< */,
8803 uint32_t items_len /**< */,
8804 const xcb_coloritem_t *items /**< */)
8806 static const xcb_protocol_request_t xcb_req = {
8807 /* count */ 4,
8808 /* ext */ 0,
8809 /* opcode */ XCB_STORE_COLORS,
8810 /* isvoid */ 1
8813 struct iovec xcb_parts[6];
8814 xcb_void_cookie_t xcb_ret;
8815 xcb_store_colors_request_t xcb_out;
8817 xcb_out.pad0 = 0;
8818 xcb_out.cmap = cmap;
8820 xcb_parts[2].iov_base = (char *) &xcb_out;
8821 xcb_parts[2].iov_len = sizeof(xcb_out);
8822 xcb_parts[3].iov_base = 0;
8823 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
8824 /* xcb_coloritem_t items */
8825 xcb_parts[4].iov_base = (char *) items;
8826 xcb_parts[4].iov_len = items_len * sizeof(xcb_coloritem_t);
8827 xcb_parts[5].iov_base = 0;
8828 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
8830 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
8831 return xcb_ret;
8834 xcb_void_cookie_t
8835 xcb_store_colors (xcb_connection_t *c /**< */,
8836 xcb_colormap_t cmap /**< */,
8837 uint32_t items_len /**< */,
8838 const xcb_coloritem_t *items /**< */)
8840 static const xcb_protocol_request_t xcb_req = {
8841 /* count */ 4,
8842 /* ext */ 0,
8843 /* opcode */ XCB_STORE_COLORS,
8844 /* isvoid */ 1
8847 struct iovec xcb_parts[6];
8848 xcb_void_cookie_t xcb_ret;
8849 xcb_store_colors_request_t xcb_out;
8851 xcb_out.pad0 = 0;
8852 xcb_out.cmap = cmap;
8854 xcb_parts[2].iov_base = (char *) &xcb_out;
8855 xcb_parts[2].iov_len = sizeof(xcb_out);
8856 xcb_parts[3].iov_base = 0;
8857 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
8858 /* xcb_coloritem_t items */
8859 xcb_parts[4].iov_base = (char *) items;
8860 xcb_parts[4].iov_len = items_len * sizeof(xcb_coloritem_t);
8861 xcb_parts[5].iov_base = 0;
8862 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
8864 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
8865 return xcb_ret;
8869 xcb_store_named_color_sizeof (const void *_buffer /**< */)
8871 char *xcb_tmp = (char *)_buffer;
8872 const xcb_store_named_color_request_t *_aux = (xcb_store_named_color_request_t *)_buffer;
8873 unsigned int xcb_buffer_len = 0;
8874 unsigned int xcb_block_len = 0;
8875 unsigned int xcb_pad = 0;
8876 unsigned int xcb_align_to = 0;
8879 xcb_block_len += sizeof(xcb_store_named_color_request_t);
8880 xcb_tmp += xcb_block_len;
8881 xcb_buffer_len += xcb_block_len;
8882 xcb_block_len = 0;
8883 /* name */
8884 xcb_block_len += _aux->name_len * sizeof(char);
8885 xcb_tmp += xcb_block_len;
8886 xcb_align_to = ALIGNOF(char);
8887 /* insert padding */
8888 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
8889 xcb_buffer_len += xcb_block_len + xcb_pad;
8890 if (0 != xcb_pad) {
8891 xcb_tmp += xcb_pad;
8892 xcb_pad = 0;
8894 xcb_block_len = 0;
8896 return xcb_buffer_len;
8899 xcb_void_cookie_t
8900 xcb_store_named_color_checked (xcb_connection_t *c /**< */,
8901 uint8_t flags /**< */,
8902 xcb_colormap_t cmap /**< */,
8903 uint32_t pixel /**< */,
8904 uint16_t name_len /**< */,
8905 const char *name /**< */)
8907 static const xcb_protocol_request_t xcb_req = {
8908 /* count */ 4,
8909 /* ext */ 0,
8910 /* opcode */ XCB_STORE_NAMED_COLOR,
8911 /* isvoid */ 1
8914 struct iovec xcb_parts[6];
8915 xcb_void_cookie_t xcb_ret;
8916 xcb_store_named_color_request_t xcb_out;
8918 xcb_out.flags = flags;
8919 xcb_out.cmap = cmap;
8920 xcb_out.pixel = pixel;
8921 xcb_out.name_len = name_len;
8922 memset(xcb_out.pad0, 0, 2);
8924 xcb_parts[2].iov_base = (char *) &xcb_out;
8925 xcb_parts[2].iov_len = sizeof(xcb_out);
8926 xcb_parts[3].iov_base = 0;
8927 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
8928 /* char name */
8929 xcb_parts[4].iov_base = (char *) name;
8930 xcb_parts[4].iov_len = name_len * sizeof(char);
8931 xcb_parts[5].iov_base = 0;
8932 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
8934 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
8935 return xcb_ret;
8938 xcb_void_cookie_t
8939 xcb_store_named_color (xcb_connection_t *c /**< */,
8940 uint8_t flags /**< */,
8941 xcb_colormap_t cmap /**< */,
8942 uint32_t pixel /**< */,
8943 uint16_t name_len /**< */,
8944 const char *name /**< */)
8946 static const xcb_protocol_request_t xcb_req = {
8947 /* count */ 4,
8948 /* ext */ 0,
8949 /* opcode */ XCB_STORE_NAMED_COLOR,
8950 /* isvoid */ 1
8953 struct iovec xcb_parts[6];
8954 xcb_void_cookie_t xcb_ret;
8955 xcb_store_named_color_request_t xcb_out;
8957 xcb_out.flags = flags;
8958 xcb_out.cmap = cmap;
8959 xcb_out.pixel = pixel;
8960 xcb_out.name_len = name_len;
8961 memset(xcb_out.pad0, 0, 2);
8963 xcb_parts[2].iov_base = (char *) &xcb_out;
8964 xcb_parts[2].iov_len = sizeof(xcb_out);
8965 xcb_parts[3].iov_base = 0;
8966 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
8967 /* char name */
8968 xcb_parts[4].iov_base = (char *) name;
8969 xcb_parts[4].iov_len = name_len * sizeof(char);
8970 xcb_parts[5].iov_base = 0;
8971 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
8973 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
8974 return xcb_ret;
8977 void
8978 xcb_rgb_next (xcb_rgb_iterator_t *i /**< */)
8980 --i->rem;
8981 ++i->data;
8982 i->index += sizeof(xcb_rgb_t);
8985 xcb_generic_iterator_t
8986 xcb_rgb_end (xcb_rgb_iterator_t i /**< */)
8988 xcb_generic_iterator_t ret;
8989 ret.data = i.data + i.rem;
8990 ret.index = i.index + ((char *) ret.data - (char *) i.data);
8991 ret.rem = 0;
8992 return ret;
8996 xcb_query_colors_sizeof (const void *_buffer /**< */,
8997 uint32_t pixels_len /**< */)
8999 char *xcb_tmp = (char *)_buffer;
9000 unsigned int xcb_buffer_len = 0;
9001 unsigned int xcb_block_len = 0;
9002 unsigned int xcb_pad = 0;
9003 unsigned int xcb_align_to = 0;
9006 xcb_block_len += sizeof(xcb_query_colors_request_t);
9007 xcb_tmp += xcb_block_len;
9008 xcb_buffer_len += xcb_block_len;
9009 xcb_block_len = 0;
9010 /* pixels */
9011 xcb_block_len += pixels_len * sizeof(uint32_t);
9012 xcb_tmp += xcb_block_len;
9013 xcb_align_to = ALIGNOF(uint32_t);
9014 /* insert padding */
9015 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
9016 xcb_buffer_len += xcb_block_len + xcb_pad;
9017 if (0 != xcb_pad) {
9018 xcb_tmp += xcb_pad;
9019 xcb_pad = 0;
9021 xcb_block_len = 0;
9023 return xcb_buffer_len;
9026 xcb_query_colors_cookie_t
9027 xcb_query_colors (xcb_connection_t *c /**< */,
9028 xcb_colormap_t cmap /**< */,
9029 uint32_t pixels_len /**< */,
9030 const uint32_t *pixels /**< */)
9032 static const xcb_protocol_request_t xcb_req = {
9033 /* count */ 4,
9034 /* ext */ 0,
9035 /* opcode */ XCB_QUERY_COLORS,
9036 /* isvoid */ 0
9039 struct iovec xcb_parts[6];
9040 xcb_query_colors_cookie_t xcb_ret;
9041 xcb_query_colors_request_t xcb_out;
9043 xcb_out.pad0 = 0;
9044 xcb_out.cmap = cmap;
9046 xcb_parts[2].iov_base = (char *) &xcb_out;
9047 xcb_parts[2].iov_len = sizeof(xcb_out);
9048 xcb_parts[3].iov_base = 0;
9049 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
9050 /* uint32_t pixels */
9051 xcb_parts[4].iov_base = (char *) pixels;
9052 xcb_parts[4].iov_len = pixels_len * sizeof(uint32_t);
9053 xcb_parts[5].iov_base = 0;
9054 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
9056 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
9057 return xcb_ret;
9060 xcb_query_colors_cookie_t
9061 xcb_query_colors_unchecked (xcb_connection_t *c /**< */,
9062 xcb_colormap_t cmap /**< */,
9063 uint32_t pixels_len /**< */,
9064 const uint32_t *pixels /**< */)
9066 static const xcb_protocol_request_t xcb_req = {
9067 /* count */ 4,
9068 /* ext */ 0,
9069 /* opcode */ XCB_QUERY_COLORS,
9070 /* isvoid */ 0
9073 struct iovec xcb_parts[6];
9074 xcb_query_colors_cookie_t xcb_ret;
9075 xcb_query_colors_request_t xcb_out;
9077 xcb_out.pad0 = 0;
9078 xcb_out.cmap = cmap;
9080 xcb_parts[2].iov_base = (char *) &xcb_out;
9081 xcb_parts[2].iov_len = sizeof(xcb_out);
9082 xcb_parts[3].iov_base = 0;
9083 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
9084 /* uint32_t pixels */
9085 xcb_parts[4].iov_base = (char *) pixels;
9086 xcb_parts[4].iov_len = pixels_len * sizeof(uint32_t);
9087 xcb_parts[5].iov_base = 0;
9088 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
9090 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
9091 return xcb_ret;
9094 xcb_rgb_t *
9095 xcb_query_colors_colors (const xcb_query_colors_reply_t *R /**< */)
9097 return (xcb_rgb_t *) (R + 1);
9101 xcb_query_colors_colors_length (const xcb_query_colors_reply_t *R /**< */)
9103 return R->colors_len;
9106 xcb_rgb_iterator_t
9107 xcb_query_colors_colors_iterator (const xcb_query_colors_reply_t *R /**< */)
9109 xcb_rgb_iterator_t i;
9110 i.data = (xcb_rgb_t *) (R + 1);
9111 i.rem = R->colors_len;
9112 i.index = (char *) i.data - (char *) R;
9113 return i;
9116 xcb_query_colors_reply_t *
9117 xcb_query_colors_reply (xcb_connection_t *c /**< */,
9118 xcb_query_colors_cookie_t cookie /**< */,
9119 xcb_generic_error_t **e /**< */)
9121 return (xcb_query_colors_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
9125 xcb_lookup_color_sizeof (const void *_buffer /**< */)
9127 char *xcb_tmp = (char *)_buffer;
9128 const xcb_lookup_color_request_t *_aux = (xcb_lookup_color_request_t *)_buffer;
9129 unsigned int xcb_buffer_len = 0;
9130 unsigned int xcb_block_len = 0;
9131 unsigned int xcb_pad = 0;
9132 unsigned int xcb_align_to = 0;
9135 xcb_block_len += sizeof(xcb_lookup_color_request_t);
9136 xcb_tmp += xcb_block_len;
9137 xcb_buffer_len += xcb_block_len;
9138 xcb_block_len = 0;
9139 /* name */
9140 xcb_block_len += _aux->name_len * sizeof(char);
9141 xcb_tmp += xcb_block_len;
9142 xcb_align_to = ALIGNOF(char);
9143 /* insert padding */
9144 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
9145 xcb_buffer_len += xcb_block_len + xcb_pad;
9146 if (0 != xcb_pad) {
9147 xcb_tmp += xcb_pad;
9148 xcb_pad = 0;
9150 xcb_block_len = 0;
9152 return xcb_buffer_len;
9155 xcb_lookup_color_cookie_t
9156 xcb_lookup_color (xcb_connection_t *c /**< */,
9157 xcb_colormap_t cmap /**< */,
9158 uint16_t name_len /**< */,
9159 const char *name /**< */)
9161 static const xcb_protocol_request_t xcb_req = {
9162 /* count */ 4,
9163 /* ext */ 0,
9164 /* opcode */ XCB_LOOKUP_COLOR,
9165 /* isvoid */ 0
9168 struct iovec xcb_parts[6];
9169 xcb_lookup_color_cookie_t xcb_ret;
9170 xcb_lookup_color_request_t xcb_out;
9172 xcb_out.pad0 = 0;
9173 xcb_out.cmap = cmap;
9174 xcb_out.name_len = name_len;
9175 memset(xcb_out.pad1, 0, 2);
9177 xcb_parts[2].iov_base = (char *) &xcb_out;
9178 xcb_parts[2].iov_len = sizeof(xcb_out);
9179 xcb_parts[3].iov_base = 0;
9180 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
9181 /* char name */
9182 xcb_parts[4].iov_base = (char *) name;
9183 xcb_parts[4].iov_len = name_len * sizeof(char);
9184 xcb_parts[5].iov_base = 0;
9185 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
9187 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
9188 return xcb_ret;
9191 xcb_lookup_color_cookie_t
9192 xcb_lookup_color_unchecked (xcb_connection_t *c /**< */,
9193 xcb_colormap_t cmap /**< */,
9194 uint16_t name_len /**< */,
9195 const char *name /**< */)
9197 static const xcb_protocol_request_t xcb_req = {
9198 /* count */ 4,
9199 /* ext */ 0,
9200 /* opcode */ XCB_LOOKUP_COLOR,
9201 /* isvoid */ 0
9204 struct iovec xcb_parts[6];
9205 xcb_lookup_color_cookie_t xcb_ret;
9206 xcb_lookup_color_request_t xcb_out;
9208 xcb_out.pad0 = 0;
9209 xcb_out.cmap = cmap;
9210 xcb_out.name_len = name_len;
9211 memset(xcb_out.pad1, 0, 2);
9213 xcb_parts[2].iov_base = (char *) &xcb_out;
9214 xcb_parts[2].iov_len = sizeof(xcb_out);
9215 xcb_parts[3].iov_base = 0;
9216 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
9217 /* char name */
9218 xcb_parts[4].iov_base = (char *) name;
9219 xcb_parts[4].iov_len = name_len * sizeof(char);
9220 xcb_parts[5].iov_base = 0;
9221 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
9223 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
9224 return xcb_ret;
9227 xcb_lookup_color_reply_t *
9228 xcb_lookup_color_reply (xcb_connection_t *c /**< */,
9229 xcb_lookup_color_cookie_t cookie /**< */,
9230 xcb_generic_error_t **e /**< */)
9232 return (xcb_lookup_color_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
9235 xcb_void_cookie_t
9236 xcb_create_cursor_checked (xcb_connection_t *c /**< */,
9237 xcb_cursor_t cid /**< */,
9238 xcb_pixmap_t source /**< */,
9239 xcb_pixmap_t mask /**< */,
9240 uint16_t fore_red /**< */,
9241 uint16_t fore_green /**< */,
9242 uint16_t fore_blue /**< */,
9243 uint16_t back_red /**< */,
9244 uint16_t back_green /**< */,
9245 uint16_t back_blue /**< */,
9246 uint16_t x /**< */,
9247 uint16_t y /**< */)
9249 static const xcb_protocol_request_t xcb_req = {
9250 /* count */ 2,
9251 /* ext */ 0,
9252 /* opcode */ XCB_CREATE_CURSOR,
9253 /* isvoid */ 1
9256 struct iovec xcb_parts[4];
9257 xcb_void_cookie_t xcb_ret;
9258 xcb_create_cursor_request_t xcb_out;
9260 xcb_out.pad0 = 0;
9261 xcb_out.cid = cid;
9262 xcb_out.source = source;
9263 xcb_out.mask = mask;
9264 xcb_out.fore_red = fore_red;
9265 xcb_out.fore_green = fore_green;
9266 xcb_out.fore_blue = fore_blue;
9267 xcb_out.back_red = back_red;
9268 xcb_out.back_green = back_green;
9269 xcb_out.back_blue = back_blue;
9270 xcb_out.x = x;
9271 xcb_out.y = y;
9273 xcb_parts[2].iov_base = (char *) &xcb_out;
9274 xcb_parts[2].iov_len = sizeof(xcb_out);
9275 xcb_parts[3].iov_base = 0;
9276 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
9278 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
9279 return xcb_ret;
9282 xcb_void_cookie_t
9283 xcb_create_cursor (xcb_connection_t *c /**< */,
9284 xcb_cursor_t cid /**< */,
9285 xcb_pixmap_t source /**< */,
9286 xcb_pixmap_t mask /**< */,
9287 uint16_t fore_red /**< */,
9288 uint16_t fore_green /**< */,
9289 uint16_t fore_blue /**< */,
9290 uint16_t back_red /**< */,
9291 uint16_t back_green /**< */,
9292 uint16_t back_blue /**< */,
9293 uint16_t x /**< */,
9294 uint16_t y /**< */)
9296 static const xcb_protocol_request_t xcb_req = {
9297 /* count */ 2,
9298 /* ext */ 0,
9299 /* opcode */ XCB_CREATE_CURSOR,
9300 /* isvoid */ 1
9303 struct iovec xcb_parts[4];
9304 xcb_void_cookie_t xcb_ret;
9305 xcb_create_cursor_request_t xcb_out;
9307 xcb_out.pad0 = 0;
9308 xcb_out.cid = cid;
9309 xcb_out.source = source;
9310 xcb_out.mask = mask;
9311 xcb_out.fore_red = fore_red;
9312 xcb_out.fore_green = fore_green;
9313 xcb_out.fore_blue = fore_blue;
9314 xcb_out.back_red = back_red;
9315 xcb_out.back_green = back_green;
9316 xcb_out.back_blue = back_blue;
9317 xcb_out.x = x;
9318 xcb_out.y = y;
9320 xcb_parts[2].iov_base = (char *) &xcb_out;
9321 xcb_parts[2].iov_len = sizeof(xcb_out);
9322 xcb_parts[3].iov_base = 0;
9323 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
9325 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
9326 return xcb_ret;
9329 xcb_void_cookie_t
9330 xcb_create_glyph_cursor_checked (xcb_connection_t *c /**< */,
9331 xcb_cursor_t cid /**< */,
9332 xcb_font_t source_font /**< */,
9333 xcb_font_t mask_font /**< */,
9334 uint16_t source_char /**< */,
9335 uint16_t mask_char /**< */,
9336 uint16_t fore_red /**< */,
9337 uint16_t fore_green /**< */,
9338 uint16_t fore_blue /**< */,
9339 uint16_t back_red /**< */,
9340 uint16_t back_green /**< */,
9341 uint16_t back_blue /**< */)
9343 static const xcb_protocol_request_t xcb_req = {
9344 /* count */ 2,
9345 /* ext */ 0,
9346 /* opcode */ XCB_CREATE_GLYPH_CURSOR,
9347 /* isvoid */ 1
9350 struct iovec xcb_parts[4];
9351 xcb_void_cookie_t xcb_ret;
9352 xcb_create_glyph_cursor_request_t xcb_out;
9354 xcb_out.pad0 = 0;
9355 xcb_out.cid = cid;
9356 xcb_out.source_font = source_font;
9357 xcb_out.mask_font = mask_font;
9358 xcb_out.source_char = source_char;
9359 xcb_out.mask_char = mask_char;
9360 xcb_out.fore_red = fore_red;
9361 xcb_out.fore_green = fore_green;
9362 xcb_out.fore_blue = fore_blue;
9363 xcb_out.back_red = back_red;
9364 xcb_out.back_green = back_green;
9365 xcb_out.back_blue = back_blue;
9367 xcb_parts[2].iov_base = (char *) &xcb_out;
9368 xcb_parts[2].iov_len = sizeof(xcb_out);
9369 xcb_parts[3].iov_base = 0;
9370 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
9372 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
9373 return xcb_ret;
9376 xcb_void_cookie_t
9377 xcb_create_glyph_cursor (xcb_connection_t *c /**< */,
9378 xcb_cursor_t cid /**< */,
9379 xcb_font_t source_font /**< */,
9380 xcb_font_t mask_font /**< */,
9381 uint16_t source_char /**< */,
9382 uint16_t mask_char /**< */,
9383 uint16_t fore_red /**< */,
9384 uint16_t fore_green /**< */,
9385 uint16_t fore_blue /**< */,
9386 uint16_t back_red /**< */,
9387 uint16_t back_green /**< */,
9388 uint16_t back_blue /**< */)
9390 static const xcb_protocol_request_t xcb_req = {
9391 /* count */ 2,
9392 /* ext */ 0,
9393 /* opcode */ XCB_CREATE_GLYPH_CURSOR,
9394 /* isvoid */ 1
9397 struct iovec xcb_parts[4];
9398 xcb_void_cookie_t xcb_ret;
9399 xcb_create_glyph_cursor_request_t xcb_out;
9401 xcb_out.pad0 = 0;
9402 xcb_out.cid = cid;
9403 xcb_out.source_font = source_font;
9404 xcb_out.mask_font = mask_font;
9405 xcb_out.source_char = source_char;
9406 xcb_out.mask_char = mask_char;
9407 xcb_out.fore_red = fore_red;
9408 xcb_out.fore_green = fore_green;
9409 xcb_out.fore_blue = fore_blue;
9410 xcb_out.back_red = back_red;
9411 xcb_out.back_green = back_green;
9412 xcb_out.back_blue = back_blue;
9414 xcb_parts[2].iov_base = (char *) &xcb_out;
9415 xcb_parts[2].iov_len = sizeof(xcb_out);
9416 xcb_parts[3].iov_base = 0;
9417 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
9419 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
9420 return xcb_ret;
9423 xcb_void_cookie_t
9424 xcb_free_cursor_checked (xcb_connection_t *c /**< */,
9425 xcb_cursor_t cursor /**< */)
9427 static const xcb_protocol_request_t xcb_req = {
9428 /* count */ 2,
9429 /* ext */ 0,
9430 /* opcode */ XCB_FREE_CURSOR,
9431 /* isvoid */ 1
9434 struct iovec xcb_parts[4];
9435 xcb_void_cookie_t xcb_ret;
9436 xcb_free_cursor_request_t xcb_out;
9438 xcb_out.pad0 = 0;
9439 xcb_out.cursor = cursor;
9441 xcb_parts[2].iov_base = (char *) &xcb_out;
9442 xcb_parts[2].iov_len = sizeof(xcb_out);
9443 xcb_parts[3].iov_base = 0;
9444 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
9446 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
9447 return xcb_ret;
9450 xcb_void_cookie_t
9451 xcb_free_cursor (xcb_connection_t *c /**< */,
9452 xcb_cursor_t cursor /**< */)
9454 static const xcb_protocol_request_t xcb_req = {
9455 /* count */ 2,
9456 /* ext */ 0,
9457 /* opcode */ XCB_FREE_CURSOR,
9458 /* isvoid */ 1
9461 struct iovec xcb_parts[4];
9462 xcb_void_cookie_t xcb_ret;
9463 xcb_free_cursor_request_t xcb_out;
9465 xcb_out.pad0 = 0;
9466 xcb_out.cursor = cursor;
9468 xcb_parts[2].iov_base = (char *) &xcb_out;
9469 xcb_parts[2].iov_len = sizeof(xcb_out);
9470 xcb_parts[3].iov_base = 0;
9471 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
9473 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
9474 return xcb_ret;
9477 xcb_void_cookie_t
9478 xcb_recolor_cursor_checked (xcb_connection_t *c /**< */,
9479 xcb_cursor_t cursor /**< */,
9480 uint16_t fore_red /**< */,
9481 uint16_t fore_green /**< */,
9482 uint16_t fore_blue /**< */,
9483 uint16_t back_red /**< */,
9484 uint16_t back_green /**< */,
9485 uint16_t back_blue /**< */)
9487 static const xcb_protocol_request_t xcb_req = {
9488 /* count */ 2,
9489 /* ext */ 0,
9490 /* opcode */ XCB_RECOLOR_CURSOR,
9491 /* isvoid */ 1
9494 struct iovec xcb_parts[4];
9495 xcb_void_cookie_t xcb_ret;
9496 xcb_recolor_cursor_request_t xcb_out;
9498 xcb_out.pad0 = 0;
9499 xcb_out.cursor = cursor;
9500 xcb_out.fore_red = fore_red;
9501 xcb_out.fore_green = fore_green;
9502 xcb_out.fore_blue = fore_blue;
9503 xcb_out.back_red = back_red;
9504 xcb_out.back_green = back_green;
9505 xcb_out.back_blue = back_blue;
9507 xcb_parts[2].iov_base = (char *) &xcb_out;
9508 xcb_parts[2].iov_len = sizeof(xcb_out);
9509 xcb_parts[3].iov_base = 0;
9510 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
9512 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
9513 return xcb_ret;
9516 xcb_void_cookie_t
9517 xcb_recolor_cursor (xcb_connection_t *c /**< */,
9518 xcb_cursor_t cursor /**< */,
9519 uint16_t fore_red /**< */,
9520 uint16_t fore_green /**< */,
9521 uint16_t fore_blue /**< */,
9522 uint16_t back_red /**< */,
9523 uint16_t back_green /**< */,
9524 uint16_t back_blue /**< */)
9526 static const xcb_protocol_request_t xcb_req = {
9527 /* count */ 2,
9528 /* ext */ 0,
9529 /* opcode */ XCB_RECOLOR_CURSOR,
9530 /* isvoid */ 1
9533 struct iovec xcb_parts[4];
9534 xcb_void_cookie_t xcb_ret;
9535 xcb_recolor_cursor_request_t xcb_out;
9537 xcb_out.pad0 = 0;
9538 xcb_out.cursor = cursor;
9539 xcb_out.fore_red = fore_red;
9540 xcb_out.fore_green = fore_green;
9541 xcb_out.fore_blue = fore_blue;
9542 xcb_out.back_red = back_red;
9543 xcb_out.back_green = back_green;
9544 xcb_out.back_blue = back_blue;
9546 xcb_parts[2].iov_base = (char *) &xcb_out;
9547 xcb_parts[2].iov_len = sizeof(xcb_out);
9548 xcb_parts[3].iov_base = 0;
9549 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
9551 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
9552 return xcb_ret;
9555 xcb_query_best_size_cookie_t
9556 xcb_query_best_size (xcb_connection_t *c /**< */,
9557 uint8_t _class /**< */,
9558 xcb_drawable_t drawable /**< */,
9559 uint16_t width /**< */,
9560 uint16_t height /**< */)
9562 static const xcb_protocol_request_t xcb_req = {
9563 /* count */ 2,
9564 /* ext */ 0,
9565 /* opcode */ XCB_QUERY_BEST_SIZE,
9566 /* isvoid */ 0
9569 struct iovec xcb_parts[4];
9570 xcb_query_best_size_cookie_t xcb_ret;
9571 xcb_query_best_size_request_t xcb_out;
9573 xcb_out._class = _class;
9574 xcb_out.drawable = drawable;
9575 xcb_out.width = width;
9576 xcb_out.height = height;
9578 xcb_parts[2].iov_base = (char *) &xcb_out;
9579 xcb_parts[2].iov_len = sizeof(xcb_out);
9580 xcb_parts[3].iov_base = 0;
9581 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
9583 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
9584 return xcb_ret;
9587 xcb_query_best_size_cookie_t
9588 xcb_query_best_size_unchecked (xcb_connection_t *c /**< */,
9589 uint8_t _class /**< */,
9590 xcb_drawable_t drawable /**< */,
9591 uint16_t width /**< */,
9592 uint16_t height /**< */)
9594 static const xcb_protocol_request_t xcb_req = {
9595 /* count */ 2,
9596 /* ext */ 0,
9597 /* opcode */ XCB_QUERY_BEST_SIZE,
9598 /* isvoid */ 0
9601 struct iovec xcb_parts[4];
9602 xcb_query_best_size_cookie_t xcb_ret;
9603 xcb_query_best_size_request_t xcb_out;
9605 xcb_out._class = _class;
9606 xcb_out.drawable = drawable;
9607 xcb_out.width = width;
9608 xcb_out.height = height;
9610 xcb_parts[2].iov_base = (char *) &xcb_out;
9611 xcb_parts[2].iov_len = sizeof(xcb_out);
9612 xcb_parts[3].iov_base = 0;
9613 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
9615 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
9616 return xcb_ret;
9619 xcb_query_best_size_reply_t *
9620 xcb_query_best_size_reply (xcb_connection_t *c /**< */,
9621 xcb_query_best_size_cookie_t cookie /**< */,
9622 xcb_generic_error_t **e /**< */)
9624 return (xcb_query_best_size_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
9628 xcb_query_extension_sizeof (const void *_buffer /**< */)
9630 char *xcb_tmp = (char *)_buffer;
9631 const xcb_query_extension_request_t *_aux = (xcb_query_extension_request_t *)_buffer;
9632 unsigned int xcb_buffer_len = 0;
9633 unsigned int xcb_block_len = 0;
9634 unsigned int xcb_pad = 0;
9635 unsigned int xcb_align_to = 0;
9638 xcb_block_len += sizeof(xcb_query_extension_request_t);
9639 xcb_tmp += xcb_block_len;
9640 xcb_buffer_len += xcb_block_len;
9641 xcb_block_len = 0;
9642 /* name */
9643 xcb_block_len += _aux->name_len * sizeof(char);
9644 xcb_tmp += xcb_block_len;
9645 xcb_align_to = ALIGNOF(char);
9646 /* insert padding */
9647 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
9648 xcb_buffer_len += xcb_block_len + xcb_pad;
9649 if (0 != xcb_pad) {
9650 xcb_tmp += xcb_pad;
9651 xcb_pad = 0;
9653 xcb_block_len = 0;
9655 return xcb_buffer_len;
9658 xcb_query_extension_cookie_t
9659 xcb_query_extension (xcb_connection_t *c /**< */,
9660 uint16_t name_len /**< */,
9661 const char *name /**< */)
9663 static const xcb_protocol_request_t xcb_req = {
9664 /* count */ 4,
9665 /* ext */ 0,
9666 /* opcode */ XCB_QUERY_EXTENSION,
9667 /* isvoid */ 0
9670 struct iovec xcb_parts[6];
9671 xcb_query_extension_cookie_t xcb_ret;
9672 xcb_query_extension_request_t xcb_out;
9674 xcb_out.pad0 = 0;
9675 xcb_out.name_len = name_len;
9676 memset(xcb_out.pad1, 0, 2);
9678 xcb_parts[2].iov_base = (char *) &xcb_out;
9679 xcb_parts[2].iov_len = sizeof(xcb_out);
9680 xcb_parts[3].iov_base = 0;
9681 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
9682 /* char name */
9683 xcb_parts[4].iov_base = (char *) name;
9684 xcb_parts[4].iov_len = name_len * sizeof(char);
9685 xcb_parts[5].iov_base = 0;
9686 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
9688 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
9689 return xcb_ret;
9692 xcb_query_extension_cookie_t
9693 xcb_query_extension_unchecked (xcb_connection_t *c /**< */,
9694 uint16_t name_len /**< */,
9695 const char *name /**< */)
9697 static const xcb_protocol_request_t xcb_req = {
9698 /* count */ 4,
9699 /* ext */ 0,
9700 /* opcode */ XCB_QUERY_EXTENSION,
9701 /* isvoid */ 0
9704 struct iovec xcb_parts[6];
9705 xcb_query_extension_cookie_t xcb_ret;
9706 xcb_query_extension_request_t xcb_out;
9708 xcb_out.pad0 = 0;
9709 xcb_out.name_len = name_len;
9710 memset(xcb_out.pad1, 0, 2);
9712 xcb_parts[2].iov_base = (char *) &xcb_out;
9713 xcb_parts[2].iov_len = sizeof(xcb_out);
9714 xcb_parts[3].iov_base = 0;
9715 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
9716 /* char name */
9717 xcb_parts[4].iov_base = (char *) name;
9718 xcb_parts[4].iov_len = name_len * sizeof(char);
9719 xcb_parts[5].iov_base = 0;
9720 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
9722 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
9723 return xcb_ret;
9726 xcb_query_extension_reply_t *
9727 xcb_query_extension_reply (xcb_connection_t *c /**< */,
9728 xcb_query_extension_cookie_t cookie /**< */,
9729 xcb_generic_error_t **e /**< */)
9731 return (xcb_query_extension_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
9735 xcb_list_extensions_sizeof (const void *_buffer /**< */)
9737 char *xcb_tmp = (char *)_buffer;
9738 const xcb_list_extensions_reply_t *_aux = (xcb_list_extensions_reply_t *)_buffer;
9739 unsigned int xcb_buffer_len = 0;
9740 unsigned int xcb_block_len = 0;
9741 unsigned int xcb_pad = 0;
9742 unsigned int xcb_align_to = 0;
9744 unsigned int i;
9745 unsigned int xcb_tmp_len;
9747 xcb_block_len += sizeof(xcb_list_extensions_reply_t);
9748 xcb_tmp += xcb_block_len;
9749 xcb_buffer_len += xcb_block_len;
9750 xcb_block_len = 0;
9751 /* names */
9752 for(i=0; i<_aux->names_len; i++) {
9753 xcb_tmp_len = xcb_str_sizeof(xcb_tmp);
9754 xcb_block_len += xcb_tmp_len;
9755 xcb_tmp += xcb_tmp_len;
9757 xcb_align_to = ALIGNOF(xcb_str_t);
9758 /* insert padding */
9759 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
9760 xcb_buffer_len += xcb_block_len + xcb_pad;
9761 if (0 != xcb_pad) {
9762 xcb_tmp += xcb_pad;
9763 xcb_pad = 0;
9765 xcb_block_len = 0;
9767 return xcb_buffer_len;
9770 xcb_list_extensions_cookie_t
9771 xcb_list_extensions (xcb_connection_t *c /**< */)
9773 static const xcb_protocol_request_t xcb_req = {
9774 /* count */ 2,
9775 /* ext */ 0,
9776 /* opcode */ XCB_LIST_EXTENSIONS,
9777 /* isvoid */ 0
9780 struct iovec xcb_parts[4];
9781 xcb_list_extensions_cookie_t xcb_ret;
9782 xcb_list_extensions_request_t xcb_out;
9784 xcb_out.pad0 = 0;
9786 xcb_parts[2].iov_base = (char *) &xcb_out;
9787 xcb_parts[2].iov_len = sizeof(xcb_out);
9788 xcb_parts[3].iov_base = 0;
9789 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
9791 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
9792 return xcb_ret;
9795 xcb_list_extensions_cookie_t
9796 xcb_list_extensions_unchecked (xcb_connection_t *c /**< */)
9798 static const xcb_protocol_request_t xcb_req = {
9799 /* count */ 2,
9800 /* ext */ 0,
9801 /* opcode */ XCB_LIST_EXTENSIONS,
9802 /* isvoid */ 0
9805 struct iovec xcb_parts[4];
9806 xcb_list_extensions_cookie_t xcb_ret;
9807 xcb_list_extensions_request_t xcb_out;
9809 xcb_out.pad0 = 0;
9811 xcb_parts[2].iov_base = (char *) &xcb_out;
9812 xcb_parts[2].iov_len = sizeof(xcb_out);
9813 xcb_parts[3].iov_base = 0;
9814 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
9816 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
9817 return xcb_ret;
9821 xcb_list_extensions_names_length (const xcb_list_extensions_reply_t *R /**< */)
9823 return R->names_len;
9826 xcb_str_iterator_t
9827 xcb_list_extensions_names_iterator (const xcb_list_extensions_reply_t *R /**< */)
9829 xcb_str_iterator_t i;
9830 i.data = (xcb_str_t *) (R + 1);
9831 i.rem = R->names_len;
9832 i.index = (char *) i.data - (char *) R;
9833 return i;
9836 xcb_list_extensions_reply_t *
9837 xcb_list_extensions_reply (xcb_connection_t *c /**< */,
9838 xcb_list_extensions_cookie_t cookie /**< */,
9839 xcb_generic_error_t **e /**< */)
9841 return (xcb_list_extensions_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
9845 xcb_change_keyboard_mapping_sizeof (const void *_buffer /**< */)
9847 char *xcb_tmp = (char *)_buffer;
9848 const xcb_change_keyboard_mapping_request_t *_aux = (xcb_change_keyboard_mapping_request_t *)_buffer;
9849 unsigned int xcb_buffer_len = 0;
9850 unsigned int xcb_block_len = 0;
9851 unsigned int xcb_pad = 0;
9852 unsigned int xcb_align_to = 0;
9855 xcb_block_len += sizeof(xcb_change_keyboard_mapping_request_t);
9856 xcb_tmp += xcb_block_len;
9857 xcb_buffer_len += xcb_block_len;
9858 xcb_block_len = 0;
9859 /* keysyms */
9860 xcb_block_len += (_aux->keycode_count * _aux->keysyms_per_keycode) * sizeof(xcb_keysym_t);
9861 xcb_tmp += xcb_block_len;
9862 xcb_align_to = ALIGNOF(xcb_keysym_t);
9863 /* insert padding */
9864 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
9865 xcb_buffer_len += xcb_block_len + xcb_pad;
9866 if (0 != xcb_pad) {
9867 xcb_tmp += xcb_pad;
9868 xcb_pad = 0;
9870 xcb_block_len = 0;
9872 return xcb_buffer_len;
9875 xcb_void_cookie_t
9876 xcb_change_keyboard_mapping_checked (xcb_connection_t *c /**< */,
9877 uint8_t keycode_count /**< */,
9878 xcb_keycode_t first_keycode /**< */,
9879 uint8_t keysyms_per_keycode /**< */,
9880 const xcb_keysym_t *keysyms /**< */)
9882 static const xcb_protocol_request_t xcb_req = {
9883 /* count */ 4,
9884 /* ext */ 0,
9885 /* opcode */ XCB_CHANGE_KEYBOARD_MAPPING,
9886 /* isvoid */ 1
9889 struct iovec xcb_parts[6];
9890 xcb_void_cookie_t xcb_ret;
9891 xcb_change_keyboard_mapping_request_t xcb_out;
9893 xcb_out.keycode_count = keycode_count;
9894 xcb_out.first_keycode = first_keycode;
9895 xcb_out.keysyms_per_keycode = keysyms_per_keycode;
9896 memset(xcb_out.pad0, 0, 2);
9898 xcb_parts[2].iov_base = (char *) &xcb_out;
9899 xcb_parts[2].iov_len = sizeof(xcb_out);
9900 xcb_parts[3].iov_base = 0;
9901 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
9902 /* xcb_keysym_t keysyms */
9903 xcb_parts[4].iov_base = (char *) keysyms;
9904 xcb_parts[4].iov_len = (keycode_count * keysyms_per_keycode) * sizeof(xcb_keysym_t);
9905 xcb_parts[5].iov_base = 0;
9906 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
9908 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
9909 return xcb_ret;
9912 xcb_void_cookie_t
9913 xcb_change_keyboard_mapping (xcb_connection_t *c /**< */,
9914 uint8_t keycode_count /**< */,
9915 xcb_keycode_t first_keycode /**< */,
9916 uint8_t keysyms_per_keycode /**< */,
9917 const xcb_keysym_t *keysyms /**< */)
9919 static const xcb_protocol_request_t xcb_req = {
9920 /* count */ 4,
9921 /* ext */ 0,
9922 /* opcode */ XCB_CHANGE_KEYBOARD_MAPPING,
9923 /* isvoid */ 1
9926 struct iovec xcb_parts[6];
9927 xcb_void_cookie_t xcb_ret;
9928 xcb_change_keyboard_mapping_request_t xcb_out;
9930 xcb_out.keycode_count = keycode_count;
9931 xcb_out.first_keycode = first_keycode;
9932 xcb_out.keysyms_per_keycode = keysyms_per_keycode;
9933 memset(xcb_out.pad0, 0, 2);
9935 xcb_parts[2].iov_base = (char *) &xcb_out;
9936 xcb_parts[2].iov_len = sizeof(xcb_out);
9937 xcb_parts[3].iov_base = 0;
9938 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
9939 /* xcb_keysym_t keysyms */
9940 xcb_parts[4].iov_base = (char *) keysyms;
9941 xcb_parts[4].iov_len = (keycode_count * keysyms_per_keycode) * sizeof(xcb_keysym_t);
9942 xcb_parts[5].iov_base = 0;
9943 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
9945 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
9946 return xcb_ret;
9950 xcb_get_keyboard_mapping_sizeof (const void *_buffer /**< */)
9952 char *xcb_tmp = (char *)_buffer;
9953 const xcb_get_keyboard_mapping_reply_t *_aux = (xcb_get_keyboard_mapping_reply_t *)_buffer;
9954 unsigned int xcb_buffer_len = 0;
9955 unsigned int xcb_block_len = 0;
9956 unsigned int xcb_pad = 0;
9957 unsigned int xcb_align_to = 0;
9960 xcb_block_len += sizeof(xcb_get_keyboard_mapping_reply_t);
9961 xcb_tmp += xcb_block_len;
9962 xcb_buffer_len += xcb_block_len;
9963 xcb_block_len = 0;
9964 /* keysyms */
9965 xcb_block_len += _aux->length * sizeof(xcb_keysym_t);
9966 xcb_tmp += xcb_block_len;
9967 xcb_align_to = ALIGNOF(xcb_keysym_t);
9968 /* insert padding */
9969 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
9970 xcb_buffer_len += xcb_block_len + xcb_pad;
9971 if (0 != xcb_pad) {
9972 xcb_tmp += xcb_pad;
9973 xcb_pad = 0;
9975 xcb_block_len = 0;
9977 return xcb_buffer_len;
9980 xcb_get_keyboard_mapping_cookie_t
9981 xcb_get_keyboard_mapping (xcb_connection_t *c /**< */,
9982 xcb_keycode_t first_keycode /**< */,
9983 uint8_t count /**< */)
9985 static const xcb_protocol_request_t xcb_req = {
9986 /* count */ 2,
9987 /* ext */ 0,
9988 /* opcode */ XCB_GET_KEYBOARD_MAPPING,
9989 /* isvoid */ 0
9992 struct iovec xcb_parts[4];
9993 xcb_get_keyboard_mapping_cookie_t xcb_ret;
9994 xcb_get_keyboard_mapping_request_t xcb_out;
9996 xcb_out.pad0 = 0;
9997 xcb_out.first_keycode = first_keycode;
9998 xcb_out.count = count;
10000 xcb_parts[2].iov_base = (char *) &xcb_out;
10001 xcb_parts[2].iov_len = sizeof(xcb_out);
10002 xcb_parts[3].iov_base = 0;
10003 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
10005 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
10006 return xcb_ret;
10009 xcb_get_keyboard_mapping_cookie_t
10010 xcb_get_keyboard_mapping_unchecked (xcb_connection_t *c /**< */,
10011 xcb_keycode_t first_keycode /**< */,
10012 uint8_t count /**< */)
10014 static const xcb_protocol_request_t xcb_req = {
10015 /* count */ 2,
10016 /* ext */ 0,
10017 /* opcode */ XCB_GET_KEYBOARD_MAPPING,
10018 /* isvoid */ 0
10021 struct iovec xcb_parts[4];
10022 xcb_get_keyboard_mapping_cookie_t xcb_ret;
10023 xcb_get_keyboard_mapping_request_t xcb_out;
10025 xcb_out.pad0 = 0;
10026 xcb_out.first_keycode = first_keycode;
10027 xcb_out.count = count;
10029 xcb_parts[2].iov_base = (char *) &xcb_out;
10030 xcb_parts[2].iov_len = sizeof(xcb_out);
10031 xcb_parts[3].iov_base = 0;
10032 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
10034 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
10035 return xcb_ret;
10038 xcb_keysym_t *
10039 xcb_get_keyboard_mapping_keysyms (const xcb_get_keyboard_mapping_reply_t *R /**< */)
10041 return (xcb_keysym_t *) (R + 1);
10045 xcb_get_keyboard_mapping_keysyms_length (const xcb_get_keyboard_mapping_reply_t *R /**< */)
10047 return R->length;
10050 xcb_generic_iterator_t
10051 xcb_get_keyboard_mapping_keysyms_end (const xcb_get_keyboard_mapping_reply_t *R /**< */)
10053 xcb_generic_iterator_t i;
10054 i.data = ((xcb_keysym_t *) (R + 1)) + (R->length);
10055 i.rem = 0;
10056 i.index = (char *) i.data - (char *) R;
10057 return i;
10060 xcb_get_keyboard_mapping_reply_t *
10061 xcb_get_keyboard_mapping_reply (xcb_connection_t *c /**< */,
10062 xcb_get_keyboard_mapping_cookie_t cookie /**< */,
10063 xcb_generic_error_t **e /**< */)
10065 return (xcb_get_keyboard_mapping_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
10069 xcb_change_keyboard_control_sizeof (const void *_buffer /**< */)
10071 char *xcb_tmp = (char *)_buffer;
10072 const xcb_change_keyboard_control_request_t *_aux = (xcb_change_keyboard_control_request_t *)_buffer;
10073 unsigned int xcb_buffer_len = 0;
10074 unsigned int xcb_block_len = 0;
10075 unsigned int xcb_pad = 0;
10076 unsigned int xcb_align_to = 0;
10079 xcb_block_len += sizeof(xcb_change_keyboard_control_request_t);
10080 xcb_tmp += xcb_block_len;
10081 xcb_buffer_len += xcb_block_len;
10082 xcb_block_len = 0;
10083 /* value_list */
10084 xcb_block_len += xcb_popcount(_aux->value_mask) * sizeof(uint32_t);
10085 xcb_tmp += xcb_block_len;
10086 xcb_align_to = ALIGNOF(uint32_t);
10087 /* insert padding */
10088 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
10089 xcb_buffer_len += xcb_block_len + xcb_pad;
10090 if (0 != xcb_pad) {
10091 xcb_tmp += xcb_pad;
10092 xcb_pad = 0;
10094 xcb_block_len = 0;
10096 return xcb_buffer_len;
10099 xcb_void_cookie_t
10100 xcb_change_keyboard_control_checked (xcb_connection_t *c /**< */,
10101 uint32_t value_mask /**< */,
10102 const uint32_t *value_list /**< */)
10104 static const xcb_protocol_request_t xcb_req = {
10105 /* count */ 4,
10106 /* ext */ 0,
10107 /* opcode */ XCB_CHANGE_KEYBOARD_CONTROL,
10108 /* isvoid */ 1
10111 struct iovec xcb_parts[6];
10112 xcb_void_cookie_t xcb_ret;
10113 xcb_change_keyboard_control_request_t xcb_out;
10115 xcb_out.pad0 = 0;
10116 xcb_out.value_mask = value_mask;
10118 xcb_parts[2].iov_base = (char *) &xcb_out;
10119 xcb_parts[2].iov_len = sizeof(xcb_out);
10120 xcb_parts[3].iov_base = 0;
10121 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
10122 /* uint32_t value_list */
10123 xcb_parts[4].iov_base = (char *) value_list;
10124 xcb_parts[4].iov_len = xcb_popcount(value_mask) * sizeof(uint32_t);
10125 xcb_parts[5].iov_base = 0;
10126 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
10128 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
10129 return xcb_ret;
10132 xcb_void_cookie_t
10133 xcb_change_keyboard_control (xcb_connection_t *c /**< */,
10134 uint32_t value_mask /**< */,
10135 const uint32_t *value_list /**< */)
10137 static const xcb_protocol_request_t xcb_req = {
10138 /* count */ 4,
10139 /* ext */ 0,
10140 /* opcode */ XCB_CHANGE_KEYBOARD_CONTROL,
10141 /* isvoid */ 1
10144 struct iovec xcb_parts[6];
10145 xcb_void_cookie_t xcb_ret;
10146 xcb_change_keyboard_control_request_t xcb_out;
10148 xcb_out.pad0 = 0;
10149 xcb_out.value_mask = value_mask;
10151 xcb_parts[2].iov_base = (char *) &xcb_out;
10152 xcb_parts[2].iov_len = sizeof(xcb_out);
10153 xcb_parts[3].iov_base = 0;
10154 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
10155 /* uint32_t value_list */
10156 xcb_parts[4].iov_base = (char *) value_list;
10157 xcb_parts[4].iov_len = xcb_popcount(value_mask) * sizeof(uint32_t);
10158 xcb_parts[5].iov_base = 0;
10159 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
10161 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
10162 return xcb_ret;
10165 xcb_get_keyboard_control_cookie_t
10166 xcb_get_keyboard_control (xcb_connection_t *c /**< */)
10168 static const xcb_protocol_request_t xcb_req = {
10169 /* count */ 2,
10170 /* ext */ 0,
10171 /* opcode */ XCB_GET_KEYBOARD_CONTROL,
10172 /* isvoid */ 0
10175 struct iovec xcb_parts[4];
10176 xcb_get_keyboard_control_cookie_t xcb_ret;
10177 xcb_get_keyboard_control_request_t xcb_out;
10179 xcb_out.pad0 = 0;
10181 xcb_parts[2].iov_base = (char *) &xcb_out;
10182 xcb_parts[2].iov_len = sizeof(xcb_out);
10183 xcb_parts[3].iov_base = 0;
10184 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
10186 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
10187 return xcb_ret;
10190 xcb_get_keyboard_control_cookie_t
10191 xcb_get_keyboard_control_unchecked (xcb_connection_t *c /**< */)
10193 static const xcb_protocol_request_t xcb_req = {
10194 /* count */ 2,
10195 /* ext */ 0,
10196 /* opcode */ XCB_GET_KEYBOARD_CONTROL,
10197 /* isvoid */ 0
10200 struct iovec xcb_parts[4];
10201 xcb_get_keyboard_control_cookie_t xcb_ret;
10202 xcb_get_keyboard_control_request_t xcb_out;
10204 xcb_out.pad0 = 0;
10206 xcb_parts[2].iov_base = (char *) &xcb_out;
10207 xcb_parts[2].iov_len = sizeof(xcb_out);
10208 xcb_parts[3].iov_base = 0;
10209 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
10211 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
10212 return xcb_ret;
10215 xcb_get_keyboard_control_reply_t *
10216 xcb_get_keyboard_control_reply (xcb_connection_t *c /**< */,
10217 xcb_get_keyboard_control_cookie_t cookie /**< */,
10218 xcb_generic_error_t **e /**< */)
10220 return (xcb_get_keyboard_control_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
10223 xcb_void_cookie_t
10224 xcb_bell_checked (xcb_connection_t *c /**< */,
10225 int8_t percent /**< */)
10227 static const xcb_protocol_request_t xcb_req = {
10228 /* count */ 2,
10229 /* ext */ 0,
10230 /* opcode */ XCB_BELL,
10231 /* isvoid */ 1
10234 struct iovec xcb_parts[4];
10235 xcb_void_cookie_t xcb_ret;
10236 xcb_bell_request_t xcb_out;
10238 xcb_out.percent = percent;
10240 xcb_parts[2].iov_base = (char *) &xcb_out;
10241 xcb_parts[2].iov_len = sizeof(xcb_out);
10242 xcb_parts[3].iov_base = 0;
10243 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
10245 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
10246 return xcb_ret;
10249 xcb_void_cookie_t
10250 xcb_bell (xcb_connection_t *c /**< */,
10251 int8_t percent /**< */)
10253 static const xcb_protocol_request_t xcb_req = {
10254 /* count */ 2,
10255 /* ext */ 0,
10256 /* opcode */ XCB_BELL,
10257 /* isvoid */ 1
10260 struct iovec xcb_parts[4];
10261 xcb_void_cookie_t xcb_ret;
10262 xcb_bell_request_t xcb_out;
10264 xcb_out.percent = percent;
10266 xcb_parts[2].iov_base = (char *) &xcb_out;
10267 xcb_parts[2].iov_len = sizeof(xcb_out);
10268 xcb_parts[3].iov_base = 0;
10269 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
10271 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
10272 return xcb_ret;
10275 xcb_void_cookie_t
10276 xcb_change_pointer_control_checked (xcb_connection_t *c /**< */,
10277 int16_t acceleration_numerator /**< */,
10278 int16_t acceleration_denominator /**< */,
10279 int16_t threshold /**< */,
10280 uint8_t do_acceleration /**< */,
10281 uint8_t do_threshold /**< */)
10283 static const xcb_protocol_request_t xcb_req = {
10284 /* count */ 2,
10285 /* ext */ 0,
10286 /* opcode */ XCB_CHANGE_POINTER_CONTROL,
10287 /* isvoid */ 1
10290 struct iovec xcb_parts[4];
10291 xcb_void_cookie_t xcb_ret;
10292 xcb_change_pointer_control_request_t xcb_out;
10294 xcb_out.pad0 = 0;
10295 xcb_out.acceleration_numerator = acceleration_numerator;
10296 xcb_out.acceleration_denominator = acceleration_denominator;
10297 xcb_out.threshold = threshold;
10298 xcb_out.do_acceleration = do_acceleration;
10299 xcb_out.do_threshold = do_threshold;
10301 xcb_parts[2].iov_base = (char *) &xcb_out;
10302 xcb_parts[2].iov_len = sizeof(xcb_out);
10303 xcb_parts[3].iov_base = 0;
10304 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
10306 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
10307 return xcb_ret;
10310 xcb_void_cookie_t
10311 xcb_change_pointer_control (xcb_connection_t *c /**< */,
10312 int16_t acceleration_numerator /**< */,
10313 int16_t acceleration_denominator /**< */,
10314 int16_t threshold /**< */,
10315 uint8_t do_acceleration /**< */,
10316 uint8_t do_threshold /**< */)
10318 static const xcb_protocol_request_t xcb_req = {
10319 /* count */ 2,
10320 /* ext */ 0,
10321 /* opcode */ XCB_CHANGE_POINTER_CONTROL,
10322 /* isvoid */ 1
10325 struct iovec xcb_parts[4];
10326 xcb_void_cookie_t xcb_ret;
10327 xcb_change_pointer_control_request_t xcb_out;
10329 xcb_out.pad0 = 0;
10330 xcb_out.acceleration_numerator = acceleration_numerator;
10331 xcb_out.acceleration_denominator = acceleration_denominator;
10332 xcb_out.threshold = threshold;
10333 xcb_out.do_acceleration = do_acceleration;
10334 xcb_out.do_threshold = do_threshold;
10336 xcb_parts[2].iov_base = (char *) &xcb_out;
10337 xcb_parts[2].iov_len = sizeof(xcb_out);
10338 xcb_parts[3].iov_base = 0;
10339 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
10341 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
10342 return xcb_ret;
10345 xcb_get_pointer_control_cookie_t
10346 xcb_get_pointer_control (xcb_connection_t *c /**< */)
10348 static const xcb_protocol_request_t xcb_req = {
10349 /* count */ 2,
10350 /* ext */ 0,
10351 /* opcode */ XCB_GET_POINTER_CONTROL,
10352 /* isvoid */ 0
10355 struct iovec xcb_parts[4];
10356 xcb_get_pointer_control_cookie_t xcb_ret;
10357 xcb_get_pointer_control_request_t xcb_out;
10359 xcb_out.pad0 = 0;
10361 xcb_parts[2].iov_base = (char *) &xcb_out;
10362 xcb_parts[2].iov_len = sizeof(xcb_out);
10363 xcb_parts[3].iov_base = 0;
10364 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
10366 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
10367 return xcb_ret;
10370 xcb_get_pointer_control_cookie_t
10371 xcb_get_pointer_control_unchecked (xcb_connection_t *c /**< */)
10373 static const xcb_protocol_request_t xcb_req = {
10374 /* count */ 2,
10375 /* ext */ 0,
10376 /* opcode */ XCB_GET_POINTER_CONTROL,
10377 /* isvoid */ 0
10380 struct iovec xcb_parts[4];
10381 xcb_get_pointer_control_cookie_t xcb_ret;
10382 xcb_get_pointer_control_request_t xcb_out;
10384 xcb_out.pad0 = 0;
10386 xcb_parts[2].iov_base = (char *) &xcb_out;
10387 xcb_parts[2].iov_len = sizeof(xcb_out);
10388 xcb_parts[3].iov_base = 0;
10389 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
10391 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
10392 return xcb_ret;
10395 xcb_get_pointer_control_reply_t *
10396 xcb_get_pointer_control_reply (xcb_connection_t *c /**< */,
10397 xcb_get_pointer_control_cookie_t cookie /**< */,
10398 xcb_generic_error_t **e /**< */)
10400 return (xcb_get_pointer_control_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
10403 xcb_void_cookie_t
10404 xcb_set_screen_saver_checked (xcb_connection_t *c /**< */,
10405 int16_t timeout /**< */,
10406 int16_t interval /**< */,
10407 uint8_t prefer_blanking /**< */,
10408 uint8_t allow_exposures /**< */)
10410 static const xcb_protocol_request_t xcb_req = {
10411 /* count */ 2,
10412 /* ext */ 0,
10413 /* opcode */ XCB_SET_SCREEN_SAVER,
10414 /* isvoid */ 1
10417 struct iovec xcb_parts[4];
10418 xcb_void_cookie_t xcb_ret;
10419 xcb_set_screen_saver_request_t xcb_out;
10421 xcb_out.pad0 = 0;
10422 xcb_out.timeout = timeout;
10423 xcb_out.interval = interval;
10424 xcb_out.prefer_blanking = prefer_blanking;
10425 xcb_out.allow_exposures = allow_exposures;
10427 xcb_parts[2].iov_base = (char *) &xcb_out;
10428 xcb_parts[2].iov_len = sizeof(xcb_out);
10429 xcb_parts[3].iov_base = 0;
10430 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
10432 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
10433 return xcb_ret;
10436 xcb_void_cookie_t
10437 xcb_set_screen_saver (xcb_connection_t *c /**< */,
10438 int16_t timeout /**< */,
10439 int16_t interval /**< */,
10440 uint8_t prefer_blanking /**< */,
10441 uint8_t allow_exposures /**< */)
10443 static const xcb_protocol_request_t xcb_req = {
10444 /* count */ 2,
10445 /* ext */ 0,
10446 /* opcode */ XCB_SET_SCREEN_SAVER,
10447 /* isvoid */ 1
10450 struct iovec xcb_parts[4];
10451 xcb_void_cookie_t xcb_ret;
10452 xcb_set_screen_saver_request_t xcb_out;
10454 xcb_out.pad0 = 0;
10455 xcb_out.timeout = timeout;
10456 xcb_out.interval = interval;
10457 xcb_out.prefer_blanking = prefer_blanking;
10458 xcb_out.allow_exposures = allow_exposures;
10460 xcb_parts[2].iov_base = (char *) &xcb_out;
10461 xcb_parts[2].iov_len = sizeof(xcb_out);
10462 xcb_parts[3].iov_base = 0;
10463 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
10465 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
10466 return xcb_ret;
10469 xcb_get_screen_saver_cookie_t
10470 xcb_get_screen_saver (xcb_connection_t *c /**< */)
10472 static const xcb_protocol_request_t xcb_req = {
10473 /* count */ 2,
10474 /* ext */ 0,
10475 /* opcode */ XCB_GET_SCREEN_SAVER,
10476 /* isvoid */ 0
10479 struct iovec xcb_parts[4];
10480 xcb_get_screen_saver_cookie_t xcb_ret;
10481 xcb_get_screen_saver_request_t xcb_out;
10483 xcb_out.pad0 = 0;
10485 xcb_parts[2].iov_base = (char *) &xcb_out;
10486 xcb_parts[2].iov_len = sizeof(xcb_out);
10487 xcb_parts[3].iov_base = 0;
10488 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
10490 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
10491 return xcb_ret;
10494 xcb_get_screen_saver_cookie_t
10495 xcb_get_screen_saver_unchecked (xcb_connection_t *c /**< */)
10497 static const xcb_protocol_request_t xcb_req = {
10498 /* count */ 2,
10499 /* ext */ 0,
10500 /* opcode */ XCB_GET_SCREEN_SAVER,
10501 /* isvoid */ 0
10504 struct iovec xcb_parts[4];
10505 xcb_get_screen_saver_cookie_t xcb_ret;
10506 xcb_get_screen_saver_request_t xcb_out;
10508 xcb_out.pad0 = 0;
10510 xcb_parts[2].iov_base = (char *) &xcb_out;
10511 xcb_parts[2].iov_len = sizeof(xcb_out);
10512 xcb_parts[3].iov_base = 0;
10513 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
10515 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
10516 return xcb_ret;
10519 xcb_get_screen_saver_reply_t *
10520 xcb_get_screen_saver_reply (xcb_connection_t *c /**< */,
10521 xcb_get_screen_saver_cookie_t cookie /**< */,
10522 xcb_generic_error_t **e /**< */)
10524 return (xcb_get_screen_saver_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
10528 xcb_change_hosts_sizeof (const void *_buffer /**< */)
10530 char *xcb_tmp = (char *)_buffer;
10531 const xcb_change_hosts_request_t *_aux = (xcb_change_hosts_request_t *)_buffer;
10532 unsigned int xcb_buffer_len = 0;
10533 unsigned int xcb_block_len = 0;
10534 unsigned int xcb_pad = 0;
10535 unsigned int xcb_align_to = 0;
10538 xcb_block_len += sizeof(xcb_change_hosts_request_t);
10539 xcb_tmp += xcb_block_len;
10540 xcb_buffer_len += xcb_block_len;
10541 xcb_block_len = 0;
10542 /* address */
10543 xcb_block_len += _aux->address_len * sizeof(uint8_t);
10544 xcb_tmp += xcb_block_len;
10545 xcb_align_to = ALIGNOF(uint8_t);
10546 /* insert padding */
10547 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
10548 xcb_buffer_len += xcb_block_len + xcb_pad;
10549 if (0 != xcb_pad) {
10550 xcb_tmp += xcb_pad;
10551 xcb_pad = 0;
10553 xcb_block_len = 0;
10555 return xcb_buffer_len;
10558 xcb_void_cookie_t
10559 xcb_change_hosts_checked (xcb_connection_t *c /**< */,
10560 uint8_t mode /**< */,
10561 uint8_t family /**< */,
10562 uint16_t address_len /**< */,
10563 const uint8_t *address /**< */)
10565 static const xcb_protocol_request_t xcb_req = {
10566 /* count */ 4,
10567 /* ext */ 0,
10568 /* opcode */ XCB_CHANGE_HOSTS,
10569 /* isvoid */ 1
10572 struct iovec xcb_parts[6];
10573 xcb_void_cookie_t xcb_ret;
10574 xcb_change_hosts_request_t xcb_out;
10576 xcb_out.mode = mode;
10577 xcb_out.family = family;
10578 xcb_out.pad0 = 0;
10579 xcb_out.address_len = address_len;
10581 xcb_parts[2].iov_base = (char *) &xcb_out;
10582 xcb_parts[2].iov_len = sizeof(xcb_out);
10583 xcb_parts[3].iov_base = 0;
10584 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
10585 /* uint8_t address */
10586 xcb_parts[4].iov_base = (char *) address;
10587 xcb_parts[4].iov_len = address_len * sizeof(uint8_t);
10588 xcb_parts[5].iov_base = 0;
10589 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
10591 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
10592 return xcb_ret;
10595 xcb_void_cookie_t
10596 xcb_change_hosts (xcb_connection_t *c /**< */,
10597 uint8_t mode /**< */,
10598 uint8_t family /**< */,
10599 uint16_t address_len /**< */,
10600 const uint8_t *address /**< */)
10602 static const xcb_protocol_request_t xcb_req = {
10603 /* count */ 4,
10604 /* ext */ 0,
10605 /* opcode */ XCB_CHANGE_HOSTS,
10606 /* isvoid */ 1
10609 struct iovec xcb_parts[6];
10610 xcb_void_cookie_t xcb_ret;
10611 xcb_change_hosts_request_t xcb_out;
10613 xcb_out.mode = mode;
10614 xcb_out.family = family;
10615 xcb_out.pad0 = 0;
10616 xcb_out.address_len = address_len;
10618 xcb_parts[2].iov_base = (char *) &xcb_out;
10619 xcb_parts[2].iov_len = sizeof(xcb_out);
10620 xcb_parts[3].iov_base = 0;
10621 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
10622 /* uint8_t address */
10623 xcb_parts[4].iov_base = (char *) address;
10624 xcb_parts[4].iov_len = address_len * sizeof(uint8_t);
10625 xcb_parts[5].iov_base = 0;
10626 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
10628 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
10629 return xcb_ret;
10633 xcb_host_sizeof (const void *_buffer /**< */)
10635 char *xcb_tmp = (char *)_buffer;
10636 const xcb_host_t *_aux = (xcb_host_t *)_buffer;
10637 unsigned int xcb_buffer_len = 0;
10638 unsigned int xcb_block_len = 0;
10639 unsigned int xcb_pad = 0;
10640 unsigned int xcb_align_to = 0;
10643 xcb_block_len += sizeof(xcb_host_t);
10644 xcb_tmp += xcb_block_len;
10645 xcb_buffer_len += xcb_block_len;
10646 xcb_block_len = 0;
10647 /* address */
10648 xcb_block_len += _aux->address_len * sizeof(uint8_t);
10649 xcb_tmp += xcb_block_len;
10650 xcb_align_to = ALIGNOF(uint8_t);
10651 /* insert padding */
10652 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
10653 xcb_buffer_len += xcb_block_len + xcb_pad;
10654 if (0 != xcb_pad) {
10655 xcb_tmp += xcb_pad;
10656 xcb_pad = 0;
10658 xcb_block_len = 0;
10660 return xcb_buffer_len;
10663 uint8_t *
10664 xcb_host_address (const xcb_host_t *R /**< */)
10666 return (uint8_t *) (R + 1);
10670 xcb_host_address_length (const xcb_host_t *R /**< */)
10672 return R->address_len;
10675 xcb_generic_iterator_t
10676 xcb_host_address_end (const xcb_host_t *R /**< */)
10678 xcb_generic_iterator_t i;
10679 i.data = ((uint8_t *) (R + 1)) + (R->address_len);
10680 i.rem = 0;
10681 i.index = (char *) i.data - (char *) R;
10682 return i;
10685 void
10686 xcb_host_next (xcb_host_iterator_t *i /**< */)
10688 xcb_host_t *R = i->data;
10689 xcb_generic_iterator_t child;
10690 child.data = (xcb_host_t *)(((char *)R) + xcb_host_sizeof(R));
10691 i->index = (char *) child.data - (char *) i->data;
10692 --i->rem;
10693 i->data = (xcb_host_t *) child.data;
10696 xcb_generic_iterator_t
10697 xcb_host_end (xcb_host_iterator_t i /**< */)
10699 xcb_generic_iterator_t ret;
10700 while(i.rem > 0)
10701 xcb_host_next(&i);
10702 ret.data = i.data;
10703 ret.rem = i.rem;
10704 ret.index = i.index;
10705 return ret;
10709 xcb_list_hosts_sizeof (const void *_buffer /**< */)
10711 char *xcb_tmp = (char *)_buffer;
10712 const xcb_list_hosts_reply_t *_aux = (xcb_list_hosts_reply_t *)_buffer;
10713 unsigned int xcb_buffer_len = 0;
10714 unsigned int xcb_block_len = 0;
10715 unsigned int xcb_pad = 0;
10716 unsigned int xcb_align_to = 0;
10718 unsigned int i;
10719 unsigned int xcb_tmp_len;
10721 xcb_block_len += sizeof(xcb_list_hosts_reply_t);
10722 xcb_tmp += xcb_block_len;
10723 xcb_buffer_len += xcb_block_len;
10724 xcb_block_len = 0;
10725 /* hosts */
10726 for(i=0; i<_aux->hosts_len; i++) {
10727 xcb_tmp_len = xcb_host_sizeof(xcb_tmp);
10728 xcb_block_len += xcb_tmp_len;
10729 xcb_tmp += xcb_tmp_len;
10731 xcb_align_to = ALIGNOF(xcb_host_t);
10732 /* insert padding */
10733 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
10734 xcb_buffer_len += xcb_block_len + xcb_pad;
10735 if (0 != xcb_pad) {
10736 xcb_tmp += xcb_pad;
10737 xcb_pad = 0;
10739 xcb_block_len = 0;
10741 return xcb_buffer_len;
10744 xcb_list_hosts_cookie_t
10745 xcb_list_hosts (xcb_connection_t *c /**< */)
10747 static const xcb_protocol_request_t xcb_req = {
10748 /* count */ 2,
10749 /* ext */ 0,
10750 /* opcode */ XCB_LIST_HOSTS,
10751 /* isvoid */ 0
10754 struct iovec xcb_parts[4];
10755 xcb_list_hosts_cookie_t xcb_ret;
10756 xcb_list_hosts_request_t xcb_out;
10758 xcb_out.pad0 = 0;
10760 xcb_parts[2].iov_base = (char *) &xcb_out;
10761 xcb_parts[2].iov_len = sizeof(xcb_out);
10762 xcb_parts[3].iov_base = 0;
10763 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
10765 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
10766 return xcb_ret;
10769 xcb_list_hosts_cookie_t
10770 xcb_list_hosts_unchecked (xcb_connection_t *c /**< */)
10772 static const xcb_protocol_request_t xcb_req = {
10773 /* count */ 2,
10774 /* ext */ 0,
10775 /* opcode */ XCB_LIST_HOSTS,
10776 /* isvoid */ 0
10779 struct iovec xcb_parts[4];
10780 xcb_list_hosts_cookie_t xcb_ret;
10781 xcb_list_hosts_request_t xcb_out;
10783 xcb_out.pad0 = 0;
10785 xcb_parts[2].iov_base = (char *) &xcb_out;
10786 xcb_parts[2].iov_len = sizeof(xcb_out);
10787 xcb_parts[3].iov_base = 0;
10788 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
10790 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
10791 return xcb_ret;
10795 xcb_list_hosts_hosts_length (const xcb_list_hosts_reply_t *R /**< */)
10797 return R->hosts_len;
10800 xcb_host_iterator_t
10801 xcb_list_hosts_hosts_iterator (const xcb_list_hosts_reply_t *R /**< */)
10803 xcb_host_iterator_t i;
10804 i.data = (xcb_host_t *) (R + 1);
10805 i.rem = R->hosts_len;
10806 i.index = (char *) i.data - (char *) R;
10807 return i;
10810 xcb_list_hosts_reply_t *
10811 xcb_list_hosts_reply (xcb_connection_t *c /**< */,
10812 xcb_list_hosts_cookie_t cookie /**< */,
10813 xcb_generic_error_t **e /**< */)
10815 return (xcb_list_hosts_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
10818 xcb_void_cookie_t
10819 xcb_set_access_control_checked (xcb_connection_t *c /**< */,
10820 uint8_t mode /**< */)
10822 static const xcb_protocol_request_t xcb_req = {
10823 /* count */ 2,
10824 /* ext */ 0,
10825 /* opcode */ XCB_SET_ACCESS_CONTROL,
10826 /* isvoid */ 1
10829 struct iovec xcb_parts[4];
10830 xcb_void_cookie_t xcb_ret;
10831 xcb_set_access_control_request_t xcb_out;
10833 xcb_out.mode = mode;
10835 xcb_parts[2].iov_base = (char *) &xcb_out;
10836 xcb_parts[2].iov_len = sizeof(xcb_out);
10837 xcb_parts[3].iov_base = 0;
10838 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
10840 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
10841 return xcb_ret;
10844 xcb_void_cookie_t
10845 xcb_set_access_control (xcb_connection_t *c /**< */,
10846 uint8_t mode /**< */)
10848 static const xcb_protocol_request_t xcb_req = {
10849 /* count */ 2,
10850 /* ext */ 0,
10851 /* opcode */ XCB_SET_ACCESS_CONTROL,
10852 /* isvoid */ 1
10855 struct iovec xcb_parts[4];
10856 xcb_void_cookie_t xcb_ret;
10857 xcb_set_access_control_request_t xcb_out;
10859 xcb_out.mode = mode;
10861 xcb_parts[2].iov_base = (char *) &xcb_out;
10862 xcb_parts[2].iov_len = sizeof(xcb_out);
10863 xcb_parts[3].iov_base = 0;
10864 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
10866 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
10867 return xcb_ret;
10870 xcb_void_cookie_t
10871 xcb_set_close_down_mode_checked (xcb_connection_t *c /**< */,
10872 uint8_t mode /**< */)
10874 static const xcb_protocol_request_t xcb_req = {
10875 /* count */ 2,
10876 /* ext */ 0,
10877 /* opcode */ XCB_SET_CLOSE_DOWN_MODE,
10878 /* isvoid */ 1
10881 struct iovec xcb_parts[4];
10882 xcb_void_cookie_t xcb_ret;
10883 xcb_set_close_down_mode_request_t xcb_out;
10885 xcb_out.mode = mode;
10887 xcb_parts[2].iov_base = (char *) &xcb_out;
10888 xcb_parts[2].iov_len = sizeof(xcb_out);
10889 xcb_parts[3].iov_base = 0;
10890 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
10892 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
10893 return xcb_ret;
10896 xcb_void_cookie_t
10897 xcb_set_close_down_mode (xcb_connection_t *c /**< */,
10898 uint8_t mode /**< */)
10900 static const xcb_protocol_request_t xcb_req = {
10901 /* count */ 2,
10902 /* ext */ 0,
10903 /* opcode */ XCB_SET_CLOSE_DOWN_MODE,
10904 /* isvoid */ 1
10907 struct iovec xcb_parts[4];
10908 xcb_void_cookie_t xcb_ret;
10909 xcb_set_close_down_mode_request_t xcb_out;
10911 xcb_out.mode = mode;
10913 xcb_parts[2].iov_base = (char *) &xcb_out;
10914 xcb_parts[2].iov_len = sizeof(xcb_out);
10915 xcb_parts[3].iov_base = 0;
10916 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
10918 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
10919 return xcb_ret;
10922 xcb_void_cookie_t
10923 xcb_kill_client_checked (xcb_connection_t *c /**< */,
10924 uint32_t resource /**< */)
10926 static const xcb_protocol_request_t xcb_req = {
10927 /* count */ 2,
10928 /* ext */ 0,
10929 /* opcode */ XCB_KILL_CLIENT,
10930 /* isvoid */ 1
10933 struct iovec xcb_parts[4];
10934 xcb_void_cookie_t xcb_ret;
10935 xcb_kill_client_request_t xcb_out;
10937 xcb_out.pad0 = 0;
10938 xcb_out.resource = resource;
10940 xcb_parts[2].iov_base = (char *) &xcb_out;
10941 xcb_parts[2].iov_len = sizeof(xcb_out);
10942 xcb_parts[3].iov_base = 0;
10943 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
10945 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
10946 return xcb_ret;
10949 xcb_void_cookie_t
10950 xcb_kill_client (xcb_connection_t *c /**< */,
10951 uint32_t resource /**< */)
10953 static const xcb_protocol_request_t xcb_req = {
10954 /* count */ 2,
10955 /* ext */ 0,
10956 /* opcode */ XCB_KILL_CLIENT,
10957 /* isvoid */ 1
10960 struct iovec xcb_parts[4];
10961 xcb_void_cookie_t xcb_ret;
10962 xcb_kill_client_request_t xcb_out;
10964 xcb_out.pad0 = 0;
10965 xcb_out.resource = resource;
10967 xcb_parts[2].iov_base = (char *) &xcb_out;
10968 xcb_parts[2].iov_len = sizeof(xcb_out);
10969 xcb_parts[3].iov_base = 0;
10970 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
10972 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
10973 return xcb_ret;
10977 xcb_rotate_properties_sizeof (const void *_buffer /**< */)
10979 char *xcb_tmp = (char *)_buffer;
10980 const xcb_rotate_properties_request_t *_aux = (xcb_rotate_properties_request_t *)_buffer;
10981 unsigned int xcb_buffer_len = 0;
10982 unsigned int xcb_block_len = 0;
10983 unsigned int xcb_pad = 0;
10984 unsigned int xcb_align_to = 0;
10987 xcb_block_len += sizeof(xcb_rotate_properties_request_t);
10988 xcb_tmp += xcb_block_len;
10989 xcb_buffer_len += xcb_block_len;
10990 xcb_block_len = 0;
10991 /* atoms */
10992 xcb_block_len += _aux->atoms_len * sizeof(xcb_atom_t);
10993 xcb_tmp += xcb_block_len;
10994 xcb_align_to = ALIGNOF(xcb_atom_t);
10995 /* insert padding */
10996 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
10997 xcb_buffer_len += xcb_block_len + xcb_pad;
10998 if (0 != xcb_pad) {
10999 xcb_tmp += xcb_pad;
11000 xcb_pad = 0;
11002 xcb_block_len = 0;
11004 return xcb_buffer_len;
11007 xcb_void_cookie_t
11008 xcb_rotate_properties_checked (xcb_connection_t *c /**< */,
11009 xcb_window_t window /**< */,
11010 uint16_t atoms_len /**< */,
11011 int16_t delta /**< */,
11012 const xcb_atom_t *atoms /**< */)
11014 static const xcb_protocol_request_t xcb_req = {
11015 /* count */ 4,
11016 /* ext */ 0,
11017 /* opcode */ XCB_ROTATE_PROPERTIES,
11018 /* isvoid */ 1
11021 struct iovec xcb_parts[6];
11022 xcb_void_cookie_t xcb_ret;
11023 xcb_rotate_properties_request_t xcb_out;
11025 xcb_out.pad0 = 0;
11026 xcb_out.window = window;
11027 xcb_out.atoms_len = atoms_len;
11028 xcb_out.delta = delta;
11030 xcb_parts[2].iov_base = (char *) &xcb_out;
11031 xcb_parts[2].iov_len = sizeof(xcb_out);
11032 xcb_parts[3].iov_base = 0;
11033 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
11034 /* xcb_atom_t atoms */
11035 xcb_parts[4].iov_base = (char *) atoms;
11036 xcb_parts[4].iov_len = atoms_len * sizeof(xcb_atom_t);
11037 xcb_parts[5].iov_base = 0;
11038 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
11040 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
11041 return xcb_ret;
11044 xcb_void_cookie_t
11045 xcb_rotate_properties (xcb_connection_t *c /**< */,
11046 xcb_window_t window /**< */,
11047 uint16_t atoms_len /**< */,
11048 int16_t delta /**< */,
11049 const xcb_atom_t *atoms /**< */)
11051 static const xcb_protocol_request_t xcb_req = {
11052 /* count */ 4,
11053 /* ext */ 0,
11054 /* opcode */ XCB_ROTATE_PROPERTIES,
11055 /* isvoid */ 1
11058 struct iovec xcb_parts[6];
11059 xcb_void_cookie_t xcb_ret;
11060 xcb_rotate_properties_request_t xcb_out;
11062 xcb_out.pad0 = 0;
11063 xcb_out.window = window;
11064 xcb_out.atoms_len = atoms_len;
11065 xcb_out.delta = delta;
11067 xcb_parts[2].iov_base = (char *) &xcb_out;
11068 xcb_parts[2].iov_len = sizeof(xcb_out);
11069 xcb_parts[3].iov_base = 0;
11070 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
11071 /* xcb_atom_t atoms */
11072 xcb_parts[4].iov_base = (char *) atoms;
11073 xcb_parts[4].iov_len = atoms_len * sizeof(xcb_atom_t);
11074 xcb_parts[5].iov_base = 0;
11075 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
11077 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
11078 return xcb_ret;
11081 xcb_void_cookie_t
11082 xcb_force_screen_saver_checked (xcb_connection_t *c /**< */,
11083 uint8_t mode /**< */)
11085 static const xcb_protocol_request_t xcb_req = {
11086 /* count */ 2,
11087 /* ext */ 0,
11088 /* opcode */ XCB_FORCE_SCREEN_SAVER,
11089 /* isvoid */ 1
11092 struct iovec xcb_parts[4];
11093 xcb_void_cookie_t xcb_ret;
11094 xcb_force_screen_saver_request_t xcb_out;
11096 xcb_out.mode = mode;
11098 xcb_parts[2].iov_base = (char *) &xcb_out;
11099 xcb_parts[2].iov_len = sizeof(xcb_out);
11100 xcb_parts[3].iov_base = 0;
11101 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
11103 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
11104 return xcb_ret;
11107 xcb_void_cookie_t
11108 xcb_force_screen_saver (xcb_connection_t *c /**< */,
11109 uint8_t mode /**< */)
11111 static const xcb_protocol_request_t xcb_req = {
11112 /* count */ 2,
11113 /* ext */ 0,
11114 /* opcode */ XCB_FORCE_SCREEN_SAVER,
11115 /* isvoid */ 1
11118 struct iovec xcb_parts[4];
11119 xcb_void_cookie_t xcb_ret;
11120 xcb_force_screen_saver_request_t xcb_out;
11122 xcb_out.mode = mode;
11124 xcb_parts[2].iov_base = (char *) &xcb_out;
11125 xcb_parts[2].iov_len = sizeof(xcb_out);
11126 xcb_parts[3].iov_base = 0;
11127 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
11129 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
11130 return xcb_ret;
11134 xcb_set_pointer_mapping_sizeof (const void *_buffer /**< */)
11136 char *xcb_tmp = (char *)_buffer;
11137 const xcb_set_pointer_mapping_request_t *_aux = (xcb_set_pointer_mapping_request_t *)_buffer;
11138 unsigned int xcb_buffer_len = 0;
11139 unsigned int xcb_block_len = 0;
11140 unsigned int xcb_pad = 0;
11141 unsigned int xcb_align_to = 0;
11144 xcb_block_len += sizeof(xcb_set_pointer_mapping_request_t);
11145 xcb_tmp += xcb_block_len;
11146 xcb_buffer_len += xcb_block_len;
11147 xcb_block_len = 0;
11148 /* map */
11149 xcb_block_len += _aux->map_len * sizeof(uint8_t);
11150 xcb_tmp += xcb_block_len;
11151 xcb_align_to = ALIGNOF(uint8_t);
11152 /* insert padding */
11153 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
11154 xcb_buffer_len += xcb_block_len + xcb_pad;
11155 if (0 != xcb_pad) {
11156 xcb_tmp += xcb_pad;
11157 xcb_pad = 0;
11159 xcb_block_len = 0;
11161 return xcb_buffer_len;
11164 xcb_set_pointer_mapping_cookie_t
11165 xcb_set_pointer_mapping (xcb_connection_t *c /**< */,
11166 uint8_t map_len /**< */,
11167 const uint8_t *map /**< */)
11169 static const xcb_protocol_request_t xcb_req = {
11170 /* count */ 4,
11171 /* ext */ 0,
11172 /* opcode */ XCB_SET_POINTER_MAPPING,
11173 /* isvoid */ 0
11176 struct iovec xcb_parts[6];
11177 xcb_set_pointer_mapping_cookie_t xcb_ret;
11178 xcb_set_pointer_mapping_request_t xcb_out;
11180 xcb_out.map_len = map_len;
11182 xcb_parts[2].iov_base = (char *) &xcb_out;
11183 xcb_parts[2].iov_len = sizeof(xcb_out);
11184 xcb_parts[3].iov_base = 0;
11185 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
11186 /* uint8_t map */
11187 xcb_parts[4].iov_base = (char *) map;
11188 xcb_parts[4].iov_len = map_len * sizeof(uint8_t);
11189 xcb_parts[5].iov_base = 0;
11190 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
11192 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
11193 return xcb_ret;
11196 xcb_set_pointer_mapping_cookie_t
11197 xcb_set_pointer_mapping_unchecked (xcb_connection_t *c /**< */,
11198 uint8_t map_len /**< */,
11199 const uint8_t *map /**< */)
11201 static const xcb_protocol_request_t xcb_req = {
11202 /* count */ 4,
11203 /* ext */ 0,
11204 /* opcode */ XCB_SET_POINTER_MAPPING,
11205 /* isvoid */ 0
11208 struct iovec xcb_parts[6];
11209 xcb_set_pointer_mapping_cookie_t xcb_ret;
11210 xcb_set_pointer_mapping_request_t xcb_out;
11212 xcb_out.map_len = map_len;
11214 xcb_parts[2].iov_base = (char *) &xcb_out;
11215 xcb_parts[2].iov_len = sizeof(xcb_out);
11216 xcb_parts[3].iov_base = 0;
11217 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
11218 /* uint8_t map */
11219 xcb_parts[4].iov_base = (char *) map;
11220 xcb_parts[4].iov_len = map_len * sizeof(uint8_t);
11221 xcb_parts[5].iov_base = 0;
11222 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
11224 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
11225 return xcb_ret;
11228 xcb_set_pointer_mapping_reply_t *
11229 xcb_set_pointer_mapping_reply (xcb_connection_t *c /**< */,
11230 xcb_set_pointer_mapping_cookie_t cookie /**< */,
11231 xcb_generic_error_t **e /**< */)
11233 return (xcb_set_pointer_mapping_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
11237 xcb_get_pointer_mapping_sizeof (const void *_buffer /**< */)
11239 char *xcb_tmp = (char *)_buffer;
11240 const xcb_get_pointer_mapping_reply_t *_aux = (xcb_get_pointer_mapping_reply_t *)_buffer;
11241 unsigned int xcb_buffer_len = 0;
11242 unsigned int xcb_block_len = 0;
11243 unsigned int xcb_pad = 0;
11244 unsigned int xcb_align_to = 0;
11247 xcb_block_len += sizeof(xcb_get_pointer_mapping_reply_t);
11248 xcb_tmp += xcb_block_len;
11249 xcb_buffer_len += xcb_block_len;
11250 xcb_block_len = 0;
11251 /* map */
11252 xcb_block_len += _aux->map_len * sizeof(uint8_t);
11253 xcb_tmp += xcb_block_len;
11254 xcb_align_to = ALIGNOF(uint8_t);
11255 /* insert padding */
11256 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
11257 xcb_buffer_len += xcb_block_len + xcb_pad;
11258 if (0 != xcb_pad) {
11259 xcb_tmp += xcb_pad;
11260 xcb_pad = 0;
11262 xcb_block_len = 0;
11264 return xcb_buffer_len;
11267 xcb_get_pointer_mapping_cookie_t
11268 xcb_get_pointer_mapping (xcb_connection_t *c /**< */)
11270 static const xcb_protocol_request_t xcb_req = {
11271 /* count */ 2,
11272 /* ext */ 0,
11273 /* opcode */ XCB_GET_POINTER_MAPPING,
11274 /* isvoid */ 0
11277 struct iovec xcb_parts[4];
11278 xcb_get_pointer_mapping_cookie_t xcb_ret;
11279 xcb_get_pointer_mapping_request_t xcb_out;
11281 xcb_out.pad0 = 0;
11283 xcb_parts[2].iov_base = (char *) &xcb_out;
11284 xcb_parts[2].iov_len = sizeof(xcb_out);
11285 xcb_parts[3].iov_base = 0;
11286 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
11288 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
11289 return xcb_ret;
11292 xcb_get_pointer_mapping_cookie_t
11293 xcb_get_pointer_mapping_unchecked (xcb_connection_t *c /**< */)
11295 static const xcb_protocol_request_t xcb_req = {
11296 /* count */ 2,
11297 /* ext */ 0,
11298 /* opcode */ XCB_GET_POINTER_MAPPING,
11299 /* isvoid */ 0
11302 struct iovec xcb_parts[4];
11303 xcb_get_pointer_mapping_cookie_t xcb_ret;
11304 xcb_get_pointer_mapping_request_t xcb_out;
11306 xcb_out.pad0 = 0;
11308 xcb_parts[2].iov_base = (char *) &xcb_out;
11309 xcb_parts[2].iov_len = sizeof(xcb_out);
11310 xcb_parts[3].iov_base = 0;
11311 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
11313 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
11314 return xcb_ret;
11317 uint8_t *
11318 xcb_get_pointer_mapping_map (const xcb_get_pointer_mapping_reply_t *R /**< */)
11320 return (uint8_t *) (R + 1);
11324 xcb_get_pointer_mapping_map_length (const xcb_get_pointer_mapping_reply_t *R /**< */)
11326 return R->map_len;
11329 xcb_generic_iterator_t
11330 xcb_get_pointer_mapping_map_end (const xcb_get_pointer_mapping_reply_t *R /**< */)
11332 xcb_generic_iterator_t i;
11333 i.data = ((uint8_t *) (R + 1)) + (R->map_len);
11334 i.rem = 0;
11335 i.index = (char *) i.data - (char *) R;
11336 return i;
11339 xcb_get_pointer_mapping_reply_t *
11340 xcb_get_pointer_mapping_reply (xcb_connection_t *c /**< */,
11341 xcb_get_pointer_mapping_cookie_t cookie /**< */,
11342 xcb_generic_error_t **e /**< */)
11344 return (xcb_get_pointer_mapping_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
11348 xcb_set_modifier_mapping_sizeof (const void *_buffer /**< */)
11350 char *xcb_tmp = (char *)_buffer;
11351 const xcb_set_modifier_mapping_request_t *_aux = (xcb_set_modifier_mapping_request_t *)_buffer;
11352 unsigned int xcb_buffer_len = 0;
11353 unsigned int xcb_block_len = 0;
11354 unsigned int xcb_pad = 0;
11355 unsigned int xcb_align_to = 0;
11358 xcb_block_len += sizeof(xcb_set_modifier_mapping_request_t);
11359 xcb_tmp += xcb_block_len;
11360 xcb_buffer_len += xcb_block_len;
11361 xcb_block_len = 0;
11362 /* keycodes */
11363 xcb_block_len += (_aux->keycodes_per_modifier * 8) * sizeof(xcb_keycode_t);
11364 xcb_tmp += xcb_block_len;
11365 xcb_align_to = ALIGNOF(xcb_keycode_t);
11366 /* insert padding */
11367 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
11368 xcb_buffer_len += xcb_block_len + xcb_pad;
11369 if (0 != xcb_pad) {
11370 xcb_tmp += xcb_pad;
11371 xcb_pad = 0;
11373 xcb_block_len = 0;
11375 return xcb_buffer_len;
11378 xcb_set_modifier_mapping_cookie_t
11379 xcb_set_modifier_mapping (xcb_connection_t *c /**< */,
11380 uint8_t keycodes_per_modifier /**< */,
11381 const xcb_keycode_t *keycodes /**< */)
11383 static const xcb_protocol_request_t xcb_req = {
11384 /* count */ 4,
11385 /* ext */ 0,
11386 /* opcode */ XCB_SET_MODIFIER_MAPPING,
11387 /* isvoid */ 0
11390 struct iovec xcb_parts[6];
11391 xcb_set_modifier_mapping_cookie_t xcb_ret;
11392 xcb_set_modifier_mapping_request_t xcb_out;
11394 xcb_out.keycodes_per_modifier = keycodes_per_modifier;
11396 xcb_parts[2].iov_base = (char *) &xcb_out;
11397 xcb_parts[2].iov_len = sizeof(xcb_out);
11398 xcb_parts[3].iov_base = 0;
11399 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
11400 /* xcb_keycode_t keycodes */
11401 xcb_parts[4].iov_base = (char *) keycodes;
11402 xcb_parts[4].iov_len = (keycodes_per_modifier * 8) * sizeof(uint8_t);
11403 xcb_parts[5].iov_base = 0;
11404 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
11406 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
11407 return xcb_ret;
11410 xcb_set_modifier_mapping_cookie_t
11411 xcb_set_modifier_mapping_unchecked (xcb_connection_t *c /**< */,
11412 uint8_t keycodes_per_modifier /**< */,
11413 const xcb_keycode_t *keycodes /**< */)
11415 static const xcb_protocol_request_t xcb_req = {
11416 /* count */ 4,
11417 /* ext */ 0,
11418 /* opcode */ XCB_SET_MODIFIER_MAPPING,
11419 /* isvoid */ 0
11422 struct iovec xcb_parts[6];
11423 xcb_set_modifier_mapping_cookie_t xcb_ret;
11424 xcb_set_modifier_mapping_request_t xcb_out;
11426 xcb_out.keycodes_per_modifier = keycodes_per_modifier;
11428 xcb_parts[2].iov_base = (char *) &xcb_out;
11429 xcb_parts[2].iov_len = sizeof(xcb_out);
11430 xcb_parts[3].iov_base = 0;
11431 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
11432 /* xcb_keycode_t keycodes */
11433 xcb_parts[4].iov_base = (char *) keycodes;
11434 xcb_parts[4].iov_len = (keycodes_per_modifier * 8) * sizeof(uint8_t);
11435 xcb_parts[5].iov_base = 0;
11436 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
11438 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
11439 return xcb_ret;
11442 xcb_set_modifier_mapping_reply_t *
11443 xcb_set_modifier_mapping_reply (xcb_connection_t *c /**< */,
11444 xcb_set_modifier_mapping_cookie_t cookie /**< */,
11445 xcb_generic_error_t **e /**< */)
11447 return (xcb_set_modifier_mapping_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
11451 xcb_get_modifier_mapping_sizeof (const void *_buffer /**< */)
11453 char *xcb_tmp = (char *)_buffer;
11454 const xcb_get_modifier_mapping_reply_t *_aux = (xcb_get_modifier_mapping_reply_t *)_buffer;
11455 unsigned int xcb_buffer_len = 0;
11456 unsigned int xcb_block_len = 0;
11457 unsigned int xcb_pad = 0;
11458 unsigned int xcb_align_to = 0;
11461 xcb_block_len += sizeof(xcb_get_modifier_mapping_reply_t);
11462 xcb_tmp += xcb_block_len;
11463 xcb_buffer_len += xcb_block_len;
11464 xcb_block_len = 0;
11465 /* keycodes */
11466 xcb_block_len += (_aux->keycodes_per_modifier * 8) * sizeof(xcb_keycode_t);
11467 xcb_tmp += xcb_block_len;
11468 xcb_align_to = ALIGNOF(xcb_keycode_t);
11469 /* insert padding */
11470 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
11471 xcb_buffer_len += xcb_block_len + xcb_pad;
11472 if (0 != xcb_pad) {
11473 xcb_tmp += xcb_pad;
11474 xcb_pad = 0;
11476 xcb_block_len = 0;
11478 return xcb_buffer_len;
11481 xcb_get_modifier_mapping_cookie_t
11482 xcb_get_modifier_mapping (xcb_connection_t *c /**< */)
11484 static const xcb_protocol_request_t xcb_req = {
11485 /* count */ 2,
11486 /* ext */ 0,
11487 /* opcode */ XCB_GET_MODIFIER_MAPPING,
11488 /* isvoid */ 0
11491 struct iovec xcb_parts[4];
11492 xcb_get_modifier_mapping_cookie_t xcb_ret;
11493 xcb_get_modifier_mapping_request_t xcb_out;
11495 xcb_out.pad0 = 0;
11497 xcb_parts[2].iov_base = (char *) &xcb_out;
11498 xcb_parts[2].iov_len = sizeof(xcb_out);
11499 xcb_parts[3].iov_base = 0;
11500 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
11502 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
11503 return xcb_ret;
11506 xcb_get_modifier_mapping_cookie_t
11507 xcb_get_modifier_mapping_unchecked (xcb_connection_t *c /**< */)
11509 static const xcb_protocol_request_t xcb_req = {
11510 /* count */ 2,
11511 /* ext */ 0,
11512 /* opcode */ XCB_GET_MODIFIER_MAPPING,
11513 /* isvoid */ 0
11516 struct iovec xcb_parts[4];
11517 xcb_get_modifier_mapping_cookie_t xcb_ret;
11518 xcb_get_modifier_mapping_request_t xcb_out;
11520 xcb_out.pad0 = 0;
11522 xcb_parts[2].iov_base = (char *) &xcb_out;
11523 xcb_parts[2].iov_len = sizeof(xcb_out);
11524 xcb_parts[3].iov_base = 0;
11525 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
11527 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
11528 return xcb_ret;
11531 xcb_keycode_t *
11532 xcb_get_modifier_mapping_keycodes (const xcb_get_modifier_mapping_reply_t *R /**< */)
11534 return (xcb_keycode_t *) (R + 1);
11538 xcb_get_modifier_mapping_keycodes_length (const xcb_get_modifier_mapping_reply_t *R /**< */)
11540 return (R->keycodes_per_modifier * 8);
11543 xcb_generic_iterator_t
11544 xcb_get_modifier_mapping_keycodes_end (const xcb_get_modifier_mapping_reply_t *R /**< */)
11546 xcb_generic_iterator_t i;
11547 i.data = ((xcb_keycode_t *) (R + 1)) + ((R->keycodes_per_modifier * 8));
11548 i.rem = 0;
11549 i.index = (char *) i.data - (char *) R;
11550 return i;
11553 xcb_get_modifier_mapping_reply_t *
11554 xcb_get_modifier_mapping_reply (xcb_connection_t *c /**< */,
11555 xcb_get_modifier_mapping_cookie_t cookie /**< */,
11556 xcb_generic_error_t **e /**< */)
11558 return (xcb_get_modifier_mapping_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
11561 xcb_void_cookie_t
11562 xcb_no_operation_checked (xcb_connection_t *c /**< */)
11564 static const xcb_protocol_request_t xcb_req = {
11565 /* count */ 2,
11566 /* ext */ 0,
11567 /* opcode */ XCB_NO_OPERATION,
11568 /* isvoid */ 1
11571 struct iovec xcb_parts[4];
11572 xcb_void_cookie_t xcb_ret;
11573 xcb_no_operation_request_t xcb_out;
11575 xcb_out.pad0 = 0;
11577 xcb_parts[2].iov_base = (char *) &xcb_out;
11578 xcb_parts[2].iov_len = sizeof(xcb_out);
11579 xcb_parts[3].iov_base = 0;
11580 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
11582 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
11583 return xcb_ret;
11586 xcb_void_cookie_t
11587 xcb_no_operation (xcb_connection_t *c /**< */)
11589 static const xcb_protocol_request_t xcb_req = {
11590 /* count */ 2,
11591 /* ext */ 0,
11592 /* opcode */ XCB_NO_OPERATION,
11593 /* isvoid */ 1
11596 struct iovec xcb_parts[4];
11597 xcb_void_cookie_t xcb_ret;
11598 xcb_no_operation_request_t xcb_out;
11600 xcb_out.pad0 = 0;
11602 xcb_parts[2].iov_base = (char *) &xcb_out;
11603 xcb_parts[2].iov_len = sizeof(xcb_out);
11604 xcb_parts[3].iov_base = 0;
11605 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
11607 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
11608 return xcb_ret;