etc/protocols - sync with NetBSD-8
[minix.git] / external / mit / xorg / lib / libxcb / files / shape.c
blob3a4428ffcac21da68e6b6870f2421deb008e43ef
1 /*
2 * This file generated automatically from shape.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 "shape.h"
16 #define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member)
17 #include "xproto.h"
19 xcb_extension_t xcb_shape_id = { "SHAPE", 0 };
21 void
22 xcb_shape_op_next (xcb_shape_op_iterator_t *i /**< */)
24 --i->rem;
25 ++i->data;
26 i->index += sizeof(xcb_shape_op_t);
29 xcb_generic_iterator_t
30 xcb_shape_op_end (xcb_shape_op_iterator_t i /**< */)
32 xcb_generic_iterator_t ret;
33 ret.data = i.data + i.rem;
34 ret.index = i.index + ((char *) ret.data - (char *) i.data);
35 ret.rem = 0;
36 return ret;
39 void
40 xcb_shape_kind_next (xcb_shape_kind_iterator_t *i /**< */)
42 --i->rem;
43 ++i->data;
44 i->index += sizeof(xcb_shape_kind_t);
47 xcb_generic_iterator_t
48 xcb_shape_kind_end (xcb_shape_kind_iterator_t i /**< */)
50 xcb_generic_iterator_t ret;
51 ret.data = i.data + i.rem;
52 ret.index = i.index + ((char *) ret.data - (char *) i.data);
53 ret.rem = 0;
54 return ret;
57 xcb_shape_query_version_cookie_t
58 xcb_shape_query_version (xcb_connection_t *c /**< */)
60 static const xcb_protocol_request_t xcb_req = {
61 /* count */ 2,
62 /* ext */ &xcb_shape_id,
63 /* opcode */ XCB_SHAPE_QUERY_VERSION,
64 /* isvoid */ 0
67 struct iovec xcb_parts[4];
68 xcb_shape_query_version_cookie_t xcb_ret;
69 xcb_shape_query_version_request_t xcb_out;
72 xcb_parts[2].iov_base = (char *) &xcb_out;
73 xcb_parts[2].iov_len = sizeof(xcb_out);
74 xcb_parts[3].iov_base = 0;
75 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
77 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
78 return xcb_ret;
81 xcb_shape_query_version_cookie_t
82 xcb_shape_query_version_unchecked (xcb_connection_t *c /**< */)
84 static const xcb_protocol_request_t xcb_req = {
85 /* count */ 2,
86 /* ext */ &xcb_shape_id,
87 /* opcode */ XCB_SHAPE_QUERY_VERSION,
88 /* isvoid */ 0
91 struct iovec xcb_parts[4];
92 xcb_shape_query_version_cookie_t xcb_ret;
93 xcb_shape_query_version_request_t xcb_out;
96 xcb_parts[2].iov_base = (char *) &xcb_out;
97 xcb_parts[2].iov_len = sizeof(xcb_out);
98 xcb_parts[3].iov_base = 0;
99 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
101 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
102 return xcb_ret;
105 xcb_shape_query_version_reply_t *
106 xcb_shape_query_version_reply (xcb_connection_t *c /**< */,
107 xcb_shape_query_version_cookie_t cookie /**< */,
108 xcb_generic_error_t **e /**< */)
110 return (xcb_shape_query_version_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
114 xcb_shape_rectangles_sizeof (const void *_buffer /**< */,
115 uint32_t rectangles_len /**< */)
117 char *xcb_tmp = (char *)_buffer;
118 unsigned int xcb_buffer_len = 0;
119 unsigned int xcb_block_len = 0;
120 unsigned int xcb_pad = 0;
121 unsigned int xcb_align_to = 0;
124 xcb_block_len += sizeof(xcb_shape_rectangles_request_t);
125 xcb_tmp += xcb_block_len;
126 xcb_buffer_len += xcb_block_len;
127 xcb_block_len = 0;
128 /* rectangles */
129 xcb_block_len += rectangles_len * sizeof(xcb_rectangle_t);
130 xcb_tmp += xcb_block_len;
131 xcb_align_to = ALIGNOF(xcb_rectangle_t);
132 /* insert padding */
133 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
134 xcb_buffer_len += xcb_block_len + xcb_pad;
135 if (0 != xcb_pad) {
136 xcb_tmp += xcb_pad;
137 xcb_pad = 0;
139 xcb_block_len = 0;
141 return xcb_buffer_len;
144 xcb_void_cookie_t
145 xcb_shape_rectangles_checked (xcb_connection_t *c /**< */,
146 xcb_shape_op_t operation /**< */,
147 xcb_shape_kind_t destination_kind /**< */,
148 uint8_t ordering /**< */,
149 xcb_window_t destination_window /**< */,
150 int16_t x_offset /**< */,
151 int16_t y_offset /**< */,
152 uint32_t rectangles_len /**< */,
153 const xcb_rectangle_t *rectangles /**< */)
155 static const xcb_protocol_request_t xcb_req = {
156 /* count */ 4,
157 /* ext */ &xcb_shape_id,
158 /* opcode */ XCB_SHAPE_RECTANGLES,
159 /* isvoid */ 1
162 struct iovec xcb_parts[6];
163 xcb_void_cookie_t xcb_ret;
164 xcb_shape_rectangles_request_t xcb_out;
166 xcb_out.operation = operation;
167 xcb_out.destination_kind = destination_kind;
168 xcb_out.ordering = ordering;
169 xcb_out.pad0 = 0;
170 xcb_out.destination_window = destination_window;
171 xcb_out.x_offset = x_offset;
172 xcb_out.y_offset = y_offset;
174 xcb_parts[2].iov_base = (char *) &xcb_out;
175 xcb_parts[2].iov_len = sizeof(xcb_out);
176 xcb_parts[3].iov_base = 0;
177 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
178 /* xcb_rectangle_t rectangles */
179 xcb_parts[4].iov_base = (char *) rectangles;
180 xcb_parts[4].iov_len = rectangles_len * sizeof(xcb_rectangle_t);
181 xcb_parts[5].iov_base = 0;
182 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
184 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
185 return xcb_ret;
188 xcb_void_cookie_t
189 xcb_shape_rectangles (xcb_connection_t *c /**< */,
190 xcb_shape_op_t operation /**< */,
191 xcb_shape_kind_t destination_kind /**< */,
192 uint8_t ordering /**< */,
193 xcb_window_t destination_window /**< */,
194 int16_t x_offset /**< */,
195 int16_t y_offset /**< */,
196 uint32_t rectangles_len /**< */,
197 const xcb_rectangle_t *rectangles /**< */)
199 static const xcb_protocol_request_t xcb_req = {
200 /* count */ 4,
201 /* ext */ &xcb_shape_id,
202 /* opcode */ XCB_SHAPE_RECTANGLES,
203 /* isvoid */ 1
206 struct iovec xcb_parts[6];
207 xcb_void_cookie_t xcb_ret;
208 xcb_shape_rectangles_request_t xcb_out;
210 xcb_out.operation = operation;
211 xcb_out.destination_kind = destination_kind;
212 xcb_out.ordering = ordering;
213 xcb_out.pad0 = 0;
214 xcb_out.destination_window = destination_window;
215 xcb_out.x_offset = x_offset;
216 xcb_out.y_offset = y_offset;
218 xcb_parts[2].iov_base = (char *) &xcb_out;
219 xcb_parts[2].iov_len = sizeof(xcb_out);
220 xcb_parts[3].iov_base = 0;
221 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
222 /* xcb_rectangle_t rectangles */
223 xcb_parts[4].iov_base = (char *) rectangles;
224 xcb_parts[4].iov_len = rectangles_len * sizeof(xcb_rectangle_t);
225 xcb_parts[5].iov_base = 0;
226 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
228 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
229 return xcb_ret;
232 xcb_void_cookie_t
233 xcb_shape_mask_checked (xcb_connection_t *c /**< */,
234 xcb_shape_op_t operation /**< */,
235 xcb_shape_kind_t destination_kind /**< */,
236 xcb_window_t destination_window /**< */,
237 int16_t x_offset /**< */,
238 int16_t y_offset /**< */,
239 xcb_pixmap_t source_bitmap /**< */)
241 static const xcb_protocol_request_t xcb_req = {
242 /* count */ 2,
243 /* ext */ &xcb_shape_id,
244 /* opcode */ XCB_SHAPE_MASK,
245 /* isvoid */ 1
248 struct iovec xcb_parts[4];
249 xcb_void_cookie_t xcb_ret;
250 xcb_shape_mask_request_t xcb_out;
252 xcb_out.operation = operation;
253 xcb_out.destination_kind = destination_kind;
254 memset(xcb_out.pad0, 0, 2);
255 xcb_out.destination_window = destination_window;
256 xcb_out.x_offset = x_offset;
257 xcb_out.y_offset = y_offset;
258 xcb_out.source_bitmap = source_bitmap;
260 xcb_parts[2].iov_base = (char *) &xcb_out;
261 xcb_parts[2].iov_len = sizeof(xcb_out);
262 xcb_parts[3].iov_base = 0;
263 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
265 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
266 return xcb_ret;
269 xcb_void_cookie_t
270 xcb_shape_mask (xcb_connection_t *c /**< */,
271 xcb_shape_op_t operation /**< */,
272 xcb_shape_kind_t destination_kind /**< */,
273 xcb_window_t destination_window /**< */,
274 int16_t x_offset /**< */,
275 int16_t y_offset /**< */,
276 xcb_pixmap_t source_bitmap /**< */)
278 static const xcb_protocol_request_t xcb_req = {
279 /* count */ 2,
280 /* ext */ &xcb_shape_id,
281 /* opcode */ XCB_SHAPE_MASK,
282 /* isvoid */ 1
285 struct iovec xcb_parts[4];
286 xcb_void_cookie_t xcb_ret;
287 xcb_shape_mask_request_t xcb_out;
289 xcb_out.operation = operation;
290 xcb_out.destination_kind = destination_kind;
291 memset(xcb_out.pad0, 0, 2);
292 xcb_out.destination_window = destination_window;
293 xcb_out.x_offset = x_offset;
294 xcb_out.y_offset = y_offset;
295 xcb_out.source_bitmap = source_bitmap;
297 xcb_parts[2].iov_base = (char *) &xcb_out;
298 xcb_parts[2].iov_len = sizeof(xcb_out);
299 xcb_parts[3].iov_base = 0;
300 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
302 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
303 return xcb_ret;
306 xcb_void_cookie_t
307 xcb_shape_combine_checked (xcb_connection_t *c /**< */,
308 xcb_shape_op_t operation /**< */,
309 xcb_shape_kind_t destination_kind /**< */,
310 xcb_shape_kind_t source_kind /**< */,
311 xcb_window_t destination_window /**< */,
312 int16_t x_offset /**< */,
313 int16_t y_offset /**< */,
314 xcb_window_t source_window /**< */)
316 static const xcb_protocol_request_t xcb_req = {
317 /* count */ 2,
318 /* ext */ &xcb_shape_id,
319 /* opcode */ XCB_SHAPE_COMBINE,
320 /* isvoid */ 1
323 struct iovec xcb_parts[4];
324 xcb_void_cookie_t xcb_ret;
325 xcb_shape_combine_request_t xcb_out;
327 xcb_out.operation = operation;
328 xcb_out.destination_kind = destination_kind;
329 xcb_out.source_kind = source_kind;
330 xcb_out.pad0 = 0;
331 xcb_out.destination_window = destination_window;
332 xcb_out.x_offset = x_offset;
333 xcb_out.y_offset = y_offset;
334 xcb_out.source_window = source_window;
336 xcb_parts[2].iov_base = (char *) &xcb_out;
337 xcb_parts[2].iov_len = sizeof(xcb_out);
338 xcb_parts[3].iov_base = 0;
339 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
341 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
342 return xcb_ret;
345 xcb_void_cookie_t
346 xcb_shape_combine (xcb_connection_t *c /**< */,
347 xcb_shape_op_t operation /**< */,
348 xcb_shape_kind_t destination_kind /**< */,
349 xcb_shape_kind_t source_kind /**< */,
350 xcb_window_t destination_window /**< */,
351 int16_t x_offset /**< */,
352 int16_t y_offset /**< */,
353 xcb_window_t source_window /**< */)
355 static const xcb_protocol_request_t xcb_req = {
356 /* count */ 2,
357 /* ext */ &xcb_shape_id,
358 /* opcode */ XCB_SHAPE_COMBINE,
359 /* isvoid */ 1
362 struct iovec xcb_parts[4];
363 xcb_void_cookie_t xcb_ret;
364 xcb_shape_combine_request_t xcb_out;
366 xcb_out.operation = operation;
367 xcb_out.destination_kind = destination_kind;
368 xcb_out.source_kind = source_kind;
369 xcb_out.pad0 = 0;
370 xcb_out.destination_window = destination_window;
371 xcb_out.x_offset = x_offset;
372 xcb_out.y_offset = y_offset;
373 xcb_out.source_window = source_window;
375 xcb_parts[2].iov_base = (char *) &xcb_out;
376 xcb_parts[2].iov_len = sizeof(xcb_out);
377 xcb_parts[3].iov_base = 0;
378 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
380 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
381 return xcb_ret;
384 xcb_void_cookie_t
385 xcb_shape_offset_checked (xcb_connection_t *c /**< */,
386 xcb_shape_kind_t destination_kind /**< */,
387 xcb_window_t destination_window /**< */,
388 int16_t x_offset /**< */,
389 int16_t y_offset /**< */)
391 static const xcb_protocol_request_t xcb_req = {
392 /* count */ 2,
393 /* ext */ &xcb_shape_id,
394 /* opcode */ XCB_SHAPE_OFFSET,
395 /* isvoid */ 1
398 struct iovec xcb_parts[4];
399 xcb_void_cookie_t xcb_ret;
400 xcb_shape_offset_request_t xcb_out;
402 xcb_out.destination_kind = destination_kind;
403 memset(xcb_out.pad0, 0, 3);
404 xcb_out.destination_window = destination_window;
405 xcb_out.x_offset = x_offset;
406 xcb_out.y_offset = y_offset;
408 xcb_parts[2].iov_base = (char *) &xcb_out;
409 xcb_parts[2].iov_len = sizeof(xcb_out);
410 xcb_parts[3].iov_base = 0;
411 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
413 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
414 return xcb_ret;
417 xcb_void_cookie_t
418 xcb_shape_offset (xcb_connection_t *c /**< */,
419 xcb_shape_kind_t destination_kind /**< */,
420 xcb_window_t destination_window /**< */,
421 int16_t x_offset /**< */,
422 int16_t y_offset /**< */)
424 static const xcb_protocol_request_t xcb_req = {
425 /* count */ 2,
426 /* ext */ &xcb_shape_id,
427 /* opcode */ XCB_SHAPE_OFFSET,
428 /* isvoid */ 1
431 struct iovec xcb_parts[4];
432 xcb_void_cookie_t xcb_ret;
433 xcb_shape_offset_request_t xcb_out;
435 xcb_out.destination_kind = destination_kind;
436 memset(xcb_out.pad0, 0, 3);
437 xcb_out.destination_window = destination_window;
438 xcb_out.x_offset = x_offset;
439 xcb_out.y_offset = y_offset;
441 xcb_parts[2].iov_base = (char *) &xcb_out;
442 xcb_parts[2].iov_len = sizeof(xcb_out);
443 xcb_parts[3].iov_base = 0;
444 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
446 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
447 return xcb_ret;
450 xcb_shape_query_extents_cookie_t
451 xcb_shape_query_extents (xcb_connection_t *c /**< */,
452 xcb_window_t destination_window /**< */)
454 static const xcb_protocol_request_t xcb_req = {
455 /* count */ 2,
456 /* ext */ &xcb_shape_id,
457 /* opcode */ XCB_SHAPE_QUERY_EXTENTS,
458 /* isvoid */ 0
461 struct iovec xcb_parts[4];
462 xcb_shape_query_extents_cookie_t xcb_ret;
463 xcb_shape_query_extents_request_t xcb_out;
465 xcb_out.destination_window = destination_window;
467 xcb_parts[2].iov_base = (char *) &xcb_out;
468 xcb_parts[2].iov_len = sizeof(xcb_out);
469 xcb_parts[3].iov_base = 0;
470 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
472 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
473 return xcb_ret;
476 xcb_shape_query_extents_cookie_t
477 xcb_shape_query_extents_unchecked (xcb_connection_t *c /**< */,
478 xcb_window_t destination_window /**< */)
480 static const xcb_protocol_request_t xcb_req = {
481 /* count */ 2,
482 /* ext */ &xcb_shape_id,
483 /* opcode */ XCB_SHAPE_QUERY_EXTENTS,
484 /* isvoid */ 0
487 struct iovec xcb_parts[4];
488 xcb_shape_query_extents_cookie_t xcb_ret;
489 xcb_shape_query_extents_request_t xcb_out;
491 xcb_out.destination_window = destination_window;
493 xcb_parts[2].iov_base = (char *) &xcb_out;
494 xcb_parts[2].iov_len = sizeof(xcb_out);
495 xcb_parts[3].iov_base = 0;
496 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
498 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
499 return xcb_ret;
502 xcb_shape_query_extents_reply_t *
503 xcb_shape_query_extents_reply (xcb_connection_t *c /**< */,
504 xcb_shape_query_extents_cookie_t cookie /**< */,
505 xcb_generic_error_t **e /**< */)
507 return (xcb_shape_query_extents_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
510 xcb_void_cookie_t
511 xcb_shape_select_input_checked (xcb_connection_t *c /**< */,
512 xcb_window_t destination_window /**< */,
513 uint8_t enable /**< */)
515 static const xcb_protocol_request_t xcb_req = {
516 /* count */ 2,
517 /* ext */ &xcb_shape_id,
518 /* opcode */ XCB_SHAPE_SELECT_INPUT,
519 /* isvoid */ 1
522 struct iovec xcb_parts[4];
523 xcb_void_cookie_t xcb_ret;
524 xcb_shape_select_input_request_t xcb_out;
526 xcb_out.destination_window = destination_window;
527 xcb_out.enable = enable;
528 memset(xcb_out.pad0, 0, 3);
530 xcb_parts[2].iov_base = (char *) &xcb_out;
531 xcb_parts[2].iov_len = sizeof(xcb_out);
532 xcb_parts[3].iov_base = 0;
533 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
535 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
536 return xcb_ret;
539 xcb_void_cookie_t
540 xcb_shape_select_input (xcb_connection_t *c /**< */,
541 xcb_window_t destination_window /**< */,
542 uint8_t enable /**< */)
544 static const xcb_protocol_request_t xcb_req = {
545 /* count */ 2,
546 /* ext */ &xcb_shape_id,
547 /* opcode */ XCB_SHAPE_SELECT_INPUT,
548 /* isvoid */ 1
551 struct iovec xcb_parts[4];
552 xcb_void_cookie_t xcb_ret;
553 xcb_shape_select_input_request_t xcb_out;
555 xcb_out.destination_window = destination_window;
556 xcb_out.enable = enable;
557 memset(xcb_out.pad0, 0, 3);
559 xcb_parts[2].iov_base = (char *) &xcb_out;
560 xcb_parts[2].iov_len = sizeof(xcb_out);
561 xcb_parts[3].iov_base = 0;
562 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
564 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
565 return xcb_ret;
568 xcb_shape_input_selected_cookie_t
569 xcb_shape_input_selected (xcb_connection_t *c /**< */,
570 xcb_window_t destination_window /**< */)
572 static const xcb_protocol_request_t xcb_req = {
573 /* count */ 2,
574 /* ext */ &xcb_shape_id,
575 /* opcode */ XCB_SHAPE_INPUT_SELECTED,
576 /* isvoid */ 0
579 struct iovec xcb_parts[4];
580 xcb_shape_input_selected_cookie_t xcb_ret;
581 xcb_shape_input_selected_request_t xcb_out;
583 xcb_out.destination_window = destination_window;
585 xcb_parts[2].iov_base = (char *) &xcb_out;
586 xcb_parts[2].iov_len = sizeof(xcb_out);
587 xcb_parts[3].iov_base = 0;
588 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
590 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
591 return xcb_ret;
594 xcb_shape_input_selected_cookie_t
595 xcb_shape_input_selected_unchecked (xcb_connection_t *c /**< */,
596 xcb_window_t destination_window /**< */)
598 static const xcb_protocol_request_t xcb_req = {
599 /* count */ 2,
600 /* ext */ &xcb_shape_id,
601 /* opcode */ XCB_SHAPE_INPUT_SELECTED,
602 /* isvoid */ 0
605 struct iovec xcb_parts[4];
606 xcb_shape_input_selected_cookie_t xcb_ret;
607 xcb_shape_input_selected_request_t xcb_out;
609 xcb_out.destination_window = destination_window;
611 xcb_parts[2].iov_base = (char *) &xcb_out;
612 xcb_parts[2].iov_len = sizeof(xcb_out);
613 xcb_parts[3].iov_base = 0;
614 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
616 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
617 return xcb_ret;
620 xcb_shape_input_selected_reply_t *
621 xcb_shape_input_selected_reply (xcb_connection_t *c /**< */,
622 xcb_shape_input_selected_cookie_t cookie /**< */,
623 xcb_generic_error_t **e /**< */)
625 return (xcb_shape_input_selected_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
629 xcb_shape_get_rectangles_sizeof (const void *_buffer /**< */)
631 char *xcb_tmp = (char *)_buffer;
632 const xcb_shape_get_rectangles_reply_t *_aux = (xcb_shape_get_rectangles_reply_t *)_buffer;
633 unsigned int xcb_buffer_len = 0;
634 unsigned int xcb_block_len = 0;
635 unsigned int xcb_pad = 0;
636 unsigned int xcb_align_to = 0;
639 xcb_block_len += sizeof(xcb_shape_get_rectangles_reply_t);
640 xcb_tmp += xcb_block_len;
641 xcb_buffer_len += xcb_block_len;
642 xcb_block_len = 0;
643 /* rectangles */
644 xcb_block_len += _aux->rectangles_len * sizeof(xcb_rectangle_t);
645 xcb_tmp += xcb_block_len;
646 xcb_align_to = ALIGNOF(xcb_rectangle_t);
647 /* insert padding */
648 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
649 xcb_buffer_len += xcb_block_len + xcb_pad;
650 if (0 != xcb_pad) {
651 xcb_tmp += xcb_pad;
652 xcb_pad = 0;
654 xcb_block_len = 0;
656 return xcb_buffer_len;
659 xcb_shape_get_rectangles_cookie_t
660 xcb_shape_get_rectangles (xcb_connection_t *c /**< */,
661 xcb_window_t window /**< */,
662 xcb_shape_kind_t source_kind /**< */)
664 static const xcb_protocol_request_t xcb_req = {
665 /* count */ 2,
666 /* ext */ &xcb_shape_id,
667 /* opcode */ XCB_SHAPE_GET_RECTANGLES,
668 /* isvoid */ 0
671 struct iovec xcb_parts[4];
672 xcb_shape_get_rectangles_cookie_t xcb_ret;
673 xcb_shape_get_rectangles_request_t xcb_out;
675 xcb_out.window = window;
676 xcb_out.source_kind = source_kind;
677 memset(xcb_out.pad0, 0, 3);
679 xcb_parts[2].iov_base = (char *) &xcb_out;
680 xcb_parts[2].iov_len = sizeof(xcb_out);
681 xcb_parts[3].iov_base = 0;
682 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
684 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
685 return xcb_ret;
688 xcb_shape_get_rectangles_cookie_t
689 xcb_shape_get_rectangles_unchecked (xcb_connection_t *c /**< */,
690 xcb_window_t window /**< */,
691 xcb_shape_kind_t source_kind /**< */)
693 static const xcb_protocol_request_t xcb_req = {
694 /* count */ 2,
695 /* ext */ &xcb_shape_id,
696 /* opcode */ XCB_SHAPE_GET_RECTANGLES,
697 /* isvoid */ 0
700 struct iovec xcb_parts[4];
701 xcb_shape_get_rectangles_cookie_t xcb_ret;
702 xcb_shape_get_rectangles_request_t xcb_out;
704 xcb_out.window = window;
705 xcb_out.source_kind = source_kind;
706 memset(xcb_out.pad0, 0, 3);
708 xcb_parts[2].iov_base = (char *) &xcb_out;
709 xcb_parts[2].iov_len = sizeof(xcb_out);
710 xcb_parts[3].iov_base = 0;
711 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
713 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
714 return xcb_ret;
717 xcb_rectangle_t *
718 xcb_shape_get_rectangles_rectangles (const xcb_shape_get_rectangles_reply_t *R /**< */)
720 return (xcb_rectangle_t *) (R + 1);
724 xcb_shape_get_rectangles_rectangles_length (const xcb_shape_get_rectangles_reply_t *R /**< */)
726 return R->rectangles_len;
729 xcb_rectangle_iterator_t
730 xcb_shape_get_rectangles_rectangles_iterator (const xcb_shape_get_rectangles_reply_t *R /**< */)
732 xcb_rectangle_iterator_t i;
733 i.data = (xcb_rectangle_t *) (R + 1);
734 i.rem = R->rectangles_len;
735 i.index = (char *) i.data - (char *) R;
736 return i;
739 xcb_shape_get_rectangles_reply_t *
740 xcb_shape_get_rectangles_reply (xcb_connection_t *c /**< */,
741 xcb_shape_get_rectangles_cookie_t cookie /**< */,
742 xcb_generic_error_t **e /**< */)
744 return (xcb_shape_get_rectangles_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);