src/video/windows/SDL_windowsvideo.h
author Sam Lantinga <slouken@libsdl.org>
Sat, 31 Dec 2011 09:28:07 -0500
changeset 6138 4c64952a58fb
parent 5535 96594ac5fd1a
child 6430 48d519500f7e
permissions -rwxr-xr-x
Happy New Year!
dewyatt@4759
     1
/*
slouken@5535
     2
  Simple DirectMedia Layer
slouken@6138
     3
  Copyright (C) 1997-2012 Sam Lantinga <slouken@libsdl.org>
dewyatt@4759
     4
slouken@5535
     5
  This software is provided 'as-is', without any express or implied
slouken@5535
     6
  warranty.  In no event will the authors be held liable for any damages
slouken@5535
     7
  arising from the use of this software.
dewyatt@4759
     8
slouken@5535
     9
  Permission is granted to anyone to use this software for any purpose,
slouken@5535
    10
  including commercial applications, and to alter it and redistribute it
slouken@5535
    11
  freely, subject to the following restrictions:
dewyatt@4759
    12
slouken@5535
    13
  1. The origin of this software must not be misrepresented; you must not
slouken@5535
    14
     claim that you wrote the original software. If you use this software
slouken@5535
    15
     in a product, an acknowledgment in the product documentation would be
slouken@5535
    16
     appreciated but is not required.
slouken@5535
    17
  2. Altered source versions must be plainly marked as such, and must not be
slouken@5535
    18
     misrepresented as being the original software.
slouken@5535
    19
  3. This notice may not be removed or altered from any source distribution.
dewyatt@4759
    20
*/
dewyatt@4759
    21
#include "SDL_config.h"
dewyatt@4759
    22
slouken@5062
    23
#ifndef _SDL_windowsvideo_h
slouken@5062
    24
#define _SDL_windowsvideo_h
dewyatt@4759
    25
dewyatt@4759
    26
#include "../SDL_sysvideo.h"
dewyatt@4759
    27
slouken@5090
    28
#include "../../core/windows/SDL_windows.h"
dewyatt@4759
    29
slouken@5086
    30
#if defined(_MSC_VER) && !defined(_WIN32_WCE)
dewyatt@4759
    31
#include <msctf.h>
Daniel@4893
    32
#else
Daniel@4893
    33
#include "SDL_msctf.h"
Daniel@4893
    34
#endif
Daniel@4893
    35
Daniel@4892
    36
#include <imm.h>
dewyatt@4759
    37
Daniel@4912
    38
#define MAX_CANDLIST    10
Daniel@4912
    39
#define MAX_CANDLENGTH  256
Daniel@4912
    40
slouken@5062
    41
#include "SDL_windowsclipboard.h"
slouken@5062
    42
#include "SDL_windowsevents.h"
slouken@5062
    43
#include "SDL_windowskeyboard.h"
slouken@5062
    44
#include "SDL_windowsmodes.h"
slouken@5062
    45
#include "SDL_windowsmouse.h"
slouken@5062
    46
#include "SDL_windowsopengl.h"
slouken@5062
    47
#include "SDL_windowswindow.h"
dewyatt@4759
    48
#include "SDL_events.h"
slouken@5090
    49
#include "SDL_loadso.h"
dewyatt@4759
    50
dewyatt@4759
    51
slouken@4919
    52
#if WINVER < 0x0601
slouken@4919
    53
/* Touch input definitions */
slouken@4919
    54
#define TWF_FINETOUCH	1
slouken@4919
    55
#define TWF_WANTPALM	2
slouken@4919
    56
slouken@4919
    57
#define TOUCHEVENTF_MOVE 0x0001
slouken@4919
    58
#define TOUCHEVENTF_DOWN 0x0002
slouken@4919
    59
#define TOUCHEVENTF_UP   0x0004
slouken@4919
    60
slouken@4919
    61
DECLARE_HANDLE(HTOUCHINPUT);
slouken@4919
    62
slouken@5038
    63
typedef struct _TOUCHINPUT {
slouken@5038
    64
	LONG      x;
slouken@5038
    65
	LONG      y;
slouken@5038
    66
	HANDLE    hSource;
slouken@5038
    67
	DWORD     dwID;
slouken@5038
    68
	DWORD     dwFlags;
slouken@5038
    69
	DWORD     dwMask;
slouken@5038
    70
	DWORD     dwTime;
slouken@5038
    71
	ULONG_PTR dwExtraInfo;
slouken@5038
    72
	DWORD     cxContact;
slouken@5038
    73
	DWORD     cyContact;
slouken@4919
    74
} TOUCHINPUT, *PTOUCHINPUT;
slouken@4919
    75
slouken@4919
    76
#endif /* WINVER < 0x0601 */
slouken@4919
    77
slouken@4569
    78
typedef BOOL  (*PFNSHFullScreen)(HWND, DWORD);
slouken@4569
    79
typedef void  (*PFCoordTransform)(SDL_Window*, POINT*);
slouken@4569
    80
dewyatt@4759
    81
typedef struct  
dewyatt@4759
    82
{
dewyatt@4759
    83
    void **lpVtbl;
dewyatt@4759
    84
    int refcount;
dewyatt@4759
    85
    void *data;
dewyatt@4759
    86
} TSFSink;
dewyatt@4759
    87
Daniel@4892
    88
/* Definition from Win98DDK version of IMM.H */
dewyatt@4759
    89
typedef struct tagINPUTCONTEXT2 {
Daniel@4912
    90
    HWND hWnd;
Daniel@4912
    91
    BOOL fOpen;
Daniel@4912
    92
    POINT ptStatusWndPos;
Daniel@4912
    93
    POINT ptSoftKbdPos;
Daniel@4912
    94
    DWORD fdwConversion;
Daniel@4912
    95
    DWORD fdwSentence;
Daniel@4912
    96
    union {
Daniel@4912
    97
        LOGFONTA A;
Daniel@4912
    98
        LOGFONTW W;
Daniel@4892
    99
    } lfFont;
Daniel@4912
   100
    COMPOSITIONFORM cfCompForm;
Daniel@4912
   101
    CANDIDATEFORM cfCandForm[4];
Daniel@4912
   102
    HIMCC hCompStr;
Daniel@4912
   103
    HIMCC hCandInfo;
Daniel@4912
   104
    HIMCC hGuideLine;
Daniel@4912
   105
    HIMCC hPrivate;
Daniel@4912
   106
    DWORD dwNumMsgBuf;
Daniel@4912
   107
    HIMCC hMsgBuf;
Daniel@4912
   108
    DWORD fdwInit;
Daniel@4912
   109
    DWORD dwReserve[3];
Daniel@4892
   110
} INPUTCONTEXT2, *PINPUTCONTEXT2, NEAR *NPINPUTCONTEXT2, FAR *LPINPUTCONTEXT2;
dewyatt@4759
   111
dewyatt@4759
   112
/* Private display data */
dewyatt@4759
   113
dewyatt@4759
   114
typedef struct SDL_VideoData
dewyatt@4759
   115
{
slouken@4569
   116
    int render;
slouken@4569
   117
slouken@4569
   118
#ifdef _WIN32_WCE
slouken@5090
   119
    void* hAygShell;
slouken@4569
   120
    PFNSHFullScreen SHFullScreen;
slouken@4569
   121
    PFCoordTransform CoordTransform;
slouken@4569
   122
#endif
dewyatt@4759
   123
slouken@5218
   124
    const SDL_Scancode *key_layout;
slouken@4919
   125
	DWORD clipboard_count;
slouken@4919
   126
slouken@4919
   127
	/* Touch input functions */
slouken@5090
   128
	void* userDLL;
slouken@4919
   129
	BOOL (WINAPI *CloseTouchInputHandle)( HTOUCHINPUT );
slouken@4919
   130
	BOOL (WINAPI *GetTouchInputInfo)( HTOUCHINPUT, UINT, PTOUCHINPUT, int );
slouken@5038
   131
	BOOL (WINAPI *RegisterTouchWindow)( HWND, ULONG );
dewyatt@4759
   132
dewyatt@4759
   133
    SDL_bool ime_com_initialized;
dewyatt@4759
   134
    struct ITfThreadMgr *ime_threadmgr;
dewyatt@4759
   135
    SDL_bool ime_initialized;
dewyatt@4759
   136
    SDL_bool ime_enabled;
dewyatt@4759
   137
    SDL_bool ime_available;
dewyatt@4759
   138
    HWND ime_hwnd_main;
dewyatt@4759
   139
    HWND ime_hwnd_current;
dewyatt@4759
   140
    HIMC ime_himc;
dewyatt@4759
   141
dewyatt@4759
   142
    WCHAR ime_composition[SDL_TEXTEDITINGEVENT_TEXT_SIZE];
dewyatt@4759
   143
    WCHAR ime_readingstring[16];
dewyatt@4759
   144
    int ime_cursor;
dewyatt@4759
   145
Daniel@4912
   146
    SDL_bool ime_candlist;
Daniel@4912
   147
    WCHAR ime_candidates[MAX_CANDLIST][MAX_CANDLENGTH];
Daniel@4912
   148
    DWORD ime_candcount;
Daniel@4912
   149
    DWORD ime_candref;
Daniel@4912
   150
    DWORD ime_candsel;
Daniel@4912
   151
    UINT ime_candpgsize;
Daniel@4912
   152
    int ime_candlistindexbase;
Daniel@4912
   153
    SDL_bool ime_candvertical;
Daniel@4912
   154
Daniel@4912
   155
    SDL_bool ime_dirty;
Daniel@4912
   156
    SDL_Rect ime_rect;
Daniel@4912
   157
    SDL_Rect ime_candlistrect;
Daniel@4912
   158
    int ime_winwidth;
Daniel@4912
   159
    int ime_winheight;
Daniel@4912
   160
dewyatt@4759
   161
    HKL ime_hkl;
slouken@5090
   162
    void* ime_himm32;
dewyatt@4759
   163
    UINT (WINAPI *GetReadingString)(HIMC himc, UINT uReadingBufLen, LPWSTR lpwReadingBuf, PINT pnErrorIndex, BOOL *pfIsVertical, PUINT puMaxReadingLen);
dewyatt@4759
   164
    BOOL (WINAPI *ShowReadingWindow)(HIMC himc, BOOL bShow);
dewyatt@4759
   165
    LPINPUTCONTEXT2 (WINAPI *ImmLockIMC)(HIMC himc);
dewyatt@4759
   166
    BOOL (WINAPI *ImmUnlockIMC)(HIMC himc);
dewyatt@4759
   167
    LPVOID (WINAPI *ImmLockIMCC)(HIMCC himcc);
dewyatt@4759
   168
    BOOL (WINAPI *ImmUnlockIMCC)(HIMCC himcc);
dewyatt@4759
   169
dewyatt@4759
   170
    SDL_bool ime_uiless;
dewyatt@4759
   171
    struct ITfThreadMgrEx *ime_threadmgrex;
dewyatt@4759
   172
    DWORD ime_uielemsinkcookie;
dewyatt@4759
   173
    DWORD ime_alpnsinkcookie;
dewyatt@4759
   174
    DWORD ime_openmodesinkcookie;
dewyatt@4759
   175
    DWORD ime_convmodesinkcookie;
dewyatt@4759
   176
    TSFSink *ime_uielemsink;
dewyatt@4759
   177
    TSFSink *ime_ippasink;
dewyatt@4759
   178
} SDL_VideoData;
dewyatt@4759
   179
slouken@5062
   180
#endif /* _SDL_windowsvideo_h */
dewyatt@4759
   181
dewyatt@4759
   182
/* vi: set ts=4 sw=4 expandtab: */