#include <freeldr.h>
PVOID TextVideoBuffer = NULL;
+extern BOOL UiDrawTime;
+extern BOOL UiMinimal;
/*
* printf() - prints formatted text to stdout
switch (c = *(format++))
{
case 'd': case 'u': case 'x':
- *_itoa(va_arg(ap, unsigned long), str, 10) = 0;
+ if (c == 'x')
+ *_itoa(va_arg(ap, unsigned long), str, 16) = 0;
+ else
+ *_itoa(va_arg(ap, unsigned long), str, 10) = 0;
ptr = str;
VOID TuiDrawBackdrop(VOID)
{
+ if (UiMinimal)
+ {
+ //
+ // Fill in a black background
+ //
+ TuiFillArea(0,
+ 0,
+ UiScreenWidth - 1,
+ UiScreenHeight - 1,
+ 0,
+ 0);
+
+ //
+ // Update the screen buffer
+ //
+ VideoCopyOffScreenBufferToVRAM();
+ return;
+ }
+
//
// Fill in the background (excluding title box & status bar)
//
ULONG i, j;
// Clip the area to the screen
- // FIXME: This code seems to have problems... Uncomment and view ;-)
- /*if ((Left >= UiScreenWidth) || (Top >= UiScreenHeight))
+ if ((Left >= UiScreenWidth) || (Top >= UiScreenHeight))
{
return;
}
- if ((Left + Right) >= UiScreenWidth)
+ if (Right >= UiScreenWidth)
{
- Right = UiScreenWidth - Left;
+ Right = UiScreenWidth - 1;
}
- if ((Top + Bottom) >= UiScreenHeight)
+ if (Bottom >= UiScreenHeight)
{
- Bottom = UiScreenHeight - Top;
- }*/
+ Bottom = UiScreenHeight - 1;
+ }
// Loop through each line and fill it in
for (i=Top; i<=Bottom; i++)
{
ULONG i;
+ //
+ // Minimal UI doesn't have a status bar
+ //
+ if (UiMinimal) return;
+
TuiDrawText(0, UiScreenHeight-1, " ", ATTR(UiStatusBarFgColor, UiStatusBarBgColor));
TuiDrawText(1, UiScreenHeight-1, StatusText, ATTR(UiStatusBarFgColor, UiStatusBarBgColor));
CHAR TempString[20];
BOOL PMHour = FALSE;
+ /* Don't draw the time if this has been disabled */
+ if (!UiDrawTime) return;
+
MachRTCGetCurrentDateTime(&Year, &Month, &Day, &Hour, &Minute, &Second);
if (Year < 1 || 9999 < Year || Month < 1 || 12 < Month || Day < 1 ||
31 < Day || 23 < Hour || 59 < Minute || 59 < Second)
ULONG Width = 50; // Allow for 50 "bars"
ULONG Height = 2;
- Left = (UiScreenWidth - Width - 4) / 2;
- Right = Left + Width + 3;
- Top = (UiScreenHeight - Height - 2) / 2;
- Top += 2;
+ //
+ // Is this the minimal UI?
+ //
+ if (UiMinimal)
+ {
+ //
+ // Use alternate settings
+ //
+ Width = 80;
+ Left = 0;
+ Right = Left + Width;
+ Top = UiScreenHeight - Height - 4;
+ Bottom = Top + Height + 1;
+ }
+ else
+ {
+ Left = (UiScreenWidth - Width - 4) / 2;
+ Right = Left + Width + 3;
+ Top = (UiScreenHeight - Height - 2) / 2;
+ Top += 2;
+ }
+
Bottom = Top + Height + 1;
TuiDrawProgressBar(Left, Top, Right, Bottom, Position, Range, ProgressText);
Position = Range;
}
- // Draw the box
- TuiDrawBox(Left, Top, Right, Bottom, VERT, HORZ, TRUE, TRUE, ATTR(UiMenuFgColor, UiMenuBgColor));
-
- // Draw the "Loading..." text
- //TuiDrawText(70/2, Top+1, "Loading...", ATTR(UiTextColor, UiMenuBgColor));
- TuiDrawCenteredText(Left + 2, Top + 2, Right - 2, Top + 2, ProgressText, ATTR(UiTextColor, UiMenuBgColor));
+ //
+ // Minimal UI has no box, and only generic loading text
+ //
+ if (!UiMinimal)
+ {
+ // Draw the box
+ TuiDrawBox(Left, Top, Right, Bottom, VERT, HORZ, TRUE, TRUE, ATTR(UiMenuFgColor, UiMenuBgColor));
+
+ //
+ // Draw the "Loading..." text
+ //
+ TuiDrawCenteredText(Left + 2, Top + 2, Right - 2, Top + 2, ProgressText, ATTR(UiTextColor, UiMenuBgColor));
+ }
+ else
+ {
+ //
+ // Draw the "Loading..." text
+ //
+ TuiDrawCenteredText(Left + 2, Top + 1, Right - 2, Top + 1, "ReactOS is loading files...", ATTR(7, 0));
+ }
// Draw the percent complete
for (i=0; i<(Position*ProgressBarWidth)/Range; i++)
TuiDrawText(Left+2+i, Top+2, "\xDB", ATTR(UiTextColor, UiMenuBgColor));
}
- // Draw the rest
- for (; i<ProgressBarWidth; i++)
- {
- TuiDrawText(Left+2+i, Top+2, "\xB2", ATTR(UiTextColor, UiMenuBgColor));
- }
+ // Draw the shadow for non-minimal UI
+ if (!UiMinimal)
+ {
+ for (; i<ProgressBarWidth; i++)
+ {
+ TuiDrawText(Left+2+i, Top+2, "\xB2", ATTR(UiTextColor, UiMenuBgColor));
+ }
+ }
TuiUpdateDateTime();
-
VideoCopyOffScreenBufferToVRAM();
}