ReactOS 0.4.15-dev-7958-gcd0bb1a
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
24INT
26 _In_ PCSTR Format, ...);
27
28VOID
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
37BOOLEAN TuiInitialize(VOID); // Initialize User-Interface
38VOID TuiUnInitialize(VOID); // Un-initialize User-Interface
39
40VOID TuiDrawBackdrop(VOID); // Fills the entire screen with a backdrop
41VOID TuiFillArea(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, CHAR FillChar, UCHAR Attr /* Color Attributes */); // Fills the area specified with FillChar and Attr
42VOID 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 */
45VOID
47 _In_ ULONG Left,
49 _In_ ULONG Right,
51 _In_ UCHAR VertStyle,
52 _In_ UCHAR HorzStyle,
54 _In_ BOOLEAN Shadow,
55 _In_ UCHAR Attr);
56
57VOID
59 _In_ ULONG Left,
61 _In_ ULONG Right,
62 _In_ UCHAR VertStyle,
63 _In_ UCHAR HorzStyle,
64 _In_ UCHAR Attr);
65
66VOID
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 */
76VOID
78 _In_ ULONG X,
79 _In_ ULONG Y,
81 _In_ UCHAR Attr);
82
83/* Draws text at coordinates specified */
84VOID
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 */
93VOID
95 _In_ ULONG Left,
97 _In_ ULONG Right,
99 _In_ PCSTR TextString,
100 _In_ UCHAR Attr);
101
102VOID TuiDrawStatusText(PCSTR StatusText); // Draws text at the very bottom line on the screen
103VOID TuiUpdateDateTime(VOID); // Updates the date and time
104
105/* Saves the screen so that it can be restored later */
108PUCHAR
109TuiSaveScreen(VOID);
110
111/* Restores the screen from a previous save */
112VOID
115
116/* Displays a message box on the screen with an ok button */
117VOID
119 _In_ PCSTR MessageText);
120
121/* Displays a message box on the screen with an ok button using no system resources */
122VOID
124 _In_ PCSTR MessageText);
125
126BOOLEAN TuiEditBox(PCSTR MessageText, PCHAR EditTextBuffer, ULONG Length);
127UCHAR TuiTextToColor(PCSTR ColorText); // Converts the text color into it's equivalent color value
128UCHAR TuiTextToFillStyle(PCSTR FillStyleText); // Converts the text fill into it's equivalent fill value
129
130VOID TuiFadeInBackdrop(VOID); // Draws the backdrop and fades the screen in
131VOID TuiFadeOut(VOID); // Fades the screen out
132
133/* Menu Functions ************************************************************/
134
135VOID
138
139VOID
142
143VOID
146 _In_ ULONG MenuItemNumber);
147
150 IN PCSTR MenuHeader,
151 IN PCSTR MenuFooter OPTIONAL,
152 IN BOOLEAN ShowBootOptions,
153 IN PCSTR MenuItemList[],
154 IN ULONG MenuItemCount,
155 IN ULONG DefaultMenuItem,
156 IN LONG MenuTimeOut,
157 OUT PULONG SelectedMenuItem,
158 IN BOOLEAN CanEscape,
161
162/*
163 * Definitions for corners, depending on HORZ and VERT
164 */
165#define UL 0xDA /* HORZ and VERT */
166#define UR 0xBF
167#define LL 0xC0
168#define LR 0xD9
169
170#define D_UL 0xC9 /* D_HORZ and D_VERT */
171#define D_UR 0xBB
172#define D_LL 0xC8
173#define D_LR 0xBC
174
175#define HD_UL 0xD5 /* D_HORZ and VERT */
176#define HD_UR 0xB8
177#define HD_LL 0xD4
178#define HD_LR 0xBE
179
180#define VD_UL 0xD6 /* HORZ and D_VERT */
181#define VD_UR 0xB7
182#define VD_LL 0xD3
183#define VD_LR 0xBD
184
185extern const UIVTBL TuiVtbl;
unsigned char BOOLEAN
static LPHIST_ENTRY Bottom
Definition: history.c:54
static LPHIST_ENTRY Top
Definition: history.c:53
BOOLEAN(* UiMenuKeyPressFilterCallback)(IN ULONG KeyPress, IN ULONG SelectedMenuItem, IN PVOID Context OPTIONAL)
Definition: ui.h:224
Definition: bufpool.h:45
char * Text
Definition: combotst.c:136
#define Y(I)
void Fill(HDC hdc, LONG x, LONG y, COLORREF color)
Definition: drawing.cpp:107
#define __drv_freesMem(kind)
Definition: driverspecs.h:272
#define __drv_allocatesMem(kind)
Definition: driverspecs.h:257
#define _In_reads_or_z_(size)
Definition: ms_sal.h:325
#define _Ret_maybenull_
Definition: ms_sal.h:529
#define _In_
Definition: ms_sal.h:308
#define _In_opt_
Definition: ms_sal.h:309
#define _Inout_z_
Definition: ms_sal.h:383
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
long LONG
Definition: pedump.c:60
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
menu info structure
Definition: window.h:276
Definition: ui.h:249
VOID TuiMessageBoxCritical(_In_ PCSTR MessageText)
Definition: tui.c:761
VOID TuiDrawCenteredText(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom, _In_ PCSTR TextString, _In_ UCHAR Attr)
Definition: tui.c:118
VOID TuiTruncateStringEllipsis(_Inout_z_ PSTR StringText, _In_ ULONG MaxChars)
Definition: tui.c:63
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:502
VOID TuiRestoreScreen(_In_opt_ __drv_freesMem(Mem) PUCHAR Buffer)
Definition: tui.c:640
VOID TuiDrawShadow(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom)
Definition: tui.c:359
UCHAR TuiTextToColor(PCSTR ColorText)
Definition: tui.c:919
VOID TuiUnInitialize(VOID)
Definition: tui.c:249
VOID TuiDrawMenu(_In_ PUI_MENU_INFO MenuInfo)
Definition: tuimenu.c:200
VOID TuiFillArea(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, CHAR FillChar, UCHAR Attr)
Definition: tui.c:329
UCHAR TuiTextToFillStyle(PCSTR FillStyleText)
Definition: tui.c:958
VOID TuiDrawText(_In_ ULONG X, _In_ ULONG Y, _In_ PCSTR Text, _In_ UCHAR Attr)
Definition: tui.c:78
VOID TuiDrawBackdrop(VOID)
Definition: tui.c:272
VOID TuiDrawStatusText(PCSTR StatusText)
Definition: tui.c:532
VOID TuiDrawBoxBottomLine(_In_ ULONG Left, _In_ ULONG Bottom, _In_ ULONG Right, _In_ UCHAR VertStyle, _In_ UCHAR HorzStyle, _In_ UCHAR Attr)
Definition: tui.c:458
VOID TuiFadeInBackdrop(VOID)
Definition: tui.c:982
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:95
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
VOID TuiUpdateDateTime(VOID)
Definition: tui.c:547
BOOLEAN TuiInitialize(VOID)
Definition: tui.c:203
BOOLEAN TuiEditBox(PCSTR MessageText, PCHAR EditTextBuffer, ULONG Length)
Definition: tui.c:1038
VOID TuiDrawBoxTopLine(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ UCHAR VertStyle, _In_ UCHAR HorzStyle, _In_ UCHAR Attr)
Definition: tui.c:414
VOID TuiDrawMenuItem(_In_ PUI_MENU_INFO MenuInfo, _In_ ULONG MenuItemNumber)
Definition: tuimenu.c:375
VOID TuiDrawMenuBox(_In_ PUI_MENU_INFO MenuInfo)
Definition: tuimenu.c:351
const UIVTBL TuiVtbl
Definition: tui.c:1219
VOID TuiFadeOut(VOID)
Definition: tui.c:1008
VOID TuiMessageBox(_In_ PCSTR MessageText)
Definition: tui.c:745
INT TuiPrintf(_In_ PCSTR Format,...)
Definition: tui.c:39
uint32_t * PULONG
Definition: typedefs.h:59
char * PSTR
Definition: typedefs.h:51
int32_t INT
Definition: typedefs.h:58
const char * PCSTR
Definition: typedefs.h:52
#define IN
Definition: typedefs.h:39
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
char * PCHAR
Definition: typedefs.h:51
unsigned char UCHAR
Definition: xmlstorage.h:181
char CHAR
Definition: xmlstorage.h:175