Atlas - SDL_waylanddyn.h

Home / ext / SDL / src / video / wayland Lines: 1 | Size: 9807 bytes [Download] [Show on GitHub] [Search similar files] [Raw] [Raw (proxy)]
[FILE BEGIN]
1/* 2 Simple DirectMedia Layer 3 Copyright (C) 1997-2025 Sam Lantinga <[email protected]> 4 5 This software is provided 'as-is', without any express or implied 6 warranty. In no event will the authors be held liable for any damages 7 arising from the use of this software. 8 9 Permission is granted to anyone to use this software for any purpose, 10 including commercial applications, and to alter it and redistribute it 11 freely, subject to the following restrictions: 12 13 1. The origin of this software must not be misrepresented; you must not 14 claim that you wrote the original software. If you use this software 15 in a product, an acknowledgment in the product documentation would be 16 appreciated but is not required. 17 2. Altered source versions must be plainly marked as such, and must not be 18 misrepresented as being the original software. 19 3. This notice may not be removed or altered from any source distribution. 20*/ 21#ifndef SDL_waylanddyn_h_ 22#define SDL_waylanddyn_h_ 23 24#include "SDL_internal.h" 25 26/* We can't include wayland-client.h here 27 * but we need some structs from it 28 */ 29struct wl_interface; 30struct wl_proxy; 31struct wl_event_queue; 32struct wl_display; 33struct wl_surface; 34struct wl_shm; 35 36// We also need some for libdecor 37struct wl_seat; 38struct wl_output; 39struct libdecor; 40struct libdecor_frame; 41struct libdecor_state; 42struct libdecor_configuration; 43struct libdecor_interface; 44struct libdecor_frame_interface; 45enum libdecor_resize_edge; 46enum libdecor_capabilities; 47enum libdecor_window_state; 48 49#include "wayland-cursor.h" 50#include "wayland-util.h" 51#include "xkbcommon/xkbcommon.h" 52#include "xkbcommon/xkbcommon-compose.h" 53 54// Must be included before our #defines, see Bugzilla #4957 55#include "wayland-client-core.h" 56 57#define SDL_WAYLAND_CHECK_VERSION(x, y, z) \ 58 (WAYLAND_VERSION_MAJOR > x || \ 59 (WAYLAND_VERSION_MAJOR == x && WAYLAND_VERSION_MINOR > y) || \ 60 (WAYLAND_VERSION_MAJOR == x && WAYLAND_VERSION_MINOR == y && WAYLAND_VERSION_MICRO >= z)) 61 62#define SDL_XKBCOMMON_CHECK_VERSION(x, y, z) \ 63 (SDL_XKBCOMMON_VERSION_MAJOR > x || \ 64 (SDL_XKBCOMMON_VERSION_MAJOR == x && SDL_XKBCOMMON_VERSION_MINOR > y) || \ 65 (SDL_XKBCOMMON_VERSION_MAJOR == x && SDL_XKBCOMMON_VERSION_MINOR == y && SDL_XKBCOMMON_VERSION_PATCH >= z)) 66 67#ifdef HAVE_LIBDECOR_H 68#define SDL_LIBDECOR_CHECK_VERSION(x, y, z) \ 69 (SDL_LIBDECOR_VERSION_MAJOR > x || \ 70 (SDL_LIBDECOR_VERSION_MAJOR == x && SDL_LIBDECOR_VERSION_MINOR > y) || \ 71 (SDL_LIBDECOR_VERSION_MAJOR == x && SDL_LIBDECOR_VERSION_MINOR == y && SDL_LIBDECOR_VERSION_PATCH >= z)) 72#endif 73 74#ifdef __cplusplus 75extern "C" { 76#endif 77 78extern bool SDL_WAYLAND_LoadSymbols(void); 79extern void SDL_WAYLAND_UnloadSymbols(void); 80 81#define SDL_WAYLAND_MODULE(modname) extern int SDL_WAYLAND_HAVE_##modname; 82#define SDL_WAYLAND_SYM(rc, fn, params) \ 83 typedef rc(*SDL_DYNWAYLANDFN_##fn) params; \ 84 extern SDL_DYNWAYLANDFN_##fn WAYLAND_##fn; 85#define SDL_WAYLAND_SYM_OPT(rc, fn, params) \ 86 typedef rc(*SDL_DYNWAYLANDFN_##fn) params; \ 87 extern SDL_DYNWAYLANDFN_##fn WAYLAND_##fn; 88#define SDL_WAYLAND_INTERFACE(iface) extern const struct wl_interface *WAYLAND_##iface; 89#include "SDL_waylandsym.h" 90 91#ifdef __cplusplus 92} 93#endif 94 95#ifdef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC 96 97#if defined(_WAYLAND_CLIENT_H) || defined(WAYLAND_CLIENT_H) 98#error Do not include wayland-client ahead of SDL_waylanddyn.h in dynamic loading mode 99#endif 100 101/* wayland-client-protocol.h included from wayland-client.h 102 * has inline functions that require these to be defined in dynamic loading mode 103 */ 104 105#define wl_proxy_create (*WAYLAND_wl_proxy_create) 106#define wl_proxy_destroy (*WAYLAND_wl_proxy_destroy) 107#define wl_proxy_marshal (*WAYLAND_wl_proxy_marshal) 108#define wl_proxy_set_user_data (*WAYLAND_wl_proxy_set_user_data) 109#define wl_proxy_get_user_data (*WAYLAND_wl_proxy_get_user_data) 110#define wl_proxy_get_version (*WAYLAND_wl_proxy_get_version) 111#define wl_proxy_add_listener (*WAYLAND_wl_proxy_add_listener) 112#define wl_proxy_marshal_constructor (*WAYLAND_wl_proxy_marshal_constructor) 113#define wl_proxy_marshal_constructor_versioned (*WAYLAND_wl_proxy_marshal_constructor_versioned) 114#define wl_proxy_set_tag (*WAYLAND_wl_proxy_set_tag) 115#define wl_proxy_get_tag (*WAYLAND_wl_proxy_get_tag) 116#define wl_proxy_marshal_flags (*WAYLAND_wl_proxy_marshal_flags) 117#define wl_proxy_marshal_array_flags (*WAYLAND_wl_proxy_marshal_array_flags) 118#define wl_display_reconnect (*WAYLAND_wl_display_reconnect) 119 120#define wl_seat_interface (*WAYLAND_wl_seat_interface) 121#define wl_surface_interface (*WAYLAND_wl_surface_interface) 122#define wl_shm_pool_interface (*WAYLAND_wl_shm_pool_interface) 123#define wl_buffer_interface (*WAYLAND_wl_buffer_interface) 124#define wl_registry_interface (*WAYLAND_wl_registry_interface) 125#define wl_region_interface (*WAYLAND_wl_region_interface) 126#define wl_pointer_interface (*WAYLAND_wl_pointer_interface) 127#define wl_keyboard_interface (*WAYLAND_wl_keyboard_interface) 128#define wl_compositor_interface (*WAYLAND_wl_compositor_interface) 129#define wl_output_interface (*WAYLAND_wl_output_interface) 130#define wl_shm_interface (*WAYLAND_wl_shm_interface) 131#define wl_data_device_interface (*WAYLAND_wl_data_device_interface) 132#define wl_data_offer_interface (*WAYLAND_wl_data_offer_interface) 133#define wl_data_source_interface (*WAYLAND_wl_data_source_interface) 134#define wl_data_device_manager_interface (*WAYLAND_wl_data_device_manager_interface) 135 136/* 137 * These must be included before libdecor.h, otherwise the libdecor header 138 * pulls in the system Wayland protocol headers instead of ours. 139 */ 140#include "wayland-client-protocol.h" 141#include "wayland-egl.h" 142 143#ifdef HAVE_LIBDECOR_H 144// Must be included before our defines 145#include <libdecor.h> 146 147#define libdecor_unref (*WAYLAND_libdecor_unref) 148#define libdecor_new (*WAYLAND_libdecor_new) 149#define libdecor_decorate (*WAYLAND_libdecor_decorate) 150#define libdecor_frame_unref (*WAYLAND_libdecor_frame_unref) 151#define libdecor_frame_set_title (*WAYLAND_libdecor_frame_set_title) 152#define libdecor_frame_set_app_id (*WAYLAND_libdecor_frame_set_app_id) 153#define libdecor_frame_set_max_content_size (*WAYLAND_libdecor_frame_set_max_content_size) 154#define libdecor_frame_get_max_content_size (*WAYLAND_libdecor_frame_get_max_content_size) 155#define libdecor_frame_set_min_content_size (*WAYLAND_libdecor_frame_set_min_content_size) 156#define libdecor_frame_get_min_content_size (*WAYLAND_libdecor_frame_get_min_content_size) 157#define libdecor_frame_resize (*WAYLAND_libdecor_frame_resize) 158#define libdecor_frame_move (*WAYLAND_libdecor_frame_move) 159#define libdecor_frame_commit (*WAYLAND_libdecor_frame_commit) 160#define libdecor_frame_set_minimized (*WAYLAND_libdecor_frame_set_minimized) 161#define libdecor_frame_set_maximized (*WAYLAND_libdecor_frame_set_maximized) 162#define libdecor_frame_unset_maximized (*WAYLAND_libdecor_frame_unset_maximized) 163#define libdecor_frame_set_fullscreen (*WAYLAND_libdecor_frame_set_fullscreen) 164#define libdecor_frame_unset_fullscreen (*WAYLAND_libdecor_frame_unset_fullscreen) 165#define libdecor_frame_set_capabilities (*WAYLAND_libdecor_frame_set_capabilities) 166#define libdecor_frame_unset_capabilities (*WAYLAND_libdecor_frame_unset_capabilities) 167#define libdecor_frame_has_capability (*WAYLAND_libdecor_frame_has_capability) 168#define libdecor_frame_set_visibility (*WAYLAND_libdecor_frame_set_visibility) 169#define libdecor_frame_is_visible (*WAYLAND_libdecor_frame_is_visible) 170#define libdecor_frame_is_floating (*WAYLAND_libdecor_frame_is_floating) 171#define libdecor_frame_set_parent (*WAYLAND_libdecor_frame_set_parent) 172#define libdecor_frame_show_window_menu (*WAYLAND_libdecor_frame_show_window_menu) 173#define libdecor_frame_get_wm_capabilities (*WAYLAND_libdecor_frame_get_wm_capabilities) 174#define libdecor_frame_get_xdg_surface (*WAYLAND_libdecor_frame_get_xdg_surface) 175#define libdecor_frame_get_xdg_toplevel (*WAYLAND_libdecor_frame_get_xdg_toplevel) 176#define libdecor_frame_translate_coordinate (*WAYLAND_libdecor_frame_translate_coordinate) 177#define libdecor_frame_map (*WAYLAND_libdecor_frame_map) 178#define libdecor_state_new (*WAYLAND_libdecor_state_new) 179#define libdecor_state_free (*WAYLAND_libdecor_state_free) 180#define libdecor_configuration_get_content_size (*WAYLAND_libdecor_configuration_get_content_size) 181#define libdecor_configuration_get_window_state (*WAYLAND_libdecor_configuration_get_window_state) 182#define libdecor_dispatch (*WAYLAND_libdecor_dispatch) 183#endif 184 185#else // SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC 186 187/* 188 * These must be included before libdecor.h, otherwise the libdecor header 189 * pulls in the system Wayland protocol headers instead of ours. 190 */ 191#include "wayland-client-protocol.h" 192#include "wayland-egl.h" 193 194#ifdef HAVE_LIBDECOR_H 195#include <libdecor.h> 196#endif 197 198#endif // SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC 199 200#endif // SDL_waylanddyn_h_ 201
[FILE END]
(C) 2025 0x4248 (C) 2025 4248 Media and 4248 Systems, All part of 0x4248 See LICENCE files for more information. Not all files are by 0x4248 always check Licencing.