src/video/win32/SDL_win32video.h
changeset 4759 863ba7d1f029
parent 4755 436183eb30c8
child 4763 518d1679d2d0
     1.1 --- a/src/video/win32/SDL_win32video.h	Tue Aug 03 16:52:10 2010 -0400
     1.2 +++ b/src/video/win32/SDL_win32video.h	Tue Aug 03 16:57:49 2010 -0400
     1.3 @@ -1,95 +1,150 @@
     1.4 -/*
     1.5 -    SDL - Simple DirectMedia Layer
     1.6 -    Copyright (C) 1997-2010 Sam Lantinga
     1.7 -
     1.8 -    This library is free software; you can redistribute it and/or
     1.9 -    modify it under the terms of the GNU Lesser General Public
    1.10 -    License as published by the Free Software Foundation; either
    1.11 -    version 2.1 of the License, or (at your option) any later version.
    1.12 -
    1.13 -    This library is distributed in the hope that it will be useful,
    1.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    1.16 -    Lesser General Public License for more details.
    1.17 -
    1.18 -    You should have received a copy of the GNU Lesser General Public
    1.19 -    License along with this library; if not, write to the Free Software
    1.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    1.21 -
    1.22 -    Sam Lantinga
    1.23 -    slouken@libsdl.org
    1.24 -*/
    1.25 -#include "SDL_config.h"
    1.26 -
    1.27 -#ifndef _SDL_win32video_h
    1.28 -#define _SDL_win32video_h
    1.29 -
    1.30 -#include "../SDL_sysvideo.h"
    1.31 -
    1.32 -#define WIN32_LEAN_AND_MEAN
    1.33 -#define STRICT
    1.34 -#define UNICODE
    1.35 -#undef WINVER
    1.36 -#define WINVER  0x500           /* Need 0x410 for AlphaBlend() and 0x500 for EnumDisplayDevices() */
    1.37 -#include <windows.h>
    1.38 -
    1.39 -#if SDL_VIDEO_RENDER_D3D
    1.40 -//#include <d3d9.h>
    1.41 -#define D3D_DEBUG_INFO
    1.42 -#include "d3d9.h"
    1.43 -#endif
    1.44 -
    1.45 -#if SDL_VIDEO_RENDER_DDRAW
    1.46 -/* WIN32_LEAN_AND_MEAN was defined, so we have to include this by hand */
    1.47 -#include <objbase.h>
    1.48 -#include "ddraw.h"
    1.49 -#endif
    1.50 -
    1.51 -#include "SDL_win32clipboard.h"
    1.52 -#include "SDL_win32events.h"
    1.53 -#include "SDL_win32gamma.h"
    1.54 -#include "SDL_win32keyboard.h"
    1.55 -#include "SDL_win32modes.h"
    1.56 -#include "SDL_win32mouse.h"
    1.57 -#include "SDL_win32opengl.h"
    1.58 -#include "SDL_win32window.h"
    1.59 -
    1.60 -#ifdef UNICODE
    1.61 -#define WIN_StringToUTF8(S) SDL_iconv_string("UTF-8", "UCS-2", (char *)S, (SDL_wcslen(S)+1)*sizeof(WCHAR))
    1.62 -#define WIN_UTF8ToString(S) (WCHAR *)SDL_iconv_string("UCS-2", "UTF-8", (char *)S, SDL_strlen(S)+1)
    1.63 -#else
    1.64 -#define WIN_StringToUTF8(S) SDL_iconv_string("UTF-8", "ASCII", (char *)S, (SDL_strlen(S)+1))
    1.65 -#define WIN_UTF8ToString(S) SDL_iconv_string("ASCII", "UTF-8", (char *)S, SDL_strlen(S)+1)
    1.66 -#endif
    1.67 -extern void WIN_SetError(const char *prefix);
    1.68 -
    1.69 -/* Private display data */
    1.70 -
    1.71 -typedef struct SDL_VideoData
    1.72 -{
    1.73 -#if SDL_VIDEO_RENDER_D3D
    1.74 -    HANDLE d3dDLL;
    1.75 -    IDirect3D9 *d3d;
    1.76 -#endif
    1.77 -#if SDL_VIDEO_RENDER_DDRAW
    1.78 -    HANDLE ddrawDLL;
    1.79 -    IDirectDraw *ddraw;
    1.80 -#endif
    1.81 -
    1.82 -    const SDL_scancode *key_layout;
    1.83 -    DWORD clipboard_count;
    1.84 -
    1.85 -    SDL_bool ime_com_initialized;
    1.86 -    struct ITfThreadMgr *ime_thread_mgr;
    1.87 -    SDL_bool ime_initialized;
    1.88 -    SDL_bool ime_enabled;
    1.89 -    SDL_bool ime_available;
    1.90 -    HWND ime_hwnd_main;
    1.91 -    HWND ime_hwnd_current;
    1.92 -    HIMC ime_himc;
    1.93 -
    1.94 -} SDL_VideoData;
    1.95 -
    1.96 -#endif /* _SDL_win32video_h */
    1.97 -
    1.98 -/* vi: set ts=4 sw=4 expandtab: */
    1.99 +/*
   1.100 +    SDL - Simple DirectMedia Layer
   1.101 +    Copyright (C) 1997-2010 Sam Lantinga
   1.102 +
   1.103 +    This library is free software; you can redistribute it and/or
   1.104 +    modify it under the terms of the GNU Lesser General Public
   1.105 +    License as published by the Free Software Foundation; either
   1.106 +    version 2.1 of the License, or (at your option) any later version.
   1.107 +
   1.108 +    This library is distributed in the hope that it will be useful,
   1.109 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
   1.110 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   1.111 +    Lesser General Public License for more details.
   1.112 +
   1.113 +    You should have received a copy of the GNU Lesser General Public
   1.114 +    License along with this library; if not, write to the Free Software
   1.115 +    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
   1.116 +
   1.117 +    Sam Lantinga
   1.118 +    slouken@libsdl.org
   1.119 +*/
   1.120 +#include "SDL_config.h"
   1.121 +
   1.122 +#ifndef _SDL_win32video_h
   1.123 +#define _SDL_win32video_h
   1.124 +
   1.125 +#include "../SDL_sysvideo.h"
   1.126 +
   1.127 +#define WIN32_LEAN_AND_MEAN
   1.128 +#define STRICT
   1.129 +#define UNICODE
   1.130 +#undef WINVER
   1.131 +#define WINVER  0x500           /* Need 0x410 for AlphaBlend() and 0x500 for EnumDisplayDevices() */
   1.132 +#include <windows.h>
   1.133 +
   1.134 +#include <msctf.h>
   1.135 +
   1.136 +#if SDL_VIDEO_RENDER_D3D
   1.137 +//#include <d3d9.h>
   1.138 +#define D3D_DEBUG_INFO
   1.139 +#include "d3d9.h"
   1.140 +#endif
   1.141 +
   1.142 +#if SDL_VIDEO_RENDER_DDRAW
   1.143 +/* WIN32_LEAN_AND_MEAN was defined, so we have to include this by hand */
   1.144 +#include <objbase.h>
   1.145 +#include "ddraw.h"
   1.146 +#endif
   1.147 +
   1.148 +#include "SDL_win32clipboard.h"
   1.149 +#include "SDL_win32events.h"
   1.150 +#include "SDL_win32gamma.h"
   1.151 +#include "SDL_win32keyboard.h"
   1.152 +#include "SDL_win32modes.h"
   1.153 +#include "SDL_win32mouse.h"
   1.154 +#include "SDL_win32opengl.h"
   1.155 +#include "SDL_win32window.h"
   1.156 +#include "SDL_events.h"
   1.157 +
   1.158 +#ifdef UNICODE
   1.159 +#define WIN_StringToUTF8(S) SDL_iconv_string("UTF-8", "UCS-2", (char *)S, (SDL_wcslen(S)+1)*sizeof(WCHAR))
   1.160 +#define WIN_UTF8ToString(S) (WCHAR *)SDL_iconv_string("UCS-2", "UTF-8", (char *)S, SDL_strlen(S)+1)
   1.161 +#else
   1.162 +#define WIN_StringToUTF8(S) SDL_iconv_string("UTF-8", "ASCII", (char *)S, (SDL_strlen(S)+1))
   1.163 +#define WIN_UTF8ToString(S) SDL_iconv_string("ASCII", "UTF-8", (char *)S, SDL_strlen(S)+1)
   1.164 +#endif
   1.165 +extern void WIN_SetError(const char *prefix);
   1.166 +
   1.167 +typedef struct  
   1.168 +{
   1.169 +    void **lpVtbl;
   1.170 +    int refcount;
   1.171 +    void *data;
   1.172 +} TSFSink;
   1.173 +
   1.174 +// Definition from Win98DDK version of IMM.H
   1.175 +typedef struct tagINPUTCONTEXT2 {
   1.176 +    HWND                hWnd;                           
   1.177 +    BOOL                fOpen;                          
   1.178 +    POINT               ptStatusWndPos;                 
   1.179 +    POINT               ptSoftKbdPos;                   
   1.180 +    DWORD               fdwConversion;                  
   1.181 +    DWORD               fdwSentence;                    
   1.182 +    union   {                                           
   1.183 +        LOGFONTA        A;                              
   1.184 +        LOGFONTW        W;                              
   1.185 +    } lfFont;                                           
   1.186 +    COMPOSITIONFORM     cfCompForm;                     
   1.187 +    CANDIDATEFORM       cfCandForm[4];                  
   1.188 +    HIMCC               hCompStr;                       
   1.189 +    HIMCC               hCandInfo;                      
   1.190 +    HIMCC               hGuideLine;                     
   1.191 +    HIMCC               hPrivate;                       
   1.192 +    DWORD               dwNumMsgBuf;                    
   1.193 +    HIMCC               hMsgBuf;                        
   1.194 +    DWORD               fdwInit;                        
   1.195 +    DWORD               dwReserve[3];                   
   1.196 +} INPUTCONTEXT2, *PINPUTCONTEXT2, NEAR *NPINPUTCONTEXT2, FAR *LPINPUTCONTEXT2;  
   1.197 +
   1.198 +/* Private display data */
   1.199 +
   1.200 +typedef struct SDL_VideoData
   1.201 +{
   1.202 +#if SDL_VIDEO_RENDER_D3D
   1.203 +    HANDLE d3dDLL;
   1.204 +    IDirect3D9 *d3d;
   1.205 +#endif
   1.206 +#if SDL_VIDEO_RENDER_DDRAW
   1.207 +    HANDLE ddrawDLL;
   1.208 +    IDirectDraw *ddraw;
   1.209 +#endif
   1.210 +
   1.211 +    const SDL_scancode *key_layout;
   1.212 +    DWORD clipboard_count;
   1.213 +
   1.214 +    SDL_bool ime_com_initialized;
   1.215 +    struct ITfThreadMgr *ime_threadmgr;
   1.216 +    SDL_bool ime_initialized;
   1.217 +    SDL_bool ime_enabled;
   1.218 +    SDL_bool ime_available;
   1.219 +    HWND ime_hwnd_main;
   1.220 +    HWND ime_hwnd_current;
   1.221 +    HIMC ime_himc;
   1.222 +
   1.223 +    WCHAR ime_composition[SDL_TEXTEDITINGEVENT_TEXT_SIZE];
   1.224 +    WCHAR ime_readingstring[16];
   1.225 +    int ime_cursor;
   1.226 +
   1.227 +    HKL ime_hkl;
   1.228 +    HMODULE ime_himm32;
   1.229 +    UINT (WINAPI *GetReadingString)(HIMC himc, UINT uReadingBufLen, LPWSTR lpwReadingBuf, PINT pnErrorIndex, BOOL *pfIsVertical, PUINT puMaxReadingLen);
   1.230 +    BOOL (WINAPI *ShowReadingWindow)(HIMC himc, BOOL bShow);
   1.231 +    LPINPUTCONTEXT2 (WINAPI *ImmLockIMC)(HIMC himc);
   1.232 +    BOOL (WINAPI *ImmUnlockIMC)(HIMC himc);
   1.233 +    LPVOID (WINAPI *ImmLockIMCC)(HIMCC himcc);
   1.234 +    BOOL (WINAPI *ImmUnlockIMCC)(HIMCC himcc);
   1.235 +
   1.236 +    SDL_bool ime_uiless;
   1.237 +    struct ITfThreadMgrEx *ime_threadmgrex;
   1.238 +    DWORD ime_uielemsinkcookie;
   1.239 +    DWORD ime_alpnsinkcookie;
   1.240 +    DWORD ime_openmodesinkcookie;
   1.241 +    DWORD ime_convmodesinkcookie;
   1.242 +    TSFSink *ime_uielemsink;
   1.243 +    TSFSink *ime_ippasink;
   1.244 +} SDL_VideoData;
   1.245 +
   1.246 +#endif /* _SDL_win32video_h */
   1.247 +
   1.248 +/* vi: set ts=4 sw=4 expandtab: */