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