zenilib: zenilib/jni/external/sdl/src/video/x11/SDL_x11video.c Source File

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
SDL_x11video.c
Go to the documentation of this file.
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2013 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_config.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_sysvideo.h"
30 #include "../SDL_pixels_c.h"
31
32 #include "SDL_x11video.h"
33 #include "SDL_x11framebuffer.h"
34 #include "SDL_x11shape.h"
35 #include "SDL_x11touch.h"
36 #include "SDL_x11xinput2.h"
37
38 #if SDL_VIDEO_OPENGL_EGL
39 #include "SDL_x11opengles.h"
40 #endif
41
42 /* !!! FIXME: move dbus stuff to somewhere under src/core/linux ... */
43 #if SDL_USE_LIBDBUS
44 /* we never link directly to libdbus. */
45 #include "SDL_loadso.h"
46 static const char *dbus_library = "libdbus-1.so.3";
47 static void *dbus_handle = NULL;
48
49 /* !!! FIXME: this is kinda ugly. */
50 static SDL_bool
51 load_dbus_sym(const char *fn, void **addr)
52 {
53 *addr = SDL_LoadFunction(dbus_handle, fn);
54 if (*addr == NULL) {
55 /* Don't call SDL_SetError(): SDL_LoadFunction already did. */
56 return SDL_FALSE;
57 }
58
59 return SDL_TRUE;
60 }
61
62 /* libdbus entry points... */
63 static DBusConnection *(*DBUS_dbus_bus_get_private)(DBusBusType, DBusError *) = NULL;
64 static void (*DBUS_dbus_connection_set_exit_on_disconnect)(DBusConnection *, dbus_bool_t) = NULL;
65 static dbus_bool_t (*DBUS_dbus_connection_send)(DBusConnection *, DBusMessage *, dbus_uint32_t *) = NULL;
66 static void (*DBUS_dbus_connection_close)(DBusConnection *) = NULL;
67 static void (*DBUS_dbus_connection_unref)(DBusConnection *) = NULL;
68 static void (*DBUS_dbus_connection_flush)(DBusConnection *) = NULL;
69 static DBusMessage *(*DBUS_dbus_message_new_method_call)(const char *, const char *, const char *, const char *) = NULL;
70 static void (*DBUS_dbus_message_unref)(DBusMessage *) = NULL;
71 static void (*DBUS_dbus_error_init)(DBusError *) = NULL;
72 static dbus_bool_t (*DBUS_dbus_error_is_set)(const DBusError *) = NULL;
73 static void (*DBUS_dbus_error_free)(DBusError *) = NULL;
74
75 static int
76 load_dbus_syms(void)
77 {
78 /* cast funcs to char* first, to please GCC's strict aliasing rules. */
79 #define SDL_DBUS_SYM(x) \
80 if (!load_dbus_sym(#x, (void **) (char *) &DBUS_##x)) return -1
81
82 SDL_DBUS_SYM(dbus_bus_get_private);
83 SDL_DBUS_SYM(dbus_connection_set_exit_on_disconnect);
84 SDL_DBUS_SYM(dbus_connection_send);
85 SDL_DBUS_SYM(dbus_connection_close);
86 SDL_DBUS_SYM(dbus_connection_unref);
87 SDL_DBUS_SYM(dbus_connection_flush);
88 SDL_DBUS_SYM(dbus_message_new_method_call);
89 SDL_DBUS_SYM(dbus_message_unref);
90 SDL_DBUS_SYM(dbus_error_init);
91 SDL_DBUS_SYM(dbus_error_is_set);
92 SDL_DBUS_SYM(dbus_error_free);
93
94 #undef SDL_DBUS_SYM
95
96 return 0;
97 }
98
99 static void
100 UnloadDBUSLibrary(void)
101 {
102 if (dbus_handle != NULL) {
103 SDL_UnloadObject(dbus_handle);
104 dbus_handle = NULL;
105 }
106 }
107
108 static int
109 LoadDBUSLibrary(void)
110 {
111 int retval = 0;
112 if (dbus_handle == NULL) {
113 dbus_handle = SDL_LoadObject(dbus_library);
114 if (dbus_handle == NULL) {
115 retval = -1;
116 /* Don't call SDL_SetError(): SDL_LoadObject already did. */
117 } else {
118 retval = load_dbus_syms();
119 if (retval < 0) {
120 UnloadDBUSLibrary();
121 }
122 }
123 }
124
125 return retval;
126 }
127
128 static void
129 X11_InitDBus(_THIS)
130 {
131 if (LoadDBUSLibrary() != -1) {
132 SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
133 DBusError err;
134 DBUS_dbus_error_init(&err);
135 data->dbus = DBUS_dbus_bus_get_private(DBUS_BUS_SESSION, &err);
136 if (DBUS_dbus_error_is_set(&err)) {
137 DBUS_dbus_error_free(&err);
138 if (data->dbus) {
139 DBUS_dbus_connection_unref(data->dbus);
140 data->dbus = NULL;
141 }
142 return; /* oh well */
143 }
144 DBUS_dbus_connection_set_exit_on_disconnect(data->dbus, 0);
145 }
146 }
147
148 static void
149 X11_QuitDBus(_THIS)
150 {
151 SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
152 if (data->dbus) {
153 DBUS_dbus_connection_close(data->dbus);
154 DBUS_dbus_connection_unref(data->dbus);
155 data->dbus = NULL;
156 }
157 }
158
159 void
160 SDL_dbus_screensaver_tickle(_THIS)
161 {
162 const SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
163 DBusConnection *conn = data->dbus;
164 if (conn != NULL) {
165 DBusMessage *msg = DBUS_dbus_message_new_method_call("org.gnome.ScreenSaver",
166 "/org/gnome/ScreenSaver",
167 "org.gnome.ScreenSaver",
168 "SimulateUserActivity");
169 if (msg != NULL) {
170 if (DBUS_dbus_connection_send(conn, msg, NULL)) {
171 DBUS_dbus_connection_flush(conn);
172 }
173 DBUS_dbus_message_unref(msg);
174 }
175 }
176 }
177 #endif
178
179 /* Initialization/Query functions */
180 static int X11_VideoInit(_THIS);
181 static void X11_VideoQuit(_THIS);
182
183 /* Find out what class name we should use */
184 static char *
185 get_classname()
186 {
187 char *spot;
188 #if defined(__LINUX__) || defined(__FREEBSD__)
189 char procfile[1024];
190 char linkfile[1024];
191 int linksize;
192 #endif
193
194 /* First allow environment variable override */
195 spot = SDL_getenv("SDL_VIDEO_X11_WMCLASS");
196 if (spot) {
197 return SDL_strdup(spot);
198 }
199
200 /* Next look at the application's executable name */
201 #if defined(__LINUX__) || defined(__FREEBSD__)
202 #if defined(__LINUX__)
203 SDL_snprintf(procfile, SDL_arraysize(procfile), "/proc/%d/exe", getpid());
204 #elif defined(__FREEBSD__)
205 SDL_snprintf(procfile, SDL_arraysize(procfile), "/proc/%d/file",
206 getpid());
207 #else
208 #error Where can we find the executable name?
209 #endif
210 linksize = readlink(procfile, linkfile, sizeof(linkfile) - 1);
211 if (linksize > 0) {
212 linkfile[linksize] = '\0';
213 spot = SDL_strrchr(linkfile, '/');
214 if (spot) {
215 return SDL_strdup(spot + 1);
216 } else {
217 return SDL_strdup(linkfile);
218 }
219 }
220 #endif /* __LINUX__ || __FREEBSD__ */
221
222 /* Finally use the default we've used forever */
223 return SDL_strdup("SDL_App");
224 }
225
226 /* X11 driver bootstrap functions */
227
228 static int
229 X11_Available(void)
230 {
231 Display *display = NULL;
232 if (SDL_X11_LoadSymbols()) {
233 display = XOpenDisplay(NULL);
234 if (display != NULL) {
235 XCloseDisplay(display);
236 }
237 SDL_X11_UnloadSymbols();
238 }
239 return (display != NULL);
240 }
241
242 static void
243 X11_DeleteDevice(SDL_VideoDevice * device)
244 {
245 SDL_VideoData *data = (SDL_VideoData *) device->driverdata;
246 if (data->display) {
247 XCloseDisplay(data->display);
248 }
249 SDL_free(data->windowlist);
250 SDL_free(device->driverdata);
251 SDL_free(device);
252
253 SDL_X11_UnloadSymbols();
254 }
255
256 /* An error handler to reset the vidmode and then call the default handler. */
257 static SDL_bool safety_net_triggered = SDL_FALSE;
258 static int (*orig_x11_errhandler) (Display *, XErrorEvent *) = NULL;
259 static int
260 X11_SafetyNetErrHandler(Display * d, XErrorEvent * e)
261 {
262 SDL_VideoDevice *device = NULL;
263 /* if we trigger an error in our error handler, don't try again. */
264 if (!safety_net_triggered) {
265 safety_net_triggered = SDL_TRUE;
266 device = SDL_GetVideoDevice();
267 if (device != NULL) {
268 int i;
269 for (i = 0; i < device->num_displays; i++) {
270 SDL_VideoDisplay *display = &device->displays[i];
271 if (SDL_memcmp(&display->current_mode, &display->desktop_mode,
272 sizeof (SDL_DisplayMode)) != 0) {
273 X11_SetDisplayMode(device, display, &display->desktop_mode);
274 }
275 }
276 }
277 }
278
279 if (orig_x11_errhandler != NULL) {
280 return orig_x11_errhandler(d, e); /* probably terminate. */
281 }
282
283 return 0;
284 }
285
286 static SDL_VideoDevice *
287 X11_CreateDevice(int devindex)
288 {
289 SDL_VideoDevice *device;
290 SDL_VideoData *data;
291 const char *display = NULL; /* Use the DISPLAY environment variable */
292
293 if (!SDL_X11_LoadSymbols()) {
294 return NULL;
295 }
296
297 /* Need for threading gl calls. This is also required for the proprietary
298 nVidia driver to be threaded. */
299 XInitThreads();
300
301 /* Initialize all variables that we clean on shutdown */
302 device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice));
303 if (!device) {
304 SDL_OutOfMemory();
305 return NULL;
306 }
307 data = (struct SDL_VideoData *) SDL_calloc(1, sizeof(SDL_VideoData));
308 if (!data) {
309 SDL_free(device);
310 SDL_OutOfMemory();
311 return NULL;
312 }
313 device->driverdata = data;
314
315 /* FIXME: Do we need this?
316 if ( (SDL_strncmp(XDisplayName(display), ":", 1) == 0) ||
317 (SDL_strncmp(XDisplayName(display), "unix:", 5) == 0) ) {
318 local_X11 = 1;
319 } else {
320 local_X11 = 0;
321 }
322 */
323 data->display = XOpenDisplay(display);
324 #if defined(__osf__) && defined(SDL_VIDEO_DRIVER_X11_DYNAMIC)
325 /* On Tru64 if linking without -lX11, it fails and you get following message.
326 * Xlib: connection to ":0.0" refused by server
327 * Xlib: XDM authorization key matches an existing client!
328 *
329 * It succeeds if retrying 1 second later
330 * or if running xhost +localhost on shell.
331 */
332 if (data->display == NULL) {
333 SDL_Delay(1000);
334 data->display = XOpenDisplay(display);
335 }
336 #endif
337 if (data->display == NULL) {
338 SDL_free(device->driverdata);
339 SDL_free(device);
340 SDL_SetError("Couldn't open X11 display");
341 return NULL;
342 }
343 #ifdef X11_DEBUG
344 XSynchronize(data->display, True);
345 #endif
346
347 /* Hook up an X11 error handler to recover the desktop resolution. */
348 safety_net_triggered = SDL_FALSE;
349 orig_x11_errhandler = XSetErrorHandler(X11_SafetyNetErrHandler);
350
351 /* Set the function pointers */
352 device->VideoInit = X11_VideoInit;
353 device->VideoQuit = X11_VideoQuit;
354 device->GetDisplayModes = X11_GetDisplayModes;
355 device->GetDisplayBounds = X11_GetDisplayBounds;
356 device->SetDisplayMode = X11_SetDisplayMode;
357 device->SuspendScreenSaver = X11_SuspendScreenSaver;
358 device->PumpEvents = X11_PumpEvents;
359
360 device->CreateWindow = X11_CreateWindow;
361 device->CreateWindowFrom = X11_CreateWindowFrom;
362 device->SetWindowTitle = X11_SetWindowTitle;
363 device->SetWindowIcon = X11_SetWindowIcon;
364 device->SetWindowPosition = X11_SetWindowPosition;
365 device->SetWindowSize = X11_SetWindowSize;
366 device->SetWindowMinimumSize = X11_SetWindowMinimumSize;
367 device->SetWindowMaximumSize = X11_SetWindowMaximumSize;
368 device->ShowWindow = X11_ShowWindow;
369 device->HideWindow = X11_HideWindow;
370 device->RaiseWindow = X11_RaiseWindow;
371 device->MaximizeWindow = X11_MaximizeWindow;
372 device->MinimizeWindow = X11_MinimizeWindow;
373 device->RestoreWindow = X11_RestoreWindow;
374 device->SetWindowBordered = X11_SetWindowBordered;
375 device->SetWindowFullscreen = X11_SetWindowFullscreen;
376 device->SetWindowGammaRamp = X11_SetWindowGammaRamp;
377 device->SetWindowGrab = X11_SetWindowGrab;
378 device->DestroyWindow = X11_DestroyWindow;
379 device->CreateWindowFramebuffer = X11_CreateWindowFramebuffer;
380 device->UpdateWindowFramebuffer = X11_UpdateWindowFramebuffer;
381 device->DestroyWindowFramebuffer = X11_DestroyWindowFramebuffer;
382 device->GetWindowWMInfo = X11_GetWindowWMInfo;
383
384 device->shape_driver.CreateShaper = X11_CreateShaper;
385 device->shape_driver.SetWindowShape = X11_SetWindowShape;
386 device->shape_driver.ResizeWindowShape = X11_ResizeWindowShape;
387
388 #if SDL_VIDEO_OPENGL_GLX
389 device->GL_LoadLibrary = X11_GL_LoadLibrary;
390 device->GL_GetProcAddress = X11_GL_GetProcAddress;
391 device->GL_UnloadLibrary = X11_GL_UnloadLibrary;
392 device->GL_CreateContext = X11_GL_CreateContext;
393 device->GL_MakeCurrent = X11_GL_MakeCurrent;
394 device->GL_SetSwapInterval = X11_GL_SetSwapInterval;
395 device->GL_GetSwapInterval = X11_GL_GetSwapInterval;
396 device->GL_SwapWindow = X11_GL_SwapWindow;
397 device->GL_DeleteContext = X11_GL_DeleteContext;
398 #elif SDL_VIDEO_OPENGL_EGL
399 device->GL_LoadLibrary = X11_GLES_LoadLibrary;
400 device->GL_GetProcAddress = X11_GLES_GetProcAddress;
401 device->GL_UnloadLibrary = X11_GLES_UnloadLibrary;
402 device->GL_CreateContext = X11_GLES_CreateContext;
403 device->GL_MakeCurrent = X11_GLES_MakeCurrent;
404 device->GL_SetSwapInterval = X11_GLES_SetSwapInterval;
405 device->GL_GetSwapInterval = X11_GLES_GetSwapInterval;
406 device->GL_SwapWindow = X11_GLES_SwapWindow;
407 device->GL_DeleteContext = X11_GLES_DeleteContext;
408 #endif
409
410 device->SetClipboardText = X11_SetClipboardText;
411 device->GetClipboardText = X11_GetClipboardText;
412 device->HasClipboardText = X11_HasClipboardText;
413
414 device->free = X11_DeleteDevice;
415
416 return device;
417 }
418
419 VideoBootStrap X11_bootstrap = {
420 "x11", "SDL X11 video driver",
421 X11_Available, X11_CreateDevice
422 };
423
424 static int (*handler) (Display *, XErrorEvent *) = NULL;
425 static int
426 X11_CheckWindowManagerErrorHandler(Display * d, XErrorEvent * e)
427 {
428 if (e->error_code == BadWindow) {
429 return (0);
430 } else {
431 return (handler(d, e));
432 }
433 }
434
435 static void
436 X11_CheckWindowManager(_THIS)
437 {
438 SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
439 Display *display = data->display;
440 Atom _NET_SUPPORTING_WM_CHECK;
441 int status, real_format;
442 Atom real_type;
443 unsigned long items_read, items_left;
444 unsigned char *propdata;
445 Window wm_window = 0;
446 #ifdef DEBUG_WINDOW_MANAGER
447 char *wm_name;
448 #endif
449
450 /* Set up a handler to gracefully catch errors */
451 XSync(display, False);
452 handler = XSetErrorHandler(X11_CheckWindowManagerErrorHandler);
453
454 _NET_SUPPORTING_WM_CHECK = XInternAtom(display, "_NET_SUPPORTING_WM_CHECK", False);
455 status = XGetWindowProperty(display, DefaultRootWindow(display), _NET_SUPPORTING_WM_CHECK, 0L, 1L, False, XA_WINDOW, &real_type, &real_format, &items_read, &items_left, &propdata);
456 if (status == Success && items_read) {
457 wm_window = ((Window*)propdata)[0];
458 }
459 if (propdata) {
460 XFree(propdata);
461 }
462
463 if (wm_window) {
464 status = XGetWindowProperty(display, wm_window, _NET_SUPPORTING_WM_CHECK, 0L, 1L, False, XA_WINDOW, &real_type, &real_format, &items_read, &items_left, &propdata);
465 if (status != Success || !items_read || wm_window != ((Window*)propdata)[0]) {
466 wm_window = None;
467 }
468 if (propdata) {
469 XFree(propdata);
470 }
471 }
472
473 /* Reset the error handler, we're done checking */
474 XSync(display, False);
475 XSetErrorHandler(handler);
476
477 if (!wm_window) {
478 #ifdef DEBUG_WINDOW_MANAGER
479 printf("Couldn't get _NET_SUPPORTING_WM_CHECK property\n");
480 #endif
481 return;
482 }
483 data->net_wm = SDL_TRUE;
484
485 #ifdef DEBUG_WINDOW_MANAGER
486 wm_name = X11_GetWindowTitle(_this, wm_window);
487 printf("Window manager: %s\n", wm_name);
488 SDL_free(wm_name);
489 #endif
490 }
491
492
493 int
494 X11_VideoInit(_THIS)
495 {
496 SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
497
498 /* Get the window class name, usually the name of the application */
499 data->classname = get_classname();
500
501 /* Get the process PID to be associated to the window */
502 data->pid = getpid();
503
504 /* Open a connection to the X input manager */
505 #ifdef X_HAVE_UTF8_STRING
506 if (SDL_X11_HAVE_UTF8) {
507 data->im =
508 XOpenIM(data->display, NULL, data->classname, data->classname);
509 }
510 #endif
511
512 /* Look up some useful Atoms */
513 #define GET_ATOM(X) data->X = XInternAtom(data->display, #X, False)
514 GET_ATOM(WM_PROTOCOLS);
515 GET_ATOM(WM_DELETE_WINDOW);
516 GET_ATOM(_NET_WM_STATE);
517 GET_ATOM(_NET_WM_STATE_HIDDEN);
518 GET_ATOM(_NET_WM_STATE_FOCUSED);
519 GET_ATOM(_NET_WM_STATE_MAXIMIZED_VERT);
520 GET_ATOM(_NET_WM_STATE_MAXIMIZED_HORZ);
521 GET_ATOM(_NET_WM_STATE_FULLSCREEN);
522 GET_ATOM(_NET_WM_ALLOWED_ACTIONS);
523 GET_ATOM(_NET_WM_ACTION_FULLSCREEN);
524 GET_ATOM(_NET_WM_NAME);
525 GET_ATOM(_NET_WM_ICON_NAME);
526 GET_ATOM(_NET_WM_ICON);
527 GET_ATOM(_NET_WM_PING);
528 GET_ATOM(_NET_ACTIVE_WINDOW);
529 GET_ATOM(UTF8_STRING);
530 GET_ATOM(PRIMARY);
531 GET_ATOM(XdndEnter);
532 GET_ATOM(XdndPosition);
533 GET_ATOM(XdndStatus);
534 GET_ATOM(XdndTypeList);
535 GET_ATOM(XdndActionCopy);
536 GET_ATOM(XdndDrop);
537 GET_ATOM(XdndFinished);
538 GET_ATOM(XdndSelection);
539
540 /* Detect the window manager */
541 X11_CheckWindowManager(_this);
542
543 if (X11_InitModes(_this) < 0) {
544 return -1;
545 }
546
547 X11_InitXinput2(_this);
548
549 if (X11_InitKeyboard(_this) != 0) {
550 return -1;
551 }
552 X11_InitMouse(_this);
553
554 X11_InitTouch(_this);
555
556 #if SDL_USE_LIBDBUS
557 X11_InitDBus(_this);
558 #endif
559
560 return 0;
561 }
562
563 void
564 X11_VideoQuit(_THIS)
565 {
566 SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
567
568 SDL_free(data->classname);
569 #ifdef X_HAVE_UTF8_STRING
570 if (data->im) {
571 XCloseIM(data->im);
572 }
573 #endif
574
575 X11_QuitModes(_this);
576 X11_QuitKeyboard(_this);
577 X11_QuitMouse(_this);
578 X11_QuitTouch(_this);
579
580 #if SDL_USE_LIBDBUS
581 X11_QuitDBus(_this);
582 #endif
583 }
584
585 SDL_bool
586 X11_UseDirectColorVisuals(void)
587 {
588 return SDL_getenv("SDL_VIDEO_X11_NODIRECTCOLOR") ? SDL_FALSE : SDL_TRUE;
589 }
590
591 #endif /* SDL_VIDEO_DRIVER_X11 */
592
593 /* vim: set ts=4 sw=4 expandtab: */
SDL_VideoDevice::SetWindowMaximumSize
void(* SetWindowMaximumSize)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:190
SDL_VideoDevice::GetDisplayModes
void(* GetDisplayModes)(_THIS, SDL_VideoDisplay *display)
Definition: SDL_sysvideo.h:169
X11_PumpEvents
void X11_PumpEvents(_THIS)
SDL_VideoDevice::MinimizeWindow
void(* MinimizeWindow)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:195
XCloseDisplay
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer retur XCloseDisplay)
Definition: SDL_x11sym.h:34
SDL_VideoDevice::UpdateWindowFramebuffer
int(* UpdateWindowFramebuffer)(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects)
Definition: SDL_sysvideo.h:204
SDL_VideoData::display
Display * display
Definition: SDL_x11video.h:75
SDL_VideoDevice::GetWindowWMInfo
SDL_bool(* GetWindowWMInfo)(_THIS, SDL_Window *window, struct SDL_SysWMinfo *info)
Definition: SDL_sysvideo.h:215
SDL_VideoData::_NET_WM_STATE_FULLSCREEN
Atom _NET_WM_STATE_FULLSCREEN
Definition: SDL_x11video.h:95
X11_ResizeWindowShape
int X11_ResizeWindowShape(SDL_Window *window)
SDL_VideoDevice::RaiseWindow
void(* RaiseWindow)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:193
SDL_VideoData::XdndEnter
Atom XdndEnter
Definition: SDL_x11video.h:105
SDL_VideoData::pid
pid_t pid
Definition: SDL_x11video.h:77
SDL_VideoData::_NET_WM_ALLOWED_ACTIONS
Atom _NET_WM_ALLOWED_ACTIONS
Definition: SDL_x11video.h:96
X11_SetWindowTitle
void X11_SetWindowTitle(_THIS, SDL_Window *window)
X11_CreateWindowFramebuffer
int X11_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch)
SDL_VideoDevice::SetClipboardText
int(* SetClipboardText)(_THIS, const char *text)
Definition: SDL_sysvideo.h:254
void
GLvoid **typedef void(GLAPIENTRY *PFNGLGETVERTEXATTRIBDVPROC)(GLuint
Definition: glew.h:1824
SDL_calloc
DECLSPEC void *SDLCALL SDL_calloc(size_t nmemb, size_t size)
XOpenDisplay
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 int return Display Window Cursor return Display Window return Display Drawable GC int int unsigned int unsigned int return Display Drawable GC int int _Xconst char int return Display Drawable GC int int unsigned int unsigned int return Display return Display Cursor return Display GC return XModifierKeymap return char Display Window int return Display return Display Atom return Display Window XWindowAttributes return Display Window return Display XEvent Bool(*) XPointer return Display Window Bool unsigned int int int Window Cursor Time return Display Window int return KeySym return Display _Xconst char Bool return Display _Xconst char return XKeyEvent char int KeySym XComposeStatus return Display int int int XVisualInfo return Display Window int int retur XOpenDisplay)
Definition: SDL_x11sym.h:92
NULL
#define NULL
Definition: ftobjs.h:61
SDL_snprintf
DECLSPEC int SDLCALL SDL_snprintf(char *text, size_t maxlen, const char *fmt,...)
Definition: SDL_string.c:1277
X11_SetDisplayMode
int X11_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode)
X11_InitXinput2
void X11_InitXinput2(_THIS)
SDL_VideoDevice::HideWindow
void(* HideWindow)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:192
SDL_VideoData::_NET_WM_STATE_MAXIMIZED_VERT
Atom _NET_WM_STATE_MAXIMIZED_VERT
Definition: SDL_x11video.h:93
SDL_VideoDevice::GL_MakeCurrent
int(* GL_MakeCurrent)(_THIS, SDL_Window *window, SDL_GLContext context)
Definition: SDL_sysvideo.h:226
addr
GLenum GLvoid * addr
Definition: glew.h:10667
X11_GetClipboardText
char * X11_GetClipboardText(_THIS)
X11_QuitKeyboard
void X11_QuitKeyboard(_THIS)
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:116
SDL_VideoDevice::GetDisplayBounds
int(* GetDisplayBounds)(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect)
Definition: SDL_sysvideo.h:164
X11_SetWindowShape
int X11_SetWindowShape(SDL_WindowShaper *shaper, SDL_Surface *shape, SDL_WindowShapeMode *shapeMode)
SDL_TRUE
Definition: SDL_stdinc.h:119
e
return Display return Display Bool Bool int int e
Definition: SDL_x11sym.h:30
X11_UseDirectColorVisuals
SDL_bool X11_UseDirectColorVisuals(void)
SDL_strrchr
DECLSPEC char *SDLCALL SDL_strrchr(const char *str, int c)
Definition: SDL_string.c:593
SDL_VideoDevice::driverdata
void * driverdata
Definition: SDL_sysvideo.h:314
SDL_free
DECLSPEC void SDLCALL SDL_free(void *mem)
SDL_VideoDevice::SetWindowGrab
void(* SetWindowGrab)(_THIS, SDL_Window *window, SDL_bool grabbed)
Definition: SDL_sysvideo.h:201
SDL_DisplayMode
The structure that defines a display mode.
Definition: SDL_video.h:53
SDL_VideoData::WM_PROTOCOLS
Atom WM_PROTOCOLS
Definition: SDL_x11video.h:88
SDL_VideoData::windowlist
SDL_WindowData ** windowlist
Definition: SDL_x11video.h:81
SDL_VideoDevice::SetWindowIcon
void(* SetWindowIcon)(_THIS, SDL_Window *window, SDL_Surface *icon)
Definition: SDL_sysvideo.h:186
SDL_x11opengles.h
X11_UpdateWindowFramebuffer
int X11_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects)
SDL_memcmp
DECLSPEC int SDLCALL SDL_memcmp(const void *s1, const void *s2, size_t len)
Definition: SDL_string.c:370
X11_SetWindowFullscreen
void X11_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen)
X11_MinimizeWindow
void X11_MinimizeWindow(_THIS, SDL_Window *window)
d
return Display return Display Bool Bool int d
Definition: SDL_x11sym.h:30
X11_InitMouse
void X11_InitMouse(_THIS)
display
char * display
Definition: visualinfo.c:85
SDL_VideoDevice::CreateWindowFrom
int(* CreateWindowFrom)(_THIS, SDL_Window *window, const void *data)
Definition: SDL_sysvideo.h:184
if
if(!yyg->yy_init)
Definition: glslang_lex.cpp:1037
SDL_FALSE
Definition: SDL_stdinc.h:118
SDL_X11_HAVE_UTF8
#define SDL_X11_HAVE_UTF8
Definition: SDL_config_linux.h:369
X11_DestroyWindowFramebuffer
void X11_DestroyWindowFramebuffer(_THIS, SDL_Window *window)
SDL_VideoData::XdndPosition
Atom XdndPosition
Definition: SDL_x11video.h:106
SDL_VideoData::_NET_WM_ICON
Atom _NET_WM_ICON
Definition: SDL_x11video.h:100
SDL_VideoData::im
XIM im
Definition: SDL_x11video.h:78
SDL_config.h
SDL_VideoDevice::free
void(* free)(_THIS)
Definition: SDL_sysvideo.h:327
XSynchronize
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 int return Display Window Cursor return Display Window return Display Drawable GC int int unsigned int unsigned int return Display Drawable GC int int _Xconst char int return Display Drawable GC int int unsigned int unsigned int return Display return Display Cursor return Display GC return XModifierKeymap return char Display Window int return Display return Display Atom return Display Window XWindowAttributes return Display Window return Display XEvent Bool(*) XPointer return Display Window Bool unsigned int int int Window Cursor Time return Display Window int return KeySym return Display _Xconst char Bool return Display _Xconst char return XKeyEvent char int KeySym XComposeStatus return Display int int int XVisualInfo return Display Window int int return _Xconst char return Display XEvent return Display Drawable GC XImage int int int int unsigned int unsigned int return Display Window Window Window int int int int unsigned int return Display Window Window int int return Display Window unsigned int unsigned int return Display Window Bool long XEvent return Display GC unsigned long return Display Window int Time return Display Window Window return Display Window unsigned long return Display Window XSizeHints Display Colormap XColor int return char int XTextProperty return XFontStruct _Xconst char int int int int XCharStruct return Display Window return Display Time return Display Colormap return Display Window Window int int unsigned int unsigned int int int return Display Window int return XExtensionInfo Display char XExtensionHooks int XPointer return XExtensionInfo XExtensionInfo Display return Display return Display unsigned long Display GC Display char long Display xReply int Bool retur XSynchronize)
Definition: SDL_x11sym.h:152
X11_MaximizeWindow
void X11_MaximizeWindow(_THIS, SDL_Window *window)
X11_GetDisplayBounds
int X11_GetDisplayBounds(_THIS, SDL_VideoDisplay *sdl_display, SDL_Rect *rect)
SDL_VideoData::_NET_WM_STATE
Atom _NET_WM_STATE
Definition: SDL_x11video.h:90
SDL_VideoDevice::GL_SetSwapInterval
int(* GL_SetSwapInterval)(_THIS, int interval)
Definition: SDL_sysvideo.h:228
_this
static SDL_VideoDevice * _this
Definition: SDL_video.c:92
SDL_VideoDevice::DestroyWindowFramebuffer
void(* DestroyWindowFramebuffer)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:205
SDL_VideoDevice::CreateWindow
int(* CreateWindow)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:183
SDL_x11shape.h
SDL_VideoDevice::GL_UnloadLibrary
void(* GL_UnloadLibrary)(_THIS)
Definition: SDL_sysvideo.h:224
SDL_x11touch.h
SDL_VideoData::classname
char * classname
Definition: SDL_x11video.h:76
SDL_VideoData::_NET_WM_STATE_HIDDEN
Atom _NET_WM_STATE_HIDDEN
Definition: SDL_x11video.h:91
SDL_VideoData::_NET_ACTIVE_WINDOW
Atom _NET_ACTIVE_WINDOW
Definition: SDL_x11video.h:102
SDL_video.h
SDL_VideoData::WM_DELETE_WINDOW
Atom WM_DELETE_WINDOW
Definition: SDL_x11video.h:89
X11_HasClipboardText
SDL_bool X11_HasClipboardText(_THIS)
SDL_VideoData::XdndActionCopy
Atom XdndActionCopy
Definition: SDL_x11video.h:109
SDL_VideoData::PRIMARY
Atom PRIMARY
Definition: SDL_x11video.h:104
XInternAtom
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 int return Display Window Cursor return Display Window return Display Drawable GC int int unsigned int unsigned int return Display Drawable GC int int _Xconst char int return Display Drawable GC int int unsigned int unsigned int return Display return Display Cursor return Display GC return XModifierKeymap return char Display Window int return Display return Display Atom return Display Window XWindowAttributes return Display Window return Display XEvent Bool(*) XPointer return Display Window Bool unsigned int int int Window Cursor Time return Display Window int return KeySym retur XInternAtom)
Definition: SDL_x11sym.h:82
X11_CreateWindow
int X11_CreateWindow(_THIS, SDL_Window *window)
X11_GetDisplayModes
void X11_GetDisplayModes(_THIS, SDL_VideoDisplay *display)
X11_SuspendScreenSaver
void X11_SuspendScreenSaver(_THIS)
int
int
Definition: SDL_systhread.c:37
data
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl2ext.h:848
SDL_ShapeDriver::SetWindowShape
int(* SetWindowShape)(SDL_WindowShaper *shaper, SDL_Surface *shape, SDL_WindowShapeMode *shape_mode)
Definition: SDL_sysvideo.h:59
SDL_VideoDevice::VideoInit
int(* VideoInit)(_THIS)
Definition: SDL_sysvideo.h:148
SDL_VideoData::_NET_WM_ICON_NAME
Atom _NET_WM_ICON_NAME
Definition: SDL_x11video.h:99
X11_SetWindowGammaRamp
int X11_SetWindowGammaRamp(_THIS, SDL_Window *window, const Uint16 *ramp)
X11_InitModes
int X11_InitModes(_THIS)
_THIS
#define _THIS
Definition: SDL_alsa_audio.h:31
SDL_strdup
DECLSPEC char *SDLCALL SDL_strdup(const char *str)
Definition: SDL_string.c:511
SDL_mouse.h
VideoBootStrap
Definition: SDL_sysvideo.h:330
SDL_LoadObject
DECLSPEC void *SDLCALL SDL_LoadObject(const char *sofile)
X11_CreateWindowFrom
int X11_CreateWindowFrom(_THIS, SDL_Window *window, const void *data)
SDL_VideoDevice::num_displays
int num_displays
Definition: SDL_sysvideo.h:264
SDL_VideoDevice::SetWindowGammaRamp
int(* SetWindowGammaRamp)(_THIS, SDL_Window *window, const Uint16 *ramp)
Definition: SDL_sysvideo.h:199
SDL_X11_LoadSymbols
int SDL_X11_LoadSymbols(void)
SDL_Delay
DECLSPEC void SDLCALL SDL_Delay(Uint32 ms)
Wait a specified number of milliseconds before returning.
Definition: SDL_systimer.c:70
SDL_VideoDisplay::current_mode
SDL_DisplayMode current_mode
Definition: SDL_sysvideo.h:120
X11_RestoreWindow
void X11_RestoreWindow(_THIS, SDL_Window *window)
SDL_VideoDevice::displays
SDL_VideoDisplay * displays
Definition: SDL_sysvideo.h:265
SDL_UnloadObject
DECLSPEC void SDLCALL SDL_UnloadObject(void *handle)
SDL_VideoData::_NET_WM_ACTION_FULLSCREEN
Atom _NET_WM_ACTION_FULLSCREEN
Definition: SDL_x11video.h:97
SDL_SetError
DECLSPEC int SDLCALL SDL_SetError(const char *fmt,...)
Definition: SDL_error.c:53
SDL_VideoDevice::SetWindowPosition
void(* SetWindowPosition)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:187
X11_ShowWindow
void X11_ShowWindow(_THIS, SDL_Window *window)
X11_DestroyWindow
void X11_DestroyWindow(_THIS, SDL_Window *window)
X11_QuitMouse
void X11_QuitMouse(_THIS)
SDL_VideoDevice::PumpEvents
void(* PumpEvents)(_THIS)
Definition: SDL_sysvideo.h:237
SDL_x11framebuffer.h
X11_CreateShaper
SDL_WindowShaper * X11_CreateShaper(SDL_Window *window)
SDL_VideoDisplay
Definition: SDL_sysvideo.h:113
X11_SetClipboardText
int X11_SetClipboardText(_THIS, const char *text)
SDL_VideoDevice::SetWindowMinimumSize
void(* SetWindowMinimumSize)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:189
SDL_x11xinput2.h
SDL_VideoDevice::SuspendScreenSaver
void(* SuspendScreenSaver)(_THIS)
Definition: SDL_sysvideo.h:240
SDL_ShapeDriver::CreateShaper
SDL_WindowShaper *(* CreateShaper)(SDL_Window *window)
Definition: SDL_sysvideo.h:58
SDL_VideoDevice::GL_GetSwapInterval
int(* GL_GetSwapInterval)(_THIS)
Definition: SDL_sysvideo.h:229
X11_SetWindowMinimumSize
void X11_SetWindowMinimumSize(_THIS, SDL_Window *window)
sizeof
sizeof(FT_AutofitterRec)
SDL_OutOfMemory
#define SDL_OutOfMemory()
Definition: SDL_error.h:52
SDL_VideoDisplay::desktop_mode
SDL_DisplayMode desktop_mode
Definition: SDL_sysvideo.h:119
SDL_arraysize
#define SDL_arraysize(array)
Definition: SDL_stdinc.h:83
SDL_VideoDevice::GL_DeleteContext
void(* GL_DeleteContext)(_THIS, SDL_GLContext context)
Definition: SDL_sysvideo.h:231
SDL_VideoDevice::MaximizeWindow
void(* MaximizeWindow)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:194
SDL_VideoData::_NET_WM_STATE_MAXIMIZED_HORZ
Atom _NET_WM_STATE_MAXIMIZED_HORZ
Definition: SDL_x11video.h:94
SDL_VideoDevice::DestroyWindow
void(* DestroyWindow)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:202
SDL_loadso.h
SDL_VideoData::XdndTypeList
Atom XdndTypeList
Definition: SDL_x11video.h:108
SDL_VideoDevice::SetWindowSize
void(* SetWindowSize)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:188
SDL_VideoDevice::SetDisplayMode
int(* SetDisplayMode)(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode)
Definition: SDL_sysvideo.h:177
X11_InitKeyboard
int X11_InitKeyboard(_THIS)
X11_QuitModes
void X11_QuitModes(_THIS)
SDL_VideoData::XdndStatus
Atom XdndStatus
Definition: SDL_x11video.h:107
SDL_VideoDevice::GetClipboardText
char *(* GetClipboardText)(_THIS)
Definition: SDL_sysvideo.h:255
SDL_VideoData::XdndFinished
Atom XdndFinished
Definition: SDL_x11video.h:111
SDL_VideoData::_NET_WM_STATE_FOCUSED
Atom _NET_WM_STATE_FOCUSED
Definition: SDL_x11video.h:92
SDL_VideoDevice::GL_CreateContext
SDL_GLContext(* GL_CreateContext)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:225
X11_RaiseWindow
void X11_RaiseWindow(_THIS, SDL_Window *window)
X11_InitTouch
void X11_InitTouch(_THIS)
SDL_VideoDevice::GL_LoadLibrary
int(* GL_LoadLibrary)(_THIS, const char *path)
Definition: SDL_sysvideo.h:222
SDL_VideoData::net_wm
SDL_bool net_wm
Definition: SDL_x11video.h:85
X11_SetWindowIcon
void X11_SetWindowIcon(_THIS, SDL_Window *window, SDL_Surface *icon)
SDL_VideoDevice::GL_SwapWindow
void(* GL_SwapWindow)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:230
X11_GetWindowTitle
char * X11_GetWindowTitle(_THIS, Window xwindow)
SDL_VideoData::XdndDrop
Atom XdndDrop
Definition: SDL_x11video.h:110
SDL_VideoDevice
Definition: SDL_sysvideo.h:135
SDL_x11video.h
SDL_VideoDevice::VideoQuit
void(* VideoQuit)(_THIS)
Definition: SDL_sysvideo.h:154
SDL_VideoDevice::ShowWindow
void(* ShowWindow)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:191
SDL_VideoData
Definition: SDL_androidvideo.h:35
SDL_GetVideoDevice
SDL_VideoDevice * SDL_GetVideoDevice(void)
Definition: SDL_video.c:548
SDL_VideoDevice::shape_driver
SDL_ShapeDriver shape_driver
Definition: SDL_sysvideo.h:212
SDL_VideoDevice::CreateWindowFramebuffer
int(* CreateWindowFramebuffer)(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch)
Definition: SDL_sysvideo.h:203
SDL_VideoDevice::HasClipboardText
SDL_bool(* HasClipboardText)(_THIS)
Definition: SDL_sysvideo.h:256
SDL_getenv
DECLSPEC char *SDLCALL SDL_getenv(const char *name)
Definition: SDL_getenv.c:179
SDL_VideoData::XdndSelection
Atom XdndSelection
Definition: SDL_x11video.h:112
SDL_X11_UnloadSymbols
void SDL_X11_UnloadSymbols(void)
SDL_VideoData::UTF8_STRING
Atom UTF8_STRING
Definition: SDL_x11video.h:103
SDL_VideoDevice::SetWindowTitle
void(* SetWindowTitle)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:185
SDL_VideoDevice::SetWindowBordered
void(* SetWindowBordered)(_THIS, SDL_Window *window, SDL_bool bordered)
Definition: SDL_sysvideo.h:197
X11_SetWindowSize
void X11_SetWindowSize(_THIS, SDL_Window *window)
i
int i
Definition: pngrutil.c:1377
SDL_VideoData::_NET_WM_NAME
Atom _NET_WM_NAME
Definition: SDL_x11video.h:98
SDL_VideoDevice::SetWindowFullscreen
void(* SetWindowFullscreen)(_THIS, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen)
Definition: SDL_sysvideo.h:198
SDL_LoadFunction
DECLSPEC void *SDLCALL SDL_LoadFunction(void *handle, const char *name)
SDL_VideoData::_NET_WM_PING
Atom _NET_WM_PING
Definition: SDL_x11video.h:101
X11_SetWindowBordered
void X11_SetWindowBordered(_THIS, SDL_Window *window, SDL_bool bordered)
X11_HideWindow
void X11_HideWindow(_THIS, SDL_Window *window)
SDL_VideoDevice::GL_GetProcAddress
void *(* GL_GetProcAddress)(_THIS, const char *proc)
Definition: SDL_sysvideo.h:223
X11_SetWindowGrab
void X11_SetWindowGrab(_THIS, SDL_Window *window, SDL_bool grabbed)
SDL_ShapeDriver::ResizeWindowShape
int(* ResizeWindowShape)(SDL_Window *window)
Definition: SDL_sysvideo.h:60
X11_GetWindowWMInfo
SDL_bool X11_GetWindowWMInfo(_THIS, SDL_Window *window, struct SDL_SysWMinfo *info)
X11_SetWindowMaximumSize
void X11_SetWindowMaximumSize(_THIS, SDL_Window *window)
SDL_VideoDevice::RestoreWindow
void(* RestoreWindow)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:196
X11_QuitTouch
void X11_QuitTouch(_THIS)
X11_SetWindowPosition
void X11_SetWindowPosition(_THIS, SDL_Window *window)