[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.
This commit is contained in:
Hermès Bélusca-Maïto 2022-01-05 04:15:41 +01:00
parent 844c9dce6c
commit 06fc2e72a6
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
5 changed files with 28 additions and 15 deletions

View file

@ -73,7 +73,7 @@ list(APPEND FREELDR_BOOTMGR_SOURCE
options.c options.c
oslist.c oslist.c
ui/directui.c ui/directui.c
ui/gui.c # ui/gui.c
ui/minitui.c ui/minitui.c
ui/noui.c ui/noui.c
ui/tui.c ui/tui.c

View file

@ -32,7 +32,6 @@
/* Public headers */ /* Public headers */
#ifdef __REACTOS__ #ifdef __REACTOS__
#define NTOSAPI #define NTOSAPI
#define printf TuiPrintf
#include <ntddk.h> #include <ntddk.h>
#include <ntifs.h> #include <ntifs.h>
#include <ioaccess.h> #include <ioaccess.h>
@ -76,7 +75,6 @@
#include <options.h> #include <options.h>
#include <oslist.h> #include <oslist.h>
#include <ramdisk.h> #include <ramdisk.h>
#include <ui.h>
#include <ver.h> #include <ver.h>
/* NTOS loader */ /* NTOS loader */
@ -93,10 +91,8 @@
#include <fs/btrfs.h> #include <fs/btrfs.h>
/* UI support */ /* UI support */
#include <ui/gui.h> #define printf TuiPrintf
#include <ui/minitui.h> #include <ui.h>
#include <ui/noui.h>
#include <ui/tui.h>
#include <ui/video.h> #include <ui/video.h>
/* Arch specific includes */ /* Arch specific includes */

View file

@ -54,7 +54,8 @@ extern const CHAR UiMonthNames[12][15];
// User Interface Functions // 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 UiUnInitialize(PCSTR BootText); // Un-initialize User-Interface
VOID UiDrawBackdrop(VOID); // Fills the entire screen with a backdrop 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 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 D_HORZ 0xCD // Double horizontal line
#define VERT 0xB3 // Single vertical line #define VERT 0xB3 // Single vertical line
#define D_VERT 0xBA // Double vertical line #define D_VERT 0xBA // Double vertical line
/* THEME HEADERS *************************************************************/
// #include <ui/gui.h>
#include <ui/minitui.h>
#include <ui/noui.h>
#include <ui/tui.h>

View file

@ -48,12 +48,12 @@ TuiPrintf(const char *Format,
} }
BOOLEAN BOOLEAN
UiInitialize(IN BOOLEAN ShowGui) UiInitialize(IN BOOLEAN ShowUi)
{ {
ULONG Depth; ULONG Depth;
/* Nothing to do */ /* Nothing to do */
if (!ShowGui) return TRUE; if (!ShowUi) return TRUE;
/* Set mode and query size */ /* Set mode and query size */
MachVideoSetDisplayMode(NULL, TRUE); MachVideoSetDisplayMode(NULL, TRUE);

View file

@ -81,7 +81,7 @@ UIVTBL UiVtbl =
NoUiDrawMenu, NoUiDrawMenu,
}; };
BOOLEAN UiInitialize(BOOLEAN ShowGui) BOOLEAN UiInitialize(BOOLEAN ShowUi)
{ {
VIDEODISPLAYMODE UiDisplayMode; // Tells us if we are in text or graphics mode 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 BOOLEAN UiMinimal = FALSE; // Tells us if we are using a minimal console-like UI
@ -89,7 +89,7 @@ BOOLEAN UiInitialize(BOOLEAN ShowGui)
ULONG Depth; ULONG Depth;
CHAR SettingText[260]; CHAR SettingText[260];
if (!ShowGui) if (!ShowUi)
{ {
if (!UiVtbl.Initialize()) if (!UiVtbl.Initialize())
{ {
@ -121,10 +121,18 @@ BOOLEAN UiInitialize(BOOLEAN ShowGui)
UiMinimal = (_stricmp(SettingText, "Yes") == 0 && strlen(SettingText) == 3); UiMinimal = (_stricmp(SettingText, "Yes") == 0 && strlen(SettingText) == 3);
} }
if (UiDisplayMode == VideoTextMode) if (UiDisplayMode == VideoGraphicsMode)
UiVtbl = (UiMinimal ? MiniTuiVtbl : TuiVtbl); #if 0 // We don't support a GUI mode yet.
else
UiVtbl = GuiVtbl; 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()) if (!UiVtbl.Initialize())
{ {