ReactOS 0.4.15-dev-6679-g945ee4b
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
25UCHAR UiStatusBarFgColor; // Status bar foreground color
26UCHAR UiStatusBarBgColor; // Status bar background color
27UCHAR UiBackdropFgColor; // Backdrop foreground color
28UCHAR UiBackdropBgColor; // Backdrop background color
29UCHAR UiBackdropFillStyle; // Backdrop fill style
30UCHAR UiTitleBoxFgColor; // Title box foreground color
31UCHAR UiTitleBoxBgColor; // Title box background color
32UCHAR UiMessageBoxFgColor; // Message box foreground color
33UCHAR UiMessageBoxBgColor; // Message box background color
34UCHAR UiMenuFgColor; // Menu foreground color
35UCHAR UiMenuBgColor; // Menu background color
36UCHAR UiTextColor; // Normal text color
37UCHAR UiSelectedTextColor; // Selected text color
38UCHAR UiSelectedTextBgColor; // Selected text background color
39UCHAR UiEditBoxTextColor; // Edit box text color
40UCHAR UiEditBoxBgColor; // Edit box text background color
41
42BOOLEAN UiShowTime; // Whether to draw the time
43BOOLEAN UiMenuBox; // Whether to draw a box around the menu
44BOOLEAN UiCenterMenu; // Whether to use a centered or left-aligned menu
45BOOLEAN UiUseSpecialEffects; // Whether to use fade effects
46
47CHAR UiTitleBoxTitleText[260] = "Boot Menu"; // Title box's title text
48CHAR UiTimeText[260] = "[Time Remaining: %d]";
49
50const PCSTR UiMonthNames[12] = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" };
51
52#define TAG_UI_TEXT 'xTiU'
53
54ULONG UiScreenWidth; // Screen Width
55ULONG 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 */
63
65{
90};
91
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;
98 CHAR SettingText[260];
99
100 if (!ShowUi)
101 {
102 if (!UiVtbl.Initialize())
103 {
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);
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.
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 {
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 */
219
220 TRACE("UiInitialize() returning TRUE.\n");
221 return TRUE;
222}
223
225{
227 UiDrawStatusText(BootText);
228 UiInfoBox(BootText);
229
231}
232
234{
236}
237
238VOID 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
244{
245 UiVtbl.DrawShadow(Left, Top, Right, Bottom);
246}
247
248VOID 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
253VOID
255 _In_ ULONG X,
256 _In_ ULONG Y,
258 _In_ UCHAR Attr)
259{
260 UiVtbl.DrawText(X, Y, Text, Attr);
261}
262
263VOID
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
274VOID
276 _In_ ULONG Left,
277 _In_ ULONG Top,
278 _In_ ULONG Right,
280 _In_ PCSTR TextString,
281 _In_ UCHAR Attr)
282{
283 UiVtbl.DrawCenteredText(Left, Top, Right, Bottom, TextString, Attr);
284}
285
287{
288 UiVtbl.DrawStatusText(StatusText);
289}
290
292{
294}
295
296VOID UiInfoBox(PCSTR MessageText)
297{
298 SIZE_T TextLength;
299 ULONG BoxWidth;
300 ULONG BoxHeight;
301 ULONG LineBreakCount;
303 SIZE_T LastIndex;
304 ULONG Left;
305 ULONG Top;
306 ULONG Right;
308
309 TextLength = strlen(MessageText);
310
311 // Count the new lines and the box width
312 LineBreakCount = 0;
313 BoxWidth = 0;
314 LastIndex = 0;
315 for (Index=0; Index<TextLength; Index++)
316 {
317 if (MessageText[Index] == '\n')
318 {
319 LastIndex = Index;
320 LineBreakCount++;
321 }
322 else
323 {
324 if ((Index - LastIndex) > BoxWidth)
325 {
326 BoxWidth = (ULONG)(Index - LastIndex);
327 }
328 }
329 }
330
331 // Calc the box width & height
332 BoxWidth += 6;
333 BoxHeight = LineBreakCount + 4;
334
335 // Calc the box coordinates
336 Left = (UiScreenWidth / 2) - (BoxWidth / 2);
337 Top =(UiScreenHeight / 2) - (BoxHeight / 2);
338 Right = (UiScreenWidth / 2) + (BoxWidth / 2);
339 Bottom = (UiScreenHeight / 2) + (BoxHeight / 2);
340
341 // Draw the box
342 UiDrawBox(Left,
343 Top,
344 Right,
345 Bottom,
346 VERT,
347 HORZ,
348 TRUE,
349 TRUE,
351 );
352
353 // Draw the text
354 UiDrawCenteredText(Left, Top, Right, Bottom, MessageText, ATTR(UiTextColor, UiMenuBgColor));
355}
356
358{
359 CHAR Buffer[256];
360 va_list ap;
361
363 vsnprintf(Buffer, sizeof(Buffer) - sizeof(CHAR), Format, ap);
365 va_end(ap);
366}
367
369{
370 UiVtbl.MessageBoxCritical(MessageText);
371}
372
374{
375 return UiVtbl.TextToColor(ColorText);
376}
377
379{
380 return UiVtbl.TextToFillStyle(FillStyleText);
381}
382
383VOID
385 _In_ ULONG Left,
386 _In_ ULONG Top,
387 _In_ ULONG Right,
389 _In_ PCSTR ProgressText)
390{
391 /* Progress bar area */
392 UiProgressBar.Left = Left;
394 UiProgressBar.Right = Right;
396 // UiProgressBar.Width = Right - Left + 1;
397
398 /* Set the progress bar ranges */
400 UiProgressBar.Indicator.Count = 0;
401 UiProgressBar.Indicator.Expected = 25;
402 UiProgressBar.Indicator.Percentage = 0;
403
404 /* Enable the progress bar */
406
407 /* Initial drawing: set the "Loading..." text and the original position */
408 UiVtbl.SetProgressBarText(ProgressText);
410}
411
412VOID
414{
415 ULONG Percentage;
416
417 /* Increase progress */
418 UiProgressBar.Indicator.Count++;
419
420 /* Compute the new percentage - Don't go over 100% */
421 Percentage = 100 * UiProgressBar.Indicator.Count /
422 UiProgressBar.Indicator.Expected;
423 Percentage = min(Percentage, 99);
424
425 if (Percentage != UiProgressBar.Indicator.Percentage)
426 {
427 /* Percentage has changed, update the progress bar */
428 UiProgressBar.Indicator.Percentage = Percentage;
429 UiUpdateProgressBar(Percentage, NULL);
430 }
431}
432
433VOID
435 _In_ ULONG Floor,
436 _In_ ULONG Ceiling)
437{
438 /* Sanity checks */
439 ASSERT(Floor < Ceiling);
440 ASSERT(Ceiling <= 100);
441
442 /* Update the progress bar state */
443 UiProgressBar.State.Floor = Floor * 100;
444 // UiProgressBar.State.Ceiling = Ceiling * 100;
445 UiProgressBar.State.Bias = Ceiling - Floor;
446}
447
448VOID
450 _In_ ULONG Percentage,
451 _In_opt_ PCSTR ProgressText)
452{
453 ULONG TotalProgress;
454
455 /* Make sure the progress bar is enabled */
456 if (!UiProgressBar.Show)
457 return;
458
459 /* Set the progress text if specified */
460 if (ProgressText)
461 UiSetProgressBarText(ProgressText);
462
463 /* Compute the total progress and tick the progress bar */
464 TotalProgress = UiProgressBar.State.Floor + (Percentage * UiProgressBar.State.Bias);
465 // TotalProgress /= (100 * 100);
466
467 UiVtbl.TickProgressBar(TotalProgress);
468}
469
470VOID
472 _In_ PCSTR ProgressText)
473{
474 /* Make sure the progress bar is enabled */
475 if (!UiProgressBar.Show)
476 return;
477
478 UiVtbl.SetProgressBarText(ProgressText);
479}
480
481VOID
483 _In_ PCSTR ProgressText)
484{
485 UiVtbl.DrawProgressBarCenter(ProgressText);
486}
487
488VOID
490 _In_ ULONG Left,
491 _In_ ULONG Top,
492 _In_ ULONG Right,
494 _In_ PCSTR ProgressText)
495{
496 UiVtbl.DrawProgressBar(Left, Top, Right, Bottom, ProgressText);
497}
498
499static VOID
501{
502 ULONG Idx;
503
504 for (Idx=0; Idx<strlen(String); Idx++)
505 {
506 // Escape the new line characters
507 if (String[Idx] == '\\' && String[Idx+1] == 'n')
508 {
509 // Escape the character
510 String[Idx] = '\n';
511
512 // Move the rest of the string up
513 strcpy(&String[Idx+1], &String[Idx+2]);
514 }
515 }
516}
517
518VOID
520 IN ULONG_PTR SectionId)
521{
522 ULONG Idx;
523 CHAR SettingName[80];
524 CHAR SettingValue[80];
525 PCHAR MessageBoxText;
526 ULONG MessageBoxTextSize;
527
528 if (SectionId == 0)
529 return;
530
531 /* Find all the message box settings and run them */
532 for (Idx = 0; Idx < IniGetNumSectionItems(SectionId); Idx++)
533 {
534 IniReadSettingByNumber(SectionId, Idx, SettingName, sizeof(SettingName), SettingValue, sizeof(SettingValue));
535 if (_stricmp(SettingName, "MessageBox") != 0)
536 continue;
537
538 /* Get the real length of the MessageBox text */
539 MessageBoxTextSize = IniGetSectionSettingValueSize(SectionId, Idx);
540 // if (MessageBoxTextSize <= 0)
541 // continue;
542
543 /* Allocate enough memory to hold the text */
544 MessageBoxText = FrLdrTempAlloc(MessageBoxTextSize, TAG_UI_TEXT);
545 if (!MessageBoxText)
546 continue;
547
548 /* Get the MessageBox text */
549 IniReadSettingByNumber(SectionId, Idx, SettingName, sizeof(SettingName), MessageBoxText, MessageBoxTextSize);
550
551 /* Fix it up */
552 UiEscapeString(MessageBoxText);
553
554 /* Display it */
555 UiMessageBox(MessageBoxText);
556
557 /* Free the memory */
558 FrLdrTempFree(MessageBoxText, TAG_UI_TEXT);
559 }
560}
561
562VOID
564 IN ULONG Argc,
565 IN PCHAR Argv[])
566{
567 ULONG LastIndex;
568 PCSTR ArgValue;
569 PCHAR MessageBoxText;
570 SIZE_T MessageBoxTextSize;
571
572 /* Find all the message box settings and run them */
573 for (LastIndex = 0;
574 (ArgValue = GetNextArgumentValue(Argc, Argv, &LastIndex, "MessageBox")) != NULL;
575 ++LastIndex)
576 {
577 /* Get the real length of the MessageBox text */
578 MessageBoxTextSize = (strlen(ArgValue) + 1) * sizeof(CHAR);
579
580 /* Allocate enough memory to hold the text */
581 MessageBoxText = FrLdrTempAlloc(MessageBoxTextSize, TAG_UI_TEXT);
582 if (!MessageBoxText)
583 continue;
584
585 /* Get the MessageBox text */
586 strcpy(MessageBoxText, ArgValue);
587
588 /* Fix it up */
589 UiEscapeString(MessageBoxText);
590
591 /* Display it */
592 UiMessageBox(MessageBoxText);
593
594 /* Free the memory */
595 FrLdrTempFree(MessageBoxText, TAG_UI_TEXT);
596 }
597}
598
601 IN PCSTR MenuHeader,
602 IN PCSTR MenuFooter OPTIONAL,
603 IN BOOLEAN ShowBootOptions,
604 IN PCSTR MenuItemList[],
605 IN ULONG MenuItemCount,
606 IN ULONG DefaultMenuItem,
607 IN LONG MenuTimeOut,
608 OUT PULONG SelectedMenuItem,
609 IN BOOLEAN CanEscape,
612{
613 return UiVtbl.DisplayMenu(MenuHeader, MenuFooter, ShowBootOptions,
614 MenuItemList, MenuItemCount, DefaultMenuItem,
615 MenuTimeOut, SelectedMenuItem, CanEscape,
616 KeyPressFilter, Context);
617}
618
620{
622}
623
625{
626 UiVtbl.FadeOut();
627}
628
629BOOLEAN UiEditBox(PCSTR MessageText, PCHAR EditTextBuffer, ULONG Length)
630{
631 return UiVtbl.EditBox(MessageText, EditTextBuffer, Length);
632}
633
unsigned char BOOLEAN
#define RTL_NUMBER_OF(x)
Definition: RtlRegistry.c:12
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
char * va_list
Definition: acmsvcex.h:78
#define va_end(ap)
Definition: acmsvcex.h:90
#define va_start(ap, A)
Definition: acmsvcex.h:91
PCHAR GetNextArgumentValue(IN ULONG Argc, IN PCHAR Argv[], IN OUT PULONG LastIndex OPTIONAL, IN PCHAR ArgumentName)
Definition: arcsupp.c:15
static LPHIST_ENTRY Bottom
Definition: history.c:54
static LPHIST_ENTRY Top
Definition: history.c:53
#define DBG_DEFAULT_CHANNEL(ch)
Definition: debug.h:103
@ VideoTextMode
Definition: machine.h:35
@ VideoGraphicsMode
Definition: machine.h:36
#define MachVideoSetDisplayMode(Mode, Init)
Definition: machine.h:94
#define MachVideoGetDisplaySize(W, H, D)
Definition: machine.h:96
enum tagVIDEODISPLAYMODE VIDEODISPLAYMODE
FORCEINLINE PVOID FrLdrTempAlloc(_In_ SIZE_T Size, _In_ ULONG Tag)
Definition: mm.h:188
FORCEINLINE VOID FrLdrTempFree(PVOID Allocation, ULONG Tag)
Definition: mm.h:197
const UIVTBL GuiVtbl
Definition: gui.c:84
#define _stricmp
Definition: cat.c:22
Definition: bufpool.h:45
char * Text
Definition: combotst.c:136
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define Y(I)
void Fill(HDC hdc, LONG x, LONG y, COLORREF color)
Definition: drawing.cpp:109
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
ULONG IniGetSectionSettingValueSize(ULONG_PTR SectionId, ULONG SettingIndex)
Definition: inifile.c:101
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
BOOLEAN IniReadSettingByName(ULONG_PTR SectionId, PCSTR SettingName, PCHAR Buffer, ULONG BufferSize)
Definition: inifile.c:147
BOOLEAN IniOpenSection(PCSTR SectionName, ULONG_PTR *SectionId)
Definition: inifile.c:25
const UIVTBL MiniTuiVtbl
Definition: minitui.c:237
#define ASSERT(a)
Definition: mode.c:44
#define min(a, b)
Definition: monoChain.cc:55
#define _In_reads_or_z_(size)
Definition: ms_sal.h:325
#define _In_
Definition: ms_sal.h:308
#define _In_opt_
Definition: ms_sal.h:309
VOID NoUiUnInitialize(VOID)
Definition: noui.c:16
VOID NoUiDrawStatusText(PCSTR StatusText)
Definition: noui.c:71
VOID NoUiDrawProgressBar(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom, _In_ PCSTR ProgressText)
Definition: noui.c:123
VOID NoUiTickProgressBar(_In_ ULONG SubPercentTimes100)
Definition: noui.c:111
VOID NoUiFadeInBackdrop(VOID)
Definition: noui.c:148
UCHAR NoUiTextToFillStyle(PCSTR FillStyleText)
Definition: noui.c:143
BOOLEAN NoUiEditBox(PCSTR MessageText, PCHAR EditTextBuffer, ULONG Length)
Definition: noui.c:133
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:47
VOID NoUiUpdateDateTime(VOID)
Definition: noui.c:76
VOID NoUiDrawShadow(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom)
Definition: noui.c:28
VOID NoUiDrawCenteredText(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom, _In_ PCSTR TextString, _In_ UCHAR Attr)
Definition: noui.c:60
BOOLEAN NoUiInitialize(VOID)
Definition: noui.c:11
VOID NoUiDrawMenu(_In_ PUI_MENU_INFO MenuInfo)
Definition: noui.c:181
VOID NoUiMessageBoxCritical(PCSTR MessageText)
Definition: noui.c:91
VOID NoUiDrawBackdrop(VOID)
Definition: noui.c:20
VOID NoUiMessageBox(PCSTR MessageText)
Definition: noui.c:80
VOID NoUiSetProgressBarText(_In_ PCSTR ProgressText)
Definition: noui.c:105
VOID NoUiFadeOut(VOID)
Definition: noui.c:152
VOID NoUiFillArea(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, CHAR FillChar, UCHAR Attr)
Definition: noui.c:24
VOID NoUiDrawBox(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, UCHAR VertStyle, UCHAR HorzStyle, BOOLEAN Fill, BOOLEAN Shadow, UCHAR Attr)
Definition: noui.c:32
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:163
VOID NoUiDrawProgressBarCenter(_In_ PCSTR ProgressText)
Definition: noui.c:117
VOID NoUiDrawText(_In_ ULONG X, _In_ ULONG Y, _In_ PCSTR Text, _In_ UCHAR Attr)
Definition: noui.c:37
UCHAR NoUiTextToColor(PCSTR ColorText)
Definition: noui.c:138
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
NTSTRSAFEAPI RtlStringCbCopyA(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cbDest, _In_ NTSTRSAFE_PCSTR pszSrc)
Definition: ntstrsafe.h:156
long LONG
Definition: pedump.c:60
#define TRACE(s)
Definition: solgame.cpp:4
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
ULONG Top
Definition: ui.h:125
ULONG Bottom
Definition: ui.h:127
struct _UI_PROGRESS_BAR::@175 State
struct _UI_PROGRESS_BAR::@176 Indicator
BOOLEAN Show
Definition: ui.h:129
ULONG Left
Definition: ui.h:124
ULONG Right
Definition: ui.h:126
Definition: ui.h:246
VOID(* DrawBackdrop)(VOID)
Definition: ui.h:250
VOID(* FadeInBackdrop)(VOID)
Definition: ui.h:281
VOID(* DrawText)(ULONG X, ULONG Y, PCSTR Text, UCHAR Attr)
Definition: ui.h:254
VOID(* FillArea)(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, CHAR FillChar, UCHAR Attr)
Definition: ui.h:251
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(* DrawStatusText)(PCSTR StatusText)
Definition: ui.h:257
UCHAR(* TextToFillStyle)(PCSTR FillStyleText)
Definition: ui.h:280
VOID(* TickProgressBar)(_In_ ULONG SubPercentTimes100)
Definition: ui.h:275
BOOLEAN(* EditBox)(PCSTR MessageText, PCHAR EditTextBuffer, ULONG Length)
Definition: ui.h:278
VOID(* DrawCenteredText)(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, PCSTR TextString, UCHAR Attr)
Definition: ui.h:256
VOID(* MessageBox)(PCSTR MessageText)
Definition: ui.h:259
BOOLEAN(* Initialize)(VOID)
Definition: ui.h:247
VOID(* DrawProgressBarCenter)(_In_ PCSTR ProgressText)
Definition: ui.h:262
VOID(* UnInitialize)(VOID)
Definition: ui.h:248
VOID(* DrawShadow)(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom)
Definition: ui.h:252
VOID(* DrawProgressBar)(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom, _In_ PCSTR ProgressText)
Definition: ui.h:265
VOID(* MessageBoxCritical)(PCSTR MessageText)
Definition: ui.h:260
VOID(* DrawText2)(ULONG X, ULONG Y, ULONG MaxNumChars, PCSTR Text, UCHAR Attr)
Definition: ui.h:255
VOID(* SetProgressBarText)(_In_ PCSTR ProgressText)
Definition: ui.h:272
VOID(* FadeOut)(VOID)
Definition: ui.h:282
VOID(* UpdateDateTime)(VOID)
Definition: ui.h:258
UCHAR(* TextToColor)(PCSTR ColorText)
Definition: ui.h:279
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
#define vsnprintf
Definition: tif_win32.c:406
const UIVTBL TuiVtbl
Definition: tui.c:1204
#define OPTIONAL
Definition: typedefs.h:41
uint32_t * PULONG
Definition: typedefs.h:59
unsigned char * PBOOLEAN
Definition: typedefs.h:53
ULONG_PTR SIZE_T
Definition: typedefs.h:80
const char * PCSTR
Definition: typedefs.h:52
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define IN
Definition: typedefs.h:39
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
char * PCHAR
Definition: typedefs.h:51
BOOLEAN UiEditBox(PCSTR MessageText, PCHAR EditTextBuffer, ULONG Length)
Definition: ui.c:629
VOID UiInfoBox(PCSTR MessageText)
Definition: ui.c:296
VOID UiMessageBoxCritical(PCSTR MessageText)
Definition: ui.c:368
UCHAR UiMessageBoxFgColor
Definition: ui.c:32
UCHAR UiTextToFillStyle(PCSTR FillStyleText)
Definition: ui.c:378
UCHAR UiMessageBoxBgColor
Definition: ui.c:33
UI_PROGRESS_BAR UiProgressBar
Definition: ui.c:62
ULONG UiScreenWidth
Definition: ui.c:54
VOID UiSetProgressBarText(_In_ PCSTR ProgressText)
Definition: ui.c:471
UCHAR UiTextToColor(PCSTR ColorText)
Definition: ui.c:373
UCHAR UiEditBoxTextColor
Definition: ui.c:39
UCHAR UiStatusBarBgColor
Definition: ui.c:26
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:600
VOID UiDrawText(_In_ ULONG X, _In_ ULONG Y, _In_ PCSTR Text, _In_ UCHAR Attr)
Definition: ui.c:254
BOOLEAN UiUseSpecialEffects
Definition: ui.c:45
BOOLEAN UiCenterMenu
Definition: ui.c:44
static VOID UiEscapeString(PCHAR String)
Definition: ui.c:500
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:264
UCHAR UiTitleBoxBgColor
Definition: ui.c:31
VOID UiShowMessageBoxesInArgv(IN ULONG Argc, IN PCHAR Argv[])
Definition: ui.c:563
VOID UiIndicateProgress(VOID)
Definition: ui.c:413
const PCSTR UiMonthNames[12]
Definition: ui.c:50
UCHAR UiTextColor
Definition: ui.c:36
VOID UiShowMessageBoxesInSection(IN ULONG_PTR SectionId)
Definition: ui.c:519
UCHAR UiMenuBgColor
Definition: ui.c:35
CHAR UiTimeText[260]
Definition: ui.c:48
VOID UiDrawShadow(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom)
Definition: ui.c:243
VOID UiUpdateProgressBar(_In_ ULONG Percentage, _In_opt_ PCSTR ProgressText)
Definition: ui.c:449
CHAR UiTitleBoxTitleText[260]
Definition: ui.c:47
VOID UiFadeOut(VOID)
Definition: ui.c:624
UCHAR UiTitleBoxFgColor
Definition: ui.c:30
UCHAR UiBackdropFgColor
Definition: ui.c:27
BOOLEAN UiShowTime
Definition: ui.c:42
UCHAR UiBackdropFillStyle
Definition: ui.c:29
VOID UiFillArea(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, CHAR FillChar, UCHAR Attr)
Definition: ui.c:238
VOID UiSetProgressBarSubset(_In_ ULONG Floor, _In_ ULONG Ceiling)
Definition: ui.c:434
UCHAR UiBackdropBgColor
Definition: ui.c:28
ULONG UiScreenHeight
Definition: ui.c:55
BOOLEAN UiMenuBox
Definition: ui.c:43
UIVTBL UiVtbl
Definition: ui.c:64
VOID UiUnInitialize(PCSTR BootText)
Definition: ui.c:224
VOID UiDrawBackdrop(VOID)
Definition: ui.c:233
VOID UiDrawProgressBar(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom, _In_ PCSTR ProgressText)
Definition: ui.c:489
VOID UiDrawProgressBarCenter(_In_ PCSTR ProgressText)
Definition: ui.c:482
VOID UiDrawStatusText(PCSTR StatusText)
Definition: ui.c:286
UCHAR UiStatusBarFgColor
Definition: ui.c:25
VOID UiMessageBox(PCSTR Format,...)
Definition: ui.c:357
VOID UiDrawBox(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, UCHAR VertStyle, UCHAR HorzStyle, BOOLEAN Fill, BOOLEAN Shadow, UCHAR Attr)
Definition: ui.c:248
UCHAR UiSelectedTextColor
Definition: ui.c:37
UCHAR UiSelectedTextBgColor
Definition: ui.c:38
UCHAR UiMenuFgColor
Definition: ui.c:34
BOOLEAN UiInitialize(BOOLEAN ShowUi)
Definition: ui.c:92
VOID UiInitProgressBar(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom, _In_ PCSTR ProgressText)
Definition: ui.c:384
VOID UiDrawCenteredText(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom, _In_ PCSTR TextString, _In_ UCHAR Attr)
Definition: ui.c:275
VOID UiUpdateDateTime(VOID)
Definition: ui.c:291
UCHAR UiEditBoxBgColor
Definition: ui.c:40
VOID UiFadeInBackdrop(VOID)
Definition: ui.c:619
#define TAG_UI_TEXT
Definition: ui.c:52
#define VERT
Definition: ui.h:345
#define ATTR(cFore, cBack)
Definition: ui.h:314
BOOLEAN(* UiMenuKeyPressFilterCallback)(IN ULONG KeyPress, IN ULONG SelectedMenuItem, IN PVOID Context OPTIONAL)
Definition: ui.h:221
#define HORZ
Definition: ui.h:343
_In_ WDFCOLLECTION _In_ ULONG Index
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_POWER_POLICY_IDLE_SETTINGS Settings
Definition: wdfdevice.h:2595
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2433
void int int ULONGLONG int va_list * ap
Definition: winesup.h:36
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION _In_ ULONG _In_ SIZE_T _In_ ULONG _In_ USHORT Depth
Definition: exfuncs.h:819
unsigned char UCHAR
Definition: xmlstorage.h:181
char CHAR
Definition: xmlstorage.h:175