shm.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647
  1. /*
  2. * This file generated automatically from shm.xml by c_client.py.
  3. * Edit at your peril.
  4. */
  5. /**
  6. * @defgroup XCB_Shm_API XCB Shm API
  7. * @brief Shm XCB Protocol Implementation.
  8. * @{
  9. **/
  10. #ifndef __SHM_H
  11. #define __SHM_H
  12. #include "xcb.h"
  13. #include "xproto.h"
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. #define XCB_SHM_MAJOR_VERSION 1
  18. #define XCB_SHM_MINOR_VERSION 2
  19. extern xcb_extension_t xcb_shm_id;
  20. typedef uint32_t xcb_shm_seg_t;
  21. /**
  22. * @brief xcb_shm_seg_iterator_t
  23. **/
  24. typedef struct xcb_shm_seg_iterator_t {
  25. xcb_shm_seg_t *data;
  26. int rem;
  27. int index;
  28. } xcb_shm_seg_iterator_t;
  29. /** Opcode for xcb_shm_completion. */
  30. #define XCB_SHM_COMPLETION 0
  31. /**
  32. * @brief xcb_shm_completion_event_t
  33. **/
  34. typedef struct xcb_shm_completion_event_t {
  35. uint8_t response_type;
  36. uint8_t pad0;
  37. uint16_t sequence;
  38. xcb_drawable_t drawable;
  39. uint16_t minor_event;
  40. uint8_t major_event;
  41. uint8_t pad1;
  42. xcb_shm_seg_t shmseg;
  43. uint32_t offset;
  44. } xcb_shm_completion_event_t;
  45. /** Opcode for xcb_shm_bad_seg. */
  46. #define XCB_SHM_BAD_SEG 0
  47. typedef xcb_value_error_t xcb_shm_bad_seg_error_t;
  48. /**
  49. * @brief xcb_shm_query_version_cookie_t
  50. **/
  51. typedef struct xcb_shm_query_version_cookie_t {
  52. unsigned int sequence;
  53. } xcb_shm_query_version_cookie_t;
  54. /** Opcode for xcb_shm_query_version. */
  55. #define XCB_SHM_QUERY_VERSION 0
  56. /**
  57. * @brief xcb_shm_query_version_request_t
  58. **/
  59. typedef struct xcb_shm_query_version_request_t {
  60. uint8_t major_opcode;
  61. uint8_t minor_opcode;
  62. uint16_t length;
  63. } xcb_shm_query_version_request_t;
  64. /**
  65. * @brief xcb_shm_query_version_reply_t
  66. **/
  67. typedef struct xcb_shm_query_version_reply_t {
  68. uint8_t response_type;
  69. uint8_t shared_pixmaps;
  70. uint16_t sequence;
  71. uint32_t length;
  72. uint16_t major_version;
  73. uint16_t minor_version;
  74. uint16_t uid;
  75. uint16_t gid;
  76. uint8_t pixmap_format;
  77. uint8_t pad0[15];
  78. } xcb_shm_query_version_reply_t;
  79. /** Opcode for xcb_shm_attach. */
  80. #define XCB_SHM_ATTACH 1
  81. /**
  82. * @brief xcb_shm_attach_request_t
  83. **/
  84. typedef struct xcb_shm_attach_request_t {
  85. uint8_t major_opcode;
  86. uint8_t minor_opcode;
  87. uint16_t length;
  88. xcb_shm_seg_t shmseg;
  89. uint32_t shmid;
  90. uint8_t read_only;
  91. uint8_t pad0[3];
  92. } xcb_shm_attach_request_t;
  93. /** Opcode for xcb_shm_detach. */
  94. #define XCB_SHM_DETACH 2
  95. /**
  96. * @brief xcb_shm_detach_request_t
  97. **/
  98. typedef struct xcb_shm_detach_request_t {
  99. uint8_t major_opcode;
  100. uint8_t minor_opcode;
  101. uint16_t length;
  102. xcb_shm_seg_t shmseg;
  103. } xcb_shm_detach_request_t;
  104. /** Opcode for xcb_shm_put_image. */
  105. #define XCB_SHM_PUT_IMAGE 3
  106. /**
  107. * @brief xcb_shm_put_image_request_t
  108. **/
  109. typedef struct xcb_shm_put_image_request_t {
  110. uint8_t major_opcode;
  111. uint8_t minor_opcode;
  112. uint16_t length;
  113. xcb_drawable_t drawable;
  114. xcb_gcontext_t gc;
  115. uint16_t total_width;
  116. uint16_t total_height;
  117. uint16_t src_x;
  118. uint16_t src_y;
  119. uint16_t src_width;
  120. uint16_t src_height;
  121. int16_t dst_x;
  122. int16_t dst_y;
  123. uint8_t depth;
  124. uint8_t format;
  125. uint8_t send_event;
  126. uint8_t pad0;
  127. xcb_shm_seg_t shmseg;
  128. uint32_t offset;
  129. } xcb_shm_put_image_request_t;
  130. /**
  131. * @brief xcb_shm_get_image_cookie_t
  132. **/
  133. typedef struct xcb_shm_get_image_cookie_t {
  134. unsigned int sequence;
  135. } xcb_shm_get_image_cookie_t;
  136. /** Opcode for xcb_shm_get_image. */
  137. #define XCB_SHM_GET_IMAGE 4
  138. /**
  139. * @brief xcb_shm_get_image_request_t
  140. **/
  141. typedef struct xcb_shm_get_image_request_t {
  142. uint8_t major_opcode;
  143. uint8_t minor_opcode;
  144. uint16_t length;
  145. xcb_drawable_t drawable;
  146. int16_t x;
  147. int16_t y;
  148. uint16_t width;
  149. uint16_t height;
  150. uint32_t plane_mask;
  151. uint8_t format;
  152. uint8_t pad0[3];
  153. xcb_shm_seg_t shmseg;
  154. uint32_t offset;
  155. } xcb_shm_get_image_request_t;
  156. /**
  157. * @brief xcb_shm_get_image_reply_t
  158. **/
  159. typedef struct xcb_shm_get_image_reply_t {
  160. uint8_t response_type;
  161. uint8_t depth;
  162. uint16_t sequence;
  163. uint32_t length;
  164. xcb_visualid_t visual;
  165. uint32_t size;
  166. } xcb_shm_get_image_reply_t;
  167. /** Opcode for xcb_shm_create_pixmap. */
  168. #define XCB_SHM_CREATE_PIXMAP 5
  169. /**
  170. * @brief xcb_shm_create_pixmap_request_t
  171. **/
  172. typedef struct xcb_shm_create_pixmap_request_t {
  173. uint8_t major_opcode;
  174. uint8_t minor_opcode;
  175. uint16_t length;
  176. xcb_pixmap_t pid;
  177. xcb_drawable_t drawable;
  178. uint16_t width;
  179. uint16_t height;
  180. uint8_t depth;
  181. uint8_t pad0[3];
  182. xcb_shm_seg_t shmseg;
  183. uint32_t offset;
  184. } xcb_shm_create_pixmap_request_t;
  185. /** Opcode for xcb_shm_attach_fd. */
  186. #define XCB_SHM_ATTACH_FD 6
  187. /**
  188. * @brief xcb_shm_attach_fd_request_t
  189. **/
  190. typedef struct xcb_shm_attach_fd_request_t {
  191. uint8_t major_opcode;
  192. uint8_t minor_opcode;
  193. uint16_t length;
  194. xcb_shm_seg_t shmseg;
  195. uint8_t read_only;
  196. uint8_t pad0[3];
  197. } xcb_shm_attach_fd_request_t;
  198. /**
  199. * @brief xcb_shm_create_segment_cookie_t
  200. **/
  201. typedef struct xcb_shm_create_segment_cookie_t {
  202. unsigned int sequence;
  203. } xcb_shm_create_segment_cookie_t;
  204. /** Opcode for xcb_shm_create_segment. */
  205. #define XCB_SHM_CREATE_SEGMENT 7
  206. /**
  207. * @brief xcb_shm_create_segment_request_t
  208. **/
  209. typedef struct xcb_shm_create_segment_request_t {
  210. uint8_t major_opcode;
  211. uint8_t minor_opcode;
  212. uint16_t length;
  213. xcb_shm_seg_t shmseg;
  214. uint32_t size;
  215. uint8_t read_only;
  216. uint8_t pad0[3];
  217. } xcb_shm_create_segment_request_t;
  218. /**
  219. * @brief xcb_shm_create_segment_reply_t
  220. **/
  221. typedef struct xcb_shm_create_segment_reply_t {
  222. uint8_t response_type;
  223. uint8_t nfd;
  224. uint16_t sequence;
  225. uint32_t length;
  226. uint8_t pad0[24];
  227. } xcb_shm_create_segment_reply_t;
  228. /**
  229. * Get the next element of the iterator
  230. * @param i Pointer to a xcb_shm_seg_iterator_t
  231. *
  232. * Get the next element in the iterator. The member rem is
  233. * decreased by one. The member data points to the next
  234. * element. The member index is increased by sizeof(xcb_shm_seg_t)
  235. */
  236. void
  237. xcb_shm_seg_next (xcb_shm_seg_iterator_t *i);
  238. /**
  239. * Return the iterator pointing to the last element
  240. * @param i An xcb_shm_seg_iterator_t
  241. * @return The iterator pointing to the last element
  242. *
  243. * Set the current element in the iterator to the last element.
  244. * The member rem is set to 0. The member data points to the
  245. * last element.
  246. */
  247. xcb_generic_iterator_t
  248. xcb_shm_seg_end (xcb_shm_seg_iterator_t i);
  249. /**
  250. *
  251. * @param c The connection
  252. * @return A cookie
  253. *
  254. * Delivers a request to the X server.
  255. *
  256. */
  257. xcb_shm_query_version_cookie_t
  258. xcb_shm_query_version (xcb_connection_t *c);
  259. /**
  260. *
  261. * @param c The connection
  262. * @return A cookie
  263. *
  264. * Delivers a request to the X server.
  265. *
  266. * This form can be used only if the request will cause
  267. * a reply to be generated. Any returned error will be
  268. * placed in the event queue.
  269. */
  270. xcb_shm_query_version_cookie_t
  271. xcb_shm_query_version_unchecked (xcb_connection_t *c);
  272. /**
  273. * Return the reply
  274. * @param c The connection
  275. * @param cookie The cookie
  276. * @param e The xcb_generic_error_t supplied
  277. *
  278. * Returns the reply of the request asked by
  279. *
  280. * The parameter @p e supplied to this function must be NULL if
  281. * xcb_shm_query_version_unchecked(). is used.
  282. * Otherwise, it stores the error if any.
  283. *
  284. * The returned value must be freed by the caller using free().
  285. */
  286. xcb_shm_query_version_reply_t *
  287. xcb_shm_query_version_reply (xcb_connection_t *c,
  288. xcb_shm_query_version_cookie_t cookie /**< */,
  289. xcb_generic_error_t **e);
  290. /**
  291. *
  292. * @param c The connection
  293. * @return A cookie
  294. *
  295. * Delivers a request to the X server.
  296. *
  297. * This form can be used only if the request will not cause
  298. * a reply to be generated. Any returned error will be
  299. * saved for handling by xcb_request_check().
  300. */
  301. xcb_void_cookie_t
  302. xcb_shm_attach_checked (xcb_connection_t *c,
  303. xcb_shm_seg_t shmseg,
  304. uint32_t shmid,
  305. uint8_t read_only);
  306. /**
  307. *
  308. * @param c The connection
  309. * @return A cookie
  310. *
  311. * Delivers a request to the X server.
  312. *
  313. */
  314. xcb_void_cookie_t
  315. xcb_shm_attach (xcb_connection_t *c,
  316. xcb_shm_seg_t shmseg,
  317. uint32_t shmid,
  318. uint8_t read_only);
  319. /**
  320. *
  321. * @param c The connection
  322. * @return A cookie
  323. *
  324. * Delivers a request to the X server.
  325. *
  326. * This form can be used only if the request will not cause
  327. * a reply to be generated. Any returned error will be
  328. * saved for handling by xcb_request_check().
  329. */
  330. xcb_void_cookie_t
  331. xcb_shm_detach_checked (xcb_connection_t *c,
  332. xcb_shm_seg_t shmseg);
  333. /**
  334. *
  335. * @param c The connection
  336. * @return A cookie
  337. *
  338. * Delivers a request to the X server.
  339. *
  340. */
  341. xcb_void_cookie_t
  342. xcb_shm_detach (xcb_connection_t *c,
  343. xcb_shm_seg_t shmseg);
  344. /**
  345. *
  346. * @param c The connection
  347. * @return A cookie
  348. *
  349. * Delivers a request to the X server.
  350. *
  351. * This form can be used only if the request will not cause
  352. * a reply to be generated. Any returned error will be
  353. * saved for handling by xcb_request_check().
  354. */
  355. xcb_void_cookie_t
  356. xcb_shm_put_image_checked (xcb_connection_t *c,
  357. xcb_drawable_t drawable,
  358. xcb_gcontext_t gc,
  359. uint16_t total_width,
  360. uint16_t total_height,
  361. uint16_t src_x,
  362. uint16_t src_y,
  363. uint16_t src_width,
  364. uint16_t src_height,
  365. int16_t dst_x,
  366. int16_t dst_y,
  367. uint8_t depth,
  368. uint8_t format,
  369. uint8_t send_event,
  370. xcb_shm_seg_t shmseg,
  371. uint32_t offset);
  372. /**
  373. *
  374. * @param c The connection
  375. * @return A cookie
  376. *
  377. * Delivers a request to the X server.
  378. *
  379. */
  380. xcb_void_cookie_t
  381. xcb_shm_put_image (xcb_connection_t *c,
  382. xcb_drawable_t drawable,
  383. xcb_gcontext_t gc,
  384. uint16_t total_width,
  385. uint16_t total_height,
  386. uint16_t src_x,
  387. uint16_t src_y,
  388. uint16_t src_width,
  389. uint16_t src_height,
  390. int16_t dst_x,
  391. int16_t dst_y,
  392. uint8_t depth,
  393. uint8_t format,
  394. uint8_t send_event,
  395. xcb_shm_seg_t shmseg,
  396. uint32_t offset);
  397. /**
  398. *
  399. * @param c The connection
  400. * @return A cookie
  401. *
  402. * Delivers a request to the X server.
  403. *
  404. */
  405. xcb_shm_get_image_cookie_t
  406. xcb_shm_get_image (xcb_connection_t *c,
  407. xcb_drawable_t drawable,
  408. int16_t x,
  409. int16_t y,
  410. uint16_t width,
  411. uint16_t height,
  412. uint32_t plane_mask,
  413. uint8_t format,
  414. xcb_shm_seg_t shmseg,
  415. uint32_t offset);
  416. /**
  417. *
  418. * @param c The connection
  419. * @return A cookie
  420. *
  421. * Delivers a request to the X server.
  422. *
  423. * This form can be used only if the request will cause
  424. * a reply to be generated. Any returned error will be
  425. * placed in the event queue.
  426. */
  427. xcb_shm_get_image_cookie_t
  428. xcb_shm_get_image_unchecked (xcb_connection_t *c,
  429. xcb_drawable_t drawable,
  430. int16_t x,
  431. int16_t y,
  432. uint16_t width,
  433. uint16_t height,
  434. uint32_t plane_mask,
  435. uint8_t format,
  436. xcb_shm_seg_t shmseg,
  437. uint32_t offset);
  438. /**
  439. * Return the reply
  440. * @param c The connection
  441. * @param cookie The cookie
  442. * @param e The xcb_generic_error_t supplied
  443. *
  444. * Returns the reply of the request asked by
  445. *
  446. * The parameter @p e supplied to this function must be NULL if
  447. * xcb_shm_get_image_unchecked(). is used.
  448. * Otherwise, it stores the error if any.
  449. *
  450. * The returned value must be freed by the caller using free().
  451. */
  452. xcb_shm_get_image_reply_t *
  453. xcb_shm_get_image_reply (xcb_connection_t *c,
  454. xcb_shm_get_image_cookie_t cookie /**< */,
  455. xcb_generic_error_t **e);
  456. /**
  457. *
  458. * @param c The connection
  459. * @return A cookie
  460. *
  461. * Delivers a request to the X server.
  462. *
  463. * This form can be used only if the request will not cause
  464. * a reply to be generated. Any returned error will be
  465. * saved for handling by xcb_request_check().
  466. */
  467. xcb_void_cookie_t
  468. xcb_shm_create_pixmap_checked (xcb_connection_t *c,
  469. xcb_pixmap_t pid,
  470. xcb_drawable_t drawable,
  471. uint16_t width,
  472. uint16_t height,
  473. uint8_t depth,
  474. xcb_shm_seg_t shmseg,
  475. uint32_t offset);
  476. /**
  477. *
  478. * @param c The connection
  479. * @return A cookie
  480. *
  481. * Delivers a request to the X server.
  482. *
  483. */
  484. xcb_void_cookie_t
  485. xcb_shm_create_pixmap (xcb_connection_t *c,
  486. xcb_pixmap_t pid,
  487. xcb_drawable_t drawable,
  488. uint16_t width,
  489. uint16_t height,
  490. uint8_t depth,
  491. xcb_shm_seg_t shmseg,
  492. uint32_t offset);
  493. /**
  494. *
  495. * @param c The connection
  496. * @return A cookie
  497. *
  498. * Delivers a request to the X server.
  499. *
  500. * This form can be used only if the request will not cause
  501. * a reply to be generated. Any returned error will be
  502. * saved for handling by xcb_request_check().
  503. */
  504. xcb_void_cookie_t
  505. xcb_shm_attach_fd_checked (xcb_connection_t *c,
  506. xcb_shm_seg_t shmseg,
  507. int32_t shm_fd,
  508. uint8_t read_only);
  509. /**
  510. *
  511. * @param c The connection
  512. * @return A cookie
  513. *
  514. * Delivers a request to the X server.
  515. *
  516. */
  517. xcb_void_cookie_t
  518. xcb_shm_attach_fd (xcb_connection_t *c,
  519. xcb_shm_seg_t shmseg,
  520. int32_t shm_fd,
  521. uint8_t read_only);
  522. /**
  523. *
  524. * @param c The connection
  525. * @return A cookie
  526. *
  527. * Delivers a request to the X server.
  528. *
  529. */
  530. xcb_shm_create_segment_cookie_t
  531. xcb_shm_create_segment (xcb_connection_t *c,
  532. xcb_shm_seg_t shmseg,
  533. uint32_t size,
  534. uint8_t read_only);
  535. /**
  536. *
  537. * @param c The connection
  538. * @return A cookie
  539. *
  540. * Delivers a request to the X server.
  541. *
  542. * This form can be used only if the request will cause
  543. * a reply to be generated. Any returned error will be
  544. * placed in the event queue.
  545. */
  546. xcb_shm_create_segment_cookie_t
  547. xcb_shm_create_segment_unchecked (xcb_connection_t *c,
  548. xcb_shm_seg_t shmseg,
  549. uint32_t size,
  550. uint8_t read_only);
  551. /**
  552. * Return the reply
  553. * @param c The connection
  554. * @param cookie The cookie
  555. * @param e The xcb_generic_error_t supplied
  556. *
  557. * Returns the reply of the request asked by
  558. *
  559. * The parameter @p e supplied to this function must be NULL if
  560. * xcb_shm_create_segment_unchecked(). is used.
  561. * Otherwise, it stores the error if any.
  562. *
  563. * The returned value must be freed by the caller using free().
  564. */
  565. xcb_shm_create_segment_reply_t *
  566. xcb_shm_create_segment_reply (xcb_connection_t *c,
  567. xcb_shm_create_segment_cookie_t cookie /**< */,
  568. xcb_generic_error_t **e);
  569. /**
  570. * Return the reply fds
  571. * @param c The connection
  572. * @param reply The reply
  573. *
  574. * Returns the array of reply fds of the request asked by
  575. *
  576. * The returned value must be freed by the caller using free().
  577. */
  578. int *
  579. xcb_shm_create_segment_reply_fds (xcb_connection_t *c /**< */,
  580. xcb_shm_create_segment_reply_t *reply);
  581. #ifdef __cplusplus
  582. }
  583. #endif
  584. #endif
  585. /**
  586. * @}
  587. */