ReactOS 0.4.15-dev-6669-g8227c5d
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
104VOID TuiSaveScreen(PUCHAR Buffer); // Saves the screen so that it can be restored later
105VOID TuiRestoreScreen(PUCHAR Buffer); // Restores the screen from a previous save
106VOID TuiMessageBox(PCSTR MessageText); // Displays a message box on the screen with an ok button
107VOID TuiMessageBoxCritical(PCSTR MessageText); // Displays a message box on the screen with an ok button using no system resources
108
109BOOLEAN TuiEditBox(PCSTR MessageText, PCHAR EditTextBuffer, ULONG Length);
110UCHAR TuiTextToColor(PCSTR ColorText); // Converts the text color into it's equivalent color value
111UCHAR TuiTextToFillStyle(PCSTR FillStyleText); // Converts the text fill into it's equivalent fill value
112
113VOID TuiFadeInBackdrop(VOID); // Draws the backdrop and fades the screen in
114VOID TuiFadeOut(VOID); // Fades the screen out
115
116/* Menu Functions ************************************************************/
117
118VOID
121
122VOID
125
126VOID
129 _In_ ULONG MenuItemNumber);
130
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
168extern const UIVTBL TuiVtbl;
unsigned char BOOLEAN
static LPHIST_ENTRY Bottom
Definition: history.c:54
static LPHIST_ENTRY Top
Definition: history.c:53
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:108
#define _In_reads_or_z_(size)
Definition: ms_sal.h:325
#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:246
VOID TuiDrawCenteredText(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom, _In_ PCSTR TextString, _In_ UCHAR Attr)
Definition: tui.c:110
VOID TuiMessageBox(PCSTR MessageText)
Definition: tui.c:631
VOID TuiTruncateStringEllipsis(_Inout_z_ PSTR StringText, _In_ ULONG MaxChars)
Definition: tui.c:55
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:496
VOID TuiDrawShadow(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom)
Definition: tui.c:351
UCHAR TuiTextToColor(PCSTR ColorText)
Definition: tui.c:852
VOID TuiUnInitialize(VOID)
Definition: tui.c:241
VOID TuiDrawMenu(_In_ PUI_MENU_INFO MenuInfo)
Definition: tuimenu.c:191
VOID TuiRestoreScreen(PUCHAR Buffer)
Definition: tui.c:620
VOID TuiFillArea(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, CHAR FillChar, UCHAR Attr)
Definition: tui.c:321
UCHAR TuiTextToFillStyle(PCSTR FillStyleText)
Definition: tui.c:891
VOID TuiDrawText(_In_ ULONG X, _In_ ULONG Y, _In_ PCSTR Text, _In_ UCHAR Attr)
Definition: tui.c:70
VOID TuiDrawBackdrop(VOID)
Definition: tui.c:264
VOID TuiDrawStatusText(PCSTR StatusText)
Definition: tui.c:526
VOID TuiDrawBoxBottomLine(_In_ ULONG Left, _In_ ULONG Bottom, _In_ ULONG Right, _In_ UCHAR VertStyle, _In_ UCHAR HorzStyle, _In_ UCHAR Attr)
Definition: tui.c:452
VOID TuiFadeInBackdrop(VOID)
Definition: tui.c:915
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:87
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:541
VOID TuiMessageBoxCritical(PCSTR MessageText)
Definition: tui.c:648
BOOLEAN TuiInitialize(VOID)
Definition: tui.c:195
BOOLEAN TuiEditBox(PCSTR MessageText, PCHAR EditTextBuffer, ULONG Length)
Definition: tui.c:971
VOID TuiSaveScreen(PUCHAR Buffer)
Definition: tui.c:609
VOID TuiDrawBoxTopLine(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ UCHAR VertStyle, _In_ UCHAR HorzStyle, _In_ UCHAR Attr)
Definition: tui.c:408
VOID TuiDrawMenuItem(_In_ PUI_MENU_INFO MenuInfo, _In_ ULONG MenuItemNumber)
Definition: tuimenu.c:366
VOID TuiDrawMenuBox(_In_ PUI_MENU_INFO MenuInfo)
Definition: tuimenu.c:342
const UIVTBL TuiVtbl
Definition: tui.c:1204
VOID TuiFadeOut(VOID)
Definition: tui.c:941
INT TuiPrintf(_In_ PCSTR Format,...)
Definition: tui.c:31
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
BOOLEAN(* UiMenuKeyPressFilterCallback)(IN ULONG KeyPress, IN ULONG SelectedMenuItem, IN PVOID Context OPTIONAL)
Definition: ui.h:221
unsigned char UCHAR
Definition: xmlstorage.h:181
char CHAR
Definition: xmlstorage.h:175