xref: /reactos/base/setup/usetup/consup.h (revision 7eead935)
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(
58     VOID);
59 
60 VOID
61 CONSOLE_ClearScreen(VOID);
62 
63 VOID
64 CONSOLE_ConInKey(
65     OUT PINPUT_RECORD Buffer);
66 
67 BOOLEAN
68 CONSOLE_ConInKeyPeek(
69     OUT PINPUT_RECORD Buffer);
70 
71 VOID
72 CONSOLE_ConOutChar(
73     IN CHAR c);
74 
75 VOID
76 CONSOLE_ConOutPrintfV(
77     IN LPCSTR szFormat,
78     IN va_list args);
79 
80 VOID
81 __cdecl
82 CONSOLE_ConOutPrintf(
83     IN LPCSTR szFormat,
84     ...);
85 
86 VOID
87 CONSOLE_ConOutPuts(
88     IN LPCSTR szText);
89 
90 BOOL
91 CONSOLE_Flush(VOID);
92 
93 VOID
94 CONSOLE_GetCursorXY(
95     PSHORT x,
96     PSHORT y);
97 
98 SHORT
99 CONSOLE_GetCursorX(VOID);
100 
101 SHORT
102 CONSOLE_GetCursorY(VOID);
103 
104 VOID
105 CONSOLE_InvertTextXY(
106     IN SHORT x,
107     IN SHORT y,
108     IN SHORT col,
109     IN SHORT row);
110 
111 VOID
112 CONSOLE_NormalTextXY(
113     IN SHORT x,
114     IN SHORT y,
115     IN SHORT col,
116     IN SHORT row);
117 
118 VOID
119 __cdecl
120 CONSOLE_PrintTextXY(
121     IN SHORT x,
122     IN SHORT y,
123     IN LPCSTR fmt, ...);
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 VOID
134 CONSOLE_SetCursorType(
135     IN BOOL bInsert,
136     IN BOOL bVisible);
137 
138 VOID
139 CONSOLE_SetCursorXY(
140     IN SHORT x,
141     IN SHORT y);
142 
143 VOID
144 CONSOLE_SetCursorXY(
145     IN SHORT x,
146     IN SHORT y);
147 
148 VOID
149 CONSOLE_SetHighlightedTextXY(
150     IN SHORT x,
151     IN SHORT y,
152     IN LPCSTR Text);
153 
154 VOID
155 CONSOLE_SetInputTextXY(
156     IN SHORT x,
157     IN SHORT y,
158     IN SHORT len,
159     IN LPCWSTR Text);
160 
161 VOID
162 CONSOLE_SetInvertedTextXY(
163     IN SHORT x,
164     IN SHORT y,
165     IN LPCSTR Text);
166 
167 VOID
168 CONSOLE_SetStatusTextV(
169     IN LPCSTR fmt,
170     IN va_list args);
171 
172 VOID
173 __cdecl
174 CONSOLE_SetStatusText(
175     IN LPCSTR fmt,
176     ...);
177 
178 VOID
179 CONSOLE_SetStatusTextXV(
180     IN SHORT x,
181     IN LPCSTR fmt,
182     IN va_list args);
183 
184 VOID
185 __cdecl
186 CONSOLE_SetStatusTextX(
187     IN SHORT x,
188     IN LPCSTR fmt,
189     ...);
190 
191 VOID
192 __cdecl
193 CONSOLE_SetStatusTextAutoFitX(
194     IN SHORT x,
195     IN LPCSTR fmt, ...);
196 
197 VOID
198 CONSOLE_SetTextXY(
199     IN SHORT x,
200     IN SHORT y,
201     IN LPCSTR Text);
202 
203 VOID
204 CONSOLE_SetUnderlinedTextXY(
205     IN SHORT x,
206     IN SHORT y,
207     IN LPCSTR Text);
208 
209 VOID
210 CONSOLE_SetStyledText(
211     IN SHORT x,
212     IN SHORT y,
213     IN INT Flags,
214     IN LPCSTR Text);
215 
216 VOID
217 CONSOLE_ClearStyledText(IN SHORT x,
218                         IN SHORT y,
219                         IN INT Flags,
220                         IN SHORT Length);
221 
222 /* EOF */
223