Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Latest commit

 

History

History
166 lines (139 loc) · 4.72 KB

SDL_win32video.h

File metadata and controls

166 lines (139 loc) · 4.72 KB
 
Aug 3, 2010
Aug 3, 2010
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
#ifndef _SDL_win32video_h
#define _SDL_win32video_h
#include "../SDL_sysvideo.h"
#define WIN32_LEAN_AND_MEAN
#define STRICT
Jul 28, 2010
Jul 28, 2010
31
#ifndef UNICODE
Aug 3, 2010
Aug 3, 2010
32
#define UNICODE
Jul 28, 2010
Jul 28, 2010
33
#endif
Aug 3, 2010
Aug 3, 2010
34
#undef WINVER
Aug 29, 2010
Aug 29, 2010
35
#define WINVER 0x500 /* Need 0x410 for AlphaBlend() and 0x500 for EnumDisplayDevices() */
Jun 10, 2010
Jun 10, 2010
36
Aug 3, 2010
Aug 3, 2010
37
38
39
#include <windows.h>
#include <msctf.h>
Sep 19, 2010
Sep 19, 2010
40
#include <imm.h>
Aug 3, 2010
Aug 3, 2010
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#if SDL_VIDEO_RENDER_D3D
//#include <d3d9.h>
#define D3D_DEBUG_INFO
#include "d3d9.h"
#endif
#if SDL_VIDEO_RENDER_DDRAW
/* WIN32_LEAN_AND_MEAN was defined, so we have to include this by hand */
#include <objbase.h>
#include "ddraw.h"
#endif
#include "SDL_win32clipboard.h"
#include "SDL_win32events.h"
#include "SDL_win32gamma.h"
#include "SDL_win32keyboard.h"
#include "SDL_win32modes.h"
#include "SDL_win32mouse.h"
#include "SDL_win32opengl.h"
#include "SDL_win32window.h"
#include "SDL_events.h"
#ifdef UNICODE
#define WIN_StringToUTF8(S) SDL_iconv_string("UTF-8", "UCS-2", (char *)S, (SDL_wcslen(S)+1)*sizeof(WCHAR))
#define WIN_UTF8ToString(S) (WCHAR *)SDL_iconv_string("UCS-2", "UTF-8", (char *)S, SDL_strlen(S)+1)
#else
#define WIN_StringToUTF8(S) SDL_iconv_string("UTF-8", "ASCII", (char *)S, (SDL_strlen(S)+1))
#define WIN_UTF8ToString(S) SDL_iconv_string("ASCII", "UTF-8", (char *)S, SDL_strlen(S)+1)
#endif
extern void WIN_SetError(const char *prefix);
Jul 28, 2010
Jul 28, 2010
73
74
75
76
77
enum { RENDER_NONE, RENDER_D3D, RENDER_DDRAW, RENDER_GDI, RENDER_GAPI, RENDER_RAW };
typedef BOOL (*PFNSHFullScreen)(HWND, DWORD);
typedef void (*PFCoordTransform)(SDL_Window*, POINT*);
Aug 3, 2010
Aug 3, 2010
78
79
80
81
82
83
84
typedef struct
{
void **lpVtbl;
int refcount;
void *data;
} TSFSink;
Sep 19, 2010
Sep 19, 2010
85
/* Definition from Win98DDK version of IMM.H */
Aug 3, 2010
Aug 3, 2010
86
typedef struct tagINPUTCONTEXT2 {
Sep 19, 2010
Sep 19, 2010
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
HWND hWnd;
BOOL fOpen;
POINT ptStatusWndPos;
POINT ptSoftKbdPos;
DWORD fdwConversion;
DWORD fdwSentence;
union {
LOGFONTA A;
LOGFONTW W;
} lfFont;
COMPOSITIONFORM cfCompForm;
CANDIDATEFORM cfCandForm[4];
HIMCC hCompStr;
HIMCC hCandInfo;
HIMCC hGuideLine;
HIMCC hPrivate;
DWORD dwNumMsgBuf;
HIMCC hMsgBuf;
DWORD fdwInit;
DWORD dwReserve[3];
} INPUTCONTEXT2, *PINPUTCONTEXT2, NEAR *NPINPUTCONTEXT2, FAR *LPINPUTCONTEXT2;
Aug 3, 2010
Aug 3, 2010
108
109
110
111
112
/* Private display data */
typedef struct SDL_VideoData
{
Jul 28, 2010
Jul 28, 2010
113
114
int render;
Aug 3, 2010
Aug 3, 2010
115
116
117
118
119
120
121
122
#if SDL_VIDEO_RENDER_D3D
HANDLE d3dDLL;
IDirect3D9 *d3d;
#endif
#if SDL_VIDEO_RENDER_DDRAW
HANDLE ddrawDLL;
IDirectDraw *ddraw;
#endif
Jul 28, 2010
Jul 28, 2010
123
124
125
126
127
#ifdef _WIN32_WCE
HMODULE hAygShell;
PFNSHFullScreen SHFullScreen;
PFCoordTransform CoordTransform;
#endif
Aug 3, 2010
Aug 3, 2010
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
const SDL_scancode *key_layout;
DWORD clipboard_count;
SDL_bool ime_com_initialized;
struct ITfThreadMgr *ime_threadmgr;
SDL_bool ime_initialized;
SDL_bool ime_enabled;
SDL_bool ime_available;
HWND ime_hwnd_main;
HWND ime_hwnd_current;
HIMC ime_himc;
WCHAR ime_composition[SDL_TEXTEDITINGEVENT_TEXT_SIZE];
WCHAR ime_readingstring[16];
int ime_cursor;
HKL ime_hkl;
HMODULE ime_himm32;
UINT (WINAPI *GetReadingString)(HIMC himc, UINT uReadingBufLen, LPWSTR lpwReadingBuf, PINT pnErrorIndex, BOOL *pfIsVertical, PUINT puMaxReadingLen);
BOOL (WINAPI *ShowReadingWindow)(HIMC himc, BOOL bShow);
LPINPUTCONTEXT2 (WINAPI *ImmLockIMC)(HIMC himc);
BOOL (WINAPI *ImmUnlockIMC)(HIMC himc);
LPVOID (WINAPI *ImmLockIMCC)(HIMCC himcc);
BOOL (WINAPI *ImmUnlockIMCC)(HIMCC himcc);
SDL_bool ime_uiless;
struct ITfThreadMgrEx *ime_threadmgrex;
DWORD ime_uielemsinkcookie;
DWORD ime_alpnsinkcookie;
DWORD ime_openmodesinkcookie;
DWORD ime_convmodesinkcookie;
TSFSink *ime_uielemsink;
TSFSink *ime_ippasink;
} SDL_VideoData;
#endif /* _SDL_win32video_h */
/* vi: set ts=4 sw=4 expandtab: */