etc/protocols - sync with NetBSD-8
[minix.git] / external / mit / xorg / lib / libxcb / files / screensaver.c
blob8dfa7009e8791b327476ebe3e822db20b3071c4a
1 /*
2 * This file generated automatically from screensaver.xml by c_client.py.
3 * Edit at your peril.
4 */
6 #ifdef HAVE_CONFIG_H
7 #include "config.h"
8 #endif
9 #include <stdlib.h>
10 #include <string.h>
11 #include <assert.h>
12 #include <stddef.h> /* for offsetof() */
13 #include "xcbext.h"
14 #include "screensaver.h"
16 #define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member)
17 #include "xproto.h"
19 xcb_extension_t xcb_screensaver_id = { "MIT-SCREEN-SAVER", 0 };
21 xcb_screensaver_query_version_cookie_t
22 xcb_screensaver_query_version (xcb_connection_t *c /**< */,
23 uint8_t client_major_version /**< */,
24 uint8_t client_minor_version /**< */)
26 static const xcb_protocol_request_t xcb_req = {
27 /* count */ 2,
28 /* ext */ &xcb_screensaver_id,
29 /* opcode */ XCB_SCREENSAVER_QUERY_VERSION,
30 /* isvoid */ 0
33 struct iovec xcb_parts[4];
34 xcb_screensaver_query_version_cookie_t xcb_ret;
35 xcb_screensaver_query_version_request_t xcb_out;
37 xcb_out.client_major_version = client_major_version;
38 xcb_out.client_minor_version = client_minor_version;
39 memset(xcb_out.pad0, 0, 2);
41 xcb_parts[2].iov_base = (char *) &xcb_out;
42 xcb_parts[2].iov_len = sizeof(xcb_out);
43 xcb_parts[3].iov_base = 0;
44 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
46 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
47 return xcb_ret;
50 xcb_screensaver_query_version_cookie_t
51 xcb_screensaver_query_version_unchecked (xcb_connection_t *c /**< */,
52 uint8_t client_major_version /**< */,
53 uint8_t client_minor_version /**< */)
55 static const xcb_protocol_request_t xcb_req = {
56 /* count */ 2,
57 /* ext */ &xcb_screensaver_id,
58 /* opcode */ XCB_SCREENSAVER_QUERY_VERSION,
59 /* isvoid */ 0
62 struct iovec xcb_parts[4];
63 xcb_screensaver_query_version_cookie_t xcb_ret;
64 xcb_screensaver_query_version_request_t xcb_out;
66 xcb_out.client_major_version = client_major_version;
67 xcb_out.client_minor_version = client_minor_version;
68 memset(xcb_out.pad0, 0, 2);
70 xcb_parts[2].iov_base = (char *) &xcb_out;
71 xcb_parts[2].iov_len = sizeof(xcb_out);
72 xcb_parts[3].iov_base = 0;
73 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
75 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
76 return xcb_ret;
79 xcb_screensaver_query_version_reply_t *
80 xcb_screensaver_query_version_reply (xcb_connection_t *c /**< */,
81 xcb_screensaver_query_version_cookie_t cookie /**< */,
82 xcb_generic_error_t **e /**< */)
84 return (xcb_screensaver_query_version_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
87 xcb_screensaver_query_info_cookie_t
88 xcb_screensaver_query_info (xcb_connection_t *c /**< */,
89 xcb_drawable_t drawable /**< */)
91 static const xcb_protocol_request_t xcb_req = {
92 /* count */ 2,
93 /* ext */ &xcb_screensaver_id,
94 /* opcode */ XCB_SCREENSAVER_QUERY_INFO,
95 /* isvoid */ 0
98 struct iovec xcb_parts[4];
99 xcb_screensaver_query_info_cookie_t xcb_ret;
100 xcb_screensaver_query_info_request_t xcb_out;
102 xcb_out.drawable = drawable;
104 xcb_parts[2].iov_base = (char *) &xcb_out;
105 xcb_parts[2].iov_len = sizeof(xcb_out);
106 xcb_parts[3].iov_base = 0;
107 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
109 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
110 return xcb_ret;
113 xcb_screensaver_query_info_cookie_t
114 xcb_screensaver_query_info_unchecked (xcb_connection_t *c /**< */,
115 xcb_drawable_t drawable /**< */)
117 static const xcb_protocol_request_t xcb_req = {
118 /* count */ 2,
119 /* ext */ &xcb_screensaver_id,
120 /* opcode */ XCB_SCREENSAVER_QUERY_INFO,
121 /* isvoid */ 0
124 struct iovec xcb_parts[4];
125 xcb_screensaver_query_info_cookie_t xcb_ret;
126 xcb_screensaver_query_info_request_t xcb_out;
128 xcb_out.drawable = drawable;
130 xcb_parts[2].iov_base = (char *) &xcb_out;
131 xcb_parts[2].iov_len = sizeof(xcb_out);
132 xcb_parts[3].iov_base = 0;
133 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
135 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
136 return xcb_ret;
139 xcb_screensaver_query_info_reply_t *
140 xcb_screensaver_query_info_reply (xcb_connection_t *c /**< */,
141 xcb_screensaver_query_info_cookie_t cookie /**< */,
142 xcb_generic_error_t **e /**< */)
144 return (xcb_screensaver_query_info_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
147 xcb_void_cookie_t
148 xcb_screensaver_select_input_checked (xcb_connection_t *c /**< */,
149 xcb_drawable_t drawable /**< */,
150 uint32_t event_mask /**< */)
152 static const xcb_protocol_request_t xcb_req = {
153 /* count */ 2,
154 /* ext */ &xcb_screensaver_id,
155 /* opcode */ XCB_SCREENSAVER_SELECT_INPUT,
156 /* isvoid */ 1
159 struct iovec xcb_parts[4];
160 xcb_void_cookie_t xcb_ret;
161 xcb_screensaver_select_input_request_t xcb_out;
163 xcb_out.drawable = drawable;
164 xcb_out.event_mask = event_mask;
166 xcb_parts[2].iov_base = (char *) &xcb_out;
167 xcb_parts[2].iov_len = sizeof(xcb_out);
168 xcb_parts[3].iov_base = 0;
169 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
171 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
172 return xcb_ret;
175 xcb_void_cookie_t
176 xcb_screensaver_select_input (xcb_connection_t *c /**< */,
177 xcb_drawable_t drawable /**< */,
178 uint32_t event_mask /**< */)
180 static const xcb_protocol_request_t xcb_req = {
181 /* count */ 2,
182 /* ext */ &xcb_screensaver_id,
183 /* opcode */ XCB_SCREENSAVER_SELECT_INPUT,
184 /* isvoid */ 1
187 struct iovec xcb_parts[4];
188 xcb_void_cookie_t xcb_ret;
189 xcb_screensaver_select_input_request_t xcb_out;
191 xcb_out.drawable = drawable;
192 xcb_out.event_mask = event_mask;
194 xcb_parts[2].iov_base = (char *) &xcb_out;
195 xcb_parts[2].iov_len = sizeof(xcb_out);
196 xcb_parts[3].iov_base = 0;
197 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
199 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
200 return xcb_ret;
204 xcb_screensaver_set_attributes_sizeof (const void *_buffer /**< */)
206 char *xcb_tmp = (char *)_buffer;
207 const xcb_screensaver_set_attributes_request_t *_aux = (xcb_screensaver_set_attributes_request_t *)_buffer;
208 unsigned int xcb_buffer_len = 0;
209 unsigned int xcb_block_len = 0;
210 unsigned int xcb_pad = 0;
211 unsigned int xcb_align_to = 0;
214 xcb_block_len += sizeof(xcb_screensaver_set_attributes_request_t);
215 xcb_tmp += xcb_block_len;
216 xcb_buffer_len += xcb_block_len;
217 xcb_block_len = 0;
218 /* value_list */
219 xcb_block_len += xcb_popcount(_aux->value_mask) * sizeof(uint32_t);
220 xcb_tmp += xcb_block_len;
221 xcb_align_to = ALIGNOF(uint32_t);
222 /* insert padding */
223 xcb_pad = -xcb_block_len & (xcb_align_to - 1);
224 xcb_buffer_len += xcb_block_len + xcb_pad;
225 if (0 != xcb_pad) {
226 xcb_tmp += xcb_pad;
227 xcb_pad = 0;
229 xcb_block_len = 0;
231 return xcb_buffer_len;
234 xcb_void_cookie_t
235 xcb_screensaver_set_attributes_checked (xcb_connection_t *c /**< */,
236 xcb_drawable_t drawable /**< */,
237 int16_t x /**< */,
238 int16_t y /**< */,
239 uint16_t width /**< */,
240 uint16_t height /**< */,
241 uint16_t border_width /**< */,
242 uint8_t _class /**< */,
243 uint8_t depth /**< */,
244 xcb_visualid_t visual /**< */,
245 uint32_t value_mask /**< */,
246 const uint32_t *value_list /**< */)
248 static const xcb_protocol_request_t xcb_req = {
249 /* count */ 4,
250 /* ext */ &xcb_screensaver_id,
251 /* opcode */ XCB_SCREENSAVER_SET_ATTRIBUTES,
252 /* isvoid */ 1
255 struct iovec xcb_parts[6];
256 xcb_void_cookie_t xcb_ret;
257 xcb_screensaver_set_attributes_request_t xcb_out;
259 xcb_out.drawable = drawable;
260 xcb_out.x = x;
261 xcb_out.y = y;
262 xcb_out.width = width;
263 xcb_out.height = height;
264 xcb_out.border_width = border_width;
265 xcb_out._class = _class;
266 xcb_out.depth = depth;
267 xcb_out.visual = visual;
268 xcb_out.value_mask = value_mask;
270 xcb_parts[2].iov_base = (char *) &xcb_out;
271 xcb_parts[2].iov_len = sizeof(xcb_out);
272 xcb_parts[3].iov_base = 0;
273 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
274 /* uint32_t value_list */
275 xcb_parts[4].iov_base = (char *) value_list;
276 xcb_parts[4].iov_len = xcb_popcount(value_mask) * sizeof(uint32_t);
277 xcb_parts[5].iov_base = 0;
278 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
280 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
281 return xcb_ret;
284 xcb_void_cookie_t
285 xcb_screensaver_set_attributes (xcb_connection_t *c /**< */,
286 xcb_drawable_t drawable /**< */,
287 int16_t x /**< */,
288 int16_t y /**< */,
289 uint16_t width /**< */,
290 uint16_t height /**< */,
291 uint16_t border_width /**< */,
292 uint8_t _class /**< */,
293 uint8_t depth /**< */,
294 xcb_visualid_t visual /**< */,
295 uint32_t value_mask /**< */,
296 const uint32_t *value_list /**< */)
298 static const xcb_protocol_request_t xcb_req = {
299 /* count */ 4,
300 /* ext */ &xcb_screensaver_id,
301 /* opcode */ XCB_SCREENSAVER_SET_ATTRIBUTES,
302 /* isvoid */ 1
305 struct iovec xcb_parts[6];
306 xcb_void_cookie_t xcb_ret;
307 xcb_screensaver_set_attributes_request_t xcb_out;
309 xcb_out.drawable = drawable;
310 xcb_out.x = x;
311 xcb_out.y = y;
312 xcb_out.width = width;
313 xcb_out.height = height;
314 xcb_out.border_width = border_width;
315 xcb_out._class = _class;
316 xcb_out.depth = depth;
317 xcb_out.visual = visual;
318 xcb_out.value_mask = value_mask;
320 xcb_parts[2].iov_base = (char *) &xcb_out;
321 xcb_parts[2].iov_len = sizeof(xcb_out);
322 xcb_parts[3].iov_base = 0;
323 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
324 /* uint32_t value_list */
325 xcb_parts[4].iov_base = (char *) value_list;
326 xcb_parts[4].iov_len = xcb_popcount(value_mask) * sizeof(uint32_t);
327 xcb_parts[5].iov_base = 0;
328 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
330 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
331 return xcb_ret;
334 xcb_void_cookie_t
335 xcb_screensaver_unset_attributes_checked (xcb_connection_t *c /**< */,
336 xcb_drawable_t drawable /**< */)
338 static const xcb_protocol_request_t xcb_req = {
339 /* count */ 2,
340 /* ext */ &xcb_screensaver_id,
341 /* opcode */ XCB_SCREENSAVER_UNSET_ATTRIBUTES,
342 /* isvoid */ 1
345 struct iovec xcb_parts[4];
346 xcb_void_cookie_t xcb_ret;
347 xcb_screensaver_unset_attributes_request_t xcb_out;
349 xcb_out.drawable = drawable;
351 xcb_parts[2].iov_base = (char *) &xcb_out;
352 xcb_parts[2].iov_len = sizeof(xcb_out);
353 xcb_parts[3].iov_base = 0;
354 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
356 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
357 return xcb_ret;
360 xcb_void_cookie_t
361 xcb_screensaver_unset_attributes (xcb_connection_t *c /**< */,
362 xcb_drawable_t drawable /**< */)
364 static const xcb_protocol_request_t xcb_req = {
365 /* count */ 2,
366 /* ext */ &xcb_screensaver_id,
367 /* opcode */ XCB_SCREENSAVER_UNSET_ATTRIBUTES,
368 /* isvoid */ 1
371 struct iovec xcb_parts[4];
372 xcb_void_cookie_t xcb_ret;
373 xcb_screensaver_unset_attributes_request_t xcb_out;
375 xcb_out.drawable = drawable;
377 xcb_parts[2].iov_base = (char *) &xcb_out;
378 xcb_parts[2].iov_len = sizeof(xcb_out);
379 xcb_parts[3].iov_base = 0;
380 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
382 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
383 return xcb_ret;
386 xcb_void_cookie_t
387 xcb_screensaver_suspend_checked (xcb_connection_t *c /**< */,
388 uint8_t suspend /**< */)
390 static const xcb_protocol_request_t xcb_req = {
391 /* count */ 2,
392 /* ext */ &xcb_screensaver_id,
393 /* opcode */ XCB_SCREENSAVER_SUSPEND,
394 /* isvoid */ 1
397 struct iovec xcb_parts[4];
398 xcb_void_cookie_t xcb_ret;
399 xcb_screensaver_suspend_request_t xcb_out;
401 xcb_out.suspend = suspend;
402 memset(xcb_out.pad0, 0, 3);
404 xcb_parts[2].iov_base = (char *) &xcb_out;
405 xcb_parts[2].iov_len = sizeof(xcb_out);
406 xcb_parts[3].iov_base = 0;
407 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
409 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
410 return xcb_ret;
413 xcb_void_cookie_t
414 xcb_screensaver_suspend (xcb_connection_t *c /**< */,
415 uint8_t suspend /**< */)
417 static const xcb_protocol_request_t xcb_req = {
418 /* count */ 2,
419 /* ext */ &xcb_screensaver_id,
420 /* opcode */ XCB_SCREENSAVER_SUSPEND,
421 /* isvoid */ 1
424 struct iovec xcb_parts[4];
425 xcb_void_cookie_t xcb_ret;
426 xcb_screensaver_suspend_request_t xcb_out;
428 xcb_out.suspend = suspend;
429 memset(xcb_out.pad0, 0, 3);
431 xcb_parts[2].iov_base = (char *) &xcb_out;
432 xcb_parts[2].iov_len = sizeof(xcb_out);
433 xcb_parts[3].iov_base = 0;
434 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
436 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
437 return xcb_ret;