41d5991c0880c6bbe5f6fb5f25c0891869c94a1e
[reactos.git] / reactos / boot / freeldr / freeldr / include / ui.h
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
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19
20 #ifndef __UI_H
21 #define __UI_H
22
23
24 extern ULONG UiScreenWidth; // Screen Width
25 extern ULONG UiScreenHeight; // Screen Height
26
27 extern UCHAR UiStatusBarFgColor; // Status bar foreground color
28 extern UCHAR UiStatusBarBgColor; // Status bar background color
29 extern UCHAR UiBackdropFgColor; // Backdrop foreground color
30 extern UCHAR UiBackdropBgColor; // Backdrop background color
31 extern UCHAR UiBackdropFillStyle; // Backdrop fill style
32 extern UCHAR UiTitleBoxFgColor; // Title box foreground color
33 extern UCHAR UiTitleBoxBgColor; // Title box background color
34 extern UCHAR UiMessageBoxFgColor; // Message box foreground color
35 extern UCHAR UiMessageBoxBgColor; // Message box background color
36 extern UCHAR UiMenuFgColor; // Menu foreground color
37 extern UCHAR UiMenuBgColor; // Menu background color
38 extern UCHAR UiTextColor; // Normal text color
39 extern UCHAR UiSelectedTextColor; // Selected text color
40 extern UCHAR UiSelectedTextBgColor; // Selected text background color
41 extern UCHAR UiEditBoxTextColor; // Edit box text color
42 extern UCHAR UiEditBoxBgColor; // Edit box text background color
43
44 extern CHAR UiTitleBoxTitleText[260]; // Title box's title text
45
46 extern BOOL UserInterfaceUp; // Tells us if the user interface is displayed
47
48 extern BOOL UiUseSpecialEffects; // Tells us if we should use fade effects
49 extern BOOL UiCenterMenu;
50 extern BOOL UiMenuBox;
51 extern BOOL UiMinimal;
52 extern CHAR UiTimeText[];
53
54 extern const CHAR UiMonthNames[12][15];
55
56 ///////////////////////////////////////////////////////////////////////////////////////
57 //
58 // User Interface Functions
59 //
60 ///////////////////////////////////////////////////////////////////////////////////////
61 BOOL UiInitialize(BOOLEAN ShowGui); // Initialize User-Interface
62 BOOL SetupUiInitialize(VOID); // Initialize User-Interface
63 VOID UiUnInitialize(PCSTR BootText); // Un-initialize User-Interface
64 VOID UiDrawBackdrop(VOID); // Fills the entire screen with a backdrop
65 VOID UiFillArea(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, CHAR FillChar, UCHAR Attr /* Color Attributes */); // Fills the area specified with FillChar and Attr
66 VOID UiDrawShadow(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom); // Draws a shadow on the bottom and right sides of the area specified
67 VOID UiDrawBox(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, UCHAR VertStyle, UCHAR HorzStyle, BOOL Fill, BOOL Shadow, UCHAR Attr); // Draws a box around the area specified
68 VOID UiDrawText(ULONG X, ULONG Y, PCSTR Text, UCHAR Attr); // Draws text at coordinates specified
69 VOID UiDrawCenteredText(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, PCSTR TextString, UCHAR Attr); // Draws centered text at the coordinates specified and clips the edges
70 VOID UiDrawStatusText(PCSTR StatusText); // Draws text at the very bottom line on the screen
71 VOID UiUpdateDateTime(VOID); // Updates the date and time
72 VOID UiInfoBox(PCSTR MessageText); // Displays a info box on the screen
73 VOID UiMessageBox(PCSTR MessageText); // Displays a message box on the screen with an ok button
74 VOID UiMessageBoxCritical(PCSTR MessageText); // Displays a message box on the screen with an ok button using no system resources
75 VOID UiDrawProgressBarCenter(ULONG Position, ULONG Range, PCHAR ProgressText); // Draws the progress bar showing nPos percent filled
76 VOID UiDrawProgressBar(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, ULONG Position, ULONG Range, PCHAR ProgressText); // Draws the progress bar showing nPos percent filled
77 VOID UiShowMessageBoxesInSection(PCSTR SectionName); // Displays all the message boxes in a given section
78 VOID UiEscapeString(PCHAR String); // Processes a string and changes all occurances of "\n" to '\n'
79 BOOL UiEditBox(PCSTR MessageText, PCHAR EditTextBuffer, ULONG Length);
80
81 UCHAR UiTextToColor(PCSTR ColorText); // Converts the text color into it's equivalent color value
82 UCHAR UiTextToFillStyle(PCSTR FillStyleText); // Converts the text fill into it's equivalent fill value
83
84 VOID UiTruncateStringEllipsis(PCHAR StringText, ULONG MaxChars); // Truncates a string to MaxChars by adding an ellipsis on the end '...'
85
86 VOID UiFadeInBackdrop(VOID); // Draws the backdrop and fades the screen in
87 VOID UiFadeOut(VOID); // Fades the screen out
88
89 ///////////////////////////////////////////////////////////////////////////////////////
90 //
91 // Menu Functions
92 //
93 ///////////////////////////////////////////////////////////////////////////////////////
94 typedef BOOL (*UiMenuKeyPressFilterCallback)(ULONG KeyPress);
95
96 BOOL UiDisplayMenu(PCSTR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenuItem, LONG MenuTimeOut, ULONG* SelectedMenuItem, BOOL CanEscape, UiMenuKeyPressFilterCallback KeyPressFilter);
97
98
99
100 #endif // #defined __UI_H