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