xref: /minix/external/mit/xorg/lib/libxcb/files/dpms.c (revision 0a6a1f1d)
1 /*
2  * This file generated automatically from dpms.xml by c_client.py.
3  * Edit at your peril.
4  */
5 
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 "dpms.h"
15 
16 #define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member)
17 
18 xcb_extension_t xcb_dpms_id = { "DPMS", 0 };
19 
20 xcb_dpms_get_version_cookie_t
xcb_dpms_get_version(xcb_connection_t * c,uint16_t client_major_version,uint16_t client_minor_version)21 xcb_dpms_get_version (xcb_connection_t *c  /**< */,
22                       uint16_t          client_major_version  /**< */,
23                       uint16_t          client_minor_version  /**< */)
24 {
25     static const xcb_protocol_request_t xcb_req = {
26         /* count */ 2,
27         /* ext */ &xcb_dpms_id,
28         /* opcode */ XCB_DPMS_GET_VERSION,
29         /* isvoid */ 0
30     };
31 
32     struct iovec xcb_parts[4];
33     xcb_dpms_get_version_cookie_t xcb_ret;
34     xcb_dpms_get_version_request_t xcb_out;
35 
36     xcb_out.client_major_version = client_major_version;
37     xcb_out.client_minor_version = client_minor_version;
38 
39     xcb_parts[2].iov_base = (char *) &xcb_out;
40     xcb_parts[2].iov_len = sizeof(xcb_out);
41     xcb_parts[3].iov_base = 0;
42     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
43 
44     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
45     return xcb_ret;
46 }
47 
48 xcb_dpms_get_version_cookie_t
xcb_dpms_get_version_unchecked(xcb_connection_t * c,uint16_t client_major_version,uint16_t client_minor_version)49 xcb_dpms_get_version_unchecked (xcb_connection_t *c  /**< */,
50                                 uint16_t          client_major_version  /**< */,
51                                 uint16_t          client_minor_version  /**< */)
52 {
53     static const xcb_protocol_request_t xcb_req = {
54         /* count */ 2,
55         /* ext */ &xcb_dpms_id,
56         /* opcode */ XCB_DPMS_GET_VERSION,
57         /* isvoid */ 0
58     };
59 
60     struct iovec xcb_parts[4];
61     xcb_dpms_get_version_cookie_t xcb_ret;
62     xcb_dpms_get_version_request_t xcb_out;
63 
64     xcb_out.client_major_version = client_major_version;
65     xcb_out.client_minor_version = client_minor_version;
66 
67     xcb_parts[2].iov_base = (char *) &xcb_out;
68     xcb_parts[2].iov_len = sizeof(xcb_out);
69     xcb_parts[3].iov_base = 0;
70     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
71 
72     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
73     return xcb_ret;
74 }
75 
76 xcb_dpms_get_version_reply_t *
xcb_dpms_get_version_reply(xcb_connection_t * c,xcb_dpms_get_version_cookie_t cookie,xcb_generic_error_t ** e)77 xcb_dpms_get_version_reply (xcb_connection_t               *c  /**< */,
78                             xcb_dpms_get_version_cookie_t   cookie  /**< */,
79                             xcb_generic_error_t           **e  /**< */)
80 {
81     return (xcb_dpms_get_version_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
82 }
83 
84 xcb_dpms_capable_cookie_t
xcb_dpms_capable(xcb_connection_t * c)85 xcb_dpms_capable (xcb_connection_t *c  /**< */)
86 {
87     static const xcb_protocol_request_t xcb_req = {
88         /* count */ 2,
89         /* ext */ &xcb_dpms_id,
90         /* opcode */ XCB_DPMS_CAPABLE,
91         /* isvoid */ 0
92     };
93 
94     struct iovec xcb_parts[4];
95     xcb_dpms_capable_cookie_t xcb_ret;
96     xcb_dpms_capable_request_t xcb_out;
97 
98 
99     xcb_parts[2].iov_base = (char *) &xcb_out;
100     xcb_parts[2].iov_len = sizeof(xcb_out);
101     xcb_parts[3].iov_base = 0;
102     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
103 
104     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
105     return xcb_ret;
106 }
107 
108 xcb_dpms_capable_cookie_t
xcb_dpms_capable_unchecked(xcb_connection_t * c)109 xcb_dpms_capable_unchecked (xcb_connection_t *c  /**< */)
110 {
111     static const xcb_protocol_request_t xcb_req = {
112         /* count */ 2,
113         /* ext */ &xcb_dpms_id,
114         /* opcode */ XCB_DPMS_CAPABLE,
115         /* isvoid */ 0
116     };
117 
118     struct iovec xcb_parts[4];
119     xcb_dpms_capable_cookie_t xcb_ret;
120     xcb_dpms_capable_request_t xcb_out;
121 
122 
123     xcb_parts[2].iov_base = (char *) &xcb_out;
124     xcb_parts[2].iov_len = sizeof(xcb_out);
125     xcb_parts[3].iov_base = 0;
126     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
127 
128     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
129     return xcb_ret;
130 }
131 
132 xcb_dpms_capable_reply_t *
xcb_dpms_capable_reply(xcb_connection_t * c,xcb_dpms_capable_cookie_t cookie,xcb_generic_error_t ** e)133 xcb_dpms_capable_reply (xcb_connection_t           *c  /**< */,
134                         xcb_dpms_capable_cookie_t   cookie  /**< */,
135                         xcb_generic_error_t       **e  /**< */)
136 {
137     return (xcb_dpms_capable_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
138 }
139 
140 xcb_dpms_get_timeouts_cookie_t
xcb_dpms_get_timeouts(xcb_connection_t * c)141 xcb_dpms_get_timeouts (xcb_connection_t *c  /**< */)
142 {
143     static const xcb_protocol_request_t xcb_req = {
144         /* count */ 2,
145         /* ext */ &xcb_dpms_id,
146         /* opcode */ XCB_DPMS_GET_TIMEOUTS,
147         /* isvoid */ 0
148     };
149 
150     struct iovec xcb_parts[4];
151     xcb_dpms_get_timeouts_cookie_t xcb_ret;
152     xcb_dpms_get_timeouts_request_t xcb_out;
153 
154 
155     xcb_parts[2].iov_base = (char *) &xcb_out;
156     xcb_parts[2].iov_len = sizeof(xcb_out);
157     xcb_parts[3].iov_base = 0;
158     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
159 
160     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
161     return xcb_ret;
162 }
163 
164 xcb_dpms_get_timeouts_cookie_t
xcb_dpms_get_timeouts_unchecked(xcb_connection_t * c)165 xcb_dpms_get_timeouts_unchecked (xcb_connection_t *c  /**< */)
166 {
167     static const xcb_protocol_request_t xcb_req = {
168         /* count */ 2,
169         /* ext */ &xcb_dpms_id,
170         /* opcode */ XCB_DPMS_GET_TIMEOUTS,
171         /* isvoid */ 0
172     };
173 
174     struct iovec xcb_parts[4];
175     xcb_dpms_get_timeouts_cookie_t xcb_ret;
176     xcb_dpms_get_timeouts_request_t xcb_out;
177 
178 
179     xcb_parts[2].iov_base = (char *) &xcb_out;
180     xcb_parts[2].iov_len = sizeof(xcb_out);
181     xcb_parts[3].iov_base = 0;
182     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
183 
184     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
185     return xcb_ret;
186 }
187 
188 xcb_dpms_get_timeouts_reply_t *
xcb_dpms_get_timeouts_reply(xcb_connection_t * c,xcb_dpms_get_timeouts_cookie_t cookie,xcb_generic_error_t ** e)189 xcb_dpms_get_timeouts_reply (xcb_connection_t                *c  /**< */,
190                              xcb_dpms_get_timeouts_cookie_t   cookie  /**< */,
191                              xcb_generic_error_t            **e  /**< */)
192 {
193     return (xcb_dpms_get_timeouts_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
194 }
195 
196 xcb_void_cookie_t
xcb_dpms_set_timeouts_checked(xcb_connection_t * c,uint16_t standby_timeout,uint16_t suspend_timeout,uint16_t off_timeout)197 xcb_dpms_set_timeouts_checked (xcb_connection_t *c  /**< */,
198                                uint16_t          standby_timeout  /**< */,
199                                uint16_t          suspend_timeout  /**< */,
200                                uint16_t          off_timeout  /**< */)
201 {
202     static const xcb_protocol_request_t xcb_req = {
203         /* count */ 2,
204         /* ext */ &xcb_dpms_id,
205         /* opcode */ XCB_DPMS_SET_TIMEOUTS,
206         /* isvoid */ 1
207     };
208 
209     struct iovec xcb_parts[4];
210     xcb_void_cookie_t xcb_ret;
211     xcb_dpms_set_timeouts_request_t xcb_out;
212 
213     xcb_out.standby_timeout = standby_timeout;
214     xcb_out.suspend_timeout = suspend_timeout;
215     xcb_out.off_timeout = off_timeout;
216 
217     xcb_parts[2].iov_base = (char *) &xcb_out;
218     xcb_parts[2].iov_len = sizeof(xcb_out);
219     xcb_parts[3].iov_base = 0;
220     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
221 
222     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
223     return xcb_ret;
224 }
225 
226 xcb_void_cookie_t
xcb_dpms_set_timeouts(xcb_connection_t * c,uint16_t standby_timeout,uint16_t suspend_timeout,uint16_t off_timeout)227 xcb_dpms_set_timeouts (xcb_connection_t *c  /**< */,
228                        uint16_t          standby_timeout  /**< */,
229                        uint16_t          suspend_timeout  /**< */,
230                        uint16_t          off_timeout  /**< */)
231 {
232     static const xcb_protocol_request_t xcb_req = {
233         /* count */ 2,
234         /* ext */ &xcb_dpms_id,
235         /* opcode */ XCB_DPMS_SET_TIMEOUTS,
236         /* isvoid */ 1
237     };
238 
239     struct iovec xcb_parts[4];
240     xcb_void_cookie_t xcb_ret;
241     xcb_dpms_set_timeouts_request_t xcb_out;
242 
243     xcb_out.standby_timeout = standby_timeout;
244     xcb_out.suspend_timeout = suspend_timeout;
245     xcb_out.off_timeout = off_timeout;
246 
247     xcb_parts[2].iov_base = (char *) &xcb_out;
248     xcb_parts[2].iov_len = sizeof(xcb_out);
249     xcb_parts[3].iov_base = 0;
250     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
251 
252     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
253     return xcb_ret;
254 }
255 
256 xcb_void_cookie_t
xcb_dpms_enable_checked(xcb_connection_t * c)257 xcb_dpms_enable_checked (xcb_connection_t *c  /**< */)
258 {
259     static const xcb_protocol_request_t xcb_req = {
260         /* count */ 2,
261         /* ext */ &xcb_dpms_id,
262         /* opcode */ XCB_DPMS_ENABLE,
263         /* isvoid */ 1
264     };
265 
266     struct iovec xcb_parts[4];
267     xcb_void_cookie_t xcb_ret;
268     xcb_dpms_enable_request_t xcb_out;
269 
270 
271     xcb_parts[2].iov_base = (char *) &xcb_out;
272     xcb_parts[2].iov_len = sizeof(xcb_out);
273     xcb_parts[3].iov_base = 0;
274     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
275 
276     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
277     return xcb_ret;
278 }
279 
280 xcb_void_cookie_t
xcb_dpms_enable(xcb_connection_t * c)281 xcb_dpms_enable (xcb_connection_t *c  /**< */)
282 {
283     static const xcb_protocol_request_t xcb_req = {
284         /* count */ 2,
285         /* ext */ &xcb_dpms_id,
286         /* opcode */ XCB_DPMS_ENABLE,
287         /* isvoid */ 1
288     };
289 
290     struct iovec xcb_parts[4];
291     xcb_void_cookie_t xcb_ret;
292     xcb_dpms_enable_request_t xcb_out;
293 
294 
295     xcb_parts[2].iov_base = (char *) &xcb_out;
296     xcb_parts[2].iov_len = sizeof(xcb_out);
297     xcb_parts[3].iov_base = 0;
298     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
299 
300     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
301     return xcb_ret;
302 }
303 
304 xcb_void_cookie_t
xcb_dpms_disable_checked(xcb_connection_t * c)305 xcb_dpms_disable_checked (xcb_connection_t *c  /**< */)
306 {
307     static const xcb_protocol_request_t xcb_req = {
308         /* count */ 2,
309         /* ext */ &xcb_dpms_id,
310         /* opcode */ XCB_DPMS_DISABLE,
311         /* isvoid */ 1
312     };
313 
314     struct iovec xcb_parts[4];
315     xcb_void_cookie_t xcb_ret;
316     xcb_dpms_disable_request_t xcb_out;
317 
318 
319     xcb_parts[2].iov_base = (char *) &xcb_out;
320     xcb_parts[2].iov_len = sizeof(xcb_out);
321     xcb_parts[3].iov_base = 0;
322     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
323 
324     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
325     return xcb_ret;
326 }
327 
328 xcb_void_cookie_t
xcb_dpms_disable(xcb_connection_t * c)329 xcb_dpms_disable (xcb_connection_t *c  /**< */)
330 {
331     static const xcb_protocol_request_t xcb_req = {
332         /* count */ 2,
333         /* ext */ &xcb_dpms_id,
334         /* opcode */ XCB_DPMS_DISABLE,
335         /* isvoid */ 1
336     };
337 
338     struct iovec xcb_parts[4];
339     xcb_void_cookie_t xcb_ret;
340     xcb_dpms_disable_request_t xcb_out;
341 
342 
343     xcb_parts[2].iov_base = (char *) &xcb_out;
344     xcb_parts[2].iov_len = sizeof(xcb_out);
345     xcb_parts[3].iov_base = 0;
346     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
347 
348     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
349     return xcb_ret;
350 }
351 
352 xcb_void_cookie_t
xcb_dpms_force_level_checked(xcb_connection_t * c,uint16_t power_level)353 xcb_dpms_force_level_checked (xcb_connection_t *c  /**< */,
354                               uint16_t          power_level  /**< */)
355 {
356     static const xcb_protocol_request_t xcb_req = {
357         /* count */ 2,
358         /* ext */ &xcb_dpms_id,
359         /* opcode */ XCB_DPMS_FORCE_LEVEL,
360         /* isvoid */ 1
361     };
362 
363     struct iovec xcb_parts[4];
364     xcb_void_cookie_t xcb_ret;
365     xcb_dpms_force_level_request_t xcb_out;
366 
367     xcb_out.power_level = power_level;
368 
369     xcb_parts[2].iov_base = (char *) &xcb_out;
370     xcb_parts[2].iov_len = sizeof(xcb_out);
371     xcb_parts[3].iov_base = 0;
372     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
373 
374     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
375     return xcb_ret;
376 }
377 
378 xcb_void_cookie_t
xcb_dpms_force_level(xcb_connection_t * c,uint16_t power_level)379 xcb_dpms_force_level (xcb_connection_t *c  /**< */,
380                       uint16_t          power_level  /**< */)
381 {
382     static const xcb_protocol_request_t xcb_req = {
383         /* count */ 2,
384         /* ext */ &xcb_dpms_id,
385         /* opcode */ XCB_DPMS_FORCE_LEVEL,
386         /* isvoid */ 1
387     };
388 
389     struct iovec xcb_parts[4];
390     xcb_void_cookie_t xcb_ret;
391     xcb_dpms_force_level_request_t xcb_out;
392 
393     xcb_out.power_level = power_level;
394 
395     xcb_parts[2].iov_base = (char *) &xcb_out;
396     xcb_parts[2].iov_len = sizeof(xcb_out);
397     xcb_parts[3].iov_base = 0;
398     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
399 
400     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
401     return xcb_ret;
402 }
403 
404 xcb_dpms_info_cookie_t
xcb_dpms_info(xcb_connection_t * c)405 xcb_dpms_info (xcb_connection_t *c  /**< */)
406 {
407     static const xcb_protocol_request_t xcb_req = {
408         /* count */ 2,
409         /* ext */ &xcb_dpms_id,
410         /* opcode */ XCB_DPMS_INFO,
411         /* isvoid */ 0
412     };
413 
414     struct iovec xcb_parts[4];
415     xcb_dpms_info_cookie_t xcb_ret;
416     xcb_dpms_info_request_t xcb_out;
417 
418 
419     xcb_parts[2].iov_base = (char *) &xcb_out;
420     xcb_parts[2].iov_len = sizeof(xcb_out);
421     xcb_parts[3].iov_base = 0;
422     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
423 
424     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
425     return xcb_ret;
426 }
427 
428 xcb_dpms_info_cookie_t
xcb_dpms_info_unchecked(xcb_connection_t * c)429 xcb_dpms_info_unchecked (xcb_connection_t *c  /**< */)
430 {
431     static const xcb_protocol_request_t xcb_req = {
432         /* count */ 2,
433         /* ext */ &xcb_dpms_id,
434         /* opcode */ XCB_DPMS_INFO,
435         /* isvoid */ 0
436     };
437 
438     struct iovec xcb_parts[4];
439     xcb_dpms_info_cookie_t xcb_ret;
440     xcb_dpms_info_request_t xcb_out;
441 
442 
443     xcb_parts[2].iov_base = (char *) &xcb_out;
444     xcb_parts[2].iov_len = sizeof(xcb_out);
445     xcb_parts[3].iov_base = 0;
446     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
447 
448     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
449     return xcb_ret;
450 }
451 
452 xcb_dpms_info_reply_t *
xcb_dpms_info_reply(xcb_connection_t * c,xcb_dpms_info_cookie_t cookie,xcb_generic_error_t ** e)453 xcb_dpms_info_reply (xcb_connection_t        *c  /**< */,
454                      xcb_dpms_info_cookie_t   cookie  /**< */,
455                      xcb_generic_error_t    **e  /**< */)
456 {
457     return (xcb_dpms_info_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
458 }
459 
460