Atlas - SDL_windowswindow.h

Home / ext / SDL / src / video / windows Lines: 1 | Size: 6518 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_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 34extern "C" { 35#endif 36 37typedef enum SDL_WindowRect 38{ 39 SDL_WINDOWRECT_CURRENT, 40 SDL_WINDOWRECT_WINDOWED, 41 SDL_WINDOWRECT_FLOATING, 42 SDL_WINDOWRECT_PENDING 43} SDL_WindowRect; 44 45typedef enum SDL_WindowEraseBackgroundMode 46{ 47 SDL_ERASEBACKGROUNDMODE_NEVER, 48 SDL_ERASEBACKGROUNDMODE_INITIAL, 49 SDL_ERASEBACKGROUNDMODE_ALWAYS, 50} SDL_WindowEraseBackgroundMode; 51 52typedef 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 62struct 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 HICON hicon; 72 WNDPROC wndproc; 73 HHOOK keyboard_hook; 74 WPARAM mouse_button_flags; 75 LPARAM last_pointer_update; 76 WCHAR high_surrogate; 77 bool initializing; 78 bool expected_resize; 79 bool in_border_change; 80 bool in_title_click; 81 Uint8 focus_click_pending; 82 bool postpone_clipcursor; 83 bool clipcursor_queued; 84 bool windowed_mode_was_maximized; 85 bool in_window_deactivation; 86 bool force_ws_maximizebox; 87 bool disable_move_size_events; 88 bool showing_window; 89 int in_modal_loop; 90 int last_modal_width; 91 int last_modal_height; 92 RECT initial_size_rect; 93 RECT cursor_clipped_rect; // last successfully committed clipping rect for this window 94 RECT cursor_ctrlock_rect; // this is Windows-specific, but probably does not need to be per-window 95 bool mouse_tracked; 96 bool destroy_parent_with_window; 97 WCHAR *ICMFileName; 98 SDL_WindowEraseBackgroundMode hint_erase_background_mode; 99 bool taskbar_button_created; 100 struct SDL_VideoData *videodata; 101#ifdef SDL_VIDEO_OPENGL_EGL 102 EGLSurface egl_surface; 103#endif 104 105 // Whether we retain the content of the window when changing state 106 UINT copybits_flag; 107 SDLDropTarget *drop_target; 108}; 109 110extern bool WIN_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_PropertiesID create_props); 111extern void WIN_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window); 112extern bool WIN_SetWindowIcon(SDL_VideoDevice *_this, SDL_Window *window, SDL_Surface *icon); 113extern bool WIN_SetWindowPosition(SDL_VideoDevice *_this, SDL_Window *window); 114extern void WIN_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window); 115extern bool WIN_GetWindowBordersSize(SDL_VideoDevice *_this, SDL_Window *window, int *top, int *left, int *bottom, int *right); 116extern void WIN_GetWindowSizeInPixels(SDL_VideoDevice *_this, SDL_Window *window, int *width, int *height); 117extern bool WIN_SetWindowOpacity(SDL_VideoDevice *_this, SDL_Window *window, float opacity); 118extern void WIN_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window); 119extern void WIN_HideWindow(SDL_VideoDevice *_this, SDL_Window *window); 120extern void WIN_RaiseWindow(SDL_VideoDevice *_this, SDL_Window *window); 121extern void WIN_MaximizeWindow(SDL_VideoDevice *_this, SDL_Window *window); 122extern void WIN_MinimizeWindow(SDL_VideoDevice *_this, SDL_Window *window); 123extern void WIN_RestoreWindow(SDL_VideoDevice *_this, SDL_Window *window); 124extern void WIN_SetWindowBordered(SDL_VideoDevice *_this, SDL_Window *window, bool bordered); 125extern void WIN_SetWindowResizable(SDL_VideoDevice *_this, SDL_Window *window, bool resizable); 126extern void WIN_SetWindowAlwaysOnTop(SDL_VideoDevice *_this, SDL_Window *window, bool on_top); 127extern SDL_FullscreenResult WIN_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *window, SDL_VideoDisplay *display, SDL_FullscreenOp fullscreen); 128extern void WIN_UpdateWindowICCProfile(SDL_Window *window, bool send_event); 129extern void *WIN_GetWindowICCProfile(SDL_VideoDevice *_this, SDL_Window *window, size_t *size); 130extern bool WIN_SetWindowMouseRect(SDL_VideoDevice *_this, SDL_Window *window); 131extern bool WIN_SetWindowMouseGrab(SDL_VideoDevice *_this, SDL_Window *window, bool grabbed); 132extern bool WIN_SetWindowKeyboardGrab(SDL_VideoDevice *_this, SDL_Window *window, bool grabbed); 133extern void WIN_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window); 134extern void WIN_OnWindowEnter(SDL_VideoDevice *_this, SDL_Window *window); 135extern void WIN_UpdateClipCursor(SDL_Window *window); 136extern void WIN_UnclipCursorForWindow(SDL_Window *window); 137extern bool WIN_SetWindowHitTest(SDL_Window *window, bool enabled); 138extern void WIN_AcceptDragAndDrop(SDL_Window *window, bool accept); 139extern bool WIN_FlashWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_FlashOperation operation); 140extern bool WIN_ApplyWindowProgress(SDL_VideoDevice *_this, SDL_Window *window); 141extern bool WIN_SetWindowPositionInternal(SDL_Window *window, UINT flags, SDL_WindowRect rect_type); 142extern void WIN_ShowWindowSystemMenu(SDL_Window *window, int x, int y); 143extern bool WIN_SetWindowFocusable(SDL_VideoDevice *_this, SDL_Window *window, bool focusable); 144extern bool WIN_AdjustWindowRect(SDL_Window *window, int *x, int *y, int *width, int *height, SDL_WindowRect rect_type); 145extern bool WIN_AdjustWindowRectForHWND(HWND hwnd, LPRECT lpRect, UINT frame_dpi); 146extern bool WIN_SetWindowParent(SDL_VideoDevice *_this, SDL_Window *window, SDL_Window *parent); 147extern bool WIN_SetWindowModal(SDL_VideoDevice *_this, SDL_Window *window, bool modal); 148 149// Ends C function definitions when using C++ 150#ifdef __cplusplus 151} 152#endif 153 154#endif // SDL_windowswindow_h_ 155
[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.