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.
dewyatt@4759
     1
/*
dewyatt@4759
     2
    SDL - Simple DirectMedia Layer
dewyatt@4759
     3
    Copyright (C) 1997-2010 Sam Lantinga
dewyatt@4759
     4
dewyatt@4759
     5
    This library is free software; you can redistribute it and/or
dewyatt@4759
     6
    modify it under the terms of the GNU Lesser General Public
dewyatt@4759
     7
    License as published by the Free Software Foundation; either
dewyatt@4759
     8
    version 2.1 of the License, or (at your option) any later version.
dewyatt@4759
     9
dewyatt@4759
    10
    This library is distributed in the hope that it will be useful,
dewyatt@4759
    11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
dewyatt@4759
    12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
dewyatt@4759
    13
    Lesser General Public License for more details.
dewyatt@4759
    14
dewyatt@4759
    15
    You should have received a copy of the GNU Lesser General Public
dewyatt@4759
    16
    License along with this library; if not, write to the Free Software
dewyatt@4759
    17
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
dewyatt@4759
    18
dewyatt@4759
    19
    Sam Lantinga
dewyatt@4759
    20
    slouken@libsdl.org
dewyatt@4759
    21
*/
dewyatt@4759
    22
#include "SDL_config.h"
dewyatt@4759
    23
slouken@5062
    24
#ifndef _SDL_windowsvideo_h
slouken@5062
    25
#define _SDL_windowsvideo_h
dewyatt@4759
    26
dewyatt@4759
    27
#include "../SDL_sysvideo.h"
dewyatt@4759
    28
slouken@5090
    29
#include "../../core/windows/SDL_windows.h"
dewyatt@4759
    30
slouken@5086
    31
#if defined(_MSC_VER) && !defined(_WIN32_WCE)
dewyatt@4759
    32
#include <msctf.h>
Daniel@4893
    33
#else
Daniel@4893
    34
#include "SDL_msctf.h"
Daniel@4893
    35
#endif
Daniel@4893
    36
Daniel@4892
    37
#include <imm.h>
dewyatt@4759
    38
Daniel@4912
    39
#define MAX_CANDLIST    10
Daniel@4912
    40
#define MAX_CANDLENGTH  256
Daniel@4912
    41
slouken@5062
    42
#include "SDL_windowsclipboard.h"
slouken@5062
    43
#include "SDL_windowsevents.h"
slouken@5062
    44
#include "SDL_windowsgamma.h"
slouken@5062
    45
#include "SDL_windowskeyboard.h"
slouken@5062
    46
#include "SDL_windowsmodes.h"
slouken@5062
    47
#include "SDL_windowsmouse.h"
slouken@5062
    48
#include "SDL_windowsopengl.h"
slouken@5062
    49
#include "SDL_windowswindow.h"
dewyatt@4759
    50
#include "SDL_events.h"
slouken@5090
    51
#include "SDL_loadso.h"
dewyatt@4759
    52
dewyatt@4759
    53
slouken@4919
    54
#if WINVER < 0x0601
slouken@4919
    55
/* Touch input definitions */
slouken@4919
    56
#define TWF_FINETOUCH	1
slouken@4919
    57
#define TWF_WANTPALM	2
slouken@4919
    58
slouken@4919
    59
#define TOUCHEVENTF_MOVE 0x0001
slouken@4919
    60
#define TOUCHEVENTF_DOWN 0x0002
slouken@4919
    61
#define TOUCHEVENTF_UP   0x0004
slouken@4919
    62
slouken@4919
    63
DECLARE_HANDLE(HTOUCHINPUT);
slouken@4919
    64
slouken@5038
    65
typedef struct _TOUCHINPUT {
slouken@5038
    66
	LONG      x;
slouken@5038
    67
	LONG      y;
slouken@5038
    68
	HANDLE    hSource;
slouken@5038
    69
	DWORD     dwID;
slouken@5038
    70
	DWORD     dwFlags;
slouken@5038
    71
	DWORD     dwMask;
slouken@5038
    72
	DWORD     dwTime;
slouken@5038
    73
	ULONG_PTR dwExtraInfo;
slouken@5038
    74
	DWORD     cxContact;
slouken@5038
    75
	DWORD     cyContact;
slouken@4919
    76
} TOUCHINPUT, *PTOUCHINPUT;
slouken@4919
    77
slouken@4919
    78
#endif /* WINVER < 0x0601 */
slouken@4919
    79
slouken@4569
    80
typedef BOOL  (*PFNSHFullScreen)(HWND, DWORD);
slouken@4569
    81
typedef void  (*PFCoordTransform)(SDL_Window*, POINT*);
slouken@4569
    82
dewyatt@4759
    83
typedef struct  
dewyatt@4759
    84
{
dewyatt@4759
    85
    void **lpVtbl;
dewyatt@4759
    86
    int refcount;
dewyatt@4759
    87
    void *data;
dewyatt@4759
    88
} TSFSink;
dewyatt@4759
    89
Daniel@4892
    90
/* Definition from Win98DDK version of IMM.H */
dewyatt@4759
    91
typedef struct tagINPUTCONTEXT2 {
Daniel@4912
    92
    HWND hWnd;
Daniel@4912
    93
    BOOL fOpen;
Daniel@4912
    94
    POINT ptStatusWndPos;
Daniel@4912
    95
    POINT ptSoftKbdPos;
Daniel@4912
    96
    DWORD fdwConversion;
Daniel@4912
    97
    DWORD fdwSentence;
Daniel@4912
    98
    union {
Daniel@4912
    99
        LOGFONTA A;
Daniel@4912
   100
        LOGFONTW W;
Daniel@4892
   101
    } lfFont;
Daniel@4912
   102
    COMPOSITIONFORM cfCompForm;
Daniel@4912
   103
    CANDIDATEFORM cfCandForm[4];
Daniel@4912
   104
    HIMCC hCompStr;
Daniel@4912
   105
    HIMCC hCandInfo;
Daniel@4912
   106
    HIMCC hGuideLine;
Daniel@4912
   107
    HIMCC hPrivate;
Daniel@4912
   108
    DWORD dwNumMsgBuf;
Daniel@4912
   109
    HIMCC hMsgBuf;
Daniel@4912
   110
    DWORD fdwInit;
Daniel@4912
   111
    DWORD dwReserve[3];
Daniel@4892
   112
} INPUTCONTEXT2, *PINPUTCONTEXT2, NEAR *NPINPUTCONTEXT2, FAR *LPINPUTCONTEXT2;
dewyatt@4759
   113
dewyatt@4759
   114
/* Private display data */
dewyatt@4759
   115
dewyatt@4759
   116
typedef struct SDL_VideoData
dewyatt@4759
   117
{
slouken@4569
   118
    int render;
slouken@4569
   119
slouken@4569
   120
#ifdef _WIN32_WCE
slouken@5090
   121
    void* hAygShell;
slouken@4569
   122
    PFNSHFullScreen SHFullScreen;
slouken@4569
   123
    PFCoordTransform CoordTransform;
slouken@4569
   124
#endif
dewyatt@4759
   125
slouken@5218
   126
    const SDL_Scancode *key_layout;
slouken@4919
   127
	DWORD clipboard_count;
slouken@4919
   128
slouken@4919
   129
	/* Touch input functions */
slouken@5090
   130
	void* userDLL;
slouken@4919
   131
	BOOL (WINAPI *CloseTouchInputHandle)( HTOUCHINPUT );
slouken@4919
   132
	BOOL (WINAPI *GetTouchInputInfo)( HTOUCHINPUT, UINT, PTOUCHINPUT, int );
slouken@5038
   133
	BOOL (WINAPI *RegisterTouchWindow)( HWND, ULONG );
dewyatt@4759
   134
dewyatt@4759
   135
    SDL_bool ime_com_initialized;
dewyatt@4759
   136
    struct ITfThreadMgr *ime_threadmgr;
dewyatt@4759
   137
    SDL_bool ime_initialized;
dewyatt@4759
   138
    SDL_bool ime_enabled;
dewyatt@4759
   139
    SDL_bool ime_available;
dewyatt@4759
   140
    HWND ime_hwnd_main;
dewyatt@4759
   141
    HWND ime_hwnd_current;
dewyatt@4759
   142
    HIMC ime_himc;
dewyatt@4759
   143
dewyatt@4759
   144
    WCHAR ime_composition[SDL_TEXTEDITINGEVENT_TEXT_SIZE];
dewyatt@4759
   145
    WCHAR ime_readingstring[16];
dewyatt@4759
   146
    int ime_cursor;
dewyatt@4759
   147
Daniel@4912
   148
    SDL_bool ime_candlist;
Daniel@4912
   149
    WCHAR ime_candidates[MAX_CANDLIST][MAX_CANDLENGTH];
Daniel@4912
   150
    DWORD ime_candcount;
Daniel@4912
   151
    DWORD ime_candref;
Daniel@4912
   152
    DWORD ime_candsel;
Daniel@4912
   153
    UINT ime_candpgsize;
Daniel@4912
   154
    int ime_candlistindexbase;
Daniel@4912
   155
    SDL_bool ime_candvertical;
Daniel@4912
   156
Daniel@4912
   157
    SDL_bool ime_dirty;
Daniel@4912
   158
    SDL_Rect ime_rect;
Daniel@4912
   159
    SDL_Rect ime_candlistrect;
Daniel@4912
   160
    int ime_winwidth;
Daniel@4912
   161
    int ime_winheight;
Daniel@4912
   162
dewyatt@4759
   163
    HKL ime_hkl;
slouken@5090
   164
    void* ime_himm32;
dewyatt@4759
   165
    UINT (WINAPI *GetReadingString)(HIMC himc, UINT uReadingBufLen, LPWSTR lpwReadingBuf, PINT pnErrorIndex, BOOL *pfIsVertical, PUINT puMaxReadingLen);
dewyatt@4759
   166
    BOOL (WINAPI *ShowReadingWindow)(HIMC himc, BOOL bShow);
dewyatt@4759
   167
    LPINPUTCONTEXT2 (WINAPI *ImmLockIMC)(HIMC himc);
dewyatt@4759
   168
    BOOL (WINAPI *ImmUnlockIMC)(HIMC himc);
dewyatt@4759
   169
    LPVOID (WINAPI *ImmLockIMCC)(HIMCC himcc);
dewyatt@4759
   170
    BOOL (WINAPI *ImmUnlockIMCC)(HIMCC himcc);
dewyatt@4759
   171
dewyatt@4759
   172
    SDL_bool ime_uiless;
dewyatt@4759
   173
    struct ITfThreadMgrEx *ime_threadmgrex;
dewyatt@4759
   174
    DWORD ime_uielemsinkcookie;
dewyatt@4759
   175
    DWORD ime_alpnsinkcookie;
dewyatt@4759
   176
    DWORD ime_openmodesinkcookie;
dewyatt@4759
   177
    DWORD ime_convmodesinkcookie;
dewyatt@4759
   178
    TSFSink *ime_uielemsink;
dewyatt@4759
   179
    TSFSink *ime_ippasink;
dewyatt@4759
   180
} SDL_VideoData;
dewyatt@4759
   181
slouken@5062
   182
#endif /* _SDL_windowsvideo_h */
dewyatt@4759
   183
dewyatt@4759
   184
/* vi: set ts=4 sw=4 expandtab: */