2014-03-17 17:53:43 -04:00
|
|
|
//========================================================================
|
2019-04-16 08:43:29 -04:00
|
|
|
// GLFW 3.4 Wayland - www.glfw.org
|
2014-03-17 17:53:43 -04: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.
|
|
|
|
//
|
|
|
|
//========================================================================
|
|
|
|
|
2014-03-19 08:21:19 -04:00
|
|
|
#include <wayland-client.h>
|
2014-06-29 17:09:21 -04:00
|
|
|
#include <xkbcommon/xkbcommon.h>
|
2017-11-16 11:42:11 -05:00
|
|
|
#ifdef HAVE_XKBCOMMON_COMPOSE_H
|
2016-10-10 19:02:15 -04:00
|
|
|
#include <xkbcommon/xkbcommon-compose.h>
|
2017-11-16 11:42:11 -05:00
|
|
|
#endif
|
2015-08-10 14:19:04 -04:00
|
|
|
#include <dlfcn.h>
|
|
|
|
|
|
|
|
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 08:21:19 -04:00
|
|
|
|
2017-05-25 13:25:47 -04:00
|
|
|
#include "posix_thread.h"
|
2015-05-27 09:06:52 -04:00
|
|
|
#include "posix_time.h"
|
2018-03-19 15:08:22 -04:00
|
|
|
#ifdef __linux__
|
2015-05-27 09:06:52 -04:00
|
|
|
#include "linux_joystick.h"
|
2018-03-19 15:08:22 -04:00
|
|
|
#else
|
|
|
|
#include "null_joystick.h"
|
|
|
|
#endif
|
2015-05-27 09:06:52 -04:00
|
|
|
#include "xkb_unicode.h"
|
2016-03-28 07:19:31 -04:00
|
|
|
#include "egl_context.h"
|
2017-03-03 12:51:40 -05:00
|
|
|
#include "osmesa_context.h"
|
2014-03-17 17:53:43 -04:00
|
|
|
|
2017-12-02 21:59:12 -05:00
|
|
|
#include "wayland-xdg-shell-client-protocol.h"
|
2018-10-01 09:05:55 -04:00
|
|
|
#include "wayland-xdg-decoration-client-protocol.h"
|
2017-12-19 13:04:28 -05:00
|
|
|
#include "wayland-viewporter-client-protocol.h"
|
2015-12-09 02:29:37 -05:00
|
|
|
#include "wayland-relative-pointer-unstable-v1-client-protocol.h"
|
|
|
|
#include "wayland-pointer-constraints-unstable-v1-client-protocol.h"
|
2017-02-17 10:52:50 -05:00
|
|
|
#include "wayland-idle-inhibit-unstable-v1-client-protocol.h"
|
2015-12-09 02:29:37 -05:00
|
|
|
|
2015-08-10 14:19:04 -04:00
|
|
|
#define _glfw_dlopen(name) dlopen(name, RTLD_LAZY | RTLD_LOCAL)
|
|
|
|
#define _glfw_dlclose(handle) dlclose(handle)
|
|
|
|
#define _glfw_dlsym(handle, name) dlsym(handle, name)
|
|
|
|
|
2015-12-02 17:53:50 -05:00
|
|
|
#define _GLFW_EGL_NATIVE_WINDOW ((EGLNativeWindowType) window->wl.native)
|
|
|
|
#define _GLFW_EGL_NATIVE_DISPLAY ((EGLNativeDisplayType) _glfw.wl.display)
|
2014-03-17 17:53:43 -04:00
|
|
|
|
2014-03-19 11:20:32 -04:00
|
|
|
#define _GLFW_PLATFORM_WINDOW_STATE _GLFWwindowWayland wl
|
|
|
|
#define _GLFW_PLATFORM_LIBRARY_WINDOW_STATE _GLFWlibraryWayland wl
|
|
|
|
#define _GLFW_PLATFORM_MONITOR_STATE _GLFWmonitorWayland wl
|
2014-03-27 12:29:22 -04:00
|
|
|
#define _GLFW_PLATFORM_CURSOR_STATE _GLFWcursorWayland wl
|
2014-03-17 17:53:43 -04:00
|
|
|
|
2019-09-15 08:57:34 -04:00
|
|
|
#define _GLFW_PLATFORM_CONTEXT_STATE struct { int dummyContext; }
|
|
|
|
#define _GLFW_PLATFORM_LIBRARY_CONTEXT_STATE struct { int dummyLibraryContext; }
|
2016-03-28 07:19:31 -04:00
|
|
|
|
2018-01-05 15:58:10 -05: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 15:33:40 -05: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 14:25:24 -04: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 03:32:13 -05:00
|
|
|
typedef int (* PFN_xkb_keymap_key_repeats)(struct xkb_keymap*, xkb_keycode_t);
|
2017-08-26 14:25:24 -04: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);
|
|
|
|
typedef xkb_mod_mask_t (* PFN_xkb_state_serialize_mods)(struct xkb_state*, enum xkb_state_component);
|
|
|
|
#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 03:32:13 -05:00
|
|
|
#define xkb_keymap_key_repeats _glfw.wl.xkb.keymap_key_repeats
|
2017-08-26 14:25:24 -04: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
|
|
|
|
#define xkb_state_serialize_mods _glfw.wl.xkb.state_serialize_mods
|
2017-11-16 11:42:11 -05:00
|
|
|
|
|
|
|
#ifdef HAVE_XKBCOMMON_COMPOSE_H
|
|
|
|
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 14:25:24 -04: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-11-16 11:42:11 -05:00
|
|
|
#endif
|
2017-08-26 14:25:24 -04:00
|
|
|
|
2017-12-19 14:58:03 -05:00
|
|
|
#define _GLFW_DECORATION_WIDTH 4
|
|
|
|
#define _GLFW_DECORATION_TOP 24
|
2017-12-22 12:22:36 -05:00
|
|
|
#define _GLFW_DECORATION_VERTICAL (_GLFW_DECORATION_TOP + _GLFW_DECORATION_WIDTH)
|
|
|
|
#define _GLFW_DECORATION_HORIZONTAL (2 * _GLFW_DECORATION_WIDTH)
|
2017-12-19 14:58:03 -05: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 17:53:43 -04:00
|
|
|
|
2014-09-02 13:42:43 -04:00
|
|
|
// Wayland-specific per-window data
|
|
|
|
//
|
2014-03-17 17:53:43 -04:00
|
|
|
typedef struct _GLFWwindowWayland
|
|
|
|
{
|
|
|
|
int width, height;
|
2015-08-23 13:30:04 -04:00
|
|
|
GLFWbool visible;
|
2016-04-08 19:54:23 -04:00
|
|
|
GLFWbool maximized;
|
2018-01-04 07:50:58 -05:00
|
|
|
GLFWbool hovered;
|
2017-09-30 20:38:00 -04:00
|
|
|
GLFWbool transparent;
|
2014-03-17 17:53:43 -04:00
|
|
|
struct wl_surface* surface;
|
|
|
|
struct wl_egl_window* native;
|
|
|
|
struct wl_callback* callback;
|
2015-10-10 11:35:06 -04:00
|
|
|
|
2017-12-02 21:59:12 -05:00
|
|
|
struct {
|
|
|
|
struct xdg_surface* surface;
|
|
|
|
struct xdg_toplevel* toplevel;
|
2018-10-01 09:05:55 -04:00
|
|
|
struct zxdg_toplevel_decoration_v1* decoration;
|
2017-12-02 21:59:12 -05:00
|
|
|
} xdg;
|
|
|
|
|
2014-09-09 10:37:55 -04:00
|
|
|
_GLFWcursor* currentCursor;
|
2015-04-15 12:18:42 -04:00
|
|
|
double cursorPosX, cursorPosY;
|
2015-10-10 11:35:06 -04:00
|
|
|
|
2016-04-08 19:51:48 -04:00
|
|
|
char* title;
|
|
|
|
|
2015-10-10 11:35:06 -04: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 14:19:04 -04:00
|
|
|
|
2015-12-09 02:29:37 -05:00
|
|
|
struct {
|
|
|
|
struct zwp_relative_pointer_v1* relativePointer;
|
|
|
|
struct zwp_locked_pointer_v1* lockedPointer;
|
|
|
|
} pointerLock;
|
2017-02-17 10:52:50 -05:00
|
|
|
|
|
|
|
struct zwp_idle_inhibitor_v1* idleInhibitor;
|
|
|
|
|
2019-02-15 12:12:06 -05:00
|
|
|
GLFWbool wasFullscreen;
|
2018-01-18 18:24:57 -05:00
|
|
|
|
2017-12-19 14:58:03 -05:00
|
|
|
struct {
|
2018-10-01 09:05:55 -04:00
|
|
|
GLFWbool serverSide;
|
2017-12-19 14:58:03 -05:00
|
|
|
struct wl_buffer* buffer;
|
|
|
|
_GLFWdecorationWayland top, left, right, bottom;
|
|
|
|
int focus;
|
|
|
|
} decorations;
|
|
|
|
|
2014-03-17 17:53:43 -04:00
|
|
|
} _GLFWwindowWayland;
|
|
|
|
|
2014-09-02 13:42:43 -04:00
|
|
|
// Wayland-specific global data
|
|
|
|
//
|
2014-03-17 17:53:43 -04:00
|
|
|
typedef struct _GLFWlibraryWayland
|
|
|
|
{
|
|
|
|
struct wl_display* display;
|
|
|
|
struct wl_registry* registry;
|
|
|
|
struct wl_compositor* compositor;
|
2017-12-19 13:04:52 -05:00
|
|
|
struct wl_subcompositor* subcompositor;
|
2014-09-09 10:37:55 -04:00
|
|
|
struct wl_shm* shm;
|
2014-06-29 06:29:00 -04:00
|
|
|
struct wl_seat* seat;
|
|
|
|
struct wl_pointer* pointer;
|
|
|
|
struct wl_keyboard* keyboard;
|
2018-10-10 13:06:11 -04:00
|
|
|
struct wl_data_device_manager* dataDeviceManager;
|
|
|
|
struct wl_data_device* dataDevice;
|
|
|
|
struct wl_data_offer* dataOffer;
|
2018-10-10 14:31:26 -04:00
|
|
|
struct wl_data_source* dataSource;
|
2017-12-02 21:59:12 -05:00
|
|
|
struct xdg_wm_base* wmBase;
|
2018-10-01 09:05:55 -04:00
|
|
|
struct zxdg_decoration_manager_v1* decorationManager;
|
2017-12-19 13:04:28 -05:00
|
|
|
struct wp_viewporter* viewporter;
|
2015-12-09 02:29:37 -05:00
|
|
|
struct zwp_relative_pointer_manager_v1* relativePointerManager;
|
|
|
|
struct zwp_pointer_constraints_v1* pointerConstraints;
|
2017-02-17 10:52:50 -05:00
|
|
|
struct zwp_idle_inhibit_manager_v1* idleInhibitManager;
|
2014-03-17 17:53:43 -04:00
|
|
|
|
2016-10-01 15:05:29 -04:00
|
|
|
int compositorVersion;
|
2017-11-16 20:24:01 -05:00
|
|
|
int seatVersion;
|
2015-12-26 21:42:45 -05:00
|
|
|
|
2014-09-09 10:37:55 -04:00
|
|
|
struct wl_cursor_theme* cursorTheme;
|
2018-09-11 08:18:52 -04:00
|
|
|
struct wl_cursor_theme* cursorThemeHiDPI;
|
2014-09-09 10:37:55 -04:00
|
|
|
struct wl_surface* cursorSurface;
|
2018-09-08 14:01:04 -04:00
|
|
|
int cursorTimerfd;
|
2014-09-23 13:24:33 -04:00
|
|
|
uint32_t serial;
|
2014-09-09 10:37:55 -04:00
|
|
|
|
2017-11-16 20:24:01 -05:00
|
|
|
int32_t keyboardRepeatRate;
|
|
|
|
int32_t keyboardRepeatDelay;
|
2018-01-30 10:22:25 -05:00
|
|
|
int keyboardLastKey;
|
|
|
|
int keyboardLastScancode;
|
2018-10-10 13:21:26 -04:00
|
|
|
char* clipboardString;
|
|
|
|
size_t clipboardSize;
|
2018-10-10 14:31:26 -04:00
|
|
|
char* clipboardSendString;
|
|
|
|
size_t clipboardSendSize;
|
2018-01-30 10:22:25 -05:00
|
|
|
int timerfd;
|
2016-09-07 09:43:39 -04:00
|
|
|
short int keycodes[256];
|
|
|
|
short int scancodes[GLFW_KEY_LAST + 1];
|
2015-11-12 09:06:46 -05:00
|
|
|
|
2014-06-29 17:09:21 -04:00
|
|
|
struct {
|
2017-08-26 14:25:24 -04:00
|
|
|
void* handle;
|
2014-06-29 17:09:21 -04:00
|
|
|
struct xkb_context* context;
|
|
|
|
struct xkb_keymap* keymap;
|
|
|
|
struct xkb_state* state;
|
2017-11-16 11:42:11 -05:00
|
|
|
|
|
|
|
#ifdef HAVE_XKBCOMMON_COMPOSE_H
|
2016-10-10 19:02:15 -04:00
|
|
|
struct xkb_compose_state* composeState;
|
2017-11-16 11:42:11 -05:00
|
|
|
#endif
|
|
|
|
|
2016-10-01 15:05:29 -04:00
|
|
|
xkb_mod_mask_t controlMask;
|
|
|
|
xkb_mod_mask_t altMask;
|
|
|
|
xkb_mod_mask_t shiftMask;
|
|
|
|
xkb_mod_mask_t superMask;
|
2017-11-29 14:42:37 -05:00
|
|
|
xkb_mod_mask_t capsLockMask;
|
|
|
|
xkb_mod_mask_t numLockMask;
|
2014-06-29 17:09:21 -04:00
|
|
|
unsigned int modifiers;
|
2017-08-26 14:25:24 -04: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 03:32:13 -05:00
|
|
|
PFN_xkb_keymap_key_repeats keymap_key_repeats;
|
2017-08-26 14:25:24 -04: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;
|
|
|
|
PFN_xkb_state_serialize_mods state_serialize_mods;
|
2017-11-16 11:42:11 -05:00
|
|
|
|
|
|
|
#ifdef HAVE_XKBCOMMON_COMPOSE_H
|
2017-08-26 14:25:24 -04: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;
|
2017-11-16 11:42:11 -05:00
|
|
|
#endif
|
2014-06-29 17:09:21 -04:00
|
|
|
} xkb;
|
|
|
|
|
2014-06-29 06:29:00 -04:00
|
|
|
_GLFWwindow* pointerFocus;
|
|
|
|
_GLFWwindow* keyboardFocus;
|
2014-09-02 13:42:43 -04:00
|
|
|
|
2018-01-05 15:58:10 -05: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 15:33:40 -05: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 17:53:43 -04:00
|
|
|
} _GLFWlibraryWayland;
|
|
|
|
|
2014-09-02 13:42:43 -04:00
|
|
|
// Wayland-specific per-monitor data
|
|
|
|
//
|
2014-03-17 17:53:43 -04:00
|
|
|
typedef struct _GLFWmonitorWayland
|
|
|
|
{
|
|
|
|
struct wl_output* output;
|
2019-09-30 17:17:42 -04:00
|
|
|
uint32_t name;
|
2016-12-04 19:19:48 -05:00
|
|
|
int currentMode;
|
2014-03-17 17:53:43 -04:00
|
|
|
|
|
|
|
int x;
|
|
|
|
int y;
|
2015-10-10 11:35:06 -04:00
|
|
|
int scale;
|
2016-12-04 19:19:48 -05:00
|
|
|
|
2014-03-17 17:53:43 -04:00
|
|
|
} _GLFWmonitorWayland;
|
|
|
|
|
2014-09-02 13:42:43 -04:00
|
|
|
// Wayland-specific per-cursor data
|
|
|
|
//
|
2014-03-27 12:29:22 -04:00
|
|
|
typedef struct _GLFWcursorWayland
|
|
|
|
{
|
2018-09-08 14:05:40 -04:00
|
|
|
struct wl_cursor* cursor;
|
2018-09-11 08:24:43 -04:00
|
|
|
struct wl_cursor* cursorHiDPI;
|
2014-09-09 10:37:55 -04:00
|
|
|
struct wl_buffer* buffer;
|
|
|
|
int width, height;
|
|
|
|
int xhot, yhot;
|
2018-09-08 14:05:40 -04:00
|
|
|
int currentImage;
|
2014-09-02 13:42:43 -04:00
|
|
|
} _GLFWcursorWayland;
|
2014-03-17 17:53:43 -04:00
|
|
|
|
|
|
|
|
2015-12-03 12:16:46 -05:00
|
|
|
void _glfwAddOutputWayland(uint32_t name, uint32_t version);
|
2014-03-17 17:53:43 -04:00
|
|
|
|