xref: /minix3/external/mit/xorg/lib/libxcb/files/shape.c (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1971bb1a5SLionel Sambuc /*
2971bb1a5SLionel Sambuc  * This file generated automatically from shape.xml by c_client.py.
3971bb1a5SLionel Sambuc  * Edit at your peril.
4971bb1a5SLionel Sambuc  */
5971bb1a5SLionel Sambuc 
6971bb1a5SLionel Sambuc #ifdef HAVE_CONFIG_H
7971bb1a5SLionel Sambuc #include "config.h"
8971bb1a5SLionel Sambuc #endif
9971bb1a5SLionel Sambuc #include <stdlib.h>
10971bb1a5SLionel Sambuc #include <string.h>
11971bb1a5SLionel Sambuc #include <assert.h>
12971bb1a5SLionel Sambuc #include <stddef.h>  /* for offsetof() */
13971bb1a5SLionel Sambuc #include "xcbext.h"
14971bb1a5SLionel Sambuc #include "shape.h"
15971bb1a5SLionel Sambuc 
16971bb1a5SLionel Sambuc #define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member)
17971bb1a5SLionel Sambuc #include "xproto.h"
18971bb1a5SLionel Sambuc 
19971bb1a5SLionel Sambuc xcb_extension_t xcb_shape_id = { "SHAPE", 0 };
20971bb1a5SLionel Sambuc 
21971bb1a5SLionel Sambuc void
xcb_shape_op_next(xcb_shape_op_iterator_t * i)22971bb1a5SLionel Sambuc xcb_shape_op_next (xcb_shape_op_iterator_t *i  /**< */)
23971bb1a5SLionel Sambuc {
24971bb1a5SLionel Sambuc     --i->rem;
25971bb1a5SLionel Sambuc     ++i->data;
26971bb1a5SLionel Sambuc     i->index += sizeof(xcb_shape_op_t);
27971bb1a5SLionel Sambuc }
28971bb1a5SLionel Sambuc 
29971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_shape_op_end(xcb_shape_op_iterator_t i)30971bb1a5SLionel Sambuc xcb_shape_op_end (xcb_shape_op_iterator_t i  /**< */)
31971bb1a5SLionel Sambuc {
32971bb1a5SLionel Sambuc     xcb_generic_iterator_t ret;
33971bb1a5SLionel Sambuc     ret.data = i.data + i.rem;
34971bb1a5SLionel Sambuc     ret.index = i.index + ((char *) ret.data - (char *) i.data);
35971bb1a5SLionel Sambuc     ret.rem = 0;
36971bb1a5SLionel Sambuc     return ret;
37971bb1a5SLionel Sambuc }
38971bb1a5SLionel Sambuc 
39971bb1a5SLionel Sambuc void
xcb_shape_kind_next(xcb_shape_kind_iterator_t * i)40971bb1a5SLionel Sambuc xcb_shape_kind_next (xcb_shape_kind_iterator_t *i  /**< */)
41971bb1a5SLionel Sambuc {
42971bb1a5SLionel Sambuc     --i->rem;
43971bb1a5SLionel Sambuc     ++i->data;
44971bb1a5SLionel Sambuc     i->index += sizeof(xcb_shape_kind_t);
45971bb1a5SLionel Sambuc }
46971bb1a5SLionel Sambuc 
47971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_shape_kind_end(xcb_shape_kind_iterator_t i)48971bb1a5SLionel Sambuc xcb_shape_kind_end (xcb_shape_kind_iterator_t i  /**< */)
49971bb1a5SLionel Sambuc {
50971bb1a5SLionel Sambuc     xcb_generic_iterator_t ret;
51971bb1a5SLionel Sambuc     ret.data = i.data + i.rem;
52971bb1a5SLionel Sambuc     ret.index = i.index + ((char *) ret.data - (char *) i.data);
53971bb1a5SLionel Sambuc     ret.rem = 0;
54971bb1a5SLionel Sambuc     return ret;
55971bb1a5SLionel Sambuc }
56971bb1a5SLionel Sambuc 
57971bb1a5SLionel Sambuc xcb_shape_query_version_cookie_t
xcb_shape_query_version(xcb_connection_t * c)58971bb1a5SLionel Sambuc xcb_shape_query_version (xcb_connection_t *c  /**< */)
59971bb1a5SLionel Sambuc {
60971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
61971bb1a5SLionel Sambuc         /* count */ 2,
62971bb1a5SLionel Sambuc         /* ext */ &xcb_shape_id,
63971bb1a5SLionel Sambuc         /* opcode */ XCB_SHAPE_QUERY_VERSION,
64971bb1a5SLionel Sambuc         /* isvoid */ 0
65971bb1a5SLionel Sambuc     };
66971bb1a5SLionel Sambuc 
67971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
68971bb1a5SLionel Sambuc     xcb_shape_query_version_cookie_t xcb_ret;
69971bb1a5SLionel Sambuc     xcb_shape_query_version_request_t xcb_out;
70971bb1a5SLionel Sambuc 
71971bb1a5SLionel Sambuc 
72971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
73971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
74971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
75971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
76971bb1a5SLionel Sambuc 
77971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
78971bb1a5SLionel Sambuc     return xcb_ret;
79971bb1a5SLionel Sambuc }
80971bb1a5SLionel Sambuc 
81971bb1a5SLionel Sambuc xcb_shape_query_version_cookie_t
xcb_shape_query_version_unchecked(xcb_connection_t * c)82971bb1a5SLionel Sambuc xcb_shape_query_version_unchecked (xcb_connection_t *c  /**< */)
83971bb1a5SLionel Sambuc {
84971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
85971bb1a5SLionel Sambuc         /* count */ 2,
86971bb1a5SLionel Sambuc         /* ext */ &xcb_shape_id,
87971bb1a5SLionel Sambuc         /* opcode */ XCB_SHAPE_QUERY_VERSION,
88971bb1a5SLionel Sambuc         /* isvoid */ 0
89971bb1a5SLionel Sambuc     };
90971bb1a5SLionel Sambuc 
91971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
92971bb1a5SLionel Sambuc     xcb_shape_query_version_cookie_t xcb_ret;
93971bb1a5SLionel Sambuc     xcb_shape_query_version_request_t xcb_out;
94971bb1a5SLionel Sambuc 
95971bb1a5SLionel Sambuc 
96971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
97971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
98971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
99971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
100971bb1a5SLionel Sambuc 
101971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
102971bb1a5SLionel Sambuc     return xcb_ret;
103971bb1a5SLionel Sambuc }
104971bb1a5SLionel Sambuc 
105971bb1a5SLionel Sambuc xcb_shape_query_version_reply_t *
xcb_shape_query_version_reply(xcb_connection_t * c,xcb_shape_query_version_cookie_t cookie,xcb_generic_error_t ** e)106971bb1a5SLionel Sambuc xcb_shape_query_version_reply (xcb_connection_t                  *c  /**< */,
107971bb1a5SLionel Sambuc                                xcb_shape_query_version_cookie_t   cookie  /**< */,
108971bb1a5SLionel Sambuc                                xcb_generic_error_t              **e  /**< */)
109971bb1a5SLionel Sambuc {
110971bb1a5SLionel Sambuc     return (xcb_shape_query_version_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
111971bb1a5SLionel Sambuc }
112971bb1a5SLionel Sambuc 
113971bb1a5SLionel Sambuc int
xcb_shape_rectangles_sizeof(const void * _buffer,uint32_t rectangles_len)114971bb1a5SLionel Sambuc xcb_shape_rectangles_sizeof (const void  *_buffer  /**< */,
115971bb1a5SLionel Sambuc                              uint32_t     rectangles_len  /**< */)
116971bb1a5SLionel Sambuc {
117971bb1a5SLionel Sambuc     char *xcb_tmp = (char *)_buffer;
118971bb1a5SLionel Sambuc     unsigned int xcb_buffer_len = 0;
119971bb1a5SLionel Sambuc     unsigned int xcb_block_len = 0;
120971bb1a5SLionel Sambuc     unsigned int xcb_pad = 0;
121*0a6a1f1dSLionel Sambuc     unsigned int xcb_align_to = 0;
122971bb1a5SLionel Sambuc 
123971bb1a5SLionel Sambuc 
124971bb1a5SLionel Sambuc     xcb_block_len += sizeof(xcb_shape_rectangles_request_t);
125971bb1a5SLionel Sambuc     xcb_tmp += xcb_block_len;
126*0a6a1f1dSLionel Sambuc     xcb_buffer_len += xcb_block_len;
127*0a6a1f1dSLionel Sambuc     xcb_block_len = 0;
128971bb1a5SLionel Sambuc     /* rectangles */
129971bb1a5SLionel Sambuc     xcb_block_len += rectangles_len * sizeof(xcb_rectangle_t);
130971bb1a5SLionel Sambuc     xcb_tmp += xcb_block_len;
131971bb1a5SLionel Sambuc     xcb_align_to = ALIGNOF(xcb_rectangle_t);
132971bb1a5SLionel Sambuc     /* insert padding */
133971bb1a5SLionel Sambuc     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
134971bb1a5SLionel Sambuc     xcb_buffer_len += xcb_block_len + xcb_pad;
135971bb1a5SLionel Sambuc     if (0 != xcb_pad) {
136971bb1a5SLionel Sambuc         xcb_tmp += xcb_pad;
137971bb1a5SLionel Sambuc         xcb_pad = 0;
138971bb1a5SLionel Sambuc     }
139971bb1a5SLionel Sambuc     xcb_block_len = 0;
140971bb1a5SLionel Sambuc 
141971bb1a5SLionel Sambuc     return xcb_buffer_len;
142971bb1a5SLionel Sambuc }
143971bb1a5SLionel Sambuc 
144971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_shape_rectangles_checked(xcb_connection_t * c,xcb_shape_op_t operation,xcb_shape_kind_t destination_kind,uint8_t ordering,xcb_window_t destination_window,int16_t x_offset,int16_t y_offset,uint32_t rectangles_len,const xcb_rectangle_t * rectangles)145971bb1a5SLionel Sambuc xcb_shape_rectangles_checked (xcb_connection_t      *c  /**< */,
146971bb1a5SLionel Sambuc                               xcb_shape_op_t         operation  /**< */,
147971bb1a5SLionel Sambuc                               xcb_shape_kind_t       destination_kind  /**< */,
148971bb1a5SLionel Sambuc                               uint8_t                ordering  /**< */,
149971bb1a5SLionel Sambuc                               xcb_window_t           destination_window  /**< */,
150971bb1a5SLionel Sambuc                               int16_t                x_offset  /**< */,
151971bb1a5SLionel Sambuc                               int16_t                y_offset  /**< */,
152971bb1a5SLionel Sambuc                               uint32_t               rectangles_len  /**< */,
153971bb1a5SLionel Sambuc                               const xcb_rectangle_t *rectangles  /**< */)
154971bb1a5SLionel Sambuc {
155971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
156971bb1a5SLionel Sambuc         /* count */ 4,
157971bb1a5SLionel Sambuc         /* ext */ &xcb_shape_id,
158971bb1a5SLionel Sambuc         /* opcode */ XCB_SHAPE_RECTANGLES,
159971bb1a5SLionel Sambuc         /* isvoid */ 1
160971bb1a5SLionel Sambuc     };
161971bb1a5SLionel Sambuc 
162971bb1a5SLionel Sambuc     struct iovec xcb_parts[6];
163971bb1a5SLionel Sambuc     xcb_void_cookie_t xcb_ret;
164971bb1a5SLionel Sambuc     xcb_shape_rectangles_request_t xcb_out;
165971bb1a5SLionel Sambuc 
166971bb1a5SLionel Sambuc     xcb_out.operation = operation;
167971bb1a5SLionel Sambuc     xcb_out.destination_kind = destination_kind;
168971bb1a5SLionel Sambuc     xcb_out.ordering = ordering;
169971bb1a5SLionel Sambuc     xcb_out.pad0 = 0;
170971bb1a5SLionel Sambuc     xcb_out.destination_window = destination_window;
171971bb1a5SLionel Sambuc     xcb_out.x_offset = x_offset;
172971bb1a5SLionel Sambuc     xcb_out.y_offset = y_offset;
173971bb1a5SLionel Sambuc 
174971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
175971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
176971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
177971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
178971bb1a5SLionel Sambuc     /* xcb_rectangle_t rectangles */
179971bb1a5SLionel Sambuc     xcb_parts[4].iov_base = (char *) rectangles;
180971bb1a5SLionel Sambuc     xcb_parts[4].iov_len = rectangles_len * sizeof(xcb_rectangle_t);
181971bb1a5SLionel Sambuc     xcb_parts[5].iov_base = 0;
182971bb1a5SLionel Sambuc     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
183971bb1a5SLionel Sambuc 
184971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
185971bb1a5SLionel Sambuc     return xcb_ret;
186971bb1a5SLionel Sambuc }
187971bb1a5SLionel Sambuc 
188971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_shape_rectangles(xcb_connection_t * c,xcb_shape_op_t operation,xcb_shape_kind_t destination_kind,uint8_t ordering,xcb_window_t destination_window,int16_t x_offset,int16_t y_offset,uint32_t rectangles_len,const xcb_rectangle_t * rectangles)189971bb1a5SLionel Sambuc xcb_shape_rectangles (xcb_connection_t      *c  /**< */,
190971bb1a5SLionel Sambuc                       xcb_shape_op_t         operation  /**< */,
191971bb1a5SLionel Sambuc                       xcb_shape_kind_t       destination_kind  /**< */,
192971bb1a5SLionel Sambuc                       uint8_t                ordering  /**< */,
193971bb1a5SLionel Sambuc                       xcb_window_t           destination_window  /**< */,
194971bb1a5SLionel Sambuc                       int16_t                x_offset  /**< */,
195971bb1a5SLionel Sambuc                       int16_t                y_offset  /**< */,
196971bb1a5SLionel Sambuc                       uint32_t               rectangles_len  /**< */,
197971bb1a5SLionel Sambuc                       const xcb_rectangle_t *rectangles  /**< */)
198971bb1a5SLionel Sambuc {
199971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
200971bb1a5SLionel Sambuc         /* count */ 4,
201971bb1a5SLionel Sambuc         /* ext */ &xcb_shape_id,
202971bb1a5SLionel Sambuc         /* opcode */ XCB_SHAPE_RECTANGLES,
203971bb1a5SLionel Sambuc         /* isvoid */ 1
204971bb1a5SLionel Sambuc     };
205971bb1a5SLionel Sambuc 
206971bb1a5SLionel Sambuc     struct iovec xcb_parts[6];
207971bb1a5SLionel Sambuc     xcb_void_cookie_t xcb_ret;
208971bb1a5SLionel Sambuc     xcb_shape_rectangles_request_t xcb_out;
209971bb1a5SLionel Sambuc 
210971bb1a5SLionel Sambuc     xcb_out.operation = operation;
211971bb1a5SLionel Sambuc     xcb_out.destination_kind = destination_kind;
212971bb1a5SLionel Sambuc     xcb_out.ordering = ordering;
213971bb1a5SLionel Sambuc     xcb_out.pad0 = 0;
214971bb1a5SLionel Sambuc     xcb_out.destination_window = destination_window;
215971bb1a5SLionel Sambuc     xcb_out.x_offset = x_offset;
216971bb1a5SLionel Sambuc     xcb_out.y_offset = y_offset;
217971bb1a5SLionel Sambuc 
218971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
219971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
220971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
221971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
222971bb1a5SLionel Sambuc     /* xcb_rectangle_t rectangles */
223971bb1a5SLionel Sambuc     xcb_parts[4].iov_base = (char *) rectangles;
224971bb1a5SLionel Sambuc     xcb_parts[4].iov_len = rectangles_len * sizeof(xcb_rectangle_t);
225971bb1a5SLionel Sambuc     xcb_parts[5].iov_base = 0;
226971bb1a5SLionel Sambuc     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
227971bb1a5SLionel Sambuc 
228971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
229971bb1a5SLionel Sambuc     return xcb_ret;
230971bb1a5SLionel Sambuc }
231971bb1a5SLionel Sambuc 
232971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_shape_mask_checked(xcb_connection_t * c,xcb_shape_op_t operation,xcb_shape_kind_t destination_kind,xcb_window_t destination_window,int16_t x_offset,int16_t y_offset,xcb_pixmap_t source_bitmap)233971bb1a5SLionel Sambuc xcb_shape_mask_checked (xcb_connection_t *c  /**< */,
234971bb1a5SLionel Sambuc                         xcb_shape_op_t    operation  /**< */,
235971bb1a5SLionel Sambuc                         xcb_shape_kind_t  destination_kind  /**< */,
236971bb1a5SLionel Sambuc                         xcb_window_t      destination_window  /**< */,
237971bb1a5SLionel Sambuc                         int16_t           x_offset  /**< */,
238971bb1a5SLionel Sambuc                         int16_t           y_offset  /**< */,
239971bb1a5SLionel Sambuc                         xcb_pixmap_t      source_bitmap  /**< */)
240971bb1a5SLionel Sambuc {
241971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
242971bb1a5SLionel Sambuc         /* count */ 2,
243971bb1a5SLionel Sambuc         /* ext */ &xcb_shape_id,
244971bb1a5SLionel Sambuc         /* opcode */ XCB_SHAPE_MASK,
245971bb1a5SLionel Sambuc         /* isvoid */ 1
246971bb1a5SLionel Sambuc     };
247971bb1a5SLionel Sambuc 
248971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
249971bb1a5SLionel Sambuc     xcb_void_cookie_t xcb_ret;
250971bb1a5SLionel Sambuc     xcb_shape_mask_request_t xcb_out;
251971bb1a5SLionel Sambuc 
252971bb1a5SLionel Sambuc     xcb_out.operation = operation;
253971bb1a5SLionel Sambuc     xcb_out.destination_kind = destination_kind;
254971bb1a5SLionel Sambuc     memset(xcb_out.pad0, 0, 2);
255971bb1a5SLionel Sambuc     xcb_out.destination_window = destination_window;
256971bb1a5SLionel Sambuc     xcb_out.x_offset = x_offset;
257971bb1a5SLionel Sambuc     xcb_out.y_offset = y_offset;
258971bb1a5SLionel Sambuc     xcb_out.source_bitmap = source_bitmap;
259971bb1a5SLionel Sambuc 
260971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
261971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
262971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
263971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
264971bb1a5SLionel Sambuc 
265971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
266971bb1a5SLionel Sambuc     return xcb_ret;
267971bb1a5SLionel Sambuc }
268971bb1a5SLionel Sambuc 
269971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_shape_mask(xcb_connection_t * c,xcb_shape_op_t operation,xcb_shape_kind_t destination_kind,xcb_window_t destination_window,int16_t x_offset,int16_t y_offset,xcb_pixmap_t source_bitmap)270971bb1a5SLionel Sambuc xcb_shape_mask (xcb_connection_t *c  /**< */,
271971bb1a5SLionel Sambuc                 xcb_shape_op_t    operation  /**< */,
272971bb1a5SLionel Sambuc                 xcb_shape_kind_t  destination_kind  /**< */,
273971bb1a5SLionel Sambuc                 xcb_window_t      destination_window  /**< */,
274971bb1a5SLionel Sambuc                 int16_t           x_offset  /**< */,
275971bb1a5SLionel Sambuc                 int16_t           y_offset  /**< */,
276971bb1a5SLionel Sambuc                 xcb_pixmap_t      source_bitmap  /**< */)
277971bb1a5SLionel Sambuc {
278971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
279971bb1a5SLionel Sambuc         /* count */ 2,
280971bb1a5SLionel Sambuc         /* ext */ &xcb_shape_id,
281971bb1a5SLionel Sambuc         /* opcode */ XCB_SHAPE_MASK,
282971bb1a5SLionel Sambuc         /* isvoid */ 1
283971bb1a5SLionel Sambuc     };
284971bb1a5SLionel Sambuc 
285971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
286971bb1a5SLionel Sambuc     xcb_void_cookie_t xcb_ret;
287971bb1a5SLionel Sambuc     xcb_shape_mask_request_t xcb_out;
288971bb1a5SLionel Sambuc 
289971bb1a5SLionel Sambuc     xcb_out.operation = operation;
290971bb1a5SLionel Sambuc     xcb_out.destination_kind = destination_kind;
291971bb1a5SLionel Sambuc     memset(xcb_out.pad0, 0, 2);
292971bb1a5SLionel Sambuc     xcb_out.destination_window = destination_window;
293971bb1a5SLionel Sambuc     xcb_out.x_offset = x_offset;
294971bb1a5SLionel Sambuc     xcb_out.y_offset = y_offset;
295971bb1a5SLionel Sambuc     xcb_out.source_bitmap = source_bitmap;
296971bb1a5SLionel Sambuc 
297971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
298971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
299971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
300971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
301971bb1a5SLionel Sambuc 
302971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
303971bb1a5SLionel Sambuc     return xcb_ret;
304971bb1a5SLionel Sambuc }
305971bb1a5SLionel Sambuc 
306971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_shape_combine_checked(xcb_connection_t * c,xcb_shape_op_t operation,xcb_shape_kind_t destination_kind,xcb_shape_kind_t source_kind,xcb_window_t destination_window,int16_t x_offset,int16_t y_offset,xcb_window_t source_window)307971bb1a5SLionel Sambuc xcb_shape_combine_checked (xcb_connection_t *c  /**< */,
308971bb1a5SLionel Sambuc                            xcb_shape_op_t    operation  /**< */,
309971bb1a5SLionel Sambuc                            xcb_shape_kind_t  destination_kind  /**< */,
310971bb1a5SLionel Sambuc                            xcb_shape_kind_t  source_kind  /**< */,
311971bb1a5SLionel Sambuc                            xcb_window_t      destination_window  /**< */,
312971bb1a5SLionel Sambuc                            int16_t           x_offset  /**< */,
313971bb1a5SLionel Sambuc                            int16_t           y_offset  /**< */,
314971bb1a5SLionel Sambuc                            xcb_window_t      source_window  /**< */)
315971bb1a5SLionel Sambuc {
316971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
317971bb1a5SLionel Sambuc         /* count */ 2,
318971bb1a5SLionel Sambuc         /* ext */ &xcb_shape_id,
319971bb1a5SLionel Sambuc         /* opcode */ XCB_SHAPE_COMBINE,
320971bb1a5SLionel Sambuc         /* isvoid */ 1
321971bb1a5SLionel Sambuc     };
322971bb1a5SLionel Sambuc 
323971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
324971bb1a5SLionel Sambuc     xcb_void_cookie_t xcb_ret;
325971bb1a5SLionel Sambuc     xcb_shape_combine_request_t xcb_out;
326971bb1a5SLionel Sambuc 
327971bb1a5SLionel Sambuc     xcb_out.operation = operation;
328971bb1a5SLionel Sambuc     xcb_out.destination_kind = destination_kind;
329971bb1a5SLionel Sambuc     xcb_out.source_kind = source_kind;
330971bb1a5SLionel Sambuc     xcb_out.pad0 = 0;
331971bb1a5SLionel Sambuc     xcb_out.destination_window = destination_window;
332971bb1a5SLionel Sambuc     xcb_out.x_offset = x_offset;
333971bb1a5SLionel Sambuc     xcb_out.y_offset = y_offset;
334971bb1a5SLionel Sambuc     xcb_out.source_window = source_window;
335971bb1a5SLionel Sambuc 
336971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
337971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
338971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
339971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
340971bb1a5SLionel Sambuc 
341971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
342971bb1a5SLionel Sambuc     return xcb_ret;
343971bb1a5SLionel Sambuc }
344971bb1a5SLionel Sambuc 
345971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_shape_combine(xcb_connection_t * c,xcb_shape_op_t operation,xcb_shape_kind_t destination_kind,xcb_shape_kind_t source_kind,xcb_window_t destination_window,int16_t x_offset,int16_t y_offset,xcb_window_t source_window)346971bb1a5SLionel Sambuc xcb_shape_combine (xcb_connection_t *c  /**< */,
347971bb1a5SLionel Sambuc                    xcb_shape_op_t    operation  /**< */,
348971bb1a5SLionel Sambuc                    xcb_shape_kind_t  destination_kind  /**< */,
349971bb1a5SLionel Sambuc                    xcb_shape_kind_t  source_kind  /**< */,
350971bb1a5SLionel Sambuc                    xcb_window_t      destination_window  /**< */,
351971bb1a5SLionel Sambuc                    int16_t           x_offset  /**< */,
352971bb1a5SLionel Sambuc                    int16_t           y_offset  /**< */,
353971bb1a5SLionel Sambuc                    xcb_window_t      source_window  /**< */)
354971bb1a5SLionel Sambuc {
355971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
356971bb1a5SLionel Sambuc         /* count */ 2,
357971bb1a5SLionel Sambuc         /* ext */ &xcb_shape_id,
358971bb1a5SLionel Sambuc         /* opcode */ XCB_SHAPE_COMBINE,
359971bb1a5SLionel Sambuc         /* isvoid */ 1
360971bb1a5SLionel Sambuc     };
361971bb1a5SLionel Sambuc 
362971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
363971bb1a5SLionel Sambuc     xcb_void_cookie_t xcb_ret;
364971bb1a5SLionel Sambuc     xcb_shape_combine_request_t xcb_out;
365971bb1a5SLionel Sambuc 
366971bb1a5SLionel Sambuc     xcb_out.operation = operation;
367971bb1a5SLionel Sambuc     xcb_out.destination_kind = destination_kind;
368971bb1a5SLionel Sambuc     xcb_out.source_kind = source_kind;
369971bb1a5SLionel Sambuc     xcb_out.pad0 = 0;
370971bb1a5SLionel Sambuc     xcb_out.destination_window = destination_window;
371971bb1a5SLionel Sambuc     xcb_out.x_offset = x_offset;
372971bb1a5SLionel Sambuc     xcb_out.y_offset = y_offset;
373971bb1a5SLionel Sambuc     xcb_out.source_window = source_window;
374971bb1a5SLionel Sambuc 
375971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
376971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
377971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
378971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
379971bb1a5SLionel Sambuc 
380971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
381971bb1a5SLionel Sambuc     return xcb_ret;
382971bb1a5SLionel Sambuc }
383971bb1a5SLionel Sambuc 
384971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_shape_offset_checked(xcb_connection_t * c,xcb_shape_kind_t destination_kind,xcb_window_t destination_window,int16_t x_offset,int16_t y_offset)385971bb1a5SLionel Sambuc xcb_shape_offset_checked (xcb_connection_t *c  /**< */,
386971bb1a5SLionel Sambuc                           xcb_shape_kind_t  destination_kind  /**< */,
387971bb1a5SLionel Sambuc                           xcb_window_t      destination_window  /**< */,
388971bb1a5SLionel Sambuc                           int16_t           x_offset  /**< */,
389971bb1a5SLionel Sambuc                           int16_t           y_offset  /**< */)
390971bb1a5SLionel Sambuc {
391971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
392971bb1a5SLionel Sambuc         /* count */ 2,
393971bb1a5SLionel Sambuc         /* ext */ &xcb_shape_id,
394971bb1a5SLionel Sambuc         /* opcode */ XCB_SHAPE_OFFSET,
395971bb1a5SLionel Sambuc         /* isvoid */ 1
396971bb1a5SLionel Sambuc     };
397971bb1a5SLionel Sambuc 
398971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
399971bb1a5SLionel Sambuc     xcb_void_cookie_t xcb_ret;
400971bb1a5SLionel Sambuc     xcb_shape_offset_request_t xcb_out;
401971bb1a5SLionel Sambuc 
402971bb1a5SLionel Sambuc     xcb_out.destination_kind = destination_kind;
403971bb1a5SLionel Sambuc     memset(xcb_out.pad0, 0, 3);
404971bb1a5SLionel Sambuc     xcb_out.destination_window = destination_window;
405971bb1a5SLionel Sambuc     xcb_out.x_offset = x_offset;
406971bb1a5SLionel Sambuc     xcb_out.y_offset = y_offset;
407971bb1a5SLionel Sambuc 
408971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
409971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
410971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
411971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
412971bb1a5SLionel Sambuc 
413971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
414971bb1a5SLionel Sambuc     return xcb_ret;
415971bb1a5SLionel Sambuc }
416971bb1a5SLionel Sambuc 
417971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_shape_offset(xcb_connection_t * c,xcb_shape_kind_t destination_kind,xcb_window_t destination_window,int16_t x_offset,int16_t y_offset)418971bb1a5SLionel Sambuc xcb_shape_offset (xcb_connection_t *c  /**< */,
419971bb1a5SLionel Sambuc                   xcb_shape_kind_t  destination_kind  /**< */,
420971bb1a5SLionel Sambuc                   xcb_window_t      destination_window  /**< */,
421971bb1a5SLionel Sambuc                   int16_t           x_offset  /**< */,
422971bb1a5SLionel Sambuc                   int16_t           y_offset  /**< */)
423971bb1a5SLionel Sambuc {
424971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
425971bb1a5SLionel Sambuc         /* count */ 2,
426971bb1a5SLionel Sambuc         /* ext */ &xcb_shape_id,
427971bb1a5SLionel Sambuc         /* opcode */ XCB_SHAPE_OFFSET,
428971bb1a5SLionel Sambuc         /* isvoid */ 1
429971bb1a5SLionel Sambuc     };
430971bb1a5SLionel Sambuc 
431971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
432971bb1a5SLionel Sambuc     xcb_void_cookie_t xcb_ret;
433971bb1a5SLionel Sambuc     xcb_shape_offset_request_t xcb_out;
434971bb1a5SLionel Sambuc 
435971bb1a5SLionel Sambuc     xcb_out.destination_kind = destination_kind;
436971bb1a5SLionel Sambuc     memset(xcb_out.pad0, 0, 3);
437971bb1a5SLionel Sambuc     xcb_out.destination_window = destination_window;
438971bb1a5SLionel Sambuc     xcb_out.x_offset = x_offset;
439971bb1a5SLionel Sambuc     xcb_out.y_offset = y_offset;
440971bb1a5SLionel Sambuc 
441971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
442971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
443971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
444971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
445971bb1a5SLionel Sambuc 
446971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
447971bb1a5SLionel Sambuc     return xcb_ret;
448971bb1a5SLionel Sambuc }
449971bb1a5SLionel Sambuc 
450971bb1a5SLionel Sambuc xcb_shape_query_extents_cookie_t
xcb_shape_query_extents(xcb_connection_t * c,xcb_window_t destination_window)451971bb1a5SLionel Sambuc xcb_shape_query_extents (xcb_connection_t *c  /**< */,
452971bb1a5SLionel Sambuc                          xcb_window_t      destination_window  /**< */)
453971bb1a5SLionel Sambuc {
454971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
455971bb1a5SLionel Sambuc         /* count */ 2,
456971bb1a5SLionel Sambuc         /* ext */ &xcb_shape_id,
457971bb1a5SLionel Sambuc         /* opcode */ XCB_SHAPE_QUERY_EXTENTS,
458971bb1a5SLionel Sambuc         /* isvoid */ 0
459971bb1a5SLionel Sambuc     };
460971bb1a5SLionel Sambuc 
461971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
462971bb1a5SLionel Sambuc     xcb_shape_query_extents_cookie_t xcb_ret;
463971bb1a5SLionel Sambuc     xcb_shape_query_extents_request_t xcb_out;
464971bb1a5SLionel Sambuc 
465971bb1a5SLionel Sambuc     xcb_out.destination_window = destination_window;
466971bb1a5SLionel Sambuc 
467971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
468971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
469971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
470971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
471971bb1a5SLionel Sambuc 
472971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
473971bb1a5SLionel Sambuc     return xcb_ret;
474971bb1a5SLionel Sambuc }
475971bb1a5SLionel Sambuc 
476971bb1a5SLionel Sambuc xcb_shape_query_extents_cookie_t
xcb_shape_query_extents_unchecked(xcb_connection_t * c,xcb_window_t destination_window)477971bb1a5SLionel Sambuc xcb_shape_query_extents_unchecked (xcb_connection_t *c  /**< */,
478971bb1a5SLionel Sambuc                                    xcb_window_t      destination_window  /**< */)
479971bb1a5SLionel Sambuc {
480971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
481971bb1a5SLionel Sambuc         /* count */ 2,
482971bb1a5SLionel Sambuc         /* ext */ &xcb_shape_id,
483971bb1a5SLionel Sambuc         /* opcode */ XCB_SHAPE_QUERY_EXTENTS,
484971bb1a5SLionel Sambuc         /* isvoid */ 0
485971bb1a5SLionel Sambuc     };
486971bb1a5SLionel Sambuc 
487971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
488971bb1a5SLionel Sambuc     xcb_shape_query_extents_cookie_t xcb_ret;
489971bb1a5SLionel Sambuc     xcb_shape_query_extents_request_t xcb_out;
490971bb1a5SLionel Sambuc 
491971bb1a5SLionel Sambuc     xcb_out.destination_window = destination_window;
492971bb1a5SLionel Sambuc 
493971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
494971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
495971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
496971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
497971bb1a5SLionel Sambuc 
498971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
499971bb1a5SLionel Sambuc     return xcb_ret;
500971bb1a5SLionel Sambuc }
501971bb1a5SLionel Sambuc 
502971bb1a5SLionel Sambuc xcb_shape_query_extents_reply_t *
xcb_shape_query_extents_reply(xcb_connection_t * c,xcb_shape_query_extents_cookie_t cookie,xcb_generic_error_t ** e)503971bb1a5SLionel Sambuc xcb_shape_query_extents_reply (xcb_connection_t                  *c  /**< */,
504971bb1a5SLionel Sambuc                                xcb_shape_query_extents_cookie_t   cookie  /**< */,
505971bb1a5SLionel Sambuc                                xcb_generic_error_t              **e  /**< */)
506971bb1a5SLionel Sambuc {
507971bb1a5SLionel Sambuc     return (xcb_shape_query_extents_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
508971bb1a5SLionel Sambuc }
509971bb1a5SLionel Sambuc 
510971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_shape_select_input_checked(xcb_connection_t * c,xcb_window_t destination_window,uint8_t enable)511971bb1a5SLionel Sambuc xcb_shape_select_input_checked (xcb_connection_t *c  /**< */,
512971bb1a5SLionel Sambuc                                 xcb_window_t      destination_window  /**< */,
513971bb1a5SLionel Sambuc                                 uint8_t           enable  /**< */)
514971bb1a5SLionel Sambuc {
515971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
516971bb1a5SLionel Sambuc         /* count */ 2,
517971bb1a5SLionel Sambuc         /* ext */ &xcb_shape_id,
518971bb1a5SLionel Sambuc         /* opcode */ XCB_SHAPE_SELECT_INPUT,
519971bb1a5SLionel Sambuc         /* isvoid */ 1
520971bb1a5SLionel Sambuc     };
521971bb1a5SLionel Sambuc 
522971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
523971bb1a5SLionel Sambuc     xcb_void_cookie_t xcb_ret;
524971bb1a5SLionel Sambuc     xcb_shape_select_input_request_t xcb_out;
525971bb1a5SLionel Sambuc 
526971bb1a5SLionel Sambuc     xcb_out.destination_window = destination_window;
527971bb1a5SLionel Sambuc     xcb_out.enable = enable;
528971bb1a5SLionel Sambuc     memset(xcb_out.pad0, 0, 3);
529971bb1a5SLionel Sambuc 
530971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
531971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
532971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
533971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
534971bb1a5SLionel Sambuc 
535971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
536971bb1a5SLionel Sambuc     return xcb_ret;
537971bb1a5SLionel Sambuc }
538971bb1a5SLionel Sambuc 
539971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_shape_select_input(xcb_connection_t * c,xcb_window_t destination_window,uint8_t enable)540971bb1a5SLionel Sambuc xcb_shape_select_input (xcb_connection_t *c  /**< */,
541971bb1a5SLionel Sambuc                         xcb_window_t      destination_window  /**< */,
542971bb1a5SLionel Sambuc                         uint8_t           enable  /**< */)
543971bb1a5SLionel Sambuc {
544971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
545971bb1a5SLionel Sambuc         /* count */ 2,
546971bb1a5SLionel Sambuc         /* ext */ &xcb_shape_id,
547971bb1a5SLionel Sambuc         /* opcode */ XCB_SHAPE_SELECT_INPUT,
548971bb1a5SLionel Sambuc         /* isvoid */ 1
549971bb1a5SLionel Sambuc     };
550971bb1a5SLionel Sambuc 
551971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
552971bb1a5SLionel Sambuc     xcb_void_cookie_t xcb_ret;
553971bb1a5SLionel Sambuc     xcb_shape_select_input_request_t xcb_out;
554971bb1a5SLionel Sambuc 
555971bb1a5SLionel Sambuc     xcb_out.destination_window = destination_window;
556971bb1a5SLionel Sambuc     xcb_out.enable = enable;
557971bb1a5SLionel Sambuc     memset(xcb_out.pad0, 0, 3);
558971bb1a5SLionel Sambuc 
559971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
560971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
561971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
562971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
563971bb1a5SLionel Sambuc 
564971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
565971bb1a5SLionel Sambuc     return xcb_ret;
566971bb1a5SLionel Sambuc }
567971bb1a5SLionel Sambuc 
568971bb1a5SLionel Sambuc xcb_shape_input_selected_cookie_t
xcb_shape_input_selected(xcb_connection_t * c,xcb_window_t destination_window)569971bb1a5SLionel Sambuc xcb_shape_input_selected (xcb_connection_t *c  /**< */,
570971bb1a5SLionel Sambuc                           xcb_window_t      destination_window  /**< */)
571971bb1a5SLionel Sambuc {
572971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
573971bb1a5SLionel Sambuc         /* count */ 2,
574971bb1a5SLionel Sambuc         /* ext */ &xcb_shape_id,
575971bb1a5SLionel Sambuc         /* opcode */ XCB_SHAPE_INPUT_SELECTED,
576971bb1a5SLionel Sambuc         /* isvoid */ 0
577971bb1a5SLionel Sambuc     };
578971bb1a5SLionel Sambuc 
579971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
580971bb1a5SLionel Sambuc     xcb_shape_input_selected_cookie_t xcb_ret;
581971bb1a5SLionel Sambuc     xcb_shape_input_selected_request_t xcb_out;
582971bb1a5SLionel Sambuc 
583971bb1a5SLionel Sambuc     xcb_out.destination_window = destination_window;
584971bb1a5SLionel Sambuc 
585971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
586971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
587971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
588971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
589971bb1a5SLionel Sambuc 
590971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
591971bb1a5SLionel Sambuc     return xcb_ret;
592971bb1a5SLionel Sambuc }
593971bb1a5SLionel Sambuc 
594971bb1a5SLionel Sambuc xcb_shape_input_selected_cookie_t
xcb_shape_input_selected_unchecked(xcb_connection_t * c,xcb_window_t destination_window)595971bb1a5SLionel Sambuc xcb_shape_input_selected_unchecked (xcb_connection_t *c  /**< */,
596971bb1a5SLionel Sambuc                                     xcb_window_t      destination_window  /**< */)
597971bb1a5SLionel Sambuc {
598971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
599971bb1a5SLionel Sambuc         /* count */ 2,
600971bb1a5SLionel Sambuc         /* ext */ &xcb_shape_id,
601971bb1a5SLionel Sambuc         /* opcode */ XCB_SHAPE_INPUT_SELECTED,
602971bb1a5SLionel Sambuc         /* isvoid */ 0
603971bb1a5SLionel Sambuc     };
604971bb1a5SLionel Sambuc 
605971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
606971bb1a5SLionel Sambuc     xcb_shape_input_selected_cookie_t xcb_ret;
607971bb1a5SLionel Sambuc     xcb_shape_input_selected_request_t xcb_out;
608971bb1a5SLionel Sambuc 
609971bb1a5SLionel Sambuc     xcb_out.destination_window = destination_window;
610971bb1a5SLionel Sambuc 
611971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
612971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
613971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
614971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
615971bb1a5SLionel Sambuc 
616971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
617971bb1a5SLionel Sambuc     return xcb_ret;
618971bb1a5SLionel Sambuc }
619971bb1a5SLionel Sambuc 
620971bb1a5SLionel Sambuc xcb_shape_input_selected_reply_t *
xcb_shape_input_selected_reply(xcb_connection_t * c,xcb_shape_input_selected_cookie_t cookie,xcb_generic_error_t ** e)621971bb1a5SLionel Sambuc xcb_shape_input_selected_reply (xcb_connection_t                   *c  /**< */,
622971bb1a5SLionel Sambuc                                 xcb_shape_input_selected_cookie_t   cookie  /**< */,
623971bb1a5SLionel Sambuc                                 xcb_generic_error_t               **e  /**< */)
624971bb1a5SLionel Sambuc {
625971bb1a5SLionel Sambuc     return (xcb_shape_input_selected_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
626971bb1a5SLionel Sambuc }
627971bb1a5SLionel Sambuc 
628971bb1a5SLionel Sambuc int
xcb_shape_get_rectangles_sizeof(const void * _buffer)629971bb1a5SLionel Sambuc xcb_shape_get_rectangles_sizeof (const void  *_buffer  /**< */)
630971bb1a5SLionel Sambuc {
631971bb1a5SLionel Sambuc     char *xcb_tmp = (char *)_buffer;
632971bb1a5SLionel Sambuc     const xcb_shape_get_rectangles_reply_t *_aux = (xcb_shape_get_rectangles_reply_t *)_buffer;
633971bb1a5SLionel Sambuc     unsigned int xcb_buffer_len = 0;
634971bb1a5SLionel Sambuc     unsigned int xcb_block_len = 0;
635971bb1a5SLionel Sambuc     unsigned int xcb_pad = 0;
636*0a6a1f1dSLionel Sambuc     unsigned int xcb_align_to = 0;
637971bb1a5SLionel Sambuc 
638971bb1a5SLionel Sambuc 
639971bb1a5SLionel Sambuc     xcb_block_len += sizeof(xcb_shape_get_rectangles_reply_t);
640971bb1a5SLionel Sambuc     xcb_tmp += xcb_block_len;
641*0a6a1f1dSLionel Sambuc     xcb_buffer_len += xcb_block_len;
642*0a6a1f1dSLionel Sambuc     xcb_block_len = 0;
643971bb1a5SLionel Sambuc     /* rectangles */
644971bb1a5SLionel Sambuc     xcb_block_len += _aux->rectangles_len * sizeof(xcb_rectangle_t);
645971bb1a5SLionel Sambuc     xcb_tmp += xcb_block_len;
646971bb1a5SLionel Sambuc     xcb_align_to = ALIGNOF(xcb_rectangle_t);
647971bb1a5SLionel Sambuc     /* insert padding */
648971bb1a5SLionel Sambuc     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
649971bb1a5SLionel Sambuc     xcb_buffer_len += xcb_block_len + xcb_pad;
650971bb1a5SLionel Sambuc     if (0 != xcb_pad) {
651971bb1a5SLionel Sambuc         xcb_tmp += xcb_pad;
652971bb1a5SLionel Sambuc         xcb_pad = 0;
653971bb1a5SLionel Sambuc     }
654971bb1a5SLionel Sambuc     xcb_block_len = 0;
655971bb1a5SLionel Sambuc 
656971bb1a5SLionel Sambuc     return xcb_buffer_len;
657971bb1a5SLionel Sambuc }
658971bb1a5SLionel Sambuc 
659971bb1a5SLionel Sambuc xcb_shape_get_rectangles_cookie_t
xcb_shape_get_rectangles(xcb_connection_t * c,xcb_window_t window,xcb_shape_kind_t source_kind)660971bb1a5SLionel Sambuc xcb_shape_get_rectangles (xcb_connection_t *c  /**< */,
661971bb1a5SLionel Sambuc                           xcb_window_t      window  /**< */,
662971bb1a5SLionel Sambuc                           xcb_shape_kind_t  source_kind  /**< */)
663971bb1a5SLionel Sambuc {
664971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
665971bb1a5SLionel Sambuc         /* count */ 2,
666971bb1a5SLionel Sambuc         /* ext */ &xcb_shape_id,
667971bb1a5SLionel Sambuc         /* opcode */ XCB_SHAPE_GET_RECTANGLES,
668971bb1a5SLionel Sambuc         /* isvoid */ 0
669971bb1a5SLionel Sambuc     };
670971bb1a5SLionel Sambuc 
671971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
672971bb1a5SLionel Sambuc     xcb_shape_get_rectangles_cookie_t xcb_ret;
673971bb1a5SLionel Sambuc     xcb_shape_get_rectangles_request_t xcb_out;
674971bb1a5SLionel Sambuc 
675971bb1a5SLionel Sambuc     xcb_out.window = window;
676971bb1a5SLionel Sambuc     xcb_out.source_kind = source_kind;
677971bb1a5SLionel Sambuc     memset(xcb_out.pad0, 0, 3);
678971bb1a5SLionel Sambuc 
679971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
680971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
681971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
682971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
683971bb1a5SLionel Sambuc 
684971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
685971bb1a5SLionel Sambuc     return xcb_ret;
686971bb1a5SLionel Sambuc }
687971bb1a5SLionel Sambuc 
688971bb1a5SLionel Sambuc xcb_shape_get_rectangles_cookie_t
xcb_shape_get_rectangles_unchecked(xcb_connection_t * c,xcb_window_t window,xcb_shape_kind_t source_kind)689971bb1a5SLionel Sambuc xcb_shape_get_rectangles_unchecked (xcb_connection_t *c  /**< */,
690971bb1a5SLionel Sambuc                                     xcb_window_t      window  /**< */,
691971bb1a5SLionel Sambuc                                     xcb_shape_kind_t  source_kind  /**< */)
692971bb1a5SLionel Sambuc {
693971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
694971bb1a5SLionel Sambuc         /* count */ 2,
695971bb1a5SLionel Sambuc         /* ext */ &xcb_shape_id,
696971bb1a5SLionel Sambuc         /* opcode */ XCB_SHAPE_GET_RECTANGLES,
697971bb1a5SLionel Sambuc         /* isvoid */ 0
698971bb1a5SLionel Sambuc     };
699971bb1a5SLionel Sambuc 
700971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
701971bb1a5SLionel Sambuc     xcb_shape_get_rectangles_cookie_t xcb_ret;
702971bb1a5SLionel Sambuc     xcb_shape_get_rectangles_request_t xcb_out;
703971bb1a5SLionel Sambuc 
704971bb1a5SLionel Sambuc     xcb_out.window = window;
705971bb1a5SLionel Sambuc     xcb_out.source_kind = source_kind;
706971bb1a5SLionel Sambuc     memset(xcb_out.pad0, 0, 3);
707971bb1a5SLionel Sambuc 
708971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
709971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
710971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
711971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
712971bb1a5SLionel Sambuc 
713971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
714971bb1a5SLionel Sambuc     return xcb_ret;
715971bb1a5SLionel Sambuc }
716971bb1a5SLionel Sambuc 
717971bb1a5SLionel Sambuc xcb_rectangle_t *
xcb_shape_get_rectangles_rectangles(const xcb_shape_get_rectangles_reply_t * R)718971bb1a5SLionel Sambuc xcb_shape_get_rectangles_rectangles (const xcb_shape_get_rectangles_reply_t *R  /**< */)
719971bb1a5SLionel Sambuc {
720971bb1a5SLionel Sambuc     return (xcb_rectangle_t *) (R + 1);
721971bb1a5SLionel Sambuc }
722971bb1a5SLionel Sambuc 
723971bb1a5SLionel Sambuc int
xcb_shape_get_rectangles_rectangles_length(const xcb_shape_get_rectangles_reply_t * R)724971bb1a5SLionel Sambuc xcb_shape_get_rectangles_rectangles_length (const xcb_shape_get_rectangles_reply_t *R  /**< */)
725971bb1a5SLionel Sambuc {
726971bb1a5SLionel Sambuc     return R->rectangles_len;
727971bb1a5SLionel Sambuc }
728971bb1a5SLionel Sambuc 
729971bb1a5SLionel Sambuc xcb_rectangle_iterator_t
xcb_shape_get_rectangles_rectangles_iterator(const xcb_shape_get_rectangles_reply_t * R)730971bb1a5SLionel Sambuc xcb_shape_get_rectangles_rectangles_iterator (const xcb_shape_get_rectangles_reply_t *R  /**< */)
731971bb1a5SLionel Sambuc {
732971bb1a5SLionel Sambuc     xcb_rectangle_iterator_t i;
733971bb1a5SLionel Sambuc     i.data = (xcb_rectangle_t *) (R + 1);
734971bb1a5SLionel Sambuc     i.rem = R->rectangles_len;
735971bb1a5SLionel Sambuc     i.index = (char *) i.data - (char *) R;
736971bb1a5SLionel Sambuc     return i;
737971bb1a5SLionel Sambuc }
738971bb1a5SLionel Sambuc 
739971bb1a5SLionel Sambuc xcb_shape_get_rectangles_reply_t *
xcb_shape_get_rectangles_reply(xcb_connection_t * c,xcb_shape_get_rectangles_cookie_t cookie,xcb_generic_error_t ** e)740971bb1a5SLionel Sambuc xcb_shape_get_rectangles_reply (xcb_connection_t                   *c  /**< */,
741971bb1a5SLionel Sambuc                                 xcb_shape_get_rectangles_cookie_t   cookie  /**< */,
742971bb1a5SLionel Sambuc                                 xcb_generic_error_t               **e  /**< */)
743971bb1a5SLionel Sambuc {
744971bb1a5SLionel Sambuc     return (xcb_shape_get_rectangles_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
745971bb1a5SLionel Sambuc }
746971bb1a5SLionel Sambuc 
747