From 06fc2e72a6d0bb20ec183211bd3efb4f0e1d782c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Wed, 5 Jan 2022 04:15:41 +0100 Subject: [PATCH] [FREELDR:UI] Disable GUI code from compilation as it is currently stubbed. Rename "ShowGui" -> "ShowUi" as this variable was actually unrelated to *graphical* aspects of the UI. --- boot/freeldr/freeldr/CMakeLists.txt | 2 +- boot/freeldr/freeldr/include/freeldr.h | 8 ++------ boot/freeldr/freeldr/include/ui.h | 11 ++++++++++- boot/freeldr/freeldr/ui/directui.c | 4 ++-- boot/freeldr/freeldr/ui/ui.c | 18 +++++++++++++----- 5 files changed, 28 insertions(+), 15 deletions(-) diff --git a/boot/freeldr/freeldr/CMakeLists.txt b/boot/freeldr/freeldr/CMakeLists.txt index 1746b7b8028..0827186d090 100644 --- a/boot/freeldr/freeldr/CMakeLists.txt +++ b/boot/freeldr/freeldr/CMakeLists.txt @@ -73,7 +73,7 @@ list(APPEND FREELDR_BOOTMGR_SOURCE options.c oslist.c ui/directui.c - ui/gui.c + # ui/gui.c ui/minitui.c ui/noui.c ui/tui.c diff --git a/boot/freeldr/freeldr/include/freeldr.h b/boot/freeldr/freeldr/include/freeldr.h index ac2a5e8b13f..91b196f5600 100644 --- a/boot/freeldr/freeldr/include/freeldr.h +++ b/boot/freeldr/freeldr/include/freeldr.h @@ -32,7 +32,6 @@ /* Public headers */ #ifdef __REACTOS__ #define NTOSAPI -#define printf TuiPrintf #include #include #include @@ -76,7 +75,6 @@ #include #include #include -#include #include /* NTOS loader */ @@ -93,10 +91,8 @@ #include /* UI support */ -#include -#include -#include -#include +#define printf TuiPrintf +#include #include /* Arch specific includes */ diff --git a/boot/freeldr/freeldr/include/ui.h b/boot/freeldr/freeldr/include/ui.h index cb8ca437c77..a42622f7d13 100644 --- a/boot/freeldr/freeldr/include/ui.h +++ b/boot/freeldr/freeldr/include/ui.h @@ -54,7 +54,8 @@ extern const CHAR UiMonthNames[12][15]; // User Interface Functions // /////////////////////////////////////////////////////////////////////////////////////// -BOOLEAN UiInitialize(BOOLEAN ShowGui); // Initialize User-Interface + +BOOLEAN UiInitialize(BOOLEAN ShowUi); // Initialize User-Interface VOID UiUnInitialize(PCSTR BootText); // Un-initialize User-Interface VOID UiDrawBackdrop(VOID); // Fills the entire screen with a backdrop VOID UiFillArea(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, CHAR FillChar, UCHAR Attr /* Color Attributes */); // Fills the area specified with FillChar and Attr @@ -229,3 +230,11 @@ extern UIVTBL UiVtbl; #define D_HORZ 0xCD // Double horizontal line #define VERT 0xB3 // Single vertical line #define D_VERT 0xBA // Double vertical line + + +/* THEME HEADERS *************************************************************/ + +// #include +#include +#include +#include diff --git a/boot/freeldr/freeldr/ui/directui.c b/boot/freeldr/freeldr/ui/directui.c index eccb2fbff66..6771bd498f9 100644 --- a/boot/freeldr/freeldr/ui/directui.c +++ b/boot/freeldr/freeldr/ui/directui.c @@ -48,12 +48,12 @@ TuiPrintf(const char *Format, } BOOLEAN -UiInitialize(IN BOOLEAN ShowGui) +UiInitialize(IN BOOLEAN ShowUi) { ULONG Depth; /* Nothing to do */ - if (!ShowGui) return TRUE; + if (!ShowUi) return TRUE; /* Set mode and query size */ MachVideoSetDisplayMode(NULL, TRUE); diff --git a/boot/freeldr/freeldr/ui/ui.c b/boot/freeldr/freeldr/ui/ui.c index fa06f73ae85..481f0983e54 100644 --- a/boot/freeldr/freeldr/ui/ui.c +++ b/boot/freeldr/freeldr/ui/ui.c @@ -81,7 +81,7 @@ UIVTBL UiVtbl = NoUiDrawMenu, }; -BOOLEAN UiInitialize(BOOLEAN ShowGui) +BOOLEAN UiInitialize(BOOLEAN ShowUi) { VIDEODISPLAYMODE UiDisplayMode; // Tells us if we are in text or graphics mode BOOLEAN UiMinimal = FALSE; // Tells us if we are using a minimal console-like UI @@ -89,7 +89,7 @@ BOOLEAN UiInitialize(BOOLEAN ShowGui) ULONG Depth; CHAR SettingText[260]; - if (!ShowGui) + if (!ShowUi) { if (!UiVtbl.Initialize()) { @@ -121,10 +121,18 @@ BOOLEAN UiInitialize(BOOLEAN ShowGui) UiMinimal = (_stricmp(SettingText, "Yes") == 0 && strlen(SettingText) == 3); } - if (UiDisplayMode == VideoTextMode) - UiVtbl = (UiMinimal ? MiniTuiVtbl : TuiVtbl); - else + if (UiDisplayMode == VideoGraphicsMode) +#if 0 // We don't support a GUI mode yet. UiVtbl = GuiVtbl; +#else + { + // Switch back to text mode. + MachVideoSetDisplayMode(NULL, TRUE); + UiDisplayMode = VideoTextMode; + } +#endif + else // if (UiDisplayMode == VideoTextMode) + UiVtbl = (UiMinimal ? MiniTuiVtbl : TuiVtbl); if (!UiVtbl.Initialize()) {