SDL_waylandvideo.c
Go to the documentation of this file.
/*
Simple DirectMedia Layer
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
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.
*/
#include "../../SDL_internal.h"
#if SDL_VIDEO_DRIVER_WAYLAND
#include "SDL_video.h"
#include "SDL_mouse.h"
#include "SDL_stdinc.h"
#include "../../events/SDL_events_c.h"
#include "SDL_waylandvideo.h"
#include "SDL_waylandevents_c.h"
#include "SDL_waylandwindow.h"
#include "SDL_waylandopengles.h"
#include "SDL_waylandmouse.h"
#include "SDL_waylandtouch.h"
#include "SDL_waylandclipboard.h"
#include "SDL_waylandvulkan.h"
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
#include <xkbcommon/xkbcommon.h>
#include "SDL_waylanddyn.h"
#include <wayland-util.h>
#include "xdg-shell-unstable-v6-client-protocol.h"
#define WAYLANDVID_DRIVER_NAME "wayland"
/* Initialization/Query functions */
static int
Wayland_VideoInit(_THIS);
static void
Wayland_GetDisplayModes(_THIS, SDL_VideoDisplay *sdl_display);
static int
Wayland_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode);
static void
Wayland_VideoQuit(_THIS);
/* Find out what class name we should use
* Based on src/video/x11/SDL_x11video.c */
static char *
get_classname()
{
/* !!! FIXME: this is probably wrong, albeit harmless in many common cases. From protocol spec:
"The surface class identifies the general class of applications
to which the surface belongs. A common convention is to use the
file name (or the full path if it is a non-standard location) of
the application's .desktop file as the class." */
char *spot;
#if defined(__LINUX__) || defined(__FREEBSD__)
char procfile[1024];
char linkfile[1024];
int linksize;
#endif
/* First allow environment variable override */
spot = SDL_getenv("SDL_VIDEO_WAYLAND_WMCLASS");
if (spot) {
return SDL_strdup(spot);
} else {
/* Fallback to the "old" envvar */
spot = SDL_getenv("SDL_VIDEO_X11_WMCLASS");
if (spot) {
return SDL_strdup(spot);
}
}
/* Next look at the application's executable name */
#if defined(__LINUX__) || defined(__FREEBSD__)
#if defined(__LINUX__)
SDL_snprintf(procfile, SDL_arraysize(procfile), "/proc/%d/exe", getpid());
#elif defined(__FREEBSD__)
SDL_snprintf(procfile, SDL_arraysize(procfile), "/proc/%d/file",
getpid());
#else
#error Where can we find the executable name?
#endif
linksize = readlink(procfile, linkfile, sizeof(linkfile) - 1);
if (linksize > 0) {
linkfile[linksize] = '\0';
spot = SDL_strrchr(linkfile, '/');
if (spot) {
return SDL_strdup(spot + 1);
} else {
return SDL_strdup(linkfile);
}
}
#endif /* __LINUX__ || __FREEBSD__ */
/* Finally use the default we've used forever */
return SDL_strdup("SDL_App");
}
/* Wayland driver bootstrap functions */
static int
Wayland_Available(void)
{
struct wl_display *display = NULL;
if (SDL_WAYLAND_LoadSymbols()) {
display = WAYLAND_wl_display_connect(NULL);
if (display != NULL) {
WAYLAND_wl_display_disconnect(display);
}
SDL_WAYLAND_UnloadSymbols();
}
return (display != NULL);
}
static void
Wayland_DeleteDevice(SDL_VideoDevice *device)
{
SDL_free(device);
SDL_WAYLAND_UnloadSymbols();
}
static SDL_VideoDevice *
Wayland_CreateDevice(int devindex)
{
SDL_VideoDevice *device;
if (!SDL_WAYLAND_LoadSymbols()) {
return NULL;
}
/* Initialize all variables that we clean on shutdown */
device = SDL_calloc(1, sizeof(SDL_VideoDevice));
if (!device) {
SDL_WAYLAND_UnloadSymbols();
SDL_OutOfMemory();
return NULL;
}
/* Set the function pointers */
device->VideoInit = Wayland_VideoInit;
device->VideoQuit = Wayland_VideoQuit;
device->SetDisplayMode = Wayland_SetDisplayMode;
device->GetDisplayModes = Wayland_GetDisplayModes;
device->GetWindowWMInfo = Wayland_GetWindowWMInfo;
device->PumpEvents = Wayland_PumpEvents;
device->GL_SwapWindow = Wayland_GLES_SwapWindow;
device->GL_GetSwapInterval = Wayland_GLES_GetSwapInterval;
device->GL_SetSwapInterval = Wayland_GLES_SetSwapInterval;
device->GL_MakeCurrent = Wayland_GLES_MakeCurrent;
device->GL_CreateContext = Wayland_GLES_CreateContext;
device->GL_LoadLibrary = Wayland_GLES_LoadLibrary;
device->GL_UnloadLibrary = Wayland_GLES_UnloadLibrary;
device->GL_GetProcAddress = Wayland_GLES_GetProcAddress;
device->GL_DeleteContext = Wayland_GLES_DeleteContext;
device->CreateSDLWindow = Wayland_CreateWindow;
device->ShowWindow = Wayland_ShowWindow;
device->SetWindowFullscreen = Wayland_SetWindowFullscreen;
device->MaximizeWindow = Wayland_MaximizeWindow;
device->RestoreWindow = Wayland_RestoreWindow;
device->SetWindowSize = Wayland_SetWindowSize;
device->SetWindowTitle = Wayland_SetWindowTitle;
device->DestroyWindow = Wayland_DestroyWindow;
device->SetWindowHitTest = Wayland_SetWindowHitTest;
device->SetClipboardText = Wayland_SetClipboardText;
device->GetClipboardText = Wayland_GetClipboardText;
device->HasClipboardText = Wayland_HasClipboardText;
#if SDL_VIDEO_VULKAN
device->Vulkan_LoadLibrary = Wayland_Vulkan_LoadLibrary;
device->Vulkan_UnloadLibrary = Wayland_Vulkan_UnloadLibrary;
device->Vulkan_GetInstanceExtensions = Wayland_Vulkan_GetInstanceExtensions;
device->Vulkan_CreateSurface = Wayland_Vulkan_CreateSurface;
#endif
device->free = Wayland_DeleteDevice;
return device;
}
VideoBootStrap Wayland_bootstrap = {
WAYLANDVID_DRIVER_NAME, "SDL Wayland video driver",
Wayland_Available, Wayland_CreateDevice
};
static void
display_handle_geometry(void *data,
struct wl_output *output,
int x, int y,
int physical_width,
int physical_height,
int subpixel,
const char *make,
const char *model,
int transform)
{
SDL_VideoDisplay *display = data;
display->name = SDL_strdup(model);
display->driverdata = output;
}
static void
display_handle_mode(void *data,
struct wl_output *output,
uint32_t flags,
int width,
int height,
int refresh)
{
SDL_VideoDisplay *display = data;
SDL_DisplayMode mode;
SDL_zero(mode);
mode.format = SDL_PIXELFORMAT_RGB888;
mode.w = width;
mode.h = height;
mode.refresh_rate = refresh / 1000; // mHz to Hz
mode.driverdata = display->driverdata;
SDL_AddDisplayMode(display, &mode);
if (flags & WL_OUTPUT_MODE_CURRENT) {
display->current_mode = mode;
display->desktop_mode = mode;
}
}
static void
display_handle_done(void *data,
struct wl_output *output)
{
SDL_VideoDisplay *display = data;
SDL_AddVideoDisplay(display);
SDL_free(display->name);
SDL_free(display);
}
static void
display_handle_scale(void *data,
struct wl_output *output,
int32_t factor)
{
// TODO: do HiDPI stuff.
}
static const struct wl_output_listener output_listener = {
display_handle_geometry,
display_handle_mode,
display_handle_done,
display_handle_scale
};
static void
Wayland_add_display(SDL_VideoData *d, uint32_t id)
{
struct wl_output *output;
SDL_VideoDisplay *display = SDL_malloc(sizeof *display);
if (!display) {
SDL_OutOfMemory();
return;
}
SDL_zero(*display);
output = wl_registry_bind(d->registry, id, &wl_output_interface, 2);
if (!output) {
SDL_SetError("Failed to retrieve output.");
SDL_free(display);
return;
}
wl_output_add_listener(output, &output_listener, display);
}
#ifdef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH
static void
windowmanager_hints(void *data, struct qt_windowmanager *qt_windowmanager,
int32_t show_is_fullscreen)
{
}
static void
windowmanager_quit(void *data, struct qt_windowmanager *qt_windowmanager)
{
SDL_SendQuit();
}
static const struct qt_windowmanager_listener windowmanager_listener = {
windowmanager_hints,
windowmanager_quit,
};
#endif /* SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH */
static void
handle_ping_zxdg_shell(void *data, struct zxdg_shell_v6 *zxdg, uint32_t serial)
{
zxdg_shell_v6_pong(zxdg, serial);
}
static const struct zxdg_shell_v6_listener shell_listener_zxdg = {
handle_ping_zxdg_shell
};
static void
display_handle_global(void *data, struct wl_registry *registry, uint32_t id,
const char *interface, uint32_t version)
{
SDL_VideoData *d = data;
if (strcmp(interface, "wl_compositor") == 0) {
d->compositor = wl_registry_bind(d->registry, id, &wl_compositor_interface, 1);
} else if (strcmp(interface, "wl_output") == 0) {
Wayland_add_display(d, id);
} else if (strcmp(interface, "wl_seat") == 0) {
Wayland_display_add_input(d, id);
} else if (strcmp(interface, "zxdg_shell_v6") == 0) {
d->shell.zxdg = wl_registry_bind(d->registry, id, &zxdg_shell_v6_interface, 1);
zxdg_shell_v6_add_listener(d->shell.zxdg, &shell_listener_zxdg, NULL);
} else if (strcmp(interface, "wl_shell") == 0) {
d->shell.wl = wl_registry_bind(d->registry, id, &wl_shell_interface, 1);
} else if (strcmp(interface, "wl_shm") == 0) {
d->shm = wl_registry_bind(registry, id, &wl_shm_interface, 1);
d->cursor_theme = WAYLAND_wl_cursor_theme_load(NULL, 32, d->shm);
} else if (strcmp(interface, "zwp_relative_pointer_manager_v1") == 0) {
Wayland_display_add_relative_pointer_manager(d, id);
} else if (strcmp(interface, "zwp_pointer_constraints_v1") == 0) {
Wayland_display_add_pointer_constraints(d, id);
} else if (strcmp(interface, "wl_data_device_manager") == 0) {
d->data_device_manager = wl_registry_bind(d->registry, id, &wl_data_device_manager_interface, 3);
#ifdef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH
} else if (strcmp(interface, "qt_touch_extension") == 0) {
Wayland_touch_create(d, id);
} else if (strcmp(interface, "qt_surface_extension") == 0) {
d->surface_extension = wl_registry_bind(registry, id,
&qt_surface_extension_interface, 1);
} else if (strcmp(interface, "qt_windowmanager") == 0) {
d->windowmanager = wl_registry_bind(registry, id,
&qt_windowmanager_interface, 1);
qt_windowmanager_add_listener(d->windowmanager, &windowmanager_listener, d);
#endif /* SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH */
}
}
static const struct wl_registry_listener registry_listener = {
display_handle_global,
NULL, /* global_remove */
};
int
Wayland_VideoInit(_THIS)
{
SDL_VideoData *data = SDL_malloc(sizeof *data);
if (data == NULL)
return SDL_OutOfMemory();
memset(data, 0, sizeof *data);
_this->driverdata = data;
data->xkb_context = WAYLAND_xkb_context_new(0);
if (!data->xkb_context) {
return SDL_SetError("Failed to create XKB context");
}
data->display = WAYLAND_wl_display_connect(NULL);
if (data->display == NULL) {
return SDL_SetError("Failed to connect to a Wayland display");
}
data->registry = wl_display_get_registry(data->display);
if (data->registry == NULL) {
return SDL_SetError("Failed to get the Wayland registry");
}
wl_registry_add_listener(data->registry, &registry_listener, data);
// First roundtrip to receive all registry objects.
WAYLAND_wl_display_roundtrip(data->display);
// Second roundtrip to receive all output events.
WAYLAND_wl_display_roundtrip(data->display);
Wayland_InitMouse();
/* Get the surface class name, usually the name of the application */
data->classname = get_classname();
WAYLAND_wl_display_flush(data->display);
return 0;
}
static void
Wayland_GetDisplayModes(_THIS, SDL_VideoDisplay *sdl_display)
{
// Nothing to do here, everything was already done in the wl_output
// callbacks.
}
static int
Wayland_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode)
{
return SDL_Unsupported();
}
void
Wayland_VideoQuit(_THIS)
{
SDL_VideoData *data = _this->driverdata;
int i, j;
Wayland_FiniMouse ();
for (i = 0; i < _this->num_displays; ++i) {
SDL_VideoDisplay *display = &_this->displays[i];
wl_output_destroy(display->driverdata);
display->driverdata = NULL;
for (j = display->num_display_modes; j--;) {
display->display_modes[j].driverdata = NULL;
}
display->desktop_mode.driverdata = NULL;
}
Wayland_display_destroy_input(data);
Wayland_display_destroy_pointer_constraints(data);
Wayland_display_destroy_relative_pointer_manager(data);
if (data->xkb_context) {
WAYLAND_xkb_context_unref(data->xkb_context);
data->xkb_context = NULL;
}
#ifdef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH
if (data->windowmanager)
qt_windowmanager_destroy(data->windowmanager);
if (data->surface_extension)
qt_surface_extension_destroy(data->surface_extension);
Wayland_touch_destroy(data);
#endif /* SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH */
if (data->shm)
wl_shm_destroy(data->shm);
if (data->cursor_theme)
WAYLAND_wl_cursor_theme_destroy(data->cursor_theme);
if (data->shell.wl)
wl_shell_destroy(data->shell.wl);
if (data->shell.zxdg)
zxdg_shell_v6_destroy(data->shell.zxdg);
if (data->compositor)
wl_compositor_destroy(data->compositor);
if (data->registry)
wl_registry_destroy(data->registry);
if (data->display) {
WAYLAND_wl_display_flush(data->display);
WAYLAND_wl_display_disconnect(data->display);
}
SDL_free(data->classname);
SDL_free(data);
_this->driverdata = NULL;
}
#endif /* SDL_VIDEO_DRIVER_WAYLAND */
/* vi: set ts=4 sw=4 expandtab: */
SDL_VideoDevice::Vulkan_LoadLibrary
int(* Vulkan_LoadLibrary)(_THIS, const char *path)
Definition: SDL_sysvideo.h:270
wl_registry_destroy
static void wl_registry_destroy(struct wl_registry *wl_registry)
Definition: wayland-client-protocol.h:1063
wl_display_get_registry
static struct wl_registry * wl_display_get_registry(struct wl_display *wl_display)
Definition: wayland-client-protocol.h:962
Wayland_display_destroy_pointer_constraints
void Wayland_display_destroy_pointer_constraints(SDL_VideoData *d)
Wayland_SetWindowSize
void Wayland_SetWindowSize(_THIS, SDL_Window *window)
wl_registry_listener
Definition: wayland-client-protocol.h:976
SDL_VideoDevice::RestoreWindow
void(* RestoreWindow)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:227
wl_shm_interface
const struct wl_interface wl_shm_interface
Definition: wayland-protocol.c:221
Wayland_SetWindowFullscreen
void Wayland_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *_display, SDL_bool fullscreen)
Wayland_display_destroy_relative_pointer_manager
void Wayland_display_destroy_relative_pointer_manager(SDL_VideoData *d)
SDL_WAYLAND_UnloadSymbols
void SDL_WAYLAND_UnloadSymbols(void)
Wayland_GetClipboardText
char * Wayland_GetClipboardText(_THIS)
SDL_VideoDevice::SetWindowHitTest
int(* SetWindowHitTest)(SDL_Window *window, SDL_bool enabled)
Definition: SDL_sysvideo.h:305
x
GLint GLint GLint GLint GLint x
Definition: SDL_opengl.h:1574
int32_t
signed int int32_t
Definition: SDL_config_windows.h:62
SDL_DisplayMode::w
int w
Definition: SDL_video.h:56
Wayland_SetWindowHitTest
int Wayland_SetWindowHitTest(SDL_Window *window, SDL_bool enabled)
SDL_VideoData::display
struct wl_display * display
Definition: SDL_waylandvideo.h:40
Wayland_MaximizeWindow
void Wayland_MaximizeWindow(_THIS, SDL_Window *window)
Wayland_bootstrap
VideoBootStrap Wayland_bootstrap
Wayland_GLES_DeleteContext
void Wayland_GLES_DeleteContext(_THIS, SDL_GLContext context)
SDL_VideoDevice::free
void(* free)(_THIS)
Definition: SDL_sysvideo.h:390
Wayland_display_add_pointer_constraints
void Wayland_display_add_pointer_constraints(SDL_VideoData *d, uint32_t id)
Wayland_SetClipboardText
int Wayland_SetClipboardText(_THIS, const char *text)
SDL_VideoDisplay::name
char * name
Definition: SDL_sysvideo.h:127
wl_shell_destroy
static void wl_shell_destroy(struct wl_shell *wl_shell)
Definition: wayland-client-protocol.h:2746
SDL_waylandtouch.h
Wayland_GLES_UnloadLibrary
#define Wayland_GLES_UnloadLibrary
Definition: SDL_waylandopengles.h:37
SDL_waylandvulkan.h
SDL_waylandwindow.h
wl_registry_bind
static void * wl_registry_bind(struct wl_registry *wl_registry, uint32_t name, const struct wl_interface *interface, uint32_t version)
Definition: wayland-client-protocol.h:1075
SDL_VideoDevice::driverdata
void * driverdata
Definition: SDL_sysvideo.h:377
SDL_VideoDevice::GL_SetSwapInterval
int(* GL_SetSwapInterval)(_THIS, int interval)
Definition: SDL_sysvideo.h:260
zxdg_shell_v6_listener
Definition: xdg-shell-unstable-v6-client-protocol.h:336
SDL_VideoDevice::ShowWindow
void(* ShowWindow)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:222
SDL_DisplayMode
The structure that defines a display mode.
Definition: SDL_video.h:53
memset
#define memset
Definition: SDL_malloc.c:619
Wayland_ShowWindow
void Wayland_ShowWindow(_THIS, SDL_Window *window)
SDL_VideoDevice::SetWindowSize
void(* SetWindowSize)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:215
SDL_DisplayMode::refresh_rate
int refresh_rate
Definition: SDL_video.h:58
data
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: SDL_opengl.h:1974
SDL_waylandmouse.h
Wayland_GLES_GetSwapInterval
#define Wayland_GLES_GetSwapInterval
Definition: SDL_waylandopengles.h:39
SDL_VideoData::cursor_theme
struct wl_cursor_theme * cursor_theme
Definition: SDL_waylandvideo.h:44
wl_output_listener
Definition: wayland-client-protocol.h:5056
Wayland_CreateWindow
int Wayland_CreateWindow(_THIS, SDL_Window *window)
SDL_waylandopengles.h
wl_output_interface
const struct wl_interface wl_output_interface
Definition: wayland-protocol.c:464
SDL_AddVideoDisplay
int SDL_AddVideoDisplay(const SDL_VideoDisplay *display)
Definition: SDL_video.c:606
SDL_VideoDevice::GL_LoadLibrary
int(* GL_LoadLibrary)(_THIS, const char *path)
Definition: SDL_sysvideo.h:254
SDL_PIXELFORMAT_RGB888
Definition: SDL_pixels.h:236
wl_compositor_destroy
static void wl_compositor_destroy(struct wl_compositor *wl_compositor)
Definition: wayland-client-protocol.h:1180
width
GLint GLint GLsizei width
Definition: SDL_opengl.h:1572
SDL_VideoData::classname
char * classname
Definition: SDL_waylandvideo.h:68
SDL_VideoDevice::SetDisplayMode
int(* SetDisplayMode)(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode)
Definition: SDL_sysvideo.h:204
Wayland_GLES_CreateContext
SDL_GLContext Wayland_GLES_CreateContext(_THIS, SDL_Window *window)
Wayland_display_add_relative_pointer_manager
void Wayland_display_add_relative_pointer_manager(SDL_VideoData *d, uint32_t id)
_this
static SDL_VideoDevice * _this
Definition: SDL_video.c:121
device
static SDL_AudioDeviceID device
Definition: loopwave.c:37
SDL_VideoDisplay::num_display_modes
int num_display_modes
Definition: SDL_sysvideo.h:129
zxdg_shell_v6_interface
const struct wl_interface zxdg_shell_v6_interface
Definition: xdg-shell-unstable-v6-protocol.c:79
SDL_video.h
SDL_VideoDevice::Vulkan_GetInstanceExtensions
SDL_bool(* Vulkan_GetInstanceExtensions)(_THIS, SDL_Window *window, unsigned *count, const char **names)
Definition: SDL_sysvideo.h:272
SDL_VideoData::shell
struct SDL_VideoData::@36 shell
Wayland_GLES_SetSwapInterval
#define Wayland_GLES_SetSwapInterval
Definition: SDL_waylandopengles.h:38
SDL_VideoDevice::GetWindowWMInfo
SDL_bool(* GetWindowWMInfo)(_THIS, SDL_Window *window, struct SDL_SysWMinfo *info)
Definition: SDL_sysvideo.h:247
SDL_VideoDevice::GL_CreateContext
SDL_GLContext(* GL_CreateContext)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:257
SDL_VideoData::data_device_manager
struct wl_data_device_manager * data_device_manager
Definition: SDL_waylandvideo.h:53
Wayland_SetWindowTitle
void Wayland_SetWindowTitle(_THIS, SDL_Window *window)
Wayland_DestroyWindow
void Wayland_DestroyWindow(_THIS, SDL_Window *window)
d
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
Definition: SDL_dynapi_procs.h:117
SDL_VideoDevice::Vulkan_CreateSurface
SDL_bool(* Vulkan_CreateSurface)(_THIS, SDL_Window *window, VkInstance instance, VkSurfaceKHR *surface)
Definition: SDL_sysvideo.h:273
_THIS
#define _THIS
Definition: SDL_alsa_audio.h:31
SDL_VideoDevice::GL_MakeCurrent
int(* GL_MakeCurrent)(_THIS, SDL_Window *window, SDL_GLContext context)
Definition: SDL_sysvideo.h:258
SDL_free
#define SDL_free
Definition: SDL_dynapi_overrides.h:377
SDL_DisplayMode::driverdata
void * driverdata
Definition: SDL_video.h:59
SDL_mouse.h
VideoBootStrap
Definition: SDL_sysvideo.h:393
sort_controllers.output
output
Definition: sort_controllers.py:10
SDL_VideoDevice::num_displays
int num_displays
Definition: SDL_sysvideo.h:311
SDL_VideoDevice::Vulkan_UnloadLibrary
void(* Vulkan_UnloadLibrary)(_THIS)
Definition: SDL_sysvideo.h:271
wl_shm_destroy
static void wl_shm_destroy(struct wl_shm *wl_shm)
Definition: wayland-client-protocol.h:1652
j
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
SDL_VideoData::xkb_context
struct xkb_context * xkb_context
Definition: SDL_waylandvideo.h:59
SDL_WAYLAND_LoadSymbols
int SDL_WAYLAND_LoadSymbols(void)
Wayland_GetWindowWMInfo
SDL_bool Wayland_GetWindowWMInfo(_THIS, SDL_Window *window, SDL_SysWMinfo *info)
SDL_VideoDisplay::display_modes
SDL_DisplayMode * display_modes
Definition: SDL_sysvideo.h:130
SDL_VideoDisplay::current_mode
SDL_DisplayMode current_mode
Definition: SDL_sysvideo.h:132
mode
GLenum mode
Definition: SDL_opengl_glext.h:1122
SDL_VideoDevice::displays
SDL_VideoDisplay * displays
Definition: SDL_sysvideo.h:312
SDL_VideoDevice::DestroyWindow
void(* DestroyWindow)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:234
SDL_zero
#define SDL_zero(x)
Definition: SDL_stdinc.h:416
SDL_VideoData::wl
struct wl_shell * wl
Definition: SDL_waylandvideo.h:49
SDL_DisplayMode::h
int h
Definition: SDL_video.h:57
y
GLint GLint GLint GLint GLint GLint y
Definition: SDL_opengl.h:1574
SDL_waylanddyn.h
Wayland_GLES_MakeCurrent
int Wayland_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context)
zxdg_shell_v6_destroy
static void zxdg_shell_v6_destroy(struct zxdg_shell_v6 *zxdg_shell_v6)
Definition: xdg-shell-unstable-v6-client-protocol.h:427
Wayland_display_add_input
void Wayland_display_add_input(SDL_VideoData *d, uint32_t id)
SDL_VideoDisplay
Definition: SDL_sysvideo.h:125
SDL_getenv
#define SDL_getenv
Definition: SDL_dynapi_overrides.h:378
SDL_VideoDevice::GL_UnloadLibrary
void(* GL_UnloadLibrary)(_THIS)
Definition: SDL_sysvideo.h:256
i
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
SDL_VideoDevice::GetDisplayModes
void(* GetDisplayModes)(_THIS, SDL_VideoDisplay *display)
Definition: SDL_sysvideo.h:196
Wayland_GLES_SwapWindow
int Wayland_GLES_SwapWindow(_THIS, SDL_Window *window)
Wayland_GLES_GetProcAddress
#define Wayland_GLES_GetProcAddress
Definition: SDL_waylandopengles.h:36
wl_output_add_listener
static int wl_output_add_listener(struct wl_output *wl_output, const struct wl_output_listener *listener, void *data)
Definition: wayland-client-protocol.h:5152
wl_output_destroy
static void wl_output_destroy(struct wl_output *wl_output)
Definition: wayland-client-protocol.h:5205
SDL_waylandvideo.h
NULL
#define NULL
Definition: begin_code.h:164
SDL_VideoDevice::CreateSDLWindow
int(* CreateSDLWindow)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:210
SDL_OutOfMemory
#define SDL_OutOfMemory()
Definition: SDL_error.h:52
SDL_VideoDisplay::desktop_mode
SDL_DisplayMode desktop_mode
Definition: SDL_sysvideo.h:131
uint32_t
unsigned int uint32_t
Definition: SDL_config_windows.h:63
SDL_VideoDevice::VideoQuit
void(* VideoQuit)(_THIS)
Definition: SDL_sysvideo.h:166
SDL_SetError
#define SDL_SetError
Definition: SDL_dynapi_overrides.h:30
wl_compositor_interface
const struct wl_interface wl_compositor_interface
Definition: wayland-protocol.c:195
flags
GLbitfield flags
Definition: SDL_opengl_glext.h:1480
SDL_VideoData::compositor
struct wl_compositor * compositor
Definition: SDL_waylandvideo.h:42
height
GLint GLint GLsizei GLsizei height
Definition: SDL_opengl.h:1572
Wayland_RestoreWindow
void Wayland_RestoreWindow(_THIS, SDL_Window *window)
SDL_calloc
#define SDL_calloc
Definition: SDL_dynapi_overrides.h:375
wl_shell_interface
const struct wl_interface wl_shell_interface
Definition: wayland-protocol.c:318
Wayland_display_destroy_input
void Wayland_display_destroy_input(SDL_VideoData *d)
Wayland_PumpEvents
void Wayland_PumpEvents(_THIS)
SDL_stdinc.h
SDL_VideoDevice::GL_SwapWindow
int(* GL_SwapWindow)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:262
SDL_strdup
#define SDL_strdup
Definition: SDL_dynapi_overrides.h:397
xdg-shell-unstable-v6-client-protocol.h
transform
GLuint GLenum GLenum transform
Definition: SDL_opengl_glext.h:9996
SDL_waylandclipboard.h
SDL_VideoData::registry
struct wl_registry * registry
Definition: SDL_waylandvideo.h:41
SDL_VideoDevice
Definition: SDL_sysvideo.h:147
Wayland_HasClipboardText
SDL_bool Wayland_HasClipboardText(_THIS)
SDL_VideoData
Definition: SDL_androidvideo.h:35
SDL_waylandevents_c.h
SDL_VideoDevice::HasClipboardText
SDL_bool(* HasClipboardText)(_THIS)
Definition: SDL_sysvideo.h:299
SDL_AddDisplayMode
SDL_bool SDL_AddDisplayMode(SDL_VideoDisplay *display, const SDL_DisplayMode *mode)
Definition: SDL_video.c:743
SDL_VideoDevice::VideoInit
int(* VideoInit)(_THIS)
Definition: SDL_sysvideo.h:160
SDL_snprintf
#define SDL_snprintf
Definition: SDL_dynapi_overrides.h:40
SDL_VideoData::zxdg
struct zxdg_shell_v6 * zxdg
Definition: SDL_waylandvideo.h:48
SDL_arraysize
#define SDL_arraysize(array)
Definition: SDL_stdinc.h:93
SDL_VideoDevice::SetWindowFullscreen
void(* SetWindowFullscreen)(_THIS, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen)
Definition: SDL_sysvideo.h:230
SDL_malloc
#define SDL_malloc
Definition: SDL_dynapi_overrides.h:374
SDL_VideoDevice::GL_DeleteContext
void(* GL_DeleteContext)(_THIS, SDL_GLContext context)
Definition: SDL_sysvideo.h:263
SDL_VideoDevice::GetClipboardText
char *(* GetClipboardText)(_THIS)
Definition: SDL_sysvideo.h:298
SDL_DisplayMode::format
Uint32 format
Definition: SDL_video.h:55
SDL_VideoDevice::SetWindowTitle
void(* SetWindowTitle)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:212
wl_data_device_manager_interface
const struct wl_interface wl_data_device_manager_interface
Definition: wayland-protocol.c:308
SDL_VideoDevice::GL_GetSwapInterval
int(* GL_GetSwapInterval)(_THIS)
Definition: SDL_sysvideo.h:261
SDL_VideoDevice::MaximizeWindow
void(* MaximizeWindow)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:225
SDL_VideoDevice::SetClipboardText
int(* SetClipboardText)(_THIS, const char *text)
Definition: SDL_sysvideo.h:297
Wayland_GLES_LoadLibrary
int Wayland_GLES_LoadLibrary(_THIS, const char *path)
WL_OUTPUT_MODE_CURRENT
Definition: wayland-client-protocol.h:5044
zxdg_shell_v6_pong
static void zxdg_shell_v6_pong(struct zxdg_shell_v6 *zxdg_shell_v6, uint32_t serial)
Definition: xdg-shell-unstable-v6-client-protocol.h:486
SDL_VideoData::shm
struct wl_shm * shm
Definition: SDL_waylandvideo.h:43
SDL_strrchr
#define SDL_strrchr
Definition: SDL_dynapi_overrides.h:402
SDL_Unsupported
#define SDL_Unsupported()
Definition: SDL_error.h:53
SDL_VideoDevice::GL_GetProcAddress
void *(* GL_GetProcAddress)(_THIS, const char *proc)
Definition: SDL_sysvideo.h:255
SDL_SendQuit
int SDL_SendQuit(void)
Definition: SDL_quit.c:137
SDL_VideoDisplay::driverdata
void * driverdata
Definition: SDL_sysvideo.h:138
wl_registry_add_listener
static int wl_registry_add_listener(struct wl_registry *wl_registry, const struct wl_registry_listener *listener, void *data)
Definition: wayland-client-protocol.h:1018
SDL_VideoDevice::PumpEvents
void(* PumpEvents)(_THIS)
Definition: SDL_sysvideo.h:280
zxdg_shell_v6_add_listener
static int zxdg_shell_v6_add_listener(struct zxdg_shell_v6 *zxdg_shell_v6, const struct zxdg_shell_v6_listener *listener, void *data)
Definition: xdg-shell-unstable-v6-client-protocol.h:363