Example #1
0
VOID UiUnInitialize(PCSTR BootText)
{
	UiDrawBackdrop();
	UiDrawStatusText("Booting...");
	UiInfoBox(BootText);

	UiVtbl.UnInitialize();
}
Example #2
0
File: ui.c Project: GYGit/reactos
VOID UiMessageBox(PCSTR Format, ...)
{
    CHAR Buffer[256];
    va_list ap;

    va_start(ap, Format);
    vsnprintf(Buffer, sizeof(Buffer) - sizeof(CHAR), Format, ap);
    UiVtbl.MessageBox(Buffer);
    va_end(ap);
}
Example #3
0
BOOLEAN SetupUiInitialize(VOID)
{
	CHAR	DisplayModeText[260];
	ULONG	Depth, Length;


	DisplayModeText[0] = '\0';

	MachVideoSetDisplayMode(DisplayModeText, TRUE);
	MachVideoGetDisplaySize(&UiScreenWidth, &UiScreenHeight, &Depth);

	UiVtbl = SetupUiVtbl;
	UiVtbl.Initialize();

	// Draw the backdrop and fade it in if special effects are enabled
	UiVtbl.FillArea(0,
			0,
			UiScreenWidth - 1,
			UiScreenHeight - 2,
			0,
			ATTR(UiBackdropFgColor, UiBackdropBgColor));

	UiDrawTime = FALSE;
	UiStatusBarBgColor = 7;

	Length = strlen("Odyssey " KERNEL_VERSION_STR " Setup");
	memset(DisplayModeText, 0xcd, Length + 2);
	DisplayModeText[Length + 2] = '\0';

	UiVtbl.DrawText(4, 1, "Odyssey " KERNEL_VERSION_STR " Setup", ATTR(COLOR_GRAY, UiBackdropBgColor));
	UiVtbl.DrawText(3, 2, DisplayModeText, ATTR(COLOR_GRAY, UiBackdropBgColor));

	TRACE("UiInitialize() returning TRUE.\n");

	return TRUE;
}
Example #4
0
UCHAR UiTextToColor(PCSTR ColorText)
{
	return UiVtbl.TextToColor(ColorText);
}
Example #5
0
VOID UiMessageBoxCritical(PCSTR MessageText)
{
	UiVtbl.MessageBoxCritical(MessageText);
}
Example #6
0
VOID UiMessageBox(PCSTR MessageText)
{
	UiVtbl.MessageBox(MessageText);
}
Example #7
0
BOOLEAN UiEditBox(PCSTR MessageText, PCHAR EditTextBuffer, ULONG Length)
{
	return UiVtbl.EditBox(MessageText, EditTextBuffer, Length);
}
Example #8
0
VOID UiFadeInBackdrop(VOID)
{
	UiVtbl.FadeInBackdrop();
}
Example #9
0
VOID UiDrawProgressBar(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, ULONG Position, ULONG Range, PCHAR ProgressText)
{
	UiVtbl.DrawProgressBar(Left, Top, Right, Bottom, Position, Range, ProgressText);
}
Example #10
0
VOID UiDrawBox(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, UCHAR VertStyle, UCHAR HorzStyle, BOOLEAN Fill, BOOLEAN Shadow, UCHAR Attr)
{
	UiVtbl.DrawBox(Left, Top, Right, Bottom, VertStyle, HorzStyle, Fill, Shadow, Attr);
}
Example #11
0
VOID UiDrawShadow(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom)
{
	UiVtbl.DrawShadow(Left, Top, Right, Bottom);
}
Example #12
0
VOID UiFillArea(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, CHAR FillChar, UCHAR Attr /* Color Attributes */)
{
	UiVtbl.FillArea(Left, Top, Right, Bottom, FillChar, Attr);
}
Example #13
0
VOID UiDrawBackdrop(VOID)
{
	UiVtbl.DrawBackdrop();
}
Example #14
0
UCHAR UiTextToFillStyle(PCSTR FillStyleText)
{
	return UiVtbl.TextToFillStyle(FillStyleText);
}
Example #15
0
VOID UiDrawText(ULONG X, ULONG Y, PCSTR Text, UCHAR Attr)
{
	UiVtbl.DrawText(X, Y, Text, Attr);
}
Example #16
0
VOID UiDrawProgressBarCenter(ULONG Position, ULONG Range, PCHAR ProgressText)
{
	UiVtbl.DrawProgressBarCenter(Position, Range, ProgressText);
}
Example #17
0
VOID UiDrawCenteredText(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, PCSTR TextString, UCHAR Attr)
{
	UiVtbl.DrawCenteredText(Left, Top, Right, Bottom, TextString, Attr);
}
Example #18
0
BOOLEAN UiDisplayMenu(PCSTR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenuItem, LONG MenuTimeOut, ULONG* SelectedMenuItem, BOOLEAN CanEscape, UiMenuKeyPressFilterCallback KeyPressFilter)
{
	return UiVtbl.DisplayMenu(MenuItemList, MenuItemCount, DefaultMenuItem, MenuTimeOut, SelectedMenuItem, CanEscape, KeyPressFilter);
}
Example #19
0
VOID UiDrawStatusText(PCSTR StatusText)
{
	UiVtbl.DrawStatusText(StatusText);
}
Example #20
0
VOID UiFadeOut(VOID)
{
	UiVtbl.FadeOut();
}
Example #21
0
VOID UiUpdateDateTime(VOID)
{
	UiVtbl.UpdateDateTime();
}
Example #22
0
BOOLEAN UiInitialize(BOOLEAN ShowGui)
{
	VIDEODISPLAYMODE	UiDisplayMode; // Tells us if we are in text or graphics mode
	BOOLEAN	UiMinimal = FALSE; // Tells us if we should use a minimal console-like UI
	ULONG_PTR SectionId;
	CHAR	DisplayModeText[260];
	CHAR	SettingText[260];
	ULONG	Depth;

	if (!ShowGui) {
		if (!UiVtbl.Initialize())
		{
			MachVideoSetDisplayMode(NULL, FALSE);
			return FALSE;
		}
		return TRUE;
	}

	TRACE("Initializing User Interface.\n");
	TRACE("Reading in UI settings from [Display] section.\n");

	DisplayModeText[0] = '\0';
	if (IniOpenSection("Display", &SectionId))
	{
		if (! IniReadSettingByName(SectionId, "DisplayMode", DisplayModeText, sizeof(DisplayModeText)))
		{
			DisplayModeText[0] = '\0';
		}
		if (IniReadSettingByName(SectionId, "MinimalUI", SettingText, sizeof(SettingText)))
		{
			UiMinimal = (_stricmp(SettingText, "Yes") == 0 && strlen(SettingText) == 3);
		}
	}

	UiDisplayMode = MachVideoSetDisplayMode(DisplayModeText, TRUE);
	MachVideoGetDisplaySize(&UiScreenWidth, &UiScreenHeight, &Depth);

	if (VideoTextMode == UiDisplayMode)
		UiVtbl = MiniTuiVtbl;

	if (!UiVtbl.Initialize())
	{
		MachVideoSetDisplayMode(NULL, FALSE);
		return FALSE;
	}

	if (IniOpenSection("Display", &SectionId))
	{
		if (IniReadSettingByName(SectionId, "TitleText", SettingText, sizeof(SettingText)))
		{
			strcpy(UiTitleBoxTitleText, SettingText);
		}
		if (IniReadSettingByName(SectionId, "TimeText", SettingText, sizeof(SettingText)))
		{
			strcpy(UiTimeText, SettingText);
		}
		if (IniReadSettingByName(SectionId, "StatusBarColor", SettingText, sizeof(SettingText)))
		{
			UiStatusBarBgColor = UiTextToColor(SettingText);
		}
		if (IniReadSettingByName(SectionId, "StatusBarTextColor", SettingText, sizeof(SettingText)))
		{
			UiStatusBarFgColor = UiTextToColor(SettingText);
		}
		if (IniReadSettingByName(SectionId, "BackdropTextColor", SettingText, sizeof(SettingText)))
		{
			UiBackdropFgColor = UiTextToColor(SettingText);
		}
		if (IniReadSettingByName(SectionId, "BackdropColor", SettingText, sizeof(SettingText)))
		{
			UiBackdropBgColor = UiTextToColor(SettingText);
		}
		if (IniReadSettingByName(SectionId, "BackdropFillStyle", SettingText, sizeof(SettingText)))
		{
			UiBackdropFillStyle = UiTextToFillStyle(SettingText);
		}
		if (IniReadSettingByName(SectionId, "TitleBoxTextColor", SettingText, sizeof(SettingText)))
		{
			UiTitleBoxFgColor = UiTextToColor(SettingText);
		}
		if (IniReadSettingByName(SectionId, "TitleBoxColor", SettingText, sizeof(SettingText)))
		{
			UiTitleBoxBgColor = UiTextToColor(SettingText);
		}
		if (IniReadSettingByName(SectionId, "MessageBoxTextColor", SettingText, sizeof(SettingText)))
		{
			UiMessageBoxFgColor = UiTextToColor(SettingText);
		}
		if (IniReadSettingByName(SectionId, "MessageBoxColor", SettingText, sizeof(SettingText)))
		{
			UiMessageBoxBgColor = UiTextToColor(SettingText);
		}
		if (IniReadSettingByName(SectionId, "MenuTextColor", SettingText, sizeof(SettingText)))
		{
			UiMenuFgColor = UiTextToColor(SettingText);
		}
		if (IniReadSettingByName(SectionId, "MenuColor", SettingText, sizeof(SettingText)))
		{
			UiMenuBgColor = UiTextToColor(SettingText);
		}
		if (IniReadSettingByName(SectionId, "TextColor", SettingText, sizeof(SettingText)))
		{
			UiTextColor = UiTextToColor(SettingText);
		}
		if (IniReadSettingByName(SectionId, "SelectedTextColor", SettingText, sizeof(SettingText)))
		{
			UiSelectedTextColor = UiTextToColor(SettingText);
		}
		if (IniReadSettingByName(SectionId, "SelectedColor", SettingText, sizeof(SettingText)))
		{
			UiSelectedTextBgColor = UiTextToColor(SettingText);
		}
		if (IniReadSettingByName(SectionId, "EditBoxTextColor", SettingText, sizeof(SettingText)))
		{
			UiEditBoxTextColor = UiTextToColor(SettingText);
		}
		if (IniReadSettingByName(SectionId, "EditBoxColor", SettingText, sizeof(SettingText)))
		{
			UiEditBoxBgColor = UiTextToColor(SettingText);
		}
		if (IniReadSettingByName(SectionId, "SpecialEffects", SettingText, sizeof(SettingText)))
		{
			UiUseSpecialEffects = (_stricmp(SettingText, "Yes") == 0 && strlen(SettingText) == 3);
		}
		if (IniReadSettingByName(SectionId, "ShowTime", SettingText, sizeof(SettingText)))
		{
			UiDrawTime = (_stricmp(SettingText, "Yes") == 0 && strlen(SettingText) == 3);
		}
		if (IniReadSettingByName(SectionId, "MenuBox", SettingText, sizeof(SettingText)))
		{
			UiMenuBox = (_stricmp(SettingText, "Yes") == 0 && strlen(SettingText) == 3);
		}
		if (IniReadSettingByName(SectionId, "CenterMenu", SettingText, sizeof(SettingText)))
		{
			UiCenterMenu = (_stricmp(SettingText, "Yes") == 0 && strlen(SettingText) == 3);
		}
	}

	// Draw the backdrop and fade it in if special effects are enabled
	UiFadeInBackdrop();

	TRACE("UiInitialize() returning TRUE.\n");
	return TRUE;
}
Example #23
0
File: ui.c Project: GYGit/reactos
VOID UiDrawText2(ULONG X, ULONG Y, ULONG MaxNumChars, PCSTR Text, UCHAR Attr)
{
    UiVtbl.DrawText2(X, Y, MaxNumChars, Text, Attr);
}