1971bb1a5SLionel Sambuc /*
2971bb1a5SLionel Sambuc * This file generated automatically from randr.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 "randr.h"
15971bb1a5SLionel Sambuc
16971bb1a5SLionel Sambuc #define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member)
17971bb1a5SLionel Sambuc #include "xproto.h"
18971bb1a5SLionel Sambuc #include "render.h"
19971bb1a5SLionel Sambuc
20971bb1a5SLionel Sambuc xcb_extension_t xcb_randr_id = { "RANDR", 0 };
21971bb1a5SLionel Sambuc
22971bb1a5SLionel Sambuc void
xcb_randr_mode_next(xcb_randr_mode_iterator_t * i)23971bb1a5SLionel Sambuc xcb_randr_mode_next (xcb_randr_mode_iterator_t *i /**< */)
24971bb1a5SLionel Sambuc {
25971bb1a5SLionel Sambuc --i->rem;
26971bb1a5SLionel Sambuc ++i->data;
27971bb1a5SLionel Sambuc i->index += sizeof(xcb_randr_mode_t);
28971bb1a5SLionel Sambuc }
29971bb1a5SLionel Sambuc
30971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_randr_mode_end(xcb_randr_mode_iterator_t i)31971bb1a5SLionel Sambuc xcb_randr_mode_end (xcb_randr_mode_iterator_t i /**< */)
32971bb1a5SLionel Sambuc {
33971bb1a5SLionel Sambuc xcb_generic_iterator_t ret;
34971bb1a5SLionel Sambuc ret.data = i.data + i.rem;
35971bb1a5SLionel Sambuc ret.index = i.index + ((char *) ret.data - (char *) i.data);
36971bb1a5SLionel Sambuc ret.rem = 0;
37971bb1a5SLionel Sambuc return ret;
38971bb1a5SLionel Sambuc }
39971bb1a5SLionel Sambuc
40971bb1a5SLionel Sambuc void
xcb_randr_crtc_next(xcb_randr_crtc_iterator_t * i)41971bb1a5SLionel Sambuc xcb_randr_crtc_next (xcb_randr_crtc_iterator_t *i /**< */)
42971bb1a5SLionel Sambuc {
43971bb1a5SLionel Sambuc --i->rem;
44971bb1a5SLionel Sambuc ++i->data;
45971bb1a5SLionel Sambuc i->index += sizeof(xcb_randr_crtc_t);
46971bb1a5SLionel Sambuc }
47971bb1a5SLionel Sambuc
48971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_randr_crtc_end(xcb_randr_crtc_iterator_t i)49971bb1a5SLionel Sambuc xcb_randr_crtc_end (xcb_randr_crtc_iterator_t i /**< */)
50971bb1a5SLionel Sambuc {
51971bb1a5SLionel Sambuc xcb_generic_iterator_t ret;
52971bb1a5SLionel Sambuc ret.data = i.data + i.rem;
53971bb1a5SLionel Sambuc ret.index = i.index + ((char *) ret.data - (char *) i.data);
54971bb1a5SLionel Sambuc ret.rem = 0;
55971bb1a5SLionel Sambuc return ret;
56971bb1a5SLionel Sambuc }
57971bb1a5SLionel Sambuc
58971bb1a5SLionel Sambuc void
xcb_randr_output_next(xcb_randr_output_iterator_t * i)59971bb1a5SLionel Sambuc xcb_randr_output_next (xcb_randr_output_iterator_t *i /**< */)
60971bb1a5SLionel Sambuc {
61971bb1a5SLionel Sambuc --i->rem;
62971bb1a5SLionel Sambuc ++i->data;
63971bb1a5SLionel Sambuc i->index += sizeof(xcb_randr_output_t);
64971bb1a5SLionel Sambuc }
65971bb1a5SLionel Sambuc
66971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_randr_output_end(xcb_randr_output_iterator_t i)67971bb1a5SLionel Sambuc xcb_randr_output_end (xcb_randr_output_iterator_t i /**< */)
68971bb1a5SLionel Sambuc {
69971bb1a5SLionel Sambuc xcb_generic_iterator_t ret;
70971bb1a5SLionel Sambuc ret.data = i.data + i.rem;
71971bb1a5SLionel Sambuc ret.index = i.index + ((char *) ret.data - (char *) i.data);
72971bb1a5SLionel Sambuc ret.rem = 0;
73971bb1a5SLionel Sambuc return ret;
74971bb1a5SLionel Sambuc }
75971bb1a5SLionel Sambuc
76*0a6a1f1dSLionel Sambuc void
xcb_randr_provider_next(xcb_randr_provider_iterator_t * i)77*0a6a1f1dSLionel Sambuc xcb_randr_provider_next (xcb_randr_provider_iterator_t *i /**< */)
78*0a6a1f1dSLionel Sambuc {
79*0a6a1f1dSLionel Sambuc --i->rem;
80*0a6a1f1dSLionel Sambuc ++i->data;
81*0a6a1f1dSLionel Sambuc i->index += sizeof(xcb_randr_provider_t);
82*0a6a1f1dSLionel Sambuc }
83971bb1a5SLionel Sambuc
84*0a6a1f1dSLionel Sambuc xcb_generic_iterator_t
xcb_randr_provider_end(xcb_randr_provider_iterator_t i)85*0a6a1f1dSLionel Sambuc xcb_randr_provider_end (xcb_randr_provider_iterator_t i /**< */)
86*0a6a1f1dSLionel Sambuc {
87*0a6a1f1dSLionel Sambuc xcb_generic_iterator_t ret;
88*0a6a1f1dSLionel Sambuc ret.data = i.data + i.rem;
89*0a6a1f1dSLionel Sambuc ret.index = i.index + ((char *) ret.data - (char *) i.data);
90*0a6a1f1dSLionel Sambuc ret.rem = 0;
91*0a6a1f1dSLionel Sambuc return ret;
92*0a6a1f1dSLionel Sambuc }
93971bb1a5SLionel Sambuc
94971bb1a5SLionel Sambuc void
xcb_randr_screen_size_next(xcb_randr_screen_size_iterator_t * i)95971bb1a5SLionel Sambuc xcb_randr_screen_size_next (xcb_randr_screen_size_iterator_t *i /**< */)
96971bb1a5SLionel Sambuc {
97971bb1a5SLionel Sambuc --i->rem;
98971bb1a5SLionel Sambuc ++i->data;
99971bb1a5SLionel Sambuc i->index += sizeof(xcb_randr_screen_size_t);
100971bb1a5SLionel Sambuc }
101971bb1a5SLionel Sambuc
102971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_randr_screen_size_end(xcb_randr_screen_size_iterator_t i)103971bb1a5SLionel Sambuc xcb_randr_screen_size_end (xcb_randr_screen_size_iterator_t i /**< */)
104971bb1a5SLionel Sambuc {
105971bb1a5SLionel Sambuc xcb_generic_iterator_t ret;
106971bb1a5SLionel Sambuc ret.data = i.data + i.rem;
107971bb1a5SLionel Sambuc ret.index = i.index + ((char *) ret.data - (char *) i.data);
108971bb1a5SLionel Sambuc ret.rem = 0;
109971bb1a5SLionel Sambuc return ret;
110971bb1a5SLionel Sambuc }
111971bb1a5SLionel Sambuc
112971bb1a5SLionel Sambuc int
xcb_randr_refresh_rates_sizeof(const void * _buffer)113971bb1a5SLionel Sambuc xcb_randr_refresh_rates_sizeof (const void *_buffer /**< */)
114971bb1a5SLionel Sambuc {
115971bb1a5SLionel Sambuc char *xcb_tmp = (char *)_buffer;
116971bb1a5SLionel Sambuc const xcb_randr_refresh_rates_t *_aux = (xcb_randr_refresh_rates_t *)_buffer;
117971bb1a5SLionel Sambuc unsigned int xcb_buffer_len = 0;
118971bb1a5SLionel Sambuc unsigned int xcb_block_len = 0;
119971bb1a5SLionel Sambuc unsigned int xcb_pad = 0;
120*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
121971bb1a5SLionel Sambuc
122971bb1a5SLionel Sambuc
123971bb1a5SLionel Sambuc xcb_block_len += sizeof(xcb_randr_refresh_rates_t);
124971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
125*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len;
126*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
127971bb1a5SLionel Sambuc /* rates */
128971bb1a5SLionel Sambuc xcb_block_len += _aux->nRates * sizeof(uint16_t);
129971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
130971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(uint16_t);
131971bb1a5SLionel Sambuc /* insert padding */
132971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
133971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
134971bb1a5SLionel Sambuc if (0 != xcb_pad) {
135971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
136971bb1a5SLionel Sambuc xcb_pad = 0;
137971bb1a5SLionel Sambuc }
138971bb1a5SLionel Sambuc xcb_block_len = 0;
139971bb1a5SLionel Sambuc
140971bb1a5SLionel Sambuc return xcb_buffer_len;
141971bb1a5SLionel Sambuc }
142971bb1a5SLionel Sambuc
143971bb1a5SLionel Sambuc uint16_t *
xcb_randr_refresh_rates_rates(const xcb_randr_refresh_rates_t * R)144971bb1a5SLionel Sambuc xcb_randr_refresh_rates_rates (const xcb_randr_refresh_rates_t *R /**< */)
145971bb1a5SLionel Sambuc {
146971bb1a5SLionel Sambuc return (uint16_t *) (R + 1);
147971bb1a5SLionel Sambuc }
148971bb1a5SLionel Sambuc
149971bb1a5SLionel Sambuc int
xcb_randr_refresh_rates_rates_length(const xcb_randr_refresh_rates_t * R)150971bb1a5SLionel Sambuc xcb_randr_refresh_rates_rates_length (const xcb_randr_refresh_rates_t *R /**< */)
151971bb1a5SLionel Sambuc {
152971bb1a5SLionel Sambuc return R->nRates;
153971bb1a5SLionel Sambuc }
154971bb1a5SLionel Sambuc
155971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_randr_refresh_rates_rates_end(const xcb_randr_refresh_rates_t * R)156971bb1a5SLionel Sambuc xcb_randr_refresh_rates_rates_end (const xcb_randr_refresh_rates_t *R /**< */)
157971bb1a5SLionel Sambuc {
158971bb1a5SLionel Sambuc xcb_generic_iterator_t i;
159971bb1a5SLionel Sambuc i.data = ((uint16_t *) (R + 1)) + (R->nRates);
160971bb1a5SLionel Sambuc i.rem = 0;
161971bb1a5SLionel Sambuc i.index = (char *) i.data - (char *) R;
162971bb1a5SLionel Sambuc return i;
163971bb1a5SLionel Sambuc }
164971bb1a5SLionel Sambuc
165971bb1a5SLionel Sambuc void
xcb_randr_refresh_rates_next(xcb_randr_refresh_rates_iterator_t * i)166971bb1a5SLionel Sambuc xcb_randr_refresh_rates_next (xcb_randr_refresh_rates_iterator_t *i /**< */)
167971bb1a5SLionel Sambuc {
168971bb1a5SLionel Sambuc xcb_randr_refresh_rates_t *R = i->data;
169971bb1a5SLionel Sambuc xcb_generic_iterator_t child;
170971bb1a5SLionel Sambuc child.data = (xcb_randr_refresh_rates_t *)(((char *)R) + xcb_randr_refresh_rates_sizeof(R));
171971bb1a5SLionel Sambuc i->index = (char *) child.data - (char *) i->data;
172971bb1a5SLionel Sambuc --i->rem;
173971bb1a5SLionel Sambuc i->data = (xcb_randr_refresh_rates_t *) child.data;
174971bb1a5SLionel Sambuc }
175971bb1a5SLionel Sambuc
176971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_randr_refresh_rates_end(xcb_randr_refresh_rates_iterator_t i)177971bb1a5SLionel Sambuc xcb_randr_refresh_rates_end (xcb_randr_refresh_rates_iterator_t i /**< */)
178971bb1a5SLionel Sambuc {
179971bb1a5SLionel Sambuc xcb_generic_iterator_t ret;
180971bb1a5SLionel Sambuc while(i.rem > 0)
181971bb1a5SLionel Sambuc xcb_randr_refresh_rates_next(&i);
182971bb1a5SLionel Sambuc ret.data = i.data;
183971bb1a5SLionel Sambuc ret.rem = i.rem;
184971bb1a5SLionel Sambuc ret.index = i.index;
185971bb1a5SLionel Sambuc return ret;
186971bb1a5SLionel Sambuc }
187971bb1a5SLionel Sambuc
188971bb1a5SLionel Sambuc xcb_randr_query_version_cookie_t
xcb_randr_query_version(xcb_connection_t * c,uint32_t major_version,uint32_t minor_version)189971bb1a5SLionel Sambuc xcb_randr_query_version (xcb_connection_t *c /**< */,
190971bb1a5SLionel Sambuc uint32_t major_version /**< */,
191971bb1a5SLionel Sambuc uint32_t minor_version /**< */)
192971bb1a5SLionel Sambuc {
193971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
194971bb1a5SLionel Sambuc /* count */ 2,
195971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
196971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_QUERY_VERSION,
197971bb1a5SLionel Sambuc /* isvoid */ 0
198971bb1a5SLionel Sambuc };
199971bb1a5SLionel Sambuc
200971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
201971bb1a5SLionel Sambuc xcb_randr_query_version_cookie_t xcb_ret;
202971bb1a5SLionel Sambuc xcb_randr_query_version_request_t xcb_out;
203971bb1a5SLionel Sambuc
204971bb1a5SLionel Sambuc xcb_out.major_version = major_version;
205971bb1a5SLionel Sambuc xcb_out.minor_version = minor_version;
206971bb1a5SLionel Sambuc
207971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
208971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
209971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
210971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
211971bb1a5SLionel Sambuc
212971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
213971bb1a5SLionel Sambuc return xcb_ret;
214971bb1a5SLionel Sambuc }
215971bb1a5SLionel Sambuc
216971bb1a5SLionel Sambuc xcb_randr_query_version_cookie_t
xcb_randr_query_version_unchecked(xcb_connection_t * c,uint32_t major_version,uint32_t minor_version)217971bb1a5SLionel Sambuc xcb_randr_query_version_unchecked (xcb_connection_t *c /**< */,
218971bb1a5SLionel Sambuc uint32_t major_version /**< */,
219971bb1a5SLionel Sambuc uint32_t minor_version /**< */)
220971bb1a5SLionel Sambuc {
221971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
222971bb1a5SLionel Sambuc /* count */ 2,
223971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
224971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_QUERY_VERSION,
225971bb1a5SLionel Sambuc /* isvoid */ 0
226971bb1a5SLionel Sambuc };
227971bb1a5SLionel Sambuc
228971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
229971bb1a5SLionel Sambuc xcb_randr_query_version_cookie_t xcb_ret;
230971bb1a5SLionel Sambuc xcb_randr_query_version_request_t xcb_out;
231971bb1a5SLionel Sambuc
232971bb1a5SLionel Sambuc xcb_out.major_version = major_version;
233971bb1a5SLionel Sambuc xcb_out.minor_version = minor_version;
234971bb1a5SLionel Sambuc
235971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
236971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
237971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
238971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
239971bb1a5SLionel Sambuc
240971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
241971bb1a5SLionel Sambuc return xcb_ret;
242971bb1a5SLionel Sambuc }
243971bb1a5SLionel Sambuc
244971bb1a5SLionel Sambuc xcb_randr_query_version_reply_t *
xcb_randr_query_version_reply(xcb_connection_t * c,xcb_randr_query_version_cookie_t cookie,xcb_generic_error_t ** e)245971bb1a5SLionel Sambuc xcb_randr_query_version_reply (xcb_connection_t *c /**< */,
246971bb1a5SLionel Sambuc xcb_randr_query_version_cookie_t cookie /**< */,
247971bb1a5SLionel Sambuc xcb_generic_error_t **e /**< */)
248971bb1a5SLionel Sambuc {
249971bb1a5SLionel Sambuc return (xcb_randr_query_version_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
250971bb1a5SLionel Sambuc }
251971bb1a5SLionel Sambuc
252971bb1a5SLionel Sambuc xcb_randr_set_screen_config_cookie_t
xcb_randr_set_screen_config(xcb_connection_t * c,xcb_window_t window,xcb_timestamp_t timestamp,xcb_timestamp_t config_timestamp,uint16_t sizeID,uint16_t rotation,uint16_t rate)253971bb1a5SLionel Sambuc xcb_randr_set_screen_config (xcb_connection_t *c /**< */,
254971bb1a5SLionel Sambuc xcb_window_t window /**< */,
255971bb1a5SLionel Sambuc xcb_timestamp_t timestamp /**< */,
256971bb1a5SLionel Sambuc xcb_timestamp_t config_timestamp /**< */,
257971bb1a5SLionel Sambuc uint16_t sizeID /**< */,
258971bb1a5SLionel Sambuc uint16_t rotation /**< */,
259971bb1a5SLionel Sambuc uint16_t rate /**< */)
260971bb1a5SLionel Sambuc {
261971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
262971bb1a5SLionel Sambuc /* count */ 2,
263971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
264971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_SET_SCREEN_CONFIG,
265971bb1a5SLionel Sambuc /* isvoid */ 0
266971bb1a5SLionel Sambuc };
267971bb1a5SLionel Sambuc
268971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
269971bb1a5SLionel Sambuc xcb_randr_set_screen_config_cookie_t xcb_ret;
270971bb1a5SLionel Sambuc xcb_randr_set_screen_config_request_t xcb_out;
271971bb1a5SLionel Sambuc
272971bb1a5SLionel Sambuc xcb_out.window = window;
273971bb1a5SLionel Sambuc xcb_out.timestamp = timestamp;
274971bb1a5SLionel Sambuc xcb_out.config_timestamp = config_timestamp;
275971bb1a5SLionel Sambuc xcb_out.sizeID = sizeID;
276971bb1a5SLionel Sambuc xcb_out.rotation = rotation;
277971bb1a5SLionel Sambuc xcb_out.rate = rate;
278971bb1a5SLionel Sambuc memset(xcb_out.pad0, 0, 2);
279971bb1a5SLionel Sambuc
280971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
281971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
282971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
283971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
284971bb1a5SLionel Sambuc
285971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
286971bb1a5SLionel Sambuc return xcb_ret;
287971bb1a5SLionel Sambuc }
288971bb1a5SLionel Sambuc
289971bb1a5SLionel Sambuc xcb_randr_set_screen_config_cookie_t
xcb_randr_set_screen_config_unchecked(xcb_connection_t * c,xcb_window_t window,xcb_timestamp_t timestamp,xcb_timestamp_t config_timestamp,uint16_t sizeID,uint16_t rotation,uint16_t rate)290971bb1a5SLionel Sambuc xcb_randr_set_screen_config_unchecked (xcb_connection_t *c /**< */,
291971bb1a5SLionel Sambuc xcb_window_t window /**< */,
292971bb1a5SLionel Sambuc xcb_timestamp_t timestamp /**< */,
293971bb1a5SLionel Sambuc xcb_timestamp_t config_timestamp /**< */,
294971bb1a5SLionel Sambuc uint16_t sizeID /**< */,
295971bb1a5SLionel Sambuc uint16_t rotation /**< */,
296971bb1a5SLionel Sambuc uint16_t rate /**< */)
297971bb1a5SLionel Sambuc {
298971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
299971bb1a5SLionel Sambuc /* count */ 2,
300971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
301971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_SET_SCREEN_CONFIG,
302971bb1a5SLionel Sambuc /* isvoid */ 0
303971bb1a5SLionel Sambuc };
304971bb1a5SLionel Sambuc
305971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
306971bb1a5SLionel Sambuc xcb_randr_set_screen_config_cookie_t xcb_ret;
307971bb1a5SLionel Sambuc xcb_randr_set_screen_config_request_t xcb_out;
308971bb1a5SLionel Sambuc
309971bb1a5SLionel Sambuc xcb_out.window = window;
310971bb1a5SLionel Sambuc xcb_out.timestamp = timestamp;
311971bb1a5SLionel Sambuc xcb_out.config_timestamp = config_timestamp;
312971bb1a5SLionel Sambuc xcb_out.sizeID = sizeID;
313971bb1a5SLionel Sambuc xcb_out.rotation = rotation;
314971bb1a5SLionel Sambuc xcb_out.rate = rate;
315971bb1a5SLionel Sambuc memset(xcb_out.pad0, 0, 2);
316971bb1a5SLionel Sambuc
317971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
318971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
319971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
320971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
321971bb1a5SLionel Sambuc
322971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
323971bb1a5SLionel Sambuc return xcb_ret;
324971bb1a5SLionel Sambuc }
325971bb1a5SLionel Sambuc
326971bb1a5SLionel Sambuc xcb_randr_set_screen_config_reply_t *
xcb_randr_set_screen_config_reply(xcb_connection_t * c,xcb_randr_set_screen_config_cookie_t cookie,xcb_generic_error_t ** e)327971bb1a5SLionel Sambuc xcb_randr_set_screen_config_reply (xcb_connection_t *c /**< */,
328971bb1a5SLionel Sambuc xcb_randr_set_screen_config_cookie_t cookie /**< */,
329971bb1a5SLionel Sambuc xcb_generic_error_t **e /**< */)
330971bb1a5SLionel Sambuc {
331971bb1a5SLionel Sambuc return (xcb_randr_set_screen_config_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
332971bb1a5SLionel Sambuc }
333971bb1a5SLionel Sambuc
334971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_randr_select_input_checked(xcb_connection_t * c,xcb_window_t window,uint16_t enable)335971bb1a5SLionel Sambuc xcb_randr_select_input_checked (xcb_connection_t *c /**< */,
336971bb1a5SLionel Sambuc xcb_window_t window /**< */,
337971bb1a5SLionel Sambuc uint16_t enable /**< */)
338971bb1a5SLionel Sambuc {
339971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
340971bb1a5SLionel Sambuc /* count */ 2,
341971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
342971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_SELECT_INPUT,
343971bb1a5SLionel Sambuc /* isvoid */ 1
344971bb1a5SLionel Sambuc };
345971bb1a5SLionel Sambuc
346971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
347971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
348971bb1a5SLionel Sambuc xcb_randr_select_input_request_t xcb_out;
349971bb1a5SLionel Sambuc
350971bb1a5SLionel Sambuc xcb_out.window = window;
351971bb1a5SLionel Sambuc xcb_out.enable = enable;
352971bb1a5SLionel Sambuc memset(xcb_out.pad0, 0, 2);
353971bb1a5SLionel Sambuc
354971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
355971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
356971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
357971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
358971bb1a5SLionel Sambuc
359971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
360971bb1a5SLionel Sambuc return xcb_ret;
361971bb1a5SLionel Sambuc }
362971bb1a5SLionel Sambuc
363971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_randr_select_input(xcb_connection_t * c,xcb_window_t window,uint16_t enable)364971bb1a5SLionel Sambuc xcb_randr_select_input (xcb_connection_t *c /**< */,
365971bb1a5SLionel Sambuc xcb_window_t window /**< */,
366971bb1a5SLionel Sambuc uint16_t enable /**< */)
367971bb1a5SLionel Sambuc {
368971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
369971bb1a5SLionel Sambuc /* count */ 2,
370971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
371971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_SELECT_INPUT,
372971bb1a5SLionel Sambuc /* isvoid */ 1
373971bb1a5SLionel Sambuc };
374971bb1a5SLionel Sambuc
375971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
376971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
377971bb1a5SLionel Sambuc xcb_randr_select_input_request_t xcb_out;
378971bb1a5SLionel Sambuc
379971bb1a5SLionel Sambuc xcb_out.window = window;
380971bb1a5SLionel Sambuc xcb_out.enable = enable;
381971bb1a5SLionel Sambuc memset(xcb_out.pad0, 0, 2);
382971bb1a5SLionel Sambuc
383971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
384971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
385971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
386971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
387971bb1a5SLionel Sambuc
388971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
389971bb1a5SLionel Sambuc return xcb_ret;
390971bb1a5SLionel Sambuc }
391971bb1a5SLionel Sambuc
392971bb1a5SLionel Sambuc int
xcb_randr_get_screen_info_sizeof(const void * _buffer)393971bb1a5SLionel Sambuc xcb_randr_get_screen_info_sizeof (const void *_buffer /**< */)
394971bb1a5SLionel Sambuc {
395971bb1a5SLionel Sambuc char *xcb_tmp = (char *)_buffer;
396971bb1a5SLionel Sambuc const xcb_randr_get_screen_info_reply_t *_aux = (xcb_randr_get_screen_info_reply_t *)_buffer;
397971bb1a5SLionel Sambuc unsigned int xcb_buffer_len = 0;
398971bb1a5SLionel Sambuc unsigned int xcb_block_len = 0;
399971bb1a5SLionel Sambuc unsigned int xcb_pad = 0;
400*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
401971bb1a5SLionel Sambuc
402971bb1a5SLionel Sambuc unsigned int i;
403971bb1a5SLionel Sambuc unsigned int xcb_tmp_len;
404971bb1a5SLionel Sambuc
405971bb1a5SLionel Sambuc xcb_block_len += sizeof(xcb_randr_get_screen_info_reply_t);
406971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
407*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len;
408*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
409971bb1a5SLionel Sambuc /* sizes */
410971bb1a5SLionel Sambuc xcb_block_len += _aux->nSizes * sizeof(xcb_randr_screen_size_t);
411971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
412971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(xcb_randr_screen_size_t);
413971bb1a5SLionel Sambuc /* insert padding */
414971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
415971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
416971bb1a5SLionel Sambuc if (0 != xcb_pad) {
417971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
418971bb1a5SLionel Sambuc xcb_pad = 0;
419971bb1a5SLionel Sambuc }
420971bb1a5SLionel Sambuc xcb_block_len = 0;
421971bb1a5SLionel Sambuc /* rates */
422971bb1a5SLionel Sambuc for(i=0; i<(_aux->nInfo - _aux->nSizes); i++) {
423971bb1a5SLionel Sambuc xcb_tmp_len = xcb_randr_refresh_rates_sizeof(xcb_tmp);
424971bb1a5SLionel Sambuc xcb_block_len += xcb_tmp_len;
425971bb1a5SLionel Sambuc xcb_tmp += xcb_tmp_len;
426971bb1a5SLionel Sambuc }
427971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(xcb_randr_refresh_rates_t);
428971bb1a5SLionel Sambuc /* insert padding */
429971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
430971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
431971bb1a5SLionel Sambuc if (0 != xcb_pad) {
432971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
433971bb1a5SLionel Sambuc xcb_pad = 0;
434971bb1a5SLionel Sambuc }
435971bb1a5SLionel Sambuc xcb_block_len = 0;
436971bb1a5SLionel Sambuc
437971bb1a5SLionel Sambuc return xcb_buffer_len;
438971bb1a5SLionel Sambuc }
439971bb1a5SLionel Sambuc
440971bb1a5SLionel Sambuc xcb_randr_get_screen_info_cookie_t
xcb_randr_get_screen_info(xcb_connection_t * c,xcb_window_t window)441971bb1a5SLionel Sambuc xcb_randr_get_screen_info (xcb_connection_t *c /**< */,
442971bb1a5SLionel Sambuc xcb_window_t window /**< */)
443971bb1a5SLionel Sambuc {
444971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
445971bb1a5SLionel Sambuc /* count */ 2,
446971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
447971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_GET_SCREEN_INFO,
448971bb1a5SLionel Sambuc /* isvoid */ 0
449971bb1a5SLionel Sambuc };
450971bb1a5SLionel Sambuc
451971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
452971bb1a5SLionel Sambuc xcb_randr_get_screen_info_cookie_t xcb_ret;
453971bb1a5SLionel Sambuc xcb_randr_get_screen_info_request_t xcb_out;
454971bb1a5SLionel Sambuc
455971bb1a5SLionel Sambuc xcb_out.window = window;
456971bb1a5SLionel Sambuc
457971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
458971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
459971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
460971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
461971bb1a5SLionel Sambuc
462971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
463971bb1a5SLionel Sambuc return xcb_ret;
464971bb1a5SLionel Sambuc }
465971bb1a5SLionel Sambuc
466971bb1a5SLionel Sambuc xcb_randr_get_screen_info_cookie_t
xcb_randr_get_screen_info_unchecked(xcb_connection_t * c,xcb_window_t window)467971bb1a5SLionel Sambuc xcb_randr_get_screen_info_unchecked (xcb_connection_t *c /**< */,
468971bb1a5SLionel Sambuc xcb_window_t window /**< */)
469971bb1a5SLionel Sambuc {
470971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
471971bb1a5SLionel Sambuc /* count */ 2,
472971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
473971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_GET_SCREEN_INFO,
474971bb1a5SLionel Sambuc /* isvoid */ 0
475971bb1a5SLionel Sambuc };
476971bb1a5SLionel Sambuc
477971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
478971bb1a5SLionel Sambuc xcb_randr_get_screen_info_cookie_t xcb_ret;
479971bb1a5SLionel Sambuc xcb_randr_get_screen_info_request_t xcb_out;
480971bb1a5SLionel Sambuc
481971bb1a5SLionel Sambuc xcb_out.window = window;
482971bb1a5SLionel Sambuc
483971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
484971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
485971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
486971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
487971bb1a5SLionel Sambuc
488971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
489971bb1a5SLionel Sambuc return xcb_ret;
490971bb1a5SLionel Sambuc }
491971bb1a5SLionel Sambuc
492971bb1a5SLionel Sambuc xcb_randr_screen_size_t *
xcb_randr_get_screen_info_sizes(const xcb_randr_get_screen_info_reply_t * R)493971bb1a5SLionel Sambuc xcb_randr_get_screen_info_sizes (const xcb_randr_get_screen_info_reply_t *R /**< */)
494971bb1a5SLionel Sambuc {
495971bb1a5SLionel Sambuc return (xcb_randr_screen_size_t *) (R + 1);
496971bb1a5SLionel Sambuc }
497971bb1a5SLionel Sambuc
498971bb1a5SLionel Sambuc int
xcb_randr_get_screen_info_sizes_length(const xcb_randr_get_screen_info_reply_t * R)499971bb1a5SLionel Sambuc xcb_randr_get_screen_info_sizes_length (const xcb_randr_get_screen_info_reply_t *R /**< */)
500971bb1a5SLionel Sambuc {
501971bb1a5SLionel Sambuc return R->nSizes;
502971bb1a5SLionel Sambuc }
503971bb1a5SLionel Sambuc
504971bb1a5SLionel Sambuc xcb_randr_screen_size_iterator_t
xcb_randr_get_screen_info_sizes_iterator(const xcb_randr_get_screen_info_reply_t * R)505971bb1a5SLionel Sambuc xcb_randr_get_screen_info_sizes_iterator (const xcb_randr_get_screen_info_reply_t *R /**< */)
506971bb1a5SLionel Sambuc {
507971bb1a5SLionel Sambuc xcb_randr_screen_size_iterator_t i;
508971bb1a5SLionel Sambuc i.data = (xcb_randr_screen_size_t *) (R + 1);
509971bb1a5SLionel Sambuc i.rem = R->nSizes;
510971bb1a5SLionel Sambuc i.index = (char *) i.data - (char *) R;
511971bb1a5SLionel Sambuc return i;
512971bb1a5SLionel Sambuc }
513971bb1a5SLionel Sambuc
514971bb1a5SLionel Sambuc int
xcb_randr_get_screen_info_rates_length(const xcb_randr_get_screen_info_reply_t * R)515971bb1a5SLionel Sambuc xcb_randr_get_screen_info_rates_length (const xcb_randr_get_screen_info_reply_t *R /**< */)
516971bb1a5SLionel Sambuc {
517971bb1a5SLionel Sambuc return (R->nInfo - R->nSizes);
518971bb1a5SLionel Sambuc }
519971bb1a5SLionel Sambuc
520971bb1a5SLionel Sambuc xcb_randr_refresh_rates_iterator_t
xcb_randr_get_screen_info_rates_iterator(const xcb_randr_get_screen_info_reply_t * R)521971bb1a5SLionel Sambuc xcb_randr_get_screen_info_rates_iterator (const xcb_randr_get_screen_info_reply_t *R /**< */)
522971bb1a5SLionel Sambuc {
523971bb1a5SLionel Sambuc xcb_randr_refresh_rates_iterator_t i;
524971bb1a5SLionel Sambuc xcb_generic_iterator_t prev = xcb_randr_screen_size_end(xcb_randr_get_screen_info_sizes_iterator(R));
525971bb1a5SLionel Sambuc i.data = (xcb_randr_refresh_rates_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_randr_refresh_rates_t, prev.index));
526971bb1a5SLionel Sambuc i.rem = (R->nInfo - R->nSizes);
527971bb1a5SLionel Sambuc i.index = (char *) i.data - (char *) R;
528971bb1a5SLionel Sambuc return i;
529971bb1a5SLionel Sambuc }
530971bb1a5SLionel Sambuc
531971bb1a5SLionel Sambuc xcb_randr_get_screen_info_reply_t *
xcb_randr_get_screen_info_reply(xcb_connection_t * c,xcb_randr_get_screen_info_cookie_t cookie,xcb_generic_error_t ** e)532971bb1a5SLionel Sambuc xcb_randr_get_screen_info_reply (xcb_connection_t *c /**< */,
533971bb1a5SLionel Sambuc xcb_randr_get_screen_info_cookie_t cookie /**< */,
534971bb1a5SLionel Sambuc xcb_generic_error_t **e /**< */)
535971bb1a5SLionel Sambuc {
536971bb1a5SLionel Sambuc return (xcb_randr_get_screen_info_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
537971bb1a5SLionel Sambuc }
538971bb1a5SLionel Sambuc
539971bb1a5SLionel Sambuc xcb_randr_get_screen_size_range_cookie_t
xcb_randr_get_screen_size_range(xcb_connection_t * c,xcb_window_t window)540971bb1a5SLionel Sambuc xcb_randr_get_screen_size_range (xcb_connection_t *c /**< */,
541971bb1a5SLionel Sambuc xcb_window_t window /**< */)
542971bb1a5SLionel Sambuc {
543971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
544971bb1a5SLionel Sambuc /* count */ 2,
545971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
546971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_GET_SCREEN_SIZE_RANGE,
547971bb1a5SLionel Sambuc /* isvoid */ 0
548971bb1a5SLionel Sambuc };
549971bb1a5SLionel Sambuc
550971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
551971bb1a5SLionel Sambuc xcb_randr_get_screen_size_range_cookie_t xcb_ret;
552971bb1a5SLionel Sambuc xcb_randr_get_screen_size_range_request_t xcb_out;
553971bb1a5SLionel Sambuc
554971bb1a5SLionel Sambuc xcb_out.window = window;
555971bb1a5SLionel Sambuc
556971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
557971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
558971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
559971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
560971bb1a5SLionel Sambuc
561971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
562971bb1a5SLionel Sambuc return xcb_ret;
563971bb1a5SLionel Sambuc }
564971bb1a5SLionel Sambuc
565971bb1a5SLionel Sambuc xcb_randr_get_screen_size_range_cookie_t
xcb_randr_get_screen_size_range_unchecked(xcb_connection_t * c,xcb_window_t window)566971bb1a5SLionel Sambuc xcb_randr_get_screen_size_range_unchecked (xcb_connection_t *c /**< */,
567971bb1a5SLionel Sambuc xcb_window_t window /**< */)
568971bb1a5SLionel Sambuc {
569971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
570971bb1a5SLionel Sambuc /* count */ 2,
571971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
572971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_GET_SCREEN_SIZE_RANGE,
573971bb1a5SLionel Sambuc /* isvoid */ 0
574971bb1a5SLionel Sambuc };
575971bb1a5SLionel Sambuc
576971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
577971bb1a5SLionel Sambuc xcb_randr_get_screen_size_range_cookie_t xcb_ret;
578971bb1a5SLionel Sambuc xcb_randr_get_screen_size_range_request_t xcb_out;
579971bb1a5SLionel Sambuc
580971bb1a5SLionel Sambuc xcb_out.window = window;
581971bb1a5SLionel Sambuc
582971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
583971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
584971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
585971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
586971bb1a5SLionel Sambuc
587971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
588971bb1a5SLionel Sambuc return xcb_ret;
589971bb1a5SLionel Sambuc }
590971bb1a5SLionel Sambuc
591971bb1a5SLionel Sambuc xcb_randr_get_screen_size_range_reply_t *
xcb_randr_get_screen_size_range_reply(xcb_connection_t * c,xcb_randr_get_screen_size_range_cookie_t cookie,xcb_generic_error_t ** e)592971bb1a5SLionel Sambuc xcb_randr_get_screen_size_range_reply (xcb_connection_t *c /**< */,
593971bb1a5SLionel Sambuc xcb_randr_get_screen_size_range_cookie_t cookie /**< */,
594971bb1a5SLionel Sambuc xcb_generic_error_t **e /**< */)
595971bb1a5SLionel Sambuc {
596971bb1a5SLionel Sambuc return (xcb_randr_get_screen_size_range_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
597971bb1a5SLionel Sambuc }
598971bb1a5SLionel Sambuc
599971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_randr_set_screen_size_checked(xcb_connection_t * c,xcb_window_t window,uint16_t width,uint16_t height,uint32_t mm_width,uint32_t mm_height)600971bb1a5SLionel Sambuc xcb_randr_set_screen_size_checked (xcb_connection_t *c /**< */,
601971bb1a5SLionel Sambuc xcb_window_t window /**< */,
602971bb1a5SLionel Sambuc uint16_t width /**< */,
603971bb1a5SLionel Sambuc uint16_t height /**< */,
604971bb1a5SLionel Sambuc uint32_t mm_width /**< */,
605971bb1a5SLionel Sambuc uint32_t mm_height /**< */)
606971bb1a5SLionel Sambuc {
607971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
608971bb1a5SLionel Sambuc /* count */ 2,
609971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
610971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_SET_SCREEN_SIZE,
611971bb1a5SLionel Sambuc /* isvoid */ 1
612971bb1a5SLionel Sambuc };
613971bb1a5SLionel Sambuc
614971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
615971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
616971bb1a5SLionel Sambuc xcb_randr_set_screen_size_request_t xcb_out;
617971bb1a5SLionel Sambuc
618971bb1a5SLionel Sambuc xcb_out.window = window;
619971bb1a5SLionel Sambuc xcb_out.width = width;
620971bb1a5SLionel Sambuc xcb_out.height = height;
621971bb1a5SLionel Sambuc xcb_out.mm_width = mm_width;
622971bb1a5SLionel Sambuc xcb_out.mm_height = mm_height;
623971bb1a5SLionel Sambuc
624971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
625971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
626971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
627971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
628971bb1a5SLionel Sambuc
629971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
630971bb1a5SLionel Sambuc return xcb_ret;
631971bb1a5SLionel Sambuc }
632971bb1a5SLionel Sambuc
633971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_randr_set_screen_size(xcb_connection_t * c,xcb_window_t window,uint16_t width,uint16_t height,uint32_t mm_width,uint32_t mm_height)634971bb1a5SLionel Sambuc xcb_randr_set_screen_size (xcb_connection_t *c /**< */,
635971bb1a5SLionel Sambuc xcb_window_t window /**< */,
636971bb1a5SLionel Sambuc uint16_t width /**< */,
637971bb1a5SLionel Sambuc uint16_t height /**< */,
638971bb1a5SLionel Sambuc uint32_t mm_width /**< */,
639971bb1a5SLionel Sambuc uint32_t mm_height /**< */)
640971bb1a5SLionel Sambuc {
641971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
642971bb1a5SLionel Sambuc /* count */ 2,
643971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
644971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_SET_SCREEN_SIZE,
645971bb1a5SLionel Sambuc /* isvoid */ 1
646971bb1a5SLionel Sambuc };
647971bb1a5SLionel Sambuc
648971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
649971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
650971bb1a5SLionel Sambuc xcb_randr_set_screen_size_request_t xcb_out;
651971bb1a5SLionel Sambuc
652971bb1a5SLionel Sambuc xcb_out.window = window;
653971bb1a5SLionel Sambuc xcb_out.width = width;
654971bb1a5SLionel Sambuc xcb_out.height = height;
655971bb1a5SLionel Sambuc xcb_out.mm_width = mm_width;
656971bb1a5SLionel Sambuc xcb_out.mm_height = mm_height;
657971bb1a5SLionel Sambuc
658971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
659971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
660971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
661971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
662971bb1a5SLionel Sambuc
663971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
664971bb1a5SLionel Sambuc return xcb_ret;
665971bb1a5SLionel Sambuc }
666971bb1a5SLionel Sambuc
667971bb1a5SLionel Sambuc void
xcb_randr_mode_info_next(xcb_randr_mode_info_iterator_t * i)668971bb1a5SLionel Sambuc xcb_randr_mode_info_next (xcb_randr_mode_info_iterator_t *i /**< */)
669971bb1a5SLionel Sambuc {
670971bb1a5SLionel Sambuc --i->rem;
671971bb1a5SLionel Sambuc ++i->data;
672971bb1a5SLionel Sambuc i->index += sizeof(xcb_randr_mode_info_t);
673971bb1a5SLionel Sambuc }
674971bb1a5SLionel Sambuc
675971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_randr_mode_info_end(xcb_randr_mode_info_iterator_t i)676971bb1a5SLionel Sambuc xcb_randr_mode_info_end (xcb_randr_mode_info_iterator_t i /**< */)
677971bb1a5SLionel Sambuc {
678971bb1a5SLionel Sambuc xcb_generic_iterator_t ret;
679971bb1a5SLionel Sambuc ret.data = i.data + i.rem;
680971bb1a5SLionel Sambuc ret.index = i.index + ((char *) ret.data - (char *) i.data);
681971bb1a5SLionel Sambuc ret.rem = 0;
682971bb1a5SLionel Sambuc return ret;
683971bb1a5SLionel Sambuc }
684971bb1a5SLionel Sambuc
685971bb1a5SLionel Sambuc int
xcb_randr_get_screen_resources_sizeof(const void * _buffer)686971bb1a5SLionel Sambuc xcb_randr_get_screen_resources_sizeof (const void *_buffer /**< */)
687971bb1a5SLionel Sambuc {
688971bb1a5SLionel Sambuc char *xcb_tmp = (char *)_buffer;
689971bb1a5SLionel Sambuc const xcb_randr_get_screen_resources_reply_t *_aux = (xcb_randr_get_screen_resources_reply_t *)_buffer;
690971bb1a5SLionel Sambuc unsigned int xcb_buffer_len = 0;
691971bb1a5SLionel Sambuc unsigned int xcb_block_len = 0;
692971bb1a5SLionel Sambuc unsigned int xcb_pad = 0;
693*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
694971bb1a5SLionel Sambuc
695971bb1a5SLionel Sambuc
696971bb1a5SLionel Sambuc xcb_block_len += sizeof(xcb_randr_get_screen_resources_reply_t);
697971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
698*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len;
699*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
700971bb1a5SLionel Sambuc /* crtcs */
701971bb1a5SLionel Sambuc xcb_block_len += _aux->num_crtcs * sizeof(uint32_t);
702971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
703971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(xcb_randr_crtc_t);
704971bb1a5SLionel Sambuc /* insert padding */
705971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
706971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
707971bb1a5SLionel Sambuc if (0 != xcb_pad) {
708971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
709971bb1a5SLionel Sambuc xcb_pad = 0;
710971bb1a5SLionel Sambuc }
711971bb1a5SLionel Sambuc xcb_block_len = 0;
712971bb1a5SLionel Sambuc /* outputs */
713971bb1a5SLionel Sambuc xcb_block_len += _aux->num_outputs * sizeof(uint32_t);
714971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
715971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(xcb_randr_output_t);
716971bb1a5SLionel Sambuc /* insert padding */
717971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
718971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
719971bb1a5SLionel Sambuc if (0 != xcb_pad) {
720971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
721971bb1a5SLionel Sambuc xcb_pad = 0;
722971bb1a5SLionel Sambuc }
723971bb1a5SLionel Sambuc xcb_block_len = 0;
724971bb1a5SLionel Sambuc /* modes */
725971bb1a5SLionel Sambuc xcb_block_len += _aux->num_modes * sizeof(xcb_randr_mode_info_t);
726971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
727971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(xcb_randr_mode_info_t);
728971bb1a5SLionel Sambuc /* insert padding */
729971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
730971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
731971bb1a5SLionel Sambuc if (0 != xcb_pad) {
732971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
733971bb1a5SLionel Sambuc xcb_pad = 0;
734971bb1a5SLionel Sambuc }
735971bb1a5SLionel Sambuc xcb_block_len = 0;
736971bb1a5SLionel Sambuc /* names */
737971bb1a5SLionel Sambuc xcb_block_len += _aux->names_len * sizeof(uint8_t);
738971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
739971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(uint8_t);
740971bb1a5SLionel Sambuc /* insert padding */
741971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
742971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
743971bb1a5SLionel Sambuc if (0 != xcb_pad) {
744971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
745971bb1a5SLionel Sambuc xcb_pad = 0;
746971bb1a5SLionel Sambuc }
747971bb1a5SLionel Sambuc xcb_block_len = 0;
748971bb1a5SLionel Sambuc
749971bb1a5SLionel Sambuc return xcb_buffer_len;
750971bb1a5SLionel Sambuc }
751971bb1a5SLionel Sambuc
752971bb1a5SLionel Sambuc xcb_randr_get_screen_resources_cookie_t
xcb_randr_get_screen_resources(xcb_connection_t * c,xcb_window_t window)753971bb1a5SLionel Sambuc xcb_randr_get_screen_resources (xcb_connection_t *c /**< */,
754971bb1a5SLionel Sambuc xcb_window_t window /**< */)
755971bb1a5SLionel Sambuc {
756971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
757971bb1a5SLionel Sambuc /* count */ 2,
758971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
759971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_GET_SCREEN_RESOURCES,
760971bb1a5SLionel Sambuc /* isvoid */ 0
761971bb1a5SLionel Sambuc };
762971bb1a5SLionel Sambuc
763971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
764971bb1a5SLionel Sambuc xcb_randr_get_screen_resources_cookie_t xcb_ret;
765971bb1a5SLionel Sambuc xcb_randr_get_screen_resources_request_t xcb_out;
766971bb1a5SLionel Sambuc
767971bb1a5SLionel Sambuc xcb_out.window = window;
768971bb1a5SLionel Sambuc
769971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
770971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
771971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
772971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
773971bb1a5SLionel Sambuc
774971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
775971bb1a5SLionel Sambuc return xcb_ret;
776971bb1a5SLionel Sambuc }
777971bb1a5SLionel Sambuc
778971bb1a5SLionel Sambuc xcb_randr_get_screen_resources_cookie_t
xcb_randr_get_screen_resources_unchecked(xcb_connection_t * c,xcb_window_t window)779971bb1a5SLionel Sambuc xcb_randr_get_screen_resources_unchecked (xcb_connection_t *c /**< */,
780971bb1a5SLionel Sambuc xcb_window_t window /**< */)
781971bb1a5SLionel Sambuc {
782971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
783971bb1a5SLionel Sambuc /* count */ 2,
784971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
785971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_GET_SCREEN_RESOURCES,
786971bb1a5SLionel Sambuc /* isvoid */ 0
787971bb1a5SLionel Sambuc };
788971bb1a5SLionel Sambuc
789971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
790971bb1a5SLionel Sambuc xcb_randr_get_screen_resources_cookie_t xcb_ret;
791971bb1a5SLionel Sambuc xcb_randr_get_screen_resources_request_t xcb_out;
792971bb1a5SLionel Sambuc
793971bb1a5SLionel Sambuc xcb_out.window = window;
794971bb1a5SLionel Sambuc
795971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
796971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
797971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
798971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
799971bb1a5SLionel Sambuc
800971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
801971bb1a5SLionel Sambuc return xcb_ret;
802971bb1a5SLionel Sambuc }
803971bb1a5SLionel Sambuc
804971bb1a5SLionel Sambuc xcb_randr_crtc_t *
xcb_randr_get_screen_resources_crtcs(const xcb_randr_get_screen_resources_reply_t * R)805971bb1a5SLionel Sambuc xcb_randr_get_screen_resources_crtcs (const xcb_randr_get_screen_resources_reply_t *R /**< */)
806971bb1a5SLionel Sambuc {
807971bb1a5SLionel Sambuc return (xcb_randr_crtc_t *) (R + 1);
808971bb1a5SLionel Sambuc }
809971bb1a5SLionel Sambuc
810971bb1a5SLionel Sambuc int
xcb_randr_get_screen_resources_crtcs_length(const xcb_randr_get_screen_resources_reply_t * R)811971bb1a5SLionel Sambuc xcb_randr_get_screen_resources_crtcs_length (const xcb_randr_get_screen_resources_reply_t *R /**< */)
812971bb1a5SLionel Sambuc {
813971bb1a5SLionel Sambuc return R->num_crtcs;
814971bb1a5SLionel Sambuc }
815971bb1a5SLionel Sambuc
816971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_randr_get_screen_resources_crtcs_end(const xcb_randr_get_screen_resources_reply_t * R)817971bb1a5SLionel Sambuc xcb_randr_get_screen_resources_crtcs_end (const xcb_randr_get_screen_resources_reply_t *R /**< */)
818971bb1a5SLionel Sambuc {
819971bb1a5SLionel Sambuc xcb_generic_iterator_t i;
820971bb1a5SLionel Sambuc i.data = ((xcb_randr_crtc_t *) (R + 1)) + (R->num_crtcs);
821971bb1a5SLionel Sambuc i.rem = 0;
822971bb1a5SLionel Sambuc i.index = (char *) i.data - (char *) R;
823971bb1a5SLionel Sambuc return i;
824971bb1a5SLionel Sambuc }
825971bb1a5SLionel Sambuc
826971bb1a5SLionel Sambuc xcb_randr_output_t *
xcb_randr_get_screen_resources_outputs(const xcb_randr_get_screen_resources_reply_t * R)827971bb1a5SLionel Sambuc xcb_randr_get_screen_resources_outputs (const xcb_randr_get_screen_resources_reply_t *R /**< */)
828971bb1a5SLionel Sambuc {
829971bb1a5SLionel Sambuc xcb_generic_iterator_t prev = xcb_randr_get_screen_resources_crtcs_end(R);
830971bb1a5SLionel Sambuc return (xcb_randr_output_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_randr_output_t, prev.index) + 0);
831971bb1a5SLionel Sambuc }
832971bb1a5SLionel Sambuc
833971bb1a5SLionel Sambuc int
xcb_randr_get_screen_resources_outputs_length(const xcb_randr_get_screen_resources_reply_t * R)834971bb1a5SLionel Sambuc xcb_randr_get_screen_resources_outputs_length (const xcb_randr_get_screen_resources_reply_t *R /**< */)
835971bb1a5SLionel Sambuc {
836971bb1a5SLionel Sambuc return R->num_outputs;
837971bb1a5SLionel Sambuc }
838971bb1a5SLionel Sambuc
839971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_randr_get_screen_resources_outputs_end(const xcb_randr_get_screen_resources_reply_t * R)840971bb1a5SLionel Sambuc xcb_randr_get_screen_resources_outputs_end (const xcb_randr_get_screen_resources_reply_t *R /**< */)
841971bb1a5SLionel Sambuc {
842971bb1a5SLionel Sambuc xcb_generic_iterator_t i;
843971bb1a5SLionel Sambuc xcb_generic_iterator_t child = xcb_randr_get_screen_resources_crtcs_end(R);
844971bb1a5SLionel Sambuc i.data = ((xcb_randr_output_t *) child.data) + (R->num_outputs);
845971bb1a5SLionel Sambuc i.rem = 0;
846971bb1a5SLionel Sambuc i.index = (char *) i.data - (char *) R;
847971bb1a5SLionel Sambuc return i;
848971bb1a5SLionel Sambuc }
849971bb1a5SLionel Sambuc
850971bb1a5SLionel Sambuc xcb_randr_mode_info_t *
xcb_randr_get_screen_resources_modes(const xcb_randr_get_screen_resources_reply_t * R)851971bb1a5SLionel Sambuc xcb_randr_get_screen_resources_modes (const xcb_randr_get_screen_resources_reply_t *R /**< */)
852971bb1a5SLionel Sambuc {
853971bb1a5SLionel Sambuc xcb_generic_iterator_t prev = xcb_randr_get_screen_resources_outputs_end(R);
854971bb1a5SLionel Sambuc return (xcb_randr_mode_info_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_randr_mode_info_t, prev.index) + 0);
855971bb1a5SLionel Sambuc }
856971bb1a5SLionel Sambuc
857971bb1a5SLionel Sambuc int
xcb_randr_get_screen_resources_modes_length(const xcb_randr_get_screen_resources_reply_t * R)858971bb1a5SLionel Sambuc xcb_randr_get_screen_resources_modes_length (const xcb_randr_get_screen_resources_reply_t *R /**< */)
859971bb1a5SLionel Sambuc {
860971bb1a5SLionel Sambuc return R->num_modes;
861971bb1a5SLionel Sambuc }
862971bb1a5SLionel Sambuc
863971bb1a5SLionel Sambuc xcb_randr_mode_info_iterator_t
xcb_randr_get_screen_resources_modes_iterator(const xcb_randr_get_screen_resources_reply_t * R)864971bb1a5SLionel Sambuc xcb_randr_get_screen_resources_modes_iterator (const xcb_randr_get_screen_resources_reply_t *R /**< */)
865971bb1a5SLionel Sambuc {
866971bb1a5SLionel Sambuc xcb_randr_mode_info_iterator_t i;
867971bb1a5SLionel Sambuc xcb_generic_iterator_t prev = xcb_randr_get_screen_resources_outputs_end(R);
868971bb1a5SLionel Sambuc i.data = (xcb_randr_mode_info_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_randr_mode_info_t, prev.index));
869971bb1a5SLionel Sambuc i.rem = R->num_modes;
870971bb1a5SLionel Sambuc i.index = (char *) i.data - (char *) R;
871971bb1a5SLionel Sambuc return i;
872971bb1a5SLionel Sambuc }
873971bb1a5SLionel Sambuc
874971bb1a5SLionel Sambuc uint8_t *
xcb_randr_get_screen_resources_names(const xcb_randr_get_screen_resources_reply_t * R)875971bb1a5SLionel Sambuc xcb_randr_get_screen_resources_names (const xcb_randr_get_screen_resources_reply_t *R /**< */)
876971bb1a5SLionel Sambuc {
877971bb1a5SLionel Sambuc xcb_generic_iterator_t prev = xcb_randr_mode_info_end(xcb_randr_get_screen_resources_modes_iterator(R));
878971bb1a5SLionel Sambuc return (uint8_t *) ((char *) prev.data + XCB_TYPE_PAD(uint8_t, prev.index) + 0);
879971bb1a5SLionel Sambuc }
880971bb1a5SLionel Sambuc
881971bb1a5SLionel Sambuc int
xcb_randr_get_screen_resources_names_length(const xcb_randr_get_screen_resources_reply_t * R)882971bb1a5SLionel Sambuc xcb_randr_get_screen_resources_names_length (const xcb_randr_get_screen_resources_reply_t *R /**< */)
883971bb1a5SLionel Sambuc {
884971bb1a5SLionel Sambuc return R->names_len;
885971bb1a5SLionel Sambuc }
886971bb1a5SLionel Sambuc
887971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_randr_get_screen_resources_names_end(const xcb_randr_get_screen_resources_reply_t * R)888971bb1a5SLionel Sambuc xcb_randr_get_screen_resources_names_end (const xcb_randr_get_screen_resources_reply_t *R /**< */)
889971bb1a5SLionel Sambuc {
890971bb1a5SLionel Sambuc xcb_generic_iterator_t i;
891971bb1a5SLionel Sambuc xcb_generic_iterator_t child = xcb_randr_mode_info_end(xcb_randr_get_screen_resources_modes_iterator(R));
892971bb1a5SLionel Sambuc i.data = ((uint8_t *) child.data) + (R->names_len);
893971bb1a5SLionel Sambuc i.rem = 0;
894971bb1a5SLionel Sambuc i.index = (char *) i.data - (char *) R;
895971bb1a5SLionel Sambuc return i;
896971bb1a5SLionel Sambuc }
897971bb1a5SLionel Sambuc
898971bb1a5SLionel Sambuc xcb_randr_get_screen_resources_reply_t *
xcb_randr_get_screen_resources_reply(xcb_connection_t * c,xcb_randr_get_screen_resources_cookie_t cookie,xcb_generic_error_t ** e)899971bb1a5SLionel Sambuc xcb_randr_get_screen_resources_reply (xcb_connection_t *c /**< */,
900971bb1a5SLionel Sambuc xcb_randr_get_screen_resources_cookie_t cookie /**< */,
901971bb1a5SLionel Sambuc xcb_generic_error_t **e /**< */)
902971bb1a5SLionel Sambuc {
903971bb1a5SLionel Sambuc return (xcb_randr_get_screen_resources_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
904971bb1a5SLionel Sambuc }
905971bb1a5SLionel Sambuc
906971bb1a5SLionel Sambuc int
xcb_randr_get_output_info_sizeof(const void * _buffer)907971bb1a5SLionel Sambuc xcb_randr_get_output_info_sizeof (const void *_buffer /**< */)
908971bb1a5SLionel Sambuc {
909971bb1a5SLionel Sambuc char *xcb_tmp = (char *)_buffer;
910971bb1a5SLionel Sambuc const xcb_randr_get_output_info_reply_t *_aux = (xcb_randr_get_output_info_reply_t *)_buffer;
911971bb1a5SLionel Sambuc unsigned int xcb_buffer_len = 0;
912971bb1a5SLionel Sambuc unsigned int xcb_block_len = 0;
913971bb1a5SLionel Sambuc unsigned int xcb_pad = 0;
914*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
915971bb1a5SLionel Sambuc
916971bb1a5SLionel Sambuc
917971bb1a5SLionel Sambuc xcb_block_len += sizeof(xcb_randr_get_output_info_reply_t);
918971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
919*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len;
920*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
921971bb1a5SLionel Sambuc /* crtcs */
922971bb1a5SLionel Sambuc xcb_block_len += _aux->num_crtcs * sizeof(xcb_randr_output_t);
923971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
924971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(xcb_randr_crtc_t);
925971bb1a5SLionel Sambuc /* insert padding */
926971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
927971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
928971bb1a5SLionel Sambuc if (0 != xcb_pad) {
929971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
930971bb1a5SLionel Sambuc xcb_pad = 0;
931971bb1a5SLionel Sambuc }
932971bb1a5SLionel Sambuc xcb_block_len = 0;
933971bb1a5SLionel Sambuc /* modes */
934971bb1a5SLionel Sambuc xcb_block_len += _aux->num_modes * sizeof(xcb_randr_output_t);
935971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
936971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(xcb_randr_mode_t);
937971bb1a5SLionel Sambuc /* insert padding */
938971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
939971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
940971bb1a5SLionel Sambuc if (0 != xcb_pad) {
941971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
942971bb1a5SLionel Sambuc xcb_pad = 0;
943971bb1a5SLionel Sambuc }
944971bb1a5SLionel Sambuc xcb_block_len = 0;
945971bb1a5SLionel Sambuc /* clones */
946971bb1a5SLionel Sambuc xcb_block_len += _aux->num_clones * sizeof(xcb_randr_output_t);
947971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
948971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(xcb_randr_output_t);
949971bb1a5SLionel Sambuc /* insert padding */
950971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
951971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
952971bb1a5SLionel Sambuc if (0 != xcb_pad) {
953971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
954971bb1a5SLionel Sambuc xcb_pad = 0;
955971bb1a5SLionel Sambuc }
956971bb1a5SLionel Sambuc xcb_block_len = 0;
957971bb1a5SLionel Sambuc /* name */
958971bb1a5SLionel Sambuc xcb_block_len += _aux->name_len * sizeof(uint8_t);
959971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
960971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(uint8_t);
961971bb1a5SLionel Sambuc /* insert padding */
962971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
963971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
964971bb1a5SLionel Sambuc if (0 != xcb_pad) {
965971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
966971bb1a5SLionel Sambuc xcb_pad = 0;
967971bb1a5SLionel Sambuc }
968971bb1a5SLionel Sambuc xcb_block_len = 0;
969971bb1a5SLionel Sambuc
970971bb1a5SLionel Sambuc return xcb_buffer_len;
971971bb1a5SLionel Sambuc }
972971bb1a5SLionel Sambuc
973971bb1a5SLionel Sambuc xcb_randr_get_output_info_cookie_t
xcb_randr_get_output_info(xcb_connection_t * c,xcb_randr_output_t output,xcb_timestamp_t config_timestamp)974971bb1a5SLionel Sambuc xcb_randr_get_output_info (xcb_connection_t *c /**< */,
975971bb1a5SLionel Sambuc xcb_randr_output_t output /**< */,
976971bb1a5SLionel Sambuc xcb_timestamp_t config_timestamp /**< */)
977971bb1a5SLionel Sambuc {
978971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
979971bb1a5SLionel Sambuc /* count */ 2,
980971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
981971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_GET_OUTPUT_INFO,
982971bb1a5SLionel Sambuc /* isvoid */ 0
983971bb1a5SLionel Sambuc };
984971bb1a5SLionel Sambuc
985971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
986971bb1a5SLionel Sambuc xcb_randr_get_output_info_cookie_t xcb_ret;
987971bb1a5SLionel Sambuc xcb_randr_get_output_info_request_t xcb_out;
988971bb1a5SLionel Sambuc
989971bb1a5SLionel Sambuc xcb_out.output = output;
990971bb1a5SLionel Sambuc xcb_out.config_timestamp = config_timestamp;
991971bb1a5SLionel Sambuc
992971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
993971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
994971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
995971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
996971bb1a5SLionel Sambuc
997971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
998971bb1a5SLionel Sambuc return xcb_ret;
999971bb1a5SLionel Sambuc }
1000971bb1a5SLionel Sambuc
1001971bb1a5SLionel Sambuc xcb_randr_get_output_info_cookie_t
xcb_randr_get_output_info_unchecked(xcb_connection_t * c,xcb_randr_output_t output,xcb_timestamp_t config_timestamp)1002971bb1a5SLionel Sambuc xcb_randr_get_output_info_unchecked (xcb_connection_t *c /**< */,
1003971bb1a5SLionel Sambuc xcb_randr_output_t output /**< */,
1004971bb1a5SLionel Sambuc xcb_timestamp_t config_timestamp /**< */)
1005971bb1a5SLionel Sambuc {
1006971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1007971bb1a5SLionel Sambuc /* count */ 2,
1008971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
1009971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_GET_OUTPUT_INFO,
1010971bb1a5SLionel Sambuc /* isvoid */ 0
1011971bb1a5SLionel Sambuc };
1012971bb1a5SLionel Sambuc
1013971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
1014971bb1a5SLionel Sambuc xcb_randr_get_output_info_cookie_t xcb_ret;
1015971bb1a5SLionel Sambuc xcb_randr_get_output_info_request_t xcb_out;
1016971bb1a5SLionel Sambuc
1017971bb1a5SLionel Sambuc xcb_out.output = output;
1018971bb1a5SLionel Sambuc xcb_out.config_timestamp = config_timestamp;
1019971bb1a5SLionel Sambuc
1020971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1021971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1022971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1023971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1024971bb1a5SLionel Sambuc
1025971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1026971bb1a5SLionel Sambuc return xcb_ret;
1027971bb1a5SLionel Sambuc }
1028971bb1a5SLionel Sambuc
1029971bb1a5SLionel Sambuc xcb_randr_crtc_t *
xcb_randr_get_output_info_crtcs(const xcb_randr_get_output_info_reply_t * R)1030971bb1a5SLionel Sambuc xcb_randr_get_output_info_crtcs (const xcb_randr_get_output_info_reply_t *R /**< */)
1031971bb1a5SLionel Sambuc {
1032971bb1a5SLionel Sambuc return (xcb_randr_crtc_t *) (R + 1);
1033971bb1a5SLionel Sambuc }
1034971bb1a5SLionel Sambuc
1035971bb1a5SLionel Sambuc int
xcb_randr_get_output_info_crtcs_length(const xcb_randr_get_output_info_reply_t * R)1036971bb1a5SLionel Sambuc xcb_randr_get_output_info_crtcs_length (const xcb_randr_get_output_info_reply_t *R /**< */)
1037971bb1a5SLionel Sambuc {
1038971bb1a5SLionel Sambuc return R->num_crtcs;
1039971bb1a5SLionel Sambuc }
1040971bb1a5SLionel Sambuc
1041971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_randr_get_output_info_crtcs_end(const xcb_randr_get_output_info_reply_t * R)1042971bb1a5SLionel Sambuc xcb_randr_get_output_info_crtcs_end (const xcb_randr_get_output_info_reply_t *R /**< */)
1043971bb1a5SLionel Sambuc {
1044971bb1a5SLionel Sambuc xcb_generic_iterator_t i;
1045971bb1a5SLionel Sambuc i.data = ((xcb_randr_crtc_t *) (R + 1)) + (R->num_crtcs);
1046971bb1a5SLionel Sambuc i.rem = 0;
1047971bb1a5SLionel Sambuc i.index = (char *) i.data - (char *) R;
1048971bb1a5SLionel Sambuc return i;
1049971bb1a5SLionel Sambuc }
1050971bb1a5SLionel Sambuc
1051971bb1a5SLionel Sambuc xcb_randr_mode_t *
xcb_randr_get_output_info_modes(const xcb_randr_get_output_info_reply_t * R)1052971bb1a5SLionel Sambuc xcb_randr_get_output_info_modes (const xcb_randr_get_output_info_reply_t *R /**< */)
1053971bb1a5SLionel Sambuc {
1054971bb1a5SLionel Sambuc xcb_generic_iterator_t prev = xcb_randr_get_output_info_crtcs_end(R);
1055971bb1a5SLionel Sambuc return (xcb_randr_mode_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_randr_mode_t, prev.index) + 0);
1056971bb1a5SLionel Sambuc }
1057971bb1a5SLionel Sambuc
1058971bb1a5SLionel Sambuc int
xcb_randr_get_output_info_modes_length(const xcb_randr_get_output_info_reply_t * R)1059971bb1a5SLionel Sambuc xcb_randr_get_output_info_modes_length (const xcb_randr_get_output_info_reply_t *R /**< */)
1060971bb1a5SLionel Sambuc {
1061971bb1a5SLionel Sambuc return R->num_modes;
1062971bb1a5SLionel Sambuc }
1063971bb1a5SLionel Sambuc
1064971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_randr_get_output_info_modes_end(const xcb_randr_get_output_info_reply_t * R)1065971bb1a5SLionel Sambuc xcb_randr_get_output_info_modes_end (const xcb_randr_get_output_info_reply_t *R /**< */)
1066971bb1a5SLionel Sambuc {
1067971bb1a5SLionel Sambuc xcb_generic_iterator_t i;
1068971bb1a5SLionel Sambuc xcb_generic_iterator_t child = xcb_randr_get_output_info_crtcs_end(R);
1069971bb1a5SLionel Sambuc i.data = ((xcb_randr_mode_t *) child.data) + (R->num_modes);
1070971bb1a5SLionel Sambuc i.rem = 0;
1071971bb1a5SLionel Sambuc i.index = (char *) i.data - (char *) R;
1072971bb1a5SLionel Sambuc return i;
1073971bb1a5SLionel Sambuc }
1074971bb1a5SLionel Sambuc
1075971bb1a5SLionel Sambuc xcb_randr_output_t *
xcb_randr_get_output_info_clones(const xcb_randr_get_output_info_reply_t * R)1076971bb1a5SLionel Sambuc xcb_randr_get_output_info_clones (const xcb_randr_get_output_info_reply_t *R /**< */)
1077971bb1a5SLionel Sambuc {
1078971bb1a5SLionel Sambuc xcb_generic_iterator_t prev = xcb_randr_get_output_info_modes_end(R);
1079971bb1a5SLionel Sambuc return (xcb_randr_output_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_randr_output_t, prev.index) + 0);
1080971bb1a5SLionel Sambuc }
1081971bb1a5SLionel Sambuc
1082971bb1a5SLionel Sambuc int
xcb_randr_get_output_info_clones_length(const xcb_randr_get_output_info_reply_t * R)1083971bb1a5SLionel Sambuc xcb_randr_get_output_info_clones_length (const xcb_randr_get_output_info_reply_t *R /**< */)
1084971bb1a5SLionel Sambuc {
1085971bb1a5SLionel Sambuc return R->num_clones;
1086971bb1a5SLionel Sambuc }
1087971bb1a5SLionel Sambuc
1088971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_randr_get_output_info_clones_end(const xcb_randr_get_output_info_reply_t * R)1089971bb1a5SLionel Sambuc xcb_randr_get_output_info_clones_end (const xcb_randr_get_output_info_reply_t *R /**< */)
1090971bb1a5SLionel Sambuc {
1091971bb1a5SLionel Sambuc xcb_generic_iterator_t i;
1092971bb1a5SLionel Sambuc xcb_generic_iterator_t child = xcb_randr_get_output_info_modes_end(R);
1093971bb1a5SLionel Sambuc i.data = ((xcb_randr_output_t *) child.data) + (R->num_clones);
1094971bb1a5SLionel Sambuc i.rem = 0;
1095971bb1a5SLionel Sambuc i.index = (char *) i.data - (char *) R;
1096971bb1a5SLionel Sambuc return i;
1097971bb1a5SLionel Sambuc }
1098971bb1a5SLionel Sambuc
1099971bb1a5SLionel Sambuc uint8_t *
xcb_randr_get_output_info_name(const xcb_randr_get_output_info_reply_t * R)1100971bb1a5SLionel Sambuc xcb_randr_get_output_info_name (const xcb_randr_get_output_info_reply_t *R /**< */)
1101971bb1a5SLionel Sambuc {
1102971bb1a5SLionel Sambuc xcb_generic_iterator_t prev = xcb_randr_get_output_info_clones_end(R);
1103971bb1a5SLionel Sambuc return (uint8_t *) ((char *) prev.data + XCB_TYPE_PAD(uint8_t, prev.index) + 0);
1104971bb1a5SLionel Sambuc }
1105971bb1a5SLionel Sambuc
1106971bb1a5SLionel Sambuc int
xcb_randr_get_output_info_name_length(const xcb_randr_get_output_info_reply_t * R)1107971bb1a5SLionel Sambuc xcb_randr_get_output_info_name_length (const xcb_randr_get_output_info_reply_t *R /**< */)
1108971bb1a5SLionel Sambuc {
1109971bb1a5SLionel Sambuc return R->name_len;
1110971bb1a5SLionel Sambuc }
1111971bb1a5SLionel Sambuc
1112971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_randr_get_output_info_name_end(const xcb_randr_get_output_info_reply_t * R)1113971bb1a5SLionel Sambuc xcb_randr_get_output_info_name_end (const xcb_randr_get_output_info_reply_t *R /**< */)
1114971bb1a5SLionel Sambuc {
1115971bb1a5SLionel Sambuc xcb_generic_iterator_t i;
1116971bb1a5SLionel Sambuc xcb_generic_iterator_t child = xcb_randr_get_output_info_clones_end(R);
1117971bb1a5SLionel Sambuc i.data = ((uint8_t *) child.data) + (R->name_len);
1118971bb1a5SLionel Sambuc i.rem = 0;
1119971bb1a5SLionel Sambuc i.index = (char *) i.data - (char *) R;
1120971bb1a5SLionel Sambuc return i;
1121971bb1a5SLionel Sambuc }
1122971bb1a5SLionel Sambuc
1123971bb1a5SLionel Sambuc xcb_randr_get_output_info_reply_t *
xcb_randr_get_output_info_reply(xcb_connection_t * c,xcb_randr_get_output_info_cookie_t cookie,xcb_generic_error_t ** e)1124971bb1a5SLionel Sambuc xcb_randr_get_output_info_reply (xcb_connection_t *c /**< */,
1125971bb1a5SLionel Sambuc xcb_randr_get_output_info_cookie_t cookie /**< */,
1126971bb1a5SLionel Sambuc xcb_generic_error_t **e /**< */)
1127971bb1a5SLionel Sambuc {
1128971bb1a5SLionel Sambuc return (xcb_randr_get_output_info_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1129971bb1a5SLionel Sambuc }
1130971bb1a5SLionel Sambuc
1131971bb1a5SLionel Sambuc int
xcb_randr_list_output_properties_sizeof(const void * _buffer)1132971bb1a5SLionel Sambuc xcb_randr_list_output_properties_sizeof (const void *_buffer /**< */)
1133971bb1a5SLionel Sambuc {
1134971bb1a5SLionel Sambuc char *xcb_tmp = (char *)_buffer;
1135971bb1a5SLionel Sambuc const xcb_randr_list_output_properties_reply_t *_aux = (xcb_randr_list_output_properties_reply_t *)_buffer;
1136971bb1a5SLionel Sambuc unsigned int xcb_buffer_len = 0;
1137971bb1a5SLionel Sambuc unsigned int xcb_block_len = 0;
1138971bb1a5SLionel Sambuc unsigned int xcb_pad = 0;
1139*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
1140971bb1a5SLionel Sambuc
1141971bb1a5SLionel Sambuc
1142971bb1a5SLionel Sambuc xcb_block_len += sizeof(xcb_randr_list_output_properties_reply_t);
1143971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
1144*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len;
1145*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
1146971bb1a5SLionel Sambuc /* atoms */
1147971bb1a5SLionel Sambuc xcb_block_len += _aux->num_atoms * sizeof(xcb_atom_t);
1148971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
1149971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(xcb_atom_t);
1150971bb1a5SLionel Sambuc /* insert padding */
1151971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1152971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
1153971bb1a5SLionel Sambuc if (0 != xcb_pad) {
1154971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
1155971bb1a5SLionel Sambuc xcb_pad = 0;
1156971bb1a5SLionel Sambuc }
1157971bb1a5SLionel Sambuc xcb_block_len = 0;
1158971bb1a5SLionel Sambuc
1159971bb1a5SLionel Sambuc return xcb_buffer_len;
1160971bb1a5SLionel Sambuc }
1161971bb1a5SLionel Sambuc
1162971bb1a5SLionel Sambuc xcb_randr_list_output_properties_cookie_t
xcb_randr_list_output_properties(xcb_connection_t * c,xcb_randr_output_t output)1163971bb1a5SLionel Sambuc xcb_randr_list_output_properties (xcb_connection_t *c /**< */,
1164971bb1a5SLionel Sambuc xcb_randr_output_t output /**< */)
1165971bb1a5SLionel Sambuc {
1166971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1167971bb1a5SLionel Sambuc /* count */ 2,
1168971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
1169971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_LIST_OUTPUT_PROPERTIES,
1170971bb1a5SLionel Sambuc /* isvoid */ 0
1171971bb1a5SLionel Sambuc };
1172971bb1a5SLionel Sambuc
1173971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
1174971bb1a5SLionel Sambuc xcb_randr_list_output_properties_cookie_t xcb_ret;
1175971bb1a5SLionel Sambuc xcb_randr_list_output_properties_request_t xcb_out;
1176971bb1a5SLionel Sambuc
1177971bb1a5SLionel Sambuc xcb_out.output = output;
1178971bb1a5SLionel Sambuc
1179971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1180971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1181971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1182971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1183971bb1a5SLionel Sambuc
1184971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1185971bb1a5SLionel Sambuc return xcb_ret;
1186971bb1a5SLionel Sambuc }
1187971bb1a5SLionel Sambuc
1188971bb1a5SLionel Sambuc xcb_randr_list_output_properties_cookie_t
xcb_randr_list_output_properties_unchecked(xcb_connection_t * c,xcb_randr_output_t output)1189971bb1a5SLionel Sambuc xcb_randr_list_output_properties_unchecked (xcb_connection_t *c /**< */,
1190971bb1a5SLionel Sambuc xcb_randr_output_t output /**< */)
1191971bb1a5SLionel Sambuc {
1192971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1193971bb1a5SLionel Sambuc /* count */ 2,
1194971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
1195971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_LIST_OUTPUT_PROPERTIES,
1196971bb1a5SLionel Sambuc /* isvoid */ 0
1197971bb1a5SLionel Sambuc };
1198971bb1a5SLionel Sambuc
1199971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
1200971bb1a5SLionel Sambuc xcb_randr_list_output_properties_cookie_t xcb_ret;
1201971bb1a5SLionel Sambuc xcb_randr_list_output_properties_request_t xcb_out;
1202971bb1a5SLionel Sambuc
1203971bb1a5SLionel Sambuc xcb_out.output = output;
1204971bb1a5SLionel Sambuc
1205971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1206971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1207971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1208971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1209971bb1a5SLionel Sambuc
1210971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1211971bb1a5SLionel Sambuc return xcb_ret;
1212971bb1a5SLionel Sambuc }
1213971bb1a5SLionel Sambuc
1214971bb1a5SLionel Sambuc xcb_atom_t *
xcb_randr_list_output_properties_atoms(const xcb_randr_list_output_properties_reply_t * R)1215971bb1a5SLionel Sambuc xcb_randr_list_output_properties_atoms (const xcb_randr_list_output_properties_reply_t *R /**< */)
1216971bb1a5SLionel Sambuc {
1217971bb1a5SLionel Sambuc return (xcb_atom_t *) (R + 1);
1218971bb1a5SLionel Sambuc }
1219971bb1a5SLionel Sambuc
1220971bb1a5SLionel Sambuc int
xcb_randr_list_output_properties_atoms_length(const xcb_randr_list_output_properties_reply_t * R)1221971bb1a5SLionel Sambuc xcb_randr_list_output_properties_atoms_length (const xcb_randr_list_output_properties_reply_t *R /**< */)
1222971bb1a5SLionel Sambuc {
1223971bb1a5SLionel Sambuc return R->num_atoms;
1224971bb1a5SLionel Sambuc }
1225971bb1a5SLionel Sambuc
1226971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_randr_list_output_properties_atoms_end(const xcb_randr_list_output_properties_reply_t * R)1227971bb1a5SLionel Sambuc xcb_randr_list_output_properties_atoms_end (const xcb_randr_list_output_properties_reply_t *R /**< */)
1228971bb1a5SLionel Sambuc {
1229971bb1a5SLionel Sambuc xcb_generic_iterator_t i;
1230971bb1a5SLionel Sambuc i.data = ((xcb_atom_t *) (R + 1)) + (R->num_atoms);
1231971bb1a5SLionel Sambuc i.rem = 0;
1232971bb1a5SLionel Sambuc i.index = (char *) i.data - (char *) R;
1233971bb1a5SLionel Sambuc return i;
1234971bb1a5SLionel Sambuc }
1235971bb1a5SLionel Sambuc
1236971bb1a5SLionel Sambuc xcb_randr_list_output_properties_reply_t *
xcb_randr_list_output_properties_reply(xcb_connection_t * c,xcb_randr_list_output_properties_cookie_t cookie,xcb_generic_error_t ** e)1237971bb1a5SLionel Sambuc xcb_randr_list_output_properties_reply (xcb_connection_t *c /**< */,
1238971bb1a5SLionel Sambuc xcb_randr_list_output_properties_cookie_t cookie /**< */,
1239971bb1a5SLionel Sambuc xcb_generic_error_t **e /**< */)
1240971bb1a5SLionel Sambuc {
1241971bb1a5SLionel Sambuc return (xcb_randr_list_output_properties_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1242971bb1a5SLionel Sambuc }
1243971bb1a5SLionel Sambuc
1244971bb1a5SLionel Sambuc int
xcb_randr_query_output_property_sizeof(const void * _buffer)1245971bb1a5SLionel Sambuc xcb_randr_query_output_property_sizeof (const void *_buffer /**< */)
1246971bb1a5SLionel Sambuc {
1247971bb1a5SLionel Sambuc char *xcb_tmp = (char *)_buffer;
1248971bb1a5SLionel Sambuc const xcb_randr_query_output_property_reply_t *_aux = (xcb_randr_query_output_property_reply_t *)_buffer;
1249971bb1a5SLionel Sambuc unsigned int xcb_buffer_len = 0;
1250971bb1a5SLionel Sambuc unsigned int xcb_block_len = 0;
1251971bb1a5SLionel Sambuc unsigned int xcb_pad = 0;
1252*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
1253971bb1a5SLionel Sambuc
1254971bb1a5SLionel Sambuc
1255971bb1a5SLionel Sambuc xcb_block_len += sizeof(xcb_randr_query_output_property_reply_t);
1256971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
1257*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len;
1258*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
1259971bb1a5SLionel Sambuc /* validValues */
1260971bb1a5SLionel Sambuc xcb_block_len += _aux->length * sizeof(int32_t);
1261971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
1262971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(int32_t);
1263971bb1a5SLionel Sambuc /* insert padding */
1264971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1265971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
1266971bb1a5SLionel Sambuc if (0 != xcb_pad) {
1267971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
1268971bb1a5SLionel Sambuc xcb_pad = 0;
1269971bb1a5SLionel Sambuc }
1270971bb1a5SLionel Sambuc xcb_block_len = 0;
1271971bb1a5SLionel Sambuc
1272971bb1a5SLionel Sambuc return xcb_buffer_len;
1273971bb1a5SLionel Sambuc }
1274971bb1a5SLionel Sambuc
1275971bb1a5SLionel Sambuc xcb_randr_query_output_property_cookie_t
xcb_randr_query_output_property(xcb_connection_t * c,xcb_randr_output_t output,xcb_atom_t property)1276971bb1a5SLionel Sambuc xcb_randr_query_output_property (xcb_connection_t *c /**< */,
1277971bb1a5SLionel Sambuc xcb_randr_output_t output /**< */,
1278971bb1a5SLionel Sambuc xcb_atom_t property /**< */)
1279971bb1a5SLionel Sambuc {
1280971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1281971bb1a5SLionel Sambuc /* count */ 2,
1282971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
1283971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_QUERY_OUTPUT_PROPERTY,
1284971bb1a5SLionel Sambuc /* isvoid */ 0
1285971bb1a5SLionel Sambuc };
1286971bb1a5SLionel Sambuc
1287971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
1288971bb1a5SLionel Sambuc xcb_randr_query_output_property_cookie_t xcb_ret;
1289971bb1a5SLionel Sambuc xcb_randr_query_output_property_request_t xcb_out;
1290971bb1a5SLionel Sambuc
1291971bb1a5SLionel Sambuc xcb_out.output = output;
1292971bb1a5SLionel Sambuc xcb_out.property = property;
1293971bb1a5SLionel Sambuc
1294971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1295971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1296971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1297971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1298971bb1a5SLionel Sambuc
1299971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1300971bb1a5SLionel Sambuc return xcb_ret;
1301971bb1a5SLionel Sambuc }
1302971bb1a5SLionel Sambuc
1303971bb1a5SLionel Sambuc xcb_randr_query_output_property_cookie_t
xcb_randr_query_output_property_unchecked(xcb_connection_t * c,xcb_randr_output_t output,xcb_atom_t property)1304971bb1a5SLionel Sambuc xcb_randr_query_output_property_unchecked (xcb_connection_t *c /**< */,
1305971bb1a5SLionel Sambuc xcb_randr_output_t output /**< */,
1306971bb1a5SLionel Sambuc xcb_atom_t property /**< */)
1307971bb1a5SLionel Sambuc {
1308971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1309971bb1a5SLionel Sambuc /* count */ 2,
1310971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
1311971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_QUERY_OUTPUT_PROPERTY,
1312971bb1a5SLionel Sambuc /* isvoid */ 0
1313971bb1a5SLionel Sambuc };
1314971bb1a5SLionel Sambuc
1315971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
1316971bb1a5SLionel Sambuc xcb_randr_query_output_property_cookie_t xcb_ret;
1317971bb1a5SLionel Sambuc xcb_randr_query_output_property_request_t xcb_out;
1318971bb1a5SLionel Sambuc
1319971bb1a5SLionel Sambuc xcb_out.output = output;
1320971bb1a5SLionel Sambuc xcb_out.property = property;
1321971bb1a5SLionel Sambuc
1322971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1323971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1324971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1325971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1326971bb1a5SLionel Sambuc
1327971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1328971bb1a5SLionel Sambuc return xcb_ret;
1329971bb1a5SLionel Sambuc }
1330971bb1a5SLionel Sambuc
1331971bb1a5SLionel Sambuc int32_t *
xcb_randr_query_output_property_valid_values(const xcb_randr_query_output_property_reply_t * R)1332971bb1a5SLionel Sambuc xcb_randr_query_output_property_valid_values (const xcb_randr_query_output_property_reply_t *R /**< */)
1333971bb1a5SLionel Sambuc {
1334971bb1a5SLionel Sambuc return (int32_t *) (R + 1);
1335971bb1a5SLionel Sambuc }
1336971bb1a5SLionel Sambuc
1337971bb1a5SLionel Sambuc int
xcb_randr_query_output_property_valid_values_length(const xcb_randr_query_output_property_reply_t * R)1338971bb1a5SLionel Sambuc xcb_randr_query_output_property_valid_values_length (const xcb_randr_query_output_property_reply_t *R /**< */)
1339971bb1a5SLionel Sambuc {
1340971bb1a5SLionel Sambuc return R->length;
1341971bb1a5SLionel Sambuc }
1342971bb1a5SLionel Sambuc
1343971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_randr_query_output_property_valid_values_end(const xcb_randr_query_output_property_reply_t * R)1344971bb1a5SLionel Sambuc xcb_randr_query_output_property_valid_values_end (const xcb_randr_query_output_property_reply_t *R /**< */)
1345971bb1a5SLionel Sambuc {
1346971bb1a5SLionel Sambuc xcb_generic_iterator_t i;
1347971bb1a5SLionel Sambuc i.data = ((int32_t *) (R + 1)) + (R->length);
1348971bb1a5SLionel Sambuc i.rem = 0;
1349971bb1a5SLionel Sambuc i.index = (char *) i.data - (char *) R;
1350971bb1a5SLionel Sambuc return i;
1351971bb1a5SLionel Sambuc }
1352971bb1a5SLionel Sambuc
1353971bb1a5SLionel Sambuc xcb_randr_query_output_property_reply_t *
xcb_randr_query_output_property_reply(xcb_connection_t * c,xcb_randr_query_output_property_cookie_t cookie,xcb_generic_error_t ** e)1354971bb1a5SLionel Sambuc xcb_randr_query_output_property_reply (xcb_connection_t *c /**< */,
1355971bb1a5SLionel Sambuc xcb_randr_query_output_property_cookie_t cookie /**< */,
1356971bb1a5SLionel Sambuc xcb_generic_error_t **e /**< */)
1357971bb1a5SLionel Sambuc {
1358971bb1a5SLionel Sambuc return (xcb_randr_query_output_property_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1359971bb1a5SLionel Sambuc }
1360971bb1a5SLionel Sambuc
1361971bb1a5SLionel Sambuc int
xcb_randr_configure_output_property_sizeof(const void * _buffer,uint32_t values_len)1362971bb1a5SLionel Sambuc xcb_randr_configure_output_property_sizeof (const void *_buffer /**< */,
1363971bb1a5SLionel Sambuc uint32_t values_len /**< */)
1364971bb1a5SLionel Sambuc {
1365971bb1a5SLionel Sambuc char *xcb_tmp = (char *)_buffer;
1366971bb1a5SLionel Sambuc unsigned int xcb_buffer_len = 0;
1367971bb1a5SLionel Sambuc unsigned int xcb_block_len = 0;
1368971bb1a5SLionel Sambuc unsigned int xcb_pad = 0;
1369*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
1370971bb1a5SLionel Sambuc
1371971bb1a5SLionel Sambuc
1372971bb1a5SLionel Sambuc xcb_block_len += sizeof(xcb_randr_configure_output_property_request_t);
1373971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
1374*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len;
1375*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
1376971bb1a5SLionel Sambuc /* values */
1377971bb1a5SLionel Sambuc xcb_block_len += values_len * sizeof(int32_t);
1378971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
1379971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(int32_t);
1380971bb1a5SLionel Sambuc /* insert padding */
1381971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1382971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
1383971bb1a5SLionel Sambuc if (0 != xcb_pad) {
1384971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
1385971bb1a5SLionel Sambuc xcb_pad = 0;
1386971bb1a5SLionel Sambuc }
1387971bb1a5SLionel Sambuc xcb_block_len = 0;
1388971bb1a5SLionel Sambuc
1389971bb1a5SLionel Sambuc return xcb_buffer_len;
1390971bb1a5SLionel Sambuc }
1391971bb1a5SLionel Sambuc
1392971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_randr_configure_output_property_checked(xcb_connection_t * c,xcb_randr_output_t output,xcb_atom_t property,uint8_t pending,uint8_t range,uint32_t values_len,const int32_t * values)1393971bb1a5SLionel Sambuc xcb_randr_configure_output_property_checked (xcb_connection_t *c /**< */,
1394971bb1a5SLionel Sambuc xcb_randr_output_t output /**< */,
1395971bb1a5SLionel Sambuc xcb_atom_t property /**< */,
1396971bb1a5SLionel Sambuc uint8_t pending /**< */,
1397971bb1a5SLionel Sambuc uint8_t range /**< */,
1398971bb1a5SLionel Sambuc uint32_t values_len /**< */,
1399971bb1a5SLionel Sambuc const int32_t *values /**< */)
1400971bb1a5SLionel Sambuc {
1401971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1402971bb1a5SLionel Sambuc /* count */ 4,
1403971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
1404971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_CONFIGURE_OUTPUT_PROPERTY,
1405971bb1a5SLionel Sambuc /* isvoid */ 1
1406971bb1a5SLionel Sambuc };
1407971bb1a5SLionel Sambuc
1408971bb1a5SLionel Sambuc struct iovec xcb_parts[6];
1409971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
1410971bb1a5SLionel Sambuc xcb_randr_configure_output_property_request_t xcb_out;
1411971bb1a5SLionel Sambuc
1412971bb1a5SLionel Sambuc xcb_out.output = output;
1413971bb1a5SLionel Sambuc xcb_out.property = property;
1414971bb1a5SLionel Sambuc xcb_out.pending = pending;
1415971bb1a5SLionel Sambuc xcb_out.range = range;
1416971bb1a5SLionel Sambuc memset(xcb_out.pad0, 0, 2);
1417971bb1a5SLionel Sambuc
1418971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1419971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1420971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1421971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1422971bb1a5SLionel Sambuc /* int32_t values */
1423971bb1a5SLionel Sambuc xcb_parts[4].iov_base = (char *) values;
1424971bb1a5SLionel Sambuc xcb_parts[4].iov_len = values_len * sizeof(int32_t);
1425971bb1a5SLionel Sambuc xcb_parts[5].iov_base = 0;
1426971bb1a5SLionel Sambuc xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1427971bb1a5SLionel Sambuc
1428971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1429971bb1a5SLionel Sambuc return xcb_ret;
1430971bb1a5SLionel Sambuc }
1431971bb1a5SLionel Sambuc
1432971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_randr_configure_output_property(xcb_connection_t * c,xcb_randr_output_t output,xcb_atom_t property,uint8_t pending,uint8_t range,uint32_t values_len,const int32_t * values)1433971bb1a5SLionel Sambuc xcb_randr_configure_output_property (xcb_connection_t *c /**< */,
1434971bb1a5SLionel Sambuc xcb_randr_output_t output /**< */,
1435971bb1a5SLionel Sambuc xcb_atom_t property /**< */,
1436971bb1a5SLionel Sambuc uint8_t pending /**< */,
1437971bb1a5SLionel Sambuc uint8_t range /**< */,
1438971bb1a5SLionel Sambuc uint32_t values_len /**< */,
1439971bb1a5SLionel Sambuc const int32_t *values /**< */)
1440971bb1a5SLionel Sambuc {
1441971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1442971bb1a5SLionel Sambuc /* count */ 4,
1443971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
1444971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_CONFIGURE_OUTPUT_PROPERTY,
1445971bb1a5SLionel Sambuc /* isvoid */ 1
1446971bb1a5SLionel Sambuc };
1447971bb1a5SLionel Sambuc
1448971bb1a5SLionel Sambuc struct iovec xcb_parts[6];
1449971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
1450971bb1a5SLionel Sambuc xcb_randr_configure_output_property_request_t xcb_out;
1451971bb1a5SLionel Sambuc
1452971bb1a5SLionel Sambuc xcb_out.output = output;
1453971bb1a5SLionel Sambuc xcb_out.property = property;
1454971bb1a5SLionel Sambuc xcb_out.pending = pending;
1455971bb1a5SLionel Sambuc xcb_out.range = range;
1456971bb1a5SLionel Sambuc memset(xcb_out.pad0, 0, 2);
1457971bb1a5SLionel Sambuc
1458971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1459971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1460971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1461971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1462971bb1a5SLionel Sambuc /* int32_t values */
1463971bb1a5SLionel Sambuc xcb_parts[4].iov_base = (char *) values;
1464971bb1a5SLionel Sambuc xcb_parts[4].iov_len = values_len * sizeof(int32_t);
1465971bb1a5SLionel Sambuc xcb_parts[5].iov_base = 0;
1466971bb1a5SLionel Sambuc xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1467971bb1a5SLionel Sambuc
1468971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1469971bb1a5SLionel Sambuc return xcb_ret;
1470971bb1a5SLionel Sambuc }
1471971bb1a5SLionel Sambuc
1472971bb1a5SLionel Sambuc int
xcb_randr_change_output_property_sizeof(const void * _buffer)1473971bb1a5SLionel Sambuc xcb_randr_change_output_property_sizeof (const void *_buffer /**< */)
1474971bb1a5SLionel Sambuc {
1475971bb1a5SLionel Sambuc char *xcb_tmp = (char *)_buffer;
1476971bb1a5SLionel Sambuc const xcb_randr_change_output_property_request_t *_aux = (xcb_randr_change_output_property_request_t *)_buffer;
1477971bb1a5SLionel Sambuc unsigned int xcb_buffer_len = 0;
1478971bb1a5SLionel Sambuc unsigned int xcb_block_len = 0;
1479971bb1a5SLionel Sambuc unsigned int xcb_pad = 0;
1480*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
1481971bb1a5SLionel Sambuc
1482971bb1a5SLionel Sambuc
1483971bb1a5SLionel Sambuc xcb_block_len += sizeof(xcb_randr_change_output_property_request_t);
1484971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
1485*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len;
1486*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
1487971bb1a5SLionel Sambuc /* data */
1488971bb1a5SLionel Sambuc xcb_block_len += ((_aux->num_units * _aux->format) / 8) * sizeof(char);
1489971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
1490971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(char);
1491971bb1a5SLionel Sambuc /* insert padding */
1492971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1493971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
1494971bb1a5SLionel Sambuc if (0 != xcb_pad) {
1495971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
1496971bb1a5SLionel Sambuc xcb_pad = 0;
1497971bb1a5SLionel Sambuc }
1498971bb1a5SLionel Sambuc xcb_block_len = 0;
1499971bb1a5SLionel Sambuc
1500971bb1a5SLionel Sambuc return xcb_buffer_len;
1501971bb1a5SLionel Sambuc }
1502971bb1a5SLionel Sambuc
1503971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_randr_change_output_property_checked(xcb_connection_t * c,xcb_randr_output_t output,xcb_atom_t property,xcb_atom_t type,uint8_t format,uint8_t mode,uint32_t num_units,const void * data)1504971bb1a5SLionel Sambuc xcb_randr_change_output_property_checked (xcb_connection_t *c /**< */,
1505971bb1a5SLionel Sambuc xcb_randr_output_t output /**< */,
1506971bb1a5SLionel Sambuc xcb_atom_t property /**< */,
1507971bb1a5SLionel Sambuc xcb_atom_t type /**< */,
1508971bb1a5SLionel Sambuc uint8_t format /**< */,
1509971bb1a5SLionel Sambuc uint8_t mode /**< */,
1510971bb1a5SLionel Sambuc uint32_t num_units /**< */,
1511971bb1a5SLionel Sambuc const void *data /**< */)
1512971bb1a5SLionel Sambuc {
1513971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1514971bb1a5SLionel Sambuc /* count */ 4,
1515971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
1516971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_CHANGE_OUTPUT_PROPERTY,
1517971bb1a5SLionel Sambuc /* isvoid */ 1
1518971bb1a5SLionel Sambuc };
1519971bb1a5SLionel Sambuc
1520971bb1a5SLionel Sambuc struct iovec xcb_parts[6];
1521971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
1522971bb1a5SLionel Sambuc xcb_randr_change_output_property_request_t xcb_out;
1523971bb1a5SLionel Sambuc
1524971bb1a5SLionel Sambuc xcb_out.output = output;
1525971bb1a5SLionel Sambuc xcb_out.property = property;
1526971bb1a5SLionel Sambuc xcb_out.type = type;
1527971bb1a5SLionel Sambuc xcb_out.format = format;
1528971bb1a5SLionel Sambuc xcb_out.mode = mode;
1529971bb1a5SLionel Sambuc memset(xcb_out.pad0, 0, 2);
1530971bb1a5SLionel Sambuc xcb_out.num_units = num_units;
1531971bb1a5SLionel Sambuc
1532971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1533971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1534971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1535971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1536971bb1a5SLionel Sambuc /* void data */
1537971bb1a5SLionel Sambuc xcb_parts[4].iov_base = (char *) data;
1538971bb1a5SLionel Sambuc xcb_parts[4].iov_len = ((num_units * format) / 8) * sizeof(char);
1539971bb1a5SLionel Sambuc xcb_parts[5].iov_base = 0;
1540971bb1a5SLionel Sambuc xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1541971bb1a5SLionel Sambuc
1542971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1543971bb1a5SLionel Sambuc return xcb_ret;
1544971bb1a5SLionel Sambuc }
1545971bb1a5SLionel Sambuc
1546971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_randr_change_output_property(xcb_connection_t * c,xcb_randr_output_t output,xcb_atom_t property,xcb_atom_t type,uint8_t format,uint8_t mode,uint32_t num_units,const void * data)1547971bb1a5SLionel Sambuc xcb_randr_change_output_property (xcb_connection_t *c /**< */,
1548971bb1a5SLionel Sambuc xcb_randr_output_t output /**< */,
1549971bb1a5SLionel Sambuc xcb_atom_t property /**< */,
1550971bb1a5SLionel Sambuc xcb_atom_t type /**< */,
1551971bb1a5SLionel Sambuc uint8_t format /**< */,
1552971bb1a5SLionel Sambuc uint8_t mode /**< */,
1553971bb1a5SLionel Sambuc uint32_t num_units /**< */,
1554971bb1a5SLionel Sambuc const void *data /**< */)
1555971bb1a5SLionel Sambuc {
1556971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1557971bb1a5SLionel Sambuc /* count */ 4,
1558971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
1559971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_CHANGE_OUTPUT_PROPERTY,
1560971bb1a5SLionel Sambuc /* isvoid */ 1
1561971bb1a5SLionel Sambuc };
1562971bb1a5SLionel Sambuc
1563971bb1a5SLionel Sambuc struct iovec xcb_parts[6];
1564971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
1565971bb1a5SLionel Sambuc xcb_randr_change_output_property_request_t xcb_out;
1566971bb1a5SLionel Sambuc
1567971bb1a5SLionel Sambuc xcb_out.output = output;
1568971bb1a5SLionel Sambuc xcb_out.property = property;
1569971bb1a5SLionel Sambuc xcb_out.type = type;
1570971bb1a5SLionel Sambuc xcb_out.format = format;
1571971bb1a5SLionel Sambuc xcb_out.mode = mode;
1572971bb1a5SLionel Sambuc memset(xcb_out.pad0, 0, 2);
1573971bb1a5SLionel Sambuc xcb_out.num_units = num_units;
1574971bb1a5SLionel Sambuc
1575971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1576971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1577971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1578971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1579971bb1a5SLionel Sambuc /* void data */
1580971bb1a5SLionel Sambuc xcb_parts[4].iov_base = (char *) data;
1581971bb1a5SLionel Sambuc xcb_parts[4].iov_len = ((num_units * format) / 8) * sizeof(char);
1582971bb1a5SLionel Sambuc xcb_parts[5].iov_base = 0;
1583971bb1a5SLionel Sambuc xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1584971bb1a5SLionel Sambuc
1585971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1586971bb1a5SLionel Sambuc return xcb_ret;
1587971bb1a5SLionel Sambuc }
1588971bb1a5SLionel Sambuc
1589971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_randr_delete_output_property_checked(xcb_connection_t * c,xcb_randr_output_t output,xcb_atom_t property)1590971bb1a5SLionel Sambuc xcb_randr_delete_output_property_checked (xcb_connection_t *c /**< */,
1591971bb1a5SLionel Sambuc xcb_randr_output_t output /**< */,
1592971bb1a5SLionel Sambuc xcb_atom_t property /**< */)
1593971bb1a5SLionel Sambuc {
1594971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1595971bb1a5SLionel Sambuc /* count */ 2,
1596971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
1597971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_DELETE_OUTPUT_PROPERTY,
1598971bb1a5SLionel Sambuc /* isvoid */ 1
1599971bb1a5SLionel Sambuc };
1600971bb1a5SLionel Sambuc
1601971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
1602971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
1603971bb1a5SLionel Sambuc xcb_randr_delete_output_property_request_t xcb_out;
1604971bb1a5SLionel Sambuc
1605971bb1a5SLionel Sambuc xcb_out.output = output;
1606971bb1a5SLionel Sambuc xcb_out.property = property;
1607971bb1a5SLionel Sambuc
1608971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1609971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1610971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1611971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1612971bb1a5SLionel Sambuc
1613971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1614971bb1a5SLionel Sambuc return xcb_ret;
1615971bb1a5SLionel Sambuc }
1616971bb1a5SLionel Sambuc
1617971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_randr_delete_output_property(xcb_connection_t * c,xcb_randr_output_t output,xcb_atom_t property)1618971bb1a5SLionel Sambuc xcb_randr_delete_output_property (xcb_connection_t *c /**< */,
1619971bb1a5SLionel Sambuc xcb_randr_output_t output /**< */,
1620971bb1a5SLionel Sambuc xcb_atom_t property /**< */)
1621971bb1a5SLionel Sambuc {
1622971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1623971bb1a5SLionel Sambuc /* count */ 2,
1624971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
1625971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_DELETE_OUTPUT_PROPERTY,
1626971bb1a5SLionel Sambuc /* isvoid */ 1
1627971bb1a5SLionel Sambuc };
1628971bb1a5SLionel Sambuc
1629971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
1630971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
1631971bb1a5SLionel Sambuc xcb_randr_delete_output_property_request_t xcb_out;
1632971bb1a5SLionel Sambuc
1633971bb1a5SLionel Sambuc xcb_out.output = output;
1634971bb1a5SLionel Sambuc xcb_out.property = property;
1635971bb1a5SLionel Sambuc
1636971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1637971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1638971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1639971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1640971bb1a5SLionel Sambuc
1641971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1642971bb1a5SLionel Sambuc return xcb_ret;
1643971bb1a5SLionel Sambuc }
1644971bb1a5SLionel Sambuc
1645971bb1a5SLionel Sambuc int
xcb_randr_get_output_property_sizeof(const void * _buffer)1646971bb1a5SLionel Sambuc xcb_randr_get_output_property_sizeof (const void *_buffer /**< */)
1647971bb1a5SLionel Sambuc {
1648971bb1a5SLionel Sambuc char *xcb_tmp = (char *)_buffer;
1649971bb1a5SLionel Sambuc const xcb_randr_get_output_property_reply_t *_aux = (xcb_randr_get_output_property_reply_t *)_buffer;
1650971bb1a5SLionel Sambuc unsigned int xcb_buffer_len = 0;
1651971bb1a5SLionel Sambuc unsigned int xcb_block_len = 0;
1652971bb1a5SLionel Sambuc unsigned int xcb_pad = 0;
1653*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
1654971bb1a5SLionel Sambuc
1655971bb1a5SLionel Sambuc
1656971bb1a5SLionel Sambuc xcb_block_len += sizeof(xcb_randr_get_output_property_reply_t);
1657971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
1658*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len;
1659*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
1660971bb1a5SLionel Sambuc /* data */
1661971bb1a5SLionel Sambuc xcb_block_len += (_aux->num_items * (_aux->format / 8)) * sizeof(uint8_t);
1662971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
1663971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(uint8_t);
1664971bb1a5SLionel Sambuc /* insert padding */
1665971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1666971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
1667971bb1a5SLionel Sambuc if (0 != xcb_pad) {
1668971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
1669971bb1a5SLionel Sambuc xcb_pad = 0;
1670971bb1a5SLionel Sambuc }
1671971bb1a5SLionel Sambuc xcb_block_len = 0;
1672971bb1a5SLionel Sambuc
1673971bb1a5SLionel Sambuc return xcb_buffer_len;
1674971bb1a5SLionel Sambuc }
1675971bb1a5SLionel Sambuc
1676971bb1a5SLionel Sambuc xcb_randr_get_output_property_cookie_t
xcb_randr_get_output_property(xcb_connection_t * c,xcb_randr_output_t output,xcb_atom_t property,xcb_atom_t type,uint32_t long_offset,uint32_t long_length,uint8_t _delete,uint8_t pending)1677971bb1a5SLionel Sambuc xcb_randr_get_output_property (xcb_connection_t *c /**< */,
1678971bb1a5SLionel Sambuc xcb_randr_output_t output /**< */,
1679971bb1a5SLionel Sambuc xcb_atom_t property /**< */,
1680971bb1a5SLionel Sambuc xcb_atom_t type /**< */,
1681971bb1a5SLionel Sambuc uint32_t long_offset /**< */,
1682971bb1a5SLionel Sambuc uint32_t long_length /**< */,
1683971bb1a5SLionel Sambuc uint8_t _delete /**< */,
1684971bb1a5SLionel Sambuc uint8_t pending /**< */)
1685971bb1a5SLionel Sambuc {
1686971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1687971bb1a5SLionel Sambuc /* count */ 2,
1688971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
1689971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_GET_OUTPUT_PROPERTY,
1690971bb1a5SLionel Sambuc /* isvoid */ 0
1691971bb1a5SLionel Sambuc };
1692971bb1a5SLionel Sambuc
1693971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
1694971bb1a5SLionel Sambuc xcb_randr_get_output_property_cookie_t xcb_ret;
1695971bb1a5SLionel Sambuc xcb_randr_get_output_property_request_t xcb_out;
1696971bb1a5SLionel Sambuc
1697971bb1a5SLionel Sambuc xcb_out.output = output;
1698971bb1a5SLionel Sambuc xcb_out.property = property;
1699971bb1a5SLionel Sambuc xcb_out.type = type;
1700971bb1a5SLionel Sambuc xcb_out.long_offset = long_offset;
1701971bb1a5SLionel Sambuc xcb_out.long_length = long_length;
1702971bb1a5SLionel Sambuc xcb_out._delete = _delete;
1703971bb1a5SLionel Sambuc xcb_out.pending = pending;
1704971bb1a5SLionel Sambuc memset(xcb_out.pad0, 0, 2);
1705971bb1a5SLionel Sambuc
1706971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1707971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1708971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1709971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1710971bb1a5SLionel Sambuc
1711971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1712971bb1a5SLionel Sambuc return xcb_ret;
1713971bb1a5SLionel Sambuc }
1714971bb1a5SLionel Sambuc
1715971bb1a5SLionel Sambuc xcb_randr_get_output_property_cookie_t
xcb_randr_get_output_property_unchecked(xcb_connection_t * c,xcb_randr_output_t output,xcb_atom_t property,xcb_atom_t type,uint32_t long_offset,uint32_t long_length,uint8_t _delete,uint8_t pending)1716971bb1a5SLionel Sambuc xcb_randr_get_output_property_unchecked (xcb_connection_t *c /**< */,
1717971bb1a5SLionel Sambuc xcb_randr_output_t output /**< */,
1718971bb1a5SLionel Sambuc xcb_atom_t property /**< */,
1719971bb1a5SLionel Sambuc xcb_atom_t type /**< */,
1720971bb1a5SLionel Sambuc uint32_t long_offset /**< */,
1721971bb1a5SLionel Sambuc uint32_t long_length /**< */,
1722971bb1a5SLionel Sambuc uint8_t _delete /**< */,
1723971bb1a5SLionel Sambuc uint8_t pending /**< */)
1724971bb1a5SLionel Sambuc {
1725971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1726971bb1a5SLionel Sambuc /* count */ 2,
1727971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
1728971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_GET_OUTPUT_PROPERTY,
1729971bb1a5SLionel Sambuc /* isvoid */ 0
1730971bb1a5SLionel Sambuc };
1731971bb1a5SLionel Sambuc
1732971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
1733971bb1a5SLionel Sambuc xcb_randr_get_output_property_cookie_t xcb_ret;
1734971bb1a5SLionel Sambuc xcb_randr_get_output_property_request_t xcb_out;
1735971bb1a5SLionel Sambuc
1736971bb1a5SLionel Sambuc xcb_out.output = output;
1737971bb1a5SLionel Sambuc xcb_out.property = property;
1738971bb1a5SLionel Sambuc xcb_out.type = type;
1739971bb1a5SLionel Sambuc xcb_out.long_offset = long_offset;
1740971bb1a5SLionel Sambuc xcb_out.long_length = long_length;
1741971bb1a5SLionel Sambuc xcb_out._delete = _delete;
1742971bb1a5SLionel Sambuc xcb_out.pending = pending;
1743971bb1a5SLionel Sambuc memset(xcb_out.pad0, 0, 2);
1744971bb1a5SLionel Sambuc
1745971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1746971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1747971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1748971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1749971bb1a5SLionel Sambuc
1750971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1751971bb1a5SLionel Sambuc return xcb_ret;
1752971bb1a5SLionel Sambuc }
1753971bb1a5SLionel Sambuc
1754971bb1a5SLionel Sambuc uint8_t *
xcb_randr_get_output_property_data(const xcb_randr_get_output_property_reply_t * R)1755971bb1a5SLionel Sambuc xcb_randr_get_output_property_data (const xcb_randr_get_output_property_reply_t *R /**< */)
1756971bb1a5SLionel Sambuc {
1757971bb1a5SLionel Sambuc return (uint8_t *) (R + 1);
1758971bb1a5SLionel Sambuc }
1759971bb1a5SLionel Sambuc
1760971bb1a5SLionel Sambuc int
xcb_randr_get_output_property_data_length(const xcb_randr_get_output_property_reply_t * R)1761971bb1a5SLionel Sambuc xcb_randr_get_output_property_data_length (const xcb_randr_get_output_property_reply_t *R /**< */)
1762971bb1a5SLionel Sambuc {
1763971bb1a5SLionel Sambuc return (R->num_items * (R->format / 8));
1764971bb1a5SLionel Sambuc }
1765971bb1a5SLionel Sambuc
1766971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_randr_get_output_property_data_end(const xcb_randr_get_output_property_reply_t * R)1767971bb1a5SLionel Sambuc xcb_randr_get_output_property_data_end (const xcb_randr_get_output_property_reply_t *R /**< */)
1768971bb1a5SLionel Sambuc {
1769971bb1a5SLionel Sambuc xcb_generic_iterator_t i;
1770971bb1a5SLionel Sambuc i.data = ((uint8_t *) (R + 1)) + ((R->num_items * (R->format / 8)));
1771971bb1a5SLionel Sambuc i.rem = 0;
1772971bb1a5SLionel Sambuc i.index = (char *) i.data - (char *) R;
1773971bb1a5SLionel Sambuc return i;
1774971bb1a5SLionel Sambuc }
1775971bb1a5SLionel Sambuc
1776971bb1a5SLionel Sambuc xcb_randr_get_output_property_reply_t *
xcb_randr_get_output_property_reply(xcb_connection_t * c,xcb_randr_get_output_property_cookie_t cookie,xcb_generic_error_t ** e)1777971bb1a5SLionel Sambuc xcb_randr_get_output_property_reply (xcb_connection_t *c /**< */,
1778971bb1a5SLionel Sambuc xcb_randr_get_output_property_cookie_t cookie /**< */,
1779971bb1a5SLionel Sambuc xcb_generic_error_t **e /**< */)
1780971bb1a5SLionel Sambuc {
1781971bb1a5SLionel Sambuc return (xcb_randr_get_output_property_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1782971bb1a5SLionel Sambuc }
1783971bb1a5SLionel Sambuc
1784971bb1a5SLionel Sambuc int
xcb_randr_create_mode_sizeof(const void * _buffer,uint32_t name_len)1785971bb1a5SLionel Sambuc xcb_randr_create_mode_sizeof (const void *_buffer /**< */,
1786971bb1a5SLionel Sambuc uint32_t name_len /**< */)
1787971bb1a5SLionel Sambuc {
1788971bb1a5SLionel Sambuc char *xcb_tmp = (char *)_buffer;
1789971bb1a5SLionel Sambuc unsigned int xcb_buffer_len = 0;
1790971bb1a5SLionel Sambuc unsigned int xcb_block_len = 0;
1791971bb1a5SLionel Sambuc unsigned int xcb_pad = 0;
1792*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
1793971bb1a5SLionel Sambuc
1794971bb1a5SLionel Sambuc
1795971bb1a5SLionel Sambuc xcb_block_len += sizeof(xcb_randr_create_mode_request_t);
1796971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
1797*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len;
1798*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
1799971bb1a5SLionel Sambuc /* name */
1800971bb1a5SLionel Sambuc xcb_block_len += name_len * sizeof(char);
1801971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
1802971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(char);
1803971bb1a5SLionel Sambuc /* insert padding */
1804971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1805971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
1806971bb1a5SLionel Sambuc if (0 != xcb_pad) {
1807971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
1808971bb1a5SLionel Sambuc xcb_pad = 0;
1809971bb1a5SLionel Sambuc }
1810971bb1a5SLionel Sambuc xcb_block_len = 0;
1811971bb1a5SLionel Sambuc
1812971bb1a5SLionel Sambuc return xcb_buffer_len;
1813971bb1a5SLionel Sambuc }
1814971bb1a5SLionel Sambuc
1815971bb1a5SLionel Sambuc xcb_randr_create_mode_cookie_t
xcb_randr_create_mode(xcb_connection_t * c,xcb_window_t window,xcb_randr_mode_info_t mode_info,uint32_t name_len,const char * name)1816971bb1a5SLionel Sambuc xcb_randr_create_mode (xcb_connection_t *c /**< */,
1817971bb1a5SLionel Sambuc xcb_window_t window /**< */,
1818971bb1a5SLionel Sambuc xcb_randr_mode_info_t mode_info /**< */,
1819971bb1a5SLionel Sambuc uint32_t name_len /**< */,
1820971bb1a5SLionel Sambuc const char *name /**< */)
1821971bb1a5SLionel Sambuc {
1822971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1823971bb1a5SLionel Sambuc /* count */ 4,
1824971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
1825971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_CREATE_MODE,
1826971bb1a5SLionel Sambuc /* isvoid */ 0
1827971bb1a5SLionel Sambuc };
1828971bb1a5SLionel Sambuc
1829971bb1a5SLionel Sambuc struct iovec xcb_parts[6];
1830971bb1a5SLionel Sambuc xcb_randr_create_mode_cookie_t xcb_ret;
1831971bb1a5SLionel Sambuc xcb_randr_create_mode_request_t xcb_out;
1832971bb1a5SLionel Sambuc
1833971bb1a5SLionel Sambuc xcb_out.window = window;
1834971bb1a5SLionel Sambuc xcb_out.mode_info = mode_info;
1835971bb1a5SLionel Sambuc
1836971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1837971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1838971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1839971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1840971bb1a5SLionel Sambuc /* char name */
1841971bb1a5SLionel Sambuc xcb_parts[4].iov_base = (char *) name;
1842971bb1a5SLionel Sambuc xcb_parts[4].iov_len = name_len * sizeof(char);
1843971bb1a5SLionel Sambuc xcb_parts[5].iov_base = 0;
1844971bb1a5SLionel Sambuc xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1845971bb1a5SLionel Sambuc
1846971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1847971bb1a5SLionel Sambuc return xcb_ret;
1848971bb1a5SLionel Sambuc }
1849971bb1a5SLionel Sambuc
1850971bb1a5SLionel Sambuc xcb_randr_create_mode_cookie_t
xcb_randr_create_mode_unchecked(xcb_connection_t * c,xcb_window_t window,xcb_randr_mode_info_t mode_info,uint32_t name_len,const char * name)1851971bb1a5SLionel Sambuc xcb_randr_create_mode_unchecked (xcb_connection_t *c /**< */,
1852971bb1a5SLionel Sambuc xcb_window_t window /**< */,
1853971bb1a5SLionel Sambuc xcb_randr_mode_info_t mode_info /**< */,
1854971bb1a5SLionel Sambuc uint32_t name_len /**< */,
1855971bb1a5SLionel Sambuc const char *name /**< */)
1856971bb1a5SLionel Sambuc {
1857971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1858971bb1a5SLionel Sambuc /* count */ 4,
1859971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
1860971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_CREATE_MODE,
1861971bb1a5SLionel Sambuc /* isvoid */ 0
1862971bb1a5SLionel Sambuc };
1863971bb1a5SLionel Sambuc
1864971bb1a5SLionel Sambuc struct iovec xcb_parts[6];
1865971bb1a5SLionel Sambuc xcb_randr_create_mode_cookie_t xcb_ret;
1866971bb1a5SLionel Sambuc xcb_randr_create_mode_request_t xcb_out;
1867971bb1a5SLionel Sambuc
1868971bb1a5SLionel Sambuc xcb_out.window = window;
1869971bb1a5SLionel Sambuc xcb_out.mode_info = mode_info;
1870971bb1a5SLionel Sambuc
1871971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1872971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1873971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1874971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1875971bb1a5SLionel Sambuc /* char name */
1876971bb1a5SLionel Sambuc xcb_parts[4].iov_base = (char *) name;
1877971bb1a5SLionel Sambuc xcb_parts[4].iov_len = name_len * sizeof(char);
1878971bb1a5SLionel Sambuc xcb_parts[5].iov_base = 0;
1879971bb1a5SLionel Sambuc xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
1880971bb1a5SLionel Sambuc
1881971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1882971bb1a5SLionel Sambuc return xcb_ret;
1883971bb1a5SLionel Sambuc }
1884971bb1a5SLionel Sambuc
1885971bb1a5SLionel Sambuc xcb_randr_create_mode_reply_t *
xcb_randr_create_mode_reply(xcb_connection_t * c,xcb_randr_create_mode_cookie_t cookie,xcb_generic_error_t ** e)1886971bb1a5SLionel Sambuc xcb_randr_create_mode_reply (xcb_connection_t *c /**< */,
1887971bb1a5SLionel Sambuc xcb_randr_create_mode_cookie_t cookie /**< */,
1888971bb1a5SLionel Sambuc xcb_generic_error_t **e /**< */)
1889971bb1a5SLionel Sambuc {
1890971bb1a5SLionel Sambuc return (xcb_randr_create_mode_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1891971bb1a5SLionel Sambuc }
1892971bb1a5SLionel Sambuc
1893971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_randr_destroy_mode_checked(xcb_connection_t * c,xcb_randr_mode_t mode)1894971bb1a5SLionel Sambuc xcb_randr_destroy_mode_checked (xcb_connection_t *c /**< */,
1895971bb1a5SLionel Sambuc xcb_randr_mode_t mode /**< */)
1896971bb1a5SLionel Sambuc {
1897971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1898971bb1a5SLionel Sambuc /* count */ 2,
1899971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
1900971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_DESTROY_MODE,
1901971bb1a5SLionel Sambuc /* isvoid */ 1
1902971bb1a5SLionel Sambuc };
1903971bb1a5SLionel Sambuc
1904971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
1905971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
1906971bb1a5SLionel Sambuc xcb_randr_destroy_mode_request_t xcb_out;
1907971bb1a5SLionel Sambuc
1908971bb1a5SLionel Sambuc xcb_out.mode = mode;
1909971bb1a5SLionel Sambuc
1910971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1911971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1912971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1913971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1914971bb1a5SLionel Sambuc
1915971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1916971bb1a5SLionel Sambuc return xcb_ret;
1917971bb1a5SLionel Sambuc }
1918971bb1a5SLionel Sambuc
1919971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_randr_destroy_mode(xcb_connection_t * c,xcb_randr_mode_t mode)1920971bb1a5SLionel Sambuc xcb_randr_destroy_mode (xcb_connection_t *c /**< */,
1921971bb1a5SLionel Sambuc xcb_randr_mode_t mode /**< */)
1922971bb1a5SLionel Sambuc {
1923971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1924971bb1a5SLionel Sambuc /* count */ 2,
1925971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
1926971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_DESTROY_MODE,
1927971bb1a5SLionel Sambuc /* isvoid */ 1
1928971bb1a5SLionel Sambuc };
1929971bb1a5SLionel Sambuc
1930971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
1931971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
1932971bb1a5SLionel Sambuc xcb_randr_destroy_mode_request_t xcb_out;
1933971bb1a5SLionel Sambuc
1934971bb1a5SLionel Sambuc xcb_out.mode = mode;
1935971bb1a5SLionel Sambuc
1936971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1937971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1938971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1939971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1940971bb1a5SLionel Sambuc
1941971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1942971bb1a5SLionel Sambuc return xcb_ret;
1943971bb1a5SLionel Sambuc }
1944971bb1a5SLionel Sambuc
1945971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_randr_add_output_mode_checked(xcb_connection_t * c,xcb_randr_output_t output,xcb_randr_mode_t mode)1946971bb1a5SLionel Sambuc xcb_randr_add_output_mode_checked (xcb_connection_t *c /**< */,
1947971bb1a5SLionel Sambuc xcb_randr_output_t output /**< */,
1948971bb1a5SLionel Sambuc xcb_randr_mode_t mode /**< */)
1949971bb1a5SLionel Sambuc {
1950971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1951971bb1a5SLionel Sambuc /* count */ 2,
1952971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
1953971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_ADD_OUTPUT_MODE,
1954971bb1a5SLionel Sambuc /* isvoid */ 1
1955971bb1a5SLionel Sambuc };
1956971bb1a5SLionel Sambuc
1957971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
1958971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
1959971bb1a5SLionel Sambuc xcb_randr_add_output_mode_request_t xcb_out;
1960971bb1a5SLionel Sambuc
1961971bb1a5SLionel Sambuc xcb_out.output = output;
1962971bb1a5SLionel Sambuc xcb_out.mode = mode;
1963971bb1a5SLionel Sambuc
1964971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1965971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1966971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1967971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1968971bb1a5SLionel Sambuc
1969971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1970971bb1a5SLionel Sambuc return xcb_ret;
1971971bb1a5SLionel Sambuc }
1972971bb1a5SLionel Sambuc
1973971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_randr_add_output_mode(xcb_connection_t * c,xcb_randr_output_t output,xcb_randr_mode_t mode)1974971bb1a5SLionel Sambuc xcb_randr_add_output_mode (xcb_connection_t *c /**< */,
1975971bb1a5SLionel Sambuc xcb_randr_output_t output /**< */,
1976971bb1a5SLionel Sambuc xcb_randr_mode_t mode /**< */)
1977971bb1a5SLionel Sambuc {
1978971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
1979971bb1a5SLionel Sambuc /* count */ 2,
1980971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
1981971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_ADD_OUTPUT_MODE,
1982971bb1a5SLionel Sambuc /* isvoid */ 1
1983971bb1a5SLionel Sambuc };
1984971bb1a5SLionel Sambuc
1985971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
1986971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
1987971bb1a5SLionel Sambuc xcb_randr_add_output_mode_request_t xcb_out;
1988971bb1a5SLionel Sambuc
1989971bb1a5SLionel Sambuc xcb_out.output = output;
1990971bb1a5SLionel Sambuc xcb_out.mode = mode;
1991971bb1a5SLionel Sambuc
1992971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
1993971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
1994971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
1995971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1996971bb1a5SLionel Sambuc
1997971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1998971bb1a5SLionel Sambuc return xcb_ret;
1999971bb1a5SLionel Sambuc }
2000971bb1a5SLionel Sambuc
2001971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_randr_delete_output_mode_checked(xcb_connection_t * c,xcb_randr_output_t output,xcb_randr_mode_t mode)2002971bb1a5SLionel Sambuc xcb_randr_delete_output_mode_checked (xcb_connection_t *c /**< */,
2003971bb1a5SLionel Sambuc xcb_randr_output_t output /**< */,
2004971bb1a5SLionel Sambuc xcb_randr_mode_t mode /**< */)
2005971bb1a5SLionel Sambuc {
2006971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
2007971bb1a5SLionel Sambuc /* count */ 2,
2008971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
2009971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_DELETE_OUTPUT_MODE,
2010971bb1a5SLionel Sambuc /* isvoid */ 1
2011971bb1a5SLionel Sambuc };
2012971bb1a5SLionel Sambuc
2013971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
2014971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
2015971bb1a5SLionel Sambuc xcb_randr_delete_output_mode_request_t xcb_out;
2016971bb1a5SLionel Sambuc
2017971bb1a5SLionel Sambuc xcb_out.output = output;
2018971bb1a5SLionel Sambuc xcb_out.mode = mode;
2019971bb1a5SLionel Sambuc
2020971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
2021971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
2022971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
2023971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2024971bb1a5SLionel Sambuc
2025971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2026971bb1a5SLionel Sambuc return xcb_ret;
2027971bb1a5SLionel Sambuc }
2028971bb1a5SLionel Sambuc
2029971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_randr_delete_output_mode(xcb_connection_t * c,xcb_randr_output_t output,xcb_randr_mode_t mode)2030971bb1a5SLionel Sambuc xcb_randr_delete_output_mode (xcb_connection_t *c /**< */,
2031971bb1a5SLionel Sambuc xcb_randr_output_t output /**< */,
2032971bb1a5SLionel Sambuc xcb_randr_mode_t mode /**< */)
2033971bb1a5SLionel Sambuc {
2034971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
2035971bb1a5SLionel Sambuc /* count */ 2,
2036971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
2037971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_DELETE_OUTPUT_MODE,
2038971bb1a5SLionel Sambuc /* isvoid */ 1
2039971bb1a5SLionel Sambuc };
2040971bb1a5SLionel Sambuc
2041971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
2042971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
2043971bb1a5SLionel Sambuc xcb_randr_delete_output_mode_request_t xcb_out;
2044971bb1a5SLionel Sambuc
2045971bb1a5SLionel Sambuc xcb_out.output = output;
2046971bb1a5SLionel Sambuc xcb_out.mode = mode;
2047971bb1a5SLionel Sambuc
2048971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
2049971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
2050971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
2051971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2052971bb1a5SLionel Sambuc
2053971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2054971bb1a5SLionel Sambuc return xcb_ret;
2055971bb1a5SLionel Sambuc }
2056971bb1a5SLionel Sambuc
2057971bb1a5SLionel Sambuc int
xcb_randr_get_crtc_info_sizeof(const void * _buffer)2058971bb1a5SLionel Sambuc xcb_randr_get_crtc_info_sizeof (const void *_buffer /**< */)
2059971bb1a5SLionel Sambuc {
2060971bb1a5SLionel Sambuc char *xcb_tmp = (char *)_buffer;
2061971bb1a5SLionel Sambuc const xcb_randr_get_crtc_info_reply_t *_aux = (xcb_randr_get_crtc_info_reply_t *)_buffer;
2062971bb1a5SLionel Sambuc unsigned int xcb_buffer_len = 0;
2063971bb1a5SLionel Sambuc unsigned int xcb_block_len = 0;
2064971bb1a5SLionel Sambuc unsigned int xcb_pad = 0;
2065*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
2066971bb1a5SLionel Sambuc
2067971bb1a5SLionel Sambuc
2068971bb1a5SLionel Sambuc xcb_block_len += sizeof(xcb_randr_get_crtc_info_reply_t);
2069971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
2070*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len;
2071*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
2072971bb1a5SLionel Sambuc /* outputs */
2073971bb1a5SLionel Sambuc xcb_block_len += _aux->num_outputs * sizeof(xcb_randr_output_t);
2074971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
2075971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(xcb_randr_output_t);
2076971bb1a5SLionel Sambuc /* insert padding */
2077971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2078971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
2079971bb1a5SLionel Sambuc if (0 != xcb_pad) {
2080971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
2081971bb1a5SLionel Sambuc xcb_pad = 0;
2082971bb1a5SLionel Sambuc }
2083971bb1a5SLionel Sambuc xcb_block_len = 0;
2084971bb1a5SLionel Sambuc /* possible */
2085971bb1a5SLionel Sambuc xcb_block_len += _aux->num_possible_outputs * sizeof(xcb_randr_output_t);
2086971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
2087971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(xcb_randr_output_t);
2088971bb1a5SLionel Sambuc /* insert padding */
2089971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2090971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
2091971bb1a5SLionel Sambuc if (0 != xcb_pad) {
2092971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
2093971bb1a5SLionel Sambuc xcb_pad = 0;
2094971bb1a5SLionel Sambuc }
2095971bb1a5SLionel Sambuc xcb_block_len = 0;
2096971bb1a5SLionel Sambuc
2097971bb1a5SLionel Sambuc return xcb_buffer_len;
2098971bb1a5SLionel Sambuc }
2099971bb1a5SLionel Sambuc
2100971bb1a5SLionel Sambuc xcb_randr_get_crtc_info_cookie_t
xcb_randr_get_crtc_info(xcb_connection_t * c,xcb_randr_crtc_t crtc,xcb_timestamp_t config_timestamp)2101971bb1a5SLionel Sambuc xcb_randr_get_crtc_info (xcb_connection_t *c /**< */,
2102971bb1a5SLionel Sambuc xcb_randr_crtc_t crtc /**< */,
2103971bb1a5SLionel Sambuc xcb_timestamp_t config_timestamp /**< */)
2104971bb1a5SLionel Sambuc {
2105971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
2106971bb1a5SLionel Sambuc /* count */ 2,
2107971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
2108971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_GET_CRTC_INFO,
2109971bb1a5SLionel Sambuc /* isvoid */ 0
2110971bb1a5SLionel Sambuc };
2111971bb1a5SLionel Sambuc
2112971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
2113971bb1a5SLionel Sambuc xcb_randr_get_crtc_info_cookie_t xcb_ret;
2114971bb1a5SLionel Sambuc xcb_randr_get_crtc_info_request_t xcb_out;
2115971bb1a5SLionel Sambuc
2116971bb1a5SLionel Sambuc xcb_out.crtc = crtc;
2117971bb1a5SLionel Sambuc xcb_out.config_timestamp = config_timestamp;
2118971bb1a5SLionel Sambuc
2119971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
2120971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
2121971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
2122971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2123971bb1a5SLionel Sambuc
2124971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2125971bb1a5SLionel Sambuc return xcb_ret;
2126971bb1a5SLionel Sambuc }
2127971bb1a5SLionel Sambuc
2128971bb1a5SLionel Sambuc xcb_randr_get_crtc_info_cookie_t
xcb_randr_get_crtc_info_unchecked(xcb_connection_t * c,xcb_randr_crtc_t crtc,xcb_timestamp_t config_timestamp)2129971bb1a5SLionel Sambuc xcb_randr_get_crtc_info_unchecked (xcb_connection_t *c /**< */,
2130971bb1a5SLionel Sambuc xcb_randr_crtc_t crtc /**< */,
2131971bb1a5SLionel Sambuc xcb_timestamp_t config_timestamp /**< */)
2132971bb1a5SLionel Sambuc {
2133971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
2134971bb1a5SLionel Sambuc /* count */ 2,
2135971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
2136971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_GET_CRTC_INFO,
2137971bb1a5SLionel Sambuc /* isvoid */ 0
2138971bb1a5SLionel Sambuc };
2139971bb1a5SLionel Sambuc
2140971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
2141971bb1a5SLionel Sambuc xcb_randr_get_crtc_info_cookie_t xcb_ret;
2142971bb1a5SLionel Sambuc xcb_randr_get_crtc_info_request_t xcb_out;
2143971bb1a5SLionel Sambuc
2144971bb1a5SLionel Sambuc xcb_out.crtc = crtc;
2145971bb1a5SLionel Sambuc xcb_out.config_timestamp = config_timestamp;
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
2152971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2153971bb1a5SLionel Sambuc return xcb_ret;
2154971bb1a5SLionel Sambuc }
2155971bb1a5SLionel Sambuc
2156971bb1a5SLionel Sambuc xcb_randr_output_t *
xcb_randr_get_crtc_info_outputs(const xcb_randr_get_crtc_info_reply_t * R)2157971bb1a5SLionel Sambuc xcb_randr_get_crtc_info_outputs (const xcb_randr_get_crtc_info_reply_t *R /**< */)
2158971bb1a5SLionel Sambuc {
2159971bb1a5SLionel Sambuc return (xcb_randr_output_t *) (R + 1);
2160971bb1a5SLionel Sambuc }
2161971bb1a5SLionel Sambuc
2162971bb1a5SLionel Sambuc int
xcb_randr_get_crtc_info_outputs_length(const xcb_randr_get_crtc_info_reply_t * R)2163971bb1a5SLionel Sambuc xcb_randr_get_crtc_info_outputs_length (const xcb_randr_get_crtc_info_reply_t *R /**< */)
2164971bb1a5SLionel Sambuc {
2165971bb1a5SLionel Sambuc return R->num_outputs;
2166971bb1a5SLionel Sambuc }
2167971bb1a5SLionel Sambuc
2168971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_randr_get_crtc_info_outputs_end(const xcb_randr_get_crtc_info_reply_t * R)2169971bb1a5SLionel Sambuc xcb_randr_get_crtc_info_outputs_end (const xcb_randr_get_crtc_info_reply_t *R /**< */)
2170971bb1a5SLionel Sambuc {
2171971bb1a5SLionel Sambuc xcb_generic_iterator_t i;
2172971bb1a5SLionel Sambuc i.data = ((xcb_randr_output_t *) (R + 1)) + (R->num_outputs);
2173971bb1a5SLionel Sambuc i.rem = 0;
2174971bb1a5SLionel Sambuc i.index = (char *) i.data - (char *) R;
2175971bb1a5SLionel Sambuc return i;
2176971bb1a5SLionel Sambuc }
2177971bb1a5SLionel Sambuc
2178971bb1a5SLionel Sambuc xcb_randr_output_t *
xcb_randr_get_crtc_info_possible(const xcb_randr_get_crtc_info_reply_t * R)2179971bb1a5SLionel Sambuc xcb_randr_get_crtc_info_possible (const xcb_randr_get_crtc_info_reply_t *R /**< */)
2180971bb1a5SLionel Sambuc {
2181971bb1a5SLionel Sambuc xcb_generic_iterator_t prev = xcb_randr_get_crtc_info_outputs_end(R);
2182971bb1a5SLionel Sambuc return (xcb_randr_output_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_randr_output_t, prev.index) + 0);
2183971bb1a5SLionel Sambuc }
2184971bb1a5SLionel Sambuc
2185971bb1a5SLionel Sambuc int
xcb_randr_get_crtc_info_possible_length(const xcb_randr_get_crtc_info_reply_t * R)2186971bb1a5SLionel Sambuc xcb_randr_get_crtc_info_possible_length (const xcb_randr_get_crtc_info_reply_t *R /**< */)
2187971bb1a5SLionel Sambuc {
2188971bb1a5SLionel Sambuc return R->num_possible_outputs;
2189971bb1a5SLionel Sambuc }
2190971bb1a5SLionel Sambuc
2191971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_randr_get_crtc_info_possible_end(const xcb_randr_get_crtc_info_reply_t * R)2192971bb1a5SLionel Sambuc xcb_randr_get_crtc_info_possible_end (const xcb_randr_get_crtc_info_reply_t *R /**< */)
2193971bb1a5SLionel Sambuc {
2194971bb1a5SLionel Sambuc xcb_generic_iterator_t i;
2195971bb1a5SLionel Sambuc xcb_generic_iterator_t child = xcb_randr_get_crtc_info_outputs_end(R);
2196971bb1a5SLionel Sambuc i.data = ((xcb_randr_output_t *) child.data) + (R->num_possible_outputs);
2197971bb1a5SLionel Sambuc i.rem = 0;
2198971bb1a5SLionel Sambuc i.index = (char *) i.data - (char *) R;
2199971bb1a5SLionel Sambuc return i;
2200971bb1a5SLionel Sambuc }
2201971bb1a5SLionel Sambuc
2202971bb1a5SLionel Sambuc xcb_randr_get_crtc_info_reply_t *
xcb_randr_get_crtc_info_reply(xcb_connection_t * c,xcb_randr_get_crtc_info_cookie_t cookie,xcb_generic_error_t ** e)2203971bb1a5SLionel Sambuc xcb_randr_get_crtc_info_reply (xcb_connection_t *c /**< */,
2204971bb1a5SLionel Sambuc xcb_randr_get_crtc_info_cookie_t cookie /**< */,
2205971bb1a5SLionel Sambuc xcb_generic_error_t **e /**< */)
2206971bb1a5SLionel Sambuc {
2207971bb1a5SLionel Sambuc return (xcb_randr_get_crtc_info_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
2208971bb1a5SLionel Sambuc }
2209971bb1a5SLionel Sambuc
2210971bb1a5SLionel Sambuc int
xcb_randr_set_crtc_config_sizeof(const void * _buffer,uint32_t outputs_len)2211971bb1a5SLionel Sambuc xcb_randr_set_crtc_config_sizeof (const void *_buffer /**< */,
2212971bb1a5SLionel Sambuc uint32_t outputs_len /**< */)
2213971bb1a5SLionel Sambuc {
2214971bb1a5SLionel Sambuc char *xcb_tmp = (char *)_buffer;
2215971bb1a5SLionel Sambuc unsigned int xcb_buffer_len = 0;
2216971bb1a5SLionel Sambuc unsigned int xcb_block_len = 0;
2217971bb1a5SLionel Sambuc unsigned int xcb_pad = 0;
2218*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
2219971bb1a5SLionel Sambuc
2220971bb1a5SLionel Sambuc
2221971bb1a5SLionel Sambuc xcb_block_len += sizeof(xcb_randr_set_crtc_config_request_t);
2222971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
2223*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len;
2224*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
2225971bb1a5SLionel Sambuc /* outputs */
2226971bb1a5SLionel Sambuc xcb_block_len += outputs_len * sizeof(xcb_randr_output_t);
2227971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
2228971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(xcb_randr_output_t);
2229971bb1a5SLionel Sambuc /* insert padding */
2230971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2231971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
2232971bb1a5SLionel Sambuc if (0 != xcb_pad) {
2233971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
2234971bb1a5SLionel Sambuc xcb_pad = 0;
2235971bb1a5SLionel Sambuc }
2236971bb1a5SLionel Sambuc xcb_block_len = 0;
2237971bb1a5SLionel Sambuc
2238971bb1a5SLionel Sambuc return xcb_buffer_len;
2239971bb1a5SLionel Sambuc }
2240971bb1a5SLionel Sambuc
2241971bb1a5SLionel Sambuc xcb_randr_set_crtc_config_cookie_t
xcb_randr_set_crtc_config(xcb_connection_t * c,xcb_randr_crtc_t crtc,xcb_timestamp_t timestamp,xcb_timestamp_t config_timestamp,int16_t x,int16_t y,xcb_randr_mode_t mode,uint16_t rotation,uint32_t outputs_len,const xcb_randr_output_t * outputs)2242971bb1a5SLionel Sambuc xcb_randr_set_crtc_config (xcb_connection_t *c /**< */,
2243971bb1a5SLionel Sambuc xcb_randr_crtc_t crtc /**< */,
2244971bb1a5SLionel Sambuc xcb_timestamp_t timestamp /**< */,
2245971bb1a5SLionel Sambuc xcb_timestamp_t config_timestamp /**< */,
2246971bb1a5SLionel Sambuc int16_t x /**< */,
2247971bb1a5SLionel Sambuc int16_t y /**< */,
2248971bb1a5SLionel Sambuc xcb_randr_mode_t mode /**< */,
2249971bb1a5SLionel Sambuc uint16_t rotation /**< */,
2250971bb1a5SLionel Sambuc uint32_t outputs_len /**< */,
2251971bb1a5SLionel Sambuc const xcb_randr_output_t *outputs /**< */)
2252971bb1a5SLionel Sambuc {
2253971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
2254971bb1a5SLionel Sambuc /* count */ 4,
2255971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
2256971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_SET_CRTC_CONFIG,
2257971bb1a5SLionel Sambuc /* isvoid */ 0
2258971bb1a5SLionel Sambuc };
2259971bb1a5SLionel Sambuc
2260971bb1a5SLionel Sambuc struct iovec xcb_parts[6];
2261971bb1a5SLionel Sambuc xcb_randr_set_crtc_config_cookie_t xcb_ret;
2262971bb1a5SLionel Sambuc xcb_randr_set_crtc_config_request_t xcb_out;
2263971bb1a5SLionel Sambuc
2264971bb1a5SLionel Sambuc xcb_out.crtc = crtc;
2265971bb1a5SLionel Sambuc xcb_out.timestamp = timestamp;
2266971bb1a5SLionel Sambuc xcb_out.config_timestamp = config_timestamp;
2267971bb1a5SLionel Sambuc xcb_out.x = x;
2268971bb1a5SLionel Sambuc xcb_out.y = y;
2269971bb1a5SLionel Sambuc xcb_out.mode = mode;
2270971bb1a5SLionel Sambuc xcb_out.rotation = rotation;
2271971bb1a5SLionel Sambuc memset(xcb_out.pad0, 0, 2);
2272971bb1a5SLionel Sambuc
2273971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
2274971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
2275971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
2276971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2277971bb1a5SLionel Sambuc /* xcb_randr_output_t outputs */
2278971bb1a5SLionel Sambuc xcb_parts[4].iov_base = (char *) outputs;
2279971bb1a5SLionel Sambuc xcb_parts[4].iov_len = outputs_len * sizeof(xcb_timestamp_t);
2280971bb1a5SLionel Sambuc xcb_parts[5].iov_base = 0;
2281971bb1a5SLionel Sambuc xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
2282971bb1a5SLionel Sambuc
2283971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2284971bb1a5SLionel Sambuc return xcb_ret;
2285971bb1a5SLionel Sambuc }
2286971bb1a5SLionel Sambuc
2287971bb1a5SLionel Sambuc xcb_randr_set_crtc_config_cookie_t
xcb_randr_set_crtc_config_unchecked(xcb_connection_t * c,xcb_randr_crtc_t crtc,xcb_timestamp_t timestamp,xcb_timestamp_t config_timestamp,int16_t x,int16_t y,xcb_randr_mode_t mode,uint16_t rotation,uint32_t outputs_len,const xcb_randr_output_t * outputs)2288971bb1a5SLionel Sambuc xcb_randr_set_crtc_config_unchecked (xcb_connection_t *c /**< */,
2289971bb1a5SLionel Sambuc xcb_randr_crtc_t crtc /**< */,
2290971bb1a5SLionel Sambuc xcb_timestamp_t timestamp /**< */,
2291971bb1a5SLionel Sambuc xcb_timestamp_t config_timestamp /**< */,
2292971bb1a5SLionel Sambuc int16_t x /**< */,
2293971bb1a5SLionel Sambuc int16_t y /**< */,
2294971bb1a5SLionel Sambuc xcb_randr_mode_t mode /**< */,
2295971bb1a5SLionel Sambuc uint16_t rotation /**< */,
2296971bb1a5SLionel Sambuc uint32_t outputs_len /**< */,
2297971bb1a5SLionel Sambuc const xcb_randr_output_t *outputs /**< */)
2298971bb1a5SLionel Sambuc {
2299971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
2300971bb1a5SLionel Sambuc /* count */ 4,
2301971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
2302971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_SET_CRTC_CONFIG,
2303971bb1a5SLionel Sambuc /* isvoid */ 0
2304971bb1a5SLionel Sambuc };
2305971bb1a5SLionel Sambuc
2306971bb1a5SLionel Sambuc struct iovec xcb_parts[6];
2307971bb1a5SLionel Sambuc xcb_randr_set_crtc_config_cookie_t xcb_ret;
2308971bb1a5SLionel Sambuc xcb_randr_set_crtc_config_request_t xcb_out;
2309971bb1a5SLionel Sambuc
2310971bb1a5SLionel Sambuc xcb_out.crtc = crtc;
2311971bb1a5SLionel Sambuc xcb_out.timestamp = timestamp;
2312971bb1a5SLionel Sambuc xcb_out.config_timestamp = config_timestamp;
2313971bb1a5SLionel Sambuc xcb_out.x = x;
2314971bb1a5SLionel Sambuc xcb_out.y = y;
2315971bb1a5SLionel Sambuc xcb_out.mode = mode;
2316971bb1a5SLionel Sambuc xcb_out.rotation = rotation;
2317971bb1a5SLionel Sambuc memset(xcb_out.pad0, 0, 2);
2318971bb1a5SLionel Sambuc
2319971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
2320971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
2321971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
2322971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2323971bb1a5SLionel Sambuc /* xcb_randr_output_t outputs */
2324971bb1a5SLionel Sambuc xcb_parts[4].iov_base = (char *) outputs;
2325971bb1a5SLionel Sambuc xcb_parts[4].iov_len = outputs_len * sizeof(xcb_timestamp_t);
2326971bb1a5SLionel Sambuc xcb_parts[5].iov_base = 0;
2327971bb1a5SLionel Sambuc xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
2328971bb1a5SLionel Sambuc
2329971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2330971bb1a5SLionel Sambuc return xcb_ret;
2331971bb1a5SLionel Sambuc }
2332971bb1a5SLionel Sambuc
2333971bb1a5SLionel Sambuc xcb_randr_set_crtc_config_reply_t *
xcb_randr_set_crtc_config_reply(xcb_connection_t * c,xcb_randr_set_crtc_config_cookie_t cookie,xcb_generic_error_t ** e)2334971bb1a5SLionel Sambuc xcb_randr_set_crtc_config_reply (xcb_connection_t *c /**< */,
2335971bb1a5SLionel Sambuc xcb_randr_set_crtc_config_cookie_t cookie /**< */,
2336971bb1a5SLionel Sambuc xcb_generic_error_t **e /**< */)
2337971bb1a5SLionel Sambuc {
2338971bb1a5SLionel Sambuc return (xcb_randr_set_crtc_config_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
2339971bb1a5SLionel Sambuc }
2340971bb1a5SLionel Sambuc
2341971bb1a5SLionel Sambuc xcb_randr_get_crtc_gamma_size_cookie_t
xcb_randr_get_crtc_gamma_size(xcb_connection_t * c,xcb_randr_crtc_t crtc)2342971bb1a5SLionel Sambuc xcb_randr_get_crtc_gamma_size (xcb_connection_t *c /**< */,
2343971bb1a5SLionel Sambuc xcb_randr_crtc_t crtc /**< */)
2344971bb1a5SLionel Sambuc {
2345971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
2346971bb1a5SLionel Sambuc /* count */ 2,
2347971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
2348971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_GET_CRTC_GAMMA_SIZE,
2349971bb1a5SLionel Sambuc /* isvoid */ 0
2350971bb1a5SLionel Sambuc };
2351971bb1a5SLionel Sambuc
2352971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
2353971bb1a5SLionel Sambuc xcb_randr_get_crtc_gamma_size_cookie_t xcb_ret;
2354971bb1a5SLionel Sambuc xcb_randr_get_crtc_gamma_size_request_t xcb_out;
2355971bb1a5SLionel Sambuc
2356971bb1a5SLionel Sambuc xcb_out.crtc = crtc;
2357971bb1a5SLionel Sambuc
2358971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
2359971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
2360971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
2361971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2362971bb1a5SLionel Sambuc
2363971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2364971bb1a5SLionel Sambuc return xcb_ret;
2365971bb1a5SLionel Sambuc }
2366971bb1a5SLionel Sambuc
2367971bb1a5SLionel Sambuc xcb_randr_get_crtc_gamma_size_cookie_t
xcb_randr_get_crtc_gamma_size_unchecked(xcb_connection_t * c,xcb_randr_crtc_t crtc)2368971bb1a5SLionel Sambuc xcb_randr_get_crtc_gamma_size_unchecked (xcb_connection_t *c /**< */,
2369971bb1a5SLionel Sambuc xcb_randr_crtc_t crtc /**< */)
2370971bb1a5SLionel Sambuc {
2371971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
2372971bb1a5SLionel Sambuc /* count */ 2,
2373971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
2374971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_GET_CRTC_GAMMA_SIZE,
2375971bb1a5SLionel Sambuc /* isvoid */ 0
2376971bb1a5SLionel Sambuc };
2377971bb1a5SLionel Sambuc
2378971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
2379971bb1a5SLionel Sambuc xcb_randr_get_crtc_gamma_size_cookie_t xcb_ret;
2380971bb1a5SLionel Sambuc xcb_randr_get_crtc_gamma_size_request_t xcb_out;
2381971bb1a5SLionel Sambuc
2382971bb1a5SLionel Sambuc xcb_out.crtc = crtc;
2383971bb1a5SLionel Sambuc
2384971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
2385971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
2386971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
2387971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2388971bb1a5SLionel Sambuc
2389971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2390971bb1a5SLionel Sambuc return xcb_ret;
2391971bb1a5SLionel Sambuc }
2392971bb1a5SLionel Sambuc
2393971bb1a5SLionel Sambuc xcb_randr_get_crtc_gamma_size_reply_t *
xcb_randr_get_crtc_gamma_size_reply(xcb_connection_t * c,xcb_randr_get_crtc_gamma_size_cookie_t cookie,xcb_generic_error_t ** e)2394971bb1a5SLionel Sambuc xcb_randr_get_crtc_gamma_size_reply (xcb_connection_t *c /**< */,
2395971bb1a5SLionel Sambuc xcb_randr_get_crtc_gamma_size_cookie_t cookie /**< */,
2396971bb1a5SLionel Sambuc xcb_generic_error_t **e /**< */)
2397971bb1a5SLionel Sambuc {
2398971bb1a5SLionel Sambuc return (xcb_randr_get_crtc_gamma_size_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
2399971bb1a5SLionel Sambuc }
2400971bb1a5SLionel Sambuc
2401971bb1a5SLionel Sambuc int
xcb_randr_get_crtc_gamma_sizeof(const void * _buffer)2402971bb1a5SLionel Sambuc xcb_randr_get_crtc_gamma_sizeof (const void *_buffer /**< */)
2403971bb1a5SLionel Sambuc {
2404971bb1a5SLionel Sambuc char *xcb_tmp = (char *)_buffer;
2405971bb1a5SLionel Sambuc const xcb_randr_get_crtc_gamma_reply_t *_aux = (xcb_randr_get_crtc_gamma_reply_t *)_buffer;
2406971bb1a5SLionel Sambuc unsigned int xcb_buffer_len = 0;
2407971bb1a5SLionel Sambuc unsigned int xcb_block_len = 0;
2408971bb1a5SLionel Sambuc unsigned int xcb_pad = 0;
2409*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
2410971bb1a5SLionel Sambuc
2411971bb1a5SLionel Sambuc
2412971bb1a5SLionel Sambuc xcb_block_len += sizeof(xcb_randr_get_crtc_gamma_reply_t);
2413971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
2414*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len;
2415*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
2416971bb1a5SLionel Sambuc /* red */
2417971bb1a5SLionel Sambuc xcb_block_len += _aux->size * sizeof(uint16_t);
2418971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
2419971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(uint16_t);
2420971bb1a5SLionel Sambuc /* insert padding */
2421971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2422971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
2423971bb1a5SLionel Sambuc if (0 != xcb_pad) {
2424971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
2425971bb1a5SLionel Sambuc xcb_pad = 0;
2426971bb1a5SLionel Sambuc }
2427971bb1a5SLionel Sambuc xcb_block_len = 0;
2428971bb1a5SLionel Sambuc /* green */
2429971bb1a5SLionel Sambuc xcb_block_len += _aux->size * sizeof(uint16_t);
2430971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
2431971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(uint16_t);
2432971bb1a5SLionel Sambuc /* insert padding */
2433971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2434971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
2435971bb1a5SLionel Sambuc if (0 != xcb_pad) {
2436971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
2437971bb1a5SLionel Sambuc xcb_pad = 0;
2438971bb1a5SLionel Sambuc }
2439971bb1a5SLionel Sambuc xcb_block_len = 0;
2440971bb1a5SLionel Sambuc /* blue */
2441971bb1a5SLionel Sambuc xcb_block_len += _aux->size * sizeof(uint16_t);
2442971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
2443971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(uint16_t);
2444971bb1a5SLionel Sambuc /* insert padding */
2445971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2446971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
2447971bb1a5SLionel Sambuc if (0 != xcb_pad) {
2448971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
2449971bb1a5SLionel Sambuc xcb_pad = 0;
2450971bb1a5SLionel Sambuc }
2451971bb1a5SLionel Sambuc xcb_block_len = 0;
2452971bb1a5SLionel Sambuc
2453971bb1a5SLionel Sambuc return xcb_buffer_len;
2454971bb1a5SLionel Sambuc }
2455971bb1a5SLionel Sambuc
2456971bb1a5SLionel Sambuc xcb_randr_get_crtc_gamma_cookie_t
xcb_randr_get_crtc_gamma(xcb_connection_t * c,xcb_randr_crtc_t crtc)2457971bb1a5SLionel Sambuc xcb_randr_get_crtc_gamma (xcb_connection_t *c /**< */,
2458971bb1a5SLionel Sambuc xcb_randr_crtc_t crtc /**< */)
2459971bb1a5SLionel Sambuc {
2460971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
2461971bb1a5SLionel Sambuc /* count */ 2,
2462971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
2463971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_GET_CRTC_GAMMA,
2464971bb1a5SLionel Sambuc /* isvoid */ 0
2465971bb1a5SLionel Sambuc };
2466971bb1a5SLionel Sambuc
2467971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
2468971bb1a5SLionel Sambuc xcb_randr_get_crtc_gamma_cookie_t xcb_ret;
2469971bb1a5SLionel Sambuc xcb_randr_get_crtc_gamma_request_t xcb_out;
2470971bb1a5SLionel Sambuc
2471971bb1a5SLionel Sambuc xcb_out.crtc = crtc;
2472971bb1a5SLionel Sambuc
2473971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
2474971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
2475971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
2476971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2477971bb1a5SLionel Sambuc
2478971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2479971bb1a5SLionel Sambuc return xcb_ret;
2480971bb1a5SLionel Sambuc }
2481971bb1a5SLionel Sambuc
2482971bb1a5SLionel Sambuc xcb_randr_get_crtc_gamma_cookie_t
xcb_randr_get_crtc_gamma_unchecked(xcb_connection_t * c,xcb_randr_crtc_t crtc)2483971bb1a5SLionel Sambuc xcb_randr_get_crtc_gamma_unchecked (xcb_connection_t *c /**< */,
2484971bb1a5SLionel Sambuc xcb_randr_crtc_t crtc /**< */)
2485971bb1a5SLionel Sambuc {
2486971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
2487971bb1a5SLionel Sambuc /* count */ 2,
2488971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
2489971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_GET_CRTC_GAMMA,
2490971bb1a5SLionel Sambuc /* isvoid */ 0
2491971bb1a5SLionel Sambuc };
2492971bb1a5SLionel Sambuc
2493971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
2494971bb1a5SLionel Sambuc xcb_randr_get_crtc_gamma_cookie_t xcb_ret;
2495971bb1a5SLionel Sambuc xcb_randr_get_crtc_gamma_request_t xcb_out;
2496971bb1a5SLionel Sambuc
2497971bb1a5SLionel Sambuc xcb_out.crtc = crtc;
2498971bb1a5SLionel Sambuc
2499971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
2500971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
2501971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
2502971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2503971bb1a5SLionel Sambuc
2504971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2505971bb1a5SLionel Sambuc return xcb_ret;
2506971bb1a5SLionel Sambuc }
2507971bb1a5SLionel Sambuc
2508971bb1a5SLionel Sambuc uint16_t *
xcb_randr_get_crtc_gamma_red(const xcb_randr_get_crtc_gamma_reply_t * R)2509971bb1a5SLionel Sambuc xcb_randr_get_crtc_gamma_red (const xcb_randr_get_crtc_gamma_reply_t *R /**< */)
2510971bb1a5SLionel Sambuc {
2511971bb1a5SLionel Sambuc return (uint16_t *) (R + 1);
2512971bb1a5SLionel Sambuc }
2513971bb1a5SLionel Sambuc
2514971bb1a5SLionel Sambuc int
xcb_randr_get_crtc_gamma_red_length(const xcb_randr_get_crtc_gamma_reply_t * R)2515971bb1a5SLionel Sambuc xcb_randr_get_crtc_gamma_red_length (const xcb_randr_get_crtc_gamma_reply_t *R /**< */)
2516971bb1a5SLionel Sambuc {
2517971bb1a5SLionel Sambuc return R->size;
2518971bb1a5SLionel Sambuc }
2519971bb1a5SLionel Sambuc
2520971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_randr_get_crtc_gamma_red_end(const xcb_randr_get_crtc_gamma_reply_t * R)2521971bb1a5SLionel Sambuc xcb_randr_get_crtc_gamma_red_end (const xcb_randr_get_crtc_gamma_reply_t *R /**< */)
2522971bb1a5SLionel Sambuc {
2523971bb1a5SLionel Sambuc xcb_generic_iterator_t i;
2524971bb1a5SLionel Sambuc i.data = ((uint16_t *) (R + 1)) + (R->size);
2525971bb1a5SLionel Sambuc i.rem = 0;
2526971bb1a5SLionel Sambuc i.index = (char *) i.data - (char *) R;
2527971bb1a5SLionel Sambuc return i;
2528971bb1a5SLionel Sambuc }
2529971bb1a5SLionel Sambuc
2530971bb1a5SLionel Sambuc uint16_t *
xcb_randr_get_crtc_gamma_green(const xcb_randr_get_crtc_gamma_reply_t * R)2531971bb1a5SLionel Sambuc xcb_randr_get_crtc_gamma_green (const xcb_randr_get_crtc_gamma_reply_t *R /**< */)
2532971bb1a5SLionel Sambuc {
2533971bb1a5SLionel Sambuc xcb_generic_iterator_t prev = xcb_randr_get_crtc_gamma_red_end(R);
2534971bb1a5SLionel Sambuc return (uint16_t *) ((char *) prev.data + XCB_TYPE_PAD(uint16_t, prev.index) + 0);
2535971bb1a5SLionel Sambuc }
2536971bb1a5SLionel Sambuc
2537971bb1a5SLionel Sambuc int
xcb_randr_get_crtc_gamma_green_length(const xcb_randr_get_crtc_gamma_reply_t * R)2538971bb1a5SLionel Sambuc xcb_randr_get_crtc_gamma_green_length (const xcb_randr_get_crtc_gamma_reply_t *R /**< */)
2539971bb1a5SLionel Sambuc {
2540971bb1a5SLionel Sambuc return R->size;
2541971bb1a5SLionel Sambuc }
2542971bb1a5SLionel Sambuc
2543971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_randr_get_crtc_gamma_green_end(const xcb_randr_get_crtc_gamma_reply_t * R)2544971bb1a5SLionel Sambuc xcb_randr_get_crtc_gamma_green_end (const xcb_randr_get_crtc_gamma_reply_t *R /**< */)
2545971bb1a5SLionel Sambuc {
2546971bb1a5SLionel Sambuc xcb_generic_iterator_t i;
2547971bb1a5SLionel Sambuc xcb_generic_iterator_t child = xcb_randr_get_crtc_gamma_red_end(R);
2548971bb1a5SLionel Sambuc i.data = ((uint16_t *) child.data) + (R->size);
2549971bb1a5SLionel Sambuc i.rem = 0;
2550971bb1a5SLionel Sambuc i.index = (char *) i.data - (char *) R;
2551971bb1a5SLionel Sambuc return i;
2552971bb1a5SLionel Sambuc }
2553971bb1a5SLionel Sambuc
2554971bb1a5SLionel Sambuc uint16_t *
xcb_randr_get_crtc_gamma_blue(const xcb_randr_get_crtc_gamma_reply_t * R)2555971bb1a5SLionel Sambuc xcb_randr_get_crtc_gamma_blue (const xcb_randr_get_crtc_gamma_reply_t *R /**< */)
2556971bb1a5SLionel Sambuc {
2557971bb1a5SLionel Sambuc xcb_generic_iterator_t prev = xcb_randr_get_crtc_gamma_green_end(R);
2558971bb1a5SLionel Sambuc return (uint16_t *) ((char *) prev.data + XCB_TYPE_PAD(uint16_t, prev.index) + 0);
2559971bb1a5SLionel Sambuc }
2560971bb1a5SLionel Sambuc
2561971bb1a5SLionel Sambuc int
xcb_randr_get_crtc_gamma_blue_length(const xcb_randr_get_crtc_gamma_reply_t * R)2562971bb1a5SLionel Sambuc xcb_randr_get_crtc_gamma_blue_length (const xcb_randr_get_crtc_gamma_reply_t *R /**< */)
2563971bb1a5SLionel Sambuc {
2564971bb1a5SLionel Sambuc return R->size;
2565971bb1a5SLionel Sambuc }
2566971bb1a5SLionel Sambuc
2567971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_randr_get_crtc_gamma_blue_end(const xcb_randr_get_crtc_gamma_reply_t * R)2568971bb1a5SLionel Sambuc xcb_randr_get_crtc_gamma_blue_end (const xcb_randr_get_crtc_gamma_reply_t *R /**< */)
2569971bb1a5SLionel Sambuc {
2570971bb1a5SLionel Sambuc xcb_generic_iterator_t i;
2571971bb1a5SLionel Sambuc xcb_generic_iterator_t child = xcb_randr_get_crtc_gamma_green_end(R);
2572971bb1a5SLionel Sambuc i.data = ((uint16_t *) child.data) + (R->size);
2573971bb1a5SLionel Sambuc i.rem = 0;
2574971bb1a5SLionel Sambuc i.index = (char *) i.data - (char *) R;
2575971bb1a5SLionel Sambuc return i;
2576971bb1a5SLionel Sambuc }
2577971bb1a5SLionel Sambuc
2578971bb1a5SLionel Sambuc xcb_randr_get_crtc_gamma_reply_t *
xcb_randr_get_crtc_gamma_reply(xcb_connection_t * c,xcb_randr_get_crtc_gamma_cookie_t cookie,xcb_generic_error_t ** e)2579971bb1a5SLionel Sambuc xcb_randr_get_crtc_gamma_reply (xcb_connection_t *c /**< */,
2580971bb1a5SLionel Sambuc xcb_randr_get_crtc_gamma_cookie_t cookie /**< */,
2581971bb1a5SLionel Sambuc xcb_generic_error_t **e /**< */)
2582971bb1a5SLionel Sambuc {
2583971bb1a5SLionel Sambuc return (xcb_randr_get_crtc_gamma_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
2584971bb1a5SLionel Sambuc }
2585971bb1a5SLionel Sambuc
2586971bb1a5SLionel Sambuc int
xcb_randr_set_crtc_gamma_sizeof(const void * _buffer)2587971bb1a5SLionel Sambuc xcb_randr_set_crtc_gamma_sizeof (const void *_buffer /**< */)
2588971bb1a5SLionel Sambuc {
2589971bb1a5SLionel Sambuc char *xcb_tmp = (char *)_buffer;
2590971bb1a5SLionel Sambuc const xcb_randr_set_crtc_gamma_request_t *_aux = (xcb_randr_set_crtc_gamma_request_t *)_buffer;
2591971bb1a5SLionel Sambuc unsigned int xcb_buffer_len = 0;
2592971bb1a5SLionel Sambuc unsigned int xcb_block_len = 0;
2593971bb1a5SLionel Sambuc unsigned int xcb_pad = 0;
2594*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
2595971bb1a5SLionel Sambuc
2596971bb1a5SLionel Sambuc
2597971bb1a5SLionel Sambuc xcb_block_len += sizeof(xcb_randr_set_crtc_gamma_request_t);
2598971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
2599*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len;
2600*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
2601971bb1a5SLionel Sambuc /* red */
2602971bb1a5SLionel Sambuc xcb_block_len += _aux->size * sizeof(uint16_t);
2603971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
2604971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(uint16_t);
2605971bb1a5SLionel Sambuc /* insert padding */
2606971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2607971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
2608971bb1a5SLionel Sambuc if (0 != xcb_pad) {
2609971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
2610971bb1a5SLionel Sambuc xcb_pad = 0;
2611971bb1a5SLionel Sambuc }
2612971bb1a5SLionel Sambuc xcb_block_len = 0;
2613971bb1a5SLionel Sambuc /* green */
2614971bb1a5SLionel Sambuc xcb_block_len += _aux->size * sizeof(uint16_t);
2615971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
2616971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(uint16_t);
2617971bb1a5SLionel Sambuc /* insert padding */
2618971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2619971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
2620971bb1a5SLionel Sambuc if (0 != xcb_pad) {
2621971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
2622971bb1a5SLionel Sambuc xcb_pad = 0;
2623971bb1a5SLionel Sambuc }
2624971bb1a5SLionel Sambuc xcb_block_len = 0;
2625971bb1a5SLionel Sambuc /* blue */
2626971bb1a5SLionel Sambuc xcb_block_len += _aux->size * sizeof(uint16_t);
2627971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
2628971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(uint16_t);
2629971bb1a5SLionel Sambuc /* insert padding */
2630971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2631971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
2632971bb1a5SLionel Sambuc if (0 != xcb_pad) {
2633971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
2634971bb1a5SLionel Sambuc xcb_pad = 0;
2635971bb1a5SLionel Sambuc }
2636971bb1a5SLionel Sambuc xcb_block_len = 0;
2637971bb1a5SLionel Sambuc
2638971bb1a5SLionel Sambuc return xcb_buffer_len;
2639971bb1a5SLionel Sambuc }
2640971bb1a5SLionel Sambuc
2641971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_randr_set_crtc_gamma_checked(xcb_connection_t * c,xcb_randr_crtc_t crtc,uint16_t size,const uint16_t * red,const uint16_t * green,const uint16_t * blue)2642971bb1a5SLionel Sambuc xcb_randr_set_crtc_gamma_checked (xcb_connection_t *c /**< */,
2643971bb1a5SLionel Sambuc xcb_randr_crtc_t crtc /**< */,
2644971bb1a5SLionel Sambuc uint16_t size /**< */,
2645971bb1a5SLionel Sambuc const uint16_t *red /**< */,
2646971bb1a5SLionel Sambuc const uint16_t *green /**< */,
2647971bb1a5SLionel Sambuc const uint16_t *blue /**< */)
2648971bb1a5SLionel Sambuc {
2649971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
2650971bb1a5SLionel Sambuc /* count */ 8,
2651971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
2652971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_SET_CRTC_GAMMA,
2653971bb1a5SLionel Sambuc /* isvoid */ 1
2654971bb1a5SLionel Sambuc };
2655971bb1a5SLionel Sambuc
2656971bb1a5SLionel Sambuc struct iovec xcb_parts[10];
2657971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
2658971bb1a5SLionel Sambuc xcb_randr_set_crtc_gamma_request_t xcb_out;
2659971bb1a5SLionel Sambuc
2660971bb1a5SLionel Sambuc xcb_out.crtc = crtc;
2661971bb1a5SLionel Sambuc xcb_out.size = size;
2662971bb1a5SLionel Sambuc memset(xcb_out.pad0, 0, 2);
2663971bb1a5SLionel Sambuc
2664971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
2665971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
2666971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
2667971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2668971bb1a5SLionel Sambuc /* uint16_t red */
2669971bb1a5SLionel Sambuc xcb_parts[4].iov_base = (char *) red;
2670971bb1a5SLionel Sambuc xcb_parts[4].iov_len = size * sizeof(uint16_t);
2671971bb1a5SLionel Sambuc xcb_parts[5].iov_base = 0;
2672971bb1a5SLionel Sambuc xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
2673971bb1a5SLionel Sambuc /* uint16_t green */
2674971bb1a5SLionel Sambuc xcb_parts[6].iov_base = (char *) green;
2675971bb1a5SLionel Sambuc xcb_parts[6].iov_len = size * sizeof(uint16_t);
2676971bb1a5SLionel Sambuc xcb_parts[7].iov_base = 0;
2677971bb1a5SLionel Sambuc xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3;
2678971bb1a5SLionel Sambuc /* uint16_t blue */
2679971bb1a5SLionel Sambuc xcb_parts[8].iov_base = (char *) blue;
2680971bb1a5SLionel Sambuc xcb_parts[8].iov_len = size * sizeof(uint16_t);
2681971bb1a5SLionel Sambuc xcb_parts[9].iov_base = 0;
2682971bb1a5SLionel Sambuc xcb_parts[9].iov_len = -xcb_parts[8].iov_len & 3;
2683971bb1a5SLionel Sambuc
2684971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2685971bb1a5SLionel Sambuc return xcb_ret;
2686971bb1a5SLionel Sambuc }
2687971bb1a5SLionel Sambuc
2688971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_randr_set_crtc_gamma(xcb_connection_t * c,xcb_randr_crtc_t crtc,uint16_t size,const uint16_t * red,const uint16_t * green,const uint16_t * blue)2689971bb1a5SLionel Sambuc xcb_randr_set_crtc_gamma (xcb_connection_t *c /**< */,
2690971bb1a5SLionel Sambuc xcb_randr_crtc_t crtc /**< */,
2691971bb1a5SLionel Sambuc uint16_t size /**< */,
2692971bb1a5SLionel Sambuc const uint16_t *red /**< */,
2693971bb1a5SLionel Sambuc const uint16_t *green /**< */,
2694971bb1a5SLionel Sambuc const uint16_t *blue /**< */)
2695971bb1a5SLionel Sambuc {
2696971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
2697971bb1a5SLionel Sambuc /* count */ 8,
2698971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
2699971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_SET_CRTC_GAMMA,
2700971bb1a5SLionel Sambuc /* isvoid */ 1
2701971bb1a5SLionel Sambuc };
2702971bb1a5SLionel Sambuc
2703971bb1a5SLionel Sambuc struct iovec xcb_parts[10];
2704971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
2705971bb1a5SLionel Sambuc xcb_randr_set_crtc_gamma_request_t xcb_out;
2706971bb1a5SLionel Sambuc
2707971bb1a5SLionel Sambuc xcb_out.crtc = crtc;
2708971bb1a5SLionel Sambuc xcb_out.size = size;
2709971bb1a5SLionel Sambuc memset(xcb_out.pad0, 0, 2);
2710971bb1a5SLionel Sambuc
2711971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
2712971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
2713971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
2714971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2715971bb1a5SLionel Sambuc /* uint16_t red */
2716971bb1a5SLionel Sambuc xcb_parts[4].iov_base = (char *) red;
2717971bb1a5SLionel Sambuc xcb_parts[4].iov_len = size * sizeof(uint16_t);
2718971bb1a5SLionel Sambuc xcb_parts[5].iov_base = 0;
2719971bb1a5SLionel Sambuc xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
2720971bb1a5SLionel Sambuc /* uint16_t green */
2721971bb1a5SLionel Sambuc xcb_parts[6].iov_base = (char *) green;
2722971bb1a5SLionel Sambuc xcb_parts[6].iov_len = size * sizeof(uint16_t);
2723971bb1a5SLionel Sambuc xcb_parts[7].iov_base = 0;
2724971bb1a5SLionel Sambuc xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3;
2725971bb1a5SLionel Sambuc /* uint16_t blue */
2726971bb1a5SLionel Sambuc xcb_parts[8].iov_base = (char *) blue;
2727971bb1a5SLionel Sambuc xcb_parts[8].iov_len = size * sizeof(uint16_t);
2728971bb1a5SLionel Sambuc xcb_parts[9].iov_base = 0;
2729971bb1a5SLionel Sambuc xcb_parts[9].iov_len = -xcb_parts[8].iov_len & 3;
2730971bb1a5SLionel Sambuc
2731971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2732971bb1a5SLionel Sambuc return xcb_ret;
2733971bb1a5SLionel Sambuc }
2734971bb1a5SLionel Sambuc
2735971bb1a5SLionel Sambuc int
xcb_randr_get_screen_resources_current_sizeof(const void * _buffer)2736971bb1a5SLionel Sambuc xcb_randr_get_screen_resources_current_sizeof (const void *_buffer /**< */)
2737971bb1a5SLionel Sambuc {
2738971bb1a5SLionel Sambuc char *xcb_tmp = (char *)_buffer;
2739971bb1a5SLionel Sambuc const xcb_randr_get_screen_resources_current_reply_t *_aux = (xcb_randr_get_screen_resources_current_reply_t *)_buffer;
2740971bb1a5SLionel Sambuc unsigned int xcb_buffer_len = 0;
2741971bb1a5SLionel Sambuc unsigned int xcb_block_len = 0;
2742971bb1a5SLionel Sambuc unsigned int xcb_pad = 0;
2743*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
2744971bb1a5SLionel Sambuc
2745971bb1a5SLionel Sambuc
2746971bb1a5SLionel Sambuc xcb_block_len += sizeof(xcb_randr_get_screen_resources_current_reply_t);
2747971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
2748*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len;
2749*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
2750971bb1a5SLionel Sambuc /* crtcs */
2751971bb1a5SLionel Sambuc xcb_block_len += _aux->num_crtcs * sizeof(uint32_t);
2752971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
2753971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(xcb_randr_crtc_t);
2754971bb1a5SLionel Sambuc /* insert padding */
2755971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2756971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
2757971bb1a5SLionel Sambuc if (0 != xcb_pad) {
2758971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
2759971bb1a5SLionel Sambuc xcb_pad = 0;
2760971bb1a5SLionel Sambuc }
2761971bb1a5SLionel Sambuc xcb_block_len = 0;
2762971bb1a5SLionel Sambuc /* outputs */
2763971bb1a5SLionel Sambuc xcb_block_len += _aux->num_outputs * sizeof(uint32_t);
2764971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
2765971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(xcb_randr_output_t);
2766971bb1a5SLionel Sambuc /* insert padding */
2767971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2768971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
2769971bb1a5SLionel Sambuc if (0 != xcb_pad) {
2770971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
2771971bb1a5SLionel Sambuc xcb_pad = 0;
2772971bb1a5SLionel Sambuc }
2773971bb1a5SLionel Sambuc xcb_block_len = 0;
2774971bb1a5SLionel Sambuc /* modes */
2775971bb1a5SLionel Sambuc xcb_block_len += _aux->num_modes * sizeof(xcb_randr_mode_info_t);
2776971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
2777971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(xcb_randr_mode_info_t);
2778971bb1a5SLionel Sambuc /* insert padding */
2779971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2780971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
2781971bb1a5SLionel Sambuc if (0 != xcb_pad) {
2782971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
2783971bb1a5SLionel Sambuc xcb_pad = 0;
2784971bb1a5SLionel Sambuc }
2785971bb1a5SLionel Sambuc xcb_block_len = 0;
2786971bb1a5SLionel Sambuc /* names */
2787971bb1a5SLionel Sambuc xcb_block_len += _aux->names_len * sizeof(uint8_t);
2788971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
2789971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(uint8_t);
2790971bb1a5SLionel Sambuc /* insert padding */
2791971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2792971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
2793971bb1a5SLionel Sambuc if (0 != xcb_pad) {
2794971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
2795971bb1a5SLionel Sambuc xcb_pad = 0;
2796971bb1a5SLionel Sambuc }
2797971bb1a5SLionel Sambuc xcb_block_len = 0;
2798971bb1a5SLionel Sambuc
2799971bb1a5SLionel Sambuc return xcb_buffer_len;
2800971bb1a5SLionel Sambuc }
2801971bb1a5SLionel Sambuc
2802971bb1a5SLionel Sambuc xcb_randr_get_screen_resources_current_cookie_t
xcb_randr_get_screen_resources_current(xcb_connection_t * c,xcb_window_t window)2803971bb1a5SLionel Sambuc xcb_randr_get_screen_resources_current (xcb_connection_t *c /**< */,
2804971bb1a5SLionel Sambuc xcb_window_t window /**< */)
2805971bb1a5SLionel Sambuc {
2806971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
2807971bb1a5SLionel Sambuc /* count */ 2,
2808971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
2809971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_GET_SCREEN_RESOURCES_CURRENT,
2810971bb1a5SLionel Sambuc /* isvoid */ 0
2811971bb1a5SLionel Sambuc };
2812971bb1a5SLionel Sambuc
2813971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
2814971bb1a5SLionel Sambuc xcb_randr_get_screen_resources_current_cookie_t xcb_ret;
2815971bb1a5SLionel Sambuc xcb_randr_get_screen_resources_current_request_t xcb_out;
2816971bb1a5SLionel Sambuc
2817971bb1a5SLionel Sambuc xcb_out.window = window;
2818971bb1a5SLionel Sambuc
2819971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
2820971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
2821971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
2822971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2823971bb1a5SLionel Sambuc
2824971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
2825971bb1a5SLionel Sambuc return xcb_ret;
2826971bb1a5SLionel Sambuc }
2827971bb1a5SLionel Sambuc
2828971bb1a5SLionel Sambuc xcb_randr_get_screen_resources_current_cookie_t
xcb_randr_get_screen_resources_current_unchecked(xcb_connection_t * c,xcb_window_t window)2829971bb1a5SLionel Sambuc xcb_randr_get_screen_resources_current_unchecked (xcb_connection_t *c /**< */,
2830971bb1a5SLionel Sambuc xcb_window_t window /**< */)
2831971bb1a5SLionel Sambuc {
2832971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
2833971bb1a5SLionel Sambuc /* count */ 2,
2834971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
2835971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_GET_SCREEN_RESOURCES_CURRENT,
2836971bb1a5SLionel Sambuc /* isvoid */ 0
2837971bb1a5SLionel Sambuc };
2838971bb1a5SLionel Sambuc
2839971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
2840971bb1a5SLionel Sambuc xcb_randr_get_screen_resources_current_cookie_t xcb_ret;
2841971bb1a5SLionel Sambuc xcb_randr_get_screen_resources_current_request_t xcb_out;
2842971bb1a5SLionel Sambuc
2843971bb1a5SLionel Sambuc xcb_out.window = window;
2844971bb1a5SLionel Sambuc
2845971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
2846971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
2847971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
2848971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
2849971bb1a5SLionel Sambuc
2850971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
2851971bb1a5SLionel Sambuc return xcb_ret;
2852971bb1a5SLionel Sambuc }
2853971bb1a5SLionel Sambuc
2854971bb1a5SLionel Sambuc xcb_randr_crtc_t *
xcb_randr_get_screen_resources_current_crtcs(const xcb_randr_get_screen_resources_current_reply_t * R)2855971bb1a5SLionel Sambuc xcb_randr_get_screen_resources_current_crtcs (const xcb_randr_get_screen_resources_current_reply_t *R /**< */)
2856971bb1a5SLionel Sambuc {
2857971bb1a5SLionel Sambuc return (xcb_randr_crtc_t *) (R + 1);
2858971bb1a5SLionel Sambuc }
2859971bb1a5SLionel Sambuc
2860971bb1a5SLionel Sambuc int
xcb_randr_get_screen_resources_current_crtcs_length(const xcb_randr_get_screen_resources_current_reply_t * R)2861971bb1a5SLionel Sambuc xcb_randr_get_screen_resources_current_crtcs_length (const xcb_randr_get_screen_resources_current_reply_t *R /**< */)
2862971bb1a5SLionel Sambuc {
2863971bb1a5SLionel Sambuc return R->num_crtcs;
2864971bb1a5SLionel Sambuc }
2865971bb1a5SLionel Sambuc
2866971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_randr_get_screen_resources_current_crtcs_end(const xcb_randr_get_screen_resources_current_reply_t * R)2867971bb1a5SLionel Sambuc xcb_randr_get_screen_resources_current_crtcs_end (const xcb_randr_get_screen_resources_current_reply_t *R /**< */)
2868971bb1a5SLionel Sambuc {
2869971bb1a5SLionel Sambuc xcb_generic_iterator_t i;
2870971bb1a5SLionel Sambuc i.data = ((xcb_randr_crtc_t *) (R + 1)) + (R->num_crtcs);
2871971bb1a5SLionel Sambuc i.rem = 0;
2872971bb1a5SLionel Sambuc i.index = (char *) i.data - (char *) R;
2873971bb1a5SLionel Sambuc return i;
2874971bb1a5SLionel Sambuc }
2875971bb1a5SLionel Sambuc
2876971bb1a5SLionel Sambuc xcb_randr_output_t *
xcb_randr_get_screen_resources_current_outputs(const xcb_randr_get_screen_resources_current_reply_t * R)2877971bb1a5SLionel Sambuc xcb_randr_get_screen_resources_current_outputs (const xcb_randr_get_screen_resources_current_reply_t *R /**< */)
2878971bb1a5SLionel Sambuc {
2879971bb1a5SLionel Sambuc xcb_generic_iterator_t prev = xcb_randr_get_screen_resources_current_crtcs_end(R);
2880971bb1a5SLionel Sambuc return (xcb_randr_output_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_randr_output_t, prev.index) + 0);
2881971bb1a5SLionel Sambuc }
2882971bb1a5SLionel Sambuc
2883971bb1a5SLionel Sambuc int
xcb_randr_get_screen_resources_current_outputs_length(const xcb_randr_get_screen_resources_current_reply_t * R)2884971bb1a5SLionel Sambuc xcb_randr_get_screen_resources_current_outputs_length (const xcb_randr_get_screen_resources_current_reply_t *R /**< */)
2885971bb1a5SLionel Sambuc {
2886971bb1a5SLionel Sambuc return R->num_outputs;
2887971bb1a5SLionel Sambuc }
2888971bb1a5SLionel Sambuc
2889971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_randr_get_screen_resources_current_outputs_end(const xcb_randr_get_screen_resources_current_reply_t * R)2890971bb1a5SLionel Sambuc xcb_randr_get_screen_resources_current_outputs_end (const xcb_randr_get_screen_resources_current_reply_t *R /**< */)
2891971bb1a5SLionel Sambuc {
2892971bb1a5SLionel Sambuc xcb_generic_iterator_t i;
2893971bb1a5SLionel Sambuc xcb_generic_iterator_t child = xcb_randr_get_screen_resources_current_crtcs_end(R);
2894971bb1a5SLionel Sambuc i.data = ((xcb_randr_output_t *) child.data) + (R->num_outputs);
2895971bb1a5SLionel Sambuc i.rem = 0;
2896971bb1a5SLionel Sambuc i.index = (char *) i.data - (char *) R;
2897971bb1a5SLionel Sambuc return i;
2898971bb1a5SLionel Sambuc }
2899971bb1a5SLionel Sambuc
2900971bb1a5SLionel Sambuc xcb_randr_mode_info_t *
xcb_randr_get_screen_resources_current_modes(const xcb_randr_get_screen_resources_current_reply_t * R)2901971bb1a5SLionel Sambuc xcb_randr_get_screen_resources_current_modes (const xcb_randr_get_screen_resources_current_reply_t *R /**< */)
2902971bb1a5SLionel Sambuc {
2903971bb1a5SLionel Sambuc xcb_generic_iterator_t prev = xcb_randr_get_screen_resources_current_outputs_end(R);
2904971bb1a5SLionel Sambuc return (xcb_randr_mode_info_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_randr_mode_info_t, prev.index) + 0);
2905971bb1a5SLionel Sambuc }
2906971bb1a5SLionel Sambuc
2907971bb1a5SLionel Sambuc int
xcb_randr_get_screen_resources_current_modes_length(const xcb_randr_get_screen_resources_current_reply_t * R)2908971bb1a5SLionel Sambuc xcb_randr_get_screen_resources_current_modes_length (const xcb_randr_get_screen_resources_current_reply_t *R /**< */)
2909971bb1a5SLionel Sambuc {
2910971bb1a5SLionel Sambuc return R->num_modes;
2911971bb1a5SLionel Sambuc }
2912971bb1a5SLionel Sambuc
2913971bb1a5SLionel Sambuc xcb_randr_mode_info_iterator_t
xcb_randr_get_screen_resources_current_modes_iterator(const xcb_randr_get_screen_resources_current_reply_t * R)2914971bb1a5SLionel Sambuc xcb_randr_get_screen_resources_current_modes_iterator (const xcb_randr_get_screen_resources_current_reply_t *R /**< */)
2915971bb1a5SLionel Sambuc {
2916971bb1a5SLionel Sambuc xcb_randr_mode_info_iterator_t i;
2917971bb1a5SLionel Sambuc xcb_generic_iterator_t prev = xcb_randr_get_screen_resources_current_outputs_end(R);
2918971bb1a5SLionel Sambuc i.data = (xcb_randr_mode_info_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_randr_mode_info_t, prev.index));
2919971bb1a5SLionel Sambuc i.rem = R->num_modes;
2920971bb1a5SLionel Sambuc i.index = (char *) i.data - (char *) R;
2921971bb1a5SLionel Sambuc return i;
2922971bb1a5SLionel Sambuc }
2923971bb1a5SLionel Sambuc
2924971bb1a5SLionel Sambuc uint8_t *
xcb_randr_get_screen_resources_current_names(const xcb_randr_get_screen_resources_current_reply_t * R)2925971bb1a5SLionel Sambuc xcb_randr_get_screen_resources_current_names (const xcb_randr_get_screen_resources_current_reply_t *R /**< */)
2926971bb1a5SLionel Sambuc {
2927971bb1a5SLionel Sambuc xcb_generic_iterator_t prev = xcb_randr_mode_info_end(xcb_randr_get_screen_resources_current_modes_iterator(R));
2928971bb1a5SLionel Sambuc return (uint8_t *) ((char *) prev.data + XCB_TYPE_PAD(uint8_t, prev.index) + 0);
2929971bb1a5SLionel Sambuc }
2930971bb1a5SLionel Sambuc
2931971bb1a5SLionel Sambuc int
xcb_randr_get_screen_resources_current_names_length(const xcb_randr_get_screen_resources_current_reply_t * R)2932971bb1a5SLionel Sambuc xcb_randr_get_screen_resources_current_names_length (const xcb_randr_get_screen_resources_current_reply_t *R /**< */)
2933971bb1a5SLionel Sambuc {
2934971bb1a5SLionel Sambuc return R->names_len;
2935971bb1a5SLionel Sambuc }
2936971bb1a5SLionel Sambuc
2937971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_randr_get_screen_resources_current_names_end(const xcb_randr_get_screen_resources_current_reply_t * R)2938971bb1a5SLionel Sambuc xcb_randr_get_screen_resources_current_names_end (const xcb_randr_get_screen_resources_current_reply_t *R /**< */)
2939971bb1a5SLionel Sambuc {
2940971bb1a5SLionel Sambuc xcb_generic_iterator_t i;
2941971bb1a5SLionel Sambuc xcb_generic_iterator_t child = xcb_randr_mode_info_end(xcb_randr_get_screen_resources_current_modes_iterator(R));
2942971bb1a5SLionel Sambuc i.data = ((uint8_t *) child.data) + (R->names_len);
2943971bb1a5SLionel Sambuc i.rem = 0;
2944971bb1a5SLionel Sambuc i.index = (char *) i.data - (char *) R;
2945971bb1a5SLionel Sambuc return i;
2946971bb1a5SLionel Sambuc }
2947971bb1a5SLionel Sambuc
2948971bb1a5SLionel Sambuc xcb_randr_get_screen_resources_current_reply_t *
xcb_randr_get_screen_resources_current_reply(xcb_connection_t * c,xcb_randr_get_screen_resources_current_cookie_t cookie,xcb_generic_error_t ** e)2949971bb1a5SLionel Sambuc xcb_randr_get_screen_resources_current_reply (xcb_connection_t *c /**< */,
2950971bb1a5SLionel Sambuc xcb_randr_get_screen_resources_current_cookie_t cookie /**< */,
2951971bb1a5SLionel Sambuc xcb_generic_error_t **e /**< */)
2952971bb1a5SLionel Sambuc {
2953971bb1a5SLionel Sambuc return (xcb_randr_get_screen_resources_current_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
2954971bb1a5SLionel Sambuc }
2955971bb1a5SLionel Sambuc
2956971bb1a5SLionel Sambuc int
xcb_randr_set_crtc_transform_sizeof(const void * _buffer,uint32_t filter_params_len)2957971bb1a5SLionel Sambuc xcb_randr_set_crtc_transform_sizeof (const void *_buffer /**< */,
2958971bb1a5SLionel Sambuc uint32_t filter_params_len /**< */)
2959971bb1a5SLionel Sambuc {
2960971bb1a5SLionel Sambuc char *xcb_tmp = (char *)_buffer;
2961971bb1a5SLionel Sambuc const xcb_randr_set_crtc_transform_request_t *_aux = (xcb_randr_set_crtc_transform_request_t *)_buffer;
2962971bb1a5SLionel Sambuc unsigned int xcb_buffer_len = 0;
2963971bb1a5SLionel Sambuc unsigned int xcb_block_len = 0;
2964971bb1a5SLionel Sambuc unsigned int xcb_pad = 0;
2965*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
2966971bb1a5SLionel Sambuc
2967971bb1a5SLionel Sambuc
2968971bb1a5SLionel Sambuc xcb_block_len += sizeof(xcb_randr_set_crtc_transform_request_t);
2969971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
2970*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len;
2971*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
2972971bb1a5SLionel Sambuc /* filter_name */
2973971bb1a5SLionel Sambuc xcb_block_len += _aux->filter_len * sizeof(char);
2974971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
2975971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(char);
2976971bb1a5SLionel Sambuc /* insert padding */
2977971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2978971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
2979971bb1a5SLionel Sambuc if (0 != xcb_pad) {
2980971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
2981971bb1a5SLionel Sambuc xcb_pad = 0;
2982971bb1a5SLionel Sambuc }
2983971bb1a5SLionel Sambuc xcb_block_len = 0;
2984971bb1a5SLionel Sambuc /* filter_params */
2985971bb1a5SLionel Sambuc xcb_block_len += filter_params_len * sizeof(xcb_render_fixed_t);
2986971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
2987971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(xcb_render_fixed_t);
2988971bb1a5SLionel Sambuc /* insert padding */
2989971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
2990971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
2991971bb1a5SLionel Sambuc if (0 != xcb_pad) {
2992971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
2993971bb1a5SLionel Sambuc xcb_pad = 0;
2994971bb1a5SLionel Sambuc }
2995971bb1a5SLionel Sambuc xcb_block_len = 0;
2996971bb1a5SLionel Sambuc
2997971bb1a5SLionel Sambuc return xcb_buffer_len;
2998971bb1a5SLionel Sambuc }
2999971bb1a5SLionel Sambuc
3000971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_randr_set_crtc_transform_checked(xcb_connection_t * c,xcb_randr_crtc_t crtc,xcb_render_transform_t transform,uint16_t filter_len,const char * filter_name,uint32_t filter_params_len,const xcb_render_fixed_t * filter_params)3001971bb1a5SLionel Sambuc xcb_randr_set_crtc_transform_checked (xcb_connection_t *c /**< */,
3002971bb1a5SLionel Sambuc xcb_randr_crtc_t crtc /**< */,
3003971bb1a5SLionel Sambuc xcb_render_transform_t transform /**< */,
3004971bb1a5SLionel Sambuc uint16_t filter_len /**< */,
3005971bb1a5SLionel Sambuc const char *filter_name /**< */,
3006971bb1a5SLionel Sambuc uint32_t filter_params_len /**< */,
3007971bb1a5SLionel Sambuc const xcb_render_fixed_t *filter_params /**< */)
3008971bb1a5SLionel Sambuc {
3009971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
3010971bb1a5SLionel Sambuc /* count */ 6,
3011971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
3012971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_SET_CRTC_TRANSFORM,
3013971bb1a5SLionel Sambuc /* isvoid */ 1
3014971bb1a5SLionel Sambuc };
3015971bb1a5SLionel Sambuc
3016971bb1a5SLionel Sambuc struct iovec xcb_parts[8];
3017971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
3018971bb1a5SLionel Sambuc xcb_randr_set_crtc_transform_request_t xcb_out;
3019971bb1a5SLionel Sambuc
3020971bb1a5SLionel Sambuc xcb_out.crtc = crtc;
3021971bb1a5SLionel Sambuc xcb_out.transform = transform;
3022971bb1a5SLionel Sambuc xcb_out.filter_len = filter_len;
3023971bb1a5SLionel Sambuc memset(xcb_out.pad0, 0, 2);
3024971bb1a5SLionel Sambuc
3025971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
3026971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
3027971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
3028971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3029971bb1a5SLionel Sambuc /* char filter_name */
3030971bb1a5SLionel Sambuc xcb_parts[4].iov_base = (char *) filter_name;
3031971bb1a5SLionel Sambuc xcb_parts[4].iov_len = filter_len * sizeof(char);
3032971bb1a5SLionel Sambuc xcb_parts[5].iov_base = 0;
3033971bb1a5SLionel Sambuc xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
3034971bb1a5SLionel Sambuc /* xcb_render_fixed_t filter_params */
3035971bb1a5SLionel Sambuc xcb_parts[6].iov_base = (char *) filter_params;
3036971bb1a5SLionel Sambuc xcb_parts[6].iov_len = filter_params_len * sizeof(xcb_render_fixed_t);
3037971bb1a5SLionel Sambuc xcb_parts[7].iov_base = 0;
3038971bb1a5SLionel Sambuc xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3;
3039971bb1a5SLionel Sambuc
3040971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3041971bb1a5SLionel Sambuc return xcb_ret;
3042971bb1a5SLionel Sambuc }
3043971bb1a5SLionel Sambuc
3044971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_randr_set_crtc_transform(xcb_connection_t * c,xcb_randr_crtc_t crtc,xcb_render_transform_t transform,uint16_t filter_len,const char * filter_name,uint32_t filter_params_len,const xcb_render_fixed_t * filter_params)3045971bb1a5SLionel Sambuc xcb_randr_set_crtc_transform (xcb_connection_t *c /**< */,
3046971bb1a5SLionel Sambuc xcb_randr_crtc_t crtc /**< */,
3047971bb1a5SLionel Sambuc xcb_render_transform_t transform /**< */,
3048971bb1a5SLionel Sambuc uint16_t filter_len /**< */,
3049971bb1a5SLionel Sambuc const char *filter_name /**< */,
3050971bb1a5SLionel Sambuc uint32_t filter_params_len /**< */,
3051971bb1a5SLionel Sambuc const xcb_render_fixed_t *filter_params /**< */)
3052971bb1a5SLionel Sambuc {
3053971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
3054971bb1a5SLionel Sambuc /* count */ 6,
3055971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
3056971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_SET_CRTC_TRANSFORM,
3057971bb1a5SLionel Sambuc /* isvoid */ 1
3058971bb1a5SLionel Sambuc };
3059971bb1a5SLionel Sambuc
3060971bb1a5SLionel Sambuc struct iovec xcb_parts[8];
3061971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
3062971bb1a5SLionel Sambuc xcb_randr_set_crtc_transform_request_t xcb_out;
3063971bb1a5SLionel Sambuc
3064971bb1a5SLionel Sambuc xcb_out.crtc = crtc;
3065971bb1a5SLionel Sambuc xcb_out.transform = transform;
3066971bb1a5SLionel Sambuc xcb_out.filter_len = filter_len;
3067971bb1a5SLionel Sambuc memset(xcb_out.pad0, 0, 2);
3068971bb1a5SLionel Sambuc
3069971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
3070971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
3071971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
3072971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3073971bb1a5SLionel Sambuc /* char filter_name */
3074971bb1a5SLionel Sambuc xcb_parts[4].iov_base = (char *) filter_name;
3075971bb1a5SLionel Sambuc xcb_parts[4].iov_len = filter_len * sizeof(char);
3076971bb1a5SLionel Sambuc xcb_parts[5].iov_base = 0;
3077971bb1a5SLionel Sambuc xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
3078971bb1a5SLionel Sambuc /* xcb_render_fixed_t filter_params */
3079971bb1a5SLionel Sambuc xcb_parts[6].iov_base = (char *) filter_params;
3080971bb1a5SLionel Sambuc xcb_parts[6].iov_len = filter_params_len * sizeof(xcb_render_fixed_t);
3081971bb1a5SLionel Sambuc xcb_parts[7].iov_base = 0;
3082971bb1a5SLionel Sambuc xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3;
3083971bb1a5SLionel Sambuc
3084971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3085971bb1a5SLionel Sambuc return xcb_ret;
3086971bb1a5SLionel Sambuc }
3087971bb1a5SLionel Sambuc
3088971bb1a5SLionel Sambuc int
xcb_randr_get_crtc_transform_sizeof(const void * _buffer)3089971bb1a5SLionel Sambuc xcb_randr_get_crtc_transform_sizeof (const void *_buffer /**< */)
3090971bb1a5SLionel Sambuc {
3091971bb1a5SLionel Sambuc char *xcb_tmp = (char *)_buffer;
3092971bb1a5SLionel Sambuc const xcb_randr_get_crtc_transform_reply_t *_aux = (xcb_randr_get_crtc_transform_reply_t *)_buffer;
3093971bb1a5SLionel Sambuc unsigned int xcb_buffer_len = 0;
3094971bb1a5SLionel Sambuc unsigned int xcb_block_len = 0;
3095971bb1a5SLionel Sambuc unsigned int xcb_pad = 0;
3096*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
3097971bb1a5SLionel Sambuc
3098971bb1a5SLionel Sambuc
3099971bb1a5SLionel Sambuc xcb_block_len += sizeof(xcb_randr_get_crtc_transform_reply_t);
3100971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
3101*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len;
3102*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
3103971bb1a5SLionel Sambuc /* pending_filter_name */
3104971bb1a5SLionel Sambuc xcb_block_len += _aux->pending_len * sizeof(char);
3105971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
3106971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(char);
3107971bb1a5SLionel Sambuc /* insert padding */
3108971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3109971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
3110971bb1a5SLionel Sambuc if (0 != xcb_pad) {
3111971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
3112971bb1a5SLionel Sambuc xcb_pad = 0;
3113971bb1a5SLionel Sambuc }
3114971bb1a5SLionel Sambuc xcb_block_len = 0;
3115971bb1a5SLionel Sambuc /* pending_params */
3116971bb1a5SLionel Sambuc xcb_block_len += _aux->pending_nparams * sizeof(xcb_render_fixed_t);
3117971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
3118971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(xcb_render_fixed_t);
3119971bb1a5SLionel Sambuc /* insert padding */
3120971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3121971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
3122971bb1a5SLionel Sambuc if (0 != xcb_pad) {
3123971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
3124971bb1a5SLionel Sambuc xcb_pad = 0;
3125971bb1a5SLionel Sambuc }
3126971bb1a5SLionel Sambuc xcb_block_len = 0;
3127971bb1a5SLionel Sambuc /* current_filter_name */
3128971bb1a5SLionel Sambuc xcb_block_len += _aux->current_len * sizeof(char);
3129971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
3130971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(char);
3131971bb1a5SLionel Sambuc /* insert padding */
3132971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3133971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
3134971bb1a5SLionel Sambuc if (0 != xcb_pad) {
3135971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
3136971bb1a5SLionel Sambuc xcb_pad = 0;
3137971bb1a5SLionel Sambuc }
3138971bb1a5SLionel Sambuc xcb_block_len = 0;
3139971bb1a5SLionel Sambuc /* current_params */
3140971bb1a5SLionel Sambuc xcb_block_len += _aux->current_nparams * sizeof(xcb_render_fixed_t);
3141971bb1a5SLionel Sambuc xcb_tmp += xcb_block_len;
3142971bb1a5SLionel Sambuc xcb_align_to = ALIGNOF(xcb_render_fixed_t);
3143971bb1a5SLionel Sambuc /* insert padding */
3144971bb1a5SLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3145971bb1a5SLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
3146971bb1a5SLionel Sambuc if (0 != xcb_pad) {
3147971bb1a5SLionel Sambuc xcb_tmp += xcb_pad;
3148971bb1a5SLionel Sambuc xcb_pad = 0;
3149971bb1a5SLionel Sambuc }
3150971bb1a5SLionel Sambuc xcb_block_len = 0;
3151971bb1a5SLionel Sambuc
3152971bb1a5SLionel Sambuc return xcb_buffer_len;
3153971bb1a5SLionel Sambuc }
3154971bb1a5SLionel Sambuc
3155971bb1a5SLionel Sambuc xcb_randr_get_crtc_transform_cookie_t
xcb_randr_get_crtc_transform(xcb_connection_t * c,xcb_randr_crtc_t crtc)3156971bb1a5SLionel Sambuc xcb_randr_get_crtc_transform (xcb_connection_t *c /**< */,
3157971bb1a5SLionel Sambuc xcb_randr_crtc_t crtc /**< */)
3158971bb1a5SLionel Sambuc {
3159971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
3160971bb1a5SLionel Sambuc /* count */ 2,
3161971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
3162971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_GET_CRTC_TRANSFORM,
3163971bb1a5SLionel Sambuc /* isvoid */ 0
3164971bb1a5SLionel Sambuc };
3165971bb1a5SLionel Sambuc
3166971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
3167971bb1a5SLionel Sambuc xcb_randr_get_crtc_transform_cookie_t xcb_ret;
3168971bb1a5SLionel Sambuc xcb_randr_get_crtc_transform_request_t xcb_out;
3169971bb1a5SLionel Sambuc
3170971bb1a5SLionel Sambuc xcb_out.crtc = crtc;
3171971bb1a5SLionel Sambuc
3172971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
3173971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
3174971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
3175971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3176971bb1a5SLionel Sambuc
3177971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3178971bb1a5SLionel Sambuc return xcb_ret;
3179971bb1a5SLionel Sambuc }
3180971bb1a5SLionel Sambuc
3181971bb1a5SLionel Sambuc xcb_randr_get_crtc_transform_cookie_t
xcb_randr_get_crtc_transform_unchecked(xcb_connection_t * c,xcb_randr_crtc_t crtc)3182971bb1a5SLionel Sambuc xcb_randr_get_crtc_transform_unchecked (xcb_connection_t *c /**< */,
3183971bb1a5SLionel Sambuc xcb_randr_crtc_t crtc /**< */)
3184971bb1a5SLionel Sambuc {
3185971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
3186971bb1a5SLionel Sambuc /* count */ 2,
3187971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
3188971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_GET_CRTC_TRANSFORM,
3189971bb1a5SLionel Sambuc /* isvoid */ 0
3190971bb1a5SLionel Sambuc };
3191971bb1a5SLionel Sambuc
3192971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
3193971bb1a5SLionel Sambuc xcb_randr_get_crtc_transform_cookie_t xcb_ret;
3194971bb1a5SLionel Sambuc xcb_randr_get_crtc_transform_request_t xcb_out;
3195971bb1a5SLionel Sambuc
3196971bb1a5SLionel Sambuc xcb_out.crtc = crtc;
3197971bb1a5SLionel Sambuc
3198971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
3199971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
3200971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
3201971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3202971bb1a5SLionel Sambuc
3203971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3204971bb1a5SLionel Sambuc return xcb_ret;
3205971bb1a5SLionel Sambuc }
3206971bb1a5SLionel Sambuc
3207971bb1a5SLionel Sambuc char *
xcb_randr_get_crtc_transform_pending_filter_name(const xcb_randr_get_crtc_transform_reply_t * R)3208971bb1a5SLionel Sambuc xcb_randr_get_crtc_transform_pending_filter_name (const xcb_randr_get_crtc_transform_reply_t *R /**< */)
3209971bb1a5SLionel Sambuc {
3210971bb1a5SLionel Sambuc return (char *) (R + 1);
3211971bb1a5SLionel Sambuc }
3212971bb1a5SLionel Sambuc
3213971bb1a5SLionel Sambuc int
xcb_randr_get_crtc_transform_pending_filter_name_length(const xcb_randr_get_crtc_transform_reply_t * R)3214971bb1a5SLionel Sambuc xcb_randr_get_crtc_transform_pending_filter_name_length (const xcb_randr_get_crtc_transform_reply_t *R /**< */)
3215971bb1a5SLionel Sambuc {
3216971bb1a5SLionel Sambuc return R->pending_len;
3217971bb1a5SLionel Sambuc }
3218971bb1a5SLionel Sambuc
3219971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_randr_get_crtc_transform_pending_filter_name_end(const xcb_randr_get_crtc_transform_reply_t * R)3220971bb1a5SLionel Sambuc xcb_randr_get_crtc_transform_pending_filter_name_end (const xcb_randr_get_crtc_transform_reply_t *R /**< */)
3221971bb1a5SLionel Sambuc {
3222971bb1a5SLionel Sambuc xcb_generic_iterator_t i;
3223971bb1a5SLionel Sambuc i.data = ((char *) (R + 1)) + (R->pending_len);
3224971bb1a5SLionel Sambuc i.rem = 0;
3225971bb1a5SLionel Sambuc i.index = (char *) i.data - (char *) R;
3226971bb1a5SLionel Sambuc return i;
3227971bb1a5SLionel Sambuc }
3228971bb1a5SLionel Sambuc
3229971bb1a5SLionel Sambuc xcb_render_fixed_t *
xcb_randr_get_crtc_transform_pending_params(const xcb_randr_get_crtc_transform_reply_t * R)3230971bb1a5SLionel Sambuc xcb_randr_get_crtc_transform_pending_params (const xcb_randr_get_crtc_transform_reply_t *R /**< */)
3231971bb1a5SLionel Sambuc {
3232971bb1a5SLionel Sambuc xcb_generic_iterator_t prev = xcb_randr_get_crtc_transform_pending_filter_name_end(R);
3233971bb1a5SLionel Sambuc return (xcb_render_fixed_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_render_fixed_t, prev.index) + 0);
3234971bb1a5SLionel Sambuc }
3235971bb1a5SLionel Sambuc
3236971bb1a5SLionel Sambuc int
xcb_randr_get_crtc_transform_pending_params_length(const xcb_randr_get_crtc_transform_reply_t * R)3237971bb1a5SLionel Sambuc xcb_randr_get_crtc_transform_pending_params_length (const xcb_randr_get_crtc_transform_reply_t *R /**< */)
3238971bb1a5SLionel Sambuc {
3239971bb1a5SLionel Sambuc return R->pending_nparams;
3240971bb1a5SLionel Sambuc }
3241971bb1a5SLionel Sambuc
3242971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_randr_get_crtc_transform_pending_params_end(const xcb_randr_get_crtc_transform_reply_t * R)3243971bb1a5SLionel Sambuc xcb_randr_get_crtc_transform_pending_params_end (const xcb_randr_get_crtc_transform_reply_t *R /**< */)
3244971bb1a5SLionel Sambuc {
3245971bb1a5SLionel Sambuc xcb_generic_iterator_t i;
3246971bb1a5SLionel Sambuc xcb_generic_iterator_t child = xcb_randr_get_crtc_transform_pending_filter_name_end(R);
3247971bb1a5SLionel Sambuc i.data = ((xcb_render_fixed_t *) child.data) + (R->pending_nparams);
3248971bb1a5SLionel Sambuc i.rem = 0;
3249971bb1a5SLionel Sambuc i.index = (char *) i.data - (char *) R;
3250971bb1a5SLionel Sambuc return i;
3251971bb1a5SLionel Sambuc }
3252971bb1a5SLionel Sambuc
3253971bb1a5SLionel Sambuc char *
xcb_randr_get_crtc_transform_current_filter_name(const xcb_randr_get_crtc_transform_reply_t * R)3254971bb1a5SLionel Sambuc xcb_randr_get_crtc_transform_current_filter_name (const xcb_randr_get_crtc_transform_reply_t *R /**< */)
3255971bb1a5SLionel Sambuc {
3256971bb1a5SLionel Sambuc xcb_generic_iterator_t prev = xcb_randr_get_crtc_transform_pending_params_end(R);
3257971bb1a5SLionel Sambuc return (char *) ((char *) prev.data + XCB_TYPE_PAD(char, prev.index) + 0);
3258971bb1a5SLionel Sambuc }
3259971bb1a5SLionel Sambuc
3260971bb1a5SLionel Sambuc int
xcb_randr_get_crtc_transform_current_filter_name_length(const xcb_randr_get_crtc_transform_reply_t * R)3261971bb1a5SLionel Sambuc xcb_randr_get_crtc_transform_current_filter_name_length (const xcb_randr_get_crtc_transform_reply_t *R /**< */)
3262971bb1a5SLionel Sambuc {
3263971bb1a5SLionel Sambuc return R->current_len;
3264971bb1a5SLionel Sambuc }
3265971bb1a5SLionel Sambuc
3266971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_randr_get_crtc_transform_current_filter_name_end(const xcb_randr_get_crtc_transform_reply_t * R)3267971bb1a5SLionel Sambuc xcb_randr_get_crtc_transform_current_filter_name_end (const xcb_randr_get_crtc_transform_reply_t *R /**< */)
3268971bb1a5SLionel Sambuc {
3269971bb1a5SLionel Sambuc xcb_generic_iterator_t i;
3270971bb1a5SLionel Sambuc xcb_generic_iterator_t child = xcb_randr_get_crtc_transform_pending_params_end(R);
3271971bb1a5SLionel Sambuc i.data = ((char *) child.data) + (R->current_len);
3272971bb1a5SLionel Sambuc i.rem = 0;
3273971bb1a5SLionel Sambuc i.index = (char *) i.data - (char *) R;
3274971bb1a5SLionel Sambuc return i;
3275971bb1a5SLionel Sambuc }
3276971bb1a5SLionel Sambuc
3277971bb1a5SLionel Sambuc xcb_render_fixed_t *
xcb_randr_get_crtc_transform_current_params(const xcb_randr_get_crtc_transform_reply_t * R)3278971bb1a5SLionel Sambuc xcb_randr_get_crtc_transform_current_params (const xcb_randr_get_crtc_transform_reply_t *R /**< */)
3279971bb1a5SLionel Sambuc {
3280971bb1a5SLionel Sambuc xcb_generic_iterator_t prev = xcb_randr_get_crtc_transform_current_filter_name_end(R);
3281971bb1a5SLionel Sambuc return (xcb_render_fixed_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_render_fixed_t, prev.index) + 0);
3282971bb1a5SLionel Sambuc }
3283971bb1a5SLionel Sambuc
3284971bb1a5SLionel Sambuc int
xcb_randr_get_crtc_transform_current_params_length(const xcb_randr_get_crtc_transform_reply_t * R)3285971bb1a5SLionel Sambuc xcb_randr_get_crtc_transform_current_params_length (const xcb_randr_get_crtc_transform_reply_t *R /**< */)
3286971bb1a5SLionel Sambuc {
3287971bb1a5SLionel Sambuc return R->current_nparams;
3288971bb1a5SLionel Sambuc }
3289971bb1a5SLionel Sambuc
3290971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_randr_get_crtc_transform_current_params_end(const xcb_randr_get_crtc_transform_reply_t * R)3291971bb1a5SLionel Sambuc xcb_randr_get_crtc_transform_current_params_end (const xcb_randr_get_crtc_transform_reply_t *R /**< */)
3292971bb1a5SLionel Sambuc {
3293971bb1a5SLionel Sambuc xcb_generic_iterator_t i;
3294971bb1a5SLionel Sambuc xcb_generic_iterator_t child = xcb_randr_get_crtc_transform_current_filter_name_end(R);
3295971bb1a5SLionel Sambuc i.data = ((xcb_render_fixed_t *) child.data) + (R->current_nparams);
3296971bb1a5SLionel Sambuc i.rem = 0;
3297971bb1a5SLionel Sambuc i.index = (char *) i.data - (char *) R;
3298971bb1a5SLionel Sambuc return i;
3299971bb1a5SLionel Sambuc }
3300971bb1a5SLionel Sambuc
3301971bb1a5SLionel Sambuc xcb_randr_get_crtc_transform_reply_t *
xcb_randr_get_crtc_transform_reply(xcb_connection_t * c,xcb_randr_get_crtc_transform_cookie_t cookie,xcb_generic_error_t ** e)3302971bb1a5SLionel Sambuc xcb_randr_get_crtc_transform_reply (xcb_connection_t *c /**< */,
3303971bb1a5SLionel Sambuc xcb_randr_get_crtc_transform_cookie_t cookie /**< */,
3304971bb1a5SLionel Sambuc xcb_generic_error_t **e /**< */)
3305971bb1a5SLionel Sambuc {
3306971bb1a5SLionel Sambuc return (xcb_randr_get_crtc_transform_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
3307971bb1a5SLionel Sambuc }
3308971bb1a5SLionel Sambuc
3309971bb1a5SLionel Sambuc xcb_randr_get_panning_cookie_t
xcb_randr_get_panning(xcb_connection_t * c,xcb_randr_crtc_t crtc)3310971bb1a5SLionel Sambuc xcb_randr_get_panning (xcb_connection_t *c /**< */,
3311971bb1a5SLionel Sambuc xcb_randr_crtc_t crtc /**< */)
3312971bb1a5SLionel Sambuc {
3313971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
3314971bb1a5SLionel Sambuc /* count */ 2,
3315971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
3316971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_GET_PANNING,
3317971bb1a5SLionel Sambuc /* isvoid */ 0
3318971bb1a5SLionel Sambuc };
3319971bb1a5SLionel Sambuc
3320971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
3321971bb1a5SLionel Sambuc xcb_randr_get_panning_cookie_t xcb_ret;
3322971bb1a5SLionel Sambuc xcb_randr_get_panning_request_t xcb_out;
3323971bb1a5SLionel Sambuc
3324971bb1a5SLionel Sambuc xcb_out.crtc = crtc;
3325971bb1a5SLionel Sambuc
3326971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
3327971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
3328971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
3329971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3330971bb1a5SLionel Sambuc
3331971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3332971bb1a5SLionel Sambuc return xcb_ret;
3333971bb1a5SLionel Sambuc }
3334971bb1a5SLionel Sambuc
3335971bb1a5SLionel Sambuc xcb_randr_get_panning_cookie_t
xcb_randr_get_panning_unchecked(xcb_connection_t * c,xcb_randr_crtc_t crtc)3336971bb1a5SLionel Sambuc xcb_randr_get_panning_unchecked (xcb_connection_t *c /**< */,
3337971bb1a5SLionel Sambuc xcb_randr_crtc_t crtc /**< */)
3338971bb1a5SLionel Sambuc {
3339971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
3340971bb1a5SLionel Sambuc /* count */ 2,
3341971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
3342971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_GET_PANNING,
3343971bb1a5SLionel Sambuc /* isvoid */ 0
3344971bb1a5SLionel Sambuc };
3345971bb1a5SLionel Sambuc
3346971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
3347971bb1a5SLionel Sambuc xcb_randr_get_panning_cookie_t xcb_ret;
3348971bb1a5SLionel Sambuc xcb_randr_get_panning_request_t xcb_out;
3349971bb1a5SLionel Sambuc
3350971bb1a5SLionel Sambuc xcb_out.crtc = crtc;
3351971bb1a5SLionel Sambuc
3352971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
3353971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
3354971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
3355971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3356971bb1a5SLionel Sambuc
3357971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3358971bb1a5SLionel Sambuc return xcb_ret;
3359971bb1a5SLionel Sambuc }
3360971bb1a5SLionel Sambuc
3361971bb1a5SLionel Sambuc xcb_randr_get_panning_reply_t *
xcb_randr_get_panning_reply(xcb_connection_t * c,xcb_randr_get_panning_cookie_t cookie,xcb_generic_error_t ** e)3362971bb1a5SLionel Sambuc xcb_randr_get_panning_reply (xcb_connection_t *c /**< */,
3363971bb1a5SLionel Sambuc xcb_randr_get_panning_cookie_t cookie /**< */,
3364971bb1a5SLionel Sambuc xcb_generic_error_t **e /**< */)
3365971bb1a5SLionel Sambuc {
3366971bb1a5SLionel Sambuc return (xcb_randr_get_panning_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
3367971bb1a5SLionel Sambuc }
3368971bb1a5SLionel Sambuc
3369971bb1a5SLionel Sambuc xcb_randr_set_panning_cookie_t
xcb_randr_set_panning(xcb_connection_t * c,xcb_randr_crtc_t crtc,xcb_timestamp_t timestamp,uint16_t left,uint16_t top,uint16_t width,uint16_t height,uint16_t track_left,uint16_t track_top,uint16_t track_width,uint16_t track_height,int16_t border_left,int16_t border_top,int16_t border_right,int16_t border_bottom)3370971bb1a5SLionel Sambuc xcb_randr_set_panning (xcb_connection_t *c /**< */,
3371971bb1a5SLionel Sambuc xcb_randr_crtc_t crtc /**< */,
3372971bb1a5SLionel Sambuc xcb_timestamp_t timestamp /**< */,
3373971bb1a5SLionel Sambuc uint16_t left /**< */,
3374971bb1a5SLionel Sambuc uint16_t top /**< */,
3375971bb1a5SLionel Sambuc uint16_t width /**< */,
3376971bb1a5SLionel Sambuc uint16_t height /**< */,
3377971bb1a5SLionel Sambuc uint16_t track_left /**< */,
3378971bb1a5SLionel Sambuc uint16_t track_top /**< */,
3379971bb1a5SLionel Sambuc uint16_t track_width /**< */,
3380971bb1a5SLionel Sambuc uint16_t track_height /**< */,
3381971bb1a5SLionel Sambuc int16_t border_left /**< */,
3382971bb1a5SLionel Sambuc int16_t border_top /**< */,
3383971bb1a5SLionel Sambuc int16_t border_right /**< */,
3384971bb1a5SLionel Sambuc int16_t border_bottom /**< */)
3385971bb1a5SLionel Sambuc {
3386971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
3387971bb1a5SLionel Sambuc /* count */ 2,
3388971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
3389971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_SET_PANNING,
3390971bb1a5SLionel Sambuc /* isvoid */ 0
3391971bb1a5SLionel Sambuc };
3392971bb1a5SLionel Sambuc
3393971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
3394971bb1a5SLionel Sambuc xcb_randr_set_panning_cookie_t xcb_ret;
3395971bb1a5SLionel Sambuc xcb_randr_set_panning_request_t xcb_out;
3396971bb1a5SLionel Sambuc
3397971bb1a5SLionel Sambuc xcb_out.crtc = crtc;
3398971bb1a5SLionel Sambuc xcb_out.timestamp = timestamp;
3399971bb1a5SLionel Sambuc xcb_out.left = left;
3400971bb1a5SLionel Sambuc xcb_out.top = top;
3401971bb1a5SLionel Sambuc xcb_out.width = width;
3402971bb1a5SLionel Sambuc xcb_out.height = height;
3403971bb1a5SLionel Sambuc xcb_out.track_left = track_left;
3404971bb1a5SLionel Sambuc xcb_out.track_top = track_top;
3405971bb1a5SLionel Sambuc xcb_out.track_width = track_width;
3406971bb1a5SLionel Sambuc xcb_out.track_height = track_height;
3407971bb1a5SLionel Sambuc xcb_out.border_left = border_left;
3408971bb1a5SLionel Sambuc xcb_out.border_top = border_top;
3409971bb1a5SLionel Sambuc xcb_out.border_right = border_right;
3410971bb1a5SLionel Sambuc xcb_out.border_bottom = border_bottom;
3411971bb1a5SLionel Sambuc
3412971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
3413971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
3414971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
3415971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3416971bb1a5SLionel Sambuc
3417971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3418971bb1a5SLionel Sambuc return xcb_ret;
3419971bb1a5SLionel Sambuc }
3420971bb1a5SLionel Sambuc
3421971bb1a5SLionel Sambuc xcb_randr_set_panning_cookie_t
xcb_randr_set_panning_unchecked(xcb_connection_t * c,xcb_randr_crtc_t crtc,xcb_timestamp_t timestamp,uint16_t left,uint16_t top,uint16_t width,uint16_t height,uint16_t track_left,uint16_t track_top,uint16_t track_width,uint16_t track_height,int16_t border_left,int16_t border_top,int16_t border_right,int16_t border_bottom)3422971bb1a5SLionel Sambuc xcb_randr_set_panning_unchecked (xcb_connection_t *c /**< */,
3423971bb1a5SLionel Sambuc xcb_randr_crtc_t crtc /**< */,
3424971bb1a5SLionel Sambuc xcb_timestamp_t timestamp /**< */,
3425971bb1a5SLionel Sambuc uint16_t left /**< */,
3426971bb1a5SLionel Sambuc uint16_t top /**< */,
3427971bb1a5SLionel Sambuc uint16_t width /**< */,
3428971bb1a5SLionel Sambuc uint16_t height /**< */,
3429971bb1a5SLionel Sambuc uint16_t track_left /**< */,
3430971bb1a5SLionel Sambuc uint16_t track_top /**< */,
3431971bb1a5SLionel Sambuc uint16_t track_width /**< */,
3432971bb1a5SLionel Sambuc uint16_t track_height /**< */,
3433971bb1a5SLionel Sambuc int16_t border_left /**< */,
3434971bb1a5SLionel Sambuc int16_t border_top /**< */,
3435971bb1a5SLionel Sambuc int16_t border_right /**< */,
3436971bb1a5SLionel Sambuc int16_t border_bottom /**< */)
3437971bb1a5SLionel Sambuc {
3438971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
3439971bb1a5SLionel Sambuc /* count */ 2,
3440971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
3441971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_SET_PANNING,
3442971bb1a5SLionel Sambuc /* isvoid */ 0
3443971bb1a5SLionel Sambuc };
3444971bb1a5SLionel Sambuc
3445971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
3446971bb1a5SLionel Sambuc xcb_randr_set_panning_cookie_t xcb_ret;
3447971bb1a5SLionel Sambuc xcb_randr_set_panning_request_t xcb_out;
3448971bb1a5SLionel Sambuc
3449971bb1a5SLionel Sambuc xcb_out.crtc = crtc;
3450971bb1a5SLionel Sambuc xcb_out.timestamp = timestamp;
3451971bb1a5SLionel Sambuc xcb_out.left = left;
3452971bb1a5SLionel Sambuc xcb_out.top = top;
3453971bb1a5SLionel Sambuc xcb_out.width = width;
3454971bb1a5SLionel Sambuc xcb_out.height = height;
3455971bb1a5SLionel Sambuc xcb_out.track_left = track_left;
3456971bb1a5SLionel Sambuc xcb_out.track_top = track_top;
3457971bb1a5SLionel Sambuc xcb_out.track_width = track_width;
3458971bb1a5SLionel Sambuc xcb_out.track_height = track_height;
3459971bb1a5SLionel Sambuc xcb_out.border_left = border_left;
3460971bb1a5SLionel Sambuc xcb_out.border_top = border_top;
3461971bb1a5SLionel Sambuc xcb_out.border_right = border_right;
3462971bb1a5SLionel Sambuc xcb_out.border_bottom = border_bottom;
3463971bb1a5SLionel Sambuc
3464971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
3465971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
3466971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
3467971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3468971bb1a5SLionel Sambuc
3469971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3470971bb1a5SLionel Sambuc return xcb_ret;
3471971bb1a5SLionel Sambuc }
3472971bb1a5SLionel Sambuc
3473971bb1a5SLionel Sambuc xcb_randr_set_panning_reply_t *
xcb_randr_set_panning_reply(xcb_connection_t * c,xcb_randr_set_panning_cookie_t cookie,xcb_generic_error_t ** e)3474971bb1a5SLionel Sambuc xcb_randr_set_panning_reply (xcb_connection_t *c /**< */,
3475971bb1a5SLionel Sambuc xcb_randr_set_panning_cookie_t cookie /**< */,
3476971bb1a5SLionel Sambuc xcb_generic_error_t **e /**< */)
3477971bb1a5SLionel Sambuc {
3478971bb1a5SLionel Sambuc return (xcb_randr_set_panning_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
3479971bb1a5SLionel Sambuc }
3480971bb1a5SLionel Sambuc
3481971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_randr_set_output_primary_checked(xcb_connection_t * c,xcb_window_t window,xcb_randr_output_t output)3482971bb1a5SLionel Sambuc xcb_randr_set_output_primary_checked (xcb_connection_t *c /**< */,
3483971bb1a5SLionel Sambuc xcb_window_t window /**< */,
3484971bb1a5SLionel Sambuc xcb_randr_output_t output /**< */)
3485971bb1a5SLionel Sambuc {
3486971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
3487971bb1a5SLionel Sambuc /* count */ 2,
3488971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
3489971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_SET_OUTPUT_PRIMARY,
3490971bb1a5SLionel Sambuc /* isvoid */ 1
3491971bb1a5SLionel Sambuc };
3492971bb1a5SLionel Sambuc
3493971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
3494971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
3495971bb1a5SLionel Sambuc xcb_randr_set_output_primary_request_t xcb_out;
3496971bb1a5SLionel Sambuc
3497971bb1a5SLionel Sambuc xcb_out.window = window;
3498971bb1a5SLionel Sambuc xcb_out.output = output;
3499971bb1a5SLionel Sambuc
3500971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
3501971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
3502971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
3503971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3504971bb1a5SLionel Sambuc
3505971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3506971bb1a5SLionel Sambuc return xcb_ret;
3507971bb1a5SLionel Sambuc }
3508971bb1a5SLionel Sambuc
3509971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_randr_set_output_primary(xcb_connection_t * c,xcb_window_t window,xcb_randr_output_t output)3510971bb1a5SLionel Sambuc xcb_randr_set_output_primary (xcb_connection_t *c /**< */,
3511971bb1a5SLionel Sambuc xcb_window_t window /**< */,
3512971bb1a5SLionel Sambuc xcb_randr_output_t output /**< */)
3513971bb1a5SLionel Sambuc {
3514971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
3515971bb1a5SLionel Sambuc /* count */ 2,
3516971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
3517971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_SET_OUTPUT_PRIMARY,
3518971bb1a5SLionel Sambuc /* isvoid */ 1
3519971bb1a5SLionel Sambuc };
3520971bb1a5SLionel Sambuc
3521971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
3522971bb1a5SLionel Sambuc xcb_void_cookie_t xcb_ret;
3523971bb1a5SLionel Sambuc xcb_randr_set_output_primary_request_t xcb_out;
3524971bb1a5SLionel Sambuc
3525971bb1a5SLionel Sambuc xcb_out.window = window;
3526971bb1a5SLionel Sambuc xcb_out.output = output;
3527971bb1a5SLionel Sambuc
3528971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
3529971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
3530971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
3531971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3532971bb1a5SLionel Sambuc
3533971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3534971bb1a5SLionel Sambuc return xcb_ret;
3535971bb1a5SLionel Sambuc }
3536971bb1a5SLionel Sambuc
3537971bb1a5SLionel Sambuc xcb_randr_get_output_primary_cookie_t
xcb_randr_get_output_primary(xcb_connection_t * c,xcb_window_t window)3538971bb1a5SLionel Sambuc xcb_randr_get_output_primary (xcb_connection_t *c /**< */,
3539971bb1a5SLionel Sambuc xcb_window_t window /**< */)
3540971bb1a5SLionel Sambuc {
3541971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
3542971bb1a5SLionel Sambuc /* count */ 2,
3543971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
3544971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_GET_OUTPUT_PRIMARY,
3545971bb1a5SLionel Sambuc /* isvoid */ 0
3546971bb1a5SLionel Sambuc };
3547971bb1a5SLionel Sambuc
3548971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
3549971bb1a5SLionel Sambuc xcb_randr_get_output_primary_cookie_t xcb_ret;
3550971bb1a5SLionel Sambuc xcb_randr_get_output_primary_request_t xcb_out;
3551971bb1a5SLionel Sambuc
3552971bb1a5SLionel Sambuc xcb_out.window = window;
3553971bb1a5SLionel Sambuc
3554971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
3555971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
3556971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
3557971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3558971bb1a5SLionel Sambuc
3559971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3560971bb1a5SLionel Sambuc return xcb_ret;
3561971bb1a5SLionel Sambuc }
3562971bb1a5SLionel Sambuc
3563971bb1a5SLionel Sambuc xcb_randr_get_output_primary_cookie_t
xcb_randr_get_output_primary_unchecked(xcb_connection_t * c,xcb_window_t window)3564971bb1a5SLionel Sambuc xcb_randr_get_output_primary_unchecked (xcb_connection_t *c /**< */,
3565971bb1a5SLionel Sambuc xcb_window_t window /**< */)
3566971bb1a5SLionel Sambuc {
3567971bb1a5SLionel Sambuc static const xcb_protocol_request_t xcb_req = {
3568971bb1a5SLionel Sambuc /* count */ 2,
3569971bb1a5SLionel Sambuc /* ext */ &xcb_randr_id,
3570971bb1a5SLionel Sambuc /* opcode */ XCB_RANDR_GET_OUTPUT_PRIMARY,
3571971bb1a5SLionel Sambuc /* isvoid */ 0
3572971bb1a5SLionel Sambuc };
3573971bb1a5SLionel Sambuc
3574971bb1a5SLionel Sambuc struct iovec xcb_parts[4];
3575971bb1a5SLionel Sambuc xcb_randr_get_output_primary_cookie_t xcb_ret;
3576971bb1a5SLionel Sambuc xcb_randr_get_output_primary_request_t xcb_out;
3577971bb1a5SLionel Sambuc
3578971bb1a5SLionel Sambuc xcb_out.window = window;
3579971bb1a5SLionel Sambuc
3580971bb1a5SLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
3581971bb1a5SLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
3582971bb1a5SLionel Sambuc xcb_parts[3].iov_base = 0;
3583971bb1a5SLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3584971bb1a5SLionel Sambuc
3585971bb1a5SLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3586971bb1a5SLionel Sambuc return xcb_ret;
3587971bb1a5SLionel Sambuc }
3588971bb1a5SLionel Sambuc
3589971bb1a5SLionel Sambuc xcb_randr_get_output_primary_reply_t *
xcb_randr_get_output_primary_reply(xcb_connection_t * c,xcb_randr_get_output_primary_cookie_t cookie,xcb_generic_error_t ** e)3590971bb1a5SLionel Sambuc xcb_randr_get_output_primary_reply (xcb_connection_t *c /**< */,
3591971bb1a5SLionel Sambuc xcb_randr_get_output_primary_cookie_t cookie /**< */,
3592971bb1a5SLionel Sambuc xcb_generic_error_t **e /**< */)
3593971bb1a5SLionel Sambuc {
3594971bb1a5SLionel Sambuc return (xcb_randr_get_output_primary_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
3595971bb1a5SLionel Sambuc }
3596971bb1a5SLionel Sambuc
3597*0a6a1f1dSLionel Sambuc int
xcb_randr_get_providers_sizeof(const void * _buffer)3598*0a6a1f1dSLionel Sambuc xcb_randr_get_providers_sizeof (const void *_buffer /**< */)
3599*0a6a1f1dSLionel Sambuc {
3600*0a6a1f1dSLionel Sambuc char *xcb_tmp = (char *)_buffer;
3601*0a6a1f1dSLionel Sambuc const xcb_randr_get_providers_reply_t *_aux = (xcb_randr_get_providers_reply_t *)_buffer;
3602*0a6a1f1dSLionel Sambuc unsigned int xcb_buffer_len = 0;
3603*0a6a1f1dSLionel Sambuc unsigned int xcb_block_len = 0;
3604*0a6a1f1dSLionel Sambuc unsigned int xcb_pad = 0;
3605*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
3606971bb1a5SLionel Sambuc
3607*0a6a1f1dSLionel Sambuc
3608*0a6a1f1dSLionel Sambuc xcb_block_len += sizeof(xcb_randr_get_providers_reply_t);
3609*0a6a1f1dSLionel Sambuc xcb_tmp += xcb_block_len;
3610*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len;
3611*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
3612*0a6a1f1dSLionel Sambuc /* providers */
3613*0a6a1f1dSLionel Sambuc xcb_block_len += _aux->num_providers * sizeof(xcb_randr_provider_t);
3614*0a6a1f1dSLionel Sambuc xcb_tmp += xcb_block_len;
3615*0a6a1f1dSLionel Sambuc xcb_align_to = ALIGNOF(xcb_randr_provider_t);
3616*0a6a1f1dSLionel Sambuc /* insert padding */
3617*0a6a1f1dSLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3618*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
3619*0a6a1f1dSLionel Sambuc if (0 != xcb_pad) {
3620*0a6a1f1dSLionel Sambuc xcb_tmp += xcb_pad;
3621*0a6a1f1dSLionel Sambuc xcb_pad = 0;
3622*0a6a1f1dSLionel Sambuc }
3623*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
3624*0a6a1f1dSLionel Sambuc
3625*0a6a1f1dSLionel Sambuc return xcb_buffer_len;
3626*0a6a1f1dSLionel Sambuc }
3627*0a6a1f1dSLionel Sambuc
3628*0a6a1f1dSLionel Sambuc xcb_randr_get_providers_cookie_t
xcb_randr_get_providers(xcb_connection_t * c,xcb_window_t window)3629*0a6a1f1dSLionel Sambuc xcb_randr_get_providers (xcb_connection_t *c /**< */,
3630*0a6a1f1dSLionel Sambuc xcb_window_t window /**< */)
3631*0a6a1f1dSLionel Sambuc {
3632*0a6a1f1dSLionel Sambuc static const xcb_protocol_request_t xcb_req = {
3633*0a6a1f1dSLionel Sambuc /* count */ 2,
3634*0a6a1f1dSLionel Sambuc /* ext */ &xcb_randr_id,
3635*0a6a1f1dSLionel Sambuc /* opcode */ XCB_RANDR_GET_PROVIDERS,
3636*0a6a1f1dSLionel Sambuc /* isvoid */ 0
3637*0a6a1f1dSLionel Sambuc };
3638*0a6a1f1dSLionel Sambuc
3639*0a6a1f1dSLionel Sambuc struct iovec xcb_parts[4];
3640*0a6a1f1dSLionel Sambuc xcb_randr_get_providers_cookie_t xcb_ret;
3641*0a6a1f1dSLionel Sambuc xcb_randr_get_providers_request_t xcb_out;
3642*0a6a1f1dSLionel Sambuc
3643*0a6a1f1dSLionel Sambuc xcb_out.window = window;
3644*0a6a1f1dSLionel Sambuc
3645*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
3646*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
3647*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_base = 0;
3648*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3649*0a6a1f1dSLionel Sambuc
3650*0a6a1f1dSLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3651*0a6a1f1dSLionel Sambuc return xcb_ret;
3652*0a6a1f1dSLionel Sambuc }
3653*0a6a1f1dSLionel Sambuc
3654*0a6a1f1dSLionel Sambuc xcb_randr_get_providers_cookie_t
xcb_randr_get_providers_unchecked(xcb_connection_t * c,xcb_window_t window)3655*0a6a1f1dSLionel Sambuc xcb_randr_get_providers_unchecked (xcb_connection_t *c /**< */,
3656*0a6a1f1dSLionel Sambuc xcb_window_t window /**< */)
3657*0a6a1f1dSLionel Sambuc {
3658*0a6a1f1dSLionel Sambuc static const xcb_protocol_request_t xcb_req = {
3659*0a6a1f1dSLionel Sambuc /* count */ 2,
3660*0a6a1f1dSLionel Sambuc /* ext */ &xcb_randr_id,
3661*0a6a1f1dSLionel Sambuc /* opcode */ XCB_RANDR_GET_PROVIDERS,
3662*0a6a1f1dSLionel Sambuc /* isvoid */ 0
3663*0a6a1f1dSLionel Sambuc };
3664*0a6a1f1dSLionel Sambuc
3665*0a6a1f1dSLionel Sambuc struct iovec xcb_parts[4];
3666*0a6a1f1dSLionel Sambuc xcb_randr_get_providers_cookie_t xcb_ret;
3667*0a6a1f1dSLionel Sambuc xcb_randr_get_providers_request_t xcb_out;
3668*0a6a1f1dSLionel Sambuc
3669*0a6a1f1dSLionel Sambuc xcb_out.window = window;
3670*0a6a1f1dSLionel Sambuc
3671*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
3672*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
3673*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_base = 0;
3674*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3675*0a6a1f1dSLionel Sambuc
3676*0a6a1f1dSLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3677*0a6a1f1dSLionel Sambuc return xcb_ret;
3678*0a6a1f1dSLionel Sambuc }
3679*0a6a1f1dSLionel Sambuc
3680*0a6a1f1dSLionel Sambuc xcb_randr_provider_t *
xcb_randr_get_providers_providers(const xcb_randr_get_providers_reply_t * R)3681*0a6a1f1dSLionel Sambuc xcb_randr_get_providers_providers (const xcb_randr_get_providers_reply_t *R /**< */)
3682*0a6a1f1dSLionel Sambuc {
3683*0a6a1f1dSLionel Sambuc return (xcb_randr_provider_t *) (R + 1);
3684*0a6a1f1dSLionel Sambuc }
3685*0a6a1f1dSLionel Sambuc
3686*0a6a1f1dSLionel Sambuc int
xcb_randr_get_providers_providers_length(const xcb_randr_get_providers_reply_t * R)3687*0a6a1f1dSLionel Sambuc xcb_randr_get_providers_providers_length (const xcb_randr_get_providers_reply_t *R /**< */)
3688*0a6a1f1dSLionel Sambuc {
3689*0a6a1f1dSLionel Sambuc return R->num_providers;
3690*0a6a1f1dSLionel Sambuc }
3691*0a6a1f1dSLionel Sambuc
3692*0a6a1f1dSLionel Sambuc xcb_generic_iterator_t
xcb_randr_get_providers_providers_end(const xcb_randr_get_providers_reply_t * R)3693*0a6a1f1dSLionel Sambuc xcb_randr_get_providers_providers_end (const xcb_randr_get_providers_reply_t *R /**< */)
3694*0a6a1f1dSLionel Sambuc {
3695*0a6a1f1dSLionel Sambuc xcb_generic_iterator_t i;
3696*0a6a1f1dSLionel Sambuc i.data = ((xcb_randr_provider_t *) (R + 1)) + (R->num_providers);
3697*0a6a1f1dSLionel Sambuc i.rem = 0;
3698*0a6a1f1dSLionel Sambuc i.index = (char *) i.data - (char *) R;
3699*0a6a1f1dSLionel Sambuc return i;
3700*0a6a1f1dSLionel Sambuc }
3701*0a6a1f1dSLionel Sambuc
3702*0a6a1f1dSLionel Sambuc xcb_randr_get_providers_reply_t *
xcb_randr_get_providers_reply(xcb_connection_t * c,xcb_randr_get_providers_cookie_t cookie,xcb_generic_error_t ** e)3703*0a6a1f1dSLionel Sambuc xcb_randr_get_providers_reply (xcb_connection_t *c /**< */,
3704*0a6a1f1dSLionel Sambuc xcb_randr_get_providers_cookie_t cookie /**< */,
3705*0a6a1f1dSLionel Sambuc xcb_generic_error_t **e /**< */)
3706*0a6a1f1dSLionel Sambuc {
3707*0a6a1f1dSLionel Sambuc return (xcb_randr_get_providers_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
3708*0a6a1f1dSLionel Sambuc }
3709*0a6a1f1dSLionel Sambuc
3710*0a6a1f1dSLionel Sambuc int
xcb_randr_get_provider_info_sizeof(const void * _buffer)3711*0a6a1f1dSLionel Sambuc xcb_randr_get_provider_info_sizeof (const void *_buffer /**< */)
3712*0a6a1f1dSLionel Sambuc {
3713*0a6a1f1dSLionel Sambuc char *xcb_tmp = (char *)_buffer;
3714*0a6a1f1dSLionel Sambuc const xcb_randr_get_provider_info_reply_t *_aux = (xcb_randr_get_provider_info_reply_t *)_buffer;
3715*0a6a1f1dSLionel Sambuc unsigned int xcb_buffer_len = 0;
3716*0a6a1f1dSLionel Sambuc unsigned int xcb_block_len = 0;
3717*0a6a1f1dSLionel Sambuc unsigned int xcb_pad = 0;
3718*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
3719*0a6a1f1dSLionel Sambuc
3720*0a6a1f1dSLionel Sambuc
3721*0a6a1f1dSLionel Sambuc xcb_block_len += sizeof(xcb_randr_get_provider_info_reply_t);
3722*0a6a1f1dSLionel Sambuc xcb_tmp += xcb_block_len;
3723*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len;
3724*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
3725*0a6a1f1dSLionel Sambuc /* crtcs */
3726*0a6a1f1dSLionel Sambuc xcb_block_len += _aux->num_crtcs * sizeof(uint32_t);
3727*0a6a1f1dSLionel Sambuc xcb_tmp += xcb_block_len;
3728*0a6a1f1dSLionel Sambuc xcb_align_to = ALIGNOF(xcb_randr_crtc_t);
3729*0a6a1f1dSLionel Sambuc /* insert padding */
3730*0a6a1f1dSLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3731*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
3732*0a6a1f1dSLionel Sambuc if (0 != xcb_pad) {
3733*0a6a1f1dSLionel Sambuc xcb_tmp += xcb_pad;
3734*0a6a1f1dSLionel Sambuc xcb_pad = 0;
3735*0a6a1f1dSLionel Sambuc }
3736*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
3737*0a6a1f1dSLionel Sambuc /* outputs */
3738*0a6a1f1dSLionel Sambuc xcb_block_len += _aux->num_outputs * sizeof(uint32_t);
3739*0a6a1f1dSLionel Sambuc xcb_tmp += xcb_block_len;
3740*0a6a1f1dSLionel Sambuc xcb_align_to = ALIGNOF(xcb_randr_output_t);
3741*0a6a1f1dSLionel Sambuc /* insert padding */
3742*0a6a1f1dSLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3743*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
3744*0a6a1f1dSLionel Sambuc if (0 != xcb_pad) {
3745*0a6a1f1dSLionel Sambuc xcb_tmp += xcb_pad;
3746*0a6a1f1dSLionel Sambuc xcb_pad = 0;
3747*0a6a1f1dSLionel Sambuc }
3748*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
3749*0a6a1f1dSLionel Sambuc /* associated_providers */
3750*0a6a1f1dSLionel Sambuc xcb_block_len += _aux->num_associated_providers * sizeof(uint32_t);
3751*0a6a1f1dSLionel Sambuc xcb_tmp += xcb_block_len;
3752*0a6a1f1dSLionel Sambuc xcb_align_to = ALIGNOF(xcb_randr_provider_t);
3753*0a6a1f1dSLionel Sambuc /* insert padding */
3754*0a6a1f1dSLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3755*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
3756*0a6a1f1dSLionel Sambuc if (0 != xcb_pad) {
3757*0a6a1f1dSLionel Sambuc xcb_tmp += xcb_pad;
3758*0a6a1f1dSLionel Sambuc xcb_pad = 0;
3759*0a6a1f1dSLionel Sambuc }
3760*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
3761*0a6a1f1dSLionel Sambuc /* associated_capability */
3762*0a6a1f1dSLionel Sambuc xcb_block_len += _aux->num_associated_providers * sizeof(uint32_t);
3763*0a6a1f1dSLionel Sambuc xcb_tmp += xcb_block_len;
3764*0a6a1f1dSLionel Sambuc xcb_align_to = ALIGNOF(uint32_t);
3765*0a6a1f1dSLionel Sambuc /* insert padding */
3766*0a6a1f1dSLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3767*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
3768*0a6a1f1dSLionel Sambuc if (0 != xcb_pad) {
3769*0a6a1f1dSLionel Sambuc xcb_tmp += xcb_pad;
3770*0a6a1f1dSLionel Sambuc xcb_pad = 0;
3771*0a6a1f1dSLionel Sambuc }
3772*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
3773*0a6a1f1dSLionel Sambuc /* name */
3774*0a6a1f1dSLionel Sambuc xcb_block_len += _aux->name_len * sizeof(char);
3775*0a6a1f1dSLionel Sambuc xcb_tmp += xcb_block_len;
3776*0a6a1f1dSLionel Sambuc xcb_align_to = ALIGNOF(char);
3777*0a6a1f1dSLionel Sambuc /* insert padding */
3778*0a6a1f1dSLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
3779*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
3780*0a6a1f1dSLionel Sambuc if (0 != xcb_pad) {
3781*0a6a1f1dSLionel Sambuc xcb_tmp += xcb_pad;
3782*0a6a1f1dSLionel Sambuc xcb_pad = 0;
3783*0a6a1f1dSLionel Sambuc }
3784*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
3785*0a6a1f1dSLionel Sambuc
3786*0a6a1f1dSLionel Sambuc return xcb_buffer_len;
3787*0a6a1f1dSLionel Sambuc }
3788*0a6a1f1dSLionel Sambuc
3789*0a6a1f1dSLionel Sambuc xcb_randr_get_provider_info_cookie_t
xcb_randr_get_provider_info(xcb_connection_t * c,xcb_randr_provider_t provider,xcb_timestamp_t config_timestamp)3790*0a6a1f1dSLionel Sambuc xcb_randr_get_provider_info (xcb_connection_t *c /**< */,
3791*0a6a1f1dSLionel Sambuc xcb_randr_provider_t provider /**< */,
3792*0a6a1f1dSLionel Sambuc xcb_timestamp_t config_timestamp /**< */)
3793*0a6a1f1dSLionel Sambuc {
3794*0a6a1f1dSLionel Sambuc static const xcb_protocol_request_t xcb_req = {
3795*0a6a1f1dSLionel Sambuc /* count */ 2,
3796*0a6a1f1dSLionel Sambuc /* ext */ &xcb_randr_id,
3797*0a6a1f1dSLionel Sambuc /* opcode */ XCB_RANDR_GET_PROVIDER_INFO,
3798*0a6a1f1dSLionel Sambuc /* isvoid */ 0
3799*0a6a1f1dSLionel Sambuc };
3800*0a6a1f1dSLionel Sambuc
3801*0a6a1f1dSLionel Sambuc struct iovec xcb_parts[4];
3802*0a6a1f1dSLionel Sambuc xcb_randr_get_provider_info_cookie_t xcb_ret;
3803*0a6a1f1dSLionel Sambuc xcb_randr_get_provider_info_request_t xcb_out;
3804*0a6a1f1dSLionel Sambuc
3805*0a6a1f1dSLionel Sambuc xcb_out.provider = provider;
3806*0a6a1f1dSLionel Sambuc xcb_out.config_timestamp = config_timestamp;
3807*0a6a1f1dSLionel Sambuc
3808*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
3809*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
3810*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_base = 0;
3811*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3812*0a6a1f1dSLionel Sambuc
3813*0a6a1f1dSLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3814*0a6a1f1dSLionel Sambuc return xcb_ret;
3815*0a6a1f1dSLionel Sambuc }
3816*0a6a1f1dSLionel Sambuc
3817*0a6a1f1dSLionel Sambuc xcb_randr_get_provider_info_cookie_t
xcb_randr_get_provider_info_unchecked(xcb_connection_t * c,xcb_randr_provider_t provider,xcb_timestamp_t config_timestamp)3818*0a6a1f1dSLionel Sambuc xcb_randr_get_provider_info_unchecked (xcb_connection_t *c /**< */,
3819*0a6a1f1dSLionel Sambuc xcb_randr_provider_t provider /**< */,
3820*0a6a1f1dSLionel Sambuc xcb_timestamp_t config_timestamp /**< */)
3821*0a6a1f1dSLionel Sambuc {
3822*0a6a1f1dSLionel Sambuc static const xcb_protocol_request_t xcb_req = {
3823*0a6a1f1dSLionel Sambuc /* count */ 2,
3824*0a6a1f1dSLionel Sambuc /* ext */ &xcb_randr_id,
3825*0a6a1f1dSLionel Sambuc /* opcode */ XCB_RANDR_GET_PROVIDER_INFO,
3826*0a6a1f1dSLionel Sambuc /* isvoid */ 0
3827*0a6a1f1dSLionel Sambuc };
3828*0a6a1f1dSLionel Sambuc
3829*0a6a1f1dSLionel Sambuc struct iovec xcb_parts[4];
3830*0a6a1f1dSLionel Sambuc xcb_randr_get_provider_info_cookie_t xcb_ret;
3831*0a6a1f1dSLionel Sambuc xcb_randr_get_provider_info_request_t xcb_out;
3832*0a6a1f1dSLionel Sambuc
3833*0a6a1f1dSLionel Sambuc xcb_out.provider = provider;
3834*0a6a1f1dSLionel Sambuc xcb_out.config_timestamp = config_timestamp;
3835*0a6a1f1dSLionel Sambuc
3836*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
3837*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
3838*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_base = 0;
3839*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3840*0a6a1f1dSLionel Sambuc
3841*0a6a1f1dSLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3842*0a6a1f1dSLionel Sambuc return xcb_ret;
3843*0a6a1f1dSLionel Sambuc }
3844*0a6a1f1dSLionel Sambuc
3845*0a6a1f1dSLionel Sambuc xcb_randr_crtc_t *
xcb_randr_get_provider_info_crtcs(const xcb_randr_get_provider_info_reply_t * R)3846*0a6a1f1dSLionel Sambuc xcb_randr_get_provider_info_crtcs (const xcb_randr_get_provider_info_reply_t *R /**< */)
3847*0a6a1f1dSLionel Sambuc {
3848*0a6a1f1dSLionel Sambuc return (xcb_randr_crtc_t *) (R + 1);
3849*0a6a1f1dSLionel Sambuc }
3850*0a6a1f1dSLionel Sambuc
3851*0a6a1f1dSLionel Sambuc int
xcb_randr_get_provider_info_crtcs_length(const xcb_randr_get_provider_info_reply_t * R)3852*0a6a1f1dSLionel Sambuc xcb_randr_get_provider_info_crtcs_length (const xcb_randr_get_provider_info_reply_t *R /**< */)
3853*0a6a1f1dSLionel Sambuc {
3854*0a6a1f1dSLionel Sambuc return R->num_crtcs;
3855*0a6a1f1dSLionel Sambuc }
3856*0a6a1f1dSLionel Sambuc
3857*0a6a1f1dSLionel Sambuc xcb_generic_iterator_t
xcb_randr_get_provider_info_crtcs_end(const xcb_randr_get_provider_info_reply_t * R)3858*0a6a1f1dSLionel Sambuc xcb_randr_get_provider_info_crtcs_end (const xcb_randr_get_provider_info_reply_t *R /**< */)
3859*0a6a1f1dSLionel Sambuc {
3860*0a6a1f1dSLionel Sambuc xcb_generic_iterator_t i;
3861*0a6a1f1dSLionel Sambuc i.data = ((xcb_randr_crtc_t *) (R + 1)) + (R->num_crtcs);
3862*0a6a1f1dSLionel Sambuc i.rem = 0;
3863*0a6a1f1dSLionel Sambuc i.index = (char *) i.data - (char *) R;
3864*0a6a1f1dSLionel Sambuc return i;
3865*0a6a1f1dSLionel Sambuc }
3866*0a6a1f1dSLionel Sambuc
3867*0a6a1f1dSLionel Sambuc xcb_randr_output_t *
xcb_randr_get_provider_info_outputs(const xcb_randr_get_provider_info_reply_t * R)3868*0a6a1f1dSLionel Sambuc xcb_randr_get_provider_info_outputs (const xcb_randr_get_provider_info_reply_t *R /**< */)
3869*0a6a1f1dSLionel Sambuc {
3870*0a6a1f1dSLionel Sambuc xcb_generic_iterator_t prev = xcb_randr_get_provider_info_crtcs_end(R);
3871*0a6a1f1dSLionel Sambuc return (xcb_randr_output_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_randr_output_t, prev.index) + 0);
3872*0a6a1f1dSLionel Sambuc }
3873*0a6a1f1dSLionel Sambuc
3874*0a6a1f1dSLionel Sambuc int
xcb_randr_get_provider_info_outputs_length(const xcb_randr_get_provider_info_reply_t * R)3875*0a6a1f1dSLionel Sambuc xcb_randr_get_provider_info_outputs_length (const xcb_randr_get_provider_info_reply_t *R /**< */)
3876*0a6a1f1dSLionel Sambuc {
3877*0a6a1f1dSLionel Sambuc return R->num_outputs;
3878*0a6a1f1dSLionel Sambuc }
3879*0a6a1f1dSLionel Sambuc
3880*0a6a1f1dSLionel Sambuc xcb_generic_iterator_t
xcb_randr_get_provider_info_outputs_end(const xcb_randr_get_provider_info_reply_t * R)3881*0a6a1f1dSLionel Sambuc xcb_randr_get_provider_info_outputs_end (const xcb_randr_get_provider_info_reply_t *R /**< */)
3882*0a6a1f1dSLionel Sambuc {
3883*0a6a1f1dSLionel Sambuc xcb_generic_iterator_t i;
3884*0a6a1f1dSLionel Sambuc xcb_generic_iterator_t child = xcb_randr_get_provider_info_crtcs_end(R);
3885*0a6a1f1dSLionel Sambuc i.data = ((xcb_randr_output_t *) child.data) + (R->num_outputs);
3886*0a6a1f1dSLionel Sambuc i.rem = 0;
3887*0a6a1f1dSLionel Sambuc i.index = (char *) i.data - (char *) R;
3888*0a6a1f1dSLionel Sambuc return i;
3889*0a6a1f1dSLionel Sambuc }
3890*0a6a1f1dSLionel Sambuc
3891*0a6a1f1dSLionel Sambuc xcb_randr_provider_t *
xcb_randr_get_provider_info_associated_providers(const xcb_randr_get_provider_info_reply_t * R)3892*0a6a1f1dSLionel Sambuc xcb_randr_get_provider_info_associated_providers (const xcb_randr_get_provider_info_reply_t *R /**< */)
3893*0a6a1f1dSLionel Sambuc {
3894*0a6a1f1dSLionel Sambuc xcb_generic_iterator_t prev = xcb_randr_get_provider_info_outputs_end(R);
3895*0a6a1f1dSLionel Sambuc return (xcb_randr_provider_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_randr_provider_t, prev.index) + 0);
3896*0a6a1f1dSLionel Sambuc }
3897*0a6a1f1dSLionel Sambuc
3898*0a6a1f1dSLionel Sambuc int
xcb_randr_get_provider_info_associated_providers_length(const xcb_randr_get_provider_info_reply_t * R)3899*0a6a1f1dSLionel Sambuc xcb_randr_get_provider_info_associated_providers_length (const xcb_randr_get_provider_info_reply_t *R /**< */)
3900*0a6a1f1dSLionel Sambuc {
3901*0a6a1f1dSLionel Sambuc return R->num_associated_providers;
3902*0a6a1f1dSLionel Sambuc }
3903*0a6a1f1dSLionel Sambuc
3904*0a6a1f1dSLionel Sambuc xcb_generic_iterator_t
xcb_randr_get_provider_info_associated_providers_end(const xcb_randr_get_provider_info_reply_t * R)3905*0a6a1f1dSLionel Sambuc xcb_randr_get_provider_info_associated_providers_end (const xcb_randr_get_provider_info_reply_t *R /**< */)
3906*0a6a1f1dSLionel Sambuc {
3907*0a6a1f1dSLionel Sambuc xcb_generic_iterator_t i;
3908*0a6a1f1dSLionel Sambuc xcb_generic_iterator_t child = xcb_randr_get_provider_info_outputs_end(R);
3909*0a6a1f1dSLionel Sambuc i.data = ((xcb_randr_provider_t *) child.data) + (R->num_associated_providers);
3910*0a6a1f1dSLionel Sambuc i.rem = 0;
3911*0a6a1f1dSLionel Sambuc i.index = (char *) i.data - (char *) R;
3912*0a6a1f1dSLionel Sambuc return i;
3913*0a6a1f1dSLionel Sambuc }
3914*0a6a1f1dSLionel Sambuc
3915*0a6a1f1dSLionel Sambuc uint32_t *
xcb_randr_get_provider_info_associated_capability(const xcb_randr_get_provider_info_reply_t * R)3916*0a6a1f1dSLionel Sambuc xcb_randr_get_provider_info_associated_capability (const xcb_randr_get_provider_info_reply_t *R /**< */)
3917*0a6a1f1dSLionel Sambuc {
3918*0a6a1f1dSLionel Sambuc xcb_generic_iterator_t prev = xcb_randr_get_provider_info_associated_providers_end(R);
3919*0a6a1f1dSLionel Sambuc return (uint32_t *) ((char *) prev.data + XCB_TYPE_PAD(uint32_t, prev.index) + 0);
3920*0a6a1f1dSLionel Sambuc }
3921*0a6a1f1dSLionel Sambuc
3922*0a6a1f1dSLionel Sambuc int
xcb_randr_get_provider_info_associated_capability_length(const xcb_randr_get_provider_info_reply_t * R)3923*0a6a1f1dSLionel Sambuc xcb_randr_get_provider_info_associated_capability_length (const xcb_randr_get_provider_info_reply_t *R /**< */)
3924*0a6a1f1dSLionel Sambuc {
3925*0a6a1f1dSLionel Sambuc return R->num_associated_providers;
3926*0a6a1f1dSLionel Sambuc }
3927*0a6a1f1dSLionel Sambuc
3928*0a6a1f1dSLionel Sambuc xcb_generic_iterator_t
xcb_randr_get_provider_info_associated_capability_end(const xcb_randr_get_provider_info_reply_t * R)3929*0a6a1f1dSLionel Sambuc xcb_randr_get_provider_info_associated_capability_end (const xcb_randr_get_provider_info_reply_t *R /**< */)
3930*0a6a1f1dSLionel Sambuc {
3931*0a6a1f1dSLionel Sambuc xcb_generic_iterator_t i;
3932*0a6a1f1dSLionel Sambuc xcb_generic_iterator_t child = xcb_randr_get_provider_info_associated_providers_end(R);
3933*0a6a1f1dSLionel Sambuc i.data = ((uint32_t *) child.data) + (R->num_associated_providers);
3934*0a6a1f1dSLionel Sambuc i.rem = 0;
3935*0a6a1f1dSLionel Sambuc i.index = (char *) i.data - (char *) R;
3936*0a6a1f1dSLionel Sambuc return i;
3937*0a6a1f1dSLionel Sambuc }
3938*0a6a1f1dSLionel Sambuc
3939*0a6a1f1dSLionel Sambuc char *
xcb_randr_get_provider_info_name(const xcb_randr_get_provider_info_reply_t * R)3940*0a6a1f1dSLionel Sambuc xcb_randr_get_provider_info_name (const xcb_randr_get_provider_info_reply_t *R /**< */)
3941*0a6a1f1dSLionel Sambuc {
3942*0a6a1f1dSLionel Sambuc xcb_generic_iterator_t prev = xcb_randr_get_provider_info_associated_capability_end(R);
3943*0a6a1f1dSLionel Sambuc return (char *) ((char *) prev.data + XCB_TYPE_PAD(char, prev.index) + 0);
3944*0a6a1f1dSLionel Sambuc }
3945*0a6a1f1dSLionel Sambuc
3946*0a6a1f1dSLionel Sambuc int
xcb_randr_get_provider_info_name_length(const xcb_randr_get_provider_info_reply_t * R)3947*0a6a1f1dSLionel Sambuc xcb_randr_get_provider_info_name_length (const xcb_randr_get_provider_info_reply_t *R /**< */)
3948*0a6a1f1dSLionel Sambuc {
3949*0a6a1f1dSLionel Sambuc return R->name_len;
3950*0a6a1f1dSLionel Sambuc }
3951*0a6a1f1dSLionel Sambuc
3952*0a6a1f1dSLionel Sambuc xcb_generic_iterator_t
xcb_randr_get_provider_info_name_end(const xcb_randr_get_provider_info_reply_t * R)3953*0a6a1f1dSLionel Sambuc xcb_randr_get_provider_info_name_end (const xcb_randr_get_provider_info_reply_t *R /**< */)
3954*0a6a1f1dSLionel Sambuc {
3955*0a6a1f1dSLionel Sambuc xcb_generic_iterator_t i;
3956*0a6a1f1dSLionel Sambuc xcb_generic_iterator_t child = xcb_randr_get_provider_info_associated_capability_end(R);
3957*0a6a1f1dSLionel Sambuc i.data = ((char *) child.data) + (R->name_len);
3958*0a6a1f1dSLionel Sambuc i.rem = 0;
3959*0a6a1f1dSLionel Sambuc i.index = (char *) i.data - (char *) R;
3960*0a6a1f1dSLionel Sambuc return i;
3961*0a6a1f1dSLionel Sambuc }
3962*0a6a1f1dSLionel Sambuc
3963*0a6a1f1dSLionel Sambuc xcb_randr_get_provider_info_reply_t *
xcb_randr_get_provider_info_reply(xcb_connection_t * c,xcb_randr_get_provider_info_cookie_t cookie,xcb_generic_error_t ** e)3964*0a6a1f1dSLionel Sambuc xcb_randr_get_provider_info_reply (xcb_connection_t *c /**< */,
3965*0a6a1f1dSLionel Sambuc xcb_randr_get_provider_info_cookie_t cookie /**< */,
3966*0a6a1f1dSLionel Sambuc xcb_generic_error_t **e /**< */)
3967*0a6a1f1dSLionel Sambuc {
3968*0a6a1f1dSLionel Sambuc return (xcb_randr_get_provider_info_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
3969*0a6a1f1dSLionel Sambuc }
3970*0a6a1f1dSLionel Sambuc
3971*0a6a1f1dSLionel Sambuc xcb_void_cookie_t
xcb_randr_set_provider_offload_sink_checked(xcb_connection_t * c,xcb_randr_provider_t provider,xcb_randr_provider_t sink_provider,xcb_timestamp_t config_timestamp)3972*0a6a1f1dSLionel Sambuc xcb_randr_set_provider_offload_sink_checked (xcb_connection_t *c /**< */,
3973*0a6a1f1dSLionel Sambuc xcb_randr_provider_t provider /**< */,
3974*0a6a1f1dSLionel Sambuc xcb_randr_provider_t sink_provider /**< */,
3975*0a6a1f1dSLionel Sambuc xcb_timestamp_t config_timestamp /**< */)
3976*0a6a1f1dSLionel Sambuc {
3977*0a6a1f1dSLionel Sambuc static const xcb_protocol_request_t xcb_req = {
3978*0a6a1f1dSLionel Sambuc /* count */ 2,
3979*0a6a1f1dSLionel Sambuc /* ext */ &xcb_randr_id,
3980*0a6a1f1dSLionel Sambuc /* opcode */ XCB_RANDR_SET_PROVIDER_OFFLOAD_SINK,
3981*0a6a1f1dSLionel Sambuc /* isvoid */ 1
3982*0a6a1f1dSLionel Sambuc };
3983*0a6a1f1dSLionel Sambuc
3984*0a6a1f1dSLionel Sambuc struct iovec xcb_parts[4];
3985*0a6a1f1dSLionel Sambuc xcb_void_cookie_t xcb_ret;
3986*0a6a1f1dSLionel Sambuc xcb_randr_set_provider_offload_sink_request_t xcb_out;
3987*0a6a1f1dSLionel Sambuc
3988*0a6a1f1dSLionel Sambuc xcb_out.provider = provider;
3989*0a6a1f1dSLionel Sambuc xcb_out.sink_provider = sink_provider;
3990*0a6a1f1dSLionel Sambuc xcb_out.config_timestamp = config_timestamp;
3991*0a6a1f1dSLionel Sambuc
3992*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
3993*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
3994*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_base = 0;
3995*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
3996*0a6a1f1dSLionel Sambuc
3997*0a6a1f1dSLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
3998*0a6a1f1dSLionel Sambuc return xcb_ret;
3999*0a6a1f1dSLionel Sambuc }
4000*0a6a1f1dSLionel Sambuc
4001*0a6a1f1dSLionel Sambuc xcb_void_cookie_t
xcb_randr_set_provider_offload_sink(xcb_connection_t * c,xcb_randr_provider_t provider,xcb_randr_provider_t sink_provider,xcb_timestamp_t config_timestamp)4002*0a6a1f1dSLionel Sambuc xcb_randr_set_provider_offload_sink (xcb_connection_t *c /**< */,
4003*0a6a1f1dSLionel Sambuc xcb_randr_provider_t provider /**< */,
4004*0a6a1f1dSLionel Sambuc xcb_randr_provider_t sink_provider /**< */,
4005*0a6a1f1dSLionel Sambuc xcb_timestamp_t config_timestamp /**< */)
4006*0a6a1f1dSLionel Sambuc {
4007*0a6a1f1dSLionel Sambuc static const xcb_protocol_request_t xcb_req = {
4008*0a6a1f1dSLionel Sambuc /* count */ 2,
4009*0a6a1f1dSLionel Sambuc /* ext */ &xcb_randr_id,
4010*0a6a1f1dSLionel Sambuc /* opcode */ XCB_RANDR_SET_PROVIDER_OFFLOAD_SINK,
4011*0a6a1f1dSLionel Sambuc /* isvoid */ 1
4012*0a6a1f1dSLionel Sambuc };
4013*0a6a1f1dSLionel Sambuc
4014*0a6a1f1dSLionel Sambuc struct iovec xcb_parts[4];
4015*0a6a1f1dSLionel Sambuc xcb_void_cookie_t xcb_ret;
4016*0a6a1f1dSLionel Sambuc xcb_randr_set_provider_offload_sink_request_t xcb_out;
4017*0a6a1f1dSLionel Sambuc
4018*0a6a1f1dSLionel Sambuc xcb_out.provider = provider;
4019*0a6a1f1dSLionel Sambuc xcb_out.sink_provider = sink_provider;
4020*0a6a1f1dSLionel Sambuc xcb_out.config_timestamp = config_timestamp;
4021*0a6a1f1dSLionel Sambuc
4022*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
4023*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
4024*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_base = 0;
4025*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4026*0a6a1f1dSLionel Sambuc
4027*0a6a1f1dSLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
4028*0a6a1f1dSLionel Sambuc return xcb_ret;
4029*0a6a1f1dSLionel Sambuc }
4030*0a6a1f1dSLionel Sambuc
4031*0a6a1f1dSLionel Sambuc xcb_void_cookie_t
xcb_randr_set_provider_output_source_checked(xcb_connection_t * c,xcb_randr_provider_t provider,xcb_randr_provider_t source_provider,xcb_timestamp_t config_timestamp)4032*0a6a1f1dSLionel Sambuc xcb_randr_set_provider_output_source_checked (xcb_connection_t *c /**< */,
4033*0a6a1f1dSLionel Sambuc xcb_randr_provider_t provider /**< */,
4034*0a6a1f1dSLionel Sambuc xcb_randr_provider_t source_provider /**< */,
4035*0a6a1f1dSLionel Sambuc xcb_timestamp_t config_timestamp /**< */)
4036*0a6a1f1dSLionel Sambuc {
4037*0a6a1f1dSLionel Sambuc static const xcb_protocol_request_t xcb_req = {
4038*0a6a1f1dSLionel Sambuc /* count */ 2,
4039*0a6a1f1dSLionel Sambuc /* ext */ &xcb_randr_id,
4040*0a6a1f1dSLionel Sambuc /* opcode */ XCB_RANDR_SET_PROVIDER_OUTPUT_SOURCE,
4041*0a6a1f1dSLionel Sambuc /* isvoid */ 1
4042*0a6a1f1dSLionel Sambuc };
4043*0a6a1f1dSLionel Sambuc
4044*0a6a1f1dSLionel Sambuc struct iovec xcb_parts[4];
4045*0a6a1f1dSLionel Sambuc xcb_void_cookie_t xcb_ret;
4046*0a6a1f1dSLionel Sambuc xcb_randr_set_provider_output_source_request_t xcb_out;
4047*0a6a1f1dSLionel Sambuc
4048*0a6a1f1dSLionel Sambuc xcb_out.provider = provider;
4049*0a6a1f1dSLionel Sambuc xcb_out.source_provider = source_provider;
4050*0a6a1f1dSLionel Sambuc xcb_out.config_timestamp = config_timestamp;
4051*0a6a1f1dSLionel Sambuc
4052*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
4053*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
4054*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_base = 0;
4055*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4056*0a6a1f1dSLionel Sambuc
4057*0a6a1f1dSLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
4058*0a6a1f1dSLionel Sambuc return xcb_ret;
4059*0a6a1f1dSLionel Sambuc }
4060*0a6a1f1dSLionel Sambuc
4061*0a6a1f1dSLionel Sambuc xcb_void_cookie_t
xcb_randr_set_provider_output_source(xcb_connection_t * c,xcb_randr_provider_t provider,xcb_randr_provider_t source_provider,xcb_timestamp_t config_timestamp)4062*0a6a1f1dSLionel Sambuc xcb_randr_set_provider_output_source (xcb_connection_t *c /**< */,
4063*0a6a1f1dSLionel Sambuc xcb_randr_provider_t provider /**< */,
4064*0a6a1f1dSLionel Sambuc xcb_randr_provider_t source_provider /**< */,
4065*0a6a1f1dSLionel Sambuc xcb_timestamp_t config_timestamp /**< */)
4066*0a6a1f1dSLionel Sambuc {
4067*0a6a1f1dSLionel Sambuc static const xcb_protocol_request_t xcb_req = {
4068*0a6a1f1dSLionel Sambuc /* count */ 2,
4069*0a6a1f1dSLionel Sambuc /* ext */ &xcb_randr_id,
4070*0a6a1f1dSLionel Sambuc /* opcode */ XCB_RANDR_SET_PROVIDER_OUTPUT_SOURCE,
4071*0a6a1f1dSLionel Sambuc /* isvoid */ 1
4072*0a6a1f1dSLionel Sambuc };
4073*0a6a1f1dSLionel Sambuc
4074*0a6a1f1dSLionel Sambuc struct iovec xcb_parts[4];
4075*0a6a1f1dSLionel Sambuc xcb_void_cookie_t xcb_ret;
4076*0a6a1f1dSLionel Sambuc xcb_randr_set_provider_output_source_request_t xcb_out;
4077*0a6a1f1dSLionel Sambuc
4078*0a6a1f1dSLionel Sambuc xcb_out.provider = provider;
4079*0a6a1f1dSLionel Sambuc xcb_out.source_provider = source_provider;
4080*0a6a1f1dSLionel Sambuc xcb_out.config_timestamp = config_timestamp;
4081*0a6a1f1dSLionel Sambuc
4082*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
4083*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
4084*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_base = 0;
4085*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4086*0a6a1f1dSLionel Sambuc
4087*0a6a1f1dSLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
4088*0a6a1f1dSLionel Sambuc return xcb_ret;
4089*0a6a1f1dSLionel Sambuc }
4090*0a6a1f1dSLionel Sambuc
4091*0a6a1f1dSLionel Sambuc int
xcb_randr_list_provider_properties_sizeof(const void * _buffer)4092*0a6a1f1dSLionel Sambuc xcb_randr_list_provider_properties_sizeof (const void *_buffer /**< */)
4093*0a6a1f1dSLionel Sambuc {
4094*0a6a1f1dSLionel Sambuc char *xcb_tmp = (char *)_buffer;
4095*0a6a1f1dSLionel Sambuc const xcb_randr_list_provider_properties_reply_t *_aux = (xcb_randr_list_provider_properties_reply_t *)_buffer;
4096*0a6a1f1dSLionel Sambuc unsigned int xcb_buffer_len = 0;
4097*0a6a1f1dSLionel Sambuc unsigned int xcb_block_len = 0;
4098*0a6a1f1dSLionel Sambuc unsigned int xcb_pad = 0;
4099*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
4100*0a6a1f1dSLionel Sambuc
4101*0a6a1f1dSLionel Sambuc
4102*0a6a1f1dSLionel Sambuc xcb_block_len += sizeof(xcb_randr_list_provider_properties_reply_t);
4103*0a6a1f1dSLionel Sambuc xcb_tmp += xcb_block_len;
4104*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len;
4105*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
4106*0a6a1f1dSLionel Sambuc /* atoms */
4107*0a6a1f1dSLionel Sambuc xcb_block_len += _aux->num_atoms * sizeof(xcb_atom_t);
4108*0a6a1f1dSLionel Sambuc xcb_tmp += xcb_block_len;
4109*0a6a1f1dSLionel Sambuc xcb_align_to = ALIGNOF(xcb_atom_t);
4110*0a6a1f1dSLionel Sambuc /* insert padding */
4111*0a6a1f1dSLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4112*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
4113*0a6a1f1dSLionel Sambuc if (0 != xcb_pad) {
4114*0a6a1f1dSLionel Sambuc xcb_tmp += xcb_pad;
4115*0a6a1f1dSLionel Sambuc xcb_pad = 0;
4116*0a6a1f1dSLionel Sambuc }
4117*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
4118*0a6a1f1dSLionel Sambuc
4119*0a6a1f1dSLionel Sambuc return xcb_buffer_len;
4120*0a6a1f1dSLionel Sambuc }
4121*0a6a1f1dSLionel Sambuc
4122*0a6a1f1dSLionel Sambuc xcb_randr_list_provider_properties_cookie_t
xcb_randr_list_provider_properties(xcb_connection_t * c,xcb_randr_provider_t provider)4123*0a6a1f1dSLionel Sambuc xcb_randr_list_provider_properties (xcb_connection_t *c /**< */,
4124*0a6a1f1dSLionel Sambuc xcb_randr_provider_t provider /**< */)
4125*0a6a1f1dSLionel Sambuc {
4126*0a6a1f1dSLionel Sambuc static const xcb_protocol_request_t xcb_req = {
4127*0a6a1f1dSLionel Sambuc /* count */ 2,
4128*0a6a1f1dSLionel Sambuc /* ext */ &xcb_randr_id,
4129*0a6a1f1dSLionel Sambuc /* opcode */ XCB_RANDR_LIST_PROVIDER_PROPERTIES,
4130*0a6a1f1dSLionel Sambuc /* isvoid */ 0
4131*0a6a1f1dSLionel Sambuc };
4132*0a6a1f1dSLionel Sambuc
4133*0a6a1f1dSLionel Sambuc struct iovec xcb_parts[4];
4134*0a6a1f1dSLionel Sambuc xcb_randr_list_provider_properties_cookie_t xcb_ret;
4135*0a6a1f1dSLionel Sambuc xcb_randr_list_provider_properties_request_t xcb_out;
4136*0a6a1f1dSLionel Sambuc
4137*0a6a1f1dSLionel Sambuc xcb_out.provider = provider;
4138*0a6a1f1dSLionel Sambuc
4139*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
4140*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
4141*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_base = 0;
4142*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4143*0a6a1f1dSLionel Sambuc
4144*0a6a1f1dSLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
4145*0a6a1f1dSLionel Sambuc return xcb_ret;
4146*0a6a1f1dSLionel Sambuc }
4147*0a6a1f1dSLionel Sambuc
4148*0a6a1f1dSLionel Sambuc xcb_randr_list_provider_properties_cookie_t
xcb_randr_list_provider_properties_unchecked(xcb_connection_t * c,xcb_randr_provider_t provider)4149*0a6a1f1dSLionel Sambuc xcb_randr_list_provider_properties_unchecked (xcb_connection_t *c /**< */,
4150*0a6a1f1dSLionel Sambuc xcb_randr_provider_t provider /**< */)
4151*0a6a1f1dSLionel Sambuc {
4152*0a6a1f1dSLionel Sambuc static const xcb_protocol_request_t xcb_req = {
4153*0a6a1f1dSLionel Sambuc /* count */ 2,
4154*0a6a1f1dSLionel Sambuc /* ext */ &xcb_randr_id,
4155*0a6a1f1dSLionel Sambuc /* opcode */ XCB_RANDR_LIST_PROVIDER_PROPERTIES,
4156*0a6a1f1dSLionel Sambuc /* isvoid */ 0
4157*0a6a1f1dSLionel Sambuc };
4158*0a6a1f1dSLionel Sambuc
4159*0a6a1f1dSLionel Sambuc struct iovec xcb_parts[4];
4160*0a6a1f1dSLionel Sambuc xcb_randr_list_provider_properties_cookie_t xcb_ret;
4161*0a6a1f1dSLionel Sambuc xcb_randr_list_provider_properties_request_t xcb_out;
4162*0a6a1f1dSLionel Sambuc
4163*0a6a1f1dSLionel Sambuc xcb_out.provider = provider;
4164*0a6a1f1dSLionel Sambuc
4165*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
4166*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
4167*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_base = 0;
4168*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4169*0a6a1f1dSLionel Sambuc
4170*0a6a1f1dSLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
4171*0a6a1f1dSLionel Sambuc return xcb_ret;
4172*0a6a1f1dSLionel Sambuc }
4173*0a6a1f1dSLionel Sambuc
4174*0a6a1f1dSLionel Sambuc xcb_atom_t *
xcb_randr_list_provider_properties_atoms(const xcb_randr_list_provider_properties_reply_t * R)4175*0a6a1f1dSLionel Sambuc xcb_randr_list_provider_properties_atoms (const xcb_randr_list_provider_properties_reply_t *R /**< */)
4176*0a6a1f1dSLionel Sambuc {
4177*0a6a1f1dSLionel Sambuc return (xcb_atom_t *) (R + 1);
4178*0a6a1f1dSLionel Sambuc }
4179*0a6a1f1dSLionel Sambuc
4180*0a6a1f1dSLionel Sambuc int
xcb_randr_list_provider_properties_atoms_length(const xcb_randr_list_provider_properties_reply_t * R)4181*0a6a1f1dSLionel Sambuc xcb_randr_list_provider_properties_atoms_length (const xcb_randr_list_provider_properties_reply_t *R /**< */)
4182*0a6a1f1dSLionel Sambuc {
4183*0a6a1f1dSLionel Sambuc return R->num_atoms;
4184*0a6a1f1dSLionel Sambuc }
4185*0a6a1f1dSLionel Sambuc
4186*0a6a1f1dSLionel Sambuc xcb_generic_iterator_t
xcb_randr_list_provider_properties_atoms_end(const xcb_randr_list_provider_properties_reply_t * R)4187*0a6a1f1dSLionel Sambuc xcb_randr_list_provider_properties_atoms_end (const xcb_randr_list_provider_properties_reply_t *R /**< */)
4188*0a6a1f1dSLionel Sambuc {
4189*0a6a1f1dSLionel Sambuc xcb_generic_iterator_t i;
4190*0a6a1f1dSLionel Sambuc i.data = ((xcb_atom_t *) (R + 1)) + (R->num_atoms);
4191*0a6a1f1dSLionel Sambuc i.rem = 0;
4192*0a6a1f1dSLionel Sambuc i.index = (char *) i.data - (char *) R;
4193*0a6a1f1dSLionel Sambuc return i;
4194*0a6a1f1dSLionel Sambuc }
4195*0a6a1f1dSLionel Sambuc
4196*0a6a1f1dSLionel Sambuc xcb_randr_list_provider_properties_reply_t *
xcb_randr_list_provider_properties_reply(xcb_connection_t * c,xcb_randr_list_provider_properties_cookie_t cookie,xcb_generic_error_t ** e)4197*0a6a1f1dSLionel Sambuc xcb_randr_list_provider_properties_reply (xcb_connection_t *c /**< */,
4198*0a6a1f1dSLionel Sambuc xcb_randr_list_provider_properties_cookie_t cookie /**< */,
4199*0a6a1f1dSLionel Sambuc xcb_generic_error_t **e /**< */)
4200*0a6a1f1dSLionel Sambuc {
4201*0a6a1f1dSLionel Sambuc return (xcb_randr_list_provider_properties_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
4202*0a6a1f1dSLionel Sambuc }
4203*0a6a1f1dSLionel Sambuc
4204*0a6a1f1dSLionel Sambuc int
xcb_randr_query_provider_property_sizeof(const void * _buffer)4205*0a6a1f1dSLionel Sambuc xcb_randr_query_provider_property_sizeof (const void *_buffer /**< */)
4206*0a6a1f1dSLionel Sambuc {
4207*0a6a1f1dSLionel Sambuc char *xcb_tmp = (char *)_buffer;
4208*0a6a1f1dSLionel Sambuc const xcb_randr_query_provider_property_reply_t *_aux = (xcb_randr_query_provider_property_reply_t *)_buffer;
4209*0a6a1f1dSLionel Sambuc unsigned int xcb_buffer_len = 0;
4210*0a6a1f1dSLionel Sambuc unsigned int xcb_block_len = 0;
4211*0a6a1f1dSLionel Sambuc unsigned int xcb_pad = 0;
4212*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
4213*0a6a1f1dSLionel Sambuc
4214*0a6a1f1dSLionel Sambuc
4215*0a6a1f1dSLionel Sambuc xcb_block_len += sizeof(xcb_randr_query_provider_property_reply_t);
4216*0a6a1f1dSLionel Sambuc xcb_tmp += xcb_block_len;
4217*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len;
4218*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
4219*0a6a1f1dSLionel Sambuc /* valid_values */
4220*0a6a1f1dSLionel Sambuc xcb_block_len += _aux->length * sizeof(int32_t);
4221*0a6a1f1dSLionel Sambuc xcb_tmp += xcb_block_len;
4222*0a6a1f1dSLionel Sambuc xcb_align_to = ALIGNOF(int32_t);
4223*0a6a1f1dSLionel Sambuc /* insert padding */
4224*0a6a1f1dSLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4225*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
4226*0a6a1f1dSLionel Sambuc if (0 != xcb_pad) {
4227*0a6a1f1dSLionel Sambuc xcb_tmp += xcb_pad;
4228*0a6a1f1dSLionel Sambuc xcb_pad = 0;
4229*0a6a1f1dSLionel Sambuc }
4230*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
4231*0a6a1f1dSLionel Sambuc
4232*0a6a1f1dSLionel Sambuc return xcb_buffer_len;
4233*0a6a1f1dSLionel Sambuc }
4234*0a6a1f1dSLionel Sambuc
4235*0a6a1f1dSLionel Sambuc xcb_randr_query_provider_property_cookie_t
xcb_randr_query_provider_property(xcb_connection_t * c,xcb_randr_provider_t provider,xcb_atom_t property)4236*0a6a1f1dSLionel Sambuc xcb_randr_query_provider_property (xcb_connection_t *c /**< */,
4237*0a6a1f1dSLionel Sambuc xcb_randr_provider_t provider /**< */,
4238*0a6a1f1dSLionel Sambuc xcb_atom_t property /**< */)
4239*0a6a1f1dSLionel Sambuc {
4240*0a6a1f1dSLionel Sambuc static const xcb_protocol_request_t xcb_req = {
4241*0a6a1f1dSLionel Sambuc /* count */ 2,
4242*0a6a1f1dSLionel Sambuc /* ext */ &xcb_randr_id,
4243*0a6a1f1dSLionel Sambuc /* opcode */ XCB_RANDR_QUERY_PROVIDER_PROPERTY,
4244*0a6a1f1dSLionel Sambuc /* isvoid */ 0
4245*0a6a1f1dSLionel Sambuc };
4246*0a6a1f1dSLionel Sambuc
4247*0a6a1f1dSLionel Sambuc struct iovec xcb_parts[4];
4248*0a6a1f1dSLionel Sambuc xcb_randr_query_provider_property_cookie_t xcb_ret;
4249*0a6a1f1dSLionel Sambuc xcb_randr_query_provider_property_request_t xcb_out;
4250*0a6a1f1dSLionel Sambuc
4251*0a6a1f1dSLionel Sambuc xcb_out.provider = provider;
4252*0a6a1f1dSLionel Sambuc xcb_out.property = property;
4253*0a6a1f1dSLionel Sambuc
4254*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
4255*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
4256*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_base = 0;
4257*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4258*0a6a1f1dSLionel Sambuc
4259*0a6a1f1dSLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
4260*0a6a1f1dSLionel Sambuc return xcb_ret;
4261*0a6a1f1dSLionel Sambuc }
4262*0a6a1f1dSLionel Sambuc
4263*0a6a1f1dSLionel Sambuc xcb_randr_query_provider_property_cookie_t
xcb_randr_query_provider_property_unchecked(xcb_connection_t * c,xcb_randr_provider_t provider,xcb_atom_t property)4264*0a6a1f1dSLionel Sambuc xcb_randr_query_provider_property_unchecked (xcb_connection_t *c /**< */,
4265*0a6a1f1dSLionel Sambuc xcb_randr_provider_t provider /**< */,
4266*0a6a1f1dSLionel Sambuc xcb_atom_t property /**< */)
4267*0a6a1f1dSLionel Sambuc {
4268*0a6a1f1dSLionel Sambuc static const xcb_protocol_request_t xcb_req = {
4269*0a6a1f1dSLionel Sambuc /* count */ 2,
4270*0a6a1f1dSLionel Sambuc /* ext */ &xcb_randr_id,
4271*0a6a1f1dSLionel Sambuc /* opcode */ XCB_RANDR_QUERY_PROVIDER_PROPERTY,
4272*0a6a1f1dSLionel Sambuc /* isvoid */ 0
4273*0a6a1f1dSLionel Sambuc };
4274*0a6a1f1dSLionel Sambuc
4275*0a6a1f1dSLionel Sambuc struct iovec xcb_parts[4];
4276*0a6a1f1dSLionel Sambuc xcb_randr_query_provider_property_cookie_t xcb_ret;
4277*0a6a1f1dSLionel Sambuc xcb_randr_query_provider_property_request_t xcb_out;
4278*0a6a1f1dSLionel Sambuc
4279*0a6a1f1dSLionel Sambuc xcb_out.provider = provider;
4280*0a6a1f1dSLionel Sambuc xcb_out.property = property;
4281*0a6a1f1dSLionel Sambuc
4282*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
4283*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
4284*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_base = 0;
4285*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4286*0a6a1f1dSLionel Sambuc
4287*0a6a1f1dSLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
4288*0a6a1f1dSLionel Sambuc return xcb_ret;
4289*0a6a1f1dSLionel Sambuc }
4290*0a6a1f1dSLionel Sambuc
4291*0a6a1f1dSLionel Sambuc int32_t *
xcb_randr_query_provider_property_valid_values(const xcb_randr_query_provider_property_reply_t * R)4292*0a6a1f1dSLionel Sambuc xcb_randr_query_provider_property_valid_values (const xcb_randr_query_provider_property_reply_t *R /**< */)
4293*0a6a1f1dSLionel Sambuc {
4294*0a6a1f1dSLionel Sambuc return (int32_t *) (R + 1);
4295*0a6a1f1dSLionel Sambuc }
4296*0a6a1f1dSLionel Sambuc
4297*0a6a1f1dSLionel Sambuc int
xcb_randr_query_provider_property_valid_values_length(const xcb_randr_query_provider_property_reply_t * R)4298*0a6a1f1dSLionel Sambuc xcb_randr_query_provider_property_valid_values_length (const xcb_randr_query_provider_property_reply_t *R /**< */)
4299*0a6a1f1dSLionel Sambuc {
4300*0a6a1f1dSLionel Sambuc return R->length;
4301*0a6a1f1dSLionel Sambuc }
4302*0a6a1f1dSLionel Sambuc
4303*0a6a1f1dSLionel Sambuc xcb_generic_iterator_t
xcb_randr_query_provider_property_valid_values_end(const xcb_randr_query_provider_property_reply_t * R)4304*0a6a1f1dSLionel Sambuc xcb_randr_query_provider_property_valid_values_end (const xcb_randr_query_provider_property_reply_t *R /**< */)
4305*0a6a1f1dSLionel Sambuc {
4306*0a6a1f1dSLionel Sambuc xcb_generic_iterator_t i;
4307*0a6a1f1dSLionel Sambuc i.data = ((int32_t *) (R + 1)) + (R->length);
4308*0a6a1f1dSLionel Sambuc i.rem = 0;
4309*0a6a1f1dSLionel Sambuc i.index = (char *) i.data - (char *) R;
4310*0a6a1f1dSLionel Sambuc return i;
4311*0a6a1f1dSLionel Sambuc }
4312*0a6a1f1dSLionel Sambuc
4313*0a6a1f1dSLionel Sambuc xcb_randr_query_provider_property_reply_t *
xcb_randr_query_provider_property_reply(xcb_connection_t * c,xcb_randr_query_provider_property_cookie_t cookie,xcb_generic_error_t ** e)4314*0a6a1f1dSLionel Sambuc xcb_randr_query_provider_property_reply (xcb_connection_t *c /**< */,
4315*0a6a1f1dSLionel Sambuc xcb_randr_query_provider_property_cookie_t cookie /**< */,
4316*0a6a1f1dSLionel Sambuc xcb_generic_error_t **e /**< */)
4317*0a6a1f1dSLionel Sambuc {
4318*0a6a1f1dSLionel Sambuc return (xcb_randr_query_provider_property_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
4319*0a6a1f1dSLionel Sambuc }
4320*0a6a1f1dSLionel Sambuc
4321*0a6a1f1dSLionel Sambuc int
xcb_randr_configure_provider_property_sizeof(const void * _buffer,uint32_t values_len)4322*0a6a1f1dSLionel Sambuc xcb_randr_configure_provider_property_sizeof (const void *_buffer /**< */,
4323*0a6a1f1dSLionel Sambuc uint32_t values_len /**< */)
4324*0a6a1f1dSLionel Sambuc {
4325*0a6a1f1dSLionel Sambuc char *xcb_tmp = (char *)_buffer;
4326*0a6a1f1dSLionel Sambuc unsigned int xcb_buffer_len = 0;
4327*0a6a1f1dSLionel Sambuc unsigned int xcb_block_len = 0;
4328*0a6a1f1dSLionel Sambuc unsigned int xcb_pad = 0;
4329*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
4330*0a6a1f1dSLionel Sambuc
4331*0a6a1f1dSLionel Sambuc
4332*0a6a1f1dSLionel Sambuc xcb_block_len += sizeof(xcb_randr_configure_provider_property_request_t);
4333*0a6a1f1dSLionel Sambuc xcb_tmp += xcb_block_len;
4334*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len;
4335*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
4336*0a6a1f1dSLionel Sambuc /* values */
4337*0a6a1f1dSLionel Sambuc xcb_block_len += values_len * sizeof(int32_t);
4338*0a6a1f1dSLionel Sambuc xcb_tmp += xcb_block_len;
4339*0a6a1f1dSLionel Sambuc xcb_align_to = ALIGNOF(int32_t);
4340*0a6a1f1dSLionel Sambuc /* insert padding */
4341*0a6a1f1dSLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4342*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
4343*0a6a1f1dSLionel Sambuc if (0 != xcb_pad) {
4344*0a6a1f1dSLionel Sambuc xcb_tmp += xcb_pad;
4345*0a6a1f1dSLionel Sambuc xcb_pad = 0;
4346*0a6a1f1dSLionel Sambuc }
4347*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
4348*0a6a1f1dSLionel Sambuc
4349*0a6a1f1dSLionel Sambuc return xcb_buffer_len;
4350*0a6a1f1dSLionel Sambuc }
4351*0a6a1f1dSLionel Sambuc
4352*0a6a1f1dSLionel Sambuc xcb_void_cookie_t
xcb_randr_configure_provider_property_checked(xcb_connection_t * c,xcb_randr_provider_t provider,xcb_atom_t property,uint8_t pending,uint8_t range,uint32_t values_len,const int32_t * values)4353*0a6a1f1dSLionel Sambuc xcb_randr_configure_provider_property_checked (xcb_connection_t *c /**< */,
4354*0a6a1f1dSLionel Sambuc xcb_randr_provider_t provider /**< */,
4355*0a6a1f1dSLionel Sambuc xcb_atom_t property /**< */,
4356*0a6a1f1dSLionel Sambuc uint8_t pending /**< */,
4357*0a6a1f1dSLionel Sambuc uint8_t range /**< */,
4358*0a6a1f1dSLionel Sambuc uint32_t values_len /**< */,
4359*0a6a1f1dSLionel Sambuc const int32_t *values /**< */)
4360*0a6a1f1dSLionel Sambuc {
4361*0a6a1f1dSLionel Sambuc static const xcb_protocol_request_t xcb_req = {
4362*0a6a1f1dSLionel Sambuc /* count */ 4,
4363*0a6a1f1dSLionel Sambuc /* ext */ &xcb_randr_id,
4364*0a6a1f1dSLionel Sambuc /* opcode */ XCB_RANDR_CONFIGURE_PROVIDER_PROPERTY,
4365*0a6a1f1dSLionel Sambuc /* isvoid */ 1
4366*0a6a1f1dSLionel Sambuc };
4367*0a6a1f1dSLionel Sambuc
4368*0a6a1f1dSLionel Sambuc struct iovec xcb_parts[6];
4369*0a6a1f1dSLionel Sambuc xcb_void_cookie_t xcb_ret;
4370*0a6a1f1dSLionel Sambuc xcb_randr_configure_provider_property_request_t xcb_out;
4371*0a6a1f1dSLionel Sambuc
4372*0a6a1f1dSLionel Sambuc xcb_out.provider = provider;
4373*0a6a1f1dSLionel Sambuc xcb_out.property = property;
4374*0a6a1f1dSLionel Sambuc xcb_out.pending = pending;
4375*0a6a1f1dSLionel Sambuc xcb_out.range = range;
4376*0a6a1f1dSLionel Sambuc memset(xcb_out.pad0, 0, 2);
4377*0a6a1f1dSLionel Sambuc
4378*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
4379*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
4380*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_base = 0;
4381*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4382*0a6a1f1dSLionel Sambuc /* int32_t values */
4383*0a6a1f1dSLionel Sambuc xcb_parts[4].iov_base = (char *) values;
4384*0a6a1f1dSLionel Sambuc xcb_parts[4].iov_len = values_len * sizeof(int32_t);
4385*0a6a1f1dSLionel Sambuc xcb_parts[5].iov_base = 0;
4386*0a6a1f1dSLionel Sambuc xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
4387*0a6a1f1dSLionel Sambuc
4388*0a6a1f1dSLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
4389*0a6a1f1dSLionel Sambuc return xcb_ret;
4390*0a6a1f1dSLionel Sambuc }
4391*0a6a1f1dSLionel Sambuc
4392*0a6a1f1dSLionel Sambuc xcb_void_cookie_t
xcb_randr_configure_provider_property(xcb_connection_t * c,xcb_randr_provider_t provider,xcb_atom_t property,uint8_t pending,uint8_t range,uint32_t values_len,const int32_t * values)4393*0a6a1f1dSLionel Sambuc xcb_randr_configure_provider_property (xcb_connection_t *c /**< */,
4394*0a6a1f1dSLionel Sambuc xcb_randr_provider_t provider /**< */,
4395*0a6a1f1dSLionel Sambuc xcb_atom_t property /**< */,
4396*0a6a1f1dSLionel Sambuc uint8_t pending /**< */,
4397*0a6a1f1dSLionel Sambuc uint8_t range /**< */,
4398*0a6a1f1dSLionel Sambuc uint32_t values_len /**< */,
4399*0a6a1f1dSLionel Sambuc const int32_t *values /**< */)
4400*0a6a1f1dSLionel Sambuc {
4401*0a6a1f1dSLionel Sambuc static const xcb_protocol_request_t xcb_req = {
4402*0a6a1f1dSLionel Sambuc /* count */ 4,
4403*0a6a1f1dSLionel Sambuc /* ext */ &xcb_randr_id,
4404*0a6a1f1dSLionel Sambuc /* opcode */ XCB_RANDR_CONFIGURE_PROVIDER_PROPERTY,
4405*0a6a1f1dSLionel Sambuc /* isvoid */ 1
4406*0a6a1f1dSLionel Sambuc };
4407*0a6a1f1dSLionel Sambuc
4408*0a6a1f1dSLionel Sambuc struct iovec xcb_parts[6];
4409*0a6a1f1dSLionel Sambuc xcb_void_cookie_t xcb_ret;
4410*0a6a1f1dSLionel Sambuc xcb_randr_configure_provider_property_request_t xcb_out;
4411*0a6a1f1dSLionel Sambuc
4412*0a6a1f1dSLionel Sambuc xcb_out.provider = provider;
4413*0a6a1f1dSLionel Sambuc xcb_out.property = property;
4414*0a6a1f1dSLionel Sambuc xcb_out.pending = pending;
4415*0a6a1f1dSLionel Sambuc xcb_out.range = range;
4416*0a6a1f1dSLionel Sambuc memset(xcb_out.pad0, 0, 2);
4417*0a6a1f1dSLionel Sambuc
4418*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
4419*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
4420*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_base = 0;
4421*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4422*0a6a1f1dSLionel Sambuc /* int32_t values */
4423*0a6a1f1dSLionel Sambuc xcb_parts[4].iov_base = (char *) values;
4424*0a6a1f1dSLionel Sambuc xcb_parts[4].iov_len = values_len * sizeof(int32_t);
4425*0a6a1f1dSLionel Sambuc xcb_parts[5].iov_base = 0;
4426*0a6a1f1dSLionel Sambuc xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
4427*0a6a1f1dSLionel Sambuc
4428*0a6a1f1dSLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
4429*0a6a1f1dSLionel Sambuc return xcb_ret;
4430*0a6a1f1dSLionel Sambuc }
4431*0a6a1f1dSLionel Sambuc
4432*0a6a1f1dSLionel Sambuc int
xcb_randr_change_provider_property_sizeof(const void * _buffer)4433*0a6a1f1dSLionel Sambuc xcb_randr_change_provider_property_sizeof (const void *_buffer /**< */)
4434*0a6a1f1dSLionel Sambuc {
4435*0a6a1f1dSLionel Sambuc char *xcb_tmp = (char *)_buffer;
4436*0a6a1f1dSLionel Sambuc const xcb_randr_change_provider_property_request_t *_aux = (xcb_randr_change_provider_property_request_t *)_buffer;
4437*0a6a1f1dSLionel Sambuc unsigned int xcb_buffer_len = 0;
4438*0a6a1f1dSLionel Sambuc unsigned int xcb_block_len = 0;
4439*0a6a1f1dSLionel Sambuc unsigned int xcb_pad = 0;
4440*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
4441*0a6a1f1dSLionel Sambuc
4442*0a6a1f1dSLionel Sambuc
4443*0a6a1f1dSLionel Sambuc xcb_block_len += sizeof(xcb_randr_change_provider_property_request_t);
4444*0a6a1f1dSLionel Sambuc xcb_tmp += xcb_block_len;
4445*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len;
4446*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
4447*0a6a1f1dSLionel Sambuc /* data */
4448*0a6a1f1dSLionel Sambuc xcb_block_len += (_aux->num_items * (_aux->format / 8)) * sizeof(char);
4449*0a6a1f1dSLionel Sambuc xcb_tmp += xcb_block_len;
4450*0a6a1f1dSLionel Sambuc xcb_align_to = ALIGNOF(char);
4451*0a6a1f1dSLionel Sambuc /* insert padding */
4452*0a6a1f1dSLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4453*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
4454*0a6a1f1dSLionel Sambuc if (0 != xcb_pad) {
4455*0a6a1f1dSLionel Sambuc xcb_tmp += xcb_pad;
4456*0a6a1f1dSLionel Sambuc xcb_pad = 0;
4457*0a6a1f1dSLionel Sambuc }
4458*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
4459*0a6a1f1dSLionel Sambuc
4460*0a6a1f1dSLionel Sambuc return xcb_buffer_len;
4461*0a6a1f1dSLionel Sambuc }
4462*0a6a1f1dSLionel Sambuc
4463*0a6a1f1dSLionel Sambuc xcb_void_cookie_t
xcb_randr_change_provider_property_checked(xcb_connection_t * c,xcb_randr_provider_t provider,xcb_atom_t property,xcb_atom_t type,uint8_t format,uint8_t mode,uint32_t num_items,const void * data)4464*0a6a1f1dSLionel Sambuc xcb_randr_change_provider_property_checked (xcb_connection_t *c /**< */,
4465*0a6a1f1dSLionel Sambuc xcb_randr_provider_t provider /**< */,
4466*0a6a1f1dSLionel Sambuc xcb_atom_t property /**< */,
4467*0a6a1f1dSLionel Sambuc xcb_atom_t type /**< */,
4468*0a6a1f1dSLionel Sambuc uint8_t format /**< */,
4469*0a6a1f1dSLionel Sambuc uint8_t mode /**< */,
4470*0a6a1f1dSLionel Sambuc uint32_t num_items /**< */,
4471*0a6a1f1dSLionel Sambuc const void *data /**< */)
4472*0a6a1f1dSLionel Sambuc {
4473*0a6a1f1dSLionel Sambuc static const xcb_protocol_request_t xcb_req = {
4474*0a6a1f1dSLionel Sambuc /* count */ 4,
4475*0a6a1f1dSLionel Sambuc /* ext */ &xcb_randr_id,
4476*0a6a1f1dSLionel Sambuc /* opcode */ XCB_RANDR_CHANGE_PROVIDER_PROPERTY,
4477*0a6a1f1dSLionel Sambuc /* isvoid */ 1
4478*0a6a1f1dSLionel Sambuc };
4479*0a6a1f1dSLionel Sambuc
4480*0a6a1f1dSLionel Sambuc struct iovec xcb_parts[6];
4481*0a6a1f1dSLionel Sambuc xcb_void_cookie_t xcb_ret;
4482*0a6a1f1dSLionel Sambuc xcb_randr_change_provider_property_request_t xcb_out;
4483*0a6a1f1dSLionel Sambuc
4484*0a6a1f1dSLionel Sambuc xcb_out.provider = provider;
4485*0a6a1f1dSLionel Sambuc xcb_out.property = property;
4486*0a6a1f1dSLionel Sambuc xcb_out.type = type;
4487*0a6a1f1dSLionel Sambuc xcb_out.format = format;
4488*0a6a1f1dSLionel Sambuc xcb_out.mode = mode;
4489*0a6a1f1dSLionel Sambuc memset(xcb_out.pad0, 0, 2);
4490*0a6a1f1dSLionel Sambuc xcb_out.num_items = num_items;
4491*0a6a1f1dSLionel Sambuc
4492*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
4493*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
4494*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_base = 0;
4495*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4496*0a6a1f1dSLionel Sambuc /* void data */
4497*0a6a1f1dSLionel Sambuc xcb_parts[4].iov_base = (char *) data;
4498*0a6a1f1dSLionel Sambuc xcb_parts[4].iov_len = (num_items * (format / 8)) * sizeof(char);
4499*0a6a1f1dSLionel Sambuc xcb_parts[5].iov_base = 0;
4500*0a6a1f1dSLionel Sambuc xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
4501*0a6a1f1dSLionel Sambuc
4502*0a6a1f1dSLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
4503*0a6a1f1dSLionel Sambuc return xcb_ret;
4504*0a6a1f1dSLionel Sambuc }
4505*0a6a1f1dSLionel Sambuc
4506*0a6a1f1dSLionel Sambuc xcb_void_cookie_t
xcb_randr_change_provider_property(xcb_connection_t * c,xcb_randr_provider_t provider,xcb_atom_t property,xcb_atom_t type,uint8_t format,uint8_t mode,uint32_t num_items,const void * data)4507*0a6a1f1dSLionel Sambuc xcb_randr_change_provider_property (xcb_connection_t *c /**< */,
4508*0a6a1f1dSLionel Sambuc xcb_randr_provider_t provider /**< */,
4509*0a6a1f1dSLionel Sambuc xcb_atom_t property /**< */,
4510*0a6a1f1dSLionel Sambuc xcb_atom_t type /**< */,
4511*0a6a1f1dSLionel Sambuc uint8_t format /**< */,
4512*0a6a1f1dSLionel Sambuc uint8_t mode /**< */,
4513*0a6a1f1dSLionel Sambuc uint32_t num_items /**< */,
4514*0a6a1f1dSLionel Sambuc const void *data /**< */)
4515*0a6a1f1dSLionel Sambuc {
4516*0a6a1f1dSLionel Sambuc static const xcb_protocol_request_t xcb_req = {
4517*0a6a1f1dSLionel Sambuc /* count */ 4,
4518*0a6a1f1dSLionel Sambuc /* ext */ &xcb_randr_id,
4519*0a6a1f1dSLionel Sambuc /* opcode */ XCB_RANDR_CHANGE_PROVIDER_PROPERTY,
4520*0a6a1f1dSLionel Sambuc /* isvoid */ 1
4521*0a6a1f1dSLionel Sambuc };
4522*0a6a1f1dSLionel Sambuc
4523*0a6a1f1dSLionel Sambuc struct iovec xcb_parts[6];
4524*0a6a1f1dSLionel Sambuc xcb_void_cookie_t xcb_ret;
4525*0a6a1f1dSLionel Sambuc xcb_randr_change_provider_property_request_t xcb_out;
4526*0a6a1f1dSLionel Sambuc
4527*0a6a1f1dSLionel Sambuc xcb_out.provider = provider;
4528*0a6a1f1dSLionel Sambuc xcb_out.property = property;
4529*0a6a1f1dSLionel Sambuc xcb_out.type = type;
4530*0a6a1f1dSLionel Sambuc xcb_out.format = format;
4531*0a6a1f1dSLionel Sambuc xcb_out.mode = mode;
4532*0a6a1f1dSLionel Sambuc memset(xcb_out.pad0, 0, 2);
4533*0a6a1f1dSLionel Sambuc xcb_out.num_items = num_items;
4534*0a6a1f1dSLionel Sambuc
4535*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
4536*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
4537*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_base = 0;
4538*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4539*0a6a1f1dSLionel Sambuc /* void data */
4540*0a6a1f1dSLionel Sambuc xcb_parts[4].iov_base = (char *) data;
4541*0a6a1f1dSLionel Sambuc xcb_parts[4].iov_len = (num_items * (format / 8)) * sizeof(char);
4542*0a6a1f1dSLionel Sambuc xcb_parts[5].iov_base = 0;
4543*0a6a1f1dSLionel Sambuc xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
4544*0a6a1f1dSLionel Sambuc
4545*0a6a1f1dSLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
4546*0a6a1f1dSLionel Sambuc return xcb_ret;
4547*0a6a1f1dSLionel Sambuc }
4548*0a6a1f1dSLionel Sambuc
4549*0a6a1f1dSLionel Sambuc xcb_void_cookie_t
xcb_randr_delete_provider_property_checked(xcb_connection_t * c,xcb_randr_provider_t provider,xcb_atom_t property)4550*0a6a1f1dSLionel Sambuc xcb_randr_delete_provider_property_checked (xcb_connection_t *c /**< */,
4551*0a6a1f1dSLionel Sambuc xcb_randr_provider_t provider /**< */,
4552*0a6a1f1dSLionel Sambuc xcb_atom_t property /**< */)
4553*0a6a1f1dSLionel Sambuc {
4554*0a6a1f1dSLionel Sambuc static const xcb_protocol_request_t xcb_req = {
4555*0a6a1f1dSLionel Sambuc /* count */ 2,
4556*0a6a1f1dSLionel Sambuc /* ext */ &xcb_randr_id,
4557*0a6a1f1dSLionel Sambuc /* opcode */ XCB_RANDR_DELETE_PROVIDER_PROPERTY,
4558*0a6a1f1dSLionel Sambuc /* isvoid */ 1
4559*0a6a1f1dSLionel Sambuc };
4560*0a6a1f1dSLionel Sambuc
4561*0a6a1f1dSLionel Sambuc struct iovec xcb_parts[4];
4562*0a6a1f1dSLionel Sambuc xcb_void_cookie_t xcb_ret;
4563*0a6a1f1dSLionel Sambuc xcb_randr_delete_provider_property_request_t xcb_out;
4564*0a6a1f1dSLionel Sambuc
4565*0a6a1f1dSLionel Sambuc xcb_out.provider = provider;
4566*0a6a1f1dSLionel Sambuc xcb_out.property = property;
4567*0a6a1f1dSLionel Sambuc
4568*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
4569*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
4570*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_base = 0;
4571*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4572*0a6a1f1dSLionel Sambuc
4573*0a6a1f1dSLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
4574*0a6a1f1dSLionel Sambuc return xcb_ret;
4575*0a6a1f1dSLionel Sambuc }
4576*0a6a1f1dSLionel Sambuc
4577*0a6a1f1dSLionel Sambuc xcb_void_cookie_t
xcb_randr_delete_provider_property(xcb_connection_t * c,xcb_randr_provider_t provider,xcb_atom_t property)4578*0a6a1f1dSLionel Sambuc xcb_randr_delete_provider_property (xcb_connection_t *c /**< */,
4579*0a6a1f1dSLionel Sambuc xcb_randr_provider_t provider /**< */,
4580*0a6a1f1dSLionel Sambuc xcb_atom_t property /**< */)
4581*0a6a1f1dSLionel Sambuc {
4582*0a6a1f1dSLionel Sambuc static const xcb_protocol_request_t xcb_req = {
4583*0a6a1f1dSLionel Sambuc /* count */ 2,
4584*0a6a1f1dSLionel Sambuc /* ext */ &xcb_randr_id,
4585*0a6a1f1dSLionel Sambuc /* opcode */ XCB_RANDR_DELETE_PROVIDER_PROPERTY,
4586*0a6a1f1dSLionel Sambuc /* isvoid */ 1
4587*0a6a1f1dSLionel Sambuc };
4588*0a6a1f1dSLionel Sambuc
4589*0a6a1f1dSLionel Sambuc struct iovec xcb_parts[4];
4590*0a6a1f1dSLionel Sambuc xcb_void_cookie_t xcb_ret;
4591*0a6a1f1dSLionel Sambuc xcb_randr_delete_provider_property_request_t xcb_out;
4592*0a6a1f1dSLionel Sambuc
4593*0a6a1f1dSLionel Sambuc xcb_out.provider = provider;
4594*0a6a1f1dSLionel Sambuc xcb_out.property = property;
4595*0a6a1f1dSLionel Sambuc
4596*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
4597*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
4598*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_base = 0;
4599*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4600*0a6a1f1dSLionel Sambuc
4601*0a6a1f1dSLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
4602*0a6a1f1dSLionel Sambuc return xcb_ret;
4603*0a6a1f1dSLionel Sambuc }
4604*0a6a1f1dSLionel Sambuc
4605*0a6a1f1dSLionel Sambuc int
xcb_randr_get_provider_property_sizeof(const void * _buffer)4606*0a6a1f1dSLionel Sambuc xcb_randr_get_provider_property_sizeof (const void *_buffer /**< */)
4607*0a6a1f1dSLionel Sambuc {
4608*0a6a1f1dSLionel Sambuc char *xcb_tmp = (char *)_buffer;
4609*0a6a1f1dSLionel Sambuc const xcb_randr_get_provider_property_reply_t *_aux = (xcb_randr_get_provider_property_reply_t *)_buffer;
4610*0a6a1f1dSLionel Sambuc unsigned int xcb_buffer_len = 0;
4611*0a6a1f1dSLionel Sambuc unsigned int xcb_block_len = 0;
4612*0a6a1f1dSLionel Sambuc unsigned int xcb_pad = 0;
4613*0a6a1f1dSLionel Sambuc unsigned int xcb_align_to = 0;
4614*0a6a1f1dSLionel Sambuc
4615*0a6a1f1dSLionel Sambuc
4616*0a6a1f1dSLionel Sambuc xcb_block_len += sizeof(xcb_randr_get_provider_property_reply_t);
4617*0a6a1f1dSLionel Sambuc xcb_tmp += xcb_block_len;
4618*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len;
4619*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
4620*0a6a1f1dSLionel Sambuc /* data */
4621*0a6a1f1dSLionel Sambuc xcb_block_len += (_aux->num_items * (_aux->format / 8)) * sizeof(char);
4622*0a6a1f1dSLionel Sambuc xcb_tmp += xcb_block_len;
4623*0a6a1f1dSLionel Sambuc xcb_align_to = ALIGNOF(char);
4624*0a6a1f1dSLionel Sambuc /* insert padding */
4625*0a6a1f1dSLionel Sambuc xcb_pad = -xcb_block_len & (xcb_align_to - 1);
4626*0a6a1f1dSLionel Sambuc xcb_buffer_len += xcb_block_len + xcb_pad;
4627*0a6a1f1dSLionel Sambuc if (0 != xcb_pad) {
4628*0a6a1f1dSLionel Sambuc xcb_tmp += xcb_pad;
4629*0a6a1f1dSLionel Sambuc xcb_pad = 0;
4630*0a6a1f1dSLionel Sambuc }
4631*0a6a1f1dSLionel Sambuc xcb_block_len = 0;
4632*0a6a1f1dSLionel Sambuc
4633*0a6a1f1dSLionel Sambuc return xcb_buffer_len;
4634*0a6a1f1dSLionel Sambuc }
4635*0a6a1f1dSLionel Sambuc
4636*0a6a1f1dSLionel Sambuc xcb_randr_get_provider_property_cookie_t
xcb_randr_get_provider_property(xcb_connection_t * c,xcb_randr_provider_t provider,xcb_atom_t property,xcb_atom_t type,uint32_t long_offset,uint32_t long_length,uint8_t _delete,uint8_t pending)4637*0a6a1f1dSLionel Sambuc xcb_randr_get_provider_property (xcb_connection_t *c /**< */,
4638*0a6a1f1dSLionel Sambuc xcb_randr_provider_t provider /**< */,
4639*0a6a1f1dSLionel Sambuc xcb_atom_t property /**< */,
4640*0a6a1f1dSLionel Sambuc xcb_atom_t type /**< */,
4641*0a6a1f1dSLionel Sambuc uint32_t long_offset /**< */,
4642*0a6a1f1dSLionel Sambuc uint32_t long_length /**< */,
4643*0a6a1f1dSLionel Sambuc uint8_t _delete /**< */,
4644*0a6a1f1dSLionel Sambuc uint8_t pending /**< */)
4645*0a6a1f1dSLionel Sambuc {
4646*0a6a1f1dSLionel Sambuc static const xcb_protocol_request_t xcb_req = {
4647*0a6a1f1dSLionel Sambuc /* count */ 2,
4648*0a6a1f1dSLionel Sambuc /* ext */ &xcb_randr_id,
4649*0a6a1f1dSLionel Sambuc /* opcode */ XCB_RANDR_GET_PROVIDER_PROPERTY,
4650*0a6a1f1dSLionel Sambuc /* isvoid */ 0
4651*0a6a1f1dSLionel Sambuc };
4652*0a6a1f1dSLionel Sambuc
4653*0a6a1f1dSLionel Sambuc struct iovec xcb_parts[4];
4654*0a6a1f1dSLionel Sambuc xcb_randr_get_provider_property_cookie_t xcb_ret;
4655*0a6a1f1dSLionel Sambuc xcb_randr_get_provider_property_request_t xcb_out;
4656*0a6a1f1dSLionel Sambuc
4657*0a6a1f1dSLionel Sambuc xcb_out.provider = provider;
4658*0a6a1f1dSLionel Sambuc xcb_out.property = property;
4659*0a6a1f1dSLionel Sambuc xcb_out.type = type;
4660*0a6a1f1dSLionel Sambuc xcb_out.long_offset = long_offset;
4661*0a6a1f1dSLionel Sambuc xcb_out.long_length = long_length;
4662*0a6a1f1dSLionel Sambuc xcb_out._delete = _delete;
4663*0a6a1f1dSLionel Sambuc xcb_out.pending = pending;
4664*0a6a1f1dSLionel Sambuc memset(xcb_out.pad0, 0, 2);
4665*0a6a1f1dSLionel Sambuc
4666*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
4667*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
4668*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_base = 0;
4669*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4670*0a6a1f1dSLionel Sambuc
4671*0a6a1f1dSLionel Sambuc xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
4672*0a6a1f1dSLionel Sambuc return xcb_ret;
4673*0a6a1f1dSLionel Sambuc }
4674*0a6a1f1dSLionel Sambuc
4675*0a6a1f1dSLionel Sambuc xcb_randr_get_provider_property_cookie_t
xcb_randr_get_provider_property_unchecked(xcb_connection_t * c,xcb_randr_provider_t provider,xcb_atom_t property,xcb_atom_t type,uint32_t long_offset,uint32_t long_length,uint8_t _delete,uint8_t pending)4676*0a6a1f1dSLionel Sambuc xcb_randr_get_provider_property_unchecked (xcb_connection_t *c /**< */,
4677*0a6a1f1dSLionel Sambuc xcb_randr_provider_t provider /**< */,
4678*0a6a1f1dSLionel Sambuc xcb_atom_t property /**< */,
4679*0a6a1f1dSLionel Sambuc xcb_atom_t type /**< */,
4680*0a6a1f1dSLionel Sambuc uint32_t long_offset /**< */,
4681*0a6a1f1dSLionel Sambuc uint32_t long_length /**< */,
4682*0a6a1f1dSLionel Sambuc uint8_t _delete /**< */,
4683*0a6a1f1dSLionel Sambuc uint8_t pending /**< */)
4684*0a6a1f1dSLionel Sambuc {
4685*0a6a1f1dSLionel Sambuc static const xcb_protocol_request_t xcb_req = {
4686*0a6a1f1dSLionel Sambuc /* count */ 2,
4687*0a6a1f1dSLionel Sambuc /* ext */ &xcb_randr_id,
4688*0a6a1f1dSLionel Sambuc /* opcode */ XCB_RANDR_GET_PROVIDER_PROPERTY,
4689*0a6a1f1dSLionel Sambuc /* isvoid */ 0
4690*0a6a1f1dSLionel Sambuc };
4691*0a6a1f1dSLionel Sambuc
4692*0a6a1f1dSLionel Sambuc struct iovec xcb_parts[4];
4693*0a6a1f1dSLionel Sambuc xcb_randr_get_provider_property_cookie_t xcb_ret;
4694*0a6a1f1dSLionel Sambuc xcb_randr_get_provider_property_request_t xcb_out;
4695*0a6a1f1dSLionel Sambuc
4696*0a6a1f1dSLionel Sambuc xcb_out.provider = provider;
4697*0a6a1f1dSLionel Sambuc xcb_out.property = property;
4698*0a6a1f1dSLionel Sambuc xcb_out.type = type;
4699*0a6a1f1dSLionel Sambuc xcb_out.long_offset = long_offset;
4700*0a6a1f1dSLionel Sambuc xcb_out.long_length = long_length;
4701*0a6a1f1dSLionel Sambuc xcb_out._delete = _delete;
4702*0a6a1f1dSLionel Sambuc xcb_out.pending = pending;
4703*0a6a1f1dSLionel Sambuc memset(xcb_out.pad0, 0, 2);
4704*0a6a1f1dSLionel Sambuc
4705*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_base = (char *) &xcb_out;
4706*0a6a1f1dSLionel Sambuc xcb_parts[2].iov_len = sizeof(xcb_out);
4707*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_base = 0;
4708*0a6a1f1dSLionel Sambuc xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
4709*0a6a1f1dSLionel Sambuc
4710*0a6a1f1dSLionel Sambuc xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
4711*0a6a1f1dSLionel Sambuc return xcb_ret;
4712*0a6a1f1dSLionel Sambuc }
4713*0a6a1f1dSLionel Sambuc
4714*0a6a1f1dSLionel Sambuc void *
xcb_randr_get_provider_property_data(const xcb_randr_get_provider_property_reply_t * R)4715*0a6a1f1dSLionel Sambuc xcb_randr_get_provider_property_data (const xcb_randr_get_provider_property_reply_t *R /**< */)
4716*0a6a1f1dSLionel Sambuc {
4717*0a6a1f1dSLionel Sambuc return (void *) (R + 1);
4718*0a6a1f1dSLionel Sambuc }
4719*0a6a1f1dSLionel Sambuc
4720*0a6a1f1dSLionel Sambuc int
xcb_randr_get_provider_property_data_length(const xcb_randr_get_provider_property_reply_t * R)4721*0a6a1f1dSLionel Sambuc xcb_randr_get_provider_property_data_length (const xcb_randr_get_provider_property_reply_t *R /**< */)
4722*0a6a1f1dSLionel Sambuc {
4723*0a6a1f1dSLionel Sambuc return (R->num_items * (R->format / 8));
4724*0a6a1f1dSLionel Sambuc }
4725*0a6a1f1dSLionel Sambuc
4726*0a6a1f1dSLionel Sambuc xcb_generic_iterator_t
xcb_randr_get_provider_property_data_end(const xcb_randr_get_provider_property_reply_t * R)4727*0a6a1f1dSLionel Sambuc xcb_randr_get_provider_property_data_end (const xcb_randr_get_provider_property_reply_t *R /**< */)
4728*0a6a1f1dSLionel Sambuc {
4729*0a6a1f1dSLionel Sambuc xcb_generic_iterator_t i;
4730*0a6a1f1dSLionel Sambuc i.data = ((char *) (R + 1)) + ((R->num_items * (R->format / 8)));
4731*0a6a1f1dSLionel Sambuc i.rem = 0;
4732*0a6a1f1dSLionel Sambuc i.index = (char *) i.data - (char *) R;
4733*0a6a1f1dSLionel Sambuc return i;
4734*0a6a1f1dSLionel Sambuc }
4735*0a6a1f1dSLionel Sambuc
4736*0a6a1f1dSLionel Sambuc xcb_randr_get_provider_property_reply_t *
xcb_randr_get_provider_property_reply(xcb_connection_t * c,xcb_randr_get_provider_property_cookie_t cookie,xcb_generic_error_t ** e)4737*0a6a1f1dSLionel Sambuc xcb_randr_get_provider_property_reply (xcb_connection_t *c /**< */,
4738*0a6a1f1dSLionel Sambuc xcb_randr_get_provider_property_cookie_t cookie /**< */,
4739*0a6a1f1dSLionel Sambuc xcb_generic_error_t **e /**< */)
4740*0a6a1f1dSLionel Sambuc {
4741*0a6a1f1dSLionel Sambuc return (xcb_randr_get_provider_property_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
4742*0a6a1f1dSLionel Sambuc }
4743971bb1a5SLionel Sambuc
4744971bb1a5SLionel Sambuc void
xcb_randr_crtc_change_next(xcb_randr_crtc_change_iterator_t * i)4745971bb1a5SLionel Sambuc xcb_randr_crtc_change_next (xcb_randr_crtc_change_iterator_t *i /**< */)
4746971bb1a5SLionel Sambuc {
4747971bb1a5SLionel Sambuc --i->rem;
4748971bb1a5SLionel Sambuc ++i->data;
4749971bb1a5SLionel Sambuc i->index += sizeof(xcb_randr_crtc_change_t);
4750971bb1a5SLionel Sambuc }
4751971bb1a5SLionel Sambuc
4752971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_randr_crtc_change_end(xcb_randr_crtc_change_iterator_t i)4753971bb1a5SLionel Sambuc xcb_randr_crtc_change_end (xcb_randr_crtc_change_iterator_t i /**< */)
4754971bb1a5SLionel Sambuc {
4755971bb1a5SLionel Sambuc xcb_generic_iterator_t ret;
4756971bb1a5SLionel Sambuc ret.data = i.data + i.rem;
4757971bb1a5SLionel Sambuc ret.index = i.index + ((char *) ret.data - (char *) i.data);
4758971bb1a5SLionel Sambuc ret.rem = 0;
4759971bb1a5SLionel Sambuc return ret;
4760971bb1a5SLionel Sambuc }
4761971bb1a5SLionel Sambuc
4762971bb1a5SLionel Sambuc void
xcb_randr_output_change_next(xcb_randr_output_change_iterator_t * i)4763971bb1a5SLionel Sambuc xcb_randr_output_change_next (xcb_randr_output_change_iterator_t *i /**< */)
4764971bb1a5SLionel Sambuc {
4765971bb1a5SLionel Sambuc --i->rem;
4766971bb1a5SLionel Sambuc ++i->data;
4767971bb1a5SLionel Sambuc i->index += sizeof(xcb_randr_output_change_t);
4768971bb1a5SLionel Sambuc }
4769971bb1a5SLionel Sambuc
4770971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_randr_output_change_end(xcb_randr_output_change_iterator_t i)4771971bb1a5SLionel Sambuc xcb_randr_output_change_end (xcb_randr_output_change_iterator_t i /**< */)
4772971bb1a5SLionel Sambuc {
4773971bb1a5SLionel Sambuc xcb_generic_iterator_t ret;
4774971bb1a5SLionel Sambuc ret.data = i.data + i.rem;
4775971bb1a5SLionel Sambuc ret.index = i.index + ((char *) ret.data - (char *) i.data);
4776971bb1a5SLionel Sambuc ret.rem = 0;
4777971bb1a5SLionel Sambuc return ret;
4778971bb1a5SLionel Sambuc }
4779971bb1a5SLionel Sambuc
4780971bb1a5SLionel Sambuc void
xcb_randr_output_property_next(xcb_randr_output_property_iterator_t * i)4781971bb1a5SLionel Sambuc xcb_randr_output_property_next (xcb_randr_output_property_iterator_t *i /**< */)
4782971bb1a5SLionel Sambuc {
4783971bb1a5SLionel Sambuc --i->rem;
4784971bb1a5SLionel Sambuc ++i->data;
4785971bb1a5SLionel Sambuc i->index += sizeof(xcb_randr_output_property_t);
4786971bb1a5SLionel Sambuc }
4787971bb1a5SLionel Sambuc
4788971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_randr_output_property_end(xcb_randr_output_property_iterator_t i)4789971bb1a5SLionel Sambuc xcb_randr_output_property_end (xcb_randr_output_property_iterator_t i /**< */)
4790971bb1a5SLionel Sambuc {
4791971bb1a5SLionel Sambuc xcb_generic_iterator_t ret;
4792971bb1a5SLionel Sambuc ret.data = i.data + i.rem;
4793971bb1a5SLionel Sambuc ret.index = i.index + ((char *) ret.data - (char *) i.data);
4794971bb1a5SLionel Sambuc ret.rem = 0;
4795971bb1a5SLionel Sambuc return ret;
4796971bb1a5SLionel Sambuc }
4797971bb1a5SLionel Sambuc
4798*0a6a1f1dSLionel Sambuc void
xcb_randr_provider_change_next(xcb_randr_provider_change_iterator_t * i)4799*0a6a1f1dSLionel Sambuc xcb_randr_provider_change_next (xcb_randr_provider_change_iterator_t *i /**< */)
4800*0a6a1f1dSLionel Sambuc {
4801*0a6a1f1dSLionel Sambuc --i->rem;
4802*0a6a1f1dSLionel Sambuc ++i->data;
4803*0a6a1f1dSLionel Sambuc i->index += sizeof(xcb_randr_provider_change_t);
4804*0a6a1f1dSLionel Sambuc }
4805971bb1a5SLionel Sambuc
4806*0a6a1f1dSLionel Sambuc xcb_generic_iterator_t
xcb_randr_provider_change_end(xcb_randr_provider_change_iterator_t i)4807*0a6a1f1dSLionel Sambuc xcb_randr_provider_change_end (xcb_randr_provider_change_iterator_t i /**< */)
4808*0a6a1f1dSLionel Sambuc {
4809*0a6a1f1dSLionel Sambuc xcb_generic_iterator_t ret;
4810*0a6a1f1dSLionel Sambuc ret.data = i.data + i.rem;
4811*0a6a1f1dSLionel Sambuc ret.index = i.index + ((char *) ret.data - (char *) i.data);
4812*0a6a1f1dSLionel Sambuc ret.rem = 0;
4813*0a6a1f1dSLionel Sambuc return ret;
4814*0a6a1f1dSLionel Sambuc }
4815*0a6a1f1dSLionel Sambuc
4816*0a6a1f1dSLionel Sambuc void
xcb_randr_provider_property_next(xcb_randr_provider_property_iterator_t * i)4817*0a6a1f1dSLionel Sambuc xcb_randr_provider_property_next (xcb_randr_provider_property_iterator_t *i /**< */)
4818*0a6a1f1dSLionel Sambuc {
4819*0a6a1f1dSLionel Sambuc --i->rem;
4820*0a6a1f1dSLionel Sambuc ++i->data;
4821*0a6a1f1dSLionel Sambuc i->index += sizeof(xcb_randr_provider_property_t);
4822*0a6a1f1dSLionel Sambuc }
4823*0a6a1f1dSLionel Sambuc
4824*0a6a1f1dSLionel Sambuc xcb_generic_iterator_t
xcb_randr_provider_property_end(xcb_randr_provider_property_iterator_t i)4825*0a6a1f1dSLionel Sambuc xcb_randr_provider_property_end (xcb_randr_provider_property_iterator_t i /**< */)
4826*0a6a1f1dSLionel Sambuc {
4827*0a6a1f1dSLionel Sambuc xcb_generic_iterator_t ret;
4828*0a6a1f1dSLionel Sambuc ret.data = i.data + i.rem;
4829*0a6a1f1dSLionel Sambuc ret.index = i.index + ((char *) ret.data - (char *) i.data);
4830*0a6a1f1dSLionel Sambuc ret.rem = 0;
4831*0a6a1f1dSLionel Sambuc return ret;
4832*0a6a1f1dSLionel Sambuc }
4833*0a6a1f1dSLionel Sambuc
4834*0a6a1f1dSLionel Sambuc void
xcb_randr_resource_change_next(xcb_randr_resource_change_iterator_t * i)4835*0a6a1f1dSLionel Sambuc xcb_randr_resource_change_next (xcb_randr_resource_change_iterator_t *i /**< */)
4836*0a6a1f1dSLionel Sambuc {
4837*0a6a1f1dSLionel Sambuc --i->rem;
4838*0a6a1f1dSLionel Sambuc ++i->data;
4839*0a6a1f1dSLionel Sambuc i->index += sizeof(xcb_randr_resource_change_t);
4840*0a6a1f1dSLionel Sambuc }
4841*0a6a1f1dSLionel Sambuc
4842*0a6a1f1dSLionel Sambuc xcb_generic_iterator_t
xcb_randr_resource_change_end(xcb_randr_resource_change_iterator_t i)4843*0a6a1f1dSLionel Sambuc xcb_randr_resource_change_end (xcb_randr_resource_change_iterator_t i /**< */)
4844*0a6a1f1dSLionel Sambuc {
4845*0a6a1f1dSLionel Sambuc xcb_generic_iterator_t ret;
4846*0a6a1f1dSLionel Sambuc ret.data = i.data + i.rem;
4847*0a6a1f1dSLionel Sambuc ret.index = i.index + ((char *) ret.data - (char *) i.data);
4848*0a6a1f1dSLionel Sambuc ret.rem = 0;
4849*0a6a1f1dSLionel Sambuc return ret;
4850*0a6a1f1dSLionel Sambuc }
4851971bb1a5SLionel Sambuc
4852971bb1a5SLionel Sambuc void
xcb_randr_notify_data_next(xcb_randr_notify_data_iterator_t * i)4853971bb1a5SLionel Sambuc xcb_randr_notify_data_next (xcb_randr_notify_data_iterator_t *i /**< */)
4854971bb1a5SLionel Sambuc {
4855971bb1a5SLionel Sambuc --i->rem;
4856971bb1a5SLionel Sambuc ++i->data;
4857971bb1a5SLionel Sambuc i->index += sizeof(xcb_randr_notify_data_t);
4858971bb1a5SLionel Sambuc }
4859971bb1a5SLionel Sambuc
4860971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_randr_notify_data_end(xcb_randr_notify_data_iterator_t i)4861971bb1a5SLionel Sambuc xcb_randr_notify_data_end (xcb_randr_notify_data_iterator_t i /**< */)
4862971bb1a5SLionel Sambuc {
4863971bb1a5SLionel Sambuc xcb_generic_iterator_t ret;
4864971bb1a5SLionel Sambuc ret.data = i.data + i.rem;
4865971bb1a5SLionel Sambuc ret.index = i.index + ((char *) ret.data - (char *) i.data);
4866971bb1a5SLionel Sambuc ret.rem = 0;
4867971bb1a5SLionel Sambuc return ret;
4868971bb1a5SLionel Sambuc }
4869971bb1a5SLionel Sambuc
4870