diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2023-02-27 22:40:48 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2023-02-27 22:40:48 (GMT) |
commit | 0cca309dfd903845b924f301a12b43eb1510979b (patch) | |
tree | ed10057b3bc451a255e38ee6e6329f06712cfef9 /Tests/FindX11 | |
parent | e7d7710cf2ef1ef576820abe60b6ce05bfa43b41 (diff) | |
download | CMake-0cca309dfd903845b924f301a12b43eb1510979b.zip CMake-0cca309dfd903845b924f301a12b43eb1510979b.tar.gz CMake-0cca309dfd903845b924f301a12b43eb1510979b.tar.bz2 |
FindX11: support the xcb-{cursor,shape,xrm} components
Fixes: #24417
Diffstat (limited to 'Tests/FindX11')
-rw-r--r-- | Tests/FindX11/Test/CMakeLists.txt | 6 | ||||
-rw-r--r-- | Tests/FindX11/Test/main.c | 53 |
2 files changed, 59 insertions, 0 deletions
diff --git a/Tests/FindX11/Test/CMakeLists.txt b/Tests/FindX11/Test/CMakeLists.txt index 18a73a3..e39ffb1 100644 --- a/Tests/FindX11/Test/CMakeLists.txt +++ b/Tests/FindX11/Test/CMakeLists.txt @@ -32,10 +32,13 @@ test_x11_component(x11_components Xau) test_x11_component(x11_components Xaw) test_x11_component(x11_components xcb) test_x11_component(x11_components X11_xcb) +test_x11_component(x11_components xcb_cursor) test_x11_component(x11_components xcb_icccm) test_x11_component(x11_components xcb_randr) +test_x11_component(x11_components xcb_shape) test_x11_component(x11_components xcb_util) test_x11_component(x11_components xcb_xfixes) +test_x11_component(x11_components xcb_xrm) test_x11_component(x11_components xcb_xtest) test_x11_component(x11_components xcb_keysyms) test_x11_component(x11_components xcb_xkb) @@ -76,10 +79,13 @@ foreach(lib Xaw xcb X11_xcb + xcb_cursor xcb_icccm xcb_randr + xcb_shape xcb_util xcb_xfixes + xcb_xrm Xcomposite Xdamage Xdmcp diff --git a/Tests/FindX11/Test/main.c b/Tests/FindX11/Test/main.c index c20257f..5240de0 100644 --- a/Tests/FindX11/Test/main.c +++ b/Tests/FindX11/Test/main.c @@ -336,6 +336,22 @@ static void test_xcb(void) xcb_disconnect(connection); } +# ifdef HAVE_xcb_cursor +# include <xcb/xcb_cursor.h> + +static void test_xcb_cursor(void) +{ + int screen_nbr; + xcb_connection_t* connection = xcb_connect(NULL, &screen_nbr); + xcb_screen_t* screen = xcb_aux_get_screen(conn, screen_nbr); + xcb_cursor_context_t* ctx; + xcb_cursor_context_new(connection, screen, &ctx); + xcb_cursor_context_free(ctx); + xcb_disconnect(connection); +} + +# endif + # ifdef HAVE_xcb_randr # include <xcb/randr.h> @@ -350,6 +366,20 @@ static void test_xcb_randr(void) # endif +# ifdef HAVE_xcb_shape +# include <xcb/shape.h> + +static void test_xcb_shape(void) +{ + int screen_nbr; + xcb_connection_t* connection = xcb_connect(NULL, &screen_nbr); + xcb_shape_query_version_cookie_t cookie = + xcb_shape_query_version(connection); + xcb_disconnect(connection); +} + +# endif + # ifdef HAVE_xcb_util # include <xcb/xcb_aux.h> @@ -376,6 +406,20 @@ static void test_xcb_xfixes(void) # endif +# ifdef HAVE_xcb_xrm +# include <xcb/xcb_xrm.h> + +static void test_xcb_xrm(void) +{ + int screen_nbr; + xcb_connection_t* connection = xcb_connect(NULL, &screen_nbr); + xcb_xrm_database_t* db = xcb_xrm_database_from_default(connection); + xcb_xrm_database_free(db); + xcb_disconnect(connection); +} + +# endif + # ifdef HAVE_xcb_xtest # include <xcb/xtest.h> @@ -496,15 +540,24 @@ int main(int argc, char* argv[]) #ifdef HAVE_xcb test_xcb, #endif +#ifdef HAVE_xcb_cursor + test_xcb_cursor, +#endif #ifdef HAVE_xcb_randr test_xcb_randr, #endif +#ifdef HAVE_xcb_shape + test_xcb_shape, +#endif #ifdef HAVE_xcb_util test_xcb_util, #endif #ifdef HAVE_xcb_xfixes test_xcb_xfixes, #endif +#ifdef HAVE_xcb_xrm + test_xcb_xrm, +#endif NULL, }; |