xref: /reactos/base/setup/usetup/consup.h (revision 2196a06f)
1 /*
2  *  ReactOS kernel
3  *  Copyright (C) 2002 ReactOS Team
4  *
5  *  This program is free software; you can redistribute it and/or modify
6  *  it under the terms of the GNU General Public License as published by
7  *  the Free Software Foundation; either version 2 of the License, or
8  *  (at your option) any later version.
9  *
10  *  This program is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  *  GNU General Public License for more details.
14  *
15  *  You should have received a copy of the GNU General Public License along
16  *  with this program; if not, write to the Free Software Foundation, Inc.,
17  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 /*
20  * COPYRIGHT:       See COPYING in the top level directory
21  * PROJECT:         ReactOS text-mode setup
22  * FILE:            base/setup/usetup/consup.h
23  * PURPOSE:         Console support functions
24  * PROGRAMMER:
25  */
26 
27 #pragma once
28 
29 #define FOREGROUND_WHITE (FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE)
30 #define FOREGROUND_YELLOW (FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN)
31 #define BACKGROUND_WHITE (BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE)
32 
33 /* Text style */
34 #define TEXT_STYLE_NORMAL      0x00000001
35 #define TEXT_STYLE_HIGHLIGHT   0x00000002
36 #define TEXT_STYLE_UNDERLINE   0x00000004
37 
38 /* Text type */
39 #define TEXT_TYPE_REGULAR      0x00000008
40 #define TEXT_TYPE_STATUS       0x00000010
41 
42 /* Text align */
43 #define TEXT_ALIGN_DEFAULT     0x00000020
44 #define TEXT_ALIGN_RIGHT       0x00000040
45 #define TEXT_ALIGN_LEFT        0x00000080
46 #define TEXT_ALIGN_CENTER      0x00000100
47 
48 /* Text padding */
49 #define TEXT_PADDING_SMALL     0x00000200 /* One space */
50 #define TEXT_PADDING_MEDIUM    0x00000400 /* Two spaces */
51 #define TEXT_PADDING_BIG       0x00000800 /* Three spaces */
52 
53 extern HANDLE StdInput, StdOutput;
54 extern SHORT xScreen, yScreen;
55 
56 BOOLEAN
57 CONSOLE_Init(VOID);
58 
59 VOID
60 CONSOLE_ClearScreen(VOID);
61 
62 VOID
63 CONSOLE_ConInKey(
64     OUT PINPUT_RECORD Buffer);
65 
66 BOOLEAN
67 CONSOLE_ConInKeyPeek(
68     OUT PINPUT_RECORD Buffer);
69 
70 VOID
71 CONSOLE_ConOutChar(
72     IN CHAR c);
73 
74 VOID
75 CONSOLE_ConOutPrintfV(
76     IN LPCSTR szFormat,
77     IN va_list args);
78 
79 VOID
80 __cdecl
81 CONSOLE_ConOutPrintf(
82     IN LPCSTR szFormat,
83     ...);
84 
85 VOID
86 CONSOLE_ConOutPuts(
87     IN LPCSTR szText);
88 
89 BOOL
90 CONSOLE_Flush(VOID);
91 
92 VOID
93 CONSOLE_GetCursorXY(
94     OUT PSHORT x,
95     OUT PSHORT y);
96 
97 SHORT
98 CONSOLE_GetCursorX(VOID);
99 
100 SHORT
101 CONSOLE_GetCursorY(VOID);
102 
103 VOID
104 CONSOLE_InvertTextXY(
105     IN SHORT x,
106     IN SHORT y,
107     IN SHORT col,
108     IN SHORT row);
109 
110 VOID
111 CONSOLE_NormalTextXY(
112     IN SHORT x,
113     IN SHORT y,
114     IN SHORT col,
115     IN SHORT row);
116 
117 VOID
118 __cdecl
119 CONSOLE_PrintTextXY(
120     IN SHORT x,
121     IN SHORT y,
122     IN LPCSTR fmt,
123     ...);
124 
125 VOID
126 __cdecl
127 CONSOLE_PrintTextXYN(
128     IN SHORT x,
129     IN SHORT y,
130     IN SHORT len,
131     IN LPCSTR fmt,
132     ...);
133 
134 VOID
135 CONSOLE_SetCursorType(
136     IN BOOL bInsert,
137     IN BOOL bVisible);
138 
139 VOID
140 CONSOLE_SetCursorXY(
141     IN SHORT x,
142     IN SHORT y);
143 
144 VOID
145 CONSOLE_SetCursorXY(
146     IN SHORT x,
147     IN SHORT y);
148 
149 VOID
150 CONSOLE_SetHighlightedTextXY(
151     IN SHORT x,
152     IN SHORT y,
153     IN LPCSTR Text);
154 
155 VOID
156 CONSOLE_SetInputTextXY(
157     IN SHORT x,
158     IN SHORT y,
159     IN SHORT len,
160     IN LPCWSTR Text);
161 
162 VOID
163 CONSOLE_SetInvertedTextXY(
164     IN SHORT x,
165     IN SHORT y,
166     IN LPCSTR Text);
167 
168 VOID
169 CONSOLE_SetStatusTextV(
170     IN LPCSTR fmt,
171     IN va_list args);
172 
173 VOID
174 __cdecl
175 CONSOLE_SetStatusText(
176     IN LPCSTR fmt,
177     ...);
178 
179 VOID
180 CONSOLE_SetStatusTextXV(
181     IN SHORT x,
182     IN LPCSTR fmt,
183     IN va_list args);
184 
185 VOID
186 __cdecl
187 CONSOLE_SetStatusTextX(
188     IN SHORT x,
189     IN LPCSTR fmt,
190     ...);
191 
192 VOID
193 __cdecl
194 CONSOLE_SetStatusTextAutoFitX(
195     IN SHORT x,
196     IN LPCSTR fmt,
197     ...);
198 
199 VOID
200 CONSOLE_SetTextXY(
201     IN SHORT x,
202     IN SHORT y,
203     IN LPCSTR Text);
204 
205 VOID
206 CONSOLE_ClearTextXY(
207     IN SHORT x,
208     IN SHORT y,
209     IN SHORT Length);
210 
211 VOID
212 CONSOLE_SetUnderlinedTextXY(
213     IN SHORT x,
214     IN SHORT y,
215     IN LPCSTR Text);
216 
217 VOID
218 CONSOLE_SetStyledText(
219     IN SHORT x,
220     IN SHORT y,
221     IN INT Flags,
222     IN LPCSTR Text);
223 
224 VOID
225 CONSOLE_ClearStyledText(
226     IN SHORT x,
227     IN SHORT y,
228     IN INT Flags,
229     IN SHORT Length);
230 
231 /* EOF */
232