ScrapExplorer - wl_platform.h

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