src/video/windows/SDL_windowsvideo.h
author Sam Lantinga
Tue, 08 Feb 2011 16:50:51 -0800
changeset 5229 c015d3e63631
parent 5218 572a73d71b5f
child 5243 3a8a452b49f0
permissions -rw-r--r--
Fixed setting the texture unit, still doesn't work.
     1 /*
     2     SDL - Simple DirectMedia Layer
     3     Copyright (C) 1997-2010 Sam Lantinga
     4 
     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.
     9 
    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.
    14 
    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
    18 
    19     Sam Lantinga
    20     slouken@libsdl.org
    21 */
    22 #include "SDL_config.h"
    23 
    24 #ifndef _SDL_windowsvideo_h
    25 #define _SDL_windowsvideo_h
    26 
    27 #include "../SDL_sysvideo.h"
    28 
    29 #include "../../core/windows/SDL_windows.h"
    30 
    31 #if defined(_MSC_VER) && !defined(_WIN32_WCE)
    32 #include <msctf.h>
    33 #else
    34 #include "SDL_msctf.h"
    35 #endif
    36 
    37 #include <imm.h>
    38 
    39 #define MAX_CANDLIST    10
    40 #define MAX_CANDLENGTH  256
    41 
    42 #include "SDL_windowsclipboard.h"
    43 #include "SDL_windowsevents.h"
    44 #include "SDL_windowsgamma.h"
    45 #include "SDL_windowskeyboard.h"
    46 #include "SDL_windowsmodes.h"
    47 #include "SDL_windowsmouse.h"
    48 #include "SDL_windowsopengl.h"
    49 #include "SDL_windowswindow.h"
    50 #include "SDL_events.h"
    51 #include "SDL_loadso.h"
    52 
    53 
    54 #if WINVER < 0x0601
    55 /* Touch input definitions */
    56 #define TWF_FINETOUCH	1
    57 #define TWF_WANTPALM	2
    58 
    59 #define TOUCHEVENTF_MOVE 0x0001
    60 #define TOUCHEVENTF_DOWN 0x0002
    61 #define TOUCHEVENTF_UP   0x0004
    62 
    63 DECLARE_HANDLE(HTOUCHINPUT);
    64 
    65 typedef struct _TOUCHINPUT {
    66 	LONG      x;
    67 	LONG      y;
    68 	HANDLE    hSource;
    69 	DWORD     dwID;
    70 	DWORD     dwFlags;
    71 	DWORD     dwMask;
    72 	DWORD     dwTime;
    73 	ULONG_PTR dwExtraInfo;
    74 	DWORD     cxContact;
    75 	DWORD     cyContact;
    76 } TOUCHINPUT, *PTOUCHINPUT;
    77 
    78 #endif /* WINVER < 0x0601 */
    79 
    80 typedef BOOL  (*PFNSHFullScreen)(HWND, DWORD);
    81 typedef void  (*PFCoordTransform)(SDL_Window*, POINT*);
    82 
    83 typedef struct  
    84 {
    85     void **lpVtbl;
    86     int refcount;
    87     void *data;
    88 } TSFSink;
    89 
    90 /* Definition from Win98DDK version of IMM.H */
    91 typedef struct tagINPUTCONTEXT2 {
    92     HWND hWnd;
    93     BOOL fOpen;
    94     POINT ptStatusWndPos;
    95     POINT ptSoftKbdPos;
    96     DWORD fdwConversion;
    97     DWORD fdwSentence;
    98     union {
    99         LOGFONTA A;
   100         LOGFONTW W;
   101     } lfFont;
   102     COMPOSITIONFORM cfCompForm;
   103     CANDIDATEFORM cfCandForm[4];
   104     HIMCC hCompStr;
   105     HIMCC hCandInfo;
   106     HIMCC hGuideLine;
   107     HIMCC hPrivate;
   108     DWORD dwNumMsgBuf;
   109     HIMCC hMsgBuf;
   110     DWORD fdwInit;
   111     DWORD dwReserve[3];
   112 } INPUTCONTEXT2, *PINPUTCONTEXT2, NEAR *NPINPUTCONTEXT2, FAR *LPINPUTCONTEXT2;
   113 
   114 /* Private display data */
   115 
   116 typedef struct SDL_VideoData
   117 {
   118     int render;
   119 
   120 #ifdef _WIN32_WCE
   121     void* hAygShell;
   122     PFNSHFullScreen SHFullScreen;
   123     PFCoordTransform CoordTransform;
   124 #endif
   125 
   126     const SDL_Scancode *key_layout;
   127 	DWORD clipboard_count;
   128 
   129 	/* Touch input functions */
   130 	void* userDLL;
   131 	BOOL (WINAPI *CloseTouchInputHandle)( HTOUCHINPUT );
   132 	BOOL (WINAPI *GetTouchInputInfo)( HTOUCHINPUT, UINT, PTOUCHINPUT, int );
   133 	BOOL (WINAPI *RegisterTouchWindow)( HWND, ULONG );
   134 
   135     SDL_bool ime_com_initialized;
   136     struct ITfThreadMgr *ime_threadmgr;
   137     SDL_bool ime_initialized;
   138     SDL_bool ime_enabled;
   139     SDL_bool ime_available;
   140     HWND ime_hwnd_main;
   141     HWND ime_hwnd_current;
   142     HIMC ime_himc;
   143 
   144     WCHAR ime_composition[SDL_TEXTEDITINGEVENT_TEXT_SIZE];
   145     WCHAR ime_readingstring[16];
   146     int ime_cursor;
   147 
   148     SDL_bool ime_candlist;
   149     WCHAR ime_candidates[MAX_CANDLIST][MAX_CANDLENGTH];
   150     DWORD ime_candcount;
   151     DWORD ime_candref;
   152     DWORD ime_candsel;
   153     UINT ime_candpgsize;
   154     int ime_candlistindexbase;
   155     SDL_bool ime_candvertical;
   156 
   157     SDL_bool ime_dirty;
   158     SDL_Rect ime_rect;
   159     SDL_Rect ime_candlistrect;
   160     int ime_winwidth;
   161     int ime_winheight;
   162 
   163     HKL ime_hkl;
   164     void* ime_himm32;
   165     UINT (WINAPI *GetReadingString)(HIMC himc, UINT uReadingBufLen, LPWSTR lpwReadingBuf, PINT pnErrorIndex, BOOL *pfIsVertical, PUINT puMaxReadingLen);
   166     BOOL (WINAPI *ShowReadingWindow)(HIMC himc, BOOL bShow);
   167     LPINPUTCONTEXT2 (WINAPI *ImmLockIMC)(HIMC himc);
   168     BOOL (WINAPI *ImmUnlockIMC)(HIMC himc);
   169     LPVOID (WINAPI *ImmLockIMCC)(HIMCC himcc);
   170     BOOL (WINAPI *ImmUnlockIMCC)(HIMCC himcc);
   171 
   172     SDL_bool ime_uiless;
   173     struct ITfThreadMgrEx *ime_threadmgrex;
   174     DWORD ime_uielemsinkcookie;
   175     DWORD ime_alpnsinkcookie;
   176     DWORD ime_openmodesinkcookie;
   177     DWORD ime_convmodesinkcookie;
   178     TSFSink *ime_uielemsink;
   179     TSFSink *ime_ippasink;
   180 } SDL_VideoData;
   181 
   182 #endif /* _SDL_windowsvideo_h */
   183 
   184 /* vi: set ts=4 sw=4 expandtab: */