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