present.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644
  1. /*
  2. * This file generated automatically from present.xml by c_client.py.
  3. * Edit at your peril.
  4. */
  5. /**
  6. * @defgroup XCB_Present_API XCB Present API
  7. * @brief Present XCB Protocol Implementation.
  8. * @{
  9. **/
  10. #ifndef __PRESENT_H
  11. #define __PRESENT_H
  12. #include "xcb.h"
  13. #include "xproto.h"
  14. #include "randr.h"
  15. #include "xfixes.h"
  16. #include "sync.h"
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. #define XCB_PRESENT_MAJOR_VERSION 1
  21. #define XCB_PRESENT_MINOR_VERSION 2
  22. extern xcb_extension_t xcb_present_id;
  23. typedef enum xcb_present_event_enum_t {
  24. XCB_PRESENT_EVENT_CONFIGURE_NOTIFY = 0,
  25. XCB_PRESENT_EVENT_COMPLETE_NOTIFY = 1,
  26. XCB_PRESENT_EVENT_IDLE_NOTIFY = 2,
  27. XCB_PRESENT_EVENT_REDIRECT_NOTIFY = 3
  28. } xcb_present_event_enum_t;
  29. typedef enum xcb_present_event_mask_t {
  30. XCB_PRESENT_EVENT_MASK_NO_EVENT = 0,
  31. XCB_PRESENT_EVENT_MASK_CONFIGURE_NOTIFY = 1,
  32. XCB_PRESENT_EVENT_MASK_COMPLETE_NOTIFY = 2,
  33. XCB_PRESENT_EVENT_MASK_IDLE_NOTIFY = 4,
  34. XCB_PRESENT_EVENT_MASK_REDIRECT_NOTIFY = 8
  35. } xcb_present_event_mask_t;
  36. typedef enum xcb_present_option_t {
  37. XCB_PRESENT_OPTION_NONE = 0,
  38. XCB_PRESENT_OPTION_ASYNC = 1,
  39. XCB_PRESENT_OPTION_COPY = 2,
  40. XCB_PRESENT_OPTION_UST = 4,
  41. XCB_PRESENT_OPTION_SUBOPTIMAL = 8
  42. } xcb_present_option_t;
  43. typedef enum xcb_present_capability_t {
  44. XCB_PRESENT_CAPABILITY_NONE = 0,
  45. XCB_PRESENT_CAPABILITY_ASYNC = 1,
  46. XCB_PRESENT_CAPABILITY_FENCE = 2,
  47. XCB_PRESENT_CAPABILITY_UST = 4
  48. } xcb_present_capability_t;
  49. typedef enum xcb_present_complete_kind_t {
  50. XCB_PRESENT_COMPLETE_KIND_PIXMAP = 0,
  51. XCB_PRESENT_COMPLETE_KIND_NOTIFY_MSC = 1
  52. } xcb_present_complete_kind_t;
  53. typedef enum xcb_present_complete_mode_t {
  54. XCB_PRESENT_COMPLETE_MODE_COPY = 0,
  55. XCB_PRESENT_COMPLETE_MODE_FLIP = 1,
  56. XCB_PRESENT_COMPLETE_MODE_SKIP = 2,
  57. XCB_PRESENT_COMPLETE_MODE_SUBOPTIMAL_COPY = 3
  58. } xcb_present_complete_mode_t;
  59. /**
  60. * @brief xcb_present_notify_t
  61. **/
  62. typedef struct xcb_present_notify_t {
  63. xcb_window_t window;
  64. uint32_t serial;
  65. } xcb_present_notify_t;
  66. /**
  67. * @brief xcb_present_notify_iterator_t
  68. **/
  69. typedef struct xcb_present_notify_iterator_t {
  70. xcb_present_notify_t *data;
  71. int rem;
  72. int index;
  73. } xcb_present_notify_iterator_t;
  74. /**
  75. * @brief xcb_present_query_version_cookie_t
  76. **/
  77. typedef struct xcb_present_query_version_cookie_t {
  78. unsigned int sequence;
  79. } xcb_present_query_version_cookie_t;
  80. /** Opcode for xcb_present_query_version. */
  81. #define XCB_PRESENT_QUERY_VERSION 0
  82. /**
  83. * @brief xcb_present_query_version_request_t
  84. **/
  85. typedef struct xcb_present_query_version_request_t {
  86. uint8_t major_opcode;
  87. uint8_t minor_opcode;
  88. uint16_t length;
  89. uint32_t major_version;
  90. uint32_t minor_version;
  91. } xcb_present_query_version_request_t;
  92. /**
  93. * @brief xcb_present_query_version_reply_t
  94. **/
  95. typedef struct xcb_present_query_version_reply_t {
  96. uint8_t response_type;
  97. uint8_t pad0;
  98. uint16_t sequence;
  99. uint32_t length;
  100. uint32_t major_version;
  101. uint32_t minor_version;
  102. } xcb_present_query_version_reply_t;
  103. /** Opcode for xcb_present_pixmap. */
  104. #define XCB_PRESENT_PIXMAP 1
  105. /**
  106. * @brief xcb_present_pixmap_request_t
  107. **/
  108. typedef struct xcb_present_pixmap_request_t {
  109. uint8_t major_opcode;
  110. uint8_t minor_opcode;
  111. uint16_t length;
  112. xcb_window_t window;
  113. xcb_pixmap_t pixmap;
  114. uint32_t serial;
  115. xcb_xfixes_region_t valid;
  116. xcb_xfixes_region_t update;
  117. int16_t x_off;
  118. int16_t y_off;
  119. xcb_randr_crtc_t target_crtc;
  120. xcb_sync_fence_t wait_fence;
  121. xcb_sync_fence_t idle_fence;
  122. uint32_t options;
  123. uint8_t pad0[4];
  124. uint64_t target_msc;
  125. uint64_t divisor;
  126. uint64_t remainder;
  127. } xcb_present_pixmap_request_t;
  128. /** Opcode for xcb_present_notify_msc. */
  129. #define XCB_PRESENT_NOTIFY_MSC 2
  130. /**
  131. * @brief xcb_present_notify_msc_request_t
  132. **/
  133. typedef struct xcb_present_notify_msc_request_t {
  134. uint8_t major_opcode;
  135. uint8_t minor_opcode;
  136. uint16_t length;
  137. xcb_window_t window;
  138. uint32_t serial;
  139. uint8_t pad0[4];
  140. uint64_t target_msc;
  141. uint64_t divisor;
  142. uint64_t remainder;
  143. } xcb_present_notify_msc_request_t;
  144. typedef uint32_t xcb_present_event_t;
  145. /**
  146. * @brief xcb_present_event_iterator_t
  147. **/
  148. typedef struct xcb_present_event_iterator_t {
  149. xcb_present_event_t *data;
  150. int rem;
  151. int index;
  152. } xcb_present_event_iterator_t;
  153. /** Opcode for xcb_present_select_input. */
  154. #define XCB_PRESENT_SELECT_INPUT 3
  155. /**
  156. * @brief xcb_present_select_input_request_t
  157. **/
  158. typedef struct xcb_present_select_input_request_t {
  159. uint8_t major_opcode;
  160. uint8_t minor_opcode;
  161. uint16_t length;
  162. xcb_present_event_t eid;
  163. xcb_window_t window;
  164. uint32_t event_mask;
  165. } xcb_present_select_input_request_t;
  166. /**
  167. * @brief xcb_present_query_capabilities_cookie_t
  168. **/
  169. typedef struct xcb_present_query_capabilities_cookie_t {
  170. unsigned int sequence;
  171. } xcb_present_query_capabilities_cookie_t;
  172. /** Opcode for xcb_present_query_capabilities. */
  173. #define XCB_PRESENT_QUERY_CAPABILITIES 4
  174. /**
  175. * @brief xcb_present_query_capabilities_request_t
  176. **/
  177. typedef struct xcb_present_query_capabilities_request_t {
  178. uint8_t major_opcode;
  179. uint8_t minor_opcode;
  180. uint16_t length;
  181. uint32_t target;
  182. } xcb_present_query_capabilities_request_t;
  183. /**
  184. * @brief xcb_present_query_capabilities_reply_t
  185. **/
  186. typedef struct xcb_present_query_capabilities_reply_t {
  187. uint8_t response_type;
  188. uint8_t pad0;
  189. uint16_t sequence;
  190. uint32_t length;
  191. uint32_t capabilities;
  192. } xcb_present_query_capabilities_reply_t;
  193. /** Opcode for xcb_present_generic. */
  194. #define XCB_PRESENT_GENERIC 0
  195. /**
  196. * @brief xcb_present_generic_event_t
  197. **/
  198. typedef struct xcb_present_generic_event_t {
  199. uint8_t response_type;
  200. uint8_t extension;
  201. uint16_t sequence;
  202. uint32_t length;
  203. uint16_t evtype;
  204. uint8_t pad0[2];
  205. xcb_present_event_t event;
  206. } xcb_present_generic_event_t;
  207. /** Opcode for xcb_present_configure_notify. */
  208. #define XCB_PRESENT_CONFIGURE_NOTIFY 0
  209. /**
  210. * @brief xcb_present_configure_notify_event_t
  211. **/
  212. typedef struct xcb_present_configure_notify_event_t {
  213. uint8_t response_type;
  214. uint8_t extension;
  215. uint16_t sequence;
  216. uint32_t length;
  217. uint16_t event_type;
  218. uint8_t pad0[2];
  219. xcb_present_event_t event;
  220. xcb_window_t window;
  221. int16_t x;
  222. int16_t y;
  223. uint16_t width;
  224. uint16_t height;
  225. int16_t off_x;
  226. int16_t off_y;
  227. uint32_t full_sequence;
  228. uint16_t pixmap_width;
  229. uint16_t pixmap_height;
  230. uint32_t pixmap_flags;
  231. } xcb_present_configure_notify_event_t;
  232. /** Opcode for xcb_present_complete_notify. */
  233. #define XCB_PRESENT_COMPLETE_NOTIFY 1
  234. /**
  235. * @brief xcb_present_complete_notify_event_t
  236. **/
  237. typedef struct xcb_present_complete_notify_event_t {
  238. uint8_t response_type;
  239. uint8_t extension;
  240. uint16_t sequence;
  241. uint32_t length;
  242. uint16_t event_type;
  243. uint8_t kind;
  244. uint8_t mode;
  245. xcb_present_event_t event;
  246. xcb_window_t window;
  247. uint32_t serial;
  248. uint64_t ust;
  249. uint32_t full_sequence;
  250. uint64_t msc;
  251. } XCB_PACKED xcb_present_complete_notify_event_t;
  252. /** Opcode for xcb_present_idle_notify. */
  253. #define XCB_PRESENT_IDLE_NOTIFY 2
  254. /**
  255. * @brief xcb_present_idle_notify_event_t
  256. **/
  257. typedef struct xcb_present_idle_notify_event_t {
  258. uint8_t response_type;
  259. uint8_t extension;
  260. uint16_t sequence;
  261. uint32_t length;
  262. uint16_t event_type;
  263. uint8_t pad0[2];
  264. xcb_present_event_t event;
  265. xcb_window_t window;
  266. uint32_t serial;
  267. xcb_pixmap_t pixmap;
  268. xcb_sync_fence_t idle_fence;
  269. uint32_t full_sequence;
  270. } xcb_present_idle_notify_event_t;
  271. /** Opcode for xcb_present_redirect_notify. */
  272. #define XCB_PRESENT_REDIRECT_NOTIFY 3
  273. /**
  274. * @brief xcb_present_redirect_notify_event_t
  275. **/
  276. typedef struct xcb_present_redirect_notify_event_t {
  277. uint8_t response_type;
  278. uint8_t extension;
  279. uint16_t sequence;
  280. uint32_t length;
  281. uint16_t event_type;
  282. uint8_t update_window;
  283. uint8_t pad0;
  284. xcb_present_event_t event;
  285. xcb_window_t event_window;
  286. xcb_window_t window;
  287. xcb_pixmap_t pixmap;
  288. uint32_t serial;
  289. uint32_t full_sequence;
  290. xcb_xfixes_region_t valid_region;
  291. xcb_xfixes_region_t update_region;
  292. xcb_rectangle_t valid_rect;
  293. xcb_rectangle_t update_rect;
  294. int16_t x_off;
  295. int16_t y_off;
  296. xcb_randr_crtc_t target_crtc;
  297. xcb_sync_fence_t wait_fence;
  298. xcb_sync_fence_t idle_fence;
  299. uint32_t options;
  300. uint8_t pad1[4];
  301. uint64_t target_msc;
  302. uint64_t divisor;
  303. uint64_t remainder;
  304. } XCB_PACKED xcb_present_redirect_notify_event_t;
  305. /**
  306. * Get the next element of the iterator
  307. * @param i Pointer to a xcb_present_notify_iterator_t
  308. *
  309. * Get the next element in the iterator. The member rem is
  310. * decreased by one. The member data points to the next
  311. * element. The member index is increased by sizeof(xcb_present_notify_t)
  312. */
  313. void
  314. xcb_present_notify_next (xcb_present_notify_iterator_t *i);
  315. /**
  316. * Return the iterator pointing to the last element
  317. * @param i An xcb_present_notify_iterator_t
  318. * @return The iterator pointing to the last element
  319. *
  320. * Set the current element in the iterator to the last element.
  321. * The member rem is set to 0. The member data points to the
  322. * last element.
  323. */
  324. xcb_generic_iterator_t
  325. xcb_present_notify_end (xcb_present_notify_iterator_t i);
  326. /**
  327. *
  328. * @param c The connection
  329. * @return A cookie
  330. *
  331. * Delivers a request to the X server.
  332. *
  333. */
  334. xcb_present_query_version_cookie_t
  335. xcb_present_query_version (xcb_connection_t *c,
  336. uint32_t major_version,
  337. uint32_t minor_version);
  338. /**
  339. *
  340. * @param c The connection
  341. * @return A cookie
  342. *
  343. * Delivers a request to the X server.
  344. *
  345. * This form can be used only if the request will cause
  346. * a reply to be generated. Any returned error will be
  347. * placed in the event queue.
  348. */
  349. xcb_present_query_version_cookie_t
  350. xcb_present_query_version_unchecked (xcb_connection_t *c,
  351. uint32_t major_version,
  352. uint32_t minor_version);
  353. /**
  354. * Return the reply
  355. * @param c The connection
  356. * @param cookie The cookie
  357. * @param e The xcb_generic_error_t supplied
  358. *
  359. * Returns the reply of the request asked by
  360. *
  361. * The parameter @p e supplied to this function must be NULL if
  362. * xcb_present_query_version_unchecked(). is used.
  363. * Otherwise, it stores the error if any.
  364. *
  365. * The returned value must be freed by the caller using free().
  366. */
  367. xcb_present_query_version_reply_t *
  368. xcb_present_query_version_reply (xcb_connection_t *c,
  369. xcb_present_query_version_cookie_t cookie /**< */,
  370. xcb_generic_error_t **e);
  371. int
  372. xcb_present_pixmap_sizeof (const void *_buffer,
  373. uint32_t notifies_len);
  374. /**
  375. *
  376. * @param c The connection
  377. * @return A cookie
  378. *
  379. * Delivers a request to the X server.
  380. *
  381. * This form can be used only if the request will not cause
  382. * a reply to be generated. Any returned error will be
  383. * saved for handling by xcb_request_check().
  384. */
  385. xcb_void_cookie_t
  386. xcb_present_pixmap_checked (xcb_connection_t *c,
  387. xcb_window_t window,
  388. xcb_pixmap_t pixmap,
  389. uint32_t serial,
  390. xcb_xfixes_region_t valid,
  391. xcb_xfixes_region_t update,
  392. int16_t x_off,
  393. int16_t y_off,
  394. xcb_randr_crtc_t target_crtc,
  395. xcb_sync_fence_t wait_fence,
  396. xcb_sync_fence_t idle_fence,
  397. uint32_t options,
  398. uint64_t target_msc,
  399. uint64_t divisor,
  400. uint64_t remainder,
  401. uint32_t notifies_len,
  402. const xcb_present_notify_t *notifies);
  403. /**
  404. *
  405. * @param c The connection
  406. * @return A cookie
  407. *
  408. * Delivers a request to the X server.
  409. *
  410. */
  411. xcb_void_cookie_t
  412. xcb_present_pixmap (xcb_connection_t *c,
  413. xcb_window_t window,
  414. xcb_pixmap_t pixmap,
  415. uint32_t serial,
  416. xcb_xfixes_region_t valid,
  417. xcb_xfixes_region_t update,
  418. int16_t x_off,
  419. int16_t y_off,
  420. xcb_randr_crtc_t target_crtc,
  421. xcb_sync_fence_t wait_fence,
  422. xcb_sync_fence_t idle_fence,
  423. uint32_t options,
  424. uint64_t target_msc,
  425. uint64_t divisor,
  426. uint64_t remainder,
  427. uint32_t notifies_len,
  428. const xcb_present_notify_t *notifies);
  429. xcb_present_notify_t *
  430. xcb_present_pixmap_notifies (const xcb_present_pixmap_request_t *R);
  431. int
  432. xcb_present_pixmap_notifies_length (const xcb_present_pixmap_request_t *R);
  433. xcb_present_notify_iterator_t
  434. xcb_present_pixmap_notifies_iterator (const xcb_present_pixmap_request_t *R);
  435. /**
  436. *
  437. * @param c The connection
  438. * @return A cookie
  439. *
  440. * Delivers a request to the X server.
  441. *
  442. * This form can be used only if the request will not cause
  443. * a reply to be generated. Any returned error will be
  444. * saved for handling by xcb_request_check().
  445. */
  446. xcb_void_cookie_t
  447. xcb_present_notify_msc_checked (xcb_connection_t *c,
  448. xcb_window_t window,
  449. uint32_t serial,
  450. uint64_t target_msc,
  451. uint64_t divisor,
  452. uint64_t remainder);
  453. /**
  454. *
  455. * @param c The connection
  456. * @return A cookie
  457. *
  458. * Delivers a request to the X server.
  459. *
  460. */
  461. xcb_void_cookie_t
  462. xcb_present_notify_msc (xcb_connection_t *c,
  463. xcb_window_t window,
  464. uint32_t serial,
  465. uint64_t target_msc,
  466. uint64_t divisor,
  467. uint64_t remainder);
  468. /**
  469. * Get the next element of the iterator
  470. * @param i Pointer to a xcb_present_event_iterator_t
  471. *
  472. * Get the next element in the iterator. The member rem is
  473. * decreased by one. The member data points to the next
  474. * element. The member index is increased by sizeof(xcb_present_event_t)
  475. */
  476. void
  477. xcb_present_event_next (xcb_present_event_iterator_t *i);
  478. /**
  479. * Return the iterator pointing to the last element
  480. * @param i An xcb_present_event_iterator_t
  481. * @return The iterator pointing to the last element
  482. *
  483. * Set the current element in the iterator to the last element.
  484. * The member rem is set to 0. The member data points to the
  485. * last element.
  486. */
  487. xcb_generic_iterator_t
  488. xcb_present_event_end (xcb_present_event_iterator_t i);
  489. /**
  490. *
  491. * @param c The connection
  492. * @return A cookie
  493. *
  494. * Delivers a request to the X server.
  495. *
  496. * This form can be used only if the request will not cause
  497. * a reply to be generated. Any returned error will be
  498. * saved for handling by xcb_request_check().
  499. */
  500. xcb_void_cookie_t
  501. xcb_present_select_input_checked (xcb_connection_t *c,
  502. xcb_present_event_t eid,
  503. xcb_window_t window,
  504. uint32_t event_mask);
  505. /**
  506. *
  507. * @param c The connection
  508. * @return A cookie
  509. *
  510. * Delivers a request to the X server.
  511. *
  512. */
  513. xcb_void_cookie_t
  514. xcb_present_select_input (xcb_connection_t *c,
  515. xcb_present_event_t eid,
  516. xcb_window_t window,
  517. uint32_t event_mask);
  518. /**
  519. *
  520. * @param c The connection
  521. * @return A cookie
  522. *
  523. * Delivers a request to the X server.
  524. *
  525. */
  526. xcb_present_query_capabilities_cookie_t
  527. xcb_present_query_capabilities (xcb_connection_t *c,
  528. uint32_t target);
  529. /**
  530. *
  531. * @param c The connection
  532. * @return A cookie
  533. *
  534. * Delivers a request to the X server.
  535. *
  536. * This form can be used only if the request will cause
  537. * a reply to be generated. Any returned error will be
  538. * placed in the event queue.
  539. */
  540. xcb_present_query_capabilities_cookie_t
  541. xcb_present_query_capabilities_unchecked (xcb_connection_t *c,
  542. uint32_t target);
  543. /**
  544. * Return the reply
  545. * @param c The connection
  546. * @param cookie The cookie
  547. * @param e The xcb_generic_error_t supplied
  548. *
  549. * Returns the reply of the request asked by
  550. *
  551. * The parameter @p e supplied to this function must be NULL if
  552. * xcb_present_query_capabilities_unchecked(). is used.
  553. * Otherwise, it stores the error if any.
  554. *
  555. * The returned value must be freed by the caller using free().
  556. */
  557. xcb_present_query_capabilities_reply_t *
  558. xcb_present_query_capabilities_reply (xcb_connection_t *c,
  559. xcb_present_query_capabilities_cookie_t cookie /**< */,
  560. xcb_generic_error_t **e);
  561. int
  562. xcb_present_redirect_notify_sizeof (const void *_buffer,
  563. uint32_t notifies_len);
  564. xcb_present_notify_t *
  565. xcb_present_redirect_notify_notifies (const xcb_present_redirect_notify_event_t *R);
  566. int
  567. xcb_present_redirect_notify_notifies_length (const xcb_present_redirect_notify_event_t *R);
  568. xcb_present_notify_iterator_t
  569. xcb_present_redirect_notify_notifies_iterator (const xcb_present_redirect_notify_event_t *R);
  570. #ifdef __cplusplus
  571. }
  572. #endif
  573. #endif
  574. /**
  575. * @}
  576. */