Atlas - SDL_x11video.h

Home / ext / SDL / src / video / x11 Lines: 1 | Size: 5802 bytes [Download] [Show on GitHub] [Search similar files] [Raw] [Raw (proxy)]
[FILE BEGIN]
1/* 2 Simple DirectMedia Layer 3 Copyright (C) 1997-2025 Sam Lantinga <[email protected]> 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_sysvideo.h" 27#include "../../events/SDL_keymap_c.h" 28 29#include "../../core/linux/SDL_dbus.h" 30#include "../../core/linux/SDL_ime.h" 31 32#include "SDL_x11dyn.h" 33 34#include "SDL_x11clipboard.h" 35#include "SDL_x11events.h" 36#include "SDL_x11keyboard.h" 37#include "SDL_x11modes.h" 38#include "SDL_x11mouse.h" 39#include "SDL_x11opengl.h" 40#include "SDL_x11settings.h" 41#include "SDL_x11window.h" 42#include "SDL_x11vulkan.h" 43 44// Private display data 45 46struct SDL_VideoData 47{ 48 Display *display; 49 Display *request_display; 50 pid_t pid; 51 XIM im; 52 Uint64 screensaver_activity; 53 int numwindows; 54 SDL_WindowData **windowlist; 55 int windowlistlength; 56 XID window_group; 57 Window clipboard_window; 58 SDLX11_ClipboardData clipboard; 59 SDLX11_ClipboardData primary_selection; 60#ifdef SDL_VIDEO_DRIVER_X11_XFIXES 61 SDL_Window *active_cursor_confined_window; 62#endif // SDL_VIDEO_DRIVER_X11_XFIXES 63 Window xsettings_window; 64 SDLX11_SettingsData xsettings_data; 65 66 // This is true for ICCCM2.0-compliant window managers 67 bool net_wm; 68 69 // Useful atoms 70 struct { 71 Atom WM_PROTOCOLS; 72 Atom WM_DELETE_WINDOW; 73 Atom WM_TAKE_FOCUS; 74 Atom WM_NAME; 75 Atom WM_TRANSIENT_FOR; 76 Atom _NET_WM_STATE; 77 Atom _NET_WM_STATE_HIDDEN; 78 Atom _NET_WM_STATE_FOCUSED; 79 Atom _NET_WM_STATE_MAXIMIZED_VERT; 80 Atom _NET_WM_STATE_MAXIMIZED_HORZ; 81 Atom _NET_WM_STATE_FULLSCREEN; 82 Atom _NET_WM_STATE_ABOVE; 83 Atom _NET_WM_STATE_SKIP_TASKBAR; 84 Atom _NET_WM_STATE_SKIP_PAGER; 85 Atom _NET_WM_STATE_MODAL; 86 Atom _NET_WM_MOVERESIZE; 87 Atom _NET_WM_ALLOWED_ACTIONS; 88 Atom _NET_WM_ACTION_FULLSCREEN; 89 Atom _NET_WM_NAME; 90 Atom _NET_WM_ICON_NAME; 91 Atom _NET_WM_ICON; 92 Atom _NET_WM_PING; 93 Atom _NET_WM_SYNC_REQUEST; 94 Atom _NET_WM_SYNC_REQUEST_COUNTER; 95 Atom _NET_WM_WINDOW_OPACITY; 96 Atom _NET_WM_USER_TIME; 97 Atom _NET_ACTIVE_WINDOW; 98 Atom _NET_FRAME_EXTENTS; 99 Atom _SDL_WAKEUP; 100 Atom UTF8_STRING; 101 Atom PRIMARY; 102 Atom CLIPBOARD; 103 Atom INCR; 104 Atom SDL_SELECTION; 105 Atom TARGETS; 106 Atom SDL_FORMATS; 107 Atom RESOURCE_MANAGER; 108 Atom XdndAware; 109 Atom XdndEnter; 110 Atom XdndLeave; 111 Atom XdndPosition; 112 Atom XdndStatus; 113 Atom XdndTypeList; 114 Atom XdndActionCopy; 115 Atom XdndDrop; 116 Atom XdndFinished; 117 Atom XdndSelection; 118 Atom XKLAVIER_STATE; 119 120 // Pen atoms (these have names that don't map well to C symbols) 121 Atom pen_atom_device_product_id; 122 Atom pen_atom_abs_pressure; 123 Atom pen_atom_abs_tilt_x; 124 Atom pen_atom_abs_tilt_y; 125 Atom pen_atom_wacom_serial_ids; 126 Atom pen_atom_wacom_tool_type; 127 } atoms; 128 129 bool selection_waiting; 130 bool selection_incr_waiting; 131 132 bool broken_pointer_grab; // true if XGrabPointer seems unreliable. 133 134 Uint64 last_mode_change_deadline; 135 136 bool global_mouse_changed; 137 SDL_Point global_mouse_position; 138 Uint32 global_mouse_buttons; 139 140 SDL_XInput2DeviceInfo *mouse_device_info; 141 int xinput_master_pointer_device; 142 bool xinput_hierarchy_changed; 143 144 int xrandr_event_base; 145 struct 146 { 147 bool xkb_enabled; 148 SDL_Scancode key_layout[256]; 149 150 union 151 { 152#ifdef SDL_VIDEO_DRIVER_X11_HAS_XKBLIB 153 struct 154 { 155 XkbDescPtr desc_ptr; 156 SDL_Keymap *keymaps[XkbNumKbdGroups]; 157 unsigned long last_map_serial; 158 int event; 159 Uint32 current_group; 160 } xkb; // Modern XKB keyboard handling 161#endif 162 struct 163 { 164 KeySym *keysym_map; 165 int keysyms_per_key; 166 int min_keycode; 167 int max_keycode; 168 } core; // Legacy core keyboard handling 169 }; 170 Uint32 pressed_modifiers; 171 Uint32 locked_modifiers; 172 SDL_Keymod sdl_pressed_modifiers; 173 SDL_Keymod sdl_physically_pressed_modifiers; 174 SDL_Keymod sdl_locked_modifiers; 175 176 // Virtual modifiers looked up by name. 177 Uint32 alt_mask; 178 Uint32 gui_mask; 179 Uint32 level3_mask; 180 Uint32 level5_mask; 181 Uint32 numlock_mask; 182 Uint32 scrolllock_mask; 183 } keyboard; 184 185#ifdef SDL_VIDEO_VULKAN 186 // Vulkan variables only valid if _this->vulkan_config.loader_handle is not NULL 187 SDL_SharedObject *vulkan_xlib_xcb_library; 188 PFN_XGetXCBConnection vulkan_XGetXCBConnection; 189#endif 190 191 // Used to interact with the on-screen keyboard 192 bool is_steam_deck; 193 194 bool is_xwayland; 195}; 196 197extern bool X11_UseDirectColorVisuals(void); 198 199#endif // SDL_x11video_h_ 200
[FILE END]
(C) 2025 0x4248 (C) 2025 4248 Media and 4248 Systems, All part of 0x4248 See LICENCE files for more information. Not all files are by 0x4248 always check Licencing.