SDL  2.0
SDL_waylandvideo.c
Go to the documentation of this file.
1 /*
2  Simple DirectMedia Layer
3  Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
4 
5  This software is provided 'as-is', without any express or implied
6  warranty. In no event will the authors be held liable for any damages
7  arising from the use of this software.
8 
9  Permission is granted to anyone to use this software for any purpose,
10  including commercial applications, and to alter it and redistribute it
11  freely, subject to the following restrictions:
12 
13  1. The origin of this software must not be misrepresented; you must not
14  claim that you wrote the original software. If you use this software
15  in a product, an acknowledgment in the product documentation would be
16  appreciated but is not required.
17  2. Altered source versions must be plainly marked as such, and must not be
18  misrepresented as being the original software.
19  3. This notice may not be removed or altered from any source distribution.
20 */
21 
22 #include "../../SDL_internal.h"
23 
24 #if SDL_VIDEO_DRIVER_WAYLAND
25 
26 #include "SDL_video.h"
27 #include "SDL_mouse.h"
28 #include "SDL_stdinc.h"
29 #include "../../events/SDL_events_c.h"
30 
31 #include "SDL_waylandvideo.h"
32 #include "SDL_waylandevents_c.h"
33 #include "SDL_waylandwindow.h"
34 #include "SDL_waylandopengles.h"
35 #include "SDL_waylandmouse.h"
36 #include "SDL_waylandtouch.h"
37 #include "SDL_waylandclipboard.h"
38 #include "SDL_waylandvulkan.h"
39 
40 #include <sys/types.h>
41 #include <unistd.h>
42 #include <fcntl.h>
43 #include <xkbcommon/xkbcommon.h>
44 
45 #include "SDL_waylanddyn.h"
46 #include <wayland-util.h>
47 
49 
50 #define WAYLANDVID_DRIVER_NAME "wayland"
51 
52 /* Initialization/Query functions */
53 static int
54 Wayland_VideoInit(_THIS);
55 
56 static void
57 Wayland_GetDisplayModes(_THIS, SDL_VideoDisplay *sdl_display);
58 static int
59 Wayland_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode);
60 
61 static void
62 Wayland_VideoQuit(_THIS);
63 
64 /* Find out what class name we should use
65  * Based on src/video/x11/SDL_x11video.c */
66 static char *
67 get_classname()
68 {
69 /* !!! FIXME: this is probably wrong, albeit harmless in many common cases. From protocol spec:
70  "The surface class identifies the general class of applications
71  to which the surface belongs. A common convention is to use the
72  file name (or the full path if it is a non-standard location) of
73  the application's .desktop file as the class." */
74 
75  char *spot;
76 #if defined(__LINUX__) || defined(__FREEBSD__)
77  char procfile[1024];
78  char linkfile[1024];
79  int linksize;
80 #endif
81 
82  /* First allow environment variable override */
83  spot = SDL_getenv("SDL_VIDEO_WAYLAND_WMCLASS");
84  if (spot) {
85  return SDL_strdup(spot);
86  } else {
87  /* Fallback to the "old" envvar */
88  spot = SDL_getenv("SDL_VIDEO_X11_WMCLASS");
89  if (spot) {
90  return SDL_strdup(spot);
91  }
92  }
93 
94  /* Next look at the application's executable name */
95 #if defined(__LINUX__) || defined(__FREEBSD__)
96 #if defined(__LINUX__)
97  SDL_snprintf(procfile, SDL_arraysize(procfile), "/proc/%d/exe", getpid());
98 #elif defined(__FREEBSD__)
99  SDL_snprintf(procfile, SDL_arraysize(procfile), "/proc/%d/file",
100  getpid());
101 #else
102 #error Where can we find the executable name?
103 #endif
104  linksize = readlink(procfile, linkfile, sizeof(linkfile) - 1);
105  if (linksize > 0) {
106  linkfile[linksize] = '\0';
107  spot = SDL_strrchr(linkfile, '/');
108  if (spot) {
109  return SDL_strdup(spot + 1);
110  } else {
111  return SDL_strdup(linkfile);
112  }
113  }
114 #endif /* __LINUX__ || __FREEBSD__ */
115 
116  /* Finally use the default we've used forever */
117  return SDL_strdup("SDL_App");
118 }
119 
120 /* Wayland driver bootstrap functions */
121 static int
122 Wayland_Available(void)
123 {
124  struct wl_display *display = NULL;
125  if (SDL_WAYLAND_LoadSymbols()) {
126  display = WAYLAND_wl_display_connect(NULL);
127  if (display != NULL) {
128  WAYLAND_wl_display_disconnect(display);
129  }
131  }
132 
133  return (display != NULL);
134 }
135 
136 static void
137 Wayland_DeleteDevice(SDL_VideoDevice *device)
138 {
139  SDL_free(device);
141 }
142 
143 static SDL_VideoDevice *
144 Wayland_CreateDevice(int devindex)
145 {
147 
148  if (!SDL_WAYLAND_LoadSymbols()) {
149  return NULL;
150  }
151 
152  /* Initialize all variables that we clean on shutdown */
153  device = SDL_calloc(1, sizeof(SDL_VideoDevice));
154  if (!device) {
156  SDL_OutOfMemory();
157  return NULL;
158  }
159 
160  /* Set the function pointers */
161  device->VideoInit = Wayland_VideoInit;
162  device->VideoQuit = Wayland_VideoQuit;
163  device->SetDisplayMode = Wayland_SetDisplayMode;
164  device->GetDisplayModes = Wayland_GetDisplayModes;
166 
167  device->PumpEvents = Wayland_PumpEvents;
168 
178 
180  device->ShowWindow = Wayland_ShowWindow;
188 
192 
193 #if SDL_VIDEO_VULKAN
194  device->Vulkan_LoadLibrary = Wayland_Vulkan_LoadLibrary;
195  device->Vulkan_UnloadLibrary = Wayland_Vulkan_UnloadLibrary;
196  device->Vulkan_GetInstanceExtensions = Wayland_Vulkan_GetInstanceExtensions;
197  device->Vulkan_CreateSurface = Wayland_Vulkan_CreateSurface;
198 #endif
199 
200  device->free = Wayland_DeleteDevice;
201 
202  return device;
203 }
204 
206  WAYLANDVID_DRIVER_NAME, "SDL Wayland video driver",
207  Wayland_Available, Wayland_CreateDevice
208 };
209 
210 static void
211 display_handle_geometry(void *data,
212  struct wl_output *output,
213  int x, int y,
214  int physical_width,
215  int physical_height,
216  int subpixel,
217  const char *make,
218  const char *model,
219  int transform)
220 
221 {
222  SDL_VideoDisplay *display = data;
223 
224  display->name = SDL_strdup(model);
225  display->driverdata = output;
226 }
227 
228 static void
229 display_handle_mode(void *data,
230  struct wl_output *output,
231  uint32_t flags,
232  int width,
233  int height,
234  int refresh)
235 {
236  SDL_VideoDisplay *display = data;
238 
239  SDL_zero(mode);
241  mode.w = width;
242  mode.h = height;
243  mode.refresh_rate = refresh / 1000; // mHz to Hz
244  mode.driverdata = display->driverdata;
245  SDL_AddDisplayMode(display, &mode);
246 
247  if (flags & WL_OUTPUT_MODE_CURRENT) {
248  display->current_mode = mode;
249  display->desktop_mode = mode;
250  }
251 }
252 
253 static void
254 display_handle_done(void *data,
255  struct wl_output *output)
256 {
257  SDL_VideoDisplay *display = data;
258  SDL_AddVideoDisplay(display);
259  SDL_free(display->name);
260  SDL_free(display);
261 }
262 
263 static void
264 display_handle_scale(void *data,
265  struct wl_output *output,
266  int32_t factor)
267 {
268  // TODO: do HiDPI stuff.
269 }
270 
271 static const struct wl_output_listener output_listener = {
272  display_handle_geometry,
273  display_handle_mode,
274  display_handle_done,
275  display_handle_scale
276 };
277 
278 static void
279 Wayland_add_display(SDL_VideoData *d, uint32_t id)
280 {
281  struct wl_output *output;
282  SDL_VideoDisplay *display = SDL_malloc(sizeof *display);
283  if (!display) {
284  SDL_OutOfMemory();
285  return;
286  }
287  SDL_zero(*display);
288 
289  output = wl_registry_bind(d->registry, id, &wl_output_interface, 2);
290  if (!output) {
291  SDL_SetError("Failed to retrieve output.");
292  SDL_free(display);
293  return;
294  }
295 
296  wl_output_add_listener(output, &output_listener, display);
297 }
298 
299 #ifdef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH
300 static void
301 windowmanager_hints(void *data, struct qt_windowmanager *qt_windowmanager,
302  int32_t show_is_fullscreen)
303 {
304 }
305 
306 static void
307 windowmanager_quit(void *data, struct qt_windowmanager *qt_windowmanager)
308 {
309  SDL_SendQuit();
310 }
311 
312 static const struct qt_windowmanager_listener windowmanager_listener = {
313  windowmanager_hints,
314  windowmanager_quit,
315 };
316 #endif /* SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH */
317 
318 
319 static void
320 handle_ping_zxdg_shell(void *data, struct zxdg_shell_v6 *zxdg, uint32_t serial)
321 {
322  zxdg_shell_v6_pong(zxdg, serial);
323 }
324 
325 static const struct zxdg_shell_v6_listener shell_listener_zxdg = {
326  handle_ping_zxdg_shell
327 };
328 
329 
330 static void
331 display_handle_global(void *data, struct wl_registry *registry, uint32_t id,
332  const char *interface, uint32_t version)
333 {
334  SDL_VideoData *d = data;
335 
336  if (strcmp(interface, "wl_compositor") == 0) {
338  } else if (strcmp(interface, "wl_output") == 0) {
339  Wayland_add_display(d, id);
340  } else if (strcmp(interface, "wl_seat") == 0) {
342  } else if (strcmp(interface, "zxdg_shell_v6") == 0) {
344  zxdg_shell_v6_add_listener(d->shell.zxdg, &shell_listener_zxdg, NULL);
345  } else if (strcmp(interface, "wl_shell") == 0) {
347  } else if (strcmp(interface, "wl_shm") == 0) {
348  d->shm = wl_registry_bind(registry, id, &wl_shm_interface, 1);
349  d->cursor_theme = WAYLAND_wl_cursor_theme_load(NULL, 32, d->shm);
350  } else if (strcmp(interface, "zwp_relative_pointer_manager_v1") == 0) {
352  } else if (strcmp(interface, "zwp_pointer_constraints_v1") == 0) {
354  } else if (strcmp(interface, "wl_data_device_manager") == 0) {
356 
357 #ifdef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH
358  } else if (strcmp(interface, "qt_touch_extension") == 0) {
359  Wayland_touch_create(d, id);
360  } else if (strcmp(interface, "qt_surface_extension") == 0) {
361  d->surface_extension = wl_registry_bind(registry, id,
362  &qt_surface_extension_interface, 1);
363  } else if (strcmp(interface, "qt_windowmanager") == 0) {
364  d->windowmanager = wl_registry_bind(registry, id,
365  &qt_windowmanager_interface, 1);
366  qt_windowmanager_add_listener(d->windowmanager, &windowmanager_listener, d);
367 #endif /* SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH */
368  }
369 }
370 
371 static const struct wl_registry_listener registry_listener = {
372  display_handle_global,
373  NULL, /* global_remove */
374 };
375 
376 int
377 Wayland_VideoInit(_THIS)
378 {
379  SDL_VideoData *data = SDL_malloc(sizeof *data);
380  if (data == NULL)
381  return SDL_OutOfMemory();
382  memset(data, 0, sizeof *data);
383 
384  _this->driverdata = data;
385 
386  data->xkb_context = WAYLAND_xkb_context_new(0);
387  if (!data->xkb_context) {
388  return SDL_SetError("Failed to create XKB context");
389  }
390 
391  data->display = WAYLAND_wl_display_connect(NULL);
392  if (data->display == NULL) {
393  return SDL_SetError("Failed to connect to a Wayland display");
394  }
395 
397  if (data->registry == NULL) {
398  return SDL_SetError("Failed to get the Wayland registry");
399  }
400 
401  wl_registry_add_listener(data->registry, &registry_listener, data);
402 
403  // First roundtrip to receive all registry objects.
404  WAYLAND_wl_display_roundtrip(data->display);
405 
406  // Second roundtrip to receive all output events.
407  WAYLAND_wl_display_roundtrip(data->display);
408 
409  Wayland_InitMouse();
410 
411  /* Get the surface class name, usually the name of the application */
412  data->classname = get_classname();
413 
414  WAYLAND_wl_display_flush(data->display);
415 
416  return 0;
417 }
418 
419 static void
420 Wayland_GetDisplayModes(_THIS, SDL_VideoDisplay *sdl_display)
421 {
422  // Nothing to do here, everything was already done in the wl_output
423  // callbacks.
424 }
425 
426 static int
427 Wayland_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode)
428 {
429  return SDL_Unsupported();
430 }
431 
432 void
433 Wayland_VideoQuit(_THIS)
434 {
435  SDL_VideoData *data = _this->driverdata;
436  int i, j;
437 
438  Wayland_FiniMouse ();
439 
440  for (i = 0; i < _this->num_displays; ++i) {
441  SDL_VideoDisplay *display = &_this->displays[i];
442  wl_output_destroy(display->driverdata);
443  display->driverdata = NULL;
444 
445  for (j = display->num_display_modes; j--;) {
446  display->display_modes[j].driverdata = NULL;
447  }
448  display->desktop_mode.driverdata = NULL;
449  }
450 
454 
455  if (data->xkb_context) {
456  WAYLAND_xkb_context_unref(data->xkb_context);
457  data->xkb_context = NULL;
458  }
459 #ifdef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH
460  if (data->windowmanager)
461  qt_windowmanager_destroy(data->windowmanager);
462 
463  if (data->surface_extension)
464  qt_surface_extension_destroy(data->surface_extension);
465 
466  Wayland_touch_destroy(data);
467 #endif /* SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH */
468 
469  if (data->shm)
470  wl_shm_destroy(data->shm);
471 
472  if (data->cursor_theme)
473  WAYLAND_wl_cursor_theme_destroy(data->cursor_theme);
474 
475  if (data->shell.wl)
476  wl_shell_destroy(data->shell.wl);
477 
478  if (data->shell.zxdg)
480 
481  if (data->compositor)
483 
484  if (data->registry)
486 
487  if (data->display) {
488  WAYLAND_wl_display_flush(data->display);
489  WAYLAND_wl_display_disconnect(data->display);
490  }
491 
492  SDL_free(data->classname);
493  SDL_free(data);
494  _this->driverdata = NULL;
495 }
496 
497 #endif /* SDL_VIDEO_DRIVER_WAYLAND */
498 
499 /* vi: set ts=4 sw=4 expandtab: */
int(* Vulkan_LoadLibrary)(_THIS, const char *path)
Definition: SDL_sysvideo.h:270
static void wl_registry_destroy(struct wl_registry *wl_registry)
static struct wl_registry * wl_display_get_registry(struct wl_display *wl_display)
void Wayland_display_destroy_pointer_constraints(SDL_VideoData *d)
void Wayland_SetWindowSize(_THIS, SDL_Window *window)
void(* RestoreWindow)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:227
const struct wl_interface wl_shm_interface
void Wayland_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *_display, SDL_bool fullscreen)
void Wayland_display_destroy_relative_pointer_manager(SDL_VideoData *d)
void SDL_WAYLAND_UnloadSymbols(void)
char * Wayland_GetClipboardText(_THIS)
int(* SetWindowHitTest)(SDL_Window *window, SDL_bool enabled)
Definition: SDL_sysvideo.h:305
GLint GLint GLint GLint GLint x
Definition: SDL_opengl.h:1574
signed int int32_t
int Wayland_SetWindowHitTest(SDL_Window *window, SDL_bool enabled)
struct wl_display * display
void Wayland_MaximizeWindow(_THIS, SDL_Window *window)
VideoBootStrap Wayland_bootstrap
void Wayland_GLES_DeleteContext(_THIS, SDL_GLContext context)
void(* free)(_THIS)
Definition: SDL_sysvideo.h:390
void Wayland_display_add_pointer_constraints(SDL_VideoData *d, uint32_t id)
int Wayland_SetClipboardText(_THIS, const char *text)
static void wl_shell_destroy(struct wl_shell *wl_shell)
#define Wayland_GLES_UnloadLibrary
static void * wl_registry_bind(struct wl_registry *wl_registry, uint32_t name, const struct wl_interface *interface, uint32_t version)
int(* GL_SetSwapInterval)(_THIS, int interval)
Definition: SDL_sysvideo.h:260
void(* ShowWindow)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:222
The structure that defines a display mode.
Definition: SDL_video.h:53
#define memset
Definition: SDL_malloc.c:619
void Wayland_ShowWindow(_THIS, SDL_Window *window)
void(* SetWindowSize)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:215
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: SDL_opengl.h:1974
#define Wayland_GLES_GetSwapInterval
struct wl_cursor_theme * cursor_theme
int Wayland_CreateWindow(_THIS, SDL_Window *window)
const struct wl_interface wl_output_interface
int SDL_AddVideoDisplay(const SDL_VideoDisplay *display)
Definition: SDL_video.c:606
int(* GL_LoadLibrary)(_THIS, const char *path)
Definition: SDL_sysvideo.h:254
static void wl_compositor_destroy(struct wl_compositor *wl_compositor)
GLint GLint GLsizei width
Definition: SDL_opengl.h:1572
int(* SetDisplayMode)(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode)
Definition: SDL_sysvideo.h:204
SDL_GLContext Wayland_GLES_CreateContext(_THIS, SDL_Window *window)
void Wayland_display_add_relative_pointer_manager(SDL_VideoData *d, uint32_t id)
static SDL_VideoDevice * _this
Definition: SDL_video.c:121
static SDL_AudioDeviceID device
Definition: loopwave.c:37
const struct wl_interface zxdg_shell_v6_interface
SDL_bool(* Vulkan_GetInstanceExtensions)(_THIS, SDL_Window *window, unsigned *count, const char **names)
Definition: SDL_sysvideo.h:272
struct SDL_VideoData::@36 shell
#define Wayland_GLES_SetSwapInterval
SDL_bool(* GetWindowWMInfo)(_THIS, SDL_Window *window, struct SDL_SysWMinfo *info)
Definition: SDL_sysvideo.h:247
SDL_GLContext(* GL_CreateContext)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:257
struct wl_data_device_manager * data_device_manager
void Wayland_SetWindowTitle(_THIS, SDL_Window *window)
void Wayland_DestroyWindow(_THIS, SDL_Window *window)
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
SDL_bool(* Vulkan_CreateSurface)(_THIS, SDL_Window *window, VkInstance instance, VkSurfaceKHR *surface)
Definition: SDL_sysvideo.h:273
#define _THIS
int(* GL_MakeCurrent)(_THIS, SDL_Window *window, SDL_GLContext context)
Definition: SDL_sysvideo.h:258
#define SDL_free
void * driverdata
Definition: SDL_video.h:59
void(* Vulkan_UnloadLibrary)(_THIS)
Definition: SDL_sysvideo.h:271
static void wl_shm_destroy(struct wl_shm *wl_shm)
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int int in j)
Definition: SDL_x11sym.h:50
struct xkb_context * xkb_context
int SDL_WAYLAND_LoadSymbols(void)
SDL_bool Wayland_GetWindowWMInfo(_THIS, SDL_Window *window, SDL_SysWMinfo *info)
SDL_DisplayMode * display_modes
Definition: SDL_sysvideo.h:130
SDL_DisplayMode current_mode
Definition: SDL_sysvideo.h:132
GLenum mode
SDL_VideoDisplay * displays
Definition: SDL_sysvideo.h:312
void(* DestroyWindow)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:234
#define SDL_zero(x)
Definition: SDL_stdinc.h:416
struct wl_shell * wl
GLint GLint GLint GLint GLint GLint y
Definition: SDL_opengl.h:1574
int Wayland_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context)
static void zxdg_shell_v6_destroy(struct zxdg_shell_v6 *zxdg_shell_v6)
void Wayland_display_add_input(SDL_VideoData *d, uint32_t id)
#define SDL_getenv
void(* GL_UnloadLibrary)(_THIS)
Definition: SDL_sysvideo.h:256
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:50
void(* GetDisplayModes)(_THIS, SDL_VideoDisplay *display)
Definition: SDL_sysvideo.h:196
int Wayland_GLES_SwapWindow(_THIS, SDL_Window *window)
#define Wayland_GLES_GetProcAddress
static int wl_output_add_listener(struct wl_output *wl_output, const struct wl_output_listener *listener, void *data)
static void wl_output_destroy(struct wl_output *wl_output)
#define NULL
Definition: begin_code.h:164
int(* CreateSDLWindow)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:210
#define SDL_OutOfMemory()
Definition: SDL_error.h:52
SDL_DisplayMode desktop_mode
Definition: SDL_sysvideo.h:131
unsigned int uint32_t
void(* VideoQuit)(_THIS)
Definition: SDL_sysvideo.h:166
#define SDL_SetError
const struct wl_interface wl_compositor_interface
GLbitfield flags
struct wl_compositor * compositor
GLint GLint GLsizei GLsizei height
Definition: SDL_opengl.h:1572
void Wayland_RestoreWindow(_THIS, SDL_Window *window)
#define SDL_calloc
const struct wl_interface wl_shell_interface
void Wayland_display_destroy_input(SDL_VideoData *d)
void Wayland_PumpEvents(_THIS)
int(* GL_SwapWindow)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:262
#define SDL_strdup
GLuint GLenum GLenum transform
struct wl_registry * registry
SDL_bool Wayland_HasClipboardText(_THIS)
SDL_bool(* HasClipboardText)(_THIS)
Definition: SDL_sysvideo.h:299
SDL_bool SDL_AddDisplayMode(SDL_VideoDisplay *display, const SDL_DisplayMode *mode)
Definition: SDL_video.c:743
int(* VideoInit)(_THIS)
Definition: SDL_sysvideo.h:160
#define SDL_snprintf
struct zxdg_shell_v6 * zxdg
#define SDL_arraysize(array)
Definition: SDL_stdinc.h:93
void(* SetWindowFullscreen)(_THIS, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen)
Definition: SDL_sysvideo.h:230
#define SDL_malloc
void(* GL_DeleteContext)(_THIS, SDL_GLContext context)
Definition: SDL_sysvideo.h:263
char *(* GetClipboardText)(_THIS)
Definition: SDL_sysvideo.h:298
Uint32 format
Definition: SDL_video.h:55
void(* SetWindowTitle)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:212
const struct wl_interface wl_data_device_manager_interface
int(* GL_GetSwapInterval)(_THIS)
Definition: SDL_sysvideo.h:261
void(* MaximizeWindow)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:225
int(* SetClipboardText)(_THIS, const char *text)
Definition: SDL_sysvideo.h:297
int Wayland_GLES_LoadLibrary(_THIS, const char *path)
static void zxdg_shell_v6_pong(struct zxdg_shell_v6 *zxdg_shell_v6, uint32_t serial)
struct wl_shm * shm
#define SDL_strrchr
#define SDL_Unsupported()
Definition: SDL_error.h:53
void *(* GL_GetProcAddress)(_THIS, const char *proc)
Definition: SDL_sysvideo.h:255
int SDL_SendQuit(void)
Definition: SDL_quit.c:137
static int wl_registry_add_listener(struct wl_registry *wl_registry, const struct wl_registry_listener *listener, void *data)
void(* PumpEvents)(_THIS)
Definition: SDL_sysvideo.h:280
static int zxdg_shell_v6_add_listener(struct zxdg_shell_v6 *zxdg_shell_v6, const struct zxdg_shell_v6_listener *listener, void *data)