ReactOS  0.4.15-dev-5126-g3bb451b
ui.c
Go to the documentation of this file.
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 #include <freeldr.h>
21 
22 #include <debug.h>
24 
25 #ifndef _M_ARM
26 
27 UCHAR UiStatusBarFgColor; // Status bar foreground color
28 UCHAR UiStatusBarBgColor; // Status bar background color
29 UCHAR UiBackdropFgColor; // Backdrop foreground color
30 UCHAR UiBackdropBgColor; // Backdrop background color
31 UCHAR UiBackdropFillStyle; // Backdrop fill style
32 UCHAR UiTitleBoxFgColor; // Title box foreground color
33 UCHAR UiTitleBoxBgColor; // Title box background color
34 UCHAR UiMessageBoxFgColor; // Message box foreground color
35 UCHAR UiMessageBoxBgColor; // Message box background color
36 UCHAR UiMenuFgColor; // Menu foreground color
37 UCHAR UiMenuBgColor; // Menu background color
38 UCHAR UiTextColor; // Normal text color
39 UCHAR UiSelectedTextColor; // Selected text color
40 UCHAR UiSelectedTextBgColor; // Selected text background color
41 UCHAR UiEditBoxTextColor; // Edit box text color
42 UCHAR UiEditBoxBgColor; // Edit box text background color
43 
44 BOOLEAN UiShowTime; // Whether to draw the time
45 BOOLEAN UiMenuBox; // Whether to draw a box around the menu
46 BOOLEAN UiCenterMenu; // Whether to use a centered or left-aligned menu
47 BOOLEAN UiUseSpecialEffects; // Whether to use fade effects
48 
49 CHAR UiTitleBoxTitleText[260] = "Boot Menu"; // Title box's title text
50 CHAR UiTimeText[260] = "[Time Remaining: %d]";
51 
52 const PCSTR UiMonthNames[12] = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" };
53 
54 #define TAG_UI_TEXT 'xTiU'
55 
56 ULONG UiScreenWidth; // Screen Width
57 ULONG UiScreenHeight; // Screen Height
58 
59 #endif // _M_ARM
60 
61 /*
62  * Loading progress bar, based on the NTOS Inbv one.
63  * Supports progress within sub-ranges, used when loading
64  * with an unknown number of steps.
65  */
67 
68 #ifndef _M_ARM
69 
71 {
96 };
97 
99 {
100  VIDEODISPLAYMODE UiDisplayMode; // Tells us if we are in text or graphics mode
101  BOOLEAN UiMinimal = FALSE; // Tells us if we are using a minimal console-like UI
102  ULONG_PTR SectionId;
103  ULONG Depth;
104  CHAR SettingText[260];
105 
106  if (!ShowUi)
107  {
108  if (!UiVtbl.Initialize())
109  {
111  return FALSE;
112  }
113  return TRUE;
114  }
115 
116  TRACE("Initializing User Interface.\n");
117  TRACE("Reading UI settings from [Display] section.\n");
118 
119  /* Open the [Display] section */
120  if (!IniOpenSection("Display", &SectionId))
121  SectionId = 0;
122 
123  /* Select the video mode */
124  SettingText[0] = '\0';
125  if ((SectionId != 0) && !IniReadSettingByName(SectionId, "DisplayMode", SettingText, sizeof(SettingText)))
126  {
127  SettingText[0] = '\0';
128  }
129  UiDisplayMode = MachVideoSetDisplayMode(SettingText, TRUE);
131 
132  /* Select the UI */
133  if ((SectionId != 0) && IniReadSettingByName(SectionId, "MinimalUI", SettingText, sizeof(SettingText)))
134  {
135  UiMinimal = (_stricmp(SettingText, "Yes") == 0);
136  }
137 
138  if (UiDisplayMode == VideoGraphicsMode)
139 #if 0 // We don't support a GUI mode yet.
140  UiVtbl = GuiVtbl;
141 #else
142  {
143  // Switch back to text mode.
145  UiDisplayMode = VideoTextMode;
146  }
147 #endif
148  else // if (UiDisplayMode == VideoTextMode)
149  UiVtbl = (UiMinimal ? MiniTuiVtbl : TuiVtbl);
150 
151  /* Load the UI and initialize its default settings */
152  if (!UiVtbl.Initialize())
153  {
155  return FALSE;
156  }
157 
158  /* Load the user UI settings */
159  if (SectionId != 0)
160  {
161  static const struct
162  {
163  PCSTR SettingName;
164  PVOID SettingVar;
165  SIZE_T SettingSize OPTIONAL; // Must be non-zero only for text buffers.
166  UCHAR SettingType; // 0: Text, 1: Yes/No, 2: Color, 3: Fill style
167  } Settings[] =
168  {
169  {"TitleText", &UiTitleBoxTitleText, sizeof(UiTitleBoxTitleText), 0},
170  {"TimeText" , &UiTimeText, sizeof(UiTimeText), 0},
171 
172  {"ShowTime" , &UiShowTime , 0, 1},
173  {"MenuBox" , &UiMenuBox , 0, 1},
174  {"CenterMenu" , &UiCenterMenu , 0, 1},
175  {"SpecialEffects", &UiUseSpecialEffects, 0, 1},
176 
177  {"BackdropColor" , &UiBackdropBgColor , 0, 2},
178  {"BackdropTextColor" , &UiBackdropFgColor , 0, 2},
179  {"StatusBarColor" , &UiStatusBarBgColor , 0, 2},
180  {"StatusBarTextColor" , &UiStatusBarFgColor , 0, 2},
181  {"TitleBoxColor" , &UiTitleBoxBgColor , 0, 2},
182  {"TitleBoxTextColor" , &UiTitleBoxFgColor , 0, 2},
183  {"MessageBoxColor" , &UiMessageBoxBgColor , 0, 2},
184  {"MessageBoxTextColor", &UiMessageBoxFgColor , 0, 2},
185  {"MenuColor" , &UiMenuBgColor , 0, 2},
186  {"MenuTextColor" , &UiMenuFgColor , 0, 2},
187  {"TextColor" , &UiTextColor , 0, 2},
188  {"SelectedColor" , &UiSelectedTextBgColor, 0, 2},
189  {"SelectedTextColor" , &UiSelectedTextColor , 0, 2},
190  {"EditBoxColor" , &UiEditBoxBgColor , 0, 2},
191  {"EditBoxTextColor" , &UiEditBoxTextColor , 0, 2},
192 
193  {"BackdropFillStyle", &UiBackdropFillStyle, 0, 3},
194  };
195  ULONG i;
196 
197  for (i = 0; i < RTL_NUMBER_OF(Settings); ++i)
198  {
199  if (!IniReadSettingByName(SectionId, Settings[i].SettingName, SettingText, sizeof(SettingText)))
200  continue;
201 
202  switch (Settings[i].SettingType)
203  {
204  case 0: // Text
205  RtlStringCbCopyA((PCHAR)Settings[i].SettingVar,
206  Settings[i].SettingSize, SettingText);
207  break;
208  case 1: // Yes/No
209  *(PBOOLEAN)Settings[i].SettingVar = (_stricmp(SettingText, "Yes") == 0);
210  break;
211  case 2: // Color
212  *(PUCHAR)Settings[i].SettingVar = UiTextToColor(SettingText);
213  break;
214  case 3: // Fill style
215  *(PUCHAR)Settings[i].SettingVar = UiTextToFillStyle(SettingText);
216  break;
217  default:
218  break;
219  }
220  }
221  }
222 
223  /* Draw the backdrop and fade it in if special effects are enabled */
225 
226  TRACE("UiInitialize() returning TRUE.\n");
227  return TRUE;
228 }
229 
231 {
232  UiDrawBackdrop();
233  UiDrawStatusText(BootText);
234  UiInfoBox(BootText);
235 
237 }
238 
240 {
242 }
243 
244 VOID UiFillArea(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, CHAR FillChar, UCHAR Attr /* Color Attributes */)
245 {
246  UiVtbl.FillArea(Left, Top, Right, Bottom, FillChar, Attr);
247 }
248 
250 {
251  UiVtbl.DrawShadow(Left, Top, Right, Bottom);
252 }
253 
254 VOID UiDrawBox(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, UCHAR VertStyle, UCHAR HorzStyle, BOOLEAN Fill, BOOLEAN Shadow, UCHAR Attr)
255 {
256  UiVtbl.DrawBox(Left, Top, Right, Bottom, VertStyle, HorzStyle, Fill, Shadow, Attr);
257 }
258 
259 VOID
261  _In_ ULONG X,
262  _In_ ULONG Y,
263  _In_ PCSTR Text,
264  _In_ UCHAR Attr)
265 {
266  UiVtbl.DrawText(X, Y, Text, Attr);
267 }
268 
269 VOID
271  _In_ ULONG X,
272  _In_ ULONG Y,
273  _In_opt_ ULONG MaxNumChars,
274  _In_reads_or_z_(MaxNumChars) PCSTR Text,
275  _In_ UCHAR Attr)
276 {
277  UiVtbl.DrawText2(X, Y, MaxNumChars, Text, Attr);
278 }
279 
280 VOID
282  _In_ ULONG Left,
283  _In_ ULONG Top,
284  _In_ ULONG Right,
285  _In_ ULONG Bottom,
286  _In_ PCSTR TextString,
287  _In_ UCHAR Attr)
288 {
289  UiVtbl.DrawCenteredText(Left, Top, Right, Bottom, TextString, Attr);
290 }
291 
293 {
294  UiVtbl.DrawStatusText(StatusText);
295 }
296 
298 {
300 }
301 
302 VOID UiInfoBox(PCSTR MessageText)
303 {
304  SIZE_T TextLength;
305  ULONG BoxWidth;
306  ULONG BoxHeight;
307  ULONG LineBreakCount;
308  SIZE_T Index;
309  SIZE_T LastIndex;
310  ULONG Left;
311  ULONG Top;
312  ULONG Right;
313  ULONG Bottom;
314 
315  TextLength = strlen(MessageText);
316 
317  // Count the new lines and the box width
318  LineBreakCount = 0;
319  BoxWidth = 0;
320  LastIndex = 0;
321  for (Index=0; Index<TextLength; Index++)
322  {
323  if (MessageText[Index] == '\n')
324  {
325  LastIndex = Index;
326  LineBreakCount++;
327  }
328  else
329  {
330  if ((Index - LastIndex) > BoxWidth)
331  {
332  BoxWidth = (ULONG)(Index - LastIndex);
333  }
334  }
335  }
336 
337  // Calc the box width & height
338  BoxWidth += 6;
339  BoxHeight = LineBreakCount + 4;
340 
341  // Calc the box coordinates
342  Left = (UiScreenWidth / 2) - (BoxWidth / 2);
343  Top =(UiScreenHeight / 2) - (BoxHeight / 2);
344  Right = (UiScreenWidth / 2) + (BoxWidth / 2);
345  Bottom = (UiScreenHeight / 2) + (BoxHeight / 2);
346 
347  // Draw the box
348  UiDrawBox(Left,
349  Top,
350  Right,
351  Bottom,
352  VERT,
353  HORZ,
354  TRUE,
355  TRUE,
357  );
358 
359  // Draw the text
360  UiDrawCenteredText(Left, Top, Right, Bottom, MessageText, ATTR(UiTextColor, UiMenuBgColor));
361 }
362 
364 {
365  CHAR Buffer[256];
366  va_list ap;
367 
368  va_start(ap, Format);
369  vsnprintf(Buffer, sizeof(Buffer) - sizeof(CHAR), Format, ap);
371  va_end(ap);
372 }
373 
375 {
376  UiVtbl.MessageBoxCritical(MessageText);
377 }
378 
380 {
381  return UiVtbl.TextToColor(ColorText);
382 }
383 
385 {
386  return UiVtbl.TextToFillStyle(FillStyleText);
387 }
388 
389 #endif // _M_ARM
390 
391 VOID
393  _In_ ULONG Left,
394  _In_ ULONG Top,
395  _In_ ULONG Right,
396  _In_ ULONG Bottom,
397  _In_ PCSTR ProgressText)
398 {
399  /* Progress bar area */
400  UiProgressBar.Left = Left;
402  UiProgressBar.Right = Right;
404  // UiProgressBar.Width = Right - Left + 1;
405 
406  /* Set the progress bar ranges */
407  UiSetProgressBarSubset(0, 100);
408  UiProgressBar.Indicator.Count = 0;
409  UiProgressBar.Indicator.Expected = 25;
410  UiProgressBar.Indicator.Percentage = 0;
411 
412  /* Enable the progress bar */
414 
415  /* Initial drawing: set the "Loading..." text and the original position */
416 #ifndef _M_ARM
417  UiVtbl.SetProgressBarText(ProgressText);
419 #else
420  MiniTuiSetProgressBarText(ProgressText);
422 #endif
423 }
424 
425 VOID
427 {
428  ULONG Percentage;
429 
430  /* Increase progress */
431  UiProgressBar.Indicator.Count++;
432 
433  /* Compute the new percentage - Don't go over 100% */
434  Percentage = 100 * UiProgressBar.Indicator.Count /
435  UiProgressBar.Indicator.Expected;
436  Percentage = min(Percentage, 99);
437 
438  if (Percentage != UiProgressBar.Indicator.Percentage)
439  {
440  /* Percentage has changed, update the progress bar */
441  UiProgressBar.Indicator.Percentage = Percentage;
442  UiUpdateProgressBar(Percentage, NULL);
443  }
444 }
445 
446 VOID
448  _In_ ULONG Floor,
449  _In_ ULONG Ceiling)
450 {
451  /* Sanity checks */
452  ASSERT(Floor < Ceiling);
453  ASSERT(Ceiling <= 100);
454 
455  /* Update the progress bar state */
456  UiProgressBar.State.Floor = Floor * 100;
457  // UiProgressBar.State.Ceiling = Ceiling * 100;
458  UiProgressBar.State.Bias = Ceiling - Floor;
459 }
460 
461 VOID
463  _In_ ULONG Percentage,
464  _In_opt_ PCSTR ProgressText)
465 {
466  ULONG TotalProgress;
467 
468  /* Make sure the progress bar is enabled */
469  if (!UiProgressBar.Show)
470  return;
471 
472  /* Set the progress text if specified */
473  if (ProgressText)
474  UiSetProgressBarText(ProgressText);
475 
476  /* Compute the total progress and tick the progress bar */
477  TotalProgress = UiProgressBar.State.Floor + (Percentage * UiProgressBar.State.Bias);
478  // TotalProgress /= (100 * 100);
479 
480 #ifndef _M_ARM
481  UiVtbl.TickProgressBar(TotalProgress);
482 #else
483  MiniTuiTickProgressBar(TotalProgress);
484 #endif
485 }
486 
487 VOID
489  _In_ PCSTR ProgressText)
490 {
491  /* Make sure the progress bar is enabled */
492  if (!UiProgressBar.Show)
493  return;
494 
495 #ifndef _M_ARM
496  UiVtbl.SetProgressBarText(ProgressText);
497 #else
498  MiniTuiSetProgressBarText(ProgressText);
499 #endif
500 }
501 
502 VOID
504  _In_ PCSTR ProgressText)
505 {
506 #ifndef _M_ARM
507  UiVtbl.DrawProgressBarCenter(ProgressText);
508 #else
509  MiniTuiDrawProgressBarCenter(ProgressText);
510 #endif
511 }
512 
513 VOID
515  _In_ ULONG Left,
516  _In_ ULONG Top,
517  _In_ ULONG Right,
518  _In_ ULONG Bottom,
519  _In_ PCSTR ProgressText)
520 {
521 #ifndef _M_ARM
522  UiVtbl.DrawProgressBar(Left, Top, Right, Bottom, ProgressText);
523 #else
524  MiniTuiDrawProgressBar(Left, Top, Right, Bottom, ProgressText);
525 #endif
526 }
527 
528 #ifndef _M_ARM
529 
530 static VOID
532 {
533  ULONG Idx;
534 
535  for (Idx=0; Idx<strlen(String); Idx++)
536  {
537  // Escape the new line characters
538  if (String[Idx] == '\\' && String[Idx+1] == 'n')
539  {
540  // Escape the character
541  String[Idx] = '\n';
542 
543  // Move the rest of the string up
544  strcpy(&String[Idx+1], &String[Idx+2]);
545  }
546  }
547 }
548 
549 VOID
551  IN ULONG_PTR SectionId)
552 {
553  ULONG Idx;
554  CHAR SettingName[80];
555  CHAR SettingValue[80];
556  PCHAR MessageBoxText;
557  ULONG MessageBoxTextSize;
558 
559  if (SectionId == 0)
560  return;
561 
562  /* Find all the message box settings and run them */
563  for (Idx = 0; Idx < IniGetNumSectionItems(SectionId); Idx++)
564  {
565  IniReadSettingByNumber(SectionId, Idx, SettingName, sizeof(SettingName), SettingValue, sizeof(SettingValue));
566  if (_stricmp(SettingName, "MessageBox") != 0)
567  continue;
568 
569  /* Get the real length of the MessageBox text */
570  MessageBoxTextSize = IniGetSectionSettingValueSize(SectionId, Idx);
571  // if (MessageBoxTextSize <= 0)
572  // continue;
573 
574  /* Allocate enough memory to hold the text */
575  MessageBoxText = FrLdrTempAlloc(MessageBoxTextSize, TAG_UI_TEXT);
576  if (!MessageBoxText)
577  continue;
578 
579  /* Get the MessageBox text */
580  IniReadSettingByNumber(SectionId, Idx, SettingName, sizeof(SettingName), MessageBoxText, MessageBoxTextSize);
581 
582  /* Fix it up */
583  UiEscapeString(MessageBoxText);
584 
585  /* Display it */
586  UiMessageBox(MessageBoxText);
587 
588  /* Free the memory */
589  FrLdrTempFree(MessageBoxText, TAG_UI_TEXT);
590  }
591 }
592 
593 VOID
595  IN ULONG Argc,
596  IN PCHAR Argv[])
597 {
598  ULONG LastIndex;
599  PCSTR ArgValue;
600  PCHAR MessageBoxText;
601  SIZE_T MessageBoxTextSize;
602 
603  /* Find all the message box settings and run them */
604  for (LastIndex = 0;
605  (ArgValue = GetNextArgumentValue(Argc, Argv, &LastIndex, "MessageBox")) != NULL;
606  ++LastIndex)
607  {
608  /* Get the real length of the MessageBox text */
609  MessageBoxTextSize = (strlen(ArgValue) + 1) * sizeof(CHAR);
610 
611  /* Allocate enough memory to hold the text */
612  MessageBoxText = FrLdrTempAlloc(MessageBoxTextSize, TAG_UI_TEXT);
613  if (!MessageBoxText)
614  continue;
615 
616  /* Get the MessageBox text */
617  strcpy(MessageBoxText, ArgValue);
618 
619  /* Fix it up */
620  UiEscapeString(MessageBoxText);
621 
622  /* Display it */
623  UiMessageBox(MessageBoxText);
624 
625  /* Free the memory */
626  FrLdrTempFree(MessageBoxText, TAG_UI_TEXT);
627  }
628 }
629 
630 BOOLEAN
632  IN PCSTR MenuHeader,
633  IN PCSTR MenuFooter OPTIONAL,
634  IN BOOLEAN ShowBootOptions,
635  IN PCSTR MenuItemList[],
636  IN ULONG MenuItemCount,
637  IN ULONG DefaultMenuItem,
638  IN LONG MenuTimeOut,
639  OUT PULONG SelectedMenuItem,
640  IN BOOLEAN CanEscape,
643 {
644  return UiVtbl.DisplayMenu(MenuHeader, MenuFooter, ShowBootOptions,
645  MenuItemList, MenuItemCount, DefaultMenuItem,
646  MenuTimeOut, SelectedMenuItem, CanEscape,
647  KeyPressFilter, Context);
648 }
649 
651 {
653 }
654 
656 {
657  UiVtbl.FadeOut();
658 }
659 
660 BOOLEAN UiEditBox(PCSTR MessageText, PCHAR EditTextBuffer, ULONG Length)
661 {
662  return UiVtbl.EditBox(MessageText, EditTextBuffer, Length);
663 }
664 
665 #else
666 BOOLEAN UiEditBox(PCSTR MessageText, PCHAR EditTextBuffer, ULONG Length)
667 {
668  return FALSE;
669 }
670 #endif
signed char * PCHAR
Definition: retypes.h:7
#define vsnprintf
Definition: tif_win32.c:406
#define IN
Definition: typedefs.h:39
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION _In_ ULONG _In_ SIZE_T _In_ ULONG _In_ USHORT Depth
Definition: exfuncs.h:814
struct _UI_PROGRESS_BAR::@174 Indicator
BOOLEAN UiShowTime
Definition: ui.c:44
const UIVTBL GuiVtbl
Definition: gui.c:85
UCHAR NoUiTextToColor(PCSTR ColorText)
Definition: noui.c:139
VOID NoUiFadeOut(VOID)
Definition: noui.c:153
VOID(* DrawProgressBar)(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom, _In_ PCSTR ProgressText)
Definition: ui.h:265
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
void Fill(HDC hdc, LONG x, LONG y, COLORREF color)
Definition: drawing.cpp:109
#define _In_opt_
Definition: ms_sal.h:309
BOOLEAN NoUiInitialize(VOID)
Definition: noui.c:12
static VOID UiEscapeString(PCHAR String)
Definition: ui.c:531
BOOLEAN NoUiDisplayMenu(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: noui.c:164
VOID UiDrawText2(_In_ ULONG X, _In_ ULONG Y, _In_opt_ ULONG MaxNumChars, _In_reads_or_z_(MaxNumChars) PCSTR Text, _In_ UCHAR Attr)
Definition: ui.c:270
#define Y(I)
UCHAR UiStatusBarFgColor
Definition: ui.c:27
VOID NoUiDrawProgressBarCenter(_In_ PCSTR ProgressText)
Definition: noui.c:118
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
BOOLEAN UiEditBox(PCSTR MessageText, PCHAR EditTextBuffer, ULONG Length)
Definition: ui.c:660
const UIVTBL MiniTuiVtbl
Definition: minitui.c:249
VOID(* DrawText)(ULONG X, ULONG Y, PCSTR Text, UCHAR Attr)
Definition: ui.h:254
#define TRUE
Definition: types.h:120
CHAR UiTimeText[260]
Definition: ui.c:50
UCHAR UiEditBoxTextColor
Definition: ui.c:41
VOID MiniTuiTickProgressBar(_In_ ULONG SubPercentTimes100)
Definition: minitui.c:115
#define MachVideoGetDisplaySize(W, H, D)
Definition: machine.h:96
unsigned char * PUCHAR
Definition: retypes.h:3
char CHAR
Definition: xmlstorage.h:175
VOID UiInfoBox(PCSTR MessageText)
Definition: ui.c:302
VOID NoUiDrawCenteredText(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom, _In_ PCSTR TextString, _In_ UCHAR Attr)
Definition: noui.c:61
VOID UiFadeOut(VOID)
Definition: ui.c:655
VOID UiDrawText(_In_ ULONG X, _In_ ULONG Y, _In_ PCSTR Text, _In_ UCHAR Attr)
Definition: ui.c:260
#define HORZ
Definition: ui.h:343
VOID NoUiDrawStatusText(PCSTR StatusText)
Definition: noui.c:72
VOID NoUiDrawBox(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, UCHAR VertStyle, UCHAR HorzStyle, BOOLEAN Fill, BOOLEAN Shadow, UCHAR Attr)
Definition: noui.c:33
BOOLEAN NoUiEditBox(PCSTR MessageText, PCHAR EditTextBuffer, ULONG Length)
Definition: noui.c:134
UCHAR UiMessageBoxBgColor
Definition: ui.c:35
VOID NoUiTickProgressBar(_In_ ULONG SubPercentTimes100)
Definition: noui.c:112
UCHAR UiTitleBoxFgColor
Definition: ui.c:32
BOOLEAN UiCenterMenu
Definition: ui.c:46
VOID UiUpdateProgressBar(_In_ ULONG Percentage, _In_opt_ PCSTR ProgressText)
Definition: ui.c:462
VOID UiIndicateProgress(VOID)
Definition: ui.c:426
VOID(* FadeInBackdrop)(VOID)
Definition: ui.h:281
VOID NoUiDrawShadow(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom)
Definition: noui.c:29
#define _stricmp
Definition: cat.c:22
UCHAR UiMessageBoxFgColor
Definition: ui.c:34
VOID UiInitProgressBar(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom, _In_ PCSTR ProgressText)
Definition: ui.c:392
UCHAR UiBackdropFgColor
Definition: ui.c:29
uint32_t ULONG_PTR
Definition: typedefs.h:65
NTSTRSAFEAPI RtlStringCbCopyA(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cbDest, _In_ NTSTRSAFE_PCSTR pszSrc)
Definition: ntstrsafe.h:156
BOOLEAN UiMenuBox
Definition: ui.c:45
UCHAR UiTextToFillStyle(PCSTR FillStyleText)
Definition: ui.c:384
ULONG UiScreenWidth
Definition: ui.c:56
UCHAR(* TextToColor)(PCSTR ColorText)
Definition: ui.h:279
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_POWER_POLICY_IDLE_SETTINGS Settings
Definition: wdfdevice.h:2592
VOID NoUiUpdateDateTime(VOID)
Definition: noui.c:77
VOID UiShowMessageBoxesInArgv(IN ULONG Argc, IN PCHAR Argv[])
Definition: ui.c:594
ULONG Right
Definition: ui.h:126
VOID(* SetProgressBarText)(_In_ PCSTR ProgressText)
Definition: ui.h:272
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2430
UCHAR NoUiTextToFillStyle(PCSTR FillStyleText)
Definition: noui.c:144
#define va_end(ap)
Definition: acmsvcex.h:90
#define FALSE
Definition: types.h:117
VOID NoUiFillArea(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, CHAR FillChar, UCHAR Attr)
Definition: noui.c:25
long LONG
Definition: pedump.c:60
VOID UiShowMessageBoxesInSection(IN ULONG_PTR SectionId)
Definition: ui.c:550
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: ui.c:631
UI_PROGRESS_BAR UiProgressBar
Definition: ui.c:66
VOID UiFadeInBackdrop(VOID)
Definition: ui.c:650
VOID(* TickProgressBar)(_In_ ULONG SubPercentTimes100)
Definition: ui.h:275
UCHAR UiTitleBoxBgColor
Definition: ui.c:33
UIVTBL UiVtbl
Definition: ui.c:70
PCHAR GetNextArgumentValue(IN ULONG Argc, IN PCHAR Argv[], IN OUT PULONG LastIndex OPTIONAL, IN PCHAR ArgumentName)
Definition: arcsupp.c:15
UCHAR UiStatusBarBgColor
Definition: ui.c:28
FORCEINLINE PVOID FrLdrTempAlloc(_In_ SIZE_T Size, _In_ ULONG Tag)
Definition: mm.h:188
VOID UiDrawCenteredText(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom, _In_ PCSTR TextString, _In_ UCHAR Attr)
Definition: ui.c:281
#define ATTR(cFore, cBack)
Definition: ui.h:314
unsigned char BOOLEAN
DBG_DEFAULT_CHANNEL(UI)
#define _In_
Definition: ms_sal.h:308
BOOLEAN UiUseSpecialEffects
Definition: ui.c:47
char * va_list
Definition: acmsvcex.h:78
VOID MiniTuiDrawProgressBarCenter(_In_ PCSTR ProgressText)
Definition: minitui.c:153
Definition: bufpool.h:45
VOID(* DrawText2)(ULONG X, ULONG Y, ULONG MaxNumChars, PCSTR Text, UCHAR Attr)
Definition: ui.h:255
VOID(* MessageBox)(PCSTR MessageText)
Definition: ui.h:259
UCHAR UiTextColor
Definition: ui.c:38
BOOLEAN IniReadSettingByName(ULONG_PTR SectionId, PCSTR SettingName, PCHAR Buffer, ULONG BufferSize)
Definition: inifile.c:147
ULONG Top
Definition: ui.h:125
VOID NoUiMessageBox(PCSTR MessageText)
Definition: noui.c:81
VOID NoUiDrawText2(_In_ ULONG X, _In_ ULONG Y, _In_opt_ ULONG MaxNumChars, _In_reads_or_z_(MaxNumChars) PCSTR Text, _In_ UCHAR Attr)
Definition: noui.c:48
VOID NoUiUnInitialize(VOID)
Definition: noui.c:17
VOID(* FillArea)(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, CHAR FillChar, UCHAR Attr)
Definition: ui.h:251
VOID NoUiSetProgressBarText(_In_ PCSTR ProgressText)
Definition: noui.c:106
#define TRACE(s)
Definition: solgame.cpp:4
VOID UiUnInitialize(PCSTR BootText)
Definition: ui.c:230
BOOLEAN(* Initialize)(VOID)
Definition: ui.h:247
BOOLEAN IniOpenSection(PCSTR SectionName, ULONG_PTR *SectionId)
Definition: inifile.c:25
#define ASSERT(a)
Definition: mode.c:44
VOID(* UpdateDateTime)(VOID)
Definition: ui.h:258
UCHAR UiSelectedTextBgColor
Definition: ui.c:40
VOID NoUiDrawMenu(_In_ PUI_MENU_INFO MenuInfo)
Definition: noui.c:182
_In_ WDFCOLLECTION _In_ ULONG Index
VOID UiDrawBox(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, UCHAR VertStyle, UCHAR HorzStyle, BOOLEAN Fill, BOOLEAN Shadow, UCHAR Attr)
Definition: ui.c:254
VOID(* DrawShadow)(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom)
Definition: ui.h:252
VOID(* DrawBox)(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, UCHAR VertStyle, UCHAR HorzStyle, BOOLEAN Fill, BOOLEAN Shadow, UCHAR Attr)
Definition: ui.h:253
VOID UiDrawStatusText(PCSTR StatusText)
Definition: ui.c:292
BOOLEAN Show
Definition: ui.h:129
va_start(ap, x)
BOOLEAN(* EditBox)(PCSTR MessageText, PCHAR EditTextBuffer, ULONG Length)
Definition: ui.h:278
VOID UiUpdateDateTime(VOID)
Definition: ui.c:297
ULONG IniGetSectionSettingValueSize(ULONG_PTR SectionId, ULONG SettingIndex)
Definition: inifile.c:101
unsigned char UCHAR
Definition: xmlstorage.h:181
char * PBOOLEAN
Definition: retypes.h:11
BOOLEAN(* UiMenuKeyPressFilterCallback)(IN ULONG KeyPress, IN ULONG SelectedMenuItem, IN PVOID Context OPTIONAL)
Definition: ui.h:221
UCHAR UiBackdropFillStyle
Definition: ui.c:31
UCHAR UiBackdropBgColor
Definition: ui.c:30
ULONG UiScreenHeight
Definition: ui.c:57
enum tagVIDEODISPLAYMODE VIDEODISPLAYMODE
#define TAG_UI_TEXT
Definition: ui.c:54
ULONG Bottom
Definition: ui.h:127
UCHAR UiMenuBgColor
Definition: ui.c:37
Definition: ui.h:245
VOID MiniTuiDrawProgressBar(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom, _In_ PCSTR ProgressText)
Definition: minitui.c:178
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:284
CHAR UiTitleBoxTitleText[260]
Definition: ui.c:49
VOID UiSetProgressBarText(_In_ PCSTR ProgressText)
Definition: ui.c:488
struct _UI_PROGRESS_BAR::@173 State
VOID NoUiFadeInBackdrop(VOID)
Definition: noui.c:149
VOID(* MessageBoxCritical)(PCSTR MessageText)
Definition: ui.h:260
ULONG_PTR SIZE_T
Definition: typedefs.h:80
VOID(* DrawProgressBarCenter)(_In_ PCSTR ProgressText)
Definition: ui.h:262
VOID UiFillArea(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, CHAR FillChar, UCHAR Attr)
Definition: ui.c:244
static LPHIST_ENTRY Bottom
Definition: history.c:54
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(* DrawStatusText)(PCSTR StatusText)
Definition: ui.h:257
VOID NoUiDrawText(_In_ ULONG X, _In_ ULONG Y, _In_ PCSTR Text, _In_ UCHAR Attr)
Definition: noui.c:38
#define RTL_NUMBER_OF(x)
Definition: RtlRegistry.c:12
VOID NoUiDrawBackdrop(VOID)
Definition: noui.c:21
VOID NoUiMessageBoxCritical(PCSTR MessageText)
Definition: noui.c:92
UCHAR UiTextToColor(PCSTR ColorText)
Definition: ui.c:379
VOID(* DrawBackdrop)(VOID)
Definition: ui.h:250
#define OPTIONAL
Definition: typedefs.h:41
unsigned int * PULONG
Definition: retypes.h:1
const PCSTR UiMonthNames[12]
Definition: ui.c:52
#define min(a, b)
Definition: monoChain.cc:55
#define NULL
Definition: types.h:112
VOID UiMessageBox(PCSTR Format,...)
Definition: ui.c:363
VOID UiDrawProgressBar(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom, _In_ PCSTR ProgressText)
Definition: ui.c:514
VOID UiDrawProgressBarCenter(_In_ PCSTR ProgressText)
Definition: ui.c:503
VOID(* FadeOut)(VOID)
Definition: ui.h:282
#define _In_reads_or_z_(size)
Definition: ms_sal.h:325
#define MachVideoSetDisplayMode(Mode, Init)
Definition: machine.h:94
VOID UiMessageBoxCritical(PCSTR MessageText)
Definition: ui.c:374
UCHAR UiMenuFgColor
Definition: ui.c:36
ULONG Left
Definition: ui.h:124
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32
#define OUT
Definition: typedefs.h:40
UCHAR UiSelectedTextColor
Definition: ui.c:39
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
unsigned int ULONG
Definition: retypes.h:1
ULONG IniGetNumSectionItems(ULONG_PTR SectionId)
Definition: inifile.c:54
VOID UiSetProgressBarSubset(_In_ ULONG Floor, _In_ ULONG Ceiling)
Definition: ui.c:447
const char * PCSTR
Definition: typedefs.h:52
VOID UiDrawBackdrop(VOID)
Definition: ui.c:239
VOID MiniTuiSetProgressBarText(_In_ PCSTR ProgressText)
Definition: minitui.c:77
VOID(* DrawCenteredText)(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, PCSTR TextString, UCHAR Attr)
Definition: ui.h:256
const UIVTBL TuiVtbl
Definition: tui.c:1217
UCHAR(* TextToFillStyle)(PCSTR FillStyleText)
Definition: ui.h:280
static LPHIST_ENTRY Top
Definition: history.c:53
VOID NoUiDrawProgressBar(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom, _In_ PCSTR ProgressText)
Definition: noui.c:124
#define VERT
Definition: ui.h:345
BOOLEAN IniReadSettingByNumber(ULONG_PTR SectionId, ULONG SettingNumber, PCHAR SettingName, ULONG NameSize, PCHAR SettingValue, ULONG ValueSize)
Definition: inifile.c:114
VOID(* UnInitialize)(VOID)
Definition: ui.h:248
BOOLEAN UiInitialize(BOOLEAN ShowUi)
Definition: ui.c:98
char * Text
Definition: combotst.c:136
UCHAR UiEditBoxBgColor
Definition: ui.c:42
VOID UiDrawShadow(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom)
Definition: ui.c:249
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
FORCEINLINE VOID FrLdrTempFree(PVOID Allocation, ULONG Tag)
Definition: mm.h:197