Atlas - SDL_x11window.h
Home / ext / SDL / src / video / x11 Lines: 1 | Size: 7089 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_x11window_h_ 24#define SDL_x11window_h_ 25 26/* We need to queue the focus in/out changes because they may occur during 27 video mode changes and we can respond to them by triggering more mode 28 changes. 29*/ 30#define PENDING_FOCUS_TIME 200 31 32#ifdef SDL_VIDEO_OPENGL_EGL 33#include <EGL/egl.h> 34#endif 35 36typedef enum 37{ 38 PENDING_FOCUS_NONE, 39 PENDING_FOCUS_IN, 40 PENDING_FOCUS_OUT 41} PendingFocusEnum; 42 43struct SDL_WindowData 44{ 45 SDL_Window *window; 46 Window xwindow; 47 Visual *visual; 48 Colormap colormap; 49#ifndef NO_SHARED_MEMORY 50 // MIT shared memory extension information 51 bool use_mitshm; 52 XShmSegmentInfo shminfo; 53#endif 54 XImage *ximage; 55 GC gc; 56 XIC ic; 57 bool created; 58 int border_left; 59 int border_right; 60 int border_top; 61 int border_bottom; 62 bool xinput2_mouse_enabled; 63 bool xinput2_keyboard_enabled; 64 bool mouse_grabbed; 65 Uint64 last_focus_event_time; 66 PendingFocusEnum pending_focus; 67 Uint64 pending_focus_time; 68 bool pending_move; 69 SDL_Point pending_move_point; 70 XConfigureEvent last_xconfigure; 71 XConfigureEvent pending_xconfigure; 72 struct SDL_VideoData *videodata; 73 unsigned long user_time; 74 Atom xdnd_req; 75 Window xdnd_source; 76 bool flashing_window; 77 Uint64 flash_cancel_time; 78#ifdef SDL_VIDEO_OPENGL_EGL 79 EGLSurface egl_surface; 80#endif 81#ifdef SDL_VIDEO_DRIVER_X11_XFIXES 82 bool pointer_barrier_active; 83 PointerBarrier barrier[4]; 84 SDL_Rect barrier_rect; 85#endif // SDL_VIDEO_DRIVER_X11_XFIXES 86#ifdef SDL_VIDEO_DRIVER_X11_XSYNC 87 XSyncCounter resize_counter; 88 XSyncValue resize_id; 89 bool resize_in_progress; 90#endif /* SDL_VIDEO_DRIVER_X11_XSYNC */ 91 92 SDL_Rect expected; 93 SDL_DisplayMode requested_fullscreen_mode; 94 95 enum 96 { 97 X11_PENDING_OP_NONE = 0x00, 98 X11_PENDING_OP_RESTORE = 0x01, 99 X11_PENDING_OP_MINIMIZE = 0x02, 100 X11_PENDING_OP_MAXIMIZE = 0x04, 101 X11_PENDING_OP_FULLSCREEN = 0x08, 102 X11_PENDING_OP_MOVE = 0x10, 103 X11_PENDING_OP_RESIZE = 0x20 104 } pending_operation; 105 106 enum 107 { 108 X11_SIZE_MOVE_EVENTS_DISABLE = 0x01, // Events are completely disabled. 109 X11_SIZE_MOVE_EVENTS_WAIT_FOR_BORDERS = 0x02, // Events are disabled until a _NET_FRAME_EXTENTS event arrives. 110 } size_move_event_flags; 111 112 bool pending_size; 113 bool pending_position; 114 bool window_was_maximized; 115 bool previous_borders_nonzero; 116 bool toggle_borders; 117 bool fullscreen_borders_forced_on; 118 bool was_shown; 119 bool emit_size_move_after_property_notify; 120 SDL_HitTestResult hit_test_result; 121 bool pending_grab; 122 123 XPoint xim_spot; 124 char *preedit_text; 125 XIMFeedback *preedit_feedback; 126 int preedit_length; 127 int preedit_cursor; 128 bool ime_needs_clear_composition; 129}; 130 131extern void X11_SetNetWMState(SDL_VideoDevice *_this, Window xwindow, SDL_WindowFlags flags); 132extern SDL_WindowFlags X11_GetNetWMState(SDL_VideoDevice *_this, SDL_Window *window, Window xwindow); 133 134extern bool X11_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_PropertiesID create_props); 135extern char *X11_GetWindowTitle(SDL_VideoDevice *_this, Window xwindow); 136extern void X11_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window); 137extern bool X11_SetWindowIcon(SDL_VideoDevice *_this, SDL_Window *window, SDL_Surface *icon); 138extern bool X11_SetWindowPosition(SDL_VideoDevice *_this, SDL_Window *window); 139extern void X11_SetWindowMinimumSize(SDL_VideoDevice *_this, SDL_Window *window); 140extern void X11_SetWindowMaximumSize(SDL_VideoDevice *_this, SDL_Window *window); 141extern void X11_SetWindowAspectRatio(SDL_VideoDevice *_this, SDL_Window *window); 142extern bool X11_GetWindowBordersSize(SDL_VideoDevice *_this, SDL_Window *window, int *top, int *left, int *bottom, int *right); 143extern bool X11_SetWindowOpacity(SDL_VideoDevice *_this, SDL_Window *window, float opacity); 144extern bool X11_SetWindowParent(SDL_VideoDevice *_this, SDL_Window *window, SDL_Window *parent); 145extern bool X11_SetWindowModal(SDL_VideoDevice *_this, SDL_Window *window, bool modal); 146extern void X11_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window); 147extern void X11_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window); 148extern void X11_HideWindow(SDL_VideoDevice *_this, SDL_Window *window); 149extern void X11_RaiseWindow(SDL_VideoDevice *_this, SDL_Window *window); 150extern void X11_MaximizeWindow(SDL_VideoDevice *_this, SDL_Window *window); 151extern void X11_MinimizeWindow(SDL_VideoDevice *_this, SDL_Window *window); 152extern void X11_RestoreWindow(SDL_VideoDevice *_this, SDL_Window *window); 153extern void X11_SetWindowBordered(SDL_VideoDevice *_this, SDL_Window *window, bool bordered); 154extern void X11_SetWindowResizable(SDL_VideoDevice *_this, SDL_Window *window, bool resizable); 155extern void X11_SetWindowAlwaysOnTop(SDL_VideoDevice *_this, SDL_Window *window, bool on_top); 156extern SDL_FullscreenResult X11_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *window, SDL_VideoDisplay *display, SDL_FullscreenOp fullscreen); 157extern void *X11_GetWindowICCProfile(SDL_VideoDevice *_this, SDL_Window *window, size_t *size); 158extern bool X11_SetWindowMouseGrab(SDL_VideoDevice *_this, SDL_Window *window, bool grabbed); 159extern bool X11_SetWindowKeyboardGrab(SDL_VideoDevice *_this, SDL_Window *window, bool grabbed); 160extern void X11_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window); 161extern bool X11_SetWindowHitTest(SDL_Window *window, bool enabled); 162extern void X11_AcceptDragAndDrop(SDL_Window *window, bool accept); 163extern bool X11_FlashWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_FlashOperation operation); 164extern void X11_ShowWindowSystemMenu(SDL_Window *window, int x, int y); 165extern bool X11_SyncWindow(SDL_VideoDevice *_this, SDL_Window *window); 166extern bool X11_SetWindowFocusable(SDL_VideoDevice *_this, SDL_Window *window, bool focusable); 167 168extern bool SDL_X11_SetWindowTitle(Display *display, Window xwindow, char *title); 169extern void X11_UpdateWindowPosition(SDL_Window *window, bool use_current_position); 170extern void X11_SetWindowMinMax(SDL_Window *window, bool use_current); 171 172#endif // SDL_x11window_h_ 173[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.