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