29#define _POSIX_C_SOURCE 199309L
36#include <linux/input.h>
41#include <sys/timerfd.h>
44#include <wayland-client.h>
47static inline int min(
int n1,
int n2)
49 return n1 < n2 ? n1 : n2;
52static _GLFWwindow* findWindowFromDecorationSurface(
struct wl_surface* surface,
61 if (surface == window->wl.decorations.top.surface)
66 if (surface == window->wl.decorations.left.surface)
71 if (surface == window->wl.decorations.right.surface)
76 if (surface == window->wl.decorations.bottom.surface)
81 window = window->
next;
86static void pointerHandleEnter(
void* data,
87 struct wl_pointer* pointer,
89 struct wl_surface* surface,
98 _GLFWwindow* window = wl_surface_get_user_data(surface);
101 window = findWindowFromDecorationSurface(surface, &focus);
106 window->wl.decorations.
focus = focus;
107 _glfw.wl.serial = serial;
108 _glfw.wl.pointerFocus = window;
116static void pointerHandleLeave(
void* data,
117 struct wl_pointer* pointer,
119 struct wl_surface* surface)
128 _glfw.wl.serial = serial;
134static void setCursor(
_GLFWwindow* window,
const char* name)
136 struct wl_buffer* buffer;
139 struct wl_surface* surface =
_glfw.wl.cursorSurface;
140 struct wl_cursor_theme* theme =
_glfw.wl.cursorTheme;
143 if (window->wl.
scale > 1 &&
_glfw.wl.cursorThemeHiDPI)
148 theme =
_glfw.wl.cursorThemeHiDPI;
155 "Wayland: Standard cursor not found");
159 image = cursor->
images[0];
167 wl_pointer_set_cursor(
_glfw.wl.pointer,
_glfw.wl.serial,
171 wl_surface_set_buffer_scale(surface, scale);
172 wl_surface_attach(surface, buffer, 0, 0);
173 wl_surface_damage(surface, 0, 0,
175 wl_surface_commit(surface);
176 _glfw.wl.cursorPreviousName = name;
179static void pointerHandleMotion(
void* data,
180 struct wl_pointer* pointer,
186 const char* cursorName =
NULL;
194 x = wl_fixed_to_double(sx);
195 y = wl_fixed_to_double(sy);
197 switch (window->wl.decorations.
focus)
200 window->wl.cursorPosX = x;
201 window->wl.cursorPosY = y;
207 cursorName =
"n-resize";
209 cursorName =
"left_ptr";
213 cursorName =
"nw-resize";
215 cursorName =
"w-resize";
219 cursorName =
"ne-resize";
221 cursorName =
"e-resize";
225 cursorName =
"sw-resize";
227 cursorName =
"se-resize";
229 cursorName =
"s-resize";
234 if (
_glfw.wl.cursorPreviousName != cursorName)
235 setCursor(window, cursorName);
238static void pointerHandleButton(
void* data,
239 struct wl_pointer* pointer,
247 uint32_t edges = XDG_TOPLEVEL_RESIZE_EDGE_NONE;
251 if (button == BTN_LEFT)
253 switch (window->wl.decorations.
focus)
259 edges = XDG_TOPLEVEL_RESIZE_EDGE_TOP;
262 xdg_toplevel_move(window->wl.xdg.toplevel,
_glfw.wl.seat, serial);
267 edges = XDG_TOPLEVEL_RESIZE_EDGE_TOP_LEFT;
269 edges = XDG_TOPLEVEL_RESIZE_EDGE_LEFT;
273 edges = XDG_TOPLEVEL_RESIZE_EDGE_TOP_RIGHT;
275 edges = XDG_TOPLEVEL_RESIZE_EDGE_RIGHT;
279 edges = XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM_LEFT;
281 edges = XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM_RIGHT;
283 edges = XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM;
288 if (edges != XDG_TOPLEVEL_RESIZE_EDGE_NONE)
290 xdg_toplevel_resize(window->wl.xdg.toplevel,
_glfw.wl.seat,
294 else if (button == BTN_RIGHT)
296 if (window->wl.decorations.
focus !=
mainWindow && window->wl.xdg.toplevel)
298 xdg_toplevel_show_window_menu(window->wl.xdg.toplevel,
299 _glfw.wl.seat, serial,
300 window->wl.cursorPosX,
301 window->wl.cursorPosY);
310 _glfw.wl.serial = serial;
314 glfwButton = button - BTN_LEFT;
318 state == WL_POINTER_BUTTON_STATE_PRESSED
321 _glfw.wl.xkb.modifiers);
324static void pointerHandleAxis(
void* data,
325 struct wl_pointer* pointer,
331 double x = 0.0, y = 0.0;
335 const double scrollFactor = 1.0 / 10.0;
340 assert(axis == WL_POINTER_AXIS_HORIZONTAL_SCROLL ||
341 axis == WL_POINTER_AXIS_VERTICAL_SCROLL);
343 if (axis == WL_POINTER_AXIS_HORIZONTAL_SCROLL)
344 x = -wl_fixed_to_double(value) * scrollFactor;
345 else if (axis == WL_POINTER_AXIS_VERTICAL_SCROLL)
346 y = -wl_fixed_to_double(value) * scrollFactor;
351static const struct wl_pointer_listener pointerListener = {
359static void keyboardHandleKeymap(
void* data,
360 struct wl_keyboard* keyboard,
365 struct xkb_keymap* keymap;
366 struct xkb_state* state;
368#ifdef HAVE_XKBCOMMON_COMPOSE_H
369 struct xkb_compose_table* composeTable;
370 struct xkb_compose_state* composeState;
376 if (format != WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1)
382 mapStr = mmap(
NULL, size, PROT_READ, MAP_SHARED, fd, 0);
383 if (mapStr == MAP_FAILED) {
390 XKB_KEYMAP_FORMAT_TEXT_V1,
392 munmap(mapStr, size);
398 "Wayland: Failed to compile keymap");
406 "Wayland: Failed to create XKB state");
412 locale = getenv(
"LC_ALL");
414 locale = getenv(
"LC_CTYPE");
416 locale = getenv(
"LANG");
420#ifdef HAVE_XKBCOMMON_COMPOSE_H
422 xkb_compose_table_new_from_locale(
_glfw.wl.xkb.
context, locale,
423 XKB_COMPOSE_COMPILE_NO_FLAGS);
427 xkb_compose_state_new(composeTable, XKB_COMPOSE_STATE_NO_FLAGS);
428 xkb_compose_table_unref(composeTable);
430 _glfw.wl.xkb.composeState = composeState;
433 "Wayland: Failed to create XKB compose state");
438 "Wayland: Failed to create XKB compose table");
444 _glfw.wl.xkb.keymap = keymap;
445 _glfw.wl.xkb.state = state;
447 _glfw.wl.xkb.controlMask =
449 _glfw.wl.xkb.altMask =
451 _glfw.wl.xkb.shiftMask =
453 _glfw.wl.xkb.superMask =
455 _glfw.wl.xkb.capsLockMask =
457 _glfw.wl.xkb.numLockMask =
461static void keyboardHandleEnter(
void* data,
462 struct wl_keyboard* keyboard,
464 struct wl_surface* surface,
465 struct wl_array* keys)
471 _GLFWwindow* window = wl_surface_get_user_data(surface);
474 window = findWindowFromDecorationSurface(surface,
NULL);
479 _glfw.wl.serial = serial;
480 _glfw.wl.keyboardFocus = window;
484static void keyboardHandleLeave(
void* data,
485 struct wl_keyboard* keyboard,
487 struct wl_surface* surface)
494 _glfw.wl.serial = serial;
499static int toGLFWKeyCode(
uint32_t key)
501 if (key <
sizeof(
_glfw.wl.keycodes) /
sizeof(
_glfw.wl.keycodes[0]))
502 return _glfw.wl.keycodes[key];
507#ifdef HAVE_XKBCOMMON_COMPOSE_H
508static xkb_keysym_t composeSymbol(xkb_keysym_t sym)
510 if (sym == XKB_KEY_NoSymbol || !
_glfw.wl.xkb.composeState)
512 if (xkb_compose_state_feed(
_glfw.wl.xkb.composeState, sym)
513 != XKB_COMPOSE_FEED_ACCEPTED)
515 switch (xkb_compose_state_get_status(
_glfw.wl.xkb.composeState))
517 case XKB_COMPOSE_COMPOSED:
518 return xkb_compose_state_get_one_sym(
_glfw.wl.xkb.composeState);
519 case XKB_COMPOSE_COMPOSING:
520 case XKB_COMPOSE_CANCELLED:
521 return XKB_KEY_NoSymbol;
522 case XKB_COMPOSE_NOTHING:
533 const xkb_keysym_t *syms;
541#ifdef HAVE_XKBCOMMON_COMPOSE_H
542 sym = composeSymbol(syms[0]);
549 const int mods =
_glfw.wl.xkb.modifiers;
558static void keyboardHandleKey(
void* data,
559 struct wl_keyboard* keyboard,
569 struct itimerspec timer = {};
574 keyCode = toGLFWKeyCode(key);
575 action = state == WL_KEYBOARD_KEY_STATE_PRESSED
578 _glfw.wl.serial = serial;
580 _glfw.wl.xkb.modifiers);
584 shouldRepeat = inputChar(window, key);
586 if (shouldRepeat &&
_glfw.wl.keyboardRepeatRate > 0)
588 _glfw.wl.keyboardLastKey = keyCode;
589 _glfw.wl.keyboardLastScancode = key;
590 if (
_glfw.wl.keyboardRepeatRate > 1)
591 timer.it_interval.tv_nsec = 1000000000 /
_glfw.wl.keyboardRepeatRate;
593 timer.it_interval.tv_sec = 1;
594 timer.it_value.tv_sec =
_glfw.wl.keyboardRepeatDelay / 1000;
595 timer.it_value.tv_nsec = (
_glfw.wl.keyboardRepeatDelay % 1000) * 1000000;
598 timerfd_settime(
_glfw.wl.timerfd, 0, &timer,
NULL);
601static void keyboardHandleModifiers(
void* data,
602 struct wl_keyboard* keyboard,
610 unsigned int modifiers = 0;
612 _glfw.wl.serial = serial;
614 if (!
_glfw.wl.xkb.keymap)
626 XKB_STATE_MODS_DEPRESSED |
627 XKB_STATE_LAYOUT_DEPRESSED |
628 XKB_STATE_MODS_LATCHED |
629 XKB_STATE_LAYOUT_LATCHED);
630 if (mask &
_glfw.wl.xkb.controlMask)
632 if (mask &
_glfw.wl.xkb.altMask)
634 if (mask &
_glfw.wl.xkb.shiftMask)
636 if (mask &
_glfw.wl.xkb.superMask)
638 if (mask &
_glfw.wl.xkb.capsLockMask)
640 if (mask &
_glfw.wl.xkb.numLockMask)
642 _glfw.wl.xkb.modifiers = modifiers;
645#ifdef WL_KEYBOARD_REPEAT_INFO_SINCE_VERSION
646static void keyboardHandleRepeatInfo(
void* data,
647 struct wl_keyboard* keyboard,
651 if (keyboard !=
_glfw.wl.keyboard)
654 _glfw.wl.keyboardRepeatRate = rate;
655 _glfw.wl.keyboardRepeatDelay = delay;
659static const struct wl_keyboard_listener keyboardListener = {
660 keyboardHandleKeymap,
664 keyboardHandleModifiers,
665#ifdef WL_KEYBOARD_REPEAT_INFO_SINCE_VERSION
666 keyboardHandleRepeatInfo,
670static void seatHandleCapabilities(
void* data,
671 struct wl_seat* seat,
672 enum wl_seat_capability caps)
674 if ((caps & WL_SEAT_CAPABILITY_POINTER) && !
_glfw.wl.pointer)
676 _glfw.wl.pointer = wl_seat_get_pointer(seat);
677 wl_pointer_add_listener(
_glfw.wl.pointer, &pointerListener,
NULL);
679 else if (!(caps & WL_SEAT_CAPABILITY_POINTER) &&
_glfw.wl.pointer)
681 wl_pointer_destroy(
_glfw.wl.pointer);
685 if ((caps & WL_SEAT_CAPABILITY_KEYBOARD) && !
_glfw.wl.keyboard)
687 _glfw.wl.keyboard = wl_seat_get_keyboard(seat);
688 wl_keyboard_add_listener(
_glfw.wl.keyboard, &keyboardListener,
NULL);
690 else if (!(caps & WL_SEAT_CAPABILITY_KEYBOARD) &&
_glfw.wl.keyboard)
692 wl_keyboard_destroy(
_glfw.wl.keyboard);
697static void seatHandleName(
void* data,
698 struct wl_seat* seat,
703static const struct wl_seat_listener seatListener = {
704 seatHandleCapabilities,
708static void dataOfferHandleOffer(
void* data,
709 struct wl_data_offer* dataOffer,
710 const char* mimeType)
714static const struct wl_data_offer_listener dataOfferListener = {
715 dataOfferHandleOffer,
718static void dataDeviceHandleDataOffer(
void* data,
719 struct wl_data_device* dataDevice,
720 struct wl_data_offer*
id)
722 if (
_glfw.wl.dataOffer)
723 wl_data_offer_destroy(
_glfw.wl.dataOffer);
726 wl_data_offer_add_listener(
_glfw.wl.dataOffer, &dataOfferListener,
NULL);
729static void dataDeviceHandleEnter(
void* data,
730 struct wl_data_device* dataDevice,
732 struct wl_surface *surface,
735 struct wl_data_offer *
id)
739static void dataDeviceHandleLeave(
void* data,
740 struct wl_data_device* dataDevice)
744static void dataDeviceHandleMotion(
void* data,
745 struct wl_data_device* dataDevice,
752static void dataDeviceHandleDrop(
void* data,
753 struct wl_data_device* dataDevice)
757static void dataDeviceHandleSelection(
void* data,
758 struct wl_data_device* dataDevice,
759 struct wl_data_offer*
id)
763static const struct wl_data_device_listener dataDeviceListener = {
764 dataDeviceHandleDataOffer,
765 dataDeviceHandleEnter,
766 dataDeviceHandleLeave,
767 dataDeviceHandleMotion,
768 dataDeviceHandleDrop,
769 dataDeviceHandleSelection,
772static void wmBaseHandlePing(
void* data,
773 struct xdg_wm_base* wmBase,
776 xdg_wm_base_pong(wmBase, serial);
779static const struct xdg_wm_base_listener wmBaseListener = {
783static void registryHandleGlobal(
void* data,
784 struct wl_registry* registry,
786 const char* interface,
789 if (strcmp(interface,
"wl_compositor") == 0)
791 _glfw.wl.compositorVersion = min(3, version);
792 _glfw.wl.compositor =
793 wl_registry_bind(registry, name, &wl_compositor_interface,
794 _glfw.wl.compositorVersion);
796 else if (strcmp(interface,
"wl_subcompositor") == 0)
798 _glfw.wl.subcompositor =
799 wl_registry_bind(registry, name, &wl_subcompositor_interface, 1);
801 else if (strcmp(interface,
"wl_shm") == 0)
804 wl_registry_bind(registry, name, &wl_shm_interface, 1);
806 else if (strcmp(interface,
"wl_output") == 0)
810 else if (strcmp(interface,
"wl_seat") == 0)
814 _glfw.wl.seatVersion = min(4, version);
816 wl_registry_bind(registry, name, &wl_seat_interface,
817 _glfw.wl.seatVersion);
818 wl_seat_add_listener(
_glfw.wl.seat, &seatListener,
NULL);
821 else if (strcmp(interface,
"wl_data_device_manager") == 0)
823 if (!
_glfw.wl.dataDeviceManager)
825 _glfw.wl.dataDeviceManager =
826 wl_registry_bind(registry, name,
827 &wl_data_device_manager_interface, 1);
830 else if (strcmp(interface,
"xdg_wm_base") == 0)
833 wl_registry_bind(registry, name, &xdg_wm_base_interface, 1);
834 xdg_wm_base_add_listener(
_glfw.wl.wmBase, &wmBaseListener,
NULL);
836 else if (strcmp(interface,
"zxdg_decoration_manager_v1") == 0)
838 _glfw.wl.decorationManager =
839 wl_registry_bind(registry, name,
840 &zxdg_decoration_manager_v1_interface,
843 else if (strcmp(interface,
"wp_viewporter") == 0)
845 _glfw.wl.viewporter =
846 wl_registry_bind(registry, name, &wp_viewporter_interface, 1);
848 else if (strcmp(interface,
"zwp_relative_pointer_manager_v1") == 0)
850 _glfw.wl.relativePointerManager =
851 wl_registry_bind(registry, name,
852 &zwp_relative_pointer_manager_v1_interface,
855 else if (strcmp(interface,
"zwp_pointer_constraints_v1") == 0)
857 _glfw.wl.pointerConstraints =
858 wl_registry_bind(registry, name,
859 &zwp_pointer_constraints_v1_interface,
862 else if (strcmp(interface,
"zwp_idle_inhibit_manager_v1") == 0)
864 _glfw.wl.idleInhibitManager =
865 wl_registry_bind(registry, name,
866 &zwp_idle_inhibit_manager_v1_interface,
871static void registryHandleGlobalRemove(
void *data,
872 struct wl_registry *registry,
881 if (monitor->wl.
name == name)
890static const struct wl_registry_listener registryListener = {
891 registryHandleGlobal,
892 registryHandleGlobalRemove
897static void createKeyTables(
void)
901 memset(
_glfw.wl.keycodes, -1,
sizeof(
_glfw.wl.keycodes));
902 memset(
_glfw.wl.scancodes, -1,
sizeof(
_glfw.wl.scancodes));
1022 for (scancode = 0; scancode < 256; scancode++)
1024 if (
_glfw.wl.keycodes[scancode] > 0)
1025 _glfw.wl.scancodes[
_glfw.wl.keycodes[scancode]] = scancode;
1036 const char *cursorTheme;
1037 const char *cursorSizeStr;
1038 char *cursorSizeEnd;
1039 long cursorSizeLong;
1046 "Wayland: Failed to open libwayland-cursor");
1063 "Wayland: Failed to open libwayland-egl");
1078 "Wayland: Failed to open libxkbcommon");
1105#ifdef HAVE_XKBCOMMON_COMPOSE_H
1106 _glfw.wl.xkb.compose_table_new_from_locale = (PFN_xkb_compose_table_new_from_locale)
1108 _glfw.wl.xkb.compose_table_unref = (PFN_xkb_compose_table_unref)
1110 _glfw.wl.xkb.compose_state_new = (PFN_xkb_compose_state_new)
1112 _glfw.wl.xkb.compose_state_unref = (PFN_xkb_compose_state_unref)
1114 _glfw.wl.xkb.compose_state_feed = (PFN_xkb_compose_state_feed)
1116 _glfw.wl.xkb.compose_state_get_status = (PFN_xkb_compose_state_get_status)
1118 _glfw.wl.xkb.compose_state_get_one_sym = (PFN_xkb_compose_state_get_one_sym)
1122 _glfw.wl.display = wl_display_connect(
NULL);
1123 if (!
_glfw.wl.display)
1126 "Wayland: Failed to connect to display");
1130 _glfw.wl.registry = wl_display_get_registry(
_glfw.wl.display);
1131 wl_registry_add_listener(
_glfw.wl.registry, ®istryListener,
NULL);
1139 "Wayland: Failed to initialize xkb context");
1144 wl_display_roundtrip(
_glfw.wl.display);
1147 wl_display_roundtrip(
_glfw.wl.display);
1151 _glfw.wl.timerfd = -1;
1152 if (
_glfw.wl.seatVersion >= 4)
1153 _glfw.wl.timerfd = timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC);
1155 if (!
_glfw.wl.wmBase)
1158 "Wayland: Failed to find xdg-shell in your compositor");
1164 cursorTheme = getenv(
"XCURSOR_THEME");
1165 cursorSizeStr = getenv(
"XCURSOR_SIZE");
1170 cursorSizeLong = strtol(cursorSizeStr, &cursorSizeEnd, 10);
1171 if (!*cursorSizeEnd && !errno && cursorSizeLong > 0 && cursorSizeLong <= INT_MAX)
1172 cursorSize = (int)cursorSizeLong;
1174 _glfw.wl.cursorTheme =
1176 if (!
_glfw.wl.cursorTheme)
1179 "Wayland: Unable to load default cursor theme");
1183 _glfw.wl.cursorThemeHiDPI =
1185 _glfw.wl.cursorSurface =
1186 wl_compositor_create_surface(
_glfw.wl.compositor);
1187 _glfw.wl.cursorTimerfd = timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC);
1190 if (
_glfw.wl.seat &&
_glfw.wl.dataDeviceManager)
1192 _glfw.wl.dataDevice =
1193 wl_data_device_manager_get_data_device(
_glfw.wl.dataDeviceManager,
1195 wl_data_device_add_listener(
_glfw.wl.dataDevice, &dataDeviceListener,
NULL);
1196 _glfw.wl.clipboardString = malloc(4096);
1197 if (!
_glfw.wl.clipboardString)
1200 "Wayland: Unable to allocate clipboard memory");
1203 _glfw.wl.clipboardSize = 4096;
1218#ifdef HAVE_XKBCOMMON_COMPOSE_H
1219 if (
_glfw.wl.xkb.composeState)
1220 xkb_compose_state_unref(
_glfw.wl.xkb.composeState);
1222 if (
_glfw.wl.xkb.keymap)
1224 if (
_glfw.wl.xkb.state)
1234 if (
_glfw.wl.cursorTheme)
1236 if (
_glfw.wl.cursorThemeHiDPI)
1244 if (
_glfw.wl.cursorSurface)
1245 wl_surface_destroy(
_glfw.wl.cursorSurface);
1246 if (
_glfw.wl.subcompositor)
1247 wl_subcompositor_destroy(
_glfw.wl.subcompositor);
1248 if (
_glfw.wl.compositor)
1249 wl_compositor_destroy(
_glfw.wl.compositor);
1251 wl_shm_destroy(
_glfw.wl.shm);
1252 if (
_glfw.wl.viewporter)
1253 wp_viewporter_destroy(
_glfw.wl.viewporter);
1254 if (
_glfw.wl.decorationManager)
1255 zxdg_decoration_manager_v1_destroy(
_glfw.wl.decorationManager);
1256 if (
_glfw.wl.wmBase)
1257 xdg_wm_base_destroy(
_glfw.wl.wmBase);
1258 if (
_glfw.wl.dataSource)
1259 wl_data_source_destroy(
_glfw.wl.dataSource);
1260 if (
_glfw.wl.dataDevice)
1261 wl_data_device_destroy(
_glfw.wl.dataDevice);
1262 if (
_glfw.wl.dataOffer)
1263 wl_data_offer_destroy(
_glfw.wl.dataOffer);
1264 if (
_glfw.wl.dataDeviceManager)
1265 wl_data_device_manager_destroy(
_glfw.wl.dataDeviceManager);
1266 if (
_glfw.wl.pointer)
1267 wl_pointer_destroy(
_glfw.wl.pointer);
1268 if (
_glfw.wl.keyboard)
1269 wl_keyboard_destroy(
_glfw.wl.keyboard);
1271 wl_seat_destroy(
_glfw.wl.seat);
1272 if (
_glfw.wl.relativePointerManager)
1273 zwp_relative_pointer_manager_v1_destroy(
_glfw.wl.relativePointerManager);
1274 if (
_glfw.wl.pointerConstraints)
1275 zwp_pointer_constraints_v1_destroy(
_glfw.wl.pointerConstraints);
1276 if (
_glfw.wl.idleInhibitManager)
1277 zwp_idle_inhibit_manager_v1_destroy(
_glfw.wl.idleInhibitManager);
1278 if (
_glfw.wl.registry)
1279 wl_registry_destroy(
_glfw.wl.registry);
1280 if (
_glfw.wl.display)
1282 wl_display_flush(
_glfw.wl.display);
1283 wl_display_disconnect(
_glfw.wl.display);
1286 if (
_glfw.wl.timerfd >= 0)
1287 close(
_glfw.wl.timerfd);
1288 if (
_glfw.wl.cursorTimerfd >= 0)
1289 close(
_glfw.wl.cursorTimerfd);
1291 if (
_glfw.wl.clipboardString)
1292 free(
_glfw.wl.clipboardString);
1293 if (
_glfw.wl.clipboardSendString)
1294 free(
_glfw.wl.clipboardSendString);
1300#if defined(_POSIX_TIMERS) && defined(_POSIX_MONOTONIC_CLOCK)
1306#if defined(_GLFW_BUILD_DLL)
void _glfwPlatformSetCursor(_GLFWwindow *window, _GLFWcursor *cursor)
void _glfwTerminateEGL(void)
#define GLFW_CURSOR_DISABLED
#define GLFW_DISCONNECTED
#define GLFW_PLATFORM_ERROR
A platform-specific error occurred that does not match any of the more specific categories.
#define GLFW_KEY_NUM_LOCK
#define GLFW_KEY_KP_DECIMAL
#define GLFW_KEY_KP_ENTER
#define GLFW_KEY_APOSTROPHE
#define GLFW_KEY_RIGHT_ALT
#define GLFW_KEY_BACKSPACE
#define GLFW_KEY_GRAVE_ACCENT
#define GLFW_KEY_LEFT_ALT
#define GLFW_KEY_SEMICOLON
#define GLFW_KEY_RIGHT_BRACKET
#define GLFW_KEY_LEFT_SHIFT
#define GLFW_KEY_CAPS_LOCK
#define GLFW_KEY_KP_MULTIPLY
#define GLFW_KEY_LEFT_CONTROL
#define GLFW_KEY_KP_SUBTRACT
#define GLFW_KEY_BACKSLASH
#define GLFW_KEY_KP_DIVIDE
#define GLFW_KEY_LEFT_BRACKET
#define GLFW_KEY_RIGHT_CONTROL
#define GLFW_KEY_RIGHT_SUPER
#define GLFW_KEY_KP_EQUAL
#define GLFW_KEY_PAGE_DOWN
#define GLFW_KEY_SCROLL_LOCK
#define GLFW_KEY_PRINT_SCREEN
#define GLFW_KEY_LEFT_SUPER
#define GLFW_KEY_RIGHT_SHIFT
#define GLFW_MOD_SHIFT
If this bit is set one or more Shift keys were held down.
#define GLFW_MOD_NUM_LOCK
If this bit is set the Num Lock key is enabled.
#define GLFW_MOD_SUPER
If this bit is set one or more Super keys were held down.
#define GLFW_MOD_CONTROL
If this bit is set one or more Control keys were held down.
#define GLFW_MOD_ALT
If this bit is set one or more Alt keys were held down.
#define GLFW_MOD_CAPS_LOCK
If this bit is set the Caps Lock key is enabled.
void _glfwInputError(int code, const char *format,...)
void _glfwInputMonitor(_GLFWmonitor *monitor, int action, int placement)
#define _GLFW_VERSION_NUMBER
void _glfwInputWindowFocus(_GLFWwindow *window, GLFWbool focused)
void _glfwInitTimerPOSIX(void)
_GLFWwindow * windowListHead
struct _GLFWwindow * next
GLFWwindowcontentscalefun scale
struct wl_cursor_image ** images
const char * _glfwPlatformGetVersionString(void)
void _glfwPlatformTerminate(void)
int _glfwPlatformInit(void)
void _glfwAddOutputWayland(uint32_t name, uint32_t version)
long _glfwKeySym2Unicode(unsigned int keysym)