00001
00002
00003
00004
00005
00012 #ifndef __PRESENT_H
00013 #define __PRESENT_H
00014
00015 #include "xcb.h"
00016 #include "xproto.h"
00017 #include "randr.h"
00018 #include "xfixes.h"
00019 #include "sync.h"
00020
00021 #ifdef __cplusplus
00022 extern "C" {
00023 #endif
00024
00025 #define XCB_PRESENT_MAJOR_VERSION 1
00026 #define XCB_PRESENT_MINOR_VERSION 0
00027
00028 extern xcb_extension_t xcb_present_id;
00029
00030 typedef enum xcb_present_event_enum_t {
00031 XCB_PRESENT_EVENT_CONFIGURE_NOTIFY = 0,
00032 XCB_PRESENT_EVENT_COMPLETE_NOTIFY = 1,
00033 XCB_PRESENT_EVENT_IDLE_NOTIFY = 2,
00034 XCB_PRESENT_EVENT_REDIRECT_NOTIFY = 3
00035 } xcb_present_event_enum_t;
00036
00037 typedef enum xcb_present_event_mask_t {
00038 XCB_PRESENT_EVENT_MASK_NO_EVENT = 0,
00039 XCB_PRESENT_EVENT_MASK_CONFIGURE_NOTIFY = 1,
00040 XCB_PRESENT_EVENT_MASK_COMPLETE_NOTIFY = 2,
00041 XCB_PRESENT_EVENT_MASK_IDLE_NOTIFY = 4,
00042 XCB_PRESENT_EVENT_MASK_REDIRECT_NOTIFY = 8
00043 } xcb_present_event_mask_t;
00044
00045 typedef enum xcb_present_option_t {
00046 XCB_PRESENT_OPTION_NONE = 0,
00047 XCB_PRESENT_OPTION_ASYNC = 1,
00048 XCB_PRESENT_OPTION_COPY = 2,
00049 XCB_PRESENT_OPTION_UST = 4
00050 } xcb_present_option_t;
00051
00052 typedef enum xcb_present_capability_t {
00053 XCB_PRESENT_CAPABILITY_NONE = 0,
00054 XCB_PRESENT_CAPABILITY_ASYNC = 1,
00055 XCB_PRESENT_CAPABILITY_FENCE = 2,
00056 XCB_PRESENT_CAPABILITY_UST = 4
00057 } xcb_present_capability_t;
00058
00059 typedef enum xcb_present_complete_kind_t {
00060 XCB_PRESENT_COMPLETE_KIND_PIXMAP = 0,
00061 XCB_PRESENT_COMPLETE_KIND_NOTIFY_MSC = 1
00062 } xcb_present_complete_kind_t;
00063
00064 typedef enum xcb_present_complete_mode_t {
00065 XCB_PRESENT_COMPLETE_MODE_COPY = 0,
00066 XCB_PRESENT_COMPLETE_MODE_FLIP = 1,
00067 XCB_PRESENT_COMPLETE_MODE_SKIP = 2
00068 } xcb_present_complete_mode_t;
00069
00073 typedef struct xcb_present_notify_t {
00074 xcb_window_t window;
00075 uint32_t serial;
00076 } xcb_present_notify_t;
00077
00081 typedef struct xcb_present_notify_iterator_t {
00082 xcb_present_notify_t *data;
00083 int rem;
00084 int index;
00085 } xcb_present_notify_iterator_t;
00086
00090 typedef struct xcb_present_query_version_cookie_t {
00091 unsigned int sequence;
00092 } xcb_present_query_version_cookie_t;
00093
00095 #define XCB_PRESENT_QUERY_VERSION 0
00096
00100 typedef struct xcb_present_query_version_request_t {
00101 uint8_t major_opcode;
00102 uint8_t minor_opcode;
00103 uint16_t length;
00104 uint32_t major_version;
00105 uint32_t minor_version;
00106 } xcb_present_query_version_request_t;
00107
00111 typedef struct xcb_present_query_version_reply_t {
00112 uint8_t response_type;
00113 uint8_t pad0;
00114 uint16_t sequence;
00115 uint32_t length;
00116 uint32_t major_version;
00117 uint32_t minor_version;
00118 } xcb_present_query_version_reply_t;
00119
00121 #define XCB_PRESENT_PIXMAP 1
00122
00126 typedef struct xcb_present_pixmap_request_t {
00127 uint8_t major_opcode;
00128 uint8_t minor_opcode;
00129 uint16_t length;
00130 xcb_window_t window;
00131 xcb_pixmap_t pixmap;
00132 uint32_t serial;
00133 xcb_xfixes_region_t valid;
00134 xcb_xfixes_region_t update;
00135 int16_t x_off;
00136 int16_t y_off;
00137 xcb_randr_crtc_t target_crtc;
00138 xcb_sync_fence_t wait_fence;
00139 xcb_sync_fence_t idle_fence;
00140 uint32_t options;
00141 uint8_t pad0[4];
00142 uint64_t target_msc;
00143 uint64_t divisor;
00144 uint64_t remainder;
00145 } xcb_present_pixmap_request_t;
00146
00148 #define XCB_PRESENT_NOTIFY_MSC 2
00149
00153 typedef struct xcb_present_notify_msc_request_t {
00154 uint8_t major_opcode;
00155 uint8_t minor_opcode;
00156 uint16_t length;
00157 xcb_window_t window;
00158 uint32_t serial;
00159 uint8_t pad0[4];
00160 uint64_t target_msc;
00161 uint64_t divisor;
00162 uint64_t remainder;
00163 } xcb_present_notify_msc_request_t;
00164
00165 typedef uint32_t xcb_present_event_t;
00166
00170 typedef struct xcb_present_event_iterator_t {
00171 xcb_present_event_t *data;
00172 int rem;
00173 int index;
00174 } xcb_present_event_iterator_t;
00175
00177 #define XCB_PRESENT_SELECT_INPUT 3
00178
00182 typedef struct xcb_present_select_input_request_t {
00183 uint8_t major_opcode;
00184 uint8_t minor_opcode;
00185 uint16_t length;
00186 xcb_present_event_t eid;
00187 xcb_window_t window;
00188 uint32_t event_mask;
00189 } xcb_present_select_input_request_t;
00190
00194 typedef struct xcb_present_query_capabilities_cookie_t {
00195 unsigned int sequence;
00196 } xcb_present_query_capabilities_cookie_t;
00197
00199 #define XCB_PRESENT_QUERY_CAPABILITIES 4
00200
00204 typedef struct xcb_present_query_capabilities_request_t {
00205 uint8_t major_opcode;
00206 uint8_t minor_opcode;
00207 uint16_t length;
00208 uint32_t target;
00209 } xcb_present_query_capabilities_request_t;
00210
00214 typedef struct xcb_present_query_capabilities_reply_t {
00215 uint8_t response_type;
00216 uint8_t pad0;
00217 uint16_t sequence;
00218 uint32_t length;
00219 uint32_t capabilities;
00220 } xcb_present_query_capabilities_reply_t;
00221
00223 #define XCB_PRESENT_GENERIC 0
00224
00228 typedef struct xcb_present_generic_event_t {
00229 uint8_t response_type;
00230 uint8_t extension;
00231 uint16_t sequence;
00232 uint32_t length;
00233 uint16_t evtype;
00234 uint8_t pad0[2];
00235 xcb_present_event_t event;
00236 } xcb_present_generic_event_t;
00237
00239 #define XCB_PRESENT_CONFIGURE_NOTIFY 0
00240
00244 typedef struct xcb_present_configure_notify_event_t {
00245 uint8_t response_type;
00246 uint8_t extension;
00247 uint16_t sequence;
00248 uint32_t length;
00249 uint16_t event_type;
00250 uint8_t pad0[2];
00251 xcb_present_event_t event;
00252 xcb_window_t window;
00253 int16_t x;
00254 int16_t y;
00255 uint16_t width;
00256 uint16_t height;
00257 int16_t off_x;
00258 int16_t off_y;
00259 uint32_t full_sequence;
00260 uint16_t pixmap_width;
00261 uint16_t pixmap_height;
00262 uint32_t pixmap_flags;
00263 } xcb_present_configure_notify_event_t;
00264
00266 #define XCB_PRESENT_COMPLETE_NOTIFY 1
00267
00271 typedef struct xcb_present_complete_notify_event_t {
00272 uint8_t response_type;
00273 uint8_t extension;
00274 uint16_t sequence;
00275 uint32_t length;
00276 uint16_t event_type;
00277 uint8_t kind;
00278 uint8_t mode;
00279 xcb_present_event_t event;
00280 xcb_window_t window;
00281 uint32_t serial;
00282 uint64_t ust;
00283 uint32_t full_sequence;
00284 uint64_t msc;
00285 } XCB_PACKED xcb_present_complete_notify_event_t;
00286
00288 #define XCB_PRESENT_IDLE_NOTIFY 2
00289
00293 typedef struct xcb_present_idle_notify_event_t {
00294 uint8_t response_type;
00295 uint8_t extension;
00296 uint16_t sequence;
00297 uint32_t length;
00298 uint16_t event_type;
00299 uint8_t pad0[2];
00300 xcb_present_event_t event;
00301 xcb_window_t window;
00302 uint32_t serial;
00303 xcb_pixmap_t pixmap;
00304 xcb_sync_fence_t idle_fence;
00305 uint32_t full_sequence;
00306 } xcb_present_idle_notify_event_t;
00307
00309 #define XCB_PRESENT_REDIRECT_NOTIFY 3
00310
00314 typedef struct xcb_present_redirect_notify_event_t {
00315 uint8_t response_type;
00316 uint8_t extension;
00317 uint16_t sequence;
00318 uint32_t length;
00319 uint16_t event_type;
00320 uint8_t update_window;
00321 uint8_t pad0;
00322 xcb_present_event_t event;
00323 xcb_window_t event_window;
00324 xcb_window_t window;
00325 xcb_pixmap_t pixmap;
00326 uint32_t serial;
00327 uint32_t full_sequence;
00328 xcb_xfixes_region_t valid_region;
00329 xcb_xfixes_region_t update_region;
00330 xcb_rectangle_t valid_rect;
00331 xcb_rectangle_t update_rect;
00332 int16_t x_off;
00333 int16_t y_off;
00334 xcb_randr_crtc_t target_crtc;
00335 xcb_sync_fence_t wait_fence;
00336 xcb_sync_fence_t idle_fence;
00337 uint32_t options;
00338 uint8_t pad1[4];
00339 uint64_t target_msc;
00340 uint64_t divisor;
00341 uint64_t remainder;
00342 } XCB_PACKED xcb_present_redirect_notify_event_t;
00343
00352 void
00353 xcb_present_notify_next (xcb_present_notify_iterator_t *i);
00354
00364 xcb_generic_iterator_t
00365 xcb_present_notify_end (xcb_present_notify_iterator_t i);
00366
00375 xcb_present_query_version_cookie_t
00376 xcb_present_query_version (xcb_connection_t *c,
00377 uint32_t major_version,
00378 uint32_t minor_version);
00379
00391 xcb_present_query_version_cookie_t
00392 xcb_present_query_version_unchecked (xcb_connection_t *c,
00393 uint32_t major_version,
00394 uint32_t minor_version);
00395
00410 xcb_present_query_version_reply_t *
00411 xcb_present_query_version_reply (xcb_connection_t *c,
00412 xcb_present_query_version_cookie_t cookie ,
00413 xcb_generic_error_t **e);
00414
00415 int
00416 xcb_present_pixmap_sizeof (const void *_buffer,
00417 uint32_t notifies_len);
00418
00430 xcb_void_cookie_t
00431 xcb_present_pixmap_checked (xcb_connection_t *c,
00432 xcb_window_t window,
00433 xcb_pixmap_t pixmap,
00434 uint32_t serial,
00435 xcb_xfixes_region_t valid,
00436 xcb_xfixes_region_t update,
00437 int16_t x_off,
00438 int16_t y_off,
00439 xcb_randr_crtc_t target_crtc,
00440 xcb_sync_fence_t wait_fence,
00441 xcb_sync_fence_t idle_fence,
00442 uint32_t options,
00443 uint64_t target_msc,
00444 uint64_t divisor,
00445 uint64_t remainder,
00446 uint32_t notifies_len,
00447 const xcb_present_notify_t *notifies);
00448
00457 xcb_void_cookie_t
00458 xcb_present_pixmap (xcb_connection_t *c,
00459 xcb_window_t window,
00460 xcb_pixmap_t pixmap,
00461 uint32_t serial,
00462 xcb_xfixes_region_t valid,
00463 xcb_xfixes_region_t update,
00464 int16_t x_off,
00465 int16_t y_off,
00466 xcb_randr_crtc_t target_crtc,
00467 xcb_sync_fence_t wait_fence,
00468 xcb_sync_fence_t idle_fence,
00469 uint32_t options,
00470 uint64_t target_msc,
00471 uint64_t divisor,
00472 uint64_t remainder,
00473 uint32_t notifies_len,
00474 const xcb_present_notify_t *notifies);
00475
00476 xcb_present_notify_t *
00477 xcb_present_pixmap_notifies (const xcb_present_pixmap_request_t *R);
00478
00479 int
00480 xcb_present_pixmap_notifies_length (const xcb_present_pixmap_request_t *R);
00481
00482 xcb_present_notify_iterator_t
00483 xcb_present_pixmap_notifies_iterator (const xcb_present_pixmap_request_t *R);
00484
00496 xcb_void_cookie_t
00497 xcb_present_notify_msc_checked (xcb_connection_t *c,
00498 xcb_window_t window,
00499 uint32_t serial,
00500 uint64_t target_msc,
00501 uint64_t divisor,
00502 uint64_t remainder);
00503
00512 xcb_void_cookie_t
00513 xcb_present_notify_msc (xcb_connection_t *c,
00514 xcb_window_t window,
00515 uint32_t serial,
00516 uint64_t target_msc,
00517 uint64_t divisor,
00518 uint64_t remainder);
00519
00528 void
00529 xcb_present_event_next (xcb_present_event_iterator_t *i);
00530
00540 xcb_generic_iterator_t
00541 xcb_present_event_end (xcb_present_event_iterator_t i);
00542
00554 xcb_void_cookie_t
00555 xcb_present_select_input_checked (xcb_connection_t *c,
00556 xcb_present_event_t eid,
00557 xcb_window_t window,
00558 uint32_t event_mask);
00559
00568 xcb_void_cookie_t
00569 xcb_present_select_input (xcb_connection_t *c,
00570 xcb_present_event_t eid,
00571 xcb_window_t window,
00572 uint32_t event_mask);
00573
00582 xcb_present_query_capabilities_cookie_t
00583 xcb_present_query_capabilities (xcb_connection_t *c,
00584 uint32_t target);
00585
00597 xcb_present_query_capabilities_cookie_t
00598 xcb_present_query_capabilities_unchecked (xcb_connection_t *c,
00599 uint32_t target);
00600
00615 xcb_present_query_capabilities_reply_t *
00616 xcb_present_query_capabilities_reply (xcb_connection_t *c,
00617 xcb_present_query_capabilities_cookie_t cookie ,
00618 xcb_generic_error_t **e);
00619
00620 int
00621 xcb_present_redirect_notify_sizeof (const void *_buffer,
00622 uint32_t notifies_len);
00623
00624 xcb_present_notify_t *
00625 xcb_present_redirect_notify_notifies (const xcb_present_redirect_notify_event_t *R);
00626
00627 int
00628 xcb_present_redirect_notify_notifies_length (const xcb_present_redirect_notify_event_t *R);
00629
00630 xcb_present_notify_iterator_t
00631 xcb_present_redirect_notify_notifies_iterator (const xcb_present_redirect_notify_event_t *R);
00632
00633
00634 #ifdef __cplusplus
00635 }
00636 #endif
00637
00638 #endif
00639