Atlas - wl_platform.h
Home / ext / glfw / src Lines: 1 | Size: 37183 bytes [Download] [Show on GitHub] [Search similar files] [Raw] [Raw (proxy)][FILE BEGIN]1//======================================================================== 2// GLFW 3.5 Wayland - www.glfw.org 3//------------------------------------------------------------------------ 4// Copyright (c) 2014 Jonas Ã…dahl <[email protected]> 5// 6// This software is provided 'as-is', without any express or implied 7// warranty. In no event will the authors be held liable for any damages 8// arising from the use of this software. 9// 10// Permission is granted to anyone to use this software for any purpose, 11// including commercial applications, and to alter it and redistribute it 12// freely, subject to the following restrictions: 13// 14// 1. The origin of this software must not be misrepresented; you must not 15// claim that you wrote the original software. If you use this software 16// in a product, an acknowledgment in the product documentation would 17// be appreciated but is not required. 18// 19// 2. Altered source versions must be plainly marked as such, and must not 20// be misrepresented as being the original software. 21// 22// 3. This notice may not be removed or altered from any source 23// distribution. 24// 25//======================================================================== 26 27#include <wayland-client-core.h> 28#include <xkbcommon/xkbcommon.h> 29#include <xkbcommon/xkbcommon-compose.h> 30 31typedef VkFlags VkWaylandSurfaceCreateFlagsKHR; 32 33typedef struct VkWaylandSurfaceCreateInfoKHR 34{ 35 VkStructureType sType; 36 const void* pNext; 37 VkWaylandSurfaceCreateFlagsKHR flags; 38 struct wl_display* display; 39 struct wl_surface* surface; 40} VkWaylandSurfaceCreateInfoKHR; 41 42typedef VkResult (APIENTRY *PFN_vkCreateWaylandSurfaceKHR)(VkInstance,const VkWaylandSurfaceCreateInfoKHR*,const VkAllocationCallbacks*,VkSurfaceKHR*); 43typedef VkBool32 (APIENTRY *PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR)(VkPhysicalDevice,uint32_t,struct wl_display*); 44 45typedef int (* PFN_wl_display_flush)(struct wl_display* display); 46typedef void (* PFN_wl_display_cancel_read)(struct wl_display* display); 47typedef int (* PFN_wl_display_dispatch_pending)(struct wl_display* display); 48typedef int (* PFN_wl_display_read_events)(struct wl_display* display); 49typedef struct wl_display* (* PFN_wl_display_connect)(const char*); 50typedef void (* PFN_wl_display_disconnect)(struct wl_display*); 51typedef int (* PFN_wl_display_roundtrip)(struct wl_display*); 52typedef int (* PFN_wl_display_get_fd)(struct wl_display*); 53typedef int (* PFN_wl_display_prepare_read)(struct wl_display*); 54typedef struct wl_event_queue* (* PFN_wl_display_create_queue)(struct wl_display*); 55typedef void (* PFN_wl_event_queue_destroy)(struct wl_event_queue*); 56typedef int (* PFN_wl_display_prepare_read_queue)(struct wl_display*,struct wl_event_queue*); 57typedef int (* PFN_wl_display_dispatch_queue_pending)(struct wl_display*,struct wl_event_queue*); 58typedef void (* PFN_wl_proxy_marshal)(struct wl_proxy*,uint32_t,...); 59typedef int (* PFN_wl_proxy_add_listener)(struct wl_proxy*,void(**)(void),void*); 60typedef void (* PFN_wl_proxy_destroy)(struct wl_proxy*); 61typedef struct wl_proxy* (* PFN_wl_proxy_marshal_constructor)(struct wl_proxy*,uint32_t,const struct wl_interface*,...); 62typedef struct wl_proxy* (* PFN_wl_proxy_marshal_constructor_versioned)(struct wl_proxy*,uint32_t,const struct wl_interface*,uint32_t,...); 63typedef void* (* PFN_wl_proxy_get_user_data)(struct wl_proxy*); 64typedef void (* PFN_wl_proxy_set_user_data)(struct wl_proxy*,void*); 65typedef void (* PFN_wl_proxy_set_tag)(struct wl_proxy*,const char*const*); 66typedef const char* const* (* PFN_wl_proxy_get_tag)(struct wl_proxy*); 67typedef uint32_t (* PFN_wl_proxy_get_version)(struct wl_proxy*); 68typedef struct wl_proxy* (* PFN_wl_proxy_marshal_flags)(struct wl_proxy*,uint32_t,const struct wl_interface*,uint32_t,uint32_t,...); 69typedef void* (* PFN_wl_proxy_create_wrapper)(void*); 70typedef void (* PFN_wl_proxy_wrapper_destroy)(void*); 71typedef void (* PFN_wl_proxy_set_queue)(struct wl_proxy*,struct wl_event_queue*); 72#define wl_display_flush _glfw.wl.client.display_flush 73#define wl_display_cancel_read _glfw.wl.client.display_cancel_read 74#define wl_display_dispatch_pending _glfw.wl.client.display_dispatch_pending 75#define wl_display_read_events _glfw.wl.client.display_read_events 76#define wl_display_disconnect _glfw.wl.client.display_disconnect 77#define wl_display_roundtrip _glfw.wl.client.display_roundtrip 78#define wl_display_get_fd _glfw.wl.client.display_get_fd 79#define wl_display_prepare_read _glfw.wl.client.display_prepare_read 80#define wl_display_create_queue _glfw.wl.client.display_create_queue 81#define wl_display_prepare_read_queue _glfw.wl.client.display_prepare_read_queue 82#define wl_display_dispatch_queue_pending _glfw.wl.client.display_dispatch_queue_pending 83#define wl_event_queue_destroy _glfw.wl.client.event_queue_destroy 84#define wl_proxy_marshal _glfw.wl.client.proxy_marshal 85#define wl_proxy_add_listener _glfw.wl.client.proxy_add_listener 86#define wl_proxy_destroy _glfw.wl.client.proxy_destroy 87#define wl_proxy_marshal_constructor _glfw.wl.client.proxy_marshal_constructor 88#define wl_proxy_marshal_constructor_versioned _glfw.wl.client.proxy_marshal_constructor_versioned 89#define wl_proxy_get_user_data _glfw.wl.client.proxy_get_user_data 90#define wl_proxy_set_user_data _glfw.wl.client.proxy_set_user_data 91#define wl_proxy_get_tag _glfw.wl.client.proxy_get_tag 92#define wl_proxy_set_tag _glfw.wl.client.proxy_set_tag 93#define wl_proxy_get_version _glfw.wl.client.proxy_get_version 94#define wl_proxy_marshal_flags _glfw.wl.client.proxy_marshal_flags 95#define wl_proxy_create_wrapper _glfw.wl.client.proxy_create_wrapper 96#define wl_proxy_wrapper_destroy _glfw.wl.client.proxy_wrapper_destroy 97#define wl_proxy_set_queue _glfw.wl.client.proxy_set_queue 98 99struct wl_shm; 100struct wl_output; 101 102#define wl_display_interface _glfw_wl_display_interface 103#define wl_subcompositor_interface _glfw_wl_subcompositor_interface 104#define wl_compositor_interface _glfw_wl_compositor_interface 105#define wl_shm_interface _glfw_wl_shm_interface 106#define wl_data_device_manager_interface _glfw_wl_data_device_manager_interface 107#define wl_shell_interface _glfw_wl_shell_interface 108#define wl_buffer_interface _glfw_wl_buffer_interface 109#define wl_callback_interface _glfw_wl_callback_interface 110#define wl_data_device_interface _glfw_wl_data_device_interface 111#define wl_data_offer_interface _glfw_wl_data_offer_interface 112#define wl_data_source_interface _glfw_wl_data_source_interface 113#define wl_keyboard_interface _glfw_wl_keyboard_interface 114#define wl_output_interface _glfw_wl_output_interface 115#define wl_pointer_interface _glfw_wl_pointer_interface 116#define wl_region_interface _glfw_wl_region_interface 117#define wl_registry_interface _glfw_wl_registry_interface 118#define wl_seat_interface _glfw_wl_seat_interface 119#define wl_shell_surface_interface _glfw_wl_shell_surface_interface 120#define wl_shm_pool_interface _glfw_wl_shm_pool_interface 121#define wl_subsurface_interface _glfw_wl_subsurface_interface 122#define wl_surface_interface _glfw_wl_surface_interface 123#define wl_touch_interface _glfw_wl_touch_interface 124#define zwp_idle_inhibitor_v1_interface _glfw_zwp_idle_inhibitor_v1_interface 125#define zwp_idle_inhibit_manager_v1_interface _glfw_zwp_idle_inhibit_manager_v1_interface 126#define zwp_confined_pointer_v1_interface _glfw_zwp_confined_pointer_v1_interface 127#define zwp_locked_pointer_v1_interface _glfw_zwp_locked_pointer_v1_interface 128#define zwp_pointer_constraints_v1_interface _glfw_zwp_pointer_constraints_v1_interface 129#define zwp_relative_pointer_v1_interface _glfw_zwp_relative_pointer_v1_interface 130#define zwp_relative_pointer_manager_v1_interface _glfw_zwp_relative_pointer_manager_v1_interface 131#define wp_viewport_interface _glfw_wp_viewport_interface 132#define wp_viewporter_interface _glfw_wp_viewporter_interface 133#define xdg_toplevel_interface _glfw_xdg_toplevel_interface 134#define zxdg_toplevel_decoration_v1_interface _glfw_zxdg_toplevel_decoration_v1_interface 135#define zxdg_decoration_manager_v1_interface _glfw_zxdg_decoration_manager_v1_interface 136#define xdg_popup_interface _glfw_xdg_popup_interface 137#define xdg_positioner_interface _glfw_xdg_positioner_interface 138#define xdg_surface_interface _glfw_xdg_surface_interface 139#define xdg_toplevel_interface _glfw_xdg_toplevel_interface 140#define xdg_wm_base_interface _glfw_xdg_wm_base_interface 141#define xdg_activation_v1_interface _glfw_xdg_activation_v1_interface 142#define xdg_activation_token_v1_interface _glfw_xdg_activation_token_v1_interface 143#define wl_surface_interface _glfw_wl_surface_interface 144#define wp_fractional_scale_v1_interface _glfw_wp_fractional_scale_v1_interface 145 146#define GLFW_WAYLAND_WINDOW_STATE _GLFWwindowWayland wl; 147#define GLFW_WAYLAND_LIBRARY_WINDOW_STATE _GLFWlibraryWayland wl; 148#define GLFW_WAYLAND_MONITOR_STATE _GLFWmonitorWayland wl; 149#define GLFW_WAYLAND_CURSOR_STATE _GLFWcursorWayland wl; 150 151struct wl_cursor_image 152{ 153 uint32_t width; 154 uint32_t height; 155 uint32_t hotspot_x; 156 uint32_t hotspot_y; 157 uint32_t delay; 158}; 159 160struct wl_cursor 161{ 162 unsigned int image_count; 163 struct wl_cursor_image** images; 164 char* name; 165}; 166 167typedef struct wl_cursor_theme* (* PFN_wl_cursor_theme_load)(const char*, int, struct wl_shm*); 168typedef void (* PFN_wl_cursor_theme_destroy)(struct wl_cursor_theme*); 169typedef struct wl_cursor* (* PFN_wl_cursor_theme_get_cursor)(struct wl_cursor_theme*, const char*); 170typedef struct wl_buffer* (* PFN_wl_cursor_image_get_buffer)(struct wl_cursor_image*); 171#define wl_cursor_theme_load _glfw.wl.cursor.theme_load 172#define wl_cursor_theme_destroy _glfw.wl.cursor.theme_destroy 173#define wl_cursor_theme_get_cursor _glfw.wl.cursor.theme_get_cursor 174#define wl_cursor_image_get_buffer _glfw.wl.cursor.image_get_buffer 175 176typedef struct wl_egl_window* (* PFN_wl_egl_window_create)(struct wl_surface*, int, int); 177typedef void (* PFN_wl_egl_window_destroy)(struct wl_egl_window*); 178typedef void (* PFN_wl_egl_window_resize)(struct wl_egl_window*, int, int, int, int); 179#define wl_egl_window_create _glfw.wl.egl.window_create 180#define wl_egl_window_destroy _glfw.wl.egl.window_destroy 181#define wl_egl_window_resize _glfw.wl.egl.window_resize 182 183typedef struct xkb_context* (* PFN_xkb_context_new)(enum xkb_context_flags); 184typedef void (* PFN_xkb_context_unref)(struct xkb_context*); 185typedef struct xkb_keymap* (* PFN_xkb_keymap_new_from_string)(struct xkb_context*, const char*, enum xkb_keymap_format, enum xkb_keymap_compile_flags); 186typedef void (* PFN_xkb_keymap_unref)(struct xkb_keymap*); 187typedef xkb_mod_index_t (* PFN_xkb_keymap_mod_get_index)(struct xkb_keymap*, const char*); 188typedef int (* PFN_xkb_keymap_key_repeats)(struct xkb_keymap*, xkb_keycode_t); 189typedef int (* PFN_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**); 190typedef struct xkb_state* (* PFN_xkb_state_new)(struct xkb_keymap*); 191typedef void (* PFN_xkb_state_unref)(struct xkb_state*); 192typedef int (* PFN_xkb_state_key_get_syms)(struct xkb_state*, xkb_keycode_t, const xkb_keysym_t**); 193typedef enum xkb_state_component (* PFN_xkb_state_update_mask)(struct xkb_state*, xkb_mod_mask_t, xkb_mod_mask_t, xkb_mod_mask_t, xkb_layout_index_t, xkb_layout_index_t, xkb_layout_index_t); 194typedef xkb_layout_index_t (* PFN_xkb_state_key_get_layout)(struct xkb_state*,xkb_keycode_t); 195typedef int (* PFN_xkb_state_mod_index_is_active)(struct xkb_state*,xkb_mod_index_t,enum xkb_state_component); 196typedef uint32_t (* PFN_xkb_keysym_to_utf32)(xkb_keysym_t); 197typedef int (* PFN_xkb_keysym_to_utf8)(xkb_keysym_t, char*, size_t); 198#define xkb_context_new _glfw.wl.xkb.context_new 199#define xkb_context_unref _glfw.wl.xkb.context_unref 200#define xkb_keymap_new_from_string _glfw.wl.xkb.keymap_new_from_string 201#define xkb_keymap_unref _glfw.wl.xkb.keymap_unref 202#define xkb_keymap_mod_get_index _glfw.wl.xkb.keymap_mod_get_index 203#define xkb_keymap_key_repeats _glfw.wl.xkb.keymap_key_repeats 204#define xkb_keymap_key_get_syms_by_level _glfw.wl.xkb.keymap_key_get_syms_by_level 205#define xkb_state_new _glfw.wl.xkb.state_new 206#define xkb_state_unref _glfw.wl.xkb.state_unref 207#define xkb_state_key_get_syms _glfw.wl.xkb.state_key_get_syms 208#define xkb_state_update_mask _glfw.wl.xkb.state_update_mask 209#define xkb_state_key_get_layout _glfw.wl.xkb.state_key_get_layout 210#define xkb_state_mod_index_is_active _glfw.wl.xkb.state_mod_index_is_active 211#define xkb_keysym_to_utf32 _glfw.wl.xkb.keysym_to_utf32 212#define xkb_keysym_to_utf8 _glfw.wl.xkb.keysym_to_utf8 213 214typedef struct xkb_compose_table* (* PFN_xkb_compose_table_new_from_locale)(struct xkb_context*, const char*, enum xkb_compose_compile_flags); 215typedef void (* PFN_xkb_compose_table_unref)(struct xkb_compose_table*); 216typedef struct xkb_compose_state* (* PFN_xkb_compose_state_new)(struct xkb_compose_table*, enum xkb_compose_state_flags); 217typedef void (* PFN_xkb_compose_state_unref)(struct xkb_compose_state*); 218typedef enum xkb_compose_feed_result (* PFN_xkb_compose_state_feed)(struct xkb_compose_state*, xkb_keysym_t); 219typedef enum xkb_compose_status (* PFN_xkb_compose_state_get_status)(struct xkb_compose_state*); 220typedef xkb_keysym_t (* PFN_xkb_compose_state_get_one_sym)(struct xkb_compose_state*); 221#define xkb_compose_table_new_from_locale _glfw.wl.xkb.compose_table_new_from_locale 222#define xkb_compose_table_unref _glfw.wl.xkb.compose_table_unref 223#define xkb_compose_state_new _glfw.wl.xkb.compose_state_new 224#define xkb_compose_state_unref _glfw.wl.xkb.compose_state_unref 225#define xkb_compose_state_feed _glfw.wl.xkb.compose_state_feed 226#define xkb_compose_state_get_status _glfw.wl.xkb.compose_state_get_status 227#define xkb_compose_state_get_one_sym _glfw.wl.xkb.compose_state_get_one_sym 228 229struct libdecor; 230struct libdecor_frame; 231struct libdecor_state; 232struct libdecor_configuration; 233 234enum libdecor_error 235{ 236 LIBDECOR_ERROR_COMPOSITOR_INCOMPATIBLE, 237 LIBDECOR_ERROR_INVALID_FRAME_CONFIGURATION, 238}; 239 240enum libdecor_window_state 241{ 242 LIBDECOR_WINDOW_STATE_NONE = 0, 243 LIBDECOR_WINDOW_STATE_ACTIVE = 1, 244 LIBDECOR_WINDOW_STATE_MAXIMIZED = 2, 245 LIBDECOR_WINDOW_STATE_FULLSCREEN = 4, 246 LIBDECOR_WINDOW_STATE_TILED_LEFT = 8, 247 LIBDECOR_WINDOW_STATE_TILED_RIGHT = 16, 248 LIBDECOR_WINDOW_STATE_TILED_TOP = 32, 249 LIBDECOR_WINDOW_STATE_TILED_BOTTOM = 64 250}; 251 252enum libdecor_capabilities 253{ 254 LIBDECOR_ACTION_MOVE = 1, 255 LIBDECOR_ACTION_RESIZE = 2, 256 LIBDECOR_ACTION_MINIMIZE = 4, 257 LIBDECOR_ACTION_FULLSCREEN = 8, 258 LIBDECOR_ACTION_CLOSE = 16 259}; 260 261struct libdecor_interface 262{ 263 void (* error)(struct libdecor*,enum libdecor_error,const char*); 264 void (* reserved0)(void); 265 void (* reserved1)(void); 266 void (* reserved2)(void); 267 void (* reserved3)(void); 268 void (* reserved4)(void); 269 void (* reserved5)(void); 270 void (* reserved6)(void); 271 void (* reserved7)(void); 272 void (* reserved8)(void); 273 void (* reserved9)(void); 274}; 275 276struct libdecor_frame_interface 277{ 278 void (* configure)(struct libdecor_frame*,struct libdecor_configuration*,void*); 279 void (* close)(struct libdecor_frame*,void*); 280 void (* commit)(struct libdecor_frame*,void*); 281 void (* dismiss_popup)(struct libdecor_frame*,const char*,void*); 282 void (* reserved0)(void); 283 void (* reserved1)(void); 284 void (* reserved2)(void); 285 void (* reserved3)(void); 286 void (* reserved4)(void); 287 void (* reserved5)(void); 288 void (* reserved6)(void); 289 void (* reserved7)(void); 290 void (* reserved8)(void); 291 void (* reserved9)(void); 292}; 293 294typedef struct libdecor* (* PFN_libdecor_new)(struct wl_display*,const struct libdecor_interface*); 295typedef void (* PFN_libdecor_unref)(struct libdecor*); 296typedef int (* PFN_libdecor_get_fd)(struct libdecor*); 297typedef int (* PFN_libdecor_dispatch)(struct libdecor*,int); 298typedef struct libdecor_frame* (* PFN_libdecor_decorate)(struct libdecor*,struct wl_surface*,const struct libdecor_frame_interface*,void*); 299typedef void (* PFN_libdecor_frame_unref)(struct libdecor_frame*); 300typedef void (* PFN_libdecor_frame_set_app_id)(struct libdecor_frame*,const char*); 301typedef void (* PFN_libdecor_frame_set_title)(struct libdecor_frame*,const char*); 302typedef void (* PFN_libdecor_frame_set_minimized)(struct libdecor_frame*); 303typedef void (* PFN_libdecor_frame_set_fullscreen)(struct libdecor_frame*,struct wl_output*); 304typedef void (* PFN_libdecor_frame_unset_fullscreen)(struct libdecor_frame*); 305typedef void (* PFN_libdecor_frame_map)(struct libdecor_frame*); 306typedef void (* PFN_libdecor_frame_commit)(struct libdecor_frame*,struct libdecor_state*,struct libdecor_configuration*); 307typedef void (* PFN_libdecor_frame_set_min_content_size)(struct libdecor_frame*,int,int); 308typedef void (* PFN_libdecor_frame_set_max_content_size)(struct libdecor_frame*,int,int); 309typedef void (* PFN_libdecor_frame_set_maximized)(struct libdecor_frame*); 310typedef void (* PFN_libdecor_frame_unset_maximized)(struct libdecor_frame*); 311typedef void (* PFN_libdecor_frame_set_capabilities)(struct libdecor_frame*,enum libdecor_capabilities); 312typedef void (* PFN_libdecor_frame_unset_capabilities)(struct libdecor_frame*,enum libdecor_capabilities); 313typedef void (* PFN_libdecor_frame_set_visibility)(struct libdecor_frame*,bool visible); 314typedef struct xdg_toplevel* (* PFN_libdecor_frame_get_xdg_toplevel)(struct libdecor_frame*); 315typedef bool (* PFN_libdecor_configuration_get_content_size)(struct libdecor_configuration*,struct libdecor_frame*,int*,int*); 316typedef bool (* PFN_libdecor_configuration_get_window_state)(struct libdecor_configuration*,enum libdecor_window_state*); 317typedef struct libdecor_state* (* PFN_libdecor_state_new)(int,int); 318typedef void (* PFN_libdecor_state_free)(struct libdecor_state*); 319#define libdecor_new _glfw.wl.libdecor.libdecor_new_ 320#define libdecor_unref _glfw.wl.libdecor.libdecor_unref_ 321#define libdecor_get_fd _glfw.wl.libdecor.libdecor_get_fd_ 322#define libdecor_dispatch _glfw.wl.libdecor.libdecor_dispatch_ 323#define libdecor_decorate _glfw.wl.libdecor.libdecor_decorate_ 324#define libdecor_frame_unref _glfw.wl.libdecor.libdecor_frame_unref_ 325#define libdecor_frame_set_app_id _glfw.wl.libdecor.libdecor_frame_set_app_id_ 326#define libdecor_frame_set_title _glfw.wl.libdecor.libdecor_frame_set_title_ 327#define libdecor_frame_set_minimized _glfw.wl.libdecor.libdecor_frame_set_minimized_ 328#define libdecor_frame_set_fullscreen _glfw.wl.libdecor.libdecor_frame_set_fullscreen_ 329#define libdecor_frame_unset_fullscreen _glfw.wl.libdecor.libdecor_frame_unset_fullscreen_ 330#define libdecor_frame_map _glfw.wl.libdecor.libdecor_frame_map_ 331#define libdecor_frame_commit _glfw.wl.libdecor.libdecor_frame_commit_ 332#define libdecor_frame_set_min_content_size _glfw.wl.libdecor.libdecor_frame_set_min_content_size_ 333#define libdecor_frame_set_max_content_size _glfw.wl.libdecor.libdecor_frame_set_max_content_size_ 334#define libdecor_frame_set_maximized _glfw.wl.libdecor.libdecor_frame_set_maximized_ 335#define libdecor_frame_unset_maximized _glfw.wl.libdecor.libdecor_frame_unset_maximized_ 336#define libdecor_frame_set_capabilities _glfw.wl.libdecor.libdecor_frame_set_capabilities_ 337#define libdecor_frame_unset_capabilities _glfw.wl.libdecor.libdecor_frame_unset_capabilities_ 338#define libdecor_frame_set_visibility _glfw.wl.libdecor.libdecor_frame_set_visibility_ 339#define libdecor_frame_get_xdg_toplevel _glfw.wl.libdecor.libdecor_frame_get_xdg_toplevel_ 340#define libdecor_configuration_get_content_size _glfw.wl.libdecor.libdecor_configuration_get_content_size_ 341#define libdecor_configuration_get_window_state _glfw.wl.libdecor.libdecor_configuration_get_window_state_ 342#define libdecor_state_new _glfw.wl.libdecor.libdecor_state_new_ 343#define libdecor_state_free _glfw.wl.libdecor.libdecor_state_free_ 344 345typedef struct _GLFWfallbackEdgeWayland 346{ 347 struct wl_surface* surface; 348 struct wl_subsurface* subsurface; 349 struct wp_viewport* viewport; 350} _GLFWfallbackEdgeWayland; 351 352typedef struct _GLFWofferWayland 353{ 354 struct wl_data_offer* offer; 355 GLFWbool text_plain_utf8; 356 GLFWbool text_uri_list; 357} _GLFWofferWayland; 358 359typedef struct _GLFWscaleWayland 360{ 361 struct wl_output* output; 362 int32_t factor; 363} _GLFWscaleWayland; 364 365// Wayland-specific per-window data 366// 367typedef struct _GLFWwindowWayland 368{ 369 int width, height; 370 int fbWidth, fbHeight; 371 GLFWbool visible; 372 GLFWbool maximized; 373 GLFWbool activated; 374 GLFWbool fullscreen; 375 GLFWbool transparent; 376 GLFWbool scaleFramebuffer; 377 struct wl_surface* surface; 378 struct wl_callback* callback; 379 380 struct { 381 struct wl_event_queue* queue; 382 struct wl_egl_window* window; 383 struct wl_callback* callback; 384 struct wl_surface* wrapper; 385 int interval; 386 } egl; 387 388 struct { 389 int width, height; 390 GLFWbool maximized; 391 GLFWbool iconified; 392 GLFWbool activated; 393 GLFWbool fullscreen; 394 } pending; 395 396 struct { 397 struct xdg_surface* surface; 398 struct xdg_toplevel* toplevel; 399 struct zxdg_toplevel_decoration_v1* decoration; 400 uint32_t decorationMode; 401 } xdg; 402 403 struct { 404 struct libdecor_frame* frame; 405 } libdecor; 406 407 double cursorPosX, cursorPosY; 408 409 char* appId; 410 411 // We need to track the monitors the window spans on to calculate the 412 // optimal scaling factor. 413 int32_t bufferScale; 414 _GLFWscaleWayland* outputScales; 415 size_t outputScaleCount; 416 size_t outputScaleSize; 417 418 struct wp_viewport* scalingViewport; 419 uint32_t scalingNumerator; 420 struct wp_fractional_scale_v1* fractionalScale; 421 422 struct zwp_relative_pointer_v1* relativePointer; 423 struct zwp_locked_pointer_v1* lockedPointer; 424 struct zwp_confined_pointer_v1* confinedPointer; 425 426 struct zwp_idle_inhibitor_v1* idleInhibitor; 427 struct xdg_activation_token_v1* activationToken; 428 429 struct { 430 GLFWbool decorations; 431 struct wl_buffer* buffer; 432 _GLFWfallbackEdgeWayland top, left, right, bottom; 433 double pointerX, pointerY; 434 uint32_t buttonPressSerial; 435 const char* cursorName; 436 } fallback; 437} _GLFWwindowWayland; 438 439// Wayland-specific global data 440// 441typedef struct _GLFWlibraryWayland 442{ 443 struct wl_display* display; 444 struct wl_registry* registry; 445 struct wl_compositor* compositor; 446 struct wl_subcompositor* subcompositor; 447 struct wl_shm* shm; 448 struct wl_seat* seat; 449 struct wl_pointer* pointer; 450 struct wl_keyboard* keyboard; 451 struct wl_data_device_manager* dataDeviceManager; 452 struct wl_data_device* dataDevice; 453 struct xdg_wm_base* wmBase; 454 struct zxdg_decoration_manager_v1* decorationManager; 455 struct wp_viewporter* viewporter; 456 struct zwp_relative_pointer_manager_v1* relativePointerManager; 457 struct zwp_pointer_constraints_v1* pointerConstraints; 458 struct zwp_idle_inhibit_manager_v1* idleInhibitManager; 459 struct xdg_activation_v1* activationManager; 460 struct wp_fractional_scale_manager_v1* fractionalScaleManager; 461 462 _GLFWofferWayland* offers; 463 unsigned int offerCount; 464 465 struct wl_data_offer* selectionOffer; 466 struct wl_data_source* selectionSource; 467 468 struct wl_data_offer* dragOffer; 469 _GLFWwindow* dragFocus; 470 uint32_t dragSerial; 471 472 const char* tag; 473 474 struct wl_surface* pointerSurface; 475 struct wl_cursor_theme* cursorTheme; 476 struct wl_cursor_theme* cursorThemeHiDPI; 477 struct wl_surface* cursorSurface; 478 int cursorTimerfd; 479 uint32_t serial; 480 uint32_t pointerEnterSerial; 481 482 int keyRepeatTimerfd; 483 int32_t keyRepeatRate; 484 int32_t keyRepeatDelay; 485 int keyRepeatScancode; 486 487 char* clipboardString; 488 short int keycodes[256]; 489 short int scancodes[GLFW_KEY_LAST + 1]; 490 char keynames[GLFW_KEY_LAST + 1][5]; 491 492 struct { 493 struct wl_surface* pointerSurface; 494 unsigned int events; 495 double pointerX; 496 double pointerY; 497 double scrollX; 498 double scrollY; 499 double discreteX; 500 double discreteY; 501 int button; 502 int action; 503 } pending; 504 505 struct { 506 void* handle; 507 struct xkb_context* context; 508 struct xkb_keymap* keymap; 509 struct xkb_state* state; 510 511 struct xkb_compose_state* composeState; 512 513 xkb_mod_index_t controlIndex; 514 xkb_mod_index_t altIndex; 515 xkb_mod_index_t shiftIndex; 516 xkb_mod_index_t superIndex; 517 xkb_mod_index_t capsLockIndex; 518 xkb_mod_index_t numLockIndex; 519 unsigned int modifiers; 520 521 PFN_xkb_context_new context_new; 522 PFN_xkb_context_unref context_unref; 523 PFN_xkb_keymap_new_from_string keymap_new_from_string; 524 PFN_xkb_keymap_unref keymap_unref; 525 PFN_xkb_keymap_mod_get_index keymap_mod_get_index; 526 PFN_xkb_keymap_key_repeats keymap_key_repeats; 527 PFN_xkb_keymap_key_get_syms_by_level keymap_key_get_syms_by_level; 528 PFN_xkb_state_new state_new; 529 PFN_xkb_state_unref state_unref; 530 PFN_xkb_state_key_get_syms state_key_get_syms; 531 PFN_xkb_state_update_mask state_update_mask; 532 PFN_xkb_state_key_get_layout state_key_get_layout; 533 PFN_xkb_state_mod_index_is_active state_mod_index_is_active; 534 PFN_xkb_keysym_to_utf32 keysym_to_utf32; 535 PFN_xkb_keysym_to_utf8 keysym_to_utf8; 536 537 PFN_xkb_compose_table_new_from_locale compose_table_new_from_locale; 538 PFN_xkb_compose_table_unref compose_table_unref; 539 PFN_xkb_compose_state_new compose_state_new; 540 PFN_xkb_compose_state_unref compose_state_unref; 541 PFN_xkb_compose_state_feed compose_state_feed; 542 PFN_xkb_compose_state_get_status compose_state_get_status; 543 PFN_xkb_compose_state_get_one_sym compose_state_get_one_sym; 544 } xkb; 545 546 _GLFWwindow* keyboardFocus; 547 548 struct { 549 void* handle; 550 PFN_wl_display_flush display_flush; 551 PFN_wl_display_cancel_read display_cancel_read; 552 PFN_wl_display_dispatch_pending display_dispatch_pending; 553 PFN_wl_display_read_events display_read_events; 554 PFN_wl_display_disconnect display_disconnect; 555 PFN_wl_display_roundtrip display_roundtrip; 556 PFN_wl_display_get_fd display_get_fd; 557 PFN_wl_display_prepare_read display_prepare_read; 558 PFN_wl_display_create_queue display_create_queue; 559 PFN_wl_display_prepare_read_queue display_prepare_read_queue; 560 PFN_wl_display_dispatch_queue_pending display_dispatch_queue_pending; 561 PFN_wl_event_queue_destroy event_queue_destroy; 562 PFN_wl_proxy_marshal proxy_marshal; 563 PFN_wl_proxy_add_listener proxy_add_listener; 564 PFN_wl_proxy_destroy proxy_destroy; 565 PFN_wl_proxy_marshal_constructor proxy_marshal_constructor; 566 PFN_wl_proxy_marshal_constructor_versioned proxy_marshal_constructor_versioned; 567 PFN_wl_proxy_get_user_data proxy_get_user_data; 568 PFN_wl_proxy_set_user_data proxy_set_user_data; 569 PFN_wl_proxy_get_tag proxy_get_tag; 570 PFN_wl_proxy_set_tag proxy_set_tag; 571 PFN_wl_proxy_get_version proxy_get_version; 572 PFN_wl_proxy_marshal_flags proxy_marshal_flags; 573 PFN_wl_proxy_create_wrapper proxy_create_wrapper; 574 PFN_wl_proxy_wrapper_destroy proxy_wrapper_destroy; 575 PFN_wl_proxy_set_queue proxy_set_queue; 576 } client; 577 578 struct { 579 void* handle; 580 581 PFN_wl_cursor_theme_load theme_load; 582 PFN_wl_cursor_theme_destroy theme_destroy; 583 PFN_wl_cursor_theme_get_cursor theme_get_cursor; 584 PFN_wl_cursor_image_get_buffer image_get_buffer; 585 } cursor; 586 587 struct { 588 void* handle; 589 590 PFN_wl_egl_window_create window_create; 591 PFN_wl_egl_window_destroy window_destroy; 592 PFN_wl_egl_window_resize window_resize; 593 } egl; 594 595 struct { 596 void* handle; 597 struct libdecor* context; 598 struct wl_callback* callback; 599 GLFWbool ready; 600 PFN_libdecor_new libdecor_new_; 601 PFN_libdecor_unref libdecor_unref_; 602 PFN_libdecor_get_fd libdecor_get_fd_; 603 PFN_libdecor_dispatch libdecor_dispatch_; 604 PFN_libdecor_decorate libdecor_decorate_; 605 PFN_libdecor_frame_unref libdecor_frame_unref_; 606 PFN_libdecor_frame_set_app_id libdecor_frame_set_app_id_; 607 PFN_libdecor_frame_set_title libdecor_frame_set_title_; 608 PFN_libdecor_frame_set_minimized libdecor_frame_set_minimized_; 609 PFN_libdecor_frame_set_fullscreen libdecor_frame_set_fullscreen_; 610 PFN_libdecor_frame_unset_fullscreen libdecor_frame_unset_fullscreen_; 611 PFN_libdecor_frame_map libdecor_frame_map_; 612 PFN_libdecor_frame_commit libdecor_frame_commit_; 613 PFN_libdecor_frame_set_min_content_size libdecor_frame_set_min_content_size_; 614 PFN_libdecor_frame_set_max_content_size libdecor_frame_set_max_content_size_; 615 PFN_libdecor_frame_set_maximized libdecor_frame_set_maximized_; 616 PFN_libdecor_frame_unset_maximized libdecor_frame_unset_maximized_; 617 PFN_libdecor_frame_set_capabilities libdecor_frame_set_capabilities_; 618 PFN_libdecor_frame_unset_capabilities libdecor_frame_unset_capabilities_; 619 PFN_libdecor_frame_set_visibility libdecor_frame_set_visibility_; 620 PFN_libdecor_frame_get_xdg_toplevel libdecor_frame_get_xdg_toplevel_; 621 PFN_libdecor_configuration_get_content_size libdecor_configuration_get_content_size_; 622 PFN_libdecor_configuration_get_window_state libdecor_configuration_get_window_state_; 623 PFN_libdecor_state_new libdecor_state_new_; 624 PFN_libdecor_state_free libdecor_state_free_; 625 } libdecor; 626} _GLFWlibraryWayland; 627 628// Wayland-specific per-monitor data 629// 630typedef struct _GLFWmonitorWayland 631{ 632 struct wl_output* output; 633 uint32_t name; 634 int currentMode; 635 636 int x; 637 int y; 638 int32_t scale; 639} _GLFWmonitorWayland; 640 641// Wayland-specific per-cursor data 642// 643typedef struct _GLFWcursorWayland 644{ 645 struct wl_cursor* cursor; 646 struct wl_cursor* cursorHiDPI; 647 struct wl_buffer* buffer; 648 int width, height; 649 int xhot, yhot; 650 int currentImage; 651} _GLFWcursorWayland; 652 653GLFWbool _glfwConnectWayland(int platformID, _GLFWplatform* platform); 654int _glfwInitWayland(void); 655void _glfwTerminateWayland(void); 656 657GLFWbool _glfwCreateWindowWayland(_GLFWwindow* window, const _GLFWwndconfig* wndconfig, const _GLFWctxconfig* ctxconfig, const _GLFWfbconfig* fbconfig); 658void _glfwDestroyWindowWayland(_GLFWwindow* window); 659void _glfwSetWindowTitleWayland(_GLFWwindow* window, const char* title); 660void _glfwSetWindowIconWayland(_GLFWwindow* window, int count, const GLFWimage* images); 661void _glfwGetWindowPosWayland(_GLFWwindow* window, int* xpos, int* ypos); 662void _glfwSetWindowPosWayland(_GLFWwindow* window, int xpos, int ypos); 663void _glfwGetWindowSizeWayland(_GLFWwindow* window, int* width, int* height); 664void _glfwSetWindowSizeWayland(_GLFWwindow* window, int width, int height); 665void _glfwSetWindowSizeLimitsWayland(_GLFWwindow* window, int minwidth, int minheight, int maxwidth, int maxheight); 666void _glfwSetWindowAspectRatioWayland(_GLFWwindow* window, int numer, int denom); 667void _glfwGetFramebufferSizeWayland(_GLFWwindow* window, int* width, int* height); 668void _glfwGetWindowFrameSizeWayland(_GLFWwindow* window, int* left, int* top, int* right, int* bottom); 669void _glfwGetWindowContentScaleWayland(_GLFWwindow* window, float* xscale, float* yscale); 670void _glfwIconifyWindowWayland(_GLFWwindow* window); 671void _glfwRestoreWindowWayland(_GLFWwindow* window); 672void _glfwMaximizeWindowWayland(_GLFWwindow* window); 673void _glfwShowWindowWayland(_GLFWwindow* window); 674void _glfwHideWindowWayland(_GLFWwindow* window); 675void _glfwRequestWindowAttentionWayland(_GLFWwindow* window); 676void _glfwFocusWindowWayland(_GLFWwindow* window); 677void _glfwSetWindowMonitorWayland(_GLFWwindow* window, _GLFWmonitor* monitor, int xpos, int ypos, int width, int height, int refreshRate); 678GLFWbool _glfwWindowFocusedWayland(_GLFWwindow* window); 679GLFWbool _glfwWindowIconifiedWayland(_GLFWwindow* window); 680GLFWbool _glfwWindowVisibleWayland(_GLFWwindow* window); 681GLFWbool _glfwWindowMaximizedWayland(_GLFWwindow* window); 682GLFWbool _glfwWindowHoveredWayland(_GLFWwindow* window); 683GLFWbool _glfwFramebufferTransparentWayland(_GLFWwindow* window); 684void _glfwSetWindowResizableWayland(_GLFWwindow* window, GLFWbool enabled); 685void _glfwSetWindowDecoratedWayland(_GLFWwindow* window, GLFWbool enabled); 686void _glfwSetWindowFloatingWayland(_GLFWwindow* window, GLFWbool enabled); 687float _glfwGetWindowOpacityWayland(_GLFWwindow* window); 688void _glfwSetWindowOpacityWayland(_GLFWwindow* window, float opacity); 689void _glfwSetWindowMousePassthroughWayland(_GLFWwindow* window, GLFWbool enabled); 690 691void _glfwSetRawMouseMotionWayland(_GLFWwindow* window, GLFWbool enabled); 692GLFWbool _glfwRawMouseMotionSupportedWayland(void); 693 694void _glfwPollEventsWayland(void); 695void _glfwWaitEventsWayland(void); 696void _glfwWaitEventsTimeoutWayland(double timeout); 697void _glfwPostEmptyEventWayland(void); 698 699void _glfwGetCursorPosWayland(_GLFWwindow* window, double* xpos, double* ypos); 700void _glfwSetCursorPosWayland(_GLFWwindow* window, double xpos, double ypos); 701void _glfwSetCursorModeWayland(_GLFWwindow* window, int mode); 702const char* _glfwGetScancodeNameWayland(int scancode); 703int _glfwGetKeyScancodeWayland(int key); 704GLFWbool _glfwCreateCursorWayland(_GLFWcursor* cursor, const GLFWimage* image, int xhot, int yhot); 705GLFWbool _glfwCreateStandardCursorWayland(_GLFWcursor* cursor, int shape); 706void _glfwDestroyCursorWayland(_GLFWcursor* cursor); 707void _glfwSetCursorWayland(_GLFWwindow* window, _GLFWcursor* cursor); 708void _glfwSetClipboardStringWayland(const char* string); 709const char* _glfwGetClipboardStringWayland(void); 710 711EGLenum _glfwGetEGLPlatformWayland(EGLint** attribs); 712EGLNativeDisplayType _glfwGetEGLNativeDisplayWayland(void); 713EGLNativeWindowType _glfwGetEGLNativeWindowWayland(_GLFWwindow* window); 714 715void _glfwGetRequiredInstanceExtensionsWayland(char** extensions); 716GLFWbool _glfwGetPhysicalDevicePresentationSupportWayland(VkInstance instance, VkPhysicalDevice device, uint32_t queuefamily); 717VkResult _glfwCreateWindowSurfaceWayland(VkInstance instance, _GLFWwindow* window, const VkAllocationCallbacks* allocator, VkSurfaceKHR* surface); 718 719void _glfwFreeMonitorWayland(_GLFWmonitor* monitor); 720void _glfwGetMonitorPosWayland(_GLFWmonitor* monitor, int* xpos, int* ypos); 721void _glfwGetMonitorContentScaleWayland(_GLFWmonitor* monitor, float* xscale, float* yscale); 722void _glfwGetMonitorWorkareaWayland(_GLFWmonitor* monitor, int* xpos, int* ypos, int* width, int* height); 723GLFWvidmode* _glfwGetVideoModesWayland(_GLFWmonitor* monitor, int* count); 724GLFWbool _glfwGetVideoModeWayland(_GLFWmonitor* monitor, GLFWvidmode* mode); 725GLFWbool _glfwGetGammaRampWayland(_GLFWmonitor* monitor, GLFWgammaramp* ramp); 726void _glfwSetGammaRampWayland(_GLFWmonitor* monitor, const GLFWgammaramp* ramp); 727 728void _glfwAddOutputWayland(uint32_t name, uint32_t version); 729void _glfwUpdateBufferScaleFromOutputsWayland(_GLFWwindow* window); 730 731void _glfwAddSeatListenerWayland(struct wl_seat* seat); 732void _glfwAddDataDeviceListenerWayland(struct wl_data_device* device); 733 734GLFWbool _glfwWaitForEGLFrameWayland(_GLFWwindow* window); 735 736[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.