SDL  2.0
SDL_x11video.c
Go to the documentation of this file.
1 /*
2  Simple DirectMedia Layer
3  Copyright (C) 1997-2020 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 #include "../../SDL_internal.h"
22 
23 #if SDL_VIDEO_DRIVER_X11
24 
25 #include <unistd.h> /* For getpid() and readlink() */
26 
27 #include "SDL_video.h"
28 #include "SDL_mouse.h"
29 #include "SDL_timer.h"
30 #include "SDL_hints.h"
31 #include "../SDL_sysvideo.h"
32 #include "../SDL_pixels_c.h"
33 
34 #include "SDL_x11video.h"
35 #include "SDL_x11framebuffer.h"
36 #include "SDL_x11shape.h"
37 #include "SDL_x11touch.h"
38 #include "SDL_x11xinput2.h"
39 
40 #if SDL_VIDEO_OPENGL_EGL
41 #include "SDL_x11opengles.h"
42 #endif
43 
44 #include "SDL_x11vulkan.h"
45 
46 /* Initialization/Query functions */
47 static int X11_VideoInit(_THIS);
48 static void X11_VideoQuit(_THIS);
49 
50 /* Find out what class name we should use */
51 static char *
52 get_classname()
53 {
54  char *spot;
55 #if defined(__LINUX__) || defined(__FREEBSD__)
56  char procfile[1024];
57  char linkfile[1024];
58  int linksize;
59 #endif
60 
61  /* First allow environment variable override */
62  spot = SDL_getenv("SDL_VIDEO_X11_WMCLASS");
63  if (spot) {
64  return SDL_strdup(spot);
65  }
66 
67  /* Next look at the application's executable name */
68 #if defined(__LINUX__) || defined(__FREEBSD__)
69 #if defined(__LINUX__)
70  SDL_snprintf(procfile, SDL_arraysize(procfile), "/proc/%d/exe", getpid());
71 #elif defined(__FREEBSD__)
72  SDL_snprintf(procfile, SDL_arraysize(procfile), "/proc/%d/file",
73  getpid());
74 #else
75 #error Where can we find the executable name?
76 #endif
77  linksize = readlink(procfile, linkfile, sizeof(linkfile) - 1);
78  if (linksize > 0) {
79  linkfile[linksize] = '\0';
80  spot = SDL_strrchr(linkfile, '/');
81  if (spot) {
82  return SDL_strdup(spot + 1);
83  } else {
84  return SDL_strdup(linkfile);
85  }
86  }
87 #endif /* __LINUX__ || __FREEBSD__ */
88 
89  /* Finally use the default we've used forever */
90  return SDL_strdup("SDL_App");
91 }
92 
93 /* X11 driver bootstrap functions */
94 
95 static int
96 X11_Available(void)
97 {
98  Display *display = NULL;
99  if (SDL_X11_LoadSymbols()) {
100  display = X11_XOpenDisplay(NULL);
101  if (display != NULL) {
102  X11_XCloseDisplay(display);
103  }
105  }
106  return (display != NULL);
107 }
108 
109 static void
110 X11_DeleteDevice(SDL_VideoDevice * device)
111 {
112  SDL_VideoData *data = (SDL_VideoData *) device->driverdata;
113  if (device->vulkan_config.loader_handle) {
114  device->Vulkan_UnloadLibrary(device);
115  }
116  if (data->display) {
117  X11_XCloseDisplay(data->display);
118  }
119  SDL_free(data->windowlist);
120  SDL_free(device->driverdata);
121  SDL_free(device);
122 
124 }
125 
126 /* An error handler to reset the vidmode and then call the default handler. */
127 static SDL_bool safety_net_triggered = SDL_FALSE;
128 static int (*orig_x11_errhandler) (Display *, XErrorEvent *) = NULL;
129 static int
130 X11_SafetyNetErrHandler(Display * d, XErrorEvent * e)
131 {
133  /* if we trigger an error in our error handler, don't try again. */
134  if (!safety_net_triggered) {
135  safety_net_triggered = SDL_TRUE;
137  if (device != NULL) {
138  int i;
139  for (i = 0; i < device->num_displays; i++) {
140  SDL_VideoDisplay *display = &device->displays[i];
141  if (SDL_memcmp(&display->current_mode, &display->desktop_mode,
142  sizeof (SDL_DisplayMode)) != 0) {
143  X11_SetDisplayMode(device, display, &display->desktop_mode);
144  }
145  }
146  }
147  }
148 
149  if (orig_x11_errhandler != NULL) {
150  return orig_x11_errhandler(d, e); /* probably terminate. */
151  }
152 
153  return 0;
154 }
155 
156 static SDL_VideoDevice *
157 X11_CreateDevice(int devindex)
158 {
161  const char *display = NULL; /* Use the DISPLAY environment variable */
162 
163  if (!SDL_X11_LoadSymbols()) {
164  return NULL;
165  }
166 
167  /* Need for threading gl calls. This is also required for the proprietary
168  nVidia driver to be threaded. */
169  X11_XInitThreads();
170 
171  /* Initialize all variables that we clean on shutdown */
173  if (!device) {
174  SDL_OutOfMemory();
175  return NULL;
176  }
177  data = (struct SDL_VideoData *) SDL_calloc(1, sizeof(SDL_VideoData));
178  if (!data) {
179  SDL_free(device);
180  SDL_OutOfMemory();
181  return NULL;
182  }
183  device->driverdata = data;
184 
185  data->global_mouse_changed = SDL_TRUE;
186 
187  /* FIXME: Do we need this?
188  if ( (SDL_strncmp(X11_XDisplayName(display), ":", 1) == 0) ||
189  (SDL_strncmp(X11_XDisplayName(display), "unix:", 5) == 0) ) {
190  local_X11 = 1;
191  } else {
192  local_X11 = 0;
193  }
194  */
195  data->display = X11_XOpenDisplay(display);
196 #ifdef SDL_VIDEO_DRIVER_X11_DYNAMIC
197  /* On some systems if linking without -lX11, it fails and you get following message.
198  * Xlib: connection to ":0.0" refused by server
199  * Xlib: XDM authorization key matches an existing client!
200  *
201  * It succeeds if retrying 1 second later
202  * or if running xhost +localhost on shell.
203  */
204  if (data->display == NULL) {
205  SDL_Delay(1000);
206  data->display = X11_XOpenDisplay(display);
207  }
208 #endif
209  if (data->display == NULL) {
210  SDL_free(device->driverdata);
211  SDL_free(device);
212  SDL_SetError("Couldn't open X11 display");
213  return NULL;
214  }
215 #ifdef X11_DEBUG
216  X11_XSynchronize(data->display, True);
217 #endif
218 
219  /* Hook up an X11 error handler to recover the desktop resolution. */
220  safety_net_triggered = SDL_FALSE;
221  orig_x11_errhandler = X11_XSetErrorHandler(X11_SafetyNetErrHandler);
222 
223  /* Set the function pointers */
224  device->VideoInit = X11_VideoInit;
225  device->VideoQuit = X11_VideoQuit;
226  device->ResetTouch = X11_ResetTouch;
227  device->GetDisplayModes = X11_GetDisplayModes;
228  device->GetDisplayBounds = X11_GetDisplayBounds;
229  device->GetDisplayUsableBounds = X11_GetDisplayUsableBounds;
230  device->GetDisplayDPI = X11_GetDisplayDPI;
231  device->SetDisplayMode = X11_SetDisplayMode;
232  device->SuspendScreenSaver = X11_SuspendScreenSaver;
233  device->PumpEvents = X11_PumpEvents;
234 
235  device->CreateSDLWindow = X11_CreateWindow;
236  device->CreateSDLWindowFrom = X11_CreateWindowFrom;
237  device->SetWindowTitle = X11_SetWindowTitle;
238  device->SetWindowIcon = X11_SetWindowIcon;
239  device->SetWindowPosition = X11_SetWindowPosition;
240  device->SetWindowSize = X11_SetWindowSize;
241  device->SetWindowMinimumSize = X11_SetWindowMinimumSize;
242  device->SetWindowMaximumSize = X11_SetWindowMaximumSize;
243  device->GetWindowBordersSize = X11_GetWindowBordersSize;
244  device->SetWindowOpacity = X11_SetWindowOpacity;
245  device->SetWindowModalFor = X11_SetWindowModalFor;
246  device->SetWindowInputFocus = X11_SetWindowInputFocus;
247  device->ShowWindow = X11_ShowWindow;
248  device->HideWindow = X11_HideWindow;
249  device->RaiseWindow = X11_RaiseWindow;
250  device->MaximizeWindow = X11_MaximizeWindow;
251  device->MinimizeWindow = X11_MinimizeWindow;
252  device->RestoreWindow = X11_RestoreWindow;
253  device->SetWindowBordered = X11_SetWindowBordered;
254  device->SetWindowResizable = X11_SetWindowResizable;
255  device->SetWindowFullscreen = X11_SetWindowFullscreen;
256  device->SetWindowGammaRamp = X11_SetWindowGammaRamp;
257  device->SetWindowGrab = X11_SetWindowGrab;
258  device->DestroyWindow = X11_DestroyWindow;
259  device->CreateWindowFramebuffer = X11_CreateWindowFramebuffer;
260  device->UpdateWindowFramebuffer = X11_UpdateWindowFramebuffer;
261  device->DestroyWindowFramebuffer = X11_DestroyWindowFramebuffer;
262  device->GetWindowWMInfo = X11_GetWindowWMInfo;
263  device->SetWindowHitTest = X11_SetWindowHitTest;
264  device->AcceptDragAndDrop = X11_AcceptDragAndDrop;
265 
266  device->shape_driver.CreateShaper = X11_CreateShaper;
267  device->shape_driver.SetWindowShape = X11_SetWindowShape;
268  device->shape_driver.ResizeWindowShape = X11_ResizeWindowShape;
269 
270 #if SDL_VIDEO_OPENGL_GLX
271  device->GL_LoadLibrary = X11_GL_LoadLibrary;
272  device->GL_GetProcAddress = X11_GL_GetProcAddress;
273  device->GL_UnloadLibrary = X11_GL_UnloadLibrary;
274  device->GL_CreateContext = X11_GL_CreateContext;
275  device->GL_MakeCurrent = X11_GL_MakeCurrent;
276  device->GL_SetSwapInterval = X11_GL_SetSwapInterval;
277  device->GL_GetSwapInterval = X11_GL_GetSwapInterval;
278  device->GL_SwapWindow = X11_GL_SwapWindow;
279  device->GL_DeleteContext = X11_GL_DeleteContext;
280 #endif
281 #if SDL_VIDEO_OPENGL_EGL
282 #if SDL_VIDEO_OPENGL_GLX
284 #endif
285  device->GL_LoadLibrary = X11_GLES_LoadLibrary;
286  device->GL_GetProcAddress = X11_GLES_GetProcAddress;
287  device->GL_UnloadLibrary = X11_GLES_UnloadLibrary;
288  device->GL_CreateContext = X11_GLES_CreateContext;
289  device->GL_MakeCurrent = X11_GLES_MakeCurrent;
290  device->GL_SetSwapInterval = X11_GLES_SetSwapInterval;
291  device->GL_GetSwapInterval = X11_GLES_GetSwapInterval;
292  device->GL_SwapWindow = X11_GLES_SwapWindow;
293  device->GL_DeleteContext = X11_GLES_DeleteContext;
294 #if SDL_VIDEO_OPENGL_GLX
295  }
296 #endif
297 #endif
298 
299  device->SetClipboardText = X11_SetClipboardText;
300  device->GetClipboardText = X11_GetClipboardText;
301  device->HasClipboardText = X11_HasClipboardText;
302  device->StartTextInput = X11_StartTextInput;
303  device->StopTextInput = X11_StopTextInput;
304  device->SetTextInputRect = X11_SetTextInputRect;
305 
306  device->free = X11_DeleteDevice;
307 
308 #if SDL_VIDEO_VULKAN
309  device->Vulkan_LoadLibrary = X11_Vulkan_LoadLibrary;
310  device->Vulkan_UnloadLibrary = X11_Vulkan_UnloadLibrary;
311  device->Vulkan_GetInstanceExtensions = X11_Vulkan_GetInstanceExtensions;
312  device->Vulkan_CreateSurface = X11_Vulkan_CreateSurface;
313 #endif
314 
315  return device;
316 }
317 
319  "x11", "SDL X11 video driver",
320  X11_Available, X11_CreateDevice
321 };
322 
323 static int (*handler) (Display *, XErrorEvent *) = NULL;
324 static int
325 X11_CheckWindowManagerErrorHandler(Display * d, XErrorEvent * e)
326 {
327  if (e->error_code == BadWindow) {
328  return (0);
329  } else {
330  return (handler(d, e));
331  }
332 }
333 
334 static void
335 X11_CheckWindowManager(_THIS)
336 {
338  Display *display = data->display;
339  Atom _NET_SUPPORTING_WM_CHECK;
340  int status, real_format;
341  Atom real_type;
342  unsigned long items_read = 0, items_left = 0;
343  unsigned char *propdata = NULL;
344  Window wm_window = 0;
345 #ifdef DEBUG_WINDOW_MANAGER
346  char *wm_name;
347 #endif
348 
349  /* Set up a handler to gracefully catch errors */
350  X11_XSync(display, False);
351  handler = X11_XSetErrorHandler(X11_CheckWindowManagerErrorHandler);
352 
353  _NET_SUPPORTING_WM_CHECK = X11_XInternAtom(display, "_NET_SUPPORTING_WM_CHECK", False);
354  status = X11_XGetWindowProperty(display, DefaultRootWindow(display), _NET_SUPPORTING_WM_CHECK, 0L, 1L, False, XA_WINDOW, &real_type, &real_format, &items_read, &items_left, &propdata);
355  if (status == Success) {
356  if (items_read) {
357  wm_window = ((Window*)propdata)[0];
358  }
359  if (propdata) {
360  X11_XFree(propdata);
361  propdata = NULL;
362  }
363  }
364 
365  if (wm_window) {
366  status = X11_XGetWindowProperty(display, wm_window, _NET_SUPPORTING_WM_CHECK, 0L, 1L, False, XA_WINDOW, &real_type, &real_format, &items_read, &items_left, &propdata);
367  if (status != Success || !items_read || wm_window != ((Window*)propdata)[0]) {
368  wm_window = None;
369  }
370  if (status == Success && propdata) {
371  X11_XFree(propdata);
372  propdata = NULL;
373  }
374  }
375 
376  /* Reset the error handler, we're done checking */
377  X11_XSync(display, False);
378  X11_XSetErrorHandler(handler);
379 
380  if (!wm_window) {
381 #ifdef DEBUG_WINDOW_MANAGER
382  printf("Couldn't get _NET_SUPPORTING_WM_CHECK property\n");
383 #endif
384  return;
385  }
386  data->net_wm = SDL_TRUE;
387 
388 #ifdef DEBUG_WINDOW_MANAGER
389  wm_name = X11_GetWindowTitle(_this, wm_window);
390  printf("Window manager: %s\n", wm_name);
391  SDL_free(wm_name);
392 #endif
393 }
394 
395 
396 int
397 X11_VideoInit(_THIS)
398 {
400 
401  /* Get the window class name, usually the name of the application */
402  data->classname = get_classname();
403 
404  /* Get the process PID to be associated to the window */
405  data->pid = getpid();
406 
407  /* I have no idea how random this actually is, or has to be. */
408  data->window_group = (XID) (((size_t) data->pid) ^ ((size_t) _this));
409 
410  /* Look up some useful Atoms */
411 #define GET_ATOM(X) data->X = X11_XInternAtom(data->display, #X, False)
412  GET_ATOM(WM_PROTOCOLS);
413  GET_ATOM(WM_DELETE_WINDOW);
414  GET_ATOM(WM_TAKE_FOCUS);
415  GET_ATOM(_NET_WM_STATE);
416  GET_ATOM(_NET_WM_STATE_HIDDEN);
417  GET_ATOM(_NET_WM_STATE_FOCUSED);
420  GET_ATOM(_NET_WM_STATE_FULLSCREEN);
421  GET_ATOM(_NET_WM_STATE_ABOVE);
422  GET_ATOM(_NET_WM_STATE_SKIP_TASKBAR);
423  GET_ATOM(_NET_WM_STATE_SKIP_PAGER);
424  GET_ATOM(_NET_WM_ALLOWED_ACTIONS);
425  GET_ATOM(_NET_WM_ACTION_FULLSCREEN);
426  GET_ATOM(_NET_WM_NAME);
427  GET_ATOM(_NET_WM_ICON_NAME);
428  GET_ATOM(_NET_WM_ICON);
429  GET_ATOM(_NET_WM_PING);
430  GET_ATOM(_NET_WM_WINDOW_OPACITY);
431  GET_ATOM(_NET_WM_USER_TIME);
432  GET_ATOM(_NET_ACTIVE_WINDOW);
433  GET_ATOM(_NET_FRAME_EXTENTS);
434  GET_ATOM(UTF8_STRING);
435  GET_ATOM(PRIMARY);
436  GET_ATOM(XdndEnter);
437  GET_ATOM(XdndPosition);
438  GET_ATOM(XdndStatus);
439  GET_ATOM(XdndTypeList);
440  GET_ATOM(XdndActionCopy);
441  GET_ATOM(XdndDrop);
442  GET_ATOM(XdndFinished);
443  GET_ATOM(XdndSelection);
444  GET_ATOM(XKLAVIER_STATE);
445 
446  /* Detect the window manager */
447  X11_CheckWindowManager(_this);
448 
449  if (X11_InitModes(_this) < 0) {
450  return -1;
451  }
452 
454 
455  if (X11_InitKeyboard(_this) != 0) {
456  return -1;
457  }
459 
461 
462 #if SDL_USE_LIBDBUS
463  SDL_DBus_Init();
464 #endif
465 
466  return 0;
467 }
468 
469 void
470 X11_VideoQuit(_THIS)
471 {
473 
474  if (data->clipboard_window) {
475  X11_XDestroyWindow(data->display, data->clipboard_window);
476  }
477 
478  SDL_free(data->classname);
479 #ifdef X_HAVE_UTF8_STRING
480  if (data->im) {
481  X11_XCloseIM(data->im);
482  }
483 #endif
484 
489 
490 /* !!! FIXME: other subsystems use D-Bus, so we shouldn't quit it here;
491  have SDL.c do this at a higher level, or add refcounting. */
492 #if SDL_USE_LIBDBUS
493  SDL_DBus_Quit();
494 #endif
495 }
496 
497 SDL_bool
499 {
500  return SDL_getenv("SDL_VIDEO_X11_NODIRECTCOLOR") ? SDL_FALSE : SDL_TRUE;
501 }
502 
503 #endif /* SDL_VIDEO_DRIVER_X11 */
504 
505 /* vim: set ts=4 sw=4 expandtab: */
X11_MaximizeWindow
void X11_MaximizeWindow(_THIS, SDL_Window *window)
X11_DestroyWindow
void X11_DestroyWindow(_THIS, SDL_Window *window)
X11_UseDirectColorVisuals
SDL_bool X11_UseDirectColorVisuals(void)
X11_SetWindowIcon
void X11_SetWindowIcon(_THIS, SDL_Window *window, SDL_Surface *icon)
X11_SetWindowShape
int X11_SetWindowShape(SDL_WindowShaper *shaper, SDL_Surface *shape, SDL_WindowShapeMode *shapeMode)
X11_GetClipboardText
char * X11_GetClipboardText(_THIS)
X11_MinimizeWindow
void X11_MinimizeWindow(_THIS, SDL_Window *window)
SDL_VideoDevice::driverdata
void * driverdata
Definition: SDL_sysvideo.h:389
X11_DestroyWindowFramebuffer
void X11_DestroyWindowFramebuffer(_THIS, SDL_Window *window)
SDL_VideoData::_NET_WM_PING
Atom _NET_WM_PING
Definition: SDL_x11video.h:109
SDL_VideoData::_NET_WM_STATE_ABOVE
Atom _NET_WM_STATE_ABOVE
Definition: SDL_x11video.h:101
SDL_x11video.h
X11_QuitTouch
void X11_QuitTouch(_THIS)
SDL_VideoData::XdndEnter
Atom XdndEnter
Definition: SDL_x11video.h:116
SDL_mouse.h
if
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 abits op endm macro pixldst3 mem_operand op endm macro pixldst30 mem_operand op endm macro pixldst abits if abits elseif abits elseif abits elseif abits elseif abits pixldst0 abits else pixldst0 abits pixldst0 abits pixldst0 abits pixldst0 abits endif elseif abits else pixldst0 abits pixldst0 abits endif elseif abits else error unsupported bpp *numpix else pixst endif endm macro pixld1_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl else error unsupported endif endm macro pixld2_s mem_operand if mov asr add asl add asl mov asr sub UNIT_X add asl mov asr add asl add asl mov asr add UNIT_X add asl else pixld1_s mem_operand pixld1_s mem_operand endif endm macro pixld0_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl endif endm macro pixld_s_internal mem_operand if mem_operand pixld2_s mem_operand pixdeinterleave basereg elseif mem_operand elseif mem_operand elseif mem_operand elseif mem_operand pixld0_s mem_operand else pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else error unsupported mem_operand if bpp mem_operand endif endm macro vuzp8 reg2 vuzp d d &reg2 endm macro vzip8 reg2 vzip d d &reg2 endm macro pixdeinterleave basereg basereg basereg basereg basereg endif endm macro pixinterleave basereg basereg basereg basereg basereg endif endm macro PF boost_increment endif if endif PF tst PF addne PF subne PF cmp ORIG_W if endif if endif if endif PF subge ORIG_W PF subges if endif if endif if endif endif endm macro cache_preload_simple endif if dst_r_bpp pld[DST_R, #(PREFETCH_DISTANCE_SIMPLE *dst_r_bpp/8)] endif if mask_bpp pld if[MASK, #(PREFETCH_DISTANCE_SIMPLE *mask_bpp/8)] endif endif endm macro fetch_mask_pixblock pixld mask_basereg pixblock_size MASK endm macro ensure_destination_ptr_alignment process_pixblock_tail_head if beq irp skip1(dst_w_bpp<=(lowbit *8)) &&((lowbit *8)<(pixblock_size *dst_w_bpp)) .if lowbit< 16 tst DST_R
Definition: pixman-arm-neon-asm.h:469
NULL
#define NULL
Definition: begin_code.h:167
SDL_timer.h
endif
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 abits op endm macro pixldst3 mem_operand op endm macro pixldst30 mem_operand op endm macro pixldst abits if abits elseif abits elseif abits elseif abits elseif abits pixldst0 abits else pixldst0 abits pixldst0 abits pixldst0 abits pixldst0 abits endif elseif abits else pixldst0 abits pixldst0 abits endif elseif abits else error unsupported bpp *numpix else pixst endif endm macro pixld1_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl else error unsupported endif endm macro pixld2_s mem_operand if mov asr add asl add asl mov asr sub UNIT_X add asl mov asr add asl add asl mov asr add UNIT_X add asl else pixld1_s mem_operand pixld1_s mem_operand endif endm macro pixld0_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl endif endm macro pixld_s_internal mem_operand if mem_operand pixld2_s mem_operand pixdeinterleave basereg elseif mem_operand elseif mem_operand elseif mem_operand elseif mem_operand pixld0_s mem_operand else pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else error unsupported mem_operand if bpp mem_operand endif endm macro vuzp8 reg2 vuzp d d &reg2 endm macro vzip8 reg2 vzip d d &reg2 endm macro pixdeinterleave basereg basereg basereg basereg basereg endif endm macro pixinterleave basereg basereg basereg basereg basereg endif endm macro PF boost_increment endif if endif PF tst PF addne PF subne PF cmp ORIG_W if endif if endif if endif PF subge ORIG_W PF subges if endif if endif if endif endif endm macro cache_preload_simple endif if dst_r_bpp pld[DST_R, #(PREFETCH_DISTANCE_SIMPLE *dst_r_bpp/8)] endif if mask_bpp pld endif[MASK, #(PREFETCH_DISTANCE_SIMPLE *mask_bpp/8)] endif endif endm macro fetch_mask_pixblock pixld mask_basereg pixblock_size MASK endm macro ensure_destination_ptr_alignment process_pixblock_tail_head if beq irp skip1 beq endif SRC MASK if dst_r_bpp DST_R else add endif PF add sub src_basereg pixdeinterleave mask_basereg pixdeinterleave dst_r_basereg process_pixblock_head pixblock_size cache_preload_simple process_pixblock_tail pixinterleave dst_w_basereg irp beq endif process_pixblock_tail_head tst beq irp if pixblock_size chunk_size tst beq pixld_src SRC pixld MASK if DST_R else pixld DST_R endif if
Definition: pixman-arm-neon-asm.h:549
X11_bootstrap
VideoBootStrap X11_bootstrap
X11_GetDisplayModes
void X11_GetDisplayModes(_THIS, SDL_VideoDisplay *display)
size_t
unsigned int size_t
Definition: SDL_config_windows.h:68
SDL_x11shape.h
X11_SetWindowHitTest
int X11_SetWindowHitTest(SDL_Window *window, SDL_bool enabled)
X11_RestoreWindow
void X11_RestoreWindow(_THIS, SDL_Window *window)
X11_GetWindowBordersSize
int X11_GetWindowBordersSize(_THIS, SDL_Window *window, int *top, int *left, int *bottom, int *right)
SDL_VideoData::WM_TAKE_FOCUS
Atom WM_TAKE_FOCUS
Definition: SDL_x11video.h:94
X11_InitTouch
void X11_InitTouch(_THIS)
SDL_X11_LoadSymbols
int SDL_X11_LoadSymbols(void)
X11_SetDisplayMode
int X11_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode)
SDL_VideoData::_NET_WM_USER_TIME
Atom _NET_WM_USER_TIME
Definition: SDL_x11video.h:111
SDL_VideoData::WM_PROTOCOLS
Atom WM_PROTOCOLS
Definition: SDL_x11video.h:92
SDL_VideoDisplay::desktop_mode
SDL_DisplayMode desktop_mode
Definition: SDL_sysvideo.h:132
X11_QuitKeyboard
void X11_QuitKeyboard(_THIS)
X11_SetWindowMinimumSize
void X11_SetWindowMinimumSize(_THIS, SDL_Window *window)
X11_SetTextInputRect
void X11_SetTextInputRect(_THIS, SDL_Rect *rect)
SDL_x11touch.h
SDL_X11_UnloadSymbols
void SDL_X11_UnloadSymbols(void)
X11_GetWindowWMInfo
SDL_bool X11_GetWindowWMInfo(_THIS, SDL_Window *window, struct SDL_SysWMinfo *info)
X11_StartTextInput
void X11_StartTextInput(_THIS)
X11_SetWindowOpacity
int X11_SetWindowOpacity(_THIS, SDL_Window *window, float opacity)
X11_QuitModes
void X11_QuitModes(_THIS)
data
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: SDL_opengl.h:1974
X11_HideWindow
void X11_HideWindow(_THIS, SDL_Window *window)
SDL_DisplayMode
The structure that defines a display mode.
Definition: SDL_video.h:54
SDL_VideoData::XdndStatus
Atom XdndStatus
Definition: SDL_x11video.h:118
SDL_VideoData::PRIMARY
Atom PRIMARY
Definition: SDL_x11video.h:115
X11_GetWindowTitle
char * X11_GetWindowTitle(_THIS, Window xwindow)
X11_SetWindowInputFocus
int X11_SetWindowInputFocus(_THIS, SDL_Window *window)
SDL_x11vulkan.h
SDL_GetHintBoolean
#define SDL_GetHintBoolean
Definition: SDL_dynapi_overrides.h:608
SDL_VideoData::_NET_ACTIVE_WINDOW
Atom _NET_ACTIVE_WINDOW
Definition: SDL_x11video.h:112
X11_SetWindowPosition
void X11_SetWindowPosition(_THIS, SDL_Window *window)
_this
static SDL_VideoDevice * _this
Definition: SDL_video.c:121
SDL_VideoData::XdndSelection
Atom XdndSelection
Definition: SDL_x11video.h:123
SDL_VideoData::_NET_WM_STATE_MAXIMIZED_HORZ
Atom _NET_WM_STATE_MAXIMIZED_HORZ
Definition: SDL_x11video.h:99
X11_ShowWindow
void X11_ShowWindow(_THIS, SDL_Window *window)
SDL_VideoData::XdndPosition
Atom XdndPosition
Definition: SDL_x11video.h:117
SDL_memcmp
#define SDL_memcmp
Definition: SDL_dynapi_overrides.h:389
X11_SetWindowModalFor
int X11_SetWindowModalFor(_THIS, SDL_Window *modal_window, SDL_Window *parent_window)
SDL_free
#define SDL_free
Definition: SDL_dynapi_overrides.h:377
SDL_VideoData::XKLAVIER_STATE
Atom XKLAVIER_STATE
Definition: SDL_x11video.h:124
X11_GetDisplayDPI
int X11_GetDisplayDPI(_THIS, SDL_VideoDisplay *sdl_display, float *ddpi, float *hdpi, float *vdpi)
SDL_VideoData::_NET_WM_STATE_SKIP_TASKBAR
Atom _NET_WM_STATE_SKIP_TASKBAR
Definition: SDL_x11video.h:102
X11_GetDisplayUsableBounds
int X11_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay *sdl_display, SDL_Rect *rect)
X11_SetWindowTitle
void X11_SetWindowTitle(_THIS, SDL_Window *window)
SDL_VideoData::_NET_WM_STATE_HIDDEN
Atom _NET_WM_STATE_HIDDEN
Definition: SDL_x11video.h:96
X11_ResetTouch
void X11_ResetTouch(_THIS)
SDL_VideoData::_NET_WM_STATE_MAXIMIZED_VERT
Atom _NET_WM_STATE_MAXIMIZED_VERT
Definition: SDL_x11video.h:98
X11_AcceptDragAndDrop
void X11_AcceptDragAndDrop(SDL_Window *window, SDL_bool accept)
X11_CreateWindowFramebuffer
int X11_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch)
X11_SetWindowResizable
void X11_SetWindowResizable(_THIS, SDL_Window *window, SDL_bool resizable)
X11_HasClipboardText
SDL_bool X11_HasClipboardText(_THIS)
SDL_VideoData::int
int
Definition: SDL_windowsvideo.h:135
X11_RaiseWindow
void X11_RaiseWindow(_THIS, SDL_Window *window)
_THIS
#define _THIS
Definition: SDL_alsa_audio.h:31
X11_UpdateWindowFramebuffer
int X11_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects)
X11_SetWindowBordered
void X11_SetWindowBordered(_THIS, SDL_Window *window, SDL_bool bordered)
SDL_TRUE
@ SDL_TRUE
Definition: SDL_stdinc.h:164
SDL_Delay
#define SDL_Delay
Definition: SDL_dynapi_overrides.h:486
SDL_VideoData::_NET_WM_ACTION_FULLSCREEN
Atom _NET_WM_ACTION_FULLSCREEN
Definition: SDL_x11video.h:105
SDL_x11opengles.h
SDL_VideoDevice
Definition: SDL_sysvideo.h:150
SDL_OutOfMemory
#define SDL_OutOfMemory()
Definition: SDL_error.h:52
SDL_HINT_VIDEO_X11_FORCE_EGL
#define SDL_HINT_VIDEO_X11_FORCE_EGL
A variable controlling whether X11 should use GLX or EGL by default.
Definition: SDL_hints.h:256
SDL_VideoData::_NET_WM_WINDOW_OPACITY
Atom _NET_WM_WINDOW_OPACITY
Definition: SDL_x11video.h:110
SDL_VideoData::_NET_WM_ALLOWED_ACTIONS
Atom _NET_WM_ALLOWED_ACTIONS
Definition: SDL_x11video.h:104
SDL_VideoData::XdndTypeList
Atom XdndTypeList
Definition: SDL_x11video.h:119
SDL_arraysize
#define SDL_arraysize(array)
Definition: SDL_stdinc.h:115
SDL_calloc
#define SDL_calloc
Definition: SDL_dynapi_overrides.h:375
X11_SuspendScreenSaver
void X11_SuspendScreenSaver(_THIS)
X11_StopTextInput
void X11_StopTextInput(_THIS)
SDL_VideoData::display
struct wl_display * display
Definition: SDL_waylandvideo.h:50
X11_CreateWindow
int X11_CreateWindow(_THIS, SDL_Window *window)
SDL_getenv
#define SDL_getenv
Definition: SDL_dynapi_overrides.h:378
X11_SetWindowGrab
void X11_SetWindowGrab(_THIS, SDL_Window *window, SDL_bool grabbed)
SDL_VideoData::_NET_WM_NAME
Atom _NET_WM_NAME
Definition: SDL_x11video.h:106
X11_SetWindowGammaRamp
int X11_SetWindowGammaRamp(_THIS, SDL_Window *window, const Uint16 *ramp)
X11_SetWindowMaximumSize
void X11_SetWindowMaximumSize(_THIS, SDL_Window *window)
SDL_VideoDisplay
Definition: SDL_sysvideo.h:127
SDL_SetError
#define SDL_SetError
Definition: SDL_dynapi_overrides.h:30
SDL_VideoData::XdndFinished
Atom XdndFinished
Definition: SDL_x11video.h:122
X11_GetDisplayBounds
int X11_GetDisplayBounds(_THIS, SDL_VideoDisplay *sdl_display, SDL_Rect *rect)
SDL_snprintf
#define SDL_snprintf
Definition: SDL_dynapi_overrides.h:40
SDL_x11xinput2.h
SDL_hints.h
e
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 Uint32 * e
Definition: SDL_dynapi_procs.h:117
X11_InitKeyboard
int X11_InitKeyboard(_THIS)
SDL_VideoData::_NET_WM_ICON_NAME
Atom _NET_WM_ICON_NAME
Definition: SDL_x11video.h:107
SDL_VideoData::UTF8_STRING
Atom UTF8_STRING
Definition: SDL_x11video.h:114
SDL_VideoData::_NET_WM_STATE
Atom _NET_WM_STATE
Definition: SDL_x11video.h:95
X11_InitMouse
void X11_InitMouse(_THIS)
SDL_strdup
#define SDL_strdup
Definition: SDL_dynapi_overrides.h:397
X11_SetClipboardText
int X11_SetClipboardText(_THIS, const char *text)
X11_InitModes
int X11_InitModes(_THIS)
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:162
SDL_x11framebuffer.h
SDL_video.h
SDL_GetVideoDevice
SDL_VideoDevice * SDL_GetVideoDevice(void)
Definition: SDL_video.c:586
SDL_strrchr
#define SDL_strrchr
Definition: SDL_dynapi_overrides.h:402
SDL_FALSE
@ SDL_FALSE
Definition: SDL_stdinc.h:163
X11_InitXinput2
void X11_InitXinput2(_THIS)
SDL_VideoData::_NET_WM_STATE_SKIP_PAGER
Atom _NET_WM_STATE_SKIP_PAGER
Definition: SDL_x11video.h:103
SDL_VideoDisplay::current_mode
SDL_DisplayMode current_mode
Definition: SDL_sysvideo.h:133
SDL_VideoData::_NET_FRAME_EXTENTS
Atom _NET_FRAME_EXTENTS
Definition: SDL_x11video.h:113
X11_QuitMouse
void X11_QuitMouse(_THIS)
VideoBootStrap
Definition: SDL_sysvideo.h:406
X11_CreateShaper
SDL_WindowShaper * X11_CreateShaper(SDL_Window *window)
X11_SetWindowSize
void X11_SetWindowSize(_THIS, SDL_Window *window)
device
static SDL_AudioDeviceID device
Definition: loopwave.c:37
X11_CreateWindowFrom
int X11_CreateWindowFrom(_THIS, SDL_Window *window, const void *data)
X11_PumpEvents
void X11_PumpEvents(_THIS)
SDL_VideoData::WM_DELETE_WINDOW
Atom WM_DELETE_WINDOW
Definition: SDL_x11video.h:93
X11_SetWindowFullscreen
void X11_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen)
SDL_VideoData::XdndActionCopy
Atom XdndActionCopy
Definition: SDL_x11video.h:120
SDL_VideoData::_NET_WM_ICON
Atom _NET_WM_ICON
Definition: SDL_x11video.h:108
X11_ResizeWindowShape
int X11_ResizeWindowShape(SDL_Window *window)
SDL_VideoData::XdndDrop
Atom XdndDrop
Definition: SDL_x11video.h:121
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_VideoData::_NET_WM_STATE_FULLSCREEN
Atom _NET_WM_STATE_FULLSCREEN
Definition: SDL_x11video.h:100
SDL_VideoData
Definition: SDL_androidvideo.h:37
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_VideoData::_NET_WM_STATE_FOCUSED
Atom _NET_WM_STATE_FOCUSED
Definition: SDL_x11video.h:97