src/video/windows/SDL_windowsvideo.h
author Sam Lantinga <slouken@libsdl.org>
Sat, 28 Sep 2013 14:06:59 -0700
changeset 7762 51abf7664304
parent 7191 75360622e65f
child 7828 1451063c8ecd
permissions -rw-r--r--
Moved SDL_Direct3D9GetAdapterIndex() to SDL_windowsvideo.c since it doesn't belong in the window code.
dewyatt@4759
     1
/*
slouken@5535
     2
  Simple DirectMedia Layer
slouken@6885
     3
  Copyright (C) 1997-2013 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
icculus@6430
    30
#if defined(_MSC_VER)
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@7191
    54
#define TWF_FINETOUCH   1
slouken@7191
    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@7191
    64
    LONG      x;
slouken@7191
    65
    LONG      y;
slouken@7191
    66
    HANDLE    hSource;
slouken@7191
    67
    DWORD     dwID;
slouken@7191
    68
    DWORD     dwFlags;
slouken@7191
    69
    DWORD     dwMask;
slouken@7191
    70
    DWORD     dwTime;
slouken@7191
    71
    ULONG_PTR dwExtraInfo;
slouken@7191
    72
    DWORD     cxContact;
slouken@7191
    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
slouken@7191
    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@7191
   118
    DWORD clipboard_count;
slouken@4919
   119
slouken@7191
   120
    /* Touch input functions */
slouken@7191
   121
    void* userDLL;
slouken@7191
   122
    BOOL (WINAPI *CloseTouchInputHandle)( HTOUCHINPUT );
slouken@7191
   123
    BOOL (WINAPI *GetTouchInputInfo)( HTOUCHINPUT, UINT, PTOUCHINPUT, int );
slouken@7191
   124
    BOOL (WINAPI *RegisterTouchWindow)( HWND, ULONG );
dewyatt@4759
   125
dewyatt@4759
   126
    SDL_bool ime_com_initialized;
dewyatt@4759
   127
    struct ITfThreadMgr *ime_threadmgr;
dewyatt@4759
   128
    SDL_bool ime_initialized;
dewyatt@4759
   129
    SDL_bool ime_enabled;
dewyatt@4759
   130
    SDL_bool ime_available;
dewyatt@4759
   131
    HWND ime_hwnd_main;
dewyatt@4759
   132
    HWND ime_hwnd_current;
dewyatt@4759
   133
    HIMC ime_himc;
dewyatt@4759
   134
dewyatt@4759
   135
    WCHAR ime_composition[SDL_TEXTEDITINGEVENT_TEXT_SIZE];
dewyatt@4759
   136
    WCHAR ime_readingstring[16];
dewyatt@4759
   137
    int ime_cursor;
dewyatt@4759
   138
Daniel@4912
   139
    SDL_bool ime_candlist;
Daniel@4912
   140
    WCHAR ime_candidates[MAX_CANDLIST][MAX_CANDLENGTH];
Daniel@4912
   141
    DWORD ime_candcount;
Daniel@4912
   142
    DWORD ime_candref;
Daniel@4912
   143
    DWORD ime_candsel;
Daniel@4912
   144
    UINT ime_candpgsize;
Daniel@4912
   145
    int ime_candlistindexbase;
Daniel@4912
   146
    SDL_bool ime_candvertical;
Daniel@4912
   147
Daniel@4912
   148
    SDL_bool ime_dirty;
Daniel@4912
   149
    SDL_Rect ime_rect;
Daniel@4912
   150
    SDL_Rect ime_candlistrect;
Daniel@4912
   151
    int ime_winwidth;
Daniel@4912
   152
    int ime_winheight;
Daniel@4912
   153
dewyatt@4759
   154
    HKL ime_hkl;
slouken@5090
   155
    void* ime_himm32;
dewyatt@4759
   156
    UINT (WINAPI *GetReadingString)(HIMC himc, UINT uReadingBufLen, LPWSTR lpwReadingBuf, PINT pnErrorIndex, BOOL *pfIsVertical, PUINT puMaxReadingLen);
dewyatt@4759
   157
    BOOL (WINAPI *ShowReadingWindow)(HIMC himc, BOOL bShow);
dewyatt@4759
   158
    LPINPUTCONTEXT2 (WINAPI *ImmLockIMC)(HIMC himc);
dewyatt@4759
   159
    BOOL (WINAPI *ImmUnlockIMC)(HIMC himc);
dewyatt@4759
   160
    LPVOID (WINAPI *ImmLockIMCC)(HIMCC himcc);
dewyatt@4759
   161
    BOOL (WINAPI *ImmUnlockIMCC)(HIMCC himcc);
dewyatt@4759
   162
dewyatt@4759
   163
    SDL_bool ime_uiless;
dewyatt@4759
   164
    struct ITfThreadMgrEx *ime_threadmgrex;
dewyatt@4759
   165
    DWORD ime_uielemsinkcookie;
dewyatt@4759
   166
    DWORD ime_alpnsinkcookie;
dewyatt@4759
   167
    DWORD ime_openmodesinkcookie;
dewyatt@4759
   168
    DWORD ime_convmodesinkcookie;
dewyatt@4759
   169
    TSFSink *ime_uielemsink;
dewyatt@4759
   170
    TSFSink *ime_ippasink;
dewyatt@4759
   171
} SDL_VideoData;
dewyatt@4759
   172
slouken@7762
   173
slouken@7762
   174
typedef struct IDirect3D9 IDirect3D9;
slouken@7762
   175
extern SDL_bool D3D_LoadDLL( void **pD3DDLL, IDirect3D9 **pDirect3D9Interface );
slouken@7762
   176
slouken@5062
   177
#endif /* _SDL_windowsvideo_h */
dewyatt@4759
   178
dewyatt@4759
   179
/* vi: set ts=4 sw=4 expandtab: */