xref: /reactos/base/setup/usetup/consup.h (revision e08ae510)
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_ConOutPrintf(
77 	IN LPCSTR szFormat, ...);
78 
79 VOID
80 CONSOLE_ConOutPuts(
81 	IN LPCSTR szText);
82 
83 BOOL
84 CONSOLE_Flush(VOID);
85 
86 VOID
87 CONSOLE_GetCursorXY(
88     PSHORT x,
89     PSHORT y);
90 
91 SHORT
92 CONSOLE_GetCursorX(VOID);
93 
94 SHORT
95 CONSOLE_GetCursorY(VOID);
96 
97 VOID
98 CONSOLE_InvertTextXY(
99 	IN SHORT x,
100 	IN SHORT y,
101 	IN SHORT col,
102 	IN SHORT row);
103 
104 VOID
105 CONSOLE_NormalTextXY(
106 	IN SHORT x,
107 	IN SHORT y,
108 	IN SHORT col,
109 	IN SHORT row);
110 
111 VOID
112 CONSOLE_PrintTextXY(
113 	IN SHORT x,
114 	IN SHORT y,
115 	IN LPCSTR fmt, ...);
116 
117 VOID
118 CONSOLE_PrintTextXYN(
119 	IN SHORT x,
120 	IN SHORT y,
121 	IN SHORT len,
122 	IN LPCSTR fmt, ...);
123 
124 VOID
125 CONSOLE_SetCursorType(
126 	IN BOOL bInsert,
127 	IN BOOL bVisible);
128 
129 VOID
130 CONSOLE_SetCursorXY(
131 	IN SHORT x,
132 	IN SHORT y);
133 
134 VOID
135 CONSOLE_SetCursorXY(
136 	IN SHORT x,
137 	IN SHORT y);
138 
139 VOID
140 CONSOLE_SetHighlightedTextXY(
141 	IN SHORT x,
142 	IN SHORT y,
143 	IN LPCSTR Text);
144 
145 VOID
146 CONSOLE_SetInputTextXY(
147 	IN SHORT x,
148 	IN SHORT y,
149 	IN SHORT len,
150 	IN LPCWSTR Text);
151 
152 VOID
153 CONSOLE_SetInvertedTextXY(
154 	IN SHORT x,
155 	IN SHORT y,
156 	IN LPCSTR Text);
157 
158 VOID
159 CONSOLE_SetStatusText(
160 	IN LPCSTR fmt, ...);
161 
162 VOID
163 CONSOLE_SetStatusTextX(
164     IN SHORT x,
165 	IN LPCSTR fmt, ...);
166 
167 VOID
168 CONSOLE_SetStatusTextAutoFitX(
169     IN SHORT x,
170 	IN LPCSTR fmt, ...);
171 
172 VOID
173 CONSOLE_SetTextXY(
174 	IN SHORT x,
175 	IN SHORT y,
176 	IN LPCSTR Text);
177 
178 VOID
179 CONSOLE_SetUnderlinedTextXY(
180 	IN SHORT x,
181 	IN SHORT y,
182 	IN LPCSTR Text);
183 
184 VOID
185 CONSOLE_SetStyledText(
186 	IN SHORT x,
187 	IN SHORT y,
188 	IN INT Flags,
189 	IN LPCSTR Text);
190 
191 VOID
192 CONSOLE_ClearStyledText(IN SHORT x,
193                         IN SHORT y,
194                         IN INT Flags,
195                         IN SHORT Length);
196 
197 /* EOF */
198