SDL  2.0
SDL_windowsvideo.h
Go to the documentation of this file.
1 /*
2  Simple DirectMedia Layer
3  Copyright (C) 1997-2018 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,
141  UINT *dpiX,
142  UINT *dpiY );
143 
151  HIMC ime_himc;
152 
153  WCHAR ime_composition[SDL_TEXTEDITINGEVENT_TEXT_SIZE];
154  WCHAR ime_readingstring[16];
156 
158  WCHAR ime_candidates[MAX_CANDLIST][MAX_CANDLENGTH];
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: */
void * data
struct IDirect3D9 IDirect3D9
#define MAX_CANDLIST
SDL_bool g_WindowFrameUsableWhileCursorHidden
TSFSink * ime_uielemsink
MONITOR_DPI_TYPE
void ** lpVtbl
BOOL(* PFNSHFullScreen)(HWND, DWORD)
DWORD ime_openmodesinkcookie
SDL_bool g_WindowsEnableMessageLoop
#define MAX_CANDLENGTH
SDL_bool ime_candlist
DWORD ime_uielemsinkcookie
#define FAR
Definition: SDL_directx.h:37
SDL_bool ime_initialized
COMPOSITIONFORM cfCompForm
DECLARE_HANDLE(HTOUCHINPUT)
ULONG_PTR dwExtraInfo
TSFSink * ime_ippasink
SDL_bool ime_enabled
DWORD ime_convmodesinkcookie
SDL_bool ime_available
SDL_bool ime_com_initialized
SDL_bool D3D_LoadDLL(void **pD3DDLL, IDirect3D9 **pDirect3D9Interface)
SDL_bool
Definition: SDL_stdinc.h:139
SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char const char SDL_SCANF_FORMAT_STRING const char return SDL_ThreadFunction const char void return Uint32 return Uint32 void
The type used to identify a window.
Definition: SDL_sysvideo.h:73
SDL_bool ime_candvertical
void(* PFCoordTransform)(SDL_Window *, POINT *)
SDL_Rect ime_candlistrect
A rectangle, with the origin at the upper left.
Definition: SDL_rect.h:64
MONITOR_DPI_TYPE UINT UINT * dpiY
#define SDL_TEXTEDITINGEVENT_TEXT_SIZE
Definition: SDL_events.h:202
struct ITfThreadMgrEx * ime_threadmgrex
struct ITfThreadMgr * ime_threadmgr