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