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