1 /* 2 * This file generated automatically from xinput.xml by c_client.py. 3 * Edit at your peril. 4 */ 5 6 #ifdef HAVE_CONFIG_H 7 #include "config.h" 8 #endif 9 #include <stdlib.h> 10 #include <string.h> 11 #include <assert.h> 12 #include <stddef.h> /* for offsetof() */ 13 #include "xcbext.h" 14 #include "xinput.h" 15 16 #define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member) 17 #include "xfixes.h" 18 19 xcb_extension_t xcb_input_id = { "XInputExtension", 0 }; 20 21 void 22 xcb_input_event_class_next (xcb_input_event_class_iterator_t *i /**< */) 23 { 24 --i->rem; 25 ++i->data; 26 i->index += sizeof(xcb_input_event_class_t); 27 } 28 29 xcb_generic_iterator_t 30 xcb_input_event_class_end (xcb_input_event_class_iterator_t i /**< */) 31 { 32 xcb_generic_iterator_t ret; 33 ret.data = i.data + i.rem; 34 ret.index = i.index + ((char *) ret.data - (char *) i.data); 35 ret.rem = 0; 36 return ret; 37 } 38 39 void 40 xcb_input_key_code_next (xcb_input_key_code_iterator_t *i /**< */) 41 { 42 --i->rem; 43 ++i->data; 44 i->index += sizeof(xcb_input_key_code_t); 45 } 46 47 xcb_generic_iterator_t 48 xcb_input_key_code_end (xcb_input_key_code_iterator_t i /**< */) 49 { 50 xcb_generic_iterator_t ret; 51 ret.data = i.data + i.rem; 52 ret.index = i.index + ((char *) ret.data - (char *) i.data); 53 ret.rem = 0; 54 return ret; 55 } 56 57 void 58 xcb_input_device_id_next (xcb_input_device_id_iterator_t *i /**< */) 59 { 60 --i->rem; 61 ++i->data; 62 i->index += sizeof(xcb_input_device_id_t); 63 } 64 65 xcb_generic_iterator_t 66 xcb_input_device_id_end (xcb_input_device_id_iterator_t i /**< */) 67 { 68 xcb_generic_iterator_t ret; 69 ret.data = i.data + i.rem; 70 ret.index = i.index + ((char *) ret.data - (char *) i.data); 71 ret.rem = 0; 72 return ret; 73 } 74 75 void 76 xcb_input_fp1616_next (xcb_input_fp1616_iterator_t *i /**< */) 77 { 78 --i->rem; 79 ++i->data; 80 i->index += sizeof(xcb_input_fp1616_t); 81 } 82 83 xcb_generic_iterator_t 84 xcb_input_fp1616_end (xcb_input_fp1616_iterator_t i /**< */) 85 { 86 xcb_generic_iterator_t ret; 87 ret.data = i.data + i.rem; 88 ret.index = i.index + ((char *) ret.data - (char *) i.data); 89 ret.rem = 0; 90 return ret; 91 } 92 93 void 94 xcb_input_fp3232_next (xcb_input_fp3232_iterator_t *i /**< */) 95 { 96 --i->rem; 97 ++i->data; 98 i->index += sizeof(xcb_input_fp3232_t); 99 } 100 101 xcb_generic_iterator_t 102 xcb_input_fp3232_end (xcb_input_fp3232_iterator_t i /**< */) 103 { 104 xcb_generic_iterator_t ret; 105 ret.data = i.data + i.rem; 106 ret.index = i.index + ((char *) ret.data - (char *) i.data); 107 ret.rem = 0; 108 return ret; 109 } 110 111 int 112 xcb_input_get_extension_version_sizeof (const void *_buffer /**< */) 113 { 114 char *xcb_tmp = (char *)_buffer; 115 const xcb_input_get_extension_version_request_t *_aux = (xcb_input_get_extension_version_request_t *)_buffer; 116 unsigned int xcb_buffer_len = 0; 117 unsigned int xcb_block_len = 0; 118 unsigned int xcb_pad = 0; 119 unsigned int xcb_align_to = 0; 120 121 122 xcb_block_len += sizeof(xcb_input_get_extension_version_request_t); 123 xcb_tmp += xcb_block_len; 124 xcb_buffer_len += xcb_block_len; 125 xcb_block_len = 0; 126 /* name */ 127 xcb_block_len += _aux->name_len * sizeof(char); 128 xcb_tmp += xcb_block_len; 129 xcb_align_to = ALIGNOF(char); 130 /* insert padding */ 131 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 132 xcb_buffer_len += xcb_block_len + xcb_pad; 133 if (0 != xcb_pad) { 134 xcb_tmp += xcb_pad; 135 xcb_pad = 0; 136 } 137 xcb_block_len = 0; 138 139 return xcb_buffer_len; 140 } 141 142 xcb_input_get_extension_version_cookie_t 143 xcb_input_get_extension_version (xcb_connection_t *c /**< */, 144 uint16_t name_len /**< */, 145 const char *name /**< */) 146 { 147 static const xcb_protocol_request_t xcb_req = { 148 /* count */ 4, 149 /* ext */ &xcb_input_id, 150 /* opcode */ XCB_INPUT_GET_EXTENSION_VERSION, 151 /* isvoid */ 0 152 }; 153 154 struct iovec xcb_parts[6]; 155 xcb_input_get_extension_version_cookie_t xcb_ret; 156 xcb_input_get_extension_version_request_t xcb_out; 157 158 xcb_out.name_len = name_len; 159 memset(xcb_out.pad0, 0, 2); 160 161 xcb_parts[2].iov_base = (char *) &xcb_out; 162 xcb_parts[2].iov_len = sizeof(xcb_out); 163 xcb_parts[3].iov_base = 0; 164 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 165 /* char name */ 166 xcb_parts[4].iov_base = (char *) name; 167 xcb_parts[4].iov_len = name_len * sizeof(char); 168 xcb_parts[5].iov_base = 0; 169 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 170 171 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 172 return xcb_ret; 173 } 174 175 xcb_input_get_extension_version_cookie_t 176 xcb_input_get_extension_version_unchecked (xcb_connection_t *c /**< */, 177 uint16_t name_len /**< */, 178 const char *name /**< */) 179 { 180 static const xcb_protocol_request_t xcb_req = { 181 /* count */ 4, 182 /* ext */ &xcb_input_id, 183 /* opcode */ XCB_INPUT_GET_EXTENSION_VERSION, 184 /* isvoid */ 0 185 }; 186 187 struct iovec xcb_parts[6]; 188 xcb_input_get_extension_version_cookie_t xcb_ret; 189 xcb_input_get_extension_version_request_t xcb_out; 190 191 xcb_out.name_len = name_len; 192 memset(xcb_out.pad0, 0, 2); 193 194 xcb_parts[2].iov_base = (char *) &xcb_out; 195 xcb_parts[2].iov_len = sizeof(xcb_out); 196 xcb_parts[3].iov_base = 0; 197 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 198 /* char name */ 199 xcb_parts[4].iov_base = (char *) name; 200 xcb_parts[4].iov_len = name_len * sizeof(char); 201 xcb_parts[5].iov_base = 0; 202 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 203 204 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 205 return xcb_ret; 206 } 207 208 xcb_input_get_extension_version_reply_t * 209 xcb_input_get_extension_version_reply (xcb_connection_t *c /**< */, 210 xcb_input_get_extension_version_cookie_t cookie /**< */, 211 xcb_generic_error_t **e /**< */) 212 { 213 return (xcb_input_get_extension_version_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 214 } 215 216 void 217 xcb_input_device_info_next (xcb_input_device_info_iterator_t *i /**< */) 218 { 219 --i->rem; 220 ++i->data; 221 i->index += sizeof(xcb_input_device_info_t); 222 } 223 224 xcb_generic_iterator_t 225 xcb_input_device_info_end (xcb_input_device_info_iterator_t i /**< */) 226 { 227 xcb_generic_iterator_t ret; 228 ret.data = i.data + i.rem; 229 ret.index = i.index + ((char *) ret.data - (char *) i.data); 230 ret.rem = 0; 231 return ret; 232 } 233 234 void 235 xcb_input_key_info_next (xcb_input_key_info_iterator_t *i /**< */) 236 { 237 --i->rem; 238 ++i->data; 239 i->index += sizeof(xcb_input_key_info_t); 240 } 241 242 xcb_generic_iterator_t 243 xcb_input_key_info_end (xcb_input_key_info_iterator_t i /**< */) 244 { 245 xcb_generic_iterator_t ret; 246 ret.data = i.data + i.rem; 247 ret.index = i.index + ((char *) ret.data - (char *) i.data); 248 ret.rem = 0; 249 return ret; 250 } 251 252 void 253 xcb_input_button_info_next (xcb_input_button_info_iterator_t *i /**< */) 254 { 255 --i->rem; 256 ++i->data; 257 i->index += sizeof(xcb_input_button_info_t); 258 } 259 260 xcb_generic_iterator_t 261 xcb_input_button_info_end (xcb_input_button_info_iterator_t i /**< */) 262 { 263 xcb_generic_iterator_t ret; 264 ret.data = i.data + i.rem; 265 ret.index = i.index + ((char *) ret.data - (char *) i.data); 266 ret.rem = 0; 267 return ret; 268 } 269 270 void 271 xcb_input_axis_info_next (xcb_input_axis_info_iterator_t *i /**< */) 272 { 273 --i->rem; 274 ++i->data; 275 i->index += sizeof(xcb_input_axis_info_t); 276 } 277 278 xcb_generic_iterator_t 279 xcb_input_axis_info_end (xcb_input_axis_info_iterator_t i /**< */) 280 { 281 xcb_generic_iterator_t ret; 282 ret.data = i.data + i.rem; 283 ret.index = i.index + ((char *) ret.data - (char *) i.data); 284 ret.rem = 0; 285 return ret; 286 } 287 288 int 289 xcb_input_valuator_info_sizeof (const void *_buffer /**< */) 290 { 291 char *xcb_tmp = (char *)_buffer; 292 const xcb_input_valuator_info_t *_aux = (xcb_input_valuator_info_t *)_buffer; 293 unsigned int xcb_buffer_len = 0; 294 unsigned int xcb_block_len = 0; 295 unsigned int xcb_pad = 0; 296 unsigned int xcb_align_to = 0; 297 298 299 xcb_block_len += sizeof(xcb_input_valuator_info_t); 300 xcb_tmp += xcb_block_len; 301 xcb_buffer_len += xcb_block_len; 302 xcb_block_len = 0; 303 /* axes */ 304 xcb_block_len += _aux->axes_len * sizeof(xcb_input_axis_info_t); 305 xcb_tmp += xcb_block_len; 306 xcb_align_to = ALIGNOF(xcb_input_axis_info_t); 307 /* insert padding */ 308 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 309 xcb_buffer_len += xcb_block_len + xcb_pad; 310 if (0 != xcb_pad) { 311 xcb_tmp += xcb_pad; 312 xcb_pad = 0; 313 } 314 xcb_block_len = 0; 315 316 return xcb_buffer_len; 317 } 318 319 xcb_input_axis_info_t * 320 xcb_input_valuator_info_axes (const xcb_input_valuator_info_t *R /**< */) 321 { 322 return (xcb_input_axis_info_t *) (R + 1); 323 } 324 325 int 326 xcb_input_valuator_info_axes_length (const xcb_input_valuator_info_t *R /**< */) 327 { 328 return R->axes_len; 329 } 330 331 xcb_input_axis_info_iterator_t 332 xcb_input_valuator_info_axes_iterator (const xcb_input_valuator_info_t *R /**< */) 333 { 334 xcb_input_axis_info_iterator_t i; 335 i.data = (xcb_input_axis_info_t *) (R + 1); 336 i.rem = R->axes_len; 337 i.index = (char *) i.data - (char *) R; 338 return i; 339 } 340 341 void 342 xcb_input_valuator_info_next (xcb_input_valuator_info_iterator_t *i /**< */) 343 { 344 xcb_input_valuator_info_t *R = i->data; 345 xcb_generic_iterator_t child; 346 child.data = (xcb_input_valuator_info_t *)(((char *)R) + xcb_input_valuator_info_sizeof(R)); 347 i->index = (char *) child.data - (char *) i->data; 348 --i->rem; 349 i->data = (xcb_input_valuator_info_t *) child.data; 350 } 351 352 xcb_generic_iterator_t 353 xcb_input_valuator_info_end (xcb_input_valuator_info_iterator_t i /**< */) 354 { 355 xcb_generic_iterator_t ret; 356 while(i.rem > 0) 357 xcb_input_valuator_info_next(&i); 358 ret.data = i.data; 359 ret.rem = i.rem; 360 ret.index = i.index; 361 return ret; 362 } 363 364 void 365 xcb_input_input_info_next (xcb_input_input_info_iterator_t *i /**< */) 366 { 367 --i->rem; 368 ++i->data; 369 i->index += sizeof(xcb_input_input_info_t); 370 } 371 372 xcb_generic_iterator_t 373 xcb_input_input_info_end (xcb_input_input_info_iterator_t i /**< */) 374 { 375 xcb_generic_iterator_t ret; 376 ret.data = i.data + i.rem; 377 ret.index = i.index + ((char *) ret.data - (char *) i.data); 378 ret.rem = 0; 379 return ret; 380 } 381 382 int 383 xcb_input_device_name_sizeof (const void *_buffer /**< */) 384 { 385 char *xcb_tmp = (char *)_buffer; 386 const xcb_input_device_name_t *_aux = (xcb_input_device_name_t *)_buffer; 387 unsigned int xcb_buffer_len = 0; 388 unsigned int xcb_block_len = 0; 389 unsigned int xcb_pad = 0; 390 unsigned int xcb_align_to = 0; 391 392 393 xcb_block_len += sizeof(xcb_input_device_name_t); 394 xcb_tmp += xcb_block_len; 395 xcb_buffer_len += xcb_block_len; 396 xcb_block_len = 0; 397 /* string */ 398 xcb_block_len += _aux->len * sizeof(char); 399 xcb_tmp += xcb_block_len; 400 xcb_align_to = ALIGNOF(char); 401 /* insert padding */ 402 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 403 xcb_buffer_len += xcb_block_len + xcb_pad; 404 if (0 != xcb_pad) { 405 xcb_tmp += xcb_pad; 406 xcb_pad = 0; 407 } 408 xcb_block_len = 0; 409 410 return xcb_buffer_len; 411 } 412 413 char * 414 xcb_input_device_name_string (const xcb_input_device_name_t *R /**< */) 415 { 416 return (char *) (R + 1); 417 } 418 419 int 420 xcb_input_device_name_string_length (const xcb_input_device_name_t *R /**< */) 421 { 422 return R->len; 423 } 424 425 xcb_generic_iterator_t 426 xcb_input_device_name_string_end (const xcb_input_device_name_t *R /**< */) 427 { 428 xcb_generic_iterator_t i; 429 i.data = ((char *) (R + 1)) + (R->len); 430 i.rem = 0; 431 i.index = (char *) i.data - (char *) R; 432 return i; 433 } 434 435 void 436 xcb_input_device_name_next (xcb_input_device_name_iterator_t *i /**< */) 437 { 438 xcb_input_device_name_t *R = i->data; 439 xcb_generic_iterator_t child; 440 child.data = (xcb_input_device_name_t *)(((char *)R) + xcb_input_device_name_sizeof(R)); 441 i->index = (char *) child.data - (char *) i->data; 442 --i->rem; 443 i->data = (xcb_input_device_name_t *) child.data; 444 } 445 446 xcb_generic_iterator_t 447 xcb_input_device_name_end (xcb_input_device_name_iterator_t i /**< */) 448 { 449 xcb_generic_iterator_t ret; 450 while(i.rem > 0) 451 xcb_input_device_name_next(&i); 452 ret.data = i.data; 453 ret.rem = i.rem; 454 ret.index = i.index; 455 return ret; 456 } 457 458 int 459 xcb_input_list_input_devices_sizeof (const void *_buffer /**< */) 460 { 461 char *xcb_tmp = (char *)_buffer; 462 const xcb_input_list_input_devices_reply_t *_aux = (xcb_input_list_input_devices_reply_t *)_buffer; 463 unsigned int xcb_buffer_len = 0; 464 unsigned int xcb_block_len = 0; 465 unsigned int xcb_pad = 0; 466 unsigned int xcb_align_to = 0; 467 468 469 xcb_block_len += sizeof(xcb_input_list_input_devices_reply_t); 470 xcb_tmp += xcb_block_len; 471 xcb_buffer_len += xcb_block_len; 472 xcb_block_len = 0; 473 /* devices */ 474 xcb_block_len += _aux->devices_len * sizeof(xcb_input_device_info_t); 475 xcb_tmp += xcb_block_len; 476 xcb_align_to = ALIGNOF(xcb_input_device_info_t); 477 /* insert padding */ 478 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 479 xcb_buffer_len += xcb_block_len + xcb_pad; 480 if (0 != xcb_pad) { 481 xcb_tmp += xcb_pad; 482 xcb_pad = 0; 483 } 484 xcb_block_len = 0; 485 486 return xcb_buffer_len; 487 } 488 489 xcb_input_list_input_devices_cookie_t 490 xcb_input_list_input_devices (xcb_connection_t *c /**< */) 491 { 492 static const xcb_protocol_request_t xcb_req = { 493 /* count */ 2, 494 /* ext */ &xcb_input_id, 495 /* opcode */ XCB_INPUT_LIST_INPUT_DEVICES, 496 /* isvoid */ 0 497 }; 498 499 struct iovec xcb_parts[4]; 500 xcb_input_list_input_devices_cookie_t xcb_ret; 501 xcb_input_list_input_devices_request_t xcb_out; 502 503 504 xcb_parts[2].iov_base = (char *) &xcb_out; 505 xcb_parts[2].iov_len = sizeof(xcb_out); 506 xcb_parts[3].iov_base = 0; 507 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 508 509 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 510 return xcb_ret; 511 } 512 513 xcb_input_list_input_devices_cookie_t 514 xcb_input_list_input_devices_unchecked (xcb_connection_t *c /**< */) 515 { 516 static const xcb_protocol_request_t xcb_req = { 517 /* count */ 2, 518 /* ext */ &xcb_input_id, 519 /* opcode */ XCB_INPUT_LIST_INPUT_DEVICES, 520 /* isvoid */ 0 521 }; 522 523 struct iovec xcb_parts[4]; 524 xcb_input_list_input_devices_cookie_t xcb_ret; 525 xcb_input_list_input_devices_request_t xcb_out; 526 527 528 xcb_parts[2].iov_base = (char *) &xcb_out; 529 xcb_parts[2].iov_len = sizeof(xcb_out); 530 xcb_parts[3].iov_base = 0; 531 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 532 533 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 534 return xcb_ret; 535 } 536 537 xcb_input_device_info_t * 538 xcb_input_list_input_devices_devices (const xcb_input_list_input_devices_reply_t *R /**< */) 539 { 540 return (xcb_input_device_info_t *) (R + 1); 541 } 542 543 int 544 xcb_input_list_input_devices_devices_length (const xcb_input_list_input_devices_reply_t *R /**< */) 545 { 546 return R->devices_len; 547 } 548 549 xcb_input_device_info_iterator_t 550 xcb_input_list_input_devices_devices_iterator (const xcb_input_list_input_devices_reply_t *R /**< */) 551 { 552 xcb_input_device_info_iterator_t i; 553 i.data = (xcb_input_device_info_t *) (R + 1); 554 i.rem = R->devices_len; 555 i.index = (char *) i.data - (char *) R; 556 return i; 557 } 558 559 xcb_input_list_input_devices_reply_t * 560 xcb_input_list_input_devices_reply (xcb_connection_t *c /**< */, 561 xcb_input_list_input_devices_cookie_t cookie /**< */, 562 xcb_generic_error_t **e /**< */) 563 { 564 return (xcb_input_list_input_devices_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 565 } 566 567 void 568 xcb_input_input_class_info_next (xcb_input_input_class_info_iterator_t *i /**< */) 569 { 570 --i->rem; 571 ++i->data; 572 i->index += sizeof(xcb_input_input_class_info_t); 573 } 574 575 xcb_generic_iterator_t 576 xcb_input_input_class_info_end (xcb_input_input_class_info_iterator_t i /**< */) 577 { 578 xcb_generic_iterator_t ret; 579 ret.data = i.data + i.rem; 580 ret.index = i.index + ((char *) ret.data - (char *) i.data); 581 ret.rem = 0; 582 return ret; 583 } 584 585 int 586 xcb_input_open_device_sizeof (const void *_buffer /**< */) 587 { 588 char *xcb_tmp = (char *)_buffer; 589 const xcb_input_open_device_reply_t *_aux = (xcb_input_open_device_reply_t *)_buffer; 590 unsigned int xcb_buffer_len = 0; 591 unsigned int xcb_block_len = 0; 592 unsigned int xcb_pad = 0; 593 unsigned int xcb_align_to = 0; 594 595 596 xcb_block_len += sizeof(xcb_input_open_device_reply_t); 597 xcb_tmp += xcb_block_len; 598 xcb_buffer_len += xcb_block_len; 599 xcb_block_len = 0; 600 /* class_info */ 601 xcb_block_len += _aux->num_classes * sizeof(xcb_input_input_class_info_t); 602 xcb_tmp += xcb_block_len; 603 xcb_align_to = ALIGNOF(xcb_input_input_class_info_t); 604 /* insert padding */ 605 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 606 xcb_buffer_len += xcb_block_len + xcb_pad; 607 if (0 != xcb_pad) { 608 xcb_tmp += xcb_pad; 609 xcb_pad = 0; 610 } 611 xcb_block_len = 0; 612 613 return xcb_buffer_len; 614 } 615 616 xcb_input_open_device_cookie_t 617 xcb_input_open_device (xcb_connection_t *c /**< */, 618 uint8_t device_id /**< */) 619 { 620 static const xcb_protocol_request_t xcb_req = { 621 /* count */ 2, 622 /* ext */ &xcb_input_id, 623 /* opcode */ XCB_INPUT_OPEN_DEVICE, 624 /* isvoid */ 0 625 }; 626 627 struct iovec xcb_parts[4]; 628 xcb_input_open_device_cookie_t xcb_ret; 629 xcb_input_open_device_request_t xcb_out; 630 631 xcb_out.device_id = device_id; 632 memset(xcb_out.pad0, 0, 3); 633 634 xcb_parts[2].iov_base = (char *) &xcb_out; 635 xcb_parts[2].iov_len = sizeof(xcb_out); 636 xcb_parts[3].iov_base = 0; 637 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 638 639 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 640 return xcb_ret; 641 } 642 643 xcb_input_open_device_cookie_t 644 xcb_input_open_device_unchecked (xcb_connection_t *c /**< */, 645 uint8_t device_id /**< */) 646 { 647 static const xcb_protocol_request_t xcb_req = { 648 /* count */ 2, 649 /* ext */ &xcb_input_id, 650 /* opcode */ XCB_INPUT_OPEN_DEVICE, 651 /* isvoid */ 0 652 }; 653 654 struct iovec xcb_parts[4]; 655 xcb_input_open_device_cookie_t xcb_ret; 656 xcb_input_open_device_request_t xcb_out; 657 658 xcb_out.device_id = device_id; 659 memset(xcb_out.pad0, 0, 3); 660 661 xcb_parts[2].iov_base = (char *) &xcb_out; 662 xcb_parts[2].iov_len = sizeof(xcb_out); 663 xcb_parts[3].iov_base = 0; 664 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 665 666 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 667 return xcb_ret; 668 } 669 670 xcb_input_input_class_info_t * 671 xcb_input_open_device_class_info (const xcb_input_open_device_reply_t *R /**< */) 672 { 673 return (xcb_input_input_class_info_t *) (R + 1); 674 } 675 676 int 677 xcb_input_open_device_class_info_length (const xcb_input_open_device_reply_t *R /**< */) 678 { 679 return R->num_classes; 680 } 681 682 xcb_input_input_class_info_iterator_t 683 xcb_input_open_device_class_info_iterator (const xcb_input_open_device_reply_t *R /**< */) 684 { 685 xcb_input_input_class_info_iterator_t i; 686 i.data = (xcb_input_input_class_info_t *) (R + 1); 687 i.rem = R->num_classes; 688 i.index = (char *) i.data - (char *) R; 689 return i; 690 } 691 692 xcb_input_open_device_reply_t * 693 xcb_input_open_device_reply (xcb_connection_t *c /**< */, 694 xcb_input_open_device_cookie_t cookie /**< */, 695 xcb_generic_error_t **e /**< */) 696 { 697 return (xcb_input_open_device_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 698 } 699 700 xcb_void_cookie_t 701 xcb_input_close_device_checked (xcb_connection_t *c /**< */, 702 uint8_t device_id /**< */) 703 { 704 static const xcb_protocol_request_t xcb_req = { 705 /* count */ 2, 706 /* ext */ &xcb_input_id, 707 /* opcode */ XCB_INPUT_CLOSE_DEVICE, 708 /* isvoid */ 1 709 }; 710 711 struct iovec xcb_parts[4]; 712 xcb_void_cookie_t xcb_ret; 713 xcb_input_close_device_request_t xcb_out; 714 715 xcb_out.device_id = device_id; 716 memset(xcb_out.pad0, 0, 3); 717 718 xcb_parts[2].iov_base = (char *) &xcb_out; 719 xcb_parts[2].iov_len = sizeof(xcb_out); 720 xcb_parts[3].iov_base = 0; 721 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 722 723 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 724 return xcb_ret; 725 } 726 727 xcb_void_cookie_t 728 xcb_input_close_device (xcb_connection_t *c /**< */, 729 uint8_t device_id /**< */) 730 { 731 static const xcb_protocol_request_t xcb_req = { 732 /* count */ 2, 733 /* ext */ &xcb_input_id, 734 /* opcode */ XCB_INPUT_CLOSE_DEVICE, 735 /* isvoid */ 1 736 }; 737 738 struct iovec xcb_parts[4]; 739 xcb_void_cookie_t xcb_ret; 740 xcb_input_close_device_request_t xcb_out; 741 742 xcb_out.device_id = device_id; 743 memset(xcb_out.pad0, 0, 3); 744 745 xcb_parts[2].iov_base = (char *) &xcb_out; 746 xcb_parts[2].iov_len = sizeof(xcb_out); 747 xcb_parts[3].iov_base = 0; 748 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 749 750 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 751 return xcb_ret; 752 } 753 754 xcb_input_set_device_mode_cookie_t 755 xcb_input_set_device_mode (xcb_connection_t *c /**< */, 756 uint8_t device_id /**< */, 757 uint8_t mode /**< */) 758 { 759 static const xcb_protocol_request_t xcb_req = { 760 /* count */ 2, 761 /* ext */ &xcb_input_id, 762 /* opcode */ XCB_INPUT_SET_DEVICE_MODE, 763 /* isvoid */ 0 764 }; 765 766 struct iovec xcb_parts[4]; 767 xcb_input_set_device_mode_cookie_t xcb_ret; 768 xcb_input_set_device_mode_request_t xcb_out; 769 770 xcb_out.device_id = device_id; 771 xcb_out.mode = mode; 772 memset(xcb_out.pad0, 0, 2); 773 774 xcb_parts[2].iov_base = (char *) &xcb_out; 775 xcb_parts[2].iov_len = sizeof(xcb_out); 776 xcb_parts[3].iov_base = 0; 777 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 778 779 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 780 return xcb_ret; 781 } 782 783 xcb_input_set_device_mode_cookie_t 784 xcb_input_set_device_mode_unchecked (xcb_connection_t *c /**< */, 785 uint8_t device_id /**< */, 786 uint8_t mode /**< */) 787 { 788 static const xcb_protocol_request_t xcb_req = { 789 /* count */ 2, 790 /* ext */ &xcb_input_id, 791 /* opcode */ XCB_INPUT_SET_DEVICE_MODE, 792 /* isvoid */ 0 793 }; 794 795 struct iovec xcb_parts[4]; 796 xcb_input_set_device_mode_cookie_t xcb_ret; 797 xcb_input_set_device_mode_request_t xcb_out; 798 799 xcb_out.device_id = device_id; 800 xcb_out.mode = mode; 801 memset(xcb_out.pad0, 0, 2); 802 803 xcb_parts[2].iov_base = (char *) &xcb_out; 804 xcb_parts[2].iov_len = sizeof(xcb_out); 805 xcb_parts[3].iov_base = 0; 806 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 807 808 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 809 return xcb_ret; 810 } 811 812 xcb_input_set_device_mode_reply_t * 813 xcb_input_set_device_mode_reply (xcb_connection_t *c /**< */, 814 xcb_input_set_device_mode_cookie_t cookie /**< */, 815 xcb_generic_error_t **e /**< */) 816 { 817 return (xcb_input_set_device_mode_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 818 } 819 820 int 821 xcb_input_select_extension_event_sizeof (const void *_buffer /**< */) 822 { 823 char *xcb_tmp = (char *)_buffer; 824 const xcb_input_select_extension_event_request_t *_aux = (xcb_input_select_extension_event_request_t *)_buffer; 825 unsigned int xcb_buffer_len = 0; 826 unsigned int xcb_block_len = 0; 827 unsigned int xcb_pad = 0; 828 unsigned int xcb_align_to = 0; 829 830 831 xcb_block_len += sizeof(xcb_input_select_extension_event_request_t); 832 xcb_tmp += xcb_block_len; 833 xcb_buffer_len += xcb_block_len; 834 xcb_block_len = 0; 835 /* classes */ 836 xcb_block_len += _aux->num_classes * sizeof(xcb_input_event_class_t); 837 xcb_tmp += xcb_block_len; 838 xcb_align_to = ALIGNOF(xcb_input_event_class_t); 839 /* insert padding */ 840 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 841 xcb_buffer_len += xcb_block_len + xcb_pad; 842 if (0 != xcb_pad) { 843 xcb_tmp += xcb_pad; 844 xcb_pad = 0; 845 } 846 xcb_block_len = 0; 847 848 return xcb_buffer_len; 849 } 850 851 xcb_void_cookie_t 852 xcb_input_select_extension_event_checked (xcb_connection_t *c /**< */, 853 xcb_window_t window /**< */, 854 uint16_t num_classes /**< */, 855 const xcb_input_event_class_t *classes /**< */) 856 { 857 static const xcb_protocol_request_t xcb_req = { 858 /* count */ 4, 859 /* ext */ &xcb_input_id, 860 /* opcode */ XCB_INPUT_SELECT_EXTENSION_EVENT, 861 /* isvoid */ 1 862 }; 863 864 struct iovec xcb_parts[6]; 865 xcb_void_cookie_t xcb_ret; 866 xcb_input_select_extension_event_request_t xcb_out; 867 868 xcb_out.window = window; 869 xcb_out.num_classes = num_classes; 870 memset(xcb_out.pad0, 0, 2); 871 872 xcb_parts[2].iov_base = (char *) &xcb_out; 873 xcb_parts[2].iov_len = sizeof(xcb_out); 874 xcb_parts[3].iov_base = 0; 875 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 876 /* xcb_input_event_class_t classes */ 877 xcb_parts[4].iov_base = (char *) classes; 878 xcb_parts[4].iov_len = num_classes * sizeof(xcb_input_event_class_t); 879 xcb_parts[5].iov_base = 0; 880 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 881 882 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 883 return xcb_ret; 884 } 885 886 xcb_void_cookie_t 887 xcb_input_select_extension_event (xcb_connection_t *c /**< */, 888 xcb_window_t window /**< */, 889 uint16_t num_classes /**< */, 890 const xcb_input_event_class_t *classes /**< */) 891 { 892 static const xcb_protocol_request_t xcb_req = { 893 /* count */ 4, 894 /* ext */ &xcb_input_id, 895 /* opcode */ XCB_INPUT_SELECT_EXTENSION_EVENT, 896 /* isvoid */ 1 897 }; 898 899 struct iovec xcb_parts[6]; 900 xcb_void_cookie_t xcb_ret; 901 xcb_input_select_extension_event_request_t xcb_out; 902 903 xcb_out.window = window; 904 xcb_out.num_classes = num_classes; 905 memset(xcb_out.pad0, 0, 2); 906 907 xcb_parts[2].iov_base = (char *) &xcb_out; 908 xcb_parts[2].iov_len = sizeof(xcb_out); 909 xcb_parts[3].iov_base = 0; 910 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 911 /* xcb_input_event_class_t classes */ 912 xcb_parts[4].iov_base = (char *) classes; 913 xcb_parts[4].iov_len = num_classes * sizeof(xcb_input_event_class_t); 914 xcb_parts[5].iov_base = 0; 915 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 916 917 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 918 return xcb_ret; 919 } 920 921 int 922 xcb_input_get_selected_extension_events_sizeof (const void *_buffer /**< */) 923 { 924 char *xcb_tmp = (char *)_buffer; 925 const xcb_input_get_selected_extension_events_reply_t *_aux = (xcb_input_get_selected_extension_events_reply_t *)_buffer; 926 unsigned int xcb_buffer_len = 0; 927 unsigned int xcb_block_len = 0; 928 unsigned int xcb_pad = 0; 929 unsigned int xcb_align_to = 0; 930 931 932 xcb_block_len += sizeof(xcb_input_get_selected_extension_events_reply_t); 933 xcb_tmp += xcb_block_len; 934 xcb_buffer_len += xcb_block_len; 935 xcb_block_len = 0; 936 /* this_classes */ 937 xcb_block_len += _aux->num_this_classes * sizeof(xcb_input_event_class_t); 938 xcb_tmp += xcb_block_len; 939 xcb_align_to = ALIGNOF(xcb_input_event_class_t); 940 /* insert padding */ 941 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 942 xcb_buffer_len += xcb_block_len + xcb_pad; 943 if (0 != xcb_pad) { 944 xcb_tmp += xcb_pad; 945 xcb_pad = 0; 946 } 947 xcb_block_len = 0; 948 /* all_classes */ 949 xcb_block_len += _aux->num_all_classes * sizeof(xcb_input_event_class_t); 950 xcb_tmp += xcb_block_len; 951 xcb_align_to = ALIGNOF(xcb_input_event_class_t); 952 /* insert padding */ 953 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 954 xcb_buffer_len += xcb_block_len + xcb_pad; 955 if (0 != xcb_pad) { 956 xcb_tmp += xcb_pad; 957 xcb_pad = 0; 958 } 959 xcb_block_len = 0; 960 961 return xcb_buffer_len; 962 } 963 964 xcb_input_get_selected_extension_events_cookie_t 965 xcb_input_get_selected_extension_events (xcb_connection_t *c /**< */, 966 xcb_window_t window /**< */) 967 { 968 static const xcb_protocol_request_t xcb_req = { 969 /* count */ 2, 970 /* ext */ &xcb_input_id, 971 /* opcode */ XCB_INPUT_GET_SELECTED_EXTENSION_EVENTS, 972 /* isvoid */ 0 973 }; 974 975 struct iovec xcb_parts[4]; 976 xcb_input_get_selected_extension_events_cookie_t xcb_ret; 977 xcb_input_get_selected_extension_events_request_t xcb_out; 978 979 xcb_out.window = window; 980 981 xcb_parts[2].iov_base = (char *) &xcb_out; 982 xcb_parts[2].iov_len = sizeof(xcb_out); 983 xcb_parts[3].iov_base = 0; 984 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 985 986 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 987 return xcb_ret; 988 } 989 990 xcb_input_get_selected_extension_events_cookie_t 991 xcb_input_get_selected_extension_events_unchecked (xcb_connection_t *c /**< */, 992 xcb_window_t window /**< */) 993 { 994 static const xcb_protocol_request_t xcb_req = { 995 /* count */ 2, 996 /* ext */ &xcb_input_id, 997 /* opcode */ XCB_INPUT_GET_SELECTED_EXTENSION_EVENTS, 998 /* isvoid */ 0 999 }; 1000 1001 struct iovec xcb_parts[4]; 1002 xcb_input_get_selected_extension_events_cookie_t xcb_ret; 1003 xcb_input_get_selected_extension_events_request_t xcb_out; 1004 1005 xcb_out.window = window; 1006 1007 xcb_parts[2].iov_base = (char *) &xcb_out; 1008 xcb_parts[2].iov_len = sizeof(xcb_out); 1009 xcb_parts[3].iov_base = 0; 1010 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1011 1012 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 1013 return xcb_ret; 1014 } 1015 1016 xcb_input_event_class_t * 1017 xcb_input_get_selected_extension_events_this_classes (const xcb_input_get_selected_extension_events_reply_t *R /**< */) 1018 { 1019 return (xcb_input_event_class_t *) (R + 1); 1020 } 1021 1022 int 1023 xcb_input_get_selected_extension_events_this_classes_length (const xcb_input_get_selected_extension_events_reply_t *R /**< */) 1024 { 1025 return R->num_this_classes; 1026 } 1027 1028 xcb_generic_iterator_t 1029 xcb_input_get_selected_extension_events_this_classes_end (const xcb_input_get_selected_extension_events_reply_t *R /**< */) 1030 { 1031 xcb_generic_iterator_t i; 1032 i.data = ((xcb_input_event_class_t *) (R + 1)) + (R->num_this_classes); 1033 i.rem = 0; 1034 i.index = (char *) i.data - (char *) R; 1035 return i; 1036 } 1037 1038 xcb_input_event_class_t * 1039 xcb_input_get_selected_extension_events_all_classes (const xcb_input_get_selected_extension_events_reply_t *R /**< */) 1040 { 1041 xcb_generic_iterator_t prev = xcb_input_get_selected_extension_events_this_classes_end(R); 1042 return (xcb_input_event_class_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_input_event_class_t, prev.index) + 0); 1043 } 1044 1045 int 1046 xcb_input_get_selected_extension_events_all_classes_length (const xcb_input_get_selected_extension_events_reply_t *R /**< */) 1047 { 1048 return R->num_all_classes; 1049 } 1050 1051 xcb_generic_iterator_t 1052 xcb_input_get_selected_extension_events_all_classes_end (const xcb_input_get_selected_extension_events_reply_t *R /**< */) 1053 { 1054 xcb_generic_iterator_t i; 1055 xcb_generic_iterator_t child = xcb_input_get_selected_extension_events_this_classes_end(R); 1056 i.data = ((xcb_input_event_class_t *) child.data) + (R->num_all_classes); 1057 i.rem = 0; 1058 i.index = (char *) i.data - (char *) R; 1059 return i; 1060 } 1061 1062 xcb_input_get_selected_extension_events_reply_t * 1063 xcb_input_get_selected_extension_events_reply (xcb_connection_t *c /**< */, 1064 xcb_input_get_selected_extension_events_cookie_t cookie /**< */, 1065 xcb_generic_error_t **e /**< */) 1066 { 1067 return (xcb_input_get_selected_extension_events_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 1068 } 1069 1070 int 1071 xcb_input_change_device_dont_propagate_list_sizeof (const void *_buffer /**< */) 1072 { 1073 char *xcb_tmp = (char *)_buffer; 1074 const xcb_input_change_device_dont_propagate_list_request_t *_aux = (xcb_input_change_device_dont_propagate_list_request_t *)_buffer; 1075 unsigned int xcb_buffer_len = 0; 1076 unsigned int xcb_block_len = 0; 1077 unsigned int xcb_pad = 0; 1078 unsigned int xcb_align_to = 0; 1079 1080 1081 xcb_block_len += sizeof(xcb_input_change_device_dont_propagate_list_request_t); 1082 xcb_tmp += xcb_block_len; 1083 xcb_buffer_len += xcb_block_len; 1084 xcb_block_len = 0; 1085 /* classes */ 1086 xcb_block_len += _aux->num_classes * sizeof(xcb_input_event_class_t); 1087 xcb_tmp += xcb_block_len; 1088 xcb_align_to = ALIGNOF(xcb_input_event_class_t); 1089 /* insert padding */ 1090 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 1091 xcb_buffer_len += xcb_block_len + xcb_pad; 1092 if (0 != xcb_pad) { 1093 xcb_tmp += xcb_pad; 1094 xcb_pad = 0; 1095 } 1096 xcb_block_len = 0; 1097 1098 return xcb_buffer_len; 1099 } 1100 1101 xcb_void_cookie_t 1102 xcb_input_change_device_dont_propagate_list_checked (xcb_connection_t *c /**< */, 1103 xcb_window_t window /**< */, 1104 uint16_t num_classes /**< */, 1105 uint8_t mode /**< */, 1106 const xcb_input_event_class_t *classes /**< */) 1107 { 1108 static const xcb_protocol_request_t xcb_req = { 1109 /* count */ 4, 1110 /* ext */ &xcb_input_id, 1111 /* opcode */ XCB_INPUT_CHANGE_DEVICE_DONT_PROPAGATE_LIST, 1112 /* isvoid */ 1 1113 }; 1114 1115 struct iovec xcb_parts[6]; 1116 xcb_void_cookie_t xcb_ret; 1117 xcb_input_change_device_dont_propagate_list_request_t xcb_out; 1118 1119 xcb_out.window = window; 1120 xcb_out.num_classes = num_classes; 1121 xcb_out.mode = mode; 1122 xcb_out.pad0 = 0; 1123 1124 xcb_parts[2].iov_base = (char *) &xcb_out; 1125 xcb_parts[2].iov_len = sizeof(xcb_out); 1126 xcb_parts[3].iov_base = 0; 1127 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1128 /* xcb_input_event_class_t classes */ 1129 xcb_parts[4].iov_base = (char *) classes; 1130 xcb_parts[4].iov_len = num_classes * sizeof(xcb_input_event_class_t); 1131 xcb_parts[5].iov_base = 0; 1132 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 1133 1134 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 1135 return xcb_ret; 1136 } 1137 1138 xcb_void_cookie_t 1139 xcb_input_change_device_dont_propagate_list (xcb_connection_t *c /**< */, 1140 xcb_window_t window /**< */, 1141 uint16_t num_classes /**< */, 1142 uint8_t mode /**< */, 1143 const xcb_input_event_class_t *classes /**< */) 1144 { 1145 static const xcb_protocol_request_t xcb_req = { 1146 /* count */ 4, 1147 /* ext */ &xcb_input_id, 1148 /* opcode */ XCB_INPUT_CHANGE_DEVICE_DONT_PROPAGATE_LIST, 1149 /* isvoid */ 1 1150 }; 1151 1152 struct iovec xcb_parts[6]; 1153 xcb_void_cookie_t xcb_ret; 1154 xcb_input_change_device_dont_propagate_list_request_t xcb_out; 1155 1156 xcb_out.window = window; 1157 xcb_out.num_classes = num_classes; 1158 xcb_out.mode = mode; 1159 xcb_out.pad0 = 0; 1160 1161 xcb_parts[2].iov_base = (char *) &xcb_out; 1162 xcb_parts[2].iov_len = sizeof(xcb_out); 1163 xcb_parts[3].iov_base = 0; 1164 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1165 /* xcb_input_event_class_t classes */ 1166 xcb_parts[4].iov_base = (char *) classes; 1167 xcb_parts[4].iov_len = num_classes * sizeof(xcb_input_event_class_t); 1168 xcb_parts[5].iov_base = 0; 1169 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 1170 1171 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 1172 return xcb_ret; 1173 } 1174 1175 int 1176 xcb_input_get_device_dont_propagate_list_sizeof (const void *_buffer /**< */) 1177 { 1178 char *xcb_tmp = (char *)_buffer; 1179 const xcb_input_get_device_dont_propagate_list_reply_t *_aux = (xcb_input_get_device_dont_propagate_list_reply_t *)_buffer; 1180 unsigned int xcb_buffer_len = 0; 1181 unsigned int xcb_block_len = 0; 1182 unsigned int xcb_pad = 0; 1183 unsigned int xcb_align_to = 0; 1184 1185 1186 xcb_block_len += sizeof(xcb_input_get_device_dont_propagate_list_reply_t); 1187 xcb_tmp += xcb_block_len; 1188 xcb_buffer_len += xcb_block_len; 1189 xcb_block_len = 0; 1190 /* classes */ 1191 xcb_block_len += _aux->num_classes * sizeof(xcb_input_event_class_t); 1192 xcb_tmp += xcb_block_len; 1193 xcb_align_to = ALIGNOF(xcb_input_event_class_t); 1194 /* insert padding */ 1195 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 1196 xcb_buffer_len += xcb_block_len + xcb_pad; 1197 if (0 != xcb_pad) { 1198 xcb_tmp += xcb_pad; 1199 xcb_pad = 0; 1200 } 1201 xcb_block_len = 0; 1202 1203 return xcb_buffer_len; 1204 } 1205 1206 xcb_input_get_device_dont_propagate_list_cookie_t 1207 xcb_input_get_device_dont_propagate_list (xcb_connection_t *c /**< */, 1208 xcb_window_t window /**< */) 1209 { 1210 static const xcb_protocol_request_t xcb_req = { 1211 /* count */ 2, 1212 /* ext */ &xcb_input_id, 1213 /* opcode */ XCB_INPUT_GET_DEVICE_DONT_PROPAGATE_LIST, 1214 /* isvoid */ 0 1215 }; 1216 1217 struct iovec xcb_parts[4]; 1218 xcb_input_get_device_dont_propagate_list_cookie_t xcb_ret; 1219 xcb_input_get_device_dont_propagate_list_request_t xcb_out; 1220 1221 xcb_out.window = window; 1222 1223 xcb_parts[2].iov_base = (char *) &xcb_out; 1224 xcb_parts[2].iov_len = sizeof(xcb_out); 1225 xcb_parts[3].iov_base = 0; 1226 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1227 1228 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 1229 return xcb_ret; 1230 } 1231 1232 xcb_input_get_device_dont_propagate_list_cookie_t 1233 xcb_input_get_device_dont_propagate_list_unchecked (xcb_connection_t *c /**< */, 1234 xcb_window_t window /**< */) 1235 { 1236 static const xcb_protocol_request_t xcb_req = { 1237 /* count */ 2, 1238 /* ext */ &xcb_input_id, 1239 /* opcode */ XCB_INPUT_GET_DEVICE_DONT_PROPAGATE_LIST, 1240 /* isvoid */ 0 1241 }; 1242 1243 struct iovec xcb_parts[4]; 1244 xcb_input_get_device_dont_propagate_list_cookie_t xcb_ret; 1245 xcb_input_get_device_dont_propagate_list_request_t xcb_out; 1246 1247 xcb_out.window = window; 1248 1249 xcb_parts[2].iov_base = (char *) &xcb_out; 1250 xcb_parts[2].iov_len = sizeof(xcb_out); 1251 xcb_parts[3].iov_base = 0; 1252 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1253 1254 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 1255 return xcb_ret; 1256 } 1257 1258 xcb_input_event_class_t * 1259 xcb_input_get_device_dont_propagate_list_classes (const xcb_input_get_device_dont_propagate_list_reply_t *R /**< */) 1260 { 1261 return (xcb_input_event_class_t *) (R + 1); 1262 } 1263 1264 int 1265 xcb_input_get_device_dont_propagate_list_classes_length (const xcb_input_get_device_dont_propagate_list_reply_t *R /**< */) 1266 { 1267 return R->num_classes; 1268 } 1269 1270 xcb_generic_iterator_t 1271 xcb_input_get_device_dont_propagate_list_classes_end (const xcb_input_get_device_dont_propagate_list_reply_t *R /**< */) 1272 { 1273 xcb_generic_iterator_t i; 1274 i.data = ((xcb_input_event_class_t *) (R + 1)) + (R->num_classes); 1275 i.rem = 0; 1276 i.index = (char *) i.data - (char *) R; 1277 return i; 1278 } 1279 1280 xcb_input_get_device_dont_propagate_list_reply_t * 1281 xcb_input_get_device_dont_propagate_list_reply (xcb_connection_t *c /**< */, 1282 xcb_input_get_device_dont_propagate_list_cookie_t cookie /**< */, 1283 xcb_generic_error_t **e /**< */) 1284 { 1285 return (xcb_input_get_device_dont_propagate_list_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 1286 } 1287 1288 void 1289 xcb_input_device_time_coord_next (xcb_input_device_time_coord_iterator_t *i /**< */) 1290 { 1291 --i->rem; 1292 ++i->data; 1293 i->index += sizeof(xcb_input_device_time_coord_t); 1294 } 1295 1296 xcb_generic_iterator_t 1297 xcb_input_device_time_coord_end (xcb_input_device_time_coord_iterator_t i /**< */) 1298 { 1299 xcb_generic_iterator_t ret; 1300 ret.data = i.data + i.rem; 1301 ret.index = i.index + ((char *) ret.data - (char *) i.data); 1302 ret.rem = 0; 1303 return ret; 1304 } 1305 1306 xcb_input_get_device_motion_events_cookie_t 1307 xcb_input_get_device_motion_events (xcb_connection_t *c /**< */, 1308 xcb_timestamp_t start /**< */, 1309 xcb_timestamp_t stop /**< */, 1310 uint8_t device_id /**< */) 1311 { 1312 static const xcb_protocol_request_t xcb_req = { 1313 /* count */ 2, 1314 /* ext */ &xcb_input_id, 1315 /* opcode */ XCB_INPUT_GET_DEVICE_MOTION_EVENTS, 1316 /* isvoid */ 0 1317 }; 1318 1319 struct iovec xcb_parts[4]; 1320 xcb_input_get_device_motion_events_cookie_t xcb_ret; 1321 xcb_input_get_device_motion_events_request_t xcb_out; 1322 1323 xcb_out.start = start; 1324 xcb_out.stop = stop; 1325 xcb_out.device_id = device_id; 1326 1327 xcb_parts[2].iov_base = (char *) &xcb_out; 1328 xcb_parts[2].iov_len = sizeof(xcb_out); 1329 xcb_parts[3].iov_base = 0; 1330 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1331 1332 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 1333 return xcb_ret; 1334 } 1335 1336 xcb_input_get_device_motion_events_cookie_t 1337 xcb_input_get_device_motion_events_unchecked (xcb_connection_t *c /**< */, 1338 xcb_timestamp_t start /**< */, 1339 xcb_timestamp_t stop /**< */, 1340 uint8_t device_id /**< */) 1341 { 1342 static const xcb_protocol_request_t xcb_req = { 1343 /* count */ 2, 1344 /* ext */ &xcb_input_id, 1345 /* opcode */ XCB_INPUT_GET_DEVICE_MOTION_EVENTS, 1346 /* isvoid */ 0 1347 }; 1348 1349 struct iovec xcb_parts[4]; 1350 xcb_input_get_device_motion_events_cookie_t xcb_ret; 1351 xcb_input_get_device_motion_events_request_t xcb_out; 1352 1353 xcb_out.start = start; 1354 xcb_out.stop = stop; 1355 xcb_out.device_id = device_id; 1356 1357 xcb_parts[2].iov_base = (char *) &xcb_out; 1358 xcb_parts[2].iov_len = sizeof(xcb_out); 1359 xcb_parts[3].iov_base = 0; 1360 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1361 1362 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 1363 return xcb_ret; 1364 } 1365 1366 xcb_input_get_device_motion_events_reply_t * 1367 xcb_input_get_device_motion_events_reply (xcb_connection_t *c /**< */, 1368 xcb_input_get_device_motion_events_cookie_t cookie /**< */, 1369 xcb_generic_error_t **e /**< */) 1370 { 1371 return (xcb_input_get_device_motion_events_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 1372 } 1373 1374 xcb_input_change_keyboard_device_cookie_t 1375 xcb_input_change_keyboard_device (xcb_connection_t *c /**< */, 1376 uint8_t device_id /**< */) 1377 { 1378 static const xcb_protocol_request_t xcb_req = { 1379 /* count */ 2, 1380 /* ext */ &xcb_input_id, 1381 /* opcode */ XCB_INPUT_CHANGE_KEYBOARD_DEVICE, 1382 /* isvoid */ 0 1383 }; 1384 1385 struct iovec xcb_parts[4]; 1386 xcb_input_change_keyboard_device_cookie_t xcb_ret; 1387 xcb_input_change_keyboard_device_request_t xcb_out; 1388 1389 xcb_out.device_id = device_id; 1390 memset(xcb_out.pad0, 0, 3); 1391 1392 xcb_parts[2].iov_base = (char *) &xcb_out; 1393 xcb_parts[2].iov_len = sizeof(xcb_out); 1394 xcb_parts[3].iov_base = 0; 1395 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1396 1397 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 1398 return xcb_ret; 1399 } 1400 1401 xcb_input_change_keyboard_device_cookie_t 1402 xcb_input_change_keyboard_device_unchecked (xcb_connection_t *c /**< */, 1403 uint8_t device_id /**< */) 1404 { 1405 static const xcb_protocol_request_t xcb_req = { 1406 /* count */ 2, 1407 /* ext */ &xcb_input_id, 1408 /* opcode */ XCB_INPUT_CHANGE_KEYBOARD_DEVICE, 1409 /* isvoid */ 0 1410 }; 1411 1412 struct iovec xcb_parts[4]; 1413 xcb_input_change_keyboard_device_cookie_t xcb_ret; 1414 xcb_input_change_keyboard_device_request_t xcb_out; 1415 1416 xcb_out.device_id = device_id; 1417 memset(xcb_out.pad0, 0, 3); 1418 1419 xcb_parts[2].iov_base = (char *) &xcb_out; 1420 xcb_parts[2].iov_len = sizeof(xcb_out); 1421 xcb_parts[3].iov_base = 0; 1422 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1423 1424 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 1425 return xcb_ret; 1426 } 1427 1428 xcb_input_change_keyboard_device_reply_t * 1429 xcb_input_change_keyboard_device_reply (xcb_connection_t *c /**< */, 1430 xcb_input_change_keyboard_device_cookie_t cookie /**< */, 1431 xcb_generic_error_t **e /**< */) 1432 { 1433 return (xcb_input_change_keyboard_device_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 1434 } 1435 1436 xcb_input_change_pointer_device_cookie_t 1437 xcb_input_change_pointer_device (xcb_connection_t *c /**< */, 1438 uint8_t x_axis /**< */, 1439 uint8_t y_axis /**< */, 1440 uint8_t device_id /**< */) 1441 { 1442 static const xcb_protocol_request_t xcb_req = { 1443 /* count */ 2, 1444 /* ext */ &xcb_input_id, 1445 /* opcode */ XCB_INPUT_CHANGE_POINTER_DEVICE, 1446 /* isvoid */ 0 1447 }; 1448 1449 struct iovec xcb_parts[4]; 1450 xcb_input_change_pointer_device_cookie_t xcb_ret; 1451 xcb_input_change_pointer_device_request_t xcb_out; 1452 1453 xcb_out.x_axis = x_axis; 1454 xcb_out.y_axis = y_axis; 1455 xcb_out.device_id = device_id; 1456 xcb_out.pad0 = 0; 1457 1458 xcb_parts[2].iov_base = (char *) &xcb_out; 1459 xcb_parts[2].iov_len = sizeof(xcb_out); 1460 xcb_parts[3].iov_base = 0; 1461 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1462 1463 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 1464 return xcb_ret; 1465 } 1466 1467 xcb_input_change_pointer_device_cookie_t 1468 xcb_input_change_pointer_device_unchecked (xcb_connection_t *c /**< */, 1469 uint8_t x_axis /**< */, 1470 uint8_t y_axis /**< */, 1471 uint8_t device_id /**< */) 1472 { 1473 static const xcb_protocol_request_t xcb_req = { 1474 /* count */ 2, 1475 /* ext */ &xcb_input_id, 1476 /* opcode */ XCB_INPUT_CHANGE_POINTER_DEVICE, 1477 /* isvoid */ 0 1478 }; 1479 1480 struct iovec xcb_parts[4]; 1481 xcb_input_change_pointer_device_cookie_t xcb_ret; 1482 xcb_input_change_pointer_device_request_t xcb_out; 1483 1484 xcb_out.x_axis = x_axis; 1485 xcb_out.y_axis = y_axis; 1486 xcb_out.device_id = device_id; 1487 xcb_out.pad0 = 0; 1488 1489 xcb_parts[2].iov_base = (char *) &xcb_out; 1490 xcb_parts[2].iov_len = sizeof(xcb_out); 1491 xcb_parts[3].iov_base = 0; 1492 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1493 1494 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 1495 return xcb_ret; 1496 } 1497 1498 xcb_input_change_pointer_device_reply_t * 1499 xcb_input_change_pointer_device_reply (xcb_connection_t *c /**< */, 1500 xcb_input_change_pointer_device_cookie_t cookie /**< */, 1501 xcb_generic_error_t **e /**< */) 1502 { 1503 return (xcb_input_change_pointer_device_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 1504 } 1505 1506 int 1507 xcb_input_grab_device_sizeof (const void *_buffer /**< */) 1508 { 1509 char *xcb_tmp = (char *)_buffer; 1510 const xcb_input_grab_device_request_t *_aux = (xcb_input_grab_device_request_t *)_buffer; 1511 unsigned int xcb_buffer_len = 0; 1512 unsigned int xcb_block_len = 0; 1513 unsigned int xcb_pad = 0; 1514 unsigned int xcb_align_to = 0; 1515 1516 1517 xcb_block_len += sizeof(xcb_input_grab_device_request_t); 1518 xcb_tmp += xcb_block_len; 1519 xcb_buffer_len += xcb_block_len; 1520 xcb_block_len = 0; 1521 /* classes */ 1522 xcb_block_len += _aux->num_classes * sizeof(xcb_input_event_class_t); 1523 xcb_tmp += xcb_block_len; 1524 xcb_align_to = ALIGNOF(xcb_input_event_class_t); 1525 /* insert padding */ 1526 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 1527 xcb_buffer_len += xcb_block_len + xcb_pad; 1528 if (0 != xcb_pad) { 1529 xcb_tmp += xcb_pad; 1530 xcb_pad = 0; 1531 } 1532 xcb_block_len = 0; 1533 1534 return xcb_buffer_len; 1535 } 1536 1537 xcb_input_grab_device_cookie_t 1538 xcb_input_grab_device (xcb_connection_t *c /**< */, 1539 xcb_window_t grab_window /**< */, 1540 xcb_timestamp_t time /**< */, 1541 uint16_t num_classes /**< */, 1542 uint8_t this_device_mode /**< */, 1543 uint8_t other_device_mode /**< */, 1544 uint8_t owner_events /**< */, 1545 uint8_t device_id /**< */, 1546 const xcb_input_event_class_t *classes /**< */) 1547 { 1548 static const xcb_protocol_request_t xcb_req = { 1549 /* count */ 4, 1550 /* ext */ &xcb_input_id, 1551 /* opcode */ XCB_INPUT_GRAB_DEVICE, 1552 /* isvoid */ 0 1553 }; 1554 1555 struct iovec xcb_parts[6]; 1556 xcb_input_grab_device_cookie_t xcb_ret; 1557 xcb_input_grab_device_request_t xcb_out; 1558 1559 xcb_out.grab_window = grab_window; 1560 xcb_out.time = time; 1561 xcb_out.num_classes = num_classes; 1562 xcb_out.this_device_mode = this_device_mode; 1563 xcb_out.other_device_mode = other_device_mode; 1564 xcb_out.owner_events = owner_events; 1565 xcb_out.device_id = device_id; 1566 memset(xcb_out.pad0, 0, 2); 1567 1568 xcb_parts[2].iov_base = (char *) &xcb_out; 1569 xcb_parts[2].iov_len = sizeof(xcb_out); 1570 xcb_parts[3].iov_base = 0; 1571 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1572 /* xcb_input_event_class_t classes */ 1573 xcb_parts[4].iov_base = (char *) classes; 1574 xcb_parts[4].iov_len = num_classes * sizeof(uint32_t); 1575 xcb_parts[5].iov_base = 0; 1576 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 1577 1578 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 1579 return xcb_ret; 1580 } 1581 1582 xcb_input_grab_device_cookie_t 1583 xcb_input_grab_device_unchecked (xcb_connection_t *c /**< */, 1584 xcb_window_t grab_window /**< */, 1585 xcb_timestamp_t time /**< */, 1586 uint16_t num_classes /**< */, 1587 uint8_t this_device_mode /**< */, 1588 uint8_t other_device_mode /**< */, 1589 uint8_t owner_events /**< */, 1590 uint8_t device_id /**< */, 1591 const xcb_input_event_class_t *classes /**< */) 1592 { 1593 static const xcb_protocol_request_t xcb_req = { 1594 /* count */ 4, 1595 /* ext */ &xcb_input_id, 1596 /* opcode */ XCB_INPUT_GRAB_DEVICE, 1597 /* isvoid */ 0 1598 }; 1599 1600 struct iovec xcb_parts[6]; 1601 xcb_input_grab_device_cookie_t xcb_ret; 1602 xcb_input_grab_device_request_t xcb_out; 1603 1604 xcb_out.grab_window = grab_window; 1605 xcb_out.time = time; 1606 xcb_out.num_classes = num_classes; 1607 xcb_out.this_device_mode = this_device_mode; 1608 xcb_out.other_device_mode = other_device_mode; 1609 xcb_out.owner_events = owner_events; 1610 xcb_out.device_id = device_id; 1611 memset(xcb_out.pad0, 0, 2); 1612 1613 xcb_parts[2].iov_base = (char *) &xcb_out; 1614 xcb_parts[2].iov_len = sizeof(xcb_out); 1615 xcb_parts[3].iov_base = 0; 1616 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1617 /* xcb_input_event_class_t classes */ 1618 xcb_parts[4].iov_base = (char *) classes; 1619 xcb_parts[4].iov_len = num_classes * sizeof(uint32_t); 1620 xcb_parts[5].iov_base = 0; 1621 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 1622 1623 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 1624 return xcb_ret; 1625 } 1626 1627 xcb_input_grab_device_reply_t * 1628 xcb_input_grab_device_reply (xcb_connection_t *c /**< */, 1629 xcb_input_grab_device_cookie_t cookie /**< */, 1630 xcb_generic_error_t **e /**< */) 1631 { 1632 return (xcb_input_grab_device_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 1633 } 1634 1635 xcb_void_cookie_t 1636 xcb_input_ungrab_device_checked (xcb_connection_t *c /**< */, 1637 xcb_timestamp_t time /**< */, 1638 uint8_t device_id /**< */) 1639 { 1640 static const xcb_protocol_request_t xcb_req = { 1641 /* count */ 2, 1642 /* ext */ &xcb_input_id, 1643 /* opcode */ XCB_INPUT_UNGRAB_DEVICE, 1644 /* isvoid */ 1 1645 }; 1646 1647 struct iovec xcb_parts[4]; 1648 xcb_void_cookie_t xcb_ret; 1649 xcb_input_ungrab_device_request_t xcb_out; 1650 1651 xcb_out.time = time; 1652 xcb_out.device_id = device_id; 1653 1654 xcb_parts[2].iov_base = (char *) &xcb_out; 1655 xcb_parts[2].iov_len = sizeof(xcb_out); 1656 xcb_parts[3].iov_base = 0; 1657 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1658 1659 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 1660 return xcb_ret; 1661 } 1662 1663 xcb_void_cookie_t 1664 xcb_input_ungrab_device (xcb_connection_t *c /**< */, 1665 xcb_timestamp_t time /**< */, 1666 uint8_t device_id /**< */) 1667 { 1668 static const xcb_protocol_request_t xcb_req = { 1669 /* count */ 2, 1670 /* ext */ &xcb_input_id, 1671 /* opcode */ XCB_INPUT_UNGRAB_DEVICE, 1672 /* isvoid */ 1 1673 }; 1674 1675 struct iovec xcb_parts[4]; 1676 xcb_void_cookie_t xcb_ret; 1677 xcb_input_ungrab_device_request_t xcb_out; 1678 1679 xcb_out.time = time; 1680 xcb_out.device_id = device_id; 1681 1682 xcb_parts[2].iov_base = (char *) &xcb_out; 1683 xcb_parts[2].iov_len = sizeof(xcb_out); 1684 xcb_parts[3].iov_base = 0; 1685 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1686 1687 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 1688 return xcb_ret; 1689 } 1690 1691 int 1692 xcb_input_grab_device_key_sizeof (const void *_buffer /**< */) 1693 { 1694 char *xcb_tmp = (char *)_buffer; 1695 const xcb_input_grab_device_key_request_t *_aux = (xcb_input_grab_device_key_request_t *)_buffer; 1696 unsigned int xcb_buffer_len = 0; 1697 unsigned int xcb_block_len = 0; 1698 unsigned int xcb_pad = 0; 1699 unsigned int xcb_align_to = 0; 1700 1701 1702 xcb_block_len += sizeof(xcb_input_grab_device_key_request_t); 1703 xcb_tmp += xcb_block_len; 1704 xcb_buffer_len += xcb_block_len; 1705 xcb_block_len = 0; 1706 /* classes */ 1707 xcb_block_len += _aux->num_classes * sizeof(xcb_input_event_class_t); 1708 xcb_tmp += xcb_block_len; 1709 xcb_align_to = ALIGNOF(xcb_input_event_class_t); 1710 /* insert padding */ 1711 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 1712 xcb_buffer_len += xcb_block_len + xcb_pad; 1713 if (0 != xcb_pad) { 1714 xcb_tmp += xcb_pad; 1715 xcb_pad = 0; 1716 } 1717 xcb_block_len = 0; 1718 1719 return xcb_buffer_len; 1720 } 1721 1722 xcb_void_cookie_t 1723 xcb_input_grab_device_key_checked (xcb_connection_t *c /**< */, 1724 xcb_window_t grab_window /**< */, 1725 uint16_t num_classes /**< */, 1726 uint16_t modifiers /**< */, 1727 uint8_t modifier_device /**< */, 1728 uint8_t grabbed_device /**< */, 1729 uint8_t key /**< */, 1730 uint8_t this_device_mode /**< */, 1731 uint8_t other_device_mode /**< */, 1732 uint8_t owner_events /**< */, 1733 const xcb_input_event_class_t *classes /**< */) 1734 { 1735 static const xcb_protocol_request_t xcb_req = { 1736 /* count */ 4, 1737 /* ext */ &xcb_input_id, 1738 /* opcode */ XCB_INPUT_GRAB_DEVICE_KEY, 1739 /* isvoid */ 1 1740 }; 1741 1742 struct iovec xcb_parts[6]; 1743 xcb_void_cookie_t xcb_ret; 1744 xcb_input_grab_device_key_request_t xcb_out; 1745 1746 xcb_out.grab_window = grab_window; 1747 xcb_out.num_classes = num_classes; 1748 xcb_out.modifiers = modifiers; 1749 xcb_out.modifier_device = modifier_device; 1750 xcb_out.grabbed_device = grabbed_device; 1751 xcb_out.key = key; 1752 xcb_out.this_device_mode = this_device_mode; 1753 xcb_out.other_device_mode = other_device_mode; 1754 xcb_out.owner_events = owner_events; 1755 memset(xcb_out.pad0, 0, 2); 1756 1757 xcb_parts[2].iov_base = (char *) &xcb_out; 1758 xcb_parts[2].iov_len = sizeof(xcb_out); 1759 xcb_parts[3].iov_base = 0; 1760 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1761 /* xcb_input_event_class_t classes */ 1762 xcb_parts[4].iov_base = (char *) classes; 1763 xcb_parts[4].iov_len = num_classes * sizeof(xcb_input_event_class_t); 1764 xcb_parts[5].iov_base = 0; 1765 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 1766 1767 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 1768 return xcb_ret; 1769 } 1770 1771 xcb_void_cookie_t 1772 xcb_input_grab_device_key (xcb_connection_t *c /**< */, 1773 xcb_window_t grab_window /**< */, 1774 uint16_t num_classes /**< */, 1775 uint16_t modifiers /**< */, 1776 uint8_t modifier_device /**< */, 1777 uint8_t grabbed_device /**< */, 1778 uint8_t key /**< */, 1779 uint8_t this_device_mode /**< */, 1780 uint8_t other_device_mode /**< */, 1781 uint8_t owner_events /**< */, 1782 const xcb_input_event_class_t *classes /**< */) 1783 { 1784 static const xcb_protocol_request_t xcb_req = { 1785 /* count */ 4, 1786 /* ext */ &xcb_input_id, 1787 /* opcode */ XCB_INPUT_GRAB_DEVICE_KEY, 1788 /* isvoid */ 1 1789 }; 1790 1791 struct iovec xcb_parts[6]; 1792 xcb_void_cookie_t xcb_ret; 1793 xcb_input_grab_device_key_request_t xcb_out; 1794 1795 xcb_out.grab_window = grab_window; 1796 xcb_out.num_classes = num_classes; 1797 xcb_out.modifiers = modifiers; 1798 xcb_out.modifier_device = modifier_device; 1799 xcb_out.grabbed_device = grabbed_device; 1800 xcb_out.key = key; 1801 xcb_out.this_device_mode = this_device_mode; 1802 xcb_out.other_device_mode = other_device_mode; 1803 xcb_out.owner_events = owner_events; 1804 memset(xcb_out.pad0, 0, 2); 1805 1806 xcb_parts[2].iov_base = (char *) &xcb_out; 1807 xcb_parts[2].iov_len = sizeof(xcb_out); 1808 xcb_parts[3].iov_base = 0; 1809 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1810 /* xcb_input_event_class_t classes */ 1811 xcb_parts[4].iov_base = (char *) classes; 1812 xcb_parts[4].iov_len = num_classes * sizeof(xcb_input_event_class_t); 1813 xcb_parts[5].iov_base = 0; 1814 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 1815 1816 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 1817 return xcb_ret; 1818 } 1819 1820 xcb_void_cookie_t 1821 xcb_input_ungrab_device_key_checked (xcb_connection_t *c /**< */, 1822 xcb_window_t grabWindow /**< */, 1823 uint16_t modifiers /**< */, 1824 uint8_t modifier_device /**< */, 1825 uint8_t key /**< */, 1826 uint8_t grabbed_device /**< */) 1827 { 1828 static const xcb_protocol_request_t xcb_req = { 1829 /* count */ 2, 1830 /* ext */ &xcb_input_id, 1831 /* opcode */ XCB_INPUT_UNGRAB_DEVICE_KEY, 1832 /* isvoid */ 1 1833 }; 1834 1835 struct iovec xcb_parts[4]; 1836 xcb_void_cookie_t xcb_ret; 1837 xcb_input_ungrab_device_key_request_t xcb_out; 1838 1839 xcb_out.grabWindow = grabWindow; 1840 xcb_out.modifiers = modifiers; 1841 xcb_out.modifier_device = modifier_device; 1842 xcb_out.key = key; 1843 xcb_out.grabbed_device = grabbed_device; 1844 1845 xcb_parts[2].iov_base = (char *) &xcb_out; 1846 xcb_parts[2].iov_len = sizeof(xcb_out); 1847 xcb_parts[3].iov_base = 0; 1848 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1849 1850 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 1851 return xcb_ret; 1852 } 1853 1854 xcb_void_cookie_t 1855 xcb_input_ungrab_device_key (xcb_connection_t *c /**< */, 1856 xcb_window_t grabWindow /**< */, 1857 uint16_t modifiers /**< */, 1858 uint8_t modifier_device /**< */, 1859 uint8_t key /**< */, 1860 uint8_t grabbed_device /**< */) 1861 { 1862 static const xcb_protocol_request_t xcb_req = { 1863 /* count */ 2, 1864 /* ext */ &xcb_input_id, 1865 /* opcode */ XCB_INPUT_UNGRAB_DEVICE_KEY, 1866 /* isvoid */ 1 1867 }; 1868 1869 struct iovec xcb_parts[4]; 1870 xcb_void_cookie_t xcb_ret; 1871 xcb_input_ungrab_device_key_request_t xcb_out; 1872 1873 xcb_out.grabWindow = grabWindow; 1874 xcb_out.modifiers = modifiers; 1875 xcb_out.modifier_device = modifier_device; 1876 xcb_out.key = key; 1877 xcb_out.grabbed_device = grabbed_device; 1878 1879 xcb_parts[2].iov_base = (char *) &xcb_out; 1880 xcb_parts[2].iov_len = sizeof(xcb_out); 1881 xcb_parts[3].iov_base = 0; 1882 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1883 1884 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 1885 return xcb_ret; 1886 } 1887 1888 int 1889 xcb_input_grab_device_button_sizeof (const void *_buffer /**< */) 1890 { 1891 char *xcb_tmp = (char *)_buffer; 1892 const xcb_input_grab_device_button_request_t *_aux = (xcb_input_grab_device_button_request_t *)_buffer; 1893 unsigned int xcb_buffer_len = 0; 1894 unsigned int xcb_block_len = 0; 1895 unsigned int xcb_pad = 0; 1896 unsigned int xcb_align_to = 0; 1897 1898 1899 xcb_block_len += sizeof(xcb_input_grab_device_button_request_t); 1900 xcb_tmp += xcb_block_len; 1901 xcb_buffer_len += xcb_block_len; 1902 xcb_block_len = 0; 1903 /* classes */ 1904 xcb_block_len += _aux->num_classes * sizeof(xcb_input_event_class_t); 1905 xcb_tmp += xcb_block_len; 1906 xcb_align_to = ALIGNOF(xcb_input_event_class_t); 1907 /* insert padding */ 1908 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 1909 xcb_buffer_len += xcb_block_len + xcb_pad; 1910 if (0 != xcb_pad) { 1911 xcb_tmp += xcb_pad; 1912 xcb_pad = 0; 1913 } 1914 xcb_block_len = 0; 1915 1916 return xcb_buffer_len; 1917 } 1918 1919 xcb_void_cookie_t 1920 xcb_input_grab_device_button_checked (xcb_connection_t *c /**< */, 1921 xcb_window_t grab_window /**< */, 1922 uint8_t grabbed_device /**< */, 1923 uint8_t modifier_device /**< */, 1924 uint16_t num_classes /**< */, 1925 uint16_t modifiers /**< */, 1926 uint8_t this_device_mode /**< */, 1927 uint8_t other_device_mode /**< */, 1928 uint8_t button /**< */, 1929 uint8_t owner_events /**< */, 1930 const xcb_input_event_class_t *classes /**< */) 1931 { 1932 static const xcb_protocol_request_t xcb_req = { 1933 /* count */ 4, 1934 /* ext */ &xcb_input_id, 1935 /* opcode */ XCB_INPUT_GRAB_DEVICE_BUTTON, 1936 /* isvoid */ 1 1937 }; 1938 1939 struct iovec xcb_parts[6]; 1940 xcb_void_cookie_t xcb_ret; 1941 xcb_input_grab_device_button_request_t xcb_out; 1942 1943 xcb_out.grab_window = grab_window; 1944 xcb_out.grabbed_device = grabbed_device; 1945 xcb_out.modifier_device = modifier_device; 1946 xcb_out.num_classes = num_classes; 1947 xcb_out.modifiers = modifiers; 1948 xcb_out.this_device_mode = this_device_mode; 1949 xcb_out.other_device_mode = other_device_mode; 1950 xcb_out.button = button; 1951 xcb_out.owner_events = owner_events; 1952 memset(xcb_out.pad0, 0, 2); 1953 1954 xcb_parts[2].iov_base = (char *) &xcb_out; 1955 xcb_parts[2].iov_len = sizeof(xcb_out); 1956 xcb_parts[3].iov_base = 0; 1957 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1958 /* xcb_input_event_class_t classes */ 1959 xcb_parts[4].iov_base = (char *) classes; 1960 xcb_parts[4].iov_len = num_classes * sizeof(xcb_input_event_class_t); 1961 xcb_parts[5].iov_base = 0; 1962 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 1963 1964 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 1965 return xcb_ret; 1966 } 1967 1968 xcb_void_cookie_t 1969 xcb_input_grab_device_button (xcb_connection_t *c /**< */, 1970 xcb_window_t grab_window /**< */, 1971 uint8_t grabbed_device /**< */, 1972 uint8_t modifier_device /**< */, 1973 uint16_t num_classes /**< */, 1974 uint16_t modifiers /**< */, 1975 uint8_t this_device_mode /**< */, 1976 uint8_t other_device_mode /**< */, 1977 uint8_t button /**< */, 1978 uint8_t owner_events /**< */, 1979 const xcb_input_event_class_t *classes /**< */) 1980 { 1981 static const xcb_protocol_request_t xcb_req = { 1982 /* count */ 4, 1983 /* ext */ &xcb_input_id, 1984 /* opcode */ XCB_INPUT_GRAB_DEVICE_BUTTON, 1985 /* isvoid */ 1 1986 }; 1987 1988 struct iovec xcb_parts[6]; 1989 xcb_void_cookie_t xcb_ret; 1990 xcb_input_grab_device_button_request_t xcb_out; 1991 1992 xcb_out.grab_window = grab_window; 1993 xcb_out.grabbed_device = grabbed_device; 1994 xcb_out.modifier_device = modifier_device; 1995 xcb_out.num_classes = num_classes; 1996 xcb_out.modifiers = modifiers; 1997 xcb_out.this_device_mode = this_device_mode; 1998 xcb_out.other_device_mode = other_device_mode; 1999 xcb_out.button = button; 2000 xcb_out.owner_events = owner_events; 2001 memset(xcb_out.pad0, 0, 2); 2002 2003 xcb_parts[2].iov_base = (char *) &xcb_out; 2004 xcb_parts[2].iov_len = sizeof(xcb_out); 2005 xcb_parts[3].iov_base = 0; 2006 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2007 /* xcb_input_event_class_t classes */ 2008 xcb_parts[4].iov_base = (char *) classes; 2009 xcb_parts[4].iov_len = num_classes * sizeof(xcb_input_event_class_t); 2010 xcb_parts[5].iov_base = 0; 2011 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 2012 2013 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 2014 return xcb_ret; 2015 } 2016 2017 xcb_void_cookie_t 2018 xcb_input_ungrab_device_button_checked (xcb_connection_t *c /**< */, 2019 xcb_window_t grab_window /**< */, 2020 uint16_t modifiers /**< */, 2021 uint8_t modifier_device /**< */, 2022 uint8_t button /**< */, 2023 uint8_t grabbed_device /**< */) 2024 { 2025 static const xcb_protocol_request_t xcb_req = { 2026 /* count */ 2, 2027 /* ext */ &xcb_input_id, 2028 /* opcode */ XCB_INPUT_UNGRAB_DEVICE_BUTTON, 2029 /* isvoid */ 1 2030 }; 2031 2032 struct iovec xcb_parts[4]; 2033 xcb_void_cookie_t xcb_ret; 2034 xcb_input_ungrab_device_button_request_t xcb_out; 2035 2036 xcb_out.grab_window = grab_window; 2037 xcb_out.modifiers = modifiers; 2038 xcb_out.modifier_device = modifier_device; 2039 xcb_out.button = button; 2040 xcb_out.grabbed_device = grabbed_device; 2041 2042 xcb_parts[2].iov_base = (char *) &xcb_out; 2043 xcb_parts[2].iov_len = sizeof(xcb_out); 2044 xcb_parts[3].iov_base = 0; 2045 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2046 2047 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 2048 return xcb_ret; 2049 } 2050 2051 xcb_void_cookie_t 2052 xcb_input_ungrab_device_button (xcb_connection_t *c /**< */, 2053 xcb_window_t grab_window /**< */, 2054 uint16_t modifiers /**< */, 2055 uint8_t modifier_device /**< */, 2056 uint8_t button /**< */, 2057 uint8_t grabbed_device /**< */) 2058 { 2059 static const xcb_protocol_request_t xcb_req = { 2060 /* count */ 2, 2061 /* ext */ &xcb_input_id, 2062 /* opcode */ XCB_INPUT_UNGRAB_DEVICE_BUTTON, 2063 /* isvoid */ 1 2064 }; 2065 2066 struct iovec xcb_parts[4]; 2067 xcb_void_cookie_t xcb_ret; 2068 xcb_input_ungrab_device_button_request_t xcb_out; 2069 2070 xcb_out.grab_window = grab_window; 2071 xcb_out.modifiers = modifiers; 2072 xcb_out.modifier_device = modifier_device; 2073 xcb_out.button = button; 2074 xcb_out.grabbed_device = grabbed_device; 2075 2076 xcb_parts[2].iov_base = (char *) &xcb_out; 2077 xcb_parts[2].iov_len = sizeof(xcb_out); 2078 xcb_parts[3].iov_base = 0; 2079 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2080 2081 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 2082 return xcb_ret; 2083 } 2084 2085 xcb_void_cookie_t 2086 xcb_input_allow_device_events_checked (xcb_connection_t *c /**< */, 2087 xcb_timestamp_t time /**< */, 2088 uint8_t mode /**< */, 2089 uint8_t device_id /**< */) 2090 { 2091 static const xcb_protocol_request_t xcb_req = { 2092 /* count */ 2, 2093 /* ext */ &xcb_input_id, 2094 /* opcode */ XCB_INPUT_ALLOW_DEVICE_EVENTS, 2095 /* isvoid */ 1 2096 }; 2097 2098 struct iovec xcb_parts[4]; 2099 xcb_void_cookie_t xcb_ret; 2100 xcb_input_allow_device_events_request_t xcb_out; 2101 2102 xcb_out.time = time; 2103 xcb_out.mode = mode; 2104 xcb_out.device_id = device_id; 2105 2106 xcb_parts[2].iov_base = (char *) &xcb_out; 2107 xcb_parts[2].iov_len = sizeof(xcb_out); 2108 xcb_parts[3].iov_base = 0; 2109 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2110 2111 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 2112 return xcb_ret; 2113 } 2114 2115 xcb_void_cookie_t 2116 xcb_input_allow_device_events (xcb_connection_t *c /**< */, 2117 xcb_timestamp_t time /**< */, 2118 uint8_t mode /**< */, 2119 uint8_t device_id /**< */) 2120 { 2121 static const xcb_protocol_request_t xcb_req = { 2122 /* count */ 2, 2123 /* ext */ &xcb_input_id, 2124 /* opcode */ XCB_INPUT_ALLOW_DEVICE_EVENTS, 2125 /* isvoid */ 1 2126 }; 2127 2128 struct iovec xcb_parts[4]; 2129 xcb_void_cookie_t xcb_ret; 2130 xcb_input_allow_device_events_request_t xcb_out; 2131 2132 xcb_out.time = time; 2133 xcb_out.mode = mode; 2134 xcb_out.device_id = device_id; 2135 2136 xcb_parts[2].iov_base = (char *) &xcb_out; 2137 xcb_parts[2].iov_len = sizeof(xcb_out); 2138 xcb_parts[3].iov_base = 0; 2139 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2140 2141 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 2142 return xcb_ret; 2143 } 2144 2145 xcb_input_get_device_focus_cookie_t 2146 xcb_input_get_device_focus (xcb_connection_t *c /**< */, 2147 uint8_t device_id /**< */) 2148 { 2149 static const xcb_protocol_request_t xcb_req = { 2150 /* count */ 2, 2151 /* ext */ &xcb_input_id, 2152 /* opcode */ XCB_INPUT_GET_DEVICE_FOCUS, 2153 /* isvoid */ 0 2154 }; 2155 2156 struct iovec xcb_parts[4]; 2157 xcb_input_get_device_focus_cookie_t xcb_ret; 2158 xcb_input_get_device_focus_request_t xcb_out; 2159 2160 xcb_out.device_id = device_id; 2161 memset(xcb_out.pad0, 0, 3); 2162 2163 xcb_parts[2].iov_base = (char *) &xcb_out; 2164 xcb_parts[2].iov_len = sizeof(xcb_out); 2165 xcb_parts[3].iov_base = 0; 2166 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2167 2168 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 2169 return xcb_ret; 2170 } 2171 2172 xcb_input_get_device_focus_cookie_t 2173 xcb_input_get_device_focus_unchecked (xcb_connection_t *c /**< */, 2174 uint8_t device_id /**< */) 2175 { 2176 static const xcb_protocol_request_t xcb_req = { 2177 /* count */ 2, 2178 /* ext */ &xcb_input_id, 2179 /* opcode */ XCB_INPUT_GET_DEVICE_FOCUS, 2180 /* isvoid */ 0 2181 }; 2182 2183 struct iovec xcb_parts[4]; 2184 xcb_input_get_device_focus_cookie_t xcb_ret; 2185 xcb_input_get_device_focus_request_t xcb_out; 2186 2187 xcb_out.device_id = device_id; 2188 memset(xcb_out.pad0, 0, 3); 2189 2190 xcb_parts[2].iov_base = (char *) &xcb_out; 2191 xcb_parts[2].iov_len = sizeof(xcb_out); 2192 xcb_parts[3].iov_base = 0; 2193 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2194 2195 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 2196 return xcb_ret; 2197 } 2198 2199 xcb_input_get_device_focus_reply_t * 2200 xcb_input_get_device_focus_reply (xcb_connection_t *c /**< */, 2201 xcb_input_get_device_focus_cookie_t cookie /**< */, 2202 xcb_generic_error_t **e /**< */) 2203 { 2204 return (xcb_input_get_device_focus_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 2205 } 2206 2207 xcb_void_cookie_t 2208 xcb_input_set_device_focus_checked (xcb_connection_t *c /**< */, 2209 xcb_window_t focus /**< */, 2210 xcb_timestamp_t time /**< */, 2211 uint8_t revert_to /**< */, 2212 uint8_t device_id /**< */) 2213 { 2214 static const xcb_protocol_request_t xcb_req = { 2215 /* count */ 2, 2216 /* ext */ &xcb_input_id, 2217 /* opcode */ XCB_INPUT_SET_DEVICE_FOCUS, 2218 /* isvoid */ 1 2219 }; 2220 2221 struct iovec xcb_parts[4]; 2222 xcb_void_cookie_t xcb_ret; 2223 xcb_input_set_device_focus_request_t xcb_out; 2224 2225 xcb_out.focus = focus; 2226 xcb_out.time = time; 2227 xcb_out.revert_to = revert_to; 2228 xcb_out.device_id = device_id; 2229 2230 xcb_parts[2].iov_base = (char *) &xcb_out; 2231 xcb_parts[2].iov_len = sizeof(xcb_out); 2232 xcb_parts[3].iov_base = 0; 2233 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2234 2235 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 2236 return xcb_ret; 2237 } 2238 2239 xcb_void_cookie_t 2240 xcb_input_set_device_focus (xcb_connection_t *c /**< */, 2241 xcb_window_t focus /**< */, 2242 xcb_timestamp_t time /**< */, 2243 uint8_t revert_to /**< */, 2244 uint8_t device_id /**< */) 2245 { 2246 static const xcb_protocol_request_t xcb_req = { 2247 /* count */ 2, 2248 /* ext */ &xcb_input_id, 2249 /* opcode */ XCB_INPUT_SET_DEVICE_FOCUS, 2250 /* isvoid */ 1 2251 }; 2252 2253 struct iovec xcb_parts[4]; 2254 xcb_void_cookie_t xcb_ret; 2255 xcb_input_set_device_focus_request_t xcb_out; 2256 2257 xcb_out.focus = focus; 2258 xcb_out.time = time; 2259 xcb_out.revert_to = revert_to; 2260 xcb_out.device_id = device_id; 2261 2262 xcb_parts[2].iov_base = (char *) &xcb_out; 2263 xcb_parts[2].iov_len = sizeof(xcb_out); 2264 xcb_parts[3].iov_base = 0; 2265 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2266 2267 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 2268 return xcb_ret; 2269 } 2270 2271 void 2272 xcb_input_kbd_feedback_state_next (xcb_input_kbd_feedback_state_iterator_t *i /**< */) 2273 { 2274 --i->rem; 2275 ++i->data; 2276 i->index += sizeof(xcb_input_kbd_feedback_state_t); 2277 } 2278 2279 xcb_generic_iterator_t 2280 xcb_input_kbd_feedback_state_end (xcb_input_kbd_feedback_state_iterator_t i /**< */) 2281 { 2282 xcb_generic_iterator_t ret; 2283 ret.data = i.data + i.rem; 2284 ret.index = i.index + ((char *) ret.data - (char *) i.data); 2285 ret.rem = 0; 2286 return ret; 2287 } 2288 2289 void 2290 xcb_input_ptr_feedback_state_next (xcb_input_ptr_feedback_state_iterator_t *i /**< */) 2291 { 2292 --i->rem; 2293 ++i->data; 2294 i->index += sizeof(xcb_input_ptr_feedback_state_t); 2295 } 2296 2297 xcb_generic_iterator_t 2298 xcb_input_ptr_feedback_state_end (xcb_input_ptr_feedback_state_iterator_t i /**< */) 2299 { 2300 xcb_generic_iterator_t ret; 2301 ret.data = i.data + i.rem; 2302 ret.index = i.index + ((char *) ret.data - (char *) i.data); 2303 ret.rem = 0; 2304 return ret; 2305 } 2306 2307 void 2308 xcb_input_integer_feedback_state_next (xcb_input_integer_feedback_state_iterator_t *i /**< */) 2309 { 2310 --i->rem; 2311 ++i->data; 2312 i->index += sizeof(xcb_input_integer_feedback_state_t); 2313 } 2314 2315 xcb_generic_iterator_t 2316 xcb_input_integer_feedback_state_end (xcb_input_integer_feedback_state_iterator_t i /**< */) 2317 { 2318 xcb_generic_iterator_t ret; 2319 ret.data = i.data + i.rem; 2320 ret.index = i.index + ((char *) ret.data - (char *) i.data); 2321 ret.rem = 0; 2322 return ret; 2323 } 2324 2325 int 2326 xcb_input_string_feedback_state_sizeof (const void *_buffer /**< */) 2327 { 2328 char *xcb_tmp = (char *)_buffer; 2329 const xcb_input_string_feedback_state_t *_aux = (xcb_input_string_feedback_state_t *)_buffer; 2330 unsigned int xcb_buffer_len = 0; 2331 unsigned int xcb_block_len = 0; 2332 unsigned int xcb_pad = 0; 2333 unsigned int xcb_align_to = 0; 2334 2335 2336 xcb_block_len += sizeof(xcb_input_string_feedback_state_t); 2337 xcb_tmp += xcb_block_len; 2338 xcb_buffer_len += xcb_block_len; 2339 xcb_block_len = 0; 2340 /* keysyms */ 2341 xcb_block_len += _aux->num_keysyms * sizeof(xcb_keysym_t); 2342 xcb_tmp += xcb_block_len; 2343 xcb_align_to = ALIGNOF(xcb_keysym_t); 2344 /* insert padding */ 2345 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 2346 xcb_buffer_len += xcb_block_len + xcb_pad; 2347 if (0 != xcb_pad) { 2348 xcb_tmp += xcb_pad; 2349 xcb_pad = 0; 2350 } 2351 xcb_block_len = 0; 2352 2353 return xcb_buffer_len; 2354 } 2355 2356 xcb_keysym_t * 2357 xcb_input_string_feedback_state_keysyms (const xcb_input_string_feedback_state_t *R /**< */) 2358 { 2359 return (xcb_keysym_t *) (R + 1); 2360 } 2361 2362 int 2363 xcb_input_string_feedback_state_keysyms_length (const xcb_input_string_feedback_state_t *R /**< */) 2364 { 2365 return R->num_keysyms; 2366 } 2367 2368 xcb_generic_iterator_t 2369 xcb_input_string_feedback_state_keysyms_end (const xcb_input_string_feedback_state_t *R /**< */) 2370 { 2371 xcb_generic_iterator_t i; 2372 i.data = ((xcb_keysym_t *) (R + 1)) + (R->num_keysyms); 2373 i.rem = 0; 2374 i.index = (char *) i.data - (char *) R; 2375 return i; 2376 } 2377 2378 void 2379 xcb_input_string_feedback_state_next (xcb_input_string_feedback_state_iterator_t *i /**< */) 2380 { 2381 xcb_input_string_feedback_state_t *R = i->data; 2382 xcb_generic_iterator_t child; 2383 child.data = (xcb_input_string_feedback_state_t *)(((char *)R) + xcb_input_string_feedback_state_sizeof(R)); 2384 i->index = (char *) child.data - (char *) i->data; 2385 --i->rem; 2386 i->data = (xcb_input_string_feedback_state_t *) child.data; 2387 } 2388 2389 xcb_generic_iterator_t 2390 xcb_input_string_feedback_state_end (xcb_input_string_feedback_state_iterator_t i /**< */) 2391 { 2392 xcb_generic_iterator_t ret; 2393 while(i.rem > 0) 2394 xcb_input_string_feedback_state_next(&i); 2395 ret.data = i.data; 2396 ret.rem = i.rem; 2397 ret.index = i.index; 2398 return ret; 2399 } 2400 2401 void 2402 xcb_input_bell_feedback_state_next (xcb_input_bell_feedback_state_iterator_t *i /**< */) 2403 { 2404 --i->rem; 2405 ++i->data; 2406 i->index += sizeof(xcb_input_bell_feedback_state_t); 2407 } 2408 2409 xcb_generic_iterator_t 2410 xcb_input_bell_feedback_state_end (xcb_input_bell_feedback_state_iterator_t i /**< */) 2411 { 2412 xcb_generic_iterator_t ret; 2413 ret.data = i.data + i.rem; 2414 ret.index = i.index + ((char *) ret.data - (char *) i.data); 2415 ret.rem = 0; 2416 return ret; 2417 } 2418 2419 void 2420 xcb_input_led_feedback_state_next (xcb_input_led_feedback_state_iterator_t *i /**< */) 2421 { 2422 --i->rem; 2423 ++i->data; 2424 i->index += sizeof(xcb_input_led_feedback_state_t); 2425 } 2426 2427 xcb_generic_iterator_t 2428 xcb_input_led_feedback_state_end (xcb_input_led_feedback_state_iterator_t i /**< */) 2429 { 2430 xcb_generic_iterator_t ret; 2431 ret.data = i.data + i.rem; 2432 ret.index = i.index + ((char *) ret.data - (char *) i.data); 2433 ret.rem = 0; 2434 return ret; 2435 } 2436 2437 int 2438 xcb_input_feedback_state_sizeof (const void *_buffer /**< */) 2439 { 2440 char *xcb_tmp = (char *)_buffer; 2441 const xcb_input_feedback_state_t *_aux = (xcb_input_feedback_state_t *)_buffer; 2442 unsigned int xcb_buffer_len = 0; 2443 unsigned int xcb_block_len = 0; 2444 unsigned int xcb_pad = 0; 2445 unsigned int xcb_align_to = 0; 2446 2447 2448 xcb_block_len += sizeof(xcb_input_feedback_state_t); 2449 xcb_tmp += xcb_block_len; 2450 xcb_buffer_len += xcb_block_len; 2451 xcb_block_len = 0; 2452 /* uninterpreted_data */ 2453 xcb_block_len += (_aux->len - 4) * sizeof(uint8_t); 2454 xcb_tmp += xcb_block_len; 2455 xcb_align_to = ALIGNOF(uint8_t); 2456 /* insert padding */ 2457 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 2458 xcb_buffer_len += xcb_block_len + xcb_pad; 2459 if (0 != xcb_pad) { 2460 xcb_tmp += xcb_pad; 2461 xcb_pad = 0; 2462 } 2463 xcb_block_len = 0; 2464 2465 return xcb_buffer_len; 2466 } 2467 2468 uint8_t * 2469 xcb_input_feedback_state_uninterpreted_data (const xcb_input_feedback_state_t *R /**< */) 2470 { 2471 return (uint8_t *) (R + 1); 2472 } 2473 2474 int 2475 xcb_input_feedback_state_uninterpreted_data_length (const xcb_input_feedback_state_t *R /**< */) 2476 { 2477 return (R->len - 4); 2478 } 2479 2480 xcb_generic_iterator_t 2481 xcb_input_feedback_state_uninterpreted_data_end (const xcb_input_feedback_state_t *R /**< */) 2482 { 2483 xcb_generic_iterator_t i; 2484 i.data = ((uint8_t *) (R + 1)) + ((R->len - 4)); 2485 i.rem = 0; 2486 i.index = (char *) i.data - (char *) R; 2487 return i; 2488 } 2489 2490 void 2491 xcb_input_feedback_state_next (xcb_input_feedback_state_iterator_t *i /**< */) 2492 { 2493 xcb_input_feedback_state_t *R = i->data; 2494 xcb_generic_iterator_t child; 2495 child.data = (xcb_input_feedback_state_t *)(((char *)R) + xcb_input_feedback_state_sizeof(R)); 2496 i->index = (char *) child.data - (char *) i->data; 2497 --i->rem; 2498 i->data = (xcb_input_feedback_state_t *) child.data; 2499 } 2500 2501 xcb_generic_iterator_t 2502 xcb_input_feedback_state_end (xcb_input_feedback_state_iterator_t i /**< */) 2503 { 2504 xcb_generic_iterator_t ret; 2505 while(i.rem > 0) 2506 xcb_input_feedback_state_next(&i); 2507 ret.data = i.data; 2508 ret.rem = i.rem; 2509 ret.index = i.index; 2510 return ret; 2511 } 2512 2513 int 2514 xcb_input_get_feedback_control_sizeof (const void *_buffer /**< */) 2515 { 2516 char *xcb_tmp = (char *)_buffer; 2517 const xcb_input_get_feedback_control_reply_t *_aux = (xcb_input_get_feedback_control_reply_t *)_buffer; 2518 unsigned int xcb_buffer_len = 0; 2519 unsigned int xcb_block_len = 0; 2520 unsigned int xcb_pad = 0; 2521 unsigned int xcb_align_to = 0; 2522 2523 unsigned int i; 2524 unsigned int xcb_tmp_len; 2525 2526 xcb_block_len += sizeof(xcb_input_get_feedback_control_reply_t); 2527 xcb_tmp += xcb_block_len; 2528 xcb_buffer_len += xcb_block_len; 2529 xcb_block_len = 0; 2530 /* feedbacks */ 2531 for(i=0; i<_aux->num_feedbacks; i++) { 2532 xcb_tmp_len = xcb_input_feedback_state_sizeof(xcb_tmp); 2533 xcb_block_len += xcb_tmp_len; 2534 xcb_tmp += xcb_tmp_len; 2535 } 2536 xcb_align_to = ALIGNOF(xcb_input_feedback_state_t); 2537 /* insert padding */ 2538 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 2539 xcb_buffer_len += xcb_block_len + xcb_pad; 2540 if (0 != xcb_pad) { 2541 xcb_tmp += xcb_pad; 2542 xcb_pad = 0; 2543 } 2544 xcb_block_len = 0; 2545 2546 return xcb_buffer_len; 2547 } 2548 2549 xcb_input_get_feedback_control_cookie_t 2550 xcb_input_get_feedback_control (xcb_connection_t *c /**< */, 2551 uint8_t device_id /**< */) 2552 { 2553 static const xcb_protocol_request_t xcb_req = { 2554 /* count */ 2, 2555 /* ext */ &xcb_input_id, 2556 /* opcode */ XCB_INPUT_GET_FEEDBACK_CONTROL, 2557 /* isvoid */ 0 2558 }; 2559 2560 struct iovec xcb_parts[4]; 2561 xcb_input_get_feedback_control_cookie_t xcb_ret; 2562 xcb_input_get_feedback_control_request_t xcb_out; 2563 2564 xcb_out.device_id = device_id; 2565 memset(xcb_out.pad0, 0, 3); 2566 2567 xcb_parts[2].iov_base = (char *) &xcb_out; 2568 xcb_parts[2].iov_len = sizeof(xcb_out); 2569 xcb_parts[3].iov_base = 0; 2570 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2571 2572 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 2573 return xcb_ret; 2574 } 2575 2576 xcb_input_get_feedback_control_cookie_t 2577 xcb_input_get_feedback_control_unchecked (xcb_connection_t *c /**< */, 2578 uint8_t device_id /**< */) 2579 { 2580 static const xcb_protocol_request_t xcb_req = { 2581 /* count */ 2, 2582 /* ext */ &xcb_input_id, 2583 /* opcode */ XCB_INPUT_GET_FEEDBACK_CONTROL, 2584 /* isvoid */ 0 2585 }; 2586 2587 struct iovec xcb_parts[4]; 2588 xcb_input_get_feedback_control_cookie_t xcb_ret; 2589 xcb_input_get_feedback_control_request_t xcb_out; 2590 2591 xcb_out.device_id = device_id; 2592 memset(xcb_out.pad0, 0, 3); 2593 2594 xcb_parts[2].iov_base = (char *) &xcb_out; 2595 xcb_parts[2].iov_len = sizeof(xcb_out); 2596 xcb_parts[3].iov_base = 0; 2597 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2598 2599 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 2600 return xcb_ret; 2601 } 2602 2603 int 2604 xcb_input_get_feedback_control_feedbacks_length (const xcb_input_get_feedback_control_reply_t *R /**< */) 2605 { 2606 return R->num_feedbacks; 2607 } 2608 2609 xcb_input_feedback_state_iterator_t 2610 xcb_input_get_feedback_control_feedbacks_iterator (const xcb_input_get_feedback_control_reply_t *R /**< */) 2611 { 2612 xcb_input_feedback_state_iterator_t i; 2613 i.data = (xcb_input_feedback_state_t *) (R + 1); 2614 i.rem = R->num_feedbacks; 2615 i.index = (char *) i.data - (char *) R; 2616 return i; 2617 } 2618 2619 xcb_input_get_feedback_control_reply_t * 2620 xcb_input_get_feedback_control_reply (xcb_connection_t *c /**< */, 2621 xcb_input_get_feedback_control_cookie_t cookie /**< */, 2622 xcb_generic_error_t **e /**< */) 2623 { 2624 return (xcb_input_get_feedback_control_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 2625 } 2626 2627 void 2628 xcb_input_kbd_feedback_ctl_next (xcb_input_kbd_feedback_ctl_iterator_t *i /**< */) 2629 { 2630 --i->rem; 2631 ++i->data; 2632 i->index += sizeof(xcb_input_kbd_feedback_ctl_t); 2633 } 2634 2635 xcb_generic_iterator_t 2636 xcb_input_kbd_feedback_ctl_end (xcb_input_kbd_feedback_ctl_iterator_t i /**< */) 2637 { 2638 xcb_generic_iterator_t ret; 2639 ret.data = i.data + i.rem; 2640 ret.index = i.index + ((char *) ret.data - (char *) i.data); 2641 ret.rem = 0; 2642 return ret; 2643 } 2644 2645 void 2646 xcb_input_ptr_feedback_ctl_next (xcb_input_ptr_feedback_ctl_iterator_t *i /**< */) 2647 { 2648 --i->rem; 2649 ++i->data; 2650 i->index += sizeof(xcb_input_ptr_feedback_ctl_t); 2651 } 2652 2653 xcb_generic_iterator_t 2654 xcb_input_ptr_feedback_ctl_end (xcb_input_ptr_feedback_ctl_iterator_t i /**< */) 2655 { 2656 xcb_generic_iterator_t ret; 2657 ret.data = i.data + i.rem; 2658 ret.index = i.index + ((char *) ret.data - (char *) i.data); 2659 ret.rem = 0; 2660 return ret; 2661 } 2662 2663 void 2664 xcb_input_integer_feedback_ctl_next (xcb_input_integer_feedback_ctl_iterator_t *i /**< */) 2665 { 2666 --i->rem; 2667 ++i->data; 2668 i->index += sizeof(xcb_input_integer_feedback_ctl_t); 2669 } 2670 2671 xcb_generic_iterator_t 2672 xcb_input_integer_feedback_ctl_end (xcb_input_integer_feedback_ctl_iterator_t i /**< */) 2673 { 2674 xcb_generic_iterator_t ret; 2675 ret.data = i.data + i.rem; 2676 ret.index = i.index + ((char *) ret.data - (char *) i.data); 2677 ret.rem = 0; 2678 return ret; 2679 } 2680 2681 int 2682 xcb_input_string_feedback_ctl_sizeof (const void *_buffer /**< */) 2683 { 2684 char *xcb_tmp = (char *)_buffer; 2685 const xcb_input_string_feedback_ctl_t *_aux = (xcb_input_string_feedback_ctl_t *)_buffer; 2686 unsigned int xcb_buffer_len = 0; 2687 unsigned int xcb_block_len = 0; 2688 unsigned int xcb_pad = 0; 2689 unsigned int xcb_align_to = 0; 2690 2691 2692 xcb_block_len += sizeof(xcb_input_string_feedback_ctl_t); 2693 xcb_tmp += xcb_block_len; 2694 xcb_buffer_len += xcb_block_len; 2695 xcb_block_len = 0; 2696 /* keysyms */ 2697 xcb_block_len += _aux->num_keysyms * sizeof(xcb_keysym_t); 2698 xcb_tmp += xcb_block_len; 2699 xcb_align_to = ALIGNOF(xcb_keysym_t); 2700 /* insert padding */ 2701 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 2702 xcb_buffer_len += xcb_block_len + xcb_pad; 2703 if (0 != xcb_pad) { 2704 xcb_tmp += xcb_pad; 2705 xcb_pad = 0; 2706 } 2707 xcb_block_len = 0; 2708 2709 return xcb_buffer_len; 2710 } 2711 2712 xcb_keysym_t * 2713 xcb_input_string_feedback_ctl_keysyms (const xcb_input_string_feedback_ctl_t *R /**< */) 2714 { 2715 return (xcb_keysym_t *) (R + 1); 2716 } 2717 2718 int 2719 xcb_input_string_feedback_ctl_keysyms_length (const xcb_input_string_feedback_ctl_t *R /**< */) 2720 { 2721 return R->num_keysyms; 2722 } 2723 2724 xcb_generic_iterator_t 2725 xcb_input_string_feedback_ctl_keysyms_end (const xcb_input_string_feedback_ctl_t *R /**< */) 2726 { 2727 xcb_generic_iterator_t i; 2728 i.data = ((xcb_keysym_t *) (R + 1)) + (R->num_keysyms); 2729 i.rem = 0; 2730 i.index = (char *) i.data - (char *) R; 2731 return i; 2732 } 2733 2734 void 2735 xcb_input_string_feedback_ctl_next (xcb_input_string_feedback_ctl_iterator_t *i /**< */) 2736 { 2737 xcb_input_string_feedback_ctl_t *R = i->data; 2738 xcb_generic_iterator_t child; 2739 child.data = (xcb_input_string_feedback_ctl_t *)(((char *)R) + xcb_input_string_feedback_ctl_sizeof(R)); 2740 i->index = (char *) child.data - (char *) i->data; 2741 --i->rem; 2742 i->data = (xcb_input_string_feedback_ctl_t *) child.data; 2743 } 2744 2745 xcb_generic_iterator_t 2746 xcb_input_string_feedback_ctl_end (xcb_input_string_feedback_ctl_iterator_t i /**< */) 2747 { 2748 xcb_generic_iterator_t ret; 2749 while(i.rem > 0) 2750 xcb_input_string_feedback_ctl_next(&i); 2751 ret.data = i.data; 2752 ret.rem = i.rem; 2753 ret.index = i.index; 2754 return ret; 2755 } 2756 2757 void 2758 xcb_input_bell_feedback_ctl_next (xcb_input_bell_feedback_ctl_iterator_t *i /**< */) 2759 { 2760 --i->rem; 2761 ++i->data; 2762 i->index += sizeof(xcb_input_bell_feedback_ctl_t); 2763 } 2764 2765 xcb_generic_iterator_t 2766 xcb_input_bell_feedback_ctl_end (xcb_input_bell_feedback_ctl_iterator_t i /**< */) 2767 { 2768 xcb_generic_iterator_t ret; 2769 ret.data = i.data + i.rem; 2770 ret.index = i.index + ((char *) ret.data - (char *) i.data); 2771 ret.rem = 0; 2772 return ret; 2773 } 2774 2775 void 2776 xcb_input_led_feedback_ctl_next (xcb_input_led_feedback_ctl_iterator_t *i /**< */) 2777 { 2778 --i->rem; 2779 ++i->data; 2780 i->index += sizeof(xcb_input_led_feedback_ctl_t); 2781 } 2782 2783 xcb_generic_iterator_t 2784 xcb_input_led_feedback_ctl_end (xcb_input_led_feedback_ctl_iterator_t i /**< */) 2785 { 2786 xcb_generic_iterator_t ret; 2787 ret.data = i.data + i.rem; 2788 ret.index = i.index + ((char *) ret.data - (char *) i.data); 2789 ret.rem = 0; 2790 return ret; 2791 } 2792 2793 int 2794 xcb_input_feedback_ctl_sizeof (const void *_buffer /**< */) 2795 { 2796 char *xcb_tmp = (char *)_buffer; 2797 const xcb_input_feedback_ctl_t *_aux = (xcb_input_feedback_ctl_t *)_buffer; 2798 unsigned int xcb_buffer_len = 0; 2799 unsigned int xcb_block_len = 0; 2800 unsigned int xcb_pad = 0; 2801 unsigned int xcb_align_to = 0; 2802 2803 2804 xcb_block_len += sizeof(xcb_input_feedback_ctl_t); 2805 xcb_tmp += xcb_block_len; 2806 xcb_buffer_len += xcb_block_len; 2807 xcb_block_len = 0; 2808 /* uninterpreted_data */ 2809 xcb_block_len += (_aux->len - 4) * sizeof(uint8_t); 2810 xcb_tmp += xcb_block_len; 2811 xcb_align_to = ALIGNOF(uint8_t); 2812 /* insert padding */ 2813 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 2814 xcb_buffer_len += xcb_block_len + xcb_pad; 2815 if (0 != xcb_pad) { 2816 xcb_tmp += xcb_pad; 2817 xcb_pad = 0; 2818 } 2819 xcb_block_len = 0; 2820 2821 return xcb_buffer_len; 2822 } 2823 2824 uint8_t * 2825 xcb_input_feedback_ctl_uninterpreted_data (const xcb_input_feedback_ctl_t *R /**< */) 2826 { 2827 return (uint8_t *) (R + 1); 2828 } 2829 2830 int 2831 xcb_input_feedback_ctl_uninterpreted_data_length (const xcb_input_feedback_ctl_t *R /**< */) 2832 { 2833 return (R->len - 4); 2834 } 2835 2836 xcb_generic_iterator_t 2837 xcb_input_feedback_ctl_uninterpreted_data_end (const xcb_input_feedback_ctl_t *R /**< */) 2838 { 2839 xcb_generic_iterator_t i; 2840 i.data = ((uint8_t *) (R + 1)) + ((R->len - 4)); 2841 i.rem = 0; 2842 i.index = (char *) i.data - (char *) R; 2843 return i; 2844 } 2845 2846 void 2847 xcb_input_feedback_ctl_next (xcb_input_feedback_ctl_iterator_t *i /**< */) 2848 { 2849 xcb_input_feedback_ctl_t *R = i->data; 2850 xcb_generic_iterator_t child; 2851 child.data = (xcb_input_feedback_ctl_t *)(((char *)R) + xcb_input_feedback_ctl_sizeof(R)); 2852 i->index = (char *) child.data - (char *) i->data; 2853 --i->rem; 2854 i->data = (xcb_input_feedback_ctl_t *) child.data; 2855 } 2856 2857 xcb_generic_iterator_t 2858 xcb_input_feedback_ctl_end (xcb_input_feedback_ctl_iterator_t i /**< */) 2859 { 2860 xcb_generic_iterator_t ret; 2861 while(i.rem > 0) 2862 xcb_input_feedback_ctl_next(&i); 2863 ret.data = i.data; 2864 ret.rem = i.rem; 2865 ret.index = i.index; 2866 return ret; 2867 } 2868 2869 int 2870 xcb_input_change_feedback_control_sizeof (const void *_buffer /**< */) 2871 { 2872 char *xcb_tmp = (char *)_buffer; 2873 unsigned int xcb_buffer_len = 0; 2874 unsigned int xcb_block_len = 0; 2875 unsigned int xcb_pad = 0; 2876 unsigned int xcb_align_to = 0; 2877 2878 2879 xcb_block_len += sizeof(xcb_input_change_feedback_control_request_t); 2880 xcb_tmp += xcb_block_len; 2881 xcb_buffer_len += xcb_block_len; 2882 xcb_block_len = 0; 2883 /* feedback */ 2884 xcb_block_len += xcb_input_feedback_ctl_sizeof(xcb_tmp); 2885 xcb_tmp += xcb_block_len; 2886 xcb_align_to = ALIGNOF(xcb_input_feedback_ctl_t); 2887 /* insert padding */ 2888 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 2889 xcb_buffer_len += xcb_block_len + xcb_pad; 2890 if (0 != xcb_pad) { 2891 xcb_tmp += xcb_pad; 2892 xcb_pad = 0; 2893 } 2894 xcb_block_len = 0; 2895 2896 return xcb_buffer_len; 2897 } 2898 2899 xcb_void_cookie_t 2900 xcb_input_change_feedback_control_checked (xcb_connection_t *c /**< */, 2901 uint32_t mask /**< */, 2902 uint8_t device_id /**< */, 2903 uint8_t feedback_id /**< */, 2904 xcb_input_feedback_ctl_t *feedback /**< */) 2905 { 2906 static const xcb_protocol_request_t xcb_req = { 2907 /* count */ 4, 2908 /* ext */ &xcb_input_id, 2909 /* opcode */ XCB_INPUT_CHANGE_FEEDBACK_CONTROL, 2910 /* isvoid */ 1 2911 }; 2912 2913 struct iovec xcb_parts[6]; 2914 xcb_void_cookie_t xcb_ret; 2915 xcb_input_change_feedback_control_request_t xcb_out; 2916 2917 xcb_out.mask = mask; 2918 xcb_out.device_id = device_id; 2919 xcb_out.feedback_id = feedback_id; 2920 2921 xcb_parts[2].iov_base = (char *) &xcb_out; 2922 xcb_parts[2].iov_len = sizeof(xcb_out); 2923 xcb_parts[3].iov_base = 0; 2924 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2925 /* xcb_input_feedback_ctl_t feedback */ 2926 xcb_parts[4].iov_base = (char *) feedback; 2927 xcb_parts[4].iov_len = 2928 xcb_input_feedback_ctl_sizeof (feedback); 2929 2930 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 2931 return xcb_ret; 2932 } 2933 2934 xcb_void_cookie_t 2935 xcb_input_change_feedback_control (xcb_connection_t *c /**< */, 2936 uint32_t mask /**< */, 2937 uint8_t device_id /**< */, 2938 uint8_t feedback_id /**< */, 2939 xcb_input_feedback_ctl_t *feedback /**< */) 2940 { 2941 static const xcb_protocol_request_t xcb_req = { 2942 /* count */ 4, 2943 /* ext */ &xcb_input_id, 2944 /* opcode */ XCB_INPUT_CHANGE_FEEDBACK_CONTROL, 2945 /* isvoid */ 1 2946 }; 2947 2948 struct iovec xcb_parts[6]; 2949 xcb_void_cookie_t xcb_ret; 2950 xcb_input_change_feedback_control_request_t xcb_out; 2951 2952 xcb_out.mask = mask; 2953 xcb_out.device_id = device_id; 2954 xcb_out.feedback_id = feedback_id; 2955 2956 xcb_parts[2].iov_base = (char *) &xcb_out; 2957 xcb_parts[2].iov_len = sizeof(xcb_out); 2958 xcb_parts[3].iov_base = 0; 2959 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2960 /* xcb_input_feedback_ctl_t feedback */ 2961 xcb_parts[4].iov_base = (char *) feedback; 2962 xcb_parts[4].iov_len = 2963 xcb_input_feedback_ctl_sizeof (feedback); 2964 2965 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 2966 return xcb_ret; 2967 } 2968 2969 int 2970 xcb_input_get_device_key_mapping_sizeof (const void *_buffer /**< */) 2971 { 2972 char *xcb_tmp = (char *)_buffer; 2973 const xcb_input_get_device_key_mapping_reply_t *_aux = (xcb_input_get_device_key_mapping_reply_t *)_buffer; 2974 unsigned int xcb_buffer_len = 0; 2975 unsigned int xcb_block_len = 0; 2976 unsigned int xcb_pad = 0; 2977 unsigned int xcb_align_to = 0; 2978 2979 2980 xcb_block_len += sizeof(xcb_input_get_device_key_mapping_reply_t); 2981 xcb_tmp += xcb_block_len; 2982 xcb_buffer_len += xcb_block_len; 2983 xcb_block_len = 0; 2984 /* keysyms */ 2985 xcb_block_len += _aux->length * sizeof(xcb_keysym_t); 2986 xcb_tmp += xcb_block_len; 2987 xcb_align_to = ALIGNOF(xcb_keysym_t); 2988 /* insert padding */ 2989 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 2990 xcb_buffer_len += xcb_block_len + xcb_pad; 2991 if (0 != xcb_pad) { 2992 xcb_tmp += xcb_pad; 2993 xcb_pad = 0; 2994 } 2995 xcb_block_len = 0; 2996 2997 return xcb_buffer_len; 2998 } 2999 3000 xcb_input_get_device_key_mapping_cookie_t 3001 xcb_input_get_device_key_mapping (xcb_connection_t *c /**< */, 3002 uint8_t device_id /**< */, 3003 xcb_input_key_code_t first_keycode /**< */, 3004 uint8_t count /**< */) 3005 { 3006 static const xcb_protocol_request_t xcb_req = { 3007 /* count */ 2, 3008 /* ext */ &xcb_input_id, 3009 /* opcode */ XCB_INPUT_GET_DEVICE_KEY_MAPPING, 3010 /* isvoid */ 0 3011 }; 3012 3013 struct iovec xcb_parts[4]; 3014 xcb_input_get_device_key_mapping_cookie_t xcb_ret; 3015 xcb_input_get_device_key_mapping_request_t xcb_out; 3016 3017 xcb_out.device_id = device_id; 3018 xcb_out.first_keycode = first_keycode; 3019 xcb_out.count = count; 3020 3021 xcb_parts[2].iov_base = (char *) &xcb_out; 3022 xcb_parts[2].iov_len = sizeof(xcb_out); 3023 xcb_parts[3].iov_base = 0; 3024 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 3025 3026 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 3027 return xcb_ret; 3028 } 3029 3030 xcb_input_get_device_key_mapping_cookie_t 3031 xcb_input_get_device_key_mapping_unchecked (xcb_connection_t *c /**< */, 3032 uint8_t device_id /**< */, 3033 xcb_input_key_code_t first_keycode /**< */, 3034 uint8_t count /**< */) 3035 { 3036 static const xcb_protocol_request_t xcb_req = { 3037 /* count */ 2, 3038 /* ext */ &xcb_input_id, 3039 /* opcode */ XCB_INPUT_GET_DEVICE_KEY_MAPPING, 3040 /* isvoid */ 0 3041 }; 3042 3043 struct iovec xcb_parts[4]; 3044 xcb_input_get_device_key_mapping_cookie_t xcb_ret; 3045 xcb_input_get_device_key_mapping_request_t xcb_out; 3046 3047 xcb_out.device_id = device_id; 3048 xcb_out.first_keycode = first_keycode; 3049 xcb_out.count = count; 3050 3051 xcb_parts[2].iov_base = (char *) &xcb_out; 3052 xcb_parts[2].iov_len = sizeof(xcb_out); 3053 xcb_parts[3].iov_base = 0; 3054 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 3055 3056 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 3057 return xcb_ret; 3058 } 3059 3060 xcb_keysym_t * 3061 xcb_input_get_device_key_mapping_keysyms (const xcb_input_get_device_key_mapping_reply_t *R /**< */) 3062 { 3063 return (xcb_keysym_t *) (R + 1); 3064 } 3065 3066 int 3067 xcb_input_get_device_key_mapping_keysyms_length (const xcb_input_get_device_key_mapping_reply_t *R /**< */) 3068 { 3069 return R->length; 3070 } 3071 3072 xcb_generic_iterator_t 3073 xcb_input_get_device_key_mapping_keysyms_end (const xcb_input_get_device_key_mapping_reply_t *R /**< */) 3074 { 3075 xcb_generic_iterator_t i; 3076 i.data = ((xcb_keysym_t *) (R + 1)) + (R->length); 3077 i.rem = 0; 3078 i.index = (char *) i.data - (char *) R; 3079 return i; 3080 } 3081 3082 xcb_input_get_device_key_mapping_reply_t * 3083 xcb_input_get_device_key_mapping_reply (xcb_connection_t *c /**< */, 3084 xcb_input_get_device_key_mapping_cookie_t cookie /**< */, 3085 xcb_generic_error_t **e /**< */) 3086 { 3087 return (xcb_input_get_device_key_mapping_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 3088 } 3089 3090 int 3091 xcb_input_change_device_key_mapping_sizeof (const void *_buffer /**< */) 3092 { 3093 char *xcb_tmp = (char *)_buffer; 3094 const xcb_input_change_device_key_mapping_request_t *_aux = (xcb_input_change_device_key_mapping_request_t *)_buffer; 3095 unsigned int xcb_buffer_len = 0; 3096 unsigned int xcb_block_len = 0; 3097 unsigned int xcb_pad = 0; 3098 unsigned int xcb_align_to = 0; 3099 3100 3101 xcb_block_len += sizeof(xcb_input_change_device_key_mapping_request_t); 3102 xcb_tmp += xcb_block_len; 3103 xcb_buffer_len += xcb_block_len; 3104 xcb_block_len = 0; 3105 /* keysyms */ 3106 xcb_block_len += (_aux->keycode_count * _aux->keysyms_per_keycode) * sizeof(xcb_keysym_t); 3107 xcb_tmp += xcb_block_len; 3108 xcb_align_to = ALIGNOF(xcb_keysym_t); 3109 /* insert padding */ 3110 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 3111 xcb_buffer_len += xcb_block_len + xcb_pad; 3112 if (0 != xcb_pad) { 3113 xcb_tmp += xcb_pad; 3114 xcb_pad = 0; 3115 } 3116 xcb_block_len = 0; 3117 3118 return xcb_buffer_len; 3119 } 3120 3121 xcb_void_cookie_t 3122 xcb_input_change_device_key_mapping_checked (xcb_connection_t *c /**< */, 3123 uint8_t device_id /**< */, 3124 xcb_input_key_code_t first_keycode /**< */, 3125 uint8_t keysyms_per_keycode /**< */, 3126 uint8_t keycode_count /**< */, 3127 const xcb_keysym_t *keysyms /**< */) 3128 { 3129 static const xcb_protocol_request_t xcb_req = { 3130 /* count */ 4, 3131 /* ext */ &xcb_input_id, 3132 /* opcode */ XCB_INPUT_CHANGE_DEVICE_KEY_MAPPING, 3133 /* isvoid */ 1 3134 }; 3135 3136 struct iovec xcb_parts[6]; 3137 xcb_void_cookie_t xcb_ret; 3138 xcb_input_change_device_key_mapping_request_t xcb_out; 3139 3140 xcb_out.device_id = device_id; 3141 xcb_out.first_keycode = first_keycode; 3142 xcb_out.keysyms_per_keycode = keysyms_per_keycode; 3143 xcb_out.keycode_count = keycode_count; 3144 3145 xcb_parts[2].iov_base = (char *) &xcb_out; 3146 xcb_parts[2].iov_len = sizeof(xcb_out); 3147 xcb_parts[3].iov_base = 0; 3148 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 3149 /* xcb_keysym_t keysyms */ 3150 xcb_parts[4].iov_base = (char *) keysyms; 3151 xcb_parts[4].iov_len = (keycode_count * keysyms_per_keycode) * sizeof(xcb_keysym_t); 3152 xcb_parts[5].iov_base = 0; 3153 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 3154 3155 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 3156 return xcb_ret; 3157 } 3158 3159 xcb_void_cookie_t 3160 xcb_input_change_device_key_mapping (xcb_connection_t *c /**< */, 3161 uint8_t device_id /**< */, 3162 xcb_input_key_code_t first_keycode /**< */, 3163 uint8_t keysyms_per_keycode /**< */, 3164 uint8_t keycode_count /**< */, 3165 const xcb_keysym_t *keysyms /**< */) 3166 { 3167 static const xcb_protocol_request_t xcb_req = { 3168 /* count */ 4, 3169 /* ext */ &xcb_input_id, 3170 /* opcode */ XCB_INPUT_CHANGE_DEVICE_KEY_MAPPING, 3171 /* isvoid */ 1 3172 }; 3173 3174 struct iovec xcb_parts[6]; 3175 xcb_void_cookie_t xcb_ret; 3176 xcb_input_change_device_key_mapping_request_t xcb_out; 3177 3178 xcb_out.device_id = device_id; 3179 xcb_out.first_keycode = first_keycode; 3180 xcb_out.keysyms_per_keycode = keysyms_per_keycode; 3181 xcb_out.keycode_count = keycode_count; 3182 3183 xcb_parts[2].iov_base = (char *) &xcb_out; 3184 xcb_parts[2].iov_len = sizeof(xcb_out); 3185 xcb_parts[3].iov_base = 0; 3186 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 3187 /* xcb_keysym_t keysyms */ 3188 xcb_parts[4].iov_base = (char *) keysyms; 3189 xcb_parts[4].iov_len = (keycode_count * keysyms_per_keycode) * sizeof(xcb_keysym_t); 3190 xcb_parts[5].iov_base = 0; 3191 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 3192 3193 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 3194 return xcb_ret; 3195 } 3196 3197 int 3198 xcb_input_get_device_modifier_mapping_sizeof (const void *_buffer /**< */) 3199 { 3200 char *xcb_tmp = (char *)_buffer; 3201 const xcb_input_get_device_modifier_mapping_reply_t *_aux = (xcb_input_get_device_modifier_mapping_reply_t *)_buffer; 3202 unsigned int xcb_buffer_len = 0; 3203 unsigned int xcb_block_len = 0; 3204 unsigned int xcb_pad = 0; 3205 unsigned int xcb_align_to = 0; 3206 3207 3208 xcb_block_len += sizeof(xcb_input_get_device_modifier_mapping_reply_t); 3209 xcb_tmp += xcb_block_len; 3210 xcb_buffer_len += xcb_block_len; 3211 xcb_block_len = 0; 3212 /* keymaps */ 3213 xcb_block_len += (_aux->keycodes_per_modifier * 8) * sizeof(uint8_t); 3214 xcb_tmp += xcb_block_len; 3215 xcb_align_to = ALIGNOF(uint8_t); 3216 /* insert padding */ 3217 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 3218 xcb_buffer_len += xcb_block_len + xcb_pad; 3219 if (0 != xcb_pad) { 3220 xcb_tmp += xcb_pad; 3221 xcb_pad = 0; 3222 } 3223 xcb_block_len = 0; 3224 3225 return xcb_buffer_len; 3226 } 3227 3228 xcb_input_get_device_modifier_mapping_cookie_t 3229 xcb_input_get_device_modifier_mapping (xcb_connection_t *c /**< */, 3230 uint8_t device_id /**< */) 3231 { 3232 static const xcb_protocol_request_t xcb_req = { 3233 /* count */ 2, 3234 /* ext */ &xcb_input_id, 3235 /* opcode */ XCB_INPUT_GET_DEVICE_MODIFIER_MAPPING, 3236 /* isvoid */ 0 3237 }; 3238 3239 struct iovec xcb_parts[4]; 3240 xcb_input_get_device_modifier_mapping_cookie_t xcb_ret; 3241 xcb_input_get_device_modifier_mapping_request_t xcb_out; 3242 3243 xcb_out.device_id = device_id; 3244 memset(xcb_out.pad0, 0, 3); 3245 3246 xcb_parts[2].iov_base = (char *) &xcb_out; 3247 xcb_parts[2].iov_len = sizeof(xcb_out); 3248 xcb_parts[3].iov_base = 0; 3249 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 3250 3251 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 3252 return xcb_ret; 3253 } 3254 3255 xcb_input_get_device_modifier_mapping_cookie_t 3256 xcb_input_get_device_modifier_mapping_unchecked (xcb_connection_t *c /**< */, 3257 uint8_t device_id /**< */) 3258 { 3259 static const xcb_protocol_request_t xcb_req = { 3260 /* count */ 2, 3261 /* ext */ &xcb_input_id, 3262 /* opcode */ XCB_INPUT_GET_DEVICE_MODIFIER_MAPPING, 3263 /* isvoid */ 0 3264 }; 3265 3266 struct iovec xcb_parts[4]; 3267 xcb_input_get_device_modifier_mapping_cookie_t xcb_ret; 3268 xcb_input_get_device_modifier_mapping_request_t xcb_out; 3269 3270 xcb_out.device_id = device_id; 3271 memset(xcb_out.pad0, 0, 3); 3272 3273 xcb_parts[2].iov_base = (char *) &xcb_out; 3274 xcb_parts[2].iov_len = sizeof(xcb_out); 3275 xcb_parts[3].iov_base = 0; 3276 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 3277 3278 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 3279 return xcb_ret; 3280 } 3281 3282 uint8_t * 3283 xcb_input_get_device_modifier_mapping_keymaps (const xcb_input_get_device_modifier_mapping_reply_t *R /**< */) 3284 { 3285 return (uint8_t *) (R + 1); 3286 } 3287 3288 int 3289 xcb_input_get_device_modifier_mapping_keymaps_length (const xcb_input_get_device_modifier_mapping_reply_t *R /**< */) 3290 { 3291 return (R->keycodes_per_modifier * 8); 3292 } 3293 3294 xcb_generic_iterator_t 3295 xcb_input_get_device_modifier_mapping_keymaps_end (const xcb_input_get_device_modifier_mapping_reply_t *R /**< */) 3296 { 3297 xcb_generic_iterator_t i; 3298 i.data = ((uint8_t *) (R + 1)) + ((R->keycodes_per_modifier * 8)); 3299 i.rem = 0; 3300 i.index = (char *) i.data - (char *) R; 3301 return i; 3302 } 3303 3304 xcb_input_get_device_modifier_mapping_reply_t * 3305 xcb_input_get_device_modifier_mapping_reply (xcb_connection_t *c /**< */, 3306 xcb_input_get_device_modifier_mapping_cookie_t cookie /**< */, 3307 xcb_generic_error_t **e /**< */) 3308 { 3309 return (xcb_input_get_device_modifier_mapping_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 3310 } 3311 3312 int 3313 xcb_input_set_device_modifier_mapping_sizeof (const void *_buffer /**< */) 3314 { 3315 char *xcb_tmp = (char *)_buffer; 3316 const xcb_input_set_device_modifier_mapping_request_t *_aux = (xcb_input_set_device_modifier_mapping_request_t *)_buffer; 3317 unsigned int xcb_buffer_len = 0; 3318 unsigned int xcb_block_len = 0; 3319 unsigned int xcb_pad = 0; 3320 unsigned int xcb_align_to = 0; 3321 3322 3323 xcb_block_len += sizeof(xcb_input_set_device_modifier_mapping_request_t); 3324 xcb_tmp += xcb_block_len; 3325 xcb_buffer_len += xcb_block_len; 3326 xcb_block_len = 0; 3327 /* keymaps */ 3328 xcb_block_len += (_aux->keycodes_per_modifier * 8) * sizeof(uint8_t); 3329 xcb_tmp += xcb_block_len; 3330 xcb_align_to = ALIGNOF(uint8_t); 3331 /* insert padding */ 3332 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 3333 xcb_buffer_len += xcb_block_len + xcb_pad; 3334 if (0 != xcb_pad) { 3335 xcb_tmp += xcb_pad; 3336 xcb_pad = 0; 3337 } 3338 xcb_block_len = 0; 3339 3340 return xcb_buffer_len; 3341 } 3342 3343 xcb_input_set_device_modifier_mapping_cookie_t 3344 xcb_input_set_device_modifier_mapping (xcb_connection_t *c /**< */, 3345 uint8_t device_id /**< */, 3346 uint8_t keycodes_per_modifier /**< */, 3347 const uint8_t *keymaps /**< */) 3348 { 3349 static const xcb_protocol_request_t xcb_req = { 3350 /* count */ 4, 3351 /* ext */ &xcb_input_id, 3352 /* opcode */ XCB_INPUT_SET_DEVICE_MODIFIER_MAPPING, 3353 /* isvoid */ 0 3354 }; 3355 3356 struct iovec xcb_parts[6]; 3357 xcb_input_set_device_modifier_mapping_cookie_t xcb_ret; 3358 xcb_input_set_device_modifier_mapping_request_t xcb_out; 3359 3360 xcb_out.device_id = device_id; 3361 xcb_out.keycodes_per_modifier = keycodes_per_modifier; 3362 xcb_out.pad0 = 0; 3363 3364 xcb_parts[2].iov_base = (char *) &xcb_out; 3365 xcb_parts[2].iov_len = sizeof(xcb_out); 3366 xcb_parts[3].iov_base = 0; 3367 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 3368 /* uint8_t keymaps */ 3369 xcb_parts[4].iov_base = (char *) keymaps; 3370 xcb_parts[4].iov_len = (keycodes_per_modifier * 8) * sizeof(uint8_t); 3371 xcb_parts[5].iov_base = 0; 3372 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 3373 3374 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 3375 return xcb_ret; 3376 } 3377 3378 xcb_input_set_device_modifier_mapping_cookie_t 3379 xcb_input_set_device_modifier_mapping_unchecked (xcb_connection_t *c /**< */, 3380 uint8_t device_id /**< */, 3381 uint8_t keycodes_per_modifier /**< */, 3382 const uint8_t *keymaps /**< */) 3383 { 3384 static const xcb_protocol_request_t xcb_req = { 3385 /* count */ 4, 3386 /* ext */ &xcb_input_id, 3387 /* opcode */ XCB_INPUT_SET_DEVICE_MODIFIER_MAPPING, 3388 /* isvoid */ 0 3389 }; 3390 3391 struct iovec xcb_parts[6]; 3392 xcb_input_set_device_modifier_mapping_cookie_t xcb_ret; 3393 xcb_input_set_device_modifier_mapping_request_t xcb_out; 3394 3395 xcb_out.device_id = device_id; 3396 xcb_out.keycodes_per_modifier = keycodes_per_modifier; 3397 xcb_out.pad0 = 0; 3398 3399 xcb_parts[2].iov_base = (char *) &xcb_out; 3400 xcb_parts[2].iov_len = sizeof(xcb_out); 3401 xcb_parts[3].iov_base = 0; 3402 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 3403 /* uint8_t keymaps */ 3404 xcb_parts[4].iov_base = (char *) keymaps; 3405 xcb_parts[4].iov_len = (keycodes_per_modifier * 8) * sizeof(uint8_t); 3406 xcb_parts[5].iov_base = 0; 3407 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 3408 3409 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 3410 return xcb_ret; 3411 } 3412 3413 xcb_input_set_device_modifier_mapping_reply_t * 3414 xcb_input_set_device_modifier_mapping_reply (xcb_connection_t *c /**< */, 3415 xcb_input_set_device_modifier_mapping_cookie_t cookie /**< */, 3416 xcb_generic_error_t **e /**< */) 3417 { 3418 return (xcb_input_set_device_modifier_mapping_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 3419 } 3420 3421 int 3422 xcb_input_get_device_button_mapping_sizeof (const void *_buffer /**< */) 3423 { 3424 char *xcb_tmp = (char *)_buffer; 3425 const xcb_input_get_device_button_mapping_reply_t *_aux = (xcb_input_get_device_button_mapping_reply_t *)_buffer; 3426 unsigned int xcb_buffer_len = 0; 3427 unsigned int xcb_block_len = 0; 3428 unsigned int xcb_pad = 0; 3429 unsigned int xcb_align_to = 0; 3430 3431 3432 xcb_block_len += sizeof(xcb_input_get_device_button_mapping_reply_t); 3433 xcb_tmp += xcb_block_len; 3434 xcb_buffer_len += xcb_block_len; 3435 xcb_block_len = 0; 3436 /* map */ 3437 xcb_block_len += _aux->map_size * sizeof(uint8_t); 3438 xcb_tmp += xcb_block_len; 3439 xcb_align_to = ALIGNOF(uint8_t); 3440 /* insert padding */ 3441 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 3442 xcb_buffer_len += xcb_block_len + xcb_pad; 3443 if (0 != xcb_pad) { 3444 xcb_tmp += xcb_pad; 3445 xcb_pad = 0; 3446 } 3447 xcb_block_len = 0; 3448 3449 return xcb_buffer_len; 3450 } 3451 3452 xcb_input_get_device_button_mapping_cookie_t 3453 xcb_input_get_device_button_mapping (xcb_connection_t *c /**< */, 3454 uint8_t device_id /**< */) 3455 { 3456 static const xcb_protocol_request_t xcb_req = { 3457 /* count */ 2, 3458 /* ext */ &xcb_input_id, 3459 /* opcode */ XCB_INPUT_GET_DEVICE_BUTTON_MAPPING, 3460 /* isvoid */ 0 3461 }; 3462 3463 struct iovec xcb_parts[4]; 3464 xcb_input_get_device_button_mapping_cookie_t xcb_ret; 3465 xcb_input_get_device_button_mapping_request_t xcb_out; 3466 3467 xcb_out.device_id = device_id; 3468 memset(xcb_out.pad0, 0, 3); 3469 3470 xcb_parts[2].iov_base = (char *) &xcb_out; 3471 xcb_parts[2].iov_len = sizeof(xcb_out); 3472 xcb_parts[3].iov_base = 0; 3473 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 3474 3475 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 3476 return xcb_ret; 3477 } 3478 3479 xcb_input_get_device_button_mapping_cookie_t 3480 xcb_input_get_device_button_mapping_unchecked (xcb_connection_t *c /**< */, 3481 uint8_t device_id /**< */) 3482 { 3483 static const xcb_protocol_request_t xcb_req = { 3484 /* count */ 2, 3485 /* ext */ &xcb_input_id, 3486 /* opcode */ XCB_INPUT_GET_DEVICE_BUTTON_MAPPING, 3487 /* isvoid */ 0 3488 }; 3489 3490 struct iovec xcb_parts[4]; 3491 xcb_input_get_device_button_mapping_cookie_t xcb_ret; 3492 xcb_input_get_device_button_mapping_request_t xcb_out; 3493 3494 xcb_out.device_id = device_id; 3495 memset(xcb_out.pad0, 0, 3); 3496 3497 xcb_parts[2].iov_base = (char *) &xcb_out; 3498 xcb_parts[2].iov_len = sizeof(xcb_out); 3499 xcb_parts[3].iov_base = 0; 3500 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 3501 3502 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 3503 return xcb_ret; 3504 } 3505 3506 uint8_t * 3507 xcb_input_get_device_button_mapping_map (const xcb_input_get_device_button_mapping_reply_t *R /**< */) 3508 { 3509 return (uint8_t *) (R + 1); 3510 } 3511 3512 int 3513 xcb_input_get_device_button_mapping_map_length (const xcb_input_get_device_button_mapping_reply_t *R /**< */) 3514 { 3515 return R->map_size; 3516 } 3517 3518 xcb_generic_iterator_t 3519 xcb_input_get_device_button_mapping_map_end (const xcb_input_get_device_button_mapping_reply_t *R /**< */) 3520 { 3521 xcb_generic_iterator_t i; 3522 i.data = ((uint8_t *) (R + 1)) + (R->map_size); 3523 i.rem = 0; 3524 i.index = (char *) i.data - (char *) R; 3525 return i; 3526 } 3527 3528 xcb_input_get_device_button_mapping_reply_t * 3529 xcb_input_get_device_button_mapping_reply (xcb_connection_t *c /**< */, 3530 xcb_input_get_device_button_mapping_cookie_t cookie /**< */, 3531 xcb_generic_error_t **e /**< */) 3532 { 3533 return (xcb_input_get_device_button_mapping_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 3534 } 3535 3536 int 3537 xcb_input_set_device_button_mapping_sizeof (const void *_buffer /**< */) 3538 { 3539 char *xcb_tmp = (char *)_buffer; 3540 const xcb_input_set_device_button_mapping_request_t *_aux = (xcb_input_set_device_button_mapping_request_t *)_buffer; 3541 unsigned int xcb_buffer_len = 0; 3542 unsigned int xcb_block_len = 0; 3543 unsigned int xcb_pad = 0; 3544 unsigned int xcb_align_to = 0; 3545 3546 3547 xcb_block_len += sizeof(xcb_input_set_device_button_mapping_request_t); 3548 xcb_tmp += xcb_block_len; 3549 xcb_buffer_len += xcb_block_len; 3550 xcb_block_len = 0; 3551 /* map */ 3552 xcb_block_len += _aux->map_size * sizeof(uint8_t); 3553 xcb_tmp += xcb_block_len; 3554 xcb_align_to = ALIGNOF(uint8_t); 3555 /* insert padding */ 3556 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 3557 xcb_buffer_len += xcb_block_len + xcb_pad; 3558 if (0 != xcb_pad) { 3559 xcb_tmp += xcb_pad; 3560 xcb_pad = 0; 3561 } 3562 xcb_block_len = 0; 3563 3564 return xcb_buffer_len; 3565 } 3566 3567 xcb_input_set_device_button_mapping_cookie_t 3568 xcb_input_set_device_button_mapping (xcb_connection_t *c /**< */, 3569 uint8_t device_id /**< */, 3570 uint8_t map_size /**< */, 3571 const uint8_t *map /**< */) 3572 { 3573 static const xcb_protocol_request_t xcb_req = { 3574 /* count */ 4, 3575 /* ext */ &xcb_input_id, 3576 /* opcode */ XCB_INPUT_SET_DEVICE_BUTTON_MAPPING, 3577 /* isvoid */ 0 3578 }; 3579 3580 struct iovec xcb_parts[6]; 3581 xcb_input_set_device_button_mapping_cookie_t xcb_ret; 3582 xcb_input_set_device_button_mapping_request_t xcb_out; 3583 3584 xcb_out.device_id = device_id; 3585 xcb_out.map_size = map_size; 3586 memset(xcb_out.pad0, 0, 2); 3587 3588 xcb_parts[2].iov_base = (char *) &xcb_out; 3589 xcb_parts[2].iov_len = sizeof(xcb_out); 3590 xcb_parts[3].iov_base = 0; 3591 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 3592 /* uint8_t map */ 3593 xcb_parts[4].iov_base = (char *) map; 3594 xcb_parts[4].iov_len = map_size * sizeof(uint8_t); 3595 xcb_parts[5].iov_base = 0; 3596 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 3597 3598 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 3599 return xcb_ret; 3600 } 3601 3602 xcb_input_set_device_button_mapping_cookie_t 3603 xcb_input_set_device_button_mapping_unchecked (xcb_connection_t *c /**< */, 3604 uint8_t device_id /**< */, 3605 uint8_t map_size /**< */, 3606 const uint8_t *map /**< */) 3607 { 3608 static const xcb_protocol_request_t xcb_req = { 3609 /* count */ 4, 3610 /* ext */ &xcb_input_id, 3611 /* opcode */ XCB_INPUT_SET_DEVICE_BUTTON_MAPPING, 3612 /* isvoid */ 0 3613 }; 3614 3615 struct iovec xcb_parts[6]; 3616 xcb_input_set_device_button_mapping_cookie_t xcb_ret; 3617 xcb_input_set_device_button_mapping_request_t xcb_out; 3618 3619 xcb_out.device_id = device_id; 3620 xcb_out.map_size = map_size; 3621 memset(xcb_out.pad0, 0, 2); 3622 3623 xcb_parts[2].iov_base = (char *) &xcb_out; 3624 xcb_parts[2].iov_len = sizeof(xcb_out); 3625 xcb_parts[3].iov_base = 0; 3626 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 3627 /* uint8_t map */ 3628 xcb_parts[4].iov_base = (char *) map; 3629 xcb_parts[4].iov_len = map_size * sizeof(uint8_t); 3630 xcb_parts[5].iov_base = 0; 3631 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 3632 3633 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 3634 return xcb_ret; 3635 } 3636 3637 xcb_input_set_device_button_mapping_reply_t * 3638 xcb_input_set_device_button_mapping_reply (xcb_connection_t *c /**< */, 3639 xcb_input_set_device_button_mapping_cookie_t cookie /**< */, 3640 xcb_generic_error_t **e /**< */) 3641 { 3642 return (xcb_input_set_device_button_mapping_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 3643 } 3644 3645 void 3646 xcb_input_key_state_next (xcb_input_key_state_iterator_t *i /**< */) 3647 { 3648 --i->rem; 3649 ++i->data; 3650 i->index += sizeof(xcb_input_key_state_t); 3651 } 3652 3653 xcb_generic_iterator_t 3654 xcb_input_key_state_end (xcb_input_key_state_iterator_t i /**< */) 3655 { 3656 xcb_generic_iterator_t ret; 3657 ret.data = i.data + i.rem; 3658 ret.index = i.index + ((char *) ret.data - (char *) i.data); 3659 ret.rem = 0; 3660 return ret; 3661 } 3662 3663 void 3664 xcb_input_button_state_next (xcb_input_button_state_iterator_t *i /**< */) 3665 { 3666 --i->rem; 3667 ++i->data; 3668 i->index += sizeof(xcb_input_button_state_t); 3669 } 3670 3671 xcb_generic_iterator_t 3672 xcb_input_button_state_end (xcb_input_button_state_iterator_t i /**< */) 3673 { 3674 xcb_generic_iterator_t ret; 3675 ret.data = i.data + i.rem; 3676 ret.index = i.index + ((char *) ret.data - (char *) i.data); 3677 ret.rem = 0; 3678 return ret; 3679 } 3680 3681 int 3682 xcb_input_valuator_state_sizeof (const void *_buffer /**< */) 3683 { 3684 char *xcb_tmp = (char *)_buffer; 3685 const xcb_input_valuator_state_t *_aux = (xcb_input_valuator_state_t *)_buffer; 3686 unsigned int xcb_buffer_len = 0; 3687 unsigned int xcb_block_len = 0; 3688 unsigned int xcb_pad = 0; 3689 unsigned int xcb_align_to = 0; 3690 3691 3692 xcb_block_len += sizeof(xcb_input_valuator_state_t); 3693 xcb_tmp += xcb_block_len; 3694 xcb_buffer_len += xcb_block_len; 3695 xcb_block_len = 0; 3696 /* valuators */ 3697 xcb_block_len += _aux->num_valuators * sizeof(uint32_t); 3698 xcb_tmp += xcb_block_len; 3699 xcb_align_to = ALIGNOF(uint32_t); 3700 /* insert padding */ 3701 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 3702 xcb_buffer_len += xcb_block_len + xcb_pad; 3703 if (0 != xcb_pad) { 3704 xcb_tmp += xcb_pad; 3705 xcb_pad = 0; 3706 } 3707 xcb_block_len = 0; 3708 3709 return xcb_buffer_len; 3710 } 3711 3712 uint32_t * 3713 xcb_input_valuator_state_valuators (const xcb_input_valuator_state_t *R /**< */) 3714 { 3715 return (uint32_t *) (R + 1); 3716 } 3717 3718 int 3719 xcb_input_valuator_state_valuators_length (const xcb_input_valuator_state_t *R /**< */) 3720 { 3721 return R->num_valuators; 3722 } 3723 3724 xcb_generic_iterator_t 3725 xcb_input_valuator_state_valuators_end (const xcb_input_valuator_state_t *R /**< */) 3726 { 3727 xcb_generic_iterator_t i; 3728 i.data = ((uint32_t *) (R + 1)) + (R->num_valuators); 3729 i.rem = 0; 3730 i.index = (char *) i.data - (char *) R; 3731 return i; 3732 } 3733 3734 void 3735 xcb_input_valuator_state_next (xcb_input_valuator_state_iterator_t *i /**< */) 3736 { 3737 xcb_input_valuator_state_t *R = i->data; 3738 xcb_generic_iterator_t child; 3739 child.data = (xcb_input_valuator_state_t *)(((char *)R) + xcb_input_valuator_state_sizeof(R)); 3740 i->index = (char *) child.data - (char *) i->data; 3741 --i->rem; 3742 i->data = (xcb_input_valuator_state_t *) child.data; 3743 } 3744 3745 xcb_generic_iterator_t 3746 xcb_input_valuator_state_end (xcb_input_valuator_state_iterator_t i /**< */) 3747 { 3748 xcb_generic_iterator_t ret; 3749 while(i.rem > 0) 3750 xcb_input_valuator_state_next(&i); 3751 ret.data = i.data; 3752 ret.rem = i.rem; 3753 ret.index = i.index; 3754 return ret; 3755 } 3756 3757 int 3758 xcb_input_input_state_sizeof (const void *_buffer /**< */) 3759 { 3760 char *xcb_tmp = (char *)_buffer; 3761 const xcb_input_input_state_t *_aux = (xcb_input_input_state_t *)_buffer; 3762 unsigned int xcb_buffer_len = 0; 3763 unsigned int xcb_block_len = 0; 3764 unsigned int xcb_pad = 0; 3765 unsigned int xcb_align_to = 0; 3766 3767 3768 xcb_block_len += sizeof(xcb_input_input_state_t); 3769 xcb_tmp += xcb_block_len; 3770 xcb_buffer_len += xcb_block_len; 3771 xcb_block_len = 0; 3772 /* uninterpreted_data */ 3773 xcb_block_len += (_aux->len - 4) * sizeof(uint8_t); 3774 xcb_tmp += xcb_block_len; 3775 xcb_align_to = ALIGNOF(uint8_t); 3776 /* insert padding */ 3777 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 3778 xcb_buffer_len += xcb_block_len + xcb_pad; 3779 if (0 != xcb_pad) { 3780 xcb_tmp += xcb_pad; 3781 xcb_pad = 0; 3782 } 3783 xcb_block_len = 0; 3784 3785 return xcb_buffer_len; 3786 } 3787 3788 uint8_t * 3789 xcb_input_input_state_uninterpreted_data (const xcb_input_input_state_t *R /**< */) 3790 { 3791 return (uint8_t *) (R + 1); 3792 } 3793 3794 int 3795 xcb_input_input_state_uninterpreted_data_length (const xcb_input_input_state_t *R /**< */) 3796 { 3797 return (R->len - 4); 3798 } 3799 3800 xcb_generic_iterator_t 3801 xcb_input_input_state_uninterpreted_data_end (const xcb_input_input_state_t *R /**< */) 3802 { 3803 xcb_generic_iterator_t i; 3804 i.data = ((uint8_t *) (R + 1)) + ((R->len - 4)); 3805 i.rem = 0; 3806 i.index = (char *) i.data - (char *) R; 3807 return i; 3808 } 3809 3810 void 3811 xcb_input_input_state_next (xcb_input_input_state_iterator_t *i /**< */) 3812 { 3813 xcb_input_input_state_t *R = i->data; 3814 xcb_generic_iterator_t child; 3815 child.data = (xcb_input_input_state_t *)(((char *)R) + xcb_input_input_state_sizeof(R)); 3816 i->index = (char *) child.data - (char *) i->data; 3817 --i->rem; 3818 i->data = (xcb_input_input_state_t *) child.data; 3819 } 3820 3821 xcb_generic_iterator_t 3822 xcb_input_input_state_end (xcb_input_input_state_iterator_t i /**< */) 3823 { 3824 xcb_generic_iterator_t ret; 3825 while(i.rem > 0) 3826 xcb_input_input_state_next(&i); 3827 ret.data = i.data; 3828 ret.rem = i.rem; 3829 ret.index = i.index; 3830 return ret; 3831 } 3832 3833 int 3834 xcb_input_query_device_state_sizeof (const void *_buffer /**< */) 3835 { 3836 char *xcb_tmp = (char *)_buffer; 3837 const xcb_input_query_device_state_reply_t *_aux = (xcb_input_query_device_state_reply_t *)_buffer; 3838 unsigned int xcb_buffer_len = 0; 3839 unsigned int xcb_block_len = 0; 3840 unsigned int xcb_pad = 0; 3841 unsigned int xcb_align_to = 0; 3842 3843 unsigned int i; 3844 unsigned int xcb_tmp_len; 3845 3846 xcb_block_len += sizeof(xcb_input_query_device_state_reply_t); 3847 xcb_tmp += xcb_block_len; 3848 xcb_buffer_len += xcb_block_len; 3849 xcb_block_len = 0; 3850 /* classes */ 3851 for(i=0; i<_aux->num_classes; i++) { 3852 xcb_tmp_len = xcb_input_input_state_sizeof(xcb_tmp); 3853 xcb_block_len += xcb_tmp_len; 3854 xcb_tmp += xcb_tmp_len; 3855 } 3856 xcb_align_to = ALIGNOF(xcb_input_input_state_t); 3857 /* insert padding */ 3858 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 3859 xcb_buffer_len += xcb_block_len + xcb_pad; 3860 if (0 != xcb_pad) { 3861 xcb_tmp += xcb_pad; 3862 xcb_pad = 0; 3863 } 3864 xcb_block_len = 0; 3865 3866 return xcb_buffer_len; 3867 } 3868 3869 xcb_input_query_device_state_cookie_t 3870 xcb_input_query_device_state (xcb_connection_t *c /**< */, 3871 uint8_t device_id /**< */) 3872 { 3873 static const xcb_protocol_request_t xcb_req = { 3874 /* count */ 2, 3875 /* ext */ &xcb_input_id, 3876 /* opcode */ XCB_INPUT_QUERY_DEVICE_STATE, 3877 /* isvoid */ 0 3878 }; 3879 3880 struct iovec xcb_parts[4]; 3881 xcb_input_query_device_state_cookie_t xcb_ret; 3882 xcb_input_query_device_state_request_t xcb_out; 3883 3884 xcb_out.device_id = device_id; 3885 memset(xcb_out.pad0, 0, 3); 3886 3887 xcb_parts[2].iov_base = (char *) &xcb_out; 3888 xcb_parts[2].iov_len = sizeof(xcb_out); 3889 xcb_parts[3].iov_base = 0; 3890 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 3891 3892 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 3893 return xcb_ret; 3894 } 3895 3896 xcb_input_query_device_state_cookie_t 3897 xcb_input_query_device_state_unchecked (xcb_connection_t *c /**< */, 3898 uint8_t device_id /**< */) 3899 { 3900 static const xcb_protocol_request_t xcb_req = { 3901 /* count */ 2, 3902 /* ext */ &xcb_input_id, 3903 /* opcode */ XCB_INPUT_QUERY_DEVICE_STATE, 3904 /* isvoid */ 0 3905 }; 3906 3907 struct iovec xcb_parts[4]; 3908 xcb_input_query_device_state_cookie_t xcb_ret; 3909 xcb_input_query_device_state_request_t xcb_out; 3910 3911 xcb_out.device_id = device_id; 3912 memset(xcb_out.pad0, 0, 3); 3913 3914 xcb_parts[2].iov_base = (char *) &xcb_out; 3915 xcb_parts[2].iov_len = sizeof(xcb_out); 3916 xcb_parts[3].iov_base = 0; 3917 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 3918 3919 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 3920 return xcb_ret; 3921 } 3922 3923 int 3924 xcb_input_query_device_state_classes_length (const xcb_input_query_device_state_reply_t *R /**< */) 3925 { 3926 return R->num_classes; 3927 } 3928 3929 xcb_input_input_state_iterator_t 3930 xcb_input_query_device_state_classes_iterator (const xcb_input_query_device_state_reply_t *R /**< */) 3931 { 3932 xcb_input_input_state_iterator_t i; 3933 i.data = (xcb_input_input_state_t *) (R + 1); 3934 i.rem = R->num_classes; 3935 i.index = (char *) i.data - (char *) R; 3936 return i; 3937 } 3938 3939 xcb_input_query_device_state_reply_t * 3940 xcb_input_query_device_state_reply (xcb_connection_t *c /**< */, 3941 xcb_input_query_device_state_cookie_t cookie /**< */, 3942 xcb_generic_error_t **e /**< */) 3943 { 3944 return (xcb_input_query_device_state_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 3945 } 3946 3947 int 3948 xcb_input_send_extension_event_sizeof (const void *_buffer /**< */) 3949 { 3950 char *xcb_tmp = (char *)_buffer; 3951 const xcb_input_send_extension_event_request_t *_aux = (xcb_input_send_extension_event_request_t *)_buffer; 3952 unsigned int xcb_buffer_len = 0; 3953 unsigned int xcb_block_len = 0; 3954 unsigned int xcb_pad = 0; 3955 unsigned int xcb_align_to = 0; 3956 3957 3958 xcb_block_len += sizeof(xcb_input_send_extension_event_request_t); 3959 xcb_tmp += xcb_block_len; 3960 xcb_buffer_len += xcb_block_len; 3961 xcb_block_len = 0; 3962 /* events */ 3963 xcb_block_len += (_aux->num_events * 32) * sizeof(uint8_t); 3964 xcb_tmp += xcb_block_len; 3965 xcb_align_to = ALIGNOF(uint8_t); 3966 /* insert padding */ 3967 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 3968 xcb_buffer_len += xcb_block_len + xcb_pad; 3969 if (0 != xcb_pad) { 3970 xcb_tmp += xcb_pad; 3971 xcb_pad = 0; 3972 } 3973 xcb_block_len = 0; 3974 /* classes */ 3975 xcb_block_len += _aux->num_classes * sizeof(xcb_input_event_class_t); 3976 xcb_tmp += xcb_block_len; 3977 xcb_align_to = ALIGNOF(xcb_input_event_class_t); 3978 /* insert padding */ 3979 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 3980 xcb_buffer_len += xcb_block_len + xcb_pad; 3981 if (0 != xcb_pad) { 3982 xcb_tmp += xcb_pad; 3983 xcb_pad = 0; 3984 } 3985 xcb_block_len = 0; 3986 3987 return xcb_buffer_len; 3988 } 3989 3990 xcb_void_cookie_t 3991 xcb_input_send_extension_event_checked (xcb_connection_t *c /**< */, 3992 xcb_window_t destination /**< */, 3993 uint8_t device_id /**< */, 3994 uint8_t propagate /**< */, 3995 uint16_t num_classes /**< */, 3996 uint8_t num_events /**< */, 3997 const uint8_t *events /**< */, 3998 const xcb_input_event_class_t *classes /**< */) 3999 { 4000 static const xcb_protocol_request_t xcb_req = { 4001 /* count */ 6, 4002 /* ext */ &xcb_input_id, 4003 /* opcode */ XCB_INPUT_SEND_EXTENSION_EVENT, 4004 /* isvoid */ 1 4005 }; 4006 4007 struct iovec xcb_parts[8]; 4008 xcb_void_cookie_t xcb_ret; 4009 xcb_input_send_extension_event_request_t xcb_out; 4010 4011 xcb_out.destination = destination; 4012 xcb_out.device_id = device_id; 4013 xcb_out.propagate = propagate; 4014 xcb_out.num_classes = num_classes; 4015 xcb_out.num_events = num_events; 4016 memset(xcb_out.pad0, 0, 3); 4017 4018 xcb_parts[2].iov_base = (char *) &xcb_out; 4019 xcb_parts[2].iov_len = sizeof(xcb_out); 4020 xcb_parts[3].iov_base = 0; 4021 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 4022 /* uint8_t events */ 4023 xcb_parts[4].iov_base = (char *) events; 4024 xcb_parts[4].iov_len = (num_events * 32) * sizeof(uint8_t); 4025 xcb_parts[5].iov_base = 0; 4026 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 4027 /* xcb_input_event_class_t classes */ 4028 xcb_parts[6].iov_base = (char *) classes; 4029 xcb_parts[6].iov_len = num_classes * sizeof(xcb_input_event_class_t); 4030 xcb_parts[7].iov_base = 0; 4031 xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3; 4032 4033 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 4034 return xcb_ret; 4035 } 4036 4037 xcb_void_cookie_t 4038 xcb_input_send_extension_event (xcb_connection_t *c /**< */, 4039 xcb_window_t destination /**< */, 4040 uint8_t device_id /**< */, 4041 uint8_t propagate /**< */, 4042 uint16_t num_classes /**< */, 4043 uint8_t num_events /**< */, 4044 const uint8_t *events /**< */, 4045 const xcb_input_event_class_t *classes /**< */) 4046 { 4047 static const xcb_protocol_request_t xcb_req = { 4048 /* count */ 6, 4049 /* ext */ &xcb_input_id, 4050 /* opcode */ XCB_INPUT_SEND_EXTENSION_EVENT, 4051 /* isvoid */ 1 4052 }; 4053 4054 struct iovec xcb_parts[8]; 4055 xcb_void_cookie_t xcb_ret; 4056 xcb_input_send_extension_event_request_t xcb_out; 4057 4058 xcb_out.destination = destination; 4059 xcb_out.device_id = device_id; 4060 xcb_out.propagate = propagate; 4061 xcb_out.num_classes = num_classes; 4062 xcb_out.num_events = num_events; 4063 memset(xcb_out.pad0, 0, 3); 4064 4065 xcb_parts[2].iov_base = (char *) &xcb_out; 4066 xcb_parts[2].iov_len = sizeof(xcb_out); 4067 xcb_parts[3].iov_base = 0; 4068 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 4069 /* uint8_t events */ 4070 xcb_parts[4].iov_base = (char *) events; 4071 xcb_parts[4].iov_len = (num_events * 32) * sizeof(uint8_t); 4072 xcb_parts[5].iov_base = 0; 4073 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 4074 /* xcb_input_event_class_t classes */ 4075 xcb_parts[6].iov_base = (char *) classes; 4076 xcb_parts[6].iov_len = num_classes * sizeof(xcb_input_event_class_t); 4077 xcb_parts[7].iov_base = 0; 4078 xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3; 4079 4080 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 4081 return xcb_ret; 4082 } 4083 4084 xcb_void_cookie_t 4085 xcb_input_device_bell_checked (xcb_connection_t *c /**< */, 4086 uint8_t device_id /**< */, 4087 uint8_t feedback_id /**< */, 4088 uint8_t feedback_class /**< */, 4089 int8_t percent /**< */) 4090 { 4091 static const xcb_protocol_request_t xcb_req = { 4092 /* count */ 2, 4093 /* ext */ &xcb_input_id, 4094 /* opcode */ XCB_INPUT_DEVICE_BELL, 4095 /* isvoid */ 1 4096 }; 4097 4098 struct iovec xcb_parts[4]; 4099 xcb_void_cookie_t xcb_ret; 4100 xcb_input_device_bell_request_t xcb_out; 4101 4102 xcb_out.device_id = device_id; 4103 xcb_out.feedback_id = feedback_id; 4104 xcb_out.feedback_class = feedback_class; 4105 xcb_out.percent = percent; 4106 4107 xcb_parts[2].iov_base = (char *) &xcb_out; 4108 xcb_parts[2].iov_len = sizeof(xcb_out); 4109 xcb_parts[3].iov_base = 0; 4110 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 4111 4112 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 4113 return xcb_ret; 4114 } 4115 4116 xcb_void_cookie_t 4117 xcb_input_device_bell (xcb_connection_t *c /**< */, 4118 uint8_t device_id /**< */, 4119 uint8_t feedback_id /**< */, 4120 uint8_t feedback_class /**< */, 4121 int8_t percent /**< */) 4122 { 4123 static const xcb_protocol_request_t xcb_req = { 4124 /* count */ 2, 4125 /* ext */ &xcb_input_id, 4126 /* opcode */ XCB_INPUT_DEVICE_BELL, 4127 /* isvoid */ 1 4128 }; 4129 4130 struct iovec xcb_parts[4]; 4131 xcb_void_cookie_t xcb_ret; 4132 xcb_input_device_bell_request_t xcb_out; 4133 4134 xcb_out.device_id = device_id; 4135 xcb_out.feedback_id = feedback_id; 4136 xcb_out.feedback_class = feedback_class; 4137 xcb_out.percent = percent; 4138 4139 xcb_parts[2].iov_base = (char *) &xcb_out; 4140 xcb_parts[2].iov_len = sizeof(xcb_out); 4141 xcb_parts[3].iov_base = 0; 4142 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 4143 4144 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 4145 return xcb_ret; 4146 } 4147 4148 int 4149 xcb_input_set_device_valuators_sizeof (const void *_buffer /**< */) 4150 { 4151 char *xcb_tmp = (char *)_buffer; 4152 const xcb_input_set_device_valuators_request_t *_aux = (xcb_input_set_device_valuators_request_t *)_buffer; 4153 unsigned int xcb_buffer_len = 0; 4154 unsigned int xcb_block_len = 0; 4155 unsigned int xcb_pad = 0; 4156 unsigned int xcb_align_to = 0; 4157 4158 4159 xcb_block_len += sizeof(xcb_input_set_device_valuators_request_t); 4160 xcb_tmp += xcb_block_len; 4161 xcb_buffer_len += xcb_block_len; 4162 xcb_block_len = 0; 4163 /* valuators */ 4164 xcb_block_len += _aux->num_valuators * sizeof(int32_t); 4165 xcb_tmp += xcb_block_len; 4166 xcb_align_to = ALIGNOF(int32_t); 4167 /* insert padding */ 4168 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 4169 xcb_buffer_len += xcb_block_len + xcb_pad; 4170 if (0 != xcb_pad) { 4171 xcb_tmp += xcb_pad; 4172 xcb_pad = 0; 4173 } 4174 xcb_block_len = 0; 4175 4176 return xcb_buffer_len; 4177 } 4178 4179 xcb_input_set_device_valuators_cookie_t 4180 xcb_input_set_device_valuators (xcb_connection_t *c /**< */, 4181 uint8_t device_id /**< */, 4182 uint8_t first_valuator /**< */, 4183 uint8_t num_valuators /**< */, 4184 const int32_t *valuators /**< */) 4185 { 4186 static const xcb_protocol_request_t xcb_req = { 4187 /* count */ 4, 4188 /* ext */ &xcb_input_id, 4189 /* opcode */ XCB_INPUT_SET_DEVICE_VALUATORS, 4190 /* isvoid */ 0 4191 }; 4192 4193 struct iovec xcb_parts[6]; 4194 xcb_input_set_device_valuators_cookie_t xcb_ret; 4195 xcb_input_set_device_valuators_request_t xcb_out; 4196 4197 xcb_out.device_id = device_id; 4198 xcb_out.first_valuator = first_valuator; 4199 xcb_out.num_valuators = num_valuators; 4200 xcb_out.pad0 = 0; 4201 4202 xcb_parts[2].iov_base = (char *) &xcb_out; 4203 xcb_parts[2].iov_len = sizeof(xcb_out); 4204 xcb_parts[3].iov_base = 0; 4205 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 4206 /* int32_t valuators */ 4207 xcb_parts[4].iov_base = (char *) valuators; 4208 xcb_parts[4].iov_len = num_valuators * sizeof(int32_t); 4209 xcb_parts[5].iov_base = 0; 4210 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 4211 4212 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 4213 return xcb_ret; 4214 } 4215 4216 xcb_input_set_device_valuators_cookie_t 4217 xcb_input_set_device_valuators_unchecked (xcb_connection_t *c /**< */, 4218 uint8_t device_id /**< */, 4219 uint8_t first_valuator /**< */, 4220 uint8_t num_valuators /**< */, 4221 const int32_t *valuators /**< */) 4222 { 4223 static const xcb_protocol_request_t xcb_req = { 4224 /* count */ 4, 4225 /* ext */ &xcb_input_id, 4226 /* opcode */ XCB_INPUT_SET_DEVICE_VALUATORS, 4227 /* isvoid */ 0 4228 }; 4229 4230 struct iovec xcb_parts[6]; 4231 xcb_input_set_device_valuators_cookie_t xcb_ret; 4232 xcb_input_set_device_valuators_request_t xcb_out; 4233 4234 xcb_out.device_id = device_id; 4235 xcb_out.first_valuator = first_valuator; 4236 xcb_out.num_valuators = num_valuators; 4237 xcb_out.pad0 = 0; 4238 4239 xcb_parts[2].iov_base = (char *) &xcb_out; 4240 xcb_parts[2].iov_len = sizeof(xcb_out); 4241 xcb_parts[3].iov_base = 0; 4242 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 4243 /* int32_t valuators */ 4244 xcb_parts[4].iov_base = (char *) valuators; 4245 xcb_parts[4].iov_len = num_valuators * sizeof(int32_t); 4246 xcb_parts[5].iov_base = 0; 4247 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 4248 4249 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 4250 return xcb_ret; 4251 } 4252 4253 xcb_input_set_device_valuators_reply_t * 4254 xcb_input_set_device_valuators_reply (xcb_connection_t *c /**< */, 4255 xcb_input_set_device_valuators_cookie_t cookie /**< */, 4256 xcb_generic_error_t **e /**< */) 4257 { 4258 return (xcb_input_set_device_valuators_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 4259 } 4260 4261 int 4262 xcb_input_device_resolution_state_sizeof (const void *_buffer /**< */) 4263 { 4264 char *xcb_tmp = (char *)_buffer; 4265 const xcb_input_device_resolution_state_t *_aux = (xcb_input_device_resolution_state_t *)_buffer; 4266 unsigned int xcb_buffer_len = 0; 4267 unsigned int xcb_block_len = 0; 4268 unsigned int xcb_pad = 0; 4269 unsigned int xcb_align_to = 0; 4270 4271 4272 xcb_block_len += sizeof(xcb_input_device_resolution_state_t); 4273 xcb_tmp += xcb_block_len; 4274 xcb_buffer_len += xcb_block_len; 4275 xcb_block_len = 0; 4276 /* resolution_values */ 4277 xcb_block_len += _aux->num_valuators * sizeof(uint32_t); 4278 xcb_tmp += xcb_block_len; 4279 xcb_align_to = ALIGNOF(uint32_t); 4280 /* insert padding */ 4281 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 4282 xcb_buffer_len += xcb_block_len + xcb_pad; 4283 if (0 != xcb_pad) { 4284 xcb_tmp += xcb_pad; 4285 xcb_pad = 0; 4286 } 4287 xcb_block_len = 0; 4288 /* resolution_min */ 4289 xcb_block_len += _aux->num_valuators * sizeof(uint32_t); 4290 xcb_tmp += xcb_block_len; 4291 xcb_align_to = ALIGNOF(uint32_t); 4292 /* insert padding */ 4293 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 4294 xcb_buffer_len += xcb_block_len + xcb_pad; 4295 if (0 != xcb_pad) { 4296 xcb_tmp += xcb_pad; 4297 xcb_pad = 0; 4298 } 4299 xcb_block_len = 0; 4300 /* resolution_max */ 4301 xcb_block_len += _aux->num_valuators * sizeof(uint32_t); 4302 xcb_tmp += xcb_block_len; 4303 xcb_align_to = ALIGNOF(uint32_t); 4304 /* insert padding */ 4305 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 4306 xcb_buffer_len += xcb_block_len + xcb_pad; 4307 if (0 != xcb_pad) { 4308 xcb_tmp += xcb_pad; 4309 xcb_pad = 0; 4310 } 4311 xcb_block_len = 0; 4312 4313 return xcb_buffer_len; 4314 } 4315 4316 uint32_t * 4317 xcb_input_device_resolution_state_resolution_values (const xcb_input_device_resolution_state_t *R /**< */) 4318 { 4319 return (uint32_t *) (R + 1); 4320 } 4321 4322 int 4323 xcb_input_device_resolution_state_resolution_values_length (const xcb_input_device_resolution_state_t *R /**< */) 4324 { 4325 return R->num_valuators; 4326 } 4327 4328 xcb_generic_iterator_t 4329 xcb_input_device_resolution_state_resolution_values_end (const xcb_input_device_resolution_state_t *R /**< */) 4330 { 4331 xcb_generic_iterator_t i; 4332 i.data = ((uint32_t *) (R + 1)) + (R->num_valuators); 4333 i.rem = 0; 4334 i.index = (char *) i.data - (char *) R; 4335 return i; 4336 } 4337 4338 uint32_t * 4339 xcb_input_device_resolution_state_resolution_min (const xcb_input_device_resolution_state_t *R /**< */) 4340 { 4341 xcb_generic_iterator_t prev = xcb_input_device_resolution_state_resolution_values_end(R); 4342 return (uint32_t *) ((char *) prev.data + XCB_TYPE_PAD(uint32_t, prev.index) + 0); 4343 } 4344 4345 int 4346 xcb_input_device_resolution_state_resolution_min_length (const xcb_input_device_resolution_state_t *R /**< */) 4347 { 4348 return R->num_valuators; 4349 } 4350 4351 xcb_generic_iterator_t 4352 xcb_input_device_resolution_state_resolution_min_end (const xcb_input_device_resolution_state_t *R /**< */) 4353 { 4354 xcb_generic_iterator_t i; 4355 xcb_generic_iterator_t child = xcb_input_device_resolution_state_resolution_values_end(R); 4356 i.data = ((uint32_t *) child.data) + (R->num_valuators); 4357 i.rem = 0; 4358 i.index = (char *) i.data - (char *) R; 4359 return i; 4360 } 4361 4362 uint32_t * 4363 xcb_input_device_resolution_state_resolution_max (const xcb_input_device_resolution_state_t *R /**< */) 4364 { 4365 xcb_generic_iterator_t prev = xcb_input_device_resolution_state_resolution_min_end(R); 4366 return (uint32_t *) ((char *) prev.data + XCB_TYPE_PAD(uint32_t, prev.index) + 0); 4367 } 4368 4369 int 4370 xcb_input_device_resolution_state_resolution_max_length (const xcb_input_device_resolution_state_t *R /**< */) 4371 { 4372 return R->num_valuators; 4373 } 4374 4375 xcb_generic_iterator_t 4376 xcb_input_device_resolution_state_resolution_max_end (const xcb_input_device_resolution_state_t *R /**< */) 4377 { 4378 xcb_generic_iterator_t i; 4379 xcb_generic_iterator_t child = xcb_input_device_resolution_state_resolution_min_end(R); 4380 i.data = ((uint32_t *) child.data) + (R->num_valuators); 4381 i.rem = 0; 4382 i.index = (char *) i.data - (char *) R; 4383 return i; 4384 } 4385 4386 void 4387 xcb_input_device_resolution_state_next (xcb_input_device_resolution_state_iterator_t *i /**< */) 4388 { 4389 xcb_input_device_resolution_state_t *R = i->data; 4390 xcb_generic_iterator_t child; 4391 child.data = (xcb_input_device_resolution_state_t *)(((char *)R) + xcb_input_device_resolution_state_sizeof(R)); 4392 i->index = (char *) child.data - (char *) i->data; 4393 --i->rem; 4394 i->data = (xcb_input_device_resolution_state_t *) child.data; 4395 } 4396 4397 xcb_generic_iterator_t 4398 xcb_input_device_resolution_state_end (xcb_input_device_resolution_state_iterator_t i /**< */) 4399 { 4400 xcb_generic_iterator_t ret; 4401 while(i.rem > 0) 4402 xcb_input_device_resolution_state_next(&i); 4403 ret.data = i.data; 4404 ret.rem = i.rem; 4405 ret.index = i.index; 4406 return ret; 4407 } 4408 4409 void 4410 xcb_input_device_abs_calib_state_next (xcb_input_device_abs_calib_state_iterator_t *i /**< */) 4411 { 4412 --i->rem; 4413 ++i->data; 4414 i->index += sizeof(xcb_input_device_abs_calib_state_t); 4415 } 4416 4417 xcb_generic_iterator_t 4418 xcb_input_device_abs_calib_state_end (xcb_input_device_abs_calib_state_iterator_t i /**< */) 4419 { 4420 xcb_generic_iterator_t ret; 4421 ret.data = i.data + i.rem; 4422 ret.index = i.index + ((char *) ret.data - (char *) i.data); 4423 ret.rem = 0; 4424 return ret; 4425 } 4426 4427 void 4428 xcb_input_device_abs_area_state_next (xcb_input_device_abs_area_state_iterator_t *i /**< */) 4429 { 4430 --i->rem; 4431 ++i->data; 4432 i->index += sizeof(xcb_input_device_abs_area_state_t); 4433 } 4434 4435 xcb_generic_iterator_t 4436 xcb_input_device_abs_area_state_end (xcb_input_device_abs_area_state_iterator_t i /**< */) 4437 { 4438 xcb_generic_iterator_t ret; 4439 ret.data = i.data + i.rem; 4440 ret.index = i.index + ((char *) ret.data - (char *) i.data); 4441 ret.rem = 0; 4442 return ret; 4443 } 4444 4445 void 4446 xcb_input_device_core_state_next (xcb_input_device_core_state_iterator_t *i /**< */) 4447 { 4448 --i->rem; 4449 ++i->data; 4450 i->index += sizeof(xcb_input_device_core_state_t); 4451 } 4452 4453 xcb_generic_iterator_t 4454 xcb_input_device_core_state_end (xcb_input_device_core_state_iterator_t i /**< */) 4455 { 4456 xcb_generic_iterator_t ret; 4457 ret.data = i.data + i.rem; 4458 ret.index = i.index + ((char *) ret.data - (char *) i.data); 4459 ret.rem = 0; 4460 return ret; 4461 } 4462 4463 void 4464 xcb_input_device_enable_state_next (xcb_input_device_enable_state_iterator_t *i /**< */) 4465 { 4466 --i->rem; 4467 ++i->data; 4468 i->index += sizeof(xcb_input_device_enable_state_t); 4469 } 4470 4471 xcb_generic_iterator_t 4472 xcb_input_device_enable_state_end (xcb_input_device_enable_state_iterator_t i /**< */) 4473 { 4474 xcb_generic_iterator_t ret; 4475 ret.data = i.data + i.rem; 4476 ret.index = i.index + ((char *) ret.data - (char *) i.data); 4477 ret.rem = 0; 4478 return ret; 4479 } 4480 4481 int 4482 xcb_input_device_state_sizeof (const void *_buffer /**< */) 4483 { 4484 char *xcb_tmp = (char *)_buffer; 4485 const xcb_input_device_state_t *_aux = (xcb_input_device_state_t *)_buffer; 4486 unsigned int xcb_buffer_len = 0; 4487 unsigned int xcb_block_len = 0; 4488 unsigned int xcb_pad = 0; 4489 unsigned int xcb_align_to = 0; 4490 4491 4492 xcb_block_len += sizeof(xcb_input_device_state_t); 4493 xcb_tmp += xcb_block_len; 4494 xcb_buffer_len += xcb_block_len; 4495 xcb_block_len = 0; 4496 /* uninterpreted_data */ 4497 xcb_block_len += (_aux->len - 4) * sizeof(uint8_t); 4498 xcb_tmp += xcb_block_len; 4499 xcb_align_to = ALIGNOF(uint8_t); 4500 /* insert padding */ 4501 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 4502 xcb_buffer_len += xcb_block_len + xcb_pad; 4503 if (0 != xcb_pad) { 4504 xcb_tmp += xcb_pad; 4505 xcb_pad = 0; 4506 } 4507 xcb_block_len = 0; 4508 4509 return xcb_buffer_len; 4510 } 4511 4512 uint8_t * 4513 xcb_input_device_state_uninterpreted_data (const xcb_input_device_state_t *R /**< */) 4514 { 4515 return (uint8_t *) (R + 1); 4516 } 4517 4518 int 4519 xcb_input_device_state_uninterpreted_data_length (const xcb_input_device_state_t *R /**< */) 4520 { 4521 return (R->len - 4); 4522 } 4523 4524 xcb_generic_iterator_t 4525 xcb_input_device_state_uninterpreted_data_end (const xcb_input_device_state_t *R /**< */) 4526 { 4527 xcb_generic_iterator_t i; 4528 i.data = ((uint8_t *) (R + 1)) + ((R->len - 4)); 4529 i.rem = 0; 4530 i.index = (char *) i.data - (char *) R; 4531 return i; 4532 } 4533 4534 void 4535 xcb_input_device_state_next (xcb_input_device_state_iterator_t *i /**< */) 4536 { 4537 xcb_input_device_state_t *R = i->data; 4538 xcb_generic_iterator_t child; 4539 child.data = (xcb_input_device_state_t *)(((char *)R) + xcb_input_device_state_sizeof(R)); 4540 i->index = (char *) child.data - (char *) i->data; 4541 --i->rem; 4542 i->data = (xcb_input_device_state_t *) child.data; 4543 } 4544 4545 xcb_generic_iterator_t 4546 xcb_input_device_state_end (xcb_input_device_state_iterator_t i /**< */) 4547 { 4548 xcb_generic_iterator_t ret; 4549 while(i.rem > 0) 4550 xcb_input_device_state_next(&i); 4551 ret.data = i.data; 4552 ret.rem = i.rem; 4553 ret.index = i.index; 4554 return ret; 4555 } 4556 4557 int 4558 xcb_input_get_device_control_sizeof (const void *_buffer /**< */) 4559 { 4560 char *xcb_tmp = (char *)_buffer; 4561 unsigned int xcb_buffer_len = 0; 4562 unsigned int xcb_block_len = 0; 4563 unsigned int xcb_pad = 0; 4564 unsigned int xcb_align_to = 0; 4565 4566 4567 xcb_block_len += sizeof(xcb_input_get_device_control_reply_t); 4568 xcb_tmp += xcb_block_len; 4569 xcb_buffer_len += xcb_block_len; 4570 xcb_block_len = 0; 4571 /* control */ 4572 xcb_block_len += xcb_input_device_state_sizeof(xcb_tmp); 4573 xcb_tmp += xcb_block_len; 4574 xcb_align_to = ALIGNOF(xcb_input_device_state_t); 4575 /* insert padding */ 4576 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 4577 xcb_buffer_len += xcb_block_len + xcb_pad; 4578 if (0 != xcb_pad) { 4579 xcb_tmp += xcb_pad; 4580 xcb_pad = 0; 4581 } 4582 xcb_block_len = 0; 4583 4584 return xcb_buffer_len; 4585 } 4586 4587 xcb_input_get_device_control_cookie_t 4588 xcb_input_get_device_control (xcb_connection_t *c /**< */, 4589 uint16_t control_id /**< */, 4590 uint8_t device_id /**< */) 4591 { 4592 static const xcb_protocol_request_t xcb_req = { 4593 /* count */ 2, 4594 /* ext */ &xcb_input_id, 4595 /* opcode */ XCB_INPUT_GET_DEVICE_CONTROL, 4596 /* isvoid */ 0 4597 }; 4598 4599 struct iovec xcb_parts[4]; 4600 xcb_input_get_device_control_cookie_t xcb_ret; 4601 xcb_input_get_device_control_request_t xcb_out; 4602 4603 xcb_out.control_id = control_id; 4604 xcb_out.device_id = device_id; 4605 xcb_out.pad0 = 0; 4606 4607 xcb_parts[2].iov_base = (char *) &xcb_out; 4608 xcb_parts[2].iov_len = sizeof(xcb_out); 4609 xcb_parts[3].iov_base = 0; 4610 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 4611 4612 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 4613 return xcb_ret; 4614 } 4615 4616 xcb_input_get_device_control_cookie_t 4617 xcb_input_get_device_control_unchecked (xcb_connection_t *c /**< */, 4618 uint16_t control_id /**< */, 4619 uint8_t device_id /**< */) 4620 { 4621 static const xcb_protocol_request_t xcb_req = { 4622 /* count */ 2, 4623 /* ext */ &xcb_input_id, 4624 /* opcode */ XCB_INPUT_GET_DEVICE_CONTROL, 4625 /* isvoid */ 0 4626 }; 4627 4628 struct iovec xcb_parts[4]; 4629 xcb_input_get_device_control_cookie_t xcb_ret; 4630 xcb_input_get_device_control_request_t xcb_out; 4631 4632 xcb_out.control_id = control_id; 4633 xcb_out.device_id = device_id; 4634 xcb_out.pad0 = 0; 4635 4636 xcb_parts[2].iov_base = (char *) &xcb_out; 4637 xcb_parts[2].iov_len = sizeof(xcb_out); 4638 xcb_parts[3].iov_base = 0; 4639 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 4640 4641 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 4642 return xcb_ret; 4643 } 4644 4645 xcb_input_device_state_t * 4646 xcb_input_get_device_control_control (const xcb_input_get_device_control_reply_t *R /**< */) 4647 { 4648 return (xcb_input_device_state_t *) (R + 1); 4649 } 4650 4651 xcb_input_get_device_control_reply_t * 4652 xcb_input_get_device_control_reply (xcb_connection_t *c /**< */, 4653 xcb_input_get_device_control_cookie_t cookie /**< */, 4654 xcb_generic_error_t **e /**< */) 4655 { 4656 return (xcb_input_get_device_control_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 4657 } 4658 4659 int 4660 xcb_input_device_resolution_ctl_sizeof (const void *_buffer /**< */) 4661 { 4662 char *xcb_tmp = (char *)_buffer; 4663 const xcb_input_device_resolution_ctl_t *_aux = (xcb_input_device_resolution_ctl_t *)_buffer; 4664 unsigned int xcb_buffer_len = 0; 4665 unsigned int xcb_block_len = 0; 4666 unsigned int xcb_pad = 0; 4667 unsigned int xcb_align_to = 0; 4668 4669 4670 xcb_block_len += sizeof(xcb_input_device_resolution_ctl_t); 4671 xcb_tmp += xcb_block_len; 4672 xcb_buffer_len += xcb_block_len; 4673 xcb_block_len = 0; 4674 /* resolution_values */ 4675 xcb_block_len += _aux->num_valuators * sizeof(uint32_t); 4676 xcb_tmp += xcb_block_len; 4677 xcb_align_to = ALIGNOF(uint32_t); 4678 /* insert padding */ 4679 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 4680 xcb_buffer_len += xcb_block_len + xcb_pad; 4681 if (0 != xcb_pad) { 4682 xcb_tmp += xcb_pad; 4683 xcb_pad = 0; 4684 } 4685 xcb_block_len = 0; 4686 4687 return xcb_buffer_len; 4688 } 4689 4690 uint32_t * 4691 xcb_input_device_resolution_ctl_resolution_values (const xcb_input_device_resolution_ctl_t *R /**< */) 4692 { 4693 return (uint32_t *) (R + 1); 4694 } 4695 4696 int 4697 xcb_input_device_resolution_ctl_resolution_values_length (const xcb_input_device_resolution_ctl_t *R /**< */) 4698 { 4699 return R->num_valuators; 4700 } 4701 4702 xcb_generic_iterator_t 4703 xcb_input_device_resolution_ctl_resolution_values_end (const xcb_input_device_resolution_ctl_t *R /**< */) 4704 { 4705 xcb_generic_iterator_t i; 4706 i.data = ((uint32_t *) (R + 1)) + (R->num_valuators); 4707 i.rem = 0; 4708 i.index = (char *) i.data - (char *) R; 4709 return i; 4710 } 4711 4712 void 4713 xcb_input_device_resolution_ctl_next (xcb_input_device_resolution_ctl_iterator_t *i /**< */) 4714 { 4715 xcb_input_device_resolution_ctl_t *R = i->data; 4716 xcb_generic_iterator_t child; 4717 child.data = (xcb_input_device_resolution_ctl_t *)(((char *)R) + xcb_input_device_resolution_ctl_sizeof(R)); 4718 i->index = (char *) child.data - (char *) i->data; 4719 --i->rem; 4720 i->data = (xcb_input_device_resolution_ctl_t *) child.data; 4721 } 4722 4723 xcb_generic_iterator_t 4724 xcb_input_device_resolution_ctl_end (xcb_input_device_resolution_ctl_iterator_t i /**< */) 4725 { 4726 xcb_generic_iterator_t ret; 4727 while(i.rem > 0) 4728 xcb_input_device_resolution_ctl_next(&i); 4729 ret.data = i.data; 4730 ret.rem = i.rem; 4731 ret.index = i.index; 4732 return ret; 4733 } 4734 4735 void 4736 xcb_input_device_abs_calib_ctl_next (xcb_input_device_abs_calib_ctl_iterator_t *i /**< */) 4737 { 4738 --i->rem; 4739 ++i->data; 4740 i->index += sizeof(xcb_input_device_abs_calib_ctl_t); 4741 } 4742 4743 xcb_generic_iterator_t 4744 xcb_input_device_abs_calib_ctl_end (xcb_input_device_abs_calib_ctl_iterator_t i /**< */) 4745 { 4746 xcb_generic_iterator_t ret; 4747 ret.data = i.data + i.rem; 4748 ret.index = i.index + ((char *) ret.data - (char *) i.data); 4749 ret.rem = 0; 4750 return ret; 4751 } 4752 4753 void 4754 xcb_input_device_abs_area_ctrl_next (xcb_input_device_abs_area_ctrl_iterator_t *i /**< */) 4755 { 4756 --i->rem; 4757 ++i->data; 4758 i->index += sizeof(xcb_input_device_abs_area_ctrl_t); 4759 } 4760 4761 xcb_generic_iterator_t 4762 xcb_input_device_abs_area_ctrl_end (xcb_input_device_abs_area_ctrl_iterator_t i /**< */) 4763 { 4764 xcb_generic_iterator_t ret; 4765 ret.data = i.data + i.rem; 4766 ret.index = i.index + ((char *) ret.data - (char *) i.data); 4767 ret.rem = 0; 4768 return ret; 4769 } 4770 4771 void 4772 xcb_input_device_core_ctrl_next (xcb_input_device_core_ctrl_iterator_t *i /**< */) 4773 { 4774 --i->rem; 4775 ++i->data; 4776 i->index += sizeof(xcb_input_device_core_ctrl_t); 4777 } 4778 4779 xcb_generic_iterator_t 4780 xcb_input_device_core_ctrl_end (xcb_input_device_core_ctrl_iterator_t i /**< */) 4781 { 4782 xcb_generic_iterator_t ret; 4783 ret.data = i.data + i.rem; 4784 ret.index = i.index + ((char *) ret.data - (char *) i.data); 4785 ret.rem = 0; 4786 return ret; 4787 } 4788 4789 void 4790 xcb_input_device_enable_ctrl_next (xcb_input_device_enable_ctrl_iterator_t *i /**< */) 4791 { 4792 --i->rem; 4793 ++i->data; 4794 i->index += sizeof(xcb_input_device_enable_ctrl_t); 4795 } 4796 4797 xcb_generic_iterator_t 4798 xcb_input_device_enable_ctrl_end (xcb_input_device_enable_ctrl_iterator_t i /**< */) 4799 { 4800 xcb_generic_iterator_t ret; 4801 ret.data = i.data + i.rem; 4802 ret.index = i.index + ((char *) ret.data - (char *) i.data); 4803 ret.rem = 0; 4804 return ret; 4805 } 4806 4807 int 4808 xcb_input_device_ctl_sizeof (const void *_buffer /**< */) 4809 { 4810 char *xcb_tmp = (char *)_buffer; 4811 const xcb_input_device_ctl_t *_aux = (xcb_input_device_ctl_t *)_buffer; 4812 unsigned int xcb_buffer_len = 0; 4813 unsigned int xcb_block_len = 0; 4814 unsigned int xcb_pad = 0; 4815 unsigned int xcb_align_to = 0; 4816 4817 4818 xcb_block_len += sizeof(xcb_input_device_ctl_t); 4819 xcb_tmp += xcb_block_len; 4820 xcb_buffer_len += xcb_block_len; 4821 xcb_block_len = 0; 4822 /* uninterpreted_data */ 4823 xcb_block_len += (_aux->len - 4) * sizeof(uint8_t); 4824 xcb_tmp += xcb_block_len; 4825 xcb_align_to = ALIGNOF(uint8_t); 4826 /* insert padding */ 4827 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 4828 xcb_buffer_len += xcb_block_len + xcb_pad; 4829 if (0 != xcb_pad) { 4830 xcb_tmp += xcb_pad; 4831 xcb_pad = 0; 4832 } 4833 xcb_block_len = 0; 4834 4835 return xcb_buffer_len; 4836 } 4837 4838 uint8_t * 4839 xcb_input_device_ctl_uninterpreted_data (const xcb_input_device_ctl_t *R /**< */) 4840 { 4841 return (uint8_t *) (R + 1); 4842 } 4843 4844 int 4845 xcb_input_device_ctl_uninterpreted_data_length (const xcb_input_device_ctl_t *R /**< */) 4846 { 4847 return (R->len - 4); 4848 } 4849 4850 xcb_generic_iterator_t 4851 xcb_input_device_ctl_uninterpreted_data_end (const xcb_input_device_ctl_t *R /**< */) 4852 { 4853 xcb_generic_iterator_t i; 4854 i.data = ((uint8_t *) (R + 1)) + ((R->len - 4)); 4855 i.rem = 0; 4856 i.index = (char *) i.data - (char *) R; 4857 return i; 4858 } 4859 4860 void 4861 xcb_input_device_ctl_next (xcb_input_device_ctl_iterator_t *i /**< */) 4862 { 4863 xcb_input_device_ctl_t *R = i->data; 4864 xcb_generic_iterator_t child; 4865 child.data = (xcb_input_device_ctl_t *)(((char *)R) + xcb_input_device_ctl_sizeof(R)); 4866 i->index = (char *) child.data - (char *) i->data; 4867 --i->rem; 4868 i->data = (xcb_input_device_ctl_t *) child.data; 4869 } 4870 4871 xcb_generic_iterator_t 4872 xcb_input_device_ctl_end (xcb_input_device_ctl_iterator_t i /**< */) 4873 { 4874 xcb_generic_iterator_t ret; 4875 while(i.rem > 0) 4876 xcb_input_device_ctl_next(&i); 4877 ret.data = i.data; 4878 ret.rem = i.rem; 4879 ret.index = i.index; 4880 return ret; 4881 } 4882 4883 int 4884 xcb_input_change_device_control_sizeof (const void *_buffer /**< */) 4885 { 4886 char *xcb_tmp = (char *)_buffer; 4887 unsigned int xcb_buffer_len = 0; 4888 unsigned int xcb_block_len = 0; 4889 unsigned int xcb_pad = 0; 4890 unsigned int xcb_align_to = 0; 4891 4892 4893 xcb_block_len += sizeof(xcb_input_change_device_control_request_t); 4894 xcb_tmp += xcb_block_len; 4895 xcb_buffer_len += xcb_block_len; 4896 xcb_block_len = 0; 4897 /* control */ 4898 xcb_block_len += xcb_input_device_ctl_sizeof(xcb_tmp); 4899 xcb_tmp += xcb_block_len; 4900 xcb_align_to = ALIGNOF(xcb_input_device_ctl_t); 4901 /* insert padding */ 4902 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 4903 xcb_buffer_len += xcb_block_len + xcb_pad; 4904 if (0 != xcb_pad) { 4905 xcb_tmp += xcb_pad; 4906 xcb_pad = 0; 4907 } 4908 xcb_block_len = 0; 4909 4910 return xcb_buffer_len; 4911 } 4912 4913 xcb_input_change_device_control_cookie_t 4914 xcb_input_change_device_control (xcb_connection_t *c /**< */, 4915 uint16_t control_id /**< */, 4916 uint8_t device_id /**< */, 4917 xcb_input_device_ctl_t *control /**< */) 4918 { 4919 static const xcb_protocol_request_t xcb_req = { 4920 /* count */ 4, 4921 /* ext */ &xcb_input_id, 4922 /* opcode */ XCB_INPUT_CHANGE_DEVICE_CONTROL, 4923 /* isvoid */ 0 4924 }; 4925 4926 struct iovec xcb_parts[6]; 4927 xcb_input_change_device_control_cookie_t xcb_ret; 4928 xcb_input_change_device_control_request_t xcb_out; 4929 4930 xcb_out.control_id = control_id; 4931 xcb_out.device_id = device_id; 4932 xcb_out.pad0 = 0; 4933 4934 xcb_parts[2].iov_base = (char *) &xcb_out; 4935 xcb_parts[2].iov_len = sizeof(xcb_out); 4936 xcb_parts[3].iov_base = 0; 4937 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 4938 /* xcb_input_device_ctl_t control */ 4939 xcb_parts[4].iov_base = (char *) control; 4940 xcb_parts[4].iov_len = 4941 xcb_input_device_ctl_sizeof (control); 4942 4943 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 4944 return xcb_ret; 4945 } 4946 4947 xcb_input_change_device_control_cookie_t 4948 xcb_input_change_device_control_unchecked (xcb_connection_t *c /**< */, 4949 uint16_t control_id /**< */, 4950 uint8_t device_id /**< */, 4951 xcb_input_device_ctl_t *control /**< */) 4952 { 4953 static const xcb_protocol_request_t xcb_req = { 4954 /* count */ 4, 4955 /* ext */ &xcb_input_id, 4956 /* opcode */ XCB_INPUT_CHANGE_DEVICE_CONTROL, 4957 /* isvoid */ 0 4958 }; 4959 4960 struct iovec xcb_parts[6]; 4961 xcb_input_change_device_control_cookie_t xcb_ret; 4962 xcb_input_change_device_control_request_t xcb_out; 4963 4964 xcb_out.control_id = control_id; 4965 xcb_out.device_id = device_id; 4966 xcb_out.pad0 = 0; 4967 4968 xcb_parts[2].iov_base = (char *) &xcb_out; 4969 xcb_parts[2].iov_len = sizeof(xcb_out); 4970 xcb_parts[3].iov_base = 0; 4971 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 4972 /* xcb_input_device_ctl_t control */ 4973 xcb_parts[4].iov_base = (char *) control; 4974 xcb_parts[4].iov_len = 4975 xcb_input_device_ctl_sizeof (control); 4976 4977 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 4978 return xcb_ret; 4979 } 4980 4981 xcb_input_change_device_control_reply_t * 4982 xcb_input_change_device_control_reply (xcb_connection_t *c /**< */, 4983 xcb_input_change_device_control_cookie_t cookie /**< */, 4984 xcb_generic_error_t **e /**< */) 4985 { 4986 return (xcb_input_change_device_control_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 4987 } 4988 4989 int 4990 xcb_input_list_device_properties_sizeof (const void *_buffer /**< */) 4991 { 4992 char *xcb_tmp = (char *)_buffer; 4993 const xcb_input_list_device_properties_reply_t *_aux = (xcb_input_list_device_properties_reply_t *)_buffer; 4994 unsigned int xcb_buffer_len = 0; 4995 unsigned int xcb_block_len = 0; 4996 unsigned int xcb_pad = 0; 4997 unsigned int xcb_align_to = 0; 4998 4999 5000 xcb_block_len += sizeof(xcb_input_list_device_properties_reply_t); 5001 xcb_tmp += xcb_block_len; 5002 xcb_buffer_len += xcb_block_len; 5003 xcb_block_len = 0; 5004 /* atoms */ 5005 xcb_block_len += _aux->num_atoms * sizeof(xcb_atom_t); 5006 xcb_tmp += xcb_block_len; 5007 xcb_align_to = ALIGNOF(xcb_atom_t); 5008 /* insert padding */ 5009 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 5010 xcb_buffer_len += xcb_block_len + xcb_pad; 5011 if (0 != xcb_pad) { 5012 xcb_tmp += xcb_pad; 5013 xcb_pad = 0; 5014 } 5015 xcb_block_len = 0; 5016 5017 return xcb_buffer_len; 5018 } 5019 5020 xcb_input_list_device_properties_cookie_t 5021 xcb_input_list_device_properties (xcb_connection_t *c /**< */, 5022 uint8_t device_id /**< */) 5023 { 5024 static const xcb_protocol_request_t xcb_req = { 5025 /* count */ 2, 5026 /* ext */ &xcb_input_id, 5027 /* opcode */ XCB_INPUT_LIST_DEVICE_PROPERTIES, 5028 /* isvoid */ 0 5029 }; 5030 5031 struct iovec xcb_parts[4]; 5032 xcb_input_list_device_properties_cookie_t xcb_ret; 5033 xcb_input_list_device_properties_request_t xcb_out; 5034 5035 xcb_out.device_id = device_id; 5036 memset(xcb_out.pad0, 0, 3); 5037 5038 xcb_parts[2].iov_base = (char *) &xcb_out; 5039 xcb_parts[2].iov_len = sizeof(xcb_out); 5040 xcb_parts[3].iov_base = 0; 5041 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 5042 5043 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 5044 return xcb_ret; 5045 } 5046 5047 xcb_input_list_device_properties_cookie_t 5048 xcb_input_list_device_properties_unchecked (xcb_connection_t *c /**< */, 5049 uint8_t device_id /**< */) 5050 { 5051 static const xcb_protocol_request_t xcb_req = { 5052 /* count */ 2, 5053 /* ext */ &xcb_input_id, 5054 /* opcode */ XCB_INPUT_LIST_DEVICE_PROPERTIES, 5055 /* isvoid */ 0 5056 }; 5057 5058 struct iovec xcb_parts[4]; 5059 xcb_input_list_device_properties_cookie_t xcb_ret; 5060 xcb_input_list_device_properties_request_t xcb_out; 5061 5062 xcb_out.device_id = device_id; 5063 memset(xcb_out.pad0, 0, 3); 5064 5065 xcb_parts[2].iov_base = (char *) &xcb_out; 5066 xcb_parts[2].iov_len = sizeof(xcb_out); 5067 xcb_parts[3].iov_base = 0; 5068 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 5069 5070 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 5071 return xcb_ret; 5072 } 5073 5074 xcb_atom_t * 5075 xcb_input_list_device_properties_atoms (const xcb_input_list_device_properties_reply_t *R /**< */) 5076 { 5077 return (xcb_atom_t *) (R + 1); 5078 } 5079 5080 int 5081 xcb_input_list_device_properties_atoms_length (const xcb_input_list_device_properties_reply_t *R /**< */) 5082 { 5083 return R->num_atoms; 5084 } 5085 5086 xcb_generic_iterator_t 5087 xcb_input_list_device_properties_atoms_end (const xcb_input_list_device_properties_reply_t *R /**< */) 5088 { 5089 xcb_generic_iterator_t i; 5090 i.data = ((xcb_atom_t *) (R + 1)) + (R->num_atoms); 5091 i.rem = 0; 5092 i.index = (char *) i.data - (char *) R; 5093 return i; 5094 } 5095 5096 xcb_input_list_device_properties_reply_t * 5097 xcb_input_list_device_properties_reply (xcb_connection_t *c /**< */, 5098 xcb_input_list_device_properties_cookie_t cookie /**< */, 5099 xcb_generic_error_t **e /**< */) 5100 { 5101 return (xcb_input_list_device_properties_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 5102 } 5103 5104 uint8_t * 5105 xcb_input_change_device_property_items_data_8 (const xcb_input_change_device_property_items_t *S /**< */) 5106 { 5107 return /* items */ S->data8; 5108 } 5109 5110 int 5111 xcb_input_change_device_property_items_data_8_length (const xcb_input_change_device_property_request_t *R /**< */, 5112 const xcb_input_change_device_property_items_t *S /**< */) 5113 { 5114 return R->num_items; 5115 } 5116 5117 xcb_generic_iterator_t 5118 xcb_input_change_device_property_items_data_8_end (const xcb_input_change_device_property_request_t *R /**< */, 5119 const xcb_input_change_device_property_items_t *S /**< */) 5120 { 5121 xcb_generic_iterator_t i; 5122 i.data = /* items */ S->data8 + R->num_items; 5123 i.rem = 0; 5124 i.index = (char *) i.data - (char *) S; 5125 return i; 5126 } 5127 5128 uint16_t * 5129 xcb_input_change_device_property_items_data_16 (const xcb_input_change_device_property_items_t *S /**< */) 5130 { 5131 return /* items */ S->data16; 5132 } 5133 5134 int 5135 xcb_input_change_device_property_items_data_16_length (const xcb_input_change_device_property_request_t *R /**< */, 5136 const xcb_input_change_device_property_items_t *S /**< */) 5137 { 5138 return R->num_items; 5139 } 5140 5141 xcb_generic_iterator_t 5142 xcb_input_change_device_property_items_data_16_end (const xcb_input_change_device_property_request_t *R /**< */, 5143 const xcb_input_change_device_property_items_t *S /**< */) 5144 { 5145 xcb_generic_iterator_t i; 5146 i.data = /* items */ S->data16 + R->num_items; 5147 i.rem = 0; 5148 i.index = (char *) i.data - (char *) S; 5149 return i; 5150 } 5151 5152 uint32_t * 5153 xcb_input_change_device_property_items_data_32 (const xcb_input_change_device_property_items_t *S /**< */) 5154 { 5155 return /* items */ S->data32; 5156 } 5157 5158 int 5159 xcb_input_change_device_property_items_data_32_length (const xcb_input_change_device_property_request_t *R /**< */, 5160 const xcb_input_change_device_property_items_t *S /**< */) 5161 { 5162 return R->num_items; 5163 } 5164 5165 xcb_generic_iterator_t 5166 xcb_input_change_device_property_items_data_32_end (const xcb_input_change_device_property_request_t *R /**< */, 5167 const xcb_input_change_device_property_items_t *S /**< */) 5168 { 5169 xcb_generic_iterator_t i; 5170 i.data = /* items */ S->data32 + R->num_items; 5171 i.rem = 0; 5172 i.index = (char *) i.data - (char *) S; 5173 return i; 5174 } 5175 5176 int 5177 xcb_input_change_device_property_items_serialize (void **_buffer /**< */, 5178 uint32_t num_items /**< */, 5179 uint8_t format /**< */, 5180 const xcb_input_change_device_property_items_t *_aux /**< */) 5181 { 5182 char *xcb_out = *_buffer; 5183 unsigned int xcb_buffer_len = 0; 5184 unsigned int xcb_align_to = 0; 5185 5186 unsigned int xcb_pad = 0; 5187 char xcb_pad0[3] = {0, 0, 0}; 5188 struct iovec xcb_parts[7]; 5189 unsigned int xcb_parts_idx = 0; 5190 unsigned int xcb_block_len = 0; 5191 unsigned int i; 5192 char *xcb_tmp; 5193 5194 if(format & XCB_INPUT_PROPERTY_FORMAT_8_BITS) { 5195 /* insert padding */ 5196 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 5197 xcb_buffer_len += xcb_block_len + xcb_pad; 5198 if (0 != xcb_pad) { 5199 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; 5200 xcb_parts[xcb_parts_idx].iov_len = xcb_pad; 5201 xcb_parts_idx++; 5202 xcb_pad = 0; 5203 } 5204 xcb_block_len = 0; 5205 /* data8 */ 5206 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->data8; 5207 xcb_block_len += num_items * sizeof(uint8_t); 5208 xcb_parts[xcb_parts_idx].iov_len = num_items * sizeof(uint8_t); 5209 xcb_parts_idx++; 5210 xcb_align_to = ALIGNOF(uint8_t); 5211 } 5212 if(format & XCB_INPUT_PROPERTY_FORMAT_16_BITS) { 5213 /* insert padding */ 5214 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 5215 xcb_buffer_len += xcb_block_len + xcb_pad; 5216 if (0 != xcb_pad) { 5217 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; 5218 xcb_parts[xcb_parts_idx].iov_len = xcb_pad; 5219 xcb_parts_idx++; 5220 xcb_pad = 0; 5221 } 5222 xcb_block_len = 0; 5223 /* data16 */ 5224 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->data16; 5225 xcb_block_len += num_items * sizeof(uint16_t); 5226 xcb_parts[xcb_parts_idx].iov_len = num_items * sizeof(uint16_t); 5227 xcb_parts_idx++; 5228 xcb_align_to = ALIGNOF(uint16_t); 5229 } 5230 if(format & XCB_INPUT_PROPERTY_FORMAT_32_BITS) { 5231 /* insert padding */ 5232 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 5233 xcb_buffer_len += xcb_block_len + xcb_pad; 5234 if (0 != xcb_pad) { 5235 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; 5236 xcb_parts[xcb_parts_idx].iov_len = xcb_pad; 5237 xcb_parts_idx++; 5238 xcb_pad = 0; 5239 } 5240 xcb_block_len = 0; 5241 /* data32 */ 5242 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->data32; 5243 xcb_block_len += num_items * sizeof(uint32_t); 5244 xcb_parts[xcb_parts_idx].iov_len = num_items * sizeof(uint32_t); 5245 xcb_parts_idx++; 5246 xcb_align_to = ALIGNOF(uint32_t); 5247 } 5248 /* insert padding */ 5249 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 5250 xcb_buffer_len += xcb_block_len + xcb_pad; 5251 if (0 != xcb_pad) { 5252 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; 5253 xcb_parts[xcb_parts_idx].iov_len = xcb_pad; 5254 xcb_parts_idx++; 5255 xcb_pad = 0; 5256 } 5257 xcb_block_len = 0; 5258 5259 if (NULL == xcb_out) { 5260 /* allocate memory */ 5261 xcb_out = malloc(xcb_buffer_len); 5262 *_buffer = xcb_out; 5263 } 5264 5265 xcb_tmp = xcb_out; 5266 for(i=0; i<xcb_parts_idx; i++) { 5267 if (0 != xcb_parts[i].iov_base && 0 != xcb_parts[i].iov_len) 5268 memcpy(xcb_tmp, xcb_parts[i].iov_base, xcb_parts[i].iov_len); 5269 if (0 != xcb_parts[i].iov_len) 5270 xcb_tmp += xcb_parts[i].iov_len; 5271 } 5272 5273 return xcb_buffer_len; 5274 } 5275 5276 int 5277 xcb_input_change_device_property_items_unpack (const void *_buffer /**< */, 5278 uint32_t num_items /**< */, 5279 uint8_t format /**< */, 5280 xcb_input_change_device_property_items_t *_aux /**< */) 5281 { 5282 char *xcb_tmp = (char *)_buffer; 5283 unsigned int xcb_buffer_len = 0; 5284 unsigned int xcb_block_len = 0; 5285 unsigned int xcb_pad = 0; 5286 unsigned int xcb_align_to = 0; 5287 5288 5289 if(format & XCB_INPUT_PROPERTY_FORMAT_8_BITS) { 5290 /* insert padding */ 5291 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 5292 xcb_buffer_len += xcb_block_len + xcb_pad; 5293 if (0 != xcb_pad) { 5294 xcb_tmp += xcb_pad; 5295 xcb_pad = 0; 5296 } 5297 xcb_block_len = 0; 5298 /* data8 */ 5299 _aux->data8 = (uint8_t *)xcb_tmp; 5300 xcb_block_len += num_items * sizeof(uint8_t); 5301 xcb_tmp += xcb_block_len; 5302 xcb_align_to = ALIGNOF(uint8_t); 5303 } 5304 if(format & XCB_INPUT_PROPERTY_FORMAT_16_BITS) { 5305 /* insert padding */ 5306 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 5307 xcb_buffer_len += xcb_block_len + xcb_pad; 5308 if (0 != xcb_pad) { 5309 xcb_tmp += xcb_pad; 5310 xcb_pad = 0; 5311 } 5312 xcb_block_len = 0; 5313 /* data16 */ 5314 _aux->data16 = (uint16_t *)xcb_tmp; 5315 xcb_block_len += num_items * sizeof(uint16_t); 5316 xcb_tmp += xcb_block_len; 5317 xcb_align_to = ALIGNOF(uint16_t); 5318 } 5319 if(format & XCB_INPUT_PROPERTY_FORMAT_32_BITS) { 5320 /* insert padding */ 5321 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 5322 xcb_buffer_len += xcb_block_len + xcb_pad; 5323 if (0 != xcb_pad) { 5324 xcb_tmp += xcb_pad; 5325 xcb_pad = 0; 5326 } 5327 xcb_block_len = 0; 5328 /* data32 */ 5329 _aux->data32 = (uint32_t *)xcb_tmp; 5330 xcb_block_len += num_items * sizeof(uint32_t); 5331 xcb_tmp += xcb_block_len; 5332 xcb_align_to = ALIGNOF(uint32_t); 5333 } 5334 /* insert padding */ 5335 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 5336 xcb_buffer_len += xcb_block_len + xcb_pad; 5337 if (0 != xcb_pad) { 5338 xcb_tmp += xcb_pad; 5339 xcb_pad = 0; 5340 } 5341 xcb_block_len = 0; 5342 5343 return xcb_buffer_len; 5344 } 5345 5346 int 5347 xcb_input_change_device_property_items_sizeof (const void *_buffer /**< */, 5348 uint32_t num_items /**< */, 5349 uint8_t format /**< */) 5350 { 5351 xcb_input_change_device_property_items_t _aux; 5352 return xcb_input_change_device_property_items_unpack(_buffer, num_items, format, &_aux); 5353 } 5354 5355 xcb_void_cookie_t 5356 xcb_input_change_device_property_checked (xcb_connection_t *c /**< */, 5357 xcb_atom_t property /**< */, 5358 xcb_atom_t type /**< */, 5359 uint8_t device_id /**< */, 5360 uint8_t format /**< */, 5361 uint8_t mode /**< */, 5362 uint32_t num_items /**< */, 5363 const void *items /**< */) 5364 { 5365 static const xcb_protocol_request_t xcb_req = { 5366 /* count */ 3, 5367 /* ext */ &xcb_input_id, 5368 /* opcode */ XCB_INPUT_CHANGE_DEVICE_PROPERTY, 5369 /* isvoid */ 1 5370 }; 5371 5372 struct iovec xcb_parts[5]; 5373 xcb_void_cookie_t xcb_ret; 5374 xcb_input_change_device_property_request_t xcb_out; 5375 5376 xcb_out.property = property; 5377 xcb_out.type = type; 5378 xcb_out.device_id = device_id; 5379 xcb_out.format = format; 5380 xcb_out.mode = mode; 5381 xcb_out.pad0 = 0; 5382 xcb_out.num_items = num_items; 5383 5384 xcb_parts[2].iov_base = (char *) &xcb_out; 5385 xcb_parts[2].iov_len = sizeof(xcb_out); 5386 xcb_parts[3].iov_base = 0; 5387 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 5388 /* xcb_input_change_device_property_items_t items */ 5389 xcb_parts[4].iov_base = (char *) items; 5390 xcb_parts[4].iov_len = 5391 xcb_input_change_device_property_items_sizeof (items, num_items, format); 5392 5393 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 5394 return xcb_ret; 5395 } 5396 5397 xcb_void_cookie_t 5398 xcb_input_change_device_property (xcb_connection_t *c /**< */, 5399 xcb_atom_t property /**< */, 5400 xcb_atom_t type /**< */, 5401 uint8_t device_id /**< */, 5402 uint8_t format /**< */, 5403 uint8_t mode /**< */, 5404 uint32_t num_items /**< */, 5405 const void *items /**< */) 5406 { 5407 static const xcb_protocol_request_t xcb_req = { 5408 /* count */ 3, 5409 /* ext */ &xcb_input_id, 5410 /* opcode */ XCB_INPUT_CHANGE_DEVICE_PROPERTY, 5411 /* isvoid */ 1 5412 }; 5413 5414 struct iovec xcb_parts[5]; 5415 xcb_void_cookie_t xcb_ret; 5416 xcb_input_change_device_property_request_t xcb_out; 5417 5418 xcb_out.property = property; 5419 xcb_out.type = type; 5420 xcb_out.device_id = device_id; 5421 xcb_out.format = format; 5422 xcb_out.mode = mode; 5423 xcb_out.pad0 = 0; 5424 xcb_out.num_items = num_items; 5425 5426 xcb_parts[2].iov_base = (char *) &xcb_out; 5427 xcb_parts[2].iov_len = sizeof(xcb_out); 5428 xcb_parts[3].iov_base = 0; 5429 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 5430 /* xcb_input_change_device_property_items_t items */ 5431 xcb_parts[4].iov_base = (char *) items; 5432 xcb_parts[4].iov_len = 5433 xcb_input_change_device_property_items_sizeof (items, num_items, format); 5434 5435 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 5436 return xcb_ret; 5437 } 5438 5439 xcb_void_cookie_t 5440 xcb_input_change_device_property_aux_checked (xcb_connection_t *c /**< */, 5441 xcb_atom_t property /**< */, 5442 xcb_atom_t type /**< */, 5443 uint8_t device_id /**< */, 5444 uint8_t format /**< */, 5445 uint8_t mode /**< */, 5446 uint32_t num_items /**< */, 5447 const xcb_input_change_device_property_items_t *items /**< */) 5448 { 5449 static const xcb_protocol_request_t xcb_req = { 5450 /* count */ 3, 5451 /* ext */ &xcb_input_id, 5452 /* opcode */ XCB_INPUT_CHANGE_DEVICE_PROPERTY, 5453 /* isvoid */ 1 5454 }; 5455 5456 struct iovec xcb_parts[5]; 5457 xcb_void_cookie_t xcb_ret; 5458 xcb_input_change_device_property_request_t xcb_out; 5459 void *xcb_aux0 = 0; 5460 5461 xcb_out.property = property; 5462 xcb_out.type = type; 5463 xcb_out.device_id = device_id; 5464 xcb_out.format = format; 5465 xcb_out.mode = mode; 5466 xcb_out.pad0 = 0; 5467 xcb_out.num_items = num_items; 5468 5469 xcb_parts[2].iov_base = (char *) &xcb_out; 5470 xcb_parts[2].iov_len = sizeof(xcb_out); 5471 xcb_parts[3].iov_base = 0; 5472 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 5473 /* xcb_input_change_device_property_items_t items */ 5474 xcb_parts[4].iov_len = 5475 xcb_input_change_device_property_items_serialize (&xcb_aux0, num_items, format, items); 5476 xcb_parts[4].iov_base = xcb_aux0; 5477 5478 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 5479 free(xcb_aux0); 5480 return xcb_ret; 5481 } 5482 5483 xcb_void_cookie_t 5484 xcb_input_change_device_property_aux (xcb_connection_t *c /**< */, 5485 xcb_atom_t property /**< */, 5486 xcb_atom_t type /**< */, 5487 uint8_t device_id /**< */, 5488 uint8_t format /**< */, 5489 uint8_t mode /**< */, 5490 uint32_t num_items /**< */, 5491 const xcb_input_change_device_property_items_t *items /**< */) 5492 { 5493 static const xcb_protocol_request_t xcb_req = { 5494 /* count */ 3, 5495 /* ext */ &xcb_input_id, 5496 /* opcode */ XCB_INPUT_CHANGE_DEVICE_PROPERTY, 5497 /* isvoid */ 1 5498 }; 5499 5500 struct iovec xcb_parts[5]; 5501 xcb_void_cookie_t xcb_ret; 5502 xcb_input_change_device_property_request_t xcb_out; 5503 void *xcb_aux0 = 0; 5504 5505 xcb_out.property = property; 5506 xcb_out.type = type; 5507 xcb_out.device_id = device_id; 5508 xcb_out.format = format; 5509 xcb_out.mode = mode; 5510 xcb_out.pad0 = 0; 5511 xcb_out.num_items = num_items; 5512 5513 xcb_parts[2].iov_base = (char *) &xcb_out; 5514 xcb_parts[2].iov_len = sizeof(xcb_out); 5515 xcb_parts[3].iov_base = 0; 5516 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 5517 /* xcb_input_change_device_property_items_t items */ 5518 xcb_parts[4].iov_len = 5519 xcb_input_change_device_property_items_serialize (&xcb_aux0, num_items, format, items); 5520 xcb_parts[4].iov_base = xcb_aux0; 5521 5522 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 5523 free(xcb_aux0); 5524 return xcb_ret; 5525 } 5526 5527 xcb_void_cookie_t 5528 xcb_input_delete_device_property_checked (xcb_connection_t *c /**< */, 5529 xcb_atom_t property /**< */, 5530 uint8_t device_id /**< */) 5531 { 5532 static const xcb_protocol_request_t xcb_req = { 5533 /* count */ 2, 5534 /* ext */ &xcb_input_id, 5535 /* opcode */ XCB_INPUT_DELETE_DEVICE_PROPERTY, 5536 /* isvoid */ 1 5537 }; 5538 5539 struct iovec xcb_parts[4]; 5540 xcb_void_cookie_t xcb_ret; 5541 xcb_input_delete_device_property_request_t xcb_out; 5542 5543 xcb_out.property = property; 5544 xcb_out.device_id = device_id; 5545 memset(xcb_out.pad0, 0, 3); 5546 5547 xcb_parts[2].iov_base = (char *) &xcb_out; 5548 xcb_parts[2].iov_len = sizeof(xcb_out); 5549 xcb_parts[3].iov_base = 0; 5550 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 5551 5552 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 5553 return xcb_ret; 5554 } 5555 5556 xcb_void_cookie_t 5557 xcb_input_delete_device_property (xcb_connection_t *c /**< */, 5558 xcb_atom_t property /**< */, 5559 uint8_t device_id /**< */) 5560 { 5561 static const xcb_protocol_request_t xcb_req = { 5562 /* count */ 2, 5563 /* ext */ &xcb_input_id, 5564 /* opcode */ XCB_INPUT_DELETE_DEVICE_PROPERTY, 5565 /* isvoid */ 1 5566 }; 5567 5568 struct iovec xcb_parts[4]; 5569 xcb_void_cookie_t xcb_ret; 5570 xcb_input_delete_device_property_request_t xcb_out; 5571 5572 xcb_out.property = property; 5573 xcb_out.device_id = device_id; 5574 memset(xcb_out.pad0, 0, 3); 5575 5576 xcb_parts[2].iov_base = (char *) &xcb_out; 5577 xcb_parts[2].iov_len = sizeof(xcb_out); 5578 xcb_parts[3].iov_base = 0; 5579 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 5580 5581 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 5582 return xcb_ret; 5583 } 5584 5585 uint8_t * 5586 xcb_input_get_device_property_items_data_8 (const xcb_input_get_device_property_items_t *S /**< */) 5587 { 5588 return /* items */ S->data8; 5589 } 5590 5591 int 5592 xcb_input_get_device_property_items_data_8_length (const xcb_input_get_device_property_reply_t *R /**< */, 5593 const xcb_input_get_device_property_items_t *S /**< */) 5594 { 5595 return R->num_items; 5596 } 5597 5598 xcb_generic_iterator_t 5599 xcb_input_get_device_property_items_data_8_end (const xcb_input_get_device_property_reply_t *R /**< */, 5600 const xcb_input_get_device_property_items_t *S /**< */) 5601 { 5602 xcb_generic_iterator_t i; 5603 i.data = /* items */ S->data8 + R->num_items; 5604 i.rem = 0; 5605 i.index = (char *) i.data - (char *) S; 5606 return i; 5607 } 5608 5609 uint16_t * 5610 xcb_input_get_device_property_items_data_16 (const xcb_input_get_device_property_items_t *S /**< */) 5611 { 5612 return /* items */ S->data16; 5613 } 5614 5615 int 5616 xcb_input_get_device_property_items_data_16_length (const xcb_input_get_device_property_reply_t *R /**< */, 5617 const xcb_input_get_device_property_items_t *S /**< */) 5618 { 5619 return R->num_items; 5620 } 5621 5622 xcb_generic_iterator_t 5623 xcb_input_get_device_property_items_data_16_end (const xcb_input_get_device_property_reply_t *R /**< */, 5624 const xcb_input_get_device_property_items_t *S /**< */) 5625 { 5626 xcb_generic_iterator_t i; 5627 i.data = /* items */ S->data16 + R->num_items; 5628 i.rem = 0; 5629 i.index = (char *) i.data - (char *) S; 5630 return i; 5631 } 5632 5633 uint32_t * 5634 xcb_input_get_device_property_items_data_32 (const xcb_input_get_device_property_items_t *S /**< */) 5635 { 5636 return /* items */ S->data32; 5637 } 5638 5639 int 5640 xcb_input_get_device_property_items_data_32_length (const xcb_input_get_device_property_reply_t *R /**< */, 5641 const xcb_input_get_device_property_items_t *S /**< */) 5642 { 5643 return R->num_items; 5644 } 5645 5646 xcb_generic_iterator_t 5647 xcb_input_get_device_property_items_data_32_end (const xcb_input_get_device_property_reply_t *R /**< */, 5648 const xcb_input_get_device_property_items_t *S /**< */) 5649 { 5650 xcb_generic_iterator_t i; 5651 i.data = /* items */ S->data32 + R->num_items; 5652 i.rem = 0; 5653 i.index = (char *) i.data - (char *) S; 5654 return i; 5655 } 5656 5657 int 5658 xcb_input_get_device_property_items_serialize (void **_buffer /**< */, 5659 uint32_t num_items /**< */, 5660 uint8_t format /**< */, 5661 const xcb_input_get_device_property_items_t *_aux /**< */) 5662 { 5663 char *xcb_out = *_buffer; 5664 unsigned int xcb_buffer_len = 0; 5665 unsigned int xcb_align_to = 0; 5666 5667 unsigned int xcb_pad = 0; 5668 char xcb_pad0[3] = {0, 0, 0}; 5669 struct iovec xcb_parts[7]; 5670 unsigned int xcb_parts_idx = 0; 5671 unsigned int xcb_block_len = 0; 5672 unsigned int i; 5673 char *xcb_tmp; 5674 5675 if(format & XCB_INPUT_PROPERTY_FORMAT_8_BITS) { 5676 /* insert padding */ 5677 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 5678 xcb_buffer_len += xcb_block_len + xcb_pad; 5679 if (0 != xcb_pad) { 5680 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; 5681 xcb_parts[xcb_parts_idx].iov_len = xcb_pad; 5682 xcb_parts_idx++; 5683 xcb_pad = 0; 5684 } 5685 xcb_block_len = 0; 5686 /* data8 */ 5687 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->data8; 5688 xcb_block_len += num_items * sizeof(uint8_t); 5689 xcb_parts[xcb_parts_idx].iov_len = num_items * sizeof(uint8_t); 5690 xcb_parts_idx++; 5691 xcb_align_to = ALIGNOF(uint8_t); 5692 } 5693 if(format & XCB_INPUT_PROPERTY_FORMAT_16_BITS) { 5694 /* insert padding */ 5695 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 5696 xcb_buffer_len += xcb_block_len + xcb_pad; 5697 if (0 != xcb_pad) { 5698 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; 5699 xcb_parts[xcb_parts_idx].iov_len = xcb_pad; 5700 xcb_parts_idx++; 5701 xcb_pad = 0; 5702 } 5703 xcb_block_len = 0; 5704 /* data16 */ 5705 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->data16; 5706 xcb_block_len += num_items * sizeof(uint16_t); 5707 xcb_parts[xcb_parts_idx].iov_len = num_items * sizeof(uint16_t); 5708 xcb_parts_idx++; 5709 xcb_align_to = ALIGNOF(uint16_t); 5710 } 5711 if(format & XCB_INPUT_PROPERTY_FORMAT_32_BITS) { 5712 /* insert padding */ 5713 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 5714 xcb_buffer_len += xcb_block_len + xcb_pad; 5715 if (0 != xcb_pad) { 5716 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; 5717 xcb_parts[xcb_parts_idx].iov_len = xcb_pad; 5718 xcb_parts_idx++; 5719 xcb_pad = 0; 5720 } 5721 xcb_block_len = 0; 5722 /* data32 */ 5723 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->data32; 5724 xcb_block_len += num_items * sizeof(uint32_t); 5725 xcb_parts[xcb_parts_idx].iov_len = num_items * sizeof(uint32_t); 5726 xcb_parts_idx++; 5727 xcb_align_to = ALIGNOF(uint32_t); 5728 } 5729 /* insert padding */ 5730 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 5731 xcb_buffer_len += xcb_block_len + xcb_pad; 5732 if (0 != xcb_pad) { 5733 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; 5734 xcb_parts[xcb_parts_idx].iov_len = xcb_pad; 5735 xcb_parts_idx++; 5736 xcb_pad = 0; 5737 } 5738 xcb_block_len = 0; 5739 5740 if (NULL == xcb_out) { 5741 /* allocate memory */ 5742 xcb_out = malloc(xcb_buffer_len); 5743 *_buffer = xcb_out; 5744 } 5745 5746 xcb_tmp = xcb_out; 5747 for(i=0; i<xcb_parts_idx; i++) { 5748 if (0 != xcb_parts[i].iov_base && 0 != xcb_parts[i].iov_len) 5749 memcpy(xcb_tmp, xcb_parts[i].iov_base, xcb_parts[i].iov_len); 5750 if (0 != xcb_parts[i].iov_len) 5751 xcb_tmp += xcb_parts[i].iov_len; 5752 } 5753 5754 return xcb_buffer_len; 5755 } 5756 5757 int 5758 xcb_input_get_device_property_items_unpack (const void *_buffer /**< */, 5759 uint32_t num_items /**< */, 5760 uint8_t format /**< */, 5761 xcb_input_get_device_property_items_t *_aux /**< */) 5762 { 5763 char *xcb_tmp = (char *)_buffer; 5764 unsigned int xcb_buffer_len = 0; 5765 unsigned int xcb_block_len = 0; 5766 unsigned int xcb_pad = 0; 5767 unsigned int xcb_align_to = 0; 5768 5769 5770 if(format & XCB_INPUT_PROPERTY_FORMAT_8_BITS) { 5771 /* insert padding */ 5772 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 5773 xcb_buffer_len += xcb_block_len + xcb_pad; 5774 if (0 != xcb_pad) { 5775 xcb_tmp += xcb_pad; 5776 xcb_pad = 0; 5777 } 5778 xcb_block_len = 0; 5779 /* data8 */ 5780 _aux->data8 = (uint8_t *)xcb_tmp; 5781 xcb_block_len += num_items * sizeof(uint8_t); 5782 xcb_tmp += xcb_block_len; 5783 xcb_align_to = ALIGNOF(uint8_t); 5784 } 5785 if(format & XCB_INPUT_PROPERTY_FORMAT_16_BITS) { 5786 /* insert padding */ 5787 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 5788 xcb_buffer_len += xcb_block_len + xcb_pad; 5789 if (0 != xcb_pad) { 5790 xcb_tmp += xcb_pad; 5791 xcb_pad = 0; 5792 } 5793 xcb_block_len = 0; 5794 /* data16 */ 5795 _aux->data16 = (uint16_t *)xcb_tmp; 5796 xcb_block_len += num_items * sizeof(uint16_t); 5797 xcb_tmp += xcb_block_len; 5798 xcb_align_to = ALIGNOF(uint16_t); 5799 } 5800 if(format & XCB_INPUT_PROPERTY_FORMAT_32_BITS) { 5801 /* insert padding */ 5802 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 5803 xcb_buffer_len += xcb_block_len + xcb_pad; 5804 if (0 != xcb_pad) { 5805 xcb_tmp += xcb_pad; 5806 xcb_pad = 0; 5807 } 5808 xcb_block_len = 0; 5809 /* data32 */ 5810 _aux->data32 = (uint32_t *)xcb_tmp; 5811 xcb_block_len += num_items * sizeof(uint32_t); 5812 xcb_tmp += xcb_block_len; 5813 xcb_align_to = ALIGNOF(uint32_t); 5814 } 5815 /* insert padding */ 5816 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 5817 xcb_buffer_len += xcb_block_len + xcb_pad; 5818 if (0 != xcb_pad) { 5819 xcb_tmp += xcb_pad; 5820 xcb_pad = 0; 5821 } 5822 xcb_block_len = 0; 5823 5824 return xcb_buffer_len; 5825 } 5826 5827 int 5828 xcb_input_get_device_property_items_sizeof (const void *_buffer /**< */, 5829 uint32_t num_items /**< */, 5830 uint8_t format /**< */) 5831 { 5832 xcb_input_get_device_property_items_t _aux; 5833 return xcb_input_get_device_property_items_unpack(_buffer, num_items, format, &_aux); 5834 } 5835 5836 xcb_input_get_device_property_cookie_t 5837 xcb_input_get_device_property (xcb_connection_t *c /**< */, 5838 xcb_atom_t property /**< */, 5839 xcb_atom_t type /**< */, 5840 uint32_t offset /**< */, 5841 uint32_t len /**< */, 5842 uint8_t device_id /**< */, 5843 uint8_t _delete /**< */) 5844 { 5845 static const xcb_protocol_request_t xcb_req = { 5846 /* count */ 2, 5847 /* ext */ &xcb_input_id, 5848 /* opcode */ XCB_INPUT_GET_DEVICE_PROPERTY, 5849 /* isvoid */ 0 5850 }; 5851 5852 struct iovec xcb_parts[4]; 5853 xcb_input_get_device_property_cookie_t xcb_ret; 5854 xcb_input_get_device_property_request_t xcb_out; 5855 5856 xcb_out.property = property; 5857 xcb_out.type = type; 5858 xcb_out.offset = offset; 5859 xcb_out.len = len; 5860 xcb_out.device_id = device_id; 5861 xcb_out._delete = _delete; 5862 memset(xcb_out.pad0, 0, 2); 5863 5864 xcb_parts[2].iov_base = (char *) &xcb_out; 5865 xcb_parts[2].iov_len = sizeof(xcb_out); 5866 xcb_parts[3].iov_base = 0; 5867 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 5868 5869 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 5870 return xcb_ret; 5871 } 5872 5873 xcb_input_get_device_property_cookie_t 5874 xcb_input_get_device_property_unchecked (xcb_connection_t *c /**< */, 5875 xcb_atom_t property /**< */, 5876 xcb_atom_t type /**< */, 5877 uint32_t offset /**< */, 5878 uint32_t len /**< */, 5879 uint8_t device_id /**< */, 5880 uint8_t _delete /**< */) 5881 { 5882 static const xcb_protocol_request_t xcb_req = { 5883 /* count */ 2, 5884 /* ext */ &xcb_input_id, 5885 /* opcode */ XCB_INPUT_GET_DEVICE_PROPERTY, 5886 /* isvoid */ 0 5887 }; 5888 5889 struct iovec xcb_parts[4]; 5890 xcb_input_get_device_property_cookie_t xcb_ret; 5891 xcb_input_get_device_property_request_t xcb_out; 5892 5893 xcb_out.property = property; 5894 xcb_out.type = type; 5895 xcb_out.offset = offset; 5896 xcb_out.len = len; 5897 xcb_out.device_id = device_id; 5898 xcb_out._delete = _delete; 5899 memset(xcb_out.pad0, 0, 2); 5900 5901 xcb_parts[2].iov_base = (char *) &xcb_out; 5902 xcb_parts[2].iov_len = sizeof(xcb_out); 5903 xcb_parts[3].iov_base = 0; 5904 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 5905 5906 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 5907 return xcb_ret; 5908 } 5909 5910 void * 5911 xcb_input_get_device_property_items (const xcb_input_get_device_property_reply_t *R /**< */) 5912 { 5913 return (void *) (R + 1); 5914 } 5915 5916 xcb_input_get_device_property_reply_t * 5917 xcb_input_get_device_property_reply (xcb_connection_t *c /**< */, 5918 xcb_input_get_device_property_cookie_t cookie /**< */, 5919 xcb_generic_error_t **e /**< */) 5920 { 5921 return (xcb_input_get_device_property_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 5922 } 5923 5924 void 5925 xcb_input_group_info_next (xcb_input_group_info_iterator_t *i /**< */) 5926 { 5927 --i->rem; 5928 ++i->data; 5929 i->index += sizeof(xcb_input_group_info_t); 5930 } 5931 5932 xcb_generic_iterator_t 5933 xcb_input_group_info_end (xcb_input_group_info_iterator_t i /**< */) 5934 { 5935 xcb_generic_iterator_t ret; 5936 ret.data = i.data + i.rem; 5937 ret.index = i.index + ((char *) ret.data - (char *) i.data); 5938 ret.rem = 0; 5939 return ret; 5940 } 5941 5942 void 5943 xcb_input_modifier_info_next (xcb_input_modifier_info_iterator_t *i /**< */) 5944 { 5945 --i->rem; 5946 ++i->data; 5947 i->index += sizeof(xcb_input_modifier_info_t); 5948 } 5949 5950 xcb_generic_iterator_t 5951 xcb_input_modifier_info_end (xcb_input_modifier_info_iterator_t i /**< */) 5952 { 5953 xcb_generic_iterator_t ret; 5954 ret.data = i.data + i.rem; 5955 ret.index = i.index + ((char *) ret.data - (char *) i.data); 5956 ret.rem = 0; 5957 return ret; 5958 } 5959 5960 int 5961 xcb_input_xi_query_pointer_sizeof (const void *_buffer /**< */) 5962 { 5963 char *xcb_tmp = (char *)_buffer; 5964 const xcb_input_xi_query_pointer_reply_t *_aux = (xcb_input_xi_query_pointer_reply_t *)_buffer; 5965 unsigned int xcb_buffer_len = 0; 5966 unsigned int xcb_block_len = 0; 5967 unsigned int xcb_pad = 0; 5968 unsigned int xcb_align_to = 0; 5969 5970 5971 xcb_block_len += sizeof(xcb_input_xi_query_pointer_reply_t); 5972 xcb_tmp += xcb_block_len; 5973 xcb_buffer_len += xcb_block_len; 5974 xcb_block_len = 0; 5975 /* buttons */ 5976 xcb_block_len += _aux->buttons_len * sizeof(uint32_t); 5977 xcb_tmp += xcb_block_len; 5978 xcb_align_to = ALIGNOF(uint32_t); 5979 /* insert padding */ 5980 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 5981 xcb_buffer_len += xcb_block_len + xcb_pad; 5982 if (0 != xcb_pad) { 5983 xcb_tmp += xcb_pad; 5984 xcb_pad = 0; 5985 } 5986 xcb_block_len = 0; 5987 5988 return xcb_buffer_len; 5989 } 5990 5991 xcb_input_xi_query_pointer_cookie_t 5992 xcb_input_xi_query_pointer (xcb_connection_t *c /**< */, 5993 xcb_window_t window /**< */, 5994 xcb_input_device_id_t deviceid /**< */) 5995 { 5996 static const xcb_protocol_request_t xcb_req = { 5997 /* count */ 2, 5998 /* ext */ &xcb_input_id, 5999 /* opcode */ XCB_INPUT_XI_QUERY_POINTER, 6000 /* isvoid */ 0 6001 }; 6002 6003 struct iovec xcb_parts[4]; 6004 xcb_input_xi_query_pointer_cookie_t xcb_ret; 6005 xcb_input_xi_query_pointer_request_t xcb_out; 6006 6007 xcb_out.window = window; 6008 xcb_out.deviceid = deviceid; 6009 memset(xcb_out.pad0, 0, 2); 6010 6011 xcb_parts[2].iov_base = (char *) &xcb_out; 6012 xcb_parts[2].iov_len = sizeof(xcb_out); 6013 xcb_parts[3].iov_base = 0; 6014 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 6015 6016 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 6017 return xcb_ret; 6018 } 6019 6020 xcb_input_xi_query_pointer_cookie_t 6021 xcb_input_xi_query_pointer_unchecked (xcb_connection_t *c /**< */, 6022 xcb_window_t window /**< */, 6023 xcb_input_device_id_t deviceid /**< */) 6024 { 6025 static const xcb_protocol_request_t xcb_req = { 6026 /* count */ 2, 6027 /* ext */ &xcb_input_id, 6028 /* opcode */ XCB_INPUT_XI_QUERY_POINTER, 6029 /* isvoid */ 0 6030 }; 6031 6032 struct iovec xcb_parts[4]; 6033 xcb_input_xi_query_pointer_cookie_t xcb_ret; 6034 xcb_input_xi_query_pointer_request_t xcb_out; 6035 6036 xcb_out.window = window; 6037 xcb_out.deviceid = deviceid; 6038 memset(xcb_out.pad0, 0, 2); 6039 6040 xcb_parts[2].iov_base = (char *) &xcb_out; 6041 xcb_parts[2].iov_len = sizeof(xcb_out); 6042 xcb_parts[3].iov_base = 0; 6043 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 6044 6045 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 6046 return xcb_ret; 6047 } 6048 6049 uint32_t * 6050 xcb_input_xi_query_pointer_buttons (const xcb_input_xi_query_pointer_reply_t *R /**< */) 6051 { 6052 return (uint32_t *) (R + 1); 6053 } 6054 6055 int 6056 xcb_input_xi_query_pointer_buttons_length (const xcb_input_xi_query_pointer_reply_t *R /**< */) 6057 { 6058 return R->buttons_len; 6059 } 6060 6061 xcb_generic_iterator_t 6062 xcb_input_xi_query_pointer_buttons_end (const xcb_input_xi_query_pointer_reply_t *R /**< */) 6063 { 6064 xcb_generic_iterator_t i; 6065 i.data = ((uint32_t *) (R + 1)) + (R->buttons_len); 6066 i.rem = 0; 6067 i.index = (char *) i.data - (char *) R; 6068 return i; 6069 } 6070 6071 xcb_input_xi_query_pointer_reply_t * 6072 xcb_input_xi_query_pointer_reply (xcb_connection_t *c /**< */, 6073 xcb_input_xi_query_pointer_cookie_t cookie /**< */, 6074 xcb_generic_error_t **e /**< */) 6075 { 6076 return (xcb_input_xi_query_pointer_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 6077 } 6078 6079 xcb_void_cookie_t 6080 xcb_input_xi_warp_pointer_checked (xcb_connection_t *c /**< */, 6081 xcb_window_t src_win /**< */, 6082 xcb_window_t dst_win /**< */, 6083 xcb_input_fp1616_t src_x /**< */, 6084 xcb_input_fp1616_t src_y /**< */, 6085 uint16_t src_width /**< */, 6086 uint16_t src_height /**< */, 6087 xcb_input_fp1616_t dst_x /**< */, 6088 xcb_input_fp1616_t dst_y /**< */, 6089 xcb_input_device_id_t deviceid /**< */) 6090 { 6091 static const xcb_protocol_request_t xcb_req = { 6092 /* count */ 2, 6093 /* ext */ &xcb_input_id, 6094 /* opcode */ XCB_INPUT_XI_WARP_POINTER, 6095 /* isvoid */ 1 6096 }; 6097 6098 struct iovec xcb_parts[4]; 6099 xcb_void_cookie_t xcb_ret; 6100 xcb_input_xi_warp_pointer_request_t xcb_out; 6101 6102 xcb_out.src_win = src_win; 6103 xcb_out.dst_win = dst_win; 6104 xcb_out.src_x = src_x; 6105 xcb_out.src_y = src_y; 6106 xcb_out.src_width = src_width; 6107 xcb_out.src_height = src_height; 6108 xcb_out.dst_x = dst_x; 6109 xcb_out.dst_y = dst_y; 6110 xcb_out.deviceid = deviceid; 6111 memset(xcb_out.pad0, 0, 2); 6112 6113 xcb_parts[2].iov_base = (char *) &xcb_out; 6114 xcb_parts[2].iov_len = sizeof(xcb_out); 6115 xcb_parts[3].iov_base = 0; 6116 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 6117 6118 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 6119 return xcb_ret; 6120 } 6121 6122 xcb_void_cookie_t 6123 xcb_input_xi_warp_pointer (xcb_connection_t *c /**< */, 6124 xcb_window_t src_win /**< */, 6125 xcb_window_t dst_win /**< */, 6126 xcb_input_fp1616_t src_x /**< */, 6127 xcb_input_fp1616_t src_y /**< */, 6128 uint16_t src_width /**< */, 6129 uint16_t src_height /**< */, 6130 xcb_input_fp1616_t dst_x /**< */, 6131 xcb_input_fp1616_t dst_y /**< */, 6132 xcb_input_device_id_t deviceid /**< */) 6133 { 6134 static const xcb_protocol_request_t xcb_req = { 6135 /* count */ 2, 6136 /* ext */ &xcb_input_id, 6137 /* opcode */ XCB_INPUT_XI_WARP_POINTER, 6138 /* isvoid */ 1 6139 }; 6140 6141 struct iovec xcb_parts[4]; 6142 xcb_void_cookie_t xcb_ret; 6143 xcb_input_xi_warp_pointer_request_t xcb_out; 6144 6145 xcb_out.src_win = src_win; 6146 xcb_out.dst_win = dst_win; 6147 xcb_out.src_x = src_x; 6148 xcb_out.src_y = src_y; 6149 xcb_out.src_width = src_width; 6150 xcb_out.src_height = src_height; 6151 xcb_out.dst_x = dst_x; 6152 xcb_out.dst_y = dst_y; 6153 xcb_out.deviceid = deviceid; 6154 memset(xcb_out.pad0, 0, 2); 6155 6156 xcb_parts[2].iov_base = (char *) &xcb_out; 6157 xcb_parts[2].iov_len = sizeof(xcb_out); 6158 xcb_parts[3].iov_base = 0; 6159 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 6160 6161 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 6162 return xcb_ret; 6163 } 6164 6165 xcb_void_cookie_t 6166 xcb_input_xi_change_cursor_checked (xcb_connection_t *c /**< */, 6167 xcb_window_t window /**< */, 6168 xcb_cursor_t cursor /**< */, 6169 xcb_input_device_id_t deviceid /**< */) 6170 { 6171 static const xcb_protocol_request_t xcb_req = { 6172 /* count */ 2, 6173 /* ext */ &xcb_input_id, 6174 /* opcode */ XCB_INPUT_XI_CHANGE_CURSOR, 6175 /* isvoid */ 1 6176 }; 6177 6178 struct iovec xcb_parts[4]; 6179 xcb_void_cookie_t xcb_ret; 6180 xcb_input_xi_change_cursor_request_t xcb_out; 6181 6182 xcb_out.window = window; 6183 xcb_out.cursor = cursor; 6184 xcb_out.deviceid = deviceid; 6185 memset(xcb_out.pad0, 0, 2); 6186 6187 xcb_parts[2].iov_base = (char *) &xcb_out; 6188 xcb_parts[2].iov_len = sizeof(xcb_out); 6189 xcb_parts[3].iov_base = 0; 6190 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 6191 6192 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 6193 return xcb_ret; 6194 } 6195 6196 xcb_void_cookie_t 6197 xcb_input_xi_change_cursor (xcb_connection_t *c /**< */, 6198 xcb_window_t window /**< */, 6199 xcb_cursor_t cursor /**< */, 6200 xcb_input_device_id_t deviceid /**< */) 6201 { 6202 static const xcb_protocol_request_t xcb_req = { 6203 /* count */ 2, 6204 /* ext */ &xcb_input_id, 6205 /* opcode */ XCB_INPUT_XI_CHANGE_CURSOR, 6206 /* isvoid */ 1 6207 }; 6208 6209 struct iovec xcb_parts[4]; 6210 xcb_void_cookie_t xcb_ret; 6211 xcb_input_xi_change_cursor_request_t xcb_out; 6212 6213 xcb_out.window = window; 6214 xcb_out.cursor = cursor; 6215 xcb_out.deviceid = deviceid; 6216 memset(xcb_out.pad0, 0, 2); 6217 6218 xcb_parts[2].iov_base = (char *) &xcb_out; 6219 xcb_parts[2].iov_len = sizeof(xcb_out); 6220 xcb_parts[3].iov_base = 0; 6221 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 6222 6223 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 6224 return xcb_ret; 6225 } 6226 6227 int 6228 xcb_input_add_master_sizeof (const void *_buffer /**< */) 6229 { 6230 char *xcb_tmp = (char *)_buffer; 6231 const xcb_input_add_master_t *_aux = (xcb_input_add_master_t *)_buffer; 6232 unsigned int xcb_buffer_len = 0; 6233 unsigned int xcb_block_len = 0; 6234 unsigned int xcb_pad = 0; 6235 unsigned int xcb_align_to = 0; 6236 6237 6238 xcb_block_len += sizeof(xcb_input_add_master_t); 6239 xcb_tmp += xcb_block_len; 6240 xcb_buffer_len += xcb_block_len; 6241 xcb_block_len = 0; 6242 /* name */ 6243 xcb_block_len += _aux->name_len * sizeof(char); 6244 xcb_tmp += xcb_block_len; 6245 xcb_align_to = ALIGNOF(char); 6246 /* insert padding */ 6247 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 6248 xcb_buffer_len += xcb_block_len + xcb_pad; 6249 if (0 != xcb_pad) { 6250 xcb_tmp += xcb_pad; 6251 xcb_pad = 0; 6252 } 6253 xcb_block_len = 0; 6254 6255 return xcb_buffer_len; 6256 } 6257 6258 char * 6259 xcb_input_add_master_name (const xcb_input_add_master_t *R /**< */) 6260 { 6261 return (char *) (R + 1); 6262 } 6263 6264 int 6265 xcb_input_add_master_name_length (const xcb_input_add_master_t *R /**< */) 6266 { 6267 return R->name_len; 6268 } 6269 6270 xcb_generic_iterator_t 6271 xcb_input_add_master_name_end (const xcb_input_add_master_t *R /**< */) 6272 { 6273 xcb_generic_iterator_t i; 6274 i.data = ((char *) (R + 1)) + (R->name_len); 6275 i.rem = 0; 6276 i.index = (char *) i.data - (char *) R; 6277 return i; 6278 } 6279 6280 void 6281 xcb_input_add_master_next (xcb_input_add_master_iterator_t *i /**< */) 6282 { 6283 xcb_input_add_master_t *R = i->data; 6284 xcb_generic_iterator_t child; 6285 child.data = (xcb_input_add_master_t *)(((char *)R) + xcb_input_add_master_sizeof(R)); 6286 i->index = (char *) child.data - (char *) i->data; 6287 --i->rem; 6288 i->data = (xcb_input_add_master_t *) child.data; 6289 } 6290 6291 xcb_generic_iterator_t 6292 xcb_input_add_master_end (xcb_input_add_master_iterator_t i /**< */) 6293 { 6294 xcb_generic_iterator_t ret; 6295 while(i.rem > 0) 6296 xcb_input_add_master_next(&i); 6297 ret.data = i.data; 6298 ret.rem = i.rem; 6299 ret.index = i.index; 6300 return ret; 6301 } 6302 6303 void 6304 xcb_input_remove_master_next (xcb_input_remove_master_iterator_t *i /**< */) 6305 { 6306 --i->rem; 6307 ++i->data; 6308 i->index += sizeof(xcb_input_remove_master_t); 6309 } 6310 6311 xcb_generic_iterator_t 6312 xcb_input_remove_master_end (xcb_input_remove_master_iterator_t i /**< */) 6313 { 6314 xcb_generic_iterator_t ret; 6315 ret.data = i.data + i.rem; 6316 ret.index = i.index + ((char *) ret.data - (char *) i.data); 6317 ret.rem = 0; 6318 return ret; 6319 } 6320 6321 void 6322 xcb_input_attach_slave_next (xcb_input_attach_slave_iterator_t *i /**< */) 6323 { 6324 --i->rem; 6325 ++i->data; 6326 i->index += sizeof(xcb_input_attach_slave_t); 6327 } 6328 6329 xcb_generic_iterator_t 6330 xcb_input_attach_slave_end (xcb_input_attach_slave_iterator_t i /**< */) 6331 { 6332 xcb_generic_iterator_t ret; 6333 ret.data = i.data + i.rem; 6334 ret.index = i.index + ((char *) ret.data - (char *) i.data); 6335 ret.rem = 0; 6336 return ret; 6337 } 6338 6339 void 6340 xcb_input_detach_slave_next (xcb_input_detach_slave_iterator_t *i /**< */) 6341 { 6342 --i->rem; 6343 ++i->data; 6344 i->index += sizeof(xcb_input_detach_slave_t); 6345 } 6346 6347 xcb_generic_iterator_t 6348 xcb_input_detach_slave_end (xcb_input_detach_slave_iterator_t i /**< */) 6349 { 6350 xcb_generic_iterator_t ret; 6351 ret.data = i.data + i.rem; 6352 ret.index = i.index + ((char *) ret.data - (char *) i.data); 6353 ret.rem = 0; 6354 return ret; 6355 } 6356 6357 int 6358 xcb_input_hierarchy_change_sizeof (const void *_buffer /**< */) 6359 { 6360 char *xcb_tmp = (char *)_buffer; 6361 const xcb_input_hierarchy_change_t *_aux = (xcb_input_hierarchy_change_t *)_buffer; 6362 unsigned int xcb_buffer_len = 0; 6363 unsigned int xcb_block_len = 0; 6364 unsigned int xcb_pad = 0; 6365 unsigned int xcb_align_to = 0; 6366 6367 6368 xcb_block_len += sizeof(xcb_input_hierarchy_change_t); 6369 xcb_tmp += xcb_block_len; 6370 xcb_buffer_len += xcb_block_len; 6371 xcb_block_len = 0; 6372 /* uninterpreted_data */ 6373 xcb_block_len += ((_aux->len * 4) - 4) * sizeof(uint8_t); 6374 xcb_tmp += xcb_block_len; 6375 xcb_align_to = ALIGNOF(uint8_t); 6376 /* insert padding */ 6377 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 6378 xcb_buffer_len += xcb_block_len + xcb_pad; 6379 if (0 != xcb_pad) { 6380 xcb_tmp += xcb_pad; 6381 xcb_pad = 0; 6382 } 6383 xcb_block_len = 0; 6384 6385 return xcb_buffer_len; 6386 } 6387 6388 uint8_t * 6389 xcb_input_hierarchy_change_uninterpreted_data (const xcb_input_hierarchy_change_t *R /**< */) 6390 { 6391 return (uint8_t *) (R + 1); 6392 } 6393 6394 int 6395 xcb_input_hierarchy_change_uninterpreted_data_length (const xcb_input_hierarchy_change_t *R /**< */) 6396 { 6397 return ((R->len * 4) - 4); 6398 } 6399 6400 xcb_generic_iterator_t 6401 xcb_input_hierarchy_change_uninterpreted_data_end (const xcb_input_hierarchy_change_t *R /**< */) 6402 { 6403 xcb_generic_iterator_t i; 6404 i.data = ((uint8_t *) (R + 1)) + (((R->len * 4) - 4)); 6405 i.rem = 0; 6406 i.index = (char *) i.data - (char *) R; 6407 return i; 6408 } 6409 6410 void 6411 xcb_input_hierarchy_change_next (xcb_input_hierarchy_change_iterator_t *i /**< */) 6412 { 6413 xcb_input_hierarchy_change_t *R = i->data; 6414 xcb_generic_iterator_t child; 6415 child.data = (xcb_input_hierarchy_change_t *)(((char *)R) + xcb_input_hierarchy_change_sizeof(R)); 6416 i->index = (char *) child.data - (char *) i->data; 6417 --i->rem; 6418 i->data = (xcb_input_hierarchy_change_t *) child.data; 6419 } 6420 6421 xcb_generic_iterator_t 6422 xcb_input_hierarchy_change_end (xcb_input_hierarchy_change_iterator_t i /**< */) 6423 { 6424 xcb_generic_iterator_t ret; 6425 while(i.rem > 0) 6426 xcb_input_hierarchy_change_next(&i); 6427 ret.data = i.data; 6428 ret.rem = i.rem; 6429 ret.index = i.index; 6430 return ret; 6431 } 6432 6433 int 6434 xcb_input_xi_change_hierarchy_sizeof (const void *_buffer /**< */) 6435 { 6436 char *xcb_tmp = (char *)_buffer; 6437 const xcb_input_xi_change_hierarchy_request_t *_aux = (xcb_input_xi_change_hierarchy_request_t *)_buffer; 6438 unsigned int xcb_buffer_len = 0; 6439 unsigned int xcb_block_len = 0; 6440 unsigned int xcb_pad = 0; 6441 unsigned int xcb_align_to = 0; 6442 6443 unsigned int i; 6444 unsigned int xcb_tmp_len; 6445 6446 xcb_block_len += sizeof(xcb_input_xi_change_hierarchy_request_t); 6447 xcb_tmp += xcb_block_len; 6448 xcb_buffer_len += xcb_block_len; 6449 xcb_block_len = 0; 6450 /* changes */ 6451 for(i=0; i<_aux->num_changes; i++) { 6452 xcb_tmp_len = xcb_input_hierarchy_change_sizeof(xcb_tmp); 6453 xcb_block_len += xcb_tmp_len; 6454 xcb_tmp += xcb_tmp_len; 6455 } 6456 xcb_align_to = ALIGNOF(xcb_input_hierarchy_change_t); 6457 /* insert padding */ 6458 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 6459 xcb_buffer_len += xcb_block_len + xcb_pad; 6460 if (0 != xcb_pad) { 6461 xcb_tmp += xcb_pad; 6462 xcb_pad = 0; 6463 } 6464 xcb_block_len = 0; 6465 6466 return xcb_buffer_len; 6467 } 6468 6469 xcb_void_cookie_t 6470 xcb_input_xi_change_hierarchy_checked (xcb_connection_t *c /**< */, 6471 uint8_t num_changes /**< */, 6472 const xcb_input_hierarchy_change_t *changes /**< */) 6473 { 6474 static const xcb_protocol_request_t xcb_req = { 6475 /* count */ 4, 6476 /* ext */ &xcb_input_id, 6477 /* opcode */ XCB_INPUT_XI_CHANGE_HIERARCHY, 6478 /* isvoid */ 1 6479 }; 6480 6481 struct iovec xcb_parts[6]; 6482 xcb_void_cookie_t xcb_ret; 6483 xcb_input_xi_change_hierarchy_request_t xcb_out; 6484 unsigned int i; 6485 unsigned int xcb_tmp_len; 6486 char *xcb_tmp; 6487 6488 xcb_out.num_changes = num_changes; 6489 memset(xcb_out.pad0, 0, 3); 6490 6491 xcb_parts[2].iov_base = (char *) &xcb_out; 6492 xcb_parts[2].iov_len = sizeof(xcb_out); 6493 xcb_parts[3].iov_base = 0; 6494 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 6495 /* xcb_input_hierarchy_change_t changes */ 6496 xcb_parts[4].iov_base = (char *) changes; 6497 xcb_parts[4].iov_len = 0; 6498 xcb_tmp = (char *)changes; 6499 for(i=0; i<num_changes; i++) { 6500 xcb_tmp_len = xcb_input_hierarchy_change_sizeof(xcb_tmp); 6501 xcb_parts[4].iov_len += xcb_tmp_len; 6502 xcb_tmp += xcb_tmp_len; 6503 } 6504 xcb_parts[5].iov_base = 0; 6505 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 6506 6507 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 6508 return xcb_ret; 6509 } 6510 6511 xcb_void_cookie_t 6512 xcb_input_xi_change_hierarchy (xcb_connection_t *c /**< */, 6513 uint8_t num_changes /**< */, 6514 const xcb_input_hierarchy_change_t *changes /**< */) 6515 { 6516 static const xcb_protocol_request_t xcb_req = { 6517 /* count */ 4, 6518 /* ext */ &xcb_input_id, 6519 /* opcode */ XCB_INPUT_XI_CHANGE_HIERARCHY, 6520 /* isvoid */ 1 6521 }; 6522 6523 struct iovec xcb_parts[6]; 6524 xcb_void_cookie_t xcb_ret; 6525 xcb_input_xi_change_hierarchy_request_t xcb_out; 6526 unsigned int i; 6527 unsigned int xcb_tmp_len; 6528 char *xcb_tmp; 6529 6530 xcb_out.num_changes = num_changes; 6531 memset(xcb_out.pad0, 0, 3); 6532 6533 xcb_parts[2].iov_base = (char *) &xcb_out; 6534 xcb_parts[2].iov_len = sizeof(xcb_out); 6535 xcb_parts[3].iov_base = 0; 6536 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 6537 /* xcb_input_hierarchy_change_t changes */ 6538 xcb_parts[4].iov_base = (char *) changes; 6539 xcb_parts[4].iov_len = 0; 6540 xcb_tmp = (char *)changes; 6541 for(i=0; i<num_changes; i++) { 6542 xcb_tmp_len = xcb_input_hierarchy_change_sizeof(xcb_tmp); 6543 xcb_parts[4].iov_len += xcb_tmp_len; 6544 xcb_tmp += xcb_tmp_len; 6545 } 6546 xcb_parts[5].iov_base = 0; 6547 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 6548 6549 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 6550 return xcb_ret; 6551 } 6552 6553 xcb_void_cookie_t 6554 xcb_input_xi_set_client_pointer_checked (xcb_connection_t *c /**< */, 6555 xcb_window_t window /**< */, 6556 xcb_input_device_id_t deviceid /**< */) 6557 { 6558 static const xcb_protocol_request_t xcb_req = { 6559 /* count */ 2, 6560 /* ext */ &xcb_input_id, 6561 /* opcode */ XCB_INPUT_XI_SET_CLIENT_POINTER, 6562 /* isvoid */ 1 6563 }; 6564 6565 struct iovec xcb_parts[4]; 6566 xcb_void_cookie_t xcb_ret; 6567 xcb_input_xi_set_client_pointer_request_t xcb_out; 6568 6569 xcb_out.window = window; 6570 xcb_out.deviceid = deviceid; 6571 memset(xcb_out.pad0, 0, 2); 6572 6573 xcb_parts[2].iov_base = (char *) &xcb_out; 6574 xcb_parts[2].iov_len = sizeof(xcb_out); 6575 xcb_parts[3].iov_base = 0; 6576 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 6577 6578 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 6579 return xcb_ret; 6580 } 6581 6582 xcb_void_cookie_t 6583 xcb_input_xi_set_client_pointer (xcb_connection_t *c /**< */, 6584 xcb_window_t window /**< */, 6585 xcb_input_device_id_t deviceid /**< */) 6586 { 6587 static const xcb_protocol_request_t xcb_req = { 6588 /* count */ 2, 6589 /* ext */ &xcb_input_id, 6590 /* opcode */ XCB_INPUT_XI_SET_CLIENT_POINTER, 6591 /* isvoid */ 1 6592 }; 6593 6594 struct iovec xcb_parts[4]; 6595 xcb_void_cookie_t xcb_ret; 6596 xcb_input_xi_set_client_pointer_request_t xcb_out; 6597 6598 xcb_out.window = window; 6599 xcb_out.deviceid = deviceid; 6600 memset(xcb_out.pad0, 0, 2); 6601 6602 xcb_parts[2].iov_base = (char *) &xcb_out; 6603 xcb_parts[2].iov_len = sizeof(xcb_out); 6604 xcb_parts[3].iov_base = 0; 6605 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 6606 6607 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 6608 return xcb_ret; 6609 } 6610 6611 xcb_input_xi_get_client_pointer_cookie_t 6612 xcb_input_xi_get_client_pointer (xcb_connection_t *c /**< */, 6613 xcb_window_t window /**< */) 6614 { 6615 static const xcb_protocol_request_t xcb_req = { 6616 /* count */ 2, 6617 /* ext */ &xcb_input_id, 6618 /* opcode */ XCB_INPUT_XI_GET_CLIENT_POINTER, 6619 /* isvoid */ 0 6620 }; 6621 6622 struct iovec xcb_parts[4]; 6623 xcb_input_xi_get_client_pointer_cookie_t xcb_ret; 6624 xcb_input_xi_get_client_pointer_request_t xcb_out; 6625 6626 xcb_out.window = window; 6627 6628 xcb_parts[2].iov_base = (char *) &xcb_out; 6629 xcb_parts[2].iov_len = sizeof(xcb_out); 6630 xcb_parts[3].iov_base = 0; 6631 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 6632 6633 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 6634 return xcb_ret; 6635 } 6636 6637 xcb_input_xi_get_client_pointer_cookie_t 6638 xcb_input_xi_get_client_pointer_unchecked (xcb_connection_t *c /**< */, 6639 xcb_window_t window /**< */) 6640 { 6641 static const xcb_protocol_request_t xcb_req = { 6642 /* count */ 2, 6643 /* ext */ &xcb_input_id, 6644 /* opcode */ XCB_INPUT_XI_GET_CLIENT_POINTER, 6645 /* isvoid */ 0 6646 }; 6647 6648 struct iovec xcb_parts[4]; 6649 xcb_input_xi_get_client_pointer_cookie_t xcb_ret; 6650 xcb_input_xi_get_client_pointer_request_t xcb_out; 6651 6652 xcb_out.window = window; 6653 6654 xcb_parts[2].iov_base = (char *) &xcb_out; 6655 xcb_parts[2].iov_len = sizeof(xcb_out); 6656 xcb_parts[3].iov_base = 0; 6657 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 6658 6659 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 6660 return xcb_ret; 6661 } 6662 6663 xcb_input_xi_get_client_pointer_reply_t * 6664 xcb_input_xi_get_client_pointer_reply (xcb_connection_t *c /**< */, 6665 xcb_input_xi_get_client_pointer_cookie_t cookie /**< */, 6666 xcb_generic_error_t **e /**< */) 6667 { 6668 return (xcb_input_xi_get_client_pointer_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 6669 } 6670 6671 int 6672 xcb_input_event_mask_sizeof (const void *_buffer /**< */) 6673 { 6674 char *xcb_tmp = (char *)_buffer; 6675 const xcb_input_event_mask_t *_aux = (xcb_input_event_mask_t *)_buffer; 6676 unsigned int xcb_buffer_len = 0; 6677 unsigned int xcb_block_len = 0; 6678 unsigned int xcb_pad = 0; 6679 unsigned int xcb_align_to = 0; 6680 6681 6682 xcb_block_len += sizeof(xcb_input_event_mask_t); 6683 xcb_tmp += xcb_block_len; 6684 xcb_buffer_len += xcb_block_len; 6685 xcb_block_len = 0; 6686 /* mask */ 6687 xcb_block_len += _aux->mask_len * sizeof(uint32_t); 6688 xcb_tmp += xcb_block_len; 6689 xcb_align_to = ALIGNOF(uint32_t); 6690 /* insert padding */ 6691 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 6692 xcb_buffer_len += xcb_block_len + xcb_pad; 6693 if (0 != xcb_pad) { 6694 xcb_tmp += xcb_pad; 6695 xcb_pad = 0; 6696 } 6697 xcb_block_len = 0; 6698 6699 return xcb_buffer_len; 6700 } 6701 6702 uint32_t * 6703 xcb_input_event_mask_mask (const xcb_input_event_mask_t *R /**< */) 6704 { 6705 return (uint32_t *) (R + 1); 6706 } 6707 6708 int 6709 xcb_input_event_mask_mask_length (const xcb_input_event_mask_t *R /**< */) 6710 { 6711 return R->mask_len; 6712 } 6713 6714 xcb_generic_iterator_t 6715 xcb_input_event_mask_mask_end (const xcb_input_event_mask_t *R /**< */) 6716 { 6717 xcb_generic_iterator_t i; 6718 i.data = ((uint32_t *) (R + 1)) + (R->mask_len); 6719 i.rem = 0; 6720 i.index = (char *) i.data - (char *) R; 6721 return i; 6722 } 6723 6724 void 6725 xcb_input_event_mask_next (xcb_input_event_mask_iterator_t *i /**< */) 6726 { 6727 xcb_input_event_mask_t *R = i->data; 6728 xcb_generic_iterator_t child; 6729 child.data = (xcb_input_event_mask_t *)(((char *)R) + xcb_input_event_mask_sizeof(R)); 6730 i->index = (char *) child.data - (char *) i->data; 6731 --i->rem; 6732 i->data = (xcb_input_event_mask_t *) child.data; 6733 } 6734 6735 xcb_generic_iterator_t 6736 xcb_input_event_mask_end (xcb_input_event_mask_iterator_t i /**< */) 6737 { 6738 xcb_generic_iterator_t ret; 6739 while(i.rem > 0) 6740 xcb_input_event_mask_next(&i); 6741 ret.data = i.data; 6742 ret.rem = i.rem; 6743 ret.index = i.index; 6744 return ret; 6745 } 6746 6747 int 6748 xcb_input_xi_select_events_sizeof (const void *_buffer /**< */) 6749 { 6750 char *xcb_tmp = (char *)_buffer; 6751 const xcb_input_xi_select_events_request_t *_aux = (xcb_input_xi_select_events_request_t *)_buffer; 6752 unsigned int xcb_buffer_len = 0; 6753 unsigned int xcb_block_len = 0; 6754 unsigned int xcb_pad = 0; 6755 unsigned int xcb_align_to = 0; 6756 6757 unsigned int i; 6758 unsigned int xcb_tmp_len; 6759 6760 xcb_block_len += sizeof(xcb_input_xi_select_events_request_t); 6761 xcb_tmp += xcb_block_len; 6762 xcb_buffer_len += xcb_block_len; 6763 xcb_block_len = 0; 6764 /* masks */ 6765 for(i=0; i<_aux->num_mask; i++) { 6766 xcb_tmp_len = xcb_input_event_mask_sizeof(xcb_tmp); 6767 xcb_block_len += xcb_tmp_len; 6768 xcb_tmp += xcb_tmp_len; 6769 } 6770 xcb_align_to = ALIGNOF(xcb_input_event_mask_t); 6771 /* insert padding */ 6772 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 6773 xcb_buffer_len += xcb_block_len + xcb_pad; 6774 if (0 != xcb_pad) { 6775 xcb_tmp += xcb_pad; 6776 xcb_pad = 0; 6777 } 6778 xcb_block_len = 0; 6779 6780 return xcb_buffer_len; 6781 } 6782 6783 xcb_void_cookie_t 6784 xcb_input_xi_select_events_checked (xcb_connection_t *c /**< */, 6785 xcb_window_t window /**< */, 6786 uint16_t num_mask /**< */, 6787 const xcb_input_event_mask_t *masks /**< */) 6788 { 6789 static const xcb_protocol_request_t xcb_req = { 6790 /* count */ 4, 6791 /* ext */ &xcb_input_id, 6792 /* opcode */ XCB_INPUT_XI_SELECT_EVENTS, 6793 /* isvoid */ 1 6794 }; 6795 6796 struct iovec xcb_parts[6]; 6797 xcb_void_cookie_t xcb_ret; 6798 xcb_input_xi_select_events_request_t xcb_out; 6799 unsigned int i; 6800 unsigned int xcb_tmp_len; 6801 char *xcb_tmp; 6802 6803 xcb_out.window = window; 6804 xcb_out.num_mask = num_mask; 6805 memset(xcb_out.pad0, 0, 2); 6806 6807 xcb_parts[2].iov_base = (char *) &xcb_out; 6808 xcb_parts[2].iov_len = sizeof(xcb_out); 6809 xcb_parts[3].iov_base = 0; 6810 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 6811 /* xcb_input_event_mask_t masks */ 6812 xcb_parts[4].iov_base = (char *) masks; 6813 xcb_parts[4].iov_len = 0; 6814 xcb_tmp = (char *)masks; 6815 for(i=0; i<num_mask; i++) { 6816 xcb_tmp_len = xcb_input_event_mask_sizeof(xcb_tmp); 6817 xcb_parts[4].iov_len += xcb_tmp_len; 6818 xcb_tmp += xcb_tmp_len; 6819 } 6820 xcb_parts[5].iov_base = 0; 6821 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 6822 6823 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 6824 return xcb_ret; 6825 } 6826 6827 xcb_void_cookie_t 6828 xcb_input_xi_select_events (xcb_connection_t *c /**< */, 6829 xcb_window_t window /**< */, 6830 uint16_t num_mask /**< */, 6831 const xcb_input_event_mask_t *masks /**< */) 6832 { 6833 static const xcb_protocol_request_t xcb_req = { 6834 /* count */ 4, 6835 /* ext */ &xcb_input_id, 6836 /* opcode */ XCB_INPUT_XI_SELECT_EVENTS, 6837 /* isvoid */ 1 6838 }; 6839 6840 struct iovec xcb_parts[6]; 6841 xcb_void_cookie_t xcb_ret; 6842 xcb_input_xi_select_events_request_t xcb_out; 6843 unsigned int i; 6844 unsigned int xcb_tmp_len; 6845 char *xcb_tmp; 6846 6847 xcb_out.window = window; 6848 xcb_out.num_mask = num_mask; 6849 memset(xcb_out.pad0, 0, 2); 6850 6851 xcb_parts[2].iov_base = (char *) &xcb_out; 6852 xcb_parts[2].iov_len = sizeof(xcb_out); 6853 xcb_parts[3].iov_base = 0; 6854 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 6855 /* xcb_input_event_mask_t masks */ 6856 xcb_parts[4].iov_base = (char *) masks; 6857 xcb_parts[4].iov_len = 0; 6858 xcb_tmp = (char *)masks; 6859 for(i=0; i<num_mask; i++) { 6860 xcb_tmp_len = xcb_input_event_mask_sizeof(xcb_tmp); 6861 xcb_parts[4].iov_len += xcb_tmp_len; 6862 xcb_tmp += xcb_tmp_len; 6863 } 6864 xcb_parts[5].iov_base = 0; 6865 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 6866 6867 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 6868 return xcb_ret; 6869 } 6870 6871 xcb_input_xi_query_version_cookie_t 6872 xcb_input_xi_query_version (xcb_connection_t *c /**< */, 6873 uint16_t major_version /**< */, 6874 uint16_t minor_version /**< */) 6875 { 6876 static const xcb_protocol_request_t xcb_req = { 6877 /* count */ 2, 6878 /* ext */ &xcb_input_id, 6879 /* opcode */ XCB_INPUT_XI_QUERY_VERSION, 6880 /* isvoid */ 0 6881 }; 6882 6883 struct iovec xcb_parts[4]; 6884 xcb_input_xi_query_version_cookie_t xcb_ret; 6885 xcb_input_xi_query_version_request_t xcb_out; 6886 6887 xcb_out.major_version = major_version; 6888 xcb_out.minor_version = minor_version; 6889 6890 xcb_parts[2].iov_base = (char *) &xcb_out; 6891 xcb_parts[2].iov_len = sizeof(xcb_out); 6892 xcb_parts[3].iov_base = 0; 6893 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 6894 6895 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 6896 return xcb_ret; 6897 } 6898 6899 xcb_input_xi_query_version_cookie_t 6900 xcb_input_xi_query_version_unchecked (xcb_connection_t *c /**< */, 6901 uint16_t major_version /**< */, 6902 uint16_t minor_version /**< */) 6903 { 6904 static const xcb_protocol_request_t xcb_req = { 6905 /* count */ 2, 6906 /* ext */ &xcb_input_id, 6907 /* opcode */ XCB_INPUT_XI_QUERY_VERSION, 6908 /* isvoid */ 0 6909 }; 6910 6911 struct iovec xcb_parts[4]; 6912 xcb_input_xi_query_version_cookie_t xcb_ret; 6913 xcb_input_xi_query_version_request_t xcb_out; 6914 6915 xcb_out.major_version = major_version; 6916 xcb_out.minor_version = minor_version; 6917 6918 xcb_parts[2].iov_base = (char *) &xcb_out; 6919 xcb_parts[2].iov_len = sizeof(xcb_out); 6920 xcb_parts[3].iov_base = 0; 6921 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 6922 6923 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 6924 return xcb_ret; 6925 } 6926 6927 xcb_input_xi_query_version_reply_t * 6928 xcb_input_xi_query_version_reply (xcb_connection_t *c /**< */, 6929 xcb_input_xi_query_version_cookie_t cookie /**< */, 6930 xcb_generic_error_t **e /**< */) 6931 { 6932 return (xcb_input_xi_query_version_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 6933 } 6934 6935 int 6936 xcb_input_button_class_sizeof (const void *_buffer /**< */) 6937 { 6938 char *xcb_tmp = (char *)_buffer; 6939 const xcb_input_button_class_t *_aux = (xcb_input_button_class_t *)_buffer; 6940 unsigned int xcb_buffer_len = 0; 6941 unsigned int xcb_block_len = 0; 6942 unsigned int xcb_pad = 0; 6943 unsigned int xcb_align_to = 0; 6944 6945 6946 xcb_block_len += sizeof(xcb_input_button_class_t); 6947 xcb_tmp += xcb_block_len; 6948 xcb_buffer_len += xcb_block_len; 6949 xcb_block_len = 0; 6950 /* state */ 6951 xcb_block_len += ((_aux->num_buttons + 31) / 32) * sizeof(xcb_atom_t); 6952 xcb_tmp += xcb_block_len; 6953 xcb_align_to = ALIGNOF(uint32_t); 6954 /* insert padding */ 6955 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 6956 xcb_buffer_len += xcb_block_len + xcb_pad; 6957 if (0 != xcb_pad) { 6958 xcb_tmp += xcb_pad; 6959 xcb_pad = 0; 6960 } 6961 xcb_block_len = 0; 6962 /* labels */ 6963 xcb_block_len += _aux->num_buttons * sizeof(xcb_atom_t); 6964 xcb_tmp += xcb_block_len; 6965 xcb_align_to = ALIGNOF(xcb_atom_t); 6966 /* insert padding */ 6967 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 6968 xcb_buffer_len += xcb_block_len + xcb_pad; 6969 if (0 != xcb_pad) { 6970 xcb_tmp += xcb_pad; 6971 xcb_pad = 0; 6972 } 6973 xcb_block_len = 0; 6974 6975 return xcb_buffer_len; 6976 } 6977 6978 uint32_t * 6979 xcb_input_button_class_state (const xcb_input_button_class_t *R /**< */) 6980 { 6981 return (uint32_t *) (R + 1); 6982 } 6983 6984 int 6985 xcb_input_button_class_state_length (const xcb_input_button_class_t *R /**< */) 6986 { 6987 return ((R->num_buttons + 31) / 32); 6988 } 6989 6990 xcb_generic_iterator_t 6991 xcb_input_button_class_state_end (const xcb_input_button_class_t *R /**< */) 6992 { 6993 xcb_generic_iterator_t i; 6994 i.data = ((uint32_t *) (R + 1)) + (((R->num_buttons + 31) / 32)); 6995 i.rem = 0; 6996 i.index = (char *) i.data - (char *) R; 6997 return i; 6998 } 6999 7000 xcb_atom_t * 7001 xcb_input_button_class_labels (const xcb_input_button_class_t *R /**< */) 7002 { 7003 xcb_generic_iterator_t prev = xcb_input_button_class_state_end(R); 7004 return (xcb_atom_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_atom_t, prev.index) + 0); 7005 } 7006 7007 int 7008 xcb_input_button_class_labels_length (const xcb_input_button_class_t *R /**< */) 7009 { 7010 return R->num_buttons; 7011 } 7012 7013 xcb_generic_iterator_t 7014 xcb_input_button_class_labels_end (const xcb_input_button_class_t *R /**< */) 7015 { 7016 xcb_generic_iterator_t i; 7017 xcb_generic_iterator_t child = xcb_input_button_class_state_end(R); 7018 i.data = ((xcb_atom_t *) child.data) + (R->num_buttons); 7019 i.rem = 0; 7020 i.index = (char *) i.data - (char *) R; 7021 return i; 7022 } 7023 7024 void 7025 xcb_input_button_class_next (xcb_input_button_class_iterator_t *i /**< */) 7026 { 7027 xcb_input_button_class_t *R = i->data; 7028 xcb_generic_iterator_t child; 7029 child.data = (xcb_input_button_class_t *)(((char *)R) + xcb_input_button_class_sizeof(R)); 7030 i->index = (char *) child.data - (char *) i->data; 7031 --i->rem; 7032 i->data = (xcb_input_button_class_t *) child.data; 7033 } 7034 7035 xcb_generic_iterator_t 7036 xcb_input_button_class_end (xcb_input_button_class_iterator_t i /**< */) 7037 { 7038 xcb_generic_iterator_t ret; 7039 while(i.rem > 0) 7040 xcb_input_button_class_next(&i); 7041 ret.data = i.data; 7042 ret.rem = i.rem; 7043 ret.index = i.index; 7044 return ret; 7045 } 7046 7047 int 7048 xcb_input_key_class_sizeof (const void *_buffer /**< */) 7049 { 7050 char *xcb_tmp = (char *)_buffer; 7051 const xcb_input_key_class_t *_aux = (xcb_input_key_class_t *)_buffer; 7052 unsigned int xcb_buffer_len = 0; 7053 unsigned int xcb_block_len = 0; 7054 unsigned int xcb_pad = 0; 7055 unsigned int xcb_align_to = 0; 7056 7057 7058 xcb_block_len += sizeof(xcb_input_key_class_t); 7059 xcb_tmp += xcb_block_len; 7060 xcb_buffer_len += xcb_block_len; 7061 xcb_block_len = 0; 7062 /* keys */ 7063 xcb_block_len += _aux->num_keys * sizeof(uint32_t); 7064 xcb_tmp += xcb_block_len; 7065 xcb_align_to = ALIGNOF(uint32_t); 7066 /* insert padding */ 7067 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 7068 xcb_buffer_len += xcb_block_len + xcb_pad; 7069 if (0 != xcb_pad) { 7070 xcb_tmp += xcb_pad; 7071 xcb_pad = 0; 7072 } 7073 xcb_block_len = 0; 7074 7075 return xcb_buffer_len; 7076 } 7077 7078 uint32_t * 7079 xcb_input_key_class_keys (const xcb_input_key_class_t *R /**< */) 7080 { 7081 return (uint32_t *) (R + 1); 7082 } 7083 7084 int 7085 xcb_input_key_class_keys_length (const xcb_input_key_class_t *R /**< */) 7086 { 7087 return R->num_keys; 7088 } 7089 7090 xcb_generic_iterator_t 7091 xcb_input_key_class_keys_end (const xcb_input_key_class_t *R /**< */) 7092 { 7093 xcb_generic_iterator_t i; 7094 i.data = ((uint32_t *) (R + 1)) + (R->num_keys); 7095 i.rem = 0; 7096 i.index = (char *) i.data - (char *) R; 7097 return i; 7098 } 7099 7100 void 7101 xcb_input_key_class_next (xcb_input_key_class_iterator_t *i /**< */) 7102 { 7103 xcb_input_key_class_t *R = i->data; 7104 xcb_generic_iterator_t child; 7105 child.data = (xcb_input_key_class_t *)(((char *)R) + xcb_input_key_class_sizeof(R)); 7106 i->index = (char *) child.data - (char *) i->data; 7107 --i->rem; 7108 i->data = (xcb_input_key_class_t *) child.data; 7109 } 7110 7111 xcb_generic_iterator_t 7112 xcb_input_key_class_end (xcb_input_key_class_iterator_t i /**< */) 7113 { 7114 xcb_generic_iterator_t ret; 7115 while(i.rem > 0) 7116 xcb_input_key_class_next(&i); 7117 ret.data = i.data; 7118 ret.rem = i.rem; 7119 ret.index = i.index; 7120 return ret; 7121 } 7122 7123 void 7124 xcb_input_scroll_class_next (xcb_input_scroll_class_iterator_t *i /**< */) 7125 { 7126 --i->rem; 7127 ++i->data; 7128 i->index += sizeof(xcb_input_scroll_class_t); 7129 } 7130 7131 xcb_generic_iterator_t 7132 xcb_input_scroll_class_end (xcb_input_scroll_class_iterator_t i /**< */) 7133 { 7134 xcb_generic_iterator_t ret; 7135 ret.data = i.data + i.rem; 7136 ret.index = i.index + ((char *) ret.data - (char *) i.data); 7137 ret.rem = 0; 7138 return ret; 7139 } 7140 7141 void 7142 xcb_input_touch_class_next (xcb_input_touch_class_iterator_t *i /**< */) 7143 { 7144 --i->rem; 7145 ++i->data; 7146 i->index += sizeof(xcb_input_touch_class_t); 7147 } 7148 7149 xcb_generic_iterator_t 7150 xcb_input_touch_class_end (xcb_input_touch_class_iterator_t i /**< */) 7151 { 7152 xcb_generic_iterator_t ret; 7153 ret.data = i.data + i.rem; 7154 ret.index = i.index + ((char *) ret.data - (char *) i.data); 7155 ret.rem = 0; 7156 return ret; 7157 } 7158 7159 void 7160 xcb_input_valuator_class_next (xcb_input_valuator_class_iterator_t *i /**< */) 7161 { 7162 --i->rem; 7163 ++i->data; 7164 i->index += sizeof(xcb_input_valuator_class_t); 7165 } 7166 7167 xcb_generic_iterator_t 7168 xcb_input_valuator_class_end (xcb_input_valuator_class_iterator_t i /**< */) 7169 { 7170 xcb_generic_iterator_t ret; 7171 ret.data = i.data + i.rem; 7172 ret.index = i.index + ((char *) ret.data - (char *) i.data); 7173 ret.rem = 0; 7174 return ret; 7175 } 7176 7177 int 7178 xcb_input_device_class_sizeof (const void *_buffer /**< */) 7179 { 7180 char *xcb_tmp = (char *)_buffer; 7181 const xcb_input_device_class_t *_aux = (xcb_input_device_class_t *)_buffer; 7182 unsigned int xcb_buffer_len = 0; 7183 unsigned int xcb_block_len = 0; 7184 unsigned int xcb_pad = 0; 7185 unsigned int xcb_align_to = 0; 7186 7187 7188 xcb_block_len += sizeof(xcb_input_device_class_t); 7189 xcb_tmp += xcb_block_len; 7190 xcb_buffer_len += xcb_block_len; 7191 xcb_block_len = 0; 7192 /* uninterpreted_data */ 7193 xcb_block_len += ((_aux->len * 4) - 8) * sizeof(uint8_t); 7194 xcb_tmp += xcb_block_len; 7195 xcb_align_to = ALIGNOF(uint8_t); 7196 /* insert padding */ 7197 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 7198 xcb_buffer_len += xcb_block_len + xcb_pad; 7199 if (0 != xcb_pad) { 7200 xcb_tmp += xcb_pad; 7201 xcb_pad = 0; 7202 } 7203 xcb_block_len = 0; 7204 7205 return xcb_buffer_len; 7206 } 7207 7208 uint8_t * 7209 xcb_input_device_class_uninterpreted_data (const xcb_input_device_class_t *R /**< */) 7210 { 7211 return (uint8_t *) (R + 1); 7212 } 7213 7214 int 7215 xcb_input_device_class_uninterpreted_data_length (const xcb_input_device_class_t *R /**< */) 7216 { 7217 return ((R->len * 4) - 8); 7218 } 7219 7220 xcb_generic_iterator_t 7221 xcb_input_device_class_uninterpreted_data_end (const xcb_input_device_class_t *R /**< */) 7222 { 7223 xcb_generic_iterator_t i; 7224 i.data = ((uint8_t *) (R + 1)) + (((R->len * 4) - 8)); 7225 i.rem = 0; 7226 i.index = (char *) i.data - (char *) R; 7227 return i; 7228 } 7229 7230 void 7231 xcb_input_device_class_next (xcb_input_device_class_iterator_t *i /**< */) 7232 { 7233 xcb_input_device_class_t *R = i->data; 7234 xcb_generic_iterator_t child; 7235 child.data = (xcb_input_device_class_t *)(((char *)R) + xcb_input_device_class_sizeof(R)); 7236 i->index = (char *) child.data - (char *) i->data; 7237 --i->rem; 7238 i->data = (xcb_input_device_class_t *) child.data; 7239 } 7240 7241 xcb_generic_iterator_t 7242 xcb_input_device_class_end (xcb_input_device_class_iterator_t i /**< */) 7243 { 7244 xcb_generic_iterator_t ret; 7245 while(i.rem > 0) 7246 xcb_input_device_class_next(&i); 7247 ret.data = i.data; 7248 ret.rem = i.rem; 7249 ret.index = i.index; 7250 return ret; 7251 } 7252 7253 int 7254 xcb_input_xi_device_info_sizeof (const void *_buffer /**< */) 7255 { 7256 char *xcb_tmp = (char *)_buffer; 7257 const xcb_input_xi_device_info_t *_aux = (xcb_input_xi_device_info_t *)_buffer; 7258 unsigned int xcb_buffer_len = 0; 7259 unsigned int xcb_block_len = 0; 7260 unsigned int xcb_pad = 0; 7261 unsigned int xcb_align_to = 0; 7262 7263 unsigned int i; 7264 unsigned int xcb_tmp_len; 7265 7266 xcb_block_len += sizeof(xcb_input_xi_device_info_t); 7267 xcb_tmp += xcb_block_len; 7268 xcb_buffer_len += xcb_block_len; 7269 xcb_block_len = 0; 7270 /* name */ 7271 xcb_block_len += (((_aux->name_len + 3) / 4) * 4) * sizeof(char); 7272 xcb_tmp += xcb_block_len; 7273 xcb_align_to = ALIGNOF(char); 7274 /* insert padding */ 7275 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 7276 xcb_buffer_len += xcb_block_len + xcb_pad; 7277 if (0 != xcb_pad) { 7278 xcb_tmp += xcb_pad; 7279 xcb_pad = 0; 7280 } 7281 xcb_block_len = 0; 7282 /* classes */ 7283 for(i=0; i<_aux->num_classes; i++) { 7284 xcb_tmp_len = xcb_input_device_class_sizeof(xcb_tmp); 7285 xcb_block_len += xcb_tmp_len; 7286 xcb_tmp += xcb_tmp_len; 7287 } 7288 xcb_align_to = ALIGNOF(xcb_input_device_class_t); 7289 /* insert padding */ 7290 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 7291 xcb_buffer_len += xcb_block_len + xcb_pad; 7292 if (0 != xcb_pad) { 7293 xcb_tmp += xcb_pad; 7294 xcb_pad = 0; 7295 } 7296 xcb_block_len = 0; 7297 7298 return xcb_buffer_len; 7299 } 7300 7301 char * 7302 xcb_input_xi_device_info_name (const xcb_input_xi_device_info_t *R /**< */) 7303 { 7304 return (char *) (R + 1); 7305 } 7306 7307 int 7308 xcb_input_xi_device_info_name_length (const xcb_input_xi_device_info_t *R /**< */) 7309 { 7310 return (((R->name_len + 3) / 4) * 4); 7311 } 7312 7313 xcb_generic_iterator_t 7314 xcb_input_xi_device_info_name_end (const xcb_input_xi_device_info_t *R /**< */) 7315 { 7316 xcb_generic_iterator_t i; 7317 i.data = ((char *) (R + 1)) + ((((R->name_len + 3) / 4) * 4)); 7318 i.rem = 0; 7319 i.index = (char *) i.data - (char *) R; 7320 return i; 7321 } 7322 7323 int 7324 xcb_input_xi_device_info_classes_length (const xcb_input_xi_device_info_t *R /**< */) 7325 { 7326 return R->num_classes; 7327 } 7328 7329 xcb_input_device_class_iterator_t 7330 xcb_input_xi_device_info_classes_iterator (const xcb_input_xi_device_info_t *R /**< */) 7331 { 7332 xcb_input_device_class_iterator_t i; 7333 xcb_generic_iterator_t prev = xcb_input_xi_device_info_name_end(R); 7334 i.data = (xcb_input_device_class_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_input_device_class_t, prev.index)); 7335 i.rem = R->num_classes; 7336 i.index = (char *) i.data - (char *) R; 7337 return i; 7338 } 7339 7340 void 7341 xcb_input_xi_device_info_next (xcb_input_xi_device_info_iterator_t *i /**< */) 7342 { 7343 xcb_input_xi_device_info_t *R = i->data; 7344 xcb_generic_iterator_t child; 7345 child.data = (xcb_input_xi_device_info_t *)(((char *)R) + xcb_input_xi_device_info_sizeof(R)); 7346 i->index = (char *) child.data - (char *) i->data; 7347 --i->rem; 7348 i->data = (xcb_input_xi_device_info_t *) child.data; 7349 } 7350 7351 xcb_generic_iterator_t 7352 xcb_input_xi_device_info_end (xcb_input_xi_device_info_iterator_t i /**< */) 7353 { 7354 xcb_generic_iterator_t ret; 7355 while(i.rem > 0) 7356 xcb_input_xi_device_info_next(&i); 7357 ret.data = i.data; 7358 ret.rem = i.rem; 7359 ret.index = i.index; 7360 return ret; 7361 } 7362 7363 int 7364 xcb_input_xi_query_device_sizeof (const void *_buffer /**< */) 7365 { 7366 char *xcb_tmp = (char *)_buffer; 7367 const xcb_input_xi_query_device_reply_t *_aux = (xcb_input_xi_query_device_reply_t *)_buffer; 7368 unsigned int xcb_buffer_len = 0; 7369 unsigned int xcb_block_len = 0; 7370 unsigned int xcb_pad = 0; 7371 unsigned int xcb_align_to = 0; 7372 7373 unsigned int i; 7374 unsigned int xcb_tmp_len; 7375 7376 xcb_block_len += sizeof(xcb_input_xi_query_device_reply_t); 7377 xcb_tmp += xcb_block_len; 7378 xcb_buffer_len += xcb_block_len; 7379 xcb_block_len = 0; 7380 /* infos */ 7381 for(i=0; i<_aux->num_infos; i++) { 7382 xcb_tmp_len = xcb_input_xi_device_info_sizeof(xcb_tmp); 7383 xcb_block_len += xcb_tmp_len; 7384 xcb_tmp += xcb_tmp_len; 7385 } 7386 xcb_align_to = ALIGNOF(xcb_input_xi_device_info_t); 7387 /* insert padding */ 7388 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 7389 xcb_buffer_len += xcb_block_len + xcb_pad; 7390 if (0 != xcb_pad) { 7391 xcb_tmp += xcb_pad; 7392 xcb_pad = 0; 7393 } 7394 xcb_block_len = 0; 7395 7396 return xcb_buffer_len; 7397 } 7398 7399 xcb_input_xi_query_device_cookie_t 7400 xcb_input_xi_query_device (xcb_connection_t *c /**< */, 7401 xcb_input_device_id_t deviceid /**< */) 7402 { 7403 static const xcb_protocol_request_t xcb_req = { 7404 /* count */ 2, 7405 /* ext */ &xcb_input_id, 7406 /* opcode */ XCB_INPUT_XI_QUERY_DEVICE, 7407 /* isvoid */ 0 7408 }; 7409 7410 struct iovec xcb_parts[4]; 7411 xcb_input_xi_query_device_cookie_t xcb_ret; 7412 xcb_input_xi_query_device_request_t xcb_out; 7413 7414 xcb_out.deviceid = deviceid; 7415 memset(xcb_out.pad0, 0, 2); 7416 7417 xcb_parts[2].iov_base = (char *) &xcb_out; 7418 xcb_parts[2].iov_len = sizeof(xcb_out); 7419 xcb_parts[3].iov_base = 0; 7420 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 7421 7422 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 7423 return xcb_ret; 7424 } 7425 7426 xcb_input_xi_query_device_cookie_t 7427 xcb_input_xi_query_device_unchecked (xcb_connection_t *c /**< */, 7428 xcb_input_device_id_t deviceid /**< */) 7429 { 7430 static const xcb_protocol_request_t xcb_req = { 7431 /* count */ 2, 7432 /* ext */ &xcb_input_id, 7433 /* opcode */ XCB_INPUT_XI_QUERY_DEVICE, 7434 /* isvoid */ 0 7435 }; 7436 7437 struct iovec xcb_parts[4]; 7438 xcb_input_xi_query_device_cookie_t xcb_ret; 7439 xcb_input_xi_query_device_request_t xcb_out; 7440 7441 xcb_out.deviceid = deviceid; 7442 memset(xcb_out.pad0, 0, 2); 7443 7444 xcb_parts[2].iov_base = (char *) &xcb_out; 7445 xcb_parts[2].iov_len = sizeof(xcb_out); 7446 xcb_parts[3].iov_base = 0; 7447 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 7448 7449 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 7450 return xcb_ret; 7451 } 7452 7453 int 7454 xcb_input_xi_query_device_infos_length (const xcb_input_xi_query_device_reply_t *R /**< */) 7455 { 7456 return R->num_infos; 7457 } 7458 7459 xcb_input_xi_device_info_iterator_t 7460 xcb_input_xi_query_device_infos_iterator (const xcb_input_xi_query_device_reply_t *R /**< */) 7461 { 7462 xcb_input_xi_device_info_iterator_t i; 7463 i.data = (xcb_input_xi_device_info_t *) (R + 1); 7464 i.rem = R->num_infos; 7465 i.index = (char *) i.data - (char *) R; 7466 return i; 7467 } 7468 7469 xcb_input_xi_query_device_reply_t * 7470 xcb_input_xi_query_device_reply (xcb_connection_t *c /**< */, 7471 xcb_input_xi_query_device_cookie_t cookie /**< */, 7472 xcb_generic_error_t **e /**< */) 7473 { 7474 return (xcb_input_xi_query_device_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 7475 } 7476 7477 xcb_void_cookie_t 7478 xcb_input_xi_set_focus_checked (xcb_connection_t *c /**< */, 7479 xcb_window_t window /**< */, 7480 xcb_timestamp_t time /**< */, 7481 xcb_input_device_id_t deviceid /**< */) 7482 { 7483 static const xcb_protocol_request_t xcb_req = { 7484 /* count */ 2, 7485 /* ext */ &xcb_input_id, 7486 /* opcode */ XCB_INPUT_XI_SET_FOCUS, 7487 /* isvoid */ 1 7488 }; 7489 7490 struct iovec xcb_parts[4]; 7491 xcb_void_cookie_t xcb_ret; 7492 xcb_input_xi_set_focus_request_t xcb_out; 7493 7494 xcb_out.window = window; 7495 xcb_out.time = time; 7496 xcb_out.deviceid = deviceid; 7497 memset(xcb_out.pad0, 0, 2); 7498 7499 xcb_parts[2].iov_base = (char *) &xcb_out; 7500 xcb_parts[2].iov_len = sizeof(xcb_out); 7501 xcb_parts[3].iov_base = 0; 7502 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 7503 7504 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 7505 return xcb_ret; 7506 } 7507 7508 xcb_void_cookie_t 7509 xcb_input_xi_set_focus (xcb_connection_t *c /**< */, 7510 xcb_window_t window /**< */, 7511 xcb_timestamp_t time /**< */, 7512 xcb_input_device_id_t deviceid /**< */) 7513 { 7514 static const xcb_protocol_request_t xcb_req = { 7515 /* count */ 2, 7516 /* ext */ &xcb_input_id, 7517 /* opcode */ XCB_INPUT_XI_SET_FOCUS, 7518 /* isvoid */ 1 7519 }; 7520 7521 struct iovec xcb_parts[4]; 7522 xcb_void_cookie_t xcb_ret; 7523 xcb_input_xi_set_focus_request_t xcb_out; 7524 7525 xcb_out.window = window; 7526 xcb_out.time = time; 7527 xcb_out.deviceid = deviceid; 7528 memset(xcb_out.pad0, 0, 2); 7529 7530 xcb_parts[2].iov_base = (char *) &xcb_out; 7531 xcb_parts[2].iov_len = sizeof(xcb_out); 7532 xcb_parts[3].iov_base = 0; 7533 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 7534 7535 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 7536 return xcb_ret; 7537 } 7538 7539 xcb_input_xi_get_focus_cookie_t 7540 xcb_input_xi_get_focus (xcb_connection_t *c /**< */, 7541 xcb_input_device_id_t deviceid /**< */) 7542 { 7543 static const xcb_protocol_request_t xcb_req = { 7544 /* count */ 2, 7545 /* ext */ &xcb_input_id, 7546 /* opcode */ XCB_INPUT_XI_GET_FOCUS, 7547 /* isvoid */ 0 7548 }; 7549 7550 struct iovec xcb_parts[4]; 7551 xcb_input_xi_get_focus_cookie_t xcb_ret; 7552 xcb_input_xi_get_focus_request_t xcb_out; 7553 7554 xcb_out.deviceid = deviceid; 7555 memset(xcb_out.pad0, 0, 2); 7556 7557 xcb_parts[2].iov_base = (char *) &xcb_out; 7558 xcb_parts[2].iov_len = sizeof(xcb_out); 7559 xcb_parts[3].iov_base = 0; 7560 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 7561 7562 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 7563 return xcb_ret; 7564 } 7565 7566 xcb_input_xi_get_focus_cookie_t 7567 xcb_input_xi_get_focus_unchecked (xcb_connection_t *c /**< */, 7568 xcb_input_device_id_t deviceid /**< */) 7569 { 7570 static const xcb_protocol_request_t xcb_req = { 7571 /* count */ 2, 7572 /* ext */ &xcb_input_id, 7573 /* opcode */ XCB_INPUT_XI_GET_FOCUS, 7574 /* isvoid */ 0 7575 }; 7576 7577 struct iovec xcb_parts[4]; 7578 xcb_input_xi_get_focus_cookie_t xcb_ret; 7579 xcb_input_xi_get_focus_request_t xcb_out; 7580 7581 xcb_out.deviceid = deviceid; 7582 memset(xcb_out.pad0, 0, 2); 7583 7584 xcb_parts[2].iov_base = (char *) &xcb_out; 7585 xcb_parts[2].iov_len = sizeof(xcb_out); 7586 xcb_parts[3].iov_base = 0; 7587 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 7588 7589 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 7590 return xcb_ret; 7591 } 7592 7593 xcb_input_xi_get_focus_reply_t * 7594 xcb_input_xi_get_focus_reply (xcb_connection_t *c /**< */, 7595 xcb_input_xi_get_focus_cookie_t cookie /**< */, 7596 xcb_generic_error_t **e /**< */) 7597 { 7598 return (xcb_input_xi_get_focus_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 7599 } 7600 7601 int 7602 xcb_input_xi_grab_device_sizeof (const void *_buffer /**< */) 7603 { 7604 char *xcb_tmp = (char *)_buffer; 7605 const xcb_input_xi_grab_device_request_t *_aux = (xcb_input_xi_grab_device_request_t *)_buffer; 7606 unsigned int xcb_buffer_len = 0; 7607 unsigned int xcb_block_len = 0; 7608 unsigned int xcb_pad = 0; 7609 unsigned int xcb_align_to = 0; 7610 7611 7612 xcb_block_len += sizeof(xcb_input_xi_grab_device_request_t); 7613 xcb_tmp += xcb_block_len; 7614 xcb_buffer_len += xcb_block_len; 7615 xcb_block_len = 0; 7616 /* mask */ 7617 xcb_block_len += _aux->mask_len * sizeof(uint32_t); 7618 xcb_tmp += xcb_block_len; 7619 xcb_align_to = ALIGNOF(uint32_t); 7620 /* insert padding */ 7621 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 7622 xcb_buffer_len += xcb_block_len + xcb_pad; 7623 if (0 != xcb_pad) { 7624 xcb_tmp += xcb_pad; 7625 xcb_pad = 0; 7626 } 7627 xcb_block_len = 0; 7628 7629 return xcb_buffer_len; 7630 } 7631 7632 xcb_input_xi_grab_device_cookie_t 7633 xcb_input_xi_grab_device (xcb_connection_t *c /**< */, 7634 xcb_window_t window /**< */, 7635 xcb_timestamp_t time /**< */, 7636 xcb_cursor_t cursor /**< */, 7637 xcb_input_device_id_t deviceid /**< */, 7638 uint8_t mode /**< */, 7639 uint8_t paired_device_mode /**< */, 7640 uint8_t owner_events /**< */, 7641 uint16_t mask_len /**< */, 7642 const uint32_t *mask /**< */) 7643 { 7644 static const xcb_protocol_request_t xcb_req = { 7645 /* count */ 4, 7646 /* ext */ &xcb_input_id, 7647 /* opcode */ XCB_INPUT_XI_GRAB_DEVICE, 7648 /* isvoid */ 0 7649 }; 7650 7651 struct iovec xcb_parts[6]; 7652 xcb_input_xi_grab_device_cookie_t xcb_ret; 7653 xcb_input_xi_grab_device_request_t xcb_out; 7654 7655 xcb_out.window = window; 7656 xcb_out.time = time; 7657 xcb_out.cursor = cursor; 7658 xcb_out.deviceid = deviceid; 7659 xcb_out.mode = mode; 7660 xcb_out.paired_device_mode = paired_device_mode; 7661 xcb_out.owner_events = owner_events; 7662 xcb_out.pad0 = 0; 7663 xcb_out.mask_len = mask_len; 7664 7665 xcb_parts[2].iov_base = (char *) &xcb_out; 7666 xcb_parts[2].iov_len = sizeof(xcb_out); 7667 xcb_parts[3].iov_base = 0; 7668 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 7669 /* uint32_t mask */ 7670 xcb_parts[4].iov_base = (char *) mask; 7671 xcb_parts[4].iov_len = mask_len * sizeof(uint32_t); 7672 xcb_parts[5].iov_base = 0; 7673 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 7674 7675 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 7676 return xcb_ret; 7677 } 7678 7679 xcb_input_xi_grab_device_cookie_t 7680 xcb_input_xi_grab_device_unchecked (xcb_connection_t *c /**< */, 7681 xcb_window_t window /**< */, 7682 xcb_timestamp_t time /**< */, 7683 xcb_cursor_t cursor /**< */, 7684 xcb_input_device_id_t deviceid /**< */, 7685 uint8_t mode /**< */, 7686 uint8_t paired_device_mode /**< */, 7687 uint8_t owner_events /**< */, 7688 uint16_t mask_len /**< */, 7689 const uint32_t *mask /**< */) 7690 { 7691 static const xcb_protocol_request_t xcb_req = { 7692 /* count */ 4, 7693 /* ext */ &xcb_input_id, 7694 /* opcode */ XCB_INPUT_XI_GRAB_DEVICE, 7695 /* isvoid */ 0 7696 }; 7697 7698 struct iovec xcb_parts[6]; 7699 xcb_input_xi_grab_device_cookie_t xcb_ret; 7700 xcb_input_xi_grab_device_request_t xcb_out; 7701 7702 xcb_out.window = window; 7703 xcb_out.time = time; 7704 xcb_out.cursor = cursor; 7705 xcb_out.deviceid = deviceid; 7706 xcb_out.mode = mode; 7707 xcb_out.paired_device_mode = paired_device_mode; 7708 xcb_out.owner_events = owner_events; 7709 xcb_out.pad0 = 0; 7710 xcb_out.mask_len = mask_len; 7711 7712 xcb_parts[2].iov_base = (char *) &xcb_out; 7713 xcb_parts[2].iov_len = sizeof(xcb_out); 7714 xcb_parts[3].iov_base = 0; 7715 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 7716 /* uint32_t mask */ 7717 xcb_parts[4].iov_base = (char *) mask; 7718 xcb_parts[4].iov_len = mask_len * sizeof(uint32_t); 7719 xcb_parts[5].iov_base = 0; 7720 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 7721 7722 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 7723 return xcb_ret; 7724 } 7725 7726 xcb_input_xi_grab_device_reply_t * 7727 xcb_input_xi_grab_device_reply (xcb_connection_t *c /**< */, 7728 xcb_input_xi_grab_device_cookie_t cookie /**< */, 7729 xcb_generic_error_t **e /**< */) 7730 { 7731 return (xcb_input_xi_grab_device_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 7732 } 7733 7734 xcb_void_cookie_t 7735 xcb_input_xi_ungrab_device_checked (xcb_connection_t *c /**< */, 7736 xcb_timestamp_t time /**< */, 7737 xcb_input_device_id_t deviceid /**< */) 7738 { 7739 static const xcb_protocol_request_t xcb_req = { 7740 /* count */ 2, 7741 /* ext */ &xcb_input_id, 7742 /* opcode */ XCB_INPUT_XI_UNGRAB_DEVICE, 7743 /* isvoid */ 1 7744 }; 7745 7746 struct iovec xcb_parts[4]; 7747 xcb_void_cookie_t xcb_ret; 7748 xcb_input_xi_ungrab_device_request_t xcb_out; 7749 7750 xcb_out.time = time; 7751 xcb_out.deviceid = deviceid; 7752 memset(xcb_out.pad0, 0, 2); 7753 7754 xcb_parts[2].iov_base = (char *) &xcb_out; 7755 xcb_parts[2].iov_len = sizeof(xcb_out); 7756 xcb_parts[3].iov_base = 0; 7757 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 7758 7759 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 7760 return xcb_ret; 7761 } 7762 7763 xcb_void_cookie_t 7764 xcb_input_xi_ungrab_device (xcb_connection_t *c /**< */, 7765 xcb_timestamp_t time /**< */, 7766 xcb_input_device_id_t deviceid /**< */) 7767 { 7768 static const xcb_protocol_request_t xcb_req = { 7769 /* count */ 2, 7770 /* ext */ &xcb_input_id, 7771 /* opcode */ XCB_INPUT_XI_UNGRAB_DEVICE, 7772 /* isvoid */ 1 7773 }; 7774 7775 struct iovec xcb_parts[4]; 7776 xcb_void_cookie_t xcb_ret; 7777 xcb_input_xi_ungrab_device_request_t xcb_out; 7778 7779 xcb_out.time = time; 7780 xcb_out.deviceid = deviceid; 7781 memset(xcb_out.pad0, 0, 2); 7782 7783 xcb_parts[2].iov_base = (char *) &xcb_out; 7784 xcb_parts[2].iov_len = sizeof(xcb_out); 7785 xcb_parts[3].iov_base = 0; 7786 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 7787 7788 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 7789 return xcb_ret; 7790 } 7791 7792 xcb_void_cookie_t 7793 xcb_input_xi_allow_events_checked (xcb_connection_t *c /**< */, 7794 xcb_timestamp_t time /**< */, 7795 xcb_input_device_id_t deviceid /**< */, 7796 uint8_t event_mode /**< */, 7797 uint32_t touchid /**< */, 7798 xcb_window_t grab_window /**< */) 7799 { 7800 static const xcb_protocol_request_t xcb_req = { 7801 /* count */ 2, 7802 /* ext */ &xcb_input_id, 7803 /* opcode */ XCB_INPUT_XI_ALLOW_EVENTS, 7804 /* isvoid */ 1 7805 }; 7806 7807 struct iovec xcb_parts[4]; 7808 xcb_void_cookie_t xcb_ret; 7809 xcb_input_xi_allow_events_request_t xcb_out; 7810 7811 xcb_out.time = time; 7812 xcb_out.deviceid = deviceid; 7813 xcb_out.event_mode = event_mode; 7814 xcb_out.pad0 = 0; 7815 xcb_out.touchid = touchid; 7816 xcb_out.grab_window = grab_window; 7817 7818 xcb_parts[2].iov_base = (char *) &xcb_out; 7819 xcb_parts[2].iov_len = sizeof(xcb_out); 7820 xcb_parts[3].iov_base = 0; 7821 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 7822 7823 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 7824 return xcb_ret; 7825 } 7826 7827 xcb_void_cookie_t 7828 xcb_input_xi_allow_events (xcb_connection_t *c /**< */, 7829 xcb_timestamp_t time /**< */, 7830 xcb_input_device_id_t deviceid /**< */, 7831 uint8_t event_mode /**< */, 7832 uint32_t touchid /**< */, 7833 xcb_window_t grab_window /**< */) 7834 { 7835 static const xcb_protocol_request_t xcb_req = { 7836 /* count */ 2, 7837 /* ext */ &xcb_input_id, 7838 /* opcode */ XCB_INPUT_XI_ALLOW_EVENTS, 7839 /* isvoid */ 1 7840 }; 7841 7842 struct iovec xcb_parts[4]; 7843 xcb_void_cookie_t xcb_ret; 7844 xcb_input_xi_allow_events_request_t xcb_out; 7845 7846 xcb_out.time = time; 7847 xcb_out.deviceid = deviceid; 7848 xcb_out.event_mode = event_mode; 7849 xcb_out.pad0 = 0; 7850 xcb_out.touchid = touchid; 7851 xcb_out.grab_window = grab_window; 7852 7853 xcb_parts[2].iov_base = (char *) &xcb_out; 7854 xcb_parts[2].iov_len = sizeof(xcb_out); 7855 xcb_parts[3].iov_base = 0; 7856 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 7857 7858 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 7859 return xcb_ret; 7860 } 7861 7862 void 7863 xcb_input_grab_modifier_info_next (xcb_input_grab_modifier_info_iterator_t *i /**< */) 7864 { 7865 --i->rem; 7866 ++i->data; 7867 i->index += sizeof(xcb_input_grab_modifier_info_t); 7868 } 7869 7870 xcb_generic_iterator_t 7871 xcb_input_grab_modifier_info_end (xcb_input_grab_modifier_info_iterator_t i /**< */) 7872 { 7873 xcb_generic_iterator_t ret; 7874 ret.data = i.data + i.rem; 7875 ret.index = i.index + ((char *) ret.data - (char *) i.data); 7876 ret.rem = 0; 7877 return ret; 7878 } 7879 7880 int 7881 xcb_input_xi_passive_grab_device_sizeof (const void *_buffer /**< */) 7882 { 7883 char *xcb_tmp = (char *)_buffer; 7884 const xcb_input_xi_passive_grab_device_request_t *_aux = (xcb_input_xi_passive_grab_device_request_t *)_buffer; 7885 unsigned int xcb_buffer_len = 0; 7886 unsigned int xcb_block_len = 0; 7887 unsigned int xcb_pad = 0; 7888 unsigned int xcb_align_to = 0; 7889 7890 7891 xcb_block_len += sizeof(xcb_input_xi_passive_grab_device_request_t); 7892 xcb_tmp += xcb_block_len; 7893 xcb_buffer_len += xcb_block_len; 7894 xcb_block_len = 0; 7895 /* mask */ 7896 xcb_block_len += _aux->mask_len * sizeof(uint32_t); 7897 xcb_tmp += xcb_block_len; 7898 xcb_align_to = ALIGNOF(uint32_t); 7899 /* insert padding */ 7900 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 7901 xcb_buffer_len += xcb_block_len + xcb_pad; 7902 if (0 != xcb_pad) { 7903 xcb_tmp += xcb_pad; 7904 xcb_pad = 0; 7905 } 7906 xcb_block_len = 0; 7907 /* modifiers */ 7908 xcb_block_len += _aux->num_modifiers * sizeof(uint32_t); 7909 xcb_tmp += xcb_block_len; 7910 xcb_align_to = ALIGNOF(uint32_t); 7911 /* insert padding */ 7912 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 7913 xcb_buffer_len += xcb_block_len + xcb_pad; 7914 if (0 != xcb_pad) { 7915 xcb_tmp += xcb_pad; 7916 xcb_pad = 0; 7917 } 7918 xcb_block_len = 0; 7919 7920 return xcb_buffer_len; 7921 } 7922 7923 xcb_input_xi_passive_grab_device_cookie_t 7924 xcb_input_xi_passive_grab_device (xcb_connection_t *c /**< */, 7925 xcb_timestamp_t time /**< */, 7926 xcb_window_t grab_window /**< */, 7927 xcb_cursor_t cursor /**< */, 7928 uint32_t detail /**< */, 7929 xcb_input_device_id_t deviceid /**< */, 7930 uint16_t num_modifiers /**< */, 7931 uint16_t mask_len /**< */, 7932 uint8_t grab_type /**< */, 7933 uint8_t grab_mode /**< */, 7934 uint8_t paired_device_mode /**< */, 7935 uint8_t owner_events /**< */, 7936 const uint32_t *mask /**< */, 7937 const uint32_t *modifiers /**< */) 7938 { 7939 static const xcb_protocol_request_t xcb_req = { 7940 /* count */ 6, 7941 /* ext */ &xcb_input_id, 7942 /* opcode */ XCB_INPUT_XI_PASSIVE_GRAB_DEVICE, 7943 /* isvoid */ 0 7944 }; 7945 7946 struct iovec xcb_parts[8]; 7947 xcb_input_xi_passive_grab_device_cookie_t xcb_ret; 7948 xcb_input_xi_passive_grab_device_request_t xcb_out; 7949 7950 xcb_out.time = time; 7951 xcb_out.grab_window = grab_window; 7952 xcb_out.cursor = cursor; 7953 xcb_out.detail = detail; 7954 xcb_out.deviceid = deviceid; 7955 xcb_out.num_modifiers = num_modifiers; 7956 xcb_out.mask_len = mask_len; 7957 xcb_out.grab_type = grab_type; 7958 xcb_out.grab_mode = grab_mode; 7959 xcb_out.paired_device_mode = paired_device_mode; 7960 xcb_out.owner_events = owner_events; 7961 memset(xcb_out.pad0, 0, 2); 7962 7963 xcb_parts[2].iov_base = (char *) &xcb_out; 7964 xcb_parts[2].iov_len = sizeof(xcb_out); 7965 xcb_parts[3].iov_base = 0; 7966 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 7967 /* uint32_t mask */ 7968 xcb_parts[4].iov_base = (char *) mask; 7969 xcb_parts[4].iov_len = mask_len * sizeof(uint32_t); 7970 xcb_parts[5].iov_base = 0; 7971 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 7972 /* uint32_t modifiers */ 7973 xcb_parts[6].iov_base = (char *) modifiers; 7974 xcb_parts[6].iov_len = num_modifiers * sizeof(uint32_t); 7975 xcb_parts[7].iov_base = 0; 7976 xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3; 7977 7978 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 7979 return xcb_ret; 7980 } 7981 7982 xcb_input_xi_passive_grab_device_cookie_t 7983 xcb_input_xi_passive_grab_device_unchecked (xcb_connection_t *c /**< */, 7984 xcb_timestamp_t time /**< */, 7985 xcb_window_t grab_window /**< */, 7986 xcb_cursor_t cursor /**< */, 7987 uint32_t detail /**< */, 7988 xcb_input_device_id_t deviceid /**< */, 7989 uint16_t num_modifiers /**< */, 7990 uint16_t mask_len /**< */, 7991 uint8_t grab_type /**< */, 7992 uint8_t grab_mode /**< */, 7993 uint8_t paired_device_mode /**< */, 7994 uint8_t owner_events /**< */, 7995 const uint32_t *mask /**< */, 7996 const uint32_t *modifiers /**< */) 7997 { 7998 static const xcb_protocol_request_t xcb_req = { 7999 /* count */ 6, 8000 /* ext */ &xcb_input_id, 8001 /* opcode */ XCB_INPUT_XI_PASSIVE_GRAB_DEVICE, 8002 /* isvoid */ 0 8003 }; 8004 8005 struct iovec xcb_parts[8]; 8006 xcb_input_xi_passive_grab_device_cookie_t xcb_ret; 8007 xcb_input_xi_passive_grab_device_request_t xcb_out; 8008 8009 xcb_out.time = time; 8010 xcb_out.grab_window = grab_window; 8011 xcb_out.cursor = cursor; 8012 xcb_out.detail = detail; 8013 xcb_out.deviceid = deviceid; 8014 xcb_out.num_modifiers = num_modifiers; 8015 xcb_out.mask_len = mask_len; 8016 xcb_out.grab_type = grab_type; 8017 xcb_out.grab_mode = grab_mode; 8018 xcb_out.paired_device_mode = paired_device_mode; 8019 xcb_out.owner_events = owner_events; 8020 memset(xcb_out.pad0, 0, 2); 8021 8022 xcb_parts[2].iov_base = (char *) &xcb_out; 8023 xcb_parts[2].iov_len = sizeof(xcb_out); 8024 xcb_parts[3].iov_base = 0; 8025 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 8026 /* uint32_t mask */ 8027 xcb_parts[4].iov_base = (char *) mask; 8028 xcb_parts[4].iov_len = mask_len * sizeof(uint32_t); 8029 xcb_parts[5].iov_base = 0; 8030 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 8031 /* uint32_t modifiers */ 8032 xcb_parts[6].iov_base = (char *) modifiers; 8033 xcb_parts[6].iov_len = num_modifiers * sizeof(uint32_t); 8034 xcb_parts[7].iov_base = 0; 8035 xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3; 8036 8037 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 8038 return xcb_ret; 8039 } 8040 8041 xcb_input_grab_modifier_info_t * 8042 xcb_input_xi_passive_grab_device_modifiers (const xcb_input_xi_passive_grab_device_reply_t *R /**< */) 8043 { 8044 return (xcb_input_grab_modifier_info_t *) (R + 1); 8045 } 8046 8047 int 8048 xcb_input_xi_passive_grab_device_modifiers_length (const xcb_input_xi_passive_grab_device_reply_t *R /**< */) 8049 { 8050 return R->num_modifiers; 8051 } 8052 8053 xcb_input_grab_modifier_info_iterator_t 8054 xcb_input_xi_passive_grab_device_modifiers_iterator (const xcb_input_xi_passive_grab_device_reply_t *R /**< */) 8055 { 8056 xcb_input_grab_modifier_info_iterator_t i; 8057 i.data = (xcb_input_grab_modifier_info_t *) (R + 1); 8058 i.rem = R->num_modifiers; 8059 i.index = (char *) i.data - (char *) R; 8060 return i; 8061 } 8062 8063 xcb_input_xi_passive_grab_device_reply_t * 8064 xcb_input_xi_passive_grab_device_reply (xcb_connection_t *c /**< */, 8065 xcb_input_xi_passive_grab_device_cookie_t cookie /**< */, 8066 xcb_generic_error_t **e /**< */) 8067 { 8068 return (xcb_input_xi_passive_grab_device_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 8069 } 8070 8071 int 8072 xcb_input_xi_passive_ungrab_device_sizeof (const void *_buffer /**< */) 8073 { 8074 char *xcb_tmp = (char *)_buffer; 8075 const xcb_input_xi_passive_ungrab_device_request_t *_aux = (xcb_input_xi_passive_ungrab_device_request_t *)_buffer; 8076 unsigned int xcb_buffer_len = 0; 8077 unsigned int xcb_block_len = 0; 8078 unsigned int xcb_pad = 0; 8079 unsigned int xcb_align_to = 0; 8080 8081 8082 xcb_block_len += sizeof(xcb_input_xi_passive_ungrab_device_request_t); 8083 xcb_tmp += xcb_block_len; 8084 xcb_buffer_len += xcb_block_len; 8085 xcb_block_len = 0; 8086 /* modifiers */ 8087 xcb_block_len += _aux->num_modifiers * sizeof(uint32_t); 8088 xcb_tmp += xcb_block_len; 8089 xcb_align_to = ALIGNOF(uint32_t); 8090 /* insert padding */ 8091 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 8092 xcb_buffer_len += xcb_block_len + xcb_pad; 8093 if (0 != xcb_pad) { 8094 xcb_tmp += xcb_pad; 8095 xcb_pad = 0; 8096 } 8097 xcb_block_len = 0; 8098 8099 return xcb_buffer_len; 8100 } 8101 8102 xcb_void_cookie_t 8103 xcb_input_xi_passive_ungrab_device_checked (xcb_connection_t *c /**< */, 8104 xcb_window_t grab_window /**< */, 8105 uint32_t detail /**< */, 8106 xcb_input_device_id_t deviceid /**< */, 8107 uint16_t num_modifiers /**< */, 8108 uint8_t grab_type /**< */, 8109 const uint32_t *modifiers /**< */) 8110 { 8111 static const xcb_protocol_request_t xcb_req = { 8112 /* count */ 4, 8113 /* ext */ &xcb_input_id, 8114 /* opcode */ XCB_INPUT_XI_PASSIVE_UNGRAB_DEVICE, 8115 /* isvoid */ 1 8116 }; 8117 8118 struct iovec xcb_parts[6]; 8119 xcb_void_cookie_t xcb_ret; 8120 xcb_input_xi_passive_ungrab_device_request_t xcb_out; 8121 8122 xcb_out.grab_window = grab_window; 8123 xcb_out.detail = detail; 8124 xcb_out.deviceid = deviceid; 8125 xcb_out.num_modifiers = num_modifiers; 8126 xcb_out.grab_type = grab_type; 8127 memset(xcb_out.pad0, 0, 3); 8128 8129 xcb_parts[2].iov_base = (char *) &xcb_out; 8130 xcb_parts[2].iov_len = sizeof(xcb_out); 8131 xcb_parts[3].iov_base = 0; 8132 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 8133 /* uint32_t modifiers */ 8134 xcb_parts[4].iov_base = (char *) modifiers; 8135 xcb_parts[4].iov_len = num_modifiers * sizeof(uint32_t); 8136 xcb_parts[5].iov_base = 0; 8137 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 8138 8139 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 8140 return xcb_ret; 8141 } 8142 8143 xcb_void_cookie_t 8144 xcb_input_xi_passive_ungrab_device (xcb_connection_t *c /**< */, 8145 xcb_window_t grab_window /**< */, 8146 uint32_t detail /**< */, 8147 xcb_input_device_id_t deviceid /**< */, 8148 uint16_t num_modifiers /**< */, 8149 uint8_t grab_type /**< */, 8150 const uint32_t *modifiers /**< */) 8151 { 8152 static const xcb_protocol_request_t xcb_req = { 8153 /* count */ 4, 8154 /* ext */ &xcb_input_id, 8155 /* opcode */ XCB_INPUT_XI_PASSIVE_UNGRAB_DEVICE, 8156 /* isvoid */ 1 8157 }; 8158 8159 struct iovec xcb_parts[6]; 8160 xcb_void_cookie_t xcb_ret; 8161 xcb_input_xi_passive_ungrab_device_request_t xcb_out; 8162 8163 xcb_out.grab_window = grab_window; 8164 xcb_out.detail = detail; 8165 xcb_out.deviceid = deviceid; 8166 xcb_out.num_modifiers = num_modifiers; 8167 xcb_out.grab_type = grab_type; 8168 memset(xcb_out.pad0, 0, 3); 8169 8170 xcb_parts[2].iov_base = (char *) &xcb_out; 8171 xcb_parts[2].iov_len = sizeof(xcb_out); 8172 xcb_parts[3].iov_base = 0; 8173 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 8174 /* uint32_t modifiers */ 8175 xcb_parts[4].iov_base = (char *) modifiers; 8176 xcb_parts[4].iov_len = num_modifiers * sizeof(uint32_t); 8177 xcb_parts[5].iov_base = 0; 8178 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 8179 8180 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 8181 return xcb_ret; 8182 } 8183 8184 int 8185 xcb_input_xi_list_properties_sizeof (const void *_buffer /**< */) 8186 { 8187 char *xcb_tmp = (char *)_buffer; 8188 const xcb_input_xi_list_properties_reply_t *_aux = (xcb_input_xi_list_properties_reply_t *)_buffer; 8189 unsigned int xcb_buffer_len = 0; 8190 unsigned int xcb_block_len = 0; 8191 unsigned int xcb_pad = 0; 8192 unsigned int xcb_align_to = 0; 8193 8194 8195 xcb_block_len += sizeof(xcb_input_xi_list_properties_reply_t); 8196 xcb_tmp += xcb_block_len; 8197 xcb_buffer_len += xcb_block_len; 8198 xcb_block_len = 0; 8199 /* properties */ 8200 xcb_block_len += _aux->num_properties * sizeof(xcb_atom_t); 8201 xcb_tmp += xcb_block_len; 8202 xcb_align_to = ALIGNOF(xcb_atom_t); 8203 /* insert padding */ 8204 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 8205 xcb_buffer_len += xcb_block_len + xcb_pad; 8206 if (0 != xcb_pad) { 8207 xcb_tmp += xcb_pad; 8208 xcb_pad = 0; 8209 } 8210 xcb_block_len = 0; 8211 8212 return xcb_buffer_len; 8213 } 8214 8215 xcb_input_xi_list_properties_cookie_t 8216 xcb_input_xi_list_properties (xcb_connection_t *c /**< */, 8217 xcb_input_device_id_t deviceid /**< */) 8218 { 8219 static const xcb_protocol_request_t xcb_req = { 8220 /* count */ 2, 8221 /* ext */ &xcb_input_id, 8222 /* opcode */ XCB_INPUT_XI_LIST_PROPERTIES, 8223 /* isvoid */ 0 8224 }; 8225 8226 struct iovec xcb_parts[4]; 8227 xcb_input_xi_list_properties_cookie_t xcb_ret; 8228 xcb_input_xi_list_properties_request_t xcb_out; 8229 8230 xcb_out.deviceid = deviceid; 8231 memset(xcb_out.pad0, 0, 2); 8232 8233 xcb_parts[2].iov_base = (char *) &xcb_out; 8234 xcb_parts[2].iov_len = sizeof(xcb_out); 8235 xcb_parts[3].iov_base = 0; 8236 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 8237 8238 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 8239 return xcb_ret; 8240 } 8241 8242 xcb_input_xi_list_properties_cookie_t 8243 xcb_input_xi_list_properties_unchecked (xcb_connection_t *c /**< */, 8244 xcb_input_device_id_t deviceid /**< */) 8245 { 8246 static const xcb_protocol_request_t xcb_req = { 8247 /* count */ 2, 8248 /* ext */ &xcb_input_id, 8249 /* opcode */ XCB_INPUT_XI_LIST_PROPERTIES, 8250 /* isvoid */ 0 8251 }; 8252 8253 struct iovec xcb_parts[4]; 8254 xcb_input_xi_list_properties_cookie_t xcb_ret; 8255 xcb_input_xi_list_properties_request_t xcb_out; 8256 8257 xcb_out.deviceid = deviceid; 8258 memset(xcb_out.pad0, 0, 2); 8259 8260 xcb_parts[2].iov_base = (char *) &xcb_out; 8261 xcb_parts[2].iov_len = sizeof(xcb_out); 8262 xcb_parts[3].iov_base = 0; 8263 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 8264 8265 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 8266 return xcb_ret; 8267 } 8268 8269 xcb_atom_t * 8270 xcb_input_xi_list_properties_properties (const xcb_input_xi_list_properties_reply_t *R /**< */) 8271 { 8272 return (xcb_atom_t *) (R + 1); 8273 } 8274 8275 int 8276 xcb_input_xi_list_properties_properties_length (const xcb_input_xi_list_properties_reply_t *R /**< */) 8277 { 8278 return R->num_properties; 8279 } 8280 8281 xcb_generic_iterator_t 8282 xcb_input_xi_list_properties_properties_end (const xcb_input_xi_list_properties_reply_t *R /**< */) 8283 { 8284 xcb_generic_iterator_t i; 8285 i.data = ((xcb_atom_t *) (R + 1)) + (R->num_properties); 8286 i.rem = 0; 8287 i.index = (char *) i.data - (char *) R; 8288 return i; 8289 } 8290 8291 xcb_input_xi_list_properties_reply_t * 8292 xcb_input_xi_list_properties_reply (xcb_connection_t *c /**< */, 8293 xcb_input_xi_list_properties_cookie_t cookie /**< */, 8294 xcb_generic_error_t **e /**< */) 8295 { 8296 return (xcb_input_xi_list_properties_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 8297 } 8298 8299 uint8_t * 8300 xcb_input_xi_change_property_items_data_8 (const xcb_input_xi_change_property_items_t *S /**< */) 8301 { 8302 return /* items */ S->data8; 8303 } 8304 8305 int 8306 xcb_input_xi_change_property_items_data_8_length (const xcb_input_xi_change_property_request_t *R /**< */, 8307 const xcb_input_xi_change_property_items_t *S /**< */) 8308 { 8309 return R->num_items; 8310 } 8311 8312 xcb_generic_iterator_t 8313 xcb_input_xi_change_property_items_data_8_end (const xcb_input_xi_change_property_request_t *R /**< */, 8314 const xcb_input_xi_change_property_items_t *S /**< */) 8315 { 8316 xcb_generic_iterator_t i; 8317 i.data = /* items */ S->data8 + R->num_items; 8318 i.rem = 0; 8319 i.index = (char *) i.data - (char *) S; 8320 return i; 8321 } 8322 8323 uint16_t * 8324 xcb_input_xi_change_property_items_data_16 (const xcb_input_xi_change_property_items_t *S /**< */) 8325 { 8326 return /* items */ S->data16; 8327 } 8328 8329 int 8330 xcb_input_xi_change_property_items_data_16_length (const xcb_input_xi_change_property_request_t *R /**< */, 8331 const xcb_input_xi_change_property_items_t *S /**< */) 8332 { 8333 return R->num_items; 8334 } 8335 8336 xcb_generic_iterator_t 8337 xcb_input_xi_change_property_items_data_16_end (const xcb_input_xi_change_property_request_t *R /**< */, 8338 const xcb_input_xi_change_property_items_t *S /**< */) 8339 { 8340 xcb_generic_iterator_t i; 8341 i.data = /* items */ S->data16 + R->num_items; 8342 i.rem = 0; 8343 i.index = (char *) i.data - (char *) S; 8344 return i; 8345 } 8346 8347 uint32_t * 8348 xcb_input_xi_change_property_items_data_32 (const xcb_input_xi_change_property_items_t *S /**< */) 8349 { 8350 return /* items */ S->data32; 8351 } 8352 8353 int 8354 xcb_input_xi_change_property_items_data_32_length (const xcb_input_xi_change_property_request_t *R /**< */, 8355 const xcb_input_xi_change_property_items_t *S /**< */) 8356 { 8357 return R->num_items; 8358 } 8359 8360 xcb_generic_iterator_t 8361 xcb_input_xi_change_property_items_data_32_end (const xcb_input_xi_change_property_request_t *R /**< */, 8362 const xcb_input_xi_change_property_items_t *S /**< */) 8363 { 8364 xcb_generic_iterator_t i; 8365 i.data = /* items */ S->data32 + R->num_items; 8366 i.rem = 0; 8367 i.index = (char *) i.data - (char *) S; 8368 return i; 8369 } 8370 8371 int 8372 xcb_input_xi_change_property_items_serialize (void **_buffer /**< */, 8373 uint32_t num_items /**< */, 8374 uint8_t format /**< */, 8375 const xcb_input_xi_change_property_items_t *_aux /**< */) 8376 { 8377 char *xcb_out = *_buffer; 8378 unsigned int xcb_buffer_len = 0; 8379 unsigned int xcb_align_to = 0; 8380 8381 unsigned int xcb_pad = 0; 8382 char xcb_pad0[3] = {0, 0, 0}; 8383 struct iovec xcb_parts[7]; 8384 unsigned int xcb_parts_idx = 0; 8385 unsigned int xcb_block_len = 0; 8386 unsigned int i; 8387 char *xcb_tmp; 8388 8389 if(format & XCB_INPUT_PROPERTY_FORMAT_8_BITS) { 8390 /* insert padding */ 8391 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 8392 xcb_buffer_len += xcb_block_len + xcb_pad; 8393 if (0 != xcb_pad) { 8394 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; 8395 xcb_parts[xcb_parts_idx].iov_len = xcb_pad; 8396 xcb_parts_idx++; 8397 xcb_pad = 0; 8398 } 8399 xcb_block_len = 0; 8400 /* data8 */ 8401 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->data8; 8402 xcb_block_len += num_items * sizeof(uint8_t); 8403 xcb_parts[xcb_parts_idx].iov_len = num_items * sizeof(uint8_t); 8404 xcb_parts_idx++; 8405 xcb_align_to = ALIGNOF(uint8_t); 8406 } 8407 if(format & XCB_INPUT_PROPERTY_FORMAT_16_BITS) { 8408 /* insert padding */ 8409 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 8410 xcb_buffer_len += xcb_block_len + xcb_pad; 8411 if (0 != xcb_pad) { 8412 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; 8413 xcb_parts[xcb_parts_idx].iov_len = xcb_pad; 8414 xcb_parts_idx++; 8415 xcb_pad = 0; 8416 } 8417 xcb_block_len = 0; 8418 /* data16 */ 8419 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->data16; 8420 xcb_block_len += num_items * sizeof(uint16_t); 8421 xcb_parts[xcb_parts_idx].iov_len = num_items * sizeof(uint16_t); 8422 xcb_parts_idx++; 8423 xcb_align_to = ALIGNOF(uint16_t); 8424 } 8425 if(format & XCB_INPUT_PROPERTY_FORMAT_32_BITS) { 8426 /* insert padding */ 8427 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 8428 xcb_buffer_len += xcb_block_len + xcb_pad; 8429 if (0 != xcb_pad) { 8430 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; 8431 xcb_parts[xcb_parts_idx].iov_len = xcb_pad; 8432 xcb_parts_idx++; 8433 xcb_pad = 0; 8434 } 8435 xcb_block_len = 0; 8436 /* data32 */ 8437 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->data32; 8438 xcb_block_len += num_items * sizeof(uint32_t); 8439 xcb_parts[xcb_parts_idx].iov_len = num_items * sizeof(uint32_t); 8440 xcb_parts_idx++; 8441 xcb_align_to = ALIGNOF(uint32_t); 8442 } 8443 /* insert padding */ 8444 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 8445 xcb_buffer_len += xcb_block_len + xcb_pad; 8446 if (0 != xcb_pad) { 8447 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; 8448 xcb_parts[xcb_parts_idx].iov_len = xcb_pad; 8449 xcb_parts_idx++; 8450 xcb_pad = 0; 8451 } 8452 xcb_block_len = 0; 8453 8454 if (NULL == xcb_out) { 8455 /* allocate memory */ 8456 xcb_out = malloc(xcb_buffer_len); 8457 *_buffer = xcb_out; 8458 } 8459 8460 xcb_tmp = xcb_out; 8461 for(i=0; i<xcb_parts_idx; i++) { 8462 if (0 != xcb_parts[i].iov_base && 0 != xcb_parts[i].iov_len) 8463 memcpy(xcb_tmp, xcb_parts[i].iov_base, xcb_parts[i].iov_len); 8464 if (0 != xcb_parts[i].iov_len) 8465 xcb_tmp += xcb_parts[i].iov_len; 8466 } 8467 8468 return xcb_buffer_len; 8469 } 8470 8471 int 8472 xcb_input_xi_change_property_items_unpack (const void *_buffer /**< */, 8473 uint32_t num_items /**< */, 8474 uint8_t format /**< */, 8475 xcb_input_xi_change_property_items_t *_aux /**< */) 8476 { 8477 char *xcb_tmp = (char *)_buffer; 8478 unsigned int xcb_buffer_len = 0; 8479 unsigned int xcb_block_len = 0; 8480 unsigned int xcb_pad = 0; 8481 unsigned int xcb_align_to = 0; 8482 8483 8484 if(format & XCB_INPUT_PROPERTY_FORMAT_8_BITS) { 8485 /* insert padding */ 8486 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 8487 xcb_buffer_len += xcb_block_len + xcb_pad; 8488 if (0 != xcb_pad) { 8489 xcb_tmp += xcb_pad; 8490 xcb_pad = 0; 8491 } 8492 xcb_block_len = 0; 8493 /* data8 */ 8494 _aux->data8 = (uint8_t *)xcb_tmp; 8495 xcb_block_len += num_items * sizeof(uint8_t); 8496 xcb_tmp += xcb_block_len; 8497 xcb_align_to = ALIGNOF(uint8_t); 8498 } 8499 if(format & XCB_INPUT_PROPERTY_FORMAT_16_BITS) { 8500 /* insert padding */ 8501 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 8502 xcb_buffer_len += xcb_block_len + xcb_pad; 8503 if (0 != xcb_pad) { 8504 xcb_tmp += xcb_pad; 8505 xcb_pad = 0; 8506 } 8507 xcb_block_len = 0; 8508 /* data16 */ 8509 _aux->data16 = (uint16_t *)xcb_tmp; 8510 xcb_block_len += num_items * sizeof(uint16_t); 8511 xcb_tmp += xcb_block_len; 8512 xcb_align_to = ALIGNOF(uint16_t); 8513 } 8514 if(format & XCB_INPUT_PROPERTY_FORMAT_32_BITS) { 8515 /* insert padding */ 8516 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 8517 xcb_buffer_len += xcb_block_len + xcb_pad; 8518 if (0 != xcb_pad) { 8519 xcb_tmp += xcb_pad; 8520 xcb_pad = 0; 8521 } 8522 xcb_block_len = 0; 8523 /* data32 */ 8524 _aux->data32 = (uint32_t *)xcb_tmp; 8525 xcb_block_len += num_items * sizeof(uint32_t); 8526 xcb_tmp += xcb_block_len; 8527 xcb_align_to = ALIGNOF(uint32_t); 8528 } 8529 /* insert padding */ 8530 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 8531 xcb_buffer_len += xcb_block_len + xcb_pad; 8532 if (0 != xcb_pad) { 8533 xcb_tmp += xcb_pad; 8534 xcb_pad = 0; 8535 } 8536 xcb_block_len = 0; 8537 8538 return xcb_buffer_len; 8539 } 8540 8541 int 8542 xcb_input_xi_change_property_items_sizeof (const void *_buffer /**< */, 8543 uint32_t num_items /**< */, 8544 uint8_t format /**< */) 8545 { 8546 xcb_input_xi_change_property_items_t _aux; 8547 return xcb_input_xi_change_property_items_unpack(_buffer, num_items, format, &_aux); 8548 } 8549 8550 xcb_void_cookie_t 8551 xcb_input_xi_change_property_checked (xcb_connection_t *c /**< */, 8552 xcb_input_device_id_t deviceid /**< */, 8553 uint8_t mode /**< */, 8554 uint8_t format /**< */, 8555 xcb_atom_t property /**< */, 8556 xcb_atom_t type /**< */, 8557 uint32_t num_items /**< */, 8558 const void *items /**< */) 8559 { 8560 static const xcb_protocol_request_t xcb_req = { 8561 /* count */ 3, 8562 /* ext */ &xcb_input_id, 8563 /* opcode */ XCB_INPUT_XI_CHANGE_PROPERTY, 8564 /* isvoid */ 1 8565 }; 8566 8567 struct iovec xcb_parts[5]; 8568 xcb_void_cookie_t xcb_ret; 8569 xcb_input_xi_change_property_request_t xcb_out; 8570 8571 xcb_out.deviceid = deviceid; 8572 xcb_out.mode = mode; 8573 xcb_out.format = format; 8574 xcb_out.property = property; 8575 xcb_out.type = type; 8576 xcb_out.num_items = num_items; 8577 8578 xcb_parts[2].iov_base = (char *) &xcb_out; 8579 xcb_parts[2].iov_len = sizeof(xcb_out); 8580 xcb_parts[3].iov_base = 0; 8581 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 8582 /* xcb_input_xi_change_property_items_t items */ 8583 xcb_parts[4].iov_base = (char *) items; 8584 xcb_parts[4].iov_len = 8585 xcb_input_xi_change_property_items_sizeof (items, num_items, format); 8586 8587 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 8588 return xcb_ret; 8589 } 8590 8591 xcb_void_cookie_t 8592 xcb_input_xi_change_property (xcb_connection_t *c /**< */, 8593 xcb_input_device_id_t deviceid /**< */, 8594 uint8_t mode /**< */, 8595 uint8_t format /**< */, 8596 xcb_atom_t property /**< */, 8597 xcb_atom_t type /**< */, 8598 uint32_t num_items /**< */, 8599 const void *items /**< */) 8600 { 8601 static const xcb_protocol_request_t xcb_req = { 8602 /* count */ 3, 8603 /* ext */ &xcb_input_id, 8604 /* opcode */ XCB_INPUT_XI_CHANGE_PROPERTY, 8605 /* isvoid */ 1 8606 }; 8607 8608 struct iovec xcb_parts[5]; 8609 xcb_void_cookie_t xcb_ret; 8610 xcb_input_xi_change_property_request_t xcb_out; 8611 8612 xcb_out.deviceid = deviceid; 8613 xcb_out.mode = mode; 8614 xcb_out.format = format; 8615 xcb_out.property = property; 8616 xcb_out.type = type; 8617 xcb_out.num_items = num_items; 8618 8619 xcb_parts[2].iov_base = (char *) &xcb_out; 8620 xcb_parts[2].iov_len = sizeof(xcb_out); 8621 xcb_parts[3].iov_base = 0; 8622 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 8623 /* xcb_input_xi_change_property_items_t items */ 8624 xcb_parts[4].iov_base = (char *) items; 8625 xcb_parts[4].iov_len = 8626 xcb_input_xi_change_property_items_sizeof (items, num_items, format); 8627 8628 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 8629 return xcb_ret; 8630 } 8631 8632 xcb_void_cookie_t 8633 xcb_input_xi_change_property_aux_checked (xcb_connection_t *c /**< */, 8634 xcb_input_device_id_t deviceid /**< */, 8635 uint8_t mode /**< */, 8636 uint8_t format /**< */, 8637 xcb_atom_t property /**< */, 8638 xcb_atom_t type /**< */, 8639 uint32_t num_items /**< */, 8640 const xcb_input_xi_change_property_items_t *items /**< */) 8641 { 8642 static const xcb_protocol_request_t xcb_req = { 8643 /* count */ 3, 8644 /* ext */ &xcb_input_id, 8645 /* opcode */ XCB_INPUT_XI_CHANGE_PROPERTY, 8646 /* isvoid */ 1 8647 }; 8648 8649 struct iovec xcb_parts[5]; 8650 xcb_void_cookie_t xcb_ret; 8651 xcb_input_xi_change_property_request_t xcb_out; 8652 void *xcb_aux0 = 0; 8653 8654 xcb_out.deviceid = deviceid; 8655 xcb_out.mode = mode; 8656 xcb_out.format = format; 8657 xcb_out.property = property; 8658 xcb_out.type = type; 8659 xcb_out.num_items = num_items; 8660 8661 xcb_parts[2].iov_base = (char *) &xcb_out; 8662 xcb_parts[2].iov_len = sizeof(xcb_out); 8663 xcb_parts[3].iov_base = 0; 8664 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 8665 /* xcb_input_xi_change_property_items_t items */ 8666 xcb_parts[4].iov_len = 8667 xcb_input_xi_change_property_items_serialize (&xcb_aux0, num_items, format, items); 8668 xcb_parts[4].iov_base = xcb_aux0; 8669 8670 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 8671 free(xcb_aux0); 8672 return xcb_ret; 8673 } 8674 8675 xcb_void_cookie_t 8676 xcb_input_xi_change_property_aux (xcb_connection_t *c /**< */, 8677 xcb_input_device_id_t deviceid /**< */, 8678 uint8_t mode /**< */, 8679 uint8_t format /**< */, 8680 xcb_atom_t property /**< */, 8681 xcb_atom_t type /**< */, 8682 uint32_t num_items /**< */, 8683 const xcb_input_xi_change_property_items_t *items /**< */) 8684 { 8685 static const xcb_protocol_request_t xcb_req = { 8686 /* count */ 3, 8687 /* ext */ &xcb_input_id, 8688 /* opcode */ XCB_INPUT_XI_CHANGE_PROPERTY, 8689 /* isvoid */ 1 8690 }; 8691 8692 struct iovec xcb_parts[5]; 8693 xcb_void_cookie_t xcb_ret; 8694 xcb_input_xi_change_property_request_t xcb_out; 8695 void *xcb_aux0 = 0; 8696 8697 xcb_out.deviceid = deviceid; 8698 xcb_out.mode = mode; 8699 xcb_out.format = format; 8700 xcb_out.property = property; 8701 xcb_out.type = type; 8702 xcb_out.num_items = num_items; 8703 8704 xcb_parts[2].iov_base = (char *) &xcb_out; 8705 xcb_parts[2].iov_len = sizeof(xcb_out); 8706 xcb_parts[3].iov_base = 0; 8707 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 8708 /* xcb_input_xi_change_property_items_t items */ 8709 xcb_parts[4].iov_len = 8710 xcb_input_xi_change_property_items_serialize (&xcb_aux0, num_items, format, items); 8711 xcb_parts[4].iov_base = xcb_aux0; 8712 8713 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 8714 free(xcb_aux0); 8715 return xcb_ret; 8716 } 8717 8718 xcb_void_cookie_t 8719 xcb_input_xi_delete_property_checked (xcb_connection_t *c /**< */, 8720 xcb_input_device_id_t deviceid /**< */, 8721 xcb_atom_t property /**< */) 8722 { 8723 static const xcb_protocol_request_t xcb_req = { 8724 /* count */ 2, 8725 /* ext */ &xcb_input_id, 8726 /* opcode */ XCB_INPUT_XI_DELETE_PROPERTY, 8727 /* isvoid */ 1 8728 }; 8729 8730 struct iovec xcb_parts[4]; 8731 xcb_void_cookie_t xcb_ret; 8732 xcb_input_xi_delete_property_request_t xcb_out; 8733 8734 xcb_out.deviceid = deviceid; 8735 memset(xcb_out.pad0, 0, 2); 8736 xcb_out.property = property; 8737 8738 xcb_parts[2].iov_base = (char *) &xcb_out; 8739 xcb_parts[2].iov_len = sizeof(xcb_out); 8740 xcb_parts[3].iov_base = 0; 8741 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 8742 8743 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 8744 return xcb_ret; 8745 } 8746 8747 xcb_void_cookie_t 8748 xcb_input_xi_delete_property (xcb_connection_t *c /**< */, 8749 xcb_input_device_id_t deviceid /**< */, 8750 xcb_atom_t property /**< */) 8751 { 8752 static const xcb_protocol_request_t xcb_req = { 8753 /* count */ 2, 8754 /* ext */ &xcb_input_id, 8755 /* opcode */ XCB_INPUT_XI_DELETE_PROPERTY, 8756 /* isvoid */ 1 8757 }; 8758 8759 struct iovec xcb_parts[4]; 8760 xcb_void_cookie_t xcb_ret; 8761 xcb_input_xi_delete_property_request_t xcb_out; 8762 8763 xcb_out.deviceid = deviceid; 8764 memset(xcb_out.pad0, 0, 2); 8765 xcb_out.property = property; 8766 8767 xcb_parts[2].iov_base = (char *) &xcb_out; 8768 xcb_parts[2].iov_len = sizeof(xcb_out); 8769 xcb_parts[3].iov_base = 0; 8770 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 8771 8772 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 8773 return xcb_ret; 8774 } 8775 8776 uint8_t * 8777 xcb_input_xi_get_property_items_data_8 (const xcb_input_xi_get_property_items_t *S /**< */) 8778 { 8779 return /* items */ S->data8; 8780 } 8781 8782 int 8783 xcb_input_xi_get_property_items_data_8_length (const xcb_input_xi_get_property_reply_t *R /**< */, 8784 const xcb_input_xi_get_property_items_t *S /**< */) 8785 { 8786 return R->num_items; 8787 } 8788 8789 xcb_generic_iterator_t 8790 xcb_input_xi_get_property_items_data_8_end (const xcb_input_xi_get_property_reply_t *R /**< */, 8791 const xcb_input_xi_get_property_items_t *S /**< */) 8792 { 8793 xcb_generic_iterator_t i; 8794 i.data = /* items */ S->data8 + R->num_items; 8795 i.rem = 0; 8796 i.index = (char *) i.data - (char *) S; 8797 return i; 8798 } 8799 8800 uint16_t * 8801 xcb_input_xi_get_property_items_data_16 (const xcb_input_xi_get_property_items_t *S /**< */) 8802 { 8803 return /* items */ S->data16; 8804 } 8805 8806 int 8807 xcb_input_xi_get_property_items_data_16_length (const xcb_input_xi_get_property_reply_t *R /**< */, 8808 const xcb_input_xi_get_property_items_t *S /**< */) 8809 { 8810 return R->num_items; 8811 } 8812 8813 xcb_generic_iterator_t 8814 xcb_input_xi_get_property_items_data_16_end (const xcb_input_xi_get_property_reply_t *R /**< */, 8815 const xcb_input_xi_get_property_items_t *S /**< */) 8816 { 8817 xcb_generic_iterator_t i; 8818 i.data = /* items */ S->data16 + R->num_items; 8819 i.rem = 0; 8820 i.index = (char *) i.data - (char *) S; 8821 return i; 8822 } 8823 8824 uint32_t * 8825 xcb_input_xi_get_property_items_data_32 (const xcb_input_xi_get_property_items_t *S /**< */) 8826 { 8827 return /* items */ S->data32; 8828 } 8829 8830 int 8831 xcb_input_xi_get_property_items_data_32_length (const xcb_input_xi_get_property_reply_t *R /**< */, 8832 const xcb_input_xi_get_property_items_t *S /**< */) 8833 { 8834 return R->num_items; 8835 } 8836 8837 xcb_generic_iterator_t 8838 xcb_input_xi_get_property_items_data_32_end (const xcb_input_xi_get_property_reply_t *R /**< */, 8839 const xcb_input_xi_get_property_items_t *S /**< */) 8840 { 8841 xcb_generic_iterator_t i; 8842 i.data = /* items */ S->data32 + R->num_items; 8843 i.rem = 0; 8844 i.index = (char *) i.data - (char *) S; 8845 return i; 8846 } 8847 8848 int 8849 xcb_input_xi_get_property_items_serialize (void **_buffer /**< */, 8850 uint32_t num_items /**< */, 8851 uint8_t format /**< */, 8852 const xcb_input_xi_get_property_items_t *_aux /**< */) 8853 { 8854 char *xcb_out = *_buffer; 8855 unsigned int xcb_buffer_len = 0; 8856 unsigned int xcb_align_to = 0; 8857 8858 unsigned int xcb_pad = 0; 8859 char xcb_pad0[3] = {0, 0, 0}; 8860 struct iovec xcb_parts[7]; 8861 unsigned int xcb_parts_idx = 0; 8862 unsigned int xcb_block_len = 0; 8863 unsigned int i; 8864 char *xcb_tmp; 8865 8866 if(format & XCB_INPUT_PROPERTY_FORMAT_8_BITS) { 8867 /* insert padding */ 8868 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 8869 xcb_buffer_len += xcb_block_len + xcb_pad; 8870 if (0 != xcb_pad) { 8871 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; 8872 xcb_parts[xcb_parts_idx].iov_len = xcb_pad; 8873 xcb_parts_idx++; 8874 xcb_pad = 0; 8875 } 8876 xcb_block_len = 0; 8877 /* data8 */ 8878 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->data8; 8879 xcb_block_len += num_items * sizeof(uint8_t); 8880 xcb_parts[xcb_parts_idx].iov_len = num_items * sizeof(uint8_t); 8881 xcb_parts_idx++; 8882 xcb_align_to = ALIGNOF(uint8_t); 8883 } 8884 if(format & XCB_INPUT_PROPERTY_FORMAT_16_BITS) { 8885 /* insert padding */ 8886 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 8887 xcb_buffer_len += xcb_block_len + xcb_pad; 8888 if (0 != xcb_pad) { 8889 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; 8890 xcb_parts[xcb_parts_idx].iov_len = xcb_pad; 8891 xcb_parts_idx++; 8892 xcb_pad = 0; 8893 } 8894 xcb_block_len = 0; 8895 /* data16 */ 8896 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->data16; 8897 xcb_block_len += num_items * sizeof(uint16_t); 8898 xcb_parts[xcb_parts_idx].iov_len = num_items * sizeof(uint16_t); 8899 xcb_parts_idx++; 8900 xcb_align_to = ALIGNOF(uint16_t); 8901 } 8902 if(format & XCB_INPUT_PROPERTY_FORMAT_32_BITS) { 8903 /* insert padding */ 8904 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 8905 xcb_buffer_len += xcb_block_len + xcb_pad; 8906 if (0 != xcb_pad) { 8907 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; 8908 xcb_parts[xcb_parts_idx].iov_len = xcb_pad; 8909 xcb_parts_idx++; 8910 xcb_pad = 0; 8911 } 8912 xcb_block_len = 0; 8913 /* data32 */ 8914 xcb_parts[xcb_parts_idx].iov_base = (char *) _aux->data32; 8915 xcb_block_len += num_items * sizeof(uint32_t); 8916 xcb_parts[xcb_parts_idx].iov_len = num_items * sizeof(uint32_t); 8917 xcb_parts_idx++; 8918 xcb_align_to = ALIGNOF(uint32_t); 8919 } 8920 /* insert padding */ 8921 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 8922 xcb_buffer_len += xcb_block_len + xcb_pad; 8923 if (0 != xcb_pad) { 8924 xcb_parts[xcb_parts_idx].iov_base = xcb_pad0; 8925 xcb_parts[xcb_parts_idx].iov_len = xcb_pad; 8926 xcb_parts_idx++; 8927 xcb_pad = 0; 8928 } 8929 xcb_block_len = 0; 8930 8931 if (NULL == xcb_out) { 8932 /* allocate memory */ 8933 xcb_out = malloc(xcb_buffer_len); 8934 *_buffer = xcb_out; 8935 } 8936 8937 xcb_tmp = xcb_out; 8938 for(i=0; i<xcb_parts_idx; i++) { 8939 if (0 != xcb_parts[i].iov_base && 0 != xcb_parts[i].iov_len) 8940 memcpy(xcb_tmp, xcb_parts[i].iov_base, xcb_parts[i].iov_len); 8941 if (0 != xcb_parts[i].iov_len) 8942 xcb_tmp += xcb_parts[i].iov_len; 8943 } 8944 8945 return xcb_buffer_len; 8946 } 8947 8948 int 8949 xcb_input_xi_get_property_items_unpack (const void *_buffer /**< */, 8950 uint32_t num_items /**< */, 8951 uint8_t format /**< */, 8952 xcb_input_xi_get_property_items_t *_aux /**< */) 8953 { 8954 char *xcb_tmp = (char *)_buffer; 8955 unsigned int xcb_buffer_len = 0; 8956 unsigned int xcb_block_len = 0; 8957 unsigned int xcb_pad = 0; 8958 unsigned int xcb_align_to = 0; 8959 8960 8961 if(format & XCB_INPUT_PROPERTY_FORMAT_8_BITS) { 8962 /* insert padding */ 8963 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 8964 xcb_buffer_len += xcb_block_len + xcb_pad; 8965 if (0 != xcb_pad) { 8966 xcb_tmp += xcb_pad; 8967 xcb_pad = 0; 8968 } 8969 xcb_block_len = 0; 8970 /* data8 */ 8971 _aux->data8 = (uint8_t *)xcb_tmp; 8972 xcb_block_len += num_items * sizeof(uint8_t); 8973 xcb_tmp += xcb_block_len; 8974 xcb_align_to = ALIGNOF(uint8_t); 8975 } 8976 if(format & XCB_INPUT_PROPERTY_FORMAT_16_BITS) { 8977 /* insert padding */ 8978 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 8979 xcb_buffer_len += xcb_block_len + xcb_pad; 8980 if (0 != xcb_pad) { 8981 xcb_tmp += xcb_pad; 8982 xcb_pad = 0; 8983 } 8984 xcb_block_len = 0; 8985 /* data16 */ 8986 _aux->data16 = (uint16_t *)xcb_tmp; 8987 xcb_block_len += num_items * sizeof(uint16_t); 8988 xcb_tmp += xcb_block_len; 8989 xcb_align_to = ALIGNOF(uint16_t); 8990 } 8991 if(format & XCB_INPUT_PROPERTY_FORMAT_32_BITS) { 8992 /* insert padding */ 8993 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 8994 xcb_buffer_len += xcb_block_len + xcb_pad; 8995 if (0 != xcb_pad) { 8996 xcb_tmp += xcb_pad; 8997 xcb_pad = 0; 8998 } 8999 xcb_block_len = 0; 9000 /* data32 */ 9001 _aux->data32 = (uint32_t *)xcb_tmp; 9002 xcb_block_len += num_items * sizeof(uint32_t); 9003 xcb_tmp += xcb_block_len; 9004 xcb_align_to = ALIGNOF(uint32_t); 9005 } 9006 /* insert padding */ 9007 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 9008 xcb_buffer_len += xcb_block_len + xcb_pad; 9009 if (0 != xcb_pad) { 9010 xcb_tmp += xcb_pad; 9011 xcb_pad = 0; 9012 } 9013 xcb_block_len = 0; 9014 9015 return xcb_buffer_len; 9016 } 9017 9018 int 9019 xcb_input_xi_get_property_items_sizeof (const void *_buffer /**< */, 9020 uint32_t num_items /**< */, 9021 uint8_t format /**< */) 9022 { 9023 xcb_input_xi_get_property_items_t _aux; 9024 return xcb_input_xi_get_property_items_unpack(_buffer, num_items, format, &_aux); 9025 } 9026 9027 xcb_input_xi_get_property_cookie_t 9028 xcb_input_xi_get_property (xcb_connection_t *c /**< */, 9029 xcb_input_device_id_t deviceid /**< */, 9030 uint8_t _delete /**< */, 9031 xcb_atom_t property /**< */, 9032 xcb_atom_t type /**< */, 9033 uint32_t offset /**< */, 9034 uint32_t len /**< */) 9035 { 9036 static const xcb_protocol_request_t xcb_req = { 9037 /* count */ 2, 9038 /* ext */ &xcb_input_id, 9039 /* opcode */ XCB_INPUT_XI_GET_PROPERTY, 9040 /* isvoid */ 0 9041 }; 9042 9043 struct iovec xcb_parts[4]; 9044 xcb_input_xi_get_property_cookie_t xcb_ret; 9045 xcb_input_xi_get_property_request_t xcb_out; 9046 9047 xcb_out.deviceid = deviceid; 9048 xcb_out._delete = _delete; 9049 xcb_out.pad0 = 0; 9050 xcb_out.property = property; 9051 xcb_out.type = type; 9052 xcb_out.offset = offset; 9053 xcb_out.len = len; 9054 9055 xcb_parts[2].iov_base = (char *) &xcb_out; 9056 xcb_parts[2].iov_len = sizeof(xcb_out); 9057 xcb_parts[3].iov_base = 0; 9058 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 9059 9060 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 9061 return xcb_ret; 9062 } 9063 9064 xcb_input_xi_get_property_cookie_t 9065 xcb_input_xi_get_property_unchecked (xcb_connection_t *c /**< */, 9066 xcb_input_device_id_t deviceid /**< */, 9067 uint8_t _delete /**< */, 9068 xcb_atom_t property /**< */, 9069 xcb_atom_t type /**< */, 9070 uint32_t offset /**< */, 9071 uint32_t len /**< */) 9072 { 9073 static const xcb_protocol_request_t xcb_req = { 9074 /* count */ 2, 9075 /* ext */ &xcb_input_id, 9076 /* opcode */ XCB_INPUT_XI_GET_PROPERTY, 9077 /* isvoid */ 0 9078 }; 9079 9080 struct iovec xcb_parts[4]; 9081 xcb_input_xi_get_property_cookie_t xcb_ret; 9082 xcb_input_xi_get_property_request_t xcb_out; 9083 9084 xcb_out.deviceid = deviceid; 9085 xcb_out._delete = _delete; 9086 xcb_out.pad0 = 0; 9087 xcb_out.property = property; 9088 xcb_out.type = type; 9089 xcb_out.offset = offset; 9090 xcb_out.len = len; 9091 9092 xcb_parts[2].iov_base = (char *) &xcb_out; 9093 xcb_parts[2].iov_len = sizeof(xcb_out); 9094 xcb_parts[3].iov_base = 0; 9095 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 9096 9097 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 9098 return xcb_ret; 9099 } 9100 9101 void * 9102 xcb_input_xi_get_property_items (const xcb_input_xi_get_property_reply_t *R /**< */) 9103 { 9104 return (void *) (R + 1); 9105 } 9106 9107 xcb_input_xi_get_property_reply_t * 9108 xcb_input_xi_get_property_reply (xcb_connection_t *c /**< */, 9109 xcb_input_xi_get_property_cookie_t cookie /**< */, 9110 xcb_generic_error_t **e /**< */) 9111 { 9112 return (xcb_input_xi_get_property_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 9113 } 9114 9115 int 9116 xcb_input_xi_get_selected_events_sizeof (const void *_buffer /**< */) 9117 { 9118 char *xcb_tmp = (char *)_buffer; 9119 const xcb_input_xi_get_selected_events_reply_t *_aux = (xcb_input_xi_get_selected_events_reply_t *)_buffer; 9120 unsigned int xcb_buffer_len = 0; 9121 unsigned int xcb_block_len = 0; 9122 unsigned int xcb_pad = 0; 9123 unsigned int xcb_align_to = 0; 9124 9125 unsigned int i; 9126 unsigned int xcb_tmp_len; 9127 9128 xcb_block_len += sizeof(xcb_input_xi_get_selected_events_reply_t); 9129 xcb_tmp += xcb_block_len; 9130 xcb_buffer_len += xcb_block_len; 9131 xcb_block_len = 0; 9132 /* masks */ 9133 for(i=0; i<_aux->num_masks; i++) { 9134 xcb_tmp_len = xcb_input_event_mask_sizeof(xcb_tmp); 9135 xcb_block_len += xcb_tmp_len; 9136 xcb_tmp += xcb_tmp_len; 9137 } 9138 xcb_align_to = ALIGNOF(xcb_input_event_mask_t); 9139 /* insert padding */ 9140 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 9141 xcb_buffer_len += xcb_block_len + xcb_pad; 9142 if (0 != xcb_pad) { 9143 xcb_tmp += xcb_pad; 9144 xcb_pad = 0; 9145 } 9146 xcb_block_len = 0; 9147 9148 return xcb_buffer_len; 9149 } 9150 9151 xcb_input_xi_get_selected_events_cookie_t 9152 xcb_input_xi_get_selected_events (xcb_connection_t *c /**< */, 9153 xcb_window_t window /**< */) 9154 { 9155 static const xcb_protocol_request_t xcb_req = { 9156 /* count */ 2, 9157 /* ext */ &xcb_input_id, 9158 /* opcode */ XCB_INPUT_XI_GET_SELECTED_EVENTS, 9159 /* isvoid */ 0 9160 }; 9161 9162 struct iovec xcb_parts[4]; 9163 xcb_input_xi_get_selected_events_cookie_t xcb_ret; 9164 xcb_input_xi_get_selected_events_request_t xcb_out; 9165 9166 xcb_out.window = window; 9167 9168 xcb_parts[2].iov_base = (char *) &xcb_out; 9169 xcb_parts[2].iov_len = sizeof(xcb_out); 9170 xcb_parts[3].iov_base = 0; 9171 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 9172 9173 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 9174 return xcb_ret; 9175 } 9176 9177 xcb_input_xi_get_selected_events_cookie_t 9178 xcb_input_xi_get_selected_events_unchecked (xcb_connection_t *c /**< */, 9179 xcb_window_t window /**< */) 9180 { 9181 static const xcb_protocol_request_t xcb_req = { 9182 /* count */ 2, 9183 /* ext */ &xcb_input_id, 9184 /* opcode */ XCB_INPUT_XI_GET_SELECTED_EVENTS, 9185 /* isvoid */ 0 9186 }; 9187 9188 struct iovec xcb_parts[4]; 9189 xcb_input_xi_get_selected_events_cookie_t xcb_ret; 9190 xcb_input_xi_get_selected_events_request_t xcb_out; 9191 9192 xcb_out.window = window; 9193 9194 xcb_parts[2].iov_base = (char *) &xcb_out; 9195 xcb_parts[2].iov_len = sizeof(xcb_out); 9196 xcb_parts[3].iov_base = 0; 9197 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 9198 9199 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 9200 return xcb_ret; 9201 } 9202 9203 int 9204 xcb_input_xi_get_selected_events_masks_length (const xcb_input_xi_get_selected_events_reply_t *R /**< */) 9205 { 9206 return R->num_masks; 9207 } 9208 9209 xcb_input_event_mask_iterator_t 9210 xcb_input_xi_get_selected_events_masks_iterator (const xcb_input_xi_get_selected_events_reply_t *R /**< */) 9211 { 9212 xcb_input_event_mask_iterator_t i; 9213 i.data = (xcb_input_event_mask_t *) (R + 1); 9214 i.rem = R->num_masks; 9215 i.index = (char *) i.data - (char *) R; 9216 return i; 9217 } 9218 9219 xcb_input_xi_get_selected_events_reply_t * 9220 xcb_input_xi_get_selected_events_reply (xcb_connection_t *c /**< */, 9221 xcb_input_xi_get_selected_events_cookie_t cookie /**< */, 9222 xcb_generic_error_t **e /**< */) 9223 { 9224 return (xcb_input_xi_get_selected_events_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 9225 } 9226 9227 void 9228 xcb_input_barrier_release_pointer_info_next (xcb_input_barrier_release_pointer_info_iterator_t *i /**< */) 9229 { 9230 --i->rem; 9231 ++i->data; 9232 i->index += sizeof(xcb_input_barrier_release_pointer_info_t); 9233 } 9234 9235 xcb_generic_iterator_t 9236 xcb_input_barrier_release_pointer_info_end (xcb_input_barrier_release_pointer_info_iterator_t i /**< */) 9237 { 9238 xcb_generic_iterator_t ret; 9239 ret.data = i.data + i.rem; 9240 ret.index = i.index + ((char *) ret.data - (char *) i.data); 9241 ret.rem = 0; 9242 return ret; 9243 } 9244 9245 int 9246 xcb_input_xi_barrier_release_pointer_sizeof (const void *_buffer /**< */) 9247 { 9248 char *xcb_tmp = (char *)_buffer; 9249 const xcb_input_xi_barrier_release_pointer_request_t *_aux = (xcb_input_xi_barrier_release_pointer_request_t *)_buffer; 9250 unsigned int xcb_buffer_len = 0; 9251 unsigned int xcb_block_len = 0; 9252 unsigned int xcb_pad = 0; 9253 unsigned int xcb_align_to = 0; 9254 9255 9256 xcb_block_len += sizeof(xcb_input_xi_barrier_release_pointer_request_t); 9257 xcb_tmp += xcb_block_len; 9258 xcb_buffer_len += xcb_block_len; 9259 xcb_block_len = 0; 9260 /* barriers */ 9261 xcb_block_len += _aux->num_barriers * sizeof(xcb_input_barrier_release_pointer_info_t); 9262 xcb_tmp += xcb_block_len; 9263 xcb_align_to = ALIGNOF(xcb_input_barrier_release_pointer_info_t); 9264 /* insert padding */ 9265 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 9266 xcb_buffer_len += xcb_block_len + xcb_pad; 9267 if (0 != xcb_pad) { 9268 xcb_tmp += xcb_pad; 9269 xcb_pad = 0; 9270 } 9271 xcb_block_len = 0; 9272 9273 return xcb_buffer_len; 9274 } 9275 9276 xcb_void_cookie_t 9277 xcb_input_xi_barrier_release_pointer_checked (xcb_connection_t *c /**< */, 9278 uint32_t num_barriers /**< */, 9279 const xcb_input_barrier_release_pointer_info_t *barriers /**< */) 9280 { 9281 static const xcb_protocol_request_t xcb_req = { 9282 /* count */ 4, 9283 /* ext */ &xcb_input_id, 9284 /* opcode */ XCB_INPUT_XI_BARRIER_RELEASE_POINTER, 9285 /* isvoid */ 1 9286 }; 9287 9288 struct iovec xcb_parts[6]; 9289 xcb_void_cookie_t xcb_ret; 9290 xcb_input_xi_barrier_release_pointer_request_t xcb_out; 9291 9292 xcb_out.num_barriers = num_barriers; 9293 9294 xcb_parts[2].iov_base = (char *) &xcb_out; 9295 xcb_parts[2].iov_len = sizeof(xcb_out); 9296 xcb_parts[3].iov_base = 0; 9297 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 9298 /* xcb_input_barrier_release_pointer_info_t barriers */ 9299 xcb_parts[4].iov_base = (char *) barriers; 9300 xcb_parts[4].iov_len = num_barriers * sizeof(xcb_input_barrier_release_pointer_info_t); 9301 xcb_parts[5].iov_base = 0; 9302 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 9303 9304 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 9305 return xcb_ret; 9306 } 9307 9308 xcb_void_cookie_t 9309 xcb_input_xi_barrier_release_pointer (xcb_connection_t *c /**< */, 9310 uint32_t num_barriers /**< */, 9311 const xcb_input_barrier_release_pointer_info_t *barriers /**< */) 9312 { 9313 static const xcb_protocol_request_t xcb_req = { 9314 /* count */ 4, 9315 /* ext */ &xcb_input_id, 9316 /* opcode */ XCB_INPUT_XI_BARRIER_RELEASE_POINTER, 9317 /* isvoid */ 1 9318 }; 9319 9320 struct iovec xcb_parts[6]; 9321 xcb_void_cookie_t xcb_ret; 9322 xcb_input_xi_barrier_release_pointer_request_t xcb_out; 9323 9324 xcb_out.num_barriers = num_barriers; 9325 9326 xcb_parts[2].iov_base = (char *) &xcb_out; 9327 xcb_parts[2].iov_len = sizeof(xcb_out); 9328 xcb_parts[3].iov_base = 0; 9329 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 9330 /* xcb_input_barrier_release_pointer_info_t barriers */ 9331 xcb_parts[4].iov_base = (char *) barriers; 9332 xcb_parts[4].iov_len = num_barriers * sizeof(xcb_input_barrier_release_pointer_info_t); 9333 xcb_parts[5].iov_base = 0; 9334 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 9335 9336 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 9337 return xcb_ret; 9338 } 9339 9340 int 9341 xcb_input_device_changed_sizeof (const void *_buffer /**< */) 9342 { 9343 char *xcb_tmp = (char *)_buffer; 9344 const xcb_input_device_changed_event_t *_aux = (xcb_input_device_changed_event_t *)_buffer; 9345 unsigned int xcb_buffer_len = 0; 9346 unsigned int xcb_block_len = 0; 9347 unsigned int xcb_pad = 0; 9348 unsigned int xcb_align_to = 0; 9349 9350 unsigned int i; 9351 unsigned int xcb_tmp_len; 9352 9353 xcb_block_len += sizeof(xcb_input_device_changed_event_t); 9354 xcb_tmp += xcb_block_len; 9355 xcb_buffer_len += xcb_block_len; 9356 xcb_block_len = 0; 9357 /* classes */ 9358 for(i=0; i<_aux->num_classes; i++) { 9359 xcb_tmp_len = xcb_input_device_class_sizeof(xcb_tmp); 9360 xcb_block_len += xcb_tmp_len; 9361 xcb_tmp += xcb_tmp_len; 9362 } 9363 xcb_align_to = ALIGNOF(xcb_input_device_class_t); 9364 /* insert padding */ 9365 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 9366 xcb_buffer_len += xcb_block_len + xcb_pad; 9367 if (0 != xcb_pad) { 9368 xcb_tmp += xcb_pad; 9369 xcb_pad = 0; 9370 } 9371 xcb_block_len = 0; 9372 9373 return xcb_buffer_len; 9374 } 9375 9376 int 9377 xcb_input_key_press_sizeof (const void *_buffer /**< */) 9378 { 9379 char *xcb_tmp = (char *)_buffer; 9380 const xcb_input_key_press_event_t *_aux = (xcb_input_key_press_event_t *)_buffer; 9381 unsigned int xcb_buffer_len = 0; 9382 unsigned int xcb_block_len = 0; 9383 unsigned int xcb_pad = 0; 9384 unsigned int xcb_align_to = 0; 9385 9386 9387 xcb_block_len += sizeof(xcb_input_key_press_event_t); 9388 xcb_tmp += xcb_block_len; 9389 xcb_buffer_len += xcb_block_len; 9390 xcb_block_len = 0; 9391 /* button_mask */ 9392 xcb_block_len += _aux->buttons_len * sizeof(uint32_t); 9393 xcb_tmp += xcb_block_len; 9394 xcb_align_to = ALIGNOF(uint32_t); 9395 /* insert padding */ 9396 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 9397 xcb_buffer_len += xcb_block_len + xcb_pad; 9398 if (0 != xcb_pad) { 9399 xcb_tmp += xcb_pad; 9400 xcb_pad = 0; 9401 } 9402 xcb_block_len = 0; 9403 /* valuator_mask */ 9404 xcb_block_len += _aux->valuators_len * sizeof(uint32_t); 9405 xcb_tmp += xcb_block_len; 9406 xcb_align_to = ALIGNOF(uint32_t); 9407 /* insert padding */ 9408 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 9409 xcb_buffer_len += xcb_block_len + xcb_pad; 9410 if (0 != xcb_pad) { 9411 xcb_tmp += xcb_pad; 9412 xcb_pad = 0; 9413 } 9414 xcb_block_len = 0; 9415 9416 return xcb_buffer_len; 9417 } 9418 9419 int 9420 xcb_input_key_release_sizeof (const void *_buffer /**< */) 9421 { 9422 char *xcb_tmp = (char *)_buffer; 9423 const xcb_input_key_release_event_t *_aux = (xcb_input_key_release_event_t *)_buffer; 9424 unsigned int xcb_buffer_len = 0; 9425 unsigned int xcb_block_len = 0; 9426 unsigned int xcb_pad = 0; 9427 unsigned int xcb_align_to = 0; 9428 9429 9430 xcb_block_len += sizeof(xcb_input_key_release_event_t); 9431 xcb_tmp += xcb_block_len; 9432 xcb_buffer_len += xcb_block_len; 9433 xcb_block_len = 0; 9434 /* button_mask */ 9435 xcb_block_len += _aux->buttons_len * sizeof(uint32_t); 9436 xcb_tmp += xcb_block_len; 9437 xcb_align_to = ALIGNOF(uint32_t); 9438 /* insert padding */ 9439 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 9440 xcb_buffer_len += xcb_block_len + xcb_pad; 9441 if (0 != xcb_pad) { 9442 xcb_tmp += xcb_pad; 9443 xcb_pad = 0; 9444 } 9445 xcb_block_len = 0; 9446 /* valuator_mask */ 9447 xcb_block_len += _aux->valuators_len * sizeof(uint32_t); 9448 xcb_tmp += xcb_block_len; 9449 xcb_align_to = ALIGNOF(uint32_t); 9450 /* insert padding */ 9451 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 9452 xcb_buffer_len += xcb_block_len + xcb_pad; 9453 if (0 != xcb_pad) { 9454 xcb_tmp += xcb_pad; 9455 xcb_pad = 0; 9456 } 9457 xcb_block_len = 0; 9458 9459 return xcb_buffer_len; 9460 } 9461 9462 int 9463 xcb_input_button_press_sizeof (const void *_buffer /**< */) 9464 { 9465 char *xcb_tmp = (char *)_buffer; 9466 const xcb_input_button_press_event_t *_aux = (xcb_input_button_press_event_t *)_buffer; 9467 unsigned int xcb_buffer_len = 0; 9468 unsigned int xcb_block_len = 0; 9469 unsigned int xcb_pad = 0; 9470 unsigned int xcb_align_to = 0; 9471 9472 9473 xcb_block_len += sizeof(xcb_input_button_press_event_t); 9474 xcb_tmp += xcb_block_len; 9475 xcb_buffer_len += xcb_block_len; 9476 xcb_block_len = 0; 9477 /* button_mask */ 9478 xcb_block_len += _aux->buttons_len * sizeof(uint32_t); 9479 xcb_tmp += xcb_block_len; 9480 xcb_align_to = ALIGNOF(uint32_t); 9481 /* insert padding */ 9482 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 9483 xcb_buffer_len += xcb_block_len + xcb_pad; 9484 if (0 != xcb_pad) { 9485 xcb_tmp += xcb_pad; 9486 xcb_pad = 0; 9487 } 9488 xcb_block_len = 0; 9489 /* valuator_mask */ 9490 xcb_block_len += _aux->valuators_len * sizeof(uint32_t); 9491 xcb_tmp += xcb_block_len; 9492 xcb_align_to = ALIGNOF(uint32_t); 9493 /* insert padding */ 9494 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 9495 xcb_buffer_len += xcb_block_len + xcb_pad; 9496 if (0 != xcb_pad) { 9497 xcb_tmp += xcb_pad; 9498 xcb_pad = 0; 9499 } 9500 xcb_block_len = 0; 9501 9502 return xcb_buffer_len; 9503 } 9504 9505 int 9506 xcb_input_button_release_sizeof (const void *_buffer /**< */) 9507 { 9508 char *xcb_tmp = (char *)_buffer; 9509 const xcb_input_button_release_event_t *_aux = (xcb_input_button_release_event_t *)_buffer; 9510 unsigned int xcb_buffer_len = 0; 9511 unsigned int xcb_block_len = 0; 9512 unsigned int xcb_pad = 0; 9513 unsigned int xcb_align_to = 0; 9514 9515 9516 xcb_block_len += sizeof(xcb_input_button_release_event_t); 9517 xcb_tmp += xcb_block_len; 9518 xcb_buffer_len += xcb_block_len; 9519 xcb_block_len = 0; 9520 /* button_mask */ 9521 xcb_block_len += _aux->buttons_len * sizeof(uint32_t); 9522 xcb_tmp += xcb_block_len; 9523 xcb_align_to = ALIGNOF(uint32_t); 9524 /* insert padding */ 9525 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 9526 xcb_buffer_len += xcb_block_len + xcb_pad; 9527 if (0 != xcb_pad) { 9528 xcb_tmp += xcb_pad; 9529 xcb_pad = 0; 9530 } 9531 xcb_block_len = 0; 9532 /* valuator_mask */ 9533 xcb_block_len += _aux->valuators_len * sizeof(uint32_t); 9534 xcb_tmp += xcb_block_len; 9535 xcb_align_to = ALIGNOF(uint32_t); 9536 /* insert padding */ 9537 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 9538 xcb_buffer_len += xcb_block_len + xcb_pad; 9539 if (0 != xcb_pad) { 9540 xcb_tmp += xcb_pad; 9541 xcb_pad = 0; 9542 } 9543 xcb_block_len = 0; 9544 9545 return xcb_buffer_len; 9546 } 9547 9548 int 9549 xcb_input_motion_sizeof (const void *_buffer /**< */) 9550 { 9551 char *xcb_tmp = (char *)_buffer; 9552 const xcb_input_motion_event_t *_aux = (xcb_input_motion_event_t *)_buffer; 9553 unsigned int xcb_buffer_len = 0; 9554 unsigned int xcb_block_len = 0; 9555 unsigned int xcb_pad = 0; 9556 unsigned int xcb_align_to = 0; 9557 9558 9559 xcb_block_len += sizeof(xcb_input_motion_event_t); 9560 xcb_tmp += xcb_block_len; 9561 xcb_buffer_len += xcb_block_len; 9562 xcb_block_len = 0; 9563 /* button_mask */ 9564 xcb_block_len += _aux->buttons_len * sizeof(uint32_t); 9565 xcb_tmp += xcb_block_len; 9566 xcb_align_to = ALIGNOF(uint32_t); 9567 /* insert padding */ 9568 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 9569 xcb_buffer_len += xcb_block_len + xcb_pad; 9570 if (0 != xcb_pad) { 9571 xcb_tmp += xcb_pad; 9572 xcb_pad = 0; 9573 } 9574 xcb_block_len = 0; 9575 /* valuator_mask */ 9576 xcb_block_len += _aux->valuators_len * sizeof(uint32_t); 9577 xcb_tmp += xcb_block_len; 9578 xcb_align_to = ALIGNOF(uint32_t); 9579 /* insert padding */ 9580 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 9581 xcb_buffer_len += xcb_block_len + xcb_pad; 9582 if (0 != xcb_pad) { 9583 xcb_tmp += xcb_pad; 9584 xcb_pad = 0; 9585 } 9586 xcb_block_len = 0; 9587 9588 return xcb_buffer_len; 9589 } 9590 9591 int 9592 xcb_input_enter_sizeof (const void *_buffer /**< */) 9593 { 9594 char *xcb_tmp = (char *)_buffer; 9595 const xcb_input_enter_event_t *_aux = (xcb_input_enter_event_t *)_buffer; 9596 unsigned int xcb_buffer_len = 0; 9597 unsigned int xcb_block_len = 0; 9598 unsigned int xcb_pad = 0; 9599 unsigned int xcb_align_to = 0; 9600 9601 9602 xcb_block_len += sizeof(xcb_input_enter_event_t); 9603 xcb_tmp += xcb_block_len; 9604 xcb_buffer_len += xcb_block_len; 9605 xcb_block_len = 0; 9606 /* buttons */ 9607 xcb_block_len += _aux->buttons_len * sizeof(uint32_t); 9608 xcb_tmp += xcb_block_len; 9609 xcb_align_to = ALIGNOF(uint32_t); 9610 /* insert padding */ 9611 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 9612 xcb_buffer_len += xcb_block_len + xcb_pad; 9613 if (0 != xcb_pad) { 9614 xcb_tmp += xcb_pad; 9615 xcb_pad = 0; 9616 } 9617 xcb_block_len = 0; 9618 9619 return xcb_buffer_len; 9620 } 9621 9622 int 9623 xcb_input_leave_sizeof (const void *_buffer /**< */) 9624 { 9625 char *xcb_tmp = (char *)_buffer; 9626 const xcb_input_leave_event_t *_aux = (xcb_input_leave_event_t *)_buffer; 9627 unsigned int xcb_buffer_len = 0; 9628 unsigned int xcb_block_len = 0; 9629 unsigned int xcb_pad = 0; 9630 unsigned int xcb_align_to = 0; 9631 9632 9633 xcb_block_len += sizeof(xcb_input_leave_event_t); 9634 xcb_tmp += xcb_block_len; 9635 xcb_buffer_len += xcb_block_len; 9636 xcb_block_len = 0; 9637 /* buttons */ 9638 xcb_block_len += _aux->buttons_len * sizeof(uint32_t); 9639 xcb_tmp += xcb_block_len; 9640 xcb_align_to = ALIGNOF(uint32_t); 9641 /* insert padding */ 9642 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 9643 xcb_buffer_len += xcb_block_len + xcb_pad; 9644 if (0 != xcb_pad) { 9645 xcb_tmp += xcb_pad; 9646 xcb_pad = 0; 9647 } 9648 xcb_block_len = 0; 9649 9650 return xcb_buffer_len; 9651 } 9652 9653 int 9654 xcb_input_focus_in_sizeof (const void *_buffer /**< */) 9655 { 9656 char *xcb_tmp = (char *)_buffer; 9657 const xcb_input_focus_in_event_t *_aux = (xcb_input_focus_in_event_t *)_buffer; 9658 unsigned int xcb_buffer_len = 0; 9659 unsigned int xcb_block_len = 0; 9660 unsigned int xcb_pad = 0; 9661 unsigned int xcb_align_to = 0; 9662 9663 9664 xcb_block_len += sizeof(xcb_input_focus_in_event_t); 9665 xcb_tmp += xcb_block_len; 9666 xcb_buffer_len += xcb_block_len; 9667 xcb_block_len = 0; 9668 /* buttons */ 9669 xcb_block_len += _aux->buttons_len * sizeof(uint32_t); 9670 xcb_tmp += xcb_block_len; 9671 xcb_align_to = ALIGNOF(uint32_t); 9672 /* insert padding */ 9673 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 9674 xcb_buffer_len += xcb_block_len + xcb_pad; 9675 if (0 != xcb_pad) { 9676 xcb_tmp += xcb_pad; 9677 xcb_pad = 0; 9678 } 9679 xcb_block_len = 0; 9680 9681 return xcb_buffer_len; 9682 } 9683 9684 int 9685 xcb_input_focus_out_sizeof (const void *_buffer /**< */) 9686 { 9687 char *xcb_tmp = (char *)_buffer; 9688 const xcb_input_focus_out_event_t *_aux = (xcb_input_focus_out_event_t *)_buffer; 9689 unsigned int xcb_buffer_len = 0; 9690 unsigned int xcb_block_len = 0; 9691 unsigned int xcb_pad = 0; 9692 unsigned int xcb_align_to = 0; 9693 9694 9695 xcb_block_len += sizeof(xcb_input_focus_out_event_t); 9696 xcb_tmp += xcb_block_len; 9697 xcb_buffer_len += xcb_block_len; 9698 xcb_block_len = 0; 9699 /* buttons */ 9700 xcb_block_len += _aux->buttons_len * sizeof(uint32_t); 9701 xcb_tmp += xcb_block_len; 9702 xcb_align_to = ALIGNOF(uint32_t); 9703 /* insert padding */ 9704 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 9705 xcb_buffer_len += xcb_block_len + xcb_pad; 9706 if (0 != xcb_pad) { 9707 xcb_tmp += xcb_pad; 9708 xcb_pad = 0; 9709 } 9710 xcb_block_len = 0; 9711 9712 return xcb_buffer_len; 9713 } 9714 9715 void 9716 xcb_input_hierarchy_info_next (xcb_input_hierarchy_info_iterator_t *i /**< */) 9717 { 9718 --i->rem; 9719 ++i->data; 9720 i->index += sizeof(xcb_input_hierarchy_info_t); 9721 } 9722 9723 xcb_generic_iterator_t 9724 xcb_input_hierarchy_info_end (xcb_input_hierarchy_info_iterator_t i /**< */) 9725 { 9726 xcb_generic_iterator_t ret; 9727 ret.data = i.data + i.rem; 9728 ret.index = i.index + ((char *) ret.data - (char *) i.data); 9729 ret.rem = 0; 9730 return ret; 9731 } 9732 9733 int 9734 xcb_input_hierarchy_sizeof (const void *_buffer /**< */) 9735 { 9736 char *xcb_tmp = (char *)_buffer; 9737 const xcb_input_hierarchy_event_t *_aux = (xcb_input_hierarchy_event_t *)_buffer; 9738 unsigned int xcb_buffer_len = 0; 9739 unsigned int xcb_block_len = 0; 9740 unsigned int xcb_pad = 0; 9741 unsigned int xcb_align_to = 0; 9742 9743 9744 xcb_block_len += sizeof(xcb_input_hierarchy_event_t); 9745 xcb_tmp += xcb_block_len; 9746 xcb_buffer_len += xcb_block_len; 9747 xcb_block_len = 0; 9748 /* infos */ 9749 xcb_block_len += _aux->num_infos * sizeof(xcb_input_hierarchy_info_t); 9750 xcb_tmp += xcb_block_len; 9751 xcb_align_to = ALIGNOF(xcb_input_hierarchy_info_t); 9752 /* insert padding */ 9753 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 9754 xcb_buffer_len += xcb_block_len + xcb_pad; 9755 if (0 != xcb_pad) { 9756 xcb_tmp += xcb_pad; 9757 xcb_pad = 0; 9758 } 9759 xcb_block_len = 0; 9760 9761 return xcb_buffer_len; 9762 } 9763 9764 int 9765 xcb_input_raw_key_press_sizeof (const void *_buffer /**< */) 9766 { 9767 char *xcb_tmp = (char *)_buffer; 9768 const xcb_input_raw_key_press_event_t *_aux = (xcb_input_raw_key_press_event_t *)_buffer; 9769 unsigned int xcb_buffer_len = 0; 9770 unsigned int xcb_block_len = 0; 9771 unsigned int xcb_pad = 0; 9772 unsigned int xcb_align_to = 0; 9773 9774 9775 xcb_block_len += sizeof(xcb_input_raw_key_press_event_t); 9776 xcb_tmp += xcb_block_len; 9777 xcb_buffer_len += xcb_block_len; 9778 xcb_block_len = 0; 9779 /* valuator_mask */ 9780 xcb_block_len += _aux->valuators_len * sizeof(uint32_t); 9781 xcb_tmp += xcb_block_len; 9782 xcb_align_to = ALIGNOF(uint32_t); 9783 /* insert padding */ 9784 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 9785 xcb_buffer_len += xcb_block_len + xcb_pad; 9786 if (0 != xcb_pad) { 9787 xcb_tmp += xcb_pad; 9788 xcb_pad = 0; 9789 } 9790 xcb_block_len = 0; 9791 9792 return xcb_buffer_len; 9793 } 9794 9795 int 9796 xcb_input_raw_key_release_sizeof (const void *_buffer /**< */) 9797 { 9798 char *xcb_tmp = (char *)_buffer; 9799 const xcb_input_raw_key_release_event_t *_aux = (xcb_input_raw_key_release_event_t *)_buffer; 9800 unsigned int xcb_buffer_len = 0; 9801 unsigned int xcb_block_len = 0; 9802 unsigned int xcb_pad = 0; 9803 unsigned int xcb_align_to = 0; 9804 9805 9806 xcb_block_len += sizeof(xcb_input_raw_key_release_event_t); 9807 xcb_tmp += xcb_block_len; 9808 xcb_buffer_len += xcb_block_len; 9809 xcb_block_len = 0; 9810 /* valuator_mask */ 9811 xcb_block_len += _aux->valuators_len * sizeof(uint32_t); 9812 xcb_tmp += xcb_block_len; 9813 xcb_align_to = ALIGNOF(uint32_t); 9814 /* insert padding */ 9815 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 9816 xcb_buffer_len += xcb_block_len + xcb_pad; 9817 if (0 != xcb_pad) { 9818 xcb_tmp += xcb_pad; 9819 xcb_pad = 0; 9820 } 9821 xcb_block_len = 0; 9822 9823 return xcb_buffer_len; 9824 } 9825 9826 int 9827 xcb_input_raw_button_press_sizeof (const void *_buffer /**< */) 9828 { 9829 char *xcb_tmp = (char *)_buffer; 9830 const xcb_input_raw_button_press_event_t *_aux = (xcb_input_raw_button_press_event_t *)_buffer; 9831 unsigned int xcb_buffer_len = 0; 9832 unsigned int xcb_block_len = 0; 9833 unsigned int xcb_pad = 0; 9834 unsigned int xcb_align_to = 0; 9835 9836 9837 xcb_block_len += sizeof(xcb_input_raw_button_press_event_t); 9838 xcb_tmp += xcb_block_len; 9839 xcb_buffer_len += xcb_block_len; 9840 xcb_block_len = 0; 9841 /* valuator_mask */ 9842 xcb_block_len += _aux->valuators_len * sizeof(uint32_t); 9843 xcb_tmp += xcb_block_len; 9844 xcb_align_to = ALIGNOF(uint32_t); 9845 /* insert padding */ 9846 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 9847 xcb_buffer_len += xcb_block_len + xcb_pad; 9848 if (0 != xcb_pad) { 9849 xcb_tmp += xcb_pad; 9850 xcb_pad = 0; 9851 } 9852 xcb_block_len = 0; 9853 9854 return xcb_buffer_len; 9855 } 9856 9857 int 9858 xcb_input_raw_button_release_sizeof (const void *_buffer /**< */) 9859 { 9860 char *xcb_tmp = (char *)_buffer; 9861 const xcb_input_raw_button_release_event_t *_aux = (xcb_input_raw_button_release_event_t *)_buffer; 9862 unsigned int xcb_buffer_len = 0; 9863 unsigned int xcb_block_len = 0; 9864 unsigned int xcb_pad = 0; 9865 unsigned int xcb_align_to = 0; 9866 9867 9868 xcb_block_len += sizeof(xcb_input_raw_button_release_event_t); 9869 xcb_tmp += xcb_block_len; 9870 xcb_buffer_len += xcb_block_len; 9871 xcb_block_len = 0; 9872 /* valuator_mask */ 9873 xcb_block_len += _aux->valuators_len * sizeof(uint32_t); 9874 xcb_tmp += xcb_block_len; 9875 xcb_align_to = ALIGNOF(uint32_t); 9876 /* insert padding */ 9877 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 9878 xcb_buffer_len += xcb_block_len + xcb_pad; 9879 if (0 != xcb_pad) { 9880 xcb_tmp += xcb_pad; 9881 xcb_pad = 0; 9882 } 9883 xcb_block_len = 0; 9884 9885 return xcb_buffer_len; 9886 } 9887 9888 int 9889 xcb_input_raw_motion_sizeof (const void *_buffer /**< */) 9890 { 9891 char *xcb_tmp = (char *)_buffer; 9892 const xcb_input_raw_motion_event_t *_aux = (xcb_input_raw_motion_event_t *)_buffer; 9893 unsigned int xcb_buffer_len = 0; 9894 unsigned int xcb_block_len = 0; 9895 unsigned int xcb_pad = 0; 9896 unsigned int xcb_align_to = 0; 9897 9898 9899 xcb_block_len += sizeof(xcb_input_raw_motion_event_t); 9900 xcb_tmp += xcb_block_len; 9901 xcb_buffer_len += xcb_block_len; 9902 xcb_block_len = 0; 9903 /* valuator_mask */ 9904 xcb_block_len += _aux->valuators_len * sizeof(uint32_t); 9905 xcb_tmp += xcb_block_len; 9906 xcb_align_to = ALIGNOF(uint32_t); 9907 /* insert padding */ 9908 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 9909 xcb_buffer_len += xcb_block_len + xcb_pad; 9910 if (0 != xcb_pad) { 9911 xcb_tmp += xcb_pad; 9912 xcb_pad = 0; 9913 } 9914 xcb_block_len = 0; 9915 9916 return xcb_buffer_len; 9917 } 9918 9919 int 9920 xcb_input_touch_begin_sizeof (const void *_buffer /**< */) 9921 { 9922 char *xcb_tmp = (char *)_buffer; 9923 const xcb_input_touch_begin_event_t *_aux = (xcb_input_touch_begin_event_t *)_buffer; 9924 unsigned int xcb_buffer_len = 0; 9925 unsigned int xcb_block_len = 0; 9926 unsigned int xcb_pad = 0; 9927 unsigned int xcb_align_to = 0; 9928 9929 9930 xcb_block_len += sizeof(xcb_input_touch_begin_event_t); 9931 xcb_tmp += xcb_block_len; 9932 xcb_buffer_len += xcb_block_len; 9933 xcb_block_len = 0; 9934 /* button_mask */ 9935 xcb_block_len += _aux->buttons_len * sizeof(uint32_t); 9936 xcb_tmp += xcb_block_len; 9937 xcb_align_to = ALIGNOF(uint32_t); 9938 /* insert padding */ 9939 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 9940 xcb_buffer_len += xcb_block_len + xcb_pad; 9941 if (0 != xcb_pad) { 9942 xcb_tmp += xcb_pad; 9943 xcb_pad = 0; 9944 } 9945 xcb_block_len = 0; 9946 /* valuator_mask */ 9947 xcb_block_len += _aux->valuators_len * sizeof(uint32_t); 9948 xcb_tmp += xcb_block_len; 9949 xcb_align_to = ALIGNOF(uint32_t); 9950 /* insert padding */ 9951 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 9952 xcb_buffer_len += xcb_block_len + xcb_pad; 9953 if (0 != xcb_pad) { 9954 xcb_tmp += xcb_pad; 9955 xcb_pad = 0; 9956 } 9957 xcb_block_len = 0; 9958 9959 return xcb_buffer_len; 9960 } 9961 9962 int 9963 xcb_input_touch_update_sizeof (const void *_buffer /**< */) 9964 { 9965 char *xcb_tmp = (char *)_buffer; 9966 const xcb_input_touch_update_event_t *_aux = (xcb_input_touch_update_event_t *)_buffer; 9967 unsigned int xcb_buffer_len = 0; 9968 unsigned int xcb_block_len = 0; 9969 unsigned int xcb_pad = 0; 9970 unsigned int xcb_align_to = 0; 9971 9972 9973 xcb_block_len += sizeof(xcb_input_touch_update_event_t); 9974 xcb_tmp += xcb_block_len; 9975 xcb_buffer_len += xcb_block_len; 9976 xcb_block_len = 0; 9977 /* button_mask */ 9978 xcb_block_len += _aux->buttons_len * sizeof(uint32_t); 9979 xcb_tmp += xcb_block_len; 9980 xcb_align_to = ALIGNOF(uint32_t); 9981 /* insert padding */ 9982 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 9983 xcb_buffer_len += xcb_block_len + xcb_pad; 9984 if (0 != xcb_pad) { 9985 xcb_tmp += xcb_pad; 9986 xcb_pad = 0; 9987 } 9988 xcb_block_len = 0; 9989 /* valuator_mask */ 9990 xcb_block_len += _aux->valuators_len * sizeof(uint32_t); 9991 xcb_tmp += xcb_block_len; 9992 xcb_align_to = ALIGNOF(uint32_t); 9993 /* insert padding */ 9994 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 9995 xcb_buffer_len += xcb_block_len + xcb_pad; 9996 if (0 != xcb_pad) { 9997 xcb_tmp += xcb_pad; 9998 xcb_pad = 0; 9999 } 10000 xcb_block_len = 0; 10001 10002 return xcb_buffer_len; 10003 } 10004 10005 int 10006 xcb_input_touch_end_sizeof (const void *_buffer /**< */) 10007 { 10008 char *xcb_tmp = (char *)_buffer; 10009 const xcb_input_touch_end_event_t *_aux = (xcb_input_touch_end_event_t *)_buffer; 10010 unsigned int xcb_buffer_len = 0; 10011 unsigned int xcb_block_len = 0; 10012 unsigned int xcb_pad = 0; 10013 unsigned int xcb_align_to = 0; 10014 10015 10016 xcb_block_len += sizeof(xcb_input_touch_end_event_t); 10017 xcb_tmp += xcb_block_len; 10018 xcb_buffer_len += xcb_block_len; 10019 xcb_block_len = 0; 10020 /* button_mask */ 10021 xcb_block_len += _aux->buttons_len * sizeof(uint32_t); 10022 xcb_tmp += xcb_block_len; 10023 xcb_align_to = ALIGNOF(uint32_t); 10024 /* insert padding */ 10025 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 10026 xcb_buffer_len += xcb_block_len + xcb_pad; 10027 if (0 != xcb_pad) { 10028 xcb_tmp += xcb_pad; 10029 xcb_pad = 0; 10030 } 10031 xcb_block_len = 0; 10032 /* valuator_mask */ 10033 xcb_block_len += _aux->valuators_len * sizeof(uint32_t); 10034 xcb_tmp += xcb_block_len; 10035 xcb_align_to = ALIGNOF(uint32_t); 10036 /* insert padding */ 10037 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 10038 xcb_buffer_len += xcb_block_len + xcb_pad; 10039 if (0 != xcb_pad) { 10040 xcb_tmp += xcb_pad; 10041 xcb_pad = 0; 10042 } 10043 xcb_block_len = 0; 10044 10045 return xcb_buffer_len; 10046 } 10047 10048 int 10049 xcb_input_raw_touch_begin_sizeof (const void *_buffer /**< */) 10050 { 10051 char *xcb_tmp = (char *)_buffer; 10052 const xcb_input_raw_touch_begin_event_t *_aux = (xcb_input_raw_touch_begin_event_t *)_buffer; 10053 unsigned int xcb_buffer_len = 0; 10054 unsigned int xcb_block_len = 0; 10055 unsigned int xcb_pad = 0; 10056 unsigned int xcb_align_to = 0; 10057 10058 10059 xcb_block_len += sizeof(xcb_input_raw_touch_begin_event_t); 10060 xcb_tmp += xcb_block_len; 10061 xcb_buffer_len += xcb_block_len; 10062 xcb_block_len = 0; 10063 /* valuator_mask */ 10064 xcb_block_len += _aux->valuators_len * sizeof(uint32_t); 10065 xcb_tmp += xcb_block_len; 10066 xcb_align_to = ALIGNOF(uint32_t); 10067 /* insert padding */ 10068 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 10069 xcb_buffer_len += xcb_block_len + xcb_pad; 10070 if (0 != xcb_pad) { 10071 xcb_tmp += xcb_pad; 10072 xcb_pad = 0; 10073 } 10074 xcb_block_len = 0; 10075 10076 return xcb_buffer_len; 10077 } 10078 10079 int 10080 xcb_input_raw_touch_update_sizeof (const void *_buffer /**< */) 10081 { 10082 char *xcb_tmp = (char *)_buffer; 10083 const xcb_input_raw_touch_update_event_t *_aux = (xcb_input_raw_touch_update_event_t *)_buffer; 10084 unsigned int xcb_buffer_len = 0; 10085 unsigned int xcb_block_len = 0; 10086 unsigned int xcb_pad = 0; 10087 unsigned int xcb_align_to = 0; 10088 10089 10090 xcb_block_len += sizeof(xcb_input_raw_touch_update_event_t); 10091 xcb_tmp += xcb_block_len; 10092 xcb_buffer_len += xcb_block_len; 10093 xcb_block_len = 0; 10094 /* valuator_mask */ 10095 xcb_block_len += _aux->valuators_len * sizeof(uint32_t); 10096 xcb_tmp += xcb_block_len; 10097 xcb_align_to = ALIGNOF(uint32_t); 10098 /* insert padding */ 10099 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 10100 xcb_buffer_len += xcb_block_len + xcb_pad; 10101 if (0 != xcb_pad) { 10102 xcb_tmp += xcb_pad; 10103 xcb_pad = 0; 10104 } 10105 xcb_block_len = 0; 10106 10107 return xcb_buffer_len; 10108 } 10109 10110 int 10111 xcb_input_raw_touch_end_sizeof (const void *_buffer /**< */) 10112 { 10113 char *xcb_tmp = (char *)_buffer; 10114 const xcb_input_raw_touch_end_event_t *_aux = (xcb_input_raw_touch_end_event_t *)_buffer; 10115 unsigned int xcb_buffer_len = 0; 10116 unsigned int xcb_block_len = 0; 10117 unsigned int xcb_pad = 0; 10118 unsigned int xcb_align_to = 0; 10119 10120 10121 xcb_block_len += sizeof(xcb_input_raw_touch_end_event_t); 10122 xcb_tmp += xcb_block_len; 10123 xcb_buffer_len += xcb_block_len; 10124 xcb_block_len = 0; 10125 /* valuator_mask */ 10126 xcb_block_len += _aux->valuators_len * sizeof(uint32_t); 10127 xcb_tmp += xcb_block_len; 10128 xcb_align_to = ALIGNOF(uint32_t); 10129 /* insert padding */ 10130 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 10131 xcb_buffer_len += xcb_block_len + xcb_pad; 10132 if (0 != xcb_pad) { 10133 xcb_tmp += xcb_pad; 10134 xcb_pad = 0; 10135 } 10136 xcb_block_len = 0; 10137 10138 return xcb_buffer_len; 10139 } 10140 10141