2014-03-17 21:53:43 +00:00
|
|
|
//========================================================================
|
2019-04-16 12:43:29 +00:00
|
|
|
// GLFW 3.4 Wayland - www.glfw.org
|
2014-03-17 21:53:43 +00:00
|
|
|
//------------------------------------------------------------------------
|
|
|
|
// Copyright (c) 2014 Jonas Ådahl <jadahl@gmail.com>
|
|
|
|
//
|
|
|
|
// This software is provided 'as-is', without any express or implied
|
|
|
|
// warranty. In no event will the authors be held liable for any damages
|
|
|
|
// arising from the use of this software.
|
|
|
|
//
|
|
|
|
// Permission is granted to anyone to use this software for any purpose,
|
|
|
|
// including commercial applications, and to alter it and redistribute it
|
|
|
|
// freely, subject to the following restrictions:
|
|
|
|
//
|
|
|
|
// 1. The origin of this software must not be misrepresented; you must not
|
|
|
|
// claim that you wrote the original software. If you use this software
|
|
|
|
// in a product, an acknowledgment in the product documentation would
|
|
|
|
// be appreciated but is not required.
|
|
|
|
//
|
|
|
|
// 2. Altered source versions must be plainly marked as such, and must not
|
|
|
|
// be misrepresented as being the original software.
|
|
|
|
//
|
|
|
|
// 3. This notice may not be removed or altered from any source
|
|
|
|
// distribution.
|
|
|
|
//
|
|
|
|
//========================================================================
|
|
|
|
|
2021-07-13 16:12:43 +00:00
|
|
|
#include <wayland-client-core.h>
|
2014-06-29 21:09:21 +00:00
|
|
|
#include <xkbcommon/xkbcommon.h>
|
2016-10-10 23:02:15 +00:00
|
|
|
#include <xkbcommon/xkbcommon-compose.h>
|
2015-08-10 18:19:04 +00:00
|
|
|
|
|
|
|
typedef VkFlags VkWaylandSurfaceCreateFlagsKHR;
|
|
|
|
|
|
|
|
typedef struct VkWaylandSurfaceCreateInfoKHR
|
|
|
|
{
|
|
|
|
VkStructureType sType;
|
|
|
|
const void* pNext;
|
|
|
|
VkWaylandSurfaceCreateFlagsKHR flags;
|
|
|
|
struct wl_display* display;
|
|
|
|
struct wl_surface* surface;
|
|
|
|
} VkWaylandSurfaceCreateInfoKHR;
|
|
|
|
|
|
|
|
typedef VkResult (APIENTRY *PFN_vkCreateWaylandSurfaceKHR)(VkInstance,const VkWaylandSurfaceCreateInfoKHR*,const VkAllocationCallbacks*,VkSurfaceKHR*);
|
|
|
|
typedef VkBool32 (APIENTRY *PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR)(VkPhysicalDevice,uint32_t,struct wl_display*);
|
2014-03-19 12:21:19 +00:00
|
|
|
|
2015-05-27 13:06:52 +00:00
|
|
|
#include "xkb_unicode.h"
|
2022-03-03 20:26:11 +00:00
|
|
|
#include "posix_poll.h"
|
2014-03-17 21:53:43 +00:00
|
|
|
|
2022-03-23 17:55:22 +00:00
|
|
|
typedef int (* PFN_wl_display_flush)(struct wl_display* display);
|
|
|
|
typedef void (* PFN_wl_display_cancel_read)(struct wl_display* display);
|
|
|
|
typedef int (* PFN_wl_display_dispatch_pending)(struct wl_display* display);
|
|
|
|
typedef int (* PFN_wl_display_read_events)(struct wl_display* display);
|
2021-07-13 16:12:43 +00:00
|
|
|
typedef struct wl_display* (* PFN_wl_display_connect)(const char*);
|
|
|
|
typedef void (* PFN_wl_display_disconnect)(struct wl_display*);
|
|
|
|
typedef int (* PFN_wl_display_roundtrip)(struct wl_display*);
|
|
|
|
typedef int (* PFN_wl_display_get_fd)(struct wl_display*);
|
|
|
|
typedef int (* PFN_wl_display_prepare_read)(struct wl_display*);
|
|
|
|
typedef void (* PFN_wl_proxy_marshal)(struct wl_proxy*,uint32_t,...);
|
|
|
|
typedef int (* PFN_wl_proxy_add_listener)(struct wl_proxy*,void(**)(void),void*);
|
|
|
|
typedef void (* PFN_wl_proxy_destroy)(struct wl_proxy*);
|
|
|
|
typedef struct wl_proxy* (* PFN_wl_proxy_marshal_constructor)(struct wl_proxy*,uint32_t,const struct wl_interface*,...);
|
|
|
|
typedef struct wl_proxy* (* PFN_wl_proxy_marshal_constructor_versioned)(struct wl_proxy*,uint32_t,const struct wl_interface*,uint32_t,...);
|
|
|
|
typedef void* (* PFN_wl_proxy_get_user_data)(struct wl_proxy*);
|
|
|
|
typedef void (* PFN_wl_proxy_set_user_data)(struct wl_proxy*,void*);
|
2021-08-19 16:50:17 +00:00
|
|
|
typedef uint32_t (* PFN_wl_proxy_get_version)(struct wl_proxy*);
|
|
|
|
typedef struct wl_proxy* (* PFN_wl_proxy_marshal_flags)(struct wl_proxy*,uint32_t,const struct wl_interface*,uint32_t,uint32_t,...);
|
2021-07-13 16:12:43 +00:00
|
|
|
#define wl_display_flush _glfw.wl.client.display_flush
|
|
|
|
#define wl_display_cancel_read _glfw.wl.client.display_cancel_read
|
|
|
|
#define wl_display_dispatch_pending _glfw.wl.client.display_dispatch_pending
|
|
|
|
#define wl_display_read_events _glfw.wl.client.display_read_events
|
|
|
|
#define wl_display_disconnect _glfw.wl.client.display_disconnect
|
|
|
|
#define wl_display_roundtrip _glfw.wl.client.display_roundtrip
|
|
|
|
#define wl_display_get_fd _glfw.wl.client.display_get_fd
|
|
|
|
#define wl_display_prepare_read _glfw.wl.client.display_prepare_read
|
|
|
|
#define wl_proxy_marshal _glfw.wl.client.proxy_marshal
|
|
|
|
#define wl_proxy_add_listener _glfw.wl.client.proxy_add_listener
|
|
|
|
#define wl_proxy_destroy _glfw.wl.client.proxy_destroy
|
|
|
|
#define wl_proxy_marshal_constructor _glfw.wl.client.proxy_marshal_constructor
|
|
|
|
#define wl_proxy_marshal_constructor_versioned _glfw.wl.client.proxy_marshal_constructor_versioned
|
|
|
|
#define wl_proxy_get_user_data _glfw.wl.client.proxy_get_user_data
|
|
|
|
#define wl_proxy_set_user_data _glfw.wl.client.proxy_set_user_data
|
2021-08-19 16:50:17 +00:00
|
|
|
#define wl_proxy_get_version _glfw.wl.client.proxy_get_version
|
|
|
|
#define wl_proxy_marshal_flags _glfw.wl.client.proxy_marshal_flags
|
2021-07-13 16:12:43 +00:00
|
|
|
|
|
|
|
struct wl_shm;
|
|
|
|
|
|
|
|
#define wl_display_interface _glfw_wl_display_interface
|
|
|
|
#define wl_subcompositor_interface _glfw_wl_subcompositor_interface
|
|
|
|
#define wl_compositor_interface _glfw_wl_compositor_interface
|
|
|
|
#define wl_shm_interface _glfw_wl_shm_interface
|
|
|
|
#define wl_data_device_manager_interface _glfw_wl_data_device_manager_interface
|
|
|
|
#define wl_shell_interface _glfw_wl_shell_interface
|
|
|
|
#define wl_buffer_interface _glfw_wl_buffer_interface
|
|
|
|
#define wl_callback_interface _glfw_wl_callback_interface
|
|
|
|
#define wl_data_device_interface _glfw_wl_data_device_interface
|
|
|
|
#define wl_data_offer_interface _glfw_wl_data_offer_interface
|
|
|
|
#define wl_data_source_interface _glfw_wl_data_source_interface
|
|
|
|
#define wl_keyboard_interface _glfw_wl_keyboard_interface
|
|
|
|
#define wl_output_interface _glfw_wl_output_interface
|
|
|
|
#define wl_pointer_interface _glfw_wl_pointer_interface
|
|
|
|
#define wl_region_interface _glfw_wl_region_interface
|
|
|
|
#define wl_registry_interface _glfw_wl_registry_interface
|
|
|
|
#define wl_seat_interface _glfw_wl_seat_interface
|
|
|
|
#define wl_shell_surface_interface _glfw_wl_shell_surface_interface
|
|
|
|
#define wl_shm_pool_interface _glfw_wl_shm_pool_interface
|
|
|
|
#define wl_subsurface_interface _glfw_wl_subsurface_interface
|
|
|
|
#define wl_surface_interface _glfw_wl_surface_interface
|
|
|
|
#define wl_touch_interface _glfw_wl_touch_interface
|
|
|
|
#define zwp_idle_inhibitor_v1_interface _glfw_zwp_idle_inhibitor_v1_interface
|
|
|
|
#define zwp_idle_inhibit_manager_v1_interface _glfw_zwp_idle_inhibit_manager_v1_interface
|
|
|
|
#define zwp_confined_pointer_v1_interface _glfw_zwp_confined_pointer_v1_interface
|
|
|
|
#define zwp_locked_pointer_v1_interface _glfw_zwp_locked_pointer_v1_interface
|
|
|
|
#define zwp_pointer_constraints_v1_interface _glfw_zwp_pointer_constraints_v1_interface
|
|
|
|
#define zwp_relative_pointer_v1_interface _glfw_zwp_relative_pointer_v1_interface
|
|
|
|
#define zwp_relative_pointer_manager_v1_interface _glfw_zwp_relative_pointer_manager_v1_interface
|
|
|
|
#define wp_viewport_interface _glfw_wp_viewport_interface
|
|
|
|
#define wp_viewporter_interface _glfw_wp_viewporter_interface
|
|
|
|
#define xdg_toplevel_interface _glfw_xdg_toplevel_interface
|
|
|
|
#define zxdg_toplevel_decoration_v1_interface _glfw_zxdg_toplevel_decoration_v1_interface
|
|
|
|
#define zxdg_decoration_manager_v1_interface _glfw_zxdg_decoration_manager_v1_interface
|
|
|
|
#define xdg_popup_interface _glfw_xdg_popup_interface
|
|
|
|
#define xdg_positioner_interface _glfw_xdg_positioner_interface
|
|
|
|
#define xdg_surface_interface _glfw_xdg_surface_interface
|
|
|
|
#define xdg_toplevel_interface _glfw_xdg_toplevel_interface
|
|
|
|
#define xdg_wm_base_interface _glfw_xdg_wm_base_interface
|
2015-12-09 07:29:37 +00:00
|
|
|
|
2021-07-13 19:50:09 +00:00
|
|
|
#define GLFW_WAYLAND_WINDOW_STATE _GLFWwindowWayland wl;
|
|
|
|
#define GLFW_WAYLAND_LIBRARY_WINDOW_STATE _GLFWlibraryWayland wl;
|
|
|
|
#define GLFW_WAYLAND_MONITOR_STATE _GLFWmonitorWayland wl;
|
|
|
|
#define GLFW_WAYLAND_CURSOR_STATE _GLFWcursorWayland wl;
|
2016-03-28 11:19:31 +00:00
|
|
|
|
2018-01-05 20:58:10 +00:00
|
|
|
struct wl_cursor_image {
|
|
|
|
uint32_t width;
|
|
|
|
uint32_t height;
|
|
|
|
uint32_t hotspot_x;
|
|
|
|
uint32_t hotspot_y;
|
|
|
|
uint32_t delay;
|
|
|
|
};
|
|
|
|
struct wl_cursor {
|
|
|
|
unsigned int image_count;
|
|
|
|
struct wl_cursor_image** images;
|
|
|
|
char* name;
|
|
|
|
};
|
|
|
|
typedef struct wl_cursor_theme* (* PFN_wl_cursor_theme_load)(const char*, int, struct wl_shm*);
|
|
|
|
typedef void (* PFN_wl_cursor_theme_destroy)(struct wl_cursor_theme*);
|
|
|
|
typedef struct wl_cursor* (* PFN_wl_cursor_theme_get_cursor)(struct wl_cursor_theme*, const char*);
|
|
|
|
typedef struct wl_buffer* (* PFN_wl_cursor_image_get_buffer)(struct wl_cursor_image*);
|
|
|
|
#define wl_cursor_theme_load _glfw.wl.cursor.theme_load
|
|
|
|
#define wl_cursor_theme_destroy _glfw.wl.cursor.theme_destroy
|
|
|
|
#define wl_cursor_theme_get_cursor _glfw.wl.cursor.theme_get_cursor
|
|
|
|
#define wl_cursor_image_get_buffer _glfw.wl.cursor.image_get_buffer
|
|
|
|
|
2018-01-05 20:33:40 +00:00
|
|
|
typedef struct wl_egl_window* (* PFN_wl_egl_window_create)(struct wl_surface*, int, int);
|
|
|
|
typedef void (* PFN_wl_egl_window_destroy)(struct wl_egl_window*);
|
|
|
|
typedef void (* PFN_wl_egl_window_resize)(struct wl_egl_window*, int, int, int, int);
|
|
|
|
#define wl_egl_window_create _glfw.wl.egl.window_create
|
|
|
|
#define wl_egl_window_destroy _glfw.wl.egl.window_destroy
|
|
|
|
#define wl_egl_window_resize _glfw.wl.egl.window_resize
|
|
|
|
|
2017-08-26 18:25:24 +00:00
|
|
|
typedef struct xkb_context* (* PFN_xkb_context_new)(enum xkb_context_flags);
|
|
|
|
typedef void (* PFN_xkb_context_unref)(struct xkb_context*);
|
|
|
|
typedef struct xkb_keymap* (* PFN_xkb_keymap_new_from_string)(struct xkb_context*, const char*, enum xkb_keymap_format, enum xkb_keymap_compile_flags);
|
|
|
|
typedef void (* PFN_xkb_keymap_unref)(struct xkb_keymap*);
|
|
|
|
typedef xkb_mod_index_t (* PFN_xkb_keymap_mod_get_index)(struct xkb_keymap*, const char*);
|
2018-02-12 08:32:13 +00:00
|
|
|
typedef int (* PFN_xkb_keymap_key_repeats)(struct xkb_keymap*, xkb_keycode_t);
|
2021-12-29 22:45:06 +00:00
|
|
|
typedef 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**);
|
2017-08-26 18:25:24 +00:00
|
|
|
typedef struct xkb_state* (* PFN_xkb_state_new)(struct xkb_keymap*);
|
|
|
|
typedef void (* PFN_xkb_state_unref)(struct xkb_state*);
|
|
|
|
typedef int (* PFN_xkb_state_key_get_syms)(struct xkb_state*, xkb_keycode_t, const xkb_keysym_t**);
|
|
|
|
typedef 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);
|
2021-12-29 22:45:06 +00:00
|
|
|
typedef xkb_layout_index_t (* PFN_xkb_state_key_get_layout)(struct xkb_state*,xkb_keycode_t);
|
2022-06-08 17:14:13 +00:00
|
|
|
typedef int (* PFN_xkb_state_mod_index_is_active)(struct xkb_state*,xkb_mod_index_t,enum xkb_state_component);
|
2017-08-26 18:25:24 +00:00
|
|
|
#define xkb_context_new _glfw.wl.xkb.context_new
|
|
|
|
#define xkb_context_unref _glfw.wl.xkb.context_unref
|
|
|
|
#define xkb_keymap_new_from_string _glfw.wl.xkb.keymap_new_from_string
|
|
|
|
#define xkb_keymap_unref _glfw.wl.xkb.keymap_unref
|
|
|
|
#define xkb_keymap_mod_get_index _glfw.wl.xkb.keymap_mod_get_index
|
2018-02-12 08:32:13 +00:00
|
|
|
#define xkb_keymap_key_repeats _glfw.wl.xkb.keymap_key_repeats
|
2021-12-29 22:45:06 +00:00
|
|
|
#define xkb_keymap_key_get_syms_by_level _glfw.wl.xkb.keymap_key_get_syms_by_level
|
2017-08-26 18:25:24 +00:00
|
|
|
#define xkb_state_new _glfw.wl.xkb.state_new
|
|
|
|
#define xkb_state_unref _glfw.wl.xkb.state_unref
|
|
|
|
#define xkb_state_key_get_syms _glfw.wl.xkb.state_key_get_syms
|
|
|
|
#define xkb_state_update_mask _glfw.wl.xkb.state_update_mask
|
2021-12-29 22:45:06 +00:00
|
|
|
#define xkb_state_key_get_layout _glfw.wl.xkb.state_key_get_layout
|
2022-06-08 17:14:13 +00:00
|
|
|
#define xkb_state_mod_index_is_active _glfw.wl.xkb.state_mod_index_is_active
|
2017-11-16 16:42:11 +00:00
|
|
|
|
|
|
|
typedef struct xkb_compose_table* (* PFN_xkb_compose_table_new_from_locale)(struct xkb_context*, const char*, enum xkb_compose_compile_flags);
|
|
|
|
typedef void (* PFN_xkb_compose_table_unref)(struct xkb_compose_table*);
|
|
|
|
typedef struct xkb_compose_state* (* PFN_xkb_compose_state_new)(struct xkb_compose_table*, enum xkb_compose_state_flags);
|
|
|
|
typedef void (* PFN_xkb_compose_state_unref)(struct xkb_compose_state*);
|
|
|
|
typedef enum xkb_compose_feed_result (* PFN_xkb_compose_state_feed)(struct xkb_compose_state*, xkb_keysym_t);
|
|
|
|
typedef enum xkb_compose_status (* PFN_xkb_compose_state_get_status)(struct xkb_compose_state*);
|
|
|
|
typedef xkb_keysym_t (* PFN_xkb_compose_state_get_one_sym)(struct xkb_compose_state*);
|
2017-08-26 18:25:24 +00:00
|
|
|
#define xkb_compose_table_new_from_locale _glfw.wl.xkb.compose_table_new_from_locale
|
|
|
|
#define xkb_compose_table_unref _glfw.wl.xkb.compose_table_unref
|
|
|
|
#define xkb_compose_state_new _glfw.wl.xkb.compose_state_new
|
|
|
|
#define xkb_compose_state_unref _glfw.wl.xkb.compose_state_unref
|
|
|
|
#define xkb_compose_state_feed _glfw.wl.xkb.compose_state_feed
|
|
|
|
#define xkb_compose_state_get_status _glfw.wl.xkb.compose_state_get_status
|
|
|
|
#define xkb_compose_state_get_one_sym _glfw.wl.xkb.compose_state_get_one_sym
|
|
|
|
|
2017-12-19 19:58:03 +00:00
|
|
|
typedef enum _GLFWdecorationSideWayland
|
|
|
|
{
|
|
|
|
mainWindow,
|
|
|
|
topDecoration,
|
|
|
|
leftDecoration,
|
|
|
|
rightDecoration,
|
|
|
|
bottomDecoration,
|
|
|
|
} _GLFWdecorationSideWayland;
|
|
|
|
|
|
|
|
typedef struct _GLFWdecorationWayland
|
|
|
|
{
|
|
|
|
struct wl_surface* surface;
|
|
|
|
struct wl_subsurface* subsurface;
|
|
|
|
struct wp_viewport* viewport;
|
|
|
|
} _GLFWdecorationWayland;
|
2014-03-17 21:53:43 +00:00
|
|
|
|
2022-03-23 18:58:33 +00:00
|
|
|
typedef struct _GLFWofferWayland
|
|
|
|
{
|
|
|
|
struct wl_data_offer* offer;
|
|
|
|
GLFWbool text_plain_utf8;
|
2022-03-31 17:56:48 +00:00
|
|
|
GLFWbool text_uri_list;
|
2022-03-23 18:58:33 +00:00
|
|
|
} _GLFWofferWayland;
|
|
|
|
|
2014-09-02 17:42:43 +00:00
|
|
|
// Wayland-specific per-window data
|
|
|
|
//
|
2014-03-17 21:53:43 +00:00
|
|
|
typedef struct _GLFWwindowWayland
|
|
|
|
{
|
|
|
|
int width, height;
|
2015-08-23 17:30:04 +00:00
|
|
|
GLFWbool visible;
|
2016-04-08 23:54:23 +00:00
|
|
|
GLFWbool maximized;
|
2022-06-09 19:31:44 +00:00
|
|
|
GLFWbool activated;
|
2022-06-10 16:36:16 +00:00
|
|
|
GLFWbool fullscreen;
|
2018-01-04 12:50:58 +00:00
|
|
|
GLFWbool hovered;
|
2017-10-01 00:38:00 +00:00
|
|
|
GLFWbool transparent;
|
2014-03-17 21:53:43 +00:00
|
|
|
struct wl_surface* surface;
|
|
|
|
struct wl_callback* callback;
|
2015-10-10 15:35:06 +00:00
|
|
|
|
2022-06-14 20:22:49 +00:00
|
|
|
struct {
|
|
|
|
struct wl_egl_window* window;
|
|
|
|
} egl;
|
|
|
|
|
2022-06-10 16:38:06 +00:00
|
|
|
struct {
|
|
|
|
int width, height;
|
2022-06-15 15:57:54 +00:00
|
|
|
GLFWbool maximized;
|
|
|
|
GLFWbool iconified;
|
|
|
|
GLFWbool activated;
|
|
|
|
GLFWbool fullscreen;
|
2022-06-10 16:38:06 +00:00
|
|
|
} pending;
|
|
|
|
|
2017-12-03 02:59:12 +00:00
|
|
|
struct {
|
|
|
|
struct xdg_surface* surface;
|
|
|
|
struct xdg_toplevel* toplevel;
|
2018-10-01 13:05:55 +00:00
|
|
|
struct zxdg_toplevel_decoration_v1* decoration;
|
2022-06-20 20:20:56 +00:00
|
|
|
uint32_t decorationMode;
|
2017-12-03 02:59:12 +00:00
|
|
|
} xdg;
|
|
|
|
|
2014-09-09 14:37:55 +00:00
|
|
|
_GLFWcursor* currentCursor;
|
2015-04-15 16:18:42 +00:00
|
|
|
double cursorPosX, cursorPosY;
|
2015-10-10 15:35:06 +00:00
|
|
|
|
2016-04-08 23:51:48 +00:00
|
|
|
char* title;
|
|
|
|
|
2015-10-10 15:35:06 +00:00
|
|
|
// We need to track the monitors the window spans on to calculate the
|
|
|
|
// optimal scaling factor.
|
|
|
|
int scale;
|
|
|
|
_GLFWmonitor** monitors;
|
|
|
|
int monitorsCount;
|
|
|
|
int monitorsSize;
|
2015-08-10 18:19:04 +00:00
|
|
|
|
2015-12-09 07:29:37 +00:00
|
|
|
struct {
|
|
|
|
struct zwp_relative_pointer_v1* relativePointer;
|
|
|
|
struct zwp_locked_pointer_v1* lockedPointer;
|
|
|
|
} pointerLock;
|
2017-02-17 15:52:50 +00:00
|
|
|
|
|
|
|
struct zwp_idle_inhibitor_v1* idleInhibitor;
|
|
|
|
|
2017-12-19 19:58:03 +00:00
|
|
|
struct {
|
|
|
|
struct wl_buffer* buffer;
|
|
|
|
_GLFWdecorationWayland top, left, right, bottom;
|
|
|
|
int focus;
|
|
|
|
} decorations;
|
2014-03-17 21:53:43 +00:00
|
|
|
} _GLFWwindowWayland;
|
|
|
|
|
2014-09-02 17:42:43 +00:00
|
|
|
// Wayland-specific global data
|
|
|
|
//
|
2014-03-17 21:53:43 +00:00
|
|
|
typedef struct _GLFWlibraryWayland
|
|
|
|
{
|
|
|
|
struct wl_display* display;
|
|
|
|
struct wl_registry* registry;
|
|
|
|
struct wl_compositor* compositor;
|
2017-12-19 18:04:52 +00:00
|
|
|
struct wl_subcompositor* subcompositor;
|
2014-09-09 14:37:55 +00:00
|
|
|
struct wl_shm* shm;
|
2014-06-29 10:29:00 +00:00
|
|
|
struct wl_seat* seat;
|
|
|
|
struct wl_pointer* pointer;
|
|
|
|
struct wl_keyboard* keyboard;
|
2018-10-10 17:06:11 +00:00
|
|
|
struct wl_data_device_manager* dataDeviceManager;
|
|
|
|
struct wl_data_device* dataDevice;
|
2017-12-03 02:59:12 +00:00
|
|
|
struct xdg_wm_base* wmBase;
|
2018-10-01 13:05:55 +00:00
|
|
|
struct zxdg_decoration_manager_v1* decorationManager;
|
2017-12-19 18:04:28 +00:00
|
|
|
struct wp_viewporter* viewporter;
|
2015-12-09 07:29:37 +00:00
|
|
|
struct zwp_relative_pointer_manager_v1* relativePointerManager;
|
|
|
|
struct zwp_pointer_constraints_v1* pointerConstraints;
|
2017-02-17 15:52:50 +00:00
|
|
|
struct zwp_idle_inhibit_manager_v1* idleInhibitManager;
|
2014-03-17 21:53:43 +00:00
|
|
|
|
2022-03-23 18:58:33 +00:00
|
|
|
_GLFWofferWayland* offers;
|
|
|
|
unsigned int offerCount;
|
|
|
|
|
|
|
|
struct wl_data_offer* selectionOffer;
|
|
|
|
struct wl_data_source* selectionSource;
|
|
|
|
|
2022-03-31 17:56:48 +00:00
|
|
|
struct wl_data_offer* dragOffer;
|
|
|
|
_GLFWwindow* dragFocus;
|
|
|
|
uint32_t dragSerial;
|
|
|
|
|
2016-10-01 19:05:29 +00:00
|
|
|
int compositorVersion;
|
2017-11-17 01:24:01 +00:00
|
|
|
int seatVersion;
|
2015-12-27 02:42:45 +00:00
|
|
|
|
2014-09-09 14:37:55 +00:00
|
|
|
struct wl_cursor_theme* cursorTheme;
|
2018-09-11 12:18:52 +00:00
|
|
|
struct wl_cursor_theme* cursorThemeHiDPI;
|
2014-09-09 14:37:55 +00:00
|
|
|
struct wl_surface* cursorSurface;
|
2019-11-15 14:30:41 +00:00
|
|
|
const char* cursorPreviousName;
|
2018-09-08 18:01:04 +00:00
|
|
|
int cursorTimerfd;
|
2014-09-23 17:24:33 +00:00
|
|
|
uint32_t serial;
|
2021-05-12 07:30:14 +00:00
|
|
|
uint32_t pointerEnterSerial;
|
2014-09-09 14:37:55 +00:00
|
|
|
|
2017-11-17 01:24:01 +00:00
|
|
|
int32_t keyboardRepeatRate;
|
|
|
|
int32_t keyboardRepeatDelay;
|
2018-01-30 15:22:25 +00:00
|
|
|
int keyboardLastKey;
|
|
|
|
int keyboardLastScancode;
|
2018-10-10 17:21:26 +00:00
|
|
|
char* clipboardString;
|
2018-01-30 15:22:25 +00:00
|
|
|
int timerfd;
|
2016-09-07 13:43:39 +00:00
|
|
|
short int keycodes[256];
|
|
|
|
short int scancodes[GLFW_KEY_LAST + 1];
|
2021-12-29 22:45:06 +00:00
|
|
|
char keynames[GLFW_KEY_LAST + 1][5];
|
2015-11-12 14:06:46 +00:00
|
|
|
|
2014-06-29 21:09:21 +00:00
|
|
|
struct {
|
2017-08-26 18:25:24 +00:00
|
|
|
void* handle;
|
2014-06-29 21:09:21 +00:00
|
|
|
struct xkb_context* context;
|
|
|
|
struct xkb_keymap* keymap;
|
|
|
|
struct xkb_state* state;
|
2017-11-16 16:42:11 +00:00
|
|
|
|
2016-10-10 23:02:15 +00:00
|
|
|
struct xkb_compose_state* composeState;
|
2017-11-16 16:42:11 +00:00
|
|
|
|
2022-06-08 17:14:13 +00:00
|
|
|
xkb_mod_index_t controlIndex;
|
|
|
|
xkb_mod_index_t altIndex;
|
|
|
|
xkb_mod_index_t shiftIndex;
|
|
|
|
xkb_mod_index_t superIndex;
|
|
|
|
xkb_mod_index_t capsLockIndex;
|
|
|
|
xkb_mod_index_t numLockIndex;
|
2014-06-29 21:09:21 +00:00
|
|
|
unsigned int modifiers;
|
2017-08-26 18:25:24 +00:00
|
|
|
|
|
|
|
PFN_xkb_context_new context_new;
|
|
|
|
PFN_xkb_context_unref context_unref;
|
|
|
|
PFN_xkb_keymap_new_from_string keymap_new_from_string;
|
|
|
|
PFN_xkb_keymap_unref keymap_unref;
|
|
|
|
PFN_xkb_keymap_mod_get_index keymap_mod_get_index;
|
2018-02-12 08:32:13 +00:00
|
|
|
PFN_xkb_keymap_key_repeats keymap_key_repeats;
|
2021-12-29 22:45:06 +00:00
|
|
|
PFN_xkb_keymap_key_get_syms_by_level keymap_key_get_syms_by_level;
|
2017-08-26 18:25:24 +00:00
|
|
|
PFN_xkb_state_new state_new;
|
|
|
|
PFN_xkb_state_unref state_unref;
|
|
|
|
PFN_xkb_state_key_get_syms state_key_get_syms;
|
|
|
|
PFN_xkb_state_update_mask state_update_mask;
|
2021-12-29 22:45:06 +00:00
|
|
|
PFN_xkb_state_key_get_layout state_key_get_layout;
|
2022-06-08 17:14:13 +00:00
|
|
|
PFN_xkb_state_mod_index_is_active state_mod_index_is_active;
|
2017-11-16 16:42:11 +00:00
|
|
|
|
2017-08-26 18:25:24 +00:00
|
|
|
PFN_xkb_compose_table_new_from_locale compose_table_new_from_locale;
|
|
|
|
PFN_xkb_compose_table_unref compose_table_unref;
|
|
|
|
PFN_xkb_compose_state_new compose_state_new;
|
|
|
|
PFN_xkb_compose_state_unref compose_state_unref;
|
|
|
|
PFN_xkb_compose_state_feed compose_state_feed;
|
|
|
|
PFN_xkb_compose_state_get_status compose_state_get_status;
|
|
|
|
PFN_xkb_compose_state_get_one_sym compose_state_get_one_sym;
|
2014-06-29 21:09:21 +00:00
|
|
|
} xkb;
|
|
|
|
|
2014-06-29 10:29:00 +00:00
|
|
|
_GLFWwindow* pointerFocus;
|
|
|
|
_GLFWwindow* keyboardFocus;
|
2014-09-02 17:42:43 +00:00
|
|
|
|
2021-07-13 16:12:43 +00:00
|
|
|
struct {
|
|
|
|
void* handle;
|
|
|
|
PFN_wl_display_flush display_flush;
|
|
|
|
PFN_wl_display_cancel_read display_cancel_read;
|
|
|
|
PFN_wl_display_dispatch_pending display_dispatch_pending;
|
|
|
|
PFN_wl_display_read_events display_read_events;
|
|
|
|
PFN_wl_display_disconnect display_disconnect;
|
|
|
|
PFN_wl_display_roundtrip display_roundtrip;
|
|
|
|
PFN_wl_display_get_fd display_get_fd;
|
|
|
|
PFN_wl_display_prepare_read display_prepare_read;
|
|
|
|
PFN_wl_proxy_marshal proxy_marshal;
|
|
|
|
PFN_wl_proxy_add_listener proxy_add_listener;
|
|
|
|
PFN_wl_proxy_destroy proxy_destroy;
|
|
|
|
PFN_wl_proxy_marshal_constructor proxy_marshal_constructor;
|
|
|
|
PFN_wl_proxy_marshal_constructor_versioned proxy_marshal_constructor_versioned;
|
|
|
|
PFN_wl_proxy_get_user_data proxy_get_user_data;
|
|
|
|
PFN_wl_proxy_set_user_data proxy_set_user_data;
|
2021-08-19 16:50:17 +00:00
|
|
|
PFN_wl_proxy_get_version proxy_get_version;
|
|
|
|
PFN_wl_proxy_marshal_flags proxy_marshal_flags;
|
2021-07-13 16:12:43 +00:00
|
|
|
} client;
|
|
|
|
|
2018-01-05 20:58:10 +00:00
|
|
|
struct {
|
|
|
|
void* handle;
|
|
|
|
|
|
|
|
PFN_wl_cursor_theme_load theme_load;
|
|
|
|
PFN_wl_cursor_theme_destroy theme_destroy;
|
|
|
|
PFN_wl_cursor_theme_get_cursor theme_get_cursor;
|
|
|
|
PFN_wl_cursor_image_get_buffer image_get_buffer;
|
|
|
|
} cursor;
|
|
|
|
|
2018-01-05 20:33:40 +00:00
|
|
|
struct {
|
|
|
|
void* handle;
|
|
|
|
|
|
|
|
PFN_wl_egl_window_create window_create;
|
|
|
|
PFN_wl_egl_window_destroy window_destroy;
|
|
|
|
PFN_wl_egl_window_resize window_resize;
|
|
|
|
} egl;
|
2014-03-17 21:53:43 +00:00
|
|
|
} _GLFWlibraryWayland;
|
|
|
|
|
2014-09-02 17:42:43 +00:00
|
|
|
// Wayland-specific per-monitor data
|
|
|
|
//
|
2014-03-17 21:53:43 +00:00
|
|
|
typedef struct _GLFWmonitorWayland
|
|
|
|
{
|
|
|
|
struct wl_output* output;
|
2019-09-30 21:17:42 +00:00
|
|
|
uint32_t name;
|
2016-12-05 00:19:48 +00:00
|
|
|
int currentMode;
|
2014-03-17 21:53:43 +00:00
|
|
|
|
|
|
|
int x;
|
|
|
|
int y;
|
2015-10-10 15:35:06 +00:00
|
|
|
int scale;
|
2014-03-17 21:53:43 +00:00
|
|
|
} _GLFWmonitorWayland;
|
|
|
|
|
2014-09-02 17:42:43 +00:00
|
|
|
// Wayland-specific per-cursor data
|
|
|
|
//
|
2014-03-27 16:29:22 +00:00
|
|
|
typedef struct _GLFWcursorWayland
|
|
|
|
{
|
2018-09-08 18:05:40 +00:00
|
|
|
struct wl_cursor* cursor;
|
2018-09-11 12:24:43 +00:00
|
|
|
struct wl_cursor* cursorHiDPI;
|
2014-09-09 14:37:55 +00:00
|
|
|
struct wl_buffer* buffer;
|
|
|
|
int width, height;
|
|
|
|
int xhot, yhot;
|
2018-09-08 18:05:40 +00:00
|
|
|
int currentImage;
|
2014-09-02 17:42:43 +00:00
|
|
|
} _GLFWcursorWayland;
|
2014-03-17 21:53:43 +00:00
|
|
|
|
2021-07-13 19:50:09 +00:00
|
|
|
GLFWbool _glfwConnectWayland(int platformID, _GLFWplatform* platform);
|
|
|
|
int _glfwInitWayland(void);
|
|
|
|
void _glfwTerminateWayland(void);
|
|
|
|
|
2022-05-22 12:40:00 +00:00
|
|
|
GLFWbool _glfwCreateWindowWayland(_GLFWwindow* window, const _GLFWwndconfig* wndconfig, const _GLFWctxconfig* ctxconfig, const _GLFWfbconfig* fbconfig);
|
2021-07-13 19:50:09 +00:00
|
|
|
void _glfwDestroyWindowWayland(_GLFWwindow* window);
|
|
|
|
void _glfwSetWindowTitleWayland(_GLFWwindow* window, const char* title);
|
|
|
|
void _glfwSetWindowIconWayland(_GLFWwindow* window, int count, const GLFWimage* images);
|
|
|
|
void _glfwGetWindowPosWayland(_GLFWwindow* window, int* xpos, int* ypos);
|
|
|
|
void _glfwSetWindowPosWayland(_GLFWwindow* window, int xpos, int ypos);
|
|
|
|
void _glfwGetWindowSizeWayland(_GLFWwindow* window, int* width, int* height);
|
|
|
|
void _glfwSetWindowSizeWayland(_GLFWwindow* window, int width, int height);
|
|
|
|
void _glfwSetWindowSizeLimitsWayland(_GLFWwindow* window, int minwidth, int minheight, int maxwidth, int maxheight);
|
|
|
|
void _glfwSetWindowAspectRatioWayland(_GLFWwindow* window, int numer, int denom);
|
|
|
|
void _glfwGetFramebufferSizeWayland(_GLFWwindow* window, int* width, int* height);
|
|
|
|
void _glfwGetWindowFrameSizeWayland(_GLFWwindow* window, int* left, int* top, int* right, int* bottom);
|
|
|
|
void _glfwGetWindowContentScaleWayland(_GLFWwindow* window, float* xscale, float* yscale);
|
|
|
|
void _glfwIconifyWindowWayland(_GLFWwindow* window);
|
|
|
|
void _glfwRestoreWindowWayland(_GLFWwindow* window);
|
|
|
|
void _glfwMaximizeWindowWayland(_GLFWwindow* window);
|
|
|
|
void _glfwShowWindowWayland(_GLFWwindow* window);
|
|
|
|
void _glfwHideWindowWayland(_GLFWwindow* window);
|
|
|
|
void _glfwRequestWindowAttentionWayland(_GLFWwindow* window);
|
|
|
|
void _glfwFocusWindowWayland(_GLFWwindow* window);
|
|
|
|
void _glfwSetWindowMonitorWayland(_GLFWwindow* window, _GLFWmonitor* monitor, int xpos, int ypos, int width, int height, int refreshRate);
|
2022-05-22 12:40:00 +00:00
|
|
|
GLFWbool _glfwWindowFocusedWayland(_GLFWwindow* window);
|
|
|
|
GLFWbool _glfwWindowIconifiedWayland(_GLFWwindow* window);
|
|
|
|
GLFWbool _glfwWindowVisibleWayland(_GLFWwindow* window);
|
|
|
|
GLFWbool _glfwWindowMaximizedWayland(_GLFWwindow* window);
|
|
|
|
GLFWbool _glfwWindowHoveredWayland(_GLFWwindow* window);
|
|
|
|
GLFWbool _glfwFramebufferTransparentWayland(_GLFWwindow* window);
|
2021-07-13 19:50:09 +00:00
|
|
|
void _glfwSetWindowResizableWayland(_GLFWwindow* window, GLFWbool enabled);
|
|
|
|
void _glfwSetWindowDecoratedWayland(_GLFWwindow* window, GLFWbool enabled);
|
|
|
|
void _glfwSetWindowFloatingWayland(_GLFWwindow* window, GLFWbool enabled);
|
|
|
|
float _glfwGetWindowOpacityWayland(_GLFWwindow* window);
|
|
|
|
void _glfwSetWindowOpacityWayland(_GLFWwindow* window, float opacity);
|
|
|
|
void _glfwSetWindowMousePassthroughWayland(_GLFWwindow* window, GLFWbool enabled);
|
|
|
|
|
2022-03-23 17:55:22 +00:00
|
|
|
void _glfwSetRawMouseMotionWayland(_GLFWwindow* window, GLFWbool enabled);
|
2021-07-13 19:50:09 +00:00
|
|
|
GLFWbool _glfwRawMouseMotionSupportedWayland(void);
|
|
|
|
|
|
|
|
void _glfwPollEventsWayland(void);
|
|
|
|
void _glfwWaitEventsWayland(void);
|
|
|
|
void _glfwWaitEventsTimeoutWayland(double timeout);
|
|
|
|
void _glfwPostEmptyEventWayland(void);
|
|
|
|
|
|
|
|
void _glfwGetCursorPosWayland(_GLFWwindow* window, double* xpos, double* ypos);
|
|
|
|
void _glfwSetCursorPosWayland(_GLFWwindow* window, double xpos, double ypos);
|
|
|
|
void _glfwSetCursorModeWayland(_GLFWwindow* window, int mode);
|
|
|
|
const char* _glfwGetScancodeNameWayland(int scancode);
|
|
|
|
int _glfwGetKeyScancodeWayland(int key);
|
2022-05-22 12:40:00 +00:00
|
|
|
GLFWbool _glfwCreateCursorWayland(_GLFWcursor* cursor, const GLFWimage* image, int xhot, int yhot);
|
|
|
|
GLFWbool _glfwCreateStandardCursorWayland(_GLFWcursor* cursor, int shape);
|
2021-07-13 19:50:09 +00:00
|
|
|
void _glfwDestroyCursorWayland(_GLFWcursor* cursor);
|
|
|
|
void _glfwSetCursorWayland(_GLFWwindow* window, _GLFWcursor* cursor);
|
|
|
|
void _glfwSetClipboardStringWayland(const char* string);
|
|
|
|
const char* _glfwGetClipboardStringWayland(void);
|
|
|
|
|
|
|
|
EGLenum _glfwGetEGLPlatformWayland(EGLint** attribs);
|
|
|
|
EGLNativeDisplayType _glfwGetEGLNativeDisplayWayland(void);
|
|
|
|
EGLNativeWindowType _glfwGetEGLNativeWindowWayland(_GLFWwindow* window);
|
|
|
|
|
|
|
|
void _glfwGetRequiredInstanceExtensionsWayland(char** extensions);
|
2022-05-22 12:40:00 +00:00
|
|
|
GLFWbool _glfwGetPhysicalDevicePresentationSupportWayland(VkInstance instance, VkPhysicalDevice device, uint32_t queuefamily);
|
2021-07-13 19:50:09 +00:00
|
|
|
VkResult _glfwCreateWindowSurfaceWayland(VkInstance instance, _GLFWwindow* window, const VkAllocationCallbacks* allocator, VkSurfaceKHR* surface);
|
|
|
|
|
|
|
|
void _glfwFreeMonitorWayland(_GLFWmonitor* monitor);
|
|
|
|
void _glfwGetMonitorPosWayland(_GLFWmonitor* monitor, int* xpos, int* ypos);
|
|
|
|
void _glfwGetMonitorContentScaleWayland(_GLFWmonitor* monitor, float* xscale, float* yscale);
|
|
|
|
void _glfwGetMonitorWorkareaWayland(_GLFWmonitor* monitor, int* xpos, int* ypos, int* width, int* height);
|
|
|
|
GLFWvidmode* _glfwGetVideoModesWayland(_GLFWmonitor* monitor, int* count);
|
|
|
|
void _glfwGetVideoModeWayland(_GLFWmonitor* monitor, GLFWvidmode* mode);
|
|
|
|
GLFWbool _glfwGetGammaRampWayland(_GLFWmonitor* monitor, GLFWgammaramp* ramp);
|
|
|
|
void _glfwSetGammaRampWayland(_GLFWmonitor* monitor, const GLFWgammaramp* ramp);
|
2014-03-17 21:53:43 +00:00
|
|
|
|
2015-12-03 17:16:46 +00:00
|
|
|
void _glfwAddOutputWayland(uint32_t name, uint32_t version);
|
2022-06-14 16:46:47 +00:00
|
|
|
void _glfwUpdateContentScaleWayland(_GLFWwindow* window);
|
2021-12-30 20:09:23 +00:00
|
|
|
GLFWbool _glfwInputTextWayland(_GLFWwindow* window, uint32_t scancode);
|
2014-03-17 21:53:43 +00:00
|
|
|
|
2022-03-29 16:32:05 +00:00
|
|
|
void _glfwAddSeatListenerWayland(struct wl_seat* seat);
|
|
|
|
void _glfwAddDataDeviceListenerWayland(struct wl_data_device* device);
|
|
|
|
|