Large commit with initial reading string support, TSF UILess code, etc.
2 SDL - Simple DirectMedia Layer
3 Copyright (C) 1997-2010 Sam Lantinga
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 #include "SDL_config.h"
24 #ifndef _SDL_win32video_h
25 #define _SDL_win32video_h
27 #include "../SDL_sysvideo.h"
29 #define WIN32_LEAN_AND_MEAN
33 #define WINVER 0x500 /* Need 0x410 for AlphaBlend() and 0x500 for EnumDisplayDevices() */
38 #if SDL_VIDEO_RENDER_D3D
40 #define D3D_DEBUG_INFO
44 #if SDL_VIDEO_RENDER_DDRAW
45 /* WIN32_LEAN_AND_MEAN was defined, so we have to include this by hand */
50 #include "SDL_win32clipboard.h"
51 #include "SDL_win32events.h"
52 #include "SDL_win32gamma.h"
53 #include "SDL_win32keyboard.h"
54 #include "SDL_win32modes.h"
55 #include "SDL_win32mouse.h"
56 #include "SDL_win32opengl.h"
57 #include "SDL_win32window.h"
58 #include "SDL_events.h"
61 #define WIN_StringToUTF8(S) SDL_iconv_string("UTF-8", "UCS-2", (char *)S, (SDL_wcslen(S)+1)*sizeof(WCHAR))
62 #define WIN_UTF8ToString(S) (WCHAR *)SDL_iconv_string("UCS-2", "UTF-8", (char *)S, SDL_strlen(S)+1)
64 #define WIN_StringToUTF8(S) SDL_iconv_string("UTF-8", "ASCII", (char *)S, (SDL_strlen(S)+1))
65 #define WIN_UTF8ToString(S) SDL_iconv_string("ASCII", "UTF-8", (char *)S, SDL_strlen(S)+1)
67 extern void WIN_SetError(const char *prefix);
76 // Definition from Win98DDK version of IMM.H
77 typedef struct tagINPUTCONTEXT2 {
88 COMPOSITIONFORM cfCompForm;
89 CANDIDATEFORM cfCandForm[4];
98 } INPUTCONTEXT2, *PINPUTCONTEXT2, NEAR *NPINPUTCONTEXT2, FAR *LPINPUTCONTEXT2;
100 /* Private display data */
102 typedef struct SDL_VideoData
104 #if SDL_VIDEO_RENDER_D3D
108 #if SDL_VIDEO_RENDER_DDRAW
113 const SDL_scancode *key_layout;
114 DWORD clipboard_count;
116 SDL_bool ime_com_initialized;
117 struct ITfThreadMgr *ime_threadmgr;
118 SDL_bool ime_initialized;
119 SDL_bool ime_enabled;
120 SDL_bool ime_available;
122 HWND ime_hwnd_current;
125 WCHAR ime_composition[SDL_TEXTEDITINGEVENT_TEXT_SIZE];
126 WCHAR ime_readingstring[16];
131 UINT (WINAPI *GetReadingString)(HIMC himc, UINT uReadingBufLen, LPWSTR lpwReadingBuf, PINT pnErrorIndex, BOOL *pfIsVertical, PUINT puMaxReadingLen);
132 BOOL (WINAPI *ShowReadingWindow)(HIMC himc, BOOL bShow);
133 LPINPUTCONTEXT2 (WINAPI *ImmLockIMC)(HIMC himc);
134 BOOL (WINAPI *ImmUnlockIMC)(HIMC himc);
135 LPVOID (WINAPI *ImmLockIMCC)(HIMCC himcc);
136 BOOL (WINAPI *ImmUnlockIMCC)(HIMCC himcc);
139 struct ITfThreadMgrEx *ime_threadmgrex;
140 DWORD ime_uielemsinkcookie;
141 DWORD ime_alpnsinkcookie;
142 DWORD ime_openmodesinkcookie;
143 DWORD ime_convmodesinkcookie;
144 TSFSink *ime_uielemsink;
145 TSFSink *ime_ippasink;
148 #endif /* _SDL_win32video_h */
150 /* vi: set ts=4 sw=4 expandtab: */