PageRenderTime 81ms CodeModel.GetById 33ms RepoModel.GetById 0ms app.codeStats 3ms

/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

Large files files are truncated, but you can click here to view the full file

  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.gr

Large files files are truncated, but you can click here to view the full file