Atlas - SDL_waylandsym.h
Home / ext / SDL / src / video / wayland Lines: 1 | Size: 16338 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 22/* *INDENT-OFF* */ // clang-format off 23 24#ifndef SDL_WAYLAND_MODULE 25#define SDL_WAYLAND_MODULE(modname) 26#endif 27 28#ifndef SDL_WAYLAND_SYM 29#define SDL_WAYLAND_SYM(rc,fn,params) 30#endif 31 32#ifndef SDL_WAYLAND_SYM_OPT 33#define SDL_WAYLAND_SYM_OPT(rc,fn,params) 34#endif 35 36#ifndef SDL_WAYLAND_INTERFACE 37#define SDL_WAYLAND_INTERFACE(iface) 38#endif 39 40SDL_WAYLAND_MODULE(WAYLAND_CLIENT) 41SDL_WAYLAND_SYM(void, wl_proxy_marshal, (struct wl_proxy *, uint32_t, ...)) 42SDL_WAYLAND_SYM(struct wl_proxy *, wl_proxy_create, (struct wl_proxy *, const struct wl_interface *)) 43SDL_WAYLAND_SYM(void, wl_proxy_destroy, (struct wl_proxy *)) 44SDL_WAYLAND_SYM(int, wl_proxy_add_listener, (struct wl_proxy *, void (**)(void), void *)) 45SDL_WAYLAND_SYM(void, wl_proxy_set_user_data, (struct wl_proxy *, void *)) 46SDL_WAYLAND_SYM(void *, wl_proxy_get_user_data, (struct wl_proxy *)) 47SDL_WAYLAND_SYM(uint32_t, wl_proxy_get_version, (struct wl_proxy *)) 48SDL_WAYLAND_SYM(uint32_t, wl_proxy_get_id, (struct wl_proxy *)) 49SDL_WAYLAND_SYM(const char *, wl_proxy_get_class, (struct wl_proxy *)) 50SDL_WAYLAND_SYM(void, wl_proxy_set_queue, (struct wl_proxy *, struct wl_event_queue *)) 51SDL_WAYLAND_SYM(void *, wl_proxy_create_wrapper, (void *)) 52SDL_WAYLAND_SYM(void, wl_proxy_wrapper_destroy, (void *)) 53SDL_WAYLAND_SYM(struct wl_display *, wl_display_connect, (const char *)) 54SDL_WAYLAND_SYM(struct wl_display *, wl_display_connect_to_fd, (int)) 55SDL_WAYLAND_SYM(void, wl_display_disconnect, (struct wl_display *)) 56SDL_WAYLAND_SYM(int, wl_display_get_fd, (struct wl_display *)) 57SDL_WAYLAND_SYM(int, wl_display_dispatch, (struct wl_display *)) 58SDL_WAYLAND_SYM(int, wl_display_dispatch_queue, (struct wl_display *, struct wl_event_queue *)) 59SDL_WAYLAND_SYM(int, wl_display_dispatch_queue_pending, (struct wl_display *, struct wl_event_queue *)) 60SDL_WAYLAND_SYM(int, wl_display_dispatch_pending, (struct wl_display *)) 61SDL_WAYLAND_SYM(int, wl_display_prepare_read, (struct wl_display *)) 62SDL_WAYLAND_SYM(int, wl_display_prepare_read_queue, (struct wl_display *, struct wl_event_queue *)) 63SDL_WAYLAND_SYM(int, wl_display_read_events, (struct wl_display *)) 64SDL_WAYLAND_SYM(void, wl_display_cancel_read, (struct wl_display *)) 65SDL_WAYLAND_SYM(int, wl_display_get_error, (struct wl_display *)) 66SDL_WAYLAND_SYM(int, wl_display_flush, (struct wl_display *)) 67SDL_WAYLAND_SYM(int, wl_display_roundtrip, (struct wl_display *)) 68SDL_WAYLAND_SYM(struct wl_event_queue *, wl_display_create_queue, (struct wl_display *)) 69SDL_WAYLAND_SYM(void, wl_event_queue_destroy, (struct wl_event_queue *)) 70SDL_WAYLAND_SYM(void, wl_log_set_handler_client, (wl_log_func_t)) 71SDL_WAYLAND_SYM(void, wl_list_init, (struct wl_list *)) 72SDL_WAYLAND_SYM(void, wl_list_insert, (struct wl_list *, struct wl_list *) ) 73SDL_WAYLAND_SYM(void, wl_list_remove, (struct wl_list *)) 74SDL_WAYLAND_SYM(int, wl_list_length, (const struct wl_list *)) 75SDL_WAYLAND_SYM(int, wl_list_empty, (const struct wl_list *)) 76SDL_WAYLAND_SYM(void, wl_list_insert_list, (struct wl_list *, struct wl_list *)) 77SDL_WAYLAND_SYM(struct wl_proxy *, wl_proxy_marshal_constructor, (struct wl_proxy *, uint32_t opcode, const struct wl_interface *interface, ...)) 78SDL_WAYLAND_SYM(struct wl_proxy *, wl_proxy_marshal_constructor_versioned, (struct wl_proxy *proxy, uint32_t opcode, const struct wl_interface *interface, uint32_t version, ...)) 79SDL_WAYLAND_SYM(void, wl_proxy_set_tag, (struct wl_proxy *, const char * const *)) 80SDL_WAYLAND_SYM(const char * const *, wl_proxy_get_tag, (struct wl_proxy *)) 81 82#if SDL_WAYLAND_CHECK_VERSION(1, 20, 0) 83/* wayland-scanner 1.20 generates code that will call these, so these are 84 * non-optional when we are compiling against Wayland 1.20. We don't 85 * explicitly call them ourselves, though, so if we are only compiling 86 * against Wayland 1.18, they're unnecessary. */ 87SDL_WAYLAND_SYM(struct wl_proxy *, wl_proxy_marshal_flags, (struct wl_proxy *proxy, uint32_t opcode, const struct wl_interface *interfac, uint32_t version, uint32_t flags, ...)) 88SDL_WAYLAND_SYM(struct wl_proxy *, wl_proxy_marshal_array_flags, (struct wl_proxy *proxy, uint32_t opcode, const struct wl_interface *interface, uint32_t version, uint32_t flags, union wl_argument *args)) 89#endif 90 91#if SDL_WAYLAND_CHECK_VERSION(1, 23, 0) || defined(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC) 92SDL_WAYLAND_SYM_OPT(struct wl_event_queue *, wl_display_create_queue_with_name, (struct wl_display *display, const char *name)) 93#endif 94 95#if 0 // TODO RECONNECT: See waylandvideo.c for more information! 96#if SDL_WAYLAND_CHECK_VERSION(broken, on, purpose) 97SDL_WAYLAND_SYM(int, wl_display_reconnect, (struct wl_display *)) 98#endif 99#endif // 0 100 101SDL_WAYLAND_INTERFACE(wl_seat_interface) 102SDL_WAYLAND_INTERFACE(wl_surface_interface) 103SDL_WAYLAND_INTERFACE(wl_shm_pool_interface) 104SDL_WAYLAND_INTERFACE(wl_buffer_interface) 105SDL_WAYLAND_INTERFACE(wl_registry_interface) 106SDL_WAYLAND_INTERFACE(wl_region_interface) 107SDL_WAYLAND_INTERFACE(wl_pointer_interface) 108SDL_WAYLAND_INTERFACE(wl_keyboard_interface) 109SDL_WAYLAND_INTERFACE(wl_compositor_interface) 110SDL_WAYLAND_INTERFACE(wl_output_interface) 111SDL_WAYLAND_INTERFACE(wl_shm_interface) 112SDL_WAYLAND_INTERFACE(wl_data_device_interface) 113SDL_WAYLAND_INTERFACE(wl_data_source_interface) 114SDL_WAYLAND_INTERFACE(wl_data_offer_interface) 115SDL_WAYLAND_INTERFACE(wl_data_device_manager_interface) 116 117SDL_WAYLAND_MODULE(WAYLAND_EGL) 118SDL_WAYLAND_SYM(struct wl_egl_window *, wl_egl_window_create, (struct wl_surface *, int, int)) 119SDL_WAYLAND_SYM(void, wl_egl_window_destroy, (struct wl_egl_window *)) 120SDL_WAYLAND_SYM(void, wl_egl_window_resize, (struct wl_egl_window *, int, int, int, int)) 121SDL_WAYLAND_SYM(void, wl_egl_window_get_attached_size, (struct wl_egl_window *, int *, int *)) 122 123SDL_WAYLAND_MODULE(WAYLAND_CURSOR) 124SDL_WAYLAND_SYM(struct wl_cursor_theme *, wl_cursor_theme_load, (const char *, int , struct wl_shm *)) 125SDL_WAYLAND_SYM(void, wl_cursor_theme_destroy, (struct wl_cursor_theme *)) 126SDL_WAYLAND_SYM(struct wl_cursor *, wl_cursor_theme_get_cursor, (struct wl_cursor_theme *, const char *)) 127SDL_WAYLAND_SYM(struct wl_buffer *, wl_cursor_image_get_buffer, (struct wl_cursor_image *)) 128SDL_WAYLAND_SYM(int, wl_cursor_frame, (struct wl_cursor *, uint32_t)) 129 130SDL_WAYLAND_MODULE(WAYLAND_XKB) 131SDL_WAYLAND_SYM(int, xkb_state_key_get_syms, (struct xkb_state *, xkb_keycode_t, const xkb_keysym_t **)) 132SDL_WAYLAND_SYM(int, xkb_keysym_to_utf8, (xkb_keysym_t, char *, size_t) ) 133SDL_WAYLAND_SYM(struct xkb_keymap *, xkb_keymap_new_from_string, (struct xkb_context *, const char *, enum xkb_keymap_format, enum xkb_keymap_compile_flags)) 134SDL_WAYLAND_SYM(struct xkb_state *, xkb_state_new, (struct xkb_keymap *) ) 135SDL_WAYLAND_SYM(int, xkb_keymap_key_repeats, (struct xkb_keymap *keymap, xkb_keycode_t key) ) 136SDL_WAYLAND_SYM(void, xkb_keymap_unref, (struct xkb_keymap *) ) 137SDL_WAYLAND_SYM(void, xkb_state_unref, (struct xkb_state *) ) 138SDL_WAYLAND_SYM(void, xkb_context_unref, (struct xkb_context *) ) 139SDL_WAYLAND_SYM(struct xkb_context *, xkb_context_new, (enum xkb_context_flags flags) ) 140SDL_WAYLAND_SYM(enum xkb_state_component, xkb_state_update_mask, (struct xkb_state *state,\ 141 xkb_mod_mask_t depressed_mods,\ 142 xkb_mod_mask_t latched_mods,\ 143 xkb_mod_mask_t locked_mods,\ 144 xkb_layout_index_t depressed_layout,\ 145 xkb_layout_index_t latched_layout,\ 146 xkb_layout_index_t locked_layout) ) 147SDL_WAYLAND_SYM(struct xkb_compose_table *, xkb_compose_table_new_from_locale, (struct xkb_context *,\ 148 const char *locale, enum xkb_compose_compile_flags) ) 149SDL_WAYLAND_SYM(void, xkb_compose_state_reset, (struct xkb_compose_state *) ) 150SDL_WAYLAND_SYM(void, xkb_compose_table_unref, (struct xkb_compose_table *) ) 151SDL_WAYLAND_SYM(struct xkb_compose_state *, xkb_compose_state_new, (struct xkb_compose_table *, enum xkb_compose_state_flags) ) 152SDL_WAYLAND_SYM(void, xkb_compose_state_unref, (struct xkb_compose_state *) ) 153SDL_WAYLAND_SYM(enum xkb_compose_feed_result, xkb_compose_state_feed, (struct xkb_compose_state *, xkb_keysym_t) ) 154SDL_WAYLAND_SYM(enum xkb_compose_status, xkb_compose_state_get_status, (struct xkb_compose_state *) ) 155SDL_WAYLAND_SYM(xkb_keysym_t, xkb_compose_state_get_one_sym, (struct xkb_compose_state *) ) 156SDL_WAYLAND_SYM(void, xkb_keymap_key_for_each, (struct xkb_keymap *, xkb_keymap_key_iter_t, void *) ) 157SDL_WAYLAND_SYM(xkb_layout_index_t, xkb_keymap_num_layouts, (struct xkb_keymap *) ) 158SDL_WAYLAND_SYM(int, xkb_keymap_key_get_syms_by_level, (struct xkb_keymap *, xkb_keycode_t, xkb_layout_index_t, xkb_level_index_t, const xkb_keysym_t **) ) 159SDL_WAYLAND_SYM(xkb_level_index_t, xkb_keymap_num_levels_for_key, (struct xkb_keymap *, xkb_keycode_t, xkb_layout_index_t) ) 160SDL_WAYLAND_SYM(uint32_t, xkb_keysym_to_utf32, (xkb_keysym_t) ) 161SDL_WAYLAND_SYM(uint32_t, xkb_keymap_mod_get_index, (struct xkb_keymap *, const char *) ) 162SDL_WAYLAND_SYM(const char *, xkb_keymap_layout_get_name, (struct xkb_keymap *, xkb_layout_index_t)) 163 164#if SDL_XKBCOMMON_CHECK_VERSION(1, 0, 0) 165SDL_WAYLAND_SYM(size_t, xkb_keymap_key_get_mods_for_level, (struct xkb_keymap *, xkb_keycode_t, xkb_layout_index_t, xkb_level_index_t, xkb_mod_mask_t *, size_t) ) 166#else 167// Only needed in the fallback replacement for xkb_keymap_key_get_mods_for_level(). 168SDL_WAYLAND_SYM(xkb_level_index_t, xkb_state_key_get_level, (struct xkb_state *, xkb_keycode_t, xkb_layout_index_t) ) 169#endif 170 171#if SDL_XKBCOMMON_CHECK_VERSION(1, 10, 0) 172SDL_WAYLAND_SYM(xkb_mod_mask_t, xkb_keymap_mod_get_mask, (struct xkb_keymap *, const char *)) 173#endif 174 175#ifdef HAVE_LIBDECOR_H 176SDL_WAYLAND_MODULE(WAYLAND_LIBDECOR) 177 178#if defined(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR) || SDL_LIBDECOR_CHECK_VERSION(0, 3, 0) 179#define SDL_libdecor_constsince03 const 180#else 181#define SDL_libdecor_constsince03 /* nothing */ 182#endif 183 184SDL_WAYLAND_SYM(void, libdecor_unref, (struct libdecor *)) 185SDL_WAYLAND_SYM(struct libdecor *, libdecor_new, (struct wl_display *,\ 186 SDL_libdecor_constsince03 struct libdecor_interface *)) 187SDL_WAYLAND_SYM(struct libdecor_frame *, libdecor_decorate, (struct libdecor *,\ 188 struct wl_surface *,\ 189 SDL_libdecor_constsince03 struct libdecor_frame_interface *,\ 190 void *)) 191SDL_WAYLAND_SYM(void, libdecor_frame_unref, (struct libdecor_frame *)) 192SDL_WAYLAND_SYM(void, libdecor_frame_set_title, (struct libdecor_frame *, const char *)) 193SDL_WAYLAND_SYM(void, libdecor_frame_set_app_id, (struct libdecor_frame *, const char *)) 194SDL_WAYLAND_SYM(void, libdecor_frame_set_max_content_size, (struct libdecor_frame *frame,\ 195 int content_width,\ 196 int content_height)) 197SDL_WAYLAND_SYM(void, libdecor_frame_set_min_content_size, (struct libdecor_frame *frame,\ 198 int content_width,\ 199 int content_height)) 200SDL_WAYLAND_SYM(void, libdecor_frame_resize, (struct libdecor_frame *,\ 201 struct wl_seat *,\ 202 uint32_t,\ 203 enum libdecor_resize_edge)) 204SDL_WAYLAND_SYM(void, libdecor_frame_move, (struct libdecor_frame *,\ 205 struct wl_seat *,\ 206 uint32_t)) 207SDL_WAYLAND_SYM(void, libdecor_frame_commit, (struct libdecor_frame *,\ 208 struct libdecor_state *,\ 209 struct libdecor_configuration *)) 210SDL_WAYLAND_SYM(void, libdecor_frame_set_minimized, (struct libdecor_frame *)) 211SDL_WAYLAND_SYM(void, libdecor_frame_set_maximized, (struct libdecor_frame *)) 212SDL_WAYLAND_SYM(void, libdecor_frame_unset_maximized, (struct libdecor_frame *)) 213SDL_WAYLAND_SYM(void, libdecor_frame_set_fullscreen, (struct libdecor_frame *, struct wl_output *)) 214SDL_WAYLAND_SYM(void, libdecor_frame_unset_fullscreen, (struct libdecor_frame *)) 215SDL_WAYLAND_SYM(void, libdecor_frame_set_capabilities, (struct libdecor_frame *, \ 216 enum libdecor_capabilities)) 217SDL_WAYLAND_SYM(void, libdecor_frame_unset_capabilities, (struct libdecor_frame *, \ 218 enum libdecor_capabilities)) 219SDL_WAYLAND_SYM(bool, libdecor_frame_has_capability, (struct libdecor_frame *, \ 220 enum libdecor_capabilities)) 221SDL_WAYLAND_SYM(void, libdecor_frame_set_visibility, (struct libdecor_frame *, bool)) 222SDL_WAYLAND_SYM(bool, libdecor_frame_is_visible, (struct libdecor_frame *)) 223SDL_WAYLAND_SYM(bool, libdecor_frame_is_floating, (struct libdecor_frame *)) 224SDL_WAYLAND_SYM(void, libdecor_frame_set_parent, (struct libdecor_frame *,\ 225 struct libdecor_frame *)) 226SDL_WAYLAND_SYM(void, libdecor_frame_show_window_menu, (struct libdecor_frame *, struct wl_seat *, uint32_t, int, int)) 227SDL_WAYLAND_SYM(struct xdg_surface *, libdecor_frame_get_xdg_surface, (struct libdecor_frame *)) 228SDL_WAYLAND_SYM(struct xdg_toplevel *, libdecor_frame_get_xdg_toplevel, (struct libdecor_frame *)) 229SDL_WAYLAND_SYM(void, libdecor_frame_translate_coordinate, (struct libdecor_frame *, int, int, int *, int *)) 230SDL_WAYLAND_SYM(void, libdecor_frame_map, (struct libdecor_frame *)) 231SDL_WAYLAND_SYM(struct libdecor_state *, libdecor_state_new, (int, int)) 232SDL_WAYLAND_SYM(void, libdecor_state_free, (struct libdecor_state *)) 233SDL_WAYLAND_SYM(bool, libdecor_configuration_get_content_size, (struct libdecor_configuration *,\ 234 struct libdecor_frame *,\ 235 int *,\ 236 int *)) 237SDL_WAYLAND_SYM(bool, libdecor_configuration_get_window_state, (struct libdecor_configuration *,\ 238 enum libdecor_window_state *)) 239SDL_WAYLAND_SYM(int, libdecor_dispatch, (struct libdecor *, int)) 240 241#if defined(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR) || SDL_LIBDECOR_CHECK_VERSION(0, 2, 0) 242// Only found in libdecor 0.1.1 or higher, so failure to load them is not fatal. 243SDL_WAYLAND_SYM_OPT(void, libdecor_frame_get_min_content_size, (const struct libdecor_frame *,\ 244 int *,\ 245 int *)) 246SDL_WAYLAND_SYM_OPT(void, libdecor_frame_get_max_content_size, (const struct libdecor_frame *,\ 247 int *,\ 248 int *)) 249#endif 250 251#if defined(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR) || SDL_LIBDECOR_CHECK_VERSION(0, 3, 0) 252SDL_WAYLAND_SYM_OPT(enum libdecor_wm_capabilities, libdecor_frame_get_wm_capabilities, (struct libdecor_frame *)) 253#endif 254 255#undef SDL_libdecor_constsince03 256 257#endif 258 259#undef SDL_WAYLAND_MODULE 260#undef SDL_WAYLAND_SYM 261#undef SDL_WAYLAND_SYM_OPT 262#undef SDL_WAYLAND_INTERFACE 263 264/* *INDENT-ON* */ // clang-format on 265[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.