Forgot to add a semi-colon at end of statement
[reactos.git] / freeldr / freeldr / tui.h
1 /*
2 * FreeLoader
3 * Copyright (C) 1999, 2000 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 __TUI_H
21 #define __TUI_H
22
23 #define SCREEN_MEM 0xB8000
24
25 extern int nScreenWidth; // Screen Width
26 extern int nScreenHeight; // Screen Height
27
28 extern char cStatusBarFgColor; // Status bar foreground color
29 extern char cStatusBarBgColor; // Status bar background color
30 extern char cBackdropFgColor; // Backdrop foreground color
31 extern char cBackdropBgColor; // Backdrop background color
32 extern char cBackdropFillStyle; // Backdrop fill style
33 extern char cTitleBoxFgColor; // Title box foreground color
34 extern char cTitleBoxBgColor; // Title box background color
35 extern char cMessageBoxFgColor; // Message box foreground color
36 extern char cMessageBoxBgColor; // Message box background color
37 extern char cMenuFgColor; // Menu foreground color
38 extern char cMenuBgColor; // Menu background color
39 extern char cTextColor; // Normal text color
40 extern char cSelectedTextColor; // Selected text color
41 extern char cSelectedTextBgColor; // Selected text background color
42 extern char szTitleBoxTitleText[260]; // Title box's title text
43
44 // Fills the entire screen with a backdrop
45 void DrawBackdrop(void);
46 // Fills the area specified with cFillChar and cAttr
47 void FillArea(int nLeft, int nTop, int nRight, int nBottom, char cFillChar, char cAttr /* Color Attributes */);
48 // Draws a shadow on the bottom and right sides of the area specified
49 void DrawShadow(int nLeft, int nTop, int nRight, int nBottom);
50 // Draws a box around the area specified
51 void DrawBox(int nLeft, int nTop, int nRight, int nBottom, int nVertStyle, int nHorzStyle, int bFill, int bShadow, char cAttr);
52 // Draws text at coordinates specified
53 void DrawText(int nX, int nY, char *text, char cAttr);
54 // Draws text at the very bottom line on the screen
55 void DrawStatusText(char *text);
56 // Updates the date and time
57 void UpdateDateTime(void);
58 // Saves the screen so that it can be restored later
59 void SaveScreen(char *buffer);
60 // Restores the screen from a previous save
61 void RestoreScreen(char *buffer);
62 // Displays a message box on the screen with an ok button
63 void MessageBox(char *text);
64 // Adds a line of text to the message box buffer
65 void MessageLine(char *text);
66 // Returns true if color is valid
67 BOOL IsValidColor(char *color);
68 // Converts the text color into it's equivalent color value
69 char TextToColor(char *color);
70 // Returns true if fill is valid
71 BOOL IsValidFillStyle(char *fill);
72 // Converts the text fill into it's equivalent fill value
73 char TextToFillStyle(char *fill);
74 // Draws the progress bar showing nPos percent filled
75 void DrawProgressBar(int nPos);
76
77 /*
78 * Combines the foreground and background colors into a single attribute byte
79 */
80 #define ATTR(cFore, cBack) ((cBack << 4)|cFore)
81
82 /*
83 * Fill styles for DrawBackdrop()
84 */
85 #define LIGHT_FILL 0xB0
86 #define MEDIUM_FILL 0xB1
87 #define DARK_FILL 0xB2
88
89 /*
90 * Screen colors
91 */
92 #define COLOR_BLACK 0
93 #define COLOR_BLUE 1
94 #define COLOR_GREEN 2
95 #define COLOR_CYAN 3
96 #define COLOR_RED 4
97 #define COLOR_MAGENTA 5
98 #define COLOR_BROWN 6
99 #define COLOR_GRAY 7
100
101 #define COLOR_DARKGRAY 8
102 #define COLOR_LIGHTBLUE 9
103 #define COLOR_LIGHTGREEN 10
104 #define COLOR_LIGHTCYAN 11
105 #define COLOR_LIGHTRED 12
106 #define COLOR_LIGHTMAGENTA 13
107 #define COLOR_YELLOW 14
108 #define COLOR_WHITE 15
109
110 /* Add COLOR_BLINK to a background to cause blinking */
111 #define COLOR_BLINK 8
112
113 /*
114 * Defines for IBM box drawing characters
115 */
116 #define HORZ (0xc4) /* Single horizontal line */
117 #define D_HORZ (0xcd) /* Double horizontal line.*/
118 #define VERT (0xb3) /* Single vertical line */
119 #define D_VERT (0xba) /* Double vertical line. */
120
121 /* Definitions for corners, depending on HORIZ and VERT */
122 #define UL (0xda)
123 #define UR (0xbf) /* HORZ and VERT */
124 #define LL (0xc0)
125 #define LR (0xd9)
126
127 #define D_UL (0xc9)
128 #define D_UR (0xbb) /* D_HORZ and D_VERT */
129 #define D_LL (0xc8)
130 #define D_LR (0xbc)
131
132 #define HD_UL (0xd5)
133 #define HD_UR (0xb8) /* D_HORZ and VERT */
134 #define HD_LL (0xd4)
135 #define HD_LR (0xbe)
136
137 #define VD_UL (0xd6)
138 #define VD_UR (0xb7) /* HORZ and D_VERT */
139 #define VD_LL (0xd3)
140 #define VD_LR (0xbd)
141
142 // Key codes
143 #define KEY_EXTENDED 0x00
144 #define KEY_ENTER 0x0D
145 #define KEY_SPACE 0x20
146 #define KEY_UP 0x48
147 #define KEY_DOWN 0x50
148 #define KEY_LEFT 0x4B
149 #define KEY_RIGHT 0x4D
150 #define KEY_ESC 0x1B
151 #define KEY_F1 0x3B
152 #define KEY_F2 0x3C
153 #define KEY_F3 0x3D
154 #define KEY_F4 0x3E
155 #define KEY_F5 0x3F
156 #define KEY_F6 0x40
157 #define KEY_F7 0x41
158 #define KEY_F8 0x42
159 #define KEY_F9 0x43
160 #define KEY_F10 0x44
161
162 #endif // #defined __TUI_H