ReactOS  0.4.15-dev-4570-g4f8bbd1
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 /* GENERIC TUI UTILS *********************************************************/
23 
24 INT
25 TuiPrintf(
26  _In_ PCSTR Format, ...);
27 
28 VOID
30  _Inout_z_ PSTR StringText,
31  _In_ ULONG MaxChars);
32 
33 #define TUI_TITLE_BOX_CHAR_HEIGHT 5
34 
35 /* Textual User Interface Functions ******************************************/
36 
37 BOOLEAN TuiInitialize(VOID); // Initialize User-Interface
38 VOID TuiUnInitialize(VOID); // Un-initialize User-Interface
39 
40 VOID TuiDrawBackdrop(VOID); // Fills the entire screen with a backdrop
41 VOID TuiFillArea(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, CHAR FillChar, UCHAR Attr /* Color Attributes */); // Fills the area specified with FillChar and Attr
42 VOID TuiDrawShadow(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom); // Draws a shadow on the bottom and right sides of the area specified
43 
44 /* Draws a box around the area specified */
45 VOID
47  _In_ ULONG Left,
48  _In_ ULONG Top,
49  _In_ ULONG Right,
51  _In_ UCHAR VertStyle,
52  _In_ UCHAR HorzStyle,
54  _In_ BOOLEAN Shadow,
55  _In_ UCHAR Attr);
56 
57 VOID
59  _In_ ULONG Left,
60  _In_ ULONG Top,
61  _In_ ULONG Right,
62  _In_ UCHAR VertStyle,
63  _In_ UCHAR HorzStyle,
64  _In_ UCHAR Attr);
65 
66 VOID
68  _In_ ULONG Left,
70  _In_ ULONG Right,
71  _In_ UCHAR VertStyle,
72  _In_ UCHAR HorzStyle,
73  _In_ UCHAR Attr);
74 
75 /* Draws text at coordinates specified */
76 VOID
78  _In_ ULONG X,
79  _In_ ULONG Y,
80  _In_ PCSTR Text,
81  _In_ UCHAR Attr);
82 
83 /* Draws text at coordinates specified */
84 VOID
86  _In_ ULONG X,
87  _In_ ULONG Y,
88  _In_opt_ ULONG MaxNumChars,
89  _In_reads_or_z_(MaxNumChars) PCSTR Text,
90  _In_ UCHAR Attr);
91 
92 /* Draws centered text at the coordinates specified and clips the edges */
93 VOID
95  _In_ ULONG Left,
96  _In_ ULONG Top,
97  _In_ ULONG Right,
99  _In_ PCSTR TextString,
100  _In_ UCHAR Attr);
101 
102 VOID TuiDrawStatusText(PCSTR StatusText); // Draws text at the very bottom line on the screen
103 VOID TuiUpdateDateTime(VOID); // Updates the date and time
104 VOID TuiSaveScreen(PUCHAR Buffer); // Saves the screen so that it can be restored later
105 VOID TuiRestoreScreen(PUCHAR Buffer); // Restores the screen from a previous save
106 VOID TuiMessageBox(PCSTR MessageText); // Displays a message box on the screen with an ok button
107 VOID TuiMessageBoxCritical(PCSTR MessageText); // Displays a message box on the screen with an ok button using no system resources
108 
109 BOOLEAN TuiEditBox(PCSTR MessageText, PCHAR EditTextBuffer, ULONG Length);
110 UCHAR TuiTextToColor(PCSTR ColorText); // Converts the text color into it's equivalent color value
111 UCHAR TuiTextToFillStyle(PCSTR FillStyleText); // Converts the text fill into it's equivalent fill value
112 
113 VOID TuiFadeInBackdrop(VOID); // Draws the backdrop and fades the screen in
114 VOID TuiFadeOut(VOID); // Fades the screen out
115 
116 /* Menu Functions ************************************************************/
117 
118 VOID
121 
122 VOID
125 
126 VOID
129  _In_ ULONG MenuItemNumber);
130 
131 BOOLEAN
133  IN PCSTR MenuHeader,
134  IN PCSTR MenuFooter OPTIONAL,
135  IN BOOLEAN ShowBootOptions,
136  IN PCSTR MenuItemList[],
137  IN ULONG MenuItemCount,
138  IN ULONG DefaultMenuItem,
139  IN LONG MenuTimeOut,
140  OUT PULONG SelectedMenuItem,
141  IN BOOLEAN CanEscape,
144 
145 /*
146  * Definitions for corners, depending on HORZ and VERT
147  */
148 #define UL 0xDA /* HORZ and VERT */
149 #define UR 0xBF
150 #define LL 0xC0
151 #define LR 0xD9
152 
153 #define D_UL 0xC9 /* D_HORZ and D_VERT */
154 #define D_UR 0xBB
155 #define D_LL 0xC8
156 #define D_LR 0xBC
157 
158 #define HD_UL 0xD5 /* D_HORZ and VERT */
159 #define HD_UR 0xB8
160 #define HD_LL 0xD4
161 #define HD_LR 0xBE
162 
163 #define VD_UL 0xD6 /* HORZ and D_VERT */
164 #define VD_UR 0xB7
165 #define VD_LL 0xD3
166 #define VD_LR 0xBD
167 
168 extern const UIVTBL TuiVtbl;
signed char * PCHAR
Definition: retypes.h:7
#define IN
Definition: typedefs.h:39
VOID TuiDrawText(_In_ ULONG X, _In_ ULONG Y, _In_ PCSTR Text, _In_ UCHAR Attr)
Definition: tui.c:72
UCHAR TuiTextToColor(PCSTR ColorText)
Definition: tui.c:865
VOID TuiMessageBoxCritical(PCSTR MessageText)
Definition: tui.c:659
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
void Fill(HDC hdc, LONG x, LONG y, COLORREF color)
Definition: drawing.cpp:109
#define _In_opt_
Definition: ms_sal.h:309
#define Y(I)
VOID TuiUpdateDateTime(VOID)
Definition: tui.c:552
VOID TuiRestoreScreen(PUCHAR Buffer)
Definition: tui.c:631
VOID TuiDrawBoxTopLine(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ UCHAR VertStyle, _In_ UCHAR HorzStyle, _In_ UCHAR Attr)
Definition: tui.c:419
unsigned char * PUCHAR
Definition: retypes.h:3
char CHAR
Definition: xmlstorage.h:175
VOID TuiMessageBox(PCSTR MessageText)
Definition: tui.c:642
VOID TuiFadeInBackdrop(VOID)
Definition: tui.c:928
BOOLEAN TuiEditBox(PCSTR MessageText, PCHAR EditTextBuffer, ULONG Length)
Definition: tui.c:984
VOID TuiDrawBox(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom, _In_ UCHAR VertStyle, _In_ UCHAR HorzStyle, _In_ BOOLEAN Fill, _In_ BOOLEAN Shadow, _In_ UCHAR Attr)
Definition: tui.c:507
int32_t INT
Definition: typedefs.h:58
VOID TuiDrawText2(_In_ ULONG X, _In_ ULONG Y, _In_opt_ ULONG MaxNumChars, _In_reads_or_z_(MaxNumChars) PCSTR Text, _In_ UCHAR Attr)
Definition: tui.c:89
long LONG
Definition: pedump.c:60
VOID TuiDrawShadow(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom)
Definition: tui.c:362
unsigned char BOOLEAN
#define _In_
Definition: ms_sal.h:308
Definition: bufpool.h:45
VOID TuiDrawBackdrop(VOID)
Definition: tui.c:275
INT TuiPrintf(_In_ PCSTR Format,...)
Definition: tui.c:33
VOID TuiUnInitialize(VOID)
Definition: tui.c:252
VOID TuiDrawMenuItem(_In_ PUI_MENU_INFO MenuInfo, _In_ ULONG MenuItemNumber)
Definition: tuimenu.c:426
VOID TuiDrawMenu(_In_ PUI_MENU_INFO MenuInfo)
Definition: tuimenu.c:204
VOID TuiDrawCenteredText(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom, _In_ PCSTR TextString, _In_ UCHAR Attr)
Definition: tui.c:119
unsigned char UCHAR
Definition: xmlstorage.h:181
BOOLEAN(* UiMenuKeyPressFilterCallback)(IN ULONG KeyPress, IN ULONG SelectedMenuItem, IN PVOID Context OPTIONAL)
Definition: ui.h:221
BOOLEAN TuiInitialize(VOID)
Definition: tui.c:206
Definition: ui.h:245
menu info structure
Definition: window.h:275
UCHAR TuiTextToFillStyle(PCSTR FillStyleText)
Definition: tui.c:904
VOID TuiFadeOut(VOID)
Definition: tui.c:954
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:30
static LPHIST_ENTRY Bottom
Definition: history.c:54
VOID TuiDrawMenuBox(_In_ PUI_MENU_INFO MenuInfo)
Definition: tuimenu.c:400
VOID TuiDrawBoxBottomLine(_In_ ULONG Left, _In_ ULONG Bottom, _In_ ULONG Right, _In_ UCHAR VertStyle, _In_ UCHAR HorzStyle, _In_ UCHAR Attr)
Definition: tui.c:463
signed char * PSTR
Definition: retypes.h:7
unsigned int * PULONG
Definition: retypes.h:1
#define _In_reads_or_z_(size)
Definition: ms_sal.h:325
VOID TuiTruncateStringEllipsis(_Inout_z_ PSTR StringText, _In_ ULONG MaxChars)
Definition: tui.c:57
VOID TuiFillArea(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, CHAR FillChar, UCHAR Attr)
Definition: tui.c:332
#define OUT
Definition: typedefs.h:40
VOID TuiDrawStatusText(PCSTR StatusText)
Definition: tui.c:537
unsigned int ULONG
Definition: retypes.h:1
VOID TuiSaveScreen(PUCHAR Buffer)
Definition: tui.c:620
const char * PCSTR
Definition: typedefs.h:52
const UIVTBL TuiVtbl
Definition: tui.c:1217
static LPHIST_ENTRY Top
Definition: history.c:53
#define _Inout_z_
Definition: ms_sal.h:383
char * Text
Definition: combotst.c:136
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68