xref: /minix3/external/mit/xorg/lib/libxcb/files/xinerama.c (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1971bb1a5SLionel Sambuc /*
2971bb1a5SLionel Sambuc  * This file generated automatically from xinerama.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 "xinerama.h"
15971bb1a5SLionel Sambuc 
16971bb1a5SLionel Sambuc #define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member)
17971bb1a5SLionel Sambuc #include "xproto.h"
18971bb1a5SLionel Sambuc 
19971bb1a5SLionel Sambuc xcb_extension_t xcb_xinerama_id = { "XINERAMA", 0 };
20971bb1a5SLionel Sambuc 
21971bb1a5SLionel Sambuc void
xcb_xinerama_screen_info_next(xcb_xinerama_screen_info_iterator_t * i)22971bb1a5SLionel Sambuc xcb_xinerama_screen_info_next (xcb_xinerama_screen_info_iterator_t *i  /**< */)
23971bb1a5SLionel Sambuc {
24971bb1a5SLionel Sambuc     --i->rem;
25971bb1a5SLionel Sambuc     ++i->data;
26971bb1a5SLionel Sambuc     i->index += sizeof(xcb_xinerama_screen_info_t);
27971bb1a5SLionel Sambuc }
28971bb1a5SLionel Sambuc 
29971bb1a5SLionel Sambuc xcb_generic_iterator_t
xcb_xinerama_screen_info_end(xcb_xinerama_screen_info_iterator_t i)30971bb1a5SLionel Sambuc xcb_xinerama_screen_info_end (xcb_xinerama_screen_info_iterator_t i  /**< */)
31971bb1a5SLionel Sambuc {
32971bb1a5SLionel Sambuc     xcb_generic_iterator_t ret;
33971bb1a5SLionel Sambuc     ret.data = i.data + i.rem;
34971bb1a5SLionel Sambuc     ret.index = i.index + ((char *) ret.data - (char *) i.data);
35971bb1a5SLionel Sambuc     ret.rem = 0;
36971bb1a5SLionel Sambuc     return ret;
37971bb1a5SLionel Sambuc }
38971bb1a5SLionel Sambuc 
39971bb1a5SLionel Sambuc xcb_xinerama_query_version_cookie_t
xcb_xinerama_query_version(xcb_connection_t * c,uint8_t major,uint8_t minor)40971bb1a5SLionel Sambuc xcb_xinerama_query_version (xcb_connection_t *c  /**< */,
41971bb1a5SLionel Sambuc                             uint8_t           major  /**< */,
42971bb1a5SLionel Sambuc                             uint8_t           minor  /**< */)
43971bb1a5SLionel Sambuc {
44971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
45971bb1a5SLionel Sambuc         /* count */ 2,
46971bb1a5SLionel Sambuc         /* ext */ &xcb_xinerama_id,
47971bb1a5SLionel Sambuc         /* opcode */ XCB_XINERAMA_QUERY_VERSION,
48971bb1a5SLionel Sambuc         /* isvoid */ 0
49971bb1a5SLionel Sambuc     };
50971bb1a5SLionel Sambuc 
51971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
52971bb1a5SLionel Sambuc     xcb_xinerama_query_version_cookie_t xcb_ret;
53971bb1a5SLionel Sambuc     xcb_xinerama_query_version_request_t xcb_out;
54971bb1a5SLionel Sambuc 
55971bb1a5SLionel Sambuc     xcb_out.major = major;
56971bb1a5SLionel Sambuc     xcb_out.minor = minor;
57971bb1a5SLionel Sambuc 
58971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
59971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
60971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
61971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
62971bb1a5SLionel Sambuc 
63971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
64971bb1a5SLionel Sambuc     return xcb_ret;
65971bb1a5SLionel Sambuc }
66971bb1a5SLionel Sambuc 
67971bb1a5SLionel Sambuc xcb_xinerama_query_version_cookie_t
xcb_xinerama_query_version_unchecked(xcb_connection_t * c,uint8_t major,uint8_t minor)68971bb1a5SLionel Sambuc xcb_xinerama_query_version_unchecked (xcb_connection_t *c  /**< */,
69971bb1a5SLionel Sambuc                                       uint8_t           major  /**< */,
70971bb1a5SLionel Sambuc                                       uint8_t           minor  /**< */)
71971bb1a5SLionel Sambuc {
72971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
73971bb1a5SLionel Sambuc         /* count */ 2,
74971bb1a5SLionel Sambuc         /* ext */ &xcb_xinerama_id,
75971bb1a5SLionel Sambuc         /* opcode */ XCB_XINERAMA_QUERY_VERSION,
76971bb1a5SLionel Sambuc         /* isvoid */ 0
77971bb1a5SLionel Sambuc     };
78971bb1a5SLionel Sambuc 
79971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
80971bb1a5SLionel Sambuc     xcb_xinerama_query_version_cookie_t xcb_ret;
81971bb1a5SLionel Sambuc     xcb_xinerama_query_version_request_t xcb_out;
82971bb1a5SLionel Sambuc 
83971bb1a5SLionel Sambuc     xcb_out.major = major;
84971bb1a5SLionel Sambuc     xcb_out.minor = minor;
85971bb1a5SLionel Sambuc 
86971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
87971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
88971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
89971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
90971bb1a5SLionel Sambuc 
91971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
92971bb1a5SLionel Sambuc     return xcb_ret;
93971bb1a5SLionel Sambuc }
94971bb1a5SLionel Sambuc 
95971bb1a5SLionel Sambuc xcb_xinerama_query_version_reply_t *
xcb_xinerama_query_version_reply(xcb_connection_t * c,xcb_xinerama_query_version_cookie_t cookie,xcb_generic_error_t ** e)96971bb1a5SLionel Sambuc xcb_xinerama_query_version_reply (xcb_connection_t                     *c  /**< */,
97971bb1a5SLionel Sambuc                                   xcb_xinerama_query_version_cookie_t   cookie  /**< */,
98971bb1a5SLionel Sambuc                                   xcb_generic_error_t                 **e  /**< */)
99971bb1a5SLionel Sambuc {
100971bb1a5SLionel Sambuc     return (xcb_xinerama_query_version_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
101971bb1a5SLionel Sambuc }
102971bb1a5SLionel Sambuc 
103971bb1a5SLionel Sambuc xcb_xinerama_get_state_cookie_t
xcb_xinerama_get_state(xcb_connection_t * c,xcb_window_t window)104971bb1a5SLionel Sambuc xcb_xinerama_get_state (xcb_connection_t *c  /**< */,
105971bb1a5SLionel Sambuc                         xcb_window_t      window  /**< */)
106971bb1a5SLionel Sambuc {
107971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
108971bb1a5SLionel Sambuc         /* count */ 2,
109971bb1a5SLionel Sambuc         /* ext */ &xcb_xinerama_id,
110971bb1a5SLionel Sambuc         /* opcode */ XCB_XINERAMA_GET_STATE,
111971bb1a5SLionel Sambuc         /* isvoid */ 0
112971bb1a5SLionel Sambuc     };
113971bb1a5SLionel Sambuc 
114971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
115971bb1a5SLionel Sambuc     xcb_xinerama_get_state_cookie_t xcb_ret;
116971bb1a5SLionel Sambuc     xcb_xinerama_get_state_request_t xcb_out;
117971bb1a5SLionel Sambuc 
118971bb1a5SLionel Sambuc     xcb_out.window = window;
119971bb1a5SLionel Sambuc 
120971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
121971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
122971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
123971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
124971bb1a5SLionel Sambuc 
125971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
126971bb1a5SLionel Sambuc     return xcb_ret;
127971bb1a5SLionel Sambuc }
128971bb1a5SLionel Sambuc 
129971bb1a5SLionel Sambuc xcb_xinerama_get_state_cookie_t
xcb_xinerama_get_state_unchecked(xcb_connection_t * c,xcb_window_t window)130971bb1a5SLionel Sambuc xcb_xinerama_get_state_unchecked (xcb_connection_t *c  /**< */,
131971bb1a5SLionel Sambuc                                   xcb_window_t      window  /**< */)
132971bb1a5SLionel Sambuc {
133971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
134971bb1a5SLionel Sambuc         /* count */ 2,
135971bb1a5SLionel Sambuc         /* ext */ &xcb_xinerama_id,
136971bb1a5SLionel Sambuc         /* opcode */ XCB_XINERAMA_GET_STATE,
137971bb1a5SLionel Sambuc         /* isvoid */ 0
138971bb1a5SLionel Sambuc     };
139971bb1a5SLionel Sambuc 
140971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
141971bb1a5SLionel Sambuc     xcb_xinerama_get_state_cookie_t xcb_ret;
142971bb1a5SLionel Sambuc     xcb_xinerama_get_state_request_t xcb_out;
143971bb1a5SLionel Sambuc 
144971bb1a5SLionel Sambuc     xcb_out.window = window;
145971bb1a5SLionel Sambuc 
146971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
147971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
148971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
149971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
150971bb1a5SLionel Sambuc 
151971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
152971bb1a5SLionel Sambuc     return xcb_ret;
153971bb1a5SLionel Sambuc }
154971bb1a5SLionel Sambuc 
155971bb1a5SLionel Sambuc xcb_xinerama_get_state_reply_t *
xcb_xinerama_get_state_reply(xcb_connection_t * c,xcb_xinerama_get_state_cookie_t cookie,xcb_generic_error_t ** e)156971bb1a5SLionel Sambuc xcb_xinerama_get_state_reply (xcb_connection_t                 *c  /**< */,
157971bb1a5SLionel Sambuc                               xcb_xinerama_get_state_cookie_t   cookie  /**< */,
158971bb1a5SLionel Sambuc                               xcb_generic_error_t             **e  /**< */)
159971bb1a5SLionel Sambuc {
160971bb1a5SLionel Sambuc     return (xcb_xinerama_get_state_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
161971bb1a5SLionel Sambuc }
162971bb1a5SLionel Sambuc 
163971bb1a5SLionel Sambuc xcb_xinerama_get_screen_count_cookie_t
xcb_xinerama_get_screen_count(xcb_connection_t * c,xcb_window_t window)164971bb1a5SLionel Sambuc xcb_xinerama_get_screen_count (xcb_connection_t *c  /**< */,
165971bb1a5SLionel Sambuc                                xcb_window_t      window  /**< */)
166971bb1a5SLionel Sambuc {
167971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
168971bb1a5SLionel Sambuc         /* count */ 2,
169971bb1a5SLionel Sambuc         /* ext */ &xcb_xinerama_id,
170971bb1a5SLionel Sambuc         /* opcode */ XCB_XINERAMA_GET_SCREEN_COUNT,
171971bb1a5SLionel Sambuc         /* isvoid */ 0
172971bb1a5SLionel Sambuc     };
173971bb1a5SLionel Sambuc 
174971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
175971bb1a5SLionel Sambuc     xcb_xinerama_get_screen_count_cookie_t xcb_ret;
176971bb1a5SLionel Sambuc     xcb_xinerama_get_screen_count_request_t xcb_out;
177971bb1a5SLionel Sambuc 
178971bb1a5SLionel Sambuc     xcb_out.window = window;
179971bb1a5SLionel Sambuc 
180971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
181971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
182971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
183971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
184971bb1a5SLionel Sambuc 
185971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
186971bb1a5SLionel Sambuc     return xcb_ret;
187971bb1a5SLionel Sambuc }
188971bb1a5SLionel Sambuc 
189971bb1a5SLionel Sambuc xcb_xinerama_get_screen_count_cookie_t
xcb_xinerama_get_screen_count_unchecked(xcb_connection_t * c,xcb_window_t window)190971bb1a5SLionel Sambuc xcb_xinerama_get_screen_count_unchecked (xcb_connection_t *c  /**< */,
191971bb1a5SLionel Sambuc                                          xcb_window_t      window  /**< */)
192971bb1a5SLionel Sambuc {
193971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
194971bb1a5SLionel Sambuc         /* count */ 2,
195971bb1a5SLionel Sambuc         /* ext */ &xcb_xinerama_id,
196971bb1a5SLionel Sambuc         /* opcode */ XCB_XINERAMA_GET_SCREEN_COUNT,
197971bb1a5SLionel Sambuc         /* isvoid */ 0
198971bb1a5SLionel Sambuc     };
199971bb1a5SLionel Sambuc 
200971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
201971bb1a5SLionel Sambuc     xcb_xinerama_get_screen_count_cookie_t xcb_ret;
202971bb1a5SLionel Sambuc     xcb_xinerama_get_screen_count_request_t xcb_out;
203971bb1a5SLionel Sambuc 
204971bb1a5SLionel Sambuc     xcb_out.window = window;
205971bb1a5SLionel Sambuc 
206971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
207971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
208971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
209971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
210971bb1a5SLionel Sambuc 
211971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
212971bb1a5SLionel Sambuc     return xcb_ret;
213971bb1a5SLionel Sambuc }
214971bb1a5SLionel Sambuc 
215971bb1a5SLionel Sambuc xcb_xinerama_get_screen_count_reply_t *
xcb_xinerama_get_screen_count_reply(xcb_connection_t * c,xcb_xinerama_get_screen_count_cookie_t cookie,xcb_generic_error_t ** e)216971bb1a5SLionel Sambuc xcb_xinerama_get_screen_count_reply (xcb_connection_t                        *c  /**< */,
217971bb1a5SLionel Sambuc                                      xcb_xinerama_get_screen_count_cookie_t   cookie  /**< */,
218971bb1a5SLionel Sambuc                                      xcb_generic_error_t                    **e  /**< */)
219971bb1a5SLionel Sambuc {
220971bb1a5SLionel Sambuc     return (xcb_xinerama_get_screen_count_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
221971bb1a5SLionel Sambuc }
222971bb1a5SLionel Sambuc 
223971bb1a5SLionel Sambuc xcb_xinerama_get_screen_size_cookie_t
xcb_xinerama_get_screen_size(xcb_connection_t * c,xcb_window_t window,uint32_t screen)224971bb1a5SLionel Sambuc xcb_xinerama_get_screen_size (xcb_connection_t *c  /**< */,
225971bb1a5SLionel Sambuc                               xcb_window_t      window  /**< */,
226971bb1a5SLionel Sambuc                               uint32_t          screen  /**< */)
227971bb1a5SLionel Sambuc {
228971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
229971bb1a5SLionel Sambuc         /* count */ 2,
230971bb1a5SLionel Sambuc         /* ext */ &xcb_xinerama_id,
231971bb1a5SLionel Sambuc         /* opcode */ XCB_XINERAMA_GET_SCREEN_SIZE,
232971bb1a5SLionel Sambuc         /* isvoid */ 0
233971bb1a5SLionel Sambuc     };
234971bb1a5SLionel Sambuc 
235971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
236971bb1a5SLionel Sambuc     xcb_xinerama_get_screen_size_cookie_t xcb_ret;
237971bb1a5SLionel Sambuc     xcb_xinerama_get_screen_size_request_t xcb_out;
238971bb1a5SLionel Sambuc 
239971bb1a5SLionel Sambuc     xcb_out.window = window;
240971bb1a5SLionel Sambuc     xcb_out.screen = screen;
241971bb1a5SLionel Sambuc 
242971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
243971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
244971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
245971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
246971bb1a5SLionel Sambuc 
247971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
248971bb1a5SLionel Sambuc     return xcb_ret;
249971bb1a5SLionel Sambuc }
250971bb1a5SLionel Sambuc 
251971bb1a5SLionel Sambuc xcb_xinerama_get_screen_size_cookie_t
xcb_xinerama_get_screen_size_unchecked(xcb_connection_t * c,xcb_window_t window,uint32_t screen)252971bb1a5SLionel Sambuc xcb_xinerama_get_screen_size_unchecked (xcb_connection_t *c  /**< */,
253971bb1a5SLionel Sambuc                                         xcb_window_t      window  /**< */,
254971bb1a5SLionel Sambuc                                         uint32_t          screen  /**< */)
255971bb1a5SLionel Sambuc {
256971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
257971bb1a5SLionel Sambuc         /* count */ 2,
258971bb1a5SLionel Sambuc         /* ext */ &xcb_xinerama_id,
259971bb1a5SLionel Sambuc         /* opcode */ XCB_XINERAMA_GET_SCREEN_SIZE,
260971bb1a5SLionel Sambuc         /* isvoid */ 0
261971bb1a5SLionel Sambuc     };
262971bb1a5SLionel Sambuc 
263971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
264971bb1a5SLionel Sambuc     xcb_xinerama_get_screen_size_cookie_t xcb_ret;
265971bb1a5SLionel Sambuc     xcb_xinerama_get_screen_size_request_t xcb_out;
266971bb1a5SLionel Sambuc 
267971bb1a5SLionel Sambuc     xcb_out.window = window;
268971bb1a5SLionel Sambuc     xcb_out.screen = screen;
269971bb1a5SLionel Sambuc 
270971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
271971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
272971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
273971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
274971bb1a5SLionel Sambuc 
275971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
276971bb1a5SLionel Sambuc     return xcb_ret;
277971bb1a5SLionel Sambuc }
278971bb1a5SLionel Sambuc 
279971bb1a5SLionel Sambuc xcb_xinerama_get_screen_size_reply_t *
xcb_xinerama_get_screen_size_reply(xcb_connection_t * c,xcb_xinerama_get_screen_size_cookie_t cookie,xcb_generic_error_t ** e)280971bb1a5SLionel Sambuc xcb_xinerama_get_screen_size_reply (xcb_connection_t                       *c  /**< */,
281971bb1a5SLionel Sambuc                                     xcb_xinerama_get_screen_size_cookie_t   cookie  /**< */,
282971bb1a5SLionel Sambuc                                     xcb_generic_error_t                   **e  /**< */)
283971bb1a5SLionel Sambuc {
284971bb1a5SLionel Sambuc     return (xcb_xinerama_get_screen_size_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
285971bb1a5SLionel Sambuc }
286971bb1a5SLionel Sambuc 
287971bb1a5SLionel Sambuc xcb_xinerama_is_active_cookie_t
xcb_xinerama_is_active(xcb_connection_t * c)288971bb1a5SLionel Sambuc xcb_xinerama_is_active (xcb_connection_t *c  /**< */)
289971bb1a5SLionel Sambuc {
290971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
291971bb1a5SLionel Sambuc         /* count */ 2,
292971bb1a5SLionel Sambuc         /* ext */ &xcb_xinerama_id,
293971bb1a5SLionel Sambuc         /* opcode */ XCB_XINERAMA_IS_ACTIVE,
294971bb1a5SLionel Sambuc         /* isvoid */ 0
295971bb1a5SLionel Sambuc     };
296971bb1a5SLionel Sambuc 
297971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
298971bb1a5SLionel Sambuc     xcb_xinerama_is_active_cookie_t xcb_ret;
299971bb1a5SLionel Sambuc     xcb_xinerama_is_active_request_t xcb_out;
300971bb1a5SLionel Sambuc 
301971bb1a5SLionel Sambuc 
302971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
303971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
304971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
305971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
306971bb1a5SLionel Sambuc 
307971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
308971bb1a5SLionel Sambuc     return xcb_ret;
309971bb1a5SLionel Sambuc }
310971bb1a5SLionel Sambuc 
311971bb1a5SLionel Sambuc xcb_xinerama_is_active_cookie_t
xcb_xinerama_is_active_unchecked(xcb_connection_t * c)312971bb1a5SLionel Sambuc xcb_xinerama_is_active_unchecked (xcb_connection_t *c  /**< */)
313971bb1a5SLionel Sambuc {
314971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
315971bb1a5SLionel Sambuc         /* count */ 2,
316971bb1a5SLionel Sambuc         /* ext */ &xcb_xinerama_id,
317971bb1a5SLionel Sambuc         /* opcode */ XCB_XINERAMA_IS_ACTIVE,
318971bb1a5SLionel Sambuc         /* isvoid */ 0
319971bb1a5SLionel Sambuc     };
320971bb1a5SLionel Sambuc 
321971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
322971bb1a5SLionel Sambuc     xcb_xinerama_is_active_cookie_t xcb_ret;
323971bb1a5SLionel Sambuc     xcb_xinerama_is_active_request_t xcb_out;
324971bb1a5SLionel Sambuc 
325971bb1a5SLionel Sambuc 
326971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
327971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
328971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
329971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
330971bb1a5SLionel Sambuc 
331971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
332971bb1a5SLionel Sambuc     return xcb_ret;
333971bb1a5SLionel Sambuc }
334971bb1a5SLionel Sambuc 
335971bb1a5SLionel Sambuc xcb_xinerama_is_active_reply_t *
xcb_xinerama_is_active_reply(xcb_connection_t * c,xcb_xinerama_is_active_cookie_t cookie,xcb_generic_error_t ** e)336971bb1a5SLionel Sambuc xcb_xinerama_is_active_reply (xcb_connection_t                 *c  /**< */,
337971bb1a5SLionel Sambuc                               xcb_xinerama_is_active_cookie_t   cookie  /**< */,
338971bb1a5SLionel Sambuc                               xcb_generic_error_t             **e  /**< */)
339971bb1a5SLionel Sambuc {
340971bb1a5SLionel Sambuc     return (xcb_xinerama_is_active_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
341971bb1a5SLionel Sambuc }
342971bb1a5SLionel Sambuc 
343971bb1a5SLionel Sambuc int
xcb_xinerama_query_screens_sizeof(const void * _buffer)344971bb1a5SLionel Sambuc xcb_xinerama_query_screens_sizeof (const void  *_buffer  /**< */)
345971bb1a5SLionel Sambuc {
346971bb1a5SLionel Sambuc     char *xcb_tmp = (char *)_buffer;
347971bb1a5SLionel Sambuc     const xcb_xinerama_query_screens_reply_t *_aux = (xcb_xinerama_query_screens_reply_t *)_buffer;
348971bb1a5SLionel Sambuc     unsigned int xcb_buffer_len = 0;
349971bb1a5SLionel Sambuc     unsigned int xcb_block_len = 0;
350971bb1a5SLionel Sambuc     unsigned int xcb_pad = 0;
351*0a6a1f1dSLionel Sambuc     unsigned int xcb_align_to = 0;
352971bb1a5SLionel Sambuc 
353971bb1a5SLionel Sambuc 
354971bb1a5SLionel Sambuc     xcb_block_len += sizeof(xcb_xinerama_query_screens_reply_t);
355971bb1a5SLionel Sambuc     xcb_tmp += xcb_block_len;
356*0a6a1f1dSLionel Sambuc     xcb_buffer_len += xcb_block_len;
357*0a6a1f1dSLionel Sambuc     xcb_block_len = 0;
358971bb1a5SLionel Sambuc     /* screen_info */
359971bb1a5SLionel Sambuc     xcb_block_len += _aux->number * sizeof(xcb_xinerama_screen_info_t);
360971bb1a5SLionel Sambuc     xcb_tmp += xcb_block_len;
361971bb1a5SLionel Sambuc     xcb_align_to = ALIGNOF(xcb_xinerama_screen_info_t);
362971bb1a5SLionel Sambuc     /* insert padding */
363971bb1a5SLionel Sambuc     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
364971bb1a5SLionel Sambuc     xcb_buffer_len += xcb_block_len + xcb_pad;
365971bb1a5SLionel Sambuc     if (0 != xcb_pad) {
366971bb1a5SLionel Sambuc         xcb_tmp += xcb_pad;
367971bb1a5SLionel Sambuc         xcb_pad = 0;
368971bb1a5SLionel Sambuc     }
369971bb1a5SLionel Sambuc     xcb_block_len = 0;
370971bb1a5SLionel Sambuc 
371971bb1a5SLionel Sambuc     return xcb_buffer_len;
372971bb1a5SLionel Sambuc }
373971bb1a5SLionel Sambuc 
374971bb1a5SLionel Sambuc xcb_xinerama_query_screens_cookie_t
xcb_xinerama_query_screens(xcb_connection_t * c)375971bb1a5SLionel Sambuc xcb_xinerama_query_screens (xcb_connection_t *c  /**< */)
376971bb1a5SLionel Sambuc {
377971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
378971bb1a5SLionel Sambuc         /* count */ 2,
379971bb1a5SLionel Sambuc         /* ext */ &xcb_xinerama_id,
380971bb1a5SLionel Sambuc         /* opcode */ XCB_XINERAMA_QUERY_SCREENS,
381971bb1a5SLionel Sambuc         /* isvoid */ 0
382971bb1a5SLionel Sambuc     };
383971bb1a5SLionel Sambuc 
384971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
385971bb1a5SLionel Sambuc     xcb_xinerama_query_screens_cookie_t xcb_ret;
386971bb1a5SLionel Sambuc     xcb_xinerama_query_screens_request_t xcb_out;
387971bb1a5SLionel Sambuc 
388971bb1a5SLionel Sambuc 
389971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
390971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
391971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
392971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
393971bb1a5SLionel Sambuc 
394971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
395971bb1a5SLionel Sambuc     return xcb_ret;
396971bb1a5SLionel Sambuc }
397971bb1a5SLionel Sambuc 
398971bb1a5SLionel Sambuc xcb_xinerama_query_screens_cookie_t
xcb_xinerama_query_screens_unchecked(xcb_connection_t * c)399971bb1a5SLionel Sambuc xcb_xinerama_query_screens_unchecked (xcb_connection_t *c  /**< */)
400971bb1a5SLionel Sambuc {
401971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
402971bb1a5SLionel Sambuc         /* count */ 2,
403971bb1a5SLionel Sambuc         /* ext */ &xcb_xinerama_id,
404971bb1a5SLionel Sambuc         /* opcode */ XCB_XINERAMA_QUERY_SCREENS,
405971bb1a5SLionel Sambuc         /* isvoid */ 0
406971bb1a5SLionel Sambuc     };
407971bb1a5SLionel Sambuc 
408971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
409971bb1a5SLionel Sambuc     xcb_xinerama_query_screens_cookie_t xcb_ret;
410971bb1a5SLionel Sambuc     xcb_xinerama_query_screens_request_t xcb_out;
411971bb1a5SLionel Sambuc 
412971bb1a5SLionel Sambuc 
413971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
414971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
415971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
416971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
417971bb1a5SLionel Sambuc 
418971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
419971bb1a5SLionel Sambuc     return xcb_ret;
420971bb1a5SLionel Sambuc }
421971bb1a5SLionel Sambuc 
422971bb1a5SLionel Sambuc xcb_xinerama_screen_info_t *
xcb_xinerama_query_screens_screen_info(const xcb_xinerama_query_screens_reply_t * R)423971bb1a5SLionel Sambuc xcb_xinerama_query_screens_screen_info (const xcb_xinerama_query_screens_reply_t *R  /**< */)
424971bb1a5SLionel Sambuc {
425971bb1a5SLionel Sambuc     return (xcb_xinerama_screen_info_t *) (R + 1);
426971bb1a5SLionel Sambuc }
427971bb1a5SLionel Sambuc 
428971bb1a5SLionel Sambuc int
xcb_xinerama_query_screens_screen_info_length(const xcb_xinerama_query_screens_reply_t * R)429971bb1a5SLionel Sambuc xcb_xinerama_query_screens_screen_info_length (const xcb_xinerama_query_screens_reply_t *R  /**< */)
430971bb1a5SLionel Sambuc {
431971bb1a5SLionel Sambuc     return R->number;
432971bb1a5SLionel Sambuc }
433971bb1a5SLionel Sambuc 
434971bb1a5SLionel Sambuc xcb_xinerama_screen_info_iterator_t
xcb_xinerama_query_screens_screen_info_iterator(const xcb_xinerama_query_screens_reply_t * R)435971bb1a5SLionel Sambuc xcb_xinerama_query_screens_screen_info_iterator (const xcb_xinerama_query_screens_reply_t *R  /**< */)
436971bb1a5SLionel Sambuc {
437971bb1a5SLionel Sambuc     xcb_xinerama_screen_info_iterator_t i;
438971bb1a5SLionel Sambuc     i.data = (xcb_xinerama_screen_info_t *) (R + 1);
439971bb1a5SLionel Sambuc     i.rem = R->number;
440971bb1a5SLionel Sambuc     i.index = (char *) i.data - (char *) R;
441971bb1a5SLionel Sambuc     return i;
442971bb1a5SLionel Sambuc }
443971bb1a5SLionel Sambuc 
444971bb1a5SLionel Sambuc xcb_xinerama_query_screens_reply_t *
xcb_xinerama_query_screens_reply(xcb_connection_t * c,xcb_xinerama_query_screens_cookie_t cookie,xcb_generic_error_t ** e)445971bb1a5SLionel Sambuc xcb_xinerama_query_screens_reply (xcb_connection_t                     *c  /**< */,
446971bb1a5SLionel Sambuc                                   xcb_xinerama_query_screens_cookie_t   cookie  /**< */,
447971bb1a5SLionel Sambuc                                   xcb_generic_error_t                 **e  /**< */)
448971bb1a5SLionel Sambuc {
449971bb1a5SLionel Sambuc     return (xcb_xinerama_query_screens_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
450971bb1a5SLionel Sambuc }
451971bb1a5SLionel Sambuc 
452