1971bb1a5SLionel Sambuc /*
2971bb1a5SLionel Sambuc * This file generated automatically from xprint.xml by c_client.py.
3971bb1a5SLionel Sambuc * Edit at your peril.
4971bb1a5SLionel Sambuc */
5971bb1a5SLionel Sambuc
6971bb1a5SLionel Sambuc #ifdef HAVE_CONFIG_H
7971bb1a5SLionel Sambuc #include "config.h"
8971bb1a5SLionel Sambuc #endif
9971bb1a5SLionel Sambuc #include <stdlib.h>
10971bb1a5SLionel Sambuc #include <string.h>
11971bb1a5SLionel Sambuc #include <assert.h>
12971bb1a5SLionel Sambuc #include <stddef.h> /* for offsetof() */
13971bb1a5SLionel Sambuc #include "xcbext.h"
14971bb1a5SLionel Sambuc #include "xprint.h"
15971bb1a5SLionel Sambuc
16971bb1a5SLionel Sambuc #define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member)
17971bb1a5SLionel Sambuc #include "xproto.h"
18971bb1a5SLionel Sambuc
19971bb1a5SLionel Sambuc xcb_extension_t xcb_x_print_id = { "XpExtension", 0 };
20971bb1a5SLionel Sambuc
21971bb1a5SLionel Sambuc void
xcb_x_print_string8_next(xcb_x_print_string8_iterator_t * i)22971bb1a5SLionel Sambuc xcb_x_print_string8_next (xcb_x_print_string8_iterator_t *i /**< */)
23971bb1a5SLionel Sambuc {
24971bb1a5SLionel Sambuc --i->rem;
25971bb1a5SLionel Sambuc ++i->data;
26971bb1a5SLionel Sambuc i->index += sizeof(xcb_x_print_string8_t);
27971bb1a5SLionel Sambuc }
28971bb1a5SLionel Sambuc
29971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_x_print_string8_end(xcb_x_print_string8_iterator_t i)30971bb1a5SLionel Sambuc xcb_x_print_string8_end (xcb_x_print_string8_iterator_t i /**< */)
31971bb1a5SLionel Sambuc {
32971bb1a5SLionel Sambuc xcb_generic_iterator_t ret;
33971bb1a5SLionel Sambuc ret.data = i.data + i.rem;
34971bb1a5SLionel Sambuc ret.index = i.index + ((char *) ret.data - (char *) i.data);
35971bb1a5SLionel Sambuc ret.rem = 0;
36971bb1a5SLionel Sambuc return ret;
37971bb1a5SLionel Sambuc }
38971bb1a5SLionel Sambuc
39971bb1a5SLionel Sambuc int
xcb_x_print_printer_serialize(void ** _buffer,const xcb_x_print_printer_t * _aux,const xcb_x_print_string8_t * name,const xcb_x_print_string8_t * description)40971bb1a5SLionel Sambuc xcb_x_print_printer_serialize (void **_buffer /**< */,
41971bb1a5SLionel Sambuc const xcb_x_print_printer_t *_aux /**< */,
42971bb1a5SLionel Sambuc const xcb_x_print_string8_t *name /**< */,
43971bb1a5SLionel Sambuc const xcb_x_print_string8_t *description /**< */)
44971bb1a5SLionel Sambuc {
45971bb1a5SLionel Sambuc char *xcb_out = *_buffer;
46971bb1a5SLionel Sambuc unsigned int xcb_buffer_len = 0;
47*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
48971bb1a5SLionel Sambuc
49971bb1a5SLionel Sambuc unsigned int xcb_pad = 0;
50971bb1a5SLionel Sambuc char xcb_pad0[3] = {0, 0, 0};
51971bb1a5SLionel Sambuc struct iovec xcb_parts[5];
52971bb1a5SLionel Sambuc unsigned int xcb_parts_idx = 0;
53971bb1a5SLionel Sambuc unsigned int xcb_block_len = 0;
54971bb1a5SLionel Sambuc unsigned int i;
55971bb1a5SLionel Sambuc char *xcb_tmp;
56971bb1a5SLionel Sambuc
57971bb1a5SLionel Sambuc /* xcb_x_print_printer_t.nameLen */
58971bb1a5SLionel Sambuc xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->nameLen;
59971bb1a5SLionel Sambuc xcb_block_len += sizeof(uint32_t);
60971bb1a5SLionel Sambuc xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t);
61971bb1a5SLionel Sambuc xcb_parts_idx++;
62971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(uint32_t);
63971bb1a5SLionel Sambuc /* name */
64971bb1a5SLionel Sambuc xcb_parts[xcb_parts_idx].iov_base = (char *) name;
65971bb1a5SLionel Sambuc xcb_block_len += _aux->nameLen * sizeof(xcb_x_print_string8_t);
66971bb1a5SLionel Sambuc xcb_parts[xcb_parts_idx].iov_len = _aux->nameLen * sizeof(xcb_x_print_string8_t);
67971bb1a5SLionel Sambuc xcb_parts_idx++;
68971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(xcb_x_print_string8_t);
69971bb1a5SLionel Sambuc /* xcb_x_print_printer_t.descLen */
70971bb1a5SLionel Sambuc xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->descLen;
71971bb1a5SLionel Sambuc xcb_block_len += sizeof(uint32_t);
72971bb1a5SLionel Sambuc xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t);
73971bb1a5SLionel Sambuc xcb_parts_idx++;
74971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(uint32_t);
75971bb1a5SLionel Sambuc /* description */
76971bb1a5SLionel Sambuc xcb_parts[xcb_parts_idx].iov_base = (char *) description;
77971bb1a5SLionel Sambuc xcb_block_len += _aux->descLen * sizeof(xcb_x_print_string8_t);
78971bb1a5SLionel Sambuc xcb_parts[xcb_parts_idx].iov_len = _aux->descLen * sizeof(xcb_x_print_string8_t);
79971bb1a5SLionel Sambuc xcb_parts_idx++;
80971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(xcb_x_print_string8_t);
81971bb1a5SLionel Sambuc /* insert padding */
82971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
83971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
84971bb1a5SLionel Sambuc if (0 != xcb_pad) {
85971bb1a5SLionel Sambuc xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
86971bb1a5SLionel Sambuc xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
87971bb1a5SLionel Sambuc xcb_parts_idx++;
88971bb1a5SLionel Sambuc xcb_pad = 0;
89971bb1a5SLionel Sambuc }
90971bb1a5SLionel Sambuc xcb_block_len = 0;
91971bb1a5SLionel Sambuc
92971bb1a5SLionel Sambuc if (NULL == xcb_out) {
93971bb1a5SLionel Sambuc /* allocate memory */
94971bb1a5SLionel Sambuc xcb_out = malloc(xcb_buffer_len);
95971bb1a5SLionel Sambuc *_buffer = xcb_out;
96971bb1a5SLionel Sambuc }
97971bb1a5SLionel Sambuc
98971bb1a5SLionel Sambuc xcb_tmp = xcb_out;
99971bb1a5SLionel Sambuc for(i=0; i<xcb_parts_idx; i++) {
100971bb1a5SLionel Sambuc if (0 != xcb_parts[i].iov_base && 0 != xcb_parts[i].iov_len)
101971bb1a5SLionel Sambuc memcpy(xcb_tmp, xcb_parts[i].iov_base, xcb_parts[i].iov_len);
102971bb1a5SLionel Sambuc if (0 != xcb_parts[i].iov_len)
103971bb1a5SLionel Sambuc xcb_tmp += xcb_parts[i].iov_len;
104971bb1a5SLionel Sambuc }
105971bb1a5SLionel Sambuc
106971bb1a5SLionel Sambuc return xcb_buffer_len;
107971bb1a5SLionel Sambuc }
108971bb1a5SLionel Sambuc
109971bb1a5SLionel Sambuc int
xcb_x_print_printer_unserialize(const void * _buffer,xcb_x_print_printer_t ** _aux)110971bb1a5SLionel Sambuc xcb_x_print_printer_unserialize (const void *_buffer /**< */,
111971bb1a5SLionel Sambuc xcb_x_print_printer_t **_aux /**< */)
112971bb1a5SLionel Sambuc {
113971bb1a5SLionel Sambuc char *xcb_tmp = (char *)_buffer;
114971bb1a5SLionel Sambuc xcb_x_print_printer_t xcb_out;
115971bb1a5SLionel Sambuc unsigned int xcb_buffer_len = 0;
116971bb1a5SLionel Sambuc unsigned int xcb_block_len = 0;
117971bb1a5SLionel Sambuc unsigned int xcb_pad = 0;
118*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
119971bb1a5SLionel Sambuc
120971bb1a5SLionel Sambuc xcb_x_print_string8_t *name;
121971bb1a5SLionel Sambuc int name_len;
122971bb1a5SLionel Sambuc xcb_x_print_string8_t *description;
123971bb1a5SLionel Sambuc int description_len;
124971bb1a5SLionel Sambuc
125971bb1a5SLionel Sambuc /* xcb_x_print_printer_t.nameLen */
126971bb1a5SLionel Sambuc xcb_out.nameLen = *(uint32_t *)xcb_tmp;
127971bb1a5SLionel Sambuc xcb_block_len += sizeof(uint32_t);
128971bb1a5SLionel Sambuc xcb_tmp += sizeof(uint32_t);
129971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(uint32_t);
130971bb1a5SLionel Sambuc /* name */
131971bb1a5SLionel Sambuc name = (xcb_x_print_string8_t *)xcb_tmp;
132971bb1a5SLionel Sambuc name_len = xcb_out.nameLen * sizeof(xcb_x_print_string8_t);
133971bb1a5SLionel Sambuc xcb_block_len += name_len;
134971bb1a5SLionel Sambuc xcb_tmp += name_len;
135971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(xcb_x_print_string8_t);
136971bb1a5SLionel Sambuc /* xcb_x_print_printer_t.descLen */
137971bb1a5SLionel Sambuc xcb_out.descLen = *(uint32_t *)xcb_tmp;
138971bb1a5SLionel Sambuc xcb_block_len += sizeof(uint32_t);
139971bb1a5SLionel Sambuc xcb_tmp += sizeof(uint32_t);
140971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(uint32_t);
141971bb1a5SLionel Sambuc /* description */
142971bb1a5SLionel Sambuc description = (xcb_x_print_string8_t *)xcb_tmp;
143971bb1a5SLionel Sambuc description_len = xcb_out.descLen * sizeof(xcb_x_print_string8_t);
144971bb1a5SLionel Sambuc xcb_block_len += description_len;
145971bb1a5SLionel Sambuc xcb_tmp += description_len;
146971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(xcb_x_print_string8_t);
147971bb1a5SLionel Sambuc /* insert padding */
148971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
149971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
150971bb1a5SLionel Sambuc if (0 != xcb_pad) {
151971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
152971bb1a5SLionel Sambuc xcb_pad = 0;
153971bb1a5SLionel Sambuc }
154971bb1a5SLionel Sambuc xcb_block_len = 0;
155971bb1a5SLionel Sambuc
156971bb1a5SLionel Sambuc if (NULL == _aux)
157971bb1a5SLionel Sambuc return xcb_buffer_len;
158971bb1a5SLionel Sambuc
159971bb1a5SLionel Sambuc if (NULL == *_aux) {
160971bb1a5SLionel Sambuc /* allocate memory */
161971bb1a5SLionel Sambuc *_aux = malloc(xcb_buffer_len);
162971bb1a5SLionel Sambuc }
163971bb1a5SLionel Sambuc
164971bb1a5SLionel Sambuc xcb_tmp = ((char *)*_aux)+xcb_buffer_len;
165971bb1a5SLionel Sambuc xcb_tmp -= description_len;
166971bb1a5SLionel Sambuc memmove(xcb_tmp, description, description_len);
167971bb1a5SLionel Sambuc xcb_tmp -= name_len;
168971bb1a5SLionel Sambuc memmove(xcb_tmp, name, name_len);
169971bb1a5SLionel Sambuc **_aux = xcb_out;
170971bb1a5SLionel Sambuc
171971bb1a5SLionel Sambuc return xcb_buffer_len;
172971bb1a5SLionel Sambuc }
173971bb1a5SLionel Sambuc
174971bb1a5SLionel Sambuc int
xcb_x_print_printer_sizeof(const void * _buffer)175971bb1a5SLionel Sambuc xcb_x_print_printer_sizeof (const void *_buffer /**< */)
176971bb1a5SLionel Sambuc {
177971bb1a5SLionel Sambuc return xcb_x_print_printer_unserialize(_buffer, NULL);
178971bb1a5SLionel Sambuc }
179971bb1a5SLionel Sambuc
180971bb1a5SLionel Sambuc xcb_x_print_string8_t *
xcb_x_print_printer_name(const xcb_x_print_printer_t * R)181971bb1a5SLionel Sambuc xcb_x_print_printer_name (const xcb_x_print_printer_t *R /**< */)
182971bb1a5SLionel Sambuc {
183971bb1a5SLionel Sambuc return (xcb_x_print_string8_t *) (R + 1);
184971bb1a5SLionel Sambuc }
185971bb1a5SLionel Sambuc
186971bb1a5SLionel Sambuc int
xcb_x_print_printer_name_length(const xcb_x_print_printer_t * R)187971bb1a5SLionel Sambuc xcb_x_print_printer_name_length (const xcb_x_print_printer_t *R /**< */)
188971bb1a5SLionel Sambuc {
189971bb1a5SLionel Sambuc return R->nameLen;
190971bb1a5SLionel Sambuc }
191971bb1a5SLionel Sambuc
192971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_x_print_printer_name_end(const xcb_x_print_printer_t * R)193971bb1a5SLionel Sambuc xcb_x_print_printer_name_end (const xcb_x_print_printer_t *R /**< */)
194971bb1a5SLionel Sambuc {
195971bb1a5SLionel Sambuc xcb_generic_iterator_t i;
196971bb1a5SLionel Sambuc i.data = ((xcb_x_print_string8_t *) (R + 1)) + (R->nameLen);
197971bb1a5SLionel Sambuc i.rem = 0;
198971bb1a5SLionel Sambuc i.index = (char *) i.data - (char *) R;
199971bb1a5SLionel Sambuc return i;
200971bb1a5SLionel Sambuc }
201971bb1a5SLionel Sambuc
202971bb1a5SLionel Sambuc xcb_x_print_string8_t *
xcb_x_print_printer_description(const xcb_x_print_printer_t * R)203971bb1a5SLionel Sambuc xcb_x_print_printer_description (const xcb_x_print_printer_t *R /**< */)
204971bb1a5SLionel Sambuc {
205971bb1a5SLionel Sambuc xcb_generic_iterator_t prev = xcb_x_print_printer_name_end(R);
206971bb1a5SLionel Sambuc return (xcb_x_print_string8_t *) ((char *) prev.data + XCB_TYPE_PAD(uint32_t, prev.index) + 4);
207971bb1a5SLionel Sambuc }
208971bb1a5SLionel Sambuc
209971bb1a5SLionel Sambuc int
xcb_x_print_printer_description_length(const xcb_x_print_printer_t * R)210971bb1a5SLionel Sambuc xcb_x_print_printer_description_length (const xcb_x_print_printer_t *R /**< */)
211971bb1a5SLionel Sambuc {
212971bb1a5SLionel Sambuc return R->descLen;
213971bb1a5SLionel Sambuc }
214971bb1a5SLionel Sambuc
215971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_x_print_printer_description_end(const xcb_x_print_printer_t * R)216971bb1a5SLionel Sambuc xcb_x_print_printer_description_end (const xcb_x_print_printer_t *R /**< */)
217971bb1a5SLionel Sambuc {
218971bb1a5SLionel Sambuc xcb_generic_iterator_t i;
219971bb1a5SLionel Sambuc xcb_generic_iterator_t child = xcb_x_print_printer_name_end(R);
220971bb1a5SLionel Sambuc i.data = ((xcb_x_print_string8_t *) child.data) + (R->descLen);
221971bb1a5SLionel Sambuc i.rem = 0;
222971bb1a5SLionel Sambuc i.index = (char *) i.data - (char *) R;
223971bb1a5SLionel Sambuc return i;
224971bb1a5SLionel Sambuc }
225971bb1a5SLionel Sambuc
226971bb1a5SLionel Sambuc void
xcb_x_print_printer_next(xcb_x_print_printer_iterator_t * i)227971bb1a5SLionel Sambuc xcb_x_print_printer_next (xcb_x_print_printer_iterator_t *i /**< */)
228971bb1a5SLionel Sambuc {
229971bb1a5SLionel Sambuc xcb_x_print_printer_t *R = i->data;
230971bb1a5SLionel Sambuc xcb_generic_iterator_t child;
231971bb1a5SLionel Sambuc child.data = (xcb_x_print_printer_t *)(((char *)R) + xcb_x_print_printer_sizeof(R));
232971bb1a5SLionel Sambuc i->index = (char *) child.data - (char *) i->data;
233971bb1a5SLionel Sambuc --i->rem;
234971bb1a5SLionel Sambuc i->data = (xcb_x_print_printer_t *) child.data;
235971bb1a5SLionel Sambuc }
236971bb1a5SLionel Sambuc
237971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_x_print_printer_end(xcb_x_print_printer_iterator_t i)238971bb1a5SLionel Sambuc xcb_x_print_printer_end (xcb_x_print_printer_iterator_t i /**< */)
239971bb1a5SLionel Sambuc {
240971bb1a5SLionel Sambuc xcb_generic_iterator_t ret;
241971bb1a5SLionel Sambuc while(i.rem > 0)
242971bb1a5SLionel Sambuc xcb_x_print_printer_next(&i);
243971bb1a5SLionel Sambuc ret.data = i.data;
244971bb1a5SLionel Sambuc ret.rem = i.rem;
245971bb1a5SLionel Sambuc ret.index = i.index;
246971bb1a5SLionel Sambuc return ret;
247971bb1a5SLionel Sambuc }
248971bb1a5SLionel Sambuc
249971bb1a5SLionel Sambuc void
xcb_x_print_pcontext_next(xcb_x_print_pcontext_iterator_t * i)250971bb1a5SLionel Sambuc xcb_x_print_pcontext_next (xcb_x_print_pcontext_iterator_t *i /**< */)
251971bb1a5SLionel Sambuc {
252971bb1a5SLionel Sambuc --i->rem;
253971bb1a5SLionel Sambuc ++i->data;
254971bb1a5SLionel Sambuc i->index += sizeof(xcb_x_print_pcontext_t);
255971bb1a5SLionel Sambuc }
256971bb1a5SLionel Sambuc
257971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_x_print_pcontext_end(xcb_x_print_pcontext_iterator_t i)258971bb1a5SLionel Sambuc xcb_x_print_pcontext_end (xcb_x_print_pcontext_iterator_t i /**< */)
259971bb1a5SLionel Sambuc {
260971bb1a5SLionel Sambuc xcb_generic_iterator_t ret;
261971bb1a5SLionel Sambuc ret.data = i.data + i.rem;
262971bb1a5SLionel Sambuc ret.index = i.index + ((char *) ret.data - (char *) i.data);
263971bb1a5SLionel Sambuc ret.rem = 0;
264971bb1a5SLionel Sambuc return ret;
265971bb1a5SLionel Sambuc }
266971bb1a5SLionel Sambuc
267971bb1a5SLionel Sambuc xcb_x_print_print_query_version_cookie_t
xcb_x_print_print_query_version(xcb_connection_t * c)268971bb1a5SLionel Sambuc xcb_x_print_print_query_version (xcb_connection_t *c /**< */)
269971bb1a5SLionel Sambuc {
270971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
271971bb1a5SLionel Sambuc /* count */ 2,
272971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
273971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_PRINT_QUERY_VERSION,
274971bb1a5SLionel Sambuc /* isvoid */ 0
275971bb1a5SLionel Sambuc };
276971bb1a5SLionel Sambuc
277971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
278971bb1a5SLionel Sambuc xcb_x_print_print_query_version_cookie_t xcb_ret;
279971bb1a5SLionel Sambuc xcb_x_print_print_query_version_request_t xcb_out;
280971bb1a5SLionel Sambuc
281971bb1a5SLionel Sambuc
282971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
283971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
284971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
285971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
286971bb1a5SLionel Sambuc
287971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
288971bb1a5SLionel Sambuc return xcb_ret;
289971bb1a5SLionel Sambuc }
290971bb1a5SLionel Sambuc
291971bb1a5SLionel Sambuc xcb_x_print_print_query_version_cookie_t
xcb_x_print_print_query_version_unchecked(xcb_connection_t * c)292971bb1a5SLionel Sambuc xcb_x_print_print_query_version_unchecked (xcb_connection_t *c /**< */)
293971bb1a5SLionel Sambuc {
294971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
295971bb1a5SLionel Sambuc /* count */ 2,
296971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
297971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_PRINT_QUERY_VERSION,
298971bb1a5SLionel Sambuc /* isvoid */ 0
299971bb1a5SLionel Sambuc };
300971bb1a5SLionel Sambuc
301971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
302971bb1a5SLionel Sambuc xcb_x_print_print_query_version_cookie_t xcb_ret;
303971bb1a5SLionel Sambuc xcb_x_print_print_query_version_request_t xcb_out;
304971bb1a5SLionel Sambuc
305971bb1a5SLionel Sambuc
306971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
307971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
308971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
309971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
310971bb1a5SLionel Sambuc
311971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
312971bb1a5SLionel Sambuc return xcb_ret;
313971bb1a5SLionel Sambuc }
314971bb1a5SLionel Sambuc
315971bb1a5SLionel Sambuc xcb_x_print_print_query_version_reply_t *
xcb_x_print_print_query_version_reply(xcb_connection_t * c,xcb_x_print_print_query_version_cookie_t cookie,xcb_generic_error_t ** e)316971bb1a5SLionel Sambuc xcb_x_print_print_query_version_reply (xcb_connection_t *c /**< */,
317971bb1a5SLionel Sambuc xcb_x_print_print_query_version_cookie_t cookie /**< */,
318971bb1a5SLionel Sambuc xcb_generic_error_t **e /**< */)
319971bb1a5SLionel Sambuc {
320971bb1a5SLionel Sambuc return (xcb_x_print_print_query_version_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
321971bb1a5SLionel Sambuc }
322971bb1a5SLionel Sambuc
323971bb1a5SLionel Sambuc int
xcb_x_print_print_get_printer_list_sizeof(const void * _buffer)324971bb1a5SLionel Sambuc xcb_x_print_print_get_printer_list_sizeof (const void *_buffer /**< */)
325971bb1a5SLionel Sambuc {
326971bb1a5SLionel Sambuc char *xcb_tmp = (char *)_buffer;
327971bb1a5SLionel Sambuc const xcb_x_print_print_get_printer_list_request_t *_aux = (xcb_x_print_print_get_printer_list_request_t *)_buffer;
328971bb1a5SLionel Sambuc unsigned int xcb_buffer_len = 0;
329971bb1a5SLionel Sambuc unsigned int xcb_block_len = 0;
330971bb1a5SLionel Sambuc unsigned int xcb_pad = 0;
331*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
332971bb1a5SLionel Sambuc
333971bb1a5SLionel Sambuc
334971bb1a5SLionel Sambuc xcb_block_len += sizeof(xcb_x_print_print_get_printer_list_request_t);
335971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
336*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len;
337*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
338971bb1a5SLionel Sambuc /* printer_name */
339971bb1a5SLionel Sambuc xcb_block_len += _aux->printerNameLen * sizeof(xcb_x_print_string8_t);
340971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
341971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(xcb_x_print_string8_t);
342971bb1a5SLionel Sambuc /* insert padding */
343971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
344971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
345971bb1a5SLionel Sambuc if (0 != xcb_pad) {
346971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
347971bb1a5SLionel Sambuc xcb_pad = 0;
348971bb1a5SLionel Sambuc }
349971bb1a5SLionel Sambuc xcb_block_len = 0;
350971bb1a5SLionel Sambuc /* locale */
351971bb1a5SLionel Sambuc xcb_block_len += _aux->localeLen * sizeof(xcb_x_print_string8_t);
352971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
353971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(xcb_x_print_string8_t);
354971bb1a5SLionel Sambuc /* insert padding */
355971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
356971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
357971bb1a5SLionel Sambuc if (0 != xcb_pad) {
358971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
359971bb1a5SLionel Sambuc xcb_pad = 0;
360971bb1a5SLionel Sambuc }
361971bb1a5SLionel Sambuc xcb_block_len = 0;
362971bb1a5SLionel Sambuc
363971bb1a5SLionel Sambuc return xcb_buffer_len;
364971bb1a5SLionel Sambuc }
365971bb1a5SLionel Sambuc
366971bb1a5SLionel Sambuc xcb_x_print_print_get_printer_list_cookie_t
xcb_x_print_print_get_printer_list(xcb_connection_t * c,uint32_t printerNameLen,uint32_t localeLen,const xcb_x_print_string8_t * printer_name,const xcb_x_print_string8_t * locale)367971bb1a5SLionel Sambuc xcb_x_print_print_get_printer_list (xcb_connection_t *c /**< */,
368971bb1a5SLionel Sambuc uint32_t printerNameLen /**< */,
369971bb1a5SLionel Sambuc uint32_t localeLen /**< */,
370971bb1a5SLionel Sambuc const xcb_x_print_string8_t *printer_name /**< */,
371971bb1a5SLionel Sambuc const xcb_x_print_string8_t *locale /**< */)
372971bb1a5SLionel Sambuc {
373971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
374971bb1a5SLionel Sambuc /* count */ 6,
375971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
376971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_PRINT_GET_PRINTER_LIST,
377971bb1a5SLionel Sambuc /* isvoid */ 0
378971bb1a5SLionel Sambuc };
379971bb1a5SLionel Sambuc
380971bb1a5SLionel Sambuc struct iovec xcb_parts[8];
381971bb1a5SLionel Sambuc xcb_x_print_print_get_printer_list_cookie_t xcb_ret;
382971bb1a5SLionel Sambuc xcb_x_print_print_get_printer_list_request_t xcb_out;
383971bb1a5SLionel Sambuc
384971bb1a5SLionel Sambuc xcb_out.printerNameLen = printerNameLen;
385971bb1a5SLionel Sambuc xcb_out.localeLen = localeLen;
386971bb1a5SLionel Sambuc
387971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
388971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
389971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
390971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
391971bb1a5SLionel Sambuc /* xcb_x_print_string8_t printer_name */
392971bb1a5SLionel Sambuc xcb_parts[4].iov_base = (char *) printer_name;
393971bb1a5SLionel Sambuc xcb_parts[4].iov_len = printerNameLen * sizeof(xcb_x_print_string8_t);
394971bb1a5SLionel Sambuc xcb_parts[5].iov_base = 0;
395971bb1a5SLionel Sambuc xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
396971bb1a5SLionel Sambuc /* xcb_x_print_string8_t locale */
397971bb1a5SLionel Sambuc xcb_parts[6].iov_base = (char *) locale;
398971bb1a5SLionel Sambuc xcb_parts[6].iov_len = localeLen * sizeof(xcb_x_print_string8_t);
399971bb1a5SLionel Sambuc xcb_parts[7].iov_base = 0;
400971bb1a5SLionel Sambuc xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3;
401971bb1a5SLionel Sambuc
402971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
403971bb1a5SLionel Sambuc return xcb_ret;
404971bb1a5SLionel Sambuc }
405971bb1a5SLionel Sambuc
406971bb1a5SLionel Sambuc xcb_x_print_print_get_printer_list_cookie_t
xcb_x_print_print_get_printer_list_unchecked(xcb_connection_t * c,uint32_t printerNameLen,uint32_t localeLen,const xcb_x_print_string8_t * printer_name,const xcb_x_print_string8_t * locale)407971bb1a5SLionel Sambuc xcb_x_print_print_get_printer_list_unchecked (xcb_connection_t *c /**< */,
408971bb1a5SLionel Sambuc uint32_t printerNameLen /**< */,
409971bb1a5SLionel Sambuc uint32_t localeLen /**< */,
410971bb1a5SLionel Sambuc const xcb_x_print_string8_t *printer_name /**< */,
411971bb1a5SLionel Sambuc const xcb_x_print_string8_t *locale /**< */)
412971bb1a5SLionel Sambuc {
413971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
414971bb1a5SLionel Sambuc /* count */ 6,
415971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
416971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_PRINT_GET_PRINTER_LIST,
417971bb1a5SLionel Sambuc /* isvoid */ 0
418971bb1a5SLionel Sambuc };
419971bb1a5SLionel Sambuc
420971bb1a5SLionel Sambuc struct iovec xcb_parts[8];
421971bb1a5SLionel Sambuc xcb_x_print_print_get_printer_list_cookie_t xcb_ret;
422971bb1a5SLionel Sambuc xcb_x_print_print_get_printer_list_request_t xcb_out;
423971bb1a5SLionel Sambuc
424971bb1a5SLionel Sambuc xcb_out.printerNameLen = printerNameLen;
425971bb1a5SLionel Sambuc xcb_out.localeLen = localeLen;
426971bb1a5SLionel Sambuc
427971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
428971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
429971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
430971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
431971bb1a5SLionel Sambuc /* xcb_x_print_string8_t printer_name */
432971bb1a5SLionel Sambuc xcb_parts[4].iov_base = (char *) printer_name;
433971bb1a5SLionel Sambuc xcb_parts[4].iov_len = printerNameLen * sizeof(xcb_x_print_string8_t);
434971bb1a5SLionel Sambuc xcb_parts[5].iov_base = 0;
435971bb1a5SLionel Sambuc xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
436971bb1a5SLionel Sambuc /* xcb_x_print_string8_t locale */
437971bb1a5SLionel Sambuc xcb_parts[6].iov_base = (char *) locale;
438971bb1a5SLionel Sambuc xcb_parts[6].iov_len = localeLen * sizeof(xcb_x_print_string8_t);
439971bb1a5SLionel Sambuc xcb_parts[7].iov_base = 0;
440971bb1a5SLionel Sambuc xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3;
441971bb1a5SLionel Sambuc
442971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
443971bb1a5SLionel Sambuc return xcb_ret;
444971bb1a5SLionel Sambuc }
445971bb1a5SLionel Sambuc
446971bb1a5SLionel Sambuc int
xcb_x_print_print_get_printer_list_printers_length(const xcb_x_print_print_get_printer_list_reply_t * R)447971bb1a5SLionel Sambuc xcb_x_print_print_get_printer_list_printers_length (const xcb_x_print_print_get_printer_list_reply_t *R /**< */)
448971bb1a5SLionel Sambuc {
449971bb1a5SLionel Sambuc return R->listCount;
450971bb1a5SLionel Sambuc }
451971bb1a5SLionel Sambuc
452971bb1a5SLionel Sambuc xcb_x_print_printer_iterator_t
xcb_x_print_print_get_printer_list_printers_iterator(const xcb_x_print_print_get_printer_list_reply_t * R)453971bb1a5SLionel Sambuc xcb_x_print_print_get_printer_list_printers_iterator (const xcb_x_print_print_get_printer_list_reply_t *R /**< */)
454971bb1a5SLionel Sambuc {
455971bb1a5SLionel Sambuc xcb_x_print_printer_iterator_t i;
456971bb1a5SLionel Sambuc i.data = (xcb_x_print_printer_t *) (R + 1);
457971bb1a5SLionel Sambuc i.rem = R->listCount;
458971bb1a5SLionel Sambuc i.index = (char *) i.data - (char *) R;
459971bb1a5SLionel Sambuc return i;
460971bb1a5SLionel Sambuc }
461971bb1a5SLionel Sambuc
462971bb1a5SLionel Sambuc xcb_x_print_print_get_printer_list_reply_t *
xcb_x_print_print_get_printer_list_reply(xcb_connection_t * c,xcb_x_print_print_get_printer_list_cookie_t cookie,xcb_generic_error_t ** e)463971bb1a5SLionel Sambuc xcb_x_print_print_get_printer_list_reply (xcb_connection_t *c /**< */,
464971bb1a5SLionel Sambuc xcb_x_print_print_get_printer_list_cookie_t cookie /**< */,
465971bb1a5SLionel Sambuc xcb_generic_error_t **e /**< */)
466971bb1a5SLionel Sambuc {
467971bb1a5SLionel Sambuc 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);
468971bb1a5SLionel Sambuc int i;
469971bb1a5SLionel Sambuc xcb_x_print_printer_iterator_t printers_iter = xcb_x_print_print_get_printer_list_printers_iterator(reply);
470971bb1a5SLionel Sambuc int printers_len = xcb_x_print_print_get_printer_list_printers_length(reply);
471971bb1a5SLionel Sambuc xcb_x_print_printer_t *printers_data;
472971bb1a5SLionel Sambuc /* special cases: transform parts of the reply to match XCB data structures */
473971bb1a5SLionel Sambuc for(i=0; i<printers_len; i++) {
474971bb1a5SLionel Sambuc printers_data = printers_iter.data;
475971bb1a5SLionel Sambuc xcb_x_print_printer_unserialize((const void *)printers_data, &printers_data);
476971bb1a5SLionel Sambuc xcb_x_print_printer_next(&printers_iter);
477971bb1a5SLionel Sambuc }
478971bb1a5SLionel Sambuc return reply;
479971bb1a5SLionel Sambuc }
480971bb1a5SLionel Sambuc
481971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_x_print_print_rehash_printer_list_checked(xcb_connection_t * c)482971bb1a5SLionel Sambuc xcb_x_print_print_rehash_printer_list_checked (xcb_connection_t *c /**< */)
483971bb1a5SLionel Sambuc {
484971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
485971bb1a5SLionel Sambuc /* count */ 2,
486971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
487971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_PRINT_REHASH_PRINTER_LIST,
488971bb1a5SLionel Sambuc /* isvoid */ 1
489971bb1a5SLionel Sambuc };
490971bb1a5SLionel Sambuc
491971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
492971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
493971bb1a5SLionel Sambuc xcb_x_print_print_rehash_printer_list_request_t xcb_out;
494971bb1a5SLionel Sambuc
495971bb1a5SLionel Sambuc
496971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
497971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
498971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
499971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
500971bb1a5SLionel Sambuc
501971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
502971bb1a5SLionel Sambuc return xcb_ret;
503971bb1a5SLionel Sambuc }
504971bb1a5SLionel Sambuc
505971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_x_print_print_rehash_printer_list(xcb_connection_t * c)506971bb1a5SLionel Sambuc xcb_x_print_print_rehash_printer_list (xcb_connection_t *c /**< */)
507971bb1a5SLionel Sambuc {
508971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
509971bb1a5SLionel Sambuc /* count */ 2,
510971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
511971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_PRINT_REHASH_PRINTER_LIST,
512971bb1a5SLionel Sambuc /* isvoid */ 1
513971bb1a5SLionel Sambuc };
514971bb1a5SLionel Sambuc
515971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
516971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
517971bb1a5SLionel Sambuc xcb_x_print_print_rehash_printer_list_request_t xcb_out;
518971bb1a5SLionel Sambuc
519971bb1a5SLionel Sambuc
520971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
521971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
522971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
523971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
524971bb1a5SLionel Sambuc
525971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
526971bb1a5SLionel Sambuc return xcb_ret;
527971bb1a5SLionel Sambuc }
528971bb1a5SLionel Sambuc
529971bb1a5SLionel Sambuc int
xcb_x_print_create_context_sizeof(const void * _buffer)530971bb1a5SLionel Sambuc xcb_x_print_create_context_sizeof (const void *_buffer /**< */)
531971bb1a5SLionel Sambuc {
532971bb1a5SLionel Sambuc char *xcb_tmp = (char *)_buffer;
533971bb1a5SLionel Sambuc const xcb_x_print_create_context_request_t *_aux = (xcb_x_print_create_context_request_t *)_buffer;
534971bb1a5SLionel Sambuc unsigned int xcb_buffer_len = 0;
535971bb1a5SLionel Sambuc unsigned int xcb_block_len = 0;
536971bb1a5SLionel Sambuc unsigned int xcb_pad = 0;
537*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
538971bb1a5SLionel Sambuc
539971bb1a5SLionel Sambuc
540971bb1a5SLionel Sambuc xcb_block_len += sizeof(xcb_x_print_create_context_request_t);
541971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
542*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len;
543*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
544971bb1a5SLionel Sambuc /* printerName */
545971bb1a5SLionel Sambuc xcb_block_len += _aux->printerNameLen * sizeof(xcb_x_print_string8_t);
546971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
547971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(xcb_x_print_string8_t);
548971bb1a5SLionel Sambuc /* insert padding */
549971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
550971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
551971bb1a5SLionel Sambuc if (0 != xcb_pad) {
552971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
553971bb1a5SLionel Sambuc xcb_pad = 0;
554971bb1a5SLionel Sambuc }
555971bb1a5SLionel Sambuc xcb_block_len = 0;
556971bb1a5SLionel Sambuc /* locale */
557971bb1a5SLionel Sambuc xcb_block_len += _aux->localeLen * sizeof(xcb_x_print_string8_t);
558971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
559971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(xcb_x_print_string8_t);
560971bb1a5SLionel Sambuc /* insert padding */
561971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
562971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
563971bb1a5SLionel Sambuc if (0 != xcb_pad) {
564971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
565971bb1a5SLionel Sambuc xcb_pad = 0;
566971bb1a5SLionel Sambuc }
567971bb1a5SLionel Sambuc xcb_block_len = 0;
568971bb1a5SLionel Sambuc
569971bb1a5SLionel Sambuc return xcb_buffer_len;
570971bb1a5SLionel Sambuc }
571971bb1a5SLionel Sambuc
572971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_x_print_create_context_checked(xcb_connection_t * c,uint32_t context_id,uint32_t printerNameLen,uint32_t localeLen,const xcb_x_print_string8_t * printerName,const xcb_x_print_string8_t * locale)573971bb1a5SLionel Sambuc xcb_x_print_create_context_checked (xcb_connection_t *c /**< */,
574971bb1a5SLionel Sambuc uint32_t context_id /**< */,
575971bb1a5SLionel Sambuc uint32_t printerNameLen /**< */,
576971bb1a5SLionel Sambuc uint32_t localeLen /**< */,
577971bb1a5SLionel Sambuc const xcb_x_print_string8_t *printerName /**< */,
578971bb1a5SLionel Sambuc const xcb_x_print_string8_t *locale /**< */)
579971bb1a5SLionel Sambuc {
580971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
581971bb1a5SLionel Sambuc /* count */ 6,
582971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
583971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_CREATE_CONTEXT,
584971bb1a5SLionel Sambuc /* isvoid */ 1
585971bb1a5SLionel Sambuc };
586971bb1a5SLionel Sambuc
587971bb1a5SLionel Sambuc struct iovec xcb_parts[8];
588971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
589971bb1a5SLionel Sambuc xcb_x_print_create_context_request_t xcb_out;
590971bb1a5SLionel Sambuc
591971bb1a5SLionel Sambuc xcb_out.context_id = context_id;
592971bb1a5SLionel Sambuc xcb_out.printerNameLen = printerNameLen;
593971bb1a5SLionel Sambuc xcb_out.localeLen = localeLen;
594971bb1a5SLionel Sambuc
595971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
596971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
597971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
598971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
599971bb1a5SLionel Sambuc /* xcb_x_print_string8_t printerName */
600971bb1a5SLionel Sambuc xcb_parts[4].iov_base = (char *) printerName;
601971bb1a5SLionel Sambuc xcb_parts[4].iov_len = printerNameLen * sizeof(xcb_x_print_string8_t);
602971bb1a5SLionel Sambuc xcb_parts[5].iov_base = 0;
603971bb1a5SLionel Sambuc xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
604971bb1a5SLionel Sambuc /* xcb_x_print_string8_t locale */
605971bb1a5SLionel Sambuc xcb_parts[6].iov_base = (char *) locale;
606971bb1a5SLionel Sambuc xcb_parts[6].iov_len = localeLen * sizeof(xcb_x_print_string8_t);
607971bb1a5SLionel Sambuc xcb_parts[7].iov_base = 0;
608971bb1a5SLionel Sambuc xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3;
609971bb1a5SLionel Sambuc
610971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
611971bb1a5SLionel Sambuc return xcb_ret;
612971bb1a5SLionel Sambuc }
613971bb1a5SLionel Sambuc
614971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_x_print_create_context(xcb_connection_t * c,uint32_t context_id,uint32_t printerNameLen,uint32_t localeLen,const xcb_x_print_string8_t * printerName,const xcb_x_print_string8_t * locale)615971bb1a5SLionel Sambuc xcb_x_print_create_context (xcb_connection_t *c /**< */,
616971bb1a5SLionel Sambuc uint32_t context_id /**< */,
617971bb1a5SLionel Sambuc uint32_t printerNameLen /**< */,
618971bb1a5SLionel Sambuc uint32_t localeLen /**< */,
619971bb1a5SLionel Sambuc const xcb_x_print_string8_t *printerName /**< */,
620971bb1a5SLionel Sambuc const xcb_x_print_string8_t *locale /**< */)
621971bb1a5SLionel Sambuc {
622971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
623971bb1a5SLionel Sambuc /* count */ 6,
624971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
625971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_CREATE_CONTEXT,
626971bb1a5SLionel Sambuc /* isvoid */ 1
627971bb1a5SLionel Sambuc };
628971bb1a5SLionel Sambuc
629971bb1a5SLionel Sambuc struct iovec xcb_parts[8];
630971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
631971bb1a5SLionel Sambuc xcb_x_print_create_context_request_t xcb_out;
632971bb1a5SLionel Sambuc
633971bb1a5SLionel Sambuc xcb_out.context_id = context_id;
634971bb1a5SLionel Sambuc xcb_out.printerNameLen = printerNameLen;
635971bb1a5SLionel Sambuc xcb_out.localeLen = localeLen;
636971bb1a5SLionel Sambuc
637971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
638971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
639971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
640971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
641971bb1a5SLionel Sambuc /* xcb_x_print_string8_t printerName */
642971bb1a5SLionel Sambuc xcb_parts[4].iov_base = (char *) printerName;
643971bb1a5SLionel Sambuc xcb_parts[4].iov_len = printerNameLen * sizeof(xcb_x_print_string8_t);
644971bb1a5SLionel Sambuc xcb_parts[5].iov_base = 0;
645971bb1a5SLionel Sambuc xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
646971bb1a5SLionel Sambuc /* xcb_x_print_string8_t locale */
647971bb1a5SLionel Sambuc xcb_parts[6].iov_base = (char *) locale;
648971bb1a5SLionel Sambuc xcb_parts[6].iov_len = localeLen * sizeof(xcb_x_print_string8_t);
649971bb1a5SLionel Sambuc xcb_parts[7].iov_base = 0;
650971bb1a5SLionel Sambuc xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3;
651971bb1a5SLionel Sambuc
652971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
653971bb1a5SLionel Sambuc return xcb_ret;
654971bb1a5SLionel Sambuc }
655971bb1a5SLionel Sambuc
656971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_x_print_print_set_context_checked(xcb_connection_t * c,uint32_t context)657971bb1a5SLionel Sambuc xcb_x_print_print_set_context_checked (xcb_connection_t *c /**< */,
658971bb1a5SLionel Sambuc uint32_t context /**< */)
659971bb1a5SLionel Sambuc {
660971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
661971bb1a5SLionel Sambuc /* count */ 2,
662971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
663971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_PRINT_SET_CONTEXT,
664971bb1a5SLionel Sambuc /* isvoid */ 1
665971bb1a5SLionel Sambuc };
666971bb1a5SLionel Sambuc
667971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
668971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
669971bb1a5SLionel Sambuc xcb_x_print_print_set_context_request_t xcb_out;
670971bb1a5SLionel Sambuc
671971bb1a5SLionel Sambuc xcb_out.context = context;
672971bb1a5SLionel Sambuc
673971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
674971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
675971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
676971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
677971bb1a5SLionel Sambuc
678971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
679971bb1a5SLionel Sambuc return xcb_ret;
680971bb1a5SLionel Sambuc }
681971bb1a5SLionel Sambuc
682971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_x_print_print_set_context(xcb_connection_t * c,uint32_t context)683971bb1a5SLionel Sambuc xcb_x_print_print_set_context (xcb_connection_t *c /**< */,
684971bb1a5SLionel Sambuc uint32_t context /**< */)
685971bb1a5SLionel Sambuc {
686971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
687971bb1a5SLionel Sambuc /* count */ 2,
688971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
689971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_PRINT_SET_CONTEXT,
690971bb1a5SLionel Sambuc /* isvoid */ 1
691971bb1a5SLionel Sambuc };
692971bb1a5SLionel Sambuc
693971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
694971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
695971bb1a5SLionel Sambuc xcb_x_print_print_set_context_request_t xcb_out;
696971bb1a5SLionel Sambuc
697971bb1a5SLionel Sambuc xcb_out.context = context;
698971bb1a5SLionel Sambuc
699971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
700971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
701971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
702971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
703971bb1a5SLionel Sambuc
704971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
705971bb1a5SLionel Sambuc return xcb_ret;
706971bb1a5SLionel Sambuc }
707971bb1a5SLionel Sambuc
708971bb1a5SLionel Sambuc xcb_x_print_print_get_context_cookie_t
xcb_x_print_print_get_context(xcb_connection_t * c)709971bb1a5SLionel Sambuc xcb_x_print_print_get_context (xcb_connection_t *c /**< */)
710971bb1a5SLionel Sambuc {
711971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
712971bb1a5SLionel Sambuc /* count */ 2,
713971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
714971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_PRINT_GET_CONTEXT,
715971bb1a5SLionel Sambuc /* isvoid */ 0
716971bb1a5SLionel Sambuc };
717971bb1a5SLionel Sambuc
718971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
719971bb1a5SLionel Sambuc xcb_x_print_print_get_context_cookie_t xcb_ret;
720971bb1a5SLionel Sambuc xcb_x_print_print_get_context_request_t xcb_out;
721971bb1a5SLionel Sambuc
722971bb1a5SLionel Sambuc
723971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
724971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
725971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
726971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
727971bb1a5SLionel Sambuc
728971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
729971bb1a5SLionel Sambuc return xcb_ret;
730971bb1a5SLionel Sambuc }
731971bb1a5SLionel Sambuc
732971bb1a5SLionel Sambuc xcb_x_print_print_get_context_cookie_t
xcb_x_print_print_get_context_unchecked(xcb_connection_t * c)733971bb1a5SLionel Sambuc xcb_x_print_print_get_context_unchecked (xcb_connection_t *c /**< */)
734971bb1a5SLionel Sambuc {
735971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
736971bb1a5SLionel Sambuc /* count */ 2,
737971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
738971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_PRINT_GET_CONTEXT,
739971bb1a5SLionel Sambuc /* isvoid */ 0
740971bb1a5SLionel Sambuc };
741971bb1a5SLionel Sambuc
742971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
743971bb1a5SLionel Sambuc xcb_x_print_print_get_context_cookie_t xcb_ret;
744971bb1a5SLionel Sambuc xcb_x_print_print_get_context_request_t xcb_out;
745971bb1a5SLionel Sambuc
746971bb1a5SLionel Sambuc
747971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
748971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
749971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
750971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
751971bb1a5SLionel Sambuc
752971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
753971bb1a5SLionel Sambuc return xcb_ret;
754971bb1a5SLionel Sambuc }
755971bb1a5SLionel Sambuc
756971bb1a5SLionel Sambuc xcb_x_print_print_get_context_reply_t *
xcb_x_print_print_get_context_reply(xcb_connection_t * c,xcb_x_print_print_get_context_cookie_t cookie,xcb_generic_error_t ** e)757971bb1a5SLionel Sambuc xcb_x_print_print_get_context_reply (xcb_connection_t *c /**< */,
758971bb1a5SLionel Sambuc xcb_x_print_print_get_context_cookie_t cookie /**< */,
759971bb1a5SLionel Sambuc xcb_generic_error_t **e /**< */)
760971bb1a5SLionel Sambuc {
761971bb1a5SLionel Sambuc return (xcb_x_print_print_get_context_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
762971bb1a5SLionel Sambuc }
763971bb1a5SLionel Sambuc
764971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_x_print_print_destroy_context_checked(xcb_connection_t * c,uint32_t context)765971bb1a5SLionel Sambuc xcb_x_print_print_destroy_context_checked (xcb_connection_t *c /**< */,
766971bb1a5SLionel Sambuc uint32_t context /**< */)
767971bb1a5SLionel Sambuc {
768971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
769971bb1a5SLionel Sambuc /* count */ 2,
770971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
771971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_PRINT_DESTROY_CONTEXT,
772971bb1a5SLionel Sambuc /* isvoid */ 1
773971bb1a5SLionel Sambuc };
774971bb1a5SLionel Sambuc
775971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
776971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
777971bb1a5SLionel Sambuc xcb_x_print_print_destroy_context_request_t xcb_out;
778971bb1a5SLionel Sambuc
779971bb1a5SLionel Sambuc xcb_out.context = context;
780971bb1a5SLionel Sambuc
781971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
782971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
783971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
784971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
785971bb1a5SLionel Sambuc
786971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
787971bb1a5SLionel Sambuc return xcb_ret;
788971bb1a5SLionel Sambuc }
789971bb1a5SLionel Sambuc
790971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_x_print_print_destroy_context(xcb_connection_t * c,uint32_t context)791971bb1a5SLionel Sambuc xcb_x_print_print_destroy_context (xcb_connection_t *c /**< */,
792971bb1a5SLionel Sambuc uint32_t context /**< */)
793971bb1a5SLionel Sambuc {
794971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
795971bb1a5SLionel Sambuc /* count */ 2,
796971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
797971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_PRINT_DESTROY_CONTEXT,
798971bb1a5SLionel Sambuc /* isvoid */ 1
799971bb1a5SLionel Sambuc };
800971bb1a5SLionel Sambuc
801971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
802971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
803971bb1a5SLionel Sambuc xcb_x_print_print_destroy_context_request_t xcb_out;
804971bb1a5SLionel Sambuc
805971bb1a5SLionel Sambuc xcb_out.context = context;
806971bb1a5SLionel Sambuc
807971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
808971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
809971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
810971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
811971bb1a5SLionel Sambuc
812971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
813971bb1a5SLionel Sambuc return xcb_ret;
814971bb1a5SLionel Sambuc }
815971bb1a5SLionel Sambuc
816971bb1a5SLionel Sambuc xcb_x_print_print_get_screen_of_context_cookie_t
xcb_x_print_print_get_screen_of_context(xcb_connection_t * c)817971bb1a5SLionel Sambuc xcb_x_print_print_get_screen_of_context (xcb_connection_t *c /**< */)
818971bb1a5SLionel Sambuc {
819971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
820971bb1a5SLionel Sambuc /* count */ 2,
821971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
822971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_PRINT_GET_SCREEN_OF_CONTEXT,
823971bb1a5SLionel Sambuc /* isvoid */ 0
824971bb1a5SLionel Sambuc };
825971bb1a5SLionel Sambuc
826971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
827971bb1a5SLionel Sambuc xcb_x_print_print_get_screen_of_context_cookie_t xcb_ret;
828971bb1a5SLionel Sambuc xcb_x_print_print_get_screen_of_context_request_t xcb_out;
829971bb1a5SLionel Sambuc
830971bb1a5SLionel Sambuc
831971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
832971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
833971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
834971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
835971bb1a5SLionel Sambuc
836971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
837971bb1a5SLionel Sambuc return xcb_ret;
838971bb1a5SLionel Sambuc }
839971bb1a5SLionel Sambuc
840971bb1a5SLionel Sambuc xcb_x_print_print_get_screen_of_context_cookie_t
xcb_x_print_print_get_screen_of_context_unchecked(xcb_connection_t * c)841971bb1a5SLionel Sambuc xcb_x_print_print_get_screen_of_context_unchecked (xcb_connection_t *c /**< */)
842971bb1a5SLionel Sambuc {
843971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
844971bb1a5SLionel Sambuc /* count */ 2,
845971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
846971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_PRINT_GET_SCREEN_OF_CONTEXT,
847971bb1a5SLionel Sambuc /* isvoid */ 0
848971bb1a5SLionel Sambuc };
849971bb1a5SLionel Sambuc
850971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
851971bb1a5SLionel Sambuc xcb_x_print_print_get_screen_of_context_cookie_t xcb_ret;
852971bb1a5SLionel Sambuc xcb_x_print_print_get_screen_of_context_request_t xcb_out;
853971bb1a5SLionel Sambuc
854971bb1a5SLionel Sambuc
855971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
856971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
857971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
858971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
859971bb1a5SLionel Sambuc
860971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
861971bb1a5SLionel Sambuc return xcb_ret;
862971bb1a5SLionel Sambuc }
863971bb1a5SLionel Sambuc
864971bb1a5SLionel Sambuc xcb_x_print_print_get_screen_of_context_reply_t *
xcb_x_print_print_get_screen_of_context_reply(xcb_connection_t * c,xcb_x_print_print_get_screen_of_context_cookie_t cookie,xcb_generic_error_t ** e)865971bb1a5SLionel Sambuc xcb_x_print_print_get_screen_of_context_reply (xcb_connection_t *c /**< */,
866971bb1a5SLionel Sambuc xcb_x_print_print_get_screen_of_context_cookie_t cookie /**< */,
867971bb1a5SLionel Sambuc xcb_generic_error_t **e /**< */)
868971bb1a5SLionel Sambuc {
869971bb1a5SLionel Sambuc return (xcb_x_print_print_get_screen_of_context_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
870971bb1a5SLionel Sambuc }
871971bb1a5SLionel Sambuc
872971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_x_print_print_start_job_checked(xcb_connection_t * c,uint8_t output_mode)873971bb1a5SLionel Sambuc xcb_x_print_print_start_job_checked (xcb_connection_t *c /**< */,
874971bb1a5SLionel Sambuc uint8_t output_mode /**< */)
875971bb1a5SLionel Sambuc {
876971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
877971bb1a5SLionel Sambuc /* count */ 2,
878971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
879971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_PRINT_START_JOB,
880971bb1a5SLionel Sambuc /* isvoid */ 1
881971bb1a5SLionel Sambuc };
882971bb1a5SLionel Sambuc
883971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
884971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
885971bb1a5SLionel Sambuc xcb_x_print_print_start_job_request_t xcb_out;
886971bb1a5SLionel Sambuc
887971bb1a5SLionel Sambuc xcb_out.output_mode = output_mode;
888971bb1a5SLionel Sambuc
889971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
890971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
891971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
892971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
893971bb1a5SLionel Sambuc
894971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
895971bb1a5SLionel Sambuc return xcb_ret;
896971bb1a5SLionel Sambuc }
897971bb1a5SLionel Sambuc
898971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_x_print_print_start_job(xcb_connection_t * c,uint8_t output_mode)899971bb1a5SLionel Sambuc xcb_x_print_print_start_job (xcb_connection_t *c /**< */,
900971bb1a5SLionel Sambuc uint8_t output_mode /**< */)
901971bb1a5SLionel Sambuc {
902971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
903971bb1a5SLionel Sambuc /* count */ 2,
904971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
905971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_PRINT_START_JOB,
906971bb1a5SLionel Sambuc /* isvoid */ 1
907971bb1a5SLionel Sambuc };
908971bb1a5SLionel Sambuc
909971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
910971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
911971bb1a5SLionel Sambuc xcb_x_print_print_start_job_request_t xcb_out;
912971bb1a5SLionel Sambuc
913971bb1a5SLionel Sambuc xcb_out.output_mode = output_mode;
914971bb1a5SLionel Sambuc
915971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
916971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
917971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
918971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
919971bb1a5SLionel Sambuc
920971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
921971bb1a5SLionel Sambuc return xcb_ret;
922971bb1a5SLionel Sambuc }
923971bb1a5SLionel Sambuc
924971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_x_print_print_end_job_checked(xcb_connection_t * c,uint8_t cancel)925971bb1a5SLionel Sambuc xcb_x_print_print_end_job_checked (xcb_connection_t *c /**< */,
926971bb1a5SLionel Sambuc uint8_t cancel /**< */)
927971bb1a5SLionel Sambuc {
928971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
929971bb1a5SLionel Sambuc /* count */ 2,
930971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
931971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_PRINT_END_JOB,
932971bb1a5SLionel Sambuc /* isvoid */ 1
933971bb1a5SLionel Sambuc };
934971bb1a5SLionel Sambuc
935971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
936971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
937971bb1a5SLionel Sambuc xcb_x_print_print_end_job_request_t xcb_out;
938971bb1a5SLionel Sambuc
939971bb1a5SLionel Sambuc xcb_out.cancel = cancel;
940971bb1a5SLionel Sambuc
941971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
942971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
943971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
944971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
945971bb1a5SLionel Sambuc
946971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
947971bb1a5SLionel Sambuc return xcb_ret;
948971bb1a5SLionel Sambuc }
949971bb1a5SLionel Sambuc
950971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_x_print_print_end_job(xcb_connection_t * c,uint8_t cancel)951971bb1a5SLionel Sambuc xcb_x_print_print_end_job (xcb_connection_t *c /**< */,
952971bb1a5SLionel Sambuc uint8_t cancel /**< */)
953971bb1a5SLionel Sambuc {
954971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
955971bb1a5SLionel Sambuc /* count */ 2,
956971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
957971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_PRINT_END_JOB,
958971bb1a5SLionel Sambuc /* isvoid */ 1
959971bb1a5SLionel Sambuc };
960971bb1a5SLionel Sambuc
961971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
962971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
963971bb1a5SLionel Sambuc xcb_x_print_print_end_job_request_t xcb_out;
964971bb1a5SLionel Sambuc
965971bb1a5SLionel Sambuc xcb_out.cancel = cancel;
966971bb1a5SLionel Sambuc
967971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
968971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
969971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
970971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
971971bb1a5SLionel Sambuc
972971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
973971bb1a5SLionel Sambuc return xcb_ret;
974971bb1a5SLionel Sambuc }
975971bb1a5SLionel Sambuc
976971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_x_print_print_start_doc_checked(xcb_connection_t * c,uint8_t driver_mode)977971bb1a5SLionel Sambuc xcb_x_print_print_start_doc_checked (xcb_connection_t *c /**< */,
978971bb1a5SLionel Sambuc uint8_t driver_mode /**< */)
979971bb1a5SLionel Sambuc {
980971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
981971bb1a5SLionel Sambuc /* count */ 2,
982971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
983971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_PRINT_START_DOC,
984971bb1a5SLionel Sambuc /* isvoid */ 1
985971bb1a5SLionel Sambuc };
986971bb1a5SLionel Sambuc
987971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
988971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
989971bb1a5SLionel Sambuc xcb_x_print_print_start_doc_request_t xcb_out;
990971bb1a5SLionel Sambuc
991971bb1a5SLionel Sambuc xcb_out.driver_mode = driver_mode;
992971bb1a5SLionel Sambuc
993971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
994971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
995971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
996971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
997971bb1a5SLionel Sambuc
998971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
999971bb1a5SLionel Sambuc return xcb_ret;
1000971bb1a5SLionel Sambuc }
1001971bb1a5SLionel Sambuc
1002971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_x_print_print_start_doc(xcb_connection_t * c,uint8_t driver_mode)1003971bb1a5SLionel Sambuc xcb_x_print_print_start_doc (xcb_connection_t *c /**< */,
1004971bb1a5SLionel Sambuc uint8_t driver_mode /**< */)
1005971bb1a5SLionel Sambuc {
1006971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1007971bb1a5SLionel Sambuc /* count */ 2,
1008971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
1009971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_PRINT_START_DOC,
1010971bb1a5SLionel Sambuc /* isvoid */ 1
1011971bb1a5SLionel Sambuc };
1012971bb1a5SLionel Sambuc
1013971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
1014971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
1015971bb1a5SLionel Sambuc xcb_x_print_print_start_doc_request_t xcb_out;
1016971bb1a5SLionel Sambuc
1017971bb1a5SLionel Sambuc xcb_out.driver_mode = driver_mode;
1018971bb1a5SLionel Sambuc
1019971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1020971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1021971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1022971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1023971bb1a5SLionel Sambuc
1024971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1025971bb1a5SLionel Sambuc return xcb_ret;
1026971bb1a5SLionel Sambuc }
1027971bb1a5SLionel Sambuc
1028971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_x_print_print_end_doc_checked(xcb_connection_t * c,uint8_t cancel)1029971bb1a5SLionel Sambuc xcb_x_print_print_end_doc_checked (xcb_connection_t *c /**< */,
1030971bb1a5SLionel Sambuc uint8_t cancel /**< */)
1031971bb1a5SLionel Sambuc {
1032971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1033971bb1a5SLionel Sambuc /* count */ 2,
1034971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
1035971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_PRINT_END_DOC,
1036971bb1a5SLionel Sambuc /* isvoid */ 1
1037971bb1a5SLionel Sambuc };
1038971bb1a5SLionel Sambuc
1039971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
1040971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
1041971bb1a5SLionel Sambuc xcb_x_print_print_end_doc_request_t xcb_out;
1042971bb1a5SLionel Sambuc
1043971bb1a5SLionel Sambuc xcb_out.cancel = cancel;
1044971bb1a5SLionel Sambuc
1045971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1046971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1047971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1048971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1049971bb1a5SLionel Sambuc
1050971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1051971bb1a5SLionel Sambuc return xcb_ret;
1052971bb1a5SLionel Sambuc }
1053971bb1a5SLionel Sambuc
1054971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_x_print_print_end_doc(xcb_connection_t * c,uint8_t cancel)1055971bb1a5SLionel Sambuc xcb_x_print_print_end_doc (xcb_connection_t *c /**< */,
1056971bb1a5SLionel Sambuc uint8_t cancel /**< */)
1057971bb1a5SLionel Sambuc {
1058971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1059971bb1a5SLionel Sambuc /* count */ 2,
1060971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
1061971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_PRINT_END_DOC,
1062971bb1a5SLionel Sambuc /* isvoid */ 1
1063971bb1a5SLionel Sambuc };
1064971bb1a5SLionel Sambuc
1065971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
1066971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
1067971bb1a5SLionel Sambuc xcb_x_print_print_end_doc_request_t xcb_out;
1068971bb1a5SLionel Sambuc
1069971bb1a5SLionel Sambuc xcb_out.cancel = cancel;
1070971bb1a5SLionel Sambuc
1071971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1072971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1073971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1074971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1075971bb1a5SLionel Sambuc
1076971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1077971bb1a5SLionel Sambuc return xcb_ret;
1078971bb1a5SLionel Sambuc }
1079971bb1a5SLionel Sambuc
1080971bb1a5SLionel Sambuc int
xcb_x_print_print_put_document_data_sizeof(const void * _buffer,uint32_t doc_format_len,uint32_t options_len)1081971bb1a5SLionel Sambuc xcb_x_print_print_put_document_data_sizeof (const void *_buffer /**< */,
1082971bb1a5SLionel Sambuc uint32_t doc_format_len /**< */,
1083971bb1a5SLionel Sambuc uint32_t options_len /**< */)
1084971bb1a5SLionel Sambuc {
1085971bb1a5SLionel Sambuc char *xcb_tmp = (char *)_buffer;
1086971bb1a5SLionel Sambuc const xcb_x_print_print_put_document_data_request_t *_aux = (xcb_x_print_print_put_document_data_request_t *)_buffer;
1087971bb1a5SLionel Sambuc unsigned int xcb_buffer_len = 0;
1088971bb1a5SLionel Sambuc unsigned int xcb_block_len = 0;
1089971bb1a5SLionel Sambuc unsigned int xcb_pad = 0;
1090*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
1091971bb1a5SLionel Sambuc
1092971bb1a5SLionel Sambuc
1093971bb1a5SLionel Sambuc xcb_block_len += sizeof(xcb_x_print_print_put_document_data_request_t);
1094971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
1095*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len;
1096*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
1097971bb1a5SLionel Sambuc /* data */
1098971bb1a5SLionel Sambuc xcb_block_len += _aux->len_data * sizeof(uint8_t);
1099971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
1100971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(uint8_t);
1101971bb1a5SLionel Sambuc /* insert padding */
1102971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1103971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
1104971bb1a5SLionel Sambuc if (0 != xcb_pad) {
1105971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
1106971bb1a5SLionel Sambuc xcb_pad = 0;
1107971bb1a5SLionel Sambuc }
1108971bb1a5SLionel Sambuc xcb_block_len = 0;
1109971bb1a5SLionel Sambuc /* doc_format */
1110971bb1a5SLionel Sambuc xcb_block_len += doc_format_len * sizeof(xcb_x_print_string8_t);
1111971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
1112971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(xcb_x_print_string8_t);
1113971bb1a5SLionel Sambuc /* insert padding */
1114971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1115971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
1116971bb1a5SLionel Sambuc if (0 != xcb_pad) {
1117971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
1118971bb1a5SLionel Sambuc xcb_pad = 0;
1119971bb1a5SLionel Sambuc }
1120971bb1a5SLionel Sambuc xcb_block_len = 0;
1121971bb1a5SLionel Sambuc /* options */
1122971bb1a5SLionel Sambuc xcb_block_len += options_len * sizeof(xcb_x_print_string8_t);
1123971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
1124971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(xcb_x_print_string8_t);
1125971bb1a5SLionel Sambuc /* insert padding */
1126971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1127971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
1128971bb1a5SLionel Sambuc if (0 != xcb_pad) {
1129971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
1130971bb1a5SLionel Sambuc xcb_pad = 0;
1131971bb1a5SLionel Sambuc }
1132971bb1a5SLionel Sambuc xcb_block_len = 0;
1133971bb1a5SLionel Sambuc
1134971bb1a5SLionel Sambuc return xcb_buffer_len;
1135971bb1a5SLionel Sambuc }
1136971bb1a5SLionel Sambuc
1137971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_x_print_print_put_document_data_checked(xcb_connection_t * c,xcb_drawable_t drawable,uint32_t len_data,uint16_t len_fmt,uint16_t len_options,const uint8_t * data,uint32_t doc_format_len,const xcb_x_print_string8_t * doc_format,uint32_t options_len,const xcb_x_print_string8_t * options)1138971bb1a5SLionel Sambuc xcb_x_print_print_put_document_data_checked (xcb_connection_t *c /**< */,
1139971bb1a5SLionel Sambuc xcb_drawable_t drawable /**< */,
1140971bb1a5SLionel Sambuc uint32_t len_data /**< */,
1141971bb1a5SLionel Sambuc uint16_t len_fmt /**< */,
1142971bb1a5SLionel Sambuc uint16_t len_options /**< */,
1143971bb1a5SLionel Sambuc const uint8_t *data /**< */,
1144971bb1a5SLionel Sambuc uint32_t doc_format_len /**< */,
1145971bb1a5SLionel Sambuc const xcb_x_print_string8_t *doc_format /**< */,
1146971bb1a5SLionel Sambuc uint32_t options_len /**< */,
1147971bb1a5SLionel Sambuc const xcb_x_print_string8_t *options /**< */)
1148971bb1a5SLionel Sambuc {
1149971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1150971bb1a5SLionel Sambuc /* count */ 8,
1151971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
1152971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_PRINT_PUT_DOCUMENT_DATA,
1153971bb1a5SLionel Sambuc /* isvoid */ 1
1154971bb1a5SLionel Sambuc };
1155971bb1a5SLionel Sambuc
1156971bb1a5SLionel Sambuc struct iovec xcb_parts[10];
1157971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
1158971bb1a5SLionel Sambuc xcb_x_print_print_put_document_data_request_t xcb_out;
1159971bb1a5SLionel Sambuc
1160971bb1a5SLionel Sambuc xcb_out.drawable = drawable;
1161971bb1a5SLionel Sambuc xcb_out.len_data = len_data;
1162971bb1a5SLionel Sambuc xcb_out.len_fmt = len_fmt;
1163971bb1a5SLionel Sambuc xcb_out.len_options = len_options;
1164971bb1a5SLionel Sambuc
1165971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1166971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1167971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1168971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1169971bb1a5SLionel Sambuc /* uint8_t data */
1170971bb1a5SLionel Sambuc xcb_parts[4].iov_base = (char *) data;
1171971bb1a5SLionel Sambuc xcb_parts[4].iov_len = len_data * sizeof(uint8_t);
1172971bb1a5SLionel Sambuc xcb_parts[5].iov_base = 0;
1173971bb1a5SLionel Sambuc xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1174971bb1a5SLionel Sambuc /* xcb_x_print_string8_t doc_format */
1175971bb1a5SLionel Sambuc xcb_parts[6].iov_base = (char *) doc_format;
1176971bb1a5SLionel Sambuc xcb_parts[6].iov_len = doc_format_len * sizeof(xcb_x_print_string8_t);
1177971bb1a5SLionel Sambuc xcb_parts[7].iov_base = 0;
1178971bb1a5SLionel Sambuc xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3;
1179971bb1a5SLionel Sambuc /* xcb_x_print_string8_t options */
1180971bb1a5SLionel Sambuc xcb_parts[8].iov_base = (char *) options;
1181971bb1a5SLionel Sambuc xcb_parts[8].iov_len = options_len * sizeof(xcb_x_print_string8_t);
1182971bb1a5SLionel Sambuc xcb_parts[9].iov_base = 0;
1183971bb1a5SLionel Sambuc xcb_parts[9].iov_len = -xcb_parts[8].iov_len & 3;
1184971bb1a5SLionel Sambuc
1185971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1186971bb1a5SLionel Sambuc return xcb_ret;
1187971bb1a5SLionel Sambuc }
1188971bb1a5SLionel Sambuc
1189971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_x_print_print_put_document_data(xcb_connection_t * c,xcb_drawable_t drawable,uint32_t len_data,uint16_t len_fmt,uint16_t len_options,const uint8_t * data,uint32_t doc_format_len,const xcb_x_print_string8_t * doc_format,uint32_t options_len,const xcb_x_print_string8_t * options)1190971bb1a5SLionel Sambuc xcb_x_print_print_put_document_data (xcb_connection_t *c /**< */,
1191971bb1a5SLionel Sambuc xcb_drawable_t drawable /**< */,
1192971bb1a5SLionel Sambuc uint32_t len_data /**< */,
1193971bb1a5SLionel Sambuc uint16_t len_fmt /**< */,
1194971bb1a5SLionel Sambuc uint16_t len_options /**< */,
1195971bb1a5SLionel Sambuc const uint8_t *data /**< */,
1196971bb1a5SLionel Sambuc uint32_t doc_format_len /**< */,
1197971bb1a5SLionel Sambuc const xcb_x_print_string8_t *doc_format /**< */,
1198971bb1a5SLionel Sambuc uint32_t options_len /**< */,
1199971bb1a5SLionel Sambuc const xcb_x_print_string8_t *options /**< */)
1200971bb1a5SLionel Sambuc {
1201971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1202971bb1a5SLionel Sambuc /* count */ 8,
1203971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
1204971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_PRINT_PUT_DOCUMENT_DATA,
1205971bb1a5SLionel Sambuc /* isvoid */ 1
1206971bb1a5SLionel Sambuc };
1207971bb1a5SLionel Sambuc
1208971bb1a5SLionel Sambuc struct iovec xcb_parts[10];
1209971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
1210971bb1a5SLionel Sambuc xcb_x_print_print_put_document_data_request_t xcb_out;
1211971bb1a5SLionel Sambuc
1212971bb1a5SLionel Sambuc xcb_out.drawable = drawable;
1213971bb1a5SLionel Sambuc xcb_out.len_data = len_data;
1214971bb1a5SLionel Sambuc xcb_out.len_fmt = len_fmt;
1215971bb1a5SLionel Sambuc xcb_out.len_options = len_options;
1216971bb1a5SLionel Sambuc
1217971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1218971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1219971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1220971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1221971bb1a5SLionel Sambuc /* uint8_t data */
1222971bb1a5SLionel Sambuc xcb_parts[4].iov_base = (char *) data;
1223971bb1a5SLionel Sambuc xcb_parts[4].iov_len = len_data * sizeof(uint8_t);
1224971bb1a5SLionel Sambuc xcb_parts[5].iov_base = 0;
1225971bb1a5SLionel Sambuc xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1226971bb1a5SLionel Sambuc /* xcb_x_print_string8_t doc_format */
1227971bb1a5SLionel Sambuc xcb_parts[6].iov_base = (char *) doc_format;
1228971bb1a5SLionel Sambuc xcb_parts[6].iov_len = doc_format_len * sizeof(xcb_x_print_string8_t);
1229971bb1a5SLionel Sambuc xcb_parts[7].iov_base = 0;
1230971bb1a5SLionel Sambuc xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3;
1231971bb1a5SLionel Sambuc /* xcb_x_print_string8_t options */
1232971bb1a5SLionel Sambuc xcb_parts[8].iov_base = (char *) options;
1233971bb1a5SLionel Sambuc xcb_parts[8].iov_len = options_len * sizeof(xcb_x_print_string8_t);
1234971bb1a5SLionel Sambuc xcb_parts[9].iov_base = 0;
1235971bb1a5SLionel Sambuc xcb_parts[9].iov_len = -xcb_parts[8].iov_len & 3;
1236971bb1a5SLionel Sambuc
1237971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1238971bb1a5SLionel Sambuc return xcb_ret;
1239971bb1a5SLionel Sambuc }
1240971bb1a5SLionel Sambuc
1241971bb1a5SLionel Sambuc int
xcb_x_print_print_get_document_data_sizeof(const void * _buffer)1242971bb1a5SLionel Sambuc xcb_x_print_print_get_document_data_sizeof (const void *_buffer /**< */)
1243971bb1a5SLionel Sambuc {
1244971bb1a5SLionel Sambuc char *xcb_tmp = (char *)_buffer;
1245971bb1a5SLionel Sambuc const xcb_x_print_print_get_document_data_reply_t *_aux = (xcb_x_print_print_get_document_data_reply_t *)_buffer;
1246971bb1a5SLionel Sambuc unsigned int xcb_buffer_len = 0;
1247971bb1a5SLionel Sambuc unsigned int xcb_block_len = 0;
1248971bb1a5SLionel Sambuc unsigned int xcb_pad = 0;
1249*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
1250971bb1a5SLionel Sambuc
1251971bb1a5SLionel Sambuc
1252971bb1a5SLionel Sambuc xcb_block_len += sizeof(xcb_x_print_print_get_document_data_reply_t);
1253971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
1254*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len;
1255*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
1256971bb1a5SLionel Sambuc /* data */
1257971bb1a5SLionel Sambuc xcb_block_len += _aux->dataLen * sizeof(uint8_t);
1258971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
1259971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(uint8_t);
1260971bb1a5SLionel Sambuc /* insert padding */
1261971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1262971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
1263971bb1a5SLionel Sambuc if (0 != xcb_pad) {
1264971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
1265971bb1a5SLionel Sambuc xcb_pad = 0;
1266971bb1a5SLionel Sambuc }
1267971bb1a5SLionel Sambuc xcb_block_len = 0;
1268971bb1a5SLionel Sambuc
1269971bb1a5SLionel Sambuc return xcb_buffer_len;
1270971bb1a5SLionel Sambuc }
1271971bb1a5SLionel Sambuc
1272971bb1a5SLionel Sambuc xcb_x_print_print_get_document_data_cookie_t
xcb_x_print_print_get_document_data(xcb_connection_t * c,xcb_x_print_pcontext_t context,uint32_t max_bytes)1273971bb1a5SLionel Sambuc xcb_x_print_print_get_document_data (xcb_connection_t *c /**< */,
1274971bb1a5SLionel Sambuc xcb_x_print_pcontext_t context /**< */,
1275971bb1a5SLionel Sambuc uint32_t max_bytes /**< */)
1276971bb1a5SLionel Sambuc {
1277971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1278971bb1a5SLionel Sambuc /* count */ 2,
1279971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
1280971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_PRINT_GET_DOCUMENT_DATA,
1281971bb1a5SLionel Sambuc /* isvoid */ 0
1282971bb1a5SLionel Sambuc };
1283971bb1a5SLionel Sambuc
1284971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
1285971bb1a5SLionel Sambuc xcb_x_print_print_get_document_data_cookie_t xcb_ret;
1286971bb1a5SLionel Sambuc xcb_x_print_print_get_document_data_request_t xcb_out;
1287971bb1a5SLionel Sambuc
1288971bb1a5SLionel Sambuc xcb_out.context = context;
1289971bb1a5SLionel Sambuc xcb_out.max_bytes = max_bytes;
1290971bb1a5SLionel Sambuc
1291971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1292971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1293971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1294971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1295971bb1a5SLionel Sambuc
1296971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1297971bb1a5SLionel Sambuc return xcb_ret;
1298971bb1a5SLionel Sambuc }
1299971bb1a5SLionel Sambuc
1300971bb1a5SLionel Sambuc xcb_x_print_print_get_document_data_cookie_t
xcb_x_print_print_get_document_data_unchecked(xcb_connection_t * c,xcb_x_print_pcontext_t context,uint32_t max_bytes)1301971bb1a5SLionel Sambuc xcb_x_print_print_get_document_data_unchecked (xcb_connection_t *c /**< */,
1302971bb1a5SLionel Sambuc xcb_x_print_pcontext_t context /**< */,
1303971bb1a5SLionel Sambuc uint32_t max_bytes /**< */)
1304971bb1a5SLionel Sambuc {
1305971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1306971bb1a5SLionel Sambuc /* count */ 2,
1307971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
1308971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_PRINT_GET_DOCUMENT_DATA,
1309971bb1a5SLionel Sambuc /* isvoid */ 0
1310971bb1a5SLionel Sambuc };
1311971bb1a5SLionel Sambuc
1312971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
1313971bb1a5SLionel Sambuc xcb_x_print_print_get_document_data_cookie_t xcb_ret;
1314971bb1a5SLionel Sambuc xcb_x_print_print_get_document_data_request_t xcb_out;
1315971bb1a5SLionel Sambuc
1316971bb1a5SLionel Sambuc xcb_out.context = context;
1317971bb1a5SLionel Sambuc xcb_out.max_bytes = max_bytes;
1318971bb1a5SLionel Sambuc
1319971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1320971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1321971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1322971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1323971bb1a5SLionel Sambuc
1324971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1325971bb1a5SLionel Sambuc return xcb_ret;
1326971bb1a5SLionel Sambuc }
1327971bb1a5SLionel Sambuc
1328971bb1a5SLionel Sambuc uint8_t *
xcb_x_print_print_get_document_data_data(const xcb_x_print_print_get_document_data_reply_t * R)1329971bb1a5SLionel Sambuc xcb_x_print_print_get_document_data_data (const xcb_x_print_print_get_document_data_reply_t *R /**< */)
1330971bb1a5SLionel Sambuc {
1331971bb1a5SLionel Sambuc return (uint8_t *) (R + 1);
1332971bb1a5SLionel Sambuc }
1333971bb1a5SLionel Sambuc
1334971bb1a5SLionel Sambuc int
xcb_x_print_print_get_document_data_data_length(const xcb_x_print_print_get_document_data_reply_t * R)1335971bb1a5SLionel Sambuc xcb_x_print_print_get_document_data_data_length (const xcb_x_print_print_get_document_data_reply_t *R /**< */)
1336971bb1a5SLionel Sambuc {
1337971bb1a5SLionel Sambuc return R->dataLen;
1338971bb1a5SLionel Sambuc }
1339971bb1a5SLionel Sambuc
1340971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_x_print_print_get_document_data_data_end(const xcb_x_print_print_get_document_data_reply_t * R)1341971bb1a5SLionel Sambuc xcb_x_print_print_get_document_data_data_end (const xcb_x_print_print_get_document_data_reply_t *R /**< */)
1342971bb1a5SLionel Sambuc {
1343971bb1a5SLionel Sambuc xcb_generic_iterator_t i;
1344971bb1a5SLionel Sambuc i.data = ((uint8_t *) (R + 1)) + (R->dataLen);
1345971bb1a5SLionel Sambuc i.rem = 0;
1346971bb1a5SLionel Sambuc i.index = (char *) i.data - (char *) R;
1347971bb1a5SLionel Sambuc return i;
1348971bb1a5SLionel Sambuc }
1349971bb1a5SLionel Sambuc
1350971bb1a5SLionel Sambuc xcb_x_print_print_get_document_data_reply_t *
xcb_x_print_print_get_document_data_reply(xcb_connection_t * c,xcb_x_print_print_get_document_data_cookie_t cookie,xcb_generic_error_t ** e)1351971bb1a5SLionel Sambuc xcb_x_print_print_get_document_data_reply (xcb_connection_t *c /**< */,
1352971bb1a5SLionel Sambuc xcb_x_print_print_get_document_data_cookie_t cookie /**< */,
1353971bb1a5SLionel Sambuc xcb_generic_error_t **e /**< */)
1354971bb1a5SLionel Sambuc {
1355971bb1a5SLionel Sambuc return (xcb_x_print_print_get_document_data_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1356971bb1a5SLionel Sambuc }
1357971bb1a5SLionel Sambuc
1358971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_x_print_print_start_page_checked(xcb_connection_t * c,xcb_window_t window)1359971bb1a5SLionel Sambuc xcb_x_print_print_start_page_checked (xcb_connection_t *c /**< */,
1360971bb1a5SLionel Sambuc xcb_window_t window /**< */)
1361971bb1a5SLionel Sambuc {
1362971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1363971bb1a5SLionel Sambuc /* count */ 2,
1364971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
1365971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_PRINT_START_PAGE,
1366971bb1a5SLionel Sambuc /* isvoid */ 1
1367971bb1a5SLionel Sambuc };
1368971bb1a5SLionel Sambuc
1369971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
1370971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
1371971bb1a5SLionel Sambuc xcb_x_print_print_start_page_request_t xcb_out;
1372971bb1a5SLionel Sambuc
1373971bb1a5SLionel Sambuc xcb_out.window = window;
1374971bb1a5SLionel Sambuc
1375971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1376971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1377971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1378971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1379971bb1a5SLionel Sambuc
1380971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1381971bb1a5SLionel Sambuc return xcb_ret;
1382971bb1a5SLionel Sambuc }
1383971bb1a5SLionel Sambuc
1384971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_x_print_print_start_page(xcb_connection_t * c,xcb_window_t window)1385971bb1a5SLionel Sambuc xcb_x_print_print_start_page (xcb_connection_t *c /**< */,
1386971bb1a5SLionel Sambuc xcb_window_t window /**< */)
1387971bb1a5SLionel Sambuc {
1388971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1389971bb1a5SLionel Sambuc /* count */ 2,
1390971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
1391971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_PRINT_START_PAGE,
1392971bb1a5SLionel Sambuc /* isvoid */ 1
1393971bb1a5SLionel Sambuc };
1394971bb1a5SLionel Sambuc
1395971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
1396971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
1397971bb1a5SLionel Sambuc xcb_x_print_print_start_page_request_t xcb_out;
1398971bb1a5SLionel Sambuc
1399971bb1a5SLionel Sambuc xcb_out.window = window;
1400971bb1a5SLionel Sambuc
1401971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1402971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1403971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1404971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1405971bb1a5SLionel Sambuc
1406971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1407971bb1a5SLionel Sambuc return xcb_ret;
1408971bb1a5SLionel Sambuc }
1409971bb1a5SLionel Sambuc
1410971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_x_print_print_end_page_checked(xcb_connection_t * c,uint8_t cancel)1411971bb1a5SLionel Sambuc xcb_x_print_print_end_page_checked (xcb_connection_t *c /**< */,
1412971bb1a5SLionel Sambuc uint8_t cancel /**< */)
1413971bb1a5SLionel Sambuc {
1414971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1415971bb1a5SLionel Sambuc /* count */ 2,
1416971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
1417971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_PRINT_END_PAGE,
1418971bb1a5SLionel Sambuc /* isvoid */ 1
1419971bb1a5SLionel Sambuc };
1420971bb1a5SLionel Sambuc
1421971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
1422971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
1423971bb1a5SLionel Sambuc xcb_x_print_print_end_page_request_t xcb_out;
1424971bb1a5SLionel Sambuc
1425971bb1a5SLionel Sambuc xcb_out.cancel = cancel;
1426971bb1a5SLionel Sambuc memset(xcb_out.pad0, 0, 3);
1427971bb1a5SLionel Sambuc
1428971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1429971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1430971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1431971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1432971bb1a5SLionel Sambuc
1433971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1434971bb1a5SLionel Sambuc return xcb_ret;
1435971bb1a5SLionel Sambuc }
1436971bb1a5SLionel Sambuc
1437971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_x_print_print_end_page(xcb_connection_t * c,uint8_t cancel)1438971bb1a5SLionel Sambuc xcb_x_print_print_end_page (xcb_connection_t *c /**< */,
1439971bb1a5SLionel Sambuc uint8_t cancel /**< */)
1440971bb1a5SLionel Sambuc {
1441971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1442971bb1a5SLionel Sambuc /* count */ 2,
1443971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
1444971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_PRINT_END_PAGE,
1445971bb1a5SLionel Sambuc /* isvoid */ 1
1446971bb1a5SLionel Sambuc };
1447971bb1a5SLionel Sambuc
1448971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
1449971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
1450971bb1a5SLionel Sambuc xcb_x_print_print_end_page_request_t xcb_out;
1451971bb1a5SLionel Sambuc
1452971bb1a5SLionel Sambuc xcb_out.cancel = cancel;
1453971bb1a5SLionel Sambuc memset(xcb_out.pad0, 0, 3);
1454971bb1a5SLionel Sambuc
1455971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1456971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1457971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1458971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1459971bb1a5SLionel Sambuc
1460971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1461971bb1a5SLionel Sambuc return xcb_ret;
1462971bb1a5SLionel Sambuc }
1463971bb1a5SLionel Sambuc
1464971bb1a5SLionel Sambuc int
xcb_x_print_print_select_input_sizeof(const void * _buffer)1465971bb1a5SLionel Sambuc xcb_x_print_print_select_input_sizeof (const void *_buffer /**< */)
1466971bb1a5SLionel Sambuc {
1467971bb1a5SLionel Sambuc char *xcb_tmp = (char *)_buffer;
1468971bb1a5SLionel Sambuc const xcb_x_print_print_select_input_request_t *_aux = (xcb_x_print_print_select_input_request_t *)_buffer;
1469971bb1a5SLionel Sambuc unsigned int xcb_buffer_len = 0;
1470971bb1a5SLionel Sambuc unsigned int xcb_block_len = 0;
1471971bb1a5SLionel Sambuc unsigned int xcb_pad = 0;
1472*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
1473971bb1a5SLionel Sambuc
1474971bb1a5SLionel Sambuc
1475971bb1a5SLionel Sambuc xcb_block_len += sizeof(xcb_x_print_print_select_input_request_t);
1476971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
1477*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len;
1478*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
1479971bb1a5SLionel Sambuc /* event_list */
1480971bb1a5SLionel Sambuc xcb_block_len += xcb_popcount(_aux->event_mask) * sizeof(uint32_t);
1481971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
1482971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(uint32_t);
1483971bb1a5SLionel Sambuc /* insert padding */
1484971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1485971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
1486971bb1a5SLionel Sambuc if (0 != xcb_pad) {
1487971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
1488971bb1a5SLionel Sambuc xcb_pad = 0;
1489971bb1a5SLionel Sambuc }
1490971bb1a5SLionel Sambuc xcb_block_len = 0;
1491971bb1a5SLionel Sambuc
1492971bb1a5SLionel Sambuc return xcb_buffer_len;
1493971bb1a5SLionel Sambuc }
1494971bb1a5SLionel Sambuc
1495971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_x_print_print_select_input_checked(xcb_connection_t * c,xcb_x_print_pcontext_t context,uint32_t event_mask,const uint32_t * event_list)1496971bb1a5SLionel Sambuc xcb_x_print_print_select_input_checked (xcb_connection_t *c /**< */,
1497971bb1a5SLionel Sambuc xcb_x_print_pcontext_t context /**< */,
1498971bb1a5SLionel Sambuc uint32_t event_mask /**< */,
1499971bb1a5SLionel Sambuc const uint32_t *event_list /**< */)
1500971bb1a5SLionel Sambuc {
1501971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1502971bb1a5SLionel Sambuc /* count */ 4,
1503971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
1504971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_PRINT_SELECT_INPUT,
1505971bb1a5SLionel Sambuc /* isvoid */ 1
1506971bb1a5SLionel Sambuc };
1507971bb1a5SLionel Sambuc
1508971bb1a5SLionel Sambuc struct iovec xcb_parts[6];
1509971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
1510971bb1a5SLionel Sambuc xcb_x_print_print_select_input_request_t xcb_out;
1511971bb1a5SLionel Sambuc
1512971bb1a5SLionel Sambuc xcb_out.context = context;
1513971bb1a5SLionel Sambuc xcb_out.event_mask = event_mask;
1514971bb1a5SLionel Sambuc
1515971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1516971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1517971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1518971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1519971bb1a5SLionel Sambuc /* uint32_t event_list */
1520971bb1a5SLionel Sambuc xcb_parts[4].iov_base = (char *) event_list;
1521971bb1a5SLionel Sambuc xcb_parts[4].iov_len = xcb_popcount(event_mask) * sizeof(uint32_t);
1522971bb1a5SLionel Sambuc xcb_parts[5].iov_base = 0;
1523971bb1a5SLionel Sambuc xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1524971bb1a5SLionel Sambuc
1525971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1526971bb1a5SLionel Sambuc return xcb_ret;
1527971bb1a5SLionel Sambuc }
1528971bb1a5SLionel Sambuc
1529971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_x_print_print_select_input(xcb_connection_t * c,xcb_x_print_pcontext_t context,uint32_t event_mask,const uint32_t * event_list)1530971bb1a5SLionel Sambuc xcb_x_print_print_select_input (xcb_connection_t *c /**< */,
1531971bb1a5SLionel Sambuc xcb_x_print_pcontext_t context /**< */,
1532971bb1a5SLionel Sambuc uint32_t event_mask /**< */,
1533971bb1a5SLionel Sambuc const uint32_t *event_list /**< */)
1534971bb1a5SLionel Sambuc {
1535971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1536971bb1a5SLionel Sambuc /* count */ 4,
1537971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
1538971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_PRINT_SELECT_INPUT,
1539971bb1a5SLionel Sambuc /* isvoid */ 1
1540971bb1a5SLionel Sambuc };
1541971bb1a5SLionel Sambuc
1542971bb1a5SLionel Sambuc struct iovec xcb_parts[6];
1543971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
1544971bb1a5SLionel Sambuc xcb_x_print_print_select_input_request_t xcb_out;
1545971bb1a5SLionel Sambuc
1546971bb1a5SLionel Sambuc xcb_out.context = context;
1547971bb1a5SLionel Sambuc xcb_out.event_mask = event_mask;
1548971bb1a5SLionel Sambuc
1549971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1550971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1551971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1552971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1553971bb1a5SLionel Sambuc /* uint32_t event_list */
1554971bb1a5SLionel Sambuc xcb_parts[4].iov_base = (char *) event_list;
1555971bb1a5SLionel Sambuc xcb_parts[4].iov_len = xcb_popcount(event_mask) * sizeof(uint32_t);
1556971bb1a5SLionel Sambuc xcb_parts[5].iov_base = 0;
1557971bb1a5SLionel Sambuc xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1558971bb1a5SLionel Sambuc
1559971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1560971bb1a5SLionel Sambuc return xcb_ret;
1561971bb1a5SLionel Sambuc }
1562971bb1a5SLionel Sambuc
1563971bb1a5SLionel Sambuc int
xcb_x_print_print_input_selected_serialize(void ** _buffer,const xcb_x_print_print_input_selected_reply_t * _aux,const uint32_t * event_list,const uint32_t * all_events_list)1564971bb1a5SLionel Sambuc xcb_x_print_print_input_selected_serialize (void **_buffer /**< */,
1565971bb1a5SLionel Sambuc const xcb_x_print_print_input_selected_reply_t *_aux /**< */,
1566971bb1a5SLionel Sambuc const uint32_t *event_list /**< */,
1567971bb1a5SLionel Sambuc const uint32_t *all_events_list /**< */)
1568971bb1a5SLionel Sambuc {
1569971bb1a5SLionel Sambuc char *xcb_out = *_buffer;
1570971bb1a5SLionel Sambuc unsigned int xcb_buffer_len = 0;
1571*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
1572971bb1a5SLionel Sambuc
1573971bb1a5SLionel Sambuc unsigned int xcb_pad = 0;
1574971bb1a5SLionel Sambuc char xcb_pad0[3] = {0, 0, 0};
1575971bb1a5SLionel Sambuc struct iovec xcb_parts[6];
1576971bb1a5SLionel Sambuc unsigned int xcb_parts_idx = 0;
1577971bb1a5SLionel Sambuc unsigned int xcb_block_len = 0;
1578971bb1a5SLionel Sambuc unsigned int i;
1579971bb1a5SLionel Sambuc char *xcb_tmp;
1580971bb1a5SLionel Sambuc
1581971bb1a5SLionel Sambuc /* xcb_x_print_print_input_selected_reply_t.pad0 */
1582971bb1a5SLionel Sambuc xcb_parts[xcb_parts_idx].iov_base = (char *) &xcb_pad;
1583971bb1a5SLionel Sambuc xcb_block_len += sizeof(uint8_t);
1584971bb1a5SLionel Sambuc xcb_parts[xcb_parts_idx].iov_len = sizeof(uint8_t);
1585971bb1a5SLionel Sambuc xcb_parts_idx++;
1586971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(uint8_t);
1587971bb1a5SLionel Sambuc /* xcb_x_print_print_input_selected_reply_t.event_mask */
1588971bb1a5SLionel Sambuc xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->event_mask;
1589971bb1a5SLionel Sambuc xcb_block_len += sizeof(uint32_t);
1590971bb1a5SLionel Sambuc xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t);
1591971bb1a5SLionel Sambuc xcb_parts_idx++;
1592971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(uint32_t);
1593971bb1a5SLionel Sambuc /* event_list */
1594971bb1a5SLionel Sambuc xcb_parts[xcb_parts_idx].iov_base = (char *) event_list;
1595971bb1a5SLionel Sambuc xcb_block_len += xcb_popcount(_aux->event_mask) * sizeof(uint32_t);
1596971bb1a5SLionel Sambuc xcb_parts[xcb_parts_idx].iov_len = xcb_popcount(_aux->event_mask) * sizeof(uint32_t);
1597971bb1a5SLionel Sambuc xcb_parts_idx++;
1598971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(uint32_t);
1599971bb1a5SLionel Sambuc /* xcb_x_print_print_input_selected_reply_t.all_events_mask */
1600971bb1a5SLionel Sambuc xcb_parts[xcb_parts_idx].iov_base = (char *) &_aux->all_events_mask;
1601971bb1a5SLionel Sambuc xcb_block_len += sizeof(uint32_t);
1602971bb1a5SLionel Sambuc xcb_parts[xcb_parts_idx].iov_len = sizeof(uint32_t);
1603971bb1a5SLionel Sambuc xcb_parts_idx++;
1604971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(uint32_t);
1605971bb1a5SLionel Sambuc /* all_events_list */
1606971bb1a5SLionel Sambuc xcb_parts[xcb_parts_idx].iov_base = (char *) all_events_list;
1607971bb1a5SLionel Sambuc xcb_block_len += xcb_popcount(_aux->all_events_mask) * sizeof(uint32_t);
1608971bb1a5SLionel Sambuc xcb_parts[xcb_parts_idx].iov_len = xcb_popcount(_aux->all_events_mask) * sizeof(uint32_t);
1609971bb1a5SLionel Sambuc xcb_parts_idx++;
1610971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(uint32_t);
1611971bb1a5SLionel Sambuc /* insert padding */
1612971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1613971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
1614971bb1a5SLionel Sambuc if (0 != xcb_pad) {
1615971bb1a5SLionel Sambuc xcb_parts[xcb_parts_idx].iov_base = xcb_pad0;
1616971bb1a5SLionel Sambuc xcb_parts[xcb_parts_idx].iov_len = xcb_pad;
1617971bb1a5SLionel Sambuc xcb_parts_idx++;
1618971bb1a5SLionel Sambuc xcb_pad = 0;
1619971bb1a5SLionel Sambuc }
1620971bb1a5SLionel Sambuc xcb_block_len = 0;
1621971bb1a5SLionel Sambuc
1622971bb1a5SLionel Sambuc if (NULL == xcb_out) {
1623971bb1a5SLionel Sambuc /* allocate memory */
1624971bb1a5SLionel Sambuc xcb_out = malloc(xcb_buffer_len);
1625971bb1a5SLionel Sambuc *_buffer = xcb_out;
1626971bb1a5SLionel Sambuc }
1627971bb1a5SLionel Sambuc
1628971bb1a5SLionel Sambuc xcb_tmp = xcb_out;
1629971bb1a5SLionel Sambuc for(i=0; i<xcb_parts_idx; i++) {
1630971bb1a5SLionel Sambuc if (0 != xcb_parts[i].iov_base && 0 != xcb_parts[i].iov_len)
1631971bb1a5SLionel Sambuc memcpy(xcb_tmp, xcb_parts[i].iov_base, xcb_parts[i].iov_len);
1632971bb1a5SLionel Sambuc if (0 != xcb_parts[i].iov_len)
1633971bb1a5SLionel Sambuc xcb_tmp += xcb_parts[i].iov_len;
1634971bb1a5SLionel Sambuc }
1635971bb1a5SLionel Sambuc
1636971bb1a5SLionel Sambuc return xcb_buffer_len;
1637971bb1a5SLionel Sambuc }
1638971bb1a5SLionel Sambuc
1639971bb1a5SLionel Sambuc int
xcb_x_print_print_input_selected_unserialize(const void * _buffer,xcb_x_print_print_input_selected_reply_t ** _aux)1640971bb1a5SLionel Sambuc xcb_x_print_print_input_selected_unserialize (const void *_buffer /**< */,
1641971bb1a5SLionel Sambuc xcb_x_print_print_input_selected_reply_t **_aux /**< */)
1642971bb1a5SLionel Sambuc {
1643971bb1a5SLionel Sambuc char *xcb_tmp = (char *)_buffer;
1644971bb1a5SLionel Sambuc xcb_x_print_print_input_selected_reply_t xcb_out;
1645971bb1a5SLionel Sambuc unsigned int xcb_buffer_len = 0;
1646971bb1a5SLionel Sambuc unsigned int xcb_block_len = 0;
1647971bb1a5SLionel Sambuc unsigned int xcb_pad = 0;
1648*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
1649971bb1a5SLionel Sambuc
1650971bb1a5SLionel Sambuc uint32_t *event_list;
1651971bb1a5SLionel Sambuc int event_list_len;
1652971bb1a5SLionel Sambuc uint32_t *all_events_list;
1653971bb1a5SLionel Sambuc int all_events_list_len;
1654971bb1a5SLionel Sambuc
1655971bb1a5SLionel Sambuc /* xcb_x_print_print_input_selected_reply_t.response_type */
1656971bb1a5SLionel Sambuc xcb_out.response_type = *(uint8_t *)xcb_tmp;
1657971bb1a5SLionel Sambuc xcb_block_len += sizeof(uint8_t);
1658971bb1a5SLionel Sambuc xcb_tmp += sizeof(uint8_t);
1659971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(uint8_t);
1660971bb1a5SLionel Sambuc /* xcb_x_print_print_input_selected_reply_t.pad0 */
1661971bb1a5SLionel Sambuc xcb_out.pad0 = *(uint8_t *)xcb_tmp;
1662971bb1a5SLionel Sambuc xcb_block_len += sizeof(uint8_t);
1663971bb1a5SLionel Sambuc xcb_tmp += sizeof(uint8_t);
1664971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(uint8_t);
1665971bb1a5SLionel Sambuc /* xcb_x_print_print_input_selected_reply_t.sequence */
1666971bb1a5SLionel Sambuc xcb_out.sequence = *(uint16_t *)xcb_tmp;
1667971bb1a5SLionel Sambuc xcb_block_len += sizeof(uint16_t);
1668971bb1a5SLionel Sambuc xcb_tmp += sizeof(uint16_t);
1669971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(uint16_t);
1670971bb1a5SLionel Sambuc /* xcb_x_print_print_input_selected_reply_t.length */
1671971bb1a5SLionel Sambuc xcb_out.length = *(uint32_t *)xcb_tmp;
1672971bb1a5SLionel Sambuc xcb_block_len += sizeof(uint32_t);
1673971bb1a5SLionel Sambuc xcb_tmp += sizeof(uint32_t);
1674971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(uint32_t);
1675971bb1a5SLionel Sambuc /* xcb_x_print_print_input_selected_reply_t.event_mask */
1676971bb1a5SLionel Sambuc xcb_out.event_mask = *(uint32_t *)xcb_tmp;
1677971bb1a5SLionel Sambuc xcb_block_len += sizeof(uint32_t);
1678971bb1a5SLionel Sambuc xcb_tmp += sizeof(uint32_t);
1679971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(uint32_t);
1680971bb1a5SLionel Sambuc /* event_list */
1681971bb1a5SLionel Sambuc event_list = (uint32_t *)xcb_tmp;
1682971bb1a5SLionel Sambuc event_list_len = xcb_popcount(xcb_out.event_mask) * sizeof(uint32_t);
1683971bb1a5SLionel Sambuc xcb_block_len += event_list_len;
1684971bb1a5SLionel Sambuc xcb_tmp += event_list_len;
1685971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(uint32_t);
1686971bb1a5SLionel Sambuc /* xcb_x_print_print_input_selected_reply_t.all_events_mask */
1687971bb1a5SLionel Sambuc xcb_out.all_events_mask = *(uint32_t *)xcb_tmp;
1688971bb1a5SLionel Sambuc xcb_block_len += sizeof(uint32_t);
1689971bb1a5SLionel Sambuc xcb_tmp += sizeof(uint32_t);
1690971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(uint32_t);
1691971bb1a5SLionel Sambuc /* all_events_list */
1692971bb1a5SLionel Sambuc all_events_list = (uint32_t *)xcb_tmp;
1693971bb1a5SLionel Sambuc all_events_list_len = xcb_popcount(xcb_out.all_events_mask) * sizeof(uint32_t);
1694971bb1a5SLionel Sambuc xcb_block_len += all_events_list_len;
1695971bb1a5SLionel Sambuc xcb_tmp += all_events_list_len;
1696971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(uint32_t);
1697971bb1a5SLionel Sambuc /* insert padding */
1698971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1699971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
1700971bb1a5SLionel Sambuc if (0 != xcb_pad) {
1701971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
1702971bb1a5SLionel Sambuc xcb_pad = 0;
1703971bb1a5SLionel Sambuc }
1704971bb1a5SLionel Sambuc xcb_block_len = 0;
1705971bb1a5SLionel Sambuc
1706971bb1a5SLionel Sambuc if (NULL == _aux)
1707971bb1a5SLionel Sambuc return xcb_buffer_len;
1708971bb1a5SLionel Sambuc
1709971bb1a5SLionel Sambuc if (NULL == *_aux) {
1710971bb1a5SLionel Sambuc /* allocate memory */
1711971bb1a5SLionel Sambuc *_aux = malloc(xcb_buffer_len);
1712971bb1a5SLionel Sambuc }
1713971bb1a5SLionel Sambuc
1714971bb1a5SLionel Sambuc xcb_tmp = ((char *)*_aux)+xcb_buffer_len;
1715971bb1a5SLionel Sambuc xcb_tmp -= all_events_list_len;
1716971bb1a5SLionel Sambuc memmove(xcb_tmp, all_events_list, all_events_list_len);
1717971bb1a5SLionel Sambuc xcb_tmp -= event_list_len;
1718971bb1a5SLionel Sambuc memmove(xcb_tmp, event_list, event_list_len);
1719971bb1a5SLionel Sambuc **_aux = xcb_out;
1720971bb1a5SLionel Sambuc
1721971bb1a5SLionel Sambuc return xcb_buffer_len;
1722971bb1a5SLionel Sambuc }
1723971bb1a5SLionel Sambuc
1724971bb1a5SLionel Sambuc int
xcb_x_print_print_input_selected_sizeof(const void * _buffer)1725971bb1a5SLionel Sambuc xcb_x_print_print_input_selected_sizeof (const void *_buffer /**< */)
1726971bb1a5SLionel Sambuc {
1727971bb1a5SLionel Sambuc return xcb_x_print_print_input_selected_unserialize(_buffer, NULL);
1728971bb1a5SLionel Sambuc }
1729971bb1a5SLionel Sambuc
1730971bb1a5SLionel Sambuc xcb_x_print_print_input_selected_cookie_t
xcb_x_print_print_input_selected(xcb_connection_t * c,xcb_x_print_pcontext_t context)1731971bb1a5SLionel Sambuc xcb_x_print_print_input_selected (xcb_connection_t *c /**< */,
1732971bb1a5SLionel Sambuc xcb_x_print_pcontext_t context /**< */)
1733971bb1a5SLionel Sambuc {
1734971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1735971bb1a5SLionel Sambuc /* count */ 2,
1736971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
1737971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_PRINT_INPUT_SELECTED,
1738971bb1a5SLionel Sambuc /* isvoid */ 0
1739971bb1a5SLionel Sambuc };
1740971bb1a5SLionel Sambuc
1741971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
1742971bb1a5SLionel Sambuc xcb_x_print_print_input_selected_cookie_t xcb_ret;
1743971bb1a5SLionel Sambuc xcb_x_print_print_input_selected_request_t xcb_out;
1744971bb1a5SLionel Sambuc
1745971bb1a5SLionel Sambuc xcb_out.context = context;
1746971bb1a5SLionel Sambuc
1747971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1748971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1749971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1750971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1751971bb1a5SLionel Sambuc
1752971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1753971bb1a5SLionel Sambuc return xcb_ret;
1754971bb1a5SLionel Sambuc }
1755971bb1a5SLionel Sambuc
1756971bb1a5SLionel Sambuc xcb_x_print_print_input_selected_cookie_t
xcb_x_print_print_input_selected_unchecked(xcb_connection_t * c,xcb_x_print_pcontext_t context)1757971bb1a5SLionel Sambuc xcb_x_print_print_input_selected_unchecked (xcb_connection_t *c /**< */,
1758971bb1a5SLionel Sambuc xcb_x_print_pcontext_t context /**< */)
1759971bb1a5SLionel Sambuc {
1760971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1761971bb1a5SLionel Sambuc /* count */ 2,
1762971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
1763971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_PRINT_INPUT_SELECTED,
1764971bb1a5SLionel Sambuc /* isvoid */ 0
1765971bb1a5SLionel Sambuc };
1766971bb1a5SLionel Sambuc
1767971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
1768971bb1a5SLionel Sambuc xcb_x_print_print_input_selected_cookie_t xcb_ret;
1769971bb1a5SLionel Sambuc xcb_x_print_print_input_selected_request_t xcb_out;
1770971bb1a5SLionel Sambuc
1771971bb1a5SLionel Sambuc xcb_out.context = context;
1772971bb1a5SLionel Sambuc
1773971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1774971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1775971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1776971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1777971bb1a5SLionel Sambuc
1778971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1779971bb1a5SLionel Sambuc return xcb_ret;
1780971bb1a5SLionel Sambuc }
1781971bb1a5SLionel Sambuc
1782971bb1a5SLionel Sambuc uint32_t *
xcb_x_print_print_input_selected_event_list(const xcb_x_print_print_input_selected_reply_t * R)1783971bb1a5SLionel Sambuc xcb_x_print_print_input_selected_event_list (const xcb_x_print_print_input_selected_reply_t *R /**< */)
1784971bb1a5SLionel Sambuc {
1785971bb1a5SLionel Sambuc return (uint32_t *) (R + 1);
1786971bb1a5SLionel Sambuc }
1787971bb1a5SLionel Sambuc
1788971bb1a5SLionel Sambuc int
xcb_x_print_print_input_selected_event_list_length(const xcb_x_print_print_input_selected_reply_t * R)1789971bb1a5SLionel Sambuc xcb_x_print_print_input_selected_event_list_length (const xcb_x_print_print_input_selected_reply_t *R /**< */)
1790971bb1a5SLionel Sambuc {
1791971bb1a5SLionel Sambuc return xcb_popcount(R->event_mask);
1792971bb1a5SLionel Sambuc }
1793971bb1a5SLionel Sambuc
1794971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_x_print_print_input_selected_event_list_end(const xcb_x_print_print_input_selected_reply_t * R)1795971bb1a5SLionel Sambuc xcb_x_print_print_input_selected_event_list_end (const xcb_x_print_print_input_selected_reply_t *R /**< */)
1796971bb1a5SLionel Sambuc {
1797971bb1a5SLionel Sambuc xcb_generic_iterator_t i;
1798971bb1a5SLionel Sambuc i.data = ((uint32_t *) (R + 1)) + (xcb_popcount(R->event_mask));
1799971bb1a5SLionel Sambuc i.rem = 0;
1800971bb1a5SLionel Sambuc i.index = (char *) i.data - (char *) R;
1801971bb1a5SLionel Sambuc return i;
1802971bb1a5SLionel Sambuc }
1803971bb1a5SLionel Sambuc
1804971bb1a5SLionel Sambuc uint32_t *
xcb_x_print_print_input_selected_all_events_list(const xcb_x_print_print_input_selected_reply_t * R)1805971bb1a5SLionel Sambuc xcb_x_print_print_input_selected_all_events_list (const xcb_x_print_print_input_selected_reply_t *R /**< */)
1806971bb1a5SLionel Sambuc {
1807971bb1a5SLionel Sambuc xcb_generic_iterator_t prev = xcb_x_print_print_input_selected_event_list_end(R);
1808971bb1a5SLionel Sambuc return (uint32_t *) ((char *) prev.data + XCB_TYPE_PAD(uint32_t, prev.index) + 4);
1809971bb1a5SLionel Sambuc }
1810971bb1a5SLionel Sambuc
1811971bb1a5SLionel Sambuc int
xcb_x_print_print_input_selected_all_events_list_length(const xcb_x_print_print_input_selected_reply_t * R)1812971bb1a5SLionel Sambuc xcb_x_print_print_input_selected_all_events_list_length (const xcb_x_print_print_input_selected_reply_t *R /**< */)
1813971bb1a5SLionel Sambuc {
1814971bb1a5SLionel Sambuc return xcb_popcount(R->all_events_mask);
1815971bb1a5SLionel Sambuc }
1816971bb1a5SLionel Sambuc
1817971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_x_print_print_input_selected_all_events_list_end(const xcb_x_print_print_input_selected_reply_t * R)1818971bb1a5SLionel Sambuc xcb_x_print_print_input_selected_all_events_list_end (const xcb_x_print_print_input_selected_reply_t *R /**< */)
1819971bb1a5SLionel Sambuc {
1820971bb1a5SLionel Sambuc xcb_generic_iterator_t i;
1821971bb1a5SLionel Sambuc xcb_generic_iterator_t child = xcb_x_print_print_input_selected_event_list_end(R);
1822971bb1a5SLionel Sambuc i.data = ((uint32_t *) child.data) + (xcb_popcount(R->all_events_mask));
1823971bb1a5SLionel Sambuc i.rem = 0;
1824971bb1a5SLionel Sambuc i.index = (char *) i.data - (char *) R;
1825971bb1a5SLionel Sambuc return i;
1826971bb1a5SLionel Sambuc }
1827971bb1a5SLionel Sambuc
1828971bb1a5SLionel Sambuc xcb_x_print_print_input_selected_reply_t *
xcb_x_print_print_input_selected_reply(xcb_connection_t * c,xcb_x_print_print_input_selected_cookie_t cookie,xcb_generic_error_t ** e)1829971bb1a5SLionel Sambuc xcb_x_print_print_input_selected_reply (xcb_connection_t *c /**< */,
1830971bb1a5SLionel Sambuc xcb_x_print_print_input_selected_cookie_t cookie /**< */,
1831971bb1a5SLionel Sambuc xcb_generic_error_t **e /**< */)
1832971bb1a5SLionel Sambuc {
1833971bb1a5SLionel Sambuc return (xcb_x_print_print_input_selected_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1834971bb1a5SLionel Sambuc }
1835971bb1a5SLionel Sambuc
1836*0a6a1f1dSLionel Sambuc int
xcb_x_print_print_get_attributes_sizeof(const void * _buffer)1837*0a6a1f1dSLionel Sambuc xcb_x_print_print_get_attributes_sizeof (const void *_buffer /**< */)
1838*0a6a1f1dSLionel Sambuc {
1839*0a6a1f1dSLionel Sambuc char *xcb_tmp = (char *)_buffer;
1840*0a6a1f1dSLionel Sambuc const xcb_x_print_print_get_attributes_reply_t *_aux = (xcb_x_print_print_get_attributes_reply_t *)_buffer;
1841*0a6a1f1dSLionel Sambuc unsigned int xcb_buffer_len = 0;
1842*0a6a1f1dSLionel Sambuc unsigned int xcb_block_len = 0;
1843*0a6a1f1dSLionel Sambuc unsigned int xcb_pad = 0;
1844*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
1845971bb1a5SLionel Sambuc
1846*0a6a1f1dSLionel Sambuc
1847*0a6a1f1dSLionel Sambuc xcb_block_len += sizeof(xcb_x_print_print_get_attributes_reply_t);
1848*0a6a1f1dSLionel Sambuc xcb_tmp += xcb_block_len;
1849*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len;
1850*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
1851*0a6a1f1dSLionel Sambuc /* attributes */
1852*0a6a1f1dSLionel Sambuc xcb_block_len += _aux->stringLen * sizeof(xcb_x_print_string8_t);
1853*0a6a1f1dSLionel Sambuc xcb_tmp += xcb_block_len;
1854*0a6a1f1dSLionel Sambuc xcb_align_to = ALIGNOF(xcb_x_print_string8_t);
1855*0a6a1f1dSLionel Sambuc /* insert padding */
1856*0a6a1f1dSLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1857*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
1858*0a6a1f1dSLionel Sambuc if (0 != xcb_pad) {
1859*0a6a1f1dSLionel Sambuc xcb_tmp += xcb_pad;
1860*0a6a1f1dSLionel Sambuc xcb_pad = 0;
1861*0a6a1f1dSLionel Sambuc }
1862*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
1863*0a6a1f1dSLionel Sambuc
1864*0a6a1f1dSLionel Sambuc return xcb_buffer_len;
1865*0a6a1f1dSLionel Sambuc }
1866971bb1a5SLionel Sambuc
1867971bb1a5SLionel Sambuc xcb_x_print_print_get_attributes_cookie_t
xcb_x_print_print_get_attributes(xcb_connection_t * c,xcb_x_print_pcontext_t context,uint8_t pool)1868971bb1a5SLionel Sambuc xcb_x_print_print_get_attributes (xcb_connection_t *c /**< */,
1869971bb1a5SLionel Sambuc xcb_x_print_pcontext_t context /**< */,
1870971bb1a5SLionel Sambuc uint8_t pool /**< */)
1871971bb1a5SLionel Sambuc {
1872971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1873971bb1a5SLionel Sambuc /* count */ 2,
1874971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
1875971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_PRINT_GET_ATTRIBUTES,
1876971bb1a5SLionel Sambuc /* isvoid */ 0
1877971bb1a5SLionel Sambuc };
1878971bb1a5SLionel Sambuc
1879971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
1880971bb1a5SLionel Sambuc xcb_x_print_print_get_attributes_cookie_t xcb_ret;
1881971bb1a5SLionel Sambuc xcb_x_print_print_get_attributes_request_t xcb_out;
1882971bb1a5SLionel Sambuc
1883971bb1a5SLionel Sambuc xcb_out.context = context;
1884971bb1a5SLionel Sambuc xcb_out.pool = pool;
1885971bb1a5SLionel Sambuc memset(xcb_out.pad0, 0, 3);
1886971bb1a5SLionel Sambuc
1887971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1888971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1889971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1890971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1891971bb1a5SLionel Sambuc
1892971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1893971bb1a5SLionel Sambuc return xcb_ret;
1894971bb1a5SLionel Sambuc }
1895971bb1a5SLionel Sambuc
1896971bb1a5SLionel Sambuc xcb_x_print_print_get_attributes_cookie_t
xcb_x_print_print_get_attributes_unchecked(xcb_connection_t * c,xcb_x_print_pcontext_t context,uint8_t pool)1897971bb1a5SLionel Sambuc xcb_x_print_print_get_attributes_unchecked (xcb_connection_t *c /**< */,
1898971bb1a5SLionel Sambuc xcb_x_print_pcontext_t context /**< */,
1899971bb1a5SLionel Sambuc uint8_t pool /**< */)
1900971bb1a5SLionel Sambuc {
1901971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1902971bb1a5SLionel Sambuc /* count */ 2,
1903971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
1904971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_PRINT_GET_ATTRIBUTES,
1905971bb1a5SLionel Sambuc /* isvoid */ 0
1906971bb1a5SLionel Sambuc };
1907971bb1a5SLionel Sambuc
1908971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
1909971bb1a5SLionel Sambuc xcb_x_print_print_get_attributes_cookie_t xcb_ret;
1910971bb1a5SLionel Sambuc xcb_x_print_print_get_attributes_request_t xcb_out;
1911971bb1a5SLionel Sambuc
1912971bb1a5SLionel Sambuc xcb_out.context = context;
1913971bb1a5SLionel Sambuc xcb_out.pool = pool;
1914971bb1a5SLionel Sambuc memset(xcb_out.pad0, 0, 3);
1915971bb1a5SLionel Sambuc
1916971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1917971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1918971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1919971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1920971bb1a5SLionel Sambuc
1921971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1922971bb1a5SLionel Sambuc return xcb_ret;
1923971bb1a5SLionel Sambuc }
1924971bb1a5SLionel Sambuc
1925*0a6a1f1dSLionel Sambuc xcb_x_print_string8_t *
xcb_x_print_print_get_attributes_attributes(const xcb_x_print_print_get_attributes_reply_t * R)1926*0a6a1f1dSLionel Sambuc xcb_x_print_print_get_attributes_attributes (const xcb_x_print_print_get_attributes_reply_t *R /**< */)
1927*0a6a1f1dSLionel Sambuc {
1928*0a6a1f1dSLionel Sambuc return (xcb_x_print_string8_t *) (R + 1);
1929*0a6a1f1dSLionel Sambuc }
1930971bb1a5SLionel Sambuc
1931*0a6a1f1dSLionel Sambuc int
xcb_x_print_print_get_attributes_attributes_length(const xcb_x_print_print_get_attributes_reply_t * R)1932*0a6a1f1dSLionel Sambuc xcb_x_print_print_get_attributes_attributes_length (const xcb_x_print_print_get_attributes_reply_t *R /**< */)
1933*0a6a1f1dSLionel Sambuc {
1934*0a6a1f1dSLionel Sambuc return R->stringLen;
1935*0a6a1f1dSLionel Sambuc }
1936*0a6a1f1dSLionel Sambuc
1937*0a6a1f1dSLionel Sambuc xcb_generic_iterator_t
xcb_x_print_print_get_attributes_attributes_end(const xcb_x_print_print_get_attributes_reply_t * R)1938*0a6a1f1dSLionel Sambuc xcb_x_print_print_get_attributes_attributes_end (const xcb_x_print_print_get_attributes_reply_t *R /**< */)
1939*0a6a1f1dSLionel Sambuc {
1940*0a6a1f1dSLionel Sambuc xcb_generic_iterator_t i;
1941*0a6a1f1dSLionel Sambuc i.data = ((xcb_x_print_string8_t *) (R + 1)) + (R->stringLen);
1942*0a6a1f1dSLionel Sambuc i.rem = 0;
1943*0a6a1f1dSLionel Sambuc i.index = (char *) i.data - (char *) R;
1944*0a6a1f1dSLionel Sambuc return i;
1945*0a6a1f1dSLionel Sambuc }
1946971bb1a5SLionel Sambuc
1947971bb1a5SLionel Sambuc xcb_x_print_print_get_attributes_reply_t *
xcb_x_print_print_get_attributes_reply(xcb_connection_t * c,xcb_x_print_print_get_attributes_cookie_t cookie,xcb_generic_error_t ** e)1948971bb1a5SLionel Sambuc xcb_x_print_print_get_attributes_reply (xcb_connection_t *c /**< */,
1949971bb1a5SLionel Sambuc xcb_x_print_print_get_attributes_cookie_t cookie /**< */,
1950971bb1a5SLionel Sambuc xcb_generic_error_t **e /**< */)
1951971bb1a5SLionel Sambuc {
1952971bb1a5SLionel Sambuc return (xcb_x_print_print_get_attributes_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1953971bb1a5SLionel Sambuc }
1954971bb1a5SLionel Sambuc
1955971bb1a5SLionel Sambuc int
xcb_x_print_print_get_one_attributes_sizeof(const void * _buffer)1956971bb1a5SLionel Sambuc xcb_x_print_print_get_one_attributes_sizeof (const void *_buffer /**< */)
1957971bb1a5SLionel Sambuc {
1958971bb1a5SLionel Sambuc char *xcb_tmp = (char *)_buffer;
1959971bb1a5SLionel Sambuc const xcb_x_print_print_get_one_attributes_request_t *_aux = (xcb_x_print_print_get_one_attributes_request_t *)_buffer;
1960971bb1a5SLionel Sambuc unsigned int xcb_buffer_len = 0;
1961971bb1a5SLionel Sambuc unsigned int xcb_block_len = 0;
1962971bb1a5SLionel Sambuc unsigned int xcb_pad = 0;
1963*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
1964971bb1a5SLionel Sambuc
1965971bb1a5SLionel Sambuc
1966971bb1a5SLionel Sambuc xcb_block_len += sizeof(xcb_x_print_print_get_one_attributes_request_t);
1967971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
1968*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len;
1969*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
1970971bb1a5SLionel Sambuc /* name */
1971971bb1a5SLionel Sambuc xcb_block_len += _aux->nameLen * sizeof(xcb_x_print_string8_t);
1972971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
1973971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(xcb_x_print_string8_t);
1974971bb1a5SLionel Sambuc /* insert padding */
1975971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1976971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
1977971bb1a5SLionel Sambuc if (0 != xcb_pad) {
1978971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
1979971bb1a5SLionel Sambuc xcb_pad = 0;
1980971bb1a5SLionel Sambuc }
1981971bb1a5SLionel Sambuc xcb_block_len = 0;
1982971bb1a5SLionel Sambuc
1983971bb1a5SLionel Sambuc return xcb_buffer_len;
1984971bb1a5SLionel Sambuc }
1985971bb1a5SLionel Sambuc
1986971bb1a5SLionel Sambuc xcb_x_print_print_get_one_attributes_cookie_t
xcb_x_print_print_get_one_attributes(xcb_connection_t * c,xcb_x_print_pcontext_t context,uint32_t nameLen,uint8_t pool,const xcb_x_print_string8_t * name)1987971bb1a5SLionel Sambuc xcb_x_print_print_get_one_attributes (xcb_connection_t *c /**< */,
1988971bb1a5SLionel Sambuc xcb_x_print_pcontext_t context /**< */,
1989971bb1a5SLionel Sambuc uint32_t nameLen /**< */,
1990971bb1a5SLionel Sambuc uint8_t pool /**< */,
1991971bb1a5SLionel Sambuc const xcb_x_print_string8_t *name /**< */)
1992971bb1a5SLionel Sambuc {
1993971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1994971bb1a5SLionel Sambuc /* count */ 4,
1995971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
1996971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_PRINT_GET_ONE_ATTRIBUTES,
1997971bb1a5SLionel Sambuc /* isvoid */ 0
1998971bb1a5SLionel Sambuc };
1999971bb1a5SLionel Sambuc
2000971bb1a5SLionel Sambuc struct iovec xcb_parts[6];
2001971bb1a5SLionel Sambuc xcb_x_print_print_get_one_attributes_cookie_t xcb_ret;
2002971bb1a5SLionel Sambuc xcb_x_print_print_get_one_attributes_request_t xcb_out;
2003971bb1a5SLionel Sambuc
2004971bb1a5SLionel Sambuc xcb_out.context = context;
2005971bb1a5SLionel Sambuc xcb_out.nameLen = nameLen;
2006971bb1a5SLionel Sambuc xcb_out.pool = pool;
2007971bb1a5SLionel Sambuc memset(xcb_out.pad0, 0, 3);
2008971bb1a5SLionel Sambuc
2009971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
2010971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
2011971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
2012971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2013971bb1a5SLionel Sambuc /* xcb_x_print_string8_t name */
2014971bb1a5SLionel Sambuc xcb_parts[4].iov_base = (char *) name;
2015971bb1a5SLionel Sambuc xcb_parts[4].iov_len = nameLen * sizeof(xcb_x_print_string8_t);
2016971bb1a5SLionel Sambuc xcb_parts[5].iov_base = 0;
2017971bb1a5SLionel Sambuc xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
2018971bb1a5SLionel Sambuc
2019971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2020971bb1a5SLionel Sambuc return xcb_ret;
2021971bb1a5SLionel Sambuc }
2022971bb1a5SLionel Sambuc
2023971bb1a5SLionel Sambuc xcb_x_print_print_get_one_attributes_cookie_t
xcb_x_print_print_get_one_attributes_unchecked(xcb_connection_t * c,xcb_x_print_pcontext_t context,uint32_t nameLen,uint8_t pool,const xcb_x_print_string8_t * name)2024971bb1a5SLionel Sambuc xcb_x_print_print_get_one_attributes_unchecked (xcb_connection_t *c /**< */,
2025971bb1a5SLionel Sambuc xcb_x_print_pcontext_t context /**< */,
2026971bb1a5SLionel Sambuc uint32_t nameLen /**< */,
2027971bb1a5SLionel Sambuc uint8_t pool /**< */,
2028971bb1a5SLionel Sambuc const xcb_x_print_string8_t *name /**< */)
2029971bb1a5SLionel Sambuc {
2030971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
2031971bb1a5SLionel Sambuc /* count */ 4,
2032971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
2033971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_PRINT_GET_ONE_ATTRIBUTES,
2034971bb1a5SLionel Sambuc /* isvoid */ 0
2035971bb1a5SLionel Sambuc };
2036971bb1a5SLionel Sambuc
2037971bb1a5SLionel Sambuc struct iovec xcb_parts[6];
2038971bb1a5SLionel Sambuc xcb_x_print_print_get_one_attributes_cookie_t xcb_ret;
2039971bb1a5SLionel Sambuc xcb_x_print_print_get_one_attributes_request_t xcb_out;
2040971bb1a5SLionel Sambuc
2041971bb1a5SLionel Sambuc xcb_out.context = context;
2042971bb1a5SLionel Sambuc xcb_out.nameLen = nameLen;
2043971bb1a5SLionel Sambuc xcb_out.pool = pool;
2044971bb1a5SLionel Sambuc memset(xcb_out.pad0, 0, 3);
2045971bb1a5SLionel Sambuc
2046971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
2047971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
2048971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
2049971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2050971bb1a5SLionel Sambuc /* xcb_x_print_string8_t name */
2051971bb1a5SLionel Sambuc xcb_parts[4].iov_base = (char *) name;
2052971bb1a5SLionel Sambuc xcb_parts[4].iov_len = nameLen * sizeof(xcb_x_print_string8_t);
2053971bb1a5SLionel Sambuc xcb_parts[5].iov_base = 0;
2054971bb1a5SLionel Sambuc xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
2055971bb1a5SLionel Sambuc
2056971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2057971bb1a5SLionel Sambuc return xcb_ret;
2058971bb1a5SLionel Sambuc }
2059971bb1a5SLionel Sambuc
2060971bb1a5SLionel Sambuc xcb_x_print_string8_t *
xcb_x_print_print_get_one_attributes_value(const xcb_x_print_print_get_one_attributes_reply_t * R)2061971bb1a5SLionel Sambuc xcb_x_print_print_get_one_attributes_value (const xcb_x_print_print_get_one_attributes_reply_t *R /**< */)
2062971bb1a5SLionel Sambuc {
2063971bb1a5SLionel Sambuc return (xcb_x_print_string8_t *) (R + 1);
2064971bb1a5SLionel Sambuc }
2065971bb1a5SLionel Sambuc
2066971bb1a5SLionel Sambuc int
xcb_x_print_print_get_one_attributes_value_length(const xcb_x_print_print_get_one_attributes_reply_t * R)2067971bb1a5SLionel Sambuc xcb_x_print_print_get_one_attributes_value_length (const xcb_x_print_print_get_one_attributes_reply_t *R /**< */)
2068971bb1a5SLionel Sambuc {
2069971bb1a5SLionel Sambuc return R->valueLen;
2070971bb1a5SLionel Sambuc }
2071971bb1a5SLionel Sambuc
2072971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_x_print_print_get_one_attributes_value_end(const xcb_x_print_print_get_one_attributes_reply_t * R)2073971bb1a5SLionel Sambuc xcb_x_print_print_get_one_attributes_value_end (const xcb_x_print_print_get_one_attributes_reply_t *R /**< */)
2074971bb1a5SLionel Sambuc {
2075971bb1a5SLionel Sambuc xcb_generic_iterator_t i;
2076971bb1a5SLionel Sambuc i.data = ((xcb_x_print_string8_t *) (R + 1)) + (R->valueLen);
2077971bb1a5SLionel Sambuc i.rem = 0;
2078971bb1a5SLionel Sambuc i.index = (char *) i.data - (char *) R;
2079971bb1a5SLionel Sambuc return i;
2080971bb1a5SLionel Sambuc }
2081971bb1a5SLionel Sambuc
2082971bb1a5SLionel Sambuc xcb_x_print_print_get_one_attributes_reply_t *
xcb_x_print_print_get_one_attributes_reply(xcb_connection_t * c,xcb_x_print_print_get_one_attributes_cookie_t cookie,xcb_generic_error_t ** e)2083971bb1a5SLionel Sambuc xcb_x_print_print_get_one_attributes_reply (xcb_connection_t *c /**< */,
2084971bb1a5SLionel Sambuc xcb_x_print_print_get_one_attributes_cookie_t cookie /**< */,
2085971bb1a5SLionel Sambuc xcb_generic_error_t **e /**< */)
2086971bb1a5SLionel Sambuc {
2087971bb1a5SLionel Sambuc return (xcb_x_print_print_get_one_attributes_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
2088971bb1a5SLionel Sambuc }
2089971bb1a5SLionel Sambuc
2090971bb1a5SLionel Sambuc int
xcb_x_print_print_set_attributes_sizeof(const void * _buffer,uint32_t attributes_len)2091971bb1a5SLionel Sambuc xcb_x_print_print_set_attributes_sizeof (const void *_buffer /**< */,
2092971bb1a5SLionel Sambuc uint32_t attributes_len /**< */)
2093971bb1a5SLionel Sambuc {
2094971bb1a5SLionel Sambuc char *xcb_tmp = (char *)_buffer;
2095971bb1a5SLionel Sambuc unsigned int xcb_buffer_len = 0;
2096971bb1a5SLionel Sambuc unsigned int xcb_block_len = 0;
2097971bb1a5SLionel Sambuc unsigned int xcb_pad = 0;
2098*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
2099971bb1a5SLionel Sambuc
2100971bb1a5SLionel Sambuc
2101971bb1a5SLionel Sambuc xcb_block_len += sizeof(xcb_x_print_print_set_attributes_request_t);
2102971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
2103*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len;
2104*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
2105971bb1a5SLionel Sambuc /* attributes */
2106971bb1a5SLionel Sambuc xcb_block_len += attributes_len * sizeof(xcb_x_print_string8_t);
2107971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
2108971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(xcb_x_print_string8_t);
2109971bb1a5SLionel Sambuc /* insert padding */
2110971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2111971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
2112971bb1a5SLionel Sambuc if (0 != xcb_pad) {
2113971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
2114971bb1a5SLionel Sambuc xcb_pad = 0;
2115971bb1a5SLionel Sambuc }
2116971bb1a5SLionel Sambuc xcb_block_len = 0;
2117971bb1a5SLionel Sambuc
2118971bb1a5SLionel Sambuc return xcb_buffer_len;
2119971bb1a5SLionel Sambuc }
2120971bb1a5SLionel Sambuc
2121971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_x_print_print_set_attributes_checked(xcb_connection_t * c,xcb_x_print_pcontext_t context,uint32_t stringLen,uint8_t pool,uint8_t rule,uint32_t attributes_len,const xcb_x_print_string8_t * attributes)2122971bb1a5SLionel Sambuc xcb_x_print_print_set_attributes_checked (xcb_connection_t *c /**< */,
2123971bb1a5SLionel Sambuc xcb_x_print_pcontext_t context /**< */,
2124971bb1a5SLionel Sambuc uint32_t stringLen /**< */,
2125971bb1a5SLionel Sambuc uint8_t pool /**< */,
2126971bb1a5SLionel Sambuc uint8_t rule /**< */,
2127971bb1a5SLionel Sambuc uint32_t attributes_len /**< */,
2128971bb1a5SLionel Sambuc const xcb_x_print_string8_t *attributes /**< */)
2129971bb1a5SLionel Sambuc {
2130971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
2131971bb1a5SLionel Sambuc /* count */ 4,
2132971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
2133971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_PRINT_SET_ATTRIBUTES,
2134971bb1a5SLionel Sambuc /* isvoid */ 1
2135971bb1a5SLionel Sambuc };
2136971bb1a5SLionel Sambuc
2137971bb1a5SLionel Sambuc struct iovec xcb_parts[6];
2138971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
2139971bb1a5SLionel Sambuc xcb_x_print_print_set_attributes_request_t xcb_out;
2140971bb1a5SLionel Sambuc
2141971bb1a5SLionel Sambuc xcb_out.context = context;
2142971bb1a5SLionel Sambuc xcb_out.stringLen = stringLen;
2143971bb1a5SLionel Sambuc xcb_out.pool = pool;
2144971bb1a5SLionel Sambuc xcb_out.rule = rule;
2145971bb1a5SLionel Sambuc memset(xcb_out.pad0, 0, 2);
2146971bb1a5SLionel Sambuc
2147971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
2148971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
2149971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
2150971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2151971bb1a5SLionel Sambuc /* xcb_x_print_string8_t attributes */
2152971bb1a5SLionel Sambuc xcb_parts[4].iov_base = (char *) attributes;
2153971bb1a5SLionel Sambuc xcb_parts[4].iov_len = attributes_len * sizeof(xcb_x_print_string8_t);
2154971bb1a5SLionel Sambuc xcb_parts[5].iov_base = 0;
2155971bb1a5SLionel Sambuc xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
2156971bb1a5SLionel Sambuc
2157971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2158971bb1a5SLionel Sambuc return xcb_ret;
2159971bb1a5SLionel Sambuc }
2160971bb1a5SLionel Sambuc
2161971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_x_print_print_set_attributes(xcb_connection_t * c,xcb_x_print_pcontext_t context,uint32_t stringLen,uint8_t pool,uint8_t rule,uint32_t attributes_len,const xcb_x_print_string8_t * attributes)2162971bb1a5SLionel Sambuc xcb_x_print_print_set_attributes (xcb_connection_t *c /**< */,
2163971bb1a5SLionel Sambuc xcb_x_print_pcontext_t context /**< */,
2164971bb1a5SLionel Sambuc uint32_t stringLen /**< */,
2165971bb1a5SLionel Sambuc uint8_t pool /**< */,
2166971bb1a5SLionel Sambuc uint8_t rule /**< */,
2167971bb1a5SLionel Sambuc uint32_t attributes_len /**< */,
2168971bb1a5SLionel Sambuc const xcb_x_print_string8_t *attributes /**< */)
2169971bb1a5SLionel Sambuc {
2170971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
2171971bb1a5SLionel Sambuc /* count */ 4,
2172971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
2173971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_PRINT_SET_ATTRIBUTES,
2174971bb1a5SLionel Sambuc /* isvoid */ 1
2175971bb1a5SLionel Sambuc };
2176971bb1a5SLionel Sambuc
2177971bb1a5SLionel Sambuc struct iovec xcb_parts[6];
2178971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
2179971bb1a5SLionel Sambuc xcb_x_print_print_set_attributes_request_t xcb_out;
2180971bb1a5SLionel Sambuc
2181971bb1a5SLionel Sambuc xcb_out.context = context;
2182971bb1a5SLionel Sambuc xcb_out.stringLen = stringLen;
2183971bb1a5SLionel Sambuc xcb_out.pool = pool;
2184971bb1a5SLionel Sambuc xcb_out.rule = rule;
2185971bb1a5SLionel Sambuc memset(xcb_out.pad0, 0, 2);
2186971bb1a5SLionel Sambuc
2187971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
2188971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
2189971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
2190971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2191971bb1a5SLionel Sambuc /* xcb_x_print_string8_t attributes */
2192971bb1a5SLionel Sambuc xcb_parts[4].iov_base = (char *) attributes;
2193971bb1a5SLionel Sambuc xcb_parts[4].iov_len = attributes_len * sizeof(xcb_x_print_string8_t);
2194971bb1a5SLionel Sambuc xcb_parts[5].iov_base = 0;
2195971bb1a5SLionel Sambuc xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
2196971bb1a5SLionel Sambuc
2197971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2198971bb1a5SLionel Sambuc return xcb_ret;
2199971bb1a5SLionel Sambuc }
2200971bb1a5SLionel Sambuc
2201971bb1a5SLionel Sambuc xcb_x_print_print_get_page_dimensions_cookie_t
xcb_x_print_print_get_page_dimensions(xcb_connection_t * c,xcb_x_print_pcontext_t context)2202971bb1a5SLionel Sambuc xcb_x_print_print_get_page_dimensions (xcb_connection_t *c /**< */,
2203971bb1a5SLionel Sambuc xcb_x_print_pcontext_t context /**< */)
2204971bb1a5SLionel Sambuc {
2205971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
2206971bb1a5SLionel Sambuc /* count */ 2,
2207971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
2208971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_PRINT_GET_PAGE_DIMENSIONS,
2209971bb1a5SLionel Sambuc /* isvoid */ 0
2210971bb1a5SLionel Sambuc };
2211971bb1a5SLionel Sambuc
2212971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
2213971bb1a5SLionel Sambuc xcb_x_print_print_get_page_dimensions_cookie_t xcb_ret;
2214971bb1a5SLionel Sambuc xcb_x_print_print_get_page_dimensions_request_t xcb_out;
2215971bb1a5SLionel Sambuc
2216971bb1a5SLionel Sambuc xcb_out.context = context;
2217971bb1a5SLionel Sambuc
2218971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
2219971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
2220971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
2221971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2222971bb1a5SLionel Sambuc
2223971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2224971bb1a5SLionel Sambuc return xcb_ret;
2225971bb1a5SLionel Sambuc }
2226971bb1a5SLionel Sambuc
2227971bb1a5SLionel Sambuc xcb_x_print_print_get_page_dimensions_cookie_t
xcb_x_print_print_get_page_dimensions_unchecked(xcb_connection_t * c,xcb_x_print_pcontext_t context)2228971bb1a5SLionel Sambuc xcb_x_print_print_get_page_dimensions_unchecked (xcb_connection_t *c /**< */,
2229971bb1a5SLionel Sambuc xcb_x_print_pcontext_t context /**< */)
2230971bb1a5SLionel Sambuc {
2231971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
2232971bb1a5SLionel Sambuc /* count */ 2,
2233971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
2234971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_PRINT_GET_PAGE_DIMENSIONS,
2235971bb1a5SLionel Sambuc /* isvoid */ 0
2236971bb1a5SLionel Sambuc };
2237971bb1a5SLionel Sambuc
2238971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
2239971bb1a5SLionel Sambuc xcb_x_print_print_get_page_dimensions_cookie_t xcb_ret;
2240971bb1a5SLionel Sambuc xcb_x_print_print_get_page_dimensions_request_t xcb_out;
2241971bb1a5SLionel Sambuc
2242971bb1a5SLionel Sambuc xcb_out.context = context;
2243971bb1a5SLionel Sambuc
2244971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
2245971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
2246971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
2247971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2248971bb1a5SLionel Sambuc
2249971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2250971bb1a5SLionel Sambuc return xcb_ret;
2251971bb1a5SLionel Sambuc }
2252971bb1a5SLionel Sambuc
2253971bb1a5SLionel Sambuc xcb_x_print_print_get_page_dimensions_reply_t *
xcb_x_print_print_get_page_dimensions_reply(xcb_connection_t * c,xcb_x_print_print_get_page_dimensions_cookie_t cookie,xcb_generic_error_t ** e)2254971bb1a5SLionel Sambuc xcb_x_print_print_get_page_dimensions_reply (xcb_connection_t *c /**< */,
2255971bb1a5SLionel Sambuc xcb_x_print_print_get_page_dimensions_cookie_t cookie /**< */,
2256971bb1a5SLionel Sambuc xcb_generic_error_t **e /**< */)
2257971bb1a5SLionel Sambuc {
2258971bb1a5SLionel Sambuc return (xcb_x_print_print_get_page_dimensions_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
2259971bb1a5SLionel Sambuc }
2260971bb1a5SLionel Sambuc
2261971bb1a5SLionel Sambuc int
xcb_x_print_print_query_screens_sizeof(const void * _buffer)2262971bb1a5SLionel Sambuc xcb_x_print_print_query_screens_sizeof (const void *_buffer /**< */)
2263971bb1a5SLionel Sambuc {
2264971bb1a5SLionel Sambuc char *xcb_tmp = (char *)_buffer;
2265971bb1a5SLionel Sambuc const xcb_x_print_print_query_screens_reply_t *_aux = (xcb_x_print_print_query_screens_reply_t *)_buffer;
2266971bb1a5SLionel Sambuc unsigned int xcb_buffer_len = 0;
2267971bb1a5SLionel Sambuc unsigned int xcb_block_len = 0;
2268971bb1a5SLionel Sambuc unsigned int xcb_pad = 0;
2269*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
2270971bb1a5SLionel Sambuc
2271971bb1a5SLionel Sambuc
2272971bb1a5SLionel Sambuc xcb_block_len += sizeof(xcb_x_print_print_query_screens_reply_t);
2273971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
2274*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len;
2275*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
2276971bb1a5SLionel Sambuc /* roots */
2277971bb1a5SLionel Sambuc xcb_block_len += _aux->listCount * sizeof(xcb_window_t);
2278971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
2279971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(xcb_window_t);
2280971bb1a5SLionel Sambuc /* insert padding */
2281971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2282971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
2283971bb1a5SLionel Sambuc if (0 != xcb_pad) {
2284971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
2285971bb1a5SLionel Sambuc xcb_pad = 0;
2286971bb1a5SLionel Sambuc }
2287971bb1a5SLionel Sambuc xcb_block_len = 0;
2288971bb1a5SLionel Sambuc
2289971bb1a5SLionel Sambuc return xcb_buffer_len;
2290971bb1a5SLionel Sambuc }
2291971bb1a5SLionel Sambuc
2292971bb1a5SLionel Sambuc xcb_x_print_print_query_screens_cookie_t
xcb_x_print_print_query_screens(xcb_connection_t * c)2293971bb1a5SLionel Sambuc xcb_x_print_print_query_screens (xcb_connection_t *c /**< */)
2294971bb1a5SLionel Sambuc {
2295971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
2296971bb1a5SLionel Sambuc /* count */ 2,
2297971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
2298971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_PRINT_QUERY_SCREENS,
2299971bb1a5SLionel Sambuc /* isvoid */ 0
2300971bb1a5SLionel Sambuc };
2301971bb1a5SLionel Sambuc
2302971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
2303971bb1a5SLionel Sambuc xcb_x_print_print_query_screens_cookie_t xcb_ret;
2304971bb1a5SLionel Sambuc xcb_x_print_print_query_screens_request_t xcb_out;
2305971bb1a5SLionel Sambuc
2306971bb1a5SLionel Sambuc
2307971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
2308971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
2309971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
2310971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2311971bb1a5SLionel Sambuc
2312971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2313971bb1a5SLionel Sambuc return xcb_ret;
2314971bb1a5SLionel Sambuc }
2315971bb1a5SLionel Sambuc
2316971bb1a5SLionel Sambuc xcb_x_print_print_query_screens_cookie_t
xcb_x_print_print_query_screens_unchecked(xcb_connection_t * c)2317971bb1a5SLionel Sambuc xcb_x_print_print_query_screens_unchecked (xcb_connection_t *c /**< */)
2318971bb1a5SLionel Sambuc {
2319971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
2320971bb1a5SLionel Sambuc /* count */ 2,
2321971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
2322971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_PRINT_QUERY_SCREENS,
2323971bb1a5SLionel Sambuc /* isvoid */ 0
2324971bb1a5SLionel Sambuc };
2325971bb1a5SLionel Sambuc
2326971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
2327971bb1a5SLionel Sambuc xcb_x_print_print_query_screens_cookie_t xcb_ret;
2328971bb1a5SLionel Sambuc xcb_x_print_print_query_screens_request_t xcb_out;
2329971bb1a5SLionel Sambuc
2330971bb1a5SLionel Sambuc
2331971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
2332971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
2333971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
2334971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2335971bb1a5SLionel Sambuc
2336971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2337971bb1a5SLionel Sambuc return xcb_ret;
2338971bb1a5SLionel Sambuc }
2339971bb1a5SLionel Sambuc
2340971bb1a5SLionel Sambuc xcb_window_t *
xcb_x_print_print_query_screens_roots(const xcb_x_print_print_query_screens_reply_t * R)2341971bb1a5SLionel Sambuc xcb_x_print_print_query_screens_roots (const xcb_x_print_print_query_screens_reply_t *R /**< */)
2342971bb1a5SLionel Sambuc {
2343971bb1a5SLionel Sambuc return (xcb_window_t *) (R + 1);
2344971bb1a5SLionel Sambuc }
2345971bb1a5SLionel Sambuc
2346971bb1a5SLionel Sambuc int
xcb_x_print_print_query_screens_roots_length(const xcb_x_print_print_query_screens_reply_t * R)2347971bb1a5SLionel Sambuc xcb_x_print_print_query_screens_roots_length (const xcb_x_print_print_query_screens_reply_t *R /**< */)
2348971bb1a5SLionel Sambuc {
2349971bb1a5SLionel Sambuc return R->listCount;
2350971bb1a5SLionel Sambuc }
2351971bb1a5SLionel Sambuc
2352971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_x_print_print_query_screens_roots_end(const xcb_x_print_print_query_screens_reply_t * R)2353971bb1a5SLionel Sambuc xcb_x_print_print_query_screens_roots_end (const xcb_x_print_print_query_screens_reply_t *R /**< */)
2354971bb1a5SLionel Sambuc {
2355971bb1a5SLionel Sambuc xcb_generic_iterator_t i;
2356971bb1a5SLionel Sambuc i.data = ((xcb_window_t *) (R + 1)) + (R->listCount);
2357971bb1a5SLionel Sambuc i.rem = 0;
2358971bb1a5SLionel Sambuc i.index = (char *) i.data - (char *) R;
2359971bb1a5SLionel Sambuc return i;
2360971bb1a5SLionel Sambuc }
2361971bb1a5SLionel Sambuc
2362971bb1a5SLionel Sambuc xcb_x_print_print_query_screens_reply_t *
xcb_x_print_print_query_screens_reply(xcb_connection_t * c,xcb_x_print_print_query_screens_cookie_t cookie,xcb_generic_error_t ** e)2363971bb1a5SLionel Sambuc xcb_x_print_print_query_screens_reply (xcb_connection_t *c /**< */,
2364971bb1a5SLionel Sambuc xcb_x_print_print_query_screens_cookie_t cookie /**< */,
2365971bb1a5SLionel Sambuc xcb_generic_error_t **e /**< */)
2366971bb1a5SLionel Sambuc {
2367971bb1a5SLionel Sambuc return (xcb_x_print_print_query_screens_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
2368971bb1a5SLionel Sambuc }
2369971bb1a5SLionel Sambuc
2370971bb1a5SLionel Sambuc xcb_x_print_print_set_image_resolution_cookie_t
xcb_x_print_print_set_image_resolution(xcb_connection_t * c,xcb_x_print_pcontext_t context,uint16_t image_resolution)2371971bb1a5SLionel Sambuc xcb_x_print_print_set_image_resolution (xcb_connection_t *c /**< */,
2372971bb1a5SLionel Sambuc xcb_x_print_pcontext_t context /**< */,
2373971bb1a5SLionel Sambuc uint16_t image_resolution /**< */)
2374971bb1a5SLionel Sambuc {
2375971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
2376971bb1a5SLionel Sambuc /* count */ 2,
2377971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
2378971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_PRINT_SET_IMAGE_RESOLUTION,
2379971bb1a5SLionel Sambuc /* isvoid */ 0
2380971bb1a5SLionel Sambuc };
2381971bb1a5SLionel Sambuc
2382971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
2383971bb1a5SLionel Sambuc xcb_x_print_print_set_image_resolution_cookie_t xcb_ret;
2384971bb1a5SLionel Sambuc xcb_x_print_print_set_image_resolution_request_t xcb_out;
2385971bb1a5SLionel Sambuc
2386971bb1a5SLionel Sambuc xcb_out.context = context;
2387971bb1a5SLionel Sambuc xcb_out.image_resolution = image_resolution;
2388971bb1a5SLionel Sambuc
2389971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
2390971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
2391971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
2392971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2393971bb1a5SLionel Sambuc
2394971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2395971bb1a5SLionel Sambuc return xcb_ret;
2396971bb1a5SLionel Sambuc }
2397971bb1a5SLionel Sambuc
2398971bb1a5SLionel Sambuc xcb_x_print_print_set_image_resolution_cookie_t
xcb_x_print_print_set_image_resolution_unchecked(xcb_connection_t * c,xcb_x_print_pcontext_t context,uint16_t image_resolution)2399971bb1a5SLionel Sambuc xcb_x_print_print_set_image_resolution_unchecked (xcb_connection_t *c /**< */,
2400971bb1a5SLionel Sambuc xcb_x_print_pcontext_t context /**< */,
2401971bb1a5SLionel Sambuc uint16_t image_resolution /**< */)
2402971bb1a5SLionel Sambuc {
2403971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
2404971bb1a5SLionel Sambuc /* count */ 2,
2405971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
2406971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_PRINT_SET_IMAGE_RESOLUTION,
2407971bb1a5SLionel Sambuc /* isvoid */ 0
2408971bb1a5SLionel Sambuc };
2409971bb1a5SLionel Sambuc
2410971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
2411971bb1a5SLionel Sambuc xcb_x_print_print_set_image_resolution_cookie_t xcb_ret;
2412971bb1a5SLionel Sambuc xcb_x_print_print_set_image_resolution_request_t xcb_out;
2413971bb1a5SLionel Sambuc
2414971bb1a5SLionel Sambuc xcb_out.context = context;
2415971bb1a5SLionel Sambuc xcb_out.image_resolution = image_resolution;
2416971bb1a5SLionel Sambuc
2417971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
2418971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
2419971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
2420971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2421971bb1a5SLionel Sambuc
2422971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2423971bb1a5SLionel Sambuc return xcb_ret;
2424971bb1a5SLionel Sambuc }
2425971bb1a5SLionel Sambuc
2426971bb1a5SLionel Sambuc xcb_x_print_print_set_image_resolution_reply_t *
xcb_x_print_print_set_image_resolution_reply(xcb_connection_t * c,xcb_x_print_print_set_image_resolution_cookie_t cookie,xcb_generic_error_t ** e)2427971bb1a5SLionel Sambuc xcb_x_print_print_set_image_resolution_reply (xcb_connection_t *c /**< */,
2428971bb1a5SLionel Sambuc xcb_x_print_print_set_image_resolution_cookie_t cookie /**< */,
2429971bb1a5SLionel Sambuc xcb_generic_error_t **e /**< */)
2430971bb1a5SLionel Sambuc {
2431971bb1a5SLionel Sambuc return (xcb_x_print_print_set_image_resolution_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
2432971bb1a5SLionel Sambuc }
2433971bb1a5SLionel Sambuc
2434971bb1a5SLionel Sambuc xcb_x_print_print_get_image_resolution_cookie_t
xcb_x_print_print_get_image_resolution(xcb_connection_t * c,xcb_x_print_pcontext_t context)2435971bb1a5SLionel Sambuc xcb_x_print_print_get_image_resolution (xcb_connection_t *c /**< */,
2436971bb1a5SLionel Sambuc xcb_x_print_pcontext_t context /**< */)
2437971bb1a5SLionel Sambuc {
2438971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
2439971bb1a5SLionel Sambuc /* count */ 2,
2440971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
2441971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_PRINT_GET_IMAGE_RESOLUTION,
2442971bb1a5SLionel Sambuc /* isvoid */ 0
2443971bb1a5SLionel Sambuc };
2444971bb1a5SLionel Sambuc
2445971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
2446971bb1a5SLionel Sambuc xcb_x_print_print_get_image_resolution_cookie_t xcb_ret;
2447971bb1a5SLionel Sambuc xcb_x_print_print_get_image_resolution_request_t xcb_out;
2448971bb1a5SLionel Sambuc
2449971bb1a5SLionel Sambuc xcb_out.context = context;
2450971bb1a5SLionel Sambuc
2451971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
2452971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
2453971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
2454971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2455971bb1a5SLionel Sambuc
2456971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2457971bb1a5SLionel Sambuc return xcb_ret;
2458971bb1a5SLionel Sambuc }
2459971bb1a5SLionel Sambuc
2460971bb1a5SLionel Sambuc xcb_x_print_print_get_image_resolution_cookie_t
xcb_x_print_print_get_image_resolution_unchecked(xcb_connection_t * c,xcb_x_print_pcontext_t context)2461971bb1a5SLionel Sambuc xcb_x_print_print_get_image_resolution_unchecked (xcb_connection_t *c /**< */,
2462971bb1a5SLionel Sambuc xcb_x_print_pcontext_t context /**< */)
2463971bb1a5SLionel Sambuc {
2464971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
2465971bb1a5SLionel Sambuc /* count */ 2,
2466971bb1a5SLionel Sambuc /* ext */ &xcb_x_print_id,
2467971bb1a5SLionel Sambuc /* opcode */ XCB_X_PRINT_PRINT_GET_IMAGE_RESOLUTION,
2468971bb1a5SLionel Sambuc /* isvoid */ 0
2469971bb1a5SLionel Sambuc };
2470971bb1a5SLionel Sambuc
2471971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
2472971bb1a5SLionel Sambuc xcb_x_print_print_get_image_resolution_cookie_t xcb_ret;
2473971bb1a5SLionel Sambuc xcb_x_print_print_get_image_resolution_request_t xcb_out;
2474971bb1a5SLionel Sambuc
2475971bb1a5SLionel Sambuc xcb_out.context = context;
2476971bb1a5SLionel Sambuc
2477971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
2478971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
2479971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
2480971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2481971bb1a5SLionel Sambuc
2482971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2483971bb1a5SLionel Sambuc return xcb_ret;
2484971bb1a5SLionel Sambuc }
2485971bb1a5SLionel Sambuc
2486971bb1a5SLionel Sambuc xcb_x_print_print_get_image_resolution_reply_t *
xcb_x_print_print_get_image_resolution_reply(xcb_connection_t * c,xcb_x_print_print_get_image_resolution_cookie_t cookie,xcb_generic_error_t ** e)2487971bb1a5SLionel Sambuc xcb_x_print_print_get_image_resolution_reply (xcb_connection_t *c /**< */,
2488971bb1a5SLionel Sambuc xcb_x_print_print_get_image_resolution_cookie_t cookie /**< */,
2489971bb1a5SLionel Sambuc xcb_generic_error_t **e /**< */)
2490971bb1a5SLionel Sambuc {
2491971bb1a5SLionel Sambuc return (xcb_x_print_print_get_image_resolution_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
2492971bb1a5SLionel Sambuc }
2493971bb1a5SLionel Sambuc
2494