mirror of
https://github.com/CloverHackyColor/CloverBootloader.git
synced 2025-01-22 21:01:31 +01:00
refactoring menu entries
Signed-off-by: Sergey Isakov <isakov-sl@bk.ru>
This commit is contained in:
parent
fc2f226e8d
commit
c1f6e8137a
@ -596,7 +596,7 @@ IsSleepImageValidBySleepTime (IN REFIT_VOLUME *Volume)
|
||||
EFI_BLOCK_IO_PROTOCOL *BlockIo;
|
||||
HFSPlusVolumeHeaderMin *HFSHeader;
|
||||
UINT32 HFSVolumeModifyDate;
|
||||
INTN TimeDiff;
|
||||
INTN TimeDelta;
|
||||
INTN Pages; // = 1;
|
||||
//EFI_TIME ImageModifyTime;
|
||||
//EFI_TIME *TimePtr;
|
||||
@ -636,9 +636,9 @@ IsSleepImageValidBySleepTime (IN REFIT_VOLUME *Volume)
|
||||
// Check that sleepimage is not more then 5 secs older then volume modification date
|
||||
// Idea is from Chameleon
|
||||
//
|
||||
TimeDiff = HFSVolumeModifyDate - (INTN)gSleepTime;
|
||||
DBG(" image older then volume: %d sec\n", TimeDiff);
|
||||
if (TimeDiff > 5 /*|| TimeDiff < -5 */) {
|
||||
TimeDelta = HFSVolumeModifyDate - (INTN)gSleepTime;
|
||||
DBG(" image older then volume: %d sec\n", TimeDelta);
|
||||
if (TimeDelta > 5 /*|| TimeDelta < -5 */) {
|
||||
//Slice - if image newer then volume it should be OK
|
||||
DBG(" image too old\n");
|
||||
FreePages(Buffer, Pages);
|
||||
|
@ -364,8 +364,8 @@ VOID AlertMessage(IN CONST CHAR16 *Title, IN CONST CHAR16 *Message)
|
||||
// Break message into info lines
|
||||
// CHAR16 **Information = CreateInfoLines(Message, &Count);
|
||||
CreateInfoLines(Message, &AlertMessageMenu.InfoLines);
|
||||
AlertMessageMenu.Title = Title;
|
||||
RunMenu(&AlertMessageMenu, NULL);
|
||||
AlertMessageMenu.Title = EfiStrDuplicate(Title);
|
||||
AlertMessageMenu.RunMenu(NULL);
|
||||
// // Check parameters
|
||||
// if (Information != NULL) {
|
||||
// if (Count > 0) {
|
||||
@ -407,7 +407,7 @@ BOOLEAN YesNoMessage(IN CHAR16 *Title, IN CONST CHAR16 *Message)
|
||||
do
|
||||
{
|
||||
REFIT_ABSTRACT_MENU_ENTRY *ChosenEntry = NULL;
|
||||
MenuExit = RunMenu(&YesNoMessageMenu, &ChosenEntry);
|
||||
MenuExit = YesNoMessageMenu.RunMenu(&ChosenEntry);
|
||||
if ( ChosenEntry != NULL && ChosenEntry->getREFIT_SIMPLE_MENU_ENTRY_TAG() && ChosenEntry->getREFIT_SIMPLE_MENU_ENTRY_TAG()->Tag == TAG_YES &&
|
||||
((MenuExit == MENU_EXIT_ENTER) || (MenuExit == MENU_EXIT_DETAILS))) {
|
||||
Result = TRUE;
|
||||
@ -484,7 +484,7 @@ BOOLEAN AskUserForFilePathFromVolumes(IN CHAR16 *Title OPTIONAL, OUT EFI_DEVICE_
|
||||
{
|
||||
REFIT_ABSTRACT_MENU_ENTRY *ChosenEntry = NULL;
|
||||
// Run the volume chooser menu
|
||||
MenuExit = RunMenu(&Menu, &ChosenEntry);
|
||||
MenuExit = Menu.RunMenu(&ChosenEntry);
|
||||
if ((ChosenEntry != NULL) && ChosenEntry->getREFIT_SIMPLE_MENU_ENTRY_TAG() &&
|
||||
((MenuExit == MENU_EXIT_ENTER) || (MenuExit == MENU_EXIT_DETAILS))) {
|
||||
if (ChosenEntry->getREFIT_SIMPLE_MENU_ENTRY_TAG()->Tag >= TAG_OFFSET) {
|
||||
|
@ -50,7 +50,7 @@
|
||||
#endif
|
||||
|
||||
|
||||
static LEGACY_ENTRY * AddLegacyEntry(IN CONST CHAR16 *FullTitle, IN CONST CHAR16 *LoaderTitle, IN REFIT_VOLUME *Volume, IN EG_IMAGE *Image, IN EG_IMAGE *DriveImage, IN CHAR16 Hotkey, IN BOOLEAN CustomEntry)
|
||||
LEGACY_ENTRY * AddLegacyEntry(IN CONST CHAR16 *FullTitle, IN CONST CHAR16 *LoaderTitle, IN REFIT_VOLUME *Volume, IN EG_IMAGE *Image, IN EG_IMAGE *DriveImage, IN CHAR16 Hotkey, IN BOOLEAN CustomEntry)
|
||||
{
|
||||
LEGACY_ENTRY *Entry, *SubEntry;
|
||||
REFIT_MENU_SCREEN *SubScreen;
|
||||
@ -109,7 +109,7 @@ static LEGACY_ENTRY * AddLegacyEntry(IN CONST CHAR16 *FullTitle, IN CONST CHAR16
|
||||
if (LoaderTitle[0] == 'W' || LoaderTitle[0] == 'L')
|
||||
ShortcutLetter = LoaderTitle[0];
|
||||
} else
|
||||
LoaderTitle = L"Legacy OS";
|
||||
LoaderTitle = EfiStrDuplicate( L"Legacy OS");
|
||||
}
|
||||
if (Volume->VolName != NULL)
|
||||
VolDesc = Volume->VolName;
|
||||
@ -158,10 +158,11 @@ static LEGACY_ENTRY * AddLegacyEntry(IN CONST CHAR16 *FullTitle, IN CONST CHAR16
|
||||
Entry->LoadOptions = (Volume->DiskKind == DISK_KIND_OPTICAL) ? L"CD" : ((Volume->DiskKind == DISK_KIND_EXTERNAL) ? L"USB" : L"HD");
|
||||
|
||||
// create the submenu
|
||||
SubScreen = (__typeof__(SubScreen))AllocateZeroPool(sizeof(REFIT_MENU_SCREEN));
|
||||
// SubScreen = (__typeof__(SubScreen))AllocateZeroPool(sizeof(REFIT_MENU_SCREEN));
|
||||
SubScreen = new REFIT_MENU_SCREEN();
|
||||
SubScreen->Title = PoolPrint(L"Boot Options for %s on %s", LoaderTitle, VolDesc);
|
||||
SubScreen->TitleImage = Entry->Image;
|
||||
SubScreen->AnimeRun = GetAnime(SubScreen);
|
||||
SubScreen->AnimeRun = SubScreen->GetAnime();
|
||||
|
||||
// default entry
|
||||
// SubEntry = (__typeof__(SubEntry))AllocateZeroPool(sizeof(LEGACY_ENTRY));
|
||||
@ -172,11 +173,11 @@ static LEGACY_ENTRY * AddLegacyEntry(IN CONST CHAR16 *FullTitle, IN CONST CHAR16
|
||||
SubEntry->DevicePathString = Entry->DevicePathString;
|
||||
SubEntry->LoadOptions = Entry->LoadOptions;
|
||||
SubEntry->AtClick = ActionEnter;
|
||||
AddMenuEntry(SubScreen, SubEntry, true);
|
||||
SubScreen->AddMenuEntry(SubEntry, true);
|
||||
|
||||
AddMenuEntry(SubScreen, &MenuEntryReturn, false);
|
||||
SubScreen->AddMenuEntry(&MenuEntryReturn, false);
|
||||
Entry->SubScreen = SubScreen;
|
||||
AddMenuEntry(&MainMenu, Entry, true);
|
||||
MainMenu.AddMenuEntry(Entry, true);
|
||||
DBG(" added '%s' OSType=%d Icon=%s\n", Entry->Title, Volume->LegacyOS->Type, Volume->LegacyOS->IconName);
|
||||
return Entry;
|
||||
}
|
||||
|
@ -759,28 +759,28 @@ STATIC VOID AddDefaultMenu(IN LOADER_ENTRY *Entry)
|
||||
SubScreen->TitleImage = Entry->Image;
|
||||
SubScreen->ID = Entry->LoaderType + 20;
|
||||
// DBG("get anime for os=%d\n", SubScreen->ID);
|
||||
SubScreen->AnimeRun = GetAnime(SubScreen);
|
||||
SubScreen->AnimeRun = SubScreen->GetAnime();
|
||||
VolumeSize = RShiftU64(MultU64x32(Volume->BlockIO->Media->LastBlock, Volume->BlockIO->Media->BlockSize), 20);
|
||||
AddMenuInfoLine(SubScreen, PoolPrint(L"Volume size: %dMb", VolumeSize));
|
||||
AddMenuInfoLine(SubScreen, FileDevicePathToStr(Entry->DevicePath));
|
||||
SubScreen->AddMenuInfoLine(PoolPrint(L"Volume size: %dMb", VolumeSize));
|
||||
SubScreen->AddMenuInfoLine(FileDevicePathToStr(Entry->DevicePath));
|
||||
Guid = FindGPTPartitionGuidInDevicePath(Volume->DevicePath);
|
||||
if (Guid) {
|
||||
CHAR8 *GuidStr = (__typeof__(GuidStr))AllocateZeroPool(50);
|
||||
AsciiSPrint(GuidStr, 50, "%g", Guid);
|
||||
AddMenuInfoLine(SubScreen, PoolPrint(L"UUID: %a", GuidStr));
|
||||
SubScreen->AddMenuInfoLine(PoolPrint(L"UUID: %a", GuidStr));
|
||||
FreePool(GuidStr);
|
||||
}
|
||||
AddMenuInfoLine(SubScreen, PoolPrint(L"Options: %s", Entry->LoadOptions));
|
||||
SubScreen->AddMenuInfoLine(PoolPrint(L"Options: %s", Entry->LoadOptions));
|
||||
// loader-specific submenu entries
|
||||
if (Entry->LoaderType == OSTYPE_OSX ||
|
||||
Entry->LoaderType == OSTYPE_OSX_INSTALLER ||
|
||||
Entry->LoaderType == OSTYPE_RECOVERY) { // entries for Mac OS X
|
||||
if (os_version < AsciiOSVersionToUint64("10.8")) {
|
||||
AddMenuInfoLine(SubScreen, PoolPrint(L"Mac OS X: %a", Entry->OSVersion));
|
||||
SubScreen->AddMenuInfoLine(PoolPrint(L"Mac OS X: %a", Entry->OSVersion));
|
||||
} else if (os_version < AsciiOSVersionToUint64("10.12")) {
|
||||
AddMenuInfoLine(SubScreen, PoolPrint(L"OS X: %a", Entry->OSVersion));
|
||||
SubScreen->AddMenuInfoLine(PoolPrint(L"OS X: %a", Entry->OSVersion));
|
||||
} else {
|
||||
AddMenuInfoLine(SubScreen, PoolPrint(L"macOS: %a", Entry->OSVersion));
|
||||
SubScreen->AddMenuInfoLine(PoolPrint(L"macOS: %a", Entry->OSVersion));
|
||||
}
|
||||
|
||||
if (OSFLAG_ISSET(Entry->Flags, OSFLAG_HIBERNATED)) {
|
||||
@ -788,7 +788,7 @@ STATIC VOID AddDefaultMenu(IN LOADER_ENTRY *Entry)
|
||||
if (SubEntry) {
|
||||
SubEntry->Title = L"Cancel hibernate wake";
|
||||
SubEntry->Flags = OSFLAG_UNSET(SubEntry->Flags, OSFLAG_HIBERNATED);
|
||||
AddMenuEntry(SubScreen, SubEntry, true);
|
||||
SubScreen->AddMenuEntry(SubEntry, true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -801,7 +801,7 @@ STATIC VOID AddDefaultMenu(IN LOADER_ENTRY *Entry)
|
||||
} else {
|
||||
SubEntry->Title = L"Boot macOS with selected options";
|
||||
}
|
||||
AddMenuEntry(SubScreen, SubEntry, true);
|
||||
SubScreen->AddMenuEntry(SubEntry, true);
|
||||
}
|
||||
|
||||
SubEntry = DuplicateLoaderEntry(Entry);
|
||||
@ -815,7 +815,7 @@ STATIC VOID AddDefaultMenu(IN LOADER_ENTRY *Entry)
|
||||
}
|
||||
SubEntry->Flags = OSFLAG_UNSET(SubEntry->Flags, OSFLAG_CHECKFAKESMC);
|
||||
SubEntry->Flags = OSFLAG_SET(SubEntry->Flags, OSFLAG_WITHKEXTS);
|
||||
AddMenuEntry(SubScreen, SubEntry, true);
|
||||
SubScreen->AddMenuEntry(SubEntry, true);
|
||||
}
|
||||
SubEntry = DuplicateLoaderEntry(Entry);
|
||||
if (SubEntry) {
|
||||
@ -828,47 +828,47 @@ STATIC VOID AddDefaultMenu(IN LOADER_ENTRY *Entry)
|
||||
}
|
||||
SubEntry->Flags = OSFLAG_UNSET(SubEntry->Flags, OSFLAG_CHECKFAKESMC);
|
||||
SubEntry->Flags = OSFLAG_UNSET(SubEntry->Flags, OSFLAG_WITHKEXTS);
|
||||
AddMenuEntry(SubScreen, (REFIT_MENU_ENTRY *)SubEntry, true);
|
||||
SubScreen->AddMenuEntry((REFIT_MENU_ENTRY *)SubEntry, true);
|
||||
}
|
||||
|
||||
AddMenuEntry(SubScreen, SubMenuKextInjectMgmt(Entry), true);
|
||||
AddMenuInfo(SubScreen, L"=== boot-args ===");
|
||||
SubScreen->AddMenuEntry(SubMenuKextInjectMgmt(Entry), true);
|
||||
SubScreen->AddMenuInfo(L"=== boot-args ===");
|
||||
if (!KernelIs64BitOnly) {
|
||||
if (os_version < AsciiOSVersionToUint64("10.8")) {
|
||||
AddMenuCheck(SubScreen, "Mac OS X 32bit", OPT_I386, 68);
|
||||
AddMenuCheck(SubScreen, "Mac OS X 64bit", OPT_X64, 68);
|
||||
SubScreen->AddMenuCheck("Mac OS X 32bit", OPT_I386, 68);
|
||||
SubScreen->AddMenuCheck("Mac OS X 64bit", OPT_X64, 68);
|
||||
} else if (os_version < AsciiOSVersionToUint64("10.12")) {
|
||||
AddMenuCheck(SubScreen, "OS X 32bit", OPT_I386, 68);
|
||||
AddMenuCheck(SubScreen, "OS X 64bit", OPT_X64, 68);
|
||||
SubScreen->AddMenuCheck("OS X 32bit", OPT_I386, 68);
|
||||
SubScreen->AddMenuCheck("OS X 64bit", OPT_X64, 68);
|
||||
} else {
|
||||
AddMenuCheck(SubScreen, "macOS 32bit", OPT_I386, 68);
|
||||
AddMenuCheck(SubScreen, "macOS 64bit", OPT_X64, 68);
|
||||
SubScreen->AddMenuCheck("macOS 32bit", OPT_I386, 68);
|
||||
SubScreen->AddMenuCheck("macOS 64bit", OPT_X64, 68);
|
||||
}
|
||||
}
|
||||
AddMenuCheck(SubScreen, "Verbose (-v)", OPT_VERBOSE, 68);
|
||||
SubScreen->AddMenuCheck("Verbose (-v)", OPT_VERBOSE, 68);
|
||||
// No Caches option works on 10.6 - 10.9
|
||||
if (os_version < AsciiOSVersionToUint64("10.10")) {
|
||||
AddMenuCheck(SubScreen, "Without caches (-f)", OPT_NOCACHES, 68);
|
||||
SubScreen->AddMenuCheck("Without caches (-f)", OPT_NOCACHES, 68);
|
||||
}
|
||||
AddMenuCheck(SubScreen, "Single User (-s)", OPT_SINGLE_USER, 68);
|
||||
AddMenuCheck(SubScreen, "Safe Mode (-x)", OPT_SAFE, 68);
|
||||
AddMenuCheck(SubScreen, "Disable KASLR (slide=0)", OPT_SLIDE, 68);
|
||||
AddMenuCheck(SubScreen, "Set Nvidia to VESA (nv_disable=1)", OPT_NVDISABLE, 68);
|
||||
AddMenuCheck(SubScreen, "Use Nvidia WEB drivers (nvda_drv=1)", OPT_NVWEBON, 68);
|
||||
AddMenuCheck(SubScreen, "Disable PowerNap (darkwake=0)", OPT_POWERNAPOFF, 68);
|
||||
AddMenuCheck(SubScreen, "Use XNU CPUPM (-xcpm)", OPT_XCPM, 68);
|
||||
// AddMenuCheck(SubScreen, "Disable Intel Idle Mode (-gux_no_idle)", OPT_GNOIDLE, 68);
|
||||
// AddMenuCheck(SubScreen, "Sleep Uses Shutdown (-gux_nosleep)", OPT_GNOSLEEP, 68);
|
||||
// AddMenuCheck(SubScreen, "Force No Msi Int (-gux_nomsi)", OPT_GNOMSI, 68);
|
||||
// AddMenuCheck(SubScreen, "EHC manage USB2 ports (-gux_defer_usb2)", OPT_EHCUSB, 68);
|
||||
AddMenuCheck(SubScreen, "Keep symbols on panic (keepsyms=1)", OPT_KEEPSYMS, 68);
|
||||
AddMenuCheck(SubScreen, "Don't reboot on panic (debug=0x100)", OPT_DEBUG, 68);
|
||||
AddMenuCheck(SubScreen, "Debug kexts (kextlog=0xffff)", OPT_KEXTLOG, 68);
|
||||
// AddMenuCheck(SubScreen, "Disable AppleALC (-alcoff)", OPT_APPLEALC, 68);
|
||||
// AddMenuCheck(SubScreen, "Disable Shiki (-shikioff)", OPT_SHIKI, 68);
|
||||
SubScreen->AddMenuCheck("Single User (-s)", OPT_SINGLE_USER, 68);
|
||||
SubScreen->AddMenuCheck("Safe Mode (-x)", OPT_SAFE, 68);
|
||||
SubScreen->AddMenuCheck("Disable KASLR (slide=0)", OPT_SLIDE, 68);
|
||||
SubScreen->AddMenuCheck("Set Nvidia to VESA (nv_disable=1)", OPT_NVDISABLE, 68);
|
||||
SubScreen->AddMenuCheck("Use Nvidia WEB drivers (nvda_drv=1)", OPT_NVWEBON, 68);
|
||||
SubScreen->AddMenuCheck("Disable PowerNap (darkwake=0)", OPT_POWERNAPOFF, 68);
|
||||
SubScreen->AddMenuCheck("Use XNU CPUPM (-xcpm)", OPT_XCPM, 68);
|
||||
// SubScreen->AddMenuCheck("Disable Intel Idle Mode (-gux_no_idle)", OPT_GNOIDLE, 68);
|
||||
// SubScreen->AddMenuCheck("Sleep Uses Shutdown (-gux_nosleep)", OPT_GNOSLEEP, 68);
|
||||
// SubScreen->AddMenuCheck("Force No Msi Int (-gux_nomsi)", OPT_GNOMSI, 68);
|
||||
// SubScreen->AddMenuCheck("EHC manage USB2 ports (-gux_defer_usb2)", OPT_EHCUSB, 68);
|
||||
SubScreen->AddMenuCheck("Keep symbols on panic (keepsyms=1)", OPT_KEEPSYMS, 68);
|
||||
SubScreen->AddMenuCheck("Don't reboot on panic (debug=0x100)", OPT_DEBUG, 68);
|
||||
SubScreen->AddMenuCheck("Debug kexts (kextlog=0xffff)", OPT_KEXTLOG, 68);
|
||||
// SubScreen->AddMenuCheck("Disable AppleALC (-alcoff)", OPT_APPLEALC, 68);
|
||||
// SubScreen->AddMenuCheck("Disable Shiki (-shikioff)", OPT_SHIKI, 68);
|
||||
|
||||
if (gSettings.CsrActiveConfig == 0) {
|
||||
AddMenuCheck(SubScreen, "No SIP", OSFLAG_NOSIP, 69);
|
||||
SubScreen->AddMenuCheck("No SIP", OSFLAG_NOSIP, 69);
|
||||
}
|
||||
|
||||
} else if (Entry->LoaderType == OSTYPE_LINEFI) {
|
||||
@ -879,7 +879,7 @@ STATIC VOID AddDefaultMenu(IN LOADER_ENTRY *Entry)
|
||||
SubEntry = DuplicateLoaderEntry(Entry);
|
||||
if (SubEntry) {
|
||||
SubEntry->Title = PoolPrint(L"Run %s", FileName);
|
||||
AddMenuEntry(SubScreen, SubEntry, true);
|
||||
SubScreen->AddMenuEntry(SubEntry, true);
|
||||
}
|
||||
|
||||
SubEntry = DuplicateLoaderEntry(Entry);
|
||||
@ -893,7 +893,7 @@ STATIC VOID AddDefaultMenu(IN LOADER_ENTRY *Entry)
|
||||
SubEntry->LoadOptions = AddLoadOption(Entry->LoadOptions, L"quiet");
|
||||
}
|
||||
}
|
||||
AddMenuEntry(SubScreen, SubEntry, true);
|
||||
SubScreen->AddMenuEntry(SubEntry, true);
|
||||
SubEntry = DuplicateLoaderEntry(Entry);
|
||||
if (SubEntry) {
|
||||
FreePool(SubEntry->LoadOptions);
|
||||
@ -905,7 +905,7 @@ STATIC VOID AddDefaultMenu(IN LOADER_ENTRY *Entry)
|
||||
SubEntry->LoadOptions = AddLoadOption(Entry->LoadOptions, L"splash");
|
||||
}
|
||||
}
|
||||
AddMenuEntry(SubScreen, SubEntry, true);
|
||||
SubScreen->AddMenuEntry(SubEntry, true);
|
||||
SubEntry = DuplicateLoaderEntry(Entry);
|
||||
if (SubEntry) {
|
||||
FreePool(SubEntry->LoadOptions);
|
||||
@ -931,7 +931,7 @@ STATIC VOID AddDefaultMenu(IN LOADER_ENTRY *Entry)
|
||||
SubEntry->LoadOptions = AddLoadOption(Entry->LoadOptions, L"quiet splash");
|
||||
}
|
||||
}
|
||||
AddMenuEntry(SubScreen, (REFIT_MENU_ENTRY *)SubEntry, true);
|
||||
SubScreen->AddMenuEntry((REFIT_MENU_ENTRY *)SubEntry, true);
|
||||
} else if ((Entry->LoaderType == OSTYPE_WIN) || (Entry->LoaderType == OSTYPE_WINEFI)) {
|
||||
// by default, skip the built-in selection and boot from hard disk only
|
||||
Entry->LoadOptions = PoolPrint(L"-s -h");
|
||||
@ -940,20 +940,20 @@ STATIC VOID AddDefaultMenu(IN LOADER_ENTRY *Entry)
|
||||
SubEntry = DuplicateLoaderEntry(Entry);
|
||||
if (SubEntry) {
|
||||
SubEntry->Title = PoolPrint(L"Run %s", FileName);
|
||||
AddMenuEntry(SubScreen, (REFIT_MENU_ENTRY *)SubEntry, true);
|
||||
SubScreen->AddMenuEntry((REFIT_MENU_ENTRY *)SubEntry, true);
|
||||
}
|
||||
|
||||
SubEntry = DuplicateLoaderEntry(Entry);
|
||||
if (SubEntry) {
|
||||
SubEntry->Title = PoolPrint(L"Boot Windows from Hard Disk");
|
||||
AddMenuEntry(SubScreen, (REFIT_MENU_ENTRY *)SubEntry, true);
|
||||
SubScreen->AddMenuEntry((REFIT_MENU_ENTRY *)SubEntry, true);
|
||||
}
|
||||
|
||||
SubEntry = DuplicateLoaderEntry(Entry);
|
||||
if (SubEntry) {
|
||||
SubEntry->Title = PoolPrint(L"Boot Windows from CD-ROM");
|
||||
SubEntry->LoadOptions = PoolPrint(L"-s -c");
|
||||
AddMenuEntry(SubScreen, (REFIT_MENU_ENTRY *)SubEntry, true);
|
||||
SubScreen->AddMenuEntry((REFIT_MENU_ENTRY *)SubEntry, true);
|
||||
}
|
||||
|
||||
SubEntry = DuplicateLoaderEntry(Entry);
|
||||
@ -962,12 +962,12 @@ STATIC VOID AddDefaultMenu(IN LOADER_ENTRY *Entry)
|
||||
SubEntry->Flags = OSFLAG_UNSET(SubEntry->Flags, OSFLAG_USEGRAPHICS);
|
||||
SubEntry->LoadOptions = PoolPrint(L"-v");
|
||||
SubEntry->LoaderType = OSTYPE_OTHER; // Sothor - Why are we using OSTYPE_OTHER here?
|
||||
AddMenuEntry(SubScreen, (REFIT_MENU_ENTRY *)SubEntry, true);
|
||||
SubScreen->AddMenuEntry((REFIT_MENU_ENTRY *)SubEntry, true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
AddMenuEntry(SubScreen, &MenuEntryReturn, false);
|
||||
SubScreen->AddMenuEntry(&MenuEntryReturn, false);
|
||||
Entry->SubScreen = SubScreen;
|
||||
// DBG(" Added '%s': OSType='%d', OSVersion='%a'\n", Entry->Title, Entry->LoaderType, Entry->OSVersion);
|
||||
}
|
||||
@ -1022,7 +1022,7 @@ STATIC BOOLEAN AddLoaderEntry(IN CONST CHAR16 *LoaderPath, IN CONST CHAR16 *Load
|
||||
//TODO there is a problem that Entry->Flags is unique while InputItems are global ;(
|
||||
// InputItems[69].IValue = Entry->Flags;
|
||||
AddDefaultMenu(Entry);
|
||||
AddMenuEntry(&MainMenu, Entry, true);
|
||||
MainMenu.AddMenuEntry(Entry, true);
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
@ -1971,17 +1971,17 @@ STATIC VOID AddCustomEntry(IN UINTN CustomIndex,
|
||||
SubScreen->Title = PoolPrint(L"Boot Options for %s on %s", (Custom->Title != NULL) ? Custom->Title : CustomPath, Entry->VolName);
|
||||
SubScreen->TitleImage = Entry->Image;
|
||||
SubScreen->ID = Custom->Type + 20;
|
||||
SubScreen->AnimeRun = GetAnime(SubScreen);
|
||||
SubScreen->AnimeRun = SubScreen->GetAnime();
|
||||
VolumeSize = RShiftU64(MultU64x32(Volume->BlockIO->Media->LastBlock, Volume->BlockIO->Media->BlockSize), 20);
|
||||
AddMenuInfoLine(SubScreen, PoolPrint(L"Volume size: %dMb", VolumeSize));
|
||||
AddMenuInfoLine(SubScreen, FileDevicePathToStr(Entry->DevicePath));
|
||||
SubScreen->AddMenuInfoLine(PoolPrint(L"Volume size: %dMb", VolumeSize));
|
||||
SubScreen->AddMenuInfoLine(FileDevicePathToStr(Entry->DevicePath));
|
||||
if (Guid) {
|
||||
CHAR8 *GuidStr = (__typeof__(GuidStr))AllocateZeroPool(50);
|
||||
AsciiSPrint(GuidStr, 50, "%g", Guid);
|
||||
AddMenuInfoLine(SubScreen, PoolPrint(L"UUID: %a", GuidStr));
|
||||
SubScreen->AddMenuInfoLine(PoolPrint(L"UUID: %a", GuidStr));
|
||||
FreePool(GuidStr);
|
||||
}
|
||||
AddMenuInfoLine(SubScreen, PoolPrint(L"Options: %s", Entry->LoadOptions));
|
||||
SubScreen->AddMenuInfoLine(PoolPrint(L"Options: %s", Entry->LoadOptions));
|
||||
DBG("Create sub entries\n");
|
||||
for (CustomSubEntry = Custom->SubEntries; CustomSubEntry; CustomSubEntry = CustomSubEntry->Next) {
|
||||
if (!CustomSubEntry->Settings) {
|
||||
@ -1989,11 +1989,15 @@ STATIC VOID AddCustomEntry(IN UINTN CustomIndex,
|
||||
}
|
||||
AddCustomEntry(CustomSubIndex++, (CustomSubEntry->Path != NULL) ? CustomSubEntry->Path : CustomPath, CustomSubEntry, SubScreen);
|
||||
}
|
||||
AddMenuEntry(SubScreen, &MenuEntryReturn, true);
|
||||
SubScreen->AddMenuEntry(&MenuEntryReturn, true);
|
||||
Entry->SubScreen = SubScreen;
|
||||
}
|
||||
}
|
||||
AddMenuEntry(IsSubEntry ? SubMenu : &MainMenu, Entry, true);
|
||||
if (IsSubEntry)
|
||||
SubMenu->AddMenuEntry(Entry, true);
|
||||
else
|
||||
MainMenu.AddMenuEntry(Entry, true);
|
||||
// AddMenuEntry(IsSubEntry ? SubMenu : &MainMenu, Entry, true);
|
||||
}
|
||||
// cleanup custom
|
||||
if (FindCustomPath) {
|
||||
|
@ -81,7 +81,7 @@ VOID AddSecureBootTool(VOID)
|
||||
Entry->AtClick = ActionSelect;
|
||||
Entry->AtDoubleClick = ActionEnter;
|
||||
Entry->AtRightClick = ActionHelp;
|
||||
AddMenuEntry(&MainMenu, Entry);
|
||||
MainMenu.AddMenuEntry(Entry);
|
||||
}
|
||||
/*
|
||||
typedef struct _refit_menu_entry {
|
||||
@ -146,7 +146,7 @@ UINTN QuerySecureBootUser(IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath)
|
||||
// Run the query menu
|
||||
do
|
||||
{
|
||||
MenuExit = RunMenu(&QueryUserMenu, &ChosenEntry);
|
||||
MenuExit = QueryUserMenu.RunMenu(&ChosenEntry);
|
||||
if ((ChosenEntry != NULL) &&
|
||||
((MenuExit == MENU_EXIT_ENTER) || (MenuExit == MENU_EXIT_DETAILS))) {
|
||||
Response = (UINTN)ChosenEntry->Tag;
|
||||
@ -457,7 +457,7 @@ BOOLEAN ConfigureSecureBoot(VOID)
|
||||
SecureBootMenu.Entries[Index++] = &MenuEntryReturn;
|
||||
SecureBootMenu.Entries.size() = Index;
|
||||
// Run the configuration menu
|
||||
MenuExit = RunMenu(&SecureBootMenu, &ChosenEntry);
|
||||
MenuExit = SecureBootMenu.RunMenu(&ChosenEntry);
|
||||
if ((ChosenEntry != NULL) &&
|
||||
((MenuExit == MENU_EXIT_ENTER) || (MenuExit == MENU_EXIT_DETAILS))) {
|
||||
switch (ChosenEntry->Tag) {
|
||||
@ -466,7 +466,7 @@ BOOLEAN ConfigureSecureBoot(VOID)
|
||||
do
|
||||
{
|
||||
ChosenEntry = NULL;
|
||||
MenuExit = RunMenu(&SecureBootPolicyMenu, &ChosenEntry);
|
||||
MenuExit = SecureBootPolicyMenu.RunMenu(&ChosenEntry);
|
||||
if ((ChosenEntry != NULL) &&
|
||||
((MenuExit == MENU_EXIT_ENTER) || (MenuExit == MENU_EXIT_DETAILS))) {
|
||||
switch (ChosenEntry->Tag) {
|
||||
|
@ -109,7 +109,7 @@ STATIC BOOLEAN AddToolEntry(IN CONST CHAR16 *LoaderPath, IN CONST CHAR16 *FullTi
|
||||
Entry->AtRightClick = ActionHelp;
|
||||
|
||||
DBG("found tool %s\n", LoaderPath);
|
||||
AddMenuEntry(&MainMenu, Entry, true);
|
||||
MainMenu.AddMenuEntry(Entry, true);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -147,8 +147,8 @@ STATIC VOID AddCloverEntry(IN CONST CHAR16 *LoaderPath, IN CONST CHAR16 *LoaderT
|
||||
SubScreen->Title = EfiStrDuplicate(LoaderTitle);
|
||||
SubScreen->TitleImage = Entry->Image;
|
||||
SubScreen->ID = SCREEN_BOOT;
|
||||
SubScreen->AnimeRun = GetAnime(SubScreen);
|
||||
AddMenuInfoLine(SubScreen, FileDevicePathToStr(Volume->DevicePath));
|
||||
SubScreen->AnimeRun = SubScreen->GetAnime();
|
||||
SubScreen->AddMenuInfoLine(FileDevicePathToStr(Volume->DevicePath));
|
||||
|
||||
if (gEmuVariableControl != NULL) {
|
||||
gEmuVariableControl->UninstallEmulation(gEmuVariableControl);
|
||||
@ -157,28 +157,28 @@ STATIC VOID AddCloverEntry(IN CONST CHAR16 *LoaderPath, IN CONST CHAR16 *LoaderT
|
||||
//always add and always remove menu entries
|
||||
SubEntry = DuplicateLoaderEntry(Entry);
|
||||
if (SubEntry) {
|
||||
SubEntry->Title = L"Add Clover boot options for all entries";
|
||||
SubEntry->LoadOptions = L"BO-ADD";
|
||||
AddMenuEntry(SubScreen, SubEntry, true);
|
||||
SubEntry->Title = EfiStrDuplicate(L"Add Clover boot options for all entries");
|
||||
SubEntry->LoadOptions = EfiStrDuplicate(L"BO-ADD");
|
||||
SubScreen->AddMenuEntry(SubEntry, true);
|
||||
}
|
||||
|
||||
SubEntry = DuplicateLoaderEntry(Entry);
|
||||
if (SubEntry) {
|
||||
SubEntry->Title = L"Remove all Clover boot options";
|
||||
SubEntry->LoadOptions = L"BO-REMOVE";
|
||||
AddMenuEntry(SubScreen, SubEntry, true);
|
||||
SubEntry->Title = EfiStrDuplicate(L"Remove all Clover boot options");
|
||||
SubEntry->LoadOptions = EfiStrDuplicate(L"BO-REMOVE");
|
||||
SubScreen->AddMenuEntry(SubEntry, true);
|
||||
}
|
||||
|
||||
SubEntry = DuplicateLoaderEntry(Entry);
|
||||
if (SubEntry) {
|
||||
SubEntry->Title = L"Print all UEFI boot options to log";
|
||||
SubEntry->LoadOptions = L"BO-PRINT";
|
||||
AddMenuEntry(SubScreen, SubEntry, true);
|
||||
SubEntry->Title = EfiStrDuplicate(L"Print all UEFI boot options to log");
|
||||
SubEntry->LoadOptions = EfiStrDuplicate(L"BO-PRINT");
|
||||
SubScreen->AddMenuEntry(SubEntry, true);
|
||||
}
|
||||
|
||||
AddMenuEntry(SubScreen, &MenuEntryReturn, false);
|
||||
SubScreen->AddMenuEntry(&MenuEntryReturn, false);
|
||||
Entry->SubScreen = SubScreen;
|
||||
AddMenuEntry(&MainMenu, Entry, true);
|
||||
MainMenu.AddMenuEntry(Entry, true);
|
||||
}
|
||||
|
||||
VOID ScanTool(VOID)
|
||||
|
@ -44,6 +44,7 @@
|
||||
#include "../cpp_foundation/XStringW.h"
|
||||
#include "../../libeg/XPointer.h"
|
||||
#endif
|
||||
|
||||
//
|
||||
//#define REFIT_DEBUG (2)
|
||||
//#define Print if ((!GlobalConfig.Quiet) || (GlobalConfig.TextOnly)) Print
|
||||
@ -369,13 +370,14 @@ public:
|
||||
//#define FILM_PERCENT 100000
|
||||
#define INITVALUE 40000
|
||||
|
||||
typedef VOID(REFIT_MENU_SCREEN::*MENU_STYLE_FUNC)(IN UINTN Function, IN CONST CHAR16 *ParamText);
|
||||
typedef VOID (REFIT_MENU_SCREEN::*MENU_STYLE_FUNC)(IN UINTN Function, IN CONST CHAR16 *ParamText);
|
||||
|
||||
class REFIT_MENU_SCREEN
|
||||
{
|
||||
public:
|
||||
UINTN ID;
|
||||
CONST CHAR16 *Title;
|
||||
/* CONST */ CHAR16 *Title; //Title is not const. It can be dynamically changed
|
||||
// it will be better to make it XStringW
|
||||
EG_IMAGE *TitleImage;
|
||||
// INTN InfoLineCount;
|
||||
// CONST CHAR16 **InfoLines;
|
||||
@ -410,7 +412,7 @@ public:
|
||||
{};
|
||||
|
||||
REFIT_MENU_SCREEN( UINTN ID_,
|
||||
CONST CHAR16 *Title_,
|
||||
/* CONST */ CHAR16 *Title_,
|
||||
EG_IMAGE *TitleImage_,
|
||||
// INTN InfoLineCount_,
|
||||
// CONST CHAR16 **InfoLines_,
|
||||
@ -434,7 +436,7 @@ public:
|
||||
{};
|
||||
|
||||
REFIT_MENU_SCREEN( UINTN ID_,
|
||||
CONST CHAR16 *Title_,
|
||||
/* CONST */ CHAR16 *Title_,
|
||||
EG_IMAGE *TitleImage_,
|
||||
// INTN InfoLineCount_,
|
||||
// CONST CHAR16 **InfoLines_,
|
||||
@ -461,7 +463,7 @@ public:
|
||||
};
|
||||
|
||||
REFIT_MENU_SCREEN( UINTN ID_,
|
||||
CONST CHAR16 *Title_,
|
||||
/* CONST */ CHAR16 *Title_,
|
||||
EG_IMAGE *TitleImage_,
|
||||
// INTN InfoLineCount_,
|
||||
// CONST CHAR16 **InfoLines_,
|
||||
@ -495,9 +497,13 @@ public:
|
||||
VOID HidePointer();
|
||||
EFI_STATUS MouseBirth();
|
||||
VOID KillMouse();
|
||||
VOID AddMenuItem_(REFIT_MENU_ITEM_IEM_ABSTRACT* InputBootArgs, INTN Inx, CONST CHAR8 *Title, BOOLEAN Cursor);
|
||||
VOID AddMenuInfo(CONST CHAR16 *Line);
|
||||
VOID AddMenuInfoLine(IN CONST CHAR16 *InfoLine);
|
||||
VOID AddMenuEntry(IN REFIT_MENU_ENTRY *Entry, bool freeIt);
|
||||
VOID AddMenuItemSwitch(INTN Inx, CONST CHAR8 *Title, BOOLEAN Cursor);
|
||||
VOID AddMenuCheck(CONST CHAR8 *Text, UINTN Bit, INTN ItemNum);
|
||||
VOID AddMenuItemInput(INTN Inx, CONST CHAR8 *Title, BOOLEAN Cursor);
|
||||
VOID FreeMenu();
|
||||
INTN FindMenuShortcutEntry(IN CHAR16 Shortcut);
|
||||
UINTN InputDialog(IN MENU_STYLE_FUNC StyleFunc);
|
||||
@ -509,9 +515,7 @@ public:
|
||||
VOID CountItems();
|
||||
VOID InitAnime();
|
||||
BOOLEAN GetAnime();
|
||||
VOID UpdateAnime(const EG_RECT *Place);
|
||||
|
||||
UINTN InputDialog();
|
||||
VOID UpdateAnime();
|
||||
|
||||
//Style functions
|
||||
virtual VOID MainMenuStyle(IN UINTN Function, IN CONST CHAR16 *ParamText);
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include "XPointer.h"
|
||||
#include "libegint.h" //this includes platform.h
|
||||
#include "../refit/screen.h"
|
||||
#include "menu.h"
|
||||
|
||||
#ifndef DEBUG_ALL
|
||||
#define DEBUG_MOUSE 1
|
||||
@ -135,14 +136,6 @@ VOID XPointer::KillMouse()
|
||||
SimplePointerProtocol = NULL;
|
||||
}
|
||||
|
||||
// input - tsc
|
||||
// output - milliseconds
|
||||
// the caller is responsible for t1 > t0
|
||||
UINT64 XPointer::TimeDiff(UINT64 t0, UINT64 t1)
|
||||
{
|
||||
return DivU64x64Remainder((t1 - t0), DivU64x32(gCPUStructure.TSCFrequency, 1000), 0);
|
||||
}
|
||||
|
||||
VOID XPointer::UpdatePointer()
|
||||
{
|
||||
UINT64 Now;
|
||||
|
@ -31,7 +31,6 @@ public:
|
||||
bool isAlive();
|
||||
EFI_STATUS MouseBirth();
|
||||
VOID KillMouse();
|
||||
UINT64 TimeDiff(UINT64 t0, UINT64 t1);
|
||||
VOID UpdatePointer();
|
||||
bool MouseInRect(EG_RECT *Place);
|
||||
EFI_STATUS CheckMouseEvent(REFIT_MENU_SCREEN *Screen);
|
||||
|
@ -1074,7 +1074,7 @@ EFI_STATUS WaitForInputEventPoll(REFIT_MENU_SCREEN* ScreenPtr, UINTN TimeoutDefa
|
||||
if (Status != EFI_TIMEOUT) {
|
||||
break;
|
||||
}
|
||||
UpdateAnime(&Screen, &(Screen.FilmPlace)); //should be moved to REFIT_MENU_SCREEN class
|
||||
Screen.UpdateAnime(); //should be moved to REFIT_MENU_SCREEN class
|
||||
if (gSettings.PlayAsync) {
|
||||
CheckSyncSound();
|
||||
}
|
||||
|
@ -622,7 +622,7 @@ static VOID StartLoader(IN LOADER_ENTRY *Entry)
|
||||
DsdtsList[i] = NULL;
|
||||
}
|
||||
}
|
||||
FreeMenu(&OptionMenu);
|
||||
OptionMenu.FreeMenu();
|
||||
//there is a place to free memory
|
||||
// GuiAnime
|
||||
// mainParser
|
||||
@ -2509,7 +2509,7 @@ RefitMain (IN EFI_HANDLE ImageHandle,
|
||||
} else if (gThemeChanged) {
|
||||
DBG("change theme\n");
|
||||
InitTheme(FALSE, NULL);
|
||||
FreeMenu(&OptionMenu);
|
||||
OptionMenu.FreeMenu();
|
||||
}
|
||||
DBG("theme inited\n");
|
||||
gThemeChanged = FALSE;
|
||||
@ -2571,22 +2571,22 @@ RefitMain (IN EFI_HANDLE ImageHandle,
|
||||
MenuEntryOptions.Image = BuiltinIcon(BUILTIN_ICON_FUNC_OPTIONS);
|
||||
if (gSettings.DisableCloverHotkeys)
|
||||
MenuEntryOptions.ShortcutLetter = 0x00;
|
||||
AddMenuEntry(&MainMenu, &MenuEntryOptions, false);
|
||||
MainMenu.AddMenuEntry(&MenuEntryOptions, false);
|
||||
MenuEntryAbout.Image = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT);
|
||||
if (gSettings.DisableCloverHotkeys)
|
||||
MenuEntryAbout.ShortcutLetter = 0x00;
|
||||
AddMenuEntry(&MainMenu, &MenuEntryAbout, false);
|
||||
MainMenu.AddMenuEntry(&MenuEntryAbout, false);
|
||||
|
||||
|
||||
if (!(GlobalConfig.HideUIFlags & HIDEUI_FLAG_FUNCS) || MainMenu.Entries.size() == 0) {
|
||||
if (gSettings.DisableCloverHotkeys)
|
||||
MenuEntryReset.ShortcutLetter = 0x00;
|
||||
MenuEntryReset.Image = BuiltinIcon(BUILTIN_ICON_FUNC_RESET);
|
||||
AddMenuEntry(&MainMenu, &MenuEntryReset, false);
|
||||
MainMenu.AddMenuEntry(&MenuEntryReset, false);
|
||||
if (gSettings.DisableCloverHotkeys)
|
||||
MenuEntryShutdown.ShortcutLetter = 0x00;
|
||||
MenuEntryShutdown.Image = BuiltinIcon(BUILTIN_ICON_FUNC_EXIT);
|
||||
AddMenuEntry(&MainMenu, &MenuEntryShutdown, false);
|
||||
MainMenu.AddMenuEntry(&MenuEntryShutdown, false);
|
||||
}
|
||||
// font already changed and this message very quirky, clear line here
|
||||
if (!GlobalConfig.NoEarlyProgress && !GlobalConfig.FastBoot && GlobalConfig.Timeout>0) {
|
||||
@ -2624,7 +2624,7 @@ RefitMain (IN EFI_HANDLE ImageHandle,
|
||||
}
|
||||
GlobalConfig.FastBoot = FALSE; //Hmm... will never be here
|
||||
}
|
||||
MainAnime = GetAnime(&MainMenu);
|
||||
MainAnime = MainMenu.GetAnime();
|
||||
// DBG("MainAnime=%d\n", MainAnime);
|
||||
AfterTool = FALSE;
|
||||
gEvent = 0; //clear to cancel loop
|
||||
@ -2635,7 +2635,7 @@ RefitMain (IN EFI_HANDLE ImageHandle,
|
||||
MenuExit = MENU_EXIT_TIMEOUT;
|
||||
} else {
|
||||
MainMenu.AnimeRun = MainAnime;
|
||||
MenuExit = RunMainMenu(&MainMenu, DefaultIndex, &ChosenEntry);
|
||||
MenuExit = MainMenu.RunMainMenu(DefaultIndex, &ChosenEntry);
|
||||
}
|
||||
DBG("exit from MainMenu %d\n", MenuExit); //MENU_EXIT_ENTER=(1) MENU_EXIT_DETAILS=3
|
||||
// disable default boot - have sense only in the first run
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,14 +1,16 @@
|
||||
|
||||
VOID AddMenuInfoLine(IN REFIT_MENU_SCREEN *Screen, IN CONST CHAR16 *InfoLine);
|
||||
VOID AddMenuInfo(IN REFIT_MENU_SCREEN *SubScreen, IN CONST CHAR16 *Line);
|
||||
VOID AddMenuEntry(IN REFIT_MENU_SCREEN *Screen, IN REFIT_MENU_ENTRY *Entry, bool freeIt);
|
||||
VOID AddMenuCheck(REFIT_MENU_SCREEN *SubScreen, CONST CHAR8 *Text, UINTN Bit, INTN ItemNum);
|
||||
VOID FreeMenu(IN REFIT_MENU_SCREEN *Screen);
|
||||
UINTN RunMenu(IN REFIT_MENU_SCREEN *Screen, OUT REFIT_ABSTRACT_MENU_ENTRY **ChosenEntry);
|
||||
UINTN RunMainMenu(IN REFIT_MENU_SCREEN *Screen, IN INTN DefaultSelection, OUT REFIT_ABSTRACT_MENU_ENTRY **ChosenEntry);
|
||||
//VOID AddMenuInfoLine(IN REFIT_MENU_SCREEN *Screen, IN CONST CHAR16 *InfoLine);
|
||||
//VOID AddMenuInfo(IN REFIT_MENU_SCREEN *SubScreen, IN CONST CHAR16 *Line);
|
||||
//VOID AddMenuEntry(IN REFIT_MENU_SCREEN *Screen, IN REFIT_MENU_ENTRY *Entry, bool freeIt);
|
||||
//VOID AddMenuCheck(REFIT_MENU_SCREEN *SubScreen, CONST CHAR8 *Text, UINTN Bit, INTN ItemNum);
|
||||
//VOID FreeMenu(IN REFIT_MENU_SCREEN *Screen);
|
||||
//UINTN RunMenu(IN REFIT_MENU_SCREEN *Screen, OUT REFIT_ABSTRACT_MENU_ENTRY **ChosenEntry);
|
||||
//UINTN RunMainMenu(IN REFIT_MENU_SCREEN *Screen, IN INTN DefaultSelection, OUT REFIT_ABSTRACT_MENU_ENTRY **ChosenEntry);
|
||||
VOID DrawMenuText(IN CONST CHAR16 *Text, IN INTN SelectedWidth, IN INTN XPos, IN INTN YPos, IN INTN Cursor);
|
||||
VOID OptionsMenu(OUT REFIT_ABSTRACT_MENU_ENTRY **ChosenEntry, IN CHAR8 *LastChosenOS);
|
||||
VOID FreeScrollBar(VOID);
|
||||
INTN DrawTextXY(IN CONST CHAR16 *Text, IN INTN XPos, IN INTN YPos, IN UINT8 XAlign);
|
||||
VOID DrawBCSText(IN CONST CHAR16 *Text, IN INTN XPos, IN INTN YPos, IN UINT8 XAlign);
|
||||
|
||||
UINT64 TimeDiff(UINT64 t0, UINT64 t1); //double in Platform.h
|
||||
|
||||
|
@ -915,7 +915,7 @@ static INTN HybridRepositioning(INTN Edge, INTN Value, INTN ImageDimension, INTN
|
||||
|
||||
static EG_IMAGE *AnimeImage = NULL;
|
||||
|
||||
VOID REFIT_MENU_SCREEN::UpdateAnime(const EG_RECT *Place)
|
||||
VOID REFIT_MENU_SCREEN::UpdateAnime()
|
||||
{
|
||||
UINT64 Now;
|
||||
INTN x, y;
|
||||
@ -938,8 +938,8 @@ VOID REFIT_MENU_SCREEN::UpdateAnime(const EG_RECT *Place)
|
||||
// DBG("anime size=[%d,%d]\n", AnimeImage->Width, AnimeImage->Height);
|
||||
|
||||
// Retained for legacy themes without new anim placement options.
|
||||
x = Place->XPos + (Place->Width - AnimeImage->Width) / 2;
|
||||
y = Place->YPos + (Place->Height - AnimeImage->Height) / 2;
|
||||
x = FilmPlace.XPos + (FilmPlace.Width - AnimeImage->Width) / 2;
|
||||
y = FilmPlace.YPos + (FilmPlace.Height - AnimeImage->Height) / 2;
|
||||
|
||||
if (!IsImageWithinScreenLimits(x, Film[0]->Width, UGAWidth) || !IsImageWithinScreenLimits(y, Film[0]->Height, UGAHeight)) {
|
||||
// DBG(") This anime can't be displayed\n");
|
||||
|
@ -10,9 +10,9 @@ VOID TerminateScreen(VOID);
|
||||
VOID SetNextScreenMode(INT32);
|
||||
|
||||
|
||||
BOOLEAN GetAnime(REFIT_MENU_SCREEN *Screen);
|
||||
VOID InitAnime(REFIT_MENU_SCREEN *Screen);
|
||||
VOID UpdateAnime(REFIT_MENU_SCREEN *Screen, const EG_RECT *Place);
|
||||
//BOOLEAN GetAnime(REFIT_MENU_SCREEN *Screen);
|
||||
//VOID InitAnime(REFIT_MENU_SCREEN *Screen);
|
||||
//VOID UpdateAnime(REFIT_MENU_SCREEN *Screen, const EG_RECT *Place);
|
||||
VOID FreeAnime(GUI_ANIME *Anime);
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user