*/
#include <freeldr.h>
-#include <ui.h>
-#include "tui.h"
-#include <rtl.h>
-#include <mm.h>
-#include <machine.h>
+
+#define NDEBUG
#include <debug.h>
-#include <inifile.h>
-#include <version.h>
-#include <video.h>
+
ULONG UiScreenWidth = 80; // Screen Width
ULONG UiScreenHeight = 25; // Screen Height
VIDEODISPLAYMODE UiDisplayMode = VideoTextMode; // Tells us if we are in text or graphics mode
BOOL UiUseSpecialEffects = FALSE; // Tells us if we should use fade effects
+BOOL UiDrawTime = TRUE; // Tells us if we should draw the time
+BOOL UiMinimal = FALSE; // Tells us if we should use a minimal console-like UI
+BOOL UiCenterMenu = TRUE; // Tells us if we should use a centered or left-aligned menu
+BOOL UiMenuBox = TRUE; // Tells us if we shuld draw a box around the menu
+CHAR UiTimeText[260] = "[Time Remaining: ] ";
-CHAR UiMonthNames[12][15] = { "January ", "February ", "March ", "April ", "May ", "June ", "July ", "August ", "September ", "October ", "November ", "December " };
+const CHAR UiMonthNames[12][15] = { "January ", "February ", "March ", "April ", "May ", "June ", "July ", "August ", "September ", "October ", "November ", "December " };
BOOL UiInitialize(BOOLEAN ShowGui)
{
strcpy(UiTitleBoxTitleText, SettingText);
}
+ if (IniReadSettingByName(SectionId, "TimeText", SettingText, 260))
+ {
+ strcpy(UiTimeText, SettingText);
+ }
if (IniReadSettingByName(SectionId, "StatusBarColor", SettingText, 260))
{
UiStatusBarBgColor = UiTextToColor(SettingText);
}
if (IniReadSettingByName(SectionId, "SpecialEffects", SettingText, 260))
{
- if (stricmp(SettingText, "Yes") == 0 && strlen(SettingText) == 3)
+ if (_stricmp(SettingText, "Yes") == 0 && strlen(SettingText) == 3)
{
UiUseSpecialEffects = TRUE;
}
UiUseSpecialEffects = FALSE;
}
}
+ if (IniReadSettingByName(SectionId, "ShowTime", SettingText, 260))
+ {
+ if (_stricmp(SettingText, "Yes") == 0 && strlen(SettingText) == 3)
+ {
+ UiDrawTime = TRUE;
+ }
+ else
+ {
+ UiDrawTime = FALSE;
+ }
+ }
+ if (IniReadSettingByName(SectionId, "MinimalUI", SettingText, 260))
+ {
+ if (_stricmp(SettingText, "Yes") == 0 && strlen(SettingText) == 3)
+ {
+ UiMinimal = TRUE;
+ }
+ else
+ {
+ UiMinimal = FALSE;
+ }
+ }
+ if (IniReadSettingByName(SectionId, "MenuBox", SettingText, 260))
+ {
+ if (_stricmp(SettingText, "Yes") == 0 && strlen(SettingText) == 3)
+ {
+ UiMenuBox = TRUE;
+ }
+ else
+ {
+ UiMenuBox = FALSE;
+ }
+ }
+ if (IniReadSettingByName(SectionId, "CenterMenu", SettingText, 260))
+ {
+ if (_stricmp(SettingText, "Yes") == 0 && strlen(SettingText) == 3)
+ {
+ UiCenterMenu = TRUE;
+ }
+ else
+ {
+ UiCenterMenu = FALSE;
+ }
+ }
}
UiDisplayMode = MachVideoSetDisplayMode(DisplayModeText, TRUE);
UserInterfaceUp = TRUE;
+ DbgPrint((DPRINT_UI, "UiInitialize() returning TRUE.\n"));
+ return TRUE;
+}
+
+BOOL SetupUiInitialize(VOID)
+{
+
+ CHAR DisplayModeText[260];
+ ULONG Depth;
+
+
+ DisplayModeText[0] = '\0';
+
+
+ UiDisplayMode = MachVideoSetDisplayMode(DisplayModeText, TRUE);
+ MachVideoGetDisplaySize(&UiScreenWidth, &UiScreenHeight, &Depth);
+
+ TuiInitialize();
+
+ // Draw the backdrop and fade it in if special effects are enabled
+ TuiFillArea(0,
+ 0,
+ UiScreenWidth - 1,
+ UiScreenHeight - 2,
+ 0,
+ ATTR(UiBackdropFgColor, UiBackdropBgColor));
+
+ UiStatusBarBgColor = 7;
+ UserInterfaceUp = TRUE;
+
+ TuiDrawText(4, 1, "ReactOS " KERNEL_VERSION_STR " Setup", ATTR(COLOR_GRAY, UiBackdropBgColor));
+ TuiDrawText(3, 2, "\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD", ATTR(COLOR_GRAY, UiBackdropBgColor));
+
DbgPrint((DPRINT_UI, "UiInitialize() returning TRUE.\n"));
return TRUE;
}
-VOID UiUnInitialize(PCHAR BootText)
+VOID UiUnInitialize(PCSTR BootText)
{
UiDrawBackdrop();
UiDrawStatusText("Booting...");
}
}
-VOID UiDrawText(ULONG X, ULONG Y, PCHAR Text, UCHAR Attr)
+VOID UiDrawText(ULONG X, ULONG Y, PCSTR Text, UCHAR Attr)
{
if (VideoTextMode == UiDisplayMode)
{
}
}
-VOID UiDrawCenteredText(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, PCHAR TextString, UCHAR Attr)
+VOID UiDrawCenteredText(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, PCSTR TextString, UCHAR Attr)
{
if (VideoTextMode == UiDisplayMode)
{
}
}
-VOID UiDrawStatusText(PCHAR StatusText)
+VOID UiDrawStatusText(PCSTR StatusText)
{
if (!UserInterfaceUp) return;
}
}
-VOID UiInfoBox(PCHAR MessageText)
+VOID UiInfoBox(PCSTR MessageText)
{
ULONG TextLength;
ULONG BoxWidth;
UiDrawCenteredText(Left, Top, Right, Bottom, MessageText, ATTR(UiTextColor, UiMenuBgColor));
}
-VOID UiMessageBox(PCHAR MessageText)
+VOID UiMessageBox(PCSTR MessageText)
{
// We have not yet displayed the user interface
// We are probably still reading the .ini file
}
}
-VOID UiMessageBoxCritical(PCHAR MessageText)
+VOID UiMessageBoxCritical(PCSTR MessageText)
{
// We have not yet displayed the user interface
// We are probably still reading the .ini file
}
}
-UCHAR UiTextToColor(PCHAR ColorText)
+UCHAR UiTextToColor(PCSTR ColorText)
{
if (VideoTextMode == UiDisplayMode)
{
}
}
-UCHAR UiTextToFillStyle(PCHAR FillStyleText)
+UCHAR UiTextToFillStyle(PCSTR FillStyleText)
{
if (VideoTextMode == UiDisplayMode)
{
}
}
-VOID UiShowMessageBoxesInSection(PCHAR SectionName)
+VOID UiShowMessageBoxesInSection(PCSTR SectionName)
{
ULONG Idx;
CHAR SettingName[80];
{
IniReadSettingByNumber(SectionId, Idx, SettingName, 79, SettingValue, 79);
- if (stricmp(SettingName, "MessageBox") == 0)
+ if (_stricmp(SettingName, "MessageBox") == 0)
{
// Get the real length of the MessageBox text
MessageBoxTextSize = IniGetSectionSettingValueSize(SectionId, Idx);
}
}
-BOOL UiDisplayMenu(PCHAR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenuItem, LONG MenuTimeOut, ULONG* SelectedMenuItem, BOOL CanEscape, UiMenuKeyPressFilterCallback KeyPressFilter)
+BOOL UiDisplayMenu(PCSTR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenuItem, LONG MenuTimeOut, ULONG* SelectedMenuItem, BOOL CanEscape, UiMenuKeyPressFilterCallback KeyPressFilter)
{
if (VideoTextMode == UiDisplayMode)
{
}
}
-BOOL UiEditBox(PCHAR MessageText, PCHAR EditTextBuffer, ULONG Length)
+BOOL UiEditBox(PCSTR MessageText, PCHAR EditTextBuffer, ULONG Length)
{
if (VideoTextMode == UiDisplayMode)
{