1 /* 2 * This file generated automatically from randr.xml by c_client.py. 3 * Edit at your peril. 4 */ 5 6 #include <string.h> 7 #include <assert.h> 8 #include "xcbext.h" 9 #include "randr.h" 10 #include "xproto.h" 11 #include "render.h" 12 13 xcb_extension_t xcb_randr_id = { "RANDR", 0 }; 14 15 16 /***************************************************************************** 17 ** 18 ** void xcb_randr_mode_next 19 ** 20 ** @param xcb_randr_mode_iterator_t *i 21 ** @returns void 22 ** 23 *****************************************************************************/ 24 25 void 26 xcb_randr_mode_next (xcb_randr_mode_iterator_t *i /**< */) 27 { 28 --i->rem; 29 ++i->data; 30 i->index += sizeof(xcb_randr_mode_t); 31 } 32 33 34 /***************************************************************************** 35 ** 36 ** xcb_generic_iterator_t xcb_randr_mode_end 37 ** 38 ** @param xcb_randr_mode_iterator_t i 39 ** @returns xcb_generic_iterator_t 40 ** 41 *****************************************************************************/ 42 43 xcb_generic_iterator_t 44 xcb_randr_mode_end (xcb_randr_mode_iterator_t i /**< */) 45 { 46 xcb_generic_iterator_t ret; 47 ret.data = i.data + i.rem; 48 ret.index = i.index + ((char *) ret.data - (char *) i.data); 49 ret.rem = 0; 50 return ret; 51 } 52 53 54 /***************************************************************************** 55 ** 56 ** void xcb_randr_crtc_next 57 ** 58 ** @param xcb_randr_crtc_iterator_t *i 59 ** @returns void 60 ** 61 *****************************************************************************/ 62 63 void 64 xcb_randr_crtc_next (xcb_randr_crtc_iterator_t *i /**< */) 65 { 66 --i->rem; 67 ++i->data; 68 i->index += sizeof(xcb_randr_crtc_t); 69 } 70 71 72 /***************************************************************************** 73 ** 74 ** xcb_generic_iterator_t xcb_randr_crtc_end 75 ** 76 ** @param xcb_randr_crtc_iterator_t i 77 ** @returns xcb_generic_iterator_t 78 ** 79 *****************************************************************************/ 80 81 xcb_generic_iterator_t 82 xcb_randr_crtc_end (xcb_randr_crtc_iterator_t i /**< */) 83 { 84 xcb_generic_iterator_t ret; 85 ret.data = i.data + i.rem; 86 ret.index = i.index + ((char *) ret.data - (char *) i.data); 87 ret.rem = 0; 88 return ret; 89 } 90 91 92 /***************************************************************************** 93 ** 94 ** void xcb_randr_output_next 95 ** 96 ** @param xcb_randr_output_iterator_t *i 97 ** @returns void 98 ** 99 *****************************************************************************/ 100 101 void 102 xcb_randr_output_next (xcb_randr_output_iterator_t *i /**< */) 103 { 104 --i->rem; 105 ++i->data; 106 i->index += sizeof(xcb_randr_output_t); 107 } 108 109 110 /***************************************************************************** 111 ** 112 ** xcb_generic_iterator_t xcb_randr_output_end 113 ** 114 ** @param xcb_randr_output_iterator_t i 115 ** @returns xcb_generic_iterator_t 116 ** 117 *****************************************************************************/ 118 119 xcb_generic_iterator_t 120 xcb_randr_output_end (xcb_randr_output_iterator_t i /**< */) 121 { 122 xcb_generic_iterator_t ret; 123 ret.data = i.data + i.rem; 124 ret.index = i.index + ((char *) ret.data - (char *) i.data); 125 ret.rem = 0; 126 return ret; 127 } 128 129 130 /***************************************************************************** 131 ** 132 ** void xcb_randr_screen_size_next 133 ** 134 ** @param xcb_randr_screen_size_iterator_t *i 135 ** @returns void 136 ** 137 *****************************************************************************/ 138 139 void 140 xcb_randr_screen_size_next (xcb_randr_screen_size_iterator_t *i /**< */) 141 { 142 --i->rem; 143 ++i->data; 144 i->index += sizeof(xcb_randr_screen_size_t); 145 } 146 147 148 /***************************************************************************** 149 ** 150 ** xcb_generic_iterator_t xcb_randr_screen_size_end 151 ** 152 ** @param xcb_randr_screen_size_iterator_t i 153 ** @returns xcb_generic_iterator_t 154 ** 155 *****************************************************************************/ 156 157 xcb_generic_iterator_t 158 xcb_randr_screen_size_end (xcb_randr_screen_size_iterator_t i /**< */) 159 { 160 xcb_generic_iterator_t ret; 161 ret.data = i.data + i.rem; 162 ret.index = i.index + ((char *) ret.data - (char *) i.data); 163 ret.rem = 0; 164 return ret; 165 } 166 167 168 /***************************************************************************** 169 ** 170 ** uint16_t * xcb_randr_refresh_rates_rates 171 ** 172 ** @param const xcb_randr_refresh_rates_t *R 173 ** @returns uint16_t * 174 ** 175 *****************************************************************************/ 176 177 uint16_t * 178 xcb_randr_refresh_rates_rates (const xcb_randr_refresh_rates_t *R /**< */) 179 { 180 return (uint16_t *) (R + 1); 181 } 182 183 184 /***************************************************************************** 185 ** 186 ** int xcb_randr_refresh_rates_rates_length 187 ** 188 ** @param const xcb_randr_refresh_rates_t *R 189 ** @returns int 190 ** 191 *****************************************************************************/ 192 193 int 194 xcb_randr_refresh_rates_rates_length (const xcb_randr_refresh_rates_t *R /**< */) 195 { 196 return R->nRates; 197 } 198 199 200 /***************************************************************************** 201 ** 202 ** xcb_generic_iterator_t xcb_randr_refresh_rates_rates_end 203 ** 204 ** @param const xcb_randr_refresh_rates_t *R 205 ** @returns xcb_generic_iterator_t 206 ** 207 *****************************************************************************/ 208 209 xcb_generic_iterator_t 210 xcb_randr_refresh_rates_rates_end (const xcb_randr_refresh_rates_t *R /**< */) 211 { 212 xcb_generic_iterator_t i; 213 i.data = ((uint16_t *) (R + 1)) + (R->nRates); 214 i.rem = 0; 215 i.index = (char *) i.data - (char *) R; 216 return i; 217 } 218 219 220 /***************************************************************************** 221 ** 222 ** void xcb_randr_refresh_rates_next 223 ** 224 ** @param xcb_randr_refresh_rates_iterator_t *i 225 ** @returns void 226 ** 227 *****************************************************************************/ 228 229 void 230 xcb_randr_refresh_rates_next (xcb_randr_refresh_rates_iterator_t *i /**< */) 231 { 232 xcb_randr_refresh_rates_t *R = i->data; 233 xcb_generic_iterator_t child = xcb_randr_refresh_rates_rates_end(R); 234 --i->rem; 235 i->data = (xcb_randr_refresh_rates_t *) child.data; 236 i->index = child.index; 237 } 238 239 240 /***************************************************************************** 241 ** 242 ** xcb_generic_iterator_t xcb_randr_refresh_rates_end 243 ** 244 ** @param xcb_randr_refresh_rates_iterator_t i 245 ** @returns xcb_generic_iterator_t 246 ** 247 *****************************************************************************/ 248 249 xcb_generic_iterator_t 250 xcb_randr_refresh_rates_end (xcb_randr_refresh_rates_iterator_t i /**< */) 251 { 252 xcb_generic_iterator_t ret; 253 while(i.rem > 0) 254 xcb_randr_refresh_rates_next(&i); 255 ret.data = i.data; 256 ret.rem = i.rem; 257 ret.index = i.index; 258 return ret; 259 } 260 261 262 /***************************************************************************** 263 ** 264 ** xcb_randr_query_version_cookie_t xcb_randr_query_version 265 ** 266 ** @param xcb_connection_t *c 267 ** @param uint32_t major_version 268 ** @param uint32_t minor_version 269 ** @returns xcb_randr_query_version_cookie_t 270 ** 271 *****************************************************************************/ 272 273 xcb_randr_query_version_cookie_t 274 xcb_randr_query_version (xcb_connection_t *c /**< */, 275 uint32_t major_version /**< */, 276 uint32_t minor_version /**< */) 277 { 278 static const xcb_protocol_request_t xcb_req = { 279 /* count */ 2, 280 /* ext */ &xcb_randr_id, 281 /* opcode */ XCB_RANDR_QUERY_VERSION, 282 /* isvoid */ 0 283 }; 284 285 struct iovec xcb_parts[4]; 286 xcb_randr_query_version_cookie_t xcb_ret; 287 xcb_randr_query_version_request_t xcb_out; 288 289 xcb_out.major_version = major_version; 290 xcb_out.minor_version = minor_version; 291 292 xcb_parts[2].iov_base = (char *) &xcb_out; 293 xcb_parts[2].iov_len = sizeof(xcb_out); 294 xcb_parts[3].iov_base = 0; 295 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 296 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 297 return xcb_ret; 298 } 299 300 301 /***************************************************************************** 302 ** 303 ** xcb_randr_query_version_cookie_t xcb_randr_query_version_unchecked 304 ** 305 ** @param xcb_connection_t *c 306 ** @param uint32_t major_version 307 ** @param uint32_t minor_version 308 ** @returns xcb_randr_query_version_cookie_t 309 ** 310 *****************************************************************************/ 311 312 xcb_randr_query_version_cookie_t 313 xcb_randr_query_version_unchecked (xcb_connection_t *c /**< */, 314 uint32_t major_version /**< */, 315 uint32_t minor_version /**< */) 316 { 317 static const xcb_protocol_request_t xcb_req = { 318 /* count */ 2, 319 /* ext */ &xcb_randr_id, 320 /* opcode */ XCB_RANDR_QUERY_VERSION, 321 /* isvoid */ 0 322 }; 323 324 struct iovec xcb_parts[4]; 325 xcb_randr_query_version_cookie_t xcb_ret; 326 xcb_randr_query_version_request_t xcb_out; 327 328 xcb_out.major_version = major_version; 329 xcb_out.minor_version = minor_version; 330 331 xcb_parts[2].iov_base = (char *) &xcb_out; 332 xcb_parts[2].iov_len = sizeof(xcb_out); 333 xcb_parts[3].iov_base = 0; 334 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 335 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 336 return xcb_ret; 337 } 338 339 340 /***************************************************************************** 341 ** 342 ** xcb_randr_query_version_reply_t * xcb_randr_query_version_reply 343 ** 344 ** @param xcb_connection_t *c 345 ** @param xcb_randr_query_version_cookie_t cookie 346 ** @param xcb_generic_error_t **e 347 ** @returns xcb_randr_query_version_reply_t * 348 ** 349 *****************************************************************************/ 350 351 xcb_randr_query_version_reply_t * 352 xcb_randr_query_version_reply (xcb_connection_t *c /**< */, 353 xcb_randr_query_version_cookie_t cookie /**< */, 354 xcb_generic_error_t **e /**< */) 355 { 356 return (xcb_randr_query_version_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 357 } 358 359 360 /***************************************************************************** 361 ** 362 ** xcb_randr_set_screen_config_cookie_t xcb_randr_set_screen_config 363 ** 364 ** @param xcb_connection_t *c 365 ** @param xcb_window_t window 366 ** @param xcb_timestamp_t timestamp 367 ** @param xcb_timestamp_t config_timestamp 368 ** @param uint16_t sizeID 369 ** @param uint16_t rotation 370 ** @param uint16_t rate 371 ** @returns xcb_randr_set_screen_config_cookie_t 372 ** 373 *****************************************************************************/ 374 375 xcb_randr_set_screen_config_cookie_t 376 xcb_randr_set_screen_config (xcb_connection_t *c /**< */, 377 xcb_window_t window /**< */, 378 xcb_timestamp_t timestamp /**< */, 379 xcb_timestamp_t config_timestamp /**< */, 380 uint16_t sizeID /**< */, 381 uint16_t rotation /**< */, 382 uint16_t rate /**< */) 383 { 384 static const xcb_protocol_request_t xcb_req = { 385 /* count */ 2, 386 /* ext */ &xcb_randr_id, 387 /* opcode */ XCB_RANDR_SET_SCREEN_CONFIG, 388 /* isvoid */ 0 389 }; 390 391 struct iovec xcb_parts[4]; 392 xcb_randr_set_screen_config_cookie_t xcb_ret; 393 xcb_randr_set_screen_config_request_t xcb_out; 394 395 xcb_out.window = window; 396 xcb_out.timestamp = timestamp; 397 xcb_out.config_timestamp = config_timestamp; 398 xcb_out.sizeID = sizeID; 399 xcb_out.rotation = rotation; 400 xcb_out.rate = rate; 401 memset(xcb_out.pad0, 0, 2); 402 403 xcb_parts[2].iov_base = (char *) &xcb_out; 404 xcb_parts[2].iov_len = sizeof(xcb_out); 405 xcb_parts[3].iov_base = 0; 406 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 407 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 408 return xcb_ret; 409 } 410 411 412 /***************************************************************************** 413 ** 414 ** xcb_randr_set_screen_config_cookie_t xcb_randr_set_screen_config_unchecked 415 ** 416 ** @param xcb_connection_t *c 417 ** @param xcb_window_t window 418 ** @param xcb_timestamp_t timestamp 419 ** @param xcb_timestamp_t config_timestamp 420 ** @param uint16_t sizeID 421 ** @param uint16_t rotation 422 ** @param uint16_t rate 423 ** @returns xcb_randr_set_screen_config_cookie_t 424 ** 425 *****************************************************************************/ 426 427 xcb_randr_set_screen_config_cookie_t 428 xcb_randr_set_screen_config_unchecked (xcb_connection_t *c /**< */, 429 xcb_window_t window /**< */, 430 xcb_timestamp_t timestamp /**< */, 431 xcb_timestamp_t config_timestamp /**< */, 432 uint16_t sizeID /**< */, 433 uint16_t rotation /**< */, 434 uint16_t rate /**< */) 435 { 436 static const xcb_protocol_request_t xcb_req = { 437 /* count */ 2, 438 /* ext */ &xcb_randr_id, 439 /* opcode */ XCB_RANDR_SET_SCREEN_CONFIG, 440 /* isvoid */ 0 441 }; 442 443 struct iovec xcb_parts[4]; 444 xcb_randr_set_screen_config_cookie_t xcb_ret; 445 xcb_randr_set_screen_config_request_t xcb_out; 446 447 xcb_out.window = window; 448 xcb_out.timestamp = timestamp; 449 xcb_out.config_timestamp = config_timestamp; 450 xcb_out.sizeID = sizeID; 451 xcb_out.rotation = rotation; 452 xcb_out.rate = rate; 453 memset(xcb_out.pad0, 0, 2); 454 455 xcb_parts[2].iov_base = (char *) &xcb_out; 456 xcb_parts[2].iov_len = sizeof(xcb_out); 457 xcb_parts[3].iov_base = 0; 458 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 459 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 460 return xcb_ret; 461 } 462 463 464 /***************************************************************************** 465 ** 466 ** xcb_randr_set_screen_config_reply_t * xcb_randr_set_screen_config_reply 467 ** 468 ** @param xcb_connection_t *c 469 ** @param xcb_randr_set_screen_config_cookie_t cookie 470 ** @param xcb_generic_error_t **e 471 ** @returns xcb_randr_set_screen_config_reply_t * 472 ** 473 *****************************************************************************/ 474 475 xcb_randr_set_screen_config_reply_t * 476 xcb_randr_set_screen_config_reply (xcb_connection_t *c /**< */, 477 xcb_randr_set_screen_config_cookie_t cookie /**< */, 478 xcb_generic_error_t **e /**< */) 479 { 480 return (xcb_randr_set_screen_config_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 481 } 482 483 484 /***************************************************************************** 485 ** 486 ** xcb_void_cookie_t xcb_randr_select_input_checked 487 ** 488 ** @param xcb_connection_t *c 489 ** @param xcb_window_t window 490 ** @param uint16_t enable 491 ** @returns xcb_void_cookie_t 492 ** 493 *****************************************************************************/ 494 495 xcb_void_cookie_t 496 xcb_randr_select_input_checked (xcb_connection_t *c /**< */, 497 xcb_window_t window /**< */, 498 uint16_t enable /**< */) 499 { 500 static const xcb_protocol_request_t xcb_req = { 501 /* count */ 2, 502 /* ext */ &xcb_randr_id, 503 /* opcode */ XCB_RANDR_SELECT_INPUT, 504 /* isvoid */ 1 505 }; 506 507 struct iovec xcb_parts[4]; 508 xcb_void_cookie_t xcb_ret; 509 xcb_randr_select_input_request_t xcb_out; 510 511 xcb_out.window = window; 512 xcb_out.enable = enable; 513 memset(xcb_out.pad0, 0, 2); 514 515 xcb_parts[2].iov_base = (char *) &xcb_out; 516 xcb_parts[2].iov_len = sizeof(xcb_out); 517 xcb_parts[3].iov_base = 0; 518 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 519 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 520 return xcb_ret; 521 } 522 523 524 /***************************************************************************** 525 ** 526 ** xcb_void_cookie_t xcb_randr_select_input 527 ** 528 ** @param xcb_connection_t *c 529 ** @param xcb_window_t window 530 ** @param uint16_t enable 531 ** @returns xcb_void_cookie_t 532 ** 533 *****************************************************************************/ 534 535 xcb_void_cookie_t 536 xcb_randr_select_input (xcb_connection_t *c /**< */, 537 xcb_window_t window /**< */, 538 uint16_t enable /**< */) 539 { 540 static const xcb_protocol_request_t xcb_req = { 541 /* count */ 2, 542 /* ext */ &xcb_randr_id, 543 /* opcode */ XCB_RANDR_SELECT_INPUT, 544 /* isvoid */ 1 545 }; 546 547 struct iovec xcb_parts[4]; 548 xcb_void_cookie_t xcb_ret; 549 xcb_randr_select_input_request_t xcb_out; 550 551 xcb_out.window = window; 552 xcb_out.enable = enable; 553 memset(xcb_out.pad0, 0, 2); 554 555 xcb_parts[2].iov_base = (char *) &xcb_out; 556 xcb_parts[2].iov_len = sizeof(xcb_out); 557 xcb_parts[3].iov_base = 0; 558 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 559 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 560 return xcb_ret; 561 } 562 563 564 /***************************************************************************** 565 ** 566 ** xcb_randr_get_screen_info_cookie_t xcb_randr_get_screen_info 567 ** 568 ** @param xcb_connection_t *c 569 ** @param xcb_window_t window 570 ** @returns xcb_randr_get_screen_info_cookie_t 571 ** 572 *****************************************************************************/ 573 574 xcb_randr_get_screen_info_cookie_t 575 xcb_randr_get_screen_info (xcb_connection_t *c /**< */, 576 xcb_window_t window /**< */) 577 { 578 static const xcb_protocol_request_t xcb_req = { 579 /* count */ 2, 580 /* ext */ &xcb_randr_id, 581 /* opcode */ XCB_RANDR_GET_SCREEN_INFO, 582 /* isvoid */ 0 583 }; 584 585 struct iovec xcb_parts[4]; 586 xcb_randr_get_screen_info_cookie_t xcb_ret; 587 xcb_randr_get_screen_info_request_t xcb_out; 588 589 xcb_out.window = window; 590 591 xcb_parts[2].iov_base = (char *) &xcb_out; 592 xcb_parts[2].iov_len = sizeof(xcb_out); 593 xcb_parts[3].iov_base = 0; 594 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 595 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 596 return xcb_ret; 597 } 598 599 600 /***************************************************************************** 601 ** 602 ** xcb_randr_get_screen_info_cookie_t xcb_randr_get_screen_info_unchecked 603 ** 604 ** @param xcb_connection_t *c 605 ** @param xcb_window_t window 606 ** @returns xcb_randr_get_screen_info_cookie_t 607 ** 608 *****************************************************************************/ 609 610 xcb_randr_get_screen_info_cookie_t 611 xcb_randr_get_screen_info_unchecked (xcb_connection_t *c /**< */, 612 xcb_window_t window /**< */) 613 { 614 static const xcb_protocol_request_t xcb_req = { 615 /* count */ 2, 616 /* ext */ &xcb_randr_id, 617 /* opcode */ XCB_RANDR_GET_SCREEN_INFO, 618 /* isvoid */ 0 619 }; 620 621 struct iovec xcb_parts[4]; 622 xcb_randr_get_screen_info_cookie_t xcb_ret; 623 xcb_randr_get_screen_info_request_t xcb_out; 624 625 xcb_out.window = window; 626 627 xcb_parts[2].iov_base = (char *) &xcb_out; 628 xcb_parts[2].iov_len = sizeof(xcb_out); 629 xcb_parts[3].iov_base = 0; 630 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 631 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 632 return xcb_ret; 633 } 634 635 636 /***************************************************************************** 637 ** 638 ** xcb_randr_screen_size_t * xcb_randr_get_screen_info_sizes 639 ** 640 ** @param const xcb_randr_get_screen_info_reply_t *R 641 ** @returns xcb_randr_screen_size_t * 642 ** 643 *****************************************************************************/ 644 645 xcb_randr_screen_size_t * 646 xcb_randr_get_screen_info_sizes (const xcb_randr_get_screen_info_reply_t *R /**< */) 647 { 648 return (xcb_randr_screen_size_t *) (R + 1); 649 } 650 651 652 /***************************************************************************** 653 ** 654 ** int xcb_randr_get_screen_info_sizes_length 655 ** 656 ** @param const xcb_randr_get_screen_info_reply_t *R 657 ** @returns int 658 ** 659 *****************************************************************************/ 660 661 int 662 xcb_randr_get_screen_info_sizes_length (const xcb_randr_get_screen_info_reply_t *R /**< */) 663 { 664 return R->nSizes; 665 } 666 667 668 /***************************************************************************** 669 ** 670 ** xcb_randr_screen_size_iterator_t xcb_randr_get_screen_info_sizes_iterator 671 ** 672 ** @param const xcb_randr_get_screen_info_reply_t *R 673 ** @returns xcb_randr_screen_size_iterator_t 674 ** 675 *****************************************************************************/ 676 677 xcb_randr_screen_size_iterator_t 678 xcb_randr_get_screen_info_sizes_iterator (const xcb_randr_get_screen_info_reply_t *R /**< */) 679 { 680 xcb_randr_screen_size_iterator_t i; 681 i.data = (xcb_randr_screen_size_t *) (R + 1); 682 i.rem = R->nSizes; 683 i.index = (char *) i.data - (char *) R; 684 return i; 685 } 686 687 688 /***************************************************************************** 689 ** 690 ** int xcb_randr_get_screen_info_rates_length 691 ** 692 ** @param const xcb_randr_get_screen_info_reply_t *R 693 ** @returns int 694 ** 695 *****************************************************************************/ 696 697 int 698 xcb_randr_get_screen_info_rates_length (const xcb_randr_get_screen_info_reply_t *R /**< */) 699 { 700 return (R->nInfo - R->nSizes); 701 } 702 703 704 /***************************************************************************** 705 ** 706 ** xcb_randr_refresh_rates_iterator_t xcb_randr_get_screen_info_rates_iterator 707 ** 708 ** @param const xcb_randr_get_screen_info_reply_t *R 709 ** @returns xcb_randr_refresh_rates_iterator_t 710 ** 711 *****************************************************************************/ 712 713 xcb_randr_refresh_rates_iterator_t 714 xcb_randr_get_screen_info_rates_iterator (const xcb_randr_get_screen_info_reply_t *R /**< */) 715 { 716 xcb_randr_refresh_rates_iterator_t i; 717 xcb_generic_iterator_t prev = xcb_randr_screen_size_end(xcb_randr_get_screen_info_sizes_iterator(R)); 718 i.data = (xcb_randr_refresh_rates_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_randr_refresh_rates_t, prev.index)); 719 i.rem = (R->nInfo - R->nSizes); 720 i.index = (char *) i.data - (char *) R; 721 return i; 722 } 723 724 725 /***************************************************************************** 726 ** 727 ** xcb_randr_get_screen_info_reply_t * xcb_randr_get_screen_info_reply 728 ** 729 ** @param xcb_connection_t *c 730 ** @param xcb_randr_get_screen_info_cookie_t cookie 731 ** @param xcb_generic_error_t **e 732 ** @returns xcb_randr_get_screen_info_reply_t * 733 ** 734 *****************************************************************************/ 735 736 xcb_randr_get_screen_info_reply_t * 737 xcb_randr_get_screen_info_reply (xcb_connection_t *c /**< */, 738 xcb_randr_get_screen_info_cookie_t cookie /**< */, 739 xcb_generic_error_t **e /**< */) 740 { 741 return (xcb_randr_get_screen_info_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 742 } 743 744 745 /***************************************************************************** 746 ** 747 ** xcb_randr_get_screen_size_range_cookie_t xcb_randr_get_screen_size_range 748 ** 749 ** @param xcb_connection_t *c 750 ** @param xcb_window_t window 751 ** @returns xcb_randr_get_screen_size_range_cookie_t 752 ** 753 *****************************************************************************/ 754 755 xcb_randr_get_screen_size_range_cookie_t 756 xcb_randr_get_screen_size_range (xcb_connection_t *c /**< */, 757 xcb_window_t window /**< */) 758 { 759 static const xcb_protocol_request_t xcb_req = { 760 /* count */ 2, 761 /* ext */ &xcb_randr_id, 762 /* opcode */ XCB_RANDR_GET_SCREEN_SIZE_RANGE, 763 /* isvoid */ 0 764 }; 765 766 struct iovec xcb_parts[4]; 767 xcb_randr_get_screen_size_range_cookie_t xcb_ret; 768 xcb_randr_get_screen_size_range_request_t xcb_out; 769 770 xcb_out.window = window; 771 772 xcb_parts[2].iov_base = (char *) &xcb_out; 773 xcb_parts[2].iov_len = sizeof(xcb_out); 774 xcb_parts[3].iov_base = 0; 775 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 776 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 777 return xcb_ret; 778 } 779 780 781 /***************************************************************************** 782 ** 783 ** xcb_randr_get_screen_size_range_cookie_t xcb_randr_get_screen_size_range_unchecked 784 ** 785 ** @param xcb_connection_t *c 786 ** @param xcb_window_t window 787 ** @returns xcb_randr_get_screen_size_range_cookie_t 788 ** 789 *****************************************************************************/ 790 791 xcb_randr_get_screen_size_range_cookie_t 792 xcb_randr_get_screen_size_range_unchecked (xcb_connection_t *c /**< */, 793 xcb_window_t window /**< */) 794 { 795 static const xcb_protocol_request_t xcb_req = { 796 /* count */ 2, 797 /* ext */ &xcb_randr_id, 798 /* opcode */ XCB_RANDR_GET_SCREEN_SIZE_RANGE, 799 /* isvoid */ 0 800 }; 801 802 struct iovec xcb_parts[4]; 803 xcb_randr_get_screen_size_range_cookie_t xcb_ret; 804 xcb_randr_get_screen_size_range_request_t xcb_out; 805 806 xcb_out.window = window; 807 808 xcb_parts[2].iov_base = (char *) &xcb_out; 809 xcb_parts[2].iov_len = sizeof(xcb_out); 810 xcb_parts[3].iov_base = 0; 811 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 812 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 813 return xcb_ret; 814 } 815 816 817 /***************************************************************************** 818 ** 819 ** xcb_randr_get_screen_size_range_reply_t * xcb_randr_get_screen_size_range_reply 820 ** 821 ** @param xcb_connection_t *c 822 ** @param xcb_randr_get_screen_size_range_cookie_t cookie 823 ** @param xcb_generic_error_t **e 824 ** @returns xcb_randr_get_screen_size_range_reply_t * 825 ** 826 *****************************************************************************/ 827 828 xcb_randr_get_screen_size_range_reply_t * 829 xcb_randr_get_screen_size_range_reply (xcb_connection_t *c /**< */, 830 xcb_randr_get_screen_size_range_cookie_t cookie /**< */, 831 xcb_generic_error_t **e /**< */) 832 { 833 return (xcb_randr_get_screen_size_range_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 834 } 835 836 837 /***************************************************************************** 838 ** 839 ** xcb_void_cookie_t xcb_randr_set_screen_size_checked 840 ** 841 ** @param xcb_connection_t *c 842 ** @param xcb_window_t window 843 ** @param uint16_t width 844 ** @param uint16_t height 845 ** @param uint32_t mm_width 846 ** @param uint32_t mm_height 847 ** @returns xcb_void_cookie_t 848 ** 849 *****************************************************************************/ 850 851 xcb_void_cookie_t 852 xcb_randr_set_screen_size_checked (xcb_connection_t *c /**< */, 853 xcb_window_t window /**< */, 854 uint16_t width /**< */, 855 uint16_t height /**< */, 856 uint32_t mm_width /**< */, 857 uint32_t mm_height /**< */) 858 { 859 static const xcb_protocol_request_t xcb_req = { 860 /* count */ 2, 861 /* ext */ &xcb_randr_id, 862 /* opcode */ XCB_RANDR_SET_SCREEN_SIZE, 863 /* isvoid */ 1 864 }; 865 866 struct iovec xcb_parts[4]; 867 xcb_void_cookie_t xcb_ret; 868 xcb_randr_set_screen_size_request_t xcb_out; 869 870 xcb_out.window = window; 871 xcb_out.width = width; 872 xcb_out.height = height; 873 xcb_out.mm_width = mm_width; 874 xcb_out.mm_height = mm_height; 875 876 xcb_parts[2].iov_base = (char *) &xcb_out; 877 xcb_parts[2].iov_len = sizeof(xcb_out); 878 xcb_parts[3].iov_base = 0; 879 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 880 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 881 return xcb_ret; 882 } 883 884 885 /***************************************************************************** 886 ** 887 ** xcb_void_cookie_t xcb_randr_set_screen_size 888 ** 889 ** @param xcb_connection_t *c 890 ** @param xcb_window_t window 891 ** @param uint16_t width 892 ** @param uint16_t height 893 ** @param uint32_t mm_width 894 ** @param uint32_t mm_height 895 ** @returns xcb_void_cookie_t 896 ** 897 *****************************************************************************/ 898 899 xcb_void_cookie_t 900 xcb_randr_set_screen_size (xcb_connection_t *c /**< */, 901 xcb_window_t window /**< */, 902 uint16_t width /**< */, 903 uint16_t height /**< */, 904 uint32_t mm_width /**< */, 905 uint32_t mm_height /**< */) 906 { 907 static const xcb_protocol_request_t xcb_req = { 908 /* count */ 2, 909 /* ext */ &xcb_randr_id, 910 /* opcode */ XCB_RANDR_SET_SCREEN_SIZE, 911 /* isvoid */ 1 912 }; 913 914 struct iovec xcb_parts[4]; 915 xcb_void_cookie_t xcb_ret; 916 xcb_randr_set_screen_size_request_t xcb_out; 917 918 xcb_out.window = window; 919 xcb_out.width = width; 920 xcb_out.height = height; 921 xcb_out.mm_width = mm_width; 922 xcb_out.mm_height = mm_height; 923 924 xcb_parts[2].iov_base = (char *) &xcb_out; 925 xcb_parts[2].iov_len = sizeof(xcb_out); 926 xcb_parts[3].iov_base = 0; 927 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 928 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 929 return xcb_ret; 930 } 931 932 933 /***************************************************************************** 934 ** 935 ** void xcb_randr_mode_info_next 936 ** 937 ** @param xcb_randr_mode_info_iterator_t *i 938 ** @returns void 939 ** 940 *****************************************************************************/ 941 942 void 943 xcb_randr_mode_info_next (xcb_randr_mode_info_iterator_t *i /**< */) 944 { 945 --i->rem; 946 ++i->data; 947 i->index += sizeof(xcb_randr_mode_info_t); 948 } 949 950 951 /***************************************************************************** 952 ** 953 ** xcb_generic_iterator_t xcb_randr_mode_info_end 954 ** 955 ** @param xcb_randr_mode_info_iterator_t i 956 ** @returns xcb_generic_iterator_t 957 ** 958 *****************************************************************************/ 959 960 xcb_generic_iterator_t 961 xcb_randr_mode_info_end (xcb_randr_mode_info_iterator_t i /**< */) 962 { 963 xcb_generic_iterator_t ret; 964 ret.data = i.data + i.rem; 965 ret.index = i.index + ((char *) ret.data - (char *) i.data); 966 ret.rem = 0; 967 return ret; 968 } 969 970 971 /***************************************************************************** 972 ** 973 ** xcb_randr_get_screen_resources_cookie_t xcb_randr_get_screen_resources 974 ** 975 ** @param xcb_connection_t *c 976 ** @param xcb_window_t window 977 ** @returns xcb_randr_get_screen_resources_cookie_t 978 ** 979 *****************************************************************************/ 980 981 xcb_randr_get_screen_resources_cookie_t 982 xcb_randr_get_screen_resources (xcb_connection_t *c /**< */, 983 xcb_window_t window /**< */) 984 { 985 static const xcb_protocol_request_t xcb_req = { 986 /* count */ 2, 987 /* ext */ &xcb_randr_id, 988 /* opcode */ XCB_RANDR_GET_SCREEN_RESOURCES, 989 /* isvoid */ 0 990 }; 991 992 struct iovec xcb_parts[4]; 993 xcb_randr_get_screen_resources_cookie_t xcb_ret; 994 xcb_randr_get_screen_resources_request_t xcb_out; 995 996 xcb_out.window = window; 997 998 xcb_parts[2].iov_base = (char *) &xcb_out; 999 xcb_parts[2].iov_len = sizeof(xcb_out); 1000 xcb_parts[3].iov_base = 0; 1001 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1002 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 1003 return xcb_ret; 1004 } 1005 1006 1007 /***************************************************************************** 1008 ** 1009 ** xcb_randr_get_screen_resources_cookie_t xcb_randr_get_screen_resources_unchecked 1010 ** 1011 ** @param xcb_connection_t *c 1012 ** @param xcb_window_t window 1013 ** @returns xcb_randr_get_screen_resources_cookie_t 1014 ** 1015 *****************************************************************************/ 1016 1017 xcb_randr_get_screen_resources_cookie_t 1018 xcb_randr_get_screen_resources_unchecked (xcb_connection_t *c /**< */, 1019 xcb_window_t window /**< */) 1020 { 1021 static const xcb_protocol_request_t xcb_req = { 1022 /* count */ 2, 1023 /* ext */ &xcb_randr_id, 1024 /* opcode */ XCB_RANDR_GET_SCREEN_RESOURCES, 1025 /* isvoid */ 0 1026 }; 1027 1028 struct iovec xcb_parts[4]; 1029 xcb_randr_get_screen_resources_cookie_t xcb_ret; 1030 xcb_randr_get_screen_resources_request_t xcb_out; 1031 1032 xcb_out.window = window; 1033 1034 xcb_parts[2].iov_base = (char *) &xcb_out; 1035 xcb_parts[2].iov_len = sizeof(xcb_out); 1036 xcb_parts[3].iov_base = 0; 1037 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1038 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 1039 return xcb_ret; 1040 } 1041 1042 1043 /***************************************************************************** 1044 ** 1045 ** xcb_randr_crtc_t * xcb_randr_get_screen_resources_crtcs 1046 ** 1047 ** @param const xcb_randr_get_screen_resources_reply_t *R 1048 ** @returns xcb_randr_crtc_t * 1049 ** 1050 *****************************************************************************/ 1051 1052 xcb_randr_crtc_t * 1053 xcb_randr_get_screen_resources_crtcs (const xcb_randr_get_screen_resources_reply_t *R /**< */) 1054 { 1055 return (xcb_randr_crtc_t *) (R + 1); 1056 } 1057 1058 1059 /***************************************************************************** 1060 ** 1061 ** int xcb_randr_get_screen_resources_crtcs_length 1062 ** 1063 ** @param const xcb_randr_get_screen_resources_reply_t *R 1064 ** @returns int 1065 ** 1066 *****************************************************************************/ 1067 1068 int 1069 xcb_randr_get_screen_resources_crtcs_length (const xcb_randr_get_screen_resources_reply_t *R /**< */) 1070 { 1071 return R->num_crtcs; 1072 } 1073 1074 1075 /***************************************************************************** 1076 ** 1077 ** xcb_generic_iterator_t xcb_randr_get_screen_resources_crtcs_end 1078 ** 1079 ** @param const xcb_randr_get_screen_resources_reply_t *R 1080 ** @returns xcb_generic_iterator_t 1081 ** 1082 *****************************************************************************/ 1083 1084 xcb_generic_iterator_t 1085 xcb_randr_get_screen_resources_crtcs_end (const xcb_randr_get_screen_resources_reply_t *R /**< */) 1086 { 1087 xcb_generic_iterator_t i; 1088 i.data = ((xcb_randr_crtc_t *) (R + 1)) + (R->num_crtcs); 1089 i.rem = 0; 1090 i.index = (char *) i.data - (char *) R; 1091 return i; 1092 } 1093 1094 1095 /***************************************************************************** 1096 ** 1097 ** xcb_randr_output_t * xcb_randr_get_screen_resources_outputs 1098 ** 1099 ** @param const xcb_randr_get_screen_resources_reply_t *R 1100 ** @returns xcb_randr_output_t * 1101 ** 1102 *****************************************************************************/ 1103 1104 xcb_randr_output_t * 1105 xcb_randr_get_screen_resources_outputs (const xcb_randr_get_screen_resources_reply_t *R /**< */) 1106 { 1107 xcb_generic_iterator_t prev = xcb_randr_get_screen_resources_crtcs_end(R); 1108 return (xcb_randr_output_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_randr_output_t, prev.index) + 0); 1109 } 1110 1111 1112 /***************************************************************************** 1113 ** 1114 ** int xcb_randr_get_screen_resources_outputs_length 1115 ** 1116 ** @param const xcb_randr_get_screen_resources_reply_t *R 1117 ** @returns int 1118 ** 1119 *****************************************************************************/ 1120 1121 int 1122 xcb_randr_get_screen_resources_outputs_length (const xcb_randr_get_screen_resources_reply_t *R /**< */) 1123 { 1124 return R->num_outputs; 1125 } 1126 1127 1128 /***************************************************************************** 1129 ** 1130 ** xcb_generic_iterator_t xcb_randr_get_screen_resources_outputs_end 1131 ** 1132 ** @param const xcb_randr_get_screen_resources_reply_t *R 1133 ** @returns xcb_generic_iterator_t 1134 ** 1135 *****************************************************************************/ 1136 1137 xcb_generic_iterator_t 1138 xcb_randr_get_screen_resources_outputs_end (const xcb_randr_get_screen_resources_reply_t *R /**< */) 1139 { 1140 xcb_generic_iterator_t i; 1141 xcb_generic_iterator_t child = xcb_randr_get_screen_resources_crtcs_end(R); 1142 i.data = ((xcb_randr_output_t *) child.data) + (R->num_outputs); 1143 i.rem = 0; 1144 i.index = (char *) i.data - (char *) R; 1145 return i; 1146 } 1147 1148 1149 /***************************************************************************** 1150 ** 1151 ** xcb_randr_mode_info_t * xcb_randr_get_screen_resources_modes 1152 ** 1153 ** @param const xcb_randr_get_screen_resources_reply_t *R 1154 ** @returns xcb_randr_mode_info_t * 1155 ** 1156 *****************************************************************************/ 1157 1158 xcb_randr_mode_info_t * 1159 xcb_randr_get_screen_resources_modes (const xcb_randr_get_screen_resources_reply_t *R /**< */) 1160 { 1161 xcb_generic_iterator_t prev = xcb_randr_get_screen_resources_outputs_end(R); 1162 return (xcb_randr_mode_info_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_randr_mode_info_t, prev.index) + 0); 1163 } 1164 1165 1166 /***************************************************************************** 1167 ** 1168 ** int xcb_randr_get_screen_resources_modes_length 1169 ** 1170 ** @param const xcb_randr_get_screen_resources_reply_t *R 1171 ** @returns int 1172 ** 1173 *****************************************************************************/ 1174 1175 int 1176 xcb_randr_get_screen_resources_modes_length (const xcb_randr_get_screen_resources_reply_t *R /**< */) 1177 { 1178 return R->num_modes; 1179 } 1180 1181 1182 /***************************************************************************** 1183 ** 1184 ** xcb_randr_mode_info_iterator_t xcb_randr_get_screen_resources_modes_iterator 1185 ** 1186 ** @param const xcb_randr_get_screen_resources_reply_t *R 1187 ** @returns xcb_randr_mode_info_iterator_t 1188 ** 1189 *****************************************************************************/ 1190 1191 xcb_randr_mode_info_iterator_t 1192 xcb_randr_get_screen_resources_modes_iterator (const xcb_randr_get_screen_resources_reply_t *R /**< */) 1193 { 1194 xcb_randr_mode_info_iterator_t i; 1195 xcb_generic_iterator_t prev = xcb_randr_get_screen_resources_outputs_end(R); 1196 i.data = (xcb_randr_mode_info_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_randr_mode_info_t, prev.index)); 1197 i.rem = R->num_modes; 1198 i.index = (char *) i.data - (char *) R; 1199 return i; 1200 } 1201 1202 1203 /***************************************************************************** 1204 ** 1205 ** uint8_t * xcb_randr_get_screen_resources_names 1206 ** 1207 ** @param const xcb_randr_get_screen_resources_reply_t *R 1208 ** @returns uint8_t * 1209 ** 1210 *****************************************************************************/ 1211 1212 uint8_t * 1213 xcb_randr_get_screen_resources_names (const xcb_randr_get_screen_resources_reply_t *R /**< */) 1214 { 1215 xcb_generic_iterator_t prev = xcb_randr_mode_info_end(xcb_randr_get_screen_resources_modes_iterator(R)); 1216 return (uint8_t *) ((char *) prev.data + XCB_TYPE_PAD(uint8_t, prev.index) + 0); 1217 } 1218 1219 1220 /***************************************************************************** 1221 ** 1222 ** int xcb_randr_get_screen_resources_names_length 1223 ** 1224 ** @param const xcb_randr_get_screen_resources_reply_t *R 1225 ** @returns int 1226 ** 1227 *****************************************************************************/ 1228 1229 int 1230 xcb_randr_get_screen_resources_names_length (const xcb_randr_get_screen_resources_reply_t *R /**< */) 1231 { 1232 return R->names_len; 1233 } 1234 1235 1236 /***************************************************************************** 1237 ** 1238 ** xcb_generic_iterator_t xcb_randr_get_screen_resources_names_end 1239 ** 1240 ** @param const xcb_randr_get_screen_resources_reply_t *R 1241 ** @returns xcb_generic_iterator_t 1242 ** 1243 *****************************************************************************/ 1244 1245 xcb_generic_iterator_t 1246 xcb_randr_get_screen_resources_names_end (const xcb_randr_get_screen_resources_reply_t *R /**< */) 1247 { 1248 xcb_generic_iterator_t i; 1249 xcb_generic_iterator_t child = xcb_randr_mode_info_end(xcb_randr_get_screen_resources_modes_iterator(R)); 1250 i.data = ((uint8_t *) child.data) + (R->names_len); 1251 i.rem = 0; 1252 i.index = (char *) i.data - (char *) R; 1253 return i; 1254 } 1255 1256 1257 /***************************************************************************** 1258 ** 1259 ** xcb_randr_get_screen_resources_reply_t * xcb_randr_get_screen_resources_reply 1260 ** 1261 ** @param xcb_connection_t *c 1262 ** @param xcb_randr_get_screen_resources_cookie_t cookie 1263 ** @param xcb_generic_error_t **e 1264 ** @returns xcb_randr_get_screen_resources_reply_t * 1265 ** 1266 *****************************************************************************/ 1267 1268 xcb_randr_get_screen_resources_reply_t * 1269 xcb_randr_get_screen_resources_reply (xcb_connection_t *c /**< */, 1270 xcb_randr_get_screen_resources_cookie_t cookie /**< */, 1271 xcb_generic_error_t **e /**< */) 1272 { 1273 return (xcb_randr_get_screen_resources_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 1274 } 1275 1276 1277 /***************************************************************************** 1278 ** 1279 ** xcb_randr_get_output_info_cookie_t xcb_randr_get_output_info 1280 ** 1281 ** @param xcb_connection_t *c 1282 ** @param xcb_randr_output_t output 1283 ** @param xcb_timestamp_t config_timestamp 1284 ** @returns xcb_randr_get_output_info_cookie_t 1285 ** 1286 *****************************************************************************/ 1287 1288 xcb_randr_get_output_info_cookie_t 1289 xcb_randr_get_output_info (xcb_connection_t *c /**< */, 1290 xcb_randr_output_t output /**< */, 1291 xcb_timestamp_t config_timestamp /**< */) 1292 { 1293 static const xcb_protocol_request_t xcb_req = { 1294 /* count */ 2, 1295 /* ext */ &xcb_randr_id, 1296 /* opcode */ XCB_RANDR_GET_OUTPUT_INFO, 1297 /* isvoid */ 0 1298 }; 1299 1300 struct iovec xcb_parts[4]; 1301 xcb_randr_get_output_info_cookie_t xcb_ret; 1302 xcb_randr_get_output_info_request_t xcb_out; 1303 1304 xcb_out.output = output; 1305 xcb_out.config_timestamp = config_timestamp; 1306 1307 xcb_parts[2].iov_base = (char *) &xcb_out; 1308 xcb_parts[2].iov_len = sizeof(xcb_out); 1309 xcb_parts[3].iov_base = 0; 1310 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1311 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 1312 return xcb_ret; 1313 } 1314 1315 1316 /***************************************************************************** 1317 ** 1318 ** xcb_randr_get_output_info_cookie_t xcb_randr_get_output_info_unchecked 1319 ** 1320 ** @param xcb_connection_t *c 1321 ** @param xcb_randr_output_t output 1322 ** @param xcb_timestamp_t config_timestamp 1323 ** @returns xcb_randr_get_output_info_cookie_t 1324 ** 1325 *****************************************************************************/ 1326 1327 xcb_randr_get_output_info_cookie_t 1328 xcb_randr_get_output_info_unchecked (xcb_connection_t *c /**< */, 1329 xcb_randr_output_t output /**< */, 1330 xcb_timestamp_t config_timestamp /**< */) 1331 { 1332 static const xcb_protocol_request_t xcb_req = { 1333 /* count */ 2, 1334 /* ext */ &xcb_randr_id, 1335 /* opcode */ XCB_RANDR_GET_OUTPUT_INFO, 1336 /* isvoid */ 0 1337 }; 1338 1339 struct iovec xcb_parts[4]; 1340 xcb_randr_get_output_info_cookie_t xcb_ret; 1341 xcb_randr_get_output_info_request_t xcb_out; 1342 1343 xcb_out.output = output; 1344 xcb_out.config_timestamp = config_timestamp; 1345 1346 xcb_parts[2].iov_base = (char *) &xcb_out; 1347 xcb_parts[2].iov_len = sizeof(xcb_out); 1348 xcb_parts[3].iov_base = 0; 1349 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1350 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 1351 return xcb_ret; 1352 } 1353 1354 1355 /***************************************************************************** 1356 ** 1357 ** xcb_randr_crtc_t * xcb_randr_get_output_info_crtcs 1358 ** 1359 ** @param const xcb_randr_get_output_info_reply_t *R 1360 ** @returns xcb_randr_crtc_t * 1361 ** 1362 *****************************************************************************/ 1363 1364 xcb_randr_crtc_t * 1365 xcb_randr_get_output_info_crtcs (const xcb_randr_get_output_info_reply_t *R /**< */) 1366 { 1367 return (xcb_randr_crtc_t *) (R + 1); 1368 } 1369 1370 1371 /***************************************************************************** 1372 ** 1373 ** int xcb_randr_get_output_info_crtcs_length 1374 ** 1375 ** @param const xcb_randr_get_output_info_reply_t *R 1376 ** @returns int 1377 ** 1378 *****************************************************************************/ 1379 1380 int 1381 xcb_randr_get_output_info_crtcs_length (const xcb_randr_get_output_info_reply_t *R /**< */) 1382 { 1383 return R->num_crtcs; 1384 } 1385 1386 1387 /***************************************************************************** 1388 ** 1389 ** xcb_generic_iterator_t xcb_randr_get_output_info_crtcs_end 1390 ** 1391 ** @param const xcb_randr_get_output_info_reply_t *R 1392 ** @returns xcb_generic_iterator_t 1393 ** 1394 *****************************************************************************/ 1395 1396 xcb_generic_iterator_t 1397 xcb_randr_get_output_info_crtcs_end (const xcb_randr_get_output_info_reply_t *R /**< */) 1398 { 1399 xcb_generic_iterator_t i; 1400 i.data = ((xcb_randr_crtc_t *) (R + 1)) + (R->num_crtcs); 1401 i.rem = 0; 1402 i.index = (char *) i.data - (char *) R; 1403 return i; 1404 } 1405 1406 1407 /***************************************************************************** 1408 ** 1409 ** xcb_randr_mode_t * xcb_randr_get_output_info_modes 1410 ** 1411 ** @param const xcb_randr_get_output_info_reply_t *R 1412 ** @returns xcb_randr_mode_t * 1413 ** 1414 *****************************************************************************/ 1415 1416 xcb_randr_mode_t * 1417 xcb_randr_get_output_info_modes (const xcb_randr_get_output_info_reply_t *R /**< */) 1418 { 1419 xcb_generic_iterator_t prev = xcb_randr_get_output_info_crtcs_end(R); 1420 return (xcb_randr_mode_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_randr_mode_t, prev.index) + 0); 1421 } 1422 1423 1424 /***************************************************************************** 1425 ** 1426 ** int xcb_randr_get_output_info_modes_length 1427 ** 1428 ** @param const xcb_randr_get_output_info_reply_t *R 1429 ** @returns int 1430 ** 1431 *****************************************************************************/ 1432 1433 int 1434 xcb_randr_get_output_info_modes_length (const xcb_randr_get_output_info_reply_t *R /**< */) 1435 { 1436 return R->num_modes; 1437 } 1438 1439 1440 /***************************************************************************** 1441 ** 1442 ** xcb_generic_iterator_t xcb_randr_get_output_info_modes_end 1443 ** 1444 ** @param const xcb_randr_get_output_info_reply_t *R 1445 ** @returns xcb_generic_iterator_t 1446 ** 1447 *****************************************************************************/ 1448 1449 xcb_generic_iterator_t 1450 xcb_randr_get_output_info_modes_end (const xcb_randr_get_output_info_reply_t *R /**< */) 1451 { 1452 xcb_generic_iterator_t i; 1453 xcb_generic_iterator_t child = xcb_randr_get_output_info_crtcs_end(R); 1454 i.data = ((xcb_randr_mode_t *) child.data) + (R->num_modes); 1455 i.rem = 0; 1456 i.index = (char *) i.data - (char *) R; 1457 return i; 1458 } 1459 1460 1461 /***************************************************************************** 1462 ** 1463 ** xcb_randr_output_t * xcb_randr_get_output_info_clones 1464 ** 1465 ** @param const xcb_randr_get_output_info_reply_t *R 1466 ** @returns xcb_randr_output_t * 1467 ** 1468 *****************************************************************************/ 1469 1470 xcb_randr_output_t * 1471 xcb_randr_get_output_info_clones (const xcb_randr_get_output_info_reply_t *R /**< */) 1472 { 1473 xcb_generic_iterator_t prev = xcb_randr_get_output_info_modes_end(R); 1474 return (xcb_randr_output_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_randr_output_t, prev.index) + 0); 1475 } 1476 1477 1478 /***************************************************************************** 1479 ** 1480 ** int xcb_randr_get_output_info_clones_length 1481 ** 1482 ** @param const xcb_randr_get_output_info_reply_t *R 1483 ** @returns int 1484 ** 1485 *****************************************************************************/ 1486 1487 int 1488 xcb_randr_get_output_info_clones_length (const xcb_randr_get_output_info_reply_t *R /**< */) 1489 { 1490 return R->num_clones; 1491 } 1492 1493 1494 /***************************************************************************** 1495 ** 1496 ** xcb_generic_iterator_t xcb_randr_get_output_info_clones_end 1497 ** 1498 ** @param const xcb_randr_get_output_info_reply_t *R 1499 ** @returns xcb_generic_iterator_t 1500 ** 1501 *****************************************************************************/ 1502 1503 xcb_generic_iterator_t 1504 xcb_randr_get_output_info_clones_end (const xcb_randr_get_output_info_reply_t *R /**< */) 1505 { 1506 xcb_generic_iterator_t i; 1507 xcb_generic_iterator_t child = xcb_randr_get_output_info_modes_end(R); 1508 i.data = ((xcb_randr_output_t *) child.data) + (R->num_clones); 1509 i.rem = 0; 1510 i.index = (char *) i.data - (char *) R; 1511 return i; 1512 } 1513 1514 1515 /***************************************************************************** 1516 ** 1517 ** uint8_t * xcb_randr_get_output_info_name 1518 ** 1519 ** @param const xcb_randr_get_output_info_reply_t *R 1520 ** @returns uint8_t * 1521 ** 1522 *****************************************************************************/ 1523 1524 uint8_t * 1525 xcb_randr_get_output_info_name (const xcb_randr_get_output_info_reply_t *R /**< */) 1526 { 1527 xcb_generic_iterator_t prev = xcb_randr_get_output_info_clones_end(R); 1528 return (uint8_t *) ((char *) prev.data + XCB_TYPE_PAD(uint8_t, prev.index) + 0); 1529 } 1530 1531 1532 /***************************************************************************** 1533 ** 1534 ** int xcb_randr_get_output_info_name_length 1535 ** 1536 ** @param const xcb_randr_get_output_info_reply_t *R 1537 ** @returns int 1538 ** 1539 *****************************************************************************/ 1540 1541 int 1542 xcb_randr_get_output_info_name_length (const xcb_randr_get_output_info_reply_t *R /**< */) 1543 { 1544 return R->name_len; 1545 } 1546 1547 1548 /***************************************************************************** 1549 ** 1550 ** xcb_generic_iterator_t xcb_randr_get_output_info_name_end 1551 ** 1552 ** @param const xcb_randr_get_output_info_reply_t *R 1553 ** @returns xcb_generic_iterator_t 1554 ** 1555 *****************************************************************************/ 1556 1557 xcb_generic_iterator_t 1558 xcb_randr_get_output_info_name_end (const xcb_randr_get_output_info_reply_t *R /**< */) 1559 { 1560 xcb_generic_iterator_t i; 1561 xcb_generic_iterator_t child = xcb_randr_get_output_info_clones_end(R); 1562 i.data = ((uint8_t *) child.data) + (R->name_len); 1563 i.rem = 0; 1564 i.index = (char *) i.data - (char *) R; 1565 return i; 1566 } 1567 1568 1569 /***************************************************************************** 1570 ** 1571 ** xcb_randr_get_output_info_reply_t * xcb_randr_get_output_info_reply 1572 ** 1573 ** @param xcb_connection_t *c 1574 ** @param xcb_randr_get_output_info_cookie_t cookie 1575 ** @param xcb_generic_error_t **e 1576 ** @returns xcb_randr_get_output_info_reply_t * 1577 ** 1578 *****************************************************************************/ 1579 1580 xcb_randr_get_output_info_reply_t * 1581 xcb_randr_get_output_info_reply (xcb_connection_t *c /**< */, 1582 xcb_randr_get_output_info_cookie_t cookie /**< */, 1583 xcb_generic_error_t **e /**< */) 1584 { 1585 return (xcb_randr_get_output_info_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 1586 } 1587 1588 1589 /***************************************************************************** 1590 ** 1591 ** xcb_randr_list_output_properties_cookie_t xcb_randr_list_output_properties 1592 ** 1593 ** @param xcb_connection_t *c 1594 ** @param xcb_randr_output_t output 1595 ** @returns xcb_randr_list_output_properties_cookie_t 1596 ** 1597 *****************************************************************************/ 1598 1599 xcb_randr_list_output_properties_cookie_t 1600 xcb_randr_list_output_properties (xcb_connection_t *c /**< */, 1601 xcb_randr_output_t output /**< */) 1602 { 1603 static const xcb_protocol_request_t xcb_req = { 1604 /* count */ 2, 1605 /* ext */ &xcb_randr_id, 1606 /* opcode */ XCB_RANDR_LIST_OUTPUT_PROPERTIES, 1607 /* isvoid */ 0 1608 }; 1609 1610 struct iovec xcb_parts[4]; 1611 xcb_randr_list_output_properties_cookie_t xcb_ret; 1612 xcb_randr_list_output_properties_request_t xcb_out; 1613 1614 xcb_out.output = output; 1615 1616 xcb_parts[2].iov_base = (char *) &xcb_out; 1617 xcb_parts[2].iov_len = sizeof(xcb_out); 1618 xcb_parts[3].iov_base = 0; 1619 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1620 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 1621 return xcb_ret; 1622 } 1623 1624 1625 /***************************************************************************** 1626 ** 1627 ** xcb_randr_list_output_properties_cookie_t xcb_randr_list_output_properties_unchecked 1628 ** 1629 ** @param xcb_connection_t *c 1630 ** @param xcb_randr_output_t output 1631 ** @returns xcb_randr_list_output_properties_cookie_t 1632 ** 1633 *****************************************************************************/ 1634 1635 xcb_randr_list_output_properties_cookie_t 1636 xcb_randr_list_output_properties_unchecked (xcb_connection_t *c /**< */, 1637 xcb_randr_output_t output /**< */) 1638 { 1639 static const xcb_protocol_request_t xcb_req = { 1640 /* count */ 2, 1641 /* ext */ &xcb_randr_id, 1642 /* opcode */ XCB_RANDR_LIST_OUTPUT_PROPERTIES, 1643 /* isvoid */ 0 1644 }; 1645 1646 struct iovec xcb_parts[4]; 1647 xcb_randr_list_output_properties_cookie_t xcb_ret; 1648 xcb_randr_list_output_properties_request_t xcb_out; 1649 1650 xcb_out.output = output; 1651 1652 xcb_parts[2].iov_base = (char *) &xcb_out; 1653 xcb_parts[2].iov_len = sizeof(xcb_out); 1654 xcb_parts[3].iov_base = 0; 1655 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1656 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 1657 return xcb_ret; 1658 } 1659 1660 1661 /***************************************************************************** 1662 ** 1663 ** xcb_atom_t * xcb_randr_list_output_properties_atoms 1664 ** 1665 ** @param const xcb_randr_list_output_properties_reply_t *R 1666 ** @returns xcb_atom_t * 1667 ** 1668 *****************************************************************************/ 1669 1670 xcb_atom_t * 1671 xcb_randr_list_output_properties_atoms (const xcb_randr_list_output_properties_reply_t *R /**< */) 1672 { 1673 return (xcb_atom_t *) (R + 1); 1674 } 1675 1676 1677 /***************************************************************************** 1678 ** 1679 ** int xcb_randr_list_output_properties_atoms_length 1680 ** 1681 ** @param const xcb_randr_list_output_properties_reply_t *R 1682 ** @returns int 1683 ** 1684 *****************************************************************************/ 1685 1686 int 1687 xcb_randr_list_output_properties_atoms_length (const xcb_randr_list_output_properties_reply_t *R /**< */) 1688 { 1689 return R->num_atoms; 1690 } 1691 1692 1693 /***************************************************************************** 1694 ** 1695 ** xcb_generic_iterator_t xcb_randr_list_output_properties_atoms_end 1696 ** 1697 ** @param const xcb_randr_list_output_properties_reply_t *R 1698 ** @returns xcb_generic_iterator_t 1699 ** 1700 *****************************************************************************/ 1701 1702 xcb_generic_iterator_t 1703 xcb_randr_list_output_properties_atoms_end (const xcb_randr_list_output_properties_reply_t *R /**< */) 1704 { 1705 xcb_generic_iterator_t i; 1706 i.data = ((xcb_atom_t *) (R + 1)) + (R->num_atoms); 1707 i.rem = 0; 1708 i.index = (char *) i.data - (char *) R; 1709 return i; 1710 } 1711 1712 1713 /***************************************************************************** 1714 ** 1715 ** xcb_randr_list_output_properties_reply_t * xcb_randr_list_output_properties_reply 1716 ** 1717 ** @param xcb_connection_t *c 1718 ** @param xcb_randr_list_output_properties_cookie_t cookie 1719 ** @param xcb_generic_error_t **e 1720 ** @returns xcb_randr_list_output_properties_reply_t * 1721 ** 1722 *****************************************************************************/ 1723 1724 xcb_randr_list_output_properties_reply_t * 1725 xcb_randr_list_output_properties_reply (xcb_connection_t *c /**< */, 1726 xcb_randr_list_output_properties_cookie_t cookie /**< */, 1727 xcb_generic_error_t **e /**< */) 1728 { 1729 return (xcb_randr_list_output_properties_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 1730 } 1731 1732 1733 /***************************************************************************** 1734 ** 1735 ** xcb_randr_query_output_property_cookie_t xcb_randr_query_output_property 1736 ** 1737 ** @param xcb_connection_t *c 1738 ** @param xcb_randr_output_t output 1739 ** @param xcb_atom_t property 1740 ** @returns xcb_randr_query_output_property_cookie_t 1741 ** 1742 *****************************************************************************/ 1743 1744 xcb_randr_query_output_property_cookie_t 1745 xcb_randr_query_output_property (xcb_connection_t *c /**< */, 1746 xcb_randr_output_t output /**< */, 1747 xcb_atom_t property /**< */) 1748 { 1749 static const xcb_protocol_request_t xcb_req = { 1750 /* count */ 2, 1751 /* ext */ &xcb_randr_id, 1752 /* opcode */ XCB_RANDR_QUERY_OUTPUT_PROPERTY, 1753 /* isvoid */ 0 1754 }; 1755 1756 struct iovec xcb_parts[4]; 1757 xcb_randr_query_output_property_cookie_t xcb_ret; 1758 xcb_randr_query_output_property_request_t xcb_out; 1759 1760 xcb_out.output = output; 1761 xcb_out.property = property; 1762 1763 xcb_parts[2].iov_base = (char *) &xcb_out; 1764 xcb_parts[2].iov_len = sizeof(xcb_out); 1765 xcb_parts[3].iov_base = 0; 1766 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1767 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 1768 return xcb_ret; 1769 } 1770 1771 1772 /***************************************************************************** 1773 ** 1774 ** xcb_randr_query_output_property_cookie_t xcb_randr_query_output_property_unchecked 1775 ** 1776 ** @param xcb_connection_t *c 1777 ** @param xcb_randr_output_t output 1778 ** @param xcb_atom_t property 1779 ** @returns xcb_randr_query_output_property_cookie_t 1780 ** 1781 *****************************************************************************/ 1782 1783 xcb_randr_query_output_property_cookie_t 1784 xcb_randr_query_output_property_unchecked (xcb_connection_t *c /**< */, 1785 xcb_randr_output_t output /**< */, 1786 xcb_atom_t property /**< */) 1787 { 1788 static const xcb_protocol_request_t xcb_req = { 1789 /* count */ 2, 1790 /* ext */ &xcb_randr_id, 1791 /* opcode */ XCB_RANDR_QUERY_OUTPUT_PROPERTY, 1792 /* isvoid */ 0 1793 }; 1794 1795 struct iovec xcb_parts[4]; 1796 xcb_randr_query_output_property_cookie_t xcb_ret; 1797 xcb_randr_query_output_property_request_t xcb_out; 1798 1799 xcb_out.output = output; 1800 xcb_out.property = property; 1801 1802 xcb_parts[2].iov_base = (char *) &xcb_out; 1803 xcb_parts[2].iov_len = sizeof(xcb_out); 1804 xcb_parts[3].iov_base = 0; 1805 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1806 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 1807 return xcb_ret; 1808 } 1809 1810 1811 /***************************************************************************** 1812 ** 1813 ** int32_t * xcb_randr_query_output_property_valid_values 1814 ** 1815 ** @param const xcb_randr_query_output_property_reply_t *R 1816 ** @returns int32_t * 1817 ** 1818 *****************************************************************************/ 1819 1820 int32_t * 1821 xcb_randr_query_output_property_valid_values (const xcb_randr_query_output_property_reply_t *R /**< */) 1822 { 1823 return (int32_t *) (R + 1); 1824 } 1825 1826 1827 /***************************************************************************** 1828 ** 1829 ** int xcb_randr_query_output_property_valid_values_length 1830 ** 1831 ** @param const xcb_randr_query_output_property_reply_t *R 1832 ** @returns int 1833 ** 1834 *****************************************************************************/ 1835 1836 int 1837 xcb_randr_query_output_property_valid_values_length (const xcb_randr_query_output_property_reply_t *R /**< */) 1838 { 1839 return R->length; 1840 } 1841 1842 1843 /***************************************************************************** 1844 ** 1845 ** xcb_generic_iterator_t xcb_randr_query_output_property_valid_values_end 1846 ** 1847 ** @param const xcb_randr_query_output_property_reply_t *R 1848 ** @returns xcb_generic_iterator_t 1849 ** 1850 *****************************************************************************/ 1851 1852 xcb_generic_iterator_t 1853 xcb_randr_query_output_property_valid_values_end (const xcb_randr_query_output_property_reply_t *R /**< */) 1854 { 1855 xcb_generic_iterator_t i; 1856 i.data = ((int32_t *) (R + 1)) + (R->length); 1857 i.rem = 0; 1858 i.index = (char *) i.data - (char *) R; 1859 return i; 1860 } 1861 1862 1863 /***************************************************************************** 1864 ** 1865 ** xcb_randr_query_output_property_reply_t * xcb_randr_query_output_property_reply 1866 ** 1867 ** @param xcb_connection_t *c 1868 ** @param xcb_randr_query_output_property_cookie_t cookie 1869 ** @param xcb_generic_error_t **e 1870 ** @returns xcb_randr_query_output_property_reply_t * 1871 ** 1872 *****************************************************************************/ 1873 1874 xcb_randr_query_output_property_reply_t * 1875 xcb_randr_query_output_property_reply (xcb_connection_t *c /**< */, 1876 xcb_randr_query_output_property_cookie_t cookie /**< */, 1877 xcb_generic_error_t **e /**< */) 1878 { 1879 return (xcb_randr_query_output_property_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 1880 } 1881 1882 1883 /***************************************************************************** 1884 ** 1885 ** xcb_void_cookie_t xcb_randr_configure_output_property_checked 1886 ** 1887 ** @param xcb_connection_t *c 1888 ** @param xcb_randr_output_t output 1889 ** @param xcb_atom_t property 1890 ** @param uint8_t pending 1891 ** @param uint8_t range 1892 ** @param uint32_t values_len 1893 ** @param const int32_t *values 1894 ** @returns xcb_void_cookie_t 1895 ** 1896 *****************************************************************************/ 1897 1898 xcb_void_cookie_t 1899 xcb_randr_configure_output_property_checked (xcb_connection_t *c /**< */, 1900 xcb_randr_output_t output /**< */, 1901 xcb_atom_t property /**< */, 1902 uint8_t pending /**< */, 1903 uint8_t range /**< */, 1904 uint32_t values_len /**< */, 1905 const int32_t *values /**< */) 1906 { 1907 static const xcb_protocol_request_t xcb_req = { 1908 /* count */ 4, 1909 /* ext */ &xcb_randr_id, 1910 /* opcode */ XCB_RANDR_CONFIGURE_OUTPUT_PROPERTY, 1911 /* isvoid */ 1 1912 }; 1913 1914 struct iovec xcb_parts[6]; 1915 xcb_void_cookie_t xcb_ret; 1916 xcb_randr_configure_output_property_request_t xcb_out; 1917 1918 xcb_out.output = output; 1919 xcb_out.property = property; 1920 xcb_out.pending = pending; 1921 xcb_out.range = range; 1922 memset(xcb_out.pad0, 0, 2); 1923 1924 xcb_parts[2].iov_base = (char *) &xcb_out; 1925 xcb_parts[2].iov_len = sizeof(xcb_out); 1926 xcb_parts[3].iov_base = 0; 1927 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1928 xcb_parts[4].iov_base = (char *) values; 1929 xcb_parts[4].iov_len = values_len * sizeof(int32_t); 1930 xcb_parts[5].iov_base = 0; 1931 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 1932 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 1933 return xcb_ret; 1934 } 1935 1936 1937 /***************************************************************************** 1938 ** 1939 ** xcb_void_cookie_t xcb_randr_configure_output_property 1940 ** 1941 ** @param xcb_connection_t *c 1942 ** @param xcb_randr_output_t output 1943 ** @param xcb_atom_t property 1944 ** @param uint8_t pending 1945 ** @param uint8_t range 1946 ** @param uint32_t values_len 1947 ** @param const int32_t *values 1948 ** @returns xcb_void_cookie_t 1949 ** 1950 *****************************************************************************/ 1951 1952 xcb_void_cookie_t 1953 xcb_randr_configure_output_property (xcb_connection_t *c /**< */, 1954 xcb_randr_output_t output /**< */, 1955 xcb_atom_t property /**< */, 1956 uint8_t pending /**< */, 1957 uint8_t range /**< */, 1958 uint32_t values_len /**< */, 1959 const int32_t *values /**< */) 1960 { 1961 static const xcb_protocol_request_t xcb_req = { 1962 /* count */ 4, 1963 /* ext */ &xcb_randr_id, 1964 /* opcode */ XCB_RANDR_CONFIGURE_OUTPUT_PROPERTY, 1965 /* isvoid */ 1 1966 }; 1967 1968 struct iovec xcb_parts[6]; 1969 xcb_void_cookie_t xcb_ret; 1970 xcb_randr_configure_output_property_request_t xcb_out; 1971 1972 xcb_out.output = output; 1973 xcb_out.property = property; 1974 xcb_out.pending = pending; 1975 xcb_out.range = range; 1976 memset(xcb_out.pad0, 0, 2); 1977 1978 xcb_parts[2].iov_base = (char *) &xcb_out; 1979 xcb_parts[2].iov_len = sizeof(xcb_out); 1980 xcb_parts[3].iov_base = 0; 1981 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1982 xcb_parts[4].iov_base = (char *) values; 1983 xcb_parts[4].iov_len = values_len * sizeof(int32_t); 1984 xcb_parts[5].iov_base = 0; 1985 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 1986 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 1987 return xcb_ret; 1988 } 1989 1990 1991 /***************************************************************************** 1992 ** 1993 ** xcb_void_cookie_t xcb_randr_change_output_property_checked 1994 ** 1995 ** @param xcb_connection_t *c 1996 ** @param xcb_randr_output_t output 1997 ** @param xcb_atom_t property 1998 ** @param xcb_atom_t type 1999 ** @param uint8_t format 2000 ** @param uint8_t mode 2001 ** @param uint32_t num_units 2002 ** @param const void *data 2003 ** @returns xcb_void_cookie_t 2004 ** 2005 *****************************************************************************/ 2006 2007 xcb_void_cookie_t 2008 xcb_randr_change_output_property_checked (xcb_connection_t *c /**< */, 2009 xcb_randr_output_t output /**< */, 2010 xcb_atom_t property /**< */, 2011 xcb_atom_t type /**< */, 2012 uint8_t format /**< */, 2013 uint8_t mode /**< */, 2014 uint32_t num_units /**< */, 2015 const void *data /**< */) 2016 { 2017 static const xcb_protocol_request_t xcb_req = { 2018 /* count */ 4, 2019 /* ext */ &xcb_randr_id, 2020 /* opcode */ XCB_RANDR_CHANGE_OUTPUT_PROPERTY, 2021 /* isvoid */ 1 2022 }; 2023 2024 struct iovec xcb_parts[6]; 2025 xcb_void_cookie_t xcb_ret; 2026 xcb_randr_change_output_property_request_t xcb_out; 2027 2028 xcb_out.output = output; 2029 xcb_out.property = property; 2030 xcb_out.type = type; 2031 xcb_out.format = format; 2032 xcb_out.mode = mode; 2033 memset(xcb_out.pad0, 0, 2); 2034 xcb_out.num_units = num_units; 2035 2036 xcb_parts[2].iov_base = (char *) &xcb_out; 2037 xcb_parts[2].iov_len = sizeof(xcb_out); 2038 xcb_parts[3].iov_base = 0; 2039 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2040 xcb_parts[4].iov_base = (char *) data; 2041 xcb_parts[4].iov_len = ((num_units * format) / 8) * sizeof(char); 2042 xcb_parts[5].iov_base = 0; 2043 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 2044 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 2045 return xcb_ret; 2046 } 2047 2048 2049 /***************************************************************************** 2050 ** 2051 ** xcb_void_cookie_t xcb_randr_change_output_property 2052 ** 2053 ** @param xcb_connection_t *c 2054 ** @param xcb_randr_output_t output 2055 ** @param xcb_atom_t property 2056 ** @param xcb_atom_t type 2057 ** @param uint8_t format 2058 ** @param uint8_t mode 2059 ** @param uint32_t num_units 2060 ** @param const void *data 2061 ** @returns xcb_void_cookie_t 2062 ** 2063 *****************************************************************************/ 2064 2065 xcb_void_cookie_t 2066 xcb_randr_change_output_property (xcb_connection_t *c /**< */, 2067 xcb_randr_output_t output /**< */, 2068 xcb_atom_t property /**< */, 2069 xcb_atom_t type /**< */, 2070 uint8_t format /**< */, 2071 uint8_t mode /**< */, 2072 uint32_t num_units /**< */, 2073 const void *data /**< */) 2074 { 2075 static const xcb_protocol_request_t xcb_req = { 2076 /* count */ 4, 2077 /* ext */ &xcb_randr_id, 2078 /* opcode */ XCB_RANDR_CHANGE_OUTPUT_PROPERTY, 2079 /* isvoid */ 1 2080 }; 2081 2082 struct iovec xcb_parts[6]; 2083 xcb_void_cookie_t xcb_ret; 2084 xcb_randr_change_output_property_request_t xcb_out; 2085 2086 xcb_out.output = output; 2087 xcb_out.property = property; 2088 xcb_out.type = type; 2089 xcb_out.format = format; 2090 xcb_out.mode = mode; 2091 memset(xcb_out.pad0, 0, 2); 2092 xcb_out.num_units = num_units; 2093 2094 xcb_parts[2].iov_base = (char *) &xcb_out; 2095 xcb_parts[2].iov_len = sizeof(xcb_out); 2096 xcb_parts[3].iov_base = 0; 2097 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2098 xcb_parts[4].iov_base = (char *) data; 2099 xcb_parts[4].iov_len = ((num_units * format) / 8) * sizeof(char); 2100 xcb_parts[5].iov_base = 0; 2101 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 2102 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 2103 return xcb_ret; 2104 } 2105 2106 2107 /***************************************************************************** 2108 ** 2109 ** xcb_void_cookie_t xcb_randr_delete_output_property_checked 2110 ** 2111 ** @param xcb_connection_t *c 2112 ** @param xcb_randr_output_t output 2113 ** @param xcb_atom_t property 2114 ** @returns xcb_void_cookie_t 2115 ** 2116 *****************************************************************************/ 2117 2118 xcb_void_cookie_t 2119 xcb_randr_delete_output_property_checked (xcb_connection_t *c /**< */, 2120 xcb_randr_output_t output /**< */, 2121 xcb_atom_t property /**< */) 2122 { 2123 static const xcb_protocol_request_t xcb_req = { 2124 /* count */ 2, 2125 /* ext */ &xcb_randr_id, 2126 /* opcode */ XCB_RANDR_DELETE_OUTPUT_PROPERTY, 2127 /* isvoid */ 1 2128 }; 2129 2130 struct iovec xcb_parts[4]; 2131 xcb_void_cookie_t xcb_ret; 2132 xcb_randr_delete_output_property_request_t xcb_out; 2133 2134 xcb_out.output = output; 2135 xcb_out.property = property; 2136 2137 xcb_parts[2].iov_base = (char *) &xcb_out; 2138 xcb_parts[2].iov_len = sizeof(xcb_out); 2139 xcb_parts[3].iov_base = 0; 2140 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2141 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 2142 return xcb_ret; 2143 } 2144 2145 2146 /***************************************************************************** 2147 ** 2148 ** xcb_void_cookie_t xcb_randr_delete_output_property 2149 ** 2150 ** @param xcb_connection_t *c 2151 ** @param xcb_randr_output_t output 2152 ** @param xcb_atom_t property 2153 ** @returns xcb_void_cookie_t 2154 ** 2155 *****************************************************************************/ 2156 2157 xcb_void_cookie_t 2158 xcb_randr_delete_output_property (xcb_connection_t *c /**< */, 2159 xcb_randr_output_t output /**< */, 2160 xcb_atom_t property /**< */) 2161 { 2162 static const xcb_protocol_request_t xcb_req = { 2163 /* count */ 2, 2164 /* ext */ &xcb_randr_id, 2165 /* opcode */ XCB_RANDR_DELETE_OUTPUT_PROPERTY, 2166 /* isvoid */ 1 2167 }; 2168 2169 struct iovec xcb_parts[4]; 2170 xcb_void_cookie_t xcb_ret; 2171 xcb_randr_delete_output_property_request_t xcb_out; 2172 2173 xcb_out.output = output; 2174 xcb_out.property = property; 2175 2176 xcb_parts[2].iov_base = (char *) &xcb_out; 2177 xcb_parts[2].iov_len = sizeof(xcb_out); 2178 xcb_parts[3].iov_base = 0; 2179 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2180 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 2181 return xcb_ret; 2182 } 2183 2184 2185 /***************************************************************************** 2186 ** 2187 ** xcb_randr_get_output_property_cookie_t xcb_randr_get_output_property 2188 ** 2189 ** @param xcb_connection_t *c 2190 ** @param xcb_randr_output_t output 2191 ** @param xcb_atom_t property 2192 ** @param xcb_atom_t type 2193 ** @param uint32_t long_offset 2194 ** @param uint32_t long_length 2195 ** @param uint8_t _delete 2196 ** @param uint8_t pending 2197 ** @returns xcb_randr_get_output_property_cookie_t 2198 ** 2199 *****************************************************************************/ 2200 2201 xcb_randr_get_output_property_cookie_t 2202 xcb_randr_get_output_property (xcb_connection_t *c /**< */, 2203 xcb_randr_output_t output /**< */, 2204 xcb_atom_t property /**< */, 2205 xcb_atom_t type /**< */, 2206 uint32_t long_offset /**< */, 2207 uint32_t long_length /**< */, 2208 uint8_t _delete /**< */, 2209 uint8_t pending /**< */) 2210 { 2211 static const xcb_protocol_request_t xcb_req = { 2212 /* count */ 2, 2213 /* ext */ &xcb_randr_id, 2214 /* opcode */ XCB_RANDR_GET_OUTPUT_PROPERTY, 2215 /* isvoid */ 0 2216 }; 2217 2218 struct iovec xcb_parts[4]; 2219 xcb_randr_get_output_property_cookie_t xcb_ret; 2220 xcb_randr_get_output_property_request_t xcb_out; 2221 2222 xcb_out.output = output; 2223 xcb_out.property = property; 2224 xcb_out.type = type; 2225 xcb_out.long_offset = long_offset; 2226 xcb_out.long_length = long_length; 2227 xcb_out._delete = _delete; 2228 xcb_out.pending = pending; 2229 memset(xcb_out.pad0, 0, 2); 2230 2231 xcb_parts[2].iov_base = (char *) &xcb_out; 2232 xcb_parts[2].iov_len = sizeof(xcb_out); 2233 xcb_parts[3].iov_base = 0; 2234 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2235 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 2236 return xcb_ret; 2237 } 2238 2239 2240 /***************************************************************************** 2241 ** 2242 ** xcb_randr_get_output_property_cookie_t xcb_randr_get_output_property_unchecked 2243 ** 2244 ** @param xcb_connection_t *c 2245 ** @param xcb_randr_output_t output 2246 ** @param xcb_atom_t property 2247 ** @param xcb_atom_t type 2248 ** @param uint32_t long_offset 2249 ** @param uint32_t long_length 2250 ** @param uint8_t _delete 2251 ** @param uint8_t pending 2252 ** @returns xcb_randr_get_output_property_cookie_t 2253 ** 2254 *****************************************************************************/ 2255 2256 xcb_randr_get_output_property_cookie_t 2257 xcb_randr_get_output_property_unchecked (xcb_connection_t *c /**< */, 2258 xcb_randr_output_t output /**< */, 2259 xcb_atom_t property /**< */, 2260 xcb_atom_t type /**< */, 2261 uint32_t long_offset /**< */, 2262 uint32_t long_length /**< */, 2263 uint8_t _delete /**< */, 2264 uint8_t pending /**< */) 2265 { 2266 static const xcb_protocol_request_t xcb_req = { 2267 /* count */ 2, 2268 /* ext */ &xcb_randr_id, 2269 /* opcode */ XCB_RANDR_GET_OUTPUT_PROPERTY, 2270 /* isvoid */ 0 2271 }; 2272 2273 struct iovec xcb_parts[4]; 2274 xcb_randr_get_output_property_cookie_t xcb_ret; 2275 xcb_randr_get_output_property_request_t xcb_out; 2276 2277 xcb_out.output = output; 2278 xcb_out.property = property; 2279 xcb_out.type = type; 2280 xcb_out.long_offset = long_offset; 2281 xcb_out.long_length = long_length; 2282 xcb_out._delete = _delete; 2283 xcb_out.pending = pending; 2284 memset(xcb_out.pad0, 0, 2); 2285 2286 xcb_parts[2].iov_base = (char *) &xcb_out; 2287 xcb_parts[2].iov_len = sizeof(xcb_out); 2288 xcb_parts[3].iov_base = 0; 2289 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2290 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 2291 return xcb_ret; 2292 } 2293 2294 2295 /***************************************************************************** 2296 ** 2297 ** uint8_t * xcb_randr_get_output_property_data 2298 ** 2299 ** @param const xcb_randr_get_output_property_reply_t *R 2300 ** @returns uint8_t * 2301 ** 2302 *****************************************************************************/ 2303 2304 uint8_t * 2305 xcb_randr_get_output_property_data (const xcb_randr_get_output_property_reply_t *R /**< */) 2306 { 2307 return (uint8_t *) (R + 1); 2308 } 2309 2310 2311 /***************************************************************************** 2312 ** 2313 ** int xcb_randr_get_output_property_data_length 2314 ** 2315 ** @param const xcb_randr_get_output_property_reply_t *R 2316 ** @returns int 2317 ** 2318 *****************************************************************************/ 2319 2320 int 2321 xcb_randr_get_output_property_data_length (const xcb_randr_get_output_property_reply_t *R /**< */) 2322 { 2323 return (R->num_items * (R->format / 8)); 2324 } 2325 2326 2327 /***************************************************************************** 2328 ** 2329 ** xcb_generic_iterator_t xcb_randr_get_output_property_data_end 2330 ** 2331 ** @param const xcb_randr_get_output_property_reply_t *R 2332 ** @returns xcb_generic_iterator_t 2333 ** 2334 *****************************************************************************/ 2335 2336 xcb_generic_iterator_t 2337 xcb_randr_get_output_property_data_end (const xcb_randr_get_output_property_reply_t *R /**< */) 2338 { 2339 xcb_generic_iterator_t i; 2340 i.data = ((uint8_t *) (R + 1)) + ((R->num_items * (R->format / 8))); 2341 i.rem = 0; 2342 i.index = (char *) i.data - (char *) R; 2343 return i; 2344 } 2345 2346 2347 /***************************************************************************** 2348 ** 2349 ** xcb_randr_get_output_property_reply_t * xcb_randr_get_output_property_reply 2350 ** 2351 ** @param xcb_connection_t *c 2352 ** @param xcb_randr_get_output_property_cookie_t cookie 2353 ** @param xcb_generic_error_t **e 2354 ** @returns xcb_randr_get_output_property_reply_t * 2355 ** 2356 *****************************************************************************/ 2357 2358 xcb_randr_get_output_property_reply_t * 2359 xcb_randr_get_output_property_reply (xcb_connection_t *c /**< */, 2360 xcb_randr_get_output_property_cookie_t cookie /**< */, 2361 xcb_generic_error_t **e /**< */) 2362 { 2363 return (xcb_randr_get_output_property_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 2364 } 2365 2366 2367 /***************************************************************************** 2368 ** 2369 ** xcb_randr_create_mode_cookie_t xcb_randr_create_mode 2370 ** 2371 ** @param xcb_connection_t *c 2372 ** @param xcb_window_t window 2373 ** @param xcb_randr_mode_info_t mode_info 2374 ** @param uint32_t name_len 2375 ** @param const char *name 2376 ** @returns xcb_randr_create_mode_cookie_t 2377 ** 2378 *****************************************************************************/ 2379 2380 xcb_randr_create_mode_cookie_t 2381 xcb_randr_create_mode (xcb_connection_t *c /**< */, 2382 xcb_window_t window /**< */, 2383 xcb_randr_mode_info_t mode_info /**< */, 2384 uint32_t name_len /**< */, 2385 const char *name /**< */) 2386 { 2387 static const xcb_protocol_request_t xcb_req = { 2388 /* count */ 4, 2389 /* ext */ &xcb_randr_id, 2390 /* opcode */ XCB_RANDR_CREATE_MODE, 2391 /* isvoid */ 0 2392 }; 2393 2394 struct iovec xcb_parts[6]; 2395 xcb_randr_create_mode_cookie_t xcb_ret; 2396 xcb_randr_create_mode_request_t xcb_out; 2397 2398 xcb_out.window = window; 2399 xcb_out.mode_info = mode_info; 2400 2401 xcb_parts[2].iov_base = (char *) &xcb_out; 2402 xcb_parts[2].iov_len = sizeof(xcb_out); 2403 xcb_parts[3].iov_base = 0; 2404 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2405 xcb_parts[4].iov_base = (char *) name; 2406 xcb_parts[4].iov_len = name_len * sizeof(char); 2407 xcb_parts[5].iov_base = 0; 2408 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 2409 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 2410 return xcb_ret; 2411 } 2412 2413 2414 /***************************************************************************** 2415 ** 2416 ** xcb_randr_create_mode_cookie_t xcb_randr_create_mode_unchecked 2417 ** 2418 ** @param xcb_connection_t *c 2419 ** @param xcb_window_t window 2420 ** @param xcb_randr_mode_info_t mode_info 2421 ** @param uint32_t name_len 2422 ** @param const char *name 2423 ** @returns xcb_randr_create_mode_cookie_t 2424 ** 2425 *****************************************************************************/ 2426 2427 xcb_randr_create_mode_cookie_t 2428 xcb_randr_create_mode_unchecked (xcb_connection_t *c /**< */, 2429 xcb_window_t window /**< */, 2430 xcb_randr_mode_info_t mode_info /**< */, 2431 uint32_t name_len /**< */, 2432 const char *name /**< */) 2433 { 2434 static const xcb_protocol_request_t xcb_req = { 2435 /* count */ 4, 2436 /* ext */ &xcb_randr_id, 2437 /* opcode */ XCB_RANDR_CREATE_MODE, 2438 /* isvoid */ 0 2439 }; 2440 2441 struct iovec xcb_parts[6]; 2442 xcb_randr_create_mode_cookie_t xcb_ret; 2443 xcb_randr_create_mode_request_t xcb_out; 2444 2445 xcb_out.window = window; 2446 xcb_out.mode_info = mode_info; 2447 2448 xcb_parts[2].iov_base = (char *) &xcb_out; 2449 xcb_parts[2].iov_len = sizeof(xcb_out); 2450 xcb_parts[3].iov_base = 0; 2451 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2452 xcb_parts[4].iov_base = (char *) name; 2453 xcb_parts[4].iov_len = name_len * sizeof(char); 2454 xcb_parts[5].iov_base = 0; 2455 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 2456 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 2457 return xcb_ret; 2458 } 2459 2460 2461 /***************************************************************************** 2462 ** 2463 ** xcb_randr_create_mode_reply_t * xcb_randr_create_mode_reply 2464 ** 2465 ** @param xcb_connection_t *c 2466 ** @param xcb_randr_create_mode_cookie_t cookie 2467 ** @param xcb_generic_error_t **e 2468 ** @returns xcb_randr_create_mode_reply_t * 2469 ** 2470 *****************************************************************************/ 2471 2472 xcb_randr_create_mode_reply_t * 2473 xcb_randr_create_mode_reply (xcb_connection_t *c /**< */, 2474 xcb_randr_create_mode_cookie_t cookie /**< */, 2475 xcb_generic_error_t **e /**< */) 2476 { 2477 return (xcb_randr_create_mode_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 2478 } 2479 2480 2481 /***************************************************************************** 2482 ** 2483 ** xcb_void_cookie_t xcb_randr_destroy_mode_checked 2484 ** 2485 ** @param xcb_connection_t *c 2486 ** @param xcb_randr_mode_t mode 2487 ** @returns xcb_void_cookie_t 2488 ** 2489 *****************************************************************************/ 2490 2491 xcb_void_cookie_t 2492 xcb_randr_destroy_mode_checked (xcb_connection_t *c /**< */, 2493 xcb_randr_mode_t mode /**< */) 2494 { 2495 static const xcb_protocol_request_t xcb_req = { 2496 /* count */ 2, 2497 /* ext */ &xcb_randr_id, 2498 /* opcode */ XCB_RANDR_DESTROY_MODE, 2499 /* isvoid */ 1 2500 }; 2501 2502 struct iovec xcb_parts[4]; 2503 xcb_void_cookie_t xcb_ret; 2504 xcb_randr_destroy_mode_request_t xcb_out; 2505 2506 xcb_out.mode = mode; 2507 2508 xcb_parts[2].iov_base = (char *) &xcb_out; 2509 xcb_parts[2].iov_len = sizeof(xcb_out); 2510 xcb_parts[3].iov_base = 0; 2511 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2512 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 2513 return xcb_ret; 2514 } 2515 2516 2517 /***************************************************************************** 2518 ** 2519 ** xcb_void_cookie_t xcb_randr_destroy_mode 2520 ** 2521 ** @param xcb_connection_t *c 2522 ** @param xcb_randr_mode_t mode 2523 ** @returns xcb_void_cookie_t 2524 ** 2525 *****************************************************************************/ 2526 2527 xcb_void_cookie_t 2528 xcb_randr_destroy_mode (xcb_connection_t *c /**< */, 2529 xcb_randr_mode_t mode /**< */) 2530 { 2531 static const xcb_protocol_request_t xcb_req = { 2532 /* count */ 2, 2533 /* ext */ &xcb_randr_id, 2534 /* opcode */ XCB_RANDR_DESTROY_MODE, 2535 /* isvoid */ 1 2536 }; 2537 2538 struct iovec xcb_parts[4]; 2539 xcb_void_cookie_t xcb_ret; 2540 xcb_randr_destroy_mode_request_t xcb_out; 2541 2542 xcb_out.mode = mode; 2543 2544 xcb_parts[2].iov_base = (char *) &xcb_out; 2545 xcb_parts[2].iov_len = sizeof(xcb_out); 2546 xcb_parts[3].iov_base = 0; 2547 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2548 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 2549 return xcb_ret; 2550 } 2551 2552 2553 /***************************************************************************** 2554 ** 2555 ** xcb_void_cookie_t xcb_randr_add_output_mode_checked 2556 ** 2557 ** @param xcb_connection_t *c 2558 ** @param xcb_randr_output_t output 2559 ** @param xcb_randr_mode_t mode 2560 ** @returns xcb_void_cookie_t 2561 ** 2562 *****************************************************************************/ 2563 2564 xcb_void_cookie_t 2565 xcb_randr_add_output_mode_checked (xcb_connection_t *c /**< */, 2566 xcb_randr_output_t output /**< */, 2567 xcb_randr_mode_t mode /**< */) 2568 { 2569 static const xcb_protocol_request_t xcb_req = { 2570 /* count */ 2, 2571 /* ext */ &xcb_randr_id, 2572 /* opcode */ XCB_RANDR_ADD_OUTPUT_MODE, 2573 /* isvoid */ 1 2574 }; 2575 2576 struct iovec xcb_parts[4]; 2577 xcb_void_cookie_t xcb_ret; 2578 xcb_randr_add_output_mode_request_t xcb_out; 2579 2580 xcb_out.output = output; 2581 xcb_out.mode = mode; 2582 2583 xcb_parts[2].iov_base = (char *) &xcb_out; 2584 xcb_parts[2].iov_len = sizeof(xcb_out); 2585 xcb_parts[3].iov_base = 0; 2586 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2587 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 2588 return xcb_ret; 2589 } 2590 2591 2592 /***************************************************************************** 2593 ** 2594 ** xcb_void_cookie_t xcb_randr_add_output_mode 2595 ** 2596 ** @param xcb_connection_t *c 2597 ** @param xcb_randr_output_t output 2598 ** @param xcb_randr_mode_t mode 2599 ** @returns xcb_void_cookie_t 2600 ** 2601 *****************************************************************************/ 2602 2603 xcb_void_cookie_t 2604 xcb_randr_add_output_mode (xcb_connection_t *c /**< */, 2605 xcb_randr_output_t output /**< */, 2606 xcb_randr_mode_t mode /**< */) 2607 { 2608 static const xcb_protocol_request_t xcb_req = { 2609 /* count */ 2, 2610 /* ext */ &xcb_randr_id, 2611 /* opcode */ XCB_RANDR_ADD_OUTPUT_MODE, 2612 /* isvoid */ 1 2613 }; 2614 2615 struct iovec xcb_parts[4]; 2616 xcb_void_cookie_t xcb_ret; 2617 xcb_randr_add_output_mode_request_t xcb_out; 2618 2619 xcb_out.output = output; 2620 xcb_out.mode = mode; 2621 2622 xcb_parts[2].iov_base = (char *) &xcb_out; 2623 xcb_parts[2].iov_len = sizeof(xcb_out); 2624 xcb_parts[3].iov_base = 0; 2625 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2626 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 2627 return xcb_ret; 2628 } 2629 2630 2631 /***************************************************************************** 2632 ** 2633 ** xcb_void_cookie_t xcb_randr_delete_output_mode_checked 2634 ** 2635 ** @param xcb_connection_t *c 2636 ** @param xcb_randr_output_t output 2637 ** @param xcb_randr_mode_t mode 2638 ** @returns xcb_void_cookie_t 2639 ** 2640 *****************************************************************************/ 2641 2642 xcb_void_cookie_t 2643 xcb_randr_delete_output_mode_checked (xcb_connection_t *c /**< */, 2644 xcb_randr_output_t output /**< */, 2645 xcb_randr_mode_t mode /**< */) 2646 { 2647 static const xcb_protocol_request_t xcb_req = { 2648 /* count */ 2, 2649 /* ext */ &xcb_randr_id, 2650 /* opcode */ XCB_RANDR_DELETE_OUTPUT_MODE, 2651 /* isvoid */ 1 2652 }; 2653 2654 struct iovec xcb_parts[4]; 2655 xcb_void_cookie_t xcb_ret; 2656 xcb_randr_delete_output_mode_request_t xcb_out; 2657 2658 xcb_out.output = output; 2659 xcb_out.mode = mode; 2660 2661 xcb_parts[2].iov_base = (char *) &xcb_out; 2662 xcb_parts[2].iov_len = sizeof(xcb_out); 2663 xcb_parts[3].iov_base = 0; 2664 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2665 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 2666 return xcb_ret; 2667 } 2668 2669 2670 /***************************************************************************** 2671 ** 2672 ** xcb_void_cookie_t xcb_randr_delete_output_mode 2673 ** 2674 ** @param xcb_connection_t *c 2675 ** @param xcb_randr_output_t output 2676 ** @param xcb_randr_mode_t mode 2677 ** @returns xcb_void_cookie_t 2678 ** 2679 *****************************************************************************/ 2680 2681 xcb_void_cookie_t 2682 xcb_randr_delete_output_mode (xcb_connection_t *c /**< */, 2683 xcb_randr_output_t output /**< */, 2684 xcb_randr_mode_t mode /**< */) 2685 { 2686 static const xcb_protocol_request_t xcb_req = { 2687 /* count */ 2, 2688 /* ext */ &xcb_randr_id, 2689 /* opcode */ XCB_RANDR_DELETE_OUTPUT_MODE, 2690 /* isvoid */ 1 2691 }; 2692 2693 struct iovec xcb_parts[4]; 2694 xcb_void_cookie_t xcb_ret; 2695 xcb_randr_delete_output_mode_request_t xcb_out; 2696 2697 xcb_out.output = output; 2698 xcb_out.mode = mode; 2699 2700 xcb_parts[2].iov_base = (char *) &xcb_out; 2701 xcb_parts[2].iov_len = sizeof(xcb_out); 2702 xcb_parts[3].iov_base = 0; 2703 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2704 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 2705 return xcb_ret; 2706 } 2707 2708 2709 /***************************************************************************** 2710 ** 2711 ** xcb_randr_get_crtc_info_cookie_t xcb_randr_get_crtc_info 2712 ** 2713 ** @param xcb_connection_t *c 2714 ** @param xcb_randr_crtc_t crtc 2715 ** @param xcb_timestamp_t config_timestamp 2716 ** @returns xcb_randr_get_crtc_info_cookie_t 2717 ** 2718 *****************************************************************************/ 2719 2720 xcb_randr_get_crtc_info_cookie_t 2721 xcb_randr_get_crtc_info (xcb_connection_t *c /**< */, 2722 xcb_randr_crtc_t crtc /**< */, 2723 xcb_timestamp_t config_timestamp /**< */) 2724 { 2725 static const xcb_protocol_request_t xcb_req = { 2726 /* count */ 2, 2727 /* ext */ &xcb_randr_id, 2728 /* opcode */ XCB_RANDR_GET_CRTC_INFO, 2729 /* isvoid */ 0 2730 }; 2731 2732 struct iovec xcb_parts[4]; 2733 xcb_randr_get_crtc_info_cookie_t xcb_ret; 2734 xcb_randr_get_crtc_info_request_t xcb_out; 2735 2736 xcb_out.crtc = crtc; 2737 xcb_out.config_timestamp = config_timestamp; 2738 2739 xcb_parts[2].iov_base = (char *) &xcb_out; 2740 xcb_parts[2].iov_len = sizeof(xcb_out); 2741 xcb_parts[3].iov_base = 0; 2742 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2743 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 2744 return xcb_ret; 2745 } 2746 2747 2748 /***************************************************************************** 2749 ** 2750 ** xcb_randr_get_crtc_info_cookie_t xcb_randr_get_crtc_info_unchecked 2751 ** 2752 ** @param xcb_connection_t *c 2753 ** @param xcb_randr_crtc_t crtc 2754 ** @param xcb_timestamp_t config_timestamp 2755 ** @returns xcb_randr_get_crtc_info_cookie_t 2756 ** 2757 *****************************************************************************/ 2758 2759 xcb_randr_get_crtc_info_cookie_t 2760 xcb_randr_get_crtc_info_unchecked (xcb_connection_t *c /**< */, 2761 xcb_randr_crtc_t crtc /**< */, 2762 xcb_timestamp_t config_timestamp /**< */) 2763 { 2764 static const xcb_protocol_request_t xcb_req = { 2765 /* count */ 2, 2766 /* ext */ &xcb_randr_id, 2767 /* opcode */ XCB_RANDR_GET_CRTC_INFO, 2768 /* isvoid */ 0 2769 }; 2770 2771 struct iovec xcb_parts[4]; 2772 xcb_randr_get_crtc_info_cookie_t xcb_ret; 2773 xcb_randr_get_crtc_info_request_t xcb_out; 2774 2775 xcb_out.crtc = crtc; 2776 xcb_out.config_timestamp = config_timestamp; 2777 2778 xcb_parts[2].iov_base = (char *) &xcb_out; 2779 xcb_parts[2].iov_len = sizeof(xcb_out); 2780 xcb_parts[3].iov_base = 0; 2781 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2782 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 2783 return xcb_ret; 2784 } 2785 2786 2787 /***************************************************************************** 2788 ** 2789 ** xcb_randr_output_t * xcb_randr_get_crtc_info_outputs 2790 ** 2791 ** @param const xcb_randr_get_crtc_info_reply_t *R 2792 ** @returns xcb_randr_output_t * 2793 ** 2794 *****************************************************************************/ 2795 2796 xcb_randr_output_t * 2797 xcb_randr_get_crtc_info_outputs (const xcb_randr_get_crtc_info_reply_t *R /**< */) 2798 { 2799 return (xcb_randr_output_t *) (R + 1); 2800 } 2801 2802 2803 /***************************************************************************** 2804 ** 2805 ** int xcb_randr_get_crtc_info_outputs_length 2806 ** 2807 ** @param const xcb_randr_get_crtc_info_reply_t *R 2808 ** @returns int 2809 ** 2810 *****************************************************************************/ 2811 2812 int 2813 xcb_randr_get_crtc_info_outputs_length (const xcb_randr_get_crtc_info_reply_t *R /**< */) 2814 { 2815 return R->num_outputs; 2816 } 2817 2818 2819 /***************************************************************************** 2820 ** 2821 ** xcb_generic_iterator_t xcb_randr_get_crtc_info_outputs_end 2822 ** 2823 ** @param const xcb_randr_get_crtc_info_reply_t *R 2824 ** @returns xcb_generic_iterator_t 2825 ** 2826 *****************************************************************************/ 2827 2828 xcb_generic_iterator_t 2829 xcb_randr_get_crtc_info_outputs_end (const xcb_randr_get_crtc_info_reply_t *R /**< */) 2830 { 2831 xcb_generic_iterator_t i; 2832 i.data = ((xcb_randr_output_t *) (R + 1)) + (R->num_outputs); 2833 i.rem = 0; 2834 i.index = (char *) i.data - (char *) R; 2835 return i; 2836 } 2837 2838 2839 /***************************************************************************** 2840 ** 2841 ** xcb_randr_output_t * xcb_randr_get_crtc_info_possible 2842 ** 2843 ** @param const xcb_randr_get_crtc_info_reply_t *R 2844 ** @returns xcb_randr_output_t * 2845 ** 2846 *****************************************************************************/ 2847 2848 xcb_randr_output_t * 2849 xcb_randr_get_crtc_info_possible (const xcb_randr_get_crtc_info_reply_t *R /**< */) 2850 { 2851 xcb_generic_iterator_t prev = xcb_randr_get_crtc_info_outputs_end(R); 2852 return (xcb_randr_output_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_randr_output_t, prev.index) + 0); 2853 } 2854 2855 2856 /***************************************************************************** 2857 ** 2858 ** int xcb_randr_get_crtc_info_possible_length 2859 ** 2860 ** @param const xcb_randr_get_crtc_info_reply_t *R 2861 ** @returns int 2862 ** 2863 *****************************************************************************/ 2864 2865 int 2866 xcb_randr_get_crtc_info_possible_length (const xcb_randr_get_crtc_info_reply_t *R /**< */) 2867 { 2868 return R->num_possible_outputs; 2869 } 2870 2871 2872 /***************************************************************************** 2873 ** 2874 ** xcb_generic_iterator_t xcb_randr_get_crtc_info_possible_end 2875 ** 2876 ** @param const xcb_randr_get_crtc_info_reply_t *R 2877 ** @returns xcb_generic_iterator_t 2878 ** 2879 *****************************************************************************/ 2880 2881 xcb_generic_iterator_t 2882 xcb_randr_get_crtc_info_possible_end (const xcb_randr_get_crtc_info_reply_t *R /**< */) 2883 { 2884 xcb_generic_iterator_t i; 2885 xcb_generic_iterator_t child = xcb_randr_get_crtc_info_outputs_end(R); 2886 i.data = ((xcb_randr_output_t *) child.data) + (R->num_possible_outputs); 2887 i.rem = 0; 2888 i.index = (char *) i.data - (char *) R; 2889 return i; 2890 } 2891 2892 2893 /***************************************************************************** 2894 ** 2895 ** xcb_randr_get_crtc_info_reply_t * xcb_randr_get_crtc_info_reply 2896 ** 2897 ** @param xcb_connection_t *c 2898 ** @param xcb_randr_get_crtc_info_cookie_t cookie 2899 ** @param xcb_generic_error_t **e 2900 ** @returns xcb_randr_get_crtc_info_reply_t * 2901 ** 2902 *****************************************************************************/ 2903 2904 xcb_randr_get_crtc_info_reply_t * 2905 xcb_randr_get_crtc_info_reply (xcb_connection_t *c /**< */, 2906 xcb_randr_get_crtc_info_cookie_t cookie /**< */, 2907 xcb_generic_error_t **e /**< */) 2908 { 2909 return (xcb_randr_get_crtc_info_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 2910 } 2911 2912 2913 /***************************************************************************** 2914 ** 2915 ** xcb_randr_set_crtc_config_cookie_t xcb_randr_set_crtc_config 2916 ** 2917 ** @param xcb_connection_t *c 2918 ** @param xcb_randr_crtc_t crtc 2919 ** @param xcb_timestamp_t timestamp 2920 ** @param xcb_timestamp_t config_timestamp 2921 ** @param int16_t x 2922 ** @param int16_t y 2923 ** @param xcb_randr_mode_t mode 2924 ** @param uint16_t rotation 2925 ** @param uint32_t outputs_len 2926 ** @param const xcb_randr_output_t *outputs 2927 ** @returns xcb_randr_set_crtc_config_cookie_t 2928 ** 2929 *****************************************************************************/ 2930 2931 xcb_randr_set_crtc_config_cookie_t 2932 xcb_randr_set_crtc_config (xcb_connection_t *c /**< */, 2933 xcb_randr_crtc_t crtc /**< */, 2934 xcb_timestamp_t timestamp /**< */, 2935 xcb_timestamp_t config_timestamp /**< */, 2936 int16_t x /**< */, 2937 int16_t y /**< */, 2938 xcb_randr_mode_t mode /**< */, 2939 uint16_t rotation /**< */, 2940 uint32_t outputs_len /**< */, 2941 const xcb_randr_output_t *outputs /**< */) 2942 { 2943 static const xcb_protocol_request_t xcb_req = { 2944 /* count */ 4, 2945 /* ext */ &xcb_randr_id, 2946 /* opcode */ XCB_RANDR_SET_CRTC_CONFIG, 2947 /* isvoid */ 0 2948 }; 2949 2950 struct iovec xcb_parts[6]; 2951 xcb_randr_set_crtc_config_cookie_t xcb_ret; 2952 xcb_randr_set_crtc_config_request_t xcb_out; 2953 2954 xcb_out.crtc = crtc; 2955 xcb_out.timestamp = timestamp; 2956 xcb_out.config_timestamp = config_timestamp; 2957 xcb_out.x = x; 2958 xcb_out.y = y; 2959 xcb_out.mode = mode; 2960 xcb_out.rotation = rotation; 2961 memset(xcb_out.pad0, 0, 2); 2962 2963 xcb_parts[2].iov_base = (char *) &xcb_out; 2964 xcb_parts[2].iov_len = sizeof(xcb_out); 2965 xcb_parts[3].iov_base = 0; 2966 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2967 xcb_parts[4].iov_base = (char *) outputs; 2968 xcb_parts[4].iov_len = outputs_len * sizeof(xcb_timestamp_t); 2969 xcb_parts[5].iov_base = 0; 2970 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 2971 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 2972 return xcb_ret; 2973 } 2974 2975 2976 /***************************************************************************** 2977 ** 2978 ** xcb_randr_set_crtc_config_cookie_t xcb_randr_set_crtc_config_unchecked 2979 ** 2980 ** @param xcb_connection_t *c 2981 ** @param xcb_randr_crtc_t crtc 2982 ** @param xcb_timestamp_t timestamp 2983 ** @param xcb_timestamp_t config_timestamp 2984 ** @param int16_t x 2985 ** @param int16_t y 2986 ** @param xcb_randr_mode_t mode 2987 ** @param uint16_t rotation 2988 ** @param uint32_t outputs_len 2989 ** @param const xcb_randr_output_t *outputs 2990 ** @returns xcb_randr_set_crtc_config_cookie_t 2991 ** 2992 *****************************************************************************/ 2993 2994 xcb_randr_set_crtc_config_cookie_t 2995 xcb_randr_set_crtc_config_unchecked (xcb_connection_t *c /**< */, 2996 xcb_randr_crtc_t crtc /**< */, 2997 xcb_timestamp_t timestamp /**< */, 2998 xcb_timestamp_t config_timestamp /**< */, 2999 int16_t x /**< */, 3000 int16_t y /**< */, 3001 xcb_randr_mode_t mode /**< */, 3002 uint16_t rotation /**< */, 3003 uint32_t outputs_len /**< */, 3004 const xcb_randr_output_t *outputs /**< */) 3005 { 3006 static const xcb_protocol_request_t xcb_req = { 3007 /* count */ 4, 3008 /* ext */ &xcb_randr_id, 3009 /* opcode */ XCB_RANDR_SET_CRTC_CONFIG, 3010 /* isvoid */ 0 3011 }; 3012 3013 struct iovec xcb_parts[6]; 3014 xcb_randr_set_crtc_config_cookie_t xcb_ret; 3015 xcb_randr_set_crtc_config_request_t xcb_out; 3016 3017 xcb_out.crtc = crtc; 3018 xcb_out.timestamp = timestamp; 3019 xcb_out.config_timestamp = config_timestamp; 3020 xcb_out.x = x; 3021 xcb_out.y = y; 3022 xcb_out.mode = mode; 3023 xcb_out.rotation = rotation; 3024 memset(xcb_out.pad0, 0, 2); 3025 3026 xcb_parts[2].iov_base = (char *) &xcb_out; 3027 xcb_parts[2].iov_len = sizeof(xcb_out); 3028 xcb_parts[3].iov_base = 0; 3029 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 3030 xcb_parts[4].iov_base = (char *) outputs; 3031 xcb_parts[4].iov_len = outputs_len * sizeof(xcb_timestamp_t); 3032 xcb_parts[5].iov_base = 0; 3033 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 3034 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 3035 return xcb_ret; 3036 } 3037 3038 3039 /***************************************************************************** 3040 ** 3041 ** xcb_randr_set_crtc_config_reply_t * xcb_randr_set_crtc_config_reply 3042 ** 3043 ** @param xcb_connection_t *c 3044 ** @param xcb_randr_set_crtc_config_cookie_t cookie 3045 ** @param xcb_generic_error_t **e 3046 ** @returns xcb_randr_set_crtc_config_reply_t * 3047 ** 3048 *****************************************************************************/ 3049 3050 xcb_randr_set_crtc_config_reply_t * 3051 xcb_randr_set_crtc_config_reply (xcb_connection_t *c /**< */, 3052 xcb_randr_set_crtc_config_cookie_t cookie /**< */, 3053 xcb_generic_error_t **e /**< */) 3054 { 3055 return (xcb_randr_set_crtc_config_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 3056 } 3057 3058 3059 /***************************************************************************** 3060 ** 3061 ** xcb_randr_get_crtc_gamma_size_cookie_t xcb_randr_get_crtc_gamma_size 3062 ** 3063 ** @param xcb_connection_t *c 3064 ** @param xcb_randr_crtc_t crtc 3065 ** @returns xcb_randr_get_crtc_gamma_size_cookie_t 3066 ** 3067 *****************************************************************************/ 3068 3069 xcb_randr_get_crtc_gamma_size_cookie_t 3070 xcb_randr_get_crtc_gamma_size (xcb_connection_t *c /**< */, 3071 xcb_randr_crtc_t crtc /**< */) 3072 { 3073 static const xcb_protocol_request_t xcb_req = { 3074 /* count */ 2, 3075 /* ext */ &xcb_randr_id, 3076 /* opcode */ XCB_RANDR_GET_CRTC_GAMMA_SIZE, 3077 /* isvoid */ 0 3078 }; 3079 3080 struct iovec xcb_parts[4]; 3081 xcb_randr_get_crtc_gamma_size_cookie_t xcb_ret; 3082 xcb_randr_get_crtc_gamma_size_request_t xcb_out; 3083 3084 xcb_out.crtc = crtc; 3085 3086 xcb_parts[2].iov_base = (char *) &xcb_out; 3087 xcb_parts[2].iov_len = sizeof(xcb_out); 3088 xcb_parts[3].iov_base = 0; 3089 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 3090 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 3091 return xcb_ret; 3092 } 3093 3094 3095 /***************************************************************************** 3096 ** 3097 ** xcb_randr_get_crtc_gamma_size_cookie_t xcb_randr_get_crtc_gamma_size_unchecked 3098 ** 3099 ** @param xcb_connection_t *c 3100 ** @param xcb_randr_crtc_t crtc 3101 ** @returns xcb_randr_get_crtc_gamma_size_cookie_t 3102 ** 3103 *****************************************************************************/ 3104 3105 xcb_randr_get_crtc_gamma_size_cookie_t 3106 xcb_randr_get_crtc_gamma_size_unchecked (xcb_connection_t *c /**< */, 3107 xcb_randr_crtc_t crtc /**< */) 3108 { 3109 static const xcb_protocol_request_t xcb_req = { 3110 /* count */ 2, 3111 /* ext */ &xcb_randr_id, 3112 /* opcode */ XCB_RANDR_GET_CRTC_GAMMA_SIZE, 3113 /* isvoid */ 0 3114 }; 3115 3116 struct iovec xcb_parts[4]; 3117 xcb_randr_get_crtc_gamma_size_cookie_t xcb_ret; 3118 xcb_randr_get_crtc_gamma_size_request_t xcb_out; 3119 3120 xcb_out.crtc = crtc; 3121 3122 xcb_parts[2].iov_base = (char *) &xcb_out; 3123 xcb_parts[2].iov_len = sizeof(xcb_out); 3124 xcb_parts[3].iov_base = 0; 3125 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 3126 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 3127 return xcb_ret; 3128 } 3129 3130 3131 /***************************************************************************** 3132 ** 3133 ** xcb_randr_get_crtc_gamma_size_reply_t * xcb_randr_get_crtc_gamma_size_reply 3134 ** 3135 ** @param xcb_connection_t *c 3136 ** @param xcb_randr_get_crtc_gamma_size_cookie_t cookie 3137 ** @param xcb_generic_error_t **e 3138 ** @returns xcb_randr_get_crtc_gamma_size_reply_t * 3139 ** 3140 *****************************************************************************/ 3141 3142 xcb_randr_get_crtc_gamma_size_reply_t * 3143 xcb_randr_get_crtc_gamma_size_reply (xcb_connection_t *c /**< */, 3144 xcb_randr_get_crtc_gamma_size_cookie_t cookie /**< */, 3145 xcb_generic_error_t **e /**< */) 3146 { 3147 return (xcb_randr_get_crtc_gamma_size_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 3148 } 3149 3150 3151 /***************************************************************************** 3152 ** 3153 ** xcb_randr_get_crtc_gamma_cookie_t xcb_randr_get_crtc_gamma 3154 ** 3155 ** @param xcb_connection_t *c 3156 ** @param xcb_randr_crtc_t crtc 3157 ** @returns xcb_randr_get_crtc_gamma_cookie_t 3158 ** 3159 *****************************************************************************/ 3160 3161 xcb_randr_get_crtc_gamma_cookie_t 3162 xcb_randr_get_crtc_gamma (xcb_connection_t *c /**< */, 3163 xcb_randr_crtc_t crtc /**< */) 3164 { 3165 static const xcb_protocol_request_t xcb_req = { 3166 /* count */ 2, 3167 /* ext */ &xcb_randr_id, 3168 /* opcode */ XCB_RANDR_GET_CRTC_GAMMA, 3169 /* isvoid */ 0 3170 }; 3171 3172 struct iovec xcb_parts[4]; 3173 xcb_randr_get_crtc_gamma_cookie_t xcb_ret; 3174 xcb_randr_get_crtc_gamma_request_t xcb_out; 3175 3176 xcb_out.crtc = crtc; 3177 3178 xcb_parts[2].iov_base = (char *) &xcb_out; 3179 xcb_parts[2].iov_len = sizeof(xcb_out); 3180 xcb_parts[3].iov_base = 0; 3181 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 3182 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 3183 return xcb_ret; 3184 } 3185 3186 3187 /***************************************************************************** 3188 ** 3189 ** xcb_randr_get_crtc_gamma_cookie_t xcb_randr_get_crtc_gamma_unchecked 3190 ** 3191 ** @param xcb_connection_t *c 3192 ** @param xcb_randr_crtc_t crtc 3193 ** @returns xcb_randr_get_crtc_gamma_cookie_t 3194 ** 3195 *****************************************************************************/ 3196 3197 xcb_randr_get_crtc_gamma_cookie_t 3198 xcb_randr_get_crtc_gamma_unchecked (xcb_connection_t *c /**< */, 3199 xcb_randr_crtc_t crtc /**< */) 3200 { 3201 static const xcb_protocol_request_t xcb_req = { 3202 /* count */ 2, 3203 /* ext */ &xcb_randr_id, 3204 /* opcode */ XCB_RANDR_GET_CRTC_GAMMA, 3205 /* isvoid */ 0 3206 }; 3207 3208 struct iovec xcb_parts[4]; 3209 xcb_randr_get_crtc_gamma_cookie_t xcb_ret; 3210 xcb_randr_get_crtc_gamma_request_t xcb_out; 3211 3212 xcb_out.crtc = crtc; 3213 3214 xcb_parts[2].iov_base = (char *) &xcb_out; 3215 xcb_parts[2].iov_len = sizeof(xcb_out); 3216 xcb_parts[3].iov_base = 0; 3217 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 3218 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 3219 return xcb_ret; 3220 } 3221 3222 3223 /***************************************************************************** 3224 ** 3225 ** uint16_t * xcb_randr_get_crtc_gamma_red 3226 ** 3227 ** @param const xcb_randr_get_crtc_gamma_reply_t *R 3228 ** @returns uint16_t * 3229 ** 3230 *****************************************************************************/ 3231 3232 uint16_t * 3233 xcb_randr_get_crtc_gamma_red (const xcb_randr_get_crtc_gamma_reply_t *R /**< */) 3234 { 3235 return (uint16_t *) (R + 1); 3236 } 3237 3238 3239 /***************************************************************************** 3240 ** 3241 ** int xcb_randr_get_crtc_gamma_red_length 3242 ** 3243 ** @param const xcb_randr_get_crtc_gamma_reply_t *R 3244 ** @returns int 3245 ** 3246 *****************************************************************************/ 3247 3248 int 3249 xcb_randr_get_crtc_gamma_red_length (const xcb_randr_get_crtc_gamma_reply_t *R /**< */) 3250 { 3251 return R->size; 3252 } 3253 3254 3255 /***************************************************************************** 3256 ** 3257 ** xcb_generic_iterator_t xcb_randr_get_crtc_gamma_red_end 3258 ** 3259 ** @param const xcb_randr_get_crtc_gamma_reply_t *R 3260 ** @returns xcb_generic_iterator_t 3261 ** 3262 *****************************************************************************/ 3263 3264 xcb_generic_iterator_t 3265 xcb_randr_get_crtc_gamma_red_end (const xcb_randr_get_crtc_gamma_reply_t *R /**< */) 3266 { 3267 xcb_generic_iterator_t i; 3268 i.data = ((uint16_t *) (R + 1)) + (R->size); 3269 i.rem = 0; 3270 i.index = (char *) i.data - (char *) R; 3271 return i; 3272 } 3273 3274 3275 /***************************************************************************** 3276 ** 3277 ** uint16_t * xcb_randr_get_crtc_gamma_green 3278 ** 3279 ** @param const xcb_randr_get_crtc_gamma_reply_t *R 3280 ** @returns uint16_t * 3281 ** 3282 *****************************************************************************/ 3283 3284 uint16_t * 3285 xcb_randr_get_crtc_gamma_green (const xcb_randr_get_crtc_gamma_reply_t *R /**< */) 3286 { 3287 xcb_generic_iterator_t prev = xcb_randr_get_crtc_gamma_red_end(R); 3288 return (uint16_t *) ((char *) prev.data + XCB_TYPE_PAD(uint16_t, prev.index) + 0); 3289 } 3290 3291 3292 /***************************************************************************** 3293 ** 3294 ** int xcb_randr_get_crtc_gamma_green_length 3295 ** 3296 ** @param const xcb_randr_get_crtc_gamma_reply_t *R 3297 ** @returns int 3298 ** 3299 *****************************************************************************/ 3300 3301 int 3302 xcb_randr_get_crtc_gamma_green_length (const xcb_randr_get_crtc_gamma_reply_t *R /**< */) 3303 { 3304 return R->size; 3305 } 3306 3307 3308 /***************************************************************************** 3309 ** 3310 ** xcb_generic_iterator_t xcb_randr_get_crtc_gamma_green_end 3311 ** 3312 ** @param const xcb_randr_get_crtc_gamma_reply_t *R 3313 ** @returns xcb_generic_iterator_t 3314 ** 3315 *****************************************************************************/ 3316 3317 xcb_generic_iterator_t 3318 xcb_randr_get_crtc_gamma_green_end (const xcb_randr_get_crtc_gamma_reply_t *R /**< */) 3319 { 3320 xcb_generic_iterator_t i; 3321 xcb_generic_iterator_t child = xcb_randr_get_crtc_gamma_red_end(R); 3322 i.data = ((uint16_t *) child.data) + (R->size); 3323 i.rem = 0; 3324 i.index = (char *) i.data - (char *) R; 3325 return i; 3326 } 3327 3328 3329 /***************************************************************************** 3330 ** 3331 ** uint16_t * xcb_randr_get_crtc_gamma_blue 3332 ** 3333 ** @param const xcb_randr_get_crtc_gamma_reply_t *R 3334 ** @returns uint16_t * 3335 ** 3336 *****************************************************************************/ 3337 3338 uint16_t * 3339 xcb_randr_get_crtc_gamma_blue (const xcb_randr_get_crtc_gamma_reply_t *R /**< */) 3340 { 3341 xcb_generic_iterator_t prev = xcb_randr_get_crtc_gamma_green_end(R); 3342 return (uint16_t *) ((char *) prev.data + XCB_TYPE_PAD(uint16_t, prev.index) + 0); 3343 } 3344 3345 3346 /***************************************************************************** 3347 ** 3348 ** int xcb_randr_get_crtc_gamma_blue_length 3349 ** 3350 ** @param const xcb_randr_get_crtc_gamma_reply_t *R 3351 ** @returns int 3352 ** 3353 *****************************************************************************/ 3354 3355 int 3356 xcb_randr_get_crtc_gamma_blue_length (const xcb_randr_get_crtc_gamma_reply_t *R /**< */) 3357 { 3358 return R->size; 3359 } 3360 3361 3362 /***************************************************************************** 3363 ** 3364 ** xcb_generic_iterator_t xcb_randr_get_crtc_gamma_blue_end 3365 ** 3366 ** @param const xcb_randr_get_crtc_gamma_reply_t *R 3367 ** @returns xcb_generic_iterator_t 3368 ** 3369 *****************************************************************************/ 3370 3371 xcb_generic_iterator_t 3372 xcb_randr_get_crtc_gamma_blue_end (const xcb_randr_get_crtc_gamma_reply_t *R /**< */) 3373 { 3374 xcb_generic_iterator_t i; 3375 xcb_generic_iterator_t child = xcb_randr_get_crtc_gamma_green_end(R); 3376 i.data = ((uint16_t *) child.data) + (R->size); 3377 i.rem = 0; 3378 i.index = (char *) i.data - (char *) R; 3379 return i; 3380 } 3381 3382 3383 /***************************************************************************** 3384 ** 3385 ** xcb_randr_get_crtc_gamma_reply_t * xcb_randr_get_crtc_gamma_reply 3386 ** 3387 ** @param xcb_connection_t *c 3388 ** @param xcb_randr_get_crtc_gamma_cookie_t cookie 3389 ** @param xcb_generic_error_t **e 3390 ** @returns xcb_randr_get_crtc_gamma_reply_t * 3391 ** 3392 *****************************************************************************/ 3393 3394 xcb_randr_get_crtc_gamma_reply_t * 3395 xcb_randr_get_crtc_gamma_reply (xcb_connection_t *c /**< */, 3396 xcb_randr_get_crtc_gamma_cookie_t cookie /**< */, 3397 xcb_generic_error_t **e /**< */) 3398 { 3399 return (xcb_randr_get_crtc_gamma_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 3400 } 3401 3402 3403 /***************************************************************************** 3404 ** 3405 ** xcb_void_cookie_t xcb_randr_set_crtc_gamma_checked 3406 ** 3407 ** @param xcb_connection_t *c 3408 ** @param xcb_randr_crtc_t crtc 3409 ** @param uint16_t size 3410 ** @param const uint16_t *red 3411 ** @param const uint16_t *green 3412 ** @param const uint16_t *blue 3413 ** @returns xcb_void_cookie_t 3414 ** 3415 *****************************************************************************/ 3416 3417 xcb_void_cookie_t 3418 xcb_randr_set_crtc_gamma_checked (xcb_connection_t *c /**< */, 3419 xcb_randr_crtc_t crtc /**< */, 3420 uint16_t size /**< */, 3421 const uint16_t *red /**< */, 3422 const uint16_t *green /**< */, 3423 const uint16_t *blue /**< */) 3424 { 3425 static const xcb_protocol_request_t xcb_req = { 3426 /* count */ 8, 3427 /* ext */ &xcb_randr_id, 3428 /* opcode */ XCB_RANDR_SET_CRTC_GAMMA, 3429 /* isvoid */ 1 3430 }; 3431 3432 struct iovec xcb_parts[10]; 3433 xcb_void_cookie_t xcb_ret; 3434 xcb_randr_set_crtc_gamma_request_t xcb_out; 3435 3436 xcb_out.crtc = crtc; 3437 xcb_out.size = size; 3438 memset(xcb_out.pad0, 0, 2); 3439 3440 xcb_parts[2].iov_base = (char *) &xcb_out; 3441 xcb_parts[2].iov_len = sizeof(xcb_out); 3442 xcb_parts[3].iov_base = 0; 3443 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 3444 xcb_parts[4].iov_base = (char *) red; 3445 xcb_parts[4].iov_len = size * sizeof(uint16_t); 3446 xcb_parts[5].iov_base = 0; 3447 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 3448 xcb_parts[6].iov_base = (char *) green; 3449 xcb_parts[6].iov_len = size * sizeof(uint16_t); 3450 xcb_parts[7].iov_base = 0; 3451 xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3; 3452 xcb_parts[8].iov_base = (char *) blue; 3453 xcb_parts[8].iov_len = size * sizeof(uint16_t); 3454 xcb_parts[9].iov_base = 0; 3455 xcb_parts[9].iov_len = -xcb_parts[8].iov_len & 3; 3456 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 3457 return xcb_ret; 3458 } 3459 3460 3461 /***************************************************************************** 3462 ** 3463 ** xcb_void_cookie_t xcb_randr_set_crtc_gamma 3464 ** 3465 ** @param xcb_connection_t *c 3466 ** @param xcb_randr_crtc_t crtc 3467 ** @param uint16_t size 3468 ** @param const uint16_t *red 3469 ** @param const uint16_t *green 3470 ** @param const uint16_t *blue 3471 ** @returns xcb_void_cookie_t 3472 ** 3473 *****************************************************************************/ 3474 3475 xcb_void_cookie_t 3476 xcb_randr_set_crtc_gamma (xcb_connection_t *c /**< */, 3477 xcb_randr_crtc_t crtc /**< */, 3478 uint16_t size /**< */, 3479 const uint16_t *red /**< */, 3480 const uint16_t *green /**< */, 3481 const uint16_t *blue /**< */) 3482 { 3483 static const xcb_protocol_request_t xcb_req = { 3484 /* count */ 8, 3485 /* ext */ &xcb_randr_id, 3486 /* opcode */ XCB_RANDR_SET_CRTC_GAMMA, 3487 /* isvoid */ 1 3488 }; 3489 3490 struct iovec xcb_parts[10]; 3491 xcb_void_cookie_t xcb_ret; 3492 xcb_randr_set_crtc_gamma_request_t xcb_out; 3493 3494 xcb_out.crtc = crtc; 3495 xcb_out.size = size; 3496 memset(xcb_out.pad0, 0, 2); 3497 3498 xcb_parts[2].iov_base = (char *) &xcb_out; 3499 xcb_parts[2].iov_len = sizeof(xcb_out); 3500 xcb_parts[3].iov_base = 0; 3501 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 3502 xcb_parts[4].iov_base = (char *) red; 3503 xcb_parts[4].iov_len = size * sizeof(uint16_t); 3504 xcb_parts[5].iov_base = 0; 3505 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 3506 xcb_parts[6].iov_base = (char *) green; 3507 xcb_parts[6].iov_len = size * sizeof(uint16_t); 3508 xcb_parts[7].iov_base = 0; 3509 xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3; 3510 xcb_parts[8].iov_base = (char *) blue; 3511 xcb_parts[8].iov_len = size * sizeof(uint16_t); 3512 xcb_parts[9].iov_base = 0; 3513 xcb_parts[9].iov_len = -xcb_parts[8].iov_len & 3; 3514 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 3515 return xcb_ret; 3516 } 3517 3518 3519 /***************************************************************************** 3520 ** 3521 ** xcb_randr_get_screen_resources_current_cookie_t xcb_randr_get_screen_resources_current 3522 ** 3523 ** @param xcb_connection_t *c 3524 ** @param xcb_window_t window 3525 ** @returns xcb_randr_get_screen_resources_current_cookie_t 3526 ** 3527 *****************************************************************************/ 3528 3529 xcb_randr_get_screen_resources_current_cookie_t 3530 xcb_randr_get_screen_resources_current (xcb_connection_t *c /**< */, 3531 xcb_window_t window /**< */) 3532 { 3533 static const xcb_protocol_request_t xcb_req = { 3534 /* count */ 2, 3535 /* ext */ &xcb_randr_id, 3536 /* opcode */ XCB_RANDR_GET_SCREEN_RESOURCES_CURRENT, 3537 /* isvoid */ 0 3538 }; 3539 3540 struct iovec xcb_parts[4]; 3541 xcb_randr_get_screen_resources_current_cookie_t xcb_ret; 3542 xcb_randr_get_screen_resources_current_request_t xcb_out; 3543 3544 xcb_out.window = window; 3545 3546 xcb_parts[2].iov_base = (char *) &xcb_out; 3547 xcb_parts[2].iov_len = sizeof(xcb_out); 3548 xcb_parts[3].iov_base = 0; 3549 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 3550 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 3551 return xcb_ret; 3552 } 3553 3554 3555 /***************************************************************************** 3556 ** 3557 ** xcb_randr_get_screen_resources_current_cookie_t xcb_randr_get_screen_resources_current_unchecked 3558 ** 3559 ** @param xcb_connection_t *c 3560 ** @param xcb_window_t window 3561 ** @returns xcb_randr_get_screen_resources_current_cookie_t 3562 ** 3563 *****************************************************************************/ 3564 3565 xcb_randr_get_screen_resources_current_cookie_t 3566 xcb_randr_get_screen_resources_current_unchecked (xcb_connection_t *c /**< */, 3567 xcb_window_t window /**< */) 3568 { 3569 static const xcb_protocol_request_t xcb_req = { 3570 /* count */ 2, 3571 /* ext */ &xcb_randr_id, 3572 /* opcode */ XCB_RANDR_GET_SCREEN_RESOURCES_CURRENT, 3573 /* isvoid */ 0 3574 }; 3575 3576 struct iovec xcb_parts[4]; 3577 xcb_randr_get_screen_resources_current_cookie_t xcb_ret; 3578 xcb_randr_get_screen_resources_current_request_t xcb_out; 3579 3580 xcb_out.window = window; 3581 3582 xcb_parts[2].iov_base = (char *) &xcb_out; 3583 xcb_parts[2].iov_len = sizeof(xcb_out); 3584 xcb_parts[3].iov_base = 0; 3585 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 3586 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 3587 return xcb_ret; 3588 } 3589 3590 3591 /***************************************************************************** 3592 ** 3593 ** xcb_randr_crtc_t * xcb_randr_get_screen_resources_current_crtcs 3594 ** 3595 ** @param const xcb_randr_get_screen_resources_current_reply_t *R 3596 ** @returns xcb_randr_crtc_t * 3597 ** 3598 *****************************************************************************/ 3599 3600 xcb_randr_crtc_t * 3601 xcb_randr_get_screen_resources_current_crtcs (const xcb_randr_get_screen_resources_current_reply_t *R /**< */) 3602 { 3603 return (xcb_randr_crtc_t *) (R + 1); 3604 } 3605 3606 3607 /***************************************************************************** 3608 ** 3609 ** int xcb_randr_get_screen_resources_current_crtcs_length 3610 ** 3611 ** @param const xcb_randr_get_screen_resources_current_reply_t *R 3612 ** @returns int 3613 ** 3614 *****************************************************************************/ 3615 3616 int 3617 xcb_randr_get_screen_resources_current_crtcs_length (const xcb_randr_get_screen_resources_current_reply_t *R /**< */) 3618 { 3619 return R->num_crtcs; 3620 } 3621 3622 3623 /***************************************************************************** 3624 ** 3625 ** xcb_generic_iterator_t xcb_randr_get_screen_resources_current_crtcs_end 3626 ** 3627 ** @param const xcb_randr_get_screen_resources_current_reply_t *R 3628 ** @returns xcb_generic_iterator_t 3629 ** 3630 *****************************************************************************/ 3631 3632 xcb_generic_iterator_t 3633 xcb_randr_get_screen_resources_current_crtcs_end (const xcb_randr_get_screen_resources_current_reply_t *R /**< */) 3634 { 3635 xcb_generic_iterator_t i; 3636 i.data = ((xcb_randr_crtc_t *) (R + 1)) + (R->num_crtcs); 3637 i.rem = 0; 3638 i.index = (char *) i.data - (char *) R; 3639 return i; 3640 } 3641 3642 3643 /***************************************************************************** 3644 ** 3645 ** xcb_randr_output_t * xcb_randr_get_screen_resources_current_outputs 3646 ** 3647 ** @param const xcb_randr_get_screen_resources_current_reply_t *R 3648 ** @returns xcb_randr_output_t * 3649 ** 3650 *****************************************************************************/ 3651 3652 xcb_randr_output_t * 3653 xcb_randr_get_screen_resources_current_outputs (const xcb_randr_get_screen_resources_current_reply_t *R /**< */) 3654 { 3655 xcb_generic_iterator_t prev = xcb_randr_get_screen_resources_current_crtcs_end(R); 3656 return (xcb_randr_output_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_randr_output_t, prev.index) + 0); 3657 } 3658 3659 3660 /***************************************************************************** 3661 ** 3662 ** int xcb_randr_get_screen_resources_current_outputs_length 3663 ** 3664 ** @param const xcb_randr_get_screen_resources_current_reply_t *R 3665 ** @returns int 3666 ** 3667 *****************************************************************************/ 3668 3669 int 3670 xcb_randr_get_screen_resources_current_outputs_length (const xcb_randr_get_screen_resources_current_reply_t *R /**< */) 3671 { 3672 return R->num_outputs; 3673 } 3674 3675 3676 /***************************************************************************** 3677 ** 3678 ** xcb_generic_iterator_t xcb_randr_get_screen_resources_current_outputs_end 3679 ** 3680 ** @param const xcb_randr_get_screen_resources_current_reply_t *R 3681 ** @returns xcb_generic_iterator_t 3682 ** 3683 *****************************************************************************/ 3684 3685 xcb_generic_iterator_t 3686 xcb_randr_get_screen_resources_current_outputs_end (const xcb_randr_get_screen_resources_current_reply_t *R /**< */) 3687 { 3688 xcb_generic_iterator_t i; 3689 xcb_generic_iterator_t child = xcb_randr_get_screen_resources_current_crtcs_end(R); 3690 i.data = ((xcb_randr_output_t *) child.data) + (R->num_outputs); 3691 i.rem = 0; 3692 i.index = (char *) i.data - (char *) R; 3693 return i; 3694 } 3695 3696 3697 /***************************************************************************** 3698 ** 3699 ** xcb_randr_mode_info_t * xcb_randr_get_screen_resources_current_modes 3700 ** 3701 ** @param const xcb_randr_get_screen_resources_current_reply_t *R 3702 ** @returns xcb_randr_mode_info_t * 3703 ** 3704 *****************************************************************************/ 3705 3706 xcb_randr_mode_info_t * 3707 xcb_randr_get_screen_resources_current_modes (const xcb_randr_get_screen_resources_current_reply_t *R /**< */) 3708 { 3709 xcb_generic_iterator_t prev = xcb_randr_get_screen_resources_current_outputs_end(R); 3710 return (xcb_randr_mode_info_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_randr_mode_info_t, prev.index) + 0); 3711 } 3712 3713 3714 /***************************************************************************** 3715 ** 3716 ** int xcb_randr_get_screen_resources_current_modes_length 3717 ** 3718 ** @param const xcb_randr_get_screen_resources_current_reply_t *R 3719 ** @returns int 3720 ** 3721 *****************************************************************************/ 3722 3723 int 3724 xcb_randr_get_screen_resources_current_modes_length (const xcb_randr_get_screen_resources_current_reply_t *R /**< */) 3725 { 3726 return R->num_modes; 3727 } 3728 3729 3730 /***************************************************************************** 3731 ** 3732 ** xcb_randr_mode_info_iterator_t xcb_randr_get_screen_resources_current_modes_iterator 3733 ** 3734 ** @param const xcb_randr_get_screen_resources_current_reply_t *R 3735 ** @returns xcb_randr_mode_info_iterator_t 3736 ** 3737 *****************************************************************************/ 3738 3739 xcb_randr_mode_info_iterator_t 3740 xcb_randr_get_screen_resources_current_modes_iterator (const xcb_randr_get_screen_resources_current_reply_t *R /**< */) 3741 { 3742 xcb_randr_mode_info_iterator_t i; 3743 xcb_generic_iterator_t prev = xcb_randr_get_screen_resources_current_outputs_end(R); 3744 i.data = (xcb_randr_mode_info_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_randr_mode_info_t, prev.index)); 3745 i.rem = R->num_modes; 3746 i.index = (char *) i.data - (char *) R; 3747 return i; 3748 } 3749 3750 3751 /***************************************************************************** 3752 ** 3753 ** uint8_t * xcb_randr_get_screen_resources_current_names 3754 ** 3755 ** @param const xcb_randr_get_screen_resources_current_reply_t *R 3756 ** @returns uint8_t * 3757 ** 3758 *****************************************************************************/ 3759 3760 uint8_t * 3761 xcb_randr_get_screen_resources_current_names (const xcb_randr_get_screen_resources_current_reply_t *R /**< */) 3762 { 3763 xcb_generic_iterator_t prev = xcb_randr_mode_info_end(xcb_randr_get_screen_resources_current_modes_iterator(R)); 3764 return (uint8_t *) ((char *) prev.data + XCB_TYPE_PAD(uint8_t, prev.index) + 0); 3765 } 3766 3767 3768 /***************************************************************************** 3769 ** 3770 ** int xcb_randr_get_screen_resources_current_names_length 3771 ** 3772 ** @param const xcb_randr_get_screen_resources_current_reply_t *R 3773 ** @returns int 3774 ** 3775 *****************************************************************************/ 3776 3777 int 3778 xcb_randr_get_screen_resources_current_names_length (const xcb_randr_get_screen_resources_current_reply_t *R /**< */) 3779 { 3780 return R->names_len; 3781 } 3782 3783 3784 /***************************************************************************** 3785 ** 3786 ** xcb_generic_iterator_t xcb_randr_get_screen_resources_current_names_end 3787 ** 3788 ** @param const xcb_randr_get_screen_resources_current_reply_t *R 3789 ** @returns xcb_generic_iterator_t 3790 ** 3791 *****************************************************************************/ 3792 3793 xcb_generic_iterator_t 3794 xcb_randr_get_screen_resources_current_names_end (const xcb_randr_get_screen_resources_current_reply_t *R /**< */) 3795 { 3796 xcb_generic_iterator_t i; 3797 xcb_generic_iterator_t child = xcb_randr_mode_info_end(xcb_randr_get_screen_resources_current_modes_iterator(R)); 3798 i.data = ((uint8_t *) child.data) + (R->names_len); 3799 i.rem = 0; 3800 i.index = (char *) i.data - (char *) R; 3801 return i; 3802 } 3803 3804 3805 /***************************************************************************** 3806 ** 3807 ** xcb_randr_get_screen_resources_current_reply_t * xcb_randr_get_screen_resources_current_reply 3808 ** 3809 ** @param xcb_connection_t *c 3810 ** @param xcb_randr_get_screen_resources_current_cookie_t cookie 3811 ** @param xcb_generic_error_t **e 3812 ** @returns xcb_randr_get_screen_resources_current_reply_t * 3813 ** 3814 *****************************************************************************/ 3815 3816 xcb_randr_get_screen_resources_current_reply_t * 3817 xcb_randr_get_screen_resources_current_reply (xcb_connection_t *c /**< */, 3818 xcb_randr_get_screen_resources_current_cookie_t cookie /**< */, 3819 xcb_generic_error_t **e /**< */) 3820 { 3821 return (xcb_randr_get_screen_resources_current_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 3822 } 3823 3824 3825 /***************************************************************************** 3826 ** 3827 ** xcb_void_cookie_t xcb_randr_set_crtc_transform_checked 3828 ** 3829 ** @param xcb_connection_t *c 3830 ** @param xcb_randr_crtc_t crtc 3831 ** @param xcb_render_transform_t transform 3832 ** @param uint16_t filter_len 3833 ** @param const char *filter_name 3834 ** @param uint32_t filter_params_len 3835 ** @param const xcb_render_fixed_t *filter_params 3836 ** @returns xcb_void_cookie_t 3837 ** 3838 *****************************************************************************/ 3839 3840 xcb_void_cookie_t 3841 xcb_randr_set_crtc_transform_checked (xcb_connection_t *c /**< */, 3842 xcb_randr_crtc_t crtc /**< */, 3843 xcb_render_transform_t transform /**< */, 3844 uint16_t filter_len /**< */, 3845 const char *filter_name /**< */, 3846 uint32_t filter_params_len /**< */, 3847 const xcb_render_fixed_t *filter_params /**< */) 3848 { 3849 static const xcb_protocol_request_t xcb_req = { 3850 /* count */ 6, 3851 /* ext */ &xcb_randr_id, 3852 /* opcode */ XCB_RANDR_SET_CRTC_TRANSFORM, 3853 /* isvoid */ 1 3854 }; 3855 3856 struct iovec xcb_parts[8]; 3857 xcb_void_cookie_t xcb_ret; 3858 xcb_randr_set_crtc_transform_request_t xcb_out; 3859 3860 xcb_out.crtc = crtc; 3861 xcb_out.transform = transform; 3862 xcb_out.filter_len = filter_len; 3863 memset(xcb_out.pad0, 0, 2); 3864 3865 xcb_parts[2].iov_base = (char *) &xcb_out; 3866 xcb_parts[2].iov_len = sizeof(xcb_out); 3867 xcb_parts[3].iov_base = 0; 3868 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 3869 xcb_parts[4].iov_base = (char *) filter_name; 3870 xcb_parts[4].iov_len = filter_len * sizeof(char); 3871 xcb_parts[5].iov_base = 0; 3872 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 3873 xcb_parts[6].iov_base = (char *) filter_params; 3874 xcb_parts[6].iov_len = filter_params_len * sizeof(xcb_render_fixed_t); 3875 xcb_parts[7].iov_base = 0; 3876 xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3; 3877 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 3878 return xcb_ret; 3879 } 3880 3881 3882 /***************************************************************************** 3883 ** 3884 ** xcb_void_cookie_t xcb_randr_set_crtc_transform 3885 ** 3886 ** @param xcb_connection_t *c 3887 ** @param xcb_randr_crtc_t crtc 3888 ** @param xcb_render_transform_t transform 3889 ** @param uint16_t filter_len 3890 ** @param const char *filter_name 3891 ** @param uint32_t filter_params_len 3892 ** @param const xcb_render_fixed_t *filter_params 3893 ** @returns xcb_void_cookie_t 3894 ** 3895 *****************************************************************************/ 3896 3897 xcb_void_cookie_t 3898 xcb_randr_set_crtc_transform (xcb_connection_t *c /**< */, 3899 xcb_randr_crtc_t crtc /**< */, 3900 xcb_render_transform_t transform /**< */, 3901 uint16_t filter_len /**< */, 3902 const char *filter_name /**< */, 3903 uint32_t filter_params_len /**< */, 3904 const xcb_render_fixed_t *filter_params /**< */) 3905 { 3906 static const xcb_protocol_request_t xcb_req = { 3907 /* count */ 6, 3908 /* ext */ &xcb_randr_id, 3909 /* opcode */ XCB_RANDR_SET_CRTC_TRANSFORM, 3910 /* isvoid */ 1 3911 }; 3912 3913 struct iovec xcb_parts[8]; 3914 xcb_void_cookie_t xcb_ret; 3915 xcb_randr_set_crtc_transform_request_t xcb_out; 3916 3917 xcb_out.crtc = crtc; 3918 xcb_out.transform = transform; 3919 xcb_out.filter_len = filter_len; 3920 memset(xcb_out.pad0, 0, 2); 3921 3922 xcb_parts[2].iov_base = (char *) &xcb_out; 3923 xcb_parts[2].iov_len = sizeof(xcb_out); 3924 xcb_parts[3].iov_base = 0; 3925 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 3926 xcb_parts[4].iov_base = (char *) filter_name; 3927 xcb_parts[4].iov_len = filter_len * sizeof(char); 3928 xcb_parts[5].iov_base = 0; 3929 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 3930 xcb_parts[6].iov_base = (char *) filter_params; 3931 xcb_parts[6].iov_len = filter_params_len * sizeof(xcb_render_fixed_t); 3932 xcb_parts[7].iov_base = 0; 3933 xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3; 3934 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 3935 return xcb_ret; 3936 } 3937 3938 3939 /***************************************************************************** 3940 ** 3941 ** xcb_randr_get_crtc_transform_cookie_t xcb_randr_get_crtc_transform 3942 ** 3943 ** @param xcb_connection_t *c 3944 ** @param xcb_randr_crtc_t crtc 3945 ** @returns xcb_randr_get_crtc_transform_cookie_t 3946 ** 3947 *****************************************************************************/ 3948 3949 xcb_randr_get_crtc_transform_cookie_t 3950 xcb_randr_get_crtc_transform (xcb_connection_t *c /**< */, 3951 xcb_randr_crtc_t crtc /**< */) 3952 { 3953 static const xcb_protocol_request_t xcb_req = { 3954 /* count */ 2, 3955 /* ext */ &xcb_randr_id, 3956 /* opcode */ XCB_RANDR_GET_CRTC_TRANSFORM, 3957 /* isvoid */ 0 3958 }; 3959 3960 struct iovec xcb_parts[4]; 3961 xcb_randr_get_crtc_transform_cookie_t xcb_ret; 3962 xcb_randr_get_crtc_transform_request_t xcb_out; 3963 3964 xcb_out.crtc = crtc; 3965 3966 xcb_parts[2].iov_base = (char *) &xcb_out; 3967 xcb_parts[2].iov_len = sizeof(xcb_out); 3968 xcb_parts[3].iov_base = 0; 3969 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 3970 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 3971 return xcb_ret; 3972 } 3973 3974 3975 /***************************************************************************** 3976 ** 3977 ** xcb_randr_get_crtc_transform_cookie_t xcb_randr_get_crtc_transform_unchecked 3978 ** 3979 ** @param xcb_connection_t *c 3980 ** @param xcb_randr_crtc_t crtc 3981 ** @returns xcb_randr_get_crtc_transform_cookie_t 3982 ** 3983 *****************************************************************************/ 3984 3985 xcb_randr_get_crtc_transform_cookie_t 3986 xcb_randr_get_crtc_transform_unchecked (xcb_connection_t *c /**< */, 3987 xcb_randr_crtc_t crtc /**< */) 3988 { 3989 static const xcb_protocol_request_t xcb_req = { 3990 /* count */ 2, 3991 /* ext */ &xcb_randr_id, 3992 /* opcode */ XCB_RANDR_GET_CRTC_TRANSFORM, 3993 /* isvoid */ 0 3994 }; 3995 3996 struct iovec xcb_parts[4]; 3997 xcb_randr_get_crtc_transform_cookie_t xcb_ret; 3998 xcb_randr_get_crtc_transform_request_t xcb_out; 3999 4000 xcb_out.crtc = crtc; 4001 4002 xcb_parts[2].iov_base = (char *) &xcb_out; 4003 xcb_parts[2].iov_len = sizeof(xcb_out); 4004 xcb_parts[3].iov_base = 0; 4005 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 4006 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 4007 return xcb_ret; 4008 } 4009 4010 4011 /***************************************************************************** 4012 ** 4013 ** char * xcb_randr_get_crtc_transform_pending_filter_name 4014 ** 4015 ** @param const xcb_randr_get_crtc_transform_reply_t *R 4016 ** @returns char * 4017 ** 4018 *****************************************************************************/ 4019 4020 char * 4021 xcb_randr_get_crtc_transform_pending_filter_name (const xcb_randr_get_crtc_transform_reply_t *R /**< */) 4022 { 4023 return (char *) (R + 1); 4024 } 4025 4026 4027 /***************************************************************************** 4028 ** 4029 ** int xcb_randr_get_crtc_transform_pending_filter_name_length 4030 ** 4031 ** @param const xcb_randr_get_crtc_transform_reply_t *R 4032 ** @returns int 4033 ** 4034 *****************************************************************************/ 4035 4036 int 4037 xcb_randr_get_crtc_transform_pending_filter_name_length (const xcb_randr_get_crtc_transform_reply_t *R /**< */) 4038 { 4039 return R->pending_len; 4040 } 4041 4042 4043 /***************************************************************************** 4044 ** 4045 ** xcb_generic_iterator_t xcb_randr_get_crtc_transform_pending_filter_name_end 4046 ** 4047 ** @param const xcb_randr_get_crtc_transform_reply_t *R 4048 ** @returns xcb_generic_iterator_t 4049 ** 4050 *****************************************************************************/ 4051 4052 xcb_generic_iterator_t 4053 xcb_randr_get_crtc_transform_pending_filter_name_end (const xcb_randr_get_crtc_transform_reply_t *R /**< */) 4054 { 4055 xcb_generic_iterator_t i; 4056 i.data = ((char *) (R + 1)) + (R->pending_len); 4057 i.rem = 0; 4058 i.index = (char *) i.data - (char *) R; 4059 return i; 4060 } 4061 4062 4063 /***************************************************************************** 4064 ** 4065 ** xcb_render_fixed_t * xcb_randr_get_crtc_transform_pending_params 4066 ** 4067 ** @param const xcb_randr_get_crtc_transform_reply_t *R 4068 ** @returns xcb_render_fixed_t * 4069 ** 4070 *****************************************************************************/ 4071 4072 xcb_render_fixed_t * 4073 xcb_randr_get_crtc_transform_pending_params (const xcb_randr_get_crtc_transform_reply_t *R /**< */) 4074 { 4075 xcb_generic_iterator_t prev = xcb_randr_get_crtc_transform_pending_filter_name_end(R); 4076 return (xcb_render_fixed_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_render_fixed_t, prev.index) + 0); 4077 } 4078 4079 4080 /***************************************************************************** 4081 ** 4082 ** int xcb_randr_get_crtc_transform_pending_params_length 4083 ** 4084 ** @param const xcb_randr_get_crtc_transform_reply_t *R 4085 ** @returns int 4086 ** 4087 *****************************************************************************/ 4088 4089 int 4090 xcb_randr_get_crtc_transform_pending_params_length (const xcb_randr_get_crtc_transform_reply_t *R /**< */) 4091 { 4092 return R->pending_nparams; 4093 } 4094 4095 4096 /***************************************************************************** 4097 ** 4098 ** xcb_generic_iterator_t xcb_randr_get_crtc_transform_pending_params_end 4099 ** 4100 ** @param const xcb_randr_get_crtc_transform_reply_t *R 4101 ** @returns xcb_generic_iterator_t 4102 ** 4103 *****************************************************************************/ 4104 4105 xcb_generic_iterator_t 4106 xcb_randr_get_crtc_transform_pending_params_end (const xcb_randr_get_crtc_transform_reply_t *R /**< */) 4107 { 4108 xcb_generic_iterator_t i; 4109 xcb_generic_iterator_t child = xcb_randr_get_crtc_transform_pending_filter_name_end(R); 4110 i.data = ((xcb_render_fixed_t *) child.data) + (R->pending_nparams); 4111 i.rem = 0; 4112 i.index = (char *) i.data - (char *) R; 4113 return i; 4114 } 4115 4116 4117 /***************************************************************************** 4118 ** 4119 ** char * xcb_randr_get_crtc_transform_current_filter_name 4120 ** 4121 ** @param const xcb_randr_get_crtc_transform_reply_t *R 4122 ** @returns char * 4123 ** 4124 *****************************************************************************/ 4125 4126 char * 4127 xcb_randr_get_crtc_transform_current_filter_name (const xcb_randr_get_crtc_transform_reply_t *R /**< */) 4128 { 4129 xcb_generic_iterator_t prev = xcb_randr_get_crtc_transform_pending_params_end(R); 4130 return (char *) ((char *) prev.data + XCB_TYPE_PAD(char, prev.index) + 0); 4131 } 4132 4133 4134 /***************************************************************************** 4135 ** 4136 ** int xcb_randr_get_crtc_transform_current_filter_name_length 4137 ** 4138 ** @param const xcb_randr_get_crtc_transform_reply_t *R 4139 ** @returns int 4140 ** 4141 *****************************************************************************/ 4142 4143 int 4144 xcb_randr_get_crtc_transform_current_filter_name_length (const xcb_randr_get_crtc_transform_reply_t *R /**< */) 4145 { 4146 return R->current_len; 4147 } 4148 4149 4150 /***************************************************************************** 4151 ** 4152 ** xcb_generic_iterator_t xcb_randr_get_crtc_transform_current_filter_name_end 4153 ** 4154 ** @param const xcb_randr_get_crtc_transform_reply_t *R 4155 ** @returns xcb_generic_iterator_t 4156 ** 4157 *****************************************************************************/ 4158 4159 xcb_generic_iterator_t 4160 xcb_randr_get_crtc_transform_current_filter_name_end (const xcb_randr_get_crtc_transform_reply_t *R /**< */) 4161 { 4162 xcb_generic_iterator_t i; 4163 xcb_generic_iterator_t child = xcb_randr_get_crtc_transform_pending_params_end(R); 4164 i.data = ((char *) child.data) + (R->current_len); 4165 i.rem = 0; 4166 i.index = (char *) i.data - (char *) R; 4167 return i; 4168 } 4169 4170 4171 /***************************************************************************** 4172 ** 4173 ** xcb_render_fixed_t * xcb_randr_get_crtc_transform_current_params 4174 ** 4175 ** @param const xcb_randr_get_crtc_transform_reply_t *R 4176 ** @returns xcb_render_fixed_t * 4177 ** 4178 *****************************************************************************/ 4179 4180 xcb_render_fixed_t * 4181 xcb_randr_get_crtc_transform_current_params (const xcb_randr_get_crtc_transform_reply_t *R /**< */) 4182 { 4183 xcb_generic_iterator_t prev = xcb_randr_get_crtc_transform_current_filter_name_end(R); 4184 return (xcb_render_fixed_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_render_fixed_t, prev.index) + 0); 4185 } 4186 4187 4188 /***************************************************************************** 4189 ** 4190 ** int xcb_randr_get_crtc_transform_current_params_length 4191 ** 4192 ** @param const xcb_randr_get_crtc_transform_reply_t *R 4193 ** @returns int 4194 ** 4195 *****************************************************************************/ 4196 4197 int 4198 xcb_randr_get_crtc_transform_current_params_length (const xcb_randr_get_crtc_transform_reply_t *R /**< */) 4199 { 4200 return R->current_nparams; 4201 } 4202 4203 4204 /***************************************************************************** 4205 ** 4206 ** xcb_generic_iterator_t xcb_randr_get_crtc_transform_current_params_end 4207 ** 4208 ** @param const xcb_randr_get_crtc_transform_reply_t *R 4209 ** @returns xcb_generic_iterator_t 4210 ** 4211 *****************************************************************************/ 4212 4213 xcb_generic_iterator_t 4214 xcb_randr_get_crtc_transform_current_params_end (const xcb_randr_get_crtc_transform_reply_t *R /**< */) 4215 { 4216 xcb_generic_iterator_t i; 4217 xcb_generic_iterator_t child = xcb_randr_get_crtc_transform_current_filter_name_end(R); 4218 i.data = ((xcb_render_fixed_t *) child.data) + (R->current_nparams); 4219 i.rem = 0; 4220 i.index = (char *) i.data - (char *) R; 4221 return i; 4222 } 4223 4224 4225 /***************************************************************************** 4226 ** 4227 ** xcb_randr_get_crtc_transform_reply_t * xcb_randr_get_crtc_transform_reply 4228 ** 4229 ** @param xcb_connection_t *c 4230 ** @param xcb_randr_get_crtc_transform_cookie_t cookie 4231 ** @param xcb_generic_error_t **e 4232 ** @returns xcb_randr_get_crtc_transform_reply_t * 4233 ** 4234 *****************************************************************************/ 4235 4236 xcb_randr_get_crtc_transform_reply_t * 4237 xcb_randr_get_crtc_transform_reply (xcb_connection_t *c /**< */, 4238 xcb_randr_get_crtc_transform_cookie_t cookie /**< */, 4239 xcb_generic_error_t **e /**< */) 4240 { 4241 return (xcb_randr_get_crtc_transform_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 4242 } 4243 4244 4245 /***************************************************************************** 4246 ** 4247 ** xcb_randr_get_panning_cookie_t xcb_randr_get_panning 4248 ** 4249 ** @param xcb_connection_t *c 4250 ** @param xcb_randr_crtc_t crtc 4251 ** @returns xcb_randr_get_panning_cookie_t 4252 ** 4253 *****************************************************************************/ 4254 4255 xcb_randr_get_panning_cookie_t 4256 xcb_randr_get_panning (xcb_connection_t *c /**< */, 4257 xcb_randr_crtc_t crtc /**< */) 4258 { 4259 static const xcb_protocol_request_t xcb_req = { 4260 /* count */ 2, 4261 /* ext */ &xcb_randr_id, 4262 /* opcode */ XCB_RANDR_GET_PANNING, 4263 /* isvoid */ 0 4264 }; 4265 4266 struct iovec xcb_parts[4]; 4267 xcb_randr_get_panning_cookie_t xcb_ret; 4268 xcb_randr_get_panning_request_t xcb_out; 4269 4270 xcb_out.crtc = crtc; 4271 4272 xcb_parts[2].iov_base = (char *) &xcb_out; 4273 xcb_parts[2].iov_len = sizeof(xcb_out); 4274 xcb_parts[3].iov_base = 0; 4275 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 4276 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 4277 return xcb_ret; 4278 } 4279 4280 4281 /***************************************************************************** 4282 ** 4283 ** xcb_randr_get_panning_cookie_t xcb_randr_get_panning_unchecked 4284 ** 4285 ** @param xcb_connection_t *c 4286 ** @param xcb_randr_crtc_t crtc 4287 ** @returns xcb_randr_get_panning_cookie_t 4288 ** 4289 *****************************************************************************/ 4290 4291 xcb_randr_get_panning_cookie_t 4292 xcb_randr_get_panning_unchecked (xcb_connection_t *c /**< */, 4293 xcb_randr_crtc_t crtc /**< */) 4294 { 4295 static const xcb_protocol_request_t xcb_req = { 4296 /* count */ 2, 4297 /* ext */ &xcb_randr_id, 4298 /* opcode */ XCB_RANDR_GET_PANNING, 4299 /* isvoid */ 0 4300 }; 4301 4302 struct iovec xcb_parts[4]; 4303 xcb_randr_get_panning_cookie_t xcb_ret; 4304 xcb_randr_get_panning_request_t xcb_out; 4305 4306 xcb_out.crtc = crtc; 4307 4308 xcb_parts[2].iov_base = (char *) &xcb_out; 4309 xcb_parts[2].iov_len = sizeof(xcb_out); 4310 xcb_parts[3].iov_base = 0; 4311 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 4312 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 4313 return xcb_ret; 4314 } 4315 4316 4317 /***************************************************************************** 4318 ** 4319 ** xcb_randr_get_panning_reply_t * xcb_randr_get_panning_reply 4320 ** 4321 ** @param xcb_connection_t *c 4322 ** @param xcb_randr_get_panning_cookie_t cookie 4323 ** @param xcb_generic_error_t **e 4324 ** @returns xcb_randr_get_panning_reply_t * 4325 ** 4326 *****************************************************************************/ 4327 4328 xcb_randr_get_panning_reply_t * 4329 xcb_randr_get_panning_reply (xcb_connection_t *c /**< */, 4330 xcb_randr_get_panning_cookie_t cookie /**< */, 4331 xcb_generic_error_t **e /**< */) 4332 { 4333 return (xcb_randr_get_panning_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 4334 } 4335 4336 4337 /***************************************************************************** 4338 ** 4339 ** xcb_randr_set_panning_cookie_t xcb_randr_set_panning 4340 ** 4341 ** @param xcb_connection_t *c 4342 ** @param xcb_randr_crtc_t crtc 4343 ** @param xcb_timestamp_t timestamp 4344 ** @param uint16_t left 4345 ** @param uint16_t top 4346 ** @param uint16_t width 4347 ** @param uint16_t height 4348 ** @param uint16_t track_left 4349 ** @param uint16_t track_top 4350 ** @param uint16_t track_width 4351 ** @param uint16_t track_height 4352 ** @param int16_t border_left 4353 ** @param int16_t border_top 4354 ** @param int16_t border_right 4355 ** @param int16_t border_bottom 4356 ** @returns xcb_randr_set_panning_cookie_t 4357 ** 4358 *****************************************************************************/ 4359 4360 xcb_randr_set_panning_cookie_t 4361 xcb_randr_set_panning (xcb_connection_t *c /**< */, 4362 xcb_randr_crtc_t crtc /**< */, 4363 xcb_timestamp_t timestamp /**< */, 4364 uint16_t left /**< */, 4365 uint16_t top /**< */, 4366 uint16_t width /**< */, 4367 uint16_t height /**< */, 4368 uint16_t track_left /**< */, 4369 uint16_t track_top /**< */, 4370 uint16_t track_width /**< */, 4371 uint16_t track_height /**< */, 4372 int16_t border_left /**< */, 4373 int16_t border_top /**< */, 4374 int16_t border_right /**< */, 4375 int16_t border_bottom /**< */) 4376 { 4377 static const xcb_protocol_request_t xcb_req = { 4378 /* count */ 2, 4379 /* ext */ &xcb_randr_id, 4380 /* opcode */ XCB_RANDR_SET_PANNING, 4381 /* isvoid */ 0 4382 }; 4383 4384 struct iovec xcb_parts[4]; 4385 xcb_randr_set_panning_cookie_t xcb_ret; 4386 xcb_randr_set_panning_request_t xcb_out; 4387 4388 xcb_out.crtc = crtc; 4389 xcb_out.timestamp = timestamp; 4390 xcb_out.left = left; 4391 xcb_out.top = top; 4392 xcb_out.width = width; 4393 xcb_out.height = height; 4394 xcb_out.track_left = track_left; 4395 xcb_out.track_top = track_top; 4396 xcb_out.track_width = track_width; 4397 xcb_out.track_height = track_height; 4398 xcb_out.border_left = border_left; 4399 xcb_out.border_top = border_top; 4400 xcb_out.border_right = border_right; 4401 xcb_out.border_bottom = border_bottom; 4402 4403 xcb_parts[2].iov_base = (char *) &xcb_out; 4404 xcb_parts[2].iov_len = sizeof(xcb_out); 4405 xcb_parts[3].iov_base = 0; 4406 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 4407 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 4408 return xcb_ret; 4409 } 4410 4411 4412 /***************************************************************************** 4413 ** 4414 ** xcb_randr_set_panning_cookie_t xcb_randr_set_panning_unchecked 4415 ** 4416 ** @param xcb_connection_t *c 4417 ** @param xcb_randr_crtc_t crtc 4418 ** @param xcb_timestamp_t timestamp 4419 ** @param uint16_t left 4420 ** @param uint16_t top 4421 ** @param uint16_t width 4422 ** @param uint16_t height 4423 ** @param uint16_t track_left 4424 ** @param uint16_t track_top 4425 ** @param uint16_t track_width 4426 ** @param uint16_t track_height 4427 ** @param int16_t border_left 4428 ** @param int16_t border_top 4429 ** @param int16_t border_right 4430 ** @param int16_t border_bottom 4431 ** @returns xcb_randr_set_panning_cookie_t 4432 ** 4433 *****************************************************************************/ 4434 4435 xcb_randr_set_panning_cookie_t 4436 xcb_randr_set_panning_unchecked (xcb_connection_t *c /**< */, 4437 xcb_randr_crtc_t crtc /**< */, 4438 xcb_timestamp_t timestamp /**< */, 4439 uint16_t left /**< */, 4440 uint16_t top /**< */, 4441 uint16_t width /**< */, 4442 uint16_t height /**< */, 4443 uint16_t track_left /**< */, 4444 uint16_t track_top /**< */, 4445 uint16_t track_width /**< */, 4446 uint16_t track_height /**< */, 4447 int16_t border_left /**< */, 4448 int16_t border_top /**< */, 4449 int16_t border_right /**< */, 4450 int16_t border_bottom /**< */) 4451 { 4452 static const xcb_protocol_request_t xcb_req = { 4453 /* count */ 2, 4454 /* ext */ &xcb_randr_id, 4455 /* opcode */ XCB_RANDR_SET_PANNING, 4456 /* isvoid */ 0 4457 }; 4458 4459 struct iovec xcb_parts[4]; 4460 xcb_randr_set_panning_cookie_t xcb_ret; 4461 xcb_randr_set_panning_request_t xcb_out; 4462 4463 xcb_out.crtc = crtc; 4464 xcb_out.timestamp = timestamp; 4465 xcb_out.left = left; 4466 xcb_out.top = top; 4467 xcb_out.width = width; 4468 xcb_out.height = height; 4469 xcb_out.track_left = track_left; 4470 xcb_out.track_top = track_top; 4471 xcb_out.track_width = track_width; 4472 xcb_out.track_height = track_height; 4473 xcb_out.border_left = border_left; 4474 xcb_out.border_top = border_top; 4475 xcb_out.border_right = border_right; 4476 xcb_out.border_bottom = border_bottom; 4477 4478 xcb_parts[2].iov_base = (char *) &xcb_out; 4479 xcb_parts[2].iov_len = sizeof(xcb_out); 4480 xcb_parts[3].iov_base = 0; 4481 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 4482 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 4483 return xcb_ret; 4484 } 4485 4486 4487 /***************************************************************************** 4488 ** 4489 ** xcb_randr_set_panning_reply_t * xcb_randr_set_panning_reply 4490 ** 4491 ** @param xcb_connection_t *c 4492 ** @param xcb_randr_set_panning_cookie_t cookie 4493 ** @param xcb_generic_error_t **e 4494 ** @returns xcb_randr_set_panning_reply_t * 4495 ** 4496 *****************************************************************************/ 4497 4498 xcb_randr_set_panning_reply_t * 4499 xcb_randr_set_panning_reply (xcb_connection_t *c /**< */, 4500 xcb_randr_set_panning_cookie_t cookie /**< */, 4501 xcb_generic_error_t **e /**< */) 4502 { 4503 return (xcb_randr_set_panning_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 4504 } 4505 4506 4507 /***************************************************************************** 4508 ** 4509 ** xcb_void_cookie_t xcb_randr_set_output_primary_checked 4510 ** 4511 ** @param xcb_connection_t *c 4512 ** @param xcb_window_t window 4513 ** @param xcb_randr_output_t output 4514 ** @returns xcb_void_cookie_t 4515 ** 4516 *****************************************************************************/ 4517 4518 xcb_void_cookie_t 4519 xcb_randr_set_output_primary_checked (xcb_connection_t *c /**< */, 4520 xcb_window_t window /**< */, 4521 xcb_randr_output_t output /**< */) 4522 { 4523 static const xcb_protocol_request_t xcb_req = { 4524 /* count */ 2, 4525 /* ext */ &xcb_randr_id, 4526 /* opcode */ XCB_RANDR_SET_OUTPUT_PRIMARY, 4527 /* isvoid */ 1 4528 }; 4529 4530 struct iovec xcb_parts[4]; 4531 xcb_void_cookie_t xcb_ret; 4532 xcb_randr_set_output_primary_request_t xcb_out; 4533 4534 xcb_out.window = window; 4535 xcb_out.output = output; 4536 4537 xcb_parts[2].iov_base = (char *) &xcb_out; 4538 xcb_parts[2].iov_len = sizeof(xcb_out); 4539 xcb_parts[3].iov_base = 0; 4540 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 4541 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 4542 return xcb_ret; 4543 } 4544 4545 4546 /***************************************************************************** 4547 ** 4548 ** xcb_void_cookie_t xcb_randr_set_output_primary 4549 ** 4550 ** @param xcb_connection_t *c 4551 ** @param xcb_window_t window 4552 ** @param xcb_randr_output_t output 4553 ** @returns xcb_void_cookie_t 4554 ** 4555 *****************************************************************************/ 4556 4557 xcb_void_cookie_t 4558 xcb_randr_set_output_primary (xcb_connection_t *c /**< */, 4559 xcb_window_t window /**< */, 4560 xcb_randr_output_t output /**< */) 4561 { 4562 static const xcb_protocol_request_t xcb_req = { 4563 /* count */ 2, 4564 /* ext */ &xcb_randr_id, 4565 /* opcode */ XCB_RANDR_SET_OUTPUT_PRIMARY, 4566 /* isvoid */ 1 4567 }; 4568 4569 struct iovec xcb_parts[4]; 4570 xcb_void_cookie_t xcb_ret; 4571 xcb_randr_set_output_primary_request_t xcb_out; 4572 4573 xcb_out.window = window; 4574 xcb_out.output = output; 4575 4576 xcb_parts[2].iov_base = (char *) &xcb_out; 4577 xcb_parts[2].iov_len = sizeof(xcb_out); 4578 xcb_parts[3].iov_base = 0; 4579 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 4580 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 4581 return xcb_ret; 4582 } 4583 4584 4585 /***************************************************************************** 4586 ** 4587 ** xcb_randr_get_output_primary_cookie_t xcb_randr_get_output_primary 4588 ** 4589 ** @param xcb_connection_t *c 4590 ** @param xcb_window_t window 4591 ** @returns xcb_randr_get_output_primary_cookie_t 4592 ** 4593 *****************************************************************************/ 4594 4595 xcb_randr_get_output_primary_cookie_t 4596 xcb_randr_get_output_primary (xcb_connection_t *c /**< */, 4597 xcb_window_t window /**< */) 4598 { 4599 static const xcb_protocol_request_t xcb_req = { 4600 /* count */ 2, 4601 /* ext */ &xcb_randr_id, 4602 /* opcode */ XCB_RANDR_GET_OUTPUT_PRIMARY, 4603 /* isvoid */ 0 4604 }; 4605 4606 struct iovec xcb_parts[4]; 4607 xcb_randr_get_output_primary_cookie_t xcb_ret; 4608 xcb_randr_get_output_primary_request_t xcb_out; 4609 4610 xcb_out.window = window; 4611 4612 xcb_parts[2].iov_base = (char *) &xcb_out; 4613 xcb_parts[2].iov_len = sizeof(xcb_out); 4614 xcb_parts[3].iov_base = 0; 4615 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 4616 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 4617 return xcb_ret; 4618 } 4619 4620 4621 /***************************************************************************** 4622 ** 4623 ** xcb_randr_get_output_primary_cookie_t xcb_randr_get_output_primary_unchecked 4624 ** 4625 ** @param xcb_connection_t *c 4626 ** @param xcb_window_t window 4627 ** @returns xcb_randr_get_output_primary_cookie_t 4628 ** 4629 *****************************************************************************/ 4630 4631 xcb_randr_get_output_primary_cookie_t 4632 xcb_randr_get_output_primary_unchecked (xcb_connection_t *c /**< */, 4633 xcb_window_t window /**< */) 4634 { 4635 static const xcb_protocol_request_t xcb_req = { 4636 /* count */ 2, 4637 /* ext */ &xcb_randr_id, 4638 /* opcode */ XCB_RANDR_GET_OUTPUT_PRIMARY, 4639 /* isvoid */ 0 4640 }; 4641 4642 struct iovec xcb_parts[4]; 4643 xcb_randr_get_output_primary_cookie_t xcb_ret; 4644 xcb_randr_get_output_primary_request_t xcb_out; 4645 4646 xcb_out.window = window; 4647 4648 xcb_parts[2].iov_base = (char *) &xcb_out; 4649 xcb_parts[2].iov_len = sizeof(xcb_out); 4650 xcb_parts[3].iov_base = 0; 4651 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 4652 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 4653 return xcb_ret; 4654 } 4655 4656 4657 /***************************************************************************** 4658 ** 4659 ** xcb_randr_get_output_primary_reply_t * xcb_randr_get_output_primary_reply 4660 ** 4661 ** @param xcb_connection_t *c 4662 ** @param xcb_randr_get_output_primary_cookie_t cookie 4663 ** @param xcb_generic_error_t **e 4664 ** @returns xcb_randr_get_output_primary_reply_t * 4665 ** 4666 *****************************************************************************/ 4667 4668 xcb_randr_get_output_primary_reply_t * 4669 xcb_randr_get_output_primary_reply (xcb_connection_t *c /**< */, 4670 xcb_randr_get_output_primary_cookie_t cookie /**< */, 4671 xcb_generic_error_t **e /**< */) 4672 { 4673 return (xcb_randr_get_output_primary_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 4674 } 4675 4676 4677 /***************************************************************************** 4678 ** 4679 ** void xcb_randr_crtc_change_next 4680 ** 4681 ** @param xcb_randr_crtc_change_iterator_t *i 4682 ** @returns void 4683 ** 4684 *****************************************************************************/ 4685 4686 void 4687 xcb_randr_crtc_change_next (xcb_randr_crtc_change_iterator_t *i /**< */) 4688 { 4689 --i->rem; 4690 ++i->data; 4691 i->index += sizeof(xcb_randr_crtc_change_t); 4692 } 4693 4694 4695 /***************************************************************************** 4696 ** 4697 ** xcb_generic_iterator_t xcb_randr_crtc_change_end 4698 ** 4699 ** @param xcb_randr_crtc_change_iterator_t i 4700 ** @returns xcb_generic_iterator_t 4701 ** 4702 *****************************************************************************/ 4703 4704 xcb_generic_iterator_t 4705 xcb_randr_crtc_change_end (xcb_randr_crtc_change_iterator_t i /**< */) 4706 { 4707 xcb_generic_iterator_t ret; 4708 ret.data = i.data + i.rem; 4709 ret.index = i.index + ((char *) ret.data - (char *) i.data); 4710 ret.rem = 0; 4711 return ret; 4712 } 4713 4714 4715 /***************************************************************************** 4716 ** 4717 ** void xcb_randr_output_change_next 4718 ** 4719 ** @param xcb_randr_output_change_iterator_t *i 4720 ** @returns void 4721 ** 4722 *****************************************************************************/ 4723 4724 void 4725 xcb_randr_output_change_next (xcb_randr_output_change_iterator_t *i /**< */) 4726 { 4727 --i->rem; 4728 ++i->data; 4729 i->index += sizeof(xcb_randr_output_change_t); 4730 } 4731 4732 4733 /***************************************************************************** 4734 ** 4735 ** xcb_generic_iterator_t xcb_randr_output_change_end 4736 ** 4737 ** @param xcb_randr_output_change_iterator_t i 4738 ** @returns xcb_generic_iterator_t 4739 ** 4740 *****************************************************************************/ 4741 4742 xcb_generic_iterator_t 4743 xcb_randr_output_change_end (xcb_randr_output_change_iterator_t i /**< */) 4744 { 4745 xcb_generic_iterator_t ret; 4746 ret.data = i.data + i.rem; 4747 ret.index = i.index + ((char *) ret.data - (char *) i.data); 4748 ret.rem = 0; 4749 return ret; 4750 } 4751 4752 4753 /***************************************************************************** 4754 ** 4755 ** void xcb_randr_output_property_next 4756 ** 4757 ** @param xcb_randr_output_property_iterator_t *i 4758 ** @returns void 4759 ** 4760 *****************************************************************************/ 4761 4762 void 4763 xcb_randr_output_property_next (xcb_randr_output_property_iterator_t *i /**< */) 4764 { 4765 --i->rem; 4766 ++i->data; 4767 i->index += sizeof(xcb_randr_output_property_t); 4768 } 4769 4770 4771 /***************************************************************************** 4772 ** 4773 ** xcb_generic_iterator_t xcb_randr_output_property_end 4774 ** 4775 ** @param xcb_randr_output_property_iterator_t i 4776 ** @returns xcb_generic_iterator_t 4777 ** 4778 *****************************************************************************/ 4779 4780 xcb_generic_iterator_t 4781 xcb_randr_output_property_end (xcb_randr_output_property_iterator_t i /**< */) 4782 { 4783 xcb_generic_iterator_t ret; 4784 ret.data = i.data + i.rem; 4785 ret.index = i.index + ((char *) ret.data - (char *) i.data); 4786 ret.rem = 0; 4787 return ret; 4788 } 4789 4790 4791 /***************************************************************************** 4792 ** 4793 ** void xcb_randr_notify_data_next 4794 ** 4795 ** @param xcb_randr_notify_data_iterator_t *i 4796 ** @returns void 4797 ** 4798 *****************************************************************************/ 4799 4800 void 4801 xcb_randr_notify_data_next (xcb_randr_notify_data_iterator_t *i /**< */) 4802 { 4803 --i->rem; 4804 ++i->data; 4805 i->index += sizeof(xcb_randr_notify_data_t); 4806 } 4807 4808 4809 /***************************************************************************** 4810 ** 4811 ** xcb_generic_iterator_t xcb_randr_notify_data_end 4812 ** 4813 ** @param xcb_randr_notify_data_iterator_t i 4814 ** @returns xcb_generic_iterator_t 4815 ** 4816 *****************************************************************************/ 4817 4818 xcb_generic_iterator_t 4819 xcb_randr_notify_data_end (xcb_randr_notify_data_iterator_t i /**< */) 4820 { 4821 xcb_generic_iterator_t ret; 4822 ret.data = i.data + i.rem; 4823 ret.index = i.index + ((char *) ret.data - (char *) i.data); 4824 ret.rem = 0; 4825 return ret; 4826 } 4827 4828