diff options
Diffstat (limited to 'contrib/SDL-3.2.8/src/video/windows/SDL_windowsvideo.h')
| -rw-r--r-- | contrib/SDL-3.2.8/src/video/windows/SDL_windowsvideo.h | 507 |
1 files changed, 507 insertions, 0 deletions
diff --git a/contrib/SDL-3.2.8/src/video/windows/SDL_windowsvideo.h b/contrib/SDL-3.2.8/src/video/windows/SDL_windowsvideo.h new file mode 100644 index 0000000..53cfbad --- /dev/null +++ b/contrib/SDL-3.2.8/src/video/windows/SDL_windowsvideo.h | |||
| @@ -0,0 +1,507 @@ | |||
| 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_windowsvideo_h_ | ||
| 24 | #define SDL_windowsvideo_h_ | ||
| 25 | |||
| 26 | #include "../../core/windows/SDL_windows.h" | ||
| 27 | |||
| 28 | #include "../SDL_sysvideo.h" | ||
| 29 | |||
| 30 | #ifdef HAVE_DXGI_H | ||
| 31 | #define CINTERFACE | ||
| 32 | #define COBJMACROS | ||
| 33 | #include <dxgi.h> | ||
| 34 | #endif | ||
| 35 | |||
| 36 | #if defined(_MSC_VER) && (_MSC_VER >= 1500) && !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) | ||
| 37 | #include <msctf.h> | ||
| 38 | #else | ||
| 39 | #include "SDL_msctf.h" | ||
| 40 | #endif | ||
| 41 | |||
| 42 | #include <imm.h> | ||
| 43 | |||
| 44 | #define MAX_CANDLIST 10 | ||
| 45 | #define MAX_CANDLENGTH 256 | ||
| 46 | #define MAX_CANDSIZE (sizeof(WCHAR) * MAX_CANDLIST * MAX_CANDLENGTH) | ||
| 47 | |||
| 48 | #include "SDL_windowsclipboard.h" | ||
| 49 | #include "SDL_windowsevents.h" | ||
| 50 | #include "SDL_windowsgameinput.h" | ||
| 51 | #include "SDL_windowsopengl.h" | ||
| 52 | |||
| 53 | #if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) | ||
| 54 | #include "SDL_windowsshape.h" | ||
| 55 | #include "SDL_windowskeyboard.h" | ||
| 56 | #include "SDL_windowsmodes.h" | ||
| 57 | #include "SDL_windowsmouse.h" | ||
| 58 | #include "SDL_windowsopengles.h" | ||
| 59 | #endif | ||
| 60 | |||
| 61 | #include "SDL_windowswindow.h" | ||
| 62 | |||
| 63 | #ifndef USER_DEFAULT_SCREEN_DPI | ||
| 64 | #define USER_DEFAULT_SCREEN_DPI 96 | ||
| 65 | #endif | ||
| 66 | |||
| 67 | #if WINVER < 0x0601 | ||
| 68 | // Touch input definitions | ||
| 69 | #define TWF_FINETOUCH 1 | ||
| 70 | #define TWF_WANTPALM 2 | ||
| 71 | |||
| 72 | #define TOUCHEVENTF_MOVE 0x0001 | ||
| 73 | #define TOUCHEVENTF_DOWN 0x0002 | ||
| 74 | #define TOUCHEVENTF_UP 0x0004 | ||
| 75 | |||
| 76 | DECLARE_HANDLE(HTOUCHINPUT); | ||
| 77 | |||
| 78 | typedef struct _TOUCHINPUT | ||
| 79 | { | ||
| 80 | LONG x; | ||
| 81 | LONG y; | ||
| 82 | HANDLE hSource; | ||
| 83 | DWORD dwID; | ||
| 84 | DWORD dwFlags; | ||
| 85 | DWORD dwMask; | ||
| 86 | DWORD dwTime; | ||
| 87 | ULONG_PTR dwExtraInfo; | ||
| 88 | DWORD cxContact; | ||
| 89 | DWORD cyContact; | ||
| 90 | } TOUCHINPUT, *PTOUCHINPUT; | ||
| 91 | |||
| 92 | // More-robust display information in Vista... | ||
| 93 | // This is a huge amount of data to be stuffing into three API calls. :( | ||
| 94 | typedef struct DISPLAYCONFIG_PATH_SOURCE_INFO | ||
| 95 | { | ||
| 96 | LUID adapterId; | ||
| 97 | UINT32 id; | ||
| 98 | union | ||
| 99 | { | ||
| 100 | UINT32 modeInfoIdx; | ||
| 101 | struct | ||
| 102 | { | ||
| 103 | UINT32 cloneGroupId : 16; | ||
| 104 | UINT32 sourceModeInfoIdx : 16; | ||
| 105 | } DUMMYSTRUCTNAME; | ||
| 106 | } DUMMYUNIONNAME; | ||
| 107 | |||
| 108 | UINT32 statusFlags; | ||
| 109 | } DISPLAYCONFIG_PATH_SOURCE_INFO; | ||
| 110 | |||
| 111 | typedef struct DISPLAYCONFIG_RATIONAL | ||
| 112 | { | ||
| 113 | UINT32 Numerator; | ||
| 114 | UINT32 Denominator; | ||
| 115 | } DISPLAYCONFIG_RATIONAL; | ||
| 116 | |||
| 117 | typedef struct DISPLAYCONFIG_PATH_TARGET_INFO | ||
| 118 | { | ||
| 119 | LUID adapterId; | ||
| 120 | UINT32 id; | ||
| 121 | union | ||
| 122 | { | ||
| 123 | UINT32 modeInfoIdx; | ||
| 124 | struct | ||
| 125 | { | ||
| 126 | UINT32 desktopModeInfoIdx : 16; | ||
| 127 | UINT32 targetModeInfoIdx : 16; | ||
| 128 | } DUMMYSTRUCTNAME; | ||
| 129 | } DUMMYUNIONNAME; | ||
| 130 | UINT32 /*DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY*/ outputTechnology; | ||
| 131 | UINT32 /*DISPLAYCONFIG_ROTATION*/ rotation; | ||
| 132 | UINT32 /*DISPLAYCONFIG_SCALING*/ scaling; | ||
| 133 | DISPLAYCONFIG_RATIONAL refreshRate; | ||
| 134 | UINT32 /*DISPLAYCONFIG_SCANLINE_ORDERING*/ scanLineOrdering; | ||
| 135 | BOOL targetAvailable; | ||
| 136 | UINT32 statusFlags; | ||
| 137 | } DISPLAYCONFIG_PATH_TARGET_INFO; | ||
| 138 | |||
| 139 | typedef struct DISPLAYCONFIG_PATH_INFO | ||
| 140 | { | ||
| 141 | DISPLAYCONFIG_PATH_SOURCE_INFO sourceInfo; | ||
| 142 | DISPLAYCONFIG_PATH_TARGET_INFO targetInfo; | ||
| 143 | UINT32 flags; | ||
| 144 | } DISPLAYCONFIG_PATH_INFO; | ||
| 145 | |||
| 146 | typedef enum | ||
| 147 | { | ||
| 148 | DISPLAYCONFIG_MODE_INFO_TYPE_SOURCE = 1, | ||
| 149 | DISPLAYCONFIG_MODE_INFO_TYPE_TARGET = 2, | ||
| 150 | DISPLAYCONFIG_MODE_INFO_TYPE_DESKTOP_IMAGE = 3, | ||
| 151 | DISPLAYCONFIG_MODE_INFO_TYPE_FORCE_UINT32 = 0xFFFFFFFF | ||
| 152 | } DISPLAYCONFIG_MODE_INFO_TYPE; | ||
| 153 | |||
| 154 | typedef struct DISPLAYCONFIG_2DREGION | ||
| 155 | { | ||
| 156 | UINT32 cx; | ||
| 157 | UINT32 cy; | ||
| 158 | } DISPLAYCONFIG_2DREGION; | ||
| 159 | |||
| 160 | typedef struct DISPLAYCONFIG_VIDEO_SIGNAL_INFO | ||
| 161 | { | ||
| 162 | UINT64 pixelRate; | ||
| 163 | DISPLAYCONFIG_RATIONAL hSyncFreq; | ||
| 164 | DISPLAYCONFIG_RATIONAL vSyncFreq; | ||
| 165 | DISPLAYCONFIG_2DREGION activeSize; | ||
| 166 | DISPLAYCONFIG_2DREGION totalSize; | ||
| 167 | |||
| 168 | union | ||
| 169 | { | ||
| 170 | struct | ||
| 171 | { | ||
| 172 | UINT32 videoStandard : 16; | ||
| 173 | |||
| 174 | // Vertical refresh frequency divider | ||
| 175 | UINT32 vSyncFreqDivider : 6; | ||
| 176 | |||
| 177 | UINT32 reserved : 10; | ||
| 178 | } AdditionalSignalInfo; | ||
| 179 | |||
| 180 | UINT32 videoStandard; | ||
| 181 | } DUMMYUNIONNAME; | ||
| 182 | |||
| 183 | // Scan line ordering (e.g. progressive, interlaced). | ||
| 184 | UINT32 /*DISPLAYCONFIG_SCANLINE_ORDERING*/ scanLineOrdering; | ||
| 185 | } DISPLAYCONFIG_VIDEO_SIGNAL_INFO; | ||
| 186 | |||
| 187 | typedef struct DISPLAYCONFIG_SOURCE_MODE | ||
| 188 | { | ||
| 189 | UINT32 width; | ||
| 190 | UINT32 height; | ||
| 191 | UINT32 /*DISPLAYCONFIG_PIXELFORMAT*/ pixelFormat; | ||
| 192 | POINTL position; | ||
| 193 | } DISPLAYCONFIG_SOURCE_MODE; | ||
| 194 | |||
| 195 | typedef struct DISPLAYCONFIG_TARGET_MODE | ||
| 196 | { | ||
| 197 | DISPLAYCONFIG_VIDEO_SIGNAL_INFO targetVideoSignalInfo; | ||
| 198 | } DISPLAYCONFIG_TARGET_MODE; | ||
| 199 | |||
| 200 | typedef struct DISPLAYCONFIG_DESKTOP_IMAGE_INFO | ||
| 201 | { | ||
| 202 | POINTL PathSourceSize; | ||
| 203 | RECTL DesktopImageRegion; | ||
| 204 | RECTL DesktopImageClip; | ||
| 205 | } DISPLAYCONFIG_DESKTOP_IMAGE_INFO; | ||
| 206 | |||
| 207 | typedef struct DISPLAYCONFIG_MODE_INFO | ||
| 208 | { | ||
| 209 | DISPLAYCONFIG_MODE_INFO_TYPE infoType; | ||
| 210 | UINT32 id; | ||
| 211 | LUID adapterId; | ||
| 212 | union | ||
| 213 | { | ||
| 214 | DISPLAYCONFIG_TARGET_MODE targetMode; | ||
| 215 | DISPLAYCONFIG_SOURCE_MODE sourceMode; | ||
| 216 | DISPLAYCONFIG_DESKTOP_IMAGE_INFO desktopImageInfo; | ||
| 217 | } DUMMYUNIONNAME; | ||
| 218 | } DISPLAYCONFIG_MODE_INFO; | ||
| 219 | |||
| 220 | typedef enum DISPLAYCONFIG_TOPOLOGY_ID | ||
| 221 | { | ||
| 222 | DISPLAYCONFIG_TOPOLOGY_INTERNAL = 0x00000001, | ||
| 223 | DISPLAYCONFIG_TOPOLOGY_CLONE = 0x00000002, | ||
| 224 | DISPLAYCONFIG_TOPOLOGY_EXTEND = 0x00000004, | ||
| 225 | DISPLAYCONFIG_TOPOLOGY_EXTERNAL = 0x00000008, | ||
| 226 | DISPLAYCONFIG_TOPOLOGY_FORCE_UINT32 = 0xFFFFFFFF | ||
| 227 | } DISPLAYCONFIG_TOPOLOGY_ID; | ||
| 228 | |||
| 229 | typedef enum | ||
| 230 | { | ||
| 231 | DISPLAYCONFIG_DEVICE_INFO_GET_SOURCE_NAME = 1, | ||
| 232 | DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_NAME = 2, | ||
| 233 | DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_PREFERRED_MODE = 3, | ||
| 234 | DISPLAYCONFIG_DEVICE_INFO_GET_ADAPTER_NAME = 4, | ||
| 235 | DISPLAYCONFIG_DEVICE_INFO_SET_TARGET_PERSISTENCE = 5, | ||
| 236 | DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_BASE_TYPE = 6, | ||
| 237 | DISPLAYCONFIG_DEVICE_INFO_GET_SUPPORT_VIRTUAL_RESOLUTION = 7, | ||
| 238 | DISPLAYCONFIG_DEVICE_INFO_SET_SUPPORT_VIRTUAL_RESOLUTION = 8, | ||
| 239 | DISPLAYCONFIG_DEVICE_INFO_GET_ADVANCED_COLOR_INFO = 9, | ||
| 240 | DISPLAYCONFIG_DEVICE_INFO_SET_ADVANCED_COLOR_STATE = 10, | ||
| 241 | DISPLAYCONFIG_DEVICE_INFO_GET_SDR_WHITE_LEVEL = 11, | ||
| 242 | DISPLAYCONFIG_DEVICE_INFO_FORCE_UINT32 = 0xFFFFFFFF | ||
| 243 | } DISPLAYCONFIG_DEVICE_INFO_TYPE; | ||
| 244 | |||
| 245 | typedef struct DISPLAYCONFIG_DEVICE_INFO_HEADER | ||
| 246 | { | ||
| 247 | DISPLAYCONFIG_DEVICE_INFO_TYPE type; | ||
| 248 | UINT32 size; | ||
| 249 | LUID adapterId; | ||
| 250 | UINT32 id; | ||
| 251 | } DISPLAYCONFIG_DEVICE_INFO_HEADER; | ||
| 252 | |||
| 253 | typedef struct DISPLAYCONFIG_SOURCE_DEVICE_NAME | ||
| 254 | { | ||
| 255 | DISPLAYCONFIG_DEVICE_INFO_HEADER header; | ||
| 256 | WCHAR viewGdiDeviceName[CCHDEVICENAME]; | ||
| 257 | } DISPLAYCONFIG_SOURCE_DEVICE_NAME; | ||
| 258 | |||
| 259 | typedef struct DISPLAYCONFIG_TARGET_DEVICE_NAME_FLAGS | ||
| 260 | { | ||
| 261 | union | ||
| 262 | { | ||
| 263 | struct | ||
| 264 | { | ||
| 265 | UINT32 friendlyNameFromEdid : 1; | ||
| 266 | UINT32 friendlyNameForced : 1; | ||
| 267 | UINT32 edidIdsValid : 1; | ||
| 268 | UINT32 reserved : 29; | ||
| 269 | } DUMMYSTRUCTNAME; | ||
| 270 | UINT32 value; | ||
| 271 | } DUMMYUNIONNAME; | ||
| 272 | } DISPLAYCONFIG_TARGET_DEVICE_NAME_FLAGS; | ||
| 273 | |||
| 274 | typedef struct DISPLAYCONFIG_TARGET_DEVICE_NAME | ||
| 275 | { | ||
| 276 | DISPLAYCONFIG_DEVICE_INFO_HEADER header; | ||
| 277 | DISPLAYCONFIG_TARGET_DEVICE_NAME_FLAGS flags; | ||
| 278 | UINT32 /*DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY*/ outputTechnology; | ||
| 279 | UINT16 edidManufactureId; | ||
| 280 | UINT16 edidProductCodeId; | ||
| 281 | UINT32 connectorInstance; | ||
| 282 | WCHAR monitorFriendlyDeviceName[64]; | ||
| 283 | WCHAR monitorDevicePath[128]; | ||
| 284 | } DISPLAYCONFIG_TARGET_DEVICE_NAME; | ||
| 285 | |||
| 286 | #define QDC_ONLY_ACTIVE_PATHS 0x00000002 | ||
| 287 | |||
| 288 | #endif // WINVER < 0x0601 | ||
| 289 | |||
| 290 | #ifndef HAVE_SHELLSCALINGAPI_H | ||
| 291 | |||
| 292 | typedef enum MONITOR_DPI_TYPE | ||
| 293 | { | ||
| 294 | MDT_EFFECTIVE_DPI = 0, | ||
| 295 | MDT_ANGULAR_DPI = 1, | ||
| 296 | MDT_RAW_DPI = 2, | ||
| 297 | MDT_DEFAULT = MDT_EFFECTIVE_DPI | ||
| 298 | } MONITOR_DPI_TYPE; | ||
| 299 | |||
| 300 | typedef enum PROCESS_DPI_AWARENESS | ||
| 301 | { | ||
| 302 | PROCESS_DPI_UNAWARE = 0, | ||
| 303 | PROCESS_SYSTEM_DPI_AWARE = 1, | ||
| 304 | PROCESS_PER_MONITOR_DPI_AWARE = 2 | ||
| 305 | } PROCESS_DPI_AWARENESS; | ||
| 306 | |||
| 307 | #else | ||
| 308 | #include <shellscalingapi.h> | ||
| 309 | #endif | ||
| 310 | |||
| 311 | #ifndef _DPI_AWARENESS_CONTEXTS_ | ||
| 312 | |||
| 313 | typedef enum DPI_AWARENESS | ||
| 314 | { | ||
| 315 | DPI_AWARENESS_INVALID = -1, | ||
| 316 | DPI_AWARENESS_UNAWARE = 0, | ||
| 317 | DPI_AWARENESS_SYSTEM_AWARE = 1, | ||
| 318 | DPI_AWARENESS_PER_MONITOR_AWARE = 2 | ||
| 319 | } DPI_AWARENESS; | ||
| 320 | |||
| 321 | DECLARE_HANDLE(DPI_AWARENESS_CONTEXT); | ||
| 322 | |||
| 323 | #define DPI_AWARENESS_CONTEXT_UNAWARE ((DPI_AWARENESS_CONTEXT)-1) | ||
| 324 | #define DPI_AWARENESS_CONTEXT_SYSTEM_AWARE ((DPI_AWARENESS_CONTEXT)-2) | ||
| 325 | #define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE ((DPI_AWARENESS_CONTEXT)-3) | ||
| 326 | |||
| 327 | #endif // _DPI_AWARENESS_CONTEXTS_ | ||
| 328 | |||
| 329 | // Windows 10 Creators Update | ||
| 330 | #if NTDDI_VERSION < 0x0A000003 | ||
| 331 | #define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 ((DPI_AWARENESS_CONTEXT)-4) | ||
| 332 | #endif // NTDDI_VERSION < 0x0A000003 | ||
| 333 | |||
| 334 | // Windows 10 version 1809 | ||
| 335 | #if NTDDI_VERSION < 0x0A000006 | ||
| 336 | #define DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED ((DPI_AWARENESS_CONTEXT)-5) | ||
| 337 | #endif // NTDDI_VERSION < 0x0A000006 | ||
| 338 | |||
| 339 | typedef BOOL (*PFNSHFullScreen)(HWND, DWORD); | ||
| 340 | typedef void (*PFCoordTransform)(SDL_Window *, POINT *); | ||
| 341 | |||
| 342 | typedef struct | ||
| 343 | { | ||
| 344 | void **lpVtbl; | ||
| 345 | int refcount; | ||
| 346 | void *data; | ||
| 347 | } TSFSink; | ||
| 348 | |||
| 349 | #ifndef SDL_DISABLE_WINDOWS_IME | ||
| 350 | // Definition from Win98DDK version of IMM.H | ||
| 351 | typedef struct tagINPUTCONTEXT2 | ||
| 352 | { | ||
| 353 | HWND hWnd; | ||
| 354 | BOOL fOpen; | ||
| 355 | POINT ptStatusWndPos; | ||
| 356 | POINT ptSoftKbdPos; | ||
| 357 | DWORD fdwConversion; | ||
| 358 | DWORD fdwSentence; | ||
| 359 | union | ||
| 360 | { | ||
| 361 | LOGFONTA A; | ||
| 362 | LOGFONTW W; | ||
| 363 | } lfFont; | ||
| 364 | COMPOSITIONFORM cfCompForm; | ||
| 365 | CANDIDATEFORM cfCandForm[4]; | ||
| 366 | HIMCC hCompStr; | ||
| 367 | HIMCC hCandInfo; | ||
| 368 | HIMCC hGuideLine; | ||
| 369 | HIMCC hPrivate; | ||
| 370 | DWORD dwNumMsgBuf; | ||
| 371 | HIMCC hMsgBuf; | ||
| 372 | DWORD fdwInit; | ||
| 373 | DWORD dwReserve[3]; | ||
| 374 | } INPUTCONTEXT2, *PINPUTCONTEXT2, NEAR *NPINPUTCONTEXT2, FAR *LPINPUTCONTEXT2; | ||
| 375 | #endif | ||
| 376 | |||
| 377 | // Private display data | ||
| 378 | |||
| 379 | struct SDL_VideoData | ||
| 380 | { | ||
| 381 | int render; | ||
| 382 | |||
| 383 | bool coinitialized; | ||
| 384 | #if !(defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES)) | ||
| 385 | bool oleinitialized; | ||
| 386 | #endif // !(defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES)) | ||
| 387 | |||
| 388 | DWORD clipboard_count; | ||
| 389 | |||
| 390 | #if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) // Xbox doesn't support user32/shcore | ||
| 391 | // Touch input functions | ||
| 392 | SDL_SharedObject *userDLL; | ||
| 393 | /* *INDENT-OFF* */ // clang-format off | ||
| 394 | BOOL (WINAPI *CloseTouchInputHandle)( HTOUCHINPUT ); | ||
| 395 | BOOL (WINAPI *GetTouchInputInfo)( HTOUCHINPUT, UINT, PTOUCHINPUT, int ); | ||
| 396 | BOOL (WINAPI *RegisterTouchWindow)( HWND, ULONG ); | ||
| 397 | BOOL (WINAPI *SetProcessDPIAware)( void ); | ||
| 398 | BOOL (WINAPI *SetProcessDpiAwarenessContext)( DPI_AWARENESS_CONTEXT ); | ||
| 399 | DPI_AWARENESS_CONTEXT (WINAPI *SetThreadDpiAwarenessContext)( DPI_AWARENESS_CONTEXT ); | ||
| 400 | DPI_AWARENESS_CONTEXT (WINAPI *GetThreadDpiAwarenessContext)( void ); | ||
| 401 | DPI_AWARENESS (WINAPI *GetAwarenessFromDpiAwarenessContext)( DPI_AWARENESS_CONTEXT ); | ||
| 402 | BOOL (WINAPI *EnableNonClientDpiScaling)( HWND ); | ||
| 403 | BOOL (WINAPI *AdjustWindowRectExForDpi)( LPRECT, DWORD, BOOL, DWORD, UINT ); | ||
| 404 | UINT (WINAPI *GetDpiForWindow)( HWND ); | ||
| 405 | BOOL (WINAPI *AreDpiAwarenessContextsEqual)(DPI_AWARENESS_CONTEXT, DPI_AWARENESS_CONTEXT); | ||
| 406 | BOOL (WINAPI *IsValidDpiAwarenessContext)(DPI_AWARENESS_CONTEXT); | ||
| 407 | // DisplayConfig functions | ||
| 408 | LONG (WINAPI *GetDisplayConfigBufferSizes)( UINT32, UINT32*, UINT32* ); | ||
| 409 | LONG (WINAPI *QueryDisplayConfig)( UINT32, UINT32*, DISPLAYCONFIG_PATH_INFO*, UINT32*, DISPLAYCONFIG_MODE_INFO*, DISPLAYCONFIG_TOPOLOGY_ID*); | ||
| 410 | LONG (WINAPI *DisplayConfigGetDeviceInfo)( DISPLAYCONFIG_DEVICE_INFO_HEADER*); | ||
| 411 | /* *INDENT-ON* */ // clang-format on | ||
| 412 | |||
| 413 | SDL_SharedObject *shcoreDLL; | ||
| 414 | /* *INDENT-OFF* */ // clang-format off | ||
| 415 | HRESULT (WINAPI *GetDpiForMonitor)( HMONITOR hmonitor, | ||
| 416 | MONITOR_DPI_TYPE dpiType, | ||
| 417 | UINT *dpiX, | ||
| 418 | UINT *dpiY ); | ||
| 419 | HRESULT (WINAPI *SetProcessDpiAwareness)(PROCESS_DPI_AWARENESS dpiAwareness); | ||
| 420 | BOOL (WINAPI *GetPointerType)(UINT32 pointerId, POINTER_INPUT_TYPE *pointerType); | ||
| 421 | BOOL (WINAPI *GetPointerPenInfo)(UINT32 pointerId, POINTER_PEN_INFO *penInfo); | ||
| 422 | |||
| 423 | /* *INDENT-ON* */ // clang-format on | ||
| 424 | #endif // !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) | ||
| 425 | |||
| 426 | #ifdef HAVE_DXGI_H | ||
| 427 | SDL_SharedObject *dxgiDLL; | ||
| 428 | IDXGIFactory *pDXGIFactory; | ||
| 429 | #endif | ||
| 430 | |||
| 431 | bool cleared; | ||
| 432 | |||
| 433 | BYTE *rawinput; | ||
| 434 | UINT rawinput_offset; | ||
| 435 | UINT rawinput_size; | ||
| 436 | UINT rawinput_count; | ||
| 437 | Uint64 last_rawinput_poll; | ||
| 438 | SDL_Point last_raw_mouse_position; | ||
| 439 | bool raw_mouse_enabled; | ||
| 440 | bool raw_keyboard_enabled; | ||
| 441 | bool pending_E1_key_sequence; | ||
| 442 | Uint32 raw_input_enabled; | ||
| 443 | |||
| 444 | WIN_GameInputData *gameinput_context; | ||
| 445 | |||
| 446 | #ifndef SDL_DISABLE_WINDOWS_IME | ||
| 447 | bool ime_initialized; | ||
| 448 | bool ime_enabled; | ||
| 449 | bool ime_available; | ||
| 450 | bool ime_internal_composition; | ||
| 451 | bool ime_internal_candidates; | ||
| 452 | HWND ime_hwnd_main; | ||
| 453 | HWND ime_hwnd_current; | ||
| 454 | bool ime_needs_clear_composition; | ||
| 455 | HIMC ime_himc; | ||
| 456 | |||
| 457 | WCHAR *ime_composition; | ||
| 458 | int ime_composition_length; | ||
| 459 | WCHAR ime_readingstring[16]; | ||
| 460 | int ime_cursor; | ||
| 461 | int ime_selected_start; | ||
| 462 | int ime_selected_length; | ||
| 463 | |||
| 464 | bool ime_candidates_open; | ||
| 465 | bool ime_update_candidates; | ||
| 466 | char *ime_candidates[MAX_CANDLIST]; | ||
| 467 | int ime_candcount; | ||
| 468 | DWORD ime_candref; | ||
| 469 | DWORD ime_candsel; | ||
| 470 | int ime_candlistindexbase; | ||
| 471 | bool ime_horizontal_candidates; | ||
| 472 | #endif | ||
| 473 | |||
| 474 | #if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) | ||
| 475 | COMPOSITIONFORM ime_composition_area; | ||
| 476 | CANDIDATEFORM ime_candidate_area; | ||
| 477 | #endif // !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) | ||
| 478 | |||
| 479 | #ifndef SDL_DISABLE_WINDOWS_IME | ||
| 480 | HKL ime_hkl; | ||
| 481 | SDL_SharedObject *ime_himm32; | ||
| 482 | /* *INDENT-OFF* */ // clang-format off | ||
| 483 | UINT (WINAPI *GetReadingString)(HIMC himc, UINT uReadingBufLen, LPWSTR lpwReadingBuf, PINT pnErrorIndex, BOOL *pfIsVertical, PUINT puMaxReadingLen); | ||
| 484 | BOOL (WINAPI *ShowReadingWindow)(HIMC himc, BOOL bShow); | ||
| 485 | LPINPUTCONTEXT2 (WINAPI *ImmLockIMC)(HIMC himc); | ||
| 486 | BOOL (WINAPI *ImmUnlockIMC)(HIMC himc); | ||
| 487 | LPVOID (WINAPI *ImmLockIMCC)(HIMCC himcc); | ||
| 488 | BOOL (WINAPI *ImmUnlockIMCC)(HIMCC himcc); | ||
| 489 | /* *INDENT-ON* */ // clang-format on | ||
| 490 | |||
| 491 | #endif // !SDL_DISABLE_WINDOWS_IME | ||
| 492 | |||
| 493 | BYTE pre_hook_key_state[256]; | ||
| 494 | UINT _SDL_WAKEUP; | ||
| 495 | }; | ||
| 496 | |||
| 497 | extern bool g_WindowsEnableMessageLoop; | ||
| 498 | extern bool g_WindowsEnableMenuMnemonics; | ||
| 499 | extern bool g_WindowFrameUsableWhileCursorHidden; | ||
| 500 | |||
| 501 | typedef struct IDirect3D9 IDirect3D9; | ||
| 502 | extern bool D3D_LoadDLL(void **pD3DDLL, IDirect3D9 **pDirect3D9Interface); | ||
| 503 | |||
| 504 | extern SDL_SystemTheme WIN_GetSystemTheme(void); | ||
| 505 | extern bool WIN_IsPerMonitorV2DPIAware(SDL_VideoDevice *_this); | ||
| 506 | |||
| 507 | #endif // SDL_windowsvideo_h_ | ||
