ReactOS  0.4.14-dev-554-g2f8d847
tui.h
Go to the documentation of this file.
1 /*
2  * FreeLoader
3  * Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
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 #pragma once
21 
22 #define TUI_SCREEN_MEM 0xB8000
23 #define TUI_TITLE_BOX_CHAR_HEIGHT 5
24 
26 //
27 // Textual User Interface Functions
28 //
30 BOOLEAN TuiInitialize(VOID); // Initialize User-Interface
31 VOID TuiUnInitialize(VOID); // Un-initialize User-Interface
32 
33 VOID TuiDrawBackdrop(VOID); // Fills the entire screen with a backdrop
34 VOID TuiFillArea(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, CHAR FillChar, UCHAR Attr /* Color Attributes */); // Fills the area specified with FillChar and Attr
35 VOID TuiDrawShadow(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom); // Draws a shadow on the bottom and right sides of the area specified
36 VOID TuiDrawBox(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, UCHAR VertStyle, UCHAR HorzStyle, BOOLEAN Fill, BOOLEAN Shadow, UCHAR Attr); // Draws a box around the area specified
37 VOID TuiDrawText(ULONG X, ULONG Y, PCSTR Text, UCHAR Attr); // Draws text at coordinates specified
38 VOID TuiDrawText2(ULONG X, ULONG Y, ULONG MaxNumChars, PCSTR Text, UCHAR Attr); // Draws text at coordinates specified
39 VOID TuiDrawCenteredText(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, PCSTR TextString, UCHAR Attr); // Draws centered text at the coordinates specified and clips the edges
40 VOID TuiDrawStatusText(PCSTR StatusText); // Draws text at the very bottom line on the screen
41 VOID TuiUpdateDateTime(VOID); // Updates the date and time
42 VOID TuiSaveScreen(PUCHAR Buffer); // Saves the screen so that it can be restored later
43 VOID TuiRestoreScreen(PUCHAR Buffer); // Restores the screen from a previous save
44 VOID TuiMessageBox(PCSTR MessageText); // Displays a message box on the screen with an ok button
45 VOID TuiMessageBoxCritical(PCSTR MessageText); // Displays a message box on the screen with an ok button using no system resources
46 VOID TuiDrawProgressBarCenter(ULONG Position, ULONG Range, PCHAR ProgressText); // Draws the progress bar showing nPos percent filled
47 VOID TuiDrawProgressBar(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, ULONG Position, ULONG Range, PCHAR ProgressText); // Draws the progress bar showing nPos percent filled
48 BOOLEAN TuiEditBox(PCSTR MessageText, PCHAR EditTextBuffer, ULONG Length);
49 int TuiPrintf(const char *format, ... );
50 UCHAR TuiTextToColor(PCSTR ColorText); // Converts the text color into it's equivalent color value
51 UCHAR TuiTextToFillStyle(PCSTR FillStyleText); // Converts the text fill into it's equivalent fill value
52 
53 VOID TuiFadeInBackdrop(VOID); // Draws the backdrop and fades the screen in
54 VOID TuiFadeOut(VOID); // Fades the screen out
55 
57 //
58 // Menu Functions
59 //
61 
67 
68 BOOLEAN
70  IN PCSTR MenuHeader,
71  IN PCSTR MenuFooter OPTIONAL,
72  IN BOOLEAN ShowBootOptions,
73  IN PCSTR MenuItemList[],
74  IN ULONG MenuItemCount,
75  IN ULONG DefaultMenuItem,
76  IN LONG MenuTimeOut,
77  OUT PULONG SelectedMenuItem,
78  IN BOOLEAN CanEscape,
81 
82 /* Definitions for corners, depending on HORIZ and VERT */
83 #define UL (0xda)
84 #define UR (0xbf) /* HORZ and VERT */
85 #define LL (0xc0)
86 #define LR (0xd9)
87 
88 #define D_UL (0xc9)
89 #define D_UR (0xbb) /* D_HORZ and D_VERT */
90 #define D_LL (0xc8)
91 #define D_LR (0xbc)
92 
93 #define HD_UL (0xd5)
94 #define HD_UR (0xb8) /* D_HORZ and VERT */
95 #define HD_LL (0xd4)
96 #define HD_LR (0xbe)
97 
98 #define VD_UL (0xd6)
99 #define VD_UR (0xb7) /* HORZ and D_VERT */
100 #define VD_LL (0xd3)
101 #define VD_LR (0xbd)
102 
103 extern const UIVTBL TuiVtbl;
signed char * PCHAR
Definition: retypes.h:7
#define IN
Definition: typedefs.h:38
UCHAR TuiTextToColor(PCSTR ColorText)
Definition: tui.c:700
int TuiPrintf(const char *format,...)
Definition: tui.c:31
VOID TuiMessageBoxCritical(PCSTR MessageText)
Definition: tui.c:562
void Fill(HDC hdc, LONG x, LONG y, COLORREF color)
Definition: drawing.cpp:109
#define Y(I)
VOID TuiUpdateDateTime(VOID)
Definition: tui.c:428
static COORD Position
Definition: mouse.c:34
VOID TuiRestoreScreen(PUCHAR Buffer)
Definition: tui.c:534
unsigned char * PUCHAR
Definition: retypes.h:3
char CHAR
Definition: xmlstorage.h:175
VOID TuiMessageBox(PCSTR MessageText)
Definition: tui.c:545
VOID TuiFadeInBackdrop(VOID)
Definition: tui.c:759
ULONG TuiProcessMenuKeyboardEvent(PUI_MENU_INFO MenuInfo, UiMenuKeyPressFilterCallback KeyPressFilter)
Definition: tuimenu.c:476
VOID TuiDrawMenuBox(PUI_MENU_INFO MenuInfo)
Definition: tuimenu.c:270
BOOLEAN TuiEditBox(PCSTR MessageText, PCHAR EditTextBuffer, ULONG Length)
Definition: tui.c:815
VOID TuiDrawMenuItem(PUI_MENU_INFO MenuInfo, ULONG MenuItemNumber)
Definition: tuimenu.c:395
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
long LONG
Definition: pedump.c:60
VOID TuiDrawShadow(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom)
Definition: tui.c:188
unsigned char BOOLEAN
Definition: bufpool.h:45
VOID TuiDrawBackdrop(VOID)
Definition: tui.c:83
VOID TuiDrawProgressBar(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, ULONG Position, ULONG Range, PCHAR ProgressText)
Definition: tui.c:663
VOID TuiUnInitialize(VOID)
Definition: tui.c:67
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
VOID TuiDrawProgressBarCenter(ULONG Position, ULONG Range, PCHAR ProgressText)
Definition: tui.c:648
unsigned char UCHAR
Definition: xmlstorage.h:181
BOOLEAN(* UiMenuKeyPressFilterCallback)(IN ULONG KeyPress, IN ULONG SelectedMenuItem, IN PVOID Context OPTIONAL)
Definition: ui.h:121
VOID TuiDrawText(ULONG X, ULONG Y, PCSTR Text, UCHAR Attr)
Definition: tui.c:320
BOOLEAN TuiInitialize(VOID)
Definition: tui.c:52
Definition: ui.h:145
Definition: range.c:39
menu info structure
Definition: window.h:275
UCHAR TuiTextToFillStyle(PCSTR FillStyleText)
Definition: tui.c:736
VOID TuiFadeOut(VOID)
Definition: tui.c:785
BOOLEAN TuiDisplayMenu(IN PCSTR MenuHeader, IN PCSTR MenuFooter OPTIONAL, IN BOOLEAN ShowBootOptions, IN PCSTR MenuItemList[], IN ULONG MenuItemCount, IN ULONG DefaultMenuItem, IN LONG MenuTimeOut, OUT PULONG SelectedMenuItem, IN BOOLEAN CanEscape, IN UiMenuKeyPressFilterCallback KeyPressFilter OPTIONAL, IN PVOID Context OPTIONAL)
Definition: tuimenu.c:17
VOID TuiCalcMenuBoxSize(PUI_MENU_INFO MenuInfo)
Definition: tuimenu.c:171
static LPHIST_ENTRY Bottom
Definition: history.c:54
VOID TuiDrawCenteredText(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, PCSTR TextString, UCHAR Attr)
Definition: tui.c:352
VOID TuiDrawText2(ULONG X, ULONG Y, ULONG MaxNumChars, PCSTR Text, UCHAR Attr)
Definition: tui.c:339
unsigned int * PULONG
Definition: retypes.h:1
VOID TuiFillArea(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, CHAR FillChar, UCHAR Attr)
Definition: tui.c:153
#define OUT
Definition: typedefs.h:39
VOID TuiDrawStatusText(PCSTR StatusText)
Definition: tui.c:413
VOID TuiDrawMenu(PUI_MENU_INFO MenuInfo)
Definition: tuimenu.c:233
unsigned int ULONG
Definition: retypes.h:1
VOID TuiSaveScreen(PUCHAR Buffer)
Definition: tui.c:523
VOID TuiDrawBox(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, UCHAR VertStyle, UCHAR HorzStyle, BOOLEAN Fill, BOOLEAN Shadow, UCHAR Attr)
Definition: tui.c:248
const char * PCSTR
Definition: typedefs.h:51
const UIVTBL TuiVtbl
Definition: tui.c:1048
static LPHIST_ENTRY Top
Definition: history.c:53
char * Text
Definition: combotst.c:136
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68