SDL  2.0
SDL_windowsvideo.h
Go to the documentation of this file.
1 /*
2  Simple DirectMedia Layer
3  Copyright (C) 1997-2019 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 #if defined(_MSC_VER) && (_MSC_VER >= 1500)
31 #include <msctf.h>
32 #else
33 #include "SDL_msctf.h"
34 #endif
35 
36 #include <imm.h>
37 
38 #define MAX_CANDLIST 10
39 #define MAX_CANDLENGTH 256
40 
41 #include "SDL_windowsclipboard.h"
42 #include "SDL_windowsevents.h"
43 #include "SDL_windowskeyboard.h"
44 #include "SDL_windowsmodes.h"
45 #include "SDL_windowsmouse.h"
46 #include "SDL_windowsopengl.h"
47 #include "SDL_windowsopengles.h"
48 #include "SDL_windowswindow.h"
49 #include "SDL_events.h"
50 #include "SDL_loadso.h"
51 
52 
53 #if WINVER < 0x0601
54 /* Touch input definitions */
55 #define TWF_FINETOUCH 1
56 #define TWF_WANTPALM 2
57 
58 #define TOUCHEVENTF_MOVE 0x0001
59 #define TOUCHEVENTF_DOWN 0x0002
60 #define TOUCHEVENTF_UP 0x0004
61 
62 DECLARE_HANDLE(HTOUCHINPUT);
63 
64 typedef struct _TOUCHINPUT {
65  LONG x;
66  LONG y;
67  HANDLE hSource;
68  DWORD dwID;
69  DWORD dwFlags;
70  DWORD dwMask;
71  DWORD dwTime;
72  ULONG_PTR dwExtraInfo;
73  DWORD cxContact;
74  DWORD cyContact;
75 } TOUCHINPUT, *PTOUCHINPUT;
76 
77 #endif /* WINVER < 0x0601 */
78 
79 #if WINVER < 0x0603
80 
81 typedef enum MONITOR_DPI_TYPE {
87 
88 #endif /* WINVER < 0x0603 */
89 
90 typedef BOOL (*PFNSHFullScreen)(HWND, DWORD);
91 typedef void (*PFCoordTransform)(SDL_Window*, POINT*);
92 
93 typedef struct
94 {
95  void **lpVtbl;
96  int refcount;
97  void *data;
98 } TSFSink;
99 
100 /* Definition from Win98DDK version of IMM.H */
101 typedef struct tagINPUTCONTEXT2 {
102  HWND hWnd;
103  BOOL fOpen;
107  DWORD fdwSentence;
108  union {
109  LOGFONTA A;
110  LOGFONTW W;
111  } lfFont;
112  COMPOSITIONFORM cfCompForm;
113  CANDIDATEFORM cfCandForm[4];
114  HIMCC hCompStr;
115  HIMCC hCandInfo;
116  HIMCC hGuideLine;
117  HIMCC hPrivate;
118  DWORD dwNumMsgBuf;
119  HIMCC hMsgBuf;
120  DWORD fdwInit;
121  DWORD dwReserve[3];
122 } INPUTCONTEXT2, *PINPUTCONTEXT2, NEAR *NPINPUTCONTEXT2, FAR *LPINPUTCONTEXT2;
123 
124 /* Private display data */
125 
126 typedef struct SDL_VideoData
127 {
128  int render;
129 
131 
132  /* Touch input functions */
133  void* userDLL;
134  BOOL (WINAPI *CloseTouchInputHandle)( HTOUCHINPUT );
135  BOOL (WINAPI *GetTouchInputInfo)( HTOUCHINPUT, UINT, PTOUCHINPUT, int );
136  BOOL (WINAPI *RegisterTouchWindow)( HWND, ULONG );
137 
138  void* shcoreDLL;
139  HRESULT (WINAPI *GetDpiForMonitor)( HMONITOR hmonitor,
142  UINT *dpiY );
143 
151  HIMC ime_himc;
152 
154  WCHAR ime_readingstring[16];
156 
160  DWORD ime_candref;
161  DWORD ime_candsel;
165 
171 
172  HKL ime_hkl;
173  void* ime_himm32;
174  UINT (WINAPI *GetReadingString)(HIMC himc, UINT uReadingBufLen, LPWSTR lpwReadingBuf, PINT pnErrorIndex, BOOL *pfIsVertical, PUINT puMaxReadingLen);
175  BOOL (WINAPI *ShowReadingWindow)(HIMC himc, BOOL bShow);
176  LPINPUTCONTEXT2 (WINAPI *ImmLockIMC)(HIMC himc);
177  BOOL (WINAPI *ImmUnlockIMC)(HIMC himc);
178  LPVOID (WINAPI *ImmLockIMCC)(HIMCC himcc);
179  BOOL (WINAPI *ImmUnlockIMCC)(HIMCC himcc);
180 
189 } SDL_VideoData;
190 
193 
194 typedef struct IDirect3D9 IDirect3D9;
195 extern SDL_bool D3D_LoadDLL( void **pD3DDLL, IDirect3D9 **pDirect3D9Interface );
196 
197 #endif /* SDL_windowsvideo_h_ */
198 
199 /* vi: set ts=4 sw=4 expandtab: */
SDL_VideoData::ime_threadmgr
struct ITfThreadMgr * ime_threadmgr
Definition: SDL_windowsvideo.h:145
SDL_events.h
SDL_windowsmouse.h
g_WindowsEnableMessageLoop
SDL_bool g_WindowsEnableMessageLoop
MDT_EFFECTIVE_DPI
@ MDT_EFFECTIVE_DPI
Definition: SDL_windowsvideo.h:82
SDL_VideoData::ime_convmodesinkcookie
DWORD ime_convmodesinkcookie
Definition: SDL_windowsvideo.h:186
IDirect3D9
struct IDirect3D9 IDirect3D9
Definition: SDL_windowsvideo.h:194
_TOUCHINPUT::hSource
HANDLE hSource
Definition: SDL_windowsvideo.h:67
ITfThreadMgrEx
Definition: SDL_msctf.h:97
MAX_CANDLIST
#define MAX_CANDLIST
Definition: SDL_windowsvideo.h:38
ITfThreadMgr
Definition: SDL_msctf.h:72
SDL_VideoData::uReadingBufLen
UINT uReadingBufLen
Definition: SDL_windowsvideo.h:174
SDL_windowsopengles.h
SDL_VideoData::userDLL
void * userDLL
Definition: SDL_windowsvideo.h:133
SDL_VideoData::PTOUCHINPUT
PTOUCHINPUT
Definition: SDL_windowsvideo.h:135
MDT_RAW_DPI
@ MDT_RAW_DPI
Definition: SDL_windowsvideo.h:84
MDT_DEFAULT
@ MDT_DEFAULT
Definition: SDL_windowsvideo.h:85
tagINPUTCONTEXT2::cfCandForm
CANDIDATEFORM cfCandForm[4]
Definition: SDL_windowsvideo.h:113
SDL_windowsopengl.h
_TOUCHINPUT
Definition: SDL_windowsvideo.h:64
tagINPUTCONTEXT2::fdwSentence
DWORD fdwSentence
Definition: SDL_windowsvideo.h:107
tagINPUTCONTEXT2::cfCompForm
COMPOSITIONFORM cfCompForm
Definition: SDL_windowsvideo.h:112
_TOUCHINPUT::dwFlags
DWORD dwFlags
Definition: SDL_windowsvideo.h:69
_TOUCHINPUT::y
LONG y
Definition: SDL_windowsvideo.h:66
FAR
#define FAR
Definition: SDL_directx.h:37
_TOUCHINPUT::dwExtraInfo
ULONG_PTR dwExtraInfo
Definition: SDL_windowsvideo.h:72
NPINPUTCONTEXT2
struct INPUTCONTEXT2 * NPINPUTCONTEXT2
SDL_VideoData::ime_alpnsinkcookie
DWORD ime_alpnsinkcookie
Definition: SDL_windowsvideo.h:184
SDL_VideoData::ime_rect
SDL_Rect ime_rect
Definition: SDL_windowsvideo.h:167
SDL_VideoData::BOOL
BOOL(WINAPI *CloseTouchInputHandle)(HTOUCHINPUT)
TSFSink::refcount
int refcount
Definition: SDL_windowsvideo.h:96
tagINPUTCONTEXT2
Definition: SDL_windowsvideo.h:101
SDL_VideoData::ime_com_initialized
SDL_bool ime_com_initialized
Definition: SDL_windowsvideo.h:144
SDL_VideoData::ime_candcount
DWORD ime_candcount
Definition: SDL_windowsvideo.h:159
SDL_VideoData::ime_threadmgrex
struct ITfThreadMgrEx * ime_threadmgrex
Definition: SDL_windowsvideo.h:182
MONITOR_DPI_TYPE
MONITOR_DPI_TYPE
Definition: SDL_windowsvideo.h:81
tagINPUTCONTEXT2::lfFont
union tagINPUTCONTEXT2::@273 lfFont
TSFSink::data
void * data
Definition: SDL_windowsvideo.h:97
SDL_VideoData::ime_candpgsize
UINT ime_candpgsize
Definition: SDL_windowsvideo.h:162
SDL_VideoData::ULONG
ULONG
Definition: SDL_windowsvideo.h:136
SDL_VideoData::shcoreDLL
void * shcoreDLL
Definition: SDL_windowsvideo.h:138
SDL_VideoData::dpiType
MONITOR_DPI_TYPE dpiType
Definition: SDL_windowsvideo.h:140
SDL_VideoData::ime_hwnd_main
HWND ime_hwnd_main
Definition: SDL_windowsvideo.h:149
SDL_VideoData::LPINPUTCONTEXT2
LPINPUTCONTEXT2(WINAPI *ImmLockIMC)(HIMC himc)
D3D_LoadDLL
SDL_bool D3D_LoadDLL(void **pD3DDLL, IDirect3D9 **pDirect3D9Interface)
SDL_VideoData::ime_enabled
SDL_bool ime_enabled
Definition: SDL_windowsvideo.h:147
SDL_VideoData::ime_composition
WCHAR ime_composition[SDL_TEXTEDITINGEVENT_TEXT_SIZE]
Definition: SDL_windowsvideo.h:153
SDL_Window
The type used to identify a window.
Definition: SDL_sysvideo.h:73
SDL_windowsevents.h
SDL_VideoData::ime_uiless
SDL_bool ime_uiless
Definition: SDL_windowsvideo.h:181
SDL_windowswindow.h
SDL_VideoData::ime_hkl
HKL ime_hkl
Definition: SDL_windowsvideo.h:172
_TOUCHINPUT::dwID
DWORD dwID
Definition: SDL_windowsvideo.h:68
SDL_windowskeyboard.h
tagINPUTCONTEXT2::W
LOGFONTW W
Definition: SDL_windowsvideo.h:110
SDL_VideoData::ime_ippasink
TSFSink * ime_ippasink
Definition: SDL_windowsvideo.h:188
tagINPUTCONTEXT2::fOpen
BOOL fOpen
Definition: SDL_windowsvideo.h:103
SDL_VideoData::pnErrorIndex
UINT LPWSTR PINT pnErrorIndex
Definition: SDL_windowsvideo.h:174
SDL_VideoData::ime_dirty
SDL_bool ime_dirty
Definition: SDL_windowsvideo.h:166
SDL_VideoData::ime_hwnd_current
HWND ime_hwnd_current
Definition: SDL_windowsvideo.h:150
PFNSHFullScreen
BOOL(* PFNSHFullScreen)(HWND, DWORD)
Definition: SDL_windowsvideo.h:90
SDL_windowsmodes.h
SDL_VideoData::ime_available
SDL_bool ime_available
Definition: SDL_windowsvideo.h:148
MAX_CANDLENGTH
#define MAX_CANDLENGTH
Definition: SDL_windowsvideo.h:39
SDL_VideoData::dpiY
MONITOR_DPI_TYPE UINT UINT * dpiY
Definition: SDL_windowsvideo.h:142
tagINPUTCONTEXT2::hCompStr
HIMCC hCompStr
Definition: SDL_windowsvideo.h:114
SDL_VideoData::ime_candidates
WCHAR ime_candidates[MAX_CANDLIST][MAX_CANDLENGTH]
Definition: SDL_windowsvideo.h:158
SDL_VideoData::int
int
Definition: SDL_windowsvideo.h:135
SDL_VideoData::dpiX
MONITOR_DPI_TYPE UINT * dpiX
Definition: SDL_windowsvideo.h:141
SDL_VideoData::ime_uielemsinkcookie
DWORD ime_uielemsinkcookie
Definition: SDL_windowsvideo.h:183
tagINPUTCONTEXT2::fdwConversion
DWORD fdwConversion
Definition: SDL_windowsvideo.h:106
tagINPUTCONTEXT2::ptStatusWndPos
POINT ptStatusWndPos
Definition: SDL_windowsvideo.h:104
SDL_TEXTEDITINGEVENT_TEXT_SIZE
#define SDL_TEXTEDITINGEVENT_TEXT_SIZE
Definition: SDL_events.h:223
SDL_VideoData::lpwReadingBuf
UINT LPWSTR lpwReadingBuf
Definition: SDL_windowsvideo.h:174
SDL_VideoData::ime_candsel
DWORD ime_candsel
Definition: SDL_windowsvideo.h:161
_TOUCHINPUT::x
LONG x
Definition: SDL_windowsvideo.h:65
SDL_VideoData::ime_himc
HIMC ime_himc
Definition: SDL_windowsvideo.h:151
TSFSink::lpVtbl
void ** lpVtbl
Definition: SDL_windowsvideo.h:95
LPINPUTCONTEXT2
struct INPUTCONTEXT2 * LPINPUTCONTEXT2
_TOUCHINPUT::dwTime
DWORD dwTime
Definition: SDL_windowsvideo.h:71
tagINPUTCONTEXT2::hPrivate
HIMCC hPrivate
Definition: SDL_windowsvideo.h:117
SDL_windowsclipboard.h
TSFSink
Definition: SDL_windowsvideo.h:93
SDL_VideoData::ime_candvertical
SDL_bool ime_candvertical
Definition: SDL_windowsvideo.h:164
tagINPUTCONTEXT2::hWnd
HWND hWnd
Definition: SDL_windowsvideo.h:102
SDL_VideoData::ime_readingstring
WCHAR ime_readingstring[16]
Definition: SDL_windowsvideo.h:154
tagINPUTCONTEXT2::ptSoftKbdPos
POINT ptSoftKbdPos
Definition: SDL_windowsvideo.h:105
SDL_VideoData::render
int render
Definition: SDL_windowsvideo.h:128
SDL_Rect
A rectangle, with the origin at the upper left (integer).
Definition: SDL_rect.h:77
SDL_VideoData::ime_candlistindexbase
int ime_candlistindexbase
Definition: SDL_windowsvideo.h:163
SDL_VideoData::pfIsVertical
UINT LPWSTR PINT BOOL * pfIsVertical
Definition: SDL_windowsvideo.h:174
SDL_VideoData::ime_candref
DWORD ime_candref
Definition: SDL_windowsvideo.h:160
_TOUCHINPUT::dwMask
DWORD dwMask
Definition: SDL_windowsvideo.h:70
_TOUCHINPUT::cxContact
DWORD cxContact
Definition: SDL_windowsvideo.h:73
SDL_VideoData::LPVOID
LPVOID(WINAPI *ImmLockIMCC)(HIMCC himcc)
SDL_VideoData::bShow
BOOL bShow
Definition: SDL_windowsvideo.h:175
SDL_VideoData::clipboard_count
DWORD clipboard_count
Definition: SDL_windowsvideo.h:130
tagINPUTCONTEXT2::dwReserve
DWORD dwReserve[3]
Definition: SDL_windowsvideo.h:121
tagINPUTCONTEXT2::A
LOGFONTA A
Definition: SDL_windowsvideo.h:109
SDL_VideoData::ime_openmodesinkcookie
DWORD ime_openmodesinkcookie
Definition: SDL_windowsvideo.h:185
tagINPUTCONTEXT2::hGuideLine
HIMCC hGuideLine
Definition: SDL_windowsvideo.h:116
PTOUCHINPUT
struct TOUCHINPUT * PTOUCHINPUT
PFCoordTransform
void(* PFCoordTransform)(SDL_Window *, POINT *)
Definition: SDL_windowsvideo.h:91
SDL_VideoData::ime_winwidth
int ime_winwidth
Definition: SDL_windowsvideo.h:169
SDL_VideoData::ime_himm32
void * ime_himm32
Definition: SDL_windowsvideo.h:173
DECLARE_HANDLE
DECLARE_HANDLE(HTOUCHINPUT)
SDL_VideoData::ime_candlistrect
SDL_Rect ime_candlistrect
Definition: SDL_windowsvideo.h:168
_TOUCHINPUT::cyContact
DWORD cyContact
Definition: SDL_windowsvideo.h:74
SDL_VideoData::ime_initialized
SDL_bool ime_initialized
Definition: SDL_windowsvideo.h:146
void
const SDL_PRINTF_FORMAT_STRING char int const SDL_PRINTF_FORMAT_STRING char int const SDL_PRINTF_FORMAT_STRING char int const SDL_PRINTF_FORMAT_STRING char const char const SDL_SCANF_FORMAT_STRING char return SDL_ThreadFunction const char void return Uint32 return Uint32 void
Definition: SDL_dynapi_procs.h:89
SDL_VideoData::HRESULT
HRESULT(WINAPI *GetDpiForMonitor)(HMONITOR hmonitor
tagINPUTCONTEXT2::hCandInfo
HIMCC hCandInfo
Definition: SDL_windowsvideo.h:115
SDL_VideoData::UINT
UINT
Definition: SDL_windowsvideo.h:135
SDL_loadso.h
tagINPUTCONTEXT2::dwNumMsgBuf
DWORD dwNumMsgBuf
Definition: SDL_windowsvideo.h:118
MDT_ANGULAR_DPI
@ MDT_ANGULAR_DPI
Definition: SDL_windowsvideo.h:83
SDL_VideoData::ime_uielemsink
TSFSink * ime_uielemsink
Definition: SDL_windowsvideo.h:187
SDL_VideoData::ime_winheight
int ime_winheight
Definition: SDL_windowsvideo.h:170
g_WindowFrameUsableWhileCursorHidden
SDL_bool g_WindowFrameUsableWhileCursorHidden
SDL_VideoData::ime_cursor
int ime_cursor
Definition: SDL_windowsvideo.h:155
tagINPUTCONTEXT2::hMsgBuf
HIMCC hMsgBuf
Definition: SDL_windowsvideo.h:119
SDL_msctf.h
SDL_VideoData::ime_candlist
SDL_bool ime_candlist
Definition: SDL_windowsvideo.h:157
SDL_VideoData
Definition: SDL_androidvideo.h:36
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:161
tagINPUTCONTEXT2::fdwInit
DWORD fdwInit
Definition: SDL_windowsvideo.h:120
PINPUTCONTEXT2
struct INPUTCONTEXT2 * PINPUTCONTEXT2
SDL_VideoData::puMaxReadingLen
UINT LPWSTR PINT BOOL PUINT puMaxReadingLen
Definition: SDL_windowsvideo.h:174