xref: /minix/external/mit/xorg/lib/libxcb/files/render.c (revision 0a6a1f1d)
1 /*
2  * This file generated automatically from render.xml by c_client.py.
3  * Edit at your peril.
4  */
5 
6 #ifdef HAVE_CONFIG_H
7 #include "config.h"
8 #endif
9 #include <stdlib.h>
10 #include <string.h>
11 #include <assert.h>
12 #include <stddef.h>  /* for offsetof() */
13 #include "xcbext.h"
14 #include "render.h"
15 
16 #define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member)
17 #include "xproto.h"
18 
19 xcb_extension_t xcb_render_id = { "RENDER", 0 };
20 
21 void
xcb_render_glyph_next(xcb_render_glyph_iterator_t * i)22 xcb_render_glyph_next (xcb_render_glyph_iterator_t *i  /**< */)
23 {
24     --i->rem;
25     ++i->data;
26     i->index += sizeof(xcb_render_glyph_t);
27 }
28 
29 xcb_generic_iterator_t
xcb_render_glyph_end(xcb_render_glyph_iterator_t i)30 xcb_render_glyph_end (xcb_render_glyph_iterator_t i  /**< */)
31 {
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;
37 }
38 
39 void
xcb_render_glyphset_next(xcb_render_glyphset_iterator_t * i)40 xcb_render_glyphset_next (xcb_render_glyphset_iterator_t *i  /**< */)
41 {
42     --i->rem;
43     ++i->data;
44     i->index += sizeof(xcb_render_glyphset_t);
45 }
46 
47 xcb_generic_iterator_t
xcb_render_glyphset_end(xcb_render_glyphset_iterator_t i)48 xcb_render_glyphset_end (xcb_render_glyphset_iterator_t i  /**< */)
49 {
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;
55 }
56 
57 void
xcb_render_picture_next(xcb_render_picture_iterator_t * i)58 xcb_render_picture_next (xcb_render_picture_iterator_t *i  /**< */)
59 {
60     --i->rem;
61     ++i->data;
62     i->index += sizeof(xcb_render_picture_t);
63 }
64 
65 xcb_generic_iterator_t
xcb_render_picture_end(xcb_render_picture_iterator_t i)66 xcb_render_picture_end (xcb_render_picture_iterator_t i  /**< */)
67 {
68     xcb_generic_iterator_t ret;
69     ret.data = i.data + i.rem;
70     ret.index = i.index + ((char *) ret.data - (char *) i.data);
71     ret.rem = 0;
72     return ret;
73 }
74 
75 void
xcb_render_pictformat_next(xcb_render_pictformat_iterator_t * i)76 xcb_render_pictformat_next (xcb_render_pictformat_iterator_t *i  /**< */)
77 {
78     --i->rem;
79     ++i->data;
80     i->index += sizeof(xcb_render_pictformat_t);
81 }
82 
83 xcb_generic_iterator_t
xcb_render_pictformat_end(xcb_render_pictformat_iterator_t i)84 xcb_render_pictformat_end (xcb_render_pictformat_iterator_t i  /**< */)
85 {
86     xcb_generic_iterator_t ret;
87     ret.data = i.data + i.rem;
88     ret.index = i.index + ((char *) ret.data - (char *) i.data);
89     ret.rem = 0;
90     return ret;
91 }
92 
93 void
xcb_render_fixed_next(xcb_render_fixed_iterator_t * i)94 xcb_render_fixed_next (xcb_render_fixed_iterator_t *i  /**< */)
95 {
96     --i->rem;
97     ++i->data;
98     i->index += sizeof(xcb_render_fixed_t);
99 }
100 
101 xcb_generic_iterator_t
xcb_render_fixed_end(xcb_render_fixed_iterator_t i)102 xcb_render_fixed_end (xcb_render_fixed_iterator_t i  /**< */)
103 {
104     xcb_generic_iterator_t ret;
105     ret.data = i.data + i.rem;
106     ret.index = i.index + ((char *) ret.data - (char *) i.data);
107     ret.rem = 0;
108     return ret;
109 }
110 
111 void
xcb_render_directformat_next(xcb_render_directformat_iterator_t * i)112 xcb_render_directformat_next (xcb_render_directformat_iterator_t *i  /**< */)
113 {
114     --i->rem;
115     ++i->data;
116     i->index += sizeof(xcb_render_directformat_t);
117 }
118 
119 xcb_generic_iterator_t
xcb_render_directformat_end(xcb_render_directformat_iterator_t i)120 xcb_render_directformat_end (xcb_render_directformat_iterator_t i  /**< */)
121 {
122     xcb_generic_iterator_t ret;
123     ret.data = i.data + i.rem;
124     ret.index = i.index + ((char *) ret.data - (char *) i.data);
125     ret.rem = 0;
126     return ret;
127 }
128 
129 void
xcb_render_pictforminfo_next(xcb_render_pictforminfo_iterator_t * i)130 xcb_render_pictforminfo_next (xcb_render_pictforminfo_iterator_t *i  /**< */)
131 {
132     --i->rem;
133     ++i->data;
134     i->index += sizeof(xcb_render_pictforminfo_t);
135 }
136 
137 xcb_generic_iterator_t
xcb_render_pictforminfo_end(xcb_render_pictforminfo_iterator_t i)138 xcb_render_pictforminfo_end (xcb_render_pictforminfo_iterator_t i  /**< */)
139 {
140     xcb_generic_iterator_t ret;
141     ret.data = i.data + i.rem;
142     ret.index = i.index + ((char *) ret.data - (char *) i.data);
143     ret.rem = 0;
144     return ret;
145 }
146 
147 void
xcb_render_pictvisual_next(xcb_render_pictvisual_iterator_t * i)148 xcb_render_pictvisual_next (xcb_render_pictvisual_iterator_t *i  /**< */)
149 {
150     --i->rem;
151     ++i->data;
152     i->index += sizeof(xcb_render_pictvisual_t);
153 }
154 
155 xcb_generic_iterator_t
xcb_render_pictvisual_end(xcb_render_pictvisual_iterator_t i)156 xcb_render_pictvisual_end (xcb_render_pictvisual_iterator_t i  /**< */)
157 {
158     xcb_generic_iterator_t ret;
159     ret.data = i.data + i.rem;
160     ret.index = i.index + ((char *) ret.data - (char *) i.data);
161     ret.rem = 0;
162     return ret;
163 }
164 
165 int
xcb_render_pictdepth_sizeof(const void * _buffer)166 xcb_render_pictdepth_sizeof (const void  *_buffer  /**< */)
167 {
168     char *xcb_tmp = (char *)_buffer;
169     const xcb_render_pictdepth_t *_aux = (xcb_render_pictdepth_t *)_buffer;
170     unsigned int xcb_buffer_len = 0;
171     unsigned int xcb_block_len = 0;
172     unsigned int xcb_pad = 0;
173     unsigned int xcb_align_to = 0;
174 
175 
176     xcb_block_len += sizeof(xcb_render_pictdepth_t);
177     xcb_tmp += xcb_block_len;
178     xcb_buffer_len += xcb_block_len;
179     xcb_block_len = 0;
180     /* visuals */
181     xcb_block_len += _aux->num_visuals * sizeof(xcb_render_pictvisual_t);
182     xcb_tmp += xcb_block_len;
183     xcb_align_to = ALIGNOF(xcb_render_pictvisual_t);
184     /* insert padding */
185     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
186     xcb_buffer_len += xcb_block_len + xcb_pad;
187     if (0 != xcb_pad) {
188         xcb_tmp += xcb_pad;
189         xcb_pad = 0;
190     }
191     xcb_block_len = 0;
192 
193     return xcb_buffer_len;
194 }
195 
196 xcb_render_pictvisual_t *
xcb_render_pictdepth_visuals(const xcb_render_pictdepth_t * R)197 xcb_render_pictdepth_visuals (const xcb_render_pictdepth_t *R  /**< */)
198 {
199     return (xcb_render_pictvisual_t *) (R + 1);
200 }
201 
202 int
xcb_render_pictdepth_visuals_length(const xcb_render_pictdepth_t * R)203 xcb_render_pictdepth_visuals_length (const xcb_render_pictdepth_t *R  /**< */)
204 {
205     return R->num_visuals;
206 }
207 
208 xcb_render_pictvisual_iterator_t
xcb_render_pictdepth_visuals_iterator(const xcb_render_pictdepth_t * R)209 xcb_render_pictdepth_visuals_iterator (const xcb_render_pictdepth_t *R  /**< */)
210 {
211     xcb_render_pictvisual_iterator_t i;
212     i.data = (xcb_render_pictvisual_t *) (R + 1);
213     i.rem = R->num_visuals;
214     i.index = (char *) i.data - (char *) R;
215     return i;
216 }
217 
218 void
xcb_render_pictdepth_next(xcb_render_pictdepth_iterator_t * i)219 xcb_render_pictdepth_next (xcb_render_pictdepth_iterator_t *i  /**< */)
220 {
221     xcb_render_pictdepth_t *R = i->data;
222     xcb_generic_iterator_t child;
223     child.data = (xcb_render_pictdepth_t *)(((char *)R) + xcb_render_pictdepth_sizeof(R));
224     i->index = (char *) child.data - (char *) i->data;
225     --i->rem;
226     i->data = (xcb_render_pictdepth_t *) child.data;
227 }
228 
229 xcb_generic_iterator_t
xcb_render_pictdepth_end(xcb_render_pictdepth_iterator_t i)230 xcb_render_pictdepth_end (xcb_render_pictdepth_iterator_t i  /**< */)
231 {
232     xcb_generic_iterator_t ret;
233     while(i.rem > 0)
234         xcb_render_pictdepth_next(&i);
235     ret.data = i.data;
236     ret.rem = i.rem;
237     ret.index = i.index;
238     return ret;
239 }
240 
241 int
xcb_render_pictscreen_sizeof(const void * _buffer)242 xcb_render_pictscreen_sizeof (const void  *_buffer  /**< */)
243 {
244     char *xcb_tmp = (char *)_buffer;
245     const xcb_render_pictscreen_t *_aux = (xcb_render_pictscreen_t *)_buffer;
246     unsigned int xcb_buffer_len = 0;
247     unsigned int xcb_block_len = 0;
248     unsigned int xcb_pad = 0;
249     unsigned int xcb_align_to = 0;
250 
251     unsigned int i;
252     unsigned int xcb_tmp_len;
253 
254     xcb_block_len += sizeof(xcb_render_pictscreen_t);
255     xcb_tmp += xcb_block_len;
256     xcb_buffer_len += xcb_block_len;
257     xcb_block_len = 0;
258     /* depths */
259     for(i=0; i<_aux->num_depths; i++) {
260         xcb_tmp_len = xcb_render_pictdepth_sizeof(xcb_tmp);
261         xcb_block_len += xcb_tmp_len;
262         xcb_tmp += xcb_tmp_len;
263     }
264     xcb_align_to = ALIGNOF(xcb_render_pictdepth_t);
265     /* insert padding */
266     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
267     xcb_buffer_len += xcb_block_len + xcb_pad;
268     if (0 != xcb_pad) {
269         xcb_tmp += xcb_pad;
270         xcb_pad = 0;
271     }
272     xcb_block_len = 0;
273 
274     return xcb_buffer_len;
275 }
276 
277 int
xcb_render_pictscreen_depths_length(const xcb_render_pictscreen_t * R)278 xcb_render_pictscreen_depths_length (const xcb_render_pictscreen_t *R  /**< */)
279 {
280     return R->num_depths;
281 }
282 
283 xcb_render_pictdepth_iterator_t
xcb_render_pictscreen_depths_iterator(const xcb_render_pictscreen_t * R)284 xcb_render_pictscreen_depths_iterator (const xcb_render_pictscreen_t *R  /**< */)
285 {
286     xcb_render_pictdepth_iterator_t i;
287     i.data = (xcb_render_pictdepth_t *) (R + 1);
288     i.rem = R->num_depths;
289     i.index = (char *) i.data - (char *) R;
290     return i;
291 }
292 
293 void
xcb_render_pictscreen_next(xcb_render_pictscreen_iterator_t * i)294 xcb_render_pictscreen_next (xcb_render_pictscreen_iterator_t *i  /**< */)
295 {
296     xcb_render_pictscreen_t *R = i->data;
297     xcb_generic_iterator_t child;
298     child.data = (xcb_render_pictscreen_t *)(((char *)R) + xcb_render_pictscreen_sizeof(R));
299     i->index = (char *) child.data - (char *) i->data;
300     --i->rem;
301     i->data = (xcb_render_pictscreen_t *) child.data;
302 }
303 
304 xcb_generic_iterator_t
xcb_render_pictscreen_end(xcb_render_pictscreen_iterator_t i)305 xcb_render_pictscreen_end (xcb_render_pictscreen_iterator_t i  /**< */)
306 {
307     xcb_generic_iterator_t ret;
308     while(i.rem > 0)
309         xcb_render_pictscreen_next(&i);
310     ret.data = i.data;
311     ret.rem = i.rem;
312     ret.index = i.index;
313     return ret;
314 }
315 
316 void
xcb_render_indexvalue_next(xcb_render_indexvalue_iterator_t * i)317 xcb_render_indexvalue_next (xcb_render_indexvalue_iterator_t *i  /**< */)
318 {
319     --i->rem;
320     ++i->data;
321     i->index += sizeof(xcb_render_indexvalue_t);
322 }
323 
324 xcb_generic_iterator_t
xcb_render_indexvalue_end(xcb_render_indexvalue_iterator_t i)325 xcb_render_indexvalue_end (xcb_render_indexvalue_iterator_t i  /**< */)
326 {
327     xcb_generic_iterator_t ret;
328     ret.data = i.data + i.rem;
329     ret.index = i.index + ((char *) ret.data - (char *) i.data);
330     ret.rem = 0;
331     return ret;
332 }
333 
334 void
xcb_render_color_next(xcb_render_color_iterator_t * i)335 xcb_render_color_next (xcb_render_color_iterator_t *i  /**< */)
336 {
337     --i->rem;
338     ++i->data;
339     i->index += sizeof(xcb_render_color_t);
340 }
341 
342 xcb_generic_iterator_t
xcb_render_color_end(xcb_render_color_iterator_t i)343 xcb_render_color_end (xcb_render_color_iterator_t i  /**< */)
344 {
345     xcb_generic_iterator_t ret;
346     ret.data = i.data + i.rem;
347     ret.index = i.index + ((char *) ret.data - (char *) i.data);
348     ret.rem = 0;
349     return ret;
350 }
351 
352 void
xcb_render_pointfix_next(xcb_render_pointfix_iterator_t * i)353 xcb_render_pointfix_next (xcb_render_pointfix_iterator_t *i  /**< */)
354 {
355     --i->rem;
356     ++i->data;
357     i->index += sizeof(xcb_render_pointfix_t);
358 }
359 
360 xcb_generic_iterator_t
xcb_render_pointfix_end(xcb_render_pointfix_iterator_t i)361 xcb_render_pointfix_end (xcb_render_pointfix_iterator_t i  /**< */)
362 {
363     xcb_generic_iterator_t ret;
364     ret.data = i.data + i.rem;
365     ret.index = i.index + ((char *) ret.data - (char *) i.data);
366     ret.rem = 0;
367     return ret;
368 }
369 
370 void
xcb_render_linefix_next(xcb_render_linefix_iterator_t * i)371 xcb_render_linefix_next (xcb_render_linefix_iterator_t *i  /**< */)
372 {
373     --i->rem;
374     ++i->data;
375     i->index += sizeof(xcb_render_linefix_t);
376 }
377 
378 xcb_generic_iterator_t
xcb_render_linefix_end(xcb_render_linefix_iterator_t i)379 xcb_render_linefix_end (xcb_render_linefix_iterator_t i  /**< */)
380 {
381     xcb_generic_iterator_t ret;
382     ret.data = i.data + i.rem;
383     ret.index = i.index + ((char *) ret.data - (char *) i.data);
384     ret.rem = 0;
385     return ret;
386 }
387 
388 void
xcb_render_triangle_next(xcb_render_triangle_iterator_t * i)389 xcb_render_triangle_next (xcb_render_triangle_iterator_t *i  /**< */)
390 {
391     --i->rem;
392     ++i->data;
393     i->index += sizeof(xcb_render_triangle_t);
394 }
395 
396 xcb_generic_iterator_t
xcb_render_triangle_end(xcb_render_triangle_iterator_t i)397 xcb_render_triangle_end (xcb_render_triangle_iterator_t i  /**< */)
398 {
399     xcb_generic_iterator_t ret;
400     ret.data = i.data + i.rem;
401     ret.index = i.index + ((char *) ret.data - (char *) i.data);
402     ret.rem = 0;
403     return ret;
404 }
405 
406 void
xcb_render_trapezoid_next(xcb_render_trapezoid_iterator_t * i)407 xcb_render_trapezoid_next (xcb_render_trapezoid_iterator_t *i  /**< */)
408 {
409     --i->rem;
410     ++i->data;
411     i->index += sizeof(xcb_render_trapezoid_t);
412 }
413 
414 xcb_generic_iterator_t
xcb_render_trapezoid_end(xcb_render_trapezoid_iterator_t i)415 xcb_render_trapezoid_end (xcb_render_trapezoid_iterator_t i  /**< */)
416 {
417     xcb_generic_iterator_t ret;
418     ret.data = i.data + i.rem;
419     ret.index = i.index + ((char *) ret.data - (char *) i.data);
420     ret.rem = 0;
421     return ret;
422 }
423 
424 void
xcb_render_glyphinfo_next(xcb_render_glyphinfo_iterator_t * i)425 xcb_render_glyphinfo_next (xcb_render_glyphinfo_iterator_t *i  /**< */)
426 {
427     --i->rem;
428     ++i->data;
429     i->index += sizeof(xcb_render_glyphinfo_t);
430 }
431 
432 xcb_generic_iterator_t
xcb_render_glyphinfo_end(xcb_render_glyphinfo_iterator_t i)433 xcb_render_glyphinfo_end (xcb_render_glyphinfo_iterator_t i  /**< */)
434 {
435     xcb_generic_iterator_t ret;
436     ret.data = i.data + i.rem;
437     ret.index = i.index + ((char *) ret.data - (char *) i.data);
438     ret.rem = 0;
439     return ret;
440 }
441 
442 xcb_render_query_version_cookie_t
xcb_render_query_version(xcb_connection_t * c,uint32_t client_major_version,uint32_t client_minor_version)443 xcb_render_query_version (xcb_connection_t *c  /**< */,
444                           uint32_t          client_major_version  /**< */,
445                           uint32_t          client_minor_version  /**< */)
446 {
447     static const xcb_protocol_request_t xcb_req = {
448         /* count */ 2,
449         /* ext */ &xcb_render_id,
450         /* opcode */ XCB_RENDER_QUERY_VERSION,
451         /* isvoid */ 0
452     };
453 
454     struct iovec xcb_parts[4];
455     xcb_render_query_version_cookie_t xcb_ret;
456     xcb_render_query_version_request_t xcb_out;
457 
458     xcb_out.client_major_version = client_major_version;
459     xcb_out.client_minor_version = client_minor_version;
460 
461     xcb_parts[2].iov_base = (char *) &xcb_out;
462     xcb_parts[2].iov_len = sizeof(xcb_out);
463     xcb_parts[3].iov_base = 0;
464     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
465 
466     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
467     return xcb_ret;
468 }
469 
470 xcb_render_query_version_cookie_t
xcb_render_query_version_unchecked(xcb_connection_t * c,uint32_t client_major_version,uint32_t client_minor_version)471 xcb_render_query_version_unchecked (xcb_connection_t *c  /**< */,
472                                     uint32_t          client_major_version  /**< */,
473                                     uint32_t          client_minor_version  /**< */)
474 {
475     static const xcb_protocol_request_t xcb_req = {
476         /* count */ 2,
477         /* ext */ &xcb_render_id,
478         /* opcode */ XCB_RENDER_QUERY_VERSION,
479         /* isvoid */ 0
480     };
481 
482     struct iovec xcb_parts[4];
483     xcb_render_query_version_cookie_t xcb_ret;
484     xcb_render_query_version_request_t xcb_out;
485 
486     xcb_out.client_major_version = client_major_version;
487     xcb_out.client_minor_version = client_minor_version;
488 
489     xcb_parts[2].iov_base = (char *) &xcb_out;
490     xcb_parts[2].iov_len = sizeof(xcb_out);
491     xcb_parts[3].iov_base = 0;
492     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
493 
494     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
495     return xcb_ret;
496 }
497 
498 xcb_render_query_version_reply_t *
xcb_render_query_version_reply(xcb_connection_t * c,xcb_render_query_version_cookie_t cookie,xcb_generic_error_t ** e)499 xcb_render_query_version_reply (xcb_connection_t                   *c  /**< */,
500                                 xcb_render_query_version_cookie_t   cookie  /**< */,
501                                 xcb_generic_error_t               **e  /**< */)
502 {
503     return (xcb_render_query_version_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
504 }
505 
506 int
xcb_render_query_pict_formats_sizeof(const void * _buffer)507 xcb_render_query_pict_formats_sizeof (const void  *_buffer  /**< */)
508 {
509     char *xcb_tmp = (char *)_buffer;
510     const xcb_render_query_pict_formats_reply_t *_aux = (xcb_render_query_pict_formats_reply_t *)_buffer;
511     unsigned int xcb_buffer_len = 0;
512     unsigned int xcb_block_len = 0;
513     unsigned int xcb_pad = 0;
514     unsigned int xcb_align_to = 0;
515 
516     unsigned int i;
517     unsigned int xcb_tmp_len;
518 
519     xcb_block_len += sizeof(xcb_render_query_pict_formats_reply_t);
520     xcb_tmp += xcb_block_len;
521     xcb_buffer_len += xcb_block_len;
522     xcb_block_len = 0;
523     /* formats */
524     xcb_block_len += _aux->num_formats * sizeof(xcb_render_pictforminfo_t);
525     xcb_tmp += xcb_block_len;
526     xcb_align_to = ALIGNOF(xcb_render_pictforminfo_t);
527     /* insert padding */
528     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
529     xcb_buffer_len += xcb_block_len + xcb_pad;
530     if (0 != xcb_pad) {
531         xcb_tmp += xcb_pad;
532         xcb_pad = 0;
533     }
534     xcb_block_len = 0;
535     /* screens */
536     for(i=0; i<_aux->num_screens; i++) {
537         xcb_tmp_len = xcb_render_pictscreen_sizeof(xcb_tmp);
538         xcb_block_len += xcb_tmp_len;
539         xcb_tmp += xcb_tmp_len;
540     }
541     xcb_align_to = ALIGNOF(xcb_render_pictscreen_t);
542     /* insert padding */
543     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
544     xcb_buffer_len += xcb_block_len + xcb_pad;
545     if (0 != xcb_pad) {
546         xcb_tmp += xcb_pad;
547         xcb_pad = 0;
548     }
549     xcb_block_len = 0;
550     /* subpixels */
551     xcb_block_len += _aux->num_subpixel * sizeof(uint32_t);
552     xcb_tmp += xcb_block_len;
553     xcb_align_to = ALIGNOF(uint32_t);
554     /* insert padding */
555     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
556     xcb_buffer_len += xcb_block_len + xcb_pad;
557     if (0 != xcb_pad) {
558         xcb_tmp += xcb_pad;
559         xcb_pad = 0;
560     }
561     xcb_block_len = 0;
562 
563     return xcb_buffer_len;
564 }
565 
566 xcb_render_query_pict_formats_cookie_t
xcb_render_query_pict_formats(xcb_connection_t * c)567 xcb_render_query_pict_formats (xcb_connection_t *c  /**< */)
568 {
569     static const xcb_protocol_request_t xcb_req = {
570         /* count */ 2,
571         /* ext */ &xcb_render_id,
572         /* opcode */ XCB_RENDER_QUERY_PICT_FORMATS,
573         /* isvoid */ 0
574     };
575 
576     struct iovec xcb_parts[4];
577     xcb_render_query_pict_formats_cookie_t xcb_ret;
578     xcb_render_query_pict_formats_request_t xcb_out;
579 
580 
581     xcb_parts[2].iov_base = (char *) &xcb_out;
582     xcb_parts[2].iov_len = sizeof(xcb_out);
583     xcb_parts[3].iov_base = 0;
584     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
585 
586     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
587     return xcb_ret;
588 }
589 
590 xcb_render_query_pict_formats_cookie_t
xcb_render_query_pict_formats_unchecked(xcb_connection_t * c)591 xcb_render_query_pict_formats_unchecked (xcb_connection_t *c  /**< */)
592 {
593     static const xcb_protocol_request_t xcb_req = {
594         /* count */ 2,
595         /* ext */ &xcb_render_id,
596         /* opcode */ XCB_RENDER_QUERY_PICT_FORMATS,
597         /* isvoid */ 0
598     };
599 
600     struct iovec xcb_parts[4];
601     xcb_render_query_pict_formats_cookie_t xcb_ret;
602     xcb_render_query_pict_formats_request_t xcb_out;
603 
604 
605     xcb_parts[2].iov_base = (char *) &xcb_out;
606     xcb_parts[2].iov_len = sizeof(xcb_out);
607     xcb_parts[3].iov_base = 0;
608     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
609 
610     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
611     return xcb_ret;
612 }
613 
614 xcb_render_pictforminfo_t *
xcb_render_query_pict_formats_formats(const xcb_render_query_pict_formats_reply_t * R)615 xcb_render_query_pict_formats_formats (const xcb_render_query_pict_formats_reply_t *R  /**< */)
616 {
617     return (xcb_render_pictforminfo_t *) (R + 1);
618 }
619 
620 int
xcb_render_query_pict_formats_formats_length(const xcb_render_query_pict_formats_reply_t * R)621 xcb_render_query_pict_formats_formats_length (const xcb_render_query_pict_formats_reply_t *R  /**< */)
622 {
623     return R->num_formats;
624 }
625 
626 xcb_render_pictforminfo_iterator_t
xcb_render_query_pict_formats_formats_iterator(const xcb_render_query_pict_formats_reply_t * R)627 xcb_render_query_pict_formats_formats_iterator (const xcb_render_query_pict_formats_reply_t *R  /**< */)
628 {
629     xcb_render_pictforminfo_iterator_t i;
630     i.data = (xcb_render_pictforminfo_t *) (R + 1);
631     i.rem = R->num_formats;
632     i.index = (char *) i.data - (char *) R;
633     return i;
634 }
635 
636 int
xcb_render_query_pict_formats_screens_length(const xcb_render_query_pict_formats_reply_t * R)637 xcb_render_query_pict_formats_screens_length (const xcb_render_query_pict_formats_reply_t *R  /**< */)
638 {
639     return R->num_screens;
640 }
641 
642 xcb_render_pictscreen_iterator_t
xcb_render_query_pict_formats_screens_iterator(const xcb_render_query_pict_formats_reply_t * R)643 xcb_render_query_pict_formats_screens_iterator (const xcb_render_query_pict_formats_reply_t *R  /**< */)
644 {
645     xcb_render_pictscreen_iterator_t i;
646     xcb_generic_iterator_t prev = xcb_render_pictforminfo_end(xcb_render_query_pict_formats_formats_iterator(R));
647     i.data = (xcb_render_pictscreen_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_render_pictscreen_t, prev.index));
648     i.rem = R->num_screens;
649     i.index = (char *) i.data - (char *) R;
650     return i;
651 }
652 
653 uint32_t *
xcb_render_query_pict_formats_subpixels(const xcb_render_query_pict_formats_reply_t * R)654 xcb_render_query_pict_formats_subpixels (const xcb_render_query_pict_formats_reply_t *R  /**< */)
655 {
656     xcb_generic_iterator_t prev = xcb_render_pictscreen_end(xcb_render_query_pict_formats_screens_iterator(R));
657     return (uint32_t *) ((char *) prev.data + XCB_TYPE_PAD(uint32_t, prev.index) + 0);
658 }
659 
660 int
xcb_render_query_pict_formats_subpixels_length(const xcb_render_query_pict_formats_reply_t * R)661 xcb_render_query_pict_formats_subpixels_length (const xcb_render_query_pict_formats_reply_t *R  /**< */)
662 {
663     return R->num_subpixel;
664 }
665 
666 xcb_generic_iterator_t
xcb_render_query_pict_formats_subpixels_end(const xcb_render_query_pict_formats_reply_t * R)667 xcb_render_query_pict_formats_subpixels_end (const xcb_render_query_pict_formats_reply_t *R  /**< */)
668 {
669     xcb_generic_iterator_t i;
670     xcb_generic_iterator_t child = xcb_render_pictscreen_end(xcb_render_query_pict_formats_screens_iterator(R));
671     i.data = ((uint32_t *) child.data) + (R->num_subpixel);
672     i.rem = 0;
673     i.index = (char *) i.data - (char *) R;
674     return i;
675 }
676 
677 xcb_render_query_pict_formats_reply_t *
xcb_render_query_pict_formats_reply(xcb_connection_t * c,xcb_render_query_pict_formats_cookie_t cookie,xcb_generic_error_t ** e)678 xcb_render_query_pict_formats_reply (xcb_connection_t                        *c  /**< */,
679                                      xcb_render_query_pict_formats_cookie_t   cookie  /**< */,
680                                      xcb_generic_error_t                    **e  /**< */)
681 {
682     return (xcb_render_query_pict_formats_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
683 }
684 
685 int
xcb_render_query_pict_index_values_sizeof(const void * _buffer)686 xcb_render_query_pict_index_values_sizeof (const void  *_buffer  /**< */)
687 {
688     char *xcb_tmp = (char *)_buffer;
689     const xcb_render_query_pict_index_values_reply_t *_aux = (xcb_render_query_pict_index_values_reply_t *)_buffer;
690     unsigned int xcb_buffer_len = 0;
691     unsigned int xcb_block_len = 0;
692     unsigned int xcb_pad = 0;
693     unsigned int xcb_align_to = 0;
694 
695 
696     xcb_block_len += sizeof(xcb_render_query_pict_index_values_reply_t);
697     xcb_tmp += xcb_block_len;
698     xcb_buffer_len += xcb_block_len;
699     xcb_block_len = 0;
700     /* values */
701     xcb_block_len += _aux->num_values * sizeof(xcb_render_indexvalue_t);
702     xcb_tmp += xcb_block_len;
703     xcb_align_to = ALIGNOF(xcb_render_indexvalue_t);
704     /* insert padding */
705     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
706     xcb_buffer_len += xcb_block_len + xcb_pad;
707     if (0 != xcb_pad) {
708         xcb_tmp += xcb_pad;
709         xcb_pad = 0;
710     }
711     xcb_block_len = 0;
712 
713     return xcb_buffer_len;
714 }
715 
716 xcb_render_query_pict_index_values_cookie_t
xcb_render_query_pict_index_values(xcb_connection_t * c,xcb_render_pictformat_t format)717 xcb_render_query_pict_index_values (xcb_connection_t        *c  /**< */,
718                                     xcb_render_pictformat_t  format  /**< */)
719 {
720     static const xcb_protocol_request_t xcb_req = {
721         /* count */ 2,
722         /* ext */ &xcb_render_id,
723         /* opcode */ XCB_RENDER_QUERY_PICT_INDEX_VALUES,
724         /* isvoid */ 0
725     };
726 
727     struct iovec xcb_parts[4];
728     xcb_render_query_pict_index_values_cookie_t xcb_ret;
729     xcb_render_query_pict_index_values_request_t xcb_out;
730 
731     xcb_out.format = format;
732 
733     xcb_parts[2].iov_base = (char *) &xcb_out;
734     xcb_parts[2].iov_len = sizeof(xcb_out);
735     xcb_parts[3].iov_base = 0;
736     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
737 
738     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
739     return xcb_ret;
740 }
741 
742 xcb_render_query_pict_index_values_cookie_t
xcb_render_query_pict_index_values_unchecked(xcb_connection_t * c,xcb_render_pictformat_t format)743 xcb_render_query_pict_index_values_unchecked (xcb_connection_t        *c  /**< */,
744                                               xcb_render_pictformat_t  format  /**< */)
745 {
746     static const xcb_protocol_request_t xcb_req = {
747         /* count */ 2,
748         /* ext */ &xcb_render_id,
749         /* opcode */ XCB_RENDER_QUERY_PICT_INDEX_VALUES,
750         /* isvoid */ 0
751     };
752 
753     struct iovec xcb_parts[4];
754     xcb_render_query_pict_index_values_cookie_t xcb_ret;
755     xcb_render_query_pict_index_values_request_t xcb_out;
756 
757     xcb_out.format = format;
758 
759     xcb_parts[2].iov_base = (char *) &xcb_out;
760     xcb_parts[2].iov_len = sizeof(xcb_out);
761     xcb_parts[3].iov_base = 0;
762     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
763 
764     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
765     return xcb_ret;
766 }
767 
768 xcb_render_indexvalue_t *
xcb_render_query_pict_index_values_values(const xcb_render_query_pict_index_values_reply_t * R)769 xcb_render_query_pict_index_values_values (const xcb_render_query_pict_index_values_reply_t *R  /**< */)
770 {
771     return (xcb_render_indexvalue_t *) (R + 1);
772 }
773 
774 int
xcb_render_query_pict_index_values_values_length(const xcb_render_query_pict_index_values_reply_t * R)775 xcb_render_query_pict_index_values_values_length (const xcb_render_query_pict_index_values_reply_t *R  /**< */)
776 {
777     return R->num_values;
778 }
779 
780 xcb_render_indexvalue_iterator_t
xcb_render_query_pict_index_values_values_iterator(const xcb_render_query_pict_index_values_reply_t * R)781 xcb_render_query_pict_index_values_values_iterator (const xcb_render_query_pict_index_values_reply_t *R  /**< */)
782 {
783     xcb_render_indexvalue_iterator_t i;
784     i.data = (xcb_render_indexvalue_t *) (R + 1);
785     i.rem = R->num_values;
786     i.index = (char *) i.data - (char *) R;
787     return i;
788 }
789 
790 xcb_render_query_pict_index_values_reply_t *
xcb_render_query_pict_index_values_reply(xcb_connection_t * c,xcb_render_query_pict_index_values_cookie_t cookie,xcb_generic_error_t ** e)791 xcb_render_query_pict_index_values_reply (xcb_connection_t                             *c  /**< */,
792                                           xcb_render_query_pict_index_values_cookie_t   cookie  /**< */,
793                                           xcb_generic_error_t                         **e  /**< */)
794 {
795     return (xcb_render_query_pict_index_values_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
796 }
797 
798 int
xcb_render_create_picture_sizeof(const void * _buffer)799 xcb_render_create_picture_sizeof (const void  *_buffer  /**< */)
800 {
801     char *xcb_tmp = (char *)_buffer;
802     const xcb_render_create_picture_request_t *_aux = (xcb_render_create_picture_request_t *)_buffer;
803     unsigned int xcb_buffer_len = 0;
804     unsigned int xcb_block_len = 0;
805     unsigned int xcb_pad = 0;
806     unsigned int xcb_align_to = 0;
807 
808 
809     xcb_block_len += sizeof(xcb_render_create_picture_request_t);
810     xcb_tmp += xcb_block_len;
811     xcb_buffer_len += xcb_block_len;
812     xcb_block_len = 0;
813     /* value_list */
814     xcb_block_len += xcb_popcount(_aux->value_mask) * sizeof(uint32_t);
815     xcb_tmp += xcb_block_len;
816     xcb_align_to = ALIGNOF(uint32_t);
817     /* insert padding */
818     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
819     xcb_buffer_len += xcb_block_len + xcb_pad;
820     if (0 != xcb_pad) {
821         xcb_tmp += xcb_pad;
822         xcb_pad = 0;
823     }
824     xcb_block_len = 0;
825 
826     return xcb_buffer_len;
827 }
828 
829 xcb_void_cookie_t
xcb_render_create_picture_checked(xcb_connection_t * c,xcb_render_picture_t pid,xcb_drawable_t drawable,xcb_render_pictformat_t format,uint32_t value_mask,const uint32_t * value_list)830 xcb_render_create_picture_checked (xcb_connection_t        *c  /**< */,
831                                    xcb_render_picture_t     pid  /**< */,
832                                    xcb_drawable_t           drawable  /**< */,
833                                    xcb_render_pictformat_t  format  /**< */,
834                                    uint32_t                 value_mask  /**< */,
835                                    const uint32_t          *value_list  /**< */)
836 {
837     static const xcb_protocol_request_t xcb_req = {
838         /* count */ 4,
839         /* ext */ &xcb_render_id,
840         /* opcode */ XCB_RENDER_CREATE_PICTURE,
841         /* isvoid */ 1
842     };
843 
844     struct iovec xcb_parts[6];
845     xcb_void_cookie_t xcb_ret;
846     xcb_render_create_picture_request_t xcb_out;
847 
848     xcb_out.pid = pid;
849     xcb_out.drawable = drawable;
850     xcb_out.format = format;
851     xcb_out.value_mask = value_mask;
852 
853     xcb_parts[2].iov_base = (char *) &xcb_out;
854     xcb_parts[2].iov_len = sizeof(xcb_out);
855     xcb_parts[3].iov_base = 0;
856     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
857     /* uint32_t value_list */
858     xcb_parts[4].iov_base = (char *) value_list;
859     xcb_parts[4].iov_len = xcb_popcount(value_mask) * sizeof(uint32_t);
860     xcb_parts[5].iov_base = 0;
861     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
862 
863     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
864     return xcb_ret;
865 }
866 
867 xcb_void_cookie_t
xcb_render_create_picture(xcb_connection_t * c,xcb_render_picture_t pid,xcb_drawable_t drawable,xcb_render_pictformat_t format,uint32_t value_mask,const uint32_t * value_list)868 xcb_render_create_picture (xcb_connection_t        *c  /**< */,
869                            xcb_render_picture_t     pid  /**< */,
870                            xcb_drawable_t           drawable  /**< */,
871                            xcb_render_pictformat_t  format  /**< */,
872                            uint32_t                 value_mask  /**< */,
873                            const uint32_t          *value_list  /**< */)
874 {
875     static const xcb_protocol_request_t xcb_req = {
876         /* count */ 4,
877         /* ext */ &xcb_render_id,
878         /* opcode */ XCB_RENDER_CREATE_PICTURE,
879         /* isvoid */ 1
880     };
881 
882     struct iovec xcb_parts[6];
883     xcb_void_cookie_t xcb_ret;
884     xcb_render_create_picture_request_t xcb_out;
885 
886     xcb_out.pid = pid;
887     xcb_out.drawable = drawable;
888     xcb_out.format = format;
889     xcb_out.value_mask = value_mask;
890 
891     xcb_parts[2].iov_base = (char *) &xcb_out;
892     xcb_parts[2].iov_len = sizeof(xcb_out);
893     xcb_parts[3].iov_base = 0;
894     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
895     /* uint32_t value_list */
896     xcb_parts[4].iov_base = (char *) value_list;
897     xcb_parts[4].iov_len = xcb_popcount(value_mask) * sizeof(uint32_t);
898     xcb_parts[5].iov_base = 0;
899     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
900 
901     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
902     return xcb_ret;
903 }
904 
905 int
xcb_render_change_picture_sizeof(const void * _buffer)906 xcb_render_change_picture_sizeof (const void  *_buffer  /**< */)
907 {
908     char *xcb_tmp = (char *)_buffer;
909     const xcb_render_change_picture_request_t *_aux = (xcb_render_change_picture_request_t *)_buffer;
910     unsigned int xcb_buffer_len = 0;
911     unsigned int xcb_block_len = 0;
912     unsigned int xcb_pad = 0;
913     unsigned int xcb_align_to = 0;
914 
915 
916     xcb_block_len += sizeof(xcb_render_change_picture_request_t);
917     xcb_tmp += xcb_block_len;
918     xcb_buffer_len += xcb_block_len;
919     xcb_block_len = 0;
920     /* value_list */
921     xcb_block_len += xcb_popcount(_aux->value_mask) * sizeof(uint32_t);
922     xcb_tmp += xcb_block_len;
923     xcb_align_to = ALIGNOF(uint32_t);
924     /* insert padding */
925     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
926     xcb_buffer_len += xcb_block_len + xcb_pad;
927     if (0 != xcb_pad) {
928         xcb_tmp += xcb_pad;
929         xcb_pad = 0;
930     }
931     xcb_block_len = 0;
932 
933     return xcb_buffer_len;
934 }
935 
936 xcb_void_cookie_t
xcb_render_change_picture_checked(xcb_connection_t * c,xcb_render_picture_t picture,uint32_t value_mask,const uint32_t * value_list)937 xcb_render_change_picture_checked (xcb_connection_t     *c  /**< */,
938                                    xcb_render_picture_t  picture  /**< */,
939                                    uint32_t              value_mask  /**< */,
940                                    const uint32_t       *value_list  /**< */)
941 {
942     static const xcb_protocol_request_t xcb_req = {
943         /* count */ 4,
944         /* ext */ &xcb_render_id,
945         /* opcode */ XCB_RENDER_CHANGE_PICTURE,
946         /* isvoid */ 1
947     };
948 
949     struct iovec xcb_parts[6];
950     xcb_void_cookie_t xcb_ret;
951     xcb_render_change_picture_request_t xcb_out;
952 
953     xcb_out.picture = picture;
954     xcb_out.value_mask = value_mask;
955 
956     xcb_parts[2].iov_base = (char *) &xcb_out;
957     xcb_parts[2].iov_len = sizeof(xcb_out);
958     xcb_parts[3].iov_base = 0;
959     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
960     /* uint32_t value_list */
961     xcb_parts[4].iov_base = (char *) value_list;
962     xcb_parts[4].iov_len = xcb_popcount(value_mask) * sizeof(uint32_t);
963     xcb_parts[5].iov_base = 0;
964     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
965 
966     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
967     return xcb_ret;
968 }
969 
970 xcb_void_cookie_t
xcb_render_change_picture(xcb_connection_t * c,xcb_render_picture_t picture,uint32_t value_mask,const uint32_t * value_list)971 xcb_render_change_picture (xcb_connection_t     *c  /**< */,
972                            xcb_render_picture_t  picture  /**< */,
973                            uint32_t              value_mask  /**< */,
974                            const uint32_t       *value_list  /**< */)
975 {
976     static const xcb_protocol_request_t xcb_req = {
977         /* count */ 4,
978         /* ext */ &xcb_render_id,
979         /* opcode */ XCB_RENDER_CHANGE_PICTURE,
980         /* isvoid */ 1
981     };
982 
983     struct iovec xcb_parts[6];
984     xcb_void_cookie_t xcb_ret;
985     xcb_render_change_picture_request_t xcb_out;
986 
987     xcb_out.picture = picture;
988     xcb_out.value_mask = value_mask;
989 
990     xcb_parts[2].iov_base = (char *) &xcb_out;
991     xcb_parts[2].iov_len = sizeof(xcb_out);
992     xcb_parts[3].iov_base = 0;
993     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
994     /* uint32_t value_list */
995     xcb_parts[4].iov_base = (char *) value_list;
996     xcb_parts[4].iov_len = xcb_popcount(value_mask) * sizeof(uint32_t);
997     xcb_parts[5].iov_base = 0;
998     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
999 
1000     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1001     return xcb_ret;
1002 }
1003 
1004 int
xcb_render_set_picture_clip_rectangles_sizeof(const void * _buffer,uint32_t rectangles_len)1005 xcb_render_set_picture_clip_rectangles_sizeof (const void  *_buffer  /**< */,
1006                                                uint32_t     rectangles_len  /**< */)
1007 {
1008     char *xcb_tmp = (char *)_buffer;
1009     unsigned int xcb_buffer_len = 0;
1010     unsigned int xcb_block_len = 0;
1011     unsigned int xcb_pad = 0;
1012     unsigned int xcb_align_to = 0;
1013 
1014 
1015     xcb_block_len += sizeof(xcb_render_set_picture_clip_rectangles_request_t);
1016     xcb_tmp += xcb_block_len;
1017     xcb_buffer_len += xcb_block_len;
1018     xcb_block_len = 0;
1019     /* rectangles */
1020     xcb_block_len += rectangles_len * sizeof(xcb_rectangle_t);
1021     xcb_tmp += xcb_block_len;
1022     xcb_align_to = ALIGNOF(xcb_rectangle_t);
1023     /* insert padding */
1024     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1025     xcb_buffer_len += xcb_block_len + xcb_pad;
1026     if (0 != xcb_pad) {
1027         xcb_tmp += xcb_pad;
1028         xcb_pad = 0;
1029     }
1030     xcb_block_len = 0;
1031 
1032     return xcb_buffer_len;
1033 }
1034 
1035 xcb_void_cookie_t
xcb_render_set_picture_clip_rectangles_checked(xcb_connection_t * c,xcb_render_picture_t picture,int16_t clip_x_origin,int16_t clip_y_origin,uint32_t rectangles_len,const xcb_rectangle_t * rectangles)1036 xcb_render_set_picture_clip_rectangles_checked (xcb_connection_t      *c  /**< */,
1037                                                 xcb_render_picture_t   picture  /**< */,
1038                                                 int16_t                clip_x_origin  /**< */,
1039                                                 int16_t                clip_y_origin  /**< */,
1040                                                 uint32_t               rectangles_len  /**< */,
1041                                                 const xcb_rectangle_t *rectangles  /**< */)
1042 {
1043     static const xcb_protocol_request_t xcb_req = {
1044         /* count */ 4,
1045         /* ext */ &xcb_render_id,
1046         /* opcode */ XCB_RENDER_SET_PICTURE_CLIP_RECTANGLES,
1047         /* isvoid */ 1
1048     };
1049 
1050     struct iovec xcb_parts[6];
1051     xcb_void_cookie_t xcb_ret;
1052     xcb_render_set_picture_clip_rectangles_request_t xcb_out;
1053 
1054     xcb_out.picture = picture;
1055     xcb_out.clip_x_origin = clip_x_origin;
1056     xcb_out.clip_y_origin = clip_y_origin;
1057 
1058     xcb_parts[2].iov_base = (char *) &xcb_out;
1059     xcb_parts[2].iov_len = sizeof(xcb_out);
1060     xcb_parts[3].iov_base = 0;
1061     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1062     /* xcb_rectangle_t rectangles */
1063     xcb_parts[4].iov_base = (char *) rectangles;
1064     xcb_parts[4].iov_len = rectangles_len * sizeof(xcb_rectangle_t);
1065     xcb_parts[5].iov_base = 0;
1066     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1067 
1068     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1069     return xcb_ret;
1070 }
1071 
1072 xcb_void_cookie_t
xcb_render_set_picture_clip_rectangles(xcb_connection_t * c,xcb_render_picture_t picture,int16_t clip_x_origin,int16_t clip_y_origin,uint32_t rectangles_len,const xcb_rectangle_t * rectangles)1073 xcb_render_set_picture_clip_rectangles (xcb_connection_t      *c  /**< */,
1074                                         xcb_render_picture_t   picture  /**< */,
1075                                         int16_t                clip_x_origin  /**< */,
1076                                         int16_t                clip_y_origin  /**< */,
1077                                         uint32_t               rectangles_len  /**< */,
1078                                         const xcb_rectangle_t *rectangles  /**< */)
1079 {
1080     static const xcb_protocol_request_t xcb_req = {
1081         /* count */ 4,
1082         /* ext */ &xcb_render_id,
1083         /* opcode */ XCB_RENDER_SET_PICTURE_CLIP_RECTANGLES,
1084         /* isvoid */ 1
1085     };
1086 
1087     struct iovec xcb_parts[6];
1088     xcb_void_cookie_t xcb_ret;
1089     xcb_render_set_picture_clip_rectangles_request_t xcb_out;
1090 
1091     xcb_out.picture = picture;
1092     xcb_out.clip_x_origin = clip_x_origin;
1093     xcb_out.clip_y_origin = clip_y_origin;
1094 
1095     xcb_parts[2].iov_base = (char *) &xcb_out;
1096     xcb_parts[2].iov_len = sizeof(xcb_out);
1097     xcb_parts[3].iov_base = 0;
1098     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1099     /* xcb_rectangle_t rectangles */
1100     xcb_parts[4].iov_base = (char *) rectangles;
1101     xcb_parts[4].iov_len = rectangles_len * sizeof(xcb_rectangle_t);
1102     xcb_parts[5].iov_base = 0;
1103     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1104 
1105     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1106     return xcb_ret;
1107 }
1108 
1109 xcb_void_cookie_t
xcb_render_free_picture_checked(xcb_connection_t * c,xcb_render_picture_t picture)1110 xcb_render_free_picture_checked (xcb_connection_t     *c  /**< */,
1111                                  xcb_render_picture_t  picture  /**< */)
1112 {
1113     static const xcb_protocol_request_t xcb_req = {
1114         /* count */ 2,
1115         /* ext */ &xcb_render_id,
1116         /* opcode */ XCB_RENDER_FREE_PICTURE,
1117         /* isvoid */ 1
1118     };
1119 
1120     struct iovec xcb_parts[4];
1121     xcb_void_cookie_t xcb_ret;
1122     xcb_render_free_picture_request_t xcb_out;
1123 
1124     xcb_out.picture = picture;
1125 
1126     xcb_parts[2].iov_base = (char *) &xcb_out;
1127     xcb_parts[2].iov_len = sizeof(xcb_out);
1128     xcb_parts[3].iov_base = 0;
1129     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1130 
1131     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1132     return xcb_ret;
1133 }
1134 
1135 xcb_void_cookie_t
xcb_render_free_picture(xcb_connection_t * c,xcb_render_picture_t picture)1136 xcb_render_free_picture (xcb_connection_t     *c  /**< */,
1137                          xcb_render_picture_t  picture  /**< */)
1138 {
1139     static const xcb_protocol_request_t xcb_req = {
1140         /* count */ 2,
1141         /* ext */ &xcb_render_id,
1142         /* opcode */ XCB_RENDER_FREE_PICTURE,
1143         /* isvoid */ 1
1144     };
1145 
1146     struct iovec xcb_parts[4];
1147     xcb_void_cookie_t xcb_ret;
1148     xcb_render_free_picture_request_t xcb_out;
1149 
1150     xcb_out.picture = picture;
1151 
1152     xcb_parts[2].iov_base = (char *) &xcb_out;
1153     xcb_parts[2].iov_len = sizeof(xcb_out);
1154     xcb_parts[3].iov_base = 0;
1155     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1156 
1157     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1158     return xcb_ret;
1159 }
1160 
1161 xcb_void_cookie_t
xcb_render_composite_checked(xcb_connection_t * c,uint8_t op,xcb_render_picture_t src,xcb_render_picture_t mask,xcb_render_picture_t dst,int16_t src_x,int16_t src_y,int16_t mask_x,int16_t mask_y,int16_t dst_x,int16_t dst_y,uint16_t width,uint16_t height)1162 xcb_render_composite_checked (xcb_connection_t     *c  /**< */,
1163                               uint8_t               op  /**< */,
1164                               xcb_render_picture_t  src  /**< */,
1165                               xcb_render_picture_t  mask  /**< */,
1166                               xcb_render_picture_t  dst  /**< */,
1167                               int16_t               src_x  /**< */,
1168                               int16_t               src_y  /**< */,
1169                               int16_t               mask_x  /**< */,
1170                               int16_t               mask_y  /**< */,
1171                               int16_t               dst_x  /**< */,
1172                               int16_t               dst_y  /**< */,
1173                               uint16_t              width  /**< */,
1174                               uint16_t              height  /**< */)
1175 {
1176     static const xcb_protocol_request_t xcb_req = {
1177         /* count */ 2,
1178         /* ext */ &xcb_render_id,
1179         /* opcode */ XCB_RENDER_COMPOSITE,
1180         /* isvoid */ 1
1181     };
1182 
1183     struct iovec xcb_parts[4];
1184     xcb_void_cookie_t xcb_ret;
1185     xcb_render_composite_request_t xcb_out;
1186 
1187     xcb_out.op = op;
1188     memset(xcb_out.pad0, 0, 3);
1189     xcb_out.src = src;
1190     xcb_out.mask = mask;
1191     xcb_out.dst = dst;
1192     xcb_out.src_x = src_x;
1193     xcb_out.src_y = src_y;
1194     xcb_out.mask_x = mask_x;
1195     xcb_out.mask_y = mask_y;
1196     xcb_out.dst_x = dst_x;
1197     xcb_out.dst_y = dst_y;
1198     xcb_out.width = width;
1199     xcb_out.height = height;
1200 
1201     xcb_parts[2].iov_base = (char *) &xcb_out;
1202     xcb_parts[2].iov_len = sizeof(xcb_out);
1203     xcb_parts[3].iov_base = 0;
1204     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1205 
1206     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1207     return xcb_ret;
1208 }
1209 
1210 xcb_void_cookie_t
xcb_render_composite(xcb_connection_t * c,uint8_t op,xcb_render_picture_t src,xcb_render_picture_t mask,xcb_render_picture_t dst,int16_t src_x,int16_t src_y,int16_t mask_x,int16_t mask_y,int16_t dst_x,int16_t dst_y,uint16_t width,uint16_t height)1211 xcb_render_composite (xcb_connection_t     *c  /**< */,
1212                       uint8_t               op  /**< */,
1213                       xcb_render_picture_t  src  /**< */,
1214                       xcb_render_picture_t  mask  /**< */,
1215                       xcb_render_picture_t  dst  /**< */,
1216                       int16_t               src_x  /**< */,
1217                       int16_t               src_y  /**< */,
1218                       int16_t               mask_x  /**< */,
1219                       int16_t               mask_y  /**< */,
1220                       int16_t               dst_x  /**< */,
1221                       int16_t               dst_y  /**< */,
1222                       uint16_t              width  /**< */,
1223                       uint16_t              height  /**< */)
1224 {
1225     static const xcb_protocol_request_t xcb_req = {
1226         /* count */ 2,
1227         /* ext */ &xcb_render_id,
1228         /* opcode */ XCB_RENDER_COMPOSITE,
1229         /* isvoid */ 1
1230     };
1231 
1232     struct iovec xcb_parts[4];
1233     xcb_void_cookie_t xcb_ret;
1234     xcb_render_composite_request_t xcb_out;
1235 
1236     xcb_out.op = op;
1237     memset(xcb_out.pad0, 0, 3);
1238     xcb_out.src = src;
1239     xcb_out.mask = mask;
1240     xcb_out.dst = dst;
1241     xcb_out.src_x = src_x;
1242     xcb_out.src_y = src_y;
1243     xcb_out.mask_x = mask_x;
1244     xcb_out.mask_y = mask_y;
1245     xcb_out.dst_x = dst_x;
1246     xcb_out.dst_y = dst_y;
1247     xcb_out.width = width;
1248     xcb_out.height = height;
1249 
1250     xcb_parts[2].iov_base = (char *) &xcb_out;
1251     xcb_parts[2].iov_len = sizeof(xcb_out);
1252     xcb_parts[3].iov_base = 0;
1253     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1254 
1255     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1256     return xcb_ret;
1257 }
1258 
1259 int
xcb_render_trapezoids_sizeof(const void * _buffer,uint32_t traps_len)1260 xcb_render_trapezoids_sizeof (const void  *_buffer  /**< */,
1261                               uint32_t     traps_len  /**< */)
1262 {
1263     char *xcb_tmp = (char *)_buffer;
1264     unsigned int xcb_buffer_len = 0;
1265     unsigned int xcb_block_len = 0;
1266     unsigned int xcb_pad = 0;
1267     unsigned int xcb_align_to = 0;
1268 
1269 
1270     xcb_block_len += sizeof(xcb_render_trapezoids_request_t);
1271     xcb_tmp += xcb_block_len;
1272     xcb_buffer_len += xcb_block_len;
1273     xcb_block_len = 0;
1274     /* traps */
1275     xcb_block_len += traps_len * sizeof(xcb_render_trapezoid_t);
1276     xcb_tmp += xcb_block_len;
1277     xcb_align_to = ALIGNOF(xcb_render_trapezoid_t);
1278     /* insert padding */
1279     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1280     xcb_buffer_len += xcb_block_len + xcb_pad;
1281     if (0 != xcb_pad) {
1282         xcb_tmp += xcb_pad;
1283         xcb_pad = 0;
1284     }
1285     xcb_block_len = 0;
1286 
1287     return xcb_buffer_len;
1288 }
1289 
1290 xcb_void_cookie_t
xcb_render_trapezoids_checked(xcb_connection_t * c,uint8_t op,xcb_render_picture_t src,xcb_render_picture_t dst,xcb_render_pictformat_t mask_format,int16_t src_x,int16_t src_y,uint32_t traps_len,const xcb_render_trapezoid_t * traps)1291 xcb_render_trapezoids_checked (xcb_connection_t             *c  /**< */,
1292                                uint8_t                       op  /**< */,
1293                                xcb_render_picture_t          src  /**< */,
1294                                xcb_render_picture_t          dst  /**< */,
1295                                xcb_render_pictformat_t       mask_format  /**< */,
1296                                int16_t                       src_x  /**< */,
1297                                int16_t                       src_y  /**< */,
1298                                uint32_t                      traps_len  /**< */,
1299                                const xcb_render_trapezoid_t *traps  /**< */)
1300 {
1301     static const xcb_protocol_request_t xcb_req = {
1302         /* count */ 4,
1303         /* ext */ &xcb_render_id,
1304         /* opcode */ XCB_RENDER_TRAPEZOIDS,
1305         /* isvoid */ 1
1306     };
1307 
1308     struct iovec xcb_parts[6];
1309     xcb_void_cookie_t xcb_ret;
1310     xcb_render_trapezoids_request_t xcb_out;
1311 
1312     xcb_out.op = op;
1313     memset(xcb_out.pad0, 0, 3);
1314     xcb_out.src = src;
1315     xcb_out.dst = dst;
1316     xcb_out.mask_format = mask_format;
1317     xcb_out.src_x = src_x;
1318     xcb_out.src_y = src_y;
1319 
1320     xcb_parts[2].iov_base = (char *) &xcb_out;
1321     xcb_parts[2].iov_len = sizeof(xcb_out);
1322     xcb_parts[3].iov_base = 0;
1323     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1324     /* xcb_render_trapezoid_t traps */
1325     xcb_parts[4].iov_base = (char *) traps;
1326     xcb_parts[4].iov_len = traps_len * sizeof(xcb_render_trapezoid_t);
1327     xcb_parts[5].iov_base = 0;
1328     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1329 
1330     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1331     return xcb_ret;
1332 }
1333 
1334 xcb_void_cookie_t
xcb_render_trapezoids(xcb_connection_t * c,uint8_t op,xcb_render_picture_t src,xcb_render_picture_t dst,xcb_render_pictformat_t mask_format,int16_t src_x,int16_t src_y,uint32_t traps_len,const xcb_render_trapezoid_t * traps)1335 xcb_render_trapezoids (xcb_connection_t             *c  /**< */,
1336                        uint8_t                       op  /**< */,
1337                        xcb_render_picture_t          src  /**< */,
1338                        xcb_render_picture_t          dst  /**< */,
1339                        xcb_render_pictformat_t       mask_format  /**< */,
1340                        int16_t                       src_x  /**< */,
1341                        int16_t                       src_y  /**< */,
1342                        uint32_t                      traps_len  /**< */,
1343                        const xcb_render_trapezoid_t *traps  /**< */)
1344 {
1345     static const xcb_protocol_request_t xcb_req = {
1346         /* count */ 4,
1347         /* ext */ &xcb_render_id,
1348         /* opcode */ XCB_RENDER_TRAPEZOIDS,
1349         /* isvoid */ 1
1350     };
1351 
1352     struct iovec xcb_parts[6];
1353     xcb_void_cookie_t xcb_ret;
1354     xcb_render_trapezoids_request_t xcb_out;
1355 
1356     xcb_out.op = op;
1357     memset(xcb_out.pad0, 0, 3);
1358     xcb_out.src = src;
1359     xcb_out.dst = dst;
1360     xcb_out.mask_format = mask_format;
1361     xcb_out.src_x = src_x;
1362     xcb_out.src_y = src_y;
1363 
1364     xcb_parts[2].iov_base = (char *) &xcb_out;
1365     xcb_parts[2].iov_len = sizeof(xcb_out);
1366     xcb_parts[3].iov_base = 0;
1367     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1368     /* xcb_render_trapezoid_t traps */
1369     xcb_parts[4].iov_base = (char *) traps;
1370     xcb_parts[4].iov_len = traps_len * sizeof(xcb_render_trapezoid_t);
1371     xcb_parts[5].iov_base = 0;
1372     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1373 
1374     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1375     return xcb_ret;
1376 }
1377 
1378 int
xcb_render_triangles_sizeof(const void * _buffer,uint32_t triangles_len)1379 xcb_render_triangles_sizeof (const void  *_buffer  /**< */,
1380                              uint32_t     triangles_len  /**< */)
1381 {
1382     char *xcb_tmp = (char *)_buffer;
1383     unsigned int xcb_buffer_len = 0;
1384     unsigned int xcb_block_len = 0;
1385     unsigned int xcb_pad = 0;
1386     unsigned int xcb_align_to = 0;
1387 
1388 
1389     xcb_block_len += sizeof(xcb_render_triangles_request_t);
1390     xcb_tmp += xcb_block_len;
1391     xcb_buffer_len += xcb_block_len;
1392     xcb_block_len = 0;
1393     /* triangles */
1394     xcb_block_len += triangles_len * sizeof(xcb_render_triangle_t);
1395     xcb_tmp += xcb_block_len;
1396     xcb_align_to = ALIGNOF(xcb_render_triangle_t);
1397     /* insert padding */
1398     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1399     xcb_buffer_len += xcb_block_len + xcb_pad;
1400     if (0 != xcb_pad) {
1401         xcb_tmp += xcb_pad;
1402         xcb_pad = 0;
1403     }
1404     xcb_block_len = 0;
1405 
1406     return xcb_buffer_len;
1407 }
1408 
1409 xcb_void_cookie_t
xcb_render_triangles_checked(xcb_connection_t * c,uint8_t op,xcb_render_picture_t src,xcb_render_picture_t dst,xcb_render_pictformat_t mask_format,int16_t src_x,int16_t src_y,uint32_t triangles_len,const xcb_render_triangle_t * triangles)1410 xcb_render_triangles_checked (xcb_connection_t            *c  /**< */,
1411                               uint8_t                      op  /**< */,
1412                               xcb_render_picture_t         src  /**< */,
1413                               xcb_render_picture_t         dst  /**< */,
1414                               xcb_render_pictformat_t      mask_format  /**< */,
1415                               int16_t                      src_x  /**< */,
1416                               int16_t                      src_y  /**< */,
1417                               uint32_t                     triangles_len  /**< */,
1418                               const xcb_render_triangle_t *triangles  /**< */)
1419 {
1420     static const xcb_protocol_request_t xcb_req = {
1421         /* count */ 4,
1422         /* ext */ &xcb_render_id,
1423         /* opcode */ XCB_RENDER_TRIANGLES,
1424         /* isvoid */ 1
1425     };
1426 
1427     struct iovec xcb_parts[6];
1428     xcb_void_cookie_t xcb_ret;
1429     xcb_render_triangles_request_t xcb_out;
1430 
1431     xcb_out.op = op;
1432     memset(xcb_out.pad0, 0, 3);
1433     xcb_out.src = src;
1434     xcb_out.dst = dst;
1435     xcb_out.mask_format = mask_format;
1436     xcb_out.src_x = src_x;
1437     xcb_out.src_y = src_y;
1438 
1439     xcb_parts[2].iov_base = (char *) &xcb_out;
1440     xcb_parts[2].iov_len = sizeof(xcb_out);
1441     xcb_parts[3].iov_base = 0;
1442     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1443     /* xcb_render_triangle_t triangles */
1444     xcb_parts[4].iov_base = (char *) triangles;
1445     xcb_parts[4].iov_len = triangles_len * sizeof(xcb_render_triangle_t);
1446     xcb_parts[5].iov_base = 0;
1447     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1448 
1449     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1450     return xcb_ret;
1451 }
1452 
1453 xcb_void_cookie_t
xcb_render_triangles(xcb_connection_t * c,uint8_t op,xcb_render_picture_t src,xcb_render_picture_t dst,xcb_render_pictformat_t mask_format,int16_t src_x,int16_t src_y,uint32_t triangles_len,const xcb_render_triangle_t * triangles)1454 xcb_render_triangles (xcb_connection_t            *c  /**< */,
1455                       uint8_t                      op  /**< */,
1456                       xcb_render_picture_t         src  /**< */,
1457                       xcb_render_picture_t         dst  /**< */,
1458                       xcb_render_pictformat_t      mask_format  /**< */,
1459                       int16_t                      src_x  /**< */,
1460                       int16_t                      src_y  /**< */,
1461                       uint32_t                     triangles_len  /**< */,
1462                       const xcb_render_triangle_t *triangles  /**< */)
1463 {
1464     static const xcb_protocol_request_t xcb_req = {
1465         /* count */ 4,
1466         /* ext */ &xcb_render_id,
1467         /* opcode */ XCB_RENDER_TRIANGLES,
1468         /* isvoid */ 1
1469     };
1470 
1471     struct iovec xcb_parts[6];
1472     xcb_void_cookie_t xcb_ret;
1473     xcb_render_triangles_request_t xcb_out;
1474 
1475     xcb_out.op = op;
1476     memset(xcb_out.pad0, 0, 3);
1477     xcb_out.src = src;
1478     xcb_out.dst = dst;
1479     xcb_out.mask_format = mask_format;
1480     xcb_out.src_x = src_x;
1481     xcb_out.src_y = src_y;
1482 
1483     xcb_parts[2].iov_base = (char *) &xcb_out;
1484     xcb_parts[2].iov_len = sizeof(xcb_out);
1485     xcb_parts[3].iov_base = 0;
1486     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1487     /* xcb_render_triangle_t triangles */
1488     xcb_parts[4].iov_base = (char *) triangles;
1489     xcb_parts[4].iov_len = triangles_len * sizeof(xcb_render_triangle_t);
1490     xcb_parts[5].iov_base = 0;
1491     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1492 
1493     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1494     return xcb_ret;
1495 }
1496 
1497 int
xcb_render_tri_strip_sizeof(const void * _buffer,uint32_t points_len)1498 xcb_render_tri_strip_sizeof (const void  *_buffer  /**< */,
1499                              uint32_t     points_len  /**< */)
1500 {
1501     char *xcb_tmp = (char *)_buffer;
1502     unsigned int xcb_buffer_len = 0;
1503     unsigned int xcb_block_len = 0;
1504     unsigned int xcb_pad = 0;
1505     unsigned int xcb_align_to = 0;
1506 
1507 
1508     xcb_block_len += sizeof(xcb_render_tri_strip_request_t);
1509     xcb_tmp += xcb_block_len;
1510     xcb_buffer_len += xcb_block_len;
1511     xcb_block_len = 0;
1512     /* points */
1513     xcb_block_len += points_len * sizeof(xcb_render_pointfix_t);
1514     xcb_tmp += xcb_block_len;
1515     xcb_align_to = ALIGNOF(xcb_render_pointfix_t);
1516     /* insert padding */
1517     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1518     xcb_buffer_len += xcb_block_len + xcb_pad;
1519     if (0 != xcb_pad) {
1520         xcb_tmp += xcb_pad;
1521         xcb_pad = 0;
1522     }
1523     xcb_block_len = 0;
1524 
1525     return xcb_buffer_len;
1526 }
1527 
1528 xcb_void_cookie_t
xcb_render_tri_strip_checked(xcb_connection_t * c,uint8_t op,xcb_render_picture_t src,xcb_render_picture_t dst,xcb_render_pictformat_t mask_format,int16_t src_x,int16_t src_y,uint32_t points_len,const xcb_render_pointfix_t * points)1529 xcb_render_tri_strip_checked (xcb_connection_t            *c  /**< */,
1530                               uint8_t                      op  /**< */,
1531                               xcb_render_picture_t         src  /**< */,
1532                               xcb_render_picture_t         dst  /**< */,
1533                               xcb_render_pictformat_t      mask_format  /**< */,
1534                               int16_t                      src_x  /**< */,
1535                               int16_t                      src_y  /**< */,
1536                               uint32_t                     points_len  /**< */,
1537                               const xcb_render_pointfix_t *points  /**< */)
1538 {
1539     static const xcb_protocol_request_t xcb_req = {
1540         /* count */ 4,
1541         /* ext */ &xcb_render_id,
1542         /* opcode */ XCB_RENDER_TRI_STRIP,
1543         /* isvoid */ 1
1544     };
1545 
1546     struct iovec xcb_parts[6];
1547     xcb_void_cookie_t xcb_ret;
1548     xcb_render_tri_strip_request_t xcb_out;
1549 
1550     xcb_out.op = op;
1551     memset(xcb_out.pad0, 0, 3);
1552     xcb_out.src = src;
1553     xcb_out.dst = dst;
1554     xcb_out.mask_format = mask_format;
1555     xcb_out.src_x = src_x;
1556     xcb_out.src_y = src_y;
1557 
1558     xcb_parts[2].iov_base = (char *) &xcb_out;
1559     xcb_parts[2].iov_len = sizeof(xcb_out);
1560     xcb_parts[3].iov_base = 0;
1561     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1562     /* xcb_render_pointfix_t points */
1563     xcb_parts[4].iov_base = (char *) points;
1564     xcb_parts[4].iov_len = points_len * sizeof(xcb_render_pointfix_t);
1565     xcb_parts[5].iov_base = 0;
1566     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1567 
1568     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1569     return xcb_ret;
1570 }
1571 
1572 xcb_void_cookie_t
xcb_render_tri_strip(xcb_connection_t * c,uint8_t op,xcb_render_picture_t src,xcb_render_picture_t dst,xcb_render_pictformat_t mask_format,int16_t src_x,int16_t src_y,uint32_t points_len,const xcb_render_pointfix_t * points)1573 xcb_render_tri_strip (xcb_connection_t            *c  /**< */,
1574                       uint8_t                      op  /**< */,
1575                       xcb_render_picture_t         src  /**< */,
1576                       xcb_render_picture_t         dst  /**< */,
1577                       xcb_render_pictformat_t      mask_format  /**< */,
1578                       int16_t                      src_x  /**< */,
1579                       int16_t                      src_y  /**< */,
1580                       uint32_t                     points_len  /**< */,
1581                       const xcb_render_pointfix_t *points  /**< */)
1582 {
1583     static const xcb_protocol_request_t xcb_req = {
1584         /* count */ 4,
1585         /* ext */ &xcb_render_id,
1586         /* opcode */ XCB_RENDER_TRI_STRIP,
1587         /* isvoid */ 1
1588     };
1589 
1590     struct iovec xcb_parts[6];
1591     xcb_void_cookie_t xcb_ret;
1592     xcb_render_tri_strip_request_t xcb_out;
1593 
1594     xcb_out.op = op;
1595     memset(xcb_out.pad0, 0, 3);
1596     xcb_out.src = src;
1597     xcb_out.dst = dst;
1598     xcb_out.mask_format = mask_format;
1599     xcb_out.src_x = src_x;
1600     xcb_out.src_y = src_y;
1601 
1602     xcb_parts[2].iov_base = (char *) &xcb_out;
1603     xcb_parts[2].iov_len = sizeof(xcb_out);
1604     xcb_parts[3].iov_base = 0;
1605     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1606     /* xcb_render_pointfix_t points */
1607     xcb_parts[4].iov_base = (char *) points;
1608     xcb_parts[4].iov_len = points_len * sizeof(xcb_render_pointfix_t);
1609     xcb_parts[5].iov_base = 0;
1610     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1611 
1612     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1613     return xcb_ret;
1614 }
1615 
1616 int
xcb_render_tri_fan_sizeof(const void * _buffer,uint32_t points_len)1617 xcb_render_tri_fan_sizeof (const void  *_buffer  /**< */,
1618                            uint32_t     points_len  /**< */)
1619 {
1620     char *xcb_tmp = (char *)_buffer;
1621     unsigned int xcb_buffer_len = 0;
1622     unsigned int xcb_block_len = 0;
1623     unsigned int xcb_pad = 0;
1624     unsigned int xcb_align_to = 0;
1625 
1626 
1627     xcb_block_len += sizeof(xcb_render_tri_fan_request_t);
1628     xcb_tmp += xcb_block_len;
1629     xcb_buffer_len += xcb_block_len;
1630     xcb_block_len = 0;
1631     /* points */
1632     xcb_block_len += points_len * sizeof(xcb_render_pointfix_t);
1633     xcb_tmp += xcb_block_len;
1634     xcb_align_to = ALIGNOF(xcb_render_pointfix_t);
1635     /* insert padding */
1636     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1637     xcb_buffer_len += xcb_block_len + xcb_pad;
1638     if (0 != xcb_pad) {
1639         xcb_tmp += xcb_pad;
1640         xcb_pad = 0;
1641     }
1642     xcb_block_len = 0;
1643 
1644     return xcb_buffer_len;
1645 }
1646 
1647 xcb_void_cookie_t
xcb_render_tri_fan_checked(xcb_connection_t * c,uint8_t op,xcb_render_picture_t src,xcb_render_picture_t dst,xcb_render_pictformat_t mask_format,int16_t src_x,int16_t src_y,uint32_t points_len,const xcb_render_pointfix_t * points)1648 xcb_render_tri_fan_checked (xcb_connection_t            *c  /**< */,
1649                             uint8_t                      op  /**< */,
1650                             xcb_render_picture_t         src  /**< */,
1651                             xcb_render_picture_t         dst  /**< */,
1652                             xcb_render_pictformat_t      mask_format  /**< */,
1653                             int16_t                      src_x  /**< */,
1654                             int16_t                      src_y  /**< */,
1655                             uint32_t                     points_len  /**< */,
1656                             const xcb_render_pointfix_t *points  /**< */)
1657 {
1658     static const xcb_protocol_request_t xcb_req = {
1659         /* count */ 4,
1660         /* ext */ &xcb_render_id,
1661         /* opcode */ XCB_RENDER_TRI_FAN,
1662         /* isvoid */ 1
1663     };
1664 
1665     struct iovec xcb_parts[6];
1666     xcb_void_cookie_t xcb_ret;
1667     xcb_render_tri_fan_request_t xcb_out;
1668 
1669     xcb_out.op = op;
1670     memset(xcb_out.pad0, 0, 3);
1671     xcb_out.src = src;
1672     xcb_out.dst = dst;
1673     xcb_out.mask_format = mask_format;
1674     xcb_out.src_x = src_x;
1675     xcb_out.src_y = src_y;
1676 
1677     xcb_parts[2].iov_base = (char *) &xcb_out;
1678     xcb_parts[2].iov_len = sizeof(xcb_out);
1679     xcb_parts[3].iov_base = 0;
1680     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1681     /* xcb_render_pointfix_t points */
1682     xcb_parts[4].iov_base = (char *) points;
1683     xcb_parts[4].iov_len = points_len * sizeof(xcb_render_pointfix_t);
1684     xcb_parts[5].iov_base = 0;
1685     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1686 
1687     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1688     return xcb_ret;
1689 }
1690 
1691 xcb_void_cookie_t
xcb_render_tri_fan(xcb_connection_t * c,uint8_t op,xcb_render_picture_t src,xcb_render_picture_t dst,xcb_render_pictformat_t mask_format,int16_t src_x,int16_t src_y,uint32_t points_len,const xcb_render_pointfix_t * points)1692 xcb_render_tri_fan (xcb_connection_t            *c  /**< */,
1693                     uint8_t                      op  /**< */,
1694                     xcb_render_picture_t         src  /**< */,
1695                     xcb_render_picture_t         dst  /**< */,
1696                     xcb_render_pictformat_t      mask_format  /**< */,
1697                     int16_t                      src_x  /**< */,
1698                     int16_t                      src_y  /**< */,
1699                     uint32_t                     points_len  /**< */,
1700                     const xcb_render_pointfix_t *points  /**< */)
1701 {
1702     static const xcb_protocol_request_t xcb_req = {
1703         /* count */ 4,
1704         /* ext */ &xcb_render_id,
1705         /* opcode */ XCB_RENDER_TRI_FAN,
1706         /* isvoid */ 1
1707     };
1708 
1709     struct iovec xcb_parts[6];
1710     xcb_void_cookie_t xcb_ret;
1711     xcb_render_tri_fan_request_t xcb_out;
1712 
1713     xcb_out.op = op;
1714     memset(xcb_out.pad0, 0, 3);
1715     xcb_out.src = src;
1716     xcb_out.dst = dst;
1717     xcb_out.mask_format = mask_format;
1718     xcb_out.src_x = src_x;
1719     xcb_out.src_y = src_y;
1720 
1721     xcb_parts[2].iov_base = (char *) &xcb_out;
1722     xcb_parts[2].iov_len = sizeof(xcb_out);
1723     xcb_parts[3].iov_base = 0;
1724     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1725     /* xcb_render_pointfix_t points */
1726     xcb_parts[4].iov_base = (char *) points;
1727     xcb_parts[4].iov_len = points_len * sizeof(xcb_render_pointfix_t);
1728     xcb_parts[5].iov_base = 0;
1729     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1730 
1731     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1732     return xcb_ret;
1733 }
1734 
1735 xcb_void_cookie_t
xcb_render_create_glyph_set_checked(xcb_connection_t * c,xcb_render_glyphset_t gsid,xcb_render_pictformat_t format)1736 xcb_render_create_glyph_set_checked (xcb_connection_t        *c  /**< */,
1737                                      xcb_render_glyphset_t    gsid  /**< */,
1738                                      xcb_render_pictformat_t  format  /**< */)
1739 {
1740     static const xcb_protocol_request_t xcb_req = {
1741         /* count */ 2,
1742         /* ext */ &xcb_render_id,
1743         /* opcode */ XCB_RENDER_CREATE_GLYPH_SET,
1744         /* isvoid */ 1
1745     };
1746 
1747     struct iovec xcb_parts[4];
1748     xcb_void_cookie_t xcb_ret;
1749     xcb_render_create_glyph_set_request_t xcb_out;
1750 
1751     xcb_out.gsid = gsid;
1752     xcb_out.format = format;
1753 
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 
1759     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1760     return xcb_ret;
1761 }
1762 
1763 xcb_void_cookie_t
xcb_render_create_glyph_set(xcb_connection_t * c,xcb_render_glyphset_t gsid,xcb_render_pictformat_t format)1764 xcb_render_create_glyph_set (xcb_connection_t        *c  /**< */,
1765                              xcb_render_glyphset_t    gsid  /**< */,
1766                              xcb_render_pictformat_t  format  /**< */)
1767 {
1768     static const xcb_protocol_request_t xcb_req = {
1769         /* count */ 2,
1770         /* ext */ &xcb_render_id,
1771         /* opcode */ XCB_RENDER_CREATE_GLYPH_SET,
1772         /* isvoid */ 1
1773     };
1774 
1775     struct iovec xcb_parts[4];
1776     xcb_void_cookie_t xcb_ret;
1777     xcb_render_create_glyph_set_request_t xcb_out;
1778 
1779     xcb_out.gsid = gsid;
1780     xcb_out.format = format;
1781 
1782     xcb_parts[2].iov_base = (char *) &xcb_out;
1783     xcb_parts[2].iov_len = sizeof(xcb_out);
1784     xcb_parts[3].iov_base = 0;
1785     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1786 
1787     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1788     return xcb_ret;
1789 }
1790 
1791 xcb_void_cookie_t
xcb_render_reference_glyph_set_checked(xcb_connection_t * c,xcb_render_glyphset_t gsid,xcb_render_glyphset_t existing)1792 xcb_render_reference_glyph_set_checked (xcb_connection_t      *c  /**< */,
1793                                         xcb_render_glyphset_t  gsid  /**< */,
1794                                         xcb_render_glyphset_t  existing  /**< */)
1795 {
1796     static const xcb_protocol_request_t xcb_req = {
1797         /* count */ 2,
1798         /* ext */ &xcb_render_id,
1799         /* opcode */ XCB_RENDER_REFERENCE_GLYPH_SET,
1800         /* isvoid */ 1
1801     };
1802 
1803     struct iovec xcb_parts[4];
1804     xcb_void_cookie_t xcb_ret;
1805     xcb_render_reference_glyph_set_request_t xcb_out;
1806 
1807     xcb_out.gsid = gsid;
1808     xcb_out.existing = existing;
1809 
1810     xcb_parts[2].iov_base = (char *) &xcb_out;
1811     xcb_parts[2].iov_len = sizeof(xcb_out);
1812     xcb_parts[3].iov_base = 0;
1813     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1814 
1815     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1816     return xcb_ret;
1817 }
1818 
1819 xcb_void_cookie_t
xcb_render_reference_glyph_set(xcb_connection_t * c,xcb_render_glyphset_t gsid,xcb_render_glyphset_t existing)1820 xcb_render_reference_glyph_set (xcb_connection_t      *c  /**< */,
1821                                 xcb_render_glyphset_t  gsid  /**< */,
1822                                 xcb_render_glyphset_t  existing  /**< */)
1823 {
1824     static const xcb_protocol_request_t xcb_req = {
1825         /* count */ 2,
1826         /* ext */ &xcb_render_id,
1827         /* opcode */ XCB_RENDER_REFERENCE_GLYPH_SET,
1828         /* isvoid */ 1
1829     };
1830 
1831     struct iovec xcb_parts[4];
1832     xcb_void_cookie_t xcb_ret;
1833     xcb_render_reference_glyph_set_request_t xcb_out;
1834 
1835     xcb_out.gsid = gsid;
1836     xcb_out.existing = existing;
1837 
1838     xcb_parts[2].iov_base = (char *) &xcb_out;
1839     xcb_parts[2].iov_len = sizeof(xcb_out);
1840     xcb_parts[3].iov_base = 0;
1841     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1842 
1843     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1844     return xcb_ret;
1845 }
1846 
1847 xcb_void_cookie_t
xcb_render_free_glyph_set_checked(xcb_connection_t * c,xcb_render_glyphset_t glyphset)1848 xcb_render_free_glyph_set_checked (xcb_connection_t      *c  /**< */,
1849                                    xcb_render_glyphset_t  glyphset  /**< */)
1850 {
1851     static const xcb_protocol_request_t xcb_req = {
1852         /* count */ 2,
1853         /* ext */ &xcb_render_id,
1854         /* opcode */ XCB_RENDER_FREE_GLYPH_SET,
1855         /* isvoid */ 1
1856     };
1857 
1858     struct iovec xcb_parts[4];
1859     xcb_void_cookie_t xcb_ret;
1860     xcb_render_free_glyph_set_request_t xcb_out;
1861 
1862     xcb_out.glyphset = glyphset;
1863 
1864     xcb_parts[2].iov_base = (char *) &xcb_out;
1865     xcb_parts[2].iov_len = sizeof(xcb_out);
1866     xcb_parts[3].iov_base = 0;
1867     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1868 
1869     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1870     return xcb_ret;
1871 }
1872 
1873 xcb_void_cookie_t
xcb_render_free_glyph_set(xcb_connection_t * c,xcb_render_glyphset_t glyphset)1874 xcb_render_free_glyph_set (xcb_connection_t      *c  /**< */,
1875                            xcb_render_glyphset_t  glyphset  /**< */)
1876 {
1877     static const xcb_protocol_request_t xcb_req = {
1878         /* count */ 2,
1879         /* ext */ &xcb_render_id,
1880         /* opcode */ XCB_RENDER_FREE_GLYPH_SET,
1881         /* isvoid */ 1
1882     };
1883 
1884     struct iovec xcb_parts[4];
1885     xcb_void_cookie_t xcb_ret;
1886     xcb_render_free_glyph_set_request_t xcb_out;
1887 
1888     xcb_out.glyphset = glyphset;
1889 
1890     xcb_parts[2].iov_base = (char *) &xcb_out;
1891     xcb_parts[2].iov_len = sizeof(xcb_out);
1892     xcb_parts[3].iov_base = 0;
1893     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1894 
1895     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1896     return xcb_ret;
1897 }
1898 
1899 int
xcb_render_add_glyphs_sizeof(const void * _buffer,uint32_t data_len)1900 xcb_render_add_glyphs_sizeof (const void  *_buffer  /**< */,
1901                               uint32_t     data_len  /**< */)
1902 {
1903     char *xcb_tmp = (char *)_buffer;
1904     const xcb_render_add_glyphs_request_t *_aux = (xcb_render_add_glyphs_request_t *)_buffer;
1905     unsigned int xcb_buffer_len = 0;
1906     unsigned int xcb_block_len = 0;
1907     unsigned int xcb_pad = 0;
1908     unsigned int xcb_align_to = 0;
1909 
1910 
1911     xcb_block_len += sizeof(xcb_render_add_glyphs_request_t);
1912     xcb_tmp += xcb_block_len;
1913     xcb_buffer_len += xcb_block_len;
1914     xcb_block_len = 0;
1915     /* glyphids */
1916     xcb_block_len += _aux->glyphs_len * sizeof(uint32_t);
1917     xcb_tmp += xcb_block_len;
1918     xcb_align_to = ALIGNOF(uint32_t);
1919     /* insert padding */
1920     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1921     xcb_buffer_len += xcb_block_len + xcb_pad;
1922     if (0 != xcb_pad) {
1923         xcb_tmp += xcb_pad;
1924         xcb_pad = 0;
1925     }
1926     xcb_block_len = 0;
1927     /* glyphs */
1928     xcb_block_len += _aux->glyphs_len * sizeof(xcb_render_glyphinfo_t);
1929     xcb_tmp += xcb_block_len;
1930     xcb_align_to = ALIGNOF(xcb_render_glyphinfo_t);
1931     /* insert padding */
1932     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1933     xcb_buffer_len += xcb_block_len + xcb_pad;
1934     if (0 != xcb_pad) {
1935         xcb_tmp += xcb_pad;
1936         xcb_pad = 0;
1937     }
1938     xcb_block_len = 0;
1939     /* data */
1940     xcb_block_len += data_len * sizeof(uint8_t);
1941     xcb_tmp += xcb_block_len;
1942     xcb_align_to = ALIGNOF(uint8_t);
1943     /* insert padding */
1944     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1945     xcb_buffer_len += xcb_block_len + xcb_pad;
1946     if (0 != xcb_pad) {
1947         xcb_tmp += xcb_pad;
1948         xcb_pad = 0;
1949     }
1950     xcb_block_len = 0;
1951 
1952     return xcb_buffer_len;
1953 }
1954 
1955 xcb_void_cookie_t
xcb_render_add_glyphs_checked(xcb_connection_t * c,xcb_render_glyphset_t glyphset,uint32_t glyphs_len,const uint32_t * glyphids,const xcb_render_glyphinfo_t * glyphs,uint32_t data_len,const uint8_t * data)1956 xcb_render_add_glyphs_checked (xcb_connection_t             *c  /**< */,
1957                                xcb_render_glyphset_t         glyphset  /**< */,
1958                                uint32_t                      glyphs_len  /**< */,
1959                                const uint32_t               *glyphids  /**< */,
1960                                const xcb_render_glyphinfo_t *glyphs  /**< */,
1961                                uint32_t                      data_len  /**< */,
1962                                const uint8_t                *data  /**< */)
1963 {
1964     static const xcb_protocol_request_t xcb_req = {
1965         /* count */ 8,
1966         /* ext */ &xcb_render_id,
1967         /* opcode */ XCB_RENDER_ADD_GLYPHS,
1968         /* isvoid */ 1
1969     };
1970 
1971     struct iovec xcb_parts[10];
1972     xcb_void_cookie_t xcb_ret;
1973     xcb_render_add_glyphs_request_t xcb_out;
1974 
1975     xcb_out.glyphset = glyphset;
1976     xcb_out.glyphs_len = glyphs_len;
1977 
1978     xcb_parts[2].iov_base = (char *) &xcb_out;
1979     xcb_parts[2].iov_len = sizeof(xcb_out);
1980     xcb_parts[3].iov_base = 0;
1981     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1982     /* uint32_t glyphids */
1983     xcb_parts[4].iov_base = (char *) glyphids;
1984     xcb_parts[4].iov_len = glyphs_len * sizeof(uint32_t);
1985     xcb_parts[5].iov_base = 0;
1986     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1987     /* xcb_render_glyphinfo_t glyphs */
1988     xcb_parts[6].iov_base = (char *) glyphs;
1989     xcb_parts[6].iov_len = glyphs_len * sizeof(xcb_render_glyphinfo_t);
1990     xcb_parts[7].iov_base = 0;
1991     xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3;
1992     /* uint8_t data */
1993     xcb_parts[8].iov_base = (char *) data;
1994     xcb_parts[8].iov_len = data_len * sizeof(uint8_t);
1995     xcb_parts[9].iov_base = 0;
1996     xcb_parts[9].iov_len = -xcb_parts[8].iov_len & 3;
1997 
1998     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1999     return xcb_ret;
2000 }
2001 
2002 xcb_void_cookie_t
xcb_render_add_glyphs(xcb_connection_t * c,xcb_render_glyphset_t glyphset,uint32_t glyphs_len,const uint32_t * glyphids,const xcb_render_glyphinfo_t * glyphs,uint32_t data_len,const uint8_t * data)2003 xcb_render_add_glyphs (xcb_connection_t             *c  /**< */,
2004                        xcb_render_glyphset_t         glyphset  /**< */,
2005                        uint32_t                      glyphs_len  /**< */,
2006                        const uint32_t               *glyphids  /**< */,
2007                        const xcb_render_glyphinfo_t *glyphs  /**< */,
2008                        uint32_t                      data_len  /**< */,
2009                        const uint8_t                *data  /**< */)
2010 {
2011     static const xcb_protocol_request_t xcb_req = {
2012         /* count */ 8,
2013         /* ext */ &xcb_render_id,
2014         /* opcode */ XCB_RENDER_ADD_GLYPHS,
2015         /* isvoid */ 1
2016     };
2017 
2018     struct iovec xcb_parts[10];
2019     xcb_void_cookie_t xcb_ret;
2020     xcb_render_add_glyphs_request_t xcb_out;
2021 
2022     xcb_out.glyphset = glyphset;
2023     xcb_out.glyphs_len = glyphs_len;
2024 
2025     xcb_parts[2].iov_base = (char *) &xcb_out;
2026     xcb_parts[2].iov_len = sizeof(xcb_out);
2027     xcb_parts[3].iov_base = 0;
2028     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2029     /* uint32_t glyphids */
2030     xcb_parts[4].iov_base = (char *) glyphids;
2031     xcb_parts[4].iov_len = glyphs_len * sizeof(uint32_t);
2032     xcb_parts[5].iov_base = 0;
2033     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
2034     /* xcb_render_glyphinfo_t glyphs */
2035     xcb_parts[6].iov_base = (char *) glyphs;
2036     xcb_parts[6].iov_len = glyphs_len * sizeof(xcb_render_glyphinfo_t);
2037     xcb_parts[7].iov_base = 0;
2038     xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3;
2039     /* uint8_t data */
2040     xcb_parts[8].iov_base = (char *) data;
2041     xcb_parts[8].iov_len = data_len * sizeof(uint8_t);
2042     xcb_parts[9].iov_base = 0;
2043     xcb_parts[9].iov_len = -xcb_parts[8].iov_len & 3;
2044 
2045     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2046     return xcb_ret;
2047 }
2048 
2049 int
xcb_render_free_glyphs_sizeof(const void * _buffer,uint32_t glyphs_len)2050 xcb_render_free_glyphs_sizeof (const void  *_buffer  /**< */,
2051                                uint32_t     glyphs_len  /**< */)
2052 {
2053     char *xcb_tmp = (char *)_buffer;
2054     unsigned int xcb_buffer_len = 0;
2055     unsigned int xcb_block_len = 0;
2056     unsigned int xcb_pad = 0;
2057     unsigned int xcb_align_to = 0;
2058 
2059 
2060     xcb_block_len += sizeof(xcb_render_free_glyphs_request_t);
2061     xcb_tmp += xcb_block_len;
2062     xcb_buffer_len += xcb_block_len;
2063     xcb_block_len = 0;
2064     /* glyphs */
2065     xcb_block_len += glyphs_len * sizeof(xcb_render_glyph_t);
2066     xcb_tmp += xcb_block_len;
2067     xcb_align_to = ALIGNOF(xcb_render_glyph_t);
2068     /* insert padding */
2069     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2070     xcb_buffer_len += xcb_block_len + xcb_pad;
2071     if (0 != xcb_pad) {
2072         xcb_tmp += xcb_pad;
2073         xcb_pad = 0;
2074     }
2075     xcb_block_len = 0;
2076 
2077     return xcb_buffer_len;
2078 }
2079 
2080 xcb_void_cookie_t
xcb_render_free_glyphs_checked(xcb_connection_t * c,xcb_render_glyphset_t glyphset,uint32_t glyphs_len,const xcb_render_glyph_t * glyphs)2081 xcb_render_free_glyphs_checked (xcb_connection_t         *c  /**< */,
2082                                 xcb_render_glyphset_t     glyphset  /**< */,
2083                                 uint32_t                  glyphs_len  /**< */,
2084                                 const xcb_render_glyph_t *glyphs  /**< */)
2085 {
2086     static const xcb_protocol_request_t xcb_req = {
2087         /* count */ 4,
2088         /* ext */ &xcb_render_id,
2089         /* opcode */ XCB_RENDER_FREE_GLYPHS,
2090         /* isvoid */ 1
2091     };
2092 
2093     struct iovec xcb_parts[6];
2094     xcb_void_cookie_t xcb_ret;
2095     xcb_render_free_glyphs_request_t xcb_out;
2096 
2097     xcb_out.glyphset = glyphset;
2098 
2099     xcb_parts[2].iov_base = (char *) &xcb_out;
2100     xcb_parts[2].iov_len = sizeof(xcb_out);
2101     xcb_parts[3].iov_base = 0;
2102     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2103     /* xcb_render_glyph_t glyphs */
2104     xcb_parts[4].iov_base = (char *) glyphs;
2105     xcb_parts[4].iov_len = glyphs_len * sizeof(xcb_render_glyph_t);
2106     xcb_parts[5].iov_base = 0;
2107     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
2108 
2109     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2110     return xcb_ret;
2111 }
2112 
2113 xcb_void_cookie_t
xcb_render_free_glyphs(xcb_connection_t * c,xcb_render_glyphset_t glyphset,uint32_t glyphs_len,const xcb_render_glyph_t * glyphs)2114 xcb_render_free_glyphs (xcb_connection_t         *c  /**< */,
2115                         xcb_render_glyphset_t     glyphset  /**< */,
2116                         uint32_t                  glyphs_len  /**< */,
2117                         const xcb_render_glyph_t *glyphs  /**< */)
2118 {
2119     static const xcb_protocol_request_t xcb_req = {
2120         /* count */ 4,
2121         /* ext */ &xcb_render_id,
2122         /* opcode */ XCB_RENDER_FREE_GLYPHS,
2123         /* isvoid */ 1
2124     };
2125 
2126     struct iovec xcb_parts[6];
2127     xcb_void_cookie_t xcb_ret;
2128     xcb_render_free_glyphs_request_t xcb_out;
2129 
2130     xcb_out.glyphset = glyphset;
2131 
2132     xcb_parts[2].iov_base = (char *) &xcb_out;
2133     xcb_parts[2].iov_len = sizeof(xcb_out);
2134     xcb_parts[3].iov_base = 0;
2135     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2136     /* xcb_render_glyph_t glyphs */
2137     xcb_parts[4].iov_base = (char *) glyphs;
2138     xcb_parts[4].iov_len = glyphs_len * sizeof(xcb_render_glyph_t);
2139     xcb_parts[5].iov_base = 0;
2140     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
2141 
2142     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2143     return xcb_ret;
2144 }
2145 
2146 int
xcb_render_composite_glyphs_8_sizeof(const void * _buffer,uint32_t glyphcmds_len)2147 xcb_render_composite_glyphs_8_sizeof (const void  *_buffer  /**< */,
2148                                       uint32_t     glyphcmds_len  /**< */)
2149 {
2150     char *xcb_tmp = (char *)_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;
2155 
2156 
2157     xcb_block_len += sizeof(xcb_render_composite_glyphs_8_request_t);
2158     xcb_tmp += xcb_block_len;
2159     xcb_buffer_len += xcb_block_len;
2160     xcb_block_len = 0;
2161     /* glyphcmds */
2162     xcb_block_len += glyphcmds_len * sizeof(uint8_t);
2163     xcb_tmp += xcb_block_len;
2164     xcb_align_to = ALIGNOF(uint8_t);
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;
2171     }
2172     xcb_block_len = 0;
2173 
2174     return xcb_buffer_len;
2175 }
2176 
2177 xcb_void_cookie_t
xcb_render_composite_glyphs_8_checked(xcb_connection_t * c,uint8_t op,xcb_render_picture_t src,xcb_render_picture_t dst,xcb_render_pictformat_t mask_format,xcb_render_glyphset_t glyphset,int16_t src_x,int16_t src_y,uint32_t glyphcmds_len,const uint8_t * glyphcmds)2178 xcb_render_composite_glyphs_8_checked (xcb_connection_t        *c  /**< */,
2179                                        uint8_t                  op  /**< */,
2180                                        xcb_render_picture_t     src  /**< */,
2181                                        xcb_render_picture_t     dst  /**< */,
2182                                        xcb_render_pictformat_t  mask_format  /**< */,
2183                                        xcb_render_glyphset_t    glyphset  /**< */,
2184                                        int16_t                  src_x  /**< */,
2185                                        int16_t                  src_y  /**< */,
2186                                        uint32_t                 glyphcmds_len  /**< */,
2187                                        const uint8_t           *glyphcmds  /**< */)
2188 {
2189     static const xcb_protocol_request_t xcb_req = {
2190         /* count */ 4,
2191         /* ext */ &xcb_render_id,
2192         /* opcode */ XCB_RENDER_COMPOSITE_GLYPHS_8,
2193         /* isvoid */ 1
2194     };
2195 
2196     struct iovec xcb_parts[6];
2197     xcb_void_cookie_t xcb_ret;
2198     xcb_render_composite_glyphs_8_request_t xcb_out;
2199 
2200     xcb_out.op = op;
2201     memset(xcb_out.pad0, 0, 3);
2202     xcb_out.src = src;
2203     xcb_out.dst = dst;
2204     xcb_out.mask_format = mask_format;
2205     xcb_out.glyphset = glyphset;
2206     xcb_out.src_x = src_x;
2207     xcb_out.src_y = src_y;
2208 
2209     xcb_parts[2].iov_base = (char *) &xcb_out;
2210     xcb_parts[2].iov_len = sizeof(xcb_out);
2211     xcb_parts[3].iov_base = 0;
2212     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2213     /* uint8_t glyphcmds */
2214     xcb_parts[4].iov_base = (char *) glyphcmds;
2215     xcb_parts[4].iov_len = glyphcmds_len * sizeof(uint8_t);
2216     xcb_parts[5].iov_base = 0;
2217     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
2218 
2219     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2220     return xcb_ret;
2221 }
2222 
2223 xcb_void_cookie_t
xcb_render_composite_glyphs_8(xcb_connection_t * c,uint8_t op,xcb_render_picture_t src,xcb_render_picture_t dst,xcb_render_pictformat_t mask_format,xcb_render_glyphset_t glyphset,int16_t src_x,int16_t src_y,uint32_t glyphcmds_len,const uint8_t * glyphcmds)2224 xcb_render_composite_glyphs_8 (xcb_connection_t        *c  /**< */,
2225                                uint8_t                  op  /**< */,
2226                                xcb_render_picture_t     src  /**< */,
2227                                xcb_render_picture_t     dst  /**< */,
2228                                xcb_render_pictformat_t  mask_format  /**< */,
2229                                xcb_render_glyphset_t    glyphset  /**< */,
2230                                int16_t                  src_x  /**< */,
2231                                int16_t                  src_y  /**< */,
2232                                uint32_t                 glyphcmds_len  /**< */,
2233                                const uint8_t           *glyphcmds  /**< */)
2234 {
2235     static const xcb_protocol_request_t xcb_req = {
2236         /* count */ 4,
2237         /* ext */ &xcb_render_id,
2238         /* opcode */ XCB_RENDER_COMPOSITE_GLYPHS_8,
2239         /* isvoid */ 1
2240     };
2241 
2242     struct iovec xcb_parts[6];
2243     xcb_void_cookie_t xcb_ret;
2244     xcb_render_composite_glyphs_8_request_t xcb_out;
2245 
2246     xcb_out.op = op;
2247     memset(xcb_out.pad0, 0, 3);
2248     xcb_out.src = src;
2249     xcb_out.dst = dst;
2250     xcb_out.mask_format = mask_format;
2251     xcb_out.glyphset = glyphset;
2252     xcb_out.src_x = src_x;
2253     xcb_out.src_y = src_y;
2254 
2255     xcb_parts[2].iov_base = (char *) &xcb_out;
2256     xcb_parts[2].iov_len = sizeof(xcb_out);
2257     xcb_parts[3].iov_base = 0;
2258     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2259     /* uint8_t glyphcmds */
2260     xcb_parts[4].iov_base = (char *) glyphcmds;
2261     xcb_parts[4].iov_len = glyphcmds_len * sizeof(uint8_t);
2262     xcb_parts[5].iov_base = 0;
2263     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
2264 
2265     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2266     return xcb_ret;
2267 }
2268 
2269 int
xcb_render_composite_glyphs_16_sizeof(const void * _buffer,uint32_t glyphcmds_len)2270 xcb_render_composite_glyphs_16_sizeof (const void  *_buffer  /**< */,
2271                                        uint32_t     glyphcmds_len  /**< */)
2272 {
2273     char *xcb_tmp = (char *)_buffer;
2274     unsigned int xcb_buffer_len = 0;
2275     unsigned int xcb_block_len = 0;
2276     unsigned int xcb_pad = 0;
2277     unsigned int xcb_align_to = 0;
2278 
2279 
2280     xcb_block_len += sizeof(xcb_render_composite_glyphs_16_request_t);
2281     xcb_tmp += xcb_block_len;
2282     xcb_buffer_len += xcb_block_len;
2283     xcb_block_len = 0;
2284     /* glyphcmds */
2285     xcb_block_len += glyphcmds_len * sizeof(uint8_t);
2286     xcb_tmp += xcb_block_len;
2287     xcb_align_to = ALIGNOF(uint8_t);
2288     /* insert padding */
2289     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2290     xcb_buffer_len += xcb_block_len + xcb_pad;
2291     if (0 != xcb_pad) {
2292         xcb_tmp += xcb_pad;
2293         xcb_pad = 0;
2294     }
2295     xcb_block_len = 0;
2296 
2297     return xcb_buffer_len;
2298 }
2299 
2300 xcb_void_cookie_t
xcb_render_composite_glyphs_16_checked(xcb_connection_t * c,uint8_t op,xcb_render_picture_t src,xcb_render_picture_t dst,xcb_render_pictformat_t mask_format,xcb_render_glyphset_t glyphset,int16_t src_x,int16_t src_y,uint32_t glyphcmds_len,const uint8_t * glyphcmds)2301 xcb_render_composite_glyphs_16_checked (xcb_connection_t        *c  /**< */,
2302                                         uint8_t                  op  /**< */,
2303                                         xcb_render_picture_t     src  /**< */,
2304                                         xcb_render_picture_t     dst  /**< */,
2305                                         xcb_render_pictformat_t  mask_format  /**< */,
2306                                         xcb_render_glyphset_t    glyphset  /**< */,
2307                                         int16_t                  src_x  /**< */,
2308                                         int16_t                  src_y  /**< */,
2309                                         uint32_t                 glyphcmds_len  /**< */,
2310                                         const uint8_t           *glyphcmds  /**< */)
2311 {
2312     static const xcb_protocol_request_t xcb_req = {
2313         /* count */ 4,
2314         /* ext */ &xcb_render_id,
2315         /* opcode */ XCB_RENDER_COMPOSITE_GLYPHS_16,
2316         /* isvoid */ 1
2317     };
2318 
2319     struct iovec xcb_parts[6];
2320     xcb_void_cookie_t xcb_ret;
2321     xcb_render_composite_glyphs_16_request_t xcb_out;
2322 
2323     xcb_out.op = op;
2324     memset(xcb_out.pad0, 0, 3);
2325     xcb_out.src = src;
2326     xcb_out.dst = dst;
2327     xcb_out.mask_format = mask_format;
2328     xcb_out.glyphset = glyphset;
2329     xcb_out.src_x = src_x;
2330     xcb_out.src_y = src_y;
2331 
2332     xcb_parts[2].iov_base = (char *) &xcb_out;
2333     xcb_parts[2].iov_len = sizeof(xcb_out);
2334     xcb_parts[3].iov_base = 0;
2335     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2336     /* uint8_t glyphcmds */
2337     xcb_parts[4].iov_base = (char *) glyphcmds;
2338     xcb_parts[4].iov_len = glyphcmds_len * sizeof(uint8_t);
2339     xcb_parts[5].iov_base = 0;
2340     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
2341 
2342     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2343     return xcb_ret;
2344 }
2345 
2346 xcb_void_cookie_t
xcb_render_composite_glyphs_16(xcb_connection_t * c,uint8_t op,xcb_render_picture_t src,xcb_render_picture_t dst,xcb_render_pictformat_t mask_format,xcb_render_glyphset_t glyphset,int16_t src_x,int16_t src_y,uint32_t glyphcmds_len,const uint8_t * glyphcmds)2347 xcb_render_composite_glyphs_16 (xcb_connection_t        *c  /**< */,
2348                                 uint8_t                  op  /**< */,
2349                                 xcb_render_picture_t     src  /**< */,
2350                                 xcb_render_picture_t     dst  /**< */,
2351                                 xcb_render_pictformat_t  mask_format  /**< */,
2352                                 xcb_render_glyphset_t    glyphset  /**< */,
2353                                 int16_t                  src_x  /**< */,
2354                                 int16_t                  src_y  /**< */,
2355                                 uint32_t                 glyphcmds_len  /**< */,
2356                                 const uint8_t           *glyphcmds  /**< */)
2357 {
2358     static const xcb_protocol_request_t xcb_req = {
2359         /* count */ 4,
2360         /* ext */ &xcb_render_id,
2361         /* opcode */ XCB_RENDER_COMPOSITE_GLYPHS_16,
2362         /* isvoid */ 1
2363     };
2364 
2365     struct iovec xcb_parts[6];
2366     xcb_void_cookie_t xcb_ret;
2367     xcb_render_composite_glyphs_16_request_t xcb_out;
2368 
2369     xcb_out.op = op;
2370     memset(xcb_out.pad0, 0, 3);
2371     xcb_out.src = src;
2372     xcb_out.dst = dst;
2373     xcb_out.mask_format = mask_format;
2374     xcb_out.glyphset = glyphset;
2375     xcb_out.src_x = src_x;
2376     xcb_out.src_y = src_y;
2377 
2378     xcb_parts[2].iov_base = (char *) &xcb_out;
2379     xcb_parts[2].iov_len = sizeof(xcb_out);
2380     xcb_parts[3].iov_base = 0;
2381     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2382     /* uint8_t glyphcmds */
2383     xcb_parts[4].iov_base = (char *) glyphcmds;
2384     xcb_parts[4].iov_len = glyphcmds_len * sizeof(uint8_t);
2385     xcb_parts[5].iov_base = 0;
2386     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
2387 
2388     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2389     return xcb_ret;
2390 }
2391 
2392 int
xcb_render_composite_glyphs_32_sizeof(const void * _buffer,uint32_t glyphcmds_len)2393 xcb_render_composite_glyphs_32_sizeof (const void  *_buffer  /**< */,
2394                                        uint32_t     glyphcmds_len  /**< */)
2395 {
2396     char *xcb_tmp = (char *)_buffer;
2397     unsigned int xcb_buffer_len = 0;
2398     unsigned int xcb_block_len = 0;
2399     unsigned int xcb_pad = 0;
2400     unsigned int xcb_align_to = 0;
2401 
2402 
2403     xcb_block_len += sizeof(xcb_render_composite_glyphs_32_request_t);
2404     xcb_tmp += xcb_block_len;
2405     xcb_buffer_len += xcb_block_len;
2406     xcb_block_len = 0;
2407     /* glyphcmds */
2408     xcb_block_len += glyphcmds_len * sizeof(uint8_t);
2409     xcb_tmp += xcb_block_len;
2410     xcb_align_to = ALIGNOF(uint8_t);
2411     /* insert padding */
2412     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2413     xcb_buffer_len += xcb_block_len + xcb_pad;
2414     if (0 != xcb_pad) {
2415         xcb_tmp += xcb_pad;
2416         xcb_pad = 0;
2417     }
2418     xcb_block_len = 0;
2419 
2420     return xcb_buffer_len;
2421 }
2422 
2423 xcb_void_cookie_t
xcb_render_composite_glyphs_32_checked(xcb_connection_t * c,uint8_t op,xcb_render_picture_t src,xcb_render_picture_t dst,xcb_render_pictformat_t mask_format,xcb_render_glyphset_t glyphset,int16_t src_x,int16_t src_y,uint32_t glyphcmds_len,const uint8_t * glyphcmds)2424 xcb_render_composite_glyphs_32_checked (xcb_connection_t        *c  /**< */,
2425                                         uint8_t                  op  /**< */,
2426                                         xcb_render_picture_t     src  /**< */,
2427                                         xcb_render_picture_t     dst  /**< */,
2428                                         xcb_render_pictformat_t  mask_format  /**< */,
2429                                         xcb_render_glyphset_t    glyphset  /**< */,
2430                                         int16_t                  src_x  /**< */,
2431                                         int16_t                  src_y  /**< */,
2432                                         uint32_t                 glyphcmds_len  /**< */,
2433                                         const uint8_t           *glyphcmds  /**< */)
2434 {
2435     static const xcb_protocol_request_t xcb_req = {
2436         /* count */ 4,
2437         /* ext */ &xcb_render_id,
2438         /* opcode */ XCB_RENDER_COMPOSITE_GLYPHS_32,
2439         /* isvoid */ 1
2440     };
2441 
2442     struct iovec xcb_parts[6];
2443     xcb_void_cookie_t xcb_ret;
2444     xcb_render_composite_glyphs_32_request_t xcb_out;
2445 
2446     xcb_out.op = op;
2447     memset(xcb_out.pad0, 0, 3);
2448     xcb_out.src = src;
2449     xcb_out.dst = dst;
2450     xcb_out.mask_format = mask_format;
2451     xcb_out.glyphset = glyphset;
2452     xcb_out.src_x = src_x;
2453     xcb_out.src_y = src_y;
2454 
2455     xcb_parts[2].iov_base = (char *) &xcb_out;
2456     xcb_parts[2].iov_len = sizeof(xcb_out);
2457     xcb_parts[3].iov_base = 0;
2458     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2459     /* uint8_t glyphcmds */
2460     xcb_parts[4].iov_base = (char *) glyphcmds;
2461     xcb_parts[4].iov_len = glyphcmds_len * sizeof(uint8_t);
2462     xcb_parts[5].iov_base = 0;
2463     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
2464 
2465     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2466     return xcb_ret;
2467 }
2468 
2469 xcb_void_cookie_t
xcb_render_composite_glyphs_32(xcb_connection_t * c,uint8_t op,xcb_render_picture_t src,xcb_render_picture_t dst,xcb_render_pictformat_t mask_format,xcb_render_glyphset_t glyphset,int16_t src_x,int16_t src_y,uint32_t glyphcmds_len,const uint8_t * glyphcmds)2470 xcb_render_composite_glyphs_32 (xcb_connection_t        *c  /**< */,
2471                                 uint8_t                  op  /**< */,
2472                                 xcb_render_picture_t     src  /**< */,
2473                                 xcb_render_picture_t     dst  /**< */,
2474                                 xcb_render_pictformat_t  mask_format  /**< */,
2475                                 xcb_render_glyphset_t    glyphset  /**< */,
2476                                 int16_t                  src_x  /**< */,
2477                                 int16_t                  src_y  /**< */,
2478                                 uint32_t                 glyphcmds_len  /**< */,
2479                                 const uint8_t           *glyphcmds  /**< */)
2480 {
2481     static const xcb_protocol_request_t xcb_req = {
2482         /* count */ 4,
2483         /* ext */ &xcb_render_id,
2484         /* opcode */ XCB_RENDER_COMPOSITE_GLYPHS_32,
2485         /* isvoid */ 1
2486     };
2487 
2488     struct iovec xcb_parts[6];
2489     xcb_void_cookie_t xcb_ret;
2490     xcb_render_composite_glyphs_32_request_t xcb_out;
2491 
2492     xcb_out.op = op;
2493     memset(xcb_out.pad0, 0, 3);
2494     xcb_out.src = src;
2495     xcb_out.dst = dst;
2496     xcb_out.mask_format = mask_format;
2497     xcb_out.glyphset = glyphset;
2498     xcb_out.src_x = src_x;
2499     xcb_out.src_y = src_y;
2500 
2501     xcb_parts[2].iov_base = (char *) &xcb_out;
2502     xcb_parts[2].iov_len = sizeof(xcb_out);
2503     xcb_parts[3].iov_base = 0;
2504     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2505     /* uint8_t glyphcmds */
2506     xcb_parts[4].iov_base = (char *) glyphcmds;
2507     xcb_parts[4].iov_len = glyphcmds_len * sizeof(uint8_t);
2508     xcb_parts[5].iov_base = 0;
2509     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
2510 
2511     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2512     return xcb_ret;
2513 }
2514 
2515 int
xcb_render_fill_rectangles_sizeof(const void * _buffer,uint32_t rects_len)2516 xcb_render_fill_rectangles_sizeof (const void  *_buffer  /**< */,
2517                                    uint32_t     rects_len  /**< */)
2518 {
2519     char *xcb_tmp = (char *)_buffer;
2520     unsigned int xcb_buffer_len = 0;
2521     unsigned int xcb_block_len = 0;
2522     unsigned int xcb_pad = 0;
2523     unsigned int xcb_align_to = 0;
2524 
2525 
2526     xcb_block_len += sizeof(xcb_render_fill_rectangles_request_t);
2527     xcb_tmp += xcb_block_len;
2528     xcb_buffer_len += xcb_block_len;
2529     xcb_block_len = 0;
2530     /* rects */
2531     xcb_block_len += rects_len * sizeof(xcb_rectangle_t);
2532     xcb_tmp += xcb_block_len;
2533     xcb_align_to = ALIGNOF(xcb_rectangle_t);
2534     /* insert padding */
2535     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2536     xcb_buffer_len += xcb_block_len + xcb_pad;
2537     if (0 != xcb_pad) {
2538         xcb_tmp += xcb_pad;
2539         xcb_pad = 0;
2540     }
2541     xcb_block_len = 0;
2542 
2543     return xcb_buffer_len;
2544 }
2545 
2546 xcb_void_cookie_t
xcb_render_fill_rectangles_checked(xcb_connection_t * c,uint8_t op,xcb_render_picture_t dst,xcb_render_color_t color,uint32_t rects_len,const xcb_rectangle_t * rects)2547 xcb_render_fill_rectangles_checked (xcb_connection_t      *c  /**< */,
2548                                     uint8_t                op  /**< */,
2549                                     xcb_render_picture_t   dst  /**< */,
2550                                     xcb_render_color_t     color  /**< */,
2551                                     uint32_t               rects_len  /**< */,
2552                                     const xcb_rectangle_t *rects  /**< */)
2553 {
2554     static const xcb_protocol_request_t xcb_req = {
2555         /* count */ 4,
2556         /* ext */ &xcb_render_id,
2557         /* opcode */ XCB_RENDER_FILL_RECTANGLES,
2558         /* isvoid */ 1
2559     };
2560 
2561     struct iovec xcb_parts[6];
2562     xcb_void_cookie_t xcb_ret;
2563     xcb_render_fill_rectangles_request_t xcb_out;
2564 
2565     xcb_out.op = op;
2566     memset(xcb_out.pad0, 0, 3);
2567     xcb_out.dst = dst;
2568     xcb_out.color = color;
2569 
2570     xcb_parts[2].iov_base = (char *) &xcb_out;
2571     xcb_parts[2].iov_len = sizeof(xcb_out);
2572     xcb_parts[3].iov_base = 0;
2573     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2574     /* xcb_rectangle_t rects */
2575     xcb_parts[4].iov_base = (char *) rects;
2576     xcb_parts[4].iov_len = rects_len * sizeof(xcb_rectangle_t);
2577     xcb_parts[5].iov_base = 0;
2578     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
2579 
2580     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2581     return xcb_ret;
2582 }
2583 
2584 xcb_void_cookie_t
xcb_render_fill_rectangles(xcb_connection_t * c,uint8_t op,xcb_render_picture_t dst,xcb_render_color_t color,uint32_t rects_len,const xcb_rectangle_t * rects)2585 xcb_render_fill_rectangles (xcb_connection_t      *c  /**< */,
2586                             uint8_t                op  /**< */,
2587                             xcb_render_picture_t   dst  /**< */,
2588                             xcb_render_color_t     color  /**< */,
2589                             uint32_t               rects_len  /**< */,
2590                             const xcb_rectangle_t *rects  /**< */)
2591 {
2592     static const xcb_protocol_request_t xcb_req = {
2593         /* count */ 4,
2594         /* ext */ &xcb_render_id,
2595         /* opcode */ XCB_RENDER_FILL_RECTANGLES,
2596         /* isvoid */ 1
2597     };
2598 
2599     struct iovec xcb_parts[6];
2600     xcb_void_cookie_t xcb_ret;
2601     xcb_render_fill_rectangles_request_t xcb_out;
2602 
2603     xcb_out.op = op;
2604     memset(xcb_out.pad0, 0, 3);
2605     xcb_out.dst = dst;
2606     xcb_out.color = color;
2607 
2608     xcb_parts[2].iov_base = (char *) &xcb_out;
2609     xcb_parts[2].iov_len = sizeof(xcb_out);
2610     xcb_parts[3].iov_base = 0;
2611     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2612     /* xcb_rectangle_t rects */
2613     xcb_parts[4].iov_base = (char *) rects;
2614     xcb_parts[4].iov_len = rects_len * sizeof(xcb_rectangle_t);
2615     xcb_parts[5].iov_base = 0;
2616     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
2617 
2618     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2619     return xcb_ret;
2620 }
2621 
2622 xcb_void_cookie_t
xcb_render_create_cursor_checked(xcb_connection_t * c,xcb_cursor_t cid,xcb_render_picture_t source,uint16_t x,uint16_t y)2623 xcb_render_create_cursor_checked (xcb_connection_t     *c  /**< */,
2624                                   xcb_cursor_t          cid  /**< */,
2625                                   xcb_render_picture_t  source  /**< */,
2626                                   uint16_t              x  /**< */,
2627                                   uint16_t              y  /**< */)
2628 {
2629     static const xcb_protocol_request_t xcb_req = {
2630         /* count */ 2,
2631         /* ext */ &xcb_render_id,
2632         /* opcode */ XCB_RENDER_CREATE_CURSOR,
2633         /* isvoid */ 1
2634     };
2635 
2636     struct iovec xcb_parts[4];
2637     xcb_void_cookie_t xcb_ret;
2638     xcb_render_create_cursor_request_t xcb_out;
2639 
2640     xcb_out.cid = cid;
2641     xcb_out.source = source;
2642     xcb_out.x = x;
2643     xcb_out.y = y;
2644 
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;
2649 
2650     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2651     return xcb_ret;
2652 }
2653 
2654 xcb_void_cookie_t
xcb_render_create_cursor(xcb_connection_t * c,xcb_cursor_t cid,xcb_render_picture_t source,uint16_t x,uint16_t y)2655 xcb_render_create_cursor (xcb_connection_t     *c  /**< */,
2656                           xcb_cursor_t          cid  /**< */,
2657                           xcb_render_picture_t  source  /**< */,
2658                           uint16_t              x  /**< */,
2659                           uint16_t              y  /**< */)
2660 {
2661     static const xcb_protocol_request_t xcb_req = {
2662         /* count */ 2,
2663         /* ext */ &xcb_render_id,
2664         /* opcode */ XCB_RENDER_CREATE_CURSOR,
2665         /* isvoid */ 1
2666     };
2667 
2668     struct iovec xcb_parts[4];
2669     xcb_void_cookie_t xcb_ret;
2670     xcb_render_create_cursor_request_t xcb_out;
2671 
2672     xcb_out.cid = cid;
2673     xcb_out.source = source;
2674     xcb_out.x = x;
2675     xcb_out.y = y;
2676 
2677     xcb_parts[2].iov_base = (char *) &xcb_out;
2678     xcb_parts[2].iov_len = sizeof(xcb_out);
2679     xcb_parts[3].iov_base = 0;
2680     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2681 
2682     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2683     return xcb_ret;
2684 }
2685 
2686 void
xcb_render_transform_next(xcb_render_transform_iterator_t * i)2687 xcb_render_transform_next (xcb_render_transform_iterator_t *i  /**< */)
2688 {
2689     --i->rem;
2690     ++i->data;
2691     i->index += sizeof(xcb_render_transform_t);
2692 }
2693 
2694 xcb_generic_iterator_t
xcb_render_transform_end(xcb_render_transform_iterator_t i)2695 xcb_render_transform_end (xcb_render_transform_iterator_t i  /**< */)
2696 {
2697     xcb_generic_iterator_t ret;
2698     ret.data = i.data + i.rem;
2699     ret.index = i.index + ((char *) ret.data - (char *) i.data);
2700     ret.rem = 0;
2701     return ret;
2702 }
2703 
2704 xcb_void_cookie_t
xcb_render_set_picture_transform_checked(xcb_connection_t * c,xcb_render_picture_t picture,xcb_render_transform_t transform)2705 xcb_render_set_picture_transform_checked (xcb_connection_t       *c  /**< */,
2706                                           xcb_render_picture_t    picture  /**< */,
2707                                           xcb_render_transform_t  transform  /**< */)
2708 {
2709     static const xcb_protocol_request_t xcb_req = {
2710         /* count */ 2,
2711         /* ext */ &xcb_render_id,
2712         /* opcode */ XCB_RENDER_SET_PICTURE_TRANSFORM,
2713         /* isvoid */ 1
2714     };
2715 
2716     struct iovec xcb_parts[4];
2717     xcb_void_cookie_t xcb_ret;
2718     xcb_render_set_picture_transform_request_t xcb_out;
2719 
2720     xcb_out.picture = picture;
2721     xcb_out.transform = transform;
2722 
2723     xcb_parts[2].iov_base = (char *) &xcb_out;
2724     xcb_parts[2].iov_len = sizeof(xcb_out);
2725     xcb_parts[3].iov_base = 0;
2726     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2727 
2728     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2729     return xcb_ret;
2730 }
2731 
2732 xcb_void_cookie_t
xcb_render_set_picture_transform(xcb_connection_t * c,xcb_render_picture_t picture,xcb_render_transform_t transform)2733 xcb_render_set_picture_transform (xcb_connection_t       *c  /**< */,
2734                                   xcb_render_picture_t    picture  /**< */,
2735                                   xcb_render_transform_t  transform  /**< */)
2736 {
2737     static const xcb_protocol_request_t xcb_req = {
2738         /* count */ 2,
2739         /* ext */ &xcb_render_id,
2740         /* opcode */ XCB_RENDER_SET_PICTURE_TRANSFORM,
2741         /* isvoid */ 1
2742     };
2743 
2744     struct iovec xcb_parts[4];
2745     xcb_void_cookie_t xcb_ret;
2746     xcb_render_set_picture_transform_request_t xcb_out;
2747 
2748     xcb_out.picture = picture;
2749     xcb_out.transform = transform;
2750 
2751     xcb_parts[2].iov_base = (char *) &xcb_out;
2752     xcb_parts[2].iov_len = sizeof(xcb_out);
2753     xcb_parts[3].iov_base = 0;
2754     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2755 
2756     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2757     return xcb_ret;
2758 }
2759 
2760 int
xcb_render_query_filters_sizeof(const void * _buffer)2761 xcb_render_query_filters_sizeof (const void  *_buffer  /**< */)
2762 {
2763     char *xcb_tmp = (char *)_buffer;
2764     const xcb_render_query_filters_reply_t *_aux = (xcb_render_query_filters_reply_t *)_buffer;
2765     unsigned int xcb_buffer_len = 0;
2766     unsigned int xcb_block_len = 0;
2767     unsigned int xcb_pad = 0;
2768     unsigned int xcb_align_to = 0;
2769 
2770     unsigned int i;
2771     unsigned int xcb_tmp_len;
2772 
2773     xcb_block_len += sizeof(xcb_render_query_filters_reply_t);
2774     xcb_tmp += xcb_block_len;
2775     xcb_buffer_len += xcb_block_len;
2776     xcb_block_len = 0;
2777     /* aliases */
2778     xcb_block_len += _aux->num_aliases * sizeof(uint16_t);
2779     xcb_tmp += xcb_block_len;
2780     xcb_align_to = ALIGNOF(uint16_t);
2781     /* insert padding */
2782     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2783     xcb_buffer_len += xcb_block_len + xcb_pad;
2784     if (0 != xcb_pad) {
2785         xcb_tmp += xcb_pad;
2786         xcb_pad = 0;
2787     }
2788     xcb_block_len = 0;
2789     /* filters */
2790     for(i=0; i<_aux->num_filters; i++) {
2791         xcb_tmp_len = xcb_str_sizeof(xcb_tmp);
2792         xcb_block_len += xcb_tmp_len;
2793         xcb_tmp += xcb_tmp_len;
2794     }
2795     xcb_align_to = ALIGNOF(xcb_str_t);
2796     /* insert padding */
2797     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2798     xcb_buffer_len += xcb_block_len + xcb_pad;
2799     if (0 != xcb_pad) {
2800         xcb_tmp += xcb_pad;
2801         xcb_pad = 0;
2802     }
2803     xcb_block_len = 0;
2804 
2805     return xcb_buffer_len;
2806 }
2807 
2808 xcb_render_query_filters_cookie_t
xcb_render_query_filters(xcb_connection_t * c,xcb_drawable_t drawable)2809 xcb_render_query_filters (xcb_connection_t *c  /**< */,
2810                           xcb_drawable_t    drawable  /**< */)
2811 {
2812     static const xcb_protocol_request_t xcb_req = {
2813         /* count */ 2,
2814         /* ext */ &xcb_render_id,
2815         /* opcode */ XCB_RENDER_QUERY_FILTERS,
2816         /* isvoid */ 0
2817     };
2818 
2819     struct iovec xcb_parts[4];
2820     xcb_render_query_filters_cookie_t xcb_ret;
2821     xcb_render_query_filters_request_t xcb_out;
2822 
2823     xcb_out.drawable = drawable;
2824 
2825     xcb_parts[2].iov_base = (char *) &xcb_out;
2826     xcb_parts[2].iov_len = sizeof(xcb_out);
2827     xcb_parts[3].iov_base = 0;
2828     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2829 
2830     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2831     return xcb_ret;
2832 }
2833 
2834 xcb_render_query_filters_cookie_t
xcb_render_query_filters_unchecked(xcb_connection_t * c,xcb_drawable_t drawable)2835 xcb_render_query_filters_unchecked (xcb_connection_t *c  /**< */,
2836                                     xcb_drawable_t    drawable  /**< */)
2837 {
2838     static const xcb_protocol_request_t xcb_req = {
2839         /* count */ 2,
2840         /* ext */ &xcb_render_id,
2841         /* opcode */ XCB_RENDER_QUERY_FILTERS,
2842         /* isvoid */ 0
2843     };
2844 
2845     struct iovec xcb_parts[4];
2846     xcb_render_query_filters_cookie_t xcb_ret;
2847     xcb_render_query_filters_request_t xcb_out;
2848 
2849     xcb_out.drawable = drawable;
2850 
2851     xcb_parts[2].iov_base = (char *) &xcb_out;
2852     xcb_parts[2].iov_len = sizeof(xcb_out);
2853     xcb_parts[3].iov_base = 0;
2854     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2855 
2856     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2857     return xcb_ret;
2858 }
2859 
2860 uint16_t *
xcb_render_query_filters_aliases(const xcb_render_query_filters_reply_t * R)2861 xcb_render_query_filters_aliases (const xcb_render_query_filters_reply_t *R  /**< */)
2862 {
2863     return (uint16_t *) (R + 1);
2864 }
2865 
2866 int
xcb_render_query_filters_aliases_length(const xcb_render_query_filters_reply_t * R)2867 xcb_render_query_filters_aliases_length (const xcb_render_query_filters_reply_t *R  /**< */)
2868 {
2869     return R->num_aliases;
2870 }
2871 
2872 xcb_generic_iterator_t
xcb_render_query_filters_aliases_end(const xcb_render_query_filters_reply_t * R)2873 xcb_render_query_filters_aliases_end (const xcb_render_query_filters_reply_t *R  /**< */)
2874 {
2875     xcb_generic_iterator_t i;
2876     i.data = ((uint16_t *) (R + 1)) + (R->num_aliases);
2877     i.rem = 0;
2878     i.index = (char *) i.data - (char *) R;
2879     return i;
2880 }
2881 
2882 int
xcb_render_query_filters_filters_length(const xcb_render_query_filters_reply_t * R)2883 xcb_render_query_filters_filters_length (const xcb_render_query_filters_reply_t *R  /**< */)
2884 {
2885     return R->num_filters;
2886 }
2887 
2888 xcb_str_iterator_t
xcb_render_query_filters_filters_iterator(const xcb_render_query_filters_reply_t * R)2889 xcb_render_query_filters_filters_iterator (const xcb_render_query_filters_reply_t *R  /**< */)
2890 {
2891     xcb_str_iterator_t i;
2892     xcb_generic_iterator_t prev = xcb_render_query_filters_aliases_end(R);
2893     i.data = (xcb_str_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_str_t, prev.index));
2894     i.rem = R->num_filters;
2895     i.index = (char *) i.data - (char *) R;
2896     return i;
2897 }
2898 
2899 xcb_render_query_filters_reply_t *
xcb_render_query_filters_reply(xcb_connection_t * c,xcb_render_query_filters_cookie_t cookie,xcb_generic_error_t ** e)2900 xcb_render_query_filters_reply (xcb_connection_t                   *c  /**< */,
2901                                 xcb_render_query_filters_cookie_t   cookie  /**< */,
2902                                 xcb_generic_error_t               **e  /**< */)
2903 {
2904     return (xcb_render_query_filters_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
2905 }
2906 
2907 int
xcb_render_set_picture_filter_sizeof(const void * _buffer,uint32_t values_len)2908 xcb_render_set_picture_filter_sizeof (const void  *_buffer  /**< */,
2909                                       uint32_t     values_len  /**< */)
2910 {
2911     char *xcb_tmp = (char *)_buffer;
2912     const xcb_render_set_picture_filter_request_t *_aux = (xcb_render_set_picture_filter_request_t *)_buffer;
2913     unsigned int xcb_buffer_len = 0;
2914     unsigned int xcb_block_len = 0;
2915     unsigned int xcb_pad = 0;
2916     unsigned int xcb_align_to = 0;
2917 
2918 
2919     xcb_block_len += sizeof(xcb_render_set_picture_filter_request_t);
2920     xcb_tmp += xcb_block_len;
2921     xcb_buffer_len += xcb_block_len;
2922     xcb_block_len = 0;
2923     /* filter */
2924     xcb_block_len += _aux->filter_len * sizeof(char);
2925     xcb_tmp += xcb_block_len;
2926     xcb_align_to = ALIGNOF(char);
2927     /* insert padding */
2928     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2929     xcb_buffer_len += xcb_block_len + xcb_pad;
2930     if (0 != xcb_pad) {
2931         xcb_tmp += xcb_pad;
2932         xcb_pad = 0;
2933     }
2934     xcb_block_len = 0;
2935     /* values */
2936     xcb_block_len += values_len * sizeof(xcb_render_fixed_t);
2937     xcb_tmp += xcb_block_len;
2938     xcb_align_to = ALIGNOF(xcb_render_fixed_t);
2939     /* insert padding */
2940     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2941     xcb_buffer_len += xcb_block_len + xcb_pad;
2942     if (0 != xcb_pad) {
2943         xcb_tmp += xcb_pad;
2944         xcb_pad = 0;
2945     }
2946     xcb_block_len = 0;
2947 
2948     return xcb_buffer_len;
2949 }
2950 
2951 xcb_void_cookie_t
xcb_render_set_picture_filter_checked(xcb_connection_t * c,xcb_render_picture_t picture,uint16_t filter_len,const char * filter,uint32_t values_len,const xcb_render_fixed_t * values)2952 xcb_render_set_picture_filter_checked (xcb_connection_t         *c  /**< */,
2953                                        xcb_render_picture_t      picture  /**< */,
2954                                        uint16_t                  filter_len  /**< */,
2955                                        const char               *filter  /**< */,
2956                                        uint32_t                  values_len  /**< */,
2957                                        const xcb_render_fixed_t *values  /**< */)
2958 {
2959     static const xcb_protocol_request_t xcb_req = {
2960         /* count */ 6,
2961         /* ext */ &xcb_render_id,
2962         /* opcode */ XCB_RENDER_SET_PICTURE_FILTER,
2963         /* isvoid */ 1
2964     };
2965 
2966     struct iovec xcb_parts[8];
2967     xcb_void_cookie_t xcb_ret;
2968     xcb_render_set_picture_filter_request_t xcb_out;
2969 
2970     xcb_out.picture = picture;
2971     xcb_out.filter_len = filter_len;
2972     memset(xcb_out.pad0, 0, 2);
2973 
2974     xcb_parts[2].iov_base = (char *) &xcb_out;
2975     xcb_parts[2].iov_len = sizeof(xcb_out);
2976     xcb_parts[3].iov_base = 0;
2977     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2978     /* char filter */
2979     xcb_parts[4].iov_base = (char *) filter;
2980     xcb_parts[4].iov_len = filter_len * sizeof(char);
2981     xcb_parts[5].iov_base = 0;
2982     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
2983     /* xcb_render_fixed_t values */
2984     xcb_parts[6].iov_base = (char *) values;
2985     xcb_parts[6].iov_len = values_len * sizeof(xcb_render_fixed_t);
2986     xcb_parts[7].iov_base = 0;
2987     xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3;
2988 
2989     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2990     return xcb_ret;
2991 }
2992 
2993 xcb_void_cookie_t
xcb_render_set_picture_filter(xcb_connection_t * c,xcb_render_picture_t picture,uint16_t filter_len,const char * filter,uint32_t values_len,const xcb_render_fixed_t * values)2994 xcb_render_set_picture_filter (xcb_connection_t         *c  /**< */,
2995                                xcb_render_picture_t      picture  /**< */,
2996                                uint16_t                  filter_len  /**< */,
2997                                const char               *filter  /**< */,
2998                                uint32_t                  values_len  /**< */,
2999                                const xcb_render_fixed_t *values  /**< */)
3000 {
3001     static const xcb_protocol_request_t xcb_req = {
3002         /* count */ 6,
3003         /* ext */ &xcb_render_id,
3004         /* opcode */ XCB_RENDER_SET_PICTURE_FILTER,
3005         /* isvoid */ 1
3006     };
3007 
3008     struct iovec xcb_parts[8];
3009     xcb_void_cookie_t xcb_ret;
3010     xcb_render_set_picture_filter_request_t xcb_out;
3011 
3012     xcb_out.picture = picture;
3013     xcb_out.filter_len = filter_len;
3014     memset(xcb_out.pad0, 0, 2);
3015 
3016     xcb_parts[2].iov_base = (char *) &xcb_out;
3017     xcb_parts[2].iov_len = sizeof(xcb_out);
3018     xcb_parts[3].iov_base = 0;
3019     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3020     /* char filter */
3021     xcb_parts[4].iov_base = (char *) filter;
3022     xcb_parts[4].iov_len = filter_len * sizeof(char);
3023     xcb_parts[5].iov_base = 0;
3024     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
3025     /* xcb_render_fixed_t values */
3026     xcb_parts[6].iov_base = (char *) values;
3027     xcb_parts[6].iov_len = values_len * sizeof(xcb_render_fixed_t);
3028     xcb_parts[7].iov_base = 0;
3029     xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3;
3030 
3031     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3032     return xcb_ret;
3033 }
3034 
3035 void
xcb_render_animcursorelt_next(xcb_render_animcursorelt_iterator_t * i)3036 xcb_render_animcursorelt_next (xcb_render_animcursorelt_iterator_t *i  /**< */)
3037 {
3038     --i->rem;
3039     ++i->data;
3040     i->index += sizeof(xcb_render_animcursorelt_t);
3041 }
3042 
3043 xcb_generic_iterator_t
xcb_render_animcursorelt_end(xcb_render_animcursorelt_iterator_t i)3044 xcb_render_animcursorelt_end (xcb_render_animcursorelt_iterator_t i  /**< */)
3045 {
3046     xcb_generic_iterator_t ret;
3047     ret.data = i.data + i.rem;
3048     ret.index = i.index + ((char *) ret.data - (char *) i.data);
3049     ret.rem = 0;
3050     return ret;
3051 }
3052 
3053 int
xcb_render_create_anim_cursor_sizeof(const void * _buffer,uint32_t cursors_len)3054 xcb_render_create_anim_cursor_sizeof (const void  *_buffer  /**< */,
3055                                       uint32_t     cursors_len  /**< */)
3056 {
3057     char *xcb_tmp = (char *)_buffer;
3058     unsigned int xcb_buffer_len = 0;
3059     unsigned int xcb_block_len = 0;
3060     unsigned int xcb_pad = 0;
3061     unsigned int xcb_align_to = 0;
3062 
3063 
3064     xcb_block_len += sizeof(xcb_render_create_anim_cursor_request_t);
3065     xcb_tmp += xcb_block_len;
3066     xcb_buffer_len += xcb_block_len;
3067     xcb_block_len = 0;
3068     /* cursors */
3069     xcb_block_len += cursors_len * sizeof(xcb_render_animcursorelt_t);
3070     xcb_tmp += xcb_block_len;
3071     xcb_align_to = ALIGNOF(xcb_render_animcursorelt_t);
3072     /* insert padding */
3073     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3074     xcb_buffer_len += xcb_block_len + xcb_pad;
3075     if (0 != xcb_pad) {
3076         xcb_tmp += xcb_pad;
3077         xcb_pad = 0;
3078     }
3079     xcb_block_len = 0;
3080 
3081     return xcb_buffer_len;
3082 }
3083 
3084 xcb_void_cookie_t
xcb_render_create_anim_cursor_checked(xcb_connection_t * c,xcb_cursor_t cid,uint32_t cursors_len,const xcb_render_animcursorelt_t * cursors)3085 xcb_render_create_anim_cursor_checked (xcb_connection_t                 *c  /**< */,
3086                                        xcb_cursor_t                      cid  /**< */,
3087                                        uint32_t                          cursors_len  /**< */,
3088                                        const xcb_render_animcursorelt_t *cursors  /**< */)
3089 {
3090     static const xcb_protocol_request_t xcb_req = {
3091         /* count */ 4,
3092         /* ext */ &xcb_render_id,
3093         /* opcode */ XCB_RENDER_CREATE_ANIM_CURSOR,
3094         /* isvoid */ 1
3095     };
3096 
3097     struct iovec xcb_parts[6];
3098     xcb_void_cookie_t xcb_ret;
3099     xcb_render_create_anim_cursor_request_t xcb_out;
3100 
3101     xcb_out.cid = cid;
3102 
3103     xcb_parts[2].iov_base = (char *) &xcb_out;
3104     xcb_parts[2].iov_len = sizeof(xcb_out);
3105     xcb_parts[3].iov_base = 0;
3106     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3107     /* xcb_render_animcursorelt_t cursors */
3108     xcb_parts[4].iov_base = (char *) cursors;
3109     xcb_parts[4].iov_len = cursors_len * sizeof(xcb_render_animcursorelt_t);
3110     xcb_parts[5].iov_base = 0;
3111     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
3112 
3113     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3114     return xcb_ret;
3115 }
3116 
3117 xcb_void_cookie_t
xcb_render_create_anim_cursor(xcb_connection_t * c,xcb_cursor_t cid,uint32_t cursors_len,const xcb_render_animcursorelt_t * cursors)3118 xcb_render_create_anim_cursor (xcb_connection_t                 *c  /**< */,
3119                                xcb_cursor_t                      cid  /**< */,
3120                                uint32_t                          cursors_len  /**< */,
3121                                const xcb_render_animcursorelt_t *cursors  /**< */)
3122 {
3123     static const xcb_protocol_request_t xcb_req = {
3124         /* count */ 4,
3125         /* ext */ &xcb_render_id,
3126         /* opcode */ XCB_RENDER_CREATE_ANIM_CURSOR,
3127         /* isvoid */ 1
3128     };
3129 
3130     struct iovec xcb_parts[6];
3131     xcb_void_cookie_t xcb_ret;
3132     xcb_render_create_anim_cursor_request_t xcb_out;
3133 
3134     xcb_out.cid = cid;
3135 
3136     xcb_parts[2].iov_base = (char *) &xcb_out;
3137     xcb_parts[2].iov_len = sizeof(xcb_out);
3138     xcb_parts[3].iov_base = 0;
3139     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3140     /* xcb_render_animcursorelt_t cursors */
3141     xcb_parts[4].iov_base = (char *) cursors;
3142     xcb_parts[4].iov_len = cursors_len * sizeof(xcb_render_animcursorelt_t);
3143     xcb_parts[5].iov_base = 0;
3144     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
3145 
3146     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3147     return xcb_ret;
3148 }
3149 
3150 void
xcb_render_spanfix_next(xcb_render_spanfix_iterator_t * i)3151 xcb_render_spanfix_next (xcb_render_spanfix_iterator_t *i  /**< */)
3152 {
3153     --i->rem;
3154     ++i->data;
3155     i->index += sizeof(xcb_render_spanfix_t);
3156 }
3157 
3158 xcb_generic_iterator_t
xcb_render_spanfix_end(xcb_render_spanfix_iterator_t i)3159 xcb_render_spanfix_end (xcb_render_spanfix_iterator_t i  /**< */)
3160 {
3161     xcb_generic_iterator_t ret;
3162     ret.data = i.data + i.rem;
3163     ret.index = i.index + ((char *) ret.data - (char *) i.data);
3164     ret.rem = 0;
3165     return ret;
3166 }
3167 
3168 void
xcb_render_trap_next(xcb_render_trap_iterator_t * i)3169 xcb_render_trap_next (xcb_render_trap_iterator_t *i  /**< */)
3170 {
3171     --i->rem;
3172     ++i->data;
3173     i->index += sizeof(xcb_render_trap_t);
3174 }
3175 
3176 xcb_generic_iterator_t
xcb_render_trap_end(xcb_render_trap_iterator_t i)3177 xcb_render_trap_end (xcb_render_trap_iterator_t i  /**< */)
3178 {
3179     xcb_generic_iterator_t ret;
3180     ret.data = i.data + i.rem;
3181     ret.index = i.index + ((char *) ret.data - (char *) i.data);
3182     ret.rem = 0;
3183     return ret;
3184 }
3185 
3186 int
xcb_render_add_traps_sizeof(const void * _buffer,uint32_t traps_len)3187 xcb_render_add_traps_sizeof (const void  *_buffer  /**< */,
3188                              uint32_t     traps_len  /**< */)
3189 {
3190     char *xcb_tmp = (char *)_buffer;
3191     unsigned int xcb_buffer_len = 0;
3192     unsigned int xcb_block_len = 0;
3193     unsigned int xcb_pad = 0;
3194     unsigned int xcb_align_to = 0;
3195 
3196 
3197     xcb_block_len += sizeof(xcb_render_add_traps_request_t);
3198     xcb_tmp += xcb_block_len;
3199     xcb_buffer_len += xcb_block_len;
3200     xcb_block_len = 0;
3201     /* traps */
3202     xcb_block_len += traps_len * sizeof(xcb_render_trap_t);
3203     xcb_tmp += xcb_block_len;
3204     xcb_align_to = ALIGNOF(xcb_render_trap_t);
3205     /* insert padding */
3206     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3207     xcb_buffer_len += xcb_block_len + xcb_pad;
3208     if (0 != xcb_pad) {
3209         xcb_tmp += xcb_pad;
3210         xcb_pad = 0;
3211     }
3212     xcb_block_len = 0;
3213 
3214     return xcb_buffer_len;
3215 }
3216 
3217 xcb_void_cookie_t
xcb_render_add_traps_checked(xcb_connection_t * c,xcb_render_picture_t picture,int16_t x_off,int16_t y_off,uint32_t traps_len,const xcb_render_trap_t * traps)3218 xcb_render_add_traps_checked (xcb_connection_t        *c  /**< */,
3219                               xcb_render_picture_t     picture  /**< */,
3220                               int16_t                  x_off  /**< */,
3221                               int16_t                  y_off  /**< */,
3222                               uint32_t                 traps_len  /**< */,
3223                               const xcb_render_trap_t *traps  /**< */)
3224 {
3225     static const xcb_protocol_request_t xcb_req = {
3226         /* count */ 4,
3227         /* ext */ &xcb_render_id,
3228         /* opcode */ XCB_RENDER_ADD_TRAPS,
3229         /* isvoid */ 1
3230     };
3231 
3232     struct iovec xcb_parts[6];
3233     xcb_void_cookie_t xcb_ret;
3234     xcb_render_add_traps_request_t xcb_out;
3235 
3236     xcb_out.picture = picture;
3237     xcb_out.x_off = x_off;
3238     xcb_out.y_off = y_off;
3239 
3240     xcb_parts[2].iov_base = (char *) &xcb_out;
3241     xcb_parts[2].iov_len = sizeof(xcb_out);
3242     xcb_parts[3].iov_base = 0;
3243     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3244     /* xcb_render_trap_t traps */
3245     xcb_parts[4].iov_base = (char *) traps;
3246     xcb_parts[4].iov_len = traps_len * sizeof(xcb_render_trap_t);
3247     xcb_parts[5].iov_base = 0;
3248     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
3249 
3250     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3251     return xcb_ret;
3252 }
3253 
3254 xcb_void_cookie_t
xcb_render_add_traps(xcb_connection_t * c,xcb_render_picture_t picture,int16_t x_off,int16_t y_off,uint32_t traps_len,const xcb_render_trap_t * traps)3255 xcb_render_add_traps (xcb_connection_t        *c  /**< */,
3256                       xcb_render_picture_t     picture  /**< */,
3257                       int16_t                  x_off  /**< */,
3258                       int16_t                  y_off  /**< */,
3259                       uint32_t                 traps_len  /**< */,
3260                       const xcb_render_trap_t *traps  /**< */)
3261 {
3262     static const xcb_protocol_request_t xcb_req = {
3263         /* count */ 4,
3264         /* ext */ &xcb_render_id,
3265         /* opcode */ XCB_RENDER_ADD_TRAPS,
3266         /* isvoid */ 1
3267     };
3268 
3269     struct iovec xcb_parts[6];
3270     xcb_void_cookie_t xcb_ret;
3271     xcb_render_add_traps_request_t xcb_out;
3272 
3273     xcb_out.picture = picture;
3274     xcb_out.x_off = x_off;
3275     xcb_out.y_off = y_off;
3276 
3277     xcb_parts[2].iov_base = (char *) &xcb_out;
3278     xcb_parts[2].iov_len = sizeof(xcb_out);
3279     xcb_parts[3].iov_base = 0;
3280     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3281     /* xcb_render_trap_t traps */
3282     xcb_parts[4].iov_base = (char *) traps;
3283     xcb_parts[4].iov_len = traps_len * sizeof(xcb_render_trap_t);
3284     xcb_parts[5].iov_base = 0;
3285     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
3286 
3287     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3288     return xcb_ret;
3289 }
3290 
3291 xcb_void_cookie_t
xcb_render_create_solid_fill_checked(xcb_connection_t * c,xcb_render_picture_t picture,xcb_render_color_t color)3292 xcb_render_create_solid_fill_checked (xcb_connection_t     *c  /**< */,
3293                                       xcb_render_picture_t  picture  /**< */,
3294                                       xcb_render_color_t    color  /**< */)
3295 {
3296     static const xcb_protocol_request_t xcb_req = {
3297         /* count */ 2,
3298         /* ext */ &xcb_render_id,
3299         /* opcode */ XCB_RENDER_CREATE_SOLID_FILL,
3300         /* isvoid */ 1
3301     };
3302 
3303     struct iovec xcb_parts[4];
3304     xcb_void_cookie_t xcb_ret;
3305     xcb_render_create_solid_fill_request_t xcb_out;
3306 
3307     xcb_out.picture = picture;
3308     xcb_out.color = color;
3309 
3310     xcb_parts[2].iov_base = (char *) &xcb_out;
3311     xcb_parts[2].iov_len = sizeof(xcb_out);
3312     xcb_parts[3].iov_base = 0;
3313     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3314 
3315     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3316     return xcb_ret;
3317 }
3318 
3319 xcb_void_cookie_t
xcb_render_create_solid_fill(xcb_connection_t * c,xcb_render_picture_t picture,xcb_render_color_t color)3320 xcb_render_create_solid_fill (xcb_connection_t     *c  /**< */,
3321                               xcb_render_picture_t  picture  /**< */,
3322                               xcb_render_color_t    color  /**< */)
3323 {
3324     static const xcb_protocol_request_t xcb_req = {
3325         /* count */ 2,
3326         /* ext */ &xcb_render_id,
3327         /* opcode */ XCB_RENDER_CREATE_SOLID_FILL,
3328         /* isvoid */ 1
3329     };
3330 
3331     struct iovec xcb_parts[4];
3332     xcb_void_cookie_t xcb_ret;
3333     xcb_render_create_solid_fill_request_t xcb_out;
3334 
3335     xcb_out.picture = picture;
3336     xcb_out.color = color;
3337 
3338     xcb_parts[2].iov_base = (char *) &xcb_out;
3339     xcb_parts[2].iov_len = sizeof(xcb_out);
3340     xcb_parts[3].iov_base = 0;
3341     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3342 
3343     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3344     return xcb_ret;
3345 }
3346 
3347 int
xcb_render_create_linear_gradient_sizeof(const void * _buffer)3348 xcb_render_create_linear_gradient_sizeof (const void  *_buffer  /**< */)
3349 {
3350     char *xcb_tmp = (char *)_buffer;
3351     const xcb_render_create_linear_gradient_request_t *_aux = (xcb_render_create_linear_gradient_request_t *)_buffer;
3352     unsigned int xcb_buffer_len = 0;
3353     unsigned int xcb_block_len = 0;
3354     unsigned int xcb_pad = 0;
3355     unsigned int xcb_align_to = 0;
3356 
3357 
3358     xcb_block_len += sizeof(xcb_render_create_linear_gradient_request_t);
3359     xcb_tmp += xcb_block_len;
3360     xcb_buffer_len += xcb_block_len;
3361     xcb_block_len = 0;
3362     /* stops */
3363     xcb_block_len += _aux->num_stops * sizeof(xcb_render_fixed_t);
3364     xcb_tmp += xcb_block_len;
3365     xcb_align_to = ALIGNOF(xcb_render_fixed_t);
3366     /* insert padding */
3367     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3368     xcb_buffer_len += xcb_block_len + xcb_pad;
3369     if (0 != xcb_pad) {
3370         xcb_tmp += xcb_pad;
3371         xcb_pad = 0;
3372     }
3373     xcb_block_len = 0;
3374     /* colors */
3375     xcb_block_len += _aux->num_stops * sizeof(xcb_render_color_t);
3376     xcb_tmp += xcb_block_len;
3377     xcb_align_to = ALIGNOF(xcb_render_color_t);
3378     /* insert padding */
3379     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3380     xcb_buffer_len += xcb_block_len + xcb_pad;
3381     if (0 != xcb_pad) {
3382         xcb_tmp += xcb_pad;
3383         xcb_pad = 0;
3384     }
3385     xcb_block_len = 0;
3386 
3387     return xcb_buffer_len;
3388 }
3389 
3390 xcb_void_cookie_t
xcb_render_create_linear_gradient_checked(xcb_connection_t * c,xcb_render_picture_t picture,xcb_render_pointfix_t p1,xcb_render_pointfix_t p2,uint32_t num_stops,const xcb_render_fixed_t * stops,const xcb_render_color_t * colors)3391 xcb_render_create_linear_gradient_checked (xcb_connection_t         *c  /**< */,
3392                                            xcb_render_picture_t      picture  /**< */,
3393                                            xcb_render_pointfix_t     p1  /**< */,
3394                                            xcb_render_pointfix_t     p2  /**< */,
3395                                            uint32_t                  num_stops  /**< */,
3396                                            const xcb_render_fixed_t *stops  /**< */,
3397                                            const xcb_render_color_t *colors  /**< */)
3398 {
3399     static const xcb_protocol_request_t xcb_req = {
3400         /* count */ 6,
3401         /* ext */ &xcb_render_id,
3402         /* opcode */ XCB_RENDER_CREATE_LINEAR_GRADIENT,
3403         /* isvoid */ 1
3404     };
3405 
3406     struct iovec xcb_parts[8];
3407     xcb_void_cookie_t xcb_ret;
3408     xcb_render_create_linear_gradient_request_t xcb_out;
3409 
3410     xcb_out.picture = picture;
3411     xcb_out.p1 = p1;
3412     xcb_out.p2 = p2;
3413     xcb_out.num_stops = num_stops;
3414 
3415     xcb_parts[2].iov_base = (char *) &xcb_out;
3416     xcb_parts[2].iov_len = sizeof(xcb_out);
3417     xcb_parts[3].iov_base = 0;
3418     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3419     /* xcb_render_fixed_t stops */
3420     xcb_parts[4].iov_base = (char *) stops;
3421     xcb_parts[4].iov_len = num_stops * sizeof(xcb_render_fixed_t);
3422     xcb_parts[5].iov_base = 0;
3423     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
3424     /* xcb_render_color_t colors */
3425     xcb_parts[6].iov_base = (char *) colors;
3426     xcb_parts[6].iov_len = num_stops * sizeof(xcb_render_color_t);
3427     xcb_parts[7].iov_base = 0;
3428     xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3;
3429 
3430     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3431     return xcb_ret;
3432 }
3433 
3434 xcb_void_cookie_t
xcb_render_create_linear_gradient(xcb_connection_t * c,xcb_render_picture_t picture,xcb_render_pointfix_t p1,xcb_render_pointfix_t p2,uint32_t num_stops,const xcb_render_fixed_t * stops,const xcb_render_color_t * colors)3435 xcb_render_create_linear_gradient (xcb_connection_t         *c  /**< */,
3436                                    xcb_render_picture_t      picture  /**< */,
3437                                    xcb_render_pointfix_t     p1  /**< */,
3438                                    xcb_render_pointfix_t     p2  /**< */,
3439                                    uint32_t                  num_stops  /**< */,
3440                                    const xcb_render_fixed_t *stops  /**< */,
3441                                    const xcb_render_color_t *colors  /**< */)
3442 {
3443     static const xcb_protocol_request_t xcb_req = {
3444         /* count */ 6,
3445         /* ext */ &xcb_render_id,
3446         /* opcode */ XCB_RENDER_CREATE_LINEAR_GRADIENT,
3447         /* isvoid */ 1
3448     };
3449 
3450     struct iovec xcb_parts[8];
3451     xcb_void_cookie_t xcb_ret;
3452     xcb_render_create_linear_gradient_request_t xcb_out;
3453 
3454     xcb_out.picture = picture;
3455     xcb_out.p1 = p1;
3456     xcb_out.p2 = p2;
3457     xcb_out.num_stops = num_stops;
3458 
3459     xcb_parts[2].iov_base = (char *) &xcb_out;
3460     xcb_parts[2].iov_len = sizeof(xcb_out);
3461     xcb_parts[3].iov_base = 0;
3462     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3463     /* xcb_render_fixed_t stops */
3464     xcb_parts[4].iov_base = (char *) stops;
3465     xcb_parts[4].iov_len = num_stops * sizeof(xcb_render_fixed_t);
3466     xcb_parts[5].iov_base = 0;
3467     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
3468     /* xcb_render_color_t colors */
3469     xcb_parts[6].iov_base = (char *) colors;
3470     xcb_parts[6].iov_len = num_stops * sizeof(xcb_render_color_t);
3471     xcb_parts[7].iov_base = 0;
3472     xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3;
3473 
3474     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3475     return xcb_ret;
3476 }
3477 
3478 int
xcb_render_create_radial_gradient_sizeof(const void * _buffer)3479 xcb_render_create_radial_gradient_sizeof (const void  *_buffer  /**< */)
3480 {
3481     char *xcb_tmp = (char *)_buffer;
3482     const xcb_render_create_radial_gradient_request_t *_aux = (xcb_render_create_radial_gradient_request_t *)_buffer;
3483     unsigned int xcb_buffer_len = 0;
3484     unsigned int xcb_block_len = 0;
3485     unsigned int xcb_pad = 0;
3486     unsigned int xcb_align_to = 0;
3487 
3488 
3489     xcb_block_len += sizeof(xcb_render_create_radial_gradient_request_t);
3490     xcb_tmp += xcb_block_len;
3491     xcb_buffer_len += xcb_block_len;
3492     xcb_block_len = 0;
3493     /* stops */
3494     xcb_block_len += _aux->num_stops * sizeof(xcb_render_fixed_t);
3495     xcb_tmp += xcb_block_len;
3496     xcb_align_to = ALIGNOF(xcb_render_fixed_t);
3497     /* insert padding */
3498     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3499     xcb_buffer_len += xcb_block_len + xcb_pad;
3500     if (0 != xcb_pad) {
3501         xcb_tmp += xcb_pad;
3502         xcb_pad = 0;
3503     }
3504     xcb_block_len = 0;
3505     /* colors */
3506     xcb_block_len += _aux->num_stops * sizeof(xcb_render_color_t);
3507     xcb_tmp += xcb_block_len;
3508     xcb_align_to = ALIGNOF(xcb_render_color_t);
3509     /* insert padding */
3510     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3511     xcb_buffer_len += xcb_block_len + xcb_pad;
3512     if (0 != xcb_pad) {
3513         xcb_tmp += xcb_pad;
3514         xcb_pad = 0;
3515     }
3516     xcb_block_len = 0;
3517 
3518     return xcb_buffer_len;
3519 }
3520 
3521 xcb_void_cookie_t
xcb_render_create_radial_gradient_checked(xcb_connection_t * c,xcb_render_picture_t picture,xcb_render_pointfix_t inner,xcb_render_pointfix_t outer,xcb_render_fixed_t inner_radius,xcb_render_fixed_t outer_radius,uint32_t num_stops,const xcb_render_fixed_t * stops,const xcb_render_color_t * colors)3522 xcb_render_create_radial_gradient_checked (xcb_connection_t         *c  /**< */,
3523                                            xcb_render_picture_t      picture  /**< */,
3524                                            xcb_render_pointfix_t     inner  /**< */,
3525                                            xcb_render_pointfix_t     outer  /**< */,
3526                                            xcb_render_fixed_t        inner_radius  /**< */,
3527                                            xcb_render_fixed_t        outer_radius  /**< */,
3528                                            uint32_t                  num_stops  /**< */,
3529                                            const xcb_render_fixed_t *stops  /**< */,
3530                                            const xcb_render_color_t *colors  /**< */)
3531 {
3532     static const xcb_protocol_request_t xcb_req = {
3533         /* count */ 6,
3534         /* ext */ &xcb_render_id,
3535         /* opcode */ XCB_RENDER_CREATE_RADIAL_GRADIENT,
3536         /* isvoid */ 1
3537     };
3538 
3539     struct iovec xcb_parts[8];
3540     xcb_void_cookie_t xcb_ret;
3541     xcb_render_create_radial_gradient_request_t xcb_out;
3542 
3543     xcb_out.picture = picture;
3544     xcb_out.inner = inner;
3545     xcb_out.outer = outer;
3546     xcb_out.inner_radius = inner_radius;
3547     xcb_out.outer_radius = outer_radius;
3548     xcb_out.num_stops = num_stops;
3549 
3550     xcb_parts[2].iov_base = (char *) &xcb_out;
3551     xcb_parts[2].iov_len = sizeof(xcb_out);
3552     xcb_parts[3].iov_base = 0;
3553     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3554     /* xcb_render_fixed_t stops */
3555     xcb_parts[4].iov_base = (char *) stops;
3556     xcb_parts[4].iov_len = num_stops * sizeof(xcb_render_fixed_t);
3557     xcb_parts[5].iov_base = 0;
3558     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
3559     /* xcb_render_color_t colors */
3560     xcb_parts[6].iov_base = (char *) colors;
3561     xcb_parts[6].iov_len = num_stops * sizeof(xcb_render_color_t);
3562     xcb_parts[7].iov_base = 0;
3563     xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3;
3564 
3565     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3566     return xcb_ret;
3567 }
3568 
3569 xcb_void_cookie_t
xcb_render_create_radial_gradient(xcb_connection_t * c,xcb_render_picture_t picture,xcb_render_pointfix_t inner,xcb_render_pointfix_t outer,xcb_render_fixed_t inner_radius,xcb_render_fixed_t outer_radius,uint32_t num_stops,const xcb_render_fixed_t * stops,const xcb_render_color_t * colors)3570 xcb_render_create_radial_gradient (xcb_connection_t         *c  /**< */,
3571                                    xcb_render_picture_t      picture  /**< */,
3572                                    xcb_render_pointfix_t     inner  /**< */,
3573                                    xcb_render_pointfix_t     outer  /**< */,
3574                                    xcb_render_fixed_t        inner_radius  /**< */,
3575                                    xcb_render_fixed_t        outer_radius  /**< */,
3576                                    uint32_t                  num_stops  /**< */,
3577                                    const xcb_render_fixed_t *stops  /**< */,
3578                                    const xcb_render_color_t *colors  /**< */)
3579 {
3580     static const xcb_protocol_request_t xcb_req = {
3581         /* count */ 6,
3582         /* ext */ &xcb_render_id,
3583         /* opcode */ XCB_RENDER_CREATE_RADIAL_GRADIENT,
3584         /* isvoid */ 1
3585     };
3586 
3587     struct iovec xcb_parts[8];
3588     xcb_void_cookie_t xcb_ret;
3589     xcb_render_create_radial_gradient_request_t xcb_out;
3590 
3591     xcb_out.picture = picture;
3592     xcb_out.inner = inner;
3593     xcb_out.outer = outer;
3594     xcb_out.inner_radius = inner_radius;
3595     xcb_out.outer_radius = outer_radius;
3596     xcb_out.num_stops = num_stops;
3597 
3598     xcb_parts[2].iov_base = (char *) &xcb_out;
3599     xcb_parts[2].iov_len = sizeof(xcb_out);
3600     xcb_parts[3].iov_base = 0;
3601     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3602     /* xcb_render_fixed_t stops */
3603     xcb_parts[4].iov_base = (char *) stops;
3604     xcb_parts[4].iov_len = num_stops * sizeof(xcb_render_fixed_t);
3605     xcb_parts[5].iov_base = 0;
3606     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
3607     /* xcb_render_color_t colors */
3608     xcb_parts[6].iov_base = (char *) colors;
3609     xcb_parts[6].iov_len = num_stops * sizeof(xcb_render_color_t);
3610     xcb_parts[7].iov_base = 0;
3611     xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3;
3612 
3613     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3614     return xcb_ret;
3615 }
3616 
3617 int
xcb_render_create_conical_gradient_sizeof(const void * _buffer)3618 xcb_render_create_conical_gradient_sizeof (const void  *_buffer  /**< */)
3619 {
3620     char *xcb_tmp = (char *)_buffer;
3621     const xcb_render_create_conical_gradient_request_t *_aux = (xcb_render_create_conical_gradient_request_t *)_buffer;
3622     unsigned int xcb_buffer_len = 0;
3623     unsigned int xcb_block_len = 0;
3624     unsigned int xcb_pad = 0;
3625     unsigned int xcb_align_to = 0;
3626 
3627 
3628     xcb_block_len += sizeof(xcb_render_create_conical_gradient_request_t);
3629     xcb_tmp += xcb_block_len;
3630     xcb_buffer_len += xcb_block_len;
3631     xcb_block_len = 0;
3632     /* stops */
3633     xcb_block_len += _aux->num_stops * sizeof(xcb_render_fixed_t);
3634     xcb_tmp += xcb_block_len;
3635     xcb_align_to = ALIGNOF(xcb_render_fixed_t);
3636     /* insert padding */
3637     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3638     xcb_buffer_len += xcb_block_len + xcb_pad;
3639     if (0 != xcb_pad) {
3640         xcb_tmp += xcb_pad;
3641         xcb_pad = 0;
3642     }
3643     xcb_block_len = 0;
3644     /* colors */
3645     xcb_block_len += _aux->num_stops * sizeof(xcb_render_color_t);
3646     xcb_tmp += xcb_block_len;
3647     xcb_align_to = ALIGNOF(xcb_render_color_t);
3648     /* insert padding */
3649     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3650     xcb_buffer_len += xcb_block_len + xcb_pad;
3651     if (0 != xcb_pad) {
3652         xcb_tmp += xcb_pad;
3653         xcb_pad = 0;
3654     }
3655     xcb_block_len = 0;
3656 
3657     return xcb_buffer_len;
3658 }
3659 
3660 xcb_void_cookie_t
xcb_render_create_conical_gradient_checked(xcb_connection_t * c,xcb_render_picture_t picture,xcb_render_pointfix_t center,xcb_render_fixed_t angle,uint32_t num_stops,const xcb_render_fixed_t * stops,const xcb_render_color_t * colors)3661 xcb_render_create_conical_gradient_checked (xcb_connection_t         *c  /**< */,
3662                                             xcb_render_picture_t      picture  /**< */,
3663                                             xcb_render_pointfix_t     center  /**< */,
3664                                             xcb_render_fixed_t        angle  /**< */,
3665                                             uint32_t                  num_stops  /**< */,
3666                                             const xcb_render_fixed_t *stops  /**< */,
3667                                             const xcb_render_color_t *colors  /**< */)
3668 {
3669     static const xcb_protocol_request_t xcb_req = {
3670         /* count */ 6,
3671         /* ext */ &xcb_render_id,
3672         /* opcode */ XCB_RENDER_CREATE_CONICAL_GRADIENT,
3673         /* isvoid */ 1
3674     };
3675 
3676     struct iovec xcb_parts[8];
3677     xcb_void_cookie_t xcb_ret;
3678     xcb_render_create_conical_gradient_request_t xcb_out;
3679 
3680     xcb_out.picture = picture;
3681     xcb_out.center = center;
3682     xcb_out.angle = angle;
3683     xcb_out.num_stops = num_stops;
3684 
3685     xcb_parts[2].iov_base = (char *) &xcb_out;
3686     xcb_parts[2].iov_len = sizeof(xcb_out);
3687     xcb_parts[3].iov_base = 0;
3688     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3689     /* xcb_render_fixed_t stops */
3690     xcb_parts[4].iov_base = (char *) stops;
3691     xcb_parts[4].iov_len = num_stops * sizeof(xcb_render_fixed_t);
3692     xcb_parts[5].iov_base = 0;
3693     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
3694     /* xcb_render_color_t colors */
3695     xcb_parts[6].iov_base = (char *) colors;
3696     xcb_parts[6].iov_len = num_stops * sizeof(xcb_render_color_t);
3697     xcb_parts[7].iov_base = 0;
3698     xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3;
3699 
3700     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3701     return xcb_ret;
3702 }
3703 
3704 xcb_void_cookie_t
xcb_render_create_conical_gradient(xcb_connection_t * c,xcb_render_picture_t picture,xcb_render_pointfix_t center,xcb_render_fixed_t angle,uint32_t num_stops,const xcb_render_fixed_t * stops,const xcb_render_color_t * colors)3705 xcb_render_create_conical_gradient (xcb_connection_t         *c  /**< */,
3706                                     xcb_render_picture_t      picture  /**< */,
3707                                     xcb_render_pointfix_t     center  /**< */,
3708                                     xcb_render_fixed_t        angle  /**< */,
3709                                     uint32_t                  num_stops  /**< */,
3710                                     const xcb_render_fixed_t *stops  /**< */,
3711                                     const xcb_render_color_t *colors  /**< */)
3712 {
3713     static const xcb_protocol_request_t xcb_req = {
3714         /* count */ 6,
3715         /* ext */ &xcb_render_id,
3716         /* opcode */ XCB_RENDER_CREATE_CONICAL_GRADIENT,
3717         /* isvoid */ 1
3718     };
3719 
3720     struct iovec xcb_parts[8];
3721     xcb_void_cookie_t xcb_ret;
3722     xcb_render_create_conical_gradient_request_t xcb_out;
3723 
3724     xcb_out.picture = picture;
3725     xcb_out.center = center;
3726     xcb_out.angle = angle;
3727     xcb_out.num_stops = num_stops;
3728 
3729     xcb_parts[2].iov_base = (char *) &xcb_out;
3730     xcb_parts[2].iov_len = sizeof(xcb_out);
3731     xcb_parts[3].iov_base = 0;
3732     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3733     /* xcb_render_fixed_t stops */
3734     xcb_parts[4].iov_base = (char *) stops;
3735     xcb_parts[4].iov_len = num_stops * sizeof(xcb_render_fixed_t);
3736     xcb_parts[5].iov_base = 0;
3737     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
3738     /* xcb_render_color_t colors */
3739     xcb_parts[6].iov_base = (char *) colors;
3740     xcb_parts[6].iov_len = num_stops * sizeof(xcb_render_color_t);
3741     xcb_parts[7].iov_base = 0;
3742     xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3;
3743 
3744     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3745     return xcb_ret;
3746 }
3747 
3748