VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/Graphics/Wine/include/wincon.h@ 16410

最後變更 在這個檔案從16410是 16410,由 vboxsync 提交於 16 年 前

export the Wine stuff to OSE

  • 屬性 svn:eol-style 設為 native
檔案大小: 10.3 KB
 
1/*
2 * Copyright (C) the Wine project
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 */
18
19#ifndef __WINE_WINCON_H
20#define __WINE_WINCON_H
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26#define CONSOLE_FULLSCREEN 1
27#define CONSOLE_FULLSCREEN_HARDWARE 2
28
29#define CTRL_C_EVENT 0
30#define CTRL_BREAK_EVENT 1
31#define CTRL_CLOSE_EVENT 2
32#define CTRL_LOGOFF_EVENT 5
33#define CTRL_SHUTDOWN_EVENT 6
34
35/* Console Mode flags */
36#define ENABLE_PROCESSED_INPUT 0x01
37#define ENABLE_LINE_INPUT 0x02
38#define ENABLE_ECHO_INPUT 0x04
39#define ENABLE_WINDOW_INPUT 0x08
40#define ENABLE_MOUSE_INPUT 0x10
41
42#define ENABLE_PROCESSED_OUTPUT 0x01
43#define ENABLE_WRAP_AT_EOL_OUTPUT 0x02
44
45
46typedef BOOL (WINAPI *PHANDLER_ROUTINE)(DWORD dwCtrlType);
47
48/* Attributes flags: */
49
50#define FOREGROUND_BLUE 0x0001 /* text color contains blue. */
51#define FOREGROUND_GREEN 0x0002 /* text color contains green. */
52#define FOREGROUND_RED 0x0004 /* text color contains red. */
53#define FOREGROUND_INTENSITY 0x0008 /* text color is intensified. */
54#define BACKGROUND_BLUE 0x0010 /* background color contains blue. */
55#define BACKGROUND_GREEN 0x0020 /* background color contains green. */
56#define BACKGROUND_RED 0x0040 /* background color contains red. */
57#define BACKGROUND_INTENSITY 0x0080 /* background color is intensified. */
58
59typedef struct _CONSOLE_CURSOR_INFO {
60 DWORD dwSize; /* Between 1 & 100 for percentage of cell filled */
61 BOOL bVisible; /* Visibility of cursor */
62} CONSOLE_CURSOR_INFO, *LPCONSOLE_CURSOR_INFO;
63
64typedef struct tagCOORD
65{
66 SHORT X;
67 SHORT Y;
68} COORD, *LPCOORD;
69
70typedef struct tagSMALL_RECT
71{
72 SHORT Left;
73 SHORT Top;
74 SHORT Right;
75 SHORT Bottom;
76} SMALL_RECT,*LPSMALL_RECT;
77
78typedef struct tagCONSOLE_SCREEN_BUFFER_INFO
79{
80 COORD dwSize;
81 COORD dwCursorPosition;
82 WORD wAttributes;
83 SMALL_RECT srWindow;
84 COORD dwMaximumWindowSize;
85} CONSOLE_SCREEN_BUFFER_INFO,*LPCONSOLE_SCREEN_BUFFER_INFO;
86
87typedef struct tagCHAR_INFO
88{
89 union
90 {
91 WCHAR UnicodeChar;
92 CHAR AsciiChar;
93 } Char;
94 WORD Attributes;
95} CHAR_INFO,*LPCHAR_INFO;
96
97typedef struct tagKEY_EVENT_RECORD
98{
99 BOOL bKeyDown; /* 04 */
100 WORD wRepeatCount; /* 08 */
101 WORD wVirtualKeyCode; /* 0A */
102 WORD wVirtualScanCode; /* 0C */
103 union /* 0E */
104 {
105 WCHAR UnicodeChar; /* 0E */
106 CHAR AsciiChar; /* 0E */
107 } uChar;
108 DWORD dwControlKeyState; /* 10 */
109} KEY_EVENT_RECORD,*LPKEY_EVENT_RECORD;
110
111/* dwControlKeyState bitmask */
112#define RIGHT_ALT_PRESSED 0x0001
113#define LEFT_ALT_PRESSED 0x0002
114#define RIGHT_CTRL_PRESSED 0x0004
115#define LEFT_CTRL_PRESSED 0x0008
116#define SHIFT_PRESSED 0x0010
117#define NUMLOCK_ON 0x0020
118#define SCROLLLOCK_ON 0x0040
119#define CAPSLOCK_ON 0x0080
120#define ENHANCED_KEY 0x0100
121
122typedef struct tagMOUSE_EVENT_RECORD
123{
124 COORD dwMousePosition;
125 DWORD dwButtonState;
126 DWORD dwControlKeyState;
127 DWORD dwEventFlags;
128} MOUSE_EVENT_RECORD,*LPMOUSE_EVENT_RECORD;
129
130#define FROM_LEFT_1ST_BUTTON_PRESSED 0x0001
131#define RIGHTMOST_BUTTON_PRESSED 0x0002
132#define FROM_LEFT_2ND_BUTTON_PRESSED 0x0004
133#define FROM_LEFT_3RD_BUTTON_PRESSED 0x0008
134#define FROM_LEFT_4TH_BUTTON_PRESSED 0x0010
135
136#define MOUSE_MOVED 0x0001
137#define DOUBLE_CLICK 0x0002
138#define MOUSE_WHEELED 0x0004
139
140typedef struct tagWINDOW_BUFFER_SIZE_RECORD
141{
142 COORD dwSize;
143} WINDOW_BUFFER_SIZE_RECORD,*LPWINDOW_BUFFER_SIZE_RECORD;
144
145typedef struct tagMENU_EVENT_RECORD
146{
147 UINT dwCommandId; /* perhaps UINT16 ??? */
148} MENU_EVENT_RECORD,*LPMENU_EVENT_RECORD;
149
150typedef struct tagFOCUS_EVENT_RECORD
151{
152 BOOL bSetFocus; /* perhaps BOOL16 ??? */
153} FOCUS_EVENT_RECORD,*LPFOCUS_EVENT_RECORD;
154
155typedef struct tagINPUT_RECORD
156{
157 WORD EventType; /* 00 */
158 union
159 {
160 KEY_EVENT_RECORD KeyEvent;
161 MOUSE_EVENT_RECORD MouseEvent;
162 WINDOW_BUFFER_SIZE_RECORD WindowBufferSizeEvent;
163 MENU_EVENT_RECORD MenuEvent;
164 FOCUS_EVENT_RECORD FocusEvent;
165 } Event;
166} INPUT_RECORD,*PINPUT_RECORD;
167
168/* INPUT_RECORD.wEventType */
169#define KEY_EVENT 0x01
170#define MOUSE_EVENT 0x02
171#define WINDOW_BUFFER_SIZE_EVENT 0x04
172#define MENU_EVENT 0x08
173#define FOCUS_EVENT 0x10
174
175#define CONSOLE_TEXTMODE_BUFFER 1
176
177#ifdef __i386__
178/* Note: this should return a COORD, but calling convention for returning
179 * structures is different between Windows and gcc on i386. */
180WINBASEAPI DWORD WINAPI GetLargestConsoleWindowSize(HANDLE);
181
182static inline COORD __wine_GetLargestConsoleWindowSize_wrapper(HANDLE h)
183{
184 union {
185 COORD c;
186 DWORD dw;
187 } u;
188 u.dw = GetLargestConsoleWindowSize(h);
189 return u.c;
190}
191#define GetLargestConsoleWindowSize(h) __wine_GetLargestConsoleWindowSize_wrapper(h)
192
193#else /* __i386__ */
194WINBASEAPI COORD WINAPI GetLargestConsoleWindowSize(HANDLE);
195#endif /* __i386__ */
196
197WINBASEAPI BOOL WINAPI AllocConsole(VOID);
198WINBASEAPI HANDLE WINAPI CreateConsoleScreenBuffer( DWORD,DWORD,LPSECURITY_ATTRIBUTES,DWORD,LPVOID);
199WINBASEAPI BOOL WINAPI FillConsoleOutputAttribute( HANDLE,WORD,DWORD,COORD,LPDWORD);
200WINBASEAPI BOOL WINAPI FillConsoleOutputCharacterA(HANDLE,CHAR,DWORD,COORD,LPDWORD);
201WINBASEAPI BOOL WINAPI FillConsoleOutputCharacterW(HANDLE,WCHAR,DWORD,COORD,LPDWORD);
202#define FillConsoleOutputCharacter WINELIB_NAME_AW(FillConsoleOutputCharacter)
203WINBASEAPI BOOL WINAPI FlushConsoleInputBuffer( HANDLE);
204WINBASEAPI BOOL WINAPI FreeConsole(VOID);
205WINBASEAPI BOOL WINAPI GenerateConsoleCtrlEvent( DWORD,DWORD);
206WINBASEAPI UINT WINAPI GetConsoleCP(VOID);
207WINBASEAPI BOOL WINAPI GetConsoleCursorInfo( HANDLE,LPCONSOLE_CURSOR_INFO);
208WINBASEAPI BOOL WINAPI GetConsoleMode( HANDLE,LPDWORD);
209WINBASEAPI UINT WINAPI GetConsoleOutputCP(VOID);
210WINBASEAPI BOOL WINAPI GetConsoleScreenBufferInfo(HANDLE,LPCONSOLE_SCREEN_BUFFER_INFO);
211WINBASEAPI DWORD WINAPI GetConsoleTitleA(LPSTR,DWORD);
212WINBASEAPI DWORD WINAPI GetConsoleTitleW(LPWSTR,DWORD);
213#define GetConsoleTitle WINELIB_NAME_AW(GetConsoleTitle)
214WINBASEAPI HWND WINAPI GetConsoleWindow(void);
215WINBASEAPI BOOL WINAPI GetNumberOfConsoleInputEvents( HANDLE,LPDWORD);
216WINBASEAPI BOOL WINAPI GetNumberOfConsoleMouseButtons(LPDWORD);
217WINBASEAPI BOOL WINAPI PeekConsoleInputA( HANDLE,PINPUT_RECORD,DWORD,LPDWORD);
218WINBASEAPI BOOL WINAPI PeekConsoleInputW( HANDLE,PINPUT_RECORD,DWORD,LPDWORD);
219#define PeekConsoleInput WINELIB_NAME_AW(PeekConsoleInput)
220WINBASEAPI BOOL WINAPI ReadConsoleA(HANDLE,LPVOID,DWORD,LPDWORD,LPVOID);
221WINBASEAPI BOOL WINAPI ReadConsoleW(HANDLE,LPVOID,DWORD,LPDWORD,LPVOID);
222#define ReadConsole WINELIB_NAME_AW(ReadConsole)
223WINBASEAPI BOOL WINAPI ReadConsoleInputA(HANDLE,PINPUT_RECORD,DWORD,LPDWORD);
224WINBASEAPI BOOL WINAPI ReadConsoleInputW(HANDLE,PINPUT_RECORD,DWORD,LPDWORD);
225#define ReadConsoleInput WINELIB_NAME_AW(ReadConsoleInput)
226WINBASEAPI BOOL WINAPI ReadConsoleOutputA( HANDLE,LPCHAR_INFO,COORD,COORD,LPSMALL_RECT);
227WINBASEAPI BOOL WINAPI ReadConsoleOutputW( HANDLE,LPCHAR_INFO,COORD,COORD,LPSMALL_RECT);
228#define ReadConsoleOutput WINELIB_NAME_AW(ReadConsoleOutput)
229WINBASEAPI BOOL WINAPI ReadConsoleOutputAttribute( HANDLE,LPWORD,DWORD,COORD,LPDWORD);
230WINBASEAPI BOOL WINAPI ReadConsoleOutputCharacterA(HANDLE,LPSTR,DWORD,COORD,LPDWORD);
231WINBASEAPI BOOL WINAPI ReadConsoleOutputCharacterW(HANDLE,LPWSTR,DWORD,COORD,LPDWORD);
232#define ReadConsoleOutputCharacter WINELIB_NAME_AW(ReadConsoleOutputCharacter)
233WINBASEAPI BOOL WINAPI ScrollConsoleScreenBufferA( HANDLE,LPSMALL_RECT,LPSMALL_RECT,COORD,LPCHAR_INFO);
234WINBASEAPI BOOL WINAPI ScrollConsoleScreenBufferW( HANDLE,LPSMALL_RECT,LPSMALL_RECT,COORD,LPCHAR_INFO);
235#define ScrollConsoleScreenBuffer WINELIB_NAME_AW(ScrollConsoleScreenBuffer)
236WINBASEAPI BOOL WINAPI SetConsoleActiveScreenBuffer( HANDLE);
237WINBASEAPI BOOL WINAPI SetConsoleCP(UINT);
238WINBASEAPI BOOL WINAPI SetConsoleCtrlHandler( PHANDLER_ROUTINE,BOOL);
239WINBASEAPI BOOL WINAPI SetConsoleCursorInfo( HANDLE,LPCONSOLE_CURSOR_INFO);
240WINBASEAPI BOOL WINAPI SetConsoleCursorPosition(HANDLE,COORD);
241WINBASEAPI BOOL WINAPI SetConsoleMode( HANDLE,DWORD);
242WINBASEAPI BOOL WINAPI SetConsoleOutputCP(UINT);
243WINBASEAPI BOOL WINAPI SetConsoleScreenBufferSize(HANDLE,COORD);
244WINBASEAPI BOOL WINAPI SetConsoleTextAttribute( HANDLE,WORD);
245WINBASEAPI BOOL WINAPI SetConsoleTitleA(LPCSTR);
246WINBASEAPI BOOL WINAPI SetConsoleTitleW(LPCWSTR);
247#define SetConsoleTitle WINELIB_NAME_AW(SetConsoleTitle)
248WINBASEAPI BOOL WINAPI SetConsoleWindowInfo( HANDLE,BOOL,LPSMALL_RECT);
249WINBASEAPI BOOL WINAPI WriteConsoleA(HANDLE,CONST VOID *,DWORD,LPDWORD,LPVOID);
250WINBASEAPI BOOL WINAPI WriteConsoleW(HANDLE,CONST VOID *,DWORD,LPDWORD,LPVOID);
251#define WriteConsole WINELIB_NAME_AW(WriteConsole)
252WINBASEAPI BOOL WINAPI WriteConsoleInputA(HANDLE,const INPUT_RECORD *,DWORD,LPDWORD);
253WINBASEAPI BOOL WINAPI WriteConsoleInputW(HANDLE,const INPUT_RECORD *,DWORD,LPDWORD);
254#define WriteConsoleInput WINELIB_NAME_AW(WriteConsoleInput)
255WINBASEAPI BOOL WINAPI WriteConsoleOutputA(HANDLE,const CHAR_INFO*,COORD,COORD,LPSMALL_RECT);
256WINBASEAPI BOOL WINAPI WriteConsoleOutputW(HANDLE,const CHAR_INFO*,COORD,COORD,LPSMALL_RECT);
257#define WriteConsoleOutput WINELIB_NAME_AW(WriteConsoleOutput)
258WINBASEAPI BOOL WINAPI WriteConsoleOutputAttribute(HANDLE,CONST WORD *,DWORD,COORD,LPDWORD);
259WINBASEAPI BOOL WINAPI WriteConsoleOutputCharacterA(HANDLE,LPCSTR,DWORD,COORD,LPDWORD);
260WINBASEAPI BOOL WINAPI WriteConsoleOutputCharacterW(HANDLE,LPCWSTR,DWORD,COORD,LPDWORD);
261#define WriteConsoleOutputCharacter WINELIB_NAME_AW(WriteConsoleOutputCharacter)
262
263#ifdef __cplusplus
264}
265#endif
266
267#endif /* __WINE_WINCON_H */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette