PageRenderTime 50ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 2ms

/external/mit/xorg/lib/libxcb/files/xinput.c

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