Atlas - SDL_x11video.h

Home / ext / SDL / src / video / x11 Lines: 1 | Size: 5825 bytes [Download] [Show on GitHub] [Search similar files] [Raw] [Raw (proxy)]
[FILE BEGIN]
1/* 2 Simple DirectMedia Layer 3 Copyright (C) 1997-2026 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 WM_STATE; 77 Atom _NET_WM_STATE; 78 Atom _NET_WM_STATE_HIDDEN; 79 Atom _NET_WM_STATE_FOCUSED; 80 Atom _NET_WM_STATE_MAXIMIZED_VERT; 81 Atom _NET_WM_STATE_MAXIMIZED_HORZ; 82 Atom _NET_WM_STATE_FULLSCREEN; 83 Atom _NET_WM_STATE_ABOVE; 84 Atom _NET_WM_STATE_SKIP_TASKBAR; 85 Atom _NET_WM_STATE_SKIP_PAGER; 86 Atom _NET_WM_STATE_MODAL; 87 Atom _NET_WM_MOVERESIZE; 88 Atom _NET_WM_ALLOWED_ACTIONS; 89 Atom _NET_WM_ACTION_FULLSCREEN; 90 Atom _NET_WM_NAME; 91 Atom _NET_WM_ICON_NAME; 92 Atom _NET_WM_ICON; 93 Atom _NET_WM_PING; 94 Atom _NET_WM_SYNC_REQUEST; 95 Atom _NET_WM_SYNC_REQUEST_COUNTER; 96 Atom _NET_WM_WINDOW_OPACITY; 97 Atom _NET_WM_USER_TIME; 98 Atom _NET_ACTIVE_WINDOW; 99 Atom _NET_FRAME_EXTENTS; 100 Atom _SDL_WAKEUP; 101 Atom UTF8_STRING; 102 Atom PRIMARY; 103 Atom CLIPBOARD; 104 Atom INCR; 105 Atom SDL_SELECTION; 106 Atom TARGETS; 107 Atom SDL_FORMATS; 108 Atom RESOURCE_MANAGER; 109 Atom XdndAware; 110 Atom XdndEnter; 111 Atom XdndLeave; 112 Atom XdndPosition; 113 Atom XdndStatus; 114 Atom XdndTypeList; 115 Atom XdndActionCopy; 116 Atom XdndDrop; 117 Atom XdndFinished; 118 Atom XdndSelection; 119 Atom XKLAVIER_STATE; 120 121 // Pen atoms (these have names that don't map well to C symbols) 122 Atom pen_atom_device_product_id; 123 Atom pen_atom_abs_pressure; 124 Atom pen_atom_abs_tilt_x; 125 Atom pen_atom_abs_tilt_y; 126 Atom pen_atom_wacom_serial_ids; 127 Atom pen_atom_wacom_tool_type; 128 } atoms; 129 130 bool selection_waiting; 131 bool selection_incr_waiting; 132 133 bool broken_pointer_grab; // true if XGrabPointer seems unreliable. 134 135 Uint64 last_mode_change_deadline; 136 137 bool global_mouse_changed; 138 SDL_Point global_mouse_position; 139 Uint32 global_mouse_buttons; 140 141 SDL_XInput2DeviceInfo *mouse_device_info; 142 int xinput_master_pointer_device; 143 bool xinput_hierarchy_changed; 144 145 int xrandr_event_base; 146 struct 147 { 148 bool xkb_enabled; 149 SDL_Scancode key_layout[256]; 150 151 union 152 { 153#ifdef SDL_VIDEO_DRIVER_X11_HAS_XKBLIB 154 struct 155 { 156 XkbDescPtr desc_ptr; 157 SDL_Keymap *keymaps[XkbNumKbdGroups]; 158 unsigned long last_map_serial; 159 int event; 160 Uint32 current_group; 161 } xkb; // Modern XKB keyboard handling 162#endif 163 struct 164 { 165 KeySym *keysym_map; 166 int keysyms_per_key; 167 int min_keycode; 168 int max_keycode; 169 } core; // Legacy core keyboard handling 170 }; 171 Uint32 pressed_modifiers; 172 Uint32 locked_modifiers; 173 SDL_Keymod sdl_pressed_modifiers; 174 SDL_Keymod sdl_physically_pressed_modifiers; 175 SDL_Keymod sdl_locked_modifiers; 176 177 // Virtual modifiers looked up by name. 178 Uint32 alt_mask; 179 Uint32 gui_mask; 180 Uint32 level3_mask; 181 Uint32 level5_mask; 182 Uint32 numlock_mask; 183 Uint32 scrolllock_mask; 184 } keyboard; 185 186#ifdef SDL_VIDEO_VULKAN 187 // Vulkan variables only valid if _this->vulkan_config.loader_handle is not NULL 188 SDL_SharedObject *vulkan_xlib_xcb_library; 189 PFN_XGetXCBConnection vulkan_XGetXCBConnection; 190#endif 191 192 // Used to interact with the on-screen keyboard 193 bool is_steam_deck; 194 195 bool is_xwayland; 196}; 197 198extern bool X11_UseDirectColorVisuals(void); 199 200#endif // SDL_x11video_h_ 201
[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.