ReactOS 0.4.15-dev-7127-g2dd0c6c
tui.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
23
24/* GENERIC TUI UTILS *********************************************************/
25
26/*
27 * TuiPrintf()
28 * Prints formatted text to the screen.
29 */
30INT
32 _In_ PCSTR Format, ...)
33{
34 INT i;
35 INT Length;
36 va_list ap;
37 CHAR Buffer[512];
38
40 Length = _vsnprintf(Buffer, sizeof(Buffer), Format, ap);
41 va_end(ap);
42
43 if (Length == -1)
44 Length = (INT)sizeof(Buffer);
45
46 for (i = 0; i < Length; i++)
47 {
49 }
50
51 return Length;
52}
53
54VOID
56 _Inout_z_ PSTR StringText,
57 _In_ ULONG MaxChars)
58{
59 /* If it's too large, just add some ellipsis past the maximum */
60 if (strlen(StringText) > MaxChars)
61 strcpy(&StringText[MaxChars - 3], "...");
62}
63
64/*
65 * DrawText()
66 * Displays a string on a single screen line.
67 * This function assumes coordinates are zero-based.
68 */
69VOID
71 _In_ ULONG X,
72 _In_ ULONG Y,
74 _In_ UCHAR Attr)
75{
76 TuiDrawText2(X, Y, 0 /*(ULONG)strlen(Text)*/, Text, Attr);
77}
78
79/*
80 * DrawText2()
81 * Displays a string on a single screen line.
82 * This function assumes coordinates are zero-based.
83 * MaxNumChars is the maximum number of characters to display.
84 * If MaxNumChars == 0, then display the whole string.
85 */
86VOID
88 _In_ ULONG X,
89 _In_ ULONG Y,
90 _In_opt_ ULONG MaxNumChars,
91 _In_reads_or_z_(MaxNumChars) PCSTR Text,
92 _In_ UCHAR Attr)
93{
94 PUCHAR ScreenMemory = (PUCHAR)TextVideoBuffer;
95 ULONG i, j;
96
97 /* Don't display anything if we are out of the screen */
98 if ((X >= UiScreenWidth) || (Y >= UiScreenHeight))
99 return;
100
101 /* Draw the text, not exceeding the width */
102 for (i = X, j = 0; Text[j] && i < UiScreenWidth && (MaxNumChars > 0 ? j < MaxNumChars : TRUE); i++, j++)
103 {
104 ScreenMemory[((Y*2)*UiScreenWidth)+(i*2)] = (UCHAR)Text[j];
105 ScreenMemory[((Y*2)*UiScreenWidth)+(i*2)+1] = Attr;
106 }
107}
108
109VOID
111 _In_ ULONG Left,
112 _In_ ULONG Top,
113 _In_ ULONG Right,
115 _In_ PCSTR TextString,
116 _In_ UCHAR Attr)
117{
118 SIZE_T TextLength;
119 SIZE_T Index, LastIndex;
120 ULONG LineBreakCount;
121 ULONG BoxWidth, BoxHeight;
122 ULONG RealLeft, RealTop;
123 ULONG X, Y;
124 CHAR Temp[2];
125
126 /* Query text length */
127 TextLength = strlen(TextString);
128
129 /* Count the new lines and the box width */
130 LineBreakCount = 0;
131 BoxWidth = 0;
132 LastIndex = 0;
133 for (Index = 0; Index < TextLength; Index++)
134 {
135 /* Scan for new lines */
136 if (TextString[Index] == '\n')
137 {
138 /* Remember the new line */
139 LastIndex = Index;
140 LineBreakCount++;
141 }
142 else
143 {
144 /* Check for new larger box width */
145 if ((Index - LastIndex) > BoxWidth)
146 {
147 /* Update it */
148 BoxWidth = (ULONG)(Index - LastIndex);
149 }
150 }
151 }
152
153 /* Base the box height on the number of lines */
154 BoxHeight = LineBreakCount + 1;
155
156 /*
157 * Create the centered coordinates.
158 * Here, the Left/Top/Right/Bottom rectangle is a hint, around
159 * which we center the "real" text rectangle RealLeft/RealTop.
160 */
161 RealLeft = (Left + Right - BoxWidth + 1) / 2;
162 RealTop = (Top + Bottom - BoxHeight + 1) / 2;
163
164 /* Now go for a second scan */
165 LastIndex = 0;
166 for (Index = 0; Index < TextLength; Index++)
167 {
168 /* Look for new lines again */
169 if (TextString[Index] == '\n')
170 {
171 /* Update where the text should start */
172 RealTop++;
173 LastIndex = 0;
174 }
175 else
176 {
177 /* We've got a line of text to print, do it */
178 X = (ULONG)(RealLeft + LastIndex);
179 Y = RealTop;
180 LastIndex++;
181 Temp[0] = TextString[Index];
182 Temp[1] = 0;
183 TuiDrawText(X, Y, Temp, Attr);
184 }
185 }
186}
187
188/* FULL TUI THEME ************************************************************/
189
190#define TAG_TUI_SCREENBUFFER 'SiuT'
191#define TAG_TUI_PALETTE 'PiuT'
192
194
196{
200
202 if (TextVideoBuffer == NULL)
203 {
204 return FALSE;
205 }
206
207 /* Load default settings with "Full" TUI Theme */
208
225
227 UiMenuBox = TRUE;
230
231 // TODO: Have a boolean to show/hide title box?
233 "Boot Menu");
234
236 "[Time Remaining: %d]");
237
238 return TRUE;
239}
240
242{
243 /* Do nothing if already uninitialized */
244 if (!TextVideoBuffer)
245 return;
246
248 {
249 TuiFadeOut();
250 }
251 else
252 {
254 }
255
258
262}
263
265{
266 /* Fill in the background (excluding title box & status bar) */
267 TuiFillArea(0,
269 UiScreenWidth - 1,
270 UiScreenHeight - 2,
273
274 /* Draw the title box */
275 TuiDrawBox(0,
276 0,
277 UiScreenWidth - 1,
279 D_VERT,
280 D_HORZ,
281 TRUE,
282 FALSE,
284
285 /* Draw version text */
286 TuiDrawText(2,
287 1,
290
291 /* Draw copyright */
292 TuiDrawText(2,
293 2,
294 BY_AUTHOR,
296 TuiDrawText(2,
297 3,
300
301 /* Draw help text */
303 /*"F1 for Help"*/ "F8 for Options",
305
306 /* Draw title text */
308 2,
311
312 /* Update the date & time */
315}
316
317/*
318 * FillArea()
319 * This function assumes coordinates are zero-based
320 */
321VOID TuiFillArea(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, CHAR FillChar, UCHAR Attr /* Color Attributes */)
322{
323 PUCHAR ScreenMemory = (PUCHAR)TextVideoBuffer;
324 ULONG i, j;
325
326 /* Clip the area to the screen */
327 if ((Left >= UiScreenWidth) || (Top >= UiScreenHeight))
328 {
329 return;
330 }
331 if (Right >= UiScreenWidth)
332 Right = UiScreenWidth - 1;
333 if (Bottom >= UiScreenHeight)
335
336 /* Loop through each line and column and fill it in */
337 for (i = Top; i <= Bottom; ++i)
338 {
339 for (j = Left; j <= Right; ++j)
340 {
341 ScreenMemory[((i*2)*UiScreenWidth)+(j*2)] = (UCHAR)FillChar;
342 ScreenMemory[((i*2)*UiScreenWidth)+(j*2)+1] = Attr;
343 }
344 }
345}
346
347/*
348 * DrawShadow()
349 * This function assumes coordinates are zero-based
350 */
352{
353 PUCHAR ScreenMemory = (PUCHAR)TextVideoBuffer;
354 ULONG Idx;
355
356 /* Shade the bottom of the area */
357 if (Bottom < (UiScreenHeight - 1))
358 {
359 if (UiScreenHeight < 34)
360 Idx = Left + 2;
361 else
362 Idx = Left + 1;
363
364 for (; Idx <= Right; ++Idx)
365 {
366 ScreenMemory[(((Bottom+1)*2)*UiScreenWidth)+(Idx*2)+1] = ATTR(COLOR_GRAY, COLOR_BLACK);
367 }
368 }
369
370 /* Shade the right of the area */
371 if (Right < (UiScreenWidth - 1))
372 {
373 for (Idx=Top+1; Idx<=Bottom; Idx++)
374 {
375 ScreenMemory[((Idx*2)*UiScreenWidth)+((Right+1)*2)+1] = ATTR(COLOR_GRAY, COLOR_BLACK);
376 }
377 }
378 if (UiScreenHeight < 34)
379 {
380 if ((Right + 1) < (UiScreenWidth - 1))
381 {
382 for (Idx=Top+1; Idx<=Bottom; Idx++)
383 {
384 ScreenMemory[((Idx*2)*UiScreenWidth)+((Right+2)*2)+1] = ATTR(COLOR_GRAY, COLOR_BLACK);
385 }
386 }
387 }
388
389 /* Shade the bottom right corner */
390 if ((Right < (UiScreenWidth - 1)) && (Bottom < (UiScreenHeight - 1)))
391 {
392 ScreenMemory[(((Bottom+1)*2)*UiScreenWidth)+((Right+1)*2)+1] = ATTR(COLOR_GRAY, COLOR_BLACK);
393 }
394 if (UiScreenHeight < 34)
395 {
396 if (((Right + 1) < (UiScreenWidth - 1)) && (Bottom < (UiScreenHeight - 1)))
397 {
398 ScreenMemory[(((Bottom+1)*2)*UiScreenWidth)+((Right+2)*2)+1] = ATTR(COLOR_GRAY, COLOR_BLACK);
399 }
400 }
401}
402
403/*
404 * DrawBox()
405 * This function assumes coordinates are zero-based
406 */
407VOID
409 _In_ ULONG Left,
410 _In_ ULONG Top,
411 _In_ ULONG Right,
412 _In_ UCHAR VertStyle,
413 _In_ UCHAR HorzStyle,
414 _In_ UCHAR Attr)
415{
416 UCHAR ULCorner, URCorner;
417
418 /* Calculate the corner values */
419 if (HorzStyle == HORZ)
420 {
421 if (VertStyle == VERT)
422 {
423 ULCorner = UL;
424 URCorner = UR;
425 }
426 else // VertStyle == D_VERT
427 {
428 ULCorner = VD_UL;
429 URCorner = VD_UR;
430 }
431 }
432 else // HorzStyle == D_HORZ
433 {
434 if (VertStyle == VERT)
435 {
436 ULCorner = HD_UL;
437 URCorner = HD_UR;
438 }
439 else // VertStyle == D_VERT
440 {
441 ULCorner = D_UL;
442 URCorner = D_UR;
443 }
444 }
445
446 TuiFillArea(Left, Top, Left, Top, ULCorner, Attr);
447 TuiFillArea(Left+1, Top, Right-1, Top, HorzStyle, Attr);
448 TuiFillArea(Right, Top, Right, Top, URCorner, Attr);
449}
450
451VOID
453 _In_ ULONG Left,
455 _In_ ULONG Right,
456 _In_ UCHAR VertStyle,
457 _In_ UCHAR HorzStyle,
458 _In_ UCHAR Attr)
459{
460 UCHAR LLCorner, LRCorner;
461
462 /* Calculate the corner values */
463 if (HorzStyle == HORZ)
464 {
465 if (VertStyle == VERT)
466 {
467 LLCorner = LL;
468 LRCorner = LR;
469 }
470 else // VertStyle == D_VERT
471 {
472 LLCorner = VD_LL;
473 LRCorner = VD_LR;
474 }
475 }
476 else // HorzStyle == D_HORZ
477 {
478 if (VertStyle == VERT)
479 {
480 LLCorner = HD_LL;
481 LRCorner = HD_LR;
482 }
483 else // VertStyle == D_VERT
484 {
485 LLCorner = D_LL;
486 LRCorner = D_LR;
487 }
488 }
489
490 TuiFillArea(Left, Bottom, Left, Bottom, LLCorner, Attr);
491 TuiFillArea(Left+1, Bottom, Right-1, Bottom, HorzStyle, Attr);
492 TuiFillArea(Right, Bottom, Right, Bottom, LRCorner, Attr);
493}
494
495VOID
497 _In_ ULONG Left,
498 _In_ ULONG Top,
499 _In_ ULONG Right,
501 _In_ UCHAR VertStyle,
502 _In_ UCHAR HorzStyle,
504 _In_ BOOLEAN Shadow,
505 _In_ UCHAR Attr)
506{
507 /* Fill in the box background */
508 if (Fill)
509 TuiFillArea(Left, Top, Right, Bottom, ' ', Attr);
510
511 /* Fill in the top horizontal line */
512 TuiDrawBoxTopLine(Left, Top, Right, VertStyle, HorzStyle, Attr);
513
514 /* Fill in the vertical left and right lines */
515 TuiFillArea(Left, Top+1, Left, Bottom-1, VertStyle, Attr);
516 TuiFillArea(Right, Top+1, Right, Bottom-1, VertStyle, Attr);
517
518 /* Fill in the bottom horizontal line */
519 TuiDrawBoxBottomLine(Left, Bottom, Right, VertStyle, HorzStyle, Attr);
520
521 /* Draw the shadow */
522 if (Shadow)
523 TuiDrawShadow(Left, Top, Right, Bottom);
524}
525
527{
528 SIZE_T i;
529
532
533 for (i=strlen(StatusText)+1; i<UiScreenWidth; i++)
534 {
536 }
537
539}
540
542{
543 TIMEINFO* TimeInfo;
544 PCSTR DayPostfix;
545 BOOLEAN PMHour = FALSE;
546 CHAR Buffer[40];
547
548 /* Don't draw the time if this has been disabled */
549 if (!UiShowTime) return;
550
551 TimeInfo = ArcGetTime();
552 if (TimeInfo->Year < 1 || 9999 < TimeInfo->Year ||
553 TimeInfo->Month < 1 || 12 < TimeInfo->Month ||
554 TimeInfo->Day < 1 || 31 < TimeInfo->Day ||
555 23 < TimeInfo->Hour ||
556 59 < TimeInfo->Minute ||
557 59 < TimeInfo->Second)
558 {
559 /* This happens on QEmu sometimes. We just skip updating. */
560 return;
561 }
562
563 /* Get the day postfix */
564 if (1 == TimeInfo->Day || 21 == TimeInfo->Day || 31 == TimeInfo->Day)
565 DayPostfix = "st";
566 else if (2 == TimeInfo->Day || 22 == TimeInfo->Day)
567 DayPostfix = "nd";
568 else if (3 == TimeInfo->Day || 23 == TimeInfo->Day)
569 DayPostfix = "rd";
570 else
571 DayPostfix = "th";
572
573 /* Build the date string in format: "MMMM dx yyyy" */
575 "%s %d%s %d",
576 UiMonthNames[TimeInfo->Month - 1],
577 TimeInfo->Day,
578 DayPostfix,
579 TimeInfo->Year);
580
581 /* Draw the date */
584
585 /* Get the hour and change from 24-hour mode to 12-hour */
586 if (TimeInfo->Hour > 12)
587 {
588 TimeInfo->Hour -= 12;
589 PMHour = TRUE;
590 }
591 if (TimeInfo->Hour == 0)
592 {
593 TimeInfo->Hour = 12;
594 }
595
596 /* Build the time string in format: "h:mm:ss tt" */
598 " %d:%02d:%02d %s",
599 TimeInfo->Hour,
600 TimeInfo->Minute,
601 TimeInfo->Second,
602 PMHour ? "PM" : "AM");
603
604 /* Draw the time */
607}
608
610{
611 PUCHAR ScreenMemory = (PUCHAR)TextVideoBuffer;
612 ULONG i;
613
614 for (i=0; i < (UiScreenWidth * UiScreenHeight * 2); i++)
615 {
616 Buffer[i] = ScreenMemory[i];
617 }
618}
619
621{
622 PUCHAR ScreenMemory = (PUCHAR)TextVideoBuffer;
623 ULONG i;
624
625 for (i=0; i < (UiScreenWidth * UiScreenHeight * 2); i++)
626 {
627 ScreenMemory[i] = Buffer[i];
628 }
629}
630
632{
634
635 // Save the screen contents
639
640 // Display the message box
641 TuiMessageBoxCritical(MessageText);
642
643 // Restore the screen contents
646}
647
649{
650 int width = 8;
651 unsigned int height = 1;
652 int curline = 0;
653 int k;
654 size_t i , j;
655 int x1, x2, y1, y2;
656 char temp[260];
657 char key;
658
659 // Find the height
660 for (i=0; i<strlen(MessageText); i++)
661 {
662 if (MessageText[i] == '\n')
663 height++;
664 }
665
666 // Find the width
667 for (i=0,j=0,k=0; i<height; i++)
668 {
669 while ((MessageText[j] != '\n') && (MessageText[j] != 0))
670 {
671 j++;
672 k++;
673 }
674
675 if (k > width)
676 width = k;
677
678 k = 0;
679 j++;
680 }
681
682 // Calculate box area
683 x1 = (UiScreenWidth - (width+2))/2;
684 x2 = x1 + width + 3;
685 y1 = ((UiScreenHeight - height - 2)/2) + 1;
686 y2 = y1 + height + 4;
687
688 // Draw the box
690
691 // Draw the text
692 for (i=0,j=0; i<strlen(MessageText)+1; i++)
693 {
694 if ((MessageText[i] == '\n') || (MessageText[i] == 0))
695 {
696 temp[j] = 0;
697 j = 0;
699 curline++;
700 }
701 else
702 temp[j++] = MessageText[i];
703 }
704
705 // Draw OK button
706 strcpy(temp, " OK ");
708
709 // Draw status text
710 UiDrawStatusText("Press ENTER to continue");
711
713
714 for (;;)
715 {
716 if (MachConsKbHit())
717 {
718 key = MachConsGetCh();
719 if (key == KEY_EXTENDED)
720 key = MachConsGetCh();
721
722 if ((key == KEY_ENTER) || (key == KEY_SPACE) || (key == KEY_ESC))
723 break;
724 }
725
727
729
730 MachHwIdle();
731 }
732}
733
734static VOID
736 _In_ PCSTR ProgressText)
737{
738 ULONG ProgressBarWidth;
739 CHAR ProgressString[256];
740
741 /* Make sure the progress bar is enabled */
743
744 /* Calculate the width of the bar proper */
745 ProgressBarWidth = UiProgressBar.Right - UiProgressBar.Left + 1;
746
747 /* First make sure the progress bar text fits */
748 RtlStringCbCopyA(ProgressString, sizeof(ProgressString), ProgressText);
749 TuiTruncateStringEllipsis(ProgressString, ProgressBarWidth);
750
751 /* Clear the text area */
755
756 /* Draw the "Loading..." text */
759 ProgressString, ATTR(UiTextColor, UiMenuBgColor));
760}
761
762static VOID
764 _In_ ULONG SubPercentTimes100)
765{
766 ULONG ProgressBarWidth;
767 ULONG FillCount;
768
769 /* Make sure the progress bar is enabled */
771
772 ASSERT(SubPercentTimes100 <= (100 * 100));
773
774 /* Calculate the width of the bar proper */
775 ProgressBarWidth = UiProgressBar.Right - UiProgressBar.Left + 1;
776
777 /* Compute fill count */
778 // FillCount = (ProgressBarWidth * Position) / Range;
779 FillCount = ProgressBarWidth * SubPercentTimes100 / (100 * 100);
780
781 /* Fill the progress bar */
782 /* Draw the percent complete -- Use the fill character */
783 if (FillCount > 0)
784 {
786 UiProgressBar.Left + FillCount - 1, UiProgressBar.Bottom,
787 '\xDB', ATTR(UiTextColor, UiMenuBgColor));
788 }
789 /* Fill the remaining with shadow blanks */
792 '\xB2', ATTR(UiTextColor, UiMenuBgColor));
793
796}
797
798static VOID
800 _In_ ULONG Left,
801 _In_ ULONG Top,
802 _In_ ULONG Right,
804 _In_ PCSTR ProgressText);
805
806static VOID
808 _In_ PCSTR ProgressText)
809{
810 ULONG Left, Top, Right, Bottom, Width, Height;
811
812 /* Build the coordinates and sizes */
813 Height = 2;
814 Width = 50; // Allow for 50 "bars"
815 Left = (UiScreenWidth - Width) / 2;
816 Top = (UiScreenHeight - Height + 4) / 2;
817 Right = Left + Width - 1;
818 Bottom = Top + Height - 1;
819
820 /* Inflate to include the box margins */
821 Left -= 2;
822 Right += 2;
823 Top -= 1;
824 Bottom += 1;
825
826 /* Draw the progress bar */
827 TuiDrawProgressBar(Left, Top, Right, Bottom, ProgressText);
828}
829
830static VOID
832 _In_ ULONG Left,
833 _In_ ULONG Top,
834 _In_ ULONG Right,
836 _In_ PCSTR ProgressText)
837{
838 /* Draw the box */
839 TuiDrawBox(Left, Top, Right, Bottom,
840 VERT, HORZ, TRUE, TRUE,
842
843 /* Exclude the box margins */
844 Left += 2;
845 Right -= 2;
846 Top += 1;
847 Bottom -= 1;
848
849 UiInitProgressBar(Left, Top, Right, Bottom, ProgressText);
850}
851
853{
854 static const struct
855 {
856 PCSTR ColorName;
857 UCHAR ColorValue;
858 } Colors[] =
859 {
860 {"Black" , COLOR_BLACK },
861 {"Blue" , COLOR_BLUE },
862 {"Green" , COLOR_GREEN },
863 {"Cyan" , COLOR_CYAN },
864 {"Red" , COLOR_RED },
865 {"Magenta", COLOR_MAGENTA},
866 {"Brown" , COLOR_BROWN },
867 {"Gray" , COLOR_GRAY },
868 {"DarkGray" , COLOR_DARKGRAY },
869 {"LightBlue" , COLOR_LIGHTBLUE },
870 {"LightGreen" , COLOR_LIGHTGREEN },
871 {"LightCyan" , COLOR_LIGHTCYAN },
872 {"LightRed" , COLOR_LIGHTRED },
873 {"LightMagenta", COLOR_LIGHTMAGENTA},
874 {"Yellow" , COLOR_YELLOW },
875 {"White" , COLOR_WHITE },
876 };
877 ULONG i;
878
879 if (_stricmp(ColorText, "Default") == 0)
881
882 for (i = 0; i < RTL_NUMBER_OF(Colors); ++i)
883 {
884 if (_stricmp(ColorText, Colors[i].ColorName) == 0)
885 return Colors[i].ColorValue;
886 }
887
888 return COLOR_BLACK;
889}
890
892{
893 static const struct
894 {
895 PCSTR FillStyleName;
896 UCHAR FillStyleValue;
897 } FillStyles[] =
898 {
899 {"None" , ' '},
900 {"Light" , LIGHT_FILL },
901 {"Medium", MEDIUM_FILL},
902 {"Dark" , DARK_FILL },
903 };
904 ULONG i;
905
906 for (i = 0; i < RTL_NUMBER_OF(FillStyles); ++i)
907 {
908 if (_stricmp(FillStyleText, FillStyles[i].FillStyleName) == 0)
909 return FillStyles[i].FillStyleValue;
910 }
911
912 return LIGHT_FILL;
913}
914
916{
917 PPALETTE_ENTRY TuiFadePalette = NULL;
918
920 {
921 TuiFadePalette = (PPALETTE_ENTRY)FrLdrTempAlloc(sizeof(PALETTE_ENTRY) * 64,
923
924 if (TuiFadePalette != NULL)
925 {
926 VideoSavePaletteState(TuiFadePalette, 64);
928 }
929 }
930
931 // Draw the backdrop and title box
933
934 if (UiUseSpecialEffects && ! MachVideoIsPaletteFixed() && TuiFadePalette != NULL)
935 {
936 VideoFadeIn(TuiFadePalette, 64);
937 FrLdrTempFree(TuiFadePalette, TAG_TUI_PALETTE);
938 }
939}
940
942{
943 PPALETTE_ENTRY TuiFadePalette = NULL;
944
946 {
947 TuiFadePalette = (PPALETTE_ENTRY)FrLdrTempAlloc(sizeof(PALETTE_ENTRY) * 64,
949
950 if (TuiFadePalette != NULL)
951 {
952 VideoSavePaletteState(TuiFadePalette, 64);
953 }
954 }
955
956 if (UiUseSpecialEffects && ! MachVideoIsPaletteFixed() && TuiFadePalette != NULL)
957 {
958 VideoFadeOut(64);
959 }
960
962
963 if (UiUseSpecialEffects && ! MachVideoIsPaletteFixed() && TuiFadePalette != NULL)
964 {
965 VideoRestorePaletteState(TuiFadePalette, 64);
966 FrLdrTempFree(TuiFadePalette, TAG_TUI_PALETTE);
967 }
968
969}
970
971BOOLEAN TuiEditBox(PCSTR MessageText, PCHAR EditTextBuffer, ULONG Length)
972{
973 INT width = 8;
974 ULONG height = 1;
975 INT curline = 0;
976 INT k;
977 size_t i , j;
978 INT x1, x2, y1, y2;
979 CHAR temp[260];
980 CHAR key;
981 BOOLEAN Extended;
982 INT EditBoxLine;
983 ULONG EditBoxStartX, EditBoxEndX;
984 INT EditBoxCursorX;
985 ULONG EditBoxTextLength, EditBoxTextPosition;
986 INT EditBoxTextDisplayIndex;
987 BOOLEAN ReturnCode;
989
990 // Save the screen contents
994
995 // Find the height
996 for (i=0; i<strlen(MessageText); i++)
997 {
998 if (MessageText[i] == '\n')
999 height++;
1000 }
1001
1002 // Find the width
1003 for (i=0,j=0,k=0; i<height; i++)
1004 {
1005 while ((MessageText[j] != '\n') && (MessageText[j] != 0))
1006 {
1007 j++;
1008 k++;
1009 }
1010
1011 if (k > width)
1012 width = k;
1013
1014 k = 0;
1015 j++;
1016 }
1017
1018 // Calculate box area
1019 x1 = (UiScreenWidth - (width+2))/2;
1020 x2 = x1 + width + 3;
1021 y1 = ((UiScreenHeight - height - 2)/2) + 1;
1022 y2 = y1 + height + 4;
1023
1024 // Draw the box
1026
1027 // Draw the text
1028 for (i=0,j=0; i<strlen(MessageText)+1; i++)
1029 {
1030 if ((MessageText[i] == '\n') || (MessageText[i] == 0))
1031 {
1032 temp[j] = 0;
1033 j = 0;
1035 curline++;
1036 }
1037 else
1038 temp[j++] = MessageText[i];
1039 }
1040
1041 EditBoxTextLength = (ULONG)strlen(EditTextBuffer);
1042 EditBoxTextLength = min(EditBoxTextLength, Length - 1);
1043 EditBoxTextPosition = 0;
1044 EditBoxLine = y2 - 2;
1045 EditBoxStartX = x1 + 3;
1046 EditBoxEndX = x2 - 3;
1047
1048 // Draw the edit box background and the text
1049 UiFillArea(EditBoxStartX, EditBoxLine, EditBoxEndX, EditBoxLine, ' ', ATTR(UiEditBoxTextColor, UiEditBoxBgColor));
1050 UiDrawText2(EditBoxStartX, EditBoxLine, EditBoxEndX - EditBoxStartX + 1, EditTextBuffer, ATTR(UiEditBoxTextColor, UiEditBoxBgColor));
1051
1052 // Show the cursor
1053 EditBoxCursorX = EditBoxStartX;
1054 MachVideoSetTextCursorPosition(EditBoxCursorX, EditBoxLine);
1056
1057 // Draw status text
1058 UiDrawStatusText("Press ENTER to continue, or ESC to cancel");
1059
1061
1062 //
1063 // Enter the text. Please keep in mind that the default input mode
1064 // of the edit boxes is in insertion mode, that is, you can insert
1065 // text without erasing the existing one.
1066 //
1067 for (;;)
1068 {
1069 if (MachConsKbHit())
1070 {
1071 Extended = FALSE;
1072 key = MachConsGetCh();
1073 if (key == KEY_EXTENDED)
1074 {
1075 Extended = TRUE;
1076 key = MachConsGetCh();
1077 }
1078
1079 if (key == KEY_ENTER)
1080 {
1081 ReturnCode = TRUE;
1082 break;
1083 }
1084 else if (key == KEY_ESC)
1085 {
1086 ReturnCode = FALSE;
1087 break;
1088 }
1089 else if (key == KEY_BACKSPACE) // Remove a character
1090 {
1091 if ( (EditBoxTextLength > 0) && (EditBoxTextPosition > 0) &&
1092 (EditBoxTextPosition <= EditBoxTextLength) )
1093 {
1094 EditBoxTextPosition--;
1095 memmove(EditTextBuffer + EditBoxTextPosition,
1096 EditTextBuffer + EditBoxTextPosition + 1,
1097 EditBoxTextLength - EditBoxTextPosition);
1098 EditBoxTextLength--;
1099 EditTextBuffer[EditBoxTextLength] = 0;
1100 }
1101 else
1102 {
1103 MachBeep();
1104 }
1105 }
1106 else if (Extended && key == KEY_DELETE) // Remove a character
1107 {
1108 if ( (EditBoxTextLength > 0) &&
1109 (EditBoxTextPosition < EditBoxTextLength) )
1110 {
1111 memmove(EditTextBuffer + EditBoxTextPosition,
1112 EditTextBuffer + EditBoxTextPosition + 1,
1113 EditBoxTextLength - EditBoxTextPosition);
1114 EditBoxTextLength--;
1115 EditTextBuffer[EditBoxTextLength] = 0;
1116 }
1117 else
1118 {
1119 MachBeep();
1120 }
1121 }
1122 else if (Extended && key == KEY_HOME) // Go to the start of the buffer
1123 {
1124 EditBoxTextPosition = 0;
1125 }
1126 else if (Extended && key == KEY_END) // Go to the end of the buffer
1127 {
1128 EditBoxTextPosition = EditBoxTextLength;
1129 }
1130 else if (Extended && key == KEY_RIGHT) // Go right
1131 {
1132 if (EditBoxTextPosition < EditBoxTextLength)
1133 EditBoxTextPosition++;
1134 else
1135 MachBeep();
1136 }
1137 else if (Extended && key == KEY_LEFT) // Go left
1138 {
1139 if (EditBoxTextPosition > 0)
1140 EditBoxTextPosition--;
1141 else
1142 MachBeep();
1143 }
1144 else if (!Extended) // Add this key to the buffer
1145 {
1146 if ( (EditBoxTextLength < Length - 1) &&
1147 (EditBoxTextPosition < Length - 1) )
1148 {
1149 memmove(EditTextBuffer + EditBoxTextPosition + 1,
1150 EditTextBuffer + EditBoxTextPosition,
1151 EditBoxTextLength - EditBoxTextPosition);
1152 EditTextBuffer[EditBoxTextPosition] = key;
1153 EditBoxTextPosition++;
1154 EditBoxTextLength++;
1155 EditTextBuffer[EditBoxTextLength] = 0;
1156 }
1157 else
1158 {
1159 MachBeep();
1160 }
1161 }
1162 else
1163 {
1164 MachBeep();
1165 }
1166 }
1167
1168 // Draw the edit box background
1169 UiFillArea(EditBoxStartX, EditBoxLine, EditBoxEndX, EditBoxLine, ' ', ATTR(UiEditBoxTextColor, UiEditBoxBgColor));
1170
1171 // Fill the text in
1172 if (EditBoxTextPosition > (EditBoxEndX - EditBoxStartX))
1173 {
1174 EditBoxTextDisplayIndex = EditBoxTextPosition - (EditBoxEndX - EditBoxStartX);
1175 EditBoxCursorX = EditBoxEndX;
1176 }
1177 else
1178 {
1179 EditBoxTextDisplayIndex = 0;
1180 EditBoxCursorX = EditBoxStartX + EditBoxTextPosition;
1181 }
1182 UiDrawText2(EditBoxStartX, EditBoxLine, EditBoxEndX - EditBoxStartX + 1, &EditTextBuffer[EditBoxTextDisplayIndex], ATTR(UiEditBoxTextColor, UiEditBoxBgColor));
1183
1184 // Move the cursor
1185 MachVideoSetTextCursorPosition(EditBoxCursorX, EditBoxLine);
1186
1188
1190
1191 MachHwIdle();
1192 }
1193
1194 // Hide the cursor again
1196
1197 // Restore the screen contents
1200
1201 return ReturnCode;
1202}
1203
1205{
1211 TuiDrawBox,
1223 TuiEditBox,
1227 TuiFadeOut,
1230};
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
Colors
Definition: ansiprsr.h:4
TIMEINFO * ArcGetTime(VOID)
Definition: arcemul.c:27
static LPHIST_ENTRY Bottom
Definition: history.c:54
static LPHIST_ENTRY Top
Definition: history.c:53
#define MachHwIdle()
Definition: machine.h:139
#define MachVideoClearScreen(Attr)
Definition: machine.h:92
#define MachConsPutChar(Ch)
Definition: machine.h:86
#define MachBeep()
Definition: machine.h:118
#define MachConsKbHit()
Definition: machine.h:88
#define MachVideoSetTextCursorPosition(X, Y)
Definition: machine.h:102
#define MachVideoSetDisplayMode(Mode, Init)
Definition: machine.h:94
#define MachConsGetCh()
Definition: machine.h:90
#define MachVideoHideShowTextCursor(Show)
Definition: machine.h:104
#define MachVideoIsPaletteFixed()
Definition: machine.h:110
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
VOID VideoFadeIn(PPALETTE_ENTRY Palette, ULONG ColorCount)
Definition: video.c:79
VOID VideoSetAllColorsToBlack(ULONG ColorCount)
Definition: video.c:67
VOID VideoFadeOut(ULONG ColorCount)
Definition: video.c:138
struct _PALETTE_ENTRY * PPALETTE_ENTRY
VOID VideoFreeOffScreenBuffer(VOID)
Definition: video.c:29
VOID VideoRestorePaletteState(PPALETTE_ENTRY Palette, ULONG ColorCount)
Definition: video.c:54
PVOID VideoAllocateOffScreenBuffer(VOID)
Definition: video.c:16
VOID VideoSavePaletteState(PPALETTE_ENTRY Palette, ULONG ColorCount)
Definition: video.c:44
VOID VideoCopyOffScreenBufferToVRAM(VOID)
Definition: video.c:38
VOID TuiDrawCenteredText(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom, _In_ PCSTR TextString, _In_ UCHAR Attr)
Definition: tui.c:110
VOID TuiMessageBox(PCSTR MessageText)
Definition: tui.c:631
VOID TuiTruncateStringEllipsis(_Inout_z_ PSTR StringText, _In_ ULONG MaxChars)
Definition: tui.c:55
VOID TuiDrawBox(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom, _In_ UCHAR VertStyle, _In_ UCHAR HorzStyle, _In_ BOOLEAN Fill, _In_ BOOLEAN Shadow, _In_ UCHAR Attr)
Definition: tui.c:496
VOID TuiDrawShadow(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom)
Definition: tui.c:351
UCHAR TuiTextToColor(PCSTR ColorText)
Definition: tui.c:852
VOID TuiUnInitialize(VOID)
Definition: tui.c:241
static VOID TuiSetProgressBarText(_In_ PCSTR ProgressText)
Definition: tui.c:735
VOID TuiRestoreScreen(PUCHAR Buffer)
Definition: tui.c:620
VOID TuiFillArea(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, CHAR FillChar, UCHAR Attr)
Definition: tui.c:321
UCHAR TuiTextToFillStyle(PCSTR FillStyleText)
Definition: tui.c:891
VOID TuiDrawText(_In_ ULONG X, _In_ ULONG Y, _In_ PCSTR Text, _In_ UCHAR Attr)
Definition: tui.c:70
#define TAG_TUI_PALETTE
Definition: tui.c:191
static VOID TuiDrawProgressBar(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom, _In_ PCSTR ProgressText)
Definition: tui.c:831
VOID TuiDrawBackdrop(VOID)
Definition: tui.c:264
VOID TuiDrawStatusText(PCSTR StatusText)
Definition: tui.c:526
#define TAG_TUI_SCREENBUFFER
Definition: tui.c:190
VOID TuiDrawBoxBottomLine(_In_ ULONG Left, _In_ ULONG Bottom, _In_ ULONG Right, _In_ UCHAR VertStyle, _In_ UCHAR HorzStyle, _In_ UCHAR Attr)
Definition: tui.c:452
static VOID TuiTickProgressBar(_In_ ULONG SubPercentTimes100)
Definition: tui.c:763
VOID TuiFadeInBackdrop(VOID)
Definition: tui.c:915
VOID TuiDrawText2(_In_ ULONG X, _In_ ULONG Y, _In_opt_ ULONG MaxNumChars, _In_reads_or_z_(MaxNumChars) PCSTR Text, _In_ UCHAR Attr)
Definition: tui.c:87
VOID TuiUpdateDateTime(VOID)
Definition: tui.c:541
UCHAR MachDefaultTextColor
Definition: pcvideo.c:111
static VOID TuiDrawProgressBarCenter(_In_ PCSTR ProgressText)
Definition: tui.c:807
VOID TuiMessageBoxCritical(PCSTR MessageText)
Definition: tui.c:648
BOOLEAN TuiInitialize(VOID)
Definition: tui.c:195
BOOLEAN TuiEditBox(PCSTR MessageText, PCHAR EditTextBuffer, ULONG Length)
Definition: tui.c:971
VOID TuiSaveScreen(PUCHAR Buffer)
Definition: tui.c:609
PVOID TextVideoBuffer
Definition: tui.c:22
VOID TuiDrawBoxTopLine(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ UCHAR VertStyle, _In_ UCHAR HorzStyle, _In_ UCHAR Attr)
Definition: tui.c:408
const UIVTBL TuiVtbl
Definition: tui.c:1204
VOID TuiFadeOut(VOID)
Definition: tui.c:941
INT TuiPrintf(_In_ PCSTR Format,...)
Definition: tui.c:31
#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
const PCSTR FrLdrVersionString
Definition: freeldr.c:32
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546
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
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 GLint GLint j
Definition: glfuncs.h:250
#define X(b, s)
#define KEY_RIGHT
Definition: keycodes.h:48
#define KEY_DELETE
Definition: keycodes.h:41
#define KEY_BACKSPACE
Definition: keycodes.h:40
#define KEY_EXTENDED
Definition: keycodes.h:38
#define KEY_ESC
Definition: keycodes.h:49
#define KEY_SPACE
Definition: keycodes.h:42
#define KEY_END
Definition: keycodes.h:64
#define KEY_ENTER
Definition: keycodes.h:39
#define KEY_LEFT
Definition: keycodes.h:47
#define KEY_HOME
Definition: keycodes.h:44
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
#define ASSERT(a)
Definition: mode.c:44
#define min(a, b)
Definition: monoChain.cc:55
int k
Definition: mpi.c:3369
#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
#define _Inout_z_
Definition: ms_sal.h:383
HANDLE ScreenBuffer
Definition: notevil.c:37
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
NTSTRSAFEVAPI RtlStringCbPrintfA(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cbDest, _In_ _Printf_format_string_ NTSTRSAFE_PCSTR pszFormat,...)
Definition: ntstrsafe.h:1148
NTSTRSAFEAPI RtlStringCbCopyA(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cbDest, _In_ NTSTRSAFE_PCSTR pszSrc)
Definition: ntstrsafe.h:156
#define INT
Definition: polytest.cpp:20
static calc_node_t temp
Definition: rpn_ieee.c:38
Definition: video.h:12
Definition: fw.h:10
USHORT Month
Definition: fw.h:12
USHORT Day
Definition: fw.h:13
USHORT Minute
Definition: fw.h:15
USHORT Hour
Definition: fw.h:14
USHORT Second
Definition: fw.h:16
USHORT Year
Definition: fw.h:11
ULONG Top
Definition: ui.h:125
ULONG Bottom
Definition: ui.h:127
BOOLEAN Show
Definition: ui.h:129
ULONG Left
Definition: ui.h:124
ULONG Right
Definition: ui.h:126
Definition: copy.c:22
Definition: ui.h:246
#define VD_UL
Definition: tui.h:163
#define UR
Definition: tui.h:149
VOID TuiDrawMenu(_In_ PUI_MENU_INFO MenuInfo)
Definition: tuimenu.c:191
#define LR
Definition: tui.h:151
#define D_LR
Definition: tui.h:156
#define D_UL
Definition: tui.h:153
#define TUI_TITLE_BOX_CHAR_HEIGHT
Definition: tui.h:33
#define UL
Definition: tui.h:148
#define VD_LL
Definition: tui.h:165
#define HD_UR
Definition: tui.h:159
#define HD_LL
Definition: tui.h:160
#define LL
Definition: tui.h:150
#define D_UR
Definition: tui.h:154
#define D_LL
Definition: tui.h:155
BOOLEAN TuiDisplayMenu(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: tuimenu.c:30
#define HD_UL
Definition: tui.h:158
#define VD_LR
Definition: tui.h:166
#define HD_LR
Definition: tui.h:161
#define VD_UR
Definition: tui.h:164
char * PSTR
Definition: typedefs.h:51
ULONG_PTR SIZE_T
Definition: typedefs.h:80
int32_t INT
Definition: typedefs.h:58
const char * PCSTR
Definition: typedefs.h:52
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
char * PCHAR
Definition: typedefs.h:51
#define LIGHT_FILL
Definition: ui.h:307
#define COLOR_LIGHTBLUE
Definition: ui.h:329
#define COLOR_LIGHTMAGENTA
Definition: ui.h:333
UCHAR UiMessageBoxFgColor
Definition: ui.c:32
UCHAR UiMessageBoxBgColor
Definition: ui.c:33
UI_PROGRESS_BAR UiProgressBar
Definition: ui.c:62
ULONG UiScreenWidth
Definition: ui.c:54
UCHAR UiEditBoxTextColor
Definition: ui.c:39
#define VERT
Definition: ui.h:345
#define COLOR_BLUE
Definition: ui.h:320
UCHAR UiStatusBarBgColor
Definition: ui.c:26
VOID UiDrawText(_In_ ULONG X, _In_ ULONG Y, _In_ PCSTR Text, _In_ UCHAR Attr)
Definition: ui.c:254
BOOLEAN UiUseSpecialEffects
Definition: ui.c:45
#define COLOR_DARKGRAY
Definition: ui.h:328
#define D_HORZ
Definition: ui.h:344
#define COLOR_LIGHTRED
Definition: ui.h:332
BOOLEAN UiCenterMenu
Definition: ui.c:44
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
#define COLOR_GRAY
Definition: ui.h:326
UCHAR UiTitleBoxBgColor
Definition: ui.c:31
#define D_VERT
Definition: ui.h:346
#define COLOR_YELLOW
Definition: ui.h:334
#define COLOR_LIGHTCYAN
Definition: ui.h:331
const PCSTR UiMonthNames[12]
Definition: ui.c:50
UCHAR UiTextColor
Definition: ui.c:36
UCHAR UiMenuBgColor
Definition: ui.c:35
#define MEDIUM_FILL
Definition: ui.h:308
#define ATTR(cFore, cBack)
Definition: ui.h:314
#define COLOR_CYAN
Definition: ui.h:322
CHAR UiTimeText[260]
Definition: ui.c:48
#define HORZ
Definition: ui.h:343
#define COLOR_MAGENTA
Definition: ui.h:324
#define COLOR_BROWN
Definition: ui.h:325
CHAR UiTitleBoxTitleText[260]
Definition: ui.c:47
#define COLOR_WHITE
Definition: ui.h:335
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
UCHAR UiBackdropBgColor
Definition: ui.c:28
ULONG UiScreenHeight
Definition: ui.c:55
BOOLEAN UiMenuBox
Definition: ui.c:43
#define COLOR_BLACK
Definition: ui.h:319
VOID UiDrawStatusText(PCSTR StatusText)
Definition: ui.c:286
UCHAR UiStatusBarFgColor
Definition: ui.c:25
#define DARK_FILL
Definition: ui.h:309
UCHAR UiSelectedTextColor
Definition: ui.c:37
UCHAR UiSelectedTextBgColor
Definition: ui.c:38
#define COLOR_LIGHTGREEN
Definition: ui.h:330
#define COLOR_RED
Definition: ui.h:323
UCHAR UiMenuFgColor
Definition: ui.c:34
VOID UiInitProgressBar(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom, _In_ PCSTR ProgressText)
Definition: ui.c:384
UCHAR UiEditBoxBgColor
Definition: ui.c:40
#define COLOR_GREEN
Definition: ui.h:321
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
Definition: font.h:89
_In_ HFONT _Out_ PUINT Height
Definition: font.h:88
#define BY_AUTHOR
Definition: ver.h:26
#define AUTHOR_EMAIL
Definition: ver.h:25
_In_ WDFCOLLECTION _In_ ULONG Index
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2
Definition: winddi.h:3710
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG y1
Definition: winddi.h:3709
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3708
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG _In_ LONG y2
Definition: winddi.h:3711
void int int ULONGLONG int va_list * ap
Definition: winesup.h:36
#define _vsnprintf
Definition: xmlstorage.h:202
unsigned char UCHAR
Definition: xmlstorage.h:181
char CHAR
Definition: xmlstorage.h:175