ReactOS  0.4.14-dev-114-gc8cbd56
ui.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  tagUI_MENU_INFO
 
struct  tagUIVTBL
 

Macros

#define ATTR(cFore, cBack)   ((cBack << 4)|cFore)
 
#define LIGHT_FILL   0xB0
 
#define MEDIUM_FILL   0xB1
 
#define DARK_FILL   0xB2
 
#define COLOR_BLACK   0
 
#define COLOR_BLUE   1
 
#define COLOR_GREEN   2
 
#define COLOR_CYAN   3
 
#define COLOR_RED   4
 
#define COLOR_MAGENTA   5
 
#define COLOR_BROWN   6
 
#define COLOR_GRAY   7
 
#define COLOR_DARKGRAY   8
 
#define COLOR_LIGHTBLUE   9
 
#define COLOR_LIGHTGREEN   10
 
#define COLOR_LIGHTCYAN   11
 
#define COLOR_LIGHTRED   12
 
#define COLOR_LIGHTMAGENTA   13
 
#define COLOR_YELLOW   14
 
#define COLOR_WHITE   15
 
#define HORZ   (0xc4) /* Single horizontal line */
 
#define D_HORZ   (0xcd) /* Double horizontal line.*/
 
#define VERT   (0xb3) /* Single vertical line */
 
#define D_VERT   (0xba) /* Double vertical line. */
 

Typedefs

typedef struct tagUI_MENU_INFO UI_MENU_INFO
 
typedef struct tagUI_MENU_INFOPUI_MENU_INFO
 
typedef BOOLEAN(* UiMenuKeyPressFilterCallback) (IN ULONG KeyPress, IN ULONG SelectedMenuItem, IN PVOID Context OPTIONAL)
 
typedef struct tagUIVTBL UIVTBL
 
typedef struct tagUIVTBLPUIVTBL
 

Functions

BOOLEAN UiInitialize (BOOLEAN ShowGui)
 
VOID UiUnInitialize (PCSTR BootText)
 
VOID UiDrawBackdrop (VOID)
 
VOID UiFillArea (ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, CHAR FillChar, UCHAR Attr)
 
VOID UiDrawShadow (ULONG Left, ULONG Top, ULONG Right, ULONG Bottom)
 
VOID UiDrawBox (ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, UCHAR VertStyle, UCHAR HorzStyle, BOOLEAN Fill, BOOLEAN Shadow, UCHAR Attr)
 
VOID UiDrawText (ULONG X, ULONG Y, PCSTR Text, UCHAR Attr)
 
VOID UiDrawText2 (ULONG X, ULONG Y, ULONG MaxNumChars, PCSTR Text, UCHAR Attr)
 
VOID UiDrawCenteredText (ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, PCSTR TextString, UCHAR Attr)
 
VOID UiDrawStatusText (PCSTR StatusText)
 
VOID UiUpdateDateTime (VOID)
 
VOID UiInfoBox (PCSTR MessageText)
 
VOID UiMessageBox (PCSTR Format,...)
 
VOID UiMessageBoxCritical (PCSTR MessageText)
 
VOID UiDrawProgressBarCenter (ULONG Position, ULONG Range, PCHAR ProgressText)
 
VOID UiDrawProgressBar (ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, ULONG Position, ULONG Range, PCHAR ProgressText)
 
VOID UiShowMessageBoxesInSection (IN ULONG_PTR SectionId)
 
VOID UiShowMessageBoxesInArgv (IN ULONG Argc, IN PCHAR Argv[])
 
VOID UiEscapeString (PCHAR String)
 
BOOLEAN UiEditBox (PCSTR MessageText, PCHAR EditTextBuffer, ULONG Length)
 
UCHAR UiTextToColor (PCSTR ColorText)
 
UCHAR UiTextToFillStyle (PCSTR FillStyleText)
 
VOID UiTruncateStringEllipsis (PCHAR StringText, ULONG MaxChars)
 
VOID UiFadeInBackdrop (VOID)
 
VOID UiFadeOut (VOID)
 
BOOLEAN UiDisplayMenu (IN PCSTR MenuHeader, IN PCSTR MenuFooter OPTIONAL, IN BOOLEAN ShowBootOptions, IN PCSTR MenuItemList[], IN ULONG MenuItemCount, IN ULONG DefaultMenuItem, IN LONG MenuTimeOut, OUT PULONG SelectedMenuItem, IN BOOLEAN CanEscape, IN UiMenuKeyPressFilterCallback KeyPressFilter OPTIONAL, IN PVOID Context OPTIONAL)
 
VOID UiInit (const char *CmdLine)
 

Variables

ULONG UiScreenWidth
 
ULONG UiScreenHeight
 
UCHAR UiStatusBarFgColor
 
UCHAR UiStatusBarBgColor
 
UCHAR UiBackdropFgColor
 
UCHAR UiBackdropBgColor
 
UCHAR UiBackdropFillStyle
 
UCHAR UiTitleBoxFgColor
 
UCHAR UiTitleBoxBgColor
 
UCHAR UiMessageBoxFgColor
 
UCHAR UiMessageBoxBgColor
 
UCHAR UiMenuFgColor
 
UCHAR UiMenuBgColor
 
UCHAR UiTextColor
 
UCHAR UiSelectedTextColor
 
UCHAR UiSelectedTextBgColor
 
UCHAR UiEditBoxTextColor
 
UCHAR UiEditBoxBgColor
 
CHAR UiTitleBoxTitleText [260]
 
BOOLEAN UiUseSpecialEffects
 
BOOLEAN UiCenterMenu
 
BOOLEAN UiMenuBox
 
CHAR UiTimeText []
 
BOOLEAN UiDrawTime
 
const CHAR UiMonthNames [12][15]
 
UIVTBL UiVtbl
 

Macro Definition Documentation

◆ ATTR

#define ATTR (   cFore,
  cBack 
)    ((cBack << 4)|cFore)

Definition at line 192 of file ui.h.

◆ COLOR_BLACK

#define COLOR_BLACK   0

Definition at line 204 of file ui.h.

◆ COLOR_BLUE

#define COLOR_BLUE   1

Definition at line 205 of file ui.h.

◆ COLOR_BROWN

#define COLOR_BROWN   6

Definition at line 210 of file ui.h.

◆ COLOR_CYAN

#define COLOR_CYAN   3

Definition at line 207 of file ui.h.

◆ COLOR_DARKGRAY

#define COLOR_DARKGRAY   8

Definition at line 213 of file ui.h.

◆ COLOR_GRAY

#define COLOR_GRAY   7

Definition at line 211 of file ui.h.

◆ COLOR_GREEN

#define COLOR_GREEN   2

Definition at line 206 of file ui.h.

◆ COLOR_LIGHTBLUE

#define COLOR_LIGHTBLUE   9

Definition at line 214 of file ui.h.

◆ COLOR_LIGHTCYAN

#define COLOR_LIGHTCYAN   11

Definition at line 216 of file ui.h.

◆ COLOR_LIGHTGREEN

#define COLOR_LIGHTGREEN   10

Definition at line 215 of file ui.h.

◆ COLOR_LIGHTMAGENTA

#define COLOR_LIGHTMAGENTA   13

Definition at line 218 of file ui.h.

◆ COLOR_LIGHTRED

#define COLOR_LIGHTRED   12

Definition at line 217 of file ui.h.

◆ COLOR_MAGENTA

#define COLOR_MAGENTA   5

Definition at line 209 of file ui.h.

◆ COLOR_RED

#define COLOR_RED   4

Definition at line 208 of file ui.h.

◆ COLOR_WHITE

#define COLOR_WHITE   15

Definition at line 220 of file ui.h.

◆ COLOR_YELLOW

#define COLOR_YELLOW   14

Definition at line 219 of file ui.h.

◆ D_HORZ

#define D_HORZ   (0xcd) /* Double horizontal line.*/

Definition at line 229 of file ui.h.

◆ D_VERT

#define D_VERT   (0xba) /* Double vertical line. */

Definition at line 231 of file ui.h.

◆ DARK_FILL

#define DARK_FILL   0xB2

Definition at line 199 of file ui.h.

◆ HORZ

#define HORZ   (0xc4) /* Single horizontal line */

Definition at line 228 of file ui.h.

◆ LIGHT_FILL

#define LIGHT_FILL   0xB0

Definition at line 197 of file ui.h.

◆ MEDIUM_FILL

#define MEDIUM_FILL   0xB1

Definition at line 198 of file ui.h.

◆ VERT

#define VERT   (0xb3) /* Single vertical line */

Definition at line 230 of file ui.h.

Typedef Documentation

◆ PUI_MENU_INFO

◆ PUIVTBL

◆ UI_MENU_INFO

◆ UiMenuKeyPressFilterCallback

typedef BOOLEAN(* UiMenuKeyPressFilterCallback) (IN ULONG KeyPress, IN ULONG SelectedMenuItem, IN PVOID Context OPTIONAL)

Definition at line 121 of file ui.h.

◆ UIVTBL

Function Documentation

◆ UiDisplayMenu()

BOOLEAN UiDisplayMenu ( IN PCSTR  MenuHeader,
IN PCSTR MenuFooter  OPTIONAL,
IN BOOLEAN  ShowBootOptions,
IN PCSTR  MenuItemList[],
IN ULONG  MenuItemCount,
IN ULONG  DefaultMenuItem,
IN LONG  MenuTimeOut,
OUT PULONG  SelectedMenuItem,
IN BOOLEAN  CanEscape,
IN UiMenuKeyPressFilterCallback KeyPressFilter  OPTIONAL,
IN PVOID Context  OPTIONAL 
)

Definition at line 463 of file ui.c.

475 {
476  return UiVtbl.DisplayMenu(MenuHeader, MenuFooter, ShowBootOptions,
477  MenuItemList, MenuItemCount, DefaultMenuItem,
478  MenuTimeOut, SelectedMenuItem, CanEscape,
479  KeyPressFilter, Context);
480 }
UIVTBL UiVtbl
Definition: ui.c:58
BOOLEAN(* DisplayMenu)(IN PCSTR MenuHeader, IN PCSTR MenuFooter OPTIONAL, IN BOOLEAN ShowBootOptions, IN PCSTR MenuItemList[], IN ULONG MenuItemCount, IN ULONG DefaultMenuItem, IN LONG MenuTimeOut, OUT PULONG SelectedMenuItem, IN BOOLEAN CanEscape, IN UiMenuKeyPressFilterCallback KeyPressFilter OPTIONAL, IN PVOID Context OPTIONAL)
Definition: ui.h:169

Referenced by DoOptionsMenu(), and RunLoader().

◆ UiDrawBackdrop()

VOID UiDrawBackdrop ( VOID  )

◆ UiDrawBox()

VOID UiDrawBox ( ULONG  Left,
ULONG  Top,
ULONG  Right,
ULONG  Bottom,
UCHAR  VertStyle,
UCHAR  HorzStyle,
BOOLEAN  Fill,
BOOLEAN  Shadow,
UCHAR  Attr 
)

Definition at line 229 of file ui.c.

230 {
231  UiVtbl.DrawBox(Left, Top, Right, Bottom, VertStyle, HorzStyle, Fill, Shadow, Attr);
232 }
void Fill(HDC hdc, LONG x, LONG y, COLORREF color)
Definition: drawing.cpp:109
UIVTBL UiVtbl
Definition: ui.c:58
VOID(* DrawBox)(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, UCHAR VertStyle, UCHAR HorzStyle, BOOLEAN Fill, BOOLEAN Shadow, UCHAR Attr)
Definition: ui.h:153
static LPHIST_ENTRY Bottom
Definition: history.c:54
static LPHIST_ENTRY Top
Definition: history.c:53

Referenced by TuiDrawMenuBox(), and UiInfoBox().

◆ UiDrawCenteredText()

VOID UiDrawCenteredText ( ULONG  Left,
ULONG  Top,
ULONG  Right,
ULONG  Bottom,
PCSTR  TextString,
UCHAR  Attr 
)

Definition at line 244 of file ui.c.

245 {
246  UiVtbl.DrawCenteredText(Left, Top, Right, Bottom, TextString, Attr);
247 }
UIVTBL UiVtbl
Definition: ui.c:58
static LPHIST_ENTRY Bottom
Definition: history.c:54
VOID(* DrawCenteredText)(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, PCSTR TextString, UCHAR Attr)
Definition: ui.h:156
static LPHIST_ENTRY Top
Definition: history.c:53

Referenced by UiInfoBox().

◆ UiDrawProgressBar()

VOID UiDrawProgressBar ( ULONG  Left,
ULONG  Top,
ULONG  Right,
ULONG  Bottom,
ULONG  Position,
ULONG  Range,
PCHAR  ProgressText 
)

Definition at line 351 of file ui.c.

352 {
353  UiVtbl.DrawProgressBar(Left, Top, Right, Bottom, Position, Range, ProgressText);
354 }
static COORD Position
Definition: mouse.c:34
UIVTBL UiVtbl
Definition: ui.c:58
Definition: range.c:43
static LPHIST_ENTRY Bottom
Definition: history.c:54
VOID(* DrawProgressBar)(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, ULONG Position, ULONG Range, PCHAR ProgressText)
Definition: ui.h:162
static LPHIST_ENTRY Top
Definition: history.c:53

◆ UiDrawProgressBarCenter()

VOID UiDrawProgressBarCenter ( ULONG  Position,
ULONG  Range,
PCHAR  ProgressText 
)

Definition at line 346 of file ui.c.

347 {
348  UiVtbl.DrawProgressBarCenter(Position, Range, ProgressText);
349 }
static COORD Position
Definition: mouse.c:34
VOID(* DrawProgressBarCenter)(ULONG Position, ULONG Range, PCHAR ProgressText)
Definition: ui.h:161
UIVTBL UiVtbl
Definition: ui.c:58
Definition: range.c:43

Referenced by LoadAndBootWindows(), LoadAndBootWindowsCommon(), LoadModule(), LoadReactOSSetup(), and RamDiskLoadVirtualFile().

◆ UiDrawShadow()

VOID UiDrawShadow ( ULONG  Left,
ULONG  Top,
ULONG  Right,
ULONG  Bottom 
)

Definition at line 224 of file ui.c.

225 {
226  UiVtbl.DrawShadow(Left, Top, Right, Bottom);
227 }
UIVTBL UiVtbl
Definition: ui.c:58
VOID(* DrawShadow)(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom)
Definition: ui.h:152
static LPHIST_ENTRY Bottom
Definition: history.c:54
static LPHIST_ENTRY Top
Definition: history.c:53

◆ UiDrawStatusText()

VOID UiDrawStatusText ( PCSTR  StatusText)

Definition at line 249 of file ui.c.

250 {
251  UiVtbl.DrawStatusText(StatusText);
252 }
UIVTBL UiVtbl
Definition: ui.c:58
VOID(* DrawStatusText)(PCSTR StatusText)
Definition: ui.h:157

Referenced by LoadReactOSSetup(), TuiEditBox(), TuiMessageBoxCritical(), UiUnInitialize(), and WinLdrSetupEms().

◆ UiDrawText()

VOID UiDrawText ( ULONG  X,
ULONG  Y,
PCSTR  Text,
UCHAR  Attr 
)

Definition at line 234 of file ui.c.

235 {
236  UiVtbl.DrawText(X, Y, Text, Attr);
237 }
#define Y(I)
VOID(* DrawText)(ULONG X, ULONG Y, PCSTR Text, UCHAR Attr)
Definition: ui.h:154
UIVTBL UiVtbl
Definition: ui.c:58
char * Text
Definition: combotst.c:136

Referenced by DisplayBootTimeOptions(), TuiDrawMenuBox(), TuiDrawMenuItem(), TuiEditBox(), and TuiMessageBoxCritical().

◆ UiDrawText2()

VOID UiDrawText2 ( ULONG  X,
ULONG  Y,
ULONG  MaxNumChars,
PCSTR  Text,
UCHAR  Attr 
)

Definition at line 239 of file ui.c.

240 {
241  UiVtbl.DrawText2(X, Y, MaxNumChars, Text, Attr);
242 }
#define Y(I)
UIVTBL UiVtbl
Definition: ui.c:58
VOID(* DrawText2)(ULONG X, ULONG Y, ULONG MaxNumChars, PCSTR Text, UCHAR Attr)
Definition: ui.h:155
char * Text
Definition: combotst.c:136

Referenced by TuiEditBox().

◆ UiEditBox()

BOOLEAN UiEditBox ( PCSTR  MessageText,
PCHAR  EditTextBuffer,
ULONG  Length 
)

Definition at line 492 of file ui.c.

493 {
494  return UiVtbl.EditBox(MessageText, EditTextBuffer, Length);
495 }
UIVTBL UiVtbl
Definition: ui.c:58
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
BOOLEAN(* EditBox)(PCSTR MessageText, PCHAR EditTextBuffer, ULONG Length)
Definition: ui.h:163

Referenced by DoOptionsMenu(), and EditCustomBootReactOS().

◆ UiEscapeString()

VOID UiEscapeString ( PCHAR  String)

Definition at line 437 of file ui.c.

438 {
439  ULONG Idx;
440 
441  for (Idx=0; Idx<strlen(String); Idx++)
442  {
443  // Escape the new line characters
444  if (String[Idx] == '\\' && String[Idx+1] == 'n')
445  {
446  // Escape the character
447  String[Idx] = '\n';
448 
449  // Move the rest of the string up
450  strcpy(&String[Idx+1], &String[Idx+2]);
451  }
452  }
453 }
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
static WCHAR String[]
Definition: stringtable.c:55
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
unsigned int ULONG
Definition: retypes.h:1

Referenced by UiShowMessageBoxesInArgv(), and UiShowMessageBoxesInSection().

◆ UiFadeInBackdrop()

VOID UiFadeInBackdrop ( VOID  )

Definition at line 482 of file ui.c.

483 {
485 }
VOID(* FadeInBackdrop)(VOID)
Definition: ui.h:166
UIVTBL UiVtbl
Definition: ui.c:58

Referenced by UiInitialize().

◆ UiFadeOut()

VOID UiFadeOut ( VOID  )

Definition at line 487 of file ui.c.

488 {
489  UiVtbl.FadeOut();
490 }
UIVTBL UiVtbl
Definition: ui.c:58
VOID(* FadeOut)(VOID)
Definition: ui.h:167

◆ UiFillArea()

VOID UiFillArea ( ULONG  Left,
ULONG  Top,
ULONG  Right,
ULONG  Bottom,
CHAR  FillChar,
UCHAR  Attr 
)

Definition at line 219 of file ui.c.

220 {
221  UiVtbl.FillArea(Left, Top, Right, Bottom, FillChar, Attr);
222 }
UIVTBL UiVtbl
Definition: ui.c:58
VOID(* FillArea)(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, CHAR FillChar, UCHAR Attr)
Definition: ui.h:151
static LPHIST_ENTRY Bottom
Definition: history.c:54
static LPHIST_ENTRY Top
Definition: history.c:53

Referenced by TuiEditBox().

◆ UiInfoBox()

VOID UiInfoBox ( PCSTR  MessageText)

Definition at line 259 of file ui.c.

260 {
261  SIZE_T TextLength;
262  ULONG BoxWidth;
263  ULONG BoxHeight;
264  ULONG LineBreakCount;
265  SIZE_T Index;
266  SIZE_T LastIndex;
267  ULONG Left;
268  ULONG Top;
269  ULONG Right;
270  ULONG Bottom;
271 
272  TextLength = strlen(MessageText);
273 
274  // Count the new lines and the box width
275  LineBreakCount = 0;
276  BoxWidth = 0;
277  LastIndex = 0;
278  for (Index=0; Index<TextLength; Index++)
279  {
280  if (MessageText[Index] == '\n')
281  {
282  LastIndex = Index;
283  LineBreakCount++;
284  }
285  else
286  {
287  if ((Index - LastIndex) > BoxWidth)
288  {
289  BoxWidth = (ULONG)(Index - LastIndex);
290  }
291  }
292  }
293 
294  // Calc the box width & height
295  BoxWidth += 6;
296  BoxHeight = LineBreakCount + 4;
297 
298  // Calc the box coordinates
299  Left = (UiScreenWidth / 2) - (BoxWidth / 2);
300  Top =(UiScreenHeight / 2) - (BoxHeight / 2);
301  Right = (UiScreenWidth / 2) + (BoxWidth / 2);
302  Bottom = (UiScreenHeight / 2) + (BoxHeight / 2);
303 
304  // Draw the box
305  UiDrawBox(Left,
306  Top,
307  Right,
308  Bottom,
309  VERT,
310  HORZ,
311  TRUE,
312  TRUE,
314  );
315 
316  // Draw the text
317  UiDrawCenteredText(Left, Top, Right, Bottom, MessageText, ATTR(UiTextColor, UiMenuBgColor));
318 }
#define TRUE
Definition: types.h:120
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define HORZ
Definition: ui.h:228
ULONG UiScreenWidth
Definition: ui.c:28
#define ATTR(cFore, cBack)
Definition: ui.h:192
UCHAR UiTextColor
Definition: ui.c:42
VOID UiDrawBox(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, UCHAR VertStyle, UCHAR HorzStyle, BOOLEAN Fill, BOOLEAN Shadow, UCHAR Attr)
Definition: ui.c:229
static const UCHAR Index[8]
Definition: usbohci.c:18
VOID UiDrawCenteredText(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, PCSTR TextString, UCHAR Attr)
Definition: ui.c:244
ULONG UiScreenHeight
Definition: ui.c:29
UCHAR UiMenuBgColor
Definition: ui.c:41
ULONG_PTR SIZE_T
Definition: typedefs.h:78
static LPHIST_ENTRY Bottom
Definition: history.c:54
UCHAR UiMenuFgColor
Definition: ui.c:40
unsigned int ULONG
Definition: retypes.h:1
static LPHIST_ENTRY Top
Definition: history.c:53
#define VERT
Definition: ui.h:230

Referenced by UiUnInitialize().

◆ UiInit()

VOID UiInit ( const char CmdLine)

◆ UiInitialize()

BOOLEAN UiInitialize ( BOOLEAN  ShowGui)

Definition at line 84 of file ui.c.

85 {
86  VIDEODISPLAYMODE UiDisplayMode; // Tells us if we are in text or graphics mode
87  BOOLEAN UiMinimal = FALSE; // Tells us if we are using a minimal console-like UI
88  ULONG_PTR SectionId;
89  ULONG Depth;
90  CHAR SettingText[260];
91 
92  if (!ShowGui)
93  {
94  if (!UiVtbl.Initialize())
95  {
97  return FALSE;
98  }
99  return TRUE;
100  }
101 
102  TRACE("Initializing User Interface.\n");
103  TRACE("Reading UI settings from [Display] section.\n");
104 
105  /* Open the [Display] section */
106  if (!IniOpenSection("Display", &SectionId))
107  SectionId = 0;
108 
109  /* Select the video mode */
110  SettingText[0] = '\0';
111  if ((SectionId != 0) && !IniReadSettingByName(SectionId, "DisplayMode", SettingText, sizeof(SettingText)))
112  {
113  SettingText[0] = '\0';
114  }
115  UiDisplayMode = MachVideoSetDisplayMode(SettingText, TRUE);
117 
118  /* Select the UI */
119  if ((SectionId != 0) && IniReadSettingByName(SectionId, "MinimalUI", SettingText, sizeof(SettingText)))
120  {
121  UiMinimal = (_stricmp(SettingText, "Yes") == 0 && strlen(SettingText) == 3);
122  }
123 
124  if (UiDisplayMode == VideoTextMode)
125  UiVtbl = (UiMinimal ? MiniTuiVtbl : TuiVtbl);
126  else
127  UiVtbl = GuiVtbl;
128 
129  if (!UiVtbl.Initialize())
130  {
132  return FALSE;
133  }
134 
135  /* Load the settings */
136  if (SectionId != 0)
137  {
138  static const struct
139  {
140  PCSTR SettingName;
141  PVOID SettingVar;
142  UCHAR SettingType; // 0: Text, 1: Yes/No, 2: Color, 3: Fill style
143  } Settings[] =
144  {
145  {"TitleText", &UiTitleBoxTitleText, 0},
146  {"TimeText" , &UiTimeText , 0},
147 
148  {"SpecialEffects", &UiUseSpecialEffects, 1},
149  {"ShowTime" , &UiDrawTime , 1},
150  {"MenuBox" , &UiMenuBox , 1},
151  {"CenterMenu" , &UiCenterMenu , 1},
152 
153  {"BackdropColor" , &UiBackdropBgColor , 2},
154  {"BackdropTextColor" , &UiBackdropFgColor , 2},
155  {"StatusBarColor" , &UiStatusBarBgColor , 2},
156  {"StatusBarTextColor" , &UiStatusBarFgColor , 2},
157  {"TitleBoxColor" , &UiTitleBoxBgColor , 2},
158  {"TitleBoxTextColor" , &UiTitleBoxFgColor , 2},
159  {"MessageBoxColor" , &UiMessageBoxBgColor , 2},
160  {"MessageBoxTextColor", &UiMessageBoxFgColor , 2},
161  {"MenuColor" , &UiMenuBgColor , 2},
162  {"MenuTextColor" , &UiMenuFgColor , 2},
163  {"TextColor" , &UiTextColor , 2},
164  {"SelectedColor" , &UiSelectedTextBgColor, 2},
165  {"SelectedTextColor" , &UiSelectedTextColor , 2},
166  {"EditBoxColor" , &UiEditBoxBgColor , 2},
167  {"EditBoxTextColor" , &UiEditBoxTextColor , 2},
168 
169  {"BackdropFillStyle", &UiBackdropFillStyle, 3},
170  };
171  ULONG i;
172 
173  for (i = 0; i < sizeof(Settings)/sizeof(Settings[0]); ++i)
174  {
175  if (!IniReadSettingByName(SectionId, Settings[i].SettingName, SettingText, sizeof(SettingText)))
176  continue;
177 
178  switch (Settings[i].SettingType)
179  {
180  case 0: // Text
181  strcpy((PCHAR)Settings[i].SettingVar, SettingText);
182  break;
183  case 1: // Yes/No
184  *(PBOOLEAN)Settings[i].SettingVar = (_stricmp(SettingText, "Yes") == 0 && strlen(SettingText) == 3);
185  break;
186  case 2: // Color
187  *(PUCHAR)Settings[i].SettingVar = UiTextToColor(SettingText);
188  break;
189  case 3: // Fill style
190  *(PUCHAR)Settings[i].SettingVar = UiTextToFillStyle(SettingText);
191  break;
192  default:
193  break;
194  }
195  }
196  }
197 
198  /* Draw the backdrop and fade it in if special effects are enabled */
200 
201  TRACE("UiInitialize() returning TRUE.\n");
202  return TRUE;
203 }
signed char * PCHAR
Definition: retypes.h:7
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION _In_ ULONG _In_ SIZE_T _In_ ULONG _In_ USHORT Depth
Definition: exfuncs.h:656
#define TRUE
Definition: types.h:120
UCHAR UiStatusBarFgColor
Definition: ui.c:31
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
const UIVTBL MiniTuiVtbl
Definition: minitui.c:143
CHAR UiTimeText[260]
Definition: ui.c:54
UCHAR UiEditBoxTextColor
Definition: ui.c:45
#define MachVideoGetDisplaySize(W, H, D)
Definition: machine.h:96
unsigned char * PUCHAR
Definition: retypes.h:3
char CHAR
Definition: xmlstorage.h:175
UCHAR UiMessageBoxBgColor
Definition: ui.c:39
UCHAR UiTitleBoxFgColor
Definition: ui.c:36
BOOLEAN UiCenterMenu
Definition: ui.c:52
#define _stricmp
Definition: cat.c:22
UCHAR UiMessageBoxFgColor
Definition: ui.c:38
UCHAR UiBackdropFgColor
Definition: ui.c:33
uint32_t ULONG_PTR
Definition: typedefs.h:63
BOOLEAN UiMenuBox
Definition: ui.c:53
UCHAR UiTextToFillStyle(PCSTR FillStyleText)
Definition: ui.c:341
ULONG UiScreenWidth
Definition: ui.c:28
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
VOID UiFadeInBackdrop(VOID)
Definition: ui.c:482
UCHAR UiTitleBoxBgColor
Definition: ui.c:37
UIVTBL UiVtbl
Definition: ui.c:58
UCHAR UiStatusBarBgColor
Definition: ui.c:32
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
BOOLEAN UiUseSpecialEffects
Definition: ui.c:50
BOOLEAN UiDrawTime
Definition: ui.c:51
UCHAR UiTextColor
Definition: ui.c:42
BOOLEAN IniReadSettingByName(ULONG_PTR SectionId, PCSTR SettingName, PCHAR Buffer, ULONG BufferSize)
Definition: inifile.c:147
#define TRACE(s)
Definition: solgame.cpp:4
BOOLEAN(* Initialize)(VOID)
Definition: ui.h:147
BOOLEAN IniOpenSection(PCSTR SectionName, ULONG_PTR *SectionId)
Definition: inifile.c:25
UCHAR UiSelectedTextBgColor
Definition: ui.c:44
SETTINGS Settings
Definition: charmap.c:26
unsigned char UCHAR
Definition: xmlstorage.h:181
char * PBOOLEAN
Definition: retypes.h:11
UCHAR UiBackdropFillStyle
Definition: ui.c:35
UCHAR UiBackdropBgColor
Definition: ui.c:34
ULONG UiScreenHeight
Definition: ui.c:29
enum tagVIDEODISPLAYMODE VIDEODISPLAYMODE
UCHAR UiMenuBgColor
Definition: ui.c:41
CHAR UiTitleBoxTitleText[260]
Definition: ui.c:48
const UIVTBL GuiVtbl
Definition: gui.c:85
UCHAR UiTextToColor(PCSTR ColorText)
Definition: ui.c:336
#define MachVideoSetDisplayMode(Mode, Init)
Definition: machine.h:94
UCHAR UiMenuFgColor
Definition: ui.c:40
UCHAR UiSelectedTextColor
Definition: ui.c:43
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
unsigned int ULONG
Definition: retypes.h:1
const char * PCSTR
Definition: typedefs.h:51
const UIVTBL TuiVtbl
Definition: tui.c:1048
UCHAR UiEditBoxBgColor
Definition: ui.c:46

Referenced by BootMain(), and RunLoader().

◆ UiMessageBox()

VOID UiMessageBox ( PCSTR  Format,
  ... 
)

Definition at line 320 of file ui.c.

321 {
322  CHAR Buffer[256];
323  va_list ap;
324 
325  va_start(ap, Format);
326  vsnprintf(Buffer, sizeof(Buffer) - sizeof(CHAR), Format, ap);
328  va_end(ap);
329 }
#define vsnprintf
Definition: tif_win32.c:406
char CHAR
Definition: xmlstorage.h:175
#define va_end(ap)
Definition: acmsvcex.h:90
UIVTBL UiVtbl
Definition: ui.c:58
char * va_list
Definition: acmsvcex.h:78
Definition: bufpool.h:45
VOID(* MessageBox)(PCSTR MessageText)
Definition: ui.h:159
#define va_start(ap, A)
Definition: acmsvcex.h:91
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32

Referenced by AllocateAndInitLPB(), DiskError(), FileSystemError(), LoadAndBootWindows(), LoadAndBootWindowsCommon(), LoadReactOSSetup(), MempAllocatePageTables(), MsgBoxPrint(), PeLdrLoadImage(), RamDiskLoadVirtualFile(), RunLoader(), UiShowMessageBoxesInArgv(), UiShowMessageBoxesInSection(), WinLdrInitSystemHive(), WinLdrLoadBootDrivers(), WinLdrLoadNLSData(), WinLdrLoadSystemHive(), WinLdrScanSystemHive(), WinLdrSetupMachineDependent(), and WinLdrSetupMemoryLayout().

◆ UiMessageBoxCritical()

VOID UiMessageBoxCritical ( PCSTR  MessageText)

Definition at line 331 of file ui.c.

332 {
333  UiVtbl.MessageBoxCritical(MessageText);
334 }
UIVTBL UiVtbl
Definition: ui.c:58
VOID(* MessageBoxCritical)(PCSTR MessageText)
Definition: ui.h:160

Referenced by BootMain(), IniFileInitialize(), KeBugCheckEx(), MmAllocateHighestMemoryBelowAddress(), MmAllocateMemoryAtAddress(), MmAllocateMemoryWithType(), and RunLoader().

◆ UiShowMessageBoxesInArgv()

VOID UiShowMessageBoxesInArgv ( IN ULONG  Argc,
IN PCHAR  Argv[] 
)

Definition at line 401 of file ui.c.

404 {
405  ULONG LastIndex;
406  PCSTR ArgValue;
407  PCHAR MessageBoxText;
408  SIZE_T MessageBoxTextSize;
409 
410  /* Find all the message box settings and run them */
411  for (LastIndex = 0;
412  (ArgValue = GetNextArgumentValue(Argc, Argv, &LastIndex, "MessageBox")) != NULL;
413  ++LastIndex)
414  {
415  /* Get the real length of the MessageBox text */
416  MessageBoxTextSize = (strlen(ArgValue) + 1) * sizeof(CHAR);
417 
418  /* Allocate enough memory to hold the text */
419  MessageBoxText = FrLdrTempAlloc(MessageBoxTextSize, TAG_UI_TEXT);
420  if (!MessageBoxText)
421  continue;
422 
423  /* Get the MessageBox text */
424  strcpy(MessageBoxText, ArgValue);
425 
426  /* Fix it up */
427  UiEscapeString(MessageBoxText);
428 
429  /* Display it */
430  UiMessageBox(MessageBoxText);
431 
432  /* Free the memory */
433  FrLdrTempFree(MessageBoxText, TAG_UI_TEXT);
434  }
435 }
signed char * PCHAR
Definition: retypes.h:7
VOID UiEscapeString(PCHAR String)
Definition: ui.c:437
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
char CHAR
Definition: xmlstorage.h:175
PCHAR GetNextArgumentValue(IN ULONG Argc, IN PCHAR Argv[], IN OUT PULONG LastIndex OPTIONAL, IN PCHAR ArgumentName)
Definition: arcsupp.c:15
FORCEINLINE PVOID FrLdrTempAlloc(_In_ SIZE_T Size, _In_ ULONG Tag)
Definition: mm.h:177
smooth NULL
Definition: ftsmooth.c:416
#define TAG_UI_TEXT
Definition: ui.c:26
ULONG_PTR SIZE_T
Definition: typedefs.h:78
VOID UiMessageBox(PCSTR Format,...)
Definition: ui.c:320
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
unsigned int ULONG
Definition: retypes.h:1
const char * PCSTR
Definition: typedefs.h:51
FORCEINLINE VOID FrLdrTempFree(PVOID Allocation, ULONG Tag)
Definition: mm.h:186

◆ UiShowMessageBoxesInSection()

VOID UiShowMessageBoxesInSection ( IN ULONG_PTR  SectionId)

Definition at line 357 of file ui.c.

359 {
360  ULONG Idx;
361  CHAR SettingName[80];
362  CHAR SettingValue[80];
363  PCHAR MessageBoxText;
364  ULONG MessageBoxTextSize;
365 
366  if (SectionId == 0)
367  return;
368 
369  /* Find all the message box settings and run them */
370  for (Idx = 0; Idx < IniGetNumSectionItems(SectionId); Idx++)
371  {
372  IniReadSettingByNumber(SectionId, Idx, SettingName, sizeof(SettingName), SettingValue, sizeof(SettingValue));
373  if (_stricmp(SettingName, "MessageBox") != 0)
374  continue;
375 
376  /* Get the real length of the MessageBox text */
377  MessageBoxTextSize = IniGetSectionSettingValueSize(SectionId, Idx);
378  // if (MessageBoxTextSize <= 0)
379  // continue;
380 
381  /* Allocate enough memory to hold the text */
382  MessageBoxText = FrLdrTempAlloc(MessageBoxTextSize, TAG_UI_TEXT);
383  if (!MessageBoxText)
384  continue;
385 
386  /* Get the MessageBox text */
387  IniReadSettingByNumber(SectionId, Idx, SettingName, sizeof(SettingName), MessageBoxText, MessageBoxTextSize);
388 
389  /* Fix it up */
390  UiEscapeString(MessageBoxText);
391 
392  /* Display it */
393  UiMessageBox(MessageBoxText);
394 
395  /* Free the memory */
396  FrLdrTempFree(MessageBoxText, TAG_UI_TEXT);
397  }
398 }
signed char * PCHAR
Definition: retypes.h:7
VOID UiEscapeString(PCHAR String)
Definition: ui.c:437
char CHAR
Definition: xmlstorage.h:175
#define _stricmp
Definition: cat.c:22
FORCEINLINE PVOID FrLdrTempAlloc(_In_ SIZE_T Size, _In_ ULONG Tag)
Definition: mm.h:177
ULONG IniGetSectionSettingValueSize(ULONG_PTR SectionId, ULONG SettingIndex)
Definition: inifile.c:101
#define TAG_UI_TEXT
Definition: ui.c:26
VOID UiMessageBox(PCSTR Format,...)
Definition: ui.c:320
unsigned int ULONG
Definition: retypes.h:1
ULONG IniGetNumSectionItems(ULONG_PTR SectionId)
Definition: inifile.c:54
BOOLEAN IniReadSettingByNumber(ULONG_PTR SectionId, ULONG SettingNumber, PCHAR SettingName, ULONG NameSize, PCHAR SettingValue, ULONG ValueSize)
Definition: inifile.c:114
FORCEINLINE VOID FrLdrTempFree(PVOID Allocation, ULONG Tag)
Definition: mm.h:186

Referenced by RunLoader().

◆ UiTextToColor()

UCHAR UiTextToColor ( PCSTR  ColorText)

Definition at line 336 of file ui.c.

337 {
338  return UiVtbl.TextToColor(ColorText);
339 }
UCHAR(* TextToColor)(PCSTR ColorText)
Definition: ui.h:164
UIVTBL UiVtbl
Definition: ui.c:58

Referenced by UiInitialize().

◆ UiTextToFillStyle()

UCHAR UiTextToFillStyle ( PCSTR  FillStyleText)

Definition at line 341 of file ui.c.

342 {
343  return UiVtbl.TextToFillStyle(FillStyleText);
344 }
UIVTBL UiVtbl
Definition: ui.c:58
UCHAR(* TextToFillStyle)(PCSTR FillStyleText)
Definition: ui.h:165

Referenced by UiInitialize().

◆ UiTruncateStringEllipsis()

VOID UiTruncateStringEllipsis ( PCHAR  StringText,
ULONG  MaxChars 
)

Definition at line 455 of file ui.c.

456 {
457  /* If it's too large, just add some ellipsis past the maximum */
458  if (strlen(StringText) > MaxChars)
459  strcpy(&StringText[MaxChars - 3], "...");
460 }
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388

Referenced by MiniTuiDrawProgressBar(), and TuiDrawProgressBar().

◆ UiUnInitialize()

VOID UiUnInitialize ( PCSTR  BootText)

Definition at line 205 of file ui.c.

206 {
207  UiDrawBackdrop();
208  UiDrawStatusText(BootText);
209  UiInfoBox(BootText);
210 
212 }
VOID UiInfoBox(PCSTR MessageText)
Definition: ui.c:259
UIVTBL UiVtbl
Definition: ui.c:58
VOID UiDrawStatusText(PCSTR StatusText)
Definition: ui.c:249
VOID UiDrawBackdrop(VOID)
Definition: ui.c:214
VOID(* UnInitialize)(VOID)
Definition: ui.h:148

Referenced by RunLoader().

◆ UiUpdateDateTime()

VOID UiUpdateDateTime ( VOID  )

Definition at line 254 of file ui.c.

255 {
257 }
UIVTBL UiVtbl
Definition: ui.c:58
VOID(* UpdateDateTime)(VOID)
Definition: ui.h:158

Variable Documentation

◆ UiBackdropBgColor

UCHAR UiBackdropBgColor

Definition at line 34 of file ui.c.

Referenced by TuiDrawBackdrop(), and UiInitialize().

◆ UiBackdropFgColor

UCHAR UiBackdropFgColor

Definition at line 33 of file ui.c.

Referenced by TuiDrawBackdrop(), and UiInitialize().

◆ UiBackdropFillStyle

UCHAR UiBackdropFillStyle

Definition at line 35 of file ui.c.

Referenced by TuiDrawBackdrop(), and UiInitialize().

◆ UiCenterMenu

BOOLEAN UiCenterMenu

Definition at line 52 of file ui.c.

Referenced by TuiCalcMenuBoxSize(), TuiDrawMenuBox(), TuiDrawMenuItem(), and UiInitialize().

◆ UiDrawTime

BOOLEAN UiDrawTime

Definition at line 51 of file ui.c.

Referenced by TuiUpdateDateTime(), and UiInitialize().

◆ UiEditBoxBgColor

UCHAR UiEditBoxBgColor

Definition at line 46 of file ui.c.

Referenced by TuiEditBox(), and UiInitialize().

◆ UiEditBoxTextColor

UCHAR UiEditBoxTextColor

Definition at line 45 of file ui.c.

Referenced by TuiEditBox(), and UiInitialize().

◆ UiMenuBgColor

◆ UiMenuBox

BOOLEAN UiMenuBox

Definition at line 53 of file ui.c.

Referenced by TuiDrawMenuBox(), and UiInitialize().

◆ UiMenuFgColor

UCHAR UiMenuFgColor

◆ UiMessageBoxBgColor

UCHAR UiMessageBoxBgColor

Definition at line 39 of file ui.c.

Referenced by TuiEditBox(), TuiMessageBoxCritical(), and UiInitialize().

◆ UiMessageBoxFgColor

UCHAR UiMessageBoxFgColor

Definition at line 38 of file ui.c.

Referenced by TuiEditBox(), TuiMessageBoxCritical(), and UiInitialize().

◆ UiMonthNames

const CHAR UiMonthNames[12][15]

Definition at line 56 of file ui.c.

Referenced by TuiUpdateDateTime().

◆ UiScreenHeight

◆ UiScreenWidth

◆ UiSelectedTextBgColor

UCHAR UiSelectedTextBgColor

Definition at line 44 of file ui.c.

Referenced by TuiDrawMenuItem(), and UiInitialize().

◆ UiSelectedTextColor

UCHAR UiSelectedTextColor

Definition at line 43 of file ui.c.

Referenced by TuiDrawMenuItem(), and UiInitialize().

◆ UiStatusBarBgColor

UCHAR UiStatusBarBgColor

Definition at line 32 of file ui.c.

Referenced by TuiDrawStatusText(), and UiInitialize().

◆ UiStatusBarFgColor

UCHAR UiStatusBarFgColor

Definition at line 31 of file ui.c.

Referenced by TuiDrawStatusText(), and UiInitialize().

◆ UiTextColor

UCHAR UiTextColor

◆ UiTimeText

CHAR UiTimeText[]

Definition at line 54 of file ui.c.

Referenced by TuiDrawMenuBox(), and UiInitialize().

◆ UiTitleBoxBgColor

UCHAR UiTitleBoxBgColor

Definition at line 37 of file ui.c.

Referenced by TuiDrawBackdrop(), TuiUpdateDateTime(), and UiInitialize().

◆ UiTitleBoxFgColor

UCHAR UiTitleBoxFgColor

Definition at line 36 of file ui.c.

Referenced by TuiDrawBackdrop(), TuiUpdateDateTime(), and UiInitialize().

◆ UiTitleBoxTitleText

CHAR UiTitleBoxTitleText[260]

Definition at line 48 of file ui.c.

Referenced by TuiDrawBackdrop(), and UiInitialize().

◆ UiUseSpecialEffects

BOOLEAN UiUseSpecialEffects

Definition at line 50 of file ui.c.

Referenced by TuiFadeInBackdrop(), TuiFadeOut(), TuiUnInitialize(), and UiInitialize().

◆ UiVtbl