ReactOS 0.4.16-dev-106-g10b08aa
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
298 _In_ PCSTR MessageText)
299{
300 SIZE_T TextLength;
301 ULONG BoxWidth;
302 ULONG BoxHeight;
303 ULONG LineBreakCount;
305 SIZE_T LastIndex;
306 ULONG Left;
307 ULONG Top;
308 ULONG Right;
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,
353
354 /* Draw the text */
355 UiDrawCenteredText(Left, Top, Right, Bottom, MessageText, ATTR(UiTextColor, UiMenuBgColor));
356}
357
358VOID
360 _In_ PCSTR Format, ...)
361{
362 va_list ap;
363 CHAR Buffer[1024];
364
366 _vsnprintf(Buffer, sizeof(Buffer) - sizeof(CHAR), Format, ap);
368 va_end(ap);
369}
370
371VOID
373 _In_ PCSTR MessageText)
374{
375 UiVtbl.MessageBoxCritical(MessageText);
376}
377
379{
380 return UiVtbl.TextToColor(ColorText);
381}
382
384{
385 return UiVtbl.TextToFillStyle(FillStyleText);
386}
387
388VOID
390 _In_ ULONG Left,
391 _In_ ULONG Top,
392 _In_ ULONG Right,
394 _In_ PCSTR ProgressText)
395{
396 /* Progress bar area */
397 UiProgressBar.Left = Left;
399 UiProgressBar.Right = Right;
401 // UiProgressBar.Width = Right - Left + 1;
402
403 /* Set the progress bar ranges */
405 UiProgressBar.Indicator.Count = 0;
406 UiProgressBar.Indicator.Expected = 25;
407 UiProgressBar.Indicator.Percentage = 0;
408
409 /* Enable the progress bar */
411
412 /* Initial drawing: set the "Loading..." text and the original position */
413 UiVtbl.SetProgressBarText(ProgressText);
415}
416
417VOID
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
438VOID
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
453VOID
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
475VOID
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
486VOID
488 _In_ PCSTR ProgressText)
489{
490 UiVtbl.DrawProgressBarCenter(ProgressText);
491}
492
493VOID
495 _In_ ULONG Left,
496 _In_ ULONG Top,
497 _In_ ULONG Right,
499 _In_ PCSTR ProgressText)
500{
501 UiVtbl.DrawProgressBar(Left, Top, Right, Bottom, ProgressText);
502}
503
504static VOID
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
523VOID
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
567VOID
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
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,
617{
618 return UiVtbl.DisplayMenu(MenuHeader, MenuFooter, ShowBootOptions,
619 MenuItemList, MenuItemCount, DefaultMenuItem,
620 MenuTimeOut, SelectedMenuItem, CanEscape,
621 KeyPressFilter, Context);
622}
623
625{
627}
628
630{
631 UiVtbl.FadeOut();
632}
633
634BOOLEAN UiEditBox(PCSTR MessageText, PCHAR EditTextBuffer, ULONG Length)
635{
636 return UiVtbl.EditBox(MessageText, EditTextBuffer, Length);
637}
638
639/* EOF */
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
PSTR GetNextArgumentValue(_In_ ULONG Argc, _In_ PCHAR Argv[], _Inout_opt_ PULONG LastIndex, _In_ PCSTR 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:106
@ 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:94
#define VERT
Definition: ui.h:348
#define ATTR(cFore, cBack)
Definition: ui.h:317
BOOLEAN(* UiMenuKeyPressFilterCallback)(IN ULONG KeyPress, IN ULONG SelectedMenuItem, IN PVOID Context OPTIONAL)
Definition: ui.h:224
#define HORZ
Definition: ui.h:346
#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:107
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:103
ULONG IniGetNumSectionItems(ULONG_PTR SectionId)
Definition: inifile.c:55
BOOLEAN IniReadSettingByNumber(ULONG_PTR SectionId, ULONG SettingNumber, PCHAR SettingName, ULONG NameSize, PCHAR SettingValue, ULONG ValueSize)
Definition: inifile.c:116
BOOLEAN IniReadSettingByName(ULONG_PTR SectionId, PCSTR SettingName, PCHAR Buffer, ULONG BufferSize)
Definition: inifile.c:149
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 NoUiMessageBox(_In_ PCSTR MessageText)
Definition: noui.c:81
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 NoUiMessageBoxCritical(_In_ PCSTR MessageText)
Definition: noui.c:88
VOID NoUiDrawMenu(_In_ PUI_MENU_INFO MenuInfo)
Definition: noui.c:181
VOID NoUiDrawBackdrop(VOID)
Definition: noui.c:20
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
Definition: ui.h:200
struct _UI_PROGRESS_BAR::@178 State
ULONG Top
Definition: ui.h:132
ULONG Bottom
Definition: ui.h:134
struct _UI_PROGRESS_BAR::@179 Indicator
BOOLEAN Show
Definition: ui.h:136
ULONG Left
Definition: ui.h:131
ULONG Right
Definition: ui.h:133
Definition: ui.h:249
VOID(* DrawBackdrop)(VOID)
Definition: ui.h:253
VOID(* FadeInBackdrop)(VOID)
Definition: ui.h:284
VOID(* DrawText)(ULONG X, ULONG Y, PCSTR Text, UCHAR Attr)
Definition: ui.h:257
VOID(* FillArea)(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, CHAR FillChar, UCHAR Attr)
Definition: ui.h:254
VOID(* DrawBox)(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, UCHAR VertStyle, UCHAR HorzStyle, BOOLEAN Fill, BOOLEAN Shadow, UCHAR Attr)
Definition: ui.h:256
VOID(* DrawStatusText)(PCSTR StatusText)
Definition: ui.h:260
UCHAR(* TextToFillStyle)(PCSTR FillStyleText)
Definition: ui.h:283
VOID(* TickProgressBar)(_In_ ULONG SubPercentTimes100)
Definition: ui.h:278
BOOLEAN(* EditBox)(PCSTR MessageText, PCHAR EditTextBuffer, ULONG Length)
Definition: ui.h:281
VOID(* DrawCenteredText)(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, PCSTR TextString, UCHAR Attr)
Definition: ui.h:259
VOID(* MessageBox)(PCSTR MessageText)
Definition: ui.h:262
BOOLEAN(* Initialize)(VOID)
Definition: ui.h:250
VOID(* DrawProgressBarCenter)(_In_ PCSTR ProgressText)
Definition: ui.h:265
VOID(* UnInitialize)(VOID)
Definition: ui.h:251
VOID(* DrawShadow)(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom)
Definition: ui.h:255
VOID(* DrawProgressBar)(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom, _In_ PCSTR ProgressText)
Definition: ui.h:268
VOID(* MessageBoxCritical)(PCSTR MessageText)
Definition: ui.h:263
VOID(* DrawText2)(ULONG X, ULONG Y, ULONG MaxNumChars, PCSTR Text, UCHAR Attr)
Definition: ui.h:258
VOID(* SetProgressBarText)(_In_ PCSTR ProgressText)
Definition: ui.h:275
VOID(* FadeOut)(VOID)
Definition: ui.h:285
VOID(* UpdateDateTime)(VOID)
Definition: ui.h:261
UCHAR(* TextToColor)(PCSTR ColorText)
Definition: ui.h:282
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:287
const UIVTBL TuiVtbl
Definition: tui.c:1219
#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:634
UCHAR UiMessageBoxFgColor
Definition: ui.c:32
UCHAR UiTextToFillStyle(PCSTR FillStyleText)
Definition: ui.c:383
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:476
UCHAR UiTextToColor(PCSTR ColorText)
Definition: ui.c:378
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:605
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:505
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:568
VOID UiIndicateProgress(VOID)
Definition: ui.c:418
const PCSTR UiMonthNames[12]
Definition: ui.c:50
UCHAR UiTextColor
Definition: ui.c:36
VOID UiShowMessageBoxesInSection(IN ULONG_PTR SectionId)
Definition: ui.c:524
UCHAR UiMenuBgColor
Definition: ui.c:35
VOID UiInfoBox(_In_ PCSTR MessageText)
Definition: ui.c:297
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:454
CHAR UiTitleBoxTitleText[260]
Definition: ui.c:47
VOID UiFadeOut(VOID)
Definition: ui.c:629
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 UiMessageBoxCritical(_In_ PCSTR MessageText)
Definition: ui.c:372
VOID UiSetProgressBarSubset(_In_ ULONG Floor, _In_ ULONG Ceiling)
Definition: ui.c:439
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:494
VOID UiDrawProgressBarCenter(_In_ PCSTR ProgressText)
Definition: ui.c:487
VOID UiDrawStatusText(PCSTR StatusText)
Definition: ui.c:286
UCHAR UiStatusBarFgColor
Definition: ui.c:25
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:389
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:624
VOID UiMessageBox(_In_ PCSTR Format,...)
Definition: ui.c:359
#define TAG_UI_TEXT
Definition: ui.c:52
_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
#define _vsnprintf
Definition: xmlstorage.h:202
unsigned char UCHAR
Definition: xmlstorage.h:181
char CHAR
Definition: xmlstorage.h:175