072ac5c794237217c647f31422a4612ed2e04de4
3 * Copyright (C) 1999, 2000 Brian Palmer <brianp@sginet.com>
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.
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.
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.
23 #define SCREEN_MEM 0xB8000
24 #define TITLE_BOX_HEIGHT 5
26 // Initialize Textual-User-Interface
27 BOOL
InitUserInterface(VOID
);
28 // Fills the entire screen with a backdrop
29 void DrawBackdrop(void);
30 // Fills the area specified with cFillChar and cAttr
31 void FillArea(int nLeft
, int nTop
, int nRight
, int nBottom
, char cFillChar
, char cAttr
/* Color Attributes */);
32 // Draws a shadow on the bottom and right sides of the area specified
33 void DrawShadow(int nLeft
, int nTop
, int nRight
, int nBottom
);
34 // Draws a box around the area specified
35 void DrawBox(int nLeft
, int nTop
, int nRight
, int nBottom
, int nVertStyle
, int nHorzStyle
, int bFill
, int bShadow
, char cAttr
);
36 // Draws text at coordinates specified
37 void DrawText(int nX
, int nY
, char *text
, char cAttr
);
38 // Draws text at the very bottom line on the screen
39 void DrawStatusText(char *text
);
40 // Updates the date and time
41 void UpdateDateTime(void);
42 // Saves the screen so that it can be restored later
43 void SaveScreen(char *buffer
);
44 // Restores the screen from a previous save
45 void RestoreScreen(char *buffer
);
46 // Displays a message box on the screen with an ok button
47 void MessageBox(char *text
);
48 // Adds a line of text to the message box buffer
49 void MessageLine(char *text
);
50 // Returns true if color is valid
51 BOOL
IsValidColor(char *color
);
52 // Converts the text color into it's equivalent color value
53 char TextToColor(char *color
);
54 // Returns true if fill is valid
55 BOOL
IsValidFillStyle(char *fill
);
56 // Converts the text fill into it's equivalent fill value
57 char TextToFillStyle(char *fill
);
58 // Draws the progress bar showing nPos percent filled
59 void DrawProgressBar(int nPos
);
62 * Combines the foreground and background colors into a single attribute byte
64 #define ATTR(cFore, cBack) ((cBack << 4)|cFore)
67 * Fill styles for DrawBackdrop()
69 #define LIGHT_FILL 0xB0
70 #define MEDIUM_FILL 0xB1
71 #define DARK_FILL 0xB2
81 #define COLOR_MAGENTA 5
85 #define COLOR_DARKGRAY 8
86 #define COLOR_LIGHTBLUE 9
87 #define COLOR_LIGHTGREEN 10
88 #define COLOR_LIGHTCYAN 11
89 #define COLOR_LIGHTRED 12
90 #define COLOR_LIGHTMAGENTA 13
91 #define COLOR_YELLOW 14
92 #define COLOR_WHITE 15
94 /* Add COLOR_BLINK to a background to cause blinking */
98 * Defines for IBM box drawing characters
100 #define HORZ (0xc4) /* Single horizontal line */
101 #define D_HORZ (0xcd) /* Double horizontal line.*/
102 #define VERT (0xb3) /* Single vertical line */
103 #define D_VERT (0xba) /* Double vertical line. */
105 /* Definitions for corners, depending on HORIZ and VERT */
107 #define UR (0xbf) /* HORZ and VERT */
112 #define D_UR (0xbb) /* D_HORZ and D_VERT */
117 #define HD_UR (0xb8) /* D_HORZ and VERT */
122 #define VD_UR (0xb7) /* HORZ and D_VERT */
127 #define KEY_EXTENDED 0x00
128 #define KEY_ENTER 0x0D
129 #define KEY_SPACE 0x20
131 #define KEY_DOWN 0x50
132 #define KEY_LEFT 0x4B
133 #define KEY_RIGHT 0x4D
146 #endif // #defined __TUI_H