SDL  2.0
SDL_x11video.h
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 #ifndef SDL_x11video_h_
24 #define SDL_x11video_h_
25 
26 #include "SDL_keycode.h"
27 
28 #include "../SDL_sysvideo.h"
29 
30 #include <X11/Xlib.h>
31 #include <X11/Xutil.h>
32 #include <X11/Xatom.h>
33 
34 #if SDL_VIDEO_DRIVER_X11_XCURSOR
35 #include <X11/Xcursor/Xcursor.h>
36 #endif
37 #if SDL_VIDEO_DRIVER_X11_XDBE
38 #include <X11/extensions/Xdbe.h>
39 #endif
40 #if SDL_VIDEO_DRIVER_X11_XINERAMA
41 #include <X11/extensions/Xinerama.h>
42 #endif
43 #if SDL_VIDEO_DRIVER_X11_XINPUT2
44 #include <X11/extensions/XInput2.h>
45 #endif
46 #if SDL_VIDEO_DRIVER_X11_XRANDR
47 #include <X11/extensions/Xrandr.h>
48 #endif
49 #if SDL_VIDEO_DRIVER_X11_XSCRNSAVER
50 #include <X11/extensions/scrnsaver.h>
51 #endif
52 #if SDL_VIDEO_DRIVER_X11_XSHAPE
53 #include <X11/extensions/shape.h>
54 #endif
55 #if SDL_VIDEO_DRIVER_X11_XVIDMODE
56 #include <X11/extensions/xf86vmode.h>
57 #endif
58 
59 #include "../../core/linux/SDL_dbus.h"
60 #include "../../core/linux/SDL_ime.h"
61 
62 #include "SDL_x11dyn.h"
63 
64 #include "SDL_x11clipboard.h"
65 #include "SDL_x11events.h"
66 #include "SDL_x11keyboard.h"
67 #include "SDL_x11modes.h"
68 #include "SDL_x11mouse.h"
69 #include "SDL_x11opengl.h"
70 #include "SDL_x11window.h"
71 #include "SDL_x11vulkan.h"
72 
73 /* Private display data */
74 
75 typedef struct SDL_VideoData
76 {
77  Display *display;
78  char *classname;
79  pid_t pid;
80  XIM im;
87 
88  /* This is true for ICCCM2.0-compliant window managers */
90 
91  /* Useful atoms */
115  Atom PRIMARY;
116  Atom XdndEnter;
121  Atom XdndDrop;
125 
128 
129  SDL_bool broken_pointer_grab; /* true if XGrabPointer seems unreliable. */
130 
132 
136 
137 #if SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM
138  XkbDescPtr xkb;
139 #endif
140 
141  KeyCode filter_code;
143 
144 #if SDL_VIDEO_VULKAN
145  /* Vulkan variables only valid if _this->vulkan_config.loader_handle is not NULL */
146  void *vulkan_xlib_xcb_library;
147  PFN_XGetXCBConnection vulkan_XGetXCBConnection;
148 #endif
149 
150 } SDL_VideoData;
151 
153 
154 #endif /* SDL_x11video_h_ */
155 
156 /* vi: set ts=4 sw=4 expandtab: */
SDL_VideoData::net_wm
SDL_bool net_wm
Definition: SDL_x11video.h:89
X11_UseDirectColorVisuals
SDL_bool X11_UseDirectColorVisuals(void)
SDL_VideoData::selection_waiting
SDL_bool selection_waiting
Definition: SDL_x11video.h:127
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_VideoData::broken_pointer_grab
SDL_bool broken_pointer_grab
Definition: SDL_x11video.h:129
SDL_x11mouse.h
SDL_VideoData::XdndEnter
Atom XdndEnter
Definition: SDL_x11video.h:116
SDL_x11modes.h
SDL_x11keyboard.h
SDL_VideoData::window_group
XID window_group
Definition: SDL_x11video.h:85
SDL_x11opengl.h
SDL_VideoData::classname
char * classname
Definition: SDL_waylandvideo.h:81
SDL_WindowData
Definition: SDL_androidwindow.h:39
SDL_keycode.h
SDL_VideoData::pid
pid_t pid
Definition: SDL_x11video.h:79
SDL_Scancode
SDL_Scancode
The SDL keyboard scancode representation.
Definition: SDL_scancode.h:44
SDL_VideoData::WM_TAKE_FOCUS
Atom WM_TAKE_FOCUS
Definition: SDL_x11video.h:94
SDL_VideoData::windowlistlength
int windowlistlength
Definition: SDL_x11video.h:84
SDL_VideoData::last_mode_change_deadline
Uint32 last_mode_change_deadline
Definition: SDL_x11video.h:131
Uint32
uint32_t Uint32
Definition: SDL_stdinc.h:203
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_VideoData::global_mouse_changed
SDL_bool global_mouse_changed
Definition: SDL_x11video.h:133
SDL_VideoData::filter_time
Time filter_time
Definition: SDL_x11video.h:142
SDL_VideoData::clipboard_window
Window clipboard_window
Definition: SDL_x11video.h:86
SDL_VideoData::windowlist
SDL_WindowData ** windowlist
Definition: SDL_x11video.h:83
SDL_x11window.h
SDL_VideoData::filter_code
KeyCode filter_code
Definition: SDL_x11video.h:141
SDL_VideoData::XdndStatus
Atom XdndStatus
Definition: SDL_x11video.h:118
SDL_VideoData::PRIMARY
Atom PRIMARY
Definition: SDL_x11video.h:115
SDL_x11vulkan.h
SDL_VideoData::numwindows
int numwindows
Definition: SDL_x11video.h:82
SDL_VideoData::_NET_ACTIVE_WINDOW
Atom _NET_ACTIVE_WINDOW
Definition: SDL_x11video.h:112
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
SDL_VideoData::XdndPosition
Atom XdndPosition
Definition: SDL_x11video.h:117
SDL_VideoData::XKLAVIER_STATE
Atom XKLAVIER_STATE
Definition: SDL_x11video.h:124
SDL_VideoData::im
XIM im
Definition: SDL_x11video.h:80
SDL_VideoData::_NET_WM_STATE_SKIP_TASKBAR
Atom _NET_WM_STATE_SKIP_TASKBAR
Definition: SDL_x11video.h:102
SDL_VideoData::_NET_WM_STATE_HIDDEN
Atom _NET_WM_STATE_HIDDEN
Definition: SDL_x11video.h:96
SDL_VideoData::_NET_WM_STATE_MAXIMIZED_VERT
Atom _NET_WM_STATE_MAXIMIZED_VERT
Definition: SDL_x11video.h:98
SDL_VideoData::global_mouse_position
SDL_Point global_mouse_position
Definition: SDL_x11video.h:134
SDL_x11events.h
SDL_VideoData::global_mouse_buttons
Uint32 global_mouse_buttons
Definition: SDL_x11video.h:135
SDL_VideoData::_NET_WM_ACTION_FULLSCREEN
Atom _NET_WM_ACTION_FULLSCREEN
Definition: SDL_x11video.h:105
SDL_VideoData::key_layout
void * key_layout
Definition: SDL_cocoavideo.h:104
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_VideoData::_NET_WM_NAME
Atom _NET_WM_NAME
Definition: SDL_x11video.h:106
SDL_Point
The structure that defines a point (integer)
Definition: SDL_rect.h:49
SDL_VideoData::XdndFinished
Atom XdndFinished
Definition: SDL_x11video.h:122
SDL_x11dyn.h
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
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:162
SDL_x11clipboard.h
SDL_VideoData::_NET_WM_STATE_SKIP_PAGER
Atom _NET_WM_STATE_SKIP_PAGER
Definition: SDL_x11video.h:103
SDL_VideoData::display
Display * display
Definition: SDL_x11video.h:77
SDL_VideoData::_NET_FRAME_EXTENTS
Atom _NET_FRAME_EXTENTS
Definition: SDL_x11video.h:113
SDL_VideoData::screensaver_activity
Uint32 screensaver_activity
Definition: SDL_cocoavideo.h:107
SDL_VideoData::WM_DELETE_WINDOW
Atom WM_DELETE_WINDOW
Definition: SDL_x11video.h:93
SDL_VideoData::XdndActionCopy
Atom XdndActionCopy
Definition: SDL_x11video.h:120
SDL_VideoData::_NET_WM_ICON
Atom _NET_WM_ICON
Definition: SDL_x11video.h:108
SDL_VideoData::XdndDrop
Atom XdndDrop
Definition: SDL_x11video.h:121
SDL_VideoData::_NET_WM_STATE_FULLSCREEN
Atom _NET_WM_STATE_FULLSCREEN
Definition: SDL_x11video.h:100
SDL_VideoData
Definition: SDL_androidvideo.h:37
SDL_VideoData::_NET_WM_STATE_FOCUSED
Atom _NET_WM_STATE_FOCUSED
Definition: SDL_x11video.h:97