etc/protocols - sync with NetBSD-8
[minix.git] / external / mit / xorg / lib / libxcb / files / xprint.c
bloba20702045ca78b36b941c0fcd553f2e2115d942e
1 /*
2 * This file generated automatically from xprint.xml by c_client.py.
3 * Edit at your peril.
4 */
6 #ifdef HAVE_CONFIG_H
7 #include "config.h"
8 #endif
9 #include <stdlib.h>
10 #include <string.h>
11 #include <assert.h>
12 #include <stddef.h> /* for offsetof() */
13 #include "xcbext.h"
14 #include "xprint.h"
16 #define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member)
17 #include "xproto.h"
19 xcb_extension_t xcb_x_print_id = { "XpExtension", 0 };
21 void
22 xcb_x_print_string8_next (xcb_x_print_string8_iterator_t *i /**< */)
24 --i->rem;
25 ++i->data;
26 i->index += sizeof(xcb_x_print_string8_t);
29 xcb_generic_iterator_t
30 xcb_x_print_string8_end (xcb_x_print_string8_iterator_t i /**< */)
32 xcb_generic_iterator_t ret;
33 ret.data = i.data + i.rem;
34 ret.index = i.index + ((char *) ret.data - (char *) i.data);
35 ret.rem = 0;
36 return ret;
39 int
40 xcb_x_print_printer_serialize (void **_buffer /**< */,
41 const xcb_x_print_printer_t *_aux /**< */,
42 const xcb_x_print_string8_t *name /**< */,
43 const xcb_x_print_string8_t *description /**< */)
45 char *xcb_out = *_buffer;
46 unsigned int xcb_buffer_len = 0;
47 unsigned int xcb_align_to = 0;
49 unsigned int xcb_pad = 0;
50 char xcb_pad0[3] = {0, 0, 0};
51 struct iovec xcb_parts[5];
52 unsigned int xcb_parts_idx = 0;
53 unsigned int xcb_block_len = 0;
54 unsigned int i;
55 char *xcb_tmp;
57 /* xcb_x_print_printer_t.nameLen */
58 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->nameLen;
59 xcb_block_len += sizeof(uint32_t);
60 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t);
61 xcb_parts_idx++;
62 xcb_align_to = ALIGNOF(uint32_t);
63 /* name */
64 xcb_parts[xcb_parts_idx].iov_base = (char *) name;
65 xcb_block_len += _aux->nameLen * sizeof(xcb_x_print_string8_t);
66 xcb_parts[xcb_parts_idx].iov_len = _aux->nameLen * sizeof(xcb_x_print_string8_t);
67 xcb_parts_idx++;
68 xcb_align_to = ALIGNOF(xcb_x_print_string8_t);
69 /* xcb_x_print_printer_t.descLen */
70 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->descLen;
71 xcb_block_len += sizeof(uint32_t);
72 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t);
73 xcb_parts_idx++;
74 xcb_align_to = ALIGNOF(uint32_t);
75 /* description */
76 xcb_parts[xcb_parts_idx].iov_base = (char *) description;
77 xcb_block_len += _aux->descLen * sizeof(xcb_x_print_string8_t);
78 xcb_parts[xcb_parts_idx].iov_len = _aux->descLen * sizeof(xcb_x_print_string8_t);
79 xcb_parts_idx++;
80 xcb_align_to = ALIGNOF(xcb_x_print_string8_t);
81 /* insert padding */
82 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
83 xcb_buffer_len += xcb_block_len + xcb_pad;
84 if (0 != xcb_pad) {
85 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
86 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
87 xcb_parts_idx++;
88 xcb_pad = 0;
90 xcb_block_len = 0;
92 if (NULL == xcb_out) {
93 /* allocate memory */
94 xcb_out = malloc(xcb_buffer_len);
95 *_buffer = xcb_out;
98 xcb_tmp = xcb_out;
99 for(i=0; i<xcb_parts_idx; i++) {
100 if (0 != xcb_parts[i].iov_base && 0 != xcb_parts[i].iov_len)
101 memcpy(xcb_tmp, xcb_parts[i].iov_base, xcb_parts[i].iov_len);
102 if (0 != xcb_parts[i].iov_len)
103 xcb_tmp += xcb_parts[i].iov_len;
106 return xcb_buffer_len;
110 xcb_x_print_printer_unserialize (const void *_buffer /**< */,
111 xcb_x_print_printer_t **_aux /**< */)
113 char *xcb_tmp = (char *)_buffer;
114 xcb_x_print_printer_t xcb_out;
115 unsigned int xcb_buffer_len = 0;
116 unsigned int xcb_block_len = 0;
117 unsigned int xcb_pad = 0;
118 unsigned int xcb_align_to = 0;
120 xcb_x_print_string8_t *name;
121 int name_len;
122 xcb_x_print_string8_t *description;
123 int description_len;
125 /* xcb_x_print_printer_t.nameLen */
126 xcb_out.nameLen = *(uint32_t *)xcb_tmp;
127 xcb_block_len += sizeof(uint32_t);
128 xcb_tmp += sizeof(uint32_t);
129 xcb_align_to = ALIGNOF(uint32_t);
130 /* name */
131 name = (xcb_x_print_string8_t *)xcb_tmp;
132 name_len = xcb_out.nameLen * sizeof(xcb_x_print_string8_t);
133 xcb_block_len += name_len;
134 xcb_tmp += name_len;
135 xcb_align_to = ALIGNOF(xcb_x_print_string8_t);
136 /* xcb_x_print_printer_t.descLen */
137 xcb_out.descLen = *(uint32_t *)xcb_tmp;
138 xcb_block_len += sizeof(uint32_t);
139 xcb_tmp += sizeof(uint32_t);
140 xcb_align_to = ALIGNOF(uint32_t);
141 /* description */
142 description = (xcb_x_print_string8_t *)xcb_tmp;
143 description_len = xcb_out.descLen * sizeof(xcb_x_print_string8_t);
144 xcb_block_len += description_len;
145 xcb_tmp += description_len;
146 xcb_align_to = ALIGNOF(xcb_x_print_string8_t);
147 /* insert padding */
148 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
149 xcb_buffer_len += xcb_block_len + xcb_pad;
150 if (0 != xcb_pad) {
151 xcb_tmp += xcb_pad;
152 xcb_pad = 0;
154 xcb_block_len = 0;
156 if (NULL == _aux)
157 return xcb_buffer_len;
159 if (NULL == *_aux) {
160 /* allocate memory */
161 *_aux = malloc(xcb_buffer_len);
164 xcb_tmp = ((char *)*_aux)+xcb_buffer_len;
165 xcb_tmp -= description_len;
166 memmove(xcb_tmp, description, description_len);
167 xcb_tmp -= name_len;
168 memmove(xcb_tmp, name, name_len);
169 **_aux = xcb_out;
171 return xcb_buffer_len;
175 xcb_x_print_printer_sizeof (const void *_buffer /**< */)
177 return xcb_x_print_printer_unserialize(_buffer, NULL);
180 xcb_x_print_string8_t *
181 xcb_x_print_printer_name (const xcb_x_print_printer_t *R /**< */)
183 return (xcb_x_print_string8_t *) (R + 1);
187 xcb_x_print_printer_name_length (const xcb_x_print_printer_t *R /**< */)
189 return R->nameLen;
192 xcb_generic_iterator_t
193 xcb_x_print_printer_name_end (const xcb_x_print_printer_t *R /**< */)
195 xcb_generic_iterator_t i;
196 i.data = ((xcb_x_print_string8_t *) (R + 1)) + (R->nameLen);
197 i.rem = 0;
198 i.index = (char *) i.data - (char *) R;
199 return i;
202 xcb_x_print_string8_t *
203 xcb_x_print_printer_description (const xcb_x_print_printer_t *R /**< */)
205 xcb_generic_iterator_t prev = xcb_x_print_printer_name_end(R);
206 return (xcb_x_print_string8_t *) ((char *) prev.data + XCB_TYPE_PAD(uint32_t, prev.index) + 4);
210 xcb_x_print_printer_description_length (const xcb_x_print_printer_t *R /**< */)
212 return R->descLen;
215 xcb_generic_iterator_t
216 xcb_x_print_printer_description_end (const xcb_x_print_printer_t *R /**< */)
218 xcb_generic_iterator_t i;
219 xcb_generic_iterator_t child = xcb_x_print_printer_name_end(R);
220 i.data = ((xcb_x_print_string8_t *) child.data) + (R->descLen);
221 i.rem = 0;
222 i.index = (char *) i.data - (char *) R;
223 return i;
226 void
227 xcb_x_print_printer_next (xcb_x_print_printer_iterator_t *i /**< */)
229 xcb_x_print_printer_t *R = i->data;
230 xcb_generic_iterator_t child;
231 child.data = (xcb_x_print_printer_t *)(((char *)R) + xcb_x_print_printer_sizeof(R));
232 i->index = (char *) child.data - (char *) i->data;
233 --i->rem;
234 i->data = (xcb_x_print_printer_t *) child.data;
237 xcb_generic_iterator_t
238 xcb_x_print_printer_end (xcb_x_print_printer_iterator_t i /**< */)
240 xcb_generic_iterator_t ret;
241 while(i.rem > 0)
242 xcb_x_print_printer_next(&i);
243 ret.data = i.data;
244 ret.rem = i.rem;
245 ret.index = i.index;
246 return ret;
249 void
250 xcb_x_print_pcontext_next (xcb_x_print_pcontext_iterator_t *i /**< */)
252 --i->rem;
253 ++i->data;
254 i->index += sizeof(xcb_x_print_pcontext_t);
257 xcb_generic_iterator_t
258 xcb_x_print_pcontext_end (xcb_x_print_pcontext_iterator_t i /**< */)
260 xcb_generic_iterator_t ret;
261 ret.data = i.data + i.rem;
262 ret.index = i.index + ((char *) ret.data - (char *) i.data);
263 ret.rem = 0;
264 return ret;
267 xcb_x_print_print_query_version_cookie_t
268 xcb_x_print_print_query_version (xcb_connection_t *c /**< */)
270 static const xcb_protocol_request_t xcb_req = {
271 /* count */ 2,
272 /* ext */ &xcb_x_print_id,
273 /* opcode */ XCB_X_PRINT_PRINT_QUERY_VERSION,
274 /* isvoid */ 0
277 struct iovec xcb_parts[4];
278 xcb_x_print_print_query_version_cookie_t xcb_ret;
279 xcb_x_print_print_query_version_request_t xcb_out;
282 xcb_parts[2].iov_base = (char *) &xcb_out;
283 xcb_parts[2].iov_len = sizeof(xcb_out);
284 xcb_parts[3].iov_base = 0;
285 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
287 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
288 return xcb_ret;
291 xcb_x_print_print_query_version_cookie_t
292 xcb_x_print_print_query_version_unchecked (xcb_connection_t *c /**< */)
294 static const xcb_protocol_request_t xcb_req = {
295 /* count */ 2,
296 /* ext */ &xcb_x_print_id,
297 /* opcode */ XCB_X_PRINT_PRINT_QUERY_VERSION,
298 /* isvoid */ 0
301 struct iovec xcb_parts[4];
302 xcb_x_print_print_query_version_cookie_t xcb_ret;
303 xcb_x_print_print_query_version_request_t xcb_out;
306 xcb_parts[2].iov_base = (char *) &xcb_out;
307 xcb_parts[2].iov_len = sizeof(xcb_out);
308 xcb_parts[3].iov_base = 0;
309 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
311 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
312 return xcb_ret;
315 xcb_x_print_print_query_version_reply_t *
316 xcb_x_print_print_query_version_reply (xcb_connection_t *c /**< */,
317 xcb_x_print_print_query_version_cookie_t cookie /**< */,
318 xcb_generic_error_t **e /**< */)
320 return (xcb_x_print_print_query_version_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
324 xcb_x_print_print_get_printer_list_sizeof (const void *_buffer /**< */)
326 char *xcb_tmp = (char *)_buffer;
327 const xcb_x_print_print_get_printer_list_request_t *_aux = (xcb_x_print_print_get_printer_list_request_t *)_buffer;
328 unsigned int xcb_buffer_len = 0;
329 unsigned int xcb_block_len = 0;
330 unsigned int xcb_pad = 0;
331 unsigned int xcb_align_to = 0;
334 xcb_block_len += sizeof(xcb_x_print_print_get_printer_list_request_t);
335 xcb_tmp += xcb_block_len;
336 xcb_buffer_len += xcb_block_len;
337 xcb_block_len = 0;
338 /* printer_name */
339 xcb_block_len += _aux->printerNameLen * sizeof(xcb_x_print_string8_t);
340 xcb_tmp += xcb_block_len;
341 xcb_align_to = ALIGNOF(xcb_x_print_string8_t);
342 /* insert padding */
343 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
344 xcb_buffer_len += xcb_block_len + xcb_pad;
345 if (0 != xcb_pad) {
346 xcb_tmp += xcb_pad;
347 xcb_pad = 0;
349 xcb_block_len = 0;
350 /* locale */
351 xcb_block_len += _aux->localeLen * sizeof(xcb_x_print_string8_t);
352 xcb_tmp += xcb_block_len;
353 xcb_align_to = ALIGNOF(xcb_x_print_string8_t);
354 /* insert padding */
355 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
356 xcb_buffer_len += xcb_block_len + xcb_pad;
357 if (0 != xcb_pad) {
358 xcb_tmp += xcb_pad;
359 xcb_pad = 0;
361 xcb_block_len = 0;
363 return xcb_buffer_len;
366 xcb_x_print_print_get_printer_list_cookie_t
367 xcb_x_print_print_get_printer_list (xcb_connection_t *c /**< */,
368 uint32_t printerNameLen /**< */,
369 uint32_t localeLen /**< */,
370 const xcb_x_print_string8_t *printer_name /**< */,
371 const xcb_x_print_string8_t *locale /**< */)
373 static const xcb_protocol_request_t xcb_req = {
374 /* count */ 6,
375 /* ext */ &xcb_x_print_id,
376 /* opcode */ XCB_X_PRINT_PRINT_GET_PRINTER_LIST,
377 /* isvoid */ 0
380 struct iovec xcb_parts[8];
381 xcb_x_print_print_get_printer_list_cookie_t xcb_ret;
382 xcb_x_print_print_get_printer_list_request_t xcb_out;
384 xcb_out.printerNameLen = printerNameLen;
385 xcb_out.localeLen = localeLen;
387 xcb_parts[2].iov_base = (char *) &xcb_out;
388 xcb_parts[2].iov_len = sizeof(xcb_out);
389 xcb_parts[3].iov_base = 0;
390 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
391 /* xcb_x_print_string8_t printer_name */
392 xcb_parts[4].iov_base = (char *) printer_name;
393 xcb_parts[4].iov_len = printerNameLen * sizeof(xcb_x_print_string8_t);
394 xcb_parts[5].iov_base = 0;
395 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
396 /* xcb_x_print_string8_t locale */
397 xcb_parts[6].iov_base = (char *) locale;
398 xcb_parts[6].iov_len = localeLen * sizeof(xcb_x_print_string8_t);
399 xcb_parts[7].iov_base = 0;
400 xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3;
402 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
403 return xcb_ret;
406 xcb_x_print_print_get_printer_list_cookie_t
407 xcb_x_print_print_get_printer_list_unchecked (xcb_connection_t *c /**< */,
408 uint32_t printerNameLen /**< */,
409 uint32_t localeLen /**< */,
410 const xcb_x_print_string8_t *printer_name /**< */,
411 const xcb_x_print_string8_t *locale /**< */)
413 static const xcb_protocol_request_t xcb_req = {
414 /* count */ 6,
415 /* ext */ &xcb_x_print_id,
416 /* opcode */ XCB_X_PRINT_PRINT_GET_PRINTER_LIST,
417 /* isvoid */ 0
420 struct iovec xcb_parts[8];
421 xcb_x_print_print_get_printer_list_cookie_t xcb_ret;
422 xcb_x_print_print_get_printer_list_request_t xcb_out;
424 xcb_out.printerNameLen = printerNameLen;
425 xcb_out.localeLen = localeLen;
427 xcb_parts[2].iov_base = (char *) &xcb_out;
428 xcb_parts[2].iov_len = sizeof(xcb_out);
429 xcb_parts[3].iov_base = 0;
430 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
431 /* xcb_x_print_string8_t printer_name */
432 xcb_parts[4].iov_base = (char *) printer_name;
433 xcb_parts[4].iov_len = printerNameLen * sizeof(xcb_x_print_string8_t);
434 xcb_parts[5].iov_base = 0;
435 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
436 /* xcb_x_print_string8_t locale */
437 xcb_parts[6].iov_base = (char *) locale;
438 xcb_parts[6].iov_len = localeLen * sizeof(xcb_x_print_string8_t);
439 xcb_parts[7].iov_base = 0;
440 xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3;
442 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
443 return xcb_ret;
447 xcb_x_print_print_get_printer_list_printers_length (const xcb_x_print_print_get_printer_list_reply_t *R /**< */)
449 return R->listCount;
452 xcb_x_print_printer_iterator_t
453 xcb_x_print_print_get_printer_list_printers_iterator (const xcb_x_print_print_get_printer_list_reply_t *R /**< */)
455 xcb_x_print_printer_iterator_t i;
456 i.data = (xcb_x_print_printer_t *) (R + 1);
457 i.rem = R->listCount;
458 i.index = (char *) i.data - (char *) R;
459 return i;
462 xcb_x_print_print_get_printer_list_reply_t *
463 xcb_x_print_print_get_printer_list_reply (xcb_connection_t *c /**< */,
464 xcb_x_print_print_get_printer_list_cookie_t cookie /**< */,
465 xcb_generic_error_t **e /**< */)
467 xcb_x_print_print_get_printer_list_reply_t *reply = (xcb_x_print_print_get_printer_list_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
468 int i;
469 xcb_x_print_printer_iterator_t printers_iter = xcb_x_print_print_get_printer_list_printers_iterator(reply);
470 int printers_len = xcb_x_print_print_get_printer_list_printers_length(reply);
471 xcb_x_print_printer_t *printers_data;
472 /* special cases: transform parts of the reply to match XCB data structures */
473 for(i=0; i<printers_len; i++) {
474 printers_data = printers_iter.data;
475 xcb_x_print_printer_unserialize((const void *)printers_data, &printers_data);
476 xcb_x_print_printer_next(&printers_iter);
478 return reply;
481 xcb_void_cookie_t
482 xcb_x_print_print_rehash_printer_list_checked (xcb_connection_t *c /**< */)
484 static const xcb_protocol_request_t xcb_req = {
485 /* count */ 2,
486 /* ext */ &xcb_x_print_id,
487 /* opcode */ XCB_X_PRINT_PRINT_REHASH_PRINTER_LIST,
488 /* isvoid */ 1
491 struct iovec xcb_parts[4];
492 xcb_void_cookie_t xcb_ret;
493 xcb_x_print_print_rehash_printer_list_request_t xcb_out;
496 xcb_parts[2].iov_base = (char *) &xcb_out;
497 xcb_parts[2].iov_len = sizeof(xcb_out);
498 xcb_parts[3].iov_base = 0;
499 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
501 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
502 return xcb_ret;
505 xcb_void_cookie_t
506 xcb_x_print_print_rehash_printer_list (xcb_connection_t *c /**< */)
508 static const xcb_protocol_request_t xcb_req = {
509 /* count */ 2,
510 /* ext */ &xcb_x_print_id,
511 /* opcode */ XCB_X_PRINT_PRINT_REHASH_PRINTER_LIST,
512 /* isvoid */ 1
515 struct iovec xcb_parts[4];
516 xcb_void_cookie_t xcb_ret;
517 xcb_x_print_print_rehash_printer_list_request_t xcb_out;
520 xcb_parts[2].iov_base = (char *) &xcb_out;
521 xcb_parts[2].iov_len = sizeof(xcb_out);
522 xcb_parts[3].iov_base = 0;
523 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
525 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
526 return xcb_ret;
530 xcb_x_print_create_context_sizeof (const void *_buffer /**< */)
532 char *xcb_tmp = (char *)_buffer;
533 const xcb_x_print_create_context_request_t *_aux = (xcb_x_print_create_context_request_t *)_buffer;
534 unsigned int xcb_buffer_len = 0;
535 unsigned int xcb_block_len = 0;
536 unsigned int xcb_pad = 0;
537 unsigned int xcb_align_to = 0;
540 xcb_block_len += sizeof(xcb_x_print_create_context_request_t);
541 xcb_tmp += xcb_block_len;
542 xcb_buffer_len += xcb_block_len;
543 xcb_block_len = 0;
544 /* printerName */
545 xcb_block_len += _aux->printerNameLen * sizeof(xcb_x_print_string8_t);
546 xcb_tmp += xcb_block_len;
547 xcb_align_to = ALIGNOF(xcb_x_print_string8_t);
548 /* insert padding */
549 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
550 xcb_buffer_len += xcb_block_len + xcb_pad;
551 if (0 != xcb_pad) {
552 xcb_tmp += xcb_pad;
553 xcb_pad = 0;
555 xcb_block_len = 0;
556 /* locale */
557 xcb_block_len += _aux->localeLen * sizeof(xcb_x_print_string8_t);
558 xcb_tmp += xcb_block_len;
559 xcb_align_to = ALIGNOF(xcb_x_print_string8_t);
560 /* insert padding */
561 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
562 xcb_buffer_len += xcb_block_len + xcb_pad;
563 if (0 != xcb_pad) {
564 xcb_tmp += xcb_pad;
565 xcb_pad = 0;
567 xcb_block_len = 0;
569 return xcb_buffer_len;
572 xcb_void_cookie_t
573 xcb_x_print_create_context_checked (xcb_connection_t *c /**< */,
574 uint32_t context_id /**< */,
575 uint32_t printerNameLen /**< */,
576 uint32_t localeLen /**< */,
577 const xcb_x_print_string8_t *printerName /**< */,
578 const xcb_x_print_string8_t *locale /**< */)
580 static const xcb_protocol_request_t xcb_req = {
581 /* count */ 6,
582 /* ext */ &xcb_x_print_id,
583 /* opcode */ XCB_X_PRINT_CREATE_CONTEXT,
584 /* isvoid */ 1
587 struct iovec xcb_parts[8];
588 xcb_void_cookie_t xcb_ret;
589 xcb_x_print_create_context_request_t xcb_out;
591 xcb_out.context_id = context_id;
592 xcb_out.printerNameLen = printerNameLen;
593 xcb_out.localeLen = localeLen;
595 xcb_parts[2].iov_base = (char *) &xcb_out;
596 xcb_parts[2].iov_len = sizeof(xcb_out);
597 xcb_parts[3].iov_base = 0;
598 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
599 /* xcb_x_print_string8_t printerName */
600 xcb_parts[4].iov_base = (char *) printerName;
601 xcb_parts[4].iov_len = printerNameLen * sizeof(xcb_x_print_string8_t);
602 xcb_parts[5].iov_base = 0;
603 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
604 /* xcb_x_print_string8_t locale */
605 xcb_parts[6].iov_base = (char *) locale;
606 xcb_parts[6].iov_len = localeLen * sizeof(xcb_x_print_string8_t);
607 xcb_parts[7].iov_base = 0;
608 xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3;
610 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
611 return xcb_ret;
614 xcb_void_cookie_t
615 xcb_x_print_create_context (xcb_connection_t *c /**< */,
616 uint32_t context_id /**< */,
617 uint32_t printerNameLen /**< */,
618 uint32_t localeLen /**< */,
619 const xcb_x_print_string8_t *printerName /**< */,
620 const xcb_x_print_string8_t *locale /**< */)
622 static const xcb_protocol_request_t xcb_req = {
623 /* count */ 6,
624 /* ext */ &xcb_x_print_id,
625 /* opcode */ XCB_X_PRINT_CREATE_CONTEXT,
626 /* isvoid */ 1
629 struct iovec xcb_parts[8];
630 xcb_void_cookie_t xcb_ret;
631 xcb_x_print_create_context_request_t xcb_out;
633 xcb_out.context_id = context_id;
634 xcb_out.printerNameLen = printerNameLen;
635 xcb_out.localeLen = localeLen;
637 xcb_parts[2].iov_base = (char *) &xcb_out;
638 xcb_parts[2].iov_len = sizeof(xcb_out);
639 xcb_parts[3].iov_base = 0;
640 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
641 /* xcb_x_print_string8_t printerName */
642 xcb_parts[4].iov_base = (char *) printerName;
643 xcb_parts[4].iov_len = printerNameLen * sizeof(xcb_x_print_string8_t);
644 xcb_parts[5].iov_base = 0;
645 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
646 /* xcb_x_print_string8_t locale */
647 xcb_parts[6].iov_base = (char *) locale;
648 xcb_parts[6].iov_len = localeLen * sizeof(xcb_x_print_string8_t);
649 xcb_parts[7].iov_base = 0;
650 xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3;
652 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
653 return xcb_ret;
656 xcb_void_cookie_t
657 xcb_x_print_print_set_context_checked (xcb_connection_t *c /**< */,
658 uint32_t context /**< */)
660 static const xcb_protocol_request_t xcb_req = {
661 /* count */ 2,
662 /* ext */ &xcb_x_print_id,
663 /* opcode */ XCB_X_PRINT_PRINT_SET_CONTEXT,
664 /* isvoid */ 1
667 struct iovec xcb_parts[4];
668 xcb_void_cookie_t xcb_ret;
669 xcb_x_print_print_set_context_request_t xcb_out;
671 xcb_out.context = context;
673 xcb_parts[2].iov_base = (char *) &xcb_out;
674 xcb_parts[2].iov_len = sizeof(xcb_out);
675 xcb_parts[3].iov_base = 0;
676 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
678 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
679 return xcb_ret;
682 xcb_void_cookie_t
683 xcb_x_print_print_set_context (xcb_connection_t *c /**< */,
684 uint32_t context /**< */)
686 static const xcb_protocol_request_t xcb_req = {
687 /* count */ 2,
688 /* ext */ &xcb_x_print_id,
689 /* opcode */ XCB_X_PRINT_PRINT_SET_CONTEXT,
690 /* isvoid */ 1
693 struct iovec xcb_parts[4];
694 xcb_void_cookie_t xcb_ret;
695 xcb_x_print_print_set_context_request_t xcb_out;
697 xcb_out.context = context;
699 xcb_parts[2].iov_base = (char *) &xcb_out;
700 xcb_parts[2].iov_len = sizeof(xcb_out);
701 xcb_parts[3].iov_base = 0;
702 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
704 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
705 return xcb_ret;
708 xcb_x_print_print_get_context_cookie_t
709 xcb_x_print_print_get_context (xcb_connection_t *c /**< */)
711 static const xcb_protocol_request_t xcb_req = {
712 /* count */ 2,
713 /* ext */ &xcb_x_print_id,
714 /* opcode */ XCB_X_PRINT_PRINT_GET_CONTEXT,
715 /* isvoid */ 0
718 struct iovec xcb_parts[4];
719 xcb_x_print_print_get_context_cookie_t xcb_ret;
720 xcb_x_print_print_get_context_request_t xcb_out;
723 xcb_parts[2].iov_base = (char *) &xcb_out;
724 xcb_parts[2].iov_len = sizeof(xcb_out);
725 xcb_parts[3].iov_base = 0;
726 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
728 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
729 return xcb_ret;
732 xcb_x_print_print_get_context_cookie_t
733 xcb_x_print_print_get_context_unchecked (xcb_connection_t *c /**< */)
735 static const xcb_protocol_request_t xcb_req = {
736 /* count */ 2,
737 /* ext */ &xcb_x_print_id,
738 /* opcode */ XCB_X_PRINT_PRINT_GET_CONTEXT,
739 /* isvoid */ 0
742 struct iovec xcb_parts[4];
743 xcb_x_print_print_get_context_cookie_t xcb_ret;
744 xcb_x_print_print_get_context_request_t xcb_out;
747 xcb_parts[2].iov_base = (char *) &xcb_out;
748 xcb_parts[2].iov_len = sizeof(xcb_out);
749 xcb_parts[3].iov_base = 0;
750 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
752 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
753 return xcb_ret;
756 xcb_x_print_print_get_context_reply_t *
757 xcb_x_print_print_get_context_reply (xcb_connection_t *c /**< */,
758 xcb_x_print_print_get_context_cookie_t cookie /**< */,
759 xcb_generic_error_t **e /**< */)
761 return (xcb_x_print_print_get_context_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
764 xcb_void_cookie_t
765 xcb_x_print_print_destroy_context_checked (xcb_connection_t *c /**< */,
766 uint32_t context /**< */)
768 static const xcb_protocol_request_t xcb_req = {
769 /* count */ 2,
770 /* ext */ &xcb_x_print_id,
771 /* opcode */ XCB_X_PRINT_PRINT_DESTROY_CONTEXT,
772 /* isvoid */ 1
775 struct iovec xcb_parts[4];
776 xcb_void_cookie_t xcb_ret;
777 xcb_x_print_print_destroy_context_request_t xcb_out;
779 xcb_out.context = context;
781 xcb_parts[2].iov_base = (char *) &xcb_out;
782 xcb_parts[2].iov_len = sizeof(xcb_out);
783 xcb_parts[3].iov_base = 0;
784 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
786 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
787 return xcb_ret;
790 xcb_void_cookie_t
791 xcb_x_print_print_destroy_context (xcb_connection_t *c /**< */,
792 uint32_t context /**< */)
794 static const xcb_protocol_request_t xcb_req = {
795 /* count */ 2,
796 /* ext */ &xcb_x_print_id,
797 /* opcode */ XCB_X_PRINT_PRINT_DESTROY_CONTEXT,
798 /* isvoid */ 1
801 struct iovec xcb_parts[4];
802 xcb_void_cookie_t xcb_ret;
803 xcb_x_print_print_destroy_context_request_t xcb_out;
805 xcb_out.context = context;
807 xcb_parts[2].iov_base = (char *) &xcb_out;
808 xcb_parts[2].iov_len = sizeof(xcb_out);
809 xcb_parts[3].iov_base = 0;
810 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
812 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
813 return xcb_ret;
816 xcb_x_print_print_get_screen_of_context_cookie_t
817 xcb_x_print_print_get_screen_of_context (xcb_connection_t *c /**< */)
819 static const xcb_protocol_request_t xcb_req = {
820 /* count */ 2,
821 /* ext */ &xcb_x_print_id,
822 /* opcode */ XCB_X_PRINT_PRINT_GET_SCREEN_OF_CONTEXT,
823 /* isvoid */ 0
826 struct iovec xcb_parts[4];
827 xcb_x_print_print_get_screen_of_context_cookie_t xcb_ret;
828 xcb_x_print_print_get_screen_of_context_request_t xcb_out;
831 xcb_parts[2].iov_base = (char *) &xcb_out;
832 xcb_parts[2].iov_len = sizeof(xcb_out);
833 xcb_parts[3].iov_base = 0;
834 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
836 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
837 return xcb_ret;
840 xcb_x_print_print_get_screen_of_context_cookie_t
841 xcb_x_print_print_get_screen_of_context_unchecked (xcb_connection_t *c /**< */)
843 static const xcb_protocol_request_t xcb_req = {
844 /* count */ 2,
845 /* ext */ &xcb_x_print_id,
846 /* opcode */ XCB_X_PRINT_PRINT_GET_SCREEN_OF_CONTEXT,
847 /* isvoid */ 0
850 struct iovec xcb_parts[4];
851 xcb_x_print_print_get_screen_of_context_cookie_t xcb_ret;
852 xcb_x_print_print_get_screen_of_context_request_t xcb_out;
855 xcb_parts[2].iov_base = (char *) &xcb_out;
856 xcb_parts[2].iov_len = sizeof(xcb_out);
857 xcb_parts[3].iov_base = 0;
858 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
860 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
861 return xcb_ret;
864 xcb_x_print_print_get_screen_of_context_reply_t *
865 xcb_x_print_print_get_screen_of_context_reply (xcb_connection_t *c /**< */,
866 xcb_x_print_print_get_screen_of_context_cookie_t cookie /**< */,
867 xcb_generic_error_t **e /**< */)
869 return (xcb_x_print_print_get_screen_of_context_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
872 xcb_void_cookie_t
873 xcb_x_print_print_start_job_checked (xcb_connection_t *c /**< */,
874 uint8_t output_mode /**< */)
876 static const xcb_protocol_request_t xcb_req = {
877 /* count */ 2,
878 /* ext */ &xcb_x_print_id,
879 /* opcode */ XCB_X_PRINT_PRINT_START_JOB,
880 /* isvoid */ 1
883 struct iovec xcb_parts[4];
884 xcb_void_cookie_t xcb_ret;
885 xcb_x_print_print_start_job_request_t xcb_out;
887 xcb_out.output_mode = output_mode;
889 xcb_parts[2].iov_base = (char *) &xcb_out;
890 xcb_parts[2].iov_len = sizeof(xcb_out);
891 xcb_parts[3].iov_base = 0;
892 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
894 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
895 return xcb_ret;
898 xcb_void_cookie_t
899 xcb_x_print_print_start_job (xcb_connection_t *c /**< */,
900 uint8_t output_mode /**< */)
902 static const xcb_protocol_request_t xcb_req = {
903 /* count */ 2,
904 /* ext */ &xcb_x_print_id,
905 /* opcode */ XCB_X_PRINT_PRINT_START_JOB,
906 /* isvoid */ 1
909 struct iovec xcb_parts[4];
910 xcb_void_cookie_t xcb_ret;
911 xcb_x_print_print_start_job_request_t xcb_out;
913 xcb_out.output_mode = output_mode;
915 xcb_parts[2].iov_base = (char *) &xcb_out;
916 xcb_parts[2].iov_len = sizeof(xcb_out);
917 xcb_parts[3].iov_base = 0;
918 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
920 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
921 return xcb_ret;
924 xcb_void_cookie_t
925 xcb_x_print_print_end_job_checked (xcb_connection_t *c /**< */,
926 uint8_t cancel /**< */)
928 static const xcb_protocol_request_t xcb_req = {
929 /* count */ 2,
930 /* ext */ &xcb_x_print_id,
931 /* opcode */ XCB_X_PRINT_PRINT_END_JOB,
932 /* isvoid */ 1
935 struct iovec xcb_parts[4];
936 xcb_void_cookie_t xcb_ret;
937 xcb_x_print_print_end_job_request_t xcb_out;
939 xcb_out.cancel = cancel;
941 xcb_parts[2].iov_base = (char *) &xcb_out;
942 xcb_parts[2].iov_len = sizeof(xcb_out);
943 xcb_parts[3].iov_base = 0;
944 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
946 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
947 return xcb_ret;
950 xcb_void_cookie_t
951 xcb_x_print_print_end_job (xcb_connection_t *c /**< */,
952 uint8_t cancel /**< */)
954 static const xcb_protocol_request_t xcb_req = {
955 /* count */ 2,
956 /* ext */ &xcb_x_print_id,
957 /* opcode */ XCB_X_PRINT_PRINT_END_JOB,
958 /* isvoid */ 1
961 struct iovec xcb_parts[4];
962 xcb_void_cookie_t xcb_ret;
963 xcb_x_print_print_end_job_request_t xcb_out;
965 xcb_out.cancel = cancel;
967 xcb_parts[2].iov_base = (char *) &xcb_out;
968 xcb_parts[2].iov_len = sizeof(xcb_out);
969 xcb_parts[3].iov_base = 0;
970 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
972 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
973 return xcb_ret;
976 xcb_void_cookie_t
977 xcb_x_print_print_start_doc_checked (xcb_connection_t *c /**< */,
978 uint8_t driver_mode /**< */)
980 static const xcb_protocol_request_t xcb_req = {
981 /* count */ 2,
982 /* ext */ &xcb_x_print_id,
983 /* opcode */ XCB_X_PRINT_PRINT_START_DOC,
984 /* isvoid */ 1
987 struct iovec xcb_parts[4];
988 xcb_void_cookie_t xcb_ret;
989 xcb_x_print_print_start_doc_request_t xcb_out;
991 xcb_out.driver_mode = driver_mode;
993 xcb_parts[2].iov_base = (char *) &xcb_out;
994 xcb_parts[2].iov_len = sizeof(xcb_out);
995 xcb_parts[3].iov_base = 0;
996 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
998 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
999 return xcb_ret;
1002 xcb_void_cookie_t
1003 xcb_x_print_print_start_doc (xcb_connection_t *c /**< */,
1004 uint8_t driver_mode /**< */)
1006 static const xcb_protocol_request_t xcb_req = {
1007 /* count */ 2,
1008 /* ext */ &xcb_x_print_id,
1009 /* opcode */ XCB_X_PRINT_PRINT_START_DOC,
1010 /* isvoid */ 1
1013 struct iovec xcb_parts[4];
1014 xcb_void_cookie_t xcb_ret;
1015 xcb_x_print_print_start_doc_request_t xcb_out;
1017 xcb_out.driver_mode = driver_mode;
1019 xcb_parts[2].iov_base = (char *) &xcb_out;
1020 xcb_parts[2].iov_len = sizeof(xcb_out);
1021 xcb_parts[3].iov_base = 0;
1022 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1024 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1025 return xcb_ret;
1028 xcb_void_cookie_t
1029 xcb_x_print_print_end_doc_checked (xcb_connection_t *c /**< */,
1030 uint8_t cancel /**< */)
1032 static const xcb_protocol_request_t xcb_req = {
1033 /* count */ 2,
1034 /* ext */ &xcb_x_print_id,
1035 /* opcode */ XCB_X_PRINT_PRINT_END_DOC,
1036 /* isvoid */ 1
1039 struct iovec xcb_parts[4];
1040 xcb_void_cookie_t xcb_ret;
1041 xcb_x_print_print_end_doc_request_t xcb_out;
1043 xcb_out.cancel = cancel;
1045 xcb_parts[2].iov_base = (char *) &xcb_out;
1046 xcb_parts[2].iov_len = sizeof(xcb_out);
1047 xcb_parts[3].iov_base = 0;
1048 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1050 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1051 return xcb_ret;
1054 xcb_void_cookie_t
1055 xcb_x_print_print_end_doc (xcb_connection_t *c /**< */,
1056 uint8_t cancel /**< */)
1058 static const xcb_protocol_request_t xcb_req = {
1059 /* count */ 2,
1060 /* ext */ &xcb_x_print_id,
1061 /* opcode */ XCB_X_PRINT_PRINT_END_DOC,
1062 /* isvoid */ 1
1065 struct iovec xcb_parts[4];
1066 xcb_void_cookie_t xcb_ret;
1067 xcb_x_print_print_end_doc_request_t xcb_out;
1069 xcb_out.cancel = cancel;
1071 xcb_parts[2].iov_base = (char *) &xcb_out;
1072 xcb_parts[2].iov_len = sizeof(xcb_out);
1073 xcb_parts[3].iov_base = 0;
1074 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1076 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1077 return xcb_ret;
1081 xcb_x_print_print_put_document_data_sizeof (const void *_buffer /**< */,
1082 uint32_t doc_format_len /**< */,
1083 uint32_t options_len /**< */)
1085 char *xcb_tmp = (char *)_buffer;
1086 const xcb_x_print_print_put_document_data_request_t *_aux = (xcb_x_print_print_put_document_data_request_t *)_buffer;
1087 unsigned int xcb_buffer_len = 0;
1088 unsigned int xcb_block_len = 0;
1089 unsigned int xcb_pad = 0;
1090 unsigned int xcb_align_to = 0;
1093 xcb_block_len += sizeof(xcb_x_print_print_put_document_data_request_t);
1094 xcb_tmp += xcb_block_len;
1095 xcb_buffer_len += xcb_block_len;
1096 xcb_block_len = 0;
1097 /* data */
1098 xcb_block_len += _aux->len_data * sizeof(uint8_t);
1099 xcb_tmp += xcb_block_len;
1100 xcb_align_to = ALIGNOF(uint8_t);
1101 /* insert padding */
1102 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1103 xcb_buffer_len += xcb_block_len + xcb_pad;
1104 if (0 != xcb_pad) {
1105 xcb_tmp += xcb_pad;
1106 xcb_pad = 0;
1108 xcb_block_len = 0;
1109 /* doc_format */
1110 xcb_block_len += doc_format_len * sizeof(xcb_x_print_string8_t);
1111 xcb_tmp += xcb_block_len;
1112 xcb_align_to = ALIGNOF(xcb_x_print_string8_t);
1113 /* insert padding */
1114 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1115 xcb_buffer_len += xcb_block_len + xcb_pad;
1116 if (0 != xcb_pad) {
1117 xcb_tmp += xcb_pad;
1118 xcb_pad = 0;
1120 xcb_block_len = 0;
1121 /* options */
1122 xcb_block_len += options_len * sizeof(xcb_x_print_string8_t);
1123 xcb_tmp += xcb_block_len;
1124 xcb_align_to = ALIGNOF(xcb_x_print_string8_t);
1125 /* insert padding */
1126 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1127 xcb_buffer_len += xcb_block_len + xcb_pad;
1128 if (0 != xcb_pad) {
1129 xcb_tmp += xcb_pad;
1130 xcb_pad = 0;
1132 xcb_block_len = 0;
1134 return xcb_buffer_len;
1137 xcb_void_cookie_t
1138 xcb_x_print_print_put_document_data_checked (xcb_connection_t *c /**< */,
1139 xcb_drawable_t drawable /**< */,
1140 uint32_t len_data /**< */,
1141 uint16_t len_fmt /**< */,
1142 uint16_t len_options /**< */,
1143 const uint8_t *data /**< */,
1144 uint32_t doc_format_len /**< */,
1145 const xcb_x_print_string8_t *doc_format /**< */,
1146 uint32_t options_len /**< */,
1147 const xcb_x_print_string8_t *options /**< */)
1149 static const xcb_protocol_request_t xcb_req = {
1150 /* count */ 8,
1151 /* ext */ &xcb_x_print_id,
1152 /* opcode */ XCB_X_PRINT_PRINT_PUT_DOCUMENT_DATA,
1153 /* isvoid */ 1
1156 struct iovec xcb_parts[10];
1157 xcb_void_cookie_t xcb_ret;
1158 xcb_x_print_print_put_document_data_request_t xcb_out;
1160 xcb_out.drawable = drawable;
1161 xcb_out.len_data = len_data;
1162 xcb_out.len_fmt = len_fmt;
1163 xcb_out.len_options = len_options;
1165 xcb_parts[2].iov_base = (char *) &xcb_out;
1166 xcb_parts[2].iov_len = sizeof(xcb_out);
1167 xcb_parts[3].iov_base = 0;
1168 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1169 /* uint8_t data */
1170 xcb_parts[4].iov_base = (char *) data;
1171 xcb_parts[4].iov_len = len_data * sizeof(uint8_t);
1172 xcb_parts[5].iov_base = 0;
1173 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1174 /* xcb_x_print_string8_t doc_format */
1175 xcb_parts[6].iov_base = (char *) doc_format;
1176 xcb_parts[6].iov_len = doc_format_len * sizeof(xcb_x_print_string8_t);
1177 xcb_parts[7].iov_base = 0;
1178 xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3;
1179 /* xcb_x_print_string8_t options */
1180 xcb_parts[8].iov_base = (char *) options;
1181 xcb_parts[8].iov_len = options_len * sizeof(xcb_x_print_string8_t);
1182 xcb_parts[9].iov_base = 0;
1183 xcb_parts[9].iov_len = -xcb_parts[8].iov_len & 3;
1185 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1186 return xcb_ret;
1189 xcb_void_cookie_t
1190 xcb_x_print_print_put_document_data (xcb_connection_t *c /**< */,
1191 xcb_drawable_t drawable /**< */,
1192 uint32_t len_data /**< */,
1193 uint16_t len_fmt /**< */,
1194 uint16_t len_options /**< */,
1195 const uint8_t *data /**< */,
1196 uint32_t doc_format_len /**< */,
1197 const xcb_x_print_string8_t *doc_format /**< */,
1198 uint32_t options_len /**< */,
1199 const xcb_x_print_string8_t *options /**< */)
1201 static const xcb_protocol_request_t xcb_req = {
1202 /* count */ 8,
1203 /* ext */ &xcb_x_print_id,
1204 /* opcode */ XCB_X_PRINT_PRINT_PUT_DOCUMENT_DATA,
1205 /* isvoid */ 1
1208 struct iovec xcb_parts[10];
1209 xcb_void_cookie_t xcb_ret;
1210 xcb_x_print_print_put_document_data_request_t xcb_out;
1212 xcb_out.drawable = drawable;
1213 xcb_out.len_data = len_data;
1214 xcb_out.len_fmt = len_fmt;
1215 xcb_out.len_options = len_options;
1217 xcb_parts[2].iov_base = (char *) &xcb_out;
1218 xcb_parts[2].iov_len = sizeof(xcb_out);
1219 xcb_parts[3].iov_base = 0;
1220 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1221 /* uint8_t data */
1222 xcb_parts[4].iov_base = (char *) data;
1223 xcb_parts[4].iov_len = len_data * sizeof(uint8_t);
1224 xcb_parts[5].iov_base = 0;
1225 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1226 /* xcb_x_print_string8_t doc_format */
1227 xcb_parts[6].iov_base = (char *) doc_format;
1228 xcb_parts[6].iov_len = doc_format_len * sizeof(xcb_x_print_string8_t);
1229 xcb_parts[7].iov_base = 0;
1230 xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3;
1231 /* xcb_x_print_string8_t options */
1232 xcb_parts[8].iov_base = (char *) options;
1233 xcb_parts[8].iov_len = options_len * sizeof(xcb_x_print_string8_t);
1234 xcb_parts[9].iov_base = 0;
1235 xcb_parts[9].iov_len = -xcb_parts[8].iov_len & 3;
1237 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1238 return xcb_ret;
1242 xcb_x_print_print_get_document_data_sizeof (const void *_buffer /**< */)
1244 char *xcb_tmp = (char *)_buffer;
1245 const xcb_x_print_print_get_document_data_reply_t *_aux = (xcb_x_print_print_get_document_data_reply_t *)_buffer;
1246 unsigned int xcb_buffer_len = 0;
1247 unsigned int xcb_block_len = 0;
1248 unsigned int xcb_pad = 0;
1249 unsigned int xcb_align_to = 0;
1252 xcb_block_len += sizeof(xcb_x_print_print_get_document_data_reply_t);
1253 xcb_tmp += xcb_block_len;
1254 xcb_buffer_len += xcb_block_len;
1255 xcb_block_len = 0;
1256 /* data */
1257 xcb_block_len += _aux->dataLen * sizeof(uint8_t);
1258 xcb_tmp += xcb_block_len;
1259 xcb_align_to = ALIGNOF(uint8_t);
1260 /* insert padding */
1261 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1262 xcb_buffer_len += xcb_block_len + xcb_pad;
1263 if (0 != xcb_pad) {
1264 xcb_tmp += xcb_pad;
1265 xcb_pad = 0;
1267 xcb_block_len = 0;
1269 return xcb_buffer_len;
1272 xcb_x_print_print_get_document_data_cookie_t
1273 xcb_x_print_print_get_document_data (xcb_connection_t *c /**< */,
1274 xcb_x_print_pcontext_t context /**< */,
1275 uint32_t max_bytes /**< */)
1277 static const xcb_protocol_request_t xcb_req = {
1278 /* count */ 2,
1279 /* ext */ &xcb_x_print_id,
1280 /* opcode */ XCB_X_PRINT_PRINT_GET_DOCUMENT_DATA,
1281 /* isvoid */ 0
1284 struct iovec xcb_parts[4];
1285 xcb_x_print_print_get_document_data_cookie_t xcb_ret;
1286 xcb_x_print_print_get_document_data_request_t xcb_out;
1288 xcb_out.context = context;
1289 xcb_out.max_bytes = max_bytes;
1291 xcb_parts[2].iov_base = (char *) &xcb_out;
1292 xcb_parts[2].iov_len = sizeof(xcb_out);
1293 xcb_parts[3].iov_base = 0;
1294 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1296 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1297 return xcb_ret;
1300 xcb_x_print_print_get_document_data_cookie_t
1301 xcb_x_print_print_get_document_data_unchecked (xcb_connection_t *c /**< */,
1302 xcb_x_print_pcontext_t context /**< */,
1303 uint32_t max_bytes /**< */)
1305 static const xcb_protocol_request_t xcb_req = {
1306 /* count */ 2,
1307 /* ext */ &xcb_x_print_id,
1308 /* opcode */ XCB_X_PRINT_PRINT_GET_DOCUMENT_DATA,
1309 /* isvoid */ 0
1312 struct iovec xcb_parts[4];
1313 xcb_x_print_print_get_document_data_cookie_t xcb_ret;
1314 xcb_x_print_print_get_document_data_request_t xcb_out;
1316 xcb_out.context = context;
1317 xcb_out.max_bytes = max_bytes;
1319 xcb_parts[2].iov_base = (char *) &xcb_out;
1320 xcb_parts[2].iov_len = sizeof(xcb_out);
1321 xcb_parts[3].iov_base = 0;
1322 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1324 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1325 return xcb_ret;
1328 uint8_t *
1329 xcb_x_print_print_get_document_data_data (const xcb_x_print_print_get_document_data_reply_t *R /**< */)
1331 return (uint8_t *) (R + 1);
1335 xcb_x_print_print_get_document_data_data_length (const xcb_x_print_print_get_document_data_reply_t *R /**< */)
1337 return R->dataLen;
1340 xcb_generic_iterator_t
1341 xcb_x_print_print_get_document_data_data_end (const xcb_x_print_print_get_document_data_reply_t *R /**< */)
1343 xcb_generic_iterator_t i;
1344 i.data = ((uint8_t *) (R + 1)) + (R->dataLen);
1345 i.rem = 0;
1346 i.index = (char *) i.data - (char *) R;
1347 return i;
1350 xcb_x_print_print_get_document_data_reply_t *
1351 xcb_x_print_print_get_document_data_reply (xcb_connection_t *c /**< */,
1352 xcb_x_print_print_get_document_data_cookie_t cookie /**< */,
1353 xcb_generic_error_t **e /**< */)
1355 return (xcb_x_print_print_get_document_data_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1358 xcb_void_cookie_t
1359 xcb_x_print_print_start_page_checked (xcb_connection_t *c /**< */,
1360 xcb_window_t window /**< */)
1362 static const xcb_protocol_request_t xcb_req = {
1363 /* count */ 2,
1364 /* ext */ &xcb_x_print_id,
1365 /* opcode */ XCB_X_PRINT_PRINT_START_PAGE,
1366 /* isvoid */ 1
1369 struct iovec xcb_parts[4];
1370 xcb_void_cookie_t xcb_ret;
1371 xcb_x_print_print_start_page_request_t xcb_out;
1373 xcb_out.window = window;
1375 xcb_parts[2].iov_base = (char *) &xcb_out;
1376 xcb_parts[2].iov_len = sizeof(xcb_out);
1377 xcb_parts[3].iov_base = 0;
1378 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1380 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1381 return xcb_ret;
1384 xcb_void_cookie_t
1385 xcb_x_print_print_start_page (xcb_connection_t *c /**< */,
1386 xcb_window_t window /**< */)
1388 static const xcb_protocol_request_t xcb_req = {
1389 /* count */ 2,
1390 /* ext */ &xcb_x_print_id,
1391 /* opcode */ XCB_X_PRINT_PRINT_START_PAGE,
1392 /* isvoid */ 1
1395 struct iovec xcb_parts[4];
1396 xcb_void_cookie_t xcb_ret;
1397 xcb_x_print_print_start_page_request_t xcb_out;
1399 xcb_out.window = window;
1401 xcb_parts[2].iov_base = (char *) &xcb_out;
1402 xcb_parts[2].iov_len = sizeof(xcb_out);
1403 xcb_parts[3].iov_base = 0;
1404 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1406 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1407 return xcb_ret;
1410 xcb_void_cookie_t
1411 xcb_x_print_print_end_page_checked (xcb_connection_t *c /**< */,
1412 uint8_t cancel /**< */)
1414 static const xcb_protocol_request_t xcb_req = {
1415 /* count */ 2,
1416 /* ext */ &xcb_x_print_id,
1417 /* opcode */ XCB_X_PRINT_PRINT_END_PAGE,
1418 /* isvoid */ 1
1421 struct iovec xcb_parts[4];
1422 xcb_void_cookie_t xcb_ret;
1423 xcb_x_print_print_end_page_request_t xcb_out;
1425 xcb_out.cancel = cancel;
1426 memset(xcb_out.pad0, 0, 3);
1428 xcb_parts[2].iov_base = (char *) &xcb_out;
1429 xcb_parts[2].iov_len = sizeof(xcb_out);
1430 xcb_parts[3].iov_base = 0;
1431 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1433 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1434 return xcb_ret;
1437 xcb_void_cookie_t
1438 xcb_x_print_print_end_page (xcb_connection_t *c /**< */,
1439 uint8_t cancel /**< */)
1441 static const xcb_protocol_request_t xcb_req = {
1442 /* count */ 2,
1443 /* ext */ &xcb_x_print_id,
1444 /* opcode */ XCB_X_PRINT_PRINT_END_PAGE,
1445 /* isvoid */ 1
1448 struct iovec xcb_parts[4];
1449 xcb_void_cookie_t xcb_ret;
1450 xcb_x_print_print_end_page_request_t xcb_out;
1452 xcb_out.cancel = cancel;
1453 memset(xcb_out.pad0, 0, 3);
1455 xcb_parts[2].iov_base = (char *) &xcb_out;
1456 xcb_parts[2].iov_len = sizeof(xcb_out);
1457 xcb_parts[3].iov_base = 0;
1458 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1460 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1461 return xcb_ret;
1465 xcb_x_print_print_select_input_sizeof (const void *_buffer /**< */)
1467 char *xcb_tmp = (char *)_buffer;
1468 const xcb_x_print_print_select_input_request_t *_aux = (xcb_x_print_print_select_input_request_t *)_buffer;
1469 unsigned int xcb_buffer_len = 0;
1470 unsigned int xcb_block_len = 0;
1471 unsigned int xcb_pad = 0;
1472 unsigned int xcb_align_to = 0;
1475 xcb_block_len += sizeof(xcb_x_print_print_select_input_request_t);
1476 xcb_tmp += xcb_block_len;
1477 xcb_buffer_len += xcb_block_len;
1478 xcb_block_len = 0;
1479 /* event_list */
1480 xcb_block_len += xcb_popcount(_aux->event_mask) * sizeof(uint32_t);
1481 xcb_tmp += xcb_block_len;
1482 xcb_align_to = ALIGNOF(uint32_t);
1483 /* insert padding */
1484 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1485 xcb_buffer_len += xcb_block_len + xcb_pad;
1486 if (0 != xcb_pad) {
1487 xcb_tmp += xcb_pad;
1488 xcb_pad = 0;
1490 xcb_block_len = 0;
1492 return xcb_buffer_len;
1495 xcb_void_cookie_t
1496 xcb_x_print_print_select_input_checked (xcb_connection_t *c /**< */,
1497 xcb_x_print_pcontext_t context /**< */,
1498 uint32_t event_mask /**< */,
1499 const uint32_t *event_list /**< */)
1501 static const xcb_protocol_request_t xcb_req = {
1502 /* count */ 4,
1503 /* ext */ &xcb_x_print_id,
1504 /* opcode */ XCB_X_PRINT_PRINT_SELECT_INPUT,
1505 /* isvoid */ 1
1508 struct iovec xcb_parts[6];
1509 xcb_void_cookie_t xcb_ret;
1510 xcb_x_print_print_select_input_request_t xcb_out;
1512 xcb_out.context = context;
1513 xcb_out.event_mask = event_mask;
1515 xcb_parts[2].iov_base = (char *) &xcb_out;
1516 xcb_parts[2].iov_len = sizeof(xcb_out);
1517 xcb_parts[3].iov_base = 0;
1518 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1519 /* uint32_t event_list */
1520 xcb_parts[4].iov_base = (char *) event_list;
1521 xcb_parts[4].iov_len = xcb_popcount(event_mask) * sizeof(uint32_t);
1522 xcb_parts[5].iov_base = 0;
1523 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1525 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1526 return xcb_ret;
1529 xcb_void_cookie_t
1530 xcb_x_print_print_select_input (xcb_connection_t *c /**< */,
1531 xcb_x_print_pcontext_t context /**< */,
1532 uint32_t event_mask /**< */,
1533 const uint32_t *event_list /**< */)
1535 static const xcb_protocol_request_t xcb_req = {
1536 /* count */ 4,
1537 /* ext */ &xcb_x_print_id,
1538 /* opcode */ XCB_X_PRINT_PRINT_SELECT_INPUT,
1539 /* isvoid */ 1
1542 struct iovec xcb_parts[6];
1543 xcb_void_cookie_t xcb_ret;
1544 xcb_x_print_print_select_input_request_t xcb_out;
1546 xcb_out.context = context;
1547 xcb_out.event_mask = event_mask;
1549 xcb_parts[2].iov_base = (char *) &xcb_out;
1550 xcb_parts[2].iov_len = sizeof(xcb_out);
1551 xcb_parts[3].iov_base = 0;
1552 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1553 /* uint32_t event_list */
1554 xcb_parts[4].iov_base = (char *) event_list;
1555 xcb_parts[4].iov_len = xcb_popcount(event_mask) * sizeof(uint32_t);
1556 xcb_parts[5].iov_base = 0;
1557 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1559 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1560 return xcb_ret;
1564 xcb_x_print_print_input_selected_serialize (void **_buffer /**< */,
1565 const xcb_x_print_print_input_selected_reply_t *_aux /**< */,
1566 const uint32_t *event_list /**< */,
1567 const uint32_t *all_events_list /**< */)
1569 char *xcb_out = *_buffer;
1570 unsigned int xcb_buffer_len = 0;
1571 unsigned int xcb_align_to = 0;
1573 unsigned int xcb_pad = 0;
1574 char xcb_pad0[3] = {0, 0, 0};
1575 struct iovec xcb_parts[6];
1576 unsigned int xcb_parts_idx = 0;
1577 unsigned int xcb_block_len = 0;
1578 unsigned int i;
1579 char *xcb_tmp;
1581 /* xcb_x_print_print_input_selected_reply_t.pad0 */
1582 xcb_parts[xcb_parts_idx].iov_base = (char *) &xcb_pad;
1583 xcb_block_len += sizeof(uint8_t);
1584 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
1585 xcb_parts_idx++;
1586 xcb_align_to = ALIGNOF(uint8_t);
1587 /* xcb_x_print_print_input_selected_reply_t.event_mask */
1588 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->event_mask;
1589 xcb_block_len += sizeof(uint32_t);
1590 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t);
1591 xcb_parts_idx++;
1592 xcb_align_to = ALIGNOF(uint32_t);
1593 /* event_list */
1594 xcb_parts[xcb_parts_idx].iov_base = (char *) event_list;
1595 xcb_block_len += xcb_popcount(_aux->event_mask) * sizeof(uint32_t);
1596 xcb_parts[xcb_parts_idx].iov_len = xcb_popcount(_aux->event_mask) * sizeof(uint32_t);
1597 xcb_parts_idx++;
1598 xcb_align_to = ALIGNOF(uint32_t);
1599 /* xcb_x_print_print_input_selected_reply_t.all_events_mask */
1600 xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->all_events_mask;
1601 xcb_block_len += sizeof(uint32_t);
1602 xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t);
1603 xcb_parts_idx++;
1604 xcb_align_to = ALIGNOF(uint32_t);
1605 /* all_events_list */
1606 xcb_parts[xcb_parts_idx].iov_base = (char *) all_events_list;
1607 xcb_block_len += xcb_popcount(_aux->all_events_mask) * sizeof(uint32_t);
1608 xcb_parts[xcb_parts_idx].iov_len = xcb_popcount(_aux->all_events_mask) * sizeof(uint32_t);
1609 xcb_parts_idx++;
1610 xcb_align_to = ALIGNOF(uint32_t);
1611 /* insert padding */
1612 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1613 xcb_buffer_len += xcb_block_len + xcb_pad;
1614 if (0 != xcb_pad) {
1615 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
1616 xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
1617 xcb_parts_idx++;
1618 xcb_pad = 0;
1620 xcb_block_len = 0;
1622 if (NULL == xcb_out) {
1623 /* allocate memory */
1624 xcb_out = malloc(xcb_buffer_len);
1625 *_buffer = xcb_out;
1628 xcb_tmp = xcb_out;
1629 for(i=0; i<xcb_parts_idx; i++) {
1630 if (0 != xcb_parts[i].iov_base && 0 != xcb_parts[i].iov_len)
1631 memcpy(xcb_tmp, xcb_parts[i].iov_base, xcb_parts[i].iov_len);
1632 if (0 != xcb_parts[i].iov_len)
1633 xcb_tmp += xcb_parts[i].iov_len;
1636 return xcb_buffer_len;
1640 xcb_x_print_print_input_selected_unserialize (const void *_buffer /**< */,
1641 xcb_x_print_print_input_selected_reply_t **_aux /**< */)
1643 char *xcb_tmp = (char *)_buffer;
1644 xcb_x_print_print_input_selected_reply_t xcb_out;
1645 unsigned int xcb_buffer_len = 0;
1646 unsigned int xcb_block_len = 0;
1647 unsigned int xcb_pad = 0;
1648 unsigned int xcb_align_to = 0;
1650 uint32_t *event_list;
1651 int event_list_len;
1652 uint32_t *all_events_list;
1653 int all_events_list_len;
1655 /* xcb_x_print_print_input_selected_reply_t.response_type */
1656 xcb_out.response_type = *(uint8_t *)xcb_tmp;
1657 xcb_block_len += sizeof(uint8_t);
1658 xcb_tmp += sizeof(uint8_t);
1659 xcb_align_to = ALIGNOF(uint8_t);
1660 /* xcb_x_print_print_input_selected_reply_t.pad0 */
1661 xcb_out.pad0 = *(uint8_t *)xcb_tmp;
1662 xcb_block_len += sizeof(uint8_t);
1663 xcb_tmp += sizeof(uint8_t);
1664 xcb_align_to = ALIGNOF(uint8_t);
1665 /* xcb_x_print_print_input_selected_reply_t.sequence */
1666 xcb_out.sequence = *(uint16_t *)xcb_tmp;
1667 xcb_block_len += sizeof(uint16_t);
1668 xcb_tmp += sizeof(uint16_t);
1669 xcb_align_to = ALIGNOF(uint16_t);
1670 /* xcb_x_print_print_input_selected_reply_t.length */
1671 xcb_out.length = *(uint32_t *)xcb_tmp;
1672 xcb_block_len += sizeof(uint32_t);
1673 xcb_tmp += sizeof(uint32_t);
1674 xcb_align_to = ALIGNOF(uint32_t);
1675 /* xcb_x_print_print_input_selected_reply_t.event_mask */
1676 xcb_out.event_mask = *(uint32_t *)xcb_tmp;
1677 xcb_block_len += sizeof(uint32_t);
1678 xcb_tmp += sizeof(uint32_t);
1679 xcb_align_to = ALIGNOF(uint32_t);
1680 /* event_list */
1681 event_list = (uint32_t *)xcb_tmp;
1682 event_list_len = xcb_popcount(xcb_out.event_mask) * sizeof(uint32_t);
1683 xcb_block_len += event_list_len;
1684 xcb_tmp += event_list_len;
1685 xcb_align_to = ALIGNOF(uint32_t);
1686 /* xcb_x_print_print_input_selected_reply_t.all_events_mask */
1687 xcb_out.all_events_mask = *(uint32_t *)xcb_tmp;
1688 xcb_block_len += sizeof(uint32_t);
1689 xcb_tmp += sizeof(uint32_t);
1690 xcb_align_to = ALIGNOF(uint32_t);
1691 /* all_events_list */
1692 all_events_list = (uint32_t *)xcb_tmp;
1693 all_events_list_len = xcb_popcount(xcb_out.all_events_mask) * sizeof(uint32_t);
1694 xcb_block_len += all_events_list_len;
1695 xcb_tmp += all_events_list_len;
1696 xcb_align_to = ALIGNOF(uint32_t);
1697 /* insert padding */
1698 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1699 xcb_buffer_len += xcb_block_len + xcb_pad;
1700 if (0 != xcb_pad) {
1701 xcb_tmp += xcb_pad;
1702 xcb_pad = 0;
1704 xcb_block_len = 0;
1706 if (NULL == _aux)
1707 return xcb_buffer_len;
1709 if (NULL == *_aux) {
1710 /* allocate memory */
1711 *_aux = malloc(xcb_buffer_len);
1714 xcb_tmp = ((char *)*_aux)+xcb_buffer_len;
1715 xcb_tmp -= all_events_list_len;
1716 memmove(xcb_tmp, all_events_list, all_events_list_len);
1717 xcb_tmp -= event_list_len;
1718 memmove(xcb_tmp, event_list, event_list_len);
1719 **_aux = xcb_out;
1721 return xcb_buffer_len;
1725 xcb_x_print_print_input_selected_sizeof (const void *_buffer /**< */)
1727 return xcb_x_print_print_input_selected_unserialize(_buffer, NULL);
1730 xcb_x_print_print_input_selected_cookie_t
1731 xcb_x_print_print_input_selected (xcb_connection_t *c /**< */,
1732 xcb_x_print_pcontext_t context /**< */)
1734 static const xcb_protocol_request_t xcb_req = {
1735 /* count */ 2,
1736 /* ext */ &xcb_x_print_id,
1737 /* opcode */ XCB_X_PRINT_PRINT_INPUT_SELECTED,
1738 /* isvoid */ 0
1741 struct iovec xcb_parts[4];
1742 xcb_x_print_print_input_selected_cookie_t xcb_ret;
1743 xcb_x_print_print_input_selected_request_t xcb_out;
1745 xcb_out.context = context;
1747 xcb_parts[2].iov_base = (char *) &xcb_out;
1748 xcb_parts[2].iov_len = sizeof(xcb_out);
1749 xcb_parts[3].iov_base = 0;
1750 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1752 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1753 return xcb_ret;
1756 xcb_x_print_print_input_selected_cookie_t
1757 xcb_x_print_print_input_selected_unchecked (xcb_connection_t *c /**< */,
1758 xcb_x_print_pcontext_t context /**< */)
1760 static const xcb_protocol_request_t xcb_req = {
1761 /* count */ 2,
1762 /* ext */ &xcb_x_print_id,
1763 /* opcode */ XCB_X_PRINT_PRINT_INPUT_SELECTED,
1764 /* isvoid */ 0
1767 struct iovec xcb_parts[4];
1768 xcb_x_print_print_input_selected_cookie_t xcb_ret;
1769 xcb_x_print_print_input_selected_request_t xcb_out;
1771 xcb_out.context = context;
1773 xcb_parts[2].iov_base = (char *) &xcb_out;
1774 xcb_parts[2].iov_len = sizeof(xcb_out);
1775 xcb_parts[3].iov_base = 0;
1776 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1778 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1779 return xcb_ret;
1782 uint32_t *
1783 xcb_x_print_print_input_selected_event_list (const xcb_x_print_print_input_selected_reply_t *R /**< */)
1785 return (uint32_t *) (R + 1);
1789 xcb_x_print_print_input_selected_event_list_length (const xcb_x_print_print_input_selected_reply_t *R /**< */)
1791 return xcb_popcount(R->event_mask);
1794 xcb_generic_iterator_t
1795 xcb_x_print_print_input_selected_event_list_end (const xcb_x_print_print_input_selected_reply_t *R /**< */)
1797 xcb_generic_iterator_t i;
1798 i.data = ((uint32_t *) (R + 1)) + (xcb_popcount(R->event_mask));
1799 i.rem = 0;
1800 i.index = (char *) i.data - (char *) R;
1801 return i;
1804 uint32_t *
1805 xcb_x_print_print_input_selected_all_events_list (const xcb_x_print_print_input_selected_reply_t *R /**< */)
1807 xcb_generic_iterator_t prev = xcb_x_print_print_input_selected_event_list_end(R);
1808 return (uint32_t *) ((char *) prev.data + XCB_TYPE_PAD(uint32_t, prev.index) + 4);
1812 xcb_x_print_print_input_selected_all_events_list_length (const xcb_x_print_print_input_selected_reply_t *R /**< */)
1814 return xcb_popcount(R->all_events_mask);
1817 xcb_generic_iterator_t
1818 xcb_x_print_print_input_selected_all_events_list_end (const xcb_x_print_print_input_selected_reply_t *R /**< */)
1820 xcb_generic_iterator_t i;
1821 xcb_generic_iterator_t child = xcb_x_print_print_input_selected_event_list_end(R);
1822 i.data = ((uint32_t *) child.data) + (xcb_popcount(R->all_events_mask));
1823 i.rem = 0;
1824 i.index = (char *) i.data - (char *) R;
1825 return i;
1828 xcb_x_print_print_input_selected_reply_t *
1829 xcb_x_print_print_input_selected_reply (xcb_connection_t *c /**< */,
1830 xcb_x_print_print_input_selected_cookie_t cookie /**< */,
1831 xcb_generic_error_t **e /**< */)
1833 return (xcb_x_print_print_input_selected_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1837 xcb_x_print_print_get_attributes_sizeof (const void *_buffer /**< */)
1839 char *xcb_tmp = (char *)_buffer;
1840 const xcb_x_print_print_get_attributes_reply_t *_aux = (xcb_x_print_print_get_attributes_reply_t *)_buffer;
1841 unsigned int xcb_buffer_len = 0;
1842 unsigned int xcb_block_len = 0;
1843 unsigned int xcb_pad = 0;
1844 unsigned int xcb_align_to = 0;
1847 xcb_block_len += sizeof(xcb_x_print_print_get_attributes_reply_t);
1848 xcb_tmp += xcb_block_len;
1849 xcb_buffer_len += xcb_block_len;
1850 xcb_block_len = 0;
1851 /* attributes */
1852 xcb_block_len += _aux->stringLen * sizeof(xcb_x_print_string8_t);
1853 xcb_tmp += xcb_block_len;
1854 xcb_align_to = ALIGNOF(xcb_x_print_string8_t);
1855 /* insert padding */
1856 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1857 xcb_buffer_len += xcb_block_len + xcb_pad;
1858 if (0 != xcb_pad) {
1859 xcb_tmp += xcb_pad;
1860 xcb_pad = 0;
1862 xcb_block_len = 0;
1864 return xcb_buffer_len;
1867 xcb_x_print_print_get_attributes_cookie_t
1868 xcb_x_print_print_get_attributes (xcb_connection_t *c /**< */,
1869 xcb_x_print_pcontext_t context /**< */,
1870 uint8_t pool /**< */)
1872 static const xcb_protocol_request_t xcb_req = {
1873 /* count */ 2,
1874 /* ext */ &xcb_x_print_id,
1875 /* opcode */ XCB_X_PRINT_PRINT_GET_ATTRIBUTES,
1876 /* isvoid */ 0
1879 struct iovec xcb_parts[4];
1880 xcb_x_print_print_get_attributes_cookie_t xcb_ret;
1881 xcb_x_print_print_get_attributes_request_t xcb_out;
1883 xcb_out.context = context;
1884 xcb_out.pool = pool;
1885 memset(xcb_out.pad0, 0, 3);
1887 xcb_parts[2].iov_base = (char *) &xcb_out;
1888 xcb_parts[2].iov_len = sizeof(xcb_out);
1889 xcb_parts[3].iov_base = 0;
1890 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1892 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1893 return xcb_ret;
1896 xcb_x_print_print_get_attributes_cookie_t
1897 xcb_x_print_print_get_attributes_unchecked (xcb_connection_t *c /**< */,
1898 xcb_x_print_pcontext_t context /**< */,
1899 uint8_t pool /**< */)
1901 static const xcb_protocol_request_t xcb_req = {
1902 /* count */ 2,
1903 /* ext */ &xcb_x_print_id,
1904 /* opcode */ XCB_X_PRINT_PRINT_GET_ATTRIBUTES,
1905 /* isvoid */ 0
1908 struct iovec xcb_parts[4];
1909 xcb_x_print_print_get_attributes_cookie_t xcb_ret;
1910 xcb_x_print_print_get_attributes_request_t xcb_out;
1912 xcb_out.context = context;
1913 xcb_out.pool = pool;
1914 memset(xcb_out.pad0, 0, 3);
1916 xcb_parts[2].iov_base = (char *) &xcb_out;
1917 xcb_parts[2].iov_len = sizeof(xcb_out);
1918 xcb_parts[3].iov_base = 0;
1919 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1921 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1922 return xcb_ret;
1925 xcb_x_print_string8_t *
1926 xcb_x_print_print_get_attributes_attributes (const xcb_x_print_print_get_attributes_reply_t *R /**< */)
1928 return (xcb_x_print_string8_t *) (R + 1);
1932 xcb_x_print_print_get_attributes_attributes_length (const xcb_x_print_print_get_attributes_reply_t *R /**< */)
1934 return R->stringLen;
1937 xcb_generic_iterator_t
1938 xcb_x_print_print_get_attributes_attributes_end (const xcb_x_print_print_get_attributes_reply_t *R /**< */)
1940 xcb_generic_iterator_t i;
1941 i.data = ((xcb_x_print_string8_t *) (R + 1)) + (R->stringLen);
1942 i.rem = 0;
1943 i.index = (char *) i.data - (char *) R;
1944 return i;
1947 xcb_x_print_print_get_attributes_reply_t *
1948 xcb_x_print_print_get_attributes_reply (xcb_connection_t *c /**< */,
1949 xcb_x_print_print_get_attributes_cookie_t cookie /**< */,
1950 xcb_generic_error_t **e /**< */)
1952 return (xcb_x_print_print_get_attributes_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1956 xcb_x_print_print_get_one_attributes_sizeof (const void *_buffer /**< */)
1958 char *xcb_tmp = (char *)_buffer;
1959 const xcb_x_print_print_get_one_attributes_request_t *_aux = (xcb_x_print_print_get_one_attributes_request_t *)_buffer;
1960 unsigned int xcb_buffer_len = 0;
1961 unsigned int xcb_block_len = 0;
1962 unsigned int xcb_pad = 0;
1963 unsigned int xcb_align_to = 0;
1966 xcb_block_len += sizeof(xcb_x_print_print_get_one_attributes_request_t);
1967 xcb_tmp += xcb_block_len;
1968 xcb_buffer_len += xcb_block_len;
1969 xcb_block_len = 0;
1970 /* name */
1971 xcb_block_len += _aux->nameLen * sizeof(xcb_x_print_string8_t);
1972 xcb_tmp += xcb_block_len;
1973 xcb_align_to = ALIGNOF(xcb_x_print_string8_t);
1974 /* insert padding */
1975 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1976 xcb_buffer_len += xcb_block_len + xcb_pad;
1977 if (0 != xcb_pad) {
1978 xcb_tmp += xcb_pad;
1979 xcb_pad = 0;
1981 xcb_block_len = 0;
1983 return xcb_buffer_len;
1986 xcb_x_print_print_get_one_attributes_cookie_t
1987 xcb_x_print_print_get_one_attributes (xcb_connection_t *c /**< */,
1988 xcb_x_print_pcontext_t context /**< */,
1989 uint32_t nameLen /**< */,
1990 uint8_t pool /**< */,
1991 const xcb_x_print_string8_t *name /**< */)
1993 static const xcb_protocol_request_t xcb_req = {
1994 /* count */ 4,
1995 /* ext */ &xcb_x_print_id,
1996 /* opcode */ XCB_X_PRINT_PRINT_GET_ONE_ATTRIBUTES,
1997 /* isvoid */ 0
2000 struct iovec xcb_parts[6];
2001 xcb_x_print_print_get_one_attributes_cookie_t xcb_ret;
2002 xcb_x_print_print_get_one_attributes_request_t xcb_out;
2004 xcb_out.context = context;
2005 xcb_out.nameLen = nameLen;
2006 xcb_out.pool = pool;
2007 memset(xcb_out.pad0, 0, 3);
2009 xcb_parts[2].iov_base = (char *) &xcb_out;
2010 xcb_parts[2].iov_len = sizeof(xcb_out);
2011 xcb_parts[3].iov_base = 0;
2012 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2013 /* xcb_x_print_string8_t name */
2014 xcb_parts[4].iov_base = (char *) name;
2015 xcb_parts[4].iov_len = nameLen * sizeof(xcb_x_print_string8_t);
2016 xcb_parts[5].iov_base = 0;
2017 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
2019 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2020 return xcb_ret;
2023 xcb_x_print_print_get_one_attributes_cookie_t
2024 xcb_x_print_print_get_one_attributes_unchecked (xcb_connection_t *c /**< */,
2025 xcb_x_print_pcontext_t context /**< */,
2026 uint32_t nameLen /**< */,
2027 uint8_t pool /**< */,
2028 const xcb_x_print_string8_t *name /**< */)
2030 static const xcb_protocol_request_t xcb_req = {
2031 /* count */ 4,
2032 /* ext */ &xcb_x_print_id,
2033 /* opcode */ XCB_X_PRINT_PRINT_GET_ONE_ATTRIBUTES,
2034 /* isvoid */ 0
2037 struct iovec xcb_parts[6];
2038 xcb_x_print_print_get_one_attributes_cookie_t xcb_ret;
2039 xcb_x_print_print_get_one_attributes_request_t xcb_out;
2041 xcb_out.context = context;
2042 xcb_out.nameLen = nameLen;
2043 xcb_out.pool = pool;
2044 memset(xcb_out.pad0, 0, 3);
2046 xcb_parts[2].iov_base = (char *) &xcb_out;
2047 xcb_parts[2].iov_len = sizeof(xcb_out);
2048 xcb_parts[3].iov_base = 0;
2049 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2050 /* xcb_x_print_string8_t name */
2051 xcb_parts[4].iov_base = (char *) name;
2052 xcb_parts[4].iov_len = nameLen * sizeof(xcb_x_print_string8_t);
2053 xcb_parts[5].iov_base = 0;
2054 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
2056 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2057 return xcb_ret;
2060 xcb_x_print_string8_t *
2061 xcb_x_print_print_get_one_attributes_value (const xcb_x_print_print_get_one_attributes_reply_t *R /**< */)
2063 return (xcb_x_print_string8_t *) (R + 1);
2067 xcb_x_print_print_get_one_attributes_value_length (const xcb_x_print_print_get_one_attributes_reply_t *R /**< */)
2069 return R->valueLen;
2072 xcb_generic_iterator_t
2073 xcb_x_print_print_get_one_attributes_value_end (const xcb_x_print_print_get_one_attributes_reply_t *R /**< */)
2075 xcb_generic_iterator_t i;
2076 i.data = ((xcb_x_print_string8_t *) (R + 1)) + (R->valueLen);
2077 i.rem = 0;
2078 i.index = (char *) i.data - (char *) R;
2079 return i;
2082 xcb_x_print_print_get_one_attributes_reply_t *
2083 xcb_x_print_print_get_one_attributes_reply (xcb_connection_t *c /**< */,
2084 xcb_x_print_print_get_one_attributes_cookie_t cookie /**< */,
2085 xcb_generic_error_t **e /**< */)
2087 return (xcb_x_print_print_get_one_attributes_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
2091 xcb_x_print_print_set_attributes_sizeof (const void *_buffer /**< */,
2092 uint32_t attributes_len /**< */)
2094 char *xcb_tmp = (char *)_buffer;
2095 unsigned int xcb_buffer_len = 0;
2096 unsigned int xcb_block_len = 0;
2097 unsigned int xcb_pad = 0;
2098 unsigned int xcb_align_to = 0;
2101 xcb_block_len += sizeof(xcb_x_print_print_set_attributes_request_t);
2102 xcb_tmp += xcb_block_len;
2103 xcb_buffer_len += xcb_block_len;
2104 xcb_block_len = 0;
2105 /* attributes */
2106 xcb_block_len += attributes_len * sizeof(xcb_x_print_string8_t);
2107 xcb_tmp += xcb_block_len;
2108 xcb_align_to = ALIGNOF(xcb_x_print_string8_t);
2109 /* insert padding */
2110 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2111 xcb_buffer_len += xcb_block_len + xcb_pad;
2112 if (0 != xcb_pad) {
2113 xcb_tmp += xcb_pad;
2114 xcb_pad = 0;
2116 xcb_block_len = 0;
2118 return xcb_buffer_len;
2121 xcb_void_cookie_t
2122 xcb_x_print_print_set_attributes_checked (xcb_connection_t *c /**< */,
2123 xcb_x_print_pcontext_t context /**< */,
2124 uint32_t stringLen /**< */,
2125 uint8_t pool /**< */,
2126 uint8_t rule /**< */,
2127 uint32_t attributes_len /**< */,
2128 const xcb_x_print_string8_t *attributes /**< */)
2130 static const xcb_protocol_request_t xcb_req = {
2131 /* count */ 4,
2132 /* ext */ &xcb_x_print_id,
2133 /* opcode */ XCB_X_PRINT_PRINT_SET_ATTRIBUTES,
2134 /* isvoid */ 1
2137 struct iovec xcb_parts[6];
2138 xcb_void_cookie_t xcb_ret;
2139 xcb_x_print_print_set_attributes_request_t xcb_out;
2141 xcb_out.context = context;
2142 xcb_out.stringLen = stringLen;
2143 xcb_out.pool = pool;
2144 xcb_out.rule = rule;
2145 memset(xcb_out.pad0, 0, 2);
2147 xcb_parts[2].iov_base = (char *) &xcb_out;
2148 xcb_parts[2].iov_len = sizeof(xcb_out);
2149 xcb_parts[3].iov_base = 0;
2150 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2151 /* xcb_x_print_string8_t attributes */
2152 xcb_parts[4].iov_base = (char *) attributes;
2153 xcb_parts[4].iov_len = attributes_len * sizeof(xcb_x_print_string8_t);
2154 xcb_parts[5].iov_base = 0;
2155 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
2157 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2158 return xcb_ret;
2161 xcb_void_cookie_t
2162 xcb_x_print_print_set_attributes (xcb_connection_t *c /**< */,
2163 xcb_x_print_pcontext_t context /**< */,
2164 uint32_t stringLen /**< */,
2165 uint8_t pool /**< */,
2166 uint8_t rule /**< */,
2167 uint32_t attributes_len /**< */,
2168 const xcb_x_print_string8_t *attributes /**< */)
2170 static const xcb_protocol_request_t xcb_req = {
2171 /* count */ 4,
2172 /* ext */ &xcb_x_print_id,
2173 /* opcode */ XCB_X_PRINT_PRINT_SET_ATTRIBUTES,
2174 /* isvoid */ 1
2177 struct iovec xcb_parts[6];
2178 xcb_void_cookie_t xcb_ret;
2179 xcb_x_print_print_set_attributes_request_t xcb_out;
2181 xcb_out.context = context;
2182 xcb_out.stringLen = stringLen;
2183 xcb_out.pool = pool;
2184 xcb_out.rule = rule;
2185 memset(xcb_out.pad0, 0, 2);
2187 xcb_parts[2].iov_base = (char *) &xcb_out;
2188 xcb_parts[2].iov_len = sizeof(xcb_out);
2189 xcb_parts[3].iov_base = 0;
2190 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2191 /* xcb_x_print_string8_t attributes */
2192 xcb_parts[4].iov_base = (char *) attributes;
2193 xcb_parts[4].iov_len = attributes_len * sizeof(xcb_x_print_string8_t);
2194 xcb_parts[5].iov_base = 0;
2195 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
2197 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2198 return xcb_ret;
2201 xcb_x_print_print_get_page_dimensions_cookie_t
2202 xcb_x_print_print_get_page_dimensions (xcb_connection_t *c /**< */,
2203 xcb_x_print_pcontext_t context /**< */)
2205 static const xcb_protocol_request_t xcb_req = {
2206 /* count */ 2,
2207 /* ext */ &xcb_x_print_id,
2208 /* opcode */ XCB_X_PRINT_PRINT_GET_PAGE_DIMENSIONS,
2209 /* isvoid */ 0
2212 struct iovec xcb_parts[4];
2213 xcb_x_print_print_get_page_dimensions_cookie_t xcb_ret;
2214 xcb_x_print_print_get_page_dimensions_request_t xcb_out;
2216 xcb_out.context = context;
2218 xcb_parts[2].iov_base = (char *) &xcb_out;
2219 xcb_parts[2].iov_len = sizeof(xcb_out);
2220 xcb_parts[3].iov_base = 0;
2221 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2223 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2224 return xcb_ret;
2227 xcb_x_print_print_get_page_dimensions_cookie_t
2228 xcb_x_print_print_get_page_dimensions_unchecked (xcb_connection_t *c /**< */,
2229 xcb_x_print_pcontext_t context /**< */)
2231 static const xcb_protocol_request_t xcb_req = {
2232 /* count */ 2,
2233 /* ext */ &xcb_x_print_id,
2234 /* opcode */ XCB_X_PRINT_PRINT_GET_PAGE_DIMENSIONS,
2235 /* isvoid */ 0
2238 struct iovec xcb_parts[4];
2239 xcb_x_print_print_get_page_dimensions_cookie_t xcb_ret;
2240 xcb_x_print_print_get_page_dimensions_request_t xcb_out;
2242 xcb_out.context = context;
2244 xcb_parts[2].iov_base = (char *) &xcb_out;
2245 xcb_parts[2].iov_len = sizeof(xcb_out);
2246 xcb_parts[3].iov_base = 0;
2247 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2249 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2250 return xcb_ret;
2253 xcb_x_print_print_get_page_dimensions_reply_t *
2254 xcb_x_print_print_get_page_dimensions_reply (xcb_connection_t *c /**< */,
2255 xcb_x_print_print_get_page_dimensions_cookie_t cookie /**< */,
2256 xcb_generic_error_t **e /**< */)
2258 return (xcb_x_print_print_get_page_dimensions_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
2262 xcb_x_print_print_query_screens_sizeof (const void *_buffer /**< */)
2264 char *xcb_tmp = (char *)_buffer;
2265 const xcb_x_print_print_query_screens_reply_t *_aux = (xcb_x_print_print_query_screens_reply_t *)_buffer;
2266 unsigned int xcb_buffer_len = 0;
2267 unsigned int xcb_block_len = 0;
2268 unsigned int xcb_pad = 0;
2269 unsigned int xcb_align_to = 0;
2272 xcb_block_len += sizeof(xcb_x_print_print_query_screens_reply_t);
2273 xcb_tmp += xcb_block_len;
2274 xcb_buffer_len += xcb_block_len;
2275 xcb_block_len = 0;
2276 /* roots */
2277 xcb_block_len += _aux->listCount * sizeof(xcb_window_t);
2278 xcb_tmp += xcb_block_len;
2279 xcb_align_to = ALIGNOF(xcb_window_t);
2280 /* insert padding */
2281 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2282 xcb_buffer_len += xcb_block_len + xcb_pad;
2283 if (0 != xcb_pad) {
2284 xcb_tmp += xcb_pad;
2285 xcb_pad = 0;
2287 xcb_block_len = 0;
2289 return xcb_buffer_len;
2292 xcb_x_print_print_query_screens_cookie_t
2293 xcb_x_print_print_query_screens (xcb_connection_t *c /**< */)
2295 static const xcb_protocol_request_t xcb_req = {
2296 /* count */ 2,
2297 /* ext */ &xcb_x_print_id,
2298 /* opcode */ XCB_X_PRINT_PRINT_QUERY_SCREENS,
2299 /* isvoid */ 0
2302 struct iovec xcb_parts[4];
2303 xcb_x_print_print_query_screens_cookie_t xcb_ret;
2304 xcb_x_print_print_query_screens_request_t xcb_out;
2307 xcb_parts[2].iov_base = (char *) &xcb_out;
2308 xcb_parts[2].iov_len = sizeof(xcb_out);
2309 xcb_parts[3].iov_base = 0;
2310 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2312 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2313 return xcb_ret;
2316 xcb_x_print_print_query_screens_cookie_t
2317 xcb_x_print_print_query_screens_unchecked (xcb_connection_t *c /**< */)
2319 static const xcb_protocol_request_t xcb_req = {
2320 /* count */ 2,
2321 /* ext */ &xcb_x_print_id,
2322 /* opcode */ XCB_X_PRINT_PRINT_QUERY_SCREENS,
2323 /* isvoid */ 0
2326 struct iovec xcb_parts[4];
2327 xcb_x_print_print_query_screens_cookie_t xcb_ret;
2328 xcb_x_print_print_query_screens_request_t xcb_out;
2331 xcb_parts[2].iov_base = (char *) &xcb_out;
2332 xcb_parts[2].iov_len = sizeof(xcb_out);
2333 xcb_parts[3].iov_base = 0;
2334 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2336 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2337 return xcb_ret;
2340 xcb_window_t *
2341 xcb_x_print_print_query_screens_roots (const xcb_x_print_print_query_screens_reply_t *R /**< */)
2343 return (xcb_window_t *) (R + 1);
2347 xcb_x_print_print_query_screens_roots_length (const xcb_x_print_print_query_screens_reply_t *R /**< */)
2349 return R->listCount;
2352 xcb_generic_iterator_t
2353 xcb_x_print_print_query_screens_roots_end (const xcb_x_print_print_query_screens_reply_t *R /**< */)
2355 xcb_generic_iterator_t i;
2356 i.data = ((xcb_window_t *) (R + 1)) + (R->listCount);
2357 i.rem = 0;
2358 i.index = (char *) i.data - (char *) R;
2359 return i;
2362 xcb_x_print_print_query_screens_reply_t *
2363 xcb_x_print_print_query_screens_reply (xcb_connection_t *c /**< */,
2364 xcb_x_print_print_query_screens_cookie_t cookie /**< */,
2365 xcb_generic_error_t **e /**< */)
2367 return (xcb_x_print_print_query_screens_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
2370 xcb_x_print_print_set_image_resolution_cookie_t
2371 xcb_x_print_print_set_image_resolution (xcb_connection_t *c /**< */,
2372 xcb_x_print_pcontext_t context /**< */,
2373 uint16_t image_resolution /**< */)
2375 static const xcb_protocol_request_t xcb_req = {
2376 /* count */ 2,
2377 /* ext */ &xcb_x_print_id,
2378 /* opcode */ XCB_X_PRINT_PRINT_SET_IMAGE_RESOLUTION,
2379 /* isvoid */ 0
2382 struct iovec xcb_parts[4];
2383 xcb_x_print_print_set_image_resolution_cookie_t xcb_ret;
2384 xcb_x_print_print_set_image_resolution_request_t xcb_out;
2386 xcb_out.context = context;
2387 xcb_out.image_resolution = image_resolution;
2389 xcb_parts[2].iov_base = (char *) &xcb_out;
2390 xcb_parts[2].iov_len = sizeof(xcb_out);
2391 xcb_parts[3].iov_base = 0;
2392 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2394 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2395 return xcb_ret;
2398 xcb_x_print_print_set_image_resolution_cookie_t
2399 xcb_x_print_print_set_image_resolution_unchecked (xcb_connection_t *c /**< */,
2400 xcb_x_print_pcontext_t context /**< */,
2401 uint16_t image_resolution /**< */)
2403 static const xcb_protocol_request_t xcb_req = {
2404 /* count */ 2,
2405 /* ext */ &xcb_x_print_id,
2406 /* opcode */ XCB_X_PRINT_PRINT_SET_IMAGE_RESOLUTION,
2407 /* isvoid */ 0
2410 struct iovec xcb_parts[4];
2411 xcb_x_print_print_set_image_resolution_cookie_t xcb_ret;
2412 xcb_x_print_print_set_image_resolution_request_t xcb_out;
2414 xcb_out.context = context;
2415 xcb_out.image_resolution = image_resolution;
2417 xcb_parts[2].iov_base = (char *) &xcb_out;
2418 xcb_parts[2].iov_len = sizeof(xcb_out);
2419 xcb_parts[3].iov_base = 0;
2420 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2422 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2423 return xcb_ret;
2426 xcb_x_print_print_set_image_resolution_reply_t *
2427 xcb_x_print_print_set_image_resolution_reply (xcb_connection_t *c /**< */,
2428 xcb_x_print_print_set_image_resolution_cookie_t cookie /**< */,
2429 xcb_generic_error_t **e /**< */)
2431 return (xcb_x_print_print_set_image_resolution_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
2434 xcb_x_print_print_get_image_resolution_cookie_t
2435 xcb_x_print_print_get_image_resolution (xcb_connection_t *c /**< */,
2436 xcb_x_print_pcontext_t context /**< */)
2438 static const xcb_protocol_request_t xcb_req = {
2439 /* count */ 2,
2440 /* ext */ &xcb_x_print_id,
2441 /* opcode */ XCB_X_PRINT_PRINT_GET_IMAGE_RESOLUTION,
2442 /* isvoid */ 0
2445 struct iovec xcb_parts[4];
2446 xcb_x_print_print_get_image_resolution_cookie_t xcb_ret;
2447 xcb_x_print_print_get_image_resolution_request_t xcb_out;
2449 xcb_out.context = context;
2451 xcb_parts[2].iov_base = (char *) &xcb_out;
2452 xcb_parts[2].iov_len = sizeof(xcb_out);
2453 xcb_parts[3].iov_base = 0;
2454 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2456 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2457 return xcb_ret;
2460 xcb_x_print_print_get_image_resolution_cookie_t
2461 xcb_x_print_print_get_image_resolution_unchecked (xcb_connection_t *c /**< */,
2462 xcb_x_print_pcontext_t context /**< */)
2464 static const xcb_protocol_request_t xcb_req = {
2465 /* count */ 2,
2466 /* ext */ &xcb_x_print_id,
2467 /* opcode */ XCB_X_PRINT_PRINT_GET_IMAGE_RESOLUTION,
2468 /* isvoid */ 0
2471 struct iovec xcb_parts[4];
2472 xcb_x_print_print_get_image_resolution_cookie_t xcb_ret;
2473 xcb_x_print_print_get_image_resolution_request_t xcb_out;
2475 xcb_out.context = context;
2477 xcb_parts[2].iov_base = (char *) &xcb_out;
2478 xcb_parts[2].iov_len = sizeof(xcb_out);
2479 xcb_parts[3].iov_base = 0;
2480 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2482 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2483 return xcb_ret;
2486 xcb_x_print_print_get_image_resolution_reply_t *
2487 xcb_x_print_print_get_image_resolution_reply (xcb_connection_t *c /**< */,
2488 xcb_x_print_print_get_image_resolution_cookie_t cookie /**< */,
2489 xcb_generic_error_t **e /**< */)
2491 return (xcb_x_print_print_get_image_resolution_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);