xref: /reactos/boot/freeldr/freeldr/include/ui/gui.h (revision 8a978a17)
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 TITLE_BOX_CHAR_HEIGHT        5
23 
24 ///////////////////////////////////////////////////////////////////////////////////////
25 //
26 // Graphical User Interface Functions
27 //
28 ///////////////////////////////////////////////////////////////////////////////////////
29 VOID    GuiDrawBackdrop(VOID);                                    // Fills the entire screen with a backdrop
30 VOID    GuiFillArea(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, UCHAR FillChar, UCHAR Attr /* Color Attributes */);    // Fills the area specified with FillChar and Attr
31 VOID    GuiDrawShadow(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom);    // Draws a shadow on the bottom and right sides of the area specified
32 VOID    GuiDrawBox(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
33 VOID    GuiDrawText(ULONG X, ULONG Y, PUCHAR Text, UCHAR Attr);    // Draws text at coordinates specified
34 VOID    GuiDrawText2(ULONG X, ULONG Y, ULONG MaxNumChars, PUCHAR Text, UCHAR Attr);    // Draws text at coordinates specified
35 VOID    GuiDrawStatusText(PCSTR StatusText);                    // Draws text at the very bottom line on the screen
36 VOID    GuiUpdateDateTime(VOID);                                // Updates the date and time
37 VOID    GuiSaveScreen(PUCHAR Buffer);                            // Saves the screen so that it can be restored later
38 VOID    GuiRestoreScreen(PUCHAR Buffer);                        // Restores the screen from a previous save
39 VOID    GuiMessageBox(PCSTR MessageText);                        // Displays a message box on the screen with an ok button
40 VOID    GuiMessageBoxCritical(PCSTR MessageText);                // Displays a message box on the screen with an ok button using no system resources
41 VOID    GuiDrawProgressBar(ULONG Position, ULONG Range);        // Draws the progress bar showing nPos percent filled
42 
43 UCHAR    GuiTextToColor(PCSTR ColorText);                        // Converts the text color into it's equivalent color value
44 UCHAR    GuiTextToFillStyle(PCSTR FillStyleText);                // Converts the text fill into it's equivalent fill value
45 
46 ///////////////////////////////////////////////////////////////////////////////////////
47 //
48 // Menu Functions
49 //
50 ///////////////////////////////////////////////////////////////////////////////////////
51 
52 BOOLEAN
53 GuiDisplayMenu(
54     IN PCSTR MenuHeader,
55     IN PCSTR MenuFooter OPTIONAL,
56     IN BOOLEAN ShowBootOptions,
57     IN PCSTR MenuItemList[],
58     IN ULONG MenuItemCount,
59     IN ULONG DefaultMenuItem,
60     IN LONG MenuTimeOut,
61     OUT PULONG SelectedMenuItem,
62     IN BOOLEAN CanEscape,
63     IN UiMenuKeyPressFilterCallback KeyPressFilter OPTIONAL,
64     IN PVOID Context OPTIONAL);
65 
66 extern const UIVTBL GuiVtbl;
67