comparison src/video/windows/SDL_windowsvideo.h @ 5092:327f181542f1

Include windows.h in a single point in the source, so we can be consistent about the definition of UNICODE and have core utility functions for Windows that all modules can share. I think this also fixes the bug relating to non-latin characters in filenames, since UNICODE wasn't defined in SDL_rwops.c
author Sam Lantinga <slouken@libsdl.org>
date Mon, 24 Jan 2011 21:20:30 -0800
parents c2539ff054c8
children 57851a238c8f
comparison
equal deleted inserted replaced
5091:79bd1e289005 5092:327f181542f1
24 #ifndef _SDL_windowsvideo_h 24 #ifndef _SDL_windowsvideo_h
25 #define _SDL_windowsvideo_h 25 #define _SDL_windowsvideo_h
26 26
27 #include "../SDL_sysvideo.h" 27 #include "../SDL_sysvideo.h"
28 28
29 #define WIN32_LEAN_AND_MEAN 29 #include "../../core/windows/SDL_windows.h"
30 #define STRICT
31 #ifndef UNICODE
32 #define UNICODE
33 #endif
34 #undef WINVER
35 #define WINVER 0x500 /* Need 0x410 for AlphaBlend() and 0x500 for EnumDisplayDevices() */
36
37 #include <windows.h>
38 30
39 #if defined(_MSC_VER) && !defined(_WIN32_WCE) 31 #if defined(_MSC_VER) && !defined(_WIN32_WCE)
40 #include <msctf.h> 32 #include <msctf.h>
41 #else 33 #else
42 #include "SDL_msctf.h" 34 #include "SDL_msctf.h"
66 #include "SDL_windowsmodes.h" 58 #include "SDL_windowsmodes.h"
67 #include "SDL_windowsmouse.h" 59 #include "SDL_windowsmouse.h"
68 #include "SDL_windowsopengl.h" 60 #include "SDL_windowsopengl.h"
69 #include "SDL_windowswindow.h" 61 #include "SDL_windowswindow.h"
70 #include "SDL_events.h" 62 #include "SDL_events.h"
71 63 #include "SDL_loadso.h"
72 #ifdef UNICODE 64
73 #define WIN_StringToUTF8(S) SDL_iconv_string("UTF-8", "UCS-2", (char *)S, (SDL_wcslen(S)+1)*sizeof(WCHAR))
74 #define WIN_UTF8ToString(S) (WCHAR *)SDL_iconv_string("UCS-2", "UTF-8", (char *)S, SDL_strlen(S)+1)
75 #else
76 #define WIN_StringToUTF8(S) SDL_iconv_string("UTF-8", "ASCII", (char *)S, (SDL_strlen(S)+1))
77 #define WIN_UTF8ToString(S) SDL_iconv_string("ASCII", "UTF-8", (char *)S, SDL_strlen(S)+1)
78 #endif
79 extern void WIN_SetError(const char *prefix);
80 65
81 enum { RENDER_NONE, RENDER_D3D, RENDER_DDRAW, RENDER_GDI, RENDER_GAPI, RENDER_RAW }; 66 enum { RENDER_NONE, RENDER_D3D, RENDER_DDRAW, RENDER_GDI, RENDER_GAPI, RENDER_RAW };
82 67
83 #if WINVER < 0x0601 68 #if WINVER < 0x0601
84 /* Touch input definitions */ 69 /* Touch input definitions */
145 typedef struct SDL_VideoData 130 typedef struct SDL_VideoData
146 { 131 {
147 int render; 132 int render;
148 133
149 #if SDL_VIDEO_RENDER_D3D 134 #if SDL_VIDEO_RENDER_D3D
150 HANDLE d3dDLL; 135 void* d3dDLL;
151 IDirect3D9 *d3d; 136 IDirect3D9 *d3d;
152 #endif 137 #endif
153 #if SDL_VIDEO_RENDER_DDRAW 138 #if SDL_VIDEO_RENDER_DDRAW
154 HANDLE ddrawDLL; 139 void* ddrawDLL;
155 IDirectDraw *ddraw; 140 IDirectDraw *ddraw;
156 #endif 141 #endif
157 #ifdef _WIN32_WCE 142 #ifdef _WIN32_WCE
158 HMODULE hAygShell; 143 void* hAygShell;
159 PFNSHFullScreen SHFullScreen; 144 PFNSHFullScreen SHFullScreen;
160 PFCoordTransform CoordTransform; 145 PFCoordTransform CoordTransform;
161 #endif 146 #endif
162 147
163 const SDL_ScanCode *key_layout; 148 const SDL_ScanCode *key_layout;
164 DWORD clipboard_count; 149 DWORD clipboard_count;
165 150
166 /* Touch input functions */ 151 /* Touch input functions */
167 HANDLE userDLL; 152 void* userDLL;
168 BOOL (WINAPI *CloseTouchInputHandle)( HTOUCHINPUT ); 153 BOOL (WINAPI *CloseTouchInputHandle)( HTOUCHINPUT );
169 BOOL (WINAPI *GetTouchInputInfo)( HTOUCHINPUT, UINT, PTOUCHINPUT, int ); 154 BOOL (WINAPI *GetTouchInputInfo)( HTOUCHINPUT, UINT, PTOUCHINPUT, int );
170 BOOL (WINAPI *RegisterTouchWindow)( HWND, ULONG ); 155 BOOL (WINAPI *RegisterTouchWindow)( HWND, ULONG );
171 156
172 SDL_bool ime_com_initialized; 157 SDL_bool ime_com_initialized;
197 SDL_Rect ime_candlistrect; 182 SDL_Rect ime_candlistrect;
198 int ime_winwidth; 183 int ime_winwidth;
199 int ime_winheight; 184 int ime_winheight;
200 185
201 HKL ime_hkl; 186 HKL ime_hkl;
202 HMODULE ime_himm32; 187 void* ime_himm32;
203 UINT (WINAPI *GetReadingString)(HIMC himc, UINT uReadingBufLen, LPWSTR lpwReadingBuf, PINT pnErrorIndex, BOOL *pfIsVertical, PUINT puMaxReadingLen); 188 UINT (WINAPI *GetReadingString)(HIMC himc, UINT uReadingBufLen, LPWSTR lpwReadingBuf, PINT pnErrorIndex, BOOL *pfIsVertical, PUINT puMaxReadingLen);
204 BOOL (WINAPI *ShowReadingWindow)(HIMC himc, BOOL bShow); 189 BOOL (WINAPI *ShowReadingWindow)(HIMC himc, BOOL bShow);
205 LPINPUTCONTEXT2 (WINAPI *ImmLockIMC)(HIMC himc); 190 LPINPUTCONTEXT2 (WINAPI *ImmLockIMC)(HIMC himc);
206 BOOL (WINAPI *ImmUnlockIMC)(HIMC himc); 191 BOOL (WINAPI *ImmUnlockIMC)(HIMC himc);
207 LPVOID (WINAPI *ImmLockIMCC)(HIMCC himcc); 192 LPVOID (WINAPI *ImmLockIMCC)(HIMCC himcc);