ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

ui.h
Go to the documentation of this file.
00001 /*
00002  *  FreeLoader
00003  *  Copyright (C) 1998-2003  Brian Palmer  <brianp@sginet.com>
00004  *
00005  *  This program is free software; you can redistribute it and/or modify
00006  *  it under the terms of the GNU General Public License as published by
00007  *  the Free Software Foundation; either version 2 of the License, or
00008  *  (at your option) any later version.
00009  *
00010  *  This program is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *  GNU General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU General Public License along
00016  *  with this program; if not, write to the Free Software Foundation, Inc.,
00017  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00018  */
00019 
00020 #pragma once
00021 
00022 extern  ULONG       UiScreenWidth;                                  // Screen Width
00023 extern  ULONG       UiScreenHeight;                                 // Screen Height
00024 
00025 extern  UCHAR   UiStatusBarFgColor;                             // Status bar foreground color
00026 extern  UCHAR   UiStatusBarBgColor;                             // Status bar background color
00027 extern  UCHAR   UiBackdropFgColor;                              // Backdrop foreground color
00028 extern  UCHAR   UiBackdropBgColor;                              // Backdrop background color
00029 extern  UCHAR   UiBackdropFillStyle;                            // Backdrop fill style
00030 extern  UCHAR   UiTitleBoxFgColor;                              // Title box foreground color
00031 extern  UCHAR   UiTitleBoxBgColor;                              // Title box background color
00032 extern  UCHAR   UiMessageBoxFgColor;                            // Message box foreground color
00033 extern  UCHAR   UiMessageBoxBgColor;                            // Message box background color
00034 extern  UCHAR   UiMenuFgColor;                                  // Menu foreground color
00035 extern  UCHAR   UiMenuBgColor;                                  // Menu background color
00036 extern  UCHAR   UiTextColor;                                    // Normal text color
00037 extern  UCHAR   UiSelectedTextColor;                            // Selected text color
00038 extern  UCHAR   UiSelectedTextBgColor;                          // Selected text background color
00039 extern  UCHAR   UiEditBoxTextColor;                             // Edit box text color
00040 extern  UCHAR   UiEditBoxBgColor;                               // Edit box text background color
00041 
00042 extern  CHAR    UiTitleBoxTitleText[260];                       // Title box's title text
00043 
00044 extern  BOOLEAN UiUseSpecialEffects;                            // Tells us if we should use fade effects
00045 extern BOOLEAN UiCenterMenu;
00046 extern BOOLEAN UiMenuBox;
00047 extern CHAR UiTimeText[];
00048 extern BOOLEAN UiDrawTime;
00049 
00050 extern  const CHAR  UiMonthNames[12][15];
00051 
00053 //
00054 // User Interface Functions
00055 //
00057 BOOLEAN UiInitialize(BOOLEAN ShowGui);                              // Initialize User-Interface
00058 BOOLEAN SetupUiInitialize(VOID);                        // Initialize User-Interface
00059 VOID    UiUnInitialize(PCSTR BootText);                     // Un-initialize User-Interface
00060 VOID    UiDrawBackdrop(VOID);                                   // Fills the entire screen with a backdrop
00061 VOID    UiFillArea(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, CHAR FillChar, UCHAR Attr /* Color Attributes */); // Fills the area specified with FillChar and Attr
00062 VOID    UiDrawShadow(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom); // Draws a shadow on the bottom and right sides of the area specified
00063 VOID    UiDrawBox(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
00064 VOID    UiDrawText(ULONG X, ULONG Y, PCSTR Text, UCHAR Attr);   // Draws text at coordinates specified
00065 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
00066 VOID    UiDrawStatusText(PCSTR StatusText);                 // Draws text at the very bottom line on the screen
00067 VOID    UiUpdateDateTime(VOID);                                 // Updates the date and time
00068 VOID    UiInfoBox(PCSTR MessageText);                           // Displays a info box on the screen
00069 VOID    UiMessageBox(PCSTR MessageText);                        // Displays a message box on the screen with an ok button
00070 VOID    UiMessageBoxCritical(PCSTR MessageText);                // Displays a message box on the screen with an ok button using no system resources
00071 VOID    UiDrawProgressBarCenter(ULONG Position, ULONG Range, PCHAR ProgressText);           // Draws the progress bar showing nPos percent filled
00072 VOID    UiDrawProgressBar(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, ULONG Position, ULONG Range, PCHAR ProgressText);           // Draws the progress bar showing nPos percent filled
00073 VOID    UiShowMessageBoxesInSection(PCSTR SectionName);     // Displays all the message boxes in a given section
00074 VOID    UiEscapeString(PCHAR String);                           // Processes a string and changes all occurances of "\n" to '\n'
00075 BOOLEAN UiEditBox(PCSTR MessageText, PCHAR EditTextBuffer, ULONG Length);
00076 
00077 UCHAR   UiTextToColor(PCSTR ColorText);                     // Converts the text color into it's equivalent color value
00078 UCHAR   UiTextToFillStyle(PCSTR FillStyleText);             // Converts the text fill into it's equivalent fill value
00079 
00080 VOID    UiTruncateStringEllipsis(PCHAR StringText, ULONG MaxChars); // Truncates a string to MaxChars by adding an ellipsis on the end '...'
00081 
00082 VOID    UiFadeInBackdrop(VOID);                                 // Draws the backdrop and fades the screen in
00083 VOID    UiFadeOut(VOID);                                        // Fades the screen out
00084 
00086 //
00087 // Menu Functions
00088 //
00090 
00091 struct tagUI_MENU_INFO;
00092 typedef struct tagUI_MENU_INFO UI_MENU_INFO, *PUI_MENU_INFO;
00093 
00094 typedef BOOLEAN (*UiMenuKeyPressFilterCallback)(ULONG KeyPress);
00095 
00096 BOOLEAN UiDisplayMenu(PCSTR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenuItem, LONG MenuTimeOut, ULONG* SelectedMenuItem, BOOLEAN CanEscape, UiMenuKeyPressFilterCallback KeyPressFilter);
00097 
00099 //
00100 // UI virtual table
00101 //
00103 typedef struct tagUIVTBL
00104 {
00105     BOOLEAN (*Initialize)(VOID);
00106     VOID (*UnInitialize)(VOID);
00107 
00108     VOID (*DrawBackdrop)(VOID);
00109     VOID (*FillArea)(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, CHAR FillChar, UCHAR Attr);
00110     VOID (*DrawShadow)(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom);
00111     VOID (*DrawBox)(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, UCHAR VertStyle, UCHAR HorzStyle, BOOLEAN Fill, BOOLEAN Shadow, UCHAR Attr);
00112     VOID (*DrawText)(ULONG X, ULONG Y, PCSTR Text, UCHAR Attr);
00113     VOID (*DrawCenteredText)(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, PCSTR TextString, UCHAR Attr);
00114     VOID (*DrawStatusText)(PCSTR StatusText);
00115     VOID (*UpdateDateTime)(VOID);
00116     VOID (*MessageBox)(PCSTR MessageText);
00117     VOID (*MessageBoxCritical)(PCSTR MessageText);
00118     VOID (*DrawProgressBarCenter)(ULONG Position, ULONG Range, PCHAR ProgressText);
00119     VOID (*DrawProgressBar)(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, ULONG Position, ULONG Range, PCHAR ProgressText);
00120     BOOLEAN (*EditBox)(PCSTR MessageText, PCHAR EditTextBuffer, ULONG Length);
00121     UCHAR (*TextToColor)(PCSTR ColorText);
00122     UCHAR (*TextToFillStyle)(PCSTR FillStyleText);
00123     VOID (*FadeInBackdrop)(VOID);
00124     VOID (*FadeOut)(VOID);
00125 
00126     BOOLEAN (*DisplayMenu)(PCSTR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenuItem, LONG MenuTimeOut, ULONG* SelectedMenuItem, BOOLEAN CanEscape, UiMenuKeyPressFilterCallback KeyPressFilter);
00127     VOID (*DrawMenu)(PUI_MENU_INFO MenuInfo);
00128 } UIVTBL, *PUIVTBL;
00129 
00130 VOID UiInit(const char *CmdLine);
00131 
00132 extern UIVTBL UiVtbl;
00133 
00134 /*
00135  * Combines the foreground and background colors into a single attribute byte
00136  */
00137 #define ATTR(cFore, cBack)  ((cBack << 4)|cFore)
00138 
00139 /*
00140  * Fill styles for DrawBackdrop()
00141  */
00142 #define LIGHT_FILL          0xB0
00143 #define MEDIUM_FILL         0xB1
00144 #define DARK_FILL           0xB2
00145 
00146 /*
00147  * Screen colors
00148  */
00149 #define COLOR_BLACK         0
00150 #define COLOR_BLUE          1
00151 #define COLOR_GREEN         2
00152 #define COLOR_CYAN          3
00153 #define COLOR_RED           4
00154 #define COLOR_MAGENTA       5
00155 #define COLOR_BROWN         6
00156 #define COLOR_GRAY          7
00157 
00158 #define COLOR_DARKGRAY      8
00159 #define COLOR_LIGHTBLUE     9
00160 #define COLOR_LIGHTGREEN    10
00161 #define COLOR_LIGHTCYAN     11
00162 #define COLOR_LIGHTRED      12
00163 #define COLOR_LIGHTMAGENTA  13
00164 #define COLOR_YELLOW        14
00165 #define COLOR_WHITE         15
00166 
00167 /* Add COLOR_BLINK to a background to cause blinking */
00168 //#define COLOR_BLINK           8
00169 
00170 /*
00171  * Defines for IBM box drawing characters
00172  */
00173 #define HORZ    (0xc4)  /* Single horizontal line */
00174 #define D_HORZ  (0xcd)  /* Double horizontal line.*/
00175 #define VERT    (0xb3)  /* Single vertical line   */
00176 #define D_VERT  (0xba)  /* Double vertical line.  */

Generated on Sun May 27 2012 04:19:15 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.