xref: /minix3/external/mit/xorg/lib/libxcb/files/screensaver.c (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1971bb1a5SLionel Sambuc /*
2971bb1a5SLionel Sambuc  * This file generated automatically from screensaver.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 "screensaver.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_screensaver_id = { "MIT-SCREEN-SAVER", 0 };
20971bb1a5SLionel Sambuc 
21971bb1a5SLionel Sambuc xcb_screensaver_query_version_cookie_t
xcb_screensaver_query_version(xcb_connection_t * c,uint8_t client_major_version,uint8_t client_minor_version)22971bb1a5SLionel Sambuc xcb_screensaver_query_version (xcb_connection_t *c  /**< */,
23971bb1a5SLionel Sambuc                                uint8_t           client_major_version  /**< */,
24971bb1a5SLionel Sambuc                                uint8_t           client_minor_version  /**< */)
25971bb1a5SLionel Sambuc {
26971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
27971bb1a5SLionel Sambuc         /* count */ 2,
28971bb1a5SLionel Sambuc         /* ext */ &xcb_screensaver_id,
29971bb1a5SLionel Sambuc         /* opcode */ XCB_SCREENSAVER_QUERY_VERSION,
30971bb1a5SLionel Sambuc         /* isvoid */ 0
31971bb1a5SLionel Sambuc     };
32971bb1a5SLionel Sambuc 
33971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
34971bb1a5SLionel Sambuc     xcb_screensaver_query_version_cookie_t xcb_ret;
35971bb1a5SLionel Sambuc     xcb_screensaver_query_version_request_t xcb_out;
36971bb1a5SLionel Sambuc 
37971bb1a5SLionel Sambuc     xcb_out.client_major_version = client_major_version;
38971bb1a5SLionel Sambuc     xcb_out.client_minor_version = client_minor_version;
39971bb1a5SLionel Sambuc     memset(xcb_out.pad0, 0, 2);
40971bb1a5SLionel Sambuc 
41971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
42971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
43971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
44971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
45971bb1a5SLionel Sambuc 
46971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
47971bb1a5SLionel Sambuc     return xcb_ret;
48971bb1a5SLionel Sambuc }
49971bb1a5SLionel Sambuc 
50971bb1a5SLionel Sambuc xcb_screensaver_query_version_cookie_t
xcb_screensaver_query_version_unchecked(xcb_connection_t * c,uint8_t client_major_version,uint8_t client_minor_version)51971bb1a5SLionel Sambuc xcb_screensaver_query_version_unchecked (xcb_connection_t *c  /**< */,
52971bb1a5SLionel Sambuc                                          uint8_t           client_major_version  /**< */,
53971bb1a5SLionel Sambuc                                          uint8_t           client_minor_version  /**< */)
54971bb1a5SLionel Sambuc {
55971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
56971bb1a5SLionel Sambuc         /* count */ 2,
57971bb1a5SLionel Sambuc         /* ext */ &xcb_screensaver_id,
58971bb1a5SLionel Sambuc         /* opcode */ XCB_SCREENSAVER_QUERY_VERSION,
59971bb1a5SLionel Sambuc         /* isvoid */ 0
60971bb1a5SLionel Sambuc     };
61971bb1a5SLionel Sambuc 
62971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
63971bb1a5SLionel Sambuc     xcb_screensaver_query_version_cookie_t xcb_ret;
64971bb1a5SLionel Sambuc     xcb_screensaver_query_version_request_t xcb_out;
65971bb1a5SLionel Sambuc 
66971bb1a5SLionel Sambuc     xcb_out.client_major_version = client_major_version;
67971bb1a5SLionel Sambuc     xcb_out.client_minor_version = client_minor_version;
68971bb1a5SLionel Sambuc     memset(xcb_out.pad0, 0, 2);
69971bb1a5SLionel Sambuc 
70971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
71971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
72971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
73971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
74971bb1a5SLionel Sambuc 
75971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
76971bb1a5SLionel Sambuc     return xcb_ret;
77971bb1a5SLionel Sambuc }
78971bb1a5SLionel Sambuc 
79971bb1a5SLionel Sambuc xcb_screensaver_query_version_reply_t *
xcb_screensaver_query_version_reply(xcb_connection_t * c,xcb_screensaver_query_version_cookie_t cookie,xcb_generic_error_t ** e)80971bb1a5SLionel Sambuc xcb_screensaver_query_version_reply (xcb_connection_t                        *c  /**< */,
81971bb1a5SLionel Sambuc                                      xcb_screensaver_query_version_cookie_t   cookie  /**< */,
82971bb1a5SLionel Sambuc                                      xcb_generic_error_t                    **e  /**< */)
83971bb1a5SLionel Sambuc {
84971bb1a5SLionel Sambuc     return (xcb_screensaver_query_version_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
85971bb1a5SLionel Sambuc }
86971bb1a5SLionel Sambuc 
87971bb1a5SLionel Sambuc xcb_screensaver_query_info_cookie_t
xcb_screensaver_query_info(xcb_connection_t * c,xcb_drawable_t drawable)88971bb1a5SLionel Sambuc xcb_screensaver_query_info (xcb_connection_t *c  /**< */,
89971bb1a5SLionel Sambuc                             xcb_drawable_t    drawable  /**< */)
90971bb1a5SLionel Sambuc {
91971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
92971bb1a5SLionel Sambuc         /* count */ 2,
93971bb1a5SLionel Sambuc         /* ext */ &xcb_screensaver_id,
94971bb1a5SLionel Sambuc         /* opcode */ XCB_SCREENSAVER_QUERY_INFO,
95971bb1a5SLionel Sambuc         /* isvoid */ 0
96971bb1a5SLionel Sambuc     };
97971bb1a5SLionel Sambuc 
98971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
99971bb1a5SLionel Sambuc     xcb_screensaver_query_info_cookie_t xcb_ret;
100971bb1a5SLionel Sambuc     xcb_screensaver_query_info_request_t xcb_out;
101971bb1a5SLionel Sambuc 
102971bb1a5SLionel Sambuc     xcb_out.drawable = drawable;
103971bb1a5SLionel Sambuc 
104971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
105971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
106971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
107971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
108971bb1a5SLionel Sambuc 
109971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
110971bb1a5SLionel Sambuc     return xcb_ret;
111971bb1a5SLionel Sambuc }
112971bb1a5SLionel Sambuc 
113971bb1a5SLionel Sambuc xcb_screensaver_query_info_cookie_t
xcb_screensaver_query_info_unchecked(xcb_connection_t * c,xcb_drawable_t drawable)114971bb1a5SLionel Sambuc xcb_screensaver_query_info_unchecked (xcb_connection_t *c  /**< */,
115971bb1a5SLionel Sambuc                                       xcb_drawable_t    drawable  /**< */)
116971bb1a5SLionel Sambuc {
117971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
118971bb1a5SLionel Sambuc         /* count */ 2,
119971bb1a5SLionel Sambuc         /* ext */ &xcb_screensaver_id,
120971bb1a5SLionel Sambuc         /* opcode */ XCB_SCREENSAVER_QUERY_INFO,
121971bb1a5SLionel Sambuc         /* isvoid */ 0
122971bb1a5SLionel Sambuc     };
123971bb1a5SLionel Sambuc 
124971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
125971bb1a5SLionel Sambuc     xcb_screensaver_query_info_cookie_t xcb_ret;
126971bb1a5SLionel Sambuc     xcb_screensaver_query_info_request_t xcb_out;
127971bb1a5SLionel Sambuc 
128971bb1a5SLionel Sambuc     xcb_out.drawable = drawable;
129971bb1a5SLionel Sambuc 
130971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
131971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
132971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
133971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
134971bb1a5SLionel Sambuc 
135971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
136971bb1a5SLionel Sambuc     return xcb_ret;
137971bb1a5SLionel Sambuc }
138971bb1a5SLionel Sambuc 
139971bb1a5SLionel Sambuc xcb_screensaver_query_info_reply_t *
xcb_screensaver_query_info_reply(xcb_connection_t * c,xcb_screensaver_query_info_cookie_t cookie,xcb_generic_error_t ** e)140971bb1a5SLionel Sambuc xcb_screensaver_query_info_reply (xcb_connection_t                     *c  /**< */,
141971bb1a5SLionel Sambuc                                   xcb_screensaver_query_info_cookie_t   cookie  /**< */,
142971bb1a5SLionel Sambuc                                   xcb_generic_error_t                 **e  /**< */)
143971bb1a5SLionel Sambuc {
144971bb1a5SLionel Sambuc     return (xcb_screensaver_query_info_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
145971bb1a5SLionel Sambuc }
146971bb1a5SLionel Sambuc 
147971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_screensaver_select_input_checked(xcb_connection_t * c,xcb_drawable_t drawable,uint32_t event_mask)148971bb1a5SLionel Sambuc xcb_screensaver_select_input_checked (xcb_connection_t *c  /**< */,
149971bb1a5SLionel Sambuc                                       xcb_drawable_t    drawable  /**< */,
150971bb1a5SLionel Sambuc                                       uint32_t          event_mask  /**< */)
151971bb1a5SLionel Sambuc {
152971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
153971bb1a5SLionel Sambuc         /* count */ 2,
154971bb1a5SLionel Sambuc         /* ext */ &xcb_screensaver_id,
155971bb1a5SLionel Sambuc         /* opcode */ XCB_SCREENSAVER_SELECT_INPUT,
156971bb1a5SLionel Sambuc         /* isvoid */ 1
157971bb1a5SLionel Sambuc     };
158971bb1a5SLionel Sambuc 
159971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
160971bb1a5SLionel Sambuc     xcb_void_cookie_t xcb_ret;
161971bb1a5SLionel Sambuc     xcb_screensaver_select_input_request_t xcb_out;
162971bb1a5SLionel Sambuc 
163971bb1a5SLionel Sambuc     xcb_out.drawable = drawable;
164971bb1a5SLionel Sambuc     xcb_out.event_mask = event_mask;
165971bb1a5SLionel Sambuc 
166971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
167971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
168971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
169971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
170971bb1a5SLionel Sambuc 
171971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
172971bb1a5SLionel Sambuc     return xcb_ret;
173971bb1a5SLionel Sambuc }
174971bb1a5SLionel Sambuc 
175971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_screensaver_select_input(xcb_connection_t * c,xcb_drawable_t drawable,uint32_t event_mask)176971bb1a5SLionel Sambuc xcb_screensaver_select_input (xcb_connection_t *c  /**< */,
177971bb1a5SLionel Sambuc                               xcb_drawable_t    drawable  /**< */,
178971bb1a5SLionel Sambuc                               uint32_t          event_mask  /**< */)
179971bb1a5SLionel Sambuc {
180971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
181971bb1a5SLionel Sambuc         /* count */ 2,
182971bb1a5SLionel Sambuc         /* ext */ &xcb_screensaver_id,
183971bb1a5SLionel Sambuc         /* opcode */ XCB_SCREENSAVER_SELECT_INPUT,
184971bb1a5SLionel Sambuc         /* isvoid */ 1
185971bb1a5SLionel Sambuc     };
186971bb1a5SLionel Sambuc 
187971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
188971bb1a5SLionel Sambuc     xcb_void_cookie_t xcb_ret;
189971bb1a5SLionel Sambuc     xcb_screensaver_select_input_request_t xcb_out;
190971bb1a5SLionel Sambuc 
191971bb1a5SLionel Sambuc     xcb_out.drawable = drawable;
192971bb1a5SLionel Sambuc     xcb_out.event_mask = event_mask;
193971bb1a5SLionel Sambuc 
194971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
195971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
196971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
197971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
198971bb1a5SLionel Sambuc 
199971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
200971bb1a5SLionel Sambuc     return xcb_ret;
201971bb1a5SLionel Sambuc }
202971bb1a5SLionel Sambuc 
203971bb1a5SLionel Sambuc int
xcb_screensaver_set_attributes_sizeof(const void * _buffer)204971bb1a5SLionel Sambuc xcb_screensaver_set_attributes_sizeof (const void  *_buffer  /**< */)
205971bb1a5SLionel Sambuc {
206971bb1a5SLionel Sambuc     char *xcb_tmp = (char *)_buffer;
207971bb1a5SLionel Sambuc     const xcb_screensaver_set_attributes_request_t *_aux = (xcb_screensaver_set_attributes_request_t *)_buffer;
208971bb1a5SLionel Sambuc     unsigned int xcb_buffer_len = 0;
209971bb1a5SLionel Sambuc     unsigned int xcb_block_len = 0;
210971bb1a5SLionel Sambuc     unsigned int xcb_pad = 0;
211*0a6a1f1dSLionel Sambuc     unsigned int xcb_align_to = 0;
212971bb1a5SLionel Sambuc 
213971bb1a5SLionel Sambuc 
214971bb1a5SLionel Sambuc     xcb_block_len += sizeof(xcb_screensaver_set_attributes_request_t);
215971bb1a5SLionel Sambuc     xcb_tmp += xcb_block_len;
216*0a6a1f1dSLionel Sambuc     xcb_buffer_len += xcb_block_len;
217*0a6a1f1dSLionel Sambuc     xcb_block_len = 0;
218971bb1a5SLionel Sambuc     /* value_list */
219971bb1a5SLionel Sambuc     xcb_block_len += xcb_popcount(_aux->value_mask) * sizeof(uint32_t);
220971bb1a5SLionel Sambuc     xcb_tmp += xcb_block_len;
221971bb1a5SLionel Sambuc     xcb_align_to = ALIGNOF(uint32_t);
222971bb1a5SLionel Sambuc     /* insert padding */
223971bb1a5SLionel Sambuc     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
224971bb1a5SLionel Sambuc     xcb_buffer_len += xcb_block_len + xcb_pad;
225971bb1a5SLionel Sambuc     if (0 != xcb_pad) {
226971bb1a5SLionel Sambuc         xcb_tmp += xcb_pad;
227971bb1a5SLionel Sambuc         xcb_pad = 0;
228971bb1a5SLionel Sambuc     }
229971bb1a5SLionel Sambuc     xcb_block_len = 0;
230971bb1a5SLionel Sambuc 
231971bb1a5SLionel Sambuc     return xcb_buffer_len;
232971bb1a5SLionel Sambuc }
233971bb1a5SLionel Sambuc 
234971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_screensaver_set_attributes_checked(xcb_connection_t * c,xcb_drawable_t drawable,int16_t x,int16_t y,uint16_t width,uint16_t height,uint16_t border_width,uint8_t _class,uint8_t depth,xcb_visualid_t visual,uint32_t value_mask,const uint32_t * value_list)235971bb1a5SLionel Sambuc xcb_screensaver_set_attributes_checked (xcb_connection_t *c  /**< */,
236971bb1a5SLionel Sambuc                                         xcb_drawable_t    drawable  /**< */,
237971bb1a5SLionel Sambuc                                         int16_t           x  /**< */,
238971bb1a5SLionel Sambuc                                         int16_t           y  /**< */,
239971bb1a5SLionel Sambuc                                         uint16_t          width  /**< */,
240971bb1a5SLionel Sambuc                                         uint16_t          height  /**< */,
241971bb1a5SLionel Sambuc                                         uint16_t          border_width  /**< */,
242971bb1a5SLionel Sambuc                                         uint8_t           _class  /**< */,
243971bb1a5SLionel Sambuc                                         uint8_t           depth  /**< */,
244971bb1a5SLionel Sambuc                                         xcb_visualid_t    visual  /**< */,
245971bb1a5SLionel Sambuc                                         uint32_t          value_mask  /**< */,
246971bb1a5SLionel Sambuc                                         const uint32_t   *value_list  /**< */)
247971bb1a5SLionel Sambuc {
248971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
249971bb1a5SLionel Sambuc         /* count */ 4,
250971bb1a5SLionel Sambuc         /* ext */ &xcb_screensaver_id,
251971bb1a5SLionel Sambuc         /* opcode */ XCB_SCREENSAVER_SET_ATTRIBUTES,
252971bb1a5SLionel Sambuc         /* isvoid */ 1
253971bb1a5SLionel Sambuc     };
254971bb1a5SLionel Sambuc 
255971bb1a5SLionel Sambuc     struct iovec xcb_parts[6];
256971bb1a5SLionel Sambuc     xcb_void_cookie_t xcb_ret;
257971bb1a5SLionel Sambuc     xcb_screensaver_set_attributes_request_t xcb_out;
258971bb1a5SLionel Sambuc 
259971bb1a5SLionel Sambuc     xcb_out.drawable = drawable;
260971bb1a5SLionel Sambuc     xcb_out.x = x;
261971bb1a5SLionel Sambuc     xcb_out.y = y;
262971bb1a5SLionel Sambuc     xcb_out.width = width;
263971bb1a5SLionel Sambuc     xcb_out.height = height;
264971bb1a5SLionel Sambuc     xcb_out.border_width = border_width;
265971bb1a5SLionel Sambuc     xcb_out._class = _class;
266971bb1a5SLionel Sambuc     xcb_out.depth = depth;
267971bb1a5SLionel Sambuc     xcb_out.visual = visual;
268971bb1a5SLionel Sambuc     xcb_out.value_mask = value_mask;
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     /* uint32_t value_list */
275971bb1a5SLionel Sambuc     xcb_parts[4].iov_base = (char *) value_list;
276971bb1a5SLionel Sambuc     xcb_parts[4].iov_len = xcb_popcount(value_mask) * sizeof(uint32_t);
277971bb1a5SLionel Sambuc     xcb_parts[5].iov_base = 0;
278971bb1a5SLionel Sambuc     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
279971bb1a5SLionel Sambuc 
280971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
281971bb1a5SLionel Sambuc     return xcb_ret;
282971bb1a5SLionel Sambuc }
283971bb1a5SLionel Sambuc 
284971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_screensaver_set_attributes(xcb_connection_t * c,xcb_drawable_t drawable,int16_t x,int16_t y,uint16_t width,uint16_t height,uint16_t border_width,uint8_t _class,uint8_t depth,xcb_visualid_t visual,uint32_t value_mask,const uint32_t * value_list)285971bb1a5SLionel Sambuc xcb_screensaver_set_attributes (xcb_connection_t *c  /**< */,
286971bb1a5SLionel Sambuc                                 xcb_drawable_t    drawable  /**< */,
287971bb1a5SLionel Sambuc                                 int16_t           x  /**< */,
288971bb1a5SLionel Sambuc                                 int16_t           y  /**< */,
289971bb1a5SLionel Sambuc                                 uint16_t          width  /**< */,
290971bb1a5SLionel Sambuc                                 uint16_t          height  /**< */,
291971bb1a5SLionel Sambuc                                 uint16_t          border_width  /**< */,
292971bb1a5SLionel Sambuc                                 uint8_t           _class  /**< */,
293971bb1a5SLionel Sambuc                                 uint8_t           depth  /**< */,
294971bb1a5SLionel Sambuc                                 xcb_visualid_t    visual  /**< */,
295971bb1a5SLionel Sambuc                                 uint32_t          value_mask  /**< */,
296971bb1a5SLionel Sambuc                                 const uint32_t   *value_list  /**< */)
297971bb1a5SLionel Sambuc {
298971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
299971bb1a5SLionel Sambuc         /* count */ 4,
300971bb1a5SLionel Sambuc         /* ext */ &xcb_screensaver_id,
301971bb1a5SLionel Sambuc         /* opcode */ XCB_SCREENSAVER_SET_ATTRIBUTES,
302971bb1a5SLionel Sambuc         /* isvoid */ 1
303971bb1a5SLionel Sambuc     };
304971bb1a5SLionel Sambuc 
305971bb1a5SLionel Sambuc     struct iovec xcb_parts[6];
306971bb1a5SLionel Sambuc     xcb_void_cookie_t xcb_ret;
307971bb1a5SLionel Sambuc     xcb_screensaver_set_attributes_request_t xcb_out;
308971bb1a5SLionel Sambuc 
309971bb1a5SLionel Sambuc     xcb_out.drawable = drawable;
310971bb1a5SLionel Sambuc     xcb_out.x = x;
311971bb1a5SLionel Sambuc     xcb_out.y = y;
312971bb1a5SLionel Sambuc     xcb_out.width = width;
313971bb1a5SLionel Sambuc     xcb_out.height = height;
314971bb1a5SLionel Sambuc     xcb_out.border_width = border_width;
315971bb1a5SLionel Sambuc     xcb_out._class = _class;
316971bb1a5SLionel Sambuc     xcb_out.depth = depth;
317971bb1a5SLionel Sambuc     xcb_out.visual = visual;
318971bb1a5SLionel Sambuc     xcb_out.value_mask = value_mask;
319971bb1a5SLionel Sambuc 
320971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
321971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
322971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
323971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
324971bb1a5SLionel Sambuc     /* uint32_t value_list */
325971bb1a5SLionel Sambuc     xcb_parts[4].iov_base = (char *) value_list;
326971bb1a5SLionel Sambuc     xcb_parts[4].iov_len = xcb_popcount(value_mask) * sizeof(uint32_t);
327971bb1a5SLionel Sambuc     xcb_parts[5].iov_base = 0;
328971bb1a5SLionel Sambuc     xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
329971bb1a5SLionel Sambuc 
330971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
331971bb1a5SLionel Sambuc     return xcb_ret;
332971bb1a5SLionel Sambuc }
333971bb1a5SLionel Sambuc 
334971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_screensaver_unset_attributes_checked(xcb_connection_t * c,xcb_drawable_t drawable)335971bb1a5SLionel Sambuc xcb_screensaver_unset_attributes_checked (xcb_connection_t *c  /**< */,
336971bb1a5SLionel Sambuc                                           xcb_drawable_t    drawable  /**< */)
337971bb1a5SLionel Sambuc {
338971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
339971bb1a5SLionel Sambuc         /* count */ 2,
340971bb1a5SLionel Sambuc         /* ext */ &xcb_screensaver_id,
341971bb1a5SLionel Sambuc         /* opcode */ XCB_SCREENSAVER_UNSET_ATTRIBUTES,
342971bb1a5SLionel Sambuc         /* isvoid */ 1
343971bb1a5SLionel Sambuc     };
344971bb1a5SLionel Sambuc 
345971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
346971bb1a5SLionel Sambuc     xcb_void_cookie_t xcb_ret;
347971bb1a5SLionel Sambuc     xcb_screensaver_unset_attributes_request_t xcb_out;
348971bb1a5SLionel Sambuc 
349971bb1a5SLionel Sambuc     xcb_out.drawable = drawable;
350971bb1a5SLionel Sambuc 
351971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
352971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
353971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
354971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
355971bb1a5SLionel Sambuc 
356971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
357971bb1a5SLionel Sambuc     return xcb_ret;
358971bb1a5SLionel Sambuc }
359971bb1a5SLionel Sambuc 
360971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_screensaver_unset_attributes(xcb_connection_t * c,xcb_drawable_t drawable)361971bb1a5SLionel Sambuc xcb_screensaver_unset_attributes (xcb_connection_t *c  /**< */,
362971bb1a5SLionel Sambuc                                   xcb_drawable_t    drawable  /**< */)
363971bb1a5SLionel Sambuc {
364971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
365971bb1a5SLionel Sambuc         /* count */ 2,
366971bb1a5SLionel Sambuc         /* ext */ &xcb_screensaver_id,
367971bb1a5SLionel Sambuc         /* opcode */ XCB_SCREENSAVER_UNSET_ATTRIBUTES,
368971bb1a5SLionel Sambuc         /* isvoid */ 1
369971bb1a5SLionel Sambuc     };
370971bb1a5SLionel Sambuc 
371971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
372971bb1a5SLionel Sambuc     xcb_void_cookie_t xcb_ret;
373971bb1a5SLionel Sambuc     xcb_screensaver_unset_attributes_request_t xcb_out;
374971bb1a5SLionel Sambuc 
375971bb1a5SLionel Sambuc     xcb_out.drawable = drawable;
376971bb1a5SLionel Sambuc 
377971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
378971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
379971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
380971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
381971bb1a5SLionel Sambuc 
382971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
383971bb1a5SLionel Sambuc     return xcb_ret;
384971bb1a5SLionel Sambuc }
385971bb1a5SLionel Sambuc 
386971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_screensaver_suspend_checked(xcb_connection_t * c,uint8_t suspend)387971bb1a5SLionel Sambuc xcb_screensaver_suspend_checked (xcb_connection_t *c  /**< */,
388971bb1a5SLionel Sambuc                                  uint8_t           suspend  /**< */)
389971bb1a5SLionel Sambuc {
390971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
391971bb1a5SLionel Sambuc         /* count */ 2,
392971bb1a5SLionel Sambuc         /* ext */ &xcb_screensaver_id,
393971bb1a5SLionel Sambuc         /* opcode */ XCB_SCREENSAVER_SUSPEND,
394971bb1a5SLionel Sambuc         /* isvoid */ 1
395971bb1a5SLionel Sambuc     };
396971bb1a5SLionel Sambuc 
397971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
398971bb1a5SLionel Sambuc     xcb_void_cookie_t xcb_ret;
399971bb1a5SLionel Sambuc     xcb_screensaver_suspend_request_t xcb_out;
400971bb1a5SLionel Sambuc 
401971bb1a5SLionel Sambuc     xcb_out.suspend = suspend;
402971bb1a5SLionel Sambuc     memset(xcb_out.pad0, 0, 3);
403971bb1a5SLionel Sambuc 
404971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
405971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
406971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
407971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
408971bb1a5SLionel Sambuc 
409971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
410971bb1a5SLionel Sambuc     return xcb_ret;
411971bb1a5SLionel Sambuc }
412971bb1a5SLionel Sambuc 
413971bb1a5SLionel Sambuc xcb_void_cookie_t
xcb_screensaver_suspend(xcb_connection_t * c,uint8_t suspend)414971bb1a5SLionel Sambuc xcb_screensaver_suspend (xcb_connection_t *c  /**< */,
415971bb1a5SLionel Sambuc                          uint8_t           suspend  /**< */)
416971bb1a5SLionel Sambuc {
417971bb1a5SLionel Sambuc     static const xcb_protocol_request_t xcb_req = {
418971bb1a5SLionel Sambuc         /* count */ 2,
419971bb1a5SLionel Sambuc         /* ext */ &xcb_screensaver_id,
420971bb1a5SLionel Sambuc         /* opcode */ XCB_SCREENSAVER_SUSPEND,
421971bb1a5SLionel Sambuc         /* isvoid */ 1
422971bb1a5SLionel Sambuc     };
423971bb1a5SLionel Sambuc 
424971bb1a5SLionel Sambuc     struct iovec xcb_parts[4];
425971bb1a5SLionel Sambuc     xcb_void_cookie_t xcb_ret;
426971bb1a5SLionel Sambuc     xcb_screensaver_suspend_request_t xcb_out;
427971bb1a5SLionel Sambuc 
428971bb1a5SLionel Sambuc     xcb_out.suspend = suspend;
429971bb1a5SLionel Sambuc     memset(xcb_out.pad0, 0, 3);
430971bb1a5SLionel Sambuc 
431971bb1a5SLionel Sambuc     xcb_parts[2].iov_base = (char *) &xcb_out;
432971bb1a5SLionel Sambuc     xcb_parts[2].iov_len = sizeof(xcb_out);
433971bb1a5SLionel Sambuc     xcb_parts[3].iov_base = 0;
434971bb1a5SLionel Sambuc     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
435971bb1a5SLionel Sambuc 
436971bb1a5SLionel Sambuc     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
437971bb1a5SLionel Sambuc     return xcb_ret;
438971bb1a5SLionel Sambuc }
439971bb1a5SLionel Sambuc 
440