2 * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
5 #include "ecore_xcb_private.h"
8 * @defgroup Ecore_X_Composite_Group X Composite Extension Functions
10 * Functions related to the X Composite extension.
13 #ifdef ECORE_XCB_COMPOSITE
14 static uint8_t _composite_available = 0;
15 static xcb_composite_query_version_cookie_t _ecore_xcb_composite_init_cookie;
16 #endif /* ECORE_XCB_COMPOSITE */
19 /* To avoid round trips, the initialization is separated in 2
20 functions: _ecore_xcb_composite_init and
21 _ecore_xcb_composite_init_finalize. The first one gets the cookies and
22 the second one gets the replies. */
25 _ecore_x_composite_init(const xcb_query_extension_reply_t *reply)
27 #ifdef ECORE_XCB_COMPOSITE
28 if (reply && reply->present)
29 _ecore_xcb_composite_init_cookie = xcb_composite_query_version_unchecked(_ecore_xcb_conn, XCB_COMPOSITE_MAJOR_VERSION, XCB_COMPOSITE_MINOR_VERSION);
30 #endif /* ECORE_XCB_COMPOSITE */
34 _ecore_x_composite_init_finalize(void)
36 #ifdef ECORE_XCB_COMPOSITE
37 xcb_composite_query_version_reply_t *reply;
39 reply = xcb_composite_query_version_reply(_ecore_xcb_conn,
40 _ecore_xcb_composite_init_cookie,
44 if (reply->major_version = XCB_COMPOSITE_MAJOR_VERSION &&
45 reply->minor_version >= XCB_COMPOSITE_MINOR_VERSION)
46 _composite_available = 1;
49 #endif /* ECORE_XCB_COMPOSITE */
53 * Return whether the Composite Extension is available.
54 * @return 1 if the Composite Extension is available, 0 if not.
56 * Return 1 if the X server supports the Composite Extension version 0.4
57 * or greater, 0 otherwise.
58 * @ingroup Ecore_X_Composite_Group
61 ecore_x_composite_query(void)
63 #ifdef ECORE_XCB_COMPOSITE
64 return _composite_available;
67 #endif /* ECORE_XCB_COMPOSITE */