diff options
| author | 3gg <3gg@shellblade.net> | 2025-12-27 12:03:39 -0800 |
|---|---|---|
| committer | 3gg <3gg@shellblade.net> | 2025-12-27 12:03:39 -0800 |
| commit | 5a079a2d114f96d4847d1ee305d5b7c16eeec50e (patch) | |
| tree | 8926ab44f168acf787d8e19608857b3af0f82758 /contrib/SDL-3.2.8/src/video/windows/SDL_windowswindow.h | |
Initial commit
Diffstat (limited to 'contrib/SDL-3.2.8/src/video/windows/SDL_windowswindow.h')
| -rw-r--r-- | contrib/SDL-3.2.8/src/video/windows/SDL_windowswindow.h | 152 |
1 files changed, 152 insertions, 0 deletions
diff --git a/contrib/SDL-3.2.8/src/video/windows/SDL_windowswindow.h b/contrib/SDL-3.2.8/src/video/windows/SDL_windowswindow.h new file mode 100644 index 0000000..a2c9a21 --- /dev/null +++ b/contrib/SDL-3.2.8/src/video/windows/SDL_windowswindow.h | |||
| @@ -0,0 +1,152 @@ | |||
| 1 | /* | ||
| 2 | Simple DirectMedia Layer | ||
| 3 | Copyright (C) 1997-2025 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_windowswindow_h_ | ||
| 24 | #define SDL_windowswindow_h_ | ||
| 25 | |||
| 26 | #ifdef SDL_VIDEO_OPENGL_EGL | ||
| 27 | #include "../SDL_egl_c.h" | ||
| 28 | #else | ||
| 29 | #include "../SDL_sysvideo.h" | ||
| 30 | #endif | ||
| 31 | |||
| 32 | // Set up for C function definitions, even when using C++ | ||
| 33 | #ifdef __cplusplus | ||
| 34 | extern "C" { | ||
| 35 | #endif | ||
| 36 | |||
| 37 | typedef enum SDL_WindowRect | ||
| 38 | { | ||
| 39 | SDL_WINDOWRECT_CURRENT, | ||
| 40 | SDL_WINDOWRECT_WINDOWED, | ||
| 41 | SDL_WINDOWRECT_FLOATING, | ||
| 42 | SDL_WINDOWRECT_PENDING | ||
| 43 | } SDL_WindowRect; | ||
| 44 | |||
| 45 | typedef enum SDL_WindowEraseBackgroundMode | ||
| 46 | { | ||
| 47 | SDL_ERASEBACKGROUNDMODE_NEVER, | ||
| 48 | SDL_ERASEBACKGROUNDMODE_INITIAL, | ||
| 49 | SDL_ERASEBACKGROUNDMODE_ALWAYS, | ||
| 50 | } SDL_WindowEraseBackgroundMode; | ||
| 51 | |||
| 52 | typedef struct | ||
| 53 | { | ||
| 54 | void **lpVtbl; | ||
| 55 | int refcount; | ||
| 56 | SDL_Window *window; | ||
| 57 | HWND hwnd; | ||
| 58 | UINT format_text; | ||
| 59 | UINT format_file; | ||
| 60 | } SDLDropTarget; | ||
| 61 | |||
| 62 | struct SDL_WindowData | ||
| 63 | { | ||
| 64 | SDL_Window *window; | ||
| 65 | HWND hwnd; | ||
| 66 | HWND parent; | ||
| 67 | HDC hdc; | ||
| 68 | HDC mdc; | ||
| 69 | HINSTANCE hinstance; | ||
| 70 | HBITMAP hbm; | ||
| 71 | WNDPROC wndproc; | ||
| 72 | HHOOK keyboard_hook; | ||
| 73 | WPARAM mouse_button_flags; | ||
| 74 | LPARAM last_pointer_update; | ||
| 75 | WCHAR high_surrogate; | ||
| 76 | bool initializing; | ||
| 77 | bool expected_resize; | ||
| 78 | bool in_border_change; | ||
| 79 | bool in_title_click; | ||
| 80 | Uint8 focus_click_pending; | ||
| 81 | bool skip_update_clipcursor; | ||
| 82 | bool windowed_mode_was_maximized; | ||
| 83 | bool in_window_deactivation; | ||
| 84 | bool force_ws_maximizebox; | ||
| 85 | bool disable_move_size_events; | ||
| 86 | int in_modal_loop; | ||
| 87 | RECT initial_size_rect; | ||
| 88 | RECT cursor_clipped_rect; // last successfully committed clipping rect for this window | ||
| 89 | RECT cursor_ctrlock_rect; // this is Windows-specific, but probably does not need to be per-window | ||
| 90 | UINT windowed_mode_corner_rounding; | ||
| 91 | COLORREF dwma_border_color; | ||
| 92 | bool mouse_tracked; | ||
| 93 | bool destroy_parent_with_window; | ||
| 94 | SDL_DisplayID last_displayID; | ||
| 95 | WCHAR *ICMFileName; | ||
| 96 | SDL_Window *keyboard_focus; | ||
| 97 | SDL_WindowEraseBackgroundMode hint_erase_background_mode; | ||
| 98 | struct SDL_VideoData *videodata; | ||
| 99 | #ifdef SDL_VIDEO_OPENGL_EGL | ||
| 100 | EGLSurface egl_surface; | ||
| 101 | #endif | ||
| 102 | |||
| 103 | // Whether we retain the content of the window when changing state | ||
| 104 | UINT copybits_flag; | ||
| 105 | SDLDropTarget *drop_target; | ||
| 106 | }; | ||
| 107 | |||
| 108 | extern bool WIN_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_PropertiesID create_props); | ||
| 109 | extern void WIN_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window); | ||
| 110 | extern bool WIN_SetWindowIcon(SDL_VideoDevice *_this, SDL_Window *window, SDL_Surface *icon); | ||
| 111 | extern bool WIN_SetWindowPosition(SDL_VideoDevice *_this, SDL_Window *window); | ||
| 112 | extern void WIN_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window); | ||
| 113 | extern bool WIN_GetWindowBordersSize(SDL_VideoDevice *_this, SDL_Window *window, int *top, int *left, int *bottom, int *right); | ||
| 114 | extern void WIN_GetWindowSizeInPixels(SDL_VideoDevice *_this, SDL_Window *window, int *width, int *height); | ||
| 115 | extern bool WIN_SetWindowOpacity(SDL_VideoDevice *_this, SDL_Window *window, float opacity); | ||
| 116 | extern void WIN_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window); | ||
| 117 | extern void WIN_HideWindow(SDL_VideoDevice *_this, SDL_Window *window); | ||
| 118 | extern void WIN_RaiseWindow(SDL_VideoDevice *_this, SDL_Window *window); | ||
| 119 | extern void WIN_MaximizeWindow(SDL_VideoDevice *_this, SDL_Window *window); | ||
| 120 | extern void WIN_MinimizeWindow(SDL_VideoDevice *_this, SDL_Window *window); | ||
| 121 | extern void WIN_RestoreWindow(SDL_VideoDevice *_this, SDL_Window *window); | ||
| 122 | extern void WIN_SetWindowBordered(SDL_VideoDevice *_this, SDL_Window *window, bool bordered); | ||
| 123 | extern void WIN_SetWindowResizable(SDL_VideoDevice *_this, SDL_Window *window, bool resizable); | ||
| 124 | extern void WIN_SetWindowAlwaysOnTop(SDL_VideoDevice *_this, SDL_Window *window, bool on_top); | ||
| 125 | extern SDL_FullscreenResult WIN_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *window, SDL_VideoDisplay *display, SDL_FullscreenOp fullscreen); | ||
| 126 | extern void WIN_UpdateWindowICCProfile(SDL_Window *window, bool send_event); | ||
| 127 | extern void *WIN_GetWindowICCProfile(SDL_VideoDevice *_this, SDL_Window *window, size_t *size); | ||
| 128 | extern bool WIN_SetWindowMouseRect(SDL_VideoDevice *_this, SDL_Window *window); | ||
| 129 | extern bool WIN_SetWindowMouseGrab(SDL_VideoDevice *_this, SDL_Window *window, bool grabbed); | ||
| 130 | extern bool WIN_SetWindowKeyboardGrab(SDL_VideoDevice *_this, SDL_Window *window, bool grabbed); | ||
| 131 | extern void WIN_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window); | ||
| 132 | extern void WIN_OnWindowEnter(SDL_VideoDevice *_this, SDL_Window *window); | ||
| 133 | extern void WIN_UpdateClipCursor(SDL_Window *window); | ||
| 134 | extern void WIN_UnclipCursorForWindow(SDL_Window *window); | ||
| 135 | extern bool WIN_SetWindowHitTest(SDL_Window *window, bool enabled); | ||
| 136 | extern void WIN_AcceptDragAndDrop(SDL_Window *window, bool accept); | ||
| 137 | extern bool WIN_FlashWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_FlashOperation operation); | ||
| 138 | extern void WIN_UpdateDarkModeForHWND(HWND hwnd); | ||
| 139 | extern bool WIN_SetWindowPositionInternal(SDL_Window *window, UINT flags, SDL_WindowRect rect_type); | ||
| 140 | extern void WIN_ShowWindowSystemMenu(SDL_Window *window, int x, int y); | ||
| 141 | extern bool WIN_SetWindowFocusable(SDL_VideoDevice *_this, SDL_Window *window, bool focusable); | ||
| 142 | extern bool WIN_AdjustWindowRect(SDL_Window *window, int *x, int *y, int *width, int *height, SDL_WindowRect rect_type); | ||
| 143 | extern bool WIN_AdjustWindowRectForHWND(HWND hwnd, LPRECT lpRect, UINT frame_dpi); | ||
| 144 | extern bool WIN_SetWindowParent(SDL_VideoDevice *_this, SDL_Window *window, SDL_Window *parent); | ||
| 145 | extern bool WIN_SetWindowModal(SDL_VideoDevice *_this, SDL_Window *window, bool modal); | ||
| 146 | |||
| 147 | // Ends C function definitions when using C++ | ||
| 148 | #ifdef __cplusplus | ||
| 149 | } | ||
| 150 | #endif | ||
| 151 | |||
| 152 | #endif // SDL_windowswindow_h_ | ||
