reactos/base/setup/usetup/consup.h

232 lines
4.2 KiB
C
Raw Normal View History

/*
* ReactOS kernel
* Copyright (C) 2002 ReactOS Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS text-mode setup
* FILE: base/setup/usetup/consup.h
* PURPOSE: Console support functions
* PROGRAMMER:
*/
#pragma once
#define FOREGROUND_WHITE (FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE)
#define FOREGROUND_YELLOW (FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN)
#define BACKGROUND_WHITE (BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE)
/* Text style */
#define TEXT_STYLE_NORMAL 0x00000001
#define TEXT_STYLE_HIGHLIGHT 0x00000002
#define TEXT_STYLE_UNDERLINE 0x00000004
/* Text type */
#define TEXT_TYPE_REGULAR 0x00000008
#define TEXT_TYPE_STATUS 0x00000010
/* Text align */
#define TEXT_ALIGN_DEFAULT 0x00000020
#define TEXT_ALIGN_RIGHT 0x00000040
#define TEXT_ALIGN_LEFT 0x00000080
#define TEXT_ALIGN_CENTER 0x00000100
/* Text padding */
#define TEXT_PADDING_SMALL 0x00000200 /* One space */
#define TEXT_PADDING_MEDIUM 0x00000400 /* Two spaces */
#define TEXT_PADDING_BIG 0x00000800 /* Three spaces */
extern HANDLE StdInput, StdOutput;
extern SHORT xScreen, yScreen;
BOOLEAN
2020-10-01 22:04:11 +00:00
CONSOLE_Init(VOID);
VOID
CONSOLE_ClearScreen(VOID);
VOID
CONSOLE_ConInKey(
OUT PINPUT_RECORD Buffer);
BOOLEAN
CONSOLE_ConInKeyPeek(
OUT PINPUT_RECORD Buffer);
VOID
CONSOLE_ConOutChar(
IN CHAR c);
VOID
CONSOLE_ConOutPrintfV(
IN LPCSTR szFormat,
IN va_list args);
VOID
__cdecl
CONSOLE_ConOutPrintf(
IN LPCSTR szFormat,
...);
VOID
CONSOLE_ConOutPuts(
IN LPCSTR szText);
BOOL
CONSOLE_Flush(VOID);
VOID
CONSOLE_GetCursorXY(
2020-10-01 22:04:11 +00:00
OUT PSHORT x,
OUT PSHORT y);
SHORT
CONSOLE_GetCursorX(VOID);
SHORT
CONSOLE_GetCursorY(VOID);
VOID
CONSOLE_InvertTextXY(
IN SHORT x,
IN SHORT y,
IN SHORT col,
IN SHORT row);
VOID
CONSOLE_NormalTextXY(
IN SHORT x,
IN SHORT y,
IN SHORT col,
IN SHORT row);
VOID
__cdecl
CONSOLE_PrintTextXY(
IN SHORT x,
IN SHORT y,
2020-10-01 22:04:11 +00:00
IN LPCSTR fmt,
...);
VOID
__cdecl
CONSOLE_PrintTextXYN(
IN SHORT x,
IN SHORT y,
IN SHORT len,
2020-10-01 22:04:11 +00:00
IN LPCSTR fmt,
...);
VOID
CONSOLE_SetCursorType(
IN BOOL bInsert,
IN BOOL bVisible);
VOID
CONSOLE_SetCursorXY(
IN SHORT x,
IN SHORT y);
VOID
CONSOLE_SetCursorXY(
IN SHORT x,
IN SHORT y);
VOID
CONSOLE_SetHighlightedTextXY(
IN SHORT x,
IN SHORT y,
IN LPCSTR Text);
VOID
CONSOLE_SetInputTextXY(
IN SHORT x,
IN SHORT y,
IN SHORT len,
IN LPCWSTR Text);
VOID
CONSOLE_SetInvertedTextXY(
IN SHORT x,
IN SHORT y,
IN LPCSTR Text);
VOID
CONSOLE_SetStatusTextV(
IN LPCSTR fmt,
IN va_list args);
VOID
__cdecl
CONSOLE_SetStatusText(
IN LPCSTR fmt,
...);
VOID
CONSOLE_SetStatusTextXV(
IN SHORT x,
IN LPCSTR fmt,
IN va_list args);
VOID
__cdecl
CONSOLE_SetStatusTextX(
IN SHORT x,
IN LPCSTR fmt,
...);
VOID
__cdecl
CONSOLE_SetStatusTextAutoFitX(
IN SHORT x,
2020-10-01 22:04:11 +00:00
IN LPCSTR fmt,
...);
VOID
CONSOLE_SetTextXY(
IN SHORT x,
IN SHORT y,
IN LPCSTR Text);
[USETUP] Implement resource ID text based strings for MUI (#2193) CORE-12683 Supersedes PR #612. * [USETUP] Implement the internal MUI routines for text manipulation based on its ID and implement text resource based IDs USETUP (the 1st stage text mode setup module) bases upon MUI (Multilingual User Interface) sub-component of USETUP which is responsible for the ability into translating the MUI pages (each page having corresponding properties like X, Y coordinates, text flags and text string buffer) in various languages. The only problem, as of now, is that whenever you want to modify a certain property of a page, such as removing a text from the said page in the screen, you've got to rely on using CONSOLE_* specific functions and calling with hardcoded parameters, namely the coordinates. This can become a problem as not every localized (translated) MUI page has the same properties for each language and this could lead to various issues. Therefore, assigning each entry with an ID you can remove a text by only giving its ID (and the entry page number) without having the need to specify the coordinates as the internal MUI routine, MUIGetEntry(), automatically retrieves the entry with respective data fields. The following commit implements: - MUIGetEntry() - MUIClearText() - MUIClearStyledText() - MUISetText() - MUISetStyledText() - Now the X and Y coordinate members of MUI_ENTRY are of SHORT integer type, for the sake of the general code as most of the coordination values, even the COORD structure itself, has the coordination points as SHORTs and not BYTEs. The following MUI functions will be used to manipulate text based resources depending on their ID from the corresponding MUI entry. * [USETUP] Make CONSOLE_ClearTextXY function public so that we can use across other files. * [USETUP] Implement the IDs for each text MUI entry in locale files. This mechanism follows the same principle of resource IDs in Win32 applications. Static text is merely a resource that doesn't get changed programmatically for whole of its lifetime whereas dynamic resources can change during the lifetime of the program depending on the algorithm (for example, hide that piece of text and set another one, etc.). * [USETUP] Remove the "Press ENTER to continue" message prompt when the partition formatting begins.
2020-01-19 16:58:13 +00:00
VOID
CONSOLE_ClearTextXY(
IN SHORT x,
IN SHORT y,
IN SHORT Length);
VOID
CONSOLE_SetUnderlinedTextXY(
IN SHORT x,
IN SHORT y,
IN LPCSTR Text);
VOID
CONSOLE_SetStyledText(
IN SHORT x,
IN SHORT y,
IN INT Flags,
IN LPCSTR Text);
VOID
2020-10-01 22:04:11 +00:00
CONSOLE_ClearStyledText(
IN SHORT x,
IN SHORT y,
IN INT Flags,
IN SHORT Length);
/* EOF */