22 #include "../../SDL_internal.h"
24 #if SDL_VIDEO_DRIVER_WAYLAND
29 #include "../../core/unix/SDL_poll.h"
30 #include "../../events/SDL_sysevents.h"
31 #include "../../events/SDL_events_c.h"
32 #include "../../events/scancodes_xfree86.h"
40 #include "pointer-constraints-unstable-v1-client-protocol.h"
41 #include "relative-pointer-unstable-v1-client-protocol.h"
42 #include "xdg-shell-client-protocol.h"
43 #include "xdg-shell-unstable-v6-client-protocol.h"
45 #ifdef SDL_INPUT_LINUXEV
46 #include <linux/input.h>
48 #define BTN_LEFT (0x110)
49 #define BTN_RIGHT (0x111)
50 #define BTN_MIDDLE (0x112)
51 #define BTN_SIDE (0x113)
52 #define BTN_EXTRA (0x114)
54 #include <sys/select.h>
58 #include <xkbcommon/xkbcommon.h>
70 } SDL_WaylandKeyboardRepeat;
72 struct SDL_WaylandInput {
76 struct wl_touch *touch;
77 struct wl_keyboard *keyboard;
79 struct zwp_relative_pointer_v1 *relative_pointer;
80 struct zwp_confined_pointer_v1 *confined_pointer;
93 struct xkb_keymap *keymap;
94 struct xkb_state *
state;
104 } pointer_curr_axis_info;
106 SDL_WaylandKeyboardRepeat keyboard_repeat;
109 struct SDL_WaylandTouchPoint {
115 struct SDL_WaylandTouchPoint* prev;
116 struct SDL_WaylandTouchPoint* next;
119 struct SDL_WaylandTouchPointList {
120 struct SDL_WaylandTouchPoint*
head;
121 struct SDL_WaylandTouchPoint*
tail;
124 static struct SDL_WaylandTouchPointList touch_points = {
NULL,
NULL};
129 struct SDL_WaylandTouchPoint* tp =
SDL_malloc(
sizeof(
struct SDL_WaylandTouchPoint));
136 if (touch_points.tail) {
137 touch_points.tail->next = tp;
138 tp->prev = touch_points.tail;
140 touch_points.head = tp;
144 touch_points.tail = tp;
151 struct SDL_WaylandTouchPoint* tp = touch_points.head;
166 struct SDL_WaylandTouchPoint* tp = touch_points.head;
175 tp->prev->next = tp->next;
177 touch_points.head = tp->next;
181 tp->next->prev = tp->prev;
183 touch_points.tail = tp->prev;
187 struct SDL_WaylandTouchPoint *next = tp->next;
197 static struct wl_surface*
200 struct SDL_WaylandTouchPoint* tp = touch_points.head;
215 keyboard_repeat_handle(SDL_WaylandKeyboardRepeat* repeat_info,
uint32_t now)
217 if (!repeat_info->is_key_down || !repeat_info->is_initialized) {
220 while (repeat_info->next_repeat_ms <= now) {
224 if (repeat_info->text[0]) {
227 repeat_info->next_repeat_ms += 1000 / repeat_info->repeat_rate;
232 keyboard_repeat_clear(SDL_WaylandKeyboardRepeat* repeat_info) {
233 if (!repeat_info->is_initialized) {
240 keyboard_repeat_set(SDL_WaylandKeyboardRepeat* repeat_info,
242 if (!repeat_info->is_initialized) {
245 repeat_info->is_key_down =
SDL_TRUE;
246 repeat_info->next_repeat_ms =
SDL_GetTicks() + repeat_info->repeat_delay;
247 repeat_info->scancode = scancode;
251 repeat_info->text[0] =
'\0';
259 struct SDL_WaylandInput *
input =
d->input;
262 WAYLAND_wl_display_flush(
d->display);
266 keyboard_repeat_handle(&
input->keyboard_repeat, now);
270 err = WAYLAND_wl_display_dispatch(
d->display);
272 err = WAYLAND_wl_display_dispatch_pending(
d->display);
274 if (err == -1 && !
d->display_disconnected) {
278 d->display_disconnected = 1;
286 pointer_handle_motion(
void *
data,
struct wl_pointer *
pointer,
293 if (
input->pointer_focus) {
294 const int sx = wl_fixed_to_int(sx_w);
295 const int sy = wl_fixed_to_int(sy_w);
301 pointer_handle_enter(
void *
data,
struct wl_pointer *
pointer,
303 wl_fixed_t sx_w, wl_fixed_t sy_w)
327 pointer_handle_motion(
data,
pointer, serial, sx_w, sy_w);
332 pointer_handle_leave(
void *
data,
struct wl_pointer *
pointer,
337 if (
input->pointer_focus) {
344 ProcessHitTest(
struct SDL_WaylandInput *
input,
uint32_t serial)
353 static const uint32_t directions_wl[] = {
354 WL_SHELL_SURFACE_RESIZE_TOP_LEFT, WL_SHELL_SURFACE_RESIZE_TOP,
355 WL_SHELL_SURFACE_RESIZE_TOP_RIGHT, WL_SHELL_SURFACE_RESIZE_RIGHT,
356 WL_SHELL_SURFACE_RESIZE_BOTTOM_RIGHT, WL_SHELL_SURFACE_RESIZE_BOTTOM,
357 WL_SHELL_SURFACE_RESIZE_BOTTOM_LEFT, WL_SHELL_SURFACE_RESIZE_LEFT
362 const uint32_t *directions_zxdg = directions_wl;
366 if (
input->display->shell.xdg) {
368 }
else if (
input->display->shell.zxdg) {
383 if (
input->display->shell.xdg) {
385 }
else if (
input->display->shell.zxdg) {
400 pointer_handle_button_common(
struct SDL_WaylandInput *
input,
uint32_t serial,
404 enum wl_pointer_button_state
state = state_w;
407 if (
input->pointer_focus) {
411 if (ProcessHitTest(
input, serial)) {
448 pointer_handle_axis_common_v1(
struct SDL_WaylandInput *
input,
452 enum wl_pointer_axis
a =
axis;
455 if (
input->pointer_focus) {
457 case WL_POINTER_AXIS_VERTICAL_SCROLL:
459 y = 0 - (float)wl_fixed_to_double(
value);
461 case WL_POINTER_AXIS_HORIZONTAL_SCROLL:
462 x = 0 - (float)wl_fixed_to_double(
value);
474 pointer_handle_axis_common(
struct SDL_WaylandInput *
input,
SDL_bool discrete,
477 enum wl_pointer_axis
a =
axis;
479 if (
input->pointer_focus) {
481 case WL_POINTER_AXIS_VERTICAL_SCROLL:
486 }
else if(
input->pointer_curr_axis_info.is_y_discrete) {
491 input->pointer_curr_axis_info.y = 0 - (float)wl_fixed_to_double(
value);
493 case WL_POINTER_AXIS_HORIZONTAL_SCROLL:
498 }
else if(
input->pointer_curr_axis_info.is_x_discrete) {
503 input->pointer_curr_axis_info.x = 0 - (float)wl_fixed_to_double(
value);
510 pointer_handle_axis(
void *
data,
struct wl_pointer *
pointer,
515 if(wl_seat_get_version(
input->seat) >= 5)
522 pointer_handle_frame(
void *
data,
struct wl_pointer *
pointer)
526 float x =
input->pointer_curr_axis_info.x,
y =
input->pointer_curr_axis_info.y;
529 memset(&
input->pointer_curr_axis_info, 0,
sizeof input->pointer_curr_axis_info);
531 if(
x == 0.0f &&
y == 0.0f)
538 pointer_handle_axis_source(
void *
data,
struct wl_pointer *
pointer,
545 pointer_handle_axis_stop(
void *
data,
struct wl_pointer *
pointer,
552 pointer_handle_axis_discrete(
void *
data,
struct wl_pointer *
pointer,
561 static const struct wl_pointer_listener pointer_listener = {
562 pointer_handle_enter,
563 pointer_handle_leave,
564 pointer_handle_motion,
565 pointer_handle_button,
567 pointer_handle_frame,
568 pointer_handle_axis_source,
569 pointer_handle_axis_stop,
570 pointer_handle_axis_discrete,
574 touch_handler_down(
void *
data,
struct wl_touch *touch,
unsigned int serial,
575 unsigned int timestamp,
struct wl_surface *
surface,
576 int id, wl_fixed_t fx, wl_fixed_t fy)
579 const double dblx = wl_fixed_to_double(fx);
580 const double dbly = wl_fixed_to_double(fy);
590 touch_handler_up(
void *
data,
struct wl_touch *touch,
unsigned int serial,
591 unsigned int timestamp,
int id)
608 touch_handler_motion(
void *
data,
struct wl_touch *touch,
unsigned int timestamp,
609 int id, wl_fixed_t fx, wl_fixed_t fy)
612 const double dblx = wl_fixed_to_double(fx);
613 const double dbly = wl_fixed_to_double(fy);
617 touch_update(
id,
x,
y);
622 touch_handler_frame(
void *
data,
struct wl_touch *touch)
628 touch_handler_cancel(
void *
data,
struct wl_touch *touch)
633 static const struct wl_touch_listener touch_listener = {
636 touch_handler_motion,
638 touch_handler_cancel,
644 keyboard_handle_keymap(
void *
data,
struct wl_keyboard *keyboard,
655 if (
format != WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1) {
660 map_str = mmap(
NULL,
size, PROT_READ, MAP_SHARED,
fd, 0);
661 if (map_str == MAP_FAILED) {
666 input->xkb.keymap = WAYLAND_xkb_keymap_new_from_string(
input->display->xkb_context,
668 XKB_KEYMAP_FORMAT_TEXT_V1,
670 munmap(map_str,
size);
673 if (!
input->xkb.keymap) {
674 fprintf(stderr,
"failed to compile keymap\n");
678 input->xkb.state = WAYLAND_xkb_state_new(
input->xkb.keymap);
679 if (!
input->xkb.state) {
680 fprintf(stderr,
"failed to create XKB state\n");
681 WAYLAND_xkb_keymap_unref(
input->xkb.keymap);
688 keyboard_handle_enter(
void *
data,
struct wl_keyboard *keyboard,
690 struct wl_array *keys)
710 keyboard_handle_leave(
void *
data,
struct wl_keyboard *keyboard,
720 const xkb_keysym_t *syms;
727 if (WAYLAND_xkb_state_key_get_syms(
input->xkb.state,
key + 8, &syms) != 1) {
731 return WAYLAND_xkb_keysym_to_utf8(syms[0],
text, 8) > 0;
735 keyboard_handle_key(
void *
data,
struct wl_keyboard *keyboard,
740 enum wl_keyboard_key_state
state = state_w;
753 if (
state == WL_KEYBOARD_KEY_STATE_PRESSED) {
759 keyboard_repeat_set(&
input->keyboard_repeat, scancode, has_text,
text);
761 keyboard_repeat_clear(&
input->keyboard_repeat);
766 keyboard_handle_modifiers(
void *
data,
struct wl_keyboard *keyboard,
773 WAYLAND_xkb_state_update_mask(
input->xkb.state, mods_depressed, mods_latched,
774 mods_locked, 0, 0,
group);
778 keyboard_handle_repeat_info(
void *
data,
struct wl_keyboard *wl_keyboard,
783 input->keyboard_repeat.repeat_delay = delay;
787 static const struct wl_keyboard_listener keyboard_listener = {
788 keyboard_handle_keymap,
789 keyboard_handle_enter,
790 keyboard_handle_leave,
792 keyboard_handle_modifiers,
793 keyboard_handle_repeat_info,
797 seat_handle_capabilities(
void *
data,
struct wl_seat *seat,
798 enum wl_seat_capability caps)
802 if ((caps & WL_SEAT_CAPABILITY_POINTER) && !
input->pointer) {
803 input->pointer = wl_seat_get_pointer(seat);
804 memset(&
input->pointer_curr_axis_info, 0,
sizeof input->pointer_curr_axis_info);
806 wl_pointer_set_user_data(
input->pointer,
input);
807 wl_pointer_add_listener(
input->pointer, &pointer_listener,
809 }
else if (!(caps & WL_SEAT_CAPABILITY_POINTER) &&
input->pointer) {
810 wl_pointer_destroy(
input->pointer);
815 if ((caps & WL_SEAT_CAPABILITY_TOUCH) && !
input->touch) {
817 input->touch = wl_seat_get_touch(seat);
819 wl_touch_add_listener(
input->touch, &touch_listener,
821 }
else if (!(caps & WL_SEAT_CAPABILITY_TOUCH) &&
input->touch) {
823 wl_touch_destroy(
input->touch);
827 if ((caps & WL_SEAT_CAPABILITY_KEYBOARD) && !
input->keyboard) {
828 input->keyboard = wl_seat_get_keyboard(seat);
829 wl_keyboard_set_user_data(
input->keyboard,
input);
830 wl_keyboard_add_listener(
input->keyboard, &keyboard_listener,
832 }
else if (!(caps & WL_SEAT_CAPABILITY_KEYBOARD) &&
input->keyboard) {
833 wl_keyboard_destroy(
input->keyboard);
839 seat_handle_name(
void *
data,
struct wl_seat *wl_seat,
const char *
name)
844 static const struct wl_seat_listener seat_listener = {
845 seat_handle_capabilities,
850 data_source_handle_target(
void *
data,
struct wl_data_source *wl_data_source,
851 const char *mime_type)
856 data_source_handle_send(
void *
data,
struct wl_data_source *wl_data_source,
863 data_source_handle_cancelled(
void *
data,
struct wl_data_source *wl_data_source)
869 data_source_handle_dnd_drop_performed(
void *
data,
struct wl_data_source *wl_data_source)
874 data_source_handle_dnd_finished(
void *
data,
struct wl_data_source *wl_data_source)
879 data_source_handle_action(
void *
data,
struct wl_data_source *wl_data_source,
884 static const struct wl_data_source_listener data_source_listener = {
885 data_source_handle_target,
886 data_source_handle_send,
887 data_source_handle_cancelled,
888 data_source_handle_dnd_drop_performed,
889 data_source_handle_dnd_finished,
890 data_source_handle_action,
898 struct wl_data_source *
id =
NULL;
906 id = wl_data_device_manager_create_data_source(
913 data_source =
SDL_calloc(1,
sizeof *data_source);
914 if (data_source ==
NULL) {
916 wl_data_source_destroy(
id);
918 WAYLAND_wl_list_init(&(data_source->
mimes));
920 wl_data_source_set_user_data(
id, data_source);
921 wl_data_source_add_listener(
id, &data_source_listener,
930 data_offer_handle_offer(
void *
data,
struct wl_data_offer *wl_data_offer,
931 const char *mime_type)
938 data_offer_handle_source_actions(
void *
data,
struct wl_data_offer *wl_data_offer,
944 data_offer_handle_actions(
void *
data,
struct wl_data_offer *wl_data_offer,
949 static const struct wl_data_offer_listener data_offer_listener = {
950 data_offer_handle_offer,
951 data_offer_handle_source_actions,
952 data_offer_handle_actions,
956 data_device_handle_data_offer(
void *
data,
struct wl_data_device *wl_data_device,
957 struct wl_data_offer *
id)
961 data_offer =
SDL_calloc(1,
sizeof *data_offer);
962 if (data_offer ==
NULL) {
967 WAYLAND_wl_list_init(&(data_offer->
mimes));
968 wl_data_offer_set_user_data(
id, data_offer);
969 wl_data_offer_add_listener(
id, &data_offer_listener, data_offer);
974 data_device_handle_enter(
void *
data,
struct wl_data_device *wl_data_device,
976 wl_fixed_t
x, wl_fixed_t
y,
struct wl_data_offer *
id)
980 uint32_t dnd_action = WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE;
985 data_device->
drag_offer = wl_data_offer_get_user_data(
id);
992 wl_data_offer_accept(
id, serial,
997 dnd_action = WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY;
1001 dnd_action, dnd_action);
1007 data_device_handle_leave(
void *
data,
struct wl_data_device *wl_data_device)
1019 data_device_handle_motion(
void *
data,
struct wl_data_device *wl_data_device,
1025 data_device_handle_drop(
void *
data,
struct wl_data_device *wl_data_device)
1031 const char *current_uri =
NULL;
1032 const char *last_char =
NULL;
1033 char *current_char =
NULL;
1041 current_uri = (
const char *)
buffer;
1043 for (current_char =
buffer; current_char < last_char; ++current_char) {
1044 if (*current_char ==
'\n' || *current_char == 0) {
1045 if (*current_uri != 0 && *current_uri !=
'#') {
1049 current_uri = (
const char *)current_char + 1;
1058 data_device_handle_selection(
void *
data,
struct wl_data_device *wl_data_device,
1059 struct wl_data_offer *
id)
1065 offer = wl_data_offer_get_user_data(
id);
1076 static const struct wl_data_device_listener data_device_listener = {
1077 data_device_handle_data_offer,
1078 data_device_handle_enter,
1079 data_device_handle_leave,
1080 data_device_handle_motion,
1081 data_device_handle_drop,
1082 data_device_handle_selection
1088 struct SDL_WaylandInput *
input;
1096 input->seat = wl_registry_bind(
d->registry,
id, &wl_seat_interface,
SDL_min(5, version));
1097 input->sx_w = wl_fixed_from_int(0);
1098 input->sy_w = wl_fixed_from_int(0);
1101 if (
d->data_device_manager !=
NULL) {
1102 data_device =
SDL_calloc(1,
sizeof *data_device);
1103 if (data_device ==
NULL) {
1107 data_device->
data_device = wl_data_device_manager_get_data_device(
1108 d->data_device_manager,
input->seat
1115 wl_data_device_set_user_data(data_device->
data_device, data_device);
1116 wl_data_device_add_listener(data_device->
data_device,
1117 &data_device_listener, data_device);
1118 input->data_device = data_device;
1122 wl_seat_add_listener(
input->seat, &seat_listener,
input);
1125 WAYLAND_wl_display_flush(
d->display);
1130 struct SDL_WaylandInput *
input =
d->input;
1137 if (
input->data_device->selection_offer !=
NULL) {
1140 if (
input->data_device->drag_offer !=
NULL) {
1143 if (
input->data_device->data_device !=
NULL) {
1144 wl_data_device_release(
input->data_device->data_device);
1149 if (
input->keyboard)
1150 wl_keyboard_destroy(
input->keyboard);
1153 wl_pointer_destroy(
input->pointer);
1157 wl_touch_destroy(
input->touch);
1161 wl_seat_destroy(
input->seat);
1163 if (
input->xkb.state)
1164 WAYLAND_xkb_state_unref(
input->xkb.state);
1166 if (
input->xkb.keymap)
1167 WAYLAND_xkb_keymap_unref(
input->xkb.keymap);
1179 return input->data_device;
1185 d->relative_pointer_manager =
1186 wl_registry_bind(
d->registry,
id,
1187 &zwp_relative_pointer_manager_v1_interface, 1);
1192 if (
d->relative_pointer_manager)
1193 zwp_relative_pointer_manager_v1_destroy(
d->relative_pointer_manager);
1198 d->pointer_constraints =
1199 wl_registry_bind(
d->registry,
id,
1200 &zwp_pointer_constraints_v1_interface, 1);
1205 if (
d->pointer_constraints)
1206 zwp_pointer_constraints_v1_destroy(
d->pointer_constraints);
1210 relative_pointer_handle_relative_motion(
void *
data,
1211 struct zwp_relative_pointer_v1 *
pointer,
1216 wl_fixed_t dx_unaccel_w,
1217 wl_fixed_t dy_unaccel_w)
1227 dx_unaccel = wl_fixed_to_double(dx_unaccel_w);
1228 dy_unaccel = wl_fixed_to_double(dy_unaccel_w);
1231 dx_unaccel +=
input->dx_frac;
1232 dy_unaccel +=
input->dy_frac;
1234 input->dx_frac = modf(dx_unaccel, &dx);
1235 input->dy_frac = modf(dy_unaccel, &dy);
1237 if (
input->pointer_focus &&
d->relative_mouse_mode) {
1242 static const struct zwp_relative_pointer_v1_listener relative_pointer_listener = {
1243 relative_pointer_handle_relative_motion,
1247 locked_pointer_locked(
void *
data,
1248 struct zwp_locked_pointer_v1 *locked_pointer)
1253 locked_pointer_unlocked(
void *
data,
1254 struct zwp_locked_pointer_v1 *locked_pointer)
1258 static const struct zwp_locked_pointer_v1_listener locked_pointer_listener = {
1259 locked_pointer_locked,
1260 locked_pointer_unlocked,
1265 struct SDL_WaylandInput *
input)
1269 struct zwp_locked_pointer_v1 *locked_pointer;
1271 if (
w->locked_pointer)
1275 zwp_pointer_constraints_v1_lock_pointer(
d->pointer_constraints,
1279 ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_PERSISTENT);
1280 zwp_locked_pointer_v1_add_listener(locked_pointer,
1281 &locked_pointer_listener,
1284 w->locked_pointer = locked_pointer;
1287 static void pointer_confine_destroy(
struct SDL_WaylandInput *
input)
1289 if (
input->confined_pointer) {
1290 zwp_confined_pointer_v1_destroy(
input->confined_pointer);
1300 struct zwp_relative_pointer_v1 *relative_pointer;
1302 if (!
d->relative_pointer_manager)
1305 if (!
d->pointer_constraints)
1308 if (!
input->pointer)
1313 pointer_confine_destroy(
input);
1315 if (!
input->relative_pointer) {
1317 zwp_relative_pointer_manager_v1_get_relative_pointer(
1318 d->relative_pointer_manager,
1320 zwp_relative_pointer_v1_add_listener(relative_pointer,
1321 &relative_pointer_listener,
1323 input->relative_pointer = relative_pointer;
1329 d->relative_mouse_mode = 1;
1343 if (
w->locked_pointer)
1344 zwp_locked_pointer_v1_destroy(
w->locked_pointer);
1345 w->locked_pointer =
NULL;
1348 zwp_relative_pointer_v1_destroy(
input->relative_pointer);
1351 d->relative_mouse_mode = 0;
1353 if (
input->confined_pointer_window)
1360 confined_pointer_confined(
void *
data,
1361 struct zwp_confined_pointer_v1 *confined_pointer)
1366 confined_pointer_unconfined(
void *
data,
1367 struct zwp_confined_pointer_v1 *confined_pointer)
1371 static const struct zwp_confined_pointer_v1_listener confined_pointer_listener = {
1372 confined_pointer_confined,
1373 confined_pointer_unconfined,
1380 struct zwp_confined_pointer_v1 *confined_pointer;
1382 if (!
d->pointer_constraints)
1385 if (!
input->pointer)
1390 if (
input->confined_pointer)
1397 if (
d->relative_mouse_mode)
1401 zwp_pointer_constraints_v1_confine_pointer(
d->pointer_constraints,
1405 ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_PERSISTENT);
1406 zwp_confined_pointer_v1_add_listener(confined_pointer,
1407 &confined_pointer_listener,
1410 input->confined_pointer = confined_pointer;
1416 pointer_confine_destroy(
input);
int SDL_SendClipboardUpdate(void)
int SDL_SendDropFile(SDL_Window *window, const char *file)
SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char const char SDL_SCANF_FORMAT_STRING const char return SDL_ThreadFunction const char void return Uint32 return Uint32 SDL_AssertionHandler void SDL_SpinLock SDL_atomic_t int int return SDL_atomic_t return void void void return void return int return SDL_AudioSpec SDL_AudioSpec return int int return return int SDL_RWops int SDL_AudioSpec Uint8 ** d
#define SDL_OutOfMemory()
void SDL_SetKeyboardFocus(SDL_Window *window)
int SDL_SendKeyboardText(const char *text)
int SDL_SendKeyboardKey(Uint8 state, SDL_Scancode scancode)
#define is_initialized(M)
int SDL_SendMouseButton(SDL_Window *window, SDL_MouseID mouseID, Uint8 state, Uint8 button)
void SDL_SetMouseFocus(SDL_Window *window)
int SDL_SendMouseWheel(SDL_Window *window, SDL_MouseID mouseID, float x, float y, SDL_MouseWheelDirection direction)
int SDL_SendMouseMotion(SDL_Window *window, SDL_MouseID mouseID, int relative, int x, int y)
#define SDL_BUTTON_MIDDLE
GLint GLint GLint GLint GLint GLint y
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLint GLint GLint GLint GLint x
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
GLsizei const void * pointer
GLboolean GLboolean GLboolean GLboolean a
GLuint const GLchar * name
GLuint GLsizei GLsizei * length
GLsizei const GLfloat * value
GLenum GLenum GLenum input
GLubyte GLubyte GLubyte GLubyte w
int SDL_IOReady(int fd, SDL_bool forWrite, int timeoutMS)
#define SDL_arraysize(array)
SDL_VideoDevice * SDL_GetVideoDevice(void)
Uint32 SDL_GetTicks(void)
Get the number of milliseconds since the SDL library initialization.
int SDL_SendTouch(SDL_TouchID id, SDL_FingerID fingerid, SDL_Window *window, SDL_bool down, float x, float y, float pressure)
void SDL_DelTouch(SDL_TouchID id)
int SDL_AddTouch(SDL_TouchID touchID, SDL_TouchDeviceType type, const char *name)
int SDL_SendTouchMotion(SDL_TouchID id, SDL_FingerID fingerid, SDL_Window *window, float x, float y, float pressure)
@ SDL_TOUCH_DEVICE_DIRECT
static SDL_VideoDevice * _this
SDL_HitTestResult
Possible return values from the SDL_HitTest callback.
@ SDL_HITTEST_RESIZE_LEFT
@ SDL_HITTEST_RESIZE_TOPRIGHT
@ SDL_HITTEST_RESIZE_BOTTOM
@ SDL_HITTEST_RESIZE_BOTTOMRIGHT
@ SDL_HITTEST_RESIZE_BOTTOMLEFT
@ SDL_HITTEST_RESIZE_RIGHT
@ SDL_HITTEST_RESIZE_TOPLEFT
void * Wayland_data_offer_receive(SDL_WaylandDataOffer *offer, size_t *length, const char *mime_type, SDL_bool null_terminate)
void Wayland_data_offer_destroy(SDL_WaylandDataOffer *offer)
ssize_t Wayland_data_source_send(SDL_WaylandDataSource *source, const char *mime_type, int fd)
int Wayland_data_device_clear_selection(SDL_WaylandDataDevice *device)
int Wayland_data_offer_add_mime(SDL_WaylandDataOffer *offer, const char *mime_type)
void Wayland_data_source_destroy(SDL_WaylandDataSource *source)
SDL_bool Wayland_data_offer_has_mime(SDL_WaylandDataOffer *offer, const char *mime_type)
SDL_WaylandDataSource * Wayland_data_source_create(_THIS)
int Wayland_data_device_set_serial(SDL_WaylandDataDevice *device, uint32_t serial)
int Wayland_input_lock_pointer(struct SDL_WaylandInput *input)
void Wayland_display_destroy_input(SDL_VideoData *d)
void Wayland_display_add_input(SDL_VideoData *d, uint32_t id, uint32_t version)
void Wayland_display_destroy_relative_pointer_manager(SDL_VideoData *d)
int Wayland_input_confine_pointer(SDL_Window *window, struct SDL_WaylandInput *input)
void Wayland_display_destroy_pointer_constraints(SDL_VideoData *d)
SDL_WaylandDataDevice * Wayland_get_data_device(struct SDL_WaylandInput *input)
void Wayland_display_add_pointer_constraints(SDL_VideoData *d, uint32_t id)
void Wayland_display_add_relative_pointer_manager(SDL_VideoData *d, uint32_t id)
int Wayland_input_unconfine_pointer(struct SDL_WaylandInput *input)
int Wayland_input_unlock_pointer(struct SDL_WaylandInput *input)
void Wayland_PumpEvents(_THIS)
EGLSurface EGLnsecsANDROID time
EGLSurface EGLNativeWindowType * window
static const SDL_Scancode xfree86_scancode_table2[]
The structure that defines a point (integer)
struct wl_data_device_manager * data_device_manager
SDL_VideoData * video_data
SDL_WaylandDataOffer * drag_offer
SDL_WaylandDataOffer * selection_offer
struct wl_data_device * data_device
struct wl_data_offer * offer
struct wl_data_source * source
SDL_xdg_shell_surface xdg
struct wl_shell_surface * wl
union SDL_WindowData::@445 shell_surface
SDL_zxdg_shell_surface zxdg
The type used to identify a window.
struct xdg_toplevel * toplevel
union SDL_xdg_shell_surface::@444 roleobj
struct zxdg_toplevel_v6 * toplevel
union SDL_zxdg_shell_surface::@443 roleobj
static char text[MAX_TEXT_LENGTH]