Fix unresolved external.

This commit is contained in:
jief 2020-03-03 23:18:21 +03:00
parent fc2f226e8d
commit fd327e2b1f
11 changed files with 543 additions and 543 deletions

View File

@ -365,7 +365,7 @@ VOID AlertMessage(IN CONST CHAR16 *Title, IN CONST CHAR16 *Message)
// CHAR16 **Information = CreateInfoLines(Message, &Count); // CHAR16 **Information = CreateInfoLines(Message, &Count);
CreateInfoLines(Message, &AlertMessageMenu.InfoLines); CreateInfoLines(Message, &AlertMessageMenu.InfoLines);
AlertMessageMenu.Title = Title; AlertMessageMenu.Title = Title;
RunMenu(&AlertMessageMenu, NULL); AlertMessageMenu.RunMenu(NULL);
// // Check parameters // // Check parameters
// if (Information != NULL) { // if (Information != NULL) {
// if (Count > 0) { // if (Count > 0) {
@ -407,7 +407,7 @@ BOOLEAN YesNoMessage(IN CHAR16 *Title, IN CONST CHAR16 *Message)
do do
{ {
REFIT_ABSTRACT_MENU_ENTRY *ChosenEntry = NULL; 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 && 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))) { ((MenuExit == MENU_EXIT_ENTER) || (MenuExit == MENU_EXIT_DETAILS))) {
Result = TRUE; Result = TRUE;
@ -484,7 +484,7 @@ BOOLEAN AskUserForFilePathFromVolumes(IN CHAR16 *Title OPTIONAL, OUT EFI_DEVICE_
{ {
REFIT_ABSTRACT_MENU_ENTRY *ChosenEntry = NULL; REFIT_ABSTRACT_MENU_ENTRY *ChosenEntry = NULL;
// Run the volume chooser menu // Run the volume chooser menu
MenuExit = RunMenu(&Menu, &ChosenEntry); MenuExit = Menu.RunMenu(&ChosenEntry);
if ((ChosenEntry != NULL) && ChosenEntry->getREFIT_SIMPLE_MENU_ENTRY_TAG() && if ((ChosenEntry != NULL) && ChosenEntry->getREFIT_SIMPLE_MENU_ENTRY_TAG() &&
((MenuExit == MENU_EXIT_ENTER) || (MenuExit == MENU_EXIT_DETAILS))) { ((MenuExit == MENU_EXIT_ENTER) || (MenuExit == MENU_EXIT_DETAILS))) {
if (ChosenEntry->getREFIT_SIMPLE_MENU_ENTRY_TAG()->Tag >= TAG_OFFSET) { if (ChosenEntry->getREFIT_SIMPLE_MENU_ENTRY_TAG()->Tag >= TAG_OFFSET) {

View File

@ -161,7 +161,7 @@ static LEGACY_ENTRY * AddLegacyEntry(IN CONST CHAR16 *FullTitle, IN CONST CHAR16
SubScreen = (__typeof__(SubScreen))AllocateZeroPool(sizeof(REFIT_MENU_SCREEN)); SubScreen = (__typeof__(SubScreen))AllocateZeroPool(sizeof(REFIT_MENU_SCREEN));
SubScreen->Title = PoolPrint(L"Boot Options for %s on %s", LoaderTitle, VolDesc); SubScreen->Title = PoolPrint(L"Boot Options for %s on %s", LoaderTitle, VolDesc);
SubScreen->TitleImage = Entry->Image; SubScreen->TitleImage = Entry->Image;
SubScreen->AnimeRun = GetAnime(SubScreen); SubScreen->AnimeRun = SubScreen->GetAnime();
// default entry // default entry
// SubEntry = (__typeof__(SubEntry))AllocateZeroPool(sizeof(LEGACY_ENTRY)); // SubEntry = (__typeof__(SubEntry))AllocateZeroPool(sizeof(LEGACY_ENTRY));
@ -172,11 +172,11 @@ static LEGACY_ENTRY * AddLegacyEntry(IN CONST CHAR16 *FullTitle, IN CONST CHAR16
SubEntry->DevicePathString = Entry->DevicePathString; SubEntry->DevicePathString = Entry->DevicePathString;
SubEntry->LoadOptions = Entry->LoadOptions; SubEntry->LoadOptions = Entry->LoadOptions;
SubEntry->AtClick = ActionEnter; SubEntry->AtClick = ActionEnter;
AddMenuEntry(SubScreen, SubEntry, true); SubScreen->AddMenuEntry(SubEntry, true);
AddMenuEntry(SubScreen, &MenuEntryReturn, false); SubScreen->AddMenuEntry(&MenuEntryReturn, false);
Entry->SubScreen = SubScreen; 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); DBG(" added '%s' OSType=%d Icon=%s\n", Entry->Title, Volume->LegacyOS->Type, Volume->LegacyOS->IconName);
return Entry; return Entry;
} }

View File

@ -759,28 +759,28 @@ STATIC VOID AddDefaultMenu(IN LOADER_ENTRY *Entry)
SubScreen->TitleImage = Entry->Image; SubScreen->TitleImage = Entry->Image;
SubScreen->ID = Entry->LoaderType + 20; SubScreen->ID = Entry->LoaderType + 20;
// DBG("get anime for os=%d\n", SubScreen->ID); // 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); VolumeSize = RShiftU64(MultU64x32(Volume->BlockIO->Media->LastBlock, Volume->BlockIO->Media->BlockSize), 20);
AddMenuInfoLine(SubScreen, PoolPrint(L"Volume size: %dMb", VolumeSize)); SubScreen->AddMenuInfoLine(PoolPrint(L"Volume size: %dMb", VolumeSize));
AddMenuInfoLine(SubScreen, FileDevicePathToStr(Entry->DevicePath)); SubScreen->AddMenuInfoLine(FileDevicePathToStr(Entry->DevicePath));
Guid = FindGPTPartitionGuidInDevicePath(Volume->DevicePath); Guid = FindGPTPartitionGuidInDevicePath(Volume->DevicePath);
if (Guid) { if (Guid) {
CHAR8 *GuidStr = (__typeof__(GuidStr))AllocateZeroPool(50); CHAR8 *GuidStr = (__typeof__(GuidStr))AllocateZeroPool(50);
AsciiSPrint(GuidStr, 50, "%g", Guid); AsciiSPrint(GuidStr, 50, "%g", Guid);
AddMenuInfoLine(SubScreen, PoolPrint(L"UUID: %a", GuidStr)); SubScreen->AddMenuInfoLine(PoolPrint(L"UUID: %a", GuidStr));
FreePool(GuidStr); FreePool(GuidStr);
} }
AddMenuInfoLine(SubScreen, PoolPrint(L"Options: %s", Entry->LoadOptions)); SubScreen->AddMenuInfoLine(PoolPrint(L"Options: %s", Entry->LoadOptions));
// loader-specific submenu entries // loader-specific submenu entries
if (Entry->LoaderType == OSTYPE_OSX || if (Entry->LoaderType == OSTYPE_OSX ||
Entry->LoaderType == OSTYPE_OSX_INSTALLER || Entry->LoaderType == OSTYPE_OSX_INSTALLER ||
Entry->LoaderType == OSTYPE_RECOVERY) { // entries for Mac OS X Entry->LoaderType == OSTYPE_RECOVERY) { // entries for Mac OS X
if (os_version < AsciiOSVersionToUint64("10.8")) { 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")) { } 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 { } else {
AddMenuInfoLine(SubScreen, PoolPrint(L"macOS: %a", Entry->OSVersion)); SubScreen->AddMenuInfoLine(PoolPrint(L"macOS: %a", Entry->OSVersion));
} }
if (OSFLAG_ISSET(Entry->Flags, OSFLAG_HIBERNATED)) { if (OSFLAG_ISSET(Entry->Flags, OSFLAG_HIBERNATED)) {
@ -788,7 +788,7 @@ STATIC VOID AddDefaultMenu(IN LOADER_ENTRY *Entry)
if (SubEntry) { if (SubEntry) {
SubEntry->Title = L"Cancel hibernate wake"; SubEntry->Title = L"Cancel hibernate wake";
SubEntry->Flags = OSFLAG_UNSET(SubEntry->Flags, OSFLAG_HIBERNATED); 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 { } else {
SubEntry->Title = L"Boot macOS with selected options"; SubEntry->Title = L"Boot macOS with selected options";
} }
AddMenuEntry(SubScreen, SubEntry, true); SubScreen->AddMenuEntry(SubEntry, true);
} }
SubEntry = DuplicateLoaderEntry(Entry); 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_UNSET(SubEntry->Flags, OSFLAG_CHECKFAKESMC);
SubEntry->Flags = OSFLAG_SET(SubEntry->Flags, OSFLAG_WITHKEXTS); SubEntry->Flags = OSFLAG_SET(SubEntry->Flags, OSFLAG_WITHKEXTS);
AddMenuEntry(SubScreen, SubEntry, true); SubScreen->AddMenuEntry(SubEntry, true);
} }
SubEntry = DuplicateLoaderEntry(Entry); SubEntry = DuplicateLoaderEntry(Entry);
if (SubEntry) { if (SubEntry) {
@ -828,11 +828,11 @@ STATIC VOID AddDefaultMenu(IN LOADER_ENTRY *Entry)
} }
SubEntry->Flags = OSFLAG_UNSET(SubEntry->Flags, OSFLAG_CHECKFAKESMC); SubEntry->Flags = OSFLAG_UNSET(SubEntry->Flags, OSFLAG_CHECKFAKESMC);
SubEntry->Flags = OSFLAG_UNSET(SubEntry->Flags, OSFLAG_WITHKEXTS); 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); SubScreen->AddMenuEntry(SubMenuKextInjectMgmt(Entry), true);
AddMenuInfo(SubScreen, L"=== boot-args ==="); SubScreen->AddMenuInfo(L"=== boot-args ===");
if (!KernelIs64BitOnly) { if (!KernelIs64BitOnly) {
if (os_version < AsciiOSVersionToUint64("10.8")) { if (os_version < AsciiOSVersionToUint64("10.8")) {
AddMenuCheck(SubScreen, "Mac OS X 32bit", OPT_I386, 68); AddMenuCheck(SubScreen, "Mac OS X 32bit", OPT_I386, 68);
@ -879,7 +879,7 @@ STATIC VOID AddDefaultMenu(IN LOADER_ENTRY *Entry)
SubEntry = DuplicateLoaderEntry(Entry); SubEntry = DuplicateLoaderEntry(Entry);
if (SubEntry) { if (SubEntry) {
SubEntry->Title = PoolPrint(L"Run %s", FileName); SubEntry->Title = PoolPrint(L"Run %s", FileName);
AddMenuEntry(SubScreen, SubEntry, true); SubScreen->AddMenuEntry(SubEntry, true);
} }
SubEntry = DuplicateLoaderEntry(Entry); SubEntry = DuplicateLoaderEntry(Entry);
@ -893,7 +893,7 @@ STATIC VOID AddDefaultMenu(IN LOADER_ENTRY *Entry)
SubEntry->LoadOptions = AddLoadOption(Entry->LoadOptions, L"quiet"); SubEntry->LoadOptions = AddLoadOption(Entry->LoadOptions, L"quiet");
} }
} }
AddMenuEntry(SubScreen, SubEntry, true); SubScreen->AddMenuEntry(SubEntry, true);
SubEntry = DuplicateLoaderEntry(Entry); SubEntry = DuplicateLoaderEntry(Entry);
if (SubEntry) { if (SubEntry) {
FreePool(SubEntry->LoadOptions); FreePool(SubEntry->LoadOptions);
@ -905,7 +905,7 @@ STATIC VOID AddDefaultMenu(IN LOADER_ENTRY *Entry)
SubEntry->LoadOptions = AddLoadOption(Entry->LoadOptions, L"splash"); SubEntry->LoadOptions = AddLoadOption(Entry->LoadOptions, L"splash");
} }
} }
AddMenuEntry(SubScreen, SubEntry, true); SubScreen->AddMenuEntry(SubEntry, true);
SubEntry = DuplicateLoaderEntry(Entry); SubEntry = DuplicateLoaderEntry(Entry);
if (SubEntry) { if (SubEntry) {
FreePool(SubEntry->LoadOptions); FreePool(SubEntry->LoadOptions);
@ -931,7 +931,7 @@ STATIC VOID AddDefaultMenu(IN LOADER_ENTRY *Entry)
SubEntry->LoadOptions = AddLoadOption(Entry->LoadOptions, L"quiet splash"); 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)) { } else if ((Entry->LoaderType == OSTYPE_WIN) || (Entry->LoaderType == OSTYPE_WINEFI)) {
// by default, skip the built-in selection and boot from hard disk only // by default, skip the built-in selection and boot from hard disk only
Entry->LoadOptions = PoolPrint(L"-s -h"); Entry->LoadOptions = PoolPrint(L"-s -h");
@ -940,20 +940,20 @@ STATIC VOID AddDefaultMenu(IN LOADER_ENTRY *Entry)
SubEntry = DuplicateLoaderEntry(Entry); SubEntry = DuplicateLoaderEntry(Entry);
if (SubEntry) { if (SubEntry) {
SubEntry->Title = PoolPrint(L"Run %s", FileName); SubEntry->Title = PoolPrint(L"Run %s", FileName);
AddMenuEntry(SubScreen, (REFIT_MENU_ENTRY *)SubEntry, true); SubScreen->AddMenuEntry((REFIT_MENU_ENTRY *)SubEntry, true);
} }
SubEntry = DuplicateLoaderEntry(Entry); SubEntry = DuplicateLoaderEntry(Entry);
if (SubEntry) { if (SubEntry) {
SubEntry->Title = PoolPrint(L"Boot Windows from Hard Disk"); 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); SubEntry = DuplicateLoaderEntry(Entry);
if (SubEntry) { if (SubEntry) {
SubEntry->Title = PoolPrint(L"Boot Windows from CD-ROM"); SubEntry->Title = PoolPrint(L"Boot Windows from CD-ROM");
SubEntry->LoadOptions = PoolPrint(L"-s -c"); SubEntry->LoadOptions = PoolPrint(L"-s -c");
AddMenuEntry(SubScreen, (REFIT_MENU_ENTRY *)SubEntry, true); SubScreen->AddMenuEntry((REFIT_MENU_ENTRY *)SubEntry, true);
} }
SubEntry = DuplicateLoaderEntry(Entry); SubEntry = DuplicateLoaderEntry(Entry);
@ -962,12 +962,12 @@ STATIC VOID AddDefaultMenu(IN LOADER_ENTRY *Entry)
SubEntry->Flags = OSFLAG_UNSET(SubEntry->Flags, OSFLAG_USEGRAPHICS); SubEntry->Flags = OSFLAG_UNSET(SubEntry->Flags, OSFLAG_USEGRAPHICS);
SubEntry->LoadOptions = PoolPrint(L"-v"); SubEntry->LoadOptions = PoolPrint(L"-v");
SubEntry->LoaderType = OSTYPE_OTHER; // Sothor - Why are we using OSTYPE_OTHER here? 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; Entry->SubScreen = SubScreen;
// DBG(" Added '%s': OSType='%d', OSVersion='%a'\n", Entry->Title, Entry->LoaderType, Entry->OSVersion); // 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 ;( //TODO there is a problem that Entry->Flags is unique while InputItems are global ;(
// InputItems[69].IValue = Entry->Flags; // InputItems[69].IValue = Entry->Flags;
AddDefaultMenu(Entry); AddDefaultMenu(Entry);
AddMenuEntry(&MainMenu, Entry, true); MainMenu.AddMenuEntry(Entry, true);
return TRUE; return TRUE;
} }
return FALSE; 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->Title = PoolPrint(L"Boot Options for %s on %s", (Custom->Title != NULL) ? Custom->Title : CustomPath, Entry->VolName);
SubScreen->TitleImage = Entry->Image; SubScreen->TitleImage = Entry->Image;
SubScreen->ID = Custom->Type + 20; 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); VolumeSize = RShiftU64(MultU64x32(Volume->BlockIO->Media->LastBlock, Volume->BlockIO->Media->BlockSize), 20);
AddMenuInfoLine(SubScreen, PoolPrint(L"Volume size: %dMb", VolumeSize)); SubScreen->AddMenuInfoLine(PoolPrint(L"Volume size: %dMb", VolumeSize));
AddMenuInfoLine(SubScreen, FileDevicePathToStr(Entry->DevicePath)); SubScreen->AddMenuInfoLine(FileDevicePathToStr(Entry->DevicePath));
if (Guid) { if (Guid) {
CHAR8 *GuidStr = (__typeof__(GuidStr))AllocateZeroPool(50); CHAR8 *GuidStr = (__typeof__(GuidStr))AllocateZeroPool(50);
AsciiSPrint(GuidStr, 50, "%g", Guid); AsciiSPrint(GuidStr, 50, "%g", Guid);
AddMenuInfoLine(SubScreen, PoolPrint(L"UUID: %a", GuidStr)); SubScreen->AddMenuInfoLine(PoolPrint(L"UUID: %a", GuidStr));
FreePool(GuidStr); FreePool(GuidStr);
} }
AddMenuInfoLine(SubScreen, PoolPrint(L"Options: %s", Entry->LoadOptions)); SubScreen->AddMenuInfoLine(PoolPrint(L"Options: %s", Entry->LoadOptions));
DBG("Create sub entries\n"); DBG("Create sub entries\n");
for (CustomSubEntry = Custom->SubEntries; CustomSubEntry; CustomSubEntry = CustomSubEntry->Next) { for (CustomSubEntry = Custom->SubEntries; CustomSubEntry; CustomSubEntry = CustomSubEntry->Next) {
if (!CustomSubEntry->Settings) { if (!CustomSubEntry->Settings) {
@ -1989,11 +1989,12 @@ STATIC VOID AddCustomEntry(IN UINTN CustomIndex,
} }
AddCustomEntry(CustomSubIndex++, (CustomSubEntry->Path != NULL) ? CustomSubEntry->Path : CustomPath, CustomSubEntry, SubScreen); AddCustomEntry(CustomSubIndex++, (CustomSubEntry->Path != NULL) ? CustomSubEntry->Path : CustomPath, CustomSubEntry, SubScreen);
} }
AddMenuEntry(SubScreen, &MenuEntryReturn, true); SubScreen->AddMenuEntry(&MenuEntryReturn, true);
Entry->SubScreen = SubScreen; Entry->SubScreen = SubScreen;
} }
} }
AddMenuEntry(IsSubEntry ? SubMenu : &MainMenu, Entry, true); if ( IsSubEntry ) SubMenu->AddMenuEntry(Entry, true);
else MainMenu.AddMenuEntry(Entry, true);
} }
// cleanup custom // cleanup custom
if (FindCustomPath) { if (FindCustomPath) {

View File

@ -81,7 +81,7 @@ VOID AddSecureBootTool(VOID)
Entry->AtClick = ActionSelect; Entry->AtClick = ActionSelect;
Entry->AtDoubleClick = ActionEnter; Entry->AtDoubleClick = ActionEnter;
Entry->AtRightClick = ActionHelp; Entry->AtRightClick = ActionHelp;
AddMenuEntry(&MainMenu, Entry); MainMenu->AddMenuEntry(Entry);
} }
/* /*
typedef struct _refit_menu_entry { typedef struct _refit_menu_entry {

View File

@ -109,7 +109,7 @@ STATIC BOOLEAN AddToolEntry(IN CONST CHAR16 *LoaderPath, IN CONST CHAR16 *FullTi
Entry->AtRightClick = ActionHelp; Entry->AtRightClick = ActionHelp;
DBG("found tool %s\n", LoaderPath); DBG("found tool %s\n", LoaderPath);
AddMenuEntry(&MainMenu, Entry, true); MainMenu.AddMenuEntry(Entry, true);
return TRUE; return TRUE;
} }
@ -147,8 +147,8 @@ STATIC VOID AddCloverEntry(IN CONST CHAR16 *LoaderPath, IN CONST CHAR16 *LoaderT
SubScreen->Title = EfiStrDuplicate(LoaderTitle); SubScreen->Title = EfiStrDuplicate(LoaderTitle);
SubScreen->TitleImage = Entry->Image; SubScreen->TitleImage = Entry->Image;
SubScreen->ID = SCREEN_BOOT; SubScreen->ID = SCREEN_BOOT;
SubScreen->AnimeRun = GetAnime(SubScreen); SubScreen->AnimeRun = SubScreen->GetAnime();
AddMenuInfoLine(SubScreen, FileDevicePathToStr(Volume->DevicePath)); SubScreen->AddMenuInfoLine(FileDevicePathToStr(Volume->DevicePath));
if (gEmuVariableControl != NULL) { if (gEmuVariableControl != NULL) {
gEmuVariableControl->UninstallEmulation(gEmuVariableControl); gEmuVariableControl->UninstallEmulation(gEmuVariableControl);
@ -159,26 +159,26 @@ STATIC VOID AddCloverEntry(IN CONST CHAR16 *LoaderPath, IN CONST CHAR16 *LoaderT
if (SubEntry) { if (SubEntry) {
SubEntry->Title = L"Add Clover boot options for all entries"; SubEntry->Title = L"Add Clover boot options for all entries";
SubEntry->LoadOptions = L"BO-ADD"; SubEntry->LoadOptions = L"BO-ADD";
AddMenuEntry(SubScreen, SubEntry, true); SubScreen->AddMenuEntry(SubEntry, true);
} }
SubEntry = DuplicateLoaderEntry(Entry); SubEntry = DuplicateLoaderEntry(Entry);
if (SubEntry) { if (SubEntry) {
SubEntry->Title = L"Remove all Clover boot options"; SubEntry->Title = L"Remove all Clover boot options";
SubEntry->LoadOptions = L"BO-REMOVE"; SubEntry->LoadOptions = L"BO-REMOVE";
AddMenuEntry(SubScreen, SubEntry, true); SubScreen->AddMenuEntry(SubEntry, true);
} }
SubEntry = DuplicateLoaderEntry(Entry); SubEntry = DuplicateLoaderEntry(Entry);
if (SubEntry) { if (SubEntry) {
SubEntry->Title = L"Print all UEFI boot options to log"; SubEntry->Title = L"Print all UEFI boot options to log";
SubEntry->LoadOptions = L"BO-PRINT"; SubEntry->LoadOptions = L"BO-PRINT";
AddMenuEntry(SubScreen, SubEntry, true); SubScreen->AddMenuEntry(SubEntry, true);
} }
AddMenuEntry(SubScreen, &MenuEntryReturn, false); SubScreen->AddMenuEntry(&MenuEntryReturn, false);
Entry->SubScreen = SubScreen; Entry->SubScreen = SubScreen;
AddMenuEntry(&MainMenu, Entry, true); MainMenu.AddMenuEntry(Entry, true);
} }
VOID ScanTool(VOID) VOID ScanTool(VOID)

View File

@ -500,7 +500,6 @@ public:
VOID AddMenuEntry(IN REFIT_MENU_ENTRY *Entry, bool freeIt); VOID AddMenuEntry(IN REFIT_MENU_ENTRY *Entry, bool freeIt);
VOID FreeMenu(); VOID FreeMenu();
INTN FindMenuShortcutEntry(IN CHAR16 Shortcut); INTN FindMenuShortcutEntry(IN CHAR16 Shortcut);
UINTN InputDialog(IN MENU_STYLE_FUNC StyleFunc);
UINTN RunGenericMenu(IN MENU_STYLE_FUNC StyleFunc, IN OUT INTN *DefaultEntryIndex, OUT REFIT_ABSTRACT_MENU_ENTRY **ChosenEntry); UINTN RunGenericMenu(IN MENU_STYLE_FUNC StyleFunc, IN OUT INTN *DefaultEntryIndex, OUT REFIT_ABSTRACT_MENU_ENTRY **ChosenEntry);
UINTN RunMenu(OUT REFIT_ABSTRACT_MENU_ENTRY **ChosenEntry); UINTN RunMenu(OUT REFIT_ABSTRACT_MENU_ENTRY **ChosenEntry);
UINTN RunMainMenu(IN INTN DefaultSelection, OUT REFIT_ABSTRACT_MENU_ENTRY **ChosenEntry); UINTN RunMainMenu(IN INTN DefaultSelection, OUT REFIT_ABSTRACT_MENU_ENTRY **ChosenEntry);
@ -511,6 +510,7 @@ public:
BOOLEAN GetAnime(); BOOLEAN GetAnime();
VOID UpdateAnime(const EG_RECT *Place); VOID UpdateAnime(const EG_RECT *Place);
// UINTN InputDialog(IN MENU_STYLE_FUNC StyleFunc);
UINTN InputDialog(); UINTN InputDialog();
//Style functions //Style functions

View File

@ -1074,7 +1074,7 @@ EFI_STATUS WaitForInputEventPoll(REFIT_MENU_SCREEN* ScreenPtr, UINTN TimeoutDefa
if (Status != EFI_TIMEOUT) { if (Status != EFI_TIMEOUT) {
break; break;
} }
UpdateAnime(&Screen, &(Screen.FilmPlace)); //should be moved to REFIT_MENU_SCREEN class Screen.UpdateAnime(&Screen.FilmPlace); //should be moved to REFIT_MENU_SCREEN class
if (gSettings.PlayAsync) { if (gSettings.PlayAsync) {
CheckSyncSound(); CheckSyncSound();
} }

View File

@ -622,7 +622,7 @@ static VOID StartLoader(IN LOADER_ENTRY *Entry)
DsdtsList[i] = NULL; DsdtsList[i] = NULL;
} }
} }
FreeMenu(&OptionMenu); OptionMenu.FreeMenu();
//there is a place to free memory //there is a place to free memory
// GuiAnime // GuiAnime
// mainParser // mainParser
@ -2509,7 +2509,7 @@ RefitMain (IN EFI_HANDLE ImageHandle,
} else if (gThemeChanged) { } else if (gThemeChanged) {
DBG("change theme\n"); DBG("change theme\n");
InitTheme(FALSE, NULL); InitTheme(FALSE, NULL);
FreeMenu(&OptionMenu); OptionMenu.FreeMenu();
} }
DBG("theme inited\n"); DBG("theme inited\n");
gThemeChanged = FALSE; gThemeChanged = FALSE;
@ -2571,22 +2571,22 @@ RefitMain (IN EFI_HANDLE ImageHandle,
MenuEntryOptions.Image = BuiltinIcon(BUILTIN_ICON_FUNC_OPTIONS); MenuEntryOptions.Image = BuiltinIcon(BUILTIN_ICON_FUNC_OPTIONS);
if (gSettings.DisableCloverHotkeys) if (gSettings.DisableCloverHotkeys)
MenuEntryOptions.ShortcutLetter = 0x00; MenuEntryOptions.ShortcutLetter = 0x00;
AddMenuEntry(&MainMenu, &MenuEntryOptions, false); MainMenu.AddMenuEntry(&MenuEntryOptions, false);
MenuEntryAbout.Image = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT); MenuEntryAbout.Image = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT);
if (gSettings.DisableCloverHotkeys) if (gSettings.DisableCloverHotkeys)
MenuEntryAbout.ShortcutLetter = 0x00; MenuEntryAbout.ShortcutLetter = 0x00;
AddMenuEntry(&MainMenu, &MenuEntryAbout, false); MainMenu.AddMenuEntry(&MenuEntryAbout, false);
if (!(GlobalConfig.HideUIFlags & HIDEUI_FLAG_FUNCS) || MainMenu.Entries.size() == 0) { if (!(GlobalConfig.HideUIFlags & HIDEUI_FLAG_FUNCS) || MainMenu.Entries.size() == 0) {
if (gSettings.DisableCloverHotkeys) if (gSettings.DisableCloverHotkeys)
MenuEntryReset.ShortcutLetter = 0x00; MenuEntryReset.ShortcutLetter = 0x00;
MenuEntryReset.Image = BuiltinIcon(BUILTIN_ICON_FUNC_RESET); MenuEntryReset.Image = BuiltinIcon(BUILTIN_ICON_FUNC_RESET);
AddMenuEntry(&MainMenu, &MenuEntryReset, false); MainMenu.AddMenuEntry(&MenuEntryReset, false);
if (gSettings.DisableCloverHotkeys) if (gSettings.DisableCloverHotkeys)
MenuEntryShutdown.ShortcutLetter = 0x00; MenuEntryShutdown.ShortcutLetter = 0x00;
MenuEntryShutdown.Image = BuiltinIcon(BUILTIN_ICON_FUNC_EXIT); 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 // font already changed and this message very quirky, clear line here
if (!GlobalConfig.NoEarlyProgress && !GlobalConfig.FastBoot && GlobalConfig.Timeout>0) { 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 GlobalConfig.FastBoot = FALSE; //Hmm... will never be here
} }
MainAnime = GetAnime(&MainMenu); MainAnime = MainMenu.GetAnime();
// DBG("MainAnime=%d\n", MainAnime); // DBG("MainAnime=%d\n", MainAnime);
AfterTool = FALSE; AfterTool = FALSE;
gEvent = 0; //clear to cancel loop gEvent = 0; //clear to cancel loop
@ -2635,7 +2635,7 @@ RefitMain (IN EFI_HANDLE ImageHandle,
MenuExit = MENU_EXIT_TIMEOUT; MenuExit = MENU_EXIT_TIMEOUT;
} else { } else {
MainMenu.AnimeRun = MainAnime; 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 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 // disable default boot - have sense only in the first run

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,11 @@
VOID AddMenuInfoLine(IN REFIT_MENU_SCREEN *Screen, IN CONST CHAR16 *InfoLine); //VOID AddMenuInfoLine(IN REFIT_MENU_SCREEN *Screen, IN CONST CHAR16 *InfoLine);
VOID AddMenuInfo(IN REFIT_MENU_SCREEN *SubScreen, IN CONST CHAR16 *Line); //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 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 AddMenuCheck(REFIT_MENU_SCREEN *SubScreen, CONST CHAR8 *Text, UINTN Bit, INTN ItemNum);
VOID FreeMenu(IN REFIT_MENU_SCREEN *Screen); //VOID FreeMenu(IN REFIT_MENU_SCREEN *Screen);
UINTN RunMenu(IN REFIT_MENU_SCREEN *Screen, OUT REFIT_ABSTRACT_MENU_ENTRY **ChosenEntry); //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); //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 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 OptionsMenu(OUT REFIT_ABSTRACT_MENU_ENTRY **ChosenEntry, IN CHAR8 *LastChosenOS);
VOID FreeScrollBar(VOID); VOID FreeScrollBar(VOID);

View File

@ -10,9 +10,9 @@ VOID TerminateScreen(VOID);
VOID SetNextScreenMode(INT32); VOID SetNextScreenMode(INT32);
BOOLEAN GetAnime(REFIT_MENU_SCREEN *Screen); //BOOLEAN GetAnime(REFIT_MENU_SCREEN *Screen);
VOID InitAnime(REFIT_MENU_SCREEN *Screen); //VOID InitAnime(REFIT_MENU_SCREEN *Screen);
VOID UpdateAnime(REFIT_MENU_SCREEN *Screen, const EG_RECT *Place); //VOID UpdateAnime(REFIT_MENU_SCREEN *Screen, const EG_RECT *Place);
VOID FreeAnime(GUI_ANIME *Anime); VOID FreeAnime(GUI_ANIME *Anime);