mirror of
https://github.com/CloverHackyColor/CloverBootloader.git
synced 2025-03-12 13:19:38 +01:00
merge conflicts
Signed-off-by: Sergey Isakov <isakov-sl@bk.ru>
This commit is contained in:
commit
b3e48e0547
rEFIt_UEFI
@ -1 +1,2 @@
|
|||||||
|
|
||||||
|
VOID KillMouse();
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
#include "../refit/screen.h"
|
#include "../refit/screen.h"
|
||||||
#include "../refit/menu.h"
|
#include "../refit/menu.h"
|
||||||
#include "gma.h"
|
#include "gma.h"
|
||||||
|
#include "Pointer.h"
|
||||||
|
|
||||||
#ifndef DEBUG_ALL
|
#ifndef DEBUG_ALL
|
||||||
#define DEBUG_SET 1
|
#define DEBUG_SET 1
|
||||||
|
@ -68,6 +68,7 @@
|
|||||||
//#define TAG_EXIT_OLD (101)
|
//#define TAG_EXIT_OLD (101)
|
||||||
//#define TAG_RETURN_OLD ((UINTN)(-1))
|
//#define TAG_RETURN_OLD ((UINTN)(-1))
|
||||||
|
|
||||||
|
|
||||||
//typedef VOID(*MENU_STYLE_FUNC)(IN UINTN Function, IN CONST CHAR16 *ParamText);
|
//typedef VOID(*MENU_STYLE_FUNC)(IN UINTN Function, IN CONST CHAR16 *ParamText);
|
||||||
enum MENU_STYLE_VALUE {
|
enum MENU_STYLE_VALUE {
|
||||||
Text,
|
Text,
|
||||||
@ -77,6 +78,7 @@ enum MENU_STYLE_VALUE {
|
|||||||
BootCamp
|
BootCamp
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
//typedef struct _refit_menu_screen REFIT_MENU_SCREEN;
|
//typedef struct _refit_menu_screen REFIT_MENU_SCREEN;
|
||||||
class REFIT_MENU_SCREEN;
|
class REFIT_MENU_SCREEN;
|
||||||
class REFIT_MENU_SWITCH;
|
class REFIT_MENU_SWITCH;
|
||||||
@ -378,6 +380,8 @@ public:
|
|||||||
//#define FILM_PERCENT 100000
|
//#define FILM_PERCENT 100000
|
||||||
#define INITVALUE 40000
|
#define INITVALUE 40000
|
||||||
|
|
||||||
|
typedef VOID(REFIT_MENU_SCREEN::*MENU_STYLE_FUNC)(IN UINTN Function, IN CONST CHAR16 *ParamText);
|
||||||
|
|
||||||
class REFIT_MENU_SCREEN
|
class REFIT_MENU_SCREEN
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -36,7 +36,9 @@ public:
|
|||||||
bool MouseInRect(EG_RECT *Place);
|
bool MouseInRect(EG_RECT *Place);
|
||||||
EFI_STATUS CheckMouseEvent(REFIT_MENU_SCREEN *Screen);
|
EFI_STATUS CheckMouseEvent(REFIT_MENU_SCREEN *Screen);
|
||||||
|
|
||||||
|
bool isEmpty() const { return PointerImage.isEmpty(); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
VOID Draw();
|
VOID Draw();
|
||||||
|
VOID DrawPointer();
|
||||||
};
|
};
|
||||||
|
@ -2421,7 +2421,7 @@ UINTN REFIT_MENU_SCREEN::InputDialog()
|
|||||||
}
|
}
|
||||||
// Redraw the field
|
// Redraw the field
|
||||||
(Entries[ScrollState.CurrentSelection]).Row = Pos;
|
(Entries[ScrollState.CurrentSelection]).Row = Pos;
|
||||||
StyleFunc(MENU_FUNCTION_PAINT_SELECTION, NULL);
|
((*this).*(StyleFunc))(MENU_FUNCTION_PAINT_SELECTION, NULL);
|
||||||
} while (!MenuExit);
|
} while (!MenuExit);
|
||||||
|
|
||||||
switch (MenuExit) {
|
switch (MenuExit) {
|
||||||
@ -2437,7 +2437,7 @@ UINTN REFIT_MENU_SCREEN::InputDialog()
|
|||||||
Item->LineShift = BackupShift;
|
Item->LineShift = BackupShift;
|
||||||
(Entries[ScrollState.CurrentSelection]).Row = BackupPos;
|
(Entries[ScrollState.CurrentSelection]).Row = BackupPos;
|
||||||
}
|
}
|
||||||
StyleFunc( MENU_FUNCTION_PAINT_SELECTION, NULL);
|
((*this).*(StyleFunc))( MENU_FUNCTION_PAINT_SELECTION, NULL);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -2495,7 +2495,7 @@ UINTN REFIT_MENU_SCREEN::RunGenericMenu(IN MENU_STYLE_VALUE StyleValue, IN OUT I
|
|||||||
}
|
}
|
||||||
MenuExit = 0;
|
MenuExit = 0;
|
||||||
|
|
||||||
StyleFunc(MENU_FUNCTION_INIT, NULL);
|
((*this).*(StyleFunc))(MENU_FUNCTION_INIT, NULL);
|
||||||
// DBG("scroll inited\n");
|
// DBG("scroll inited\n");
|
||||||
// override the starting selection with the default index, if any
|
// override the starting selection with the default index, if any
|
||||||
if (*DefaultEntryIndex >= 0 && *DefaultEntryIndex <= ScrollState.MaxIndex) {
|
if (*DefaultEntryIndex >= 0 && *DefaultEntryIndex <= ScrollState.MaxIndex) {
|
||||||
@ -2511,16 +2511,16 @@ UINTN REFIT_MENU_SCREEN::RunGenericMenu(IN MENU_STYLE_VALUE StyleValue, IN OUT I
|
|||||||
while (!MenuExit) {
|
while (!MenuExit) {
|
||||||
// update the screen
|
// update the screen
|
||||||
if (ScrollState.PaintAll) {
|
if (ScrollState.PaintAll) {
|
||||||
StyleFunc(MENU_FUNCTION_PAINT_ALL, NULL);
|
((*this).*(StyleFunc))(MENU_FUNCTION_PAINT_ALL, NULL);
|
||||||
ScrollState.PaintAll = FALSE;
|
ScrollState.PaintAll = FALSE;
|
||||||
} else if (ScrollState.PaintSelection) {
|
} else if (ScrollState.PaintSelection) {
|
||||||
StyleFunc(MENU_FUNCTION_PAINT_SELECTION, NULL);
|
((*this).*(StyleFunc))(MENU_FUNCTION_PAINT_SELECTION, NULL);
|
||||||
ScrollState.PaintSelection = FALSE;
|
ScrollState.PaintSelection = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (HaveTimeout) {
|
if (HaveTimeout) {
|
||||||
TimeoutMessage = PoolPrint(L"%s in %d seconds", TimeoutText, TimeoutCountdown);
|
TimeoutMessage = PoolPrint(L"%s in %d seconds", TimeoutText, TimeoutCountdown);
|
||||||
StyleFunc(MENU_FUNCTION_PAINT_TIMEOUT, TimeoutMessage);
|
((*this).*(StyleFunc))(MENU_FUNCTION_PAINT_TIMEOUT, TimeoutMessage);
|
||||||
FreePool(TimeoutMessage);
|
FreePool(TimeoutMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2626,7 +2626,7 @@ UINTN REFIT_MENU_SCREEN::RunGenericMenu(IN MENU_STYLE_VALUE StyleValue, IN OUT I
|
|||||||
}
|
}
|
||||||
if (HaveTimeout) {
|
if (HaveTimeout) {
|
||||||
// the user pressed a key, cancel the timeout
|
// the user pressed a key, cancel the timeout
|
||||||
StyleFunc(MENU_FUNCTION_PAINT_TIMEOUT, L"");
|
((*this).*(StyleFunc))(MENU_FUNCTION_PAINT_TIMEOUT, L"");
|
||||||
HidePointer(); //ycr.ru
|
HidePointer(); //ycr.ru
|
||||||
HaveTimeout = FALSE;
|
HaveTimeout = FALSE;
|
||||||
}
|
}
|
||||||
@ -2651,12 +2651,12 @@ UINTN REFIT_MENU_SCREEN::RunGenericMenu(IN MENU_STYLE_VALUE StyleValue, IN OUT I
|
|||||||
case SCAN_PAGE_UP:
|
case SCAN_PAGE_UP:
|
||||||
UpdateScroll(SCROLL_PAGE_UP);
|
UpdateScroll(SCROLL_PAGE_UP);
|
||||||
// SetNextScreenMode(1);
|
// SetNextScreenMode(1);
|
||||||
StyleFunc(MENU_FUNCTION_INIT, NULL);
|
((*this).*(StyleFunc))(MENU_FUNCTION_INIT, NULL);
|
||||||
break;
|
break;
|
||||||
case SCAN_PAGE_DOWN:
|
case SCAN_PAGE_DOWN:
|
||||||
UpdateScroll(SCROLL_PAGE_DOWN);
|
UpdateScroll(SCROLL_PAGE_DOWN);
|
||||||
// SetNextScreenMode(-1);
|
// SetNextScreenMode(-1);
|
||||||
StyleFunc(MENU_FUNCTION_INIT, NULL);
|
((*this).*(StyleFunc))(MENU_FUNCTION_INIT, NULL);
|
||||||
break;
|
break;
|
||||||
case SCAN_ESC:
|
case SCAN_ESC:
|
||||||
MenuExit = MENU_EXIT_ESCAPE;
|
MenuExit = MENU_EXIT_ESCAPE;
|
||||||
@ -2771,7 +2771,7 @@ UINTN REFIT_MENU_SCREEN::RunGenericMenu(IN MENU_STYLE_VALUE StyleValue, IN OUT I
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
StyleFunc(MENU_FUNCTION_CLEANUP, NULL);
|
((*this).*(StyleFunc))(MENU_FUNCTION_CLEANUP, NULL);
|
||||||
|
|
||||||
if (ChosenEntry) {
|
if (ChosenEntry) {
|
||||||
*ChosenEntry = &Entries[ScrollState.CurrentSelection];
|
*ChosenEntry = &Entries[ScrollState.CurrentSelection];
|
||||||
@ -3424,7 +3424,7 @@ VOID REFIT_MENU_SCREEN::GraphicsMenuStyle(IN UINTN Function, IN CONST CHAR16 *Pa
|
|||||||
|
|
||||||
case MENU_FUNCTION_INIT:
|
case MENU_FUNCTION_INIT:
|
||||||
egGetScreenSize(&UGAWidth, &UGAHeight);
|
egGetScreenSize(&UGAWidth, &UGAHeight);
|
||||||
InitAnime();
|
InitAnime(this); // Should InitAnime be a method of REFIT_MENU_SCREEN ? If yes, parameter will not be needed anymore.
|
||||||
SwitchToGraphicsAndClear();
|
SwitchToGraphicsAndClear();
|
||||||
|
|
||||||
EntriesPosY = ((UGAHeight - (int)(LAYOUT_TOTAL_HEIGHT * GlobalConfig.Scale)) >> 1) + (int)(LayoutBannerOffset * GlobalConfig.Scale) + (TextHeight << 1);
|
EntriesPosY = ((UGAHeight - (int)(LAYOUT_TOTAL_HEIGHT * GlobalConfig.Scale)) >> 1) + (int)(LayoutBannerOffset * GlobalConfig.Scale) + (TextHeight << 1);
|
||||||
@ -3970,7 +3970,7 @@ VOID REFIT_MENU_SCREEN::MainMenuVerticalStyle(IN UINTN Function, IN CONST CHAR16
|
|||||||
|
|
||||||
case MENU_FUNCTION_INIT:
|
case MENU_FUNCTION_INIT:
|
||||||
egGetScreenSize(&UGAWidth, &UGAHeight);
|
egGetScreenSize(&UGAWidth, &UGAHeight);
|
||||||
InitAnime();
|
InitAnime(this); // Should InitAnime be a method of REFIT_MENU_SCREEN ? If yes, parameter will not be needed anymore.
|
||||||
SwitchToGraphicsAndClear();
|
SwitchToGraphicsAndClear();
|
||||||
//BltClearScreen(FALSE);
|
//BltClearScreen(FALSE);
|
||||||
//adjustable by theme.plist?
|
//adjustable by theme.plist?
|
||||||
@ -4119,7 +4119,7 @@ VOID REFIT_MENU_SCREEN::MainMenuStyle(IN UINTN Function, IN CONST CHAR16 *ParamT
|
|||||||
|
|
||||||
case MENU_FUNCTION_INIT:
|
case MENU_FUNCTION_INIT:
|
||||||
egGetScreenSize(&UGAWidth, &UGAHeight);
|
egGetScreenSize(&UGAWidth, &UGAHeight);
|
||||||
InitAnime();
|
InitAnime(this); // Should InitAnime be a method of REFIT_MENU_SCREEN ? If yes, parameter will not be needed anymore.
|
||||||
SwitchToGraphicsAndClear();
|
SwitchToGraphicsAndClear();
|
||||||
//BltClearScreen(FALSE);
|
//BltClearScreen(FALSE);
|
||||||
|
|
||||||
@ -4324,32 +4324,10 @@ UINTN REFIT_MENU_SCREEN::RunMenu(OUT REFIT_ABSTRACT_MENU_ENTRY **ChosenEntry)
|
|||||||
INTN Index = -1;
|
INTN Index = -1;
|
||||||
|
|
||||||
if (AllowGraphicsMode)
|
if (AllowGraphicsMode)
|
||||||
StyleValue = Options;
|
|
||||||
|
return RunGenericMenu(&REFIT_MENU_SCREEN::GraphicsMenuStyle, &Index, ChosenEntry);
|
||||||
else
|
else
|
||||||
StyleValue = Text;
|
return RunGenericMenu(&REFIT_MENU_SCREEN::TextMenuStyle, &Index, ChosenEntry);
|
||||||
|
|
||||||
return RunGenericMenu(StyleValue, &Index, ChosenEntry);
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID REFIT_MENU_SCREEN::StyleFunc(IN UINTN Function, IN CONST CHAR16 *ParamText)
|
|
||||||
{
|
|
||||||
switch (StyleValue) {
|
|
||||||
case Text:
|
|
||||||
TextMenuStyle(Function, ParamText);
|
|
||||||
break;
|
|
||||||
case Options:
|
|
||||||
GraphicsMenuStyle(Function, ParamText);
|
|
||||||
break;
|
|
||||||
case Refit:
|
|
||||||
MainMenuStyle(Function, ParamText);
|
|
||||||
break;
|
|
||||||
case Vertical:
|
|
||||||
MainMenuVerticalStyle(Function, ParamText);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
GraphicsMenuStyle(Function, ParamText);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID NewEntry_(REFIT_ABSTRACT_MENU_ENTRY *Entry, REFIT_MENU_SCREEN **SubScreen, ACTION AtClick, UINTN ID, CONST CHAR8 *Title)
|
VOID NewEntry_(REFIT_ABSTRACT_MENU_ENTRY *Entry, REFIT_MENU_SCREEN **SubScreen, ACTION AtClick, UINTN ID, CONST CHAR8 *Title)
|
||||||
@ -5477,7 +5455,9 @@ VOID OptionsMenu(OUT REFIT_ABSTRACT_MENU_ENTRY **ChosenEntry, IN CHAR8 *LastCho
|
|||||||
UINTN SubMenuExit;
|
UINTN SubMenuExit;
|
||||||
UINTN NextMenuExit;
|
UINTN NextMenuExit;
|
||||||
//CHAR16* Flags;
|
//CHAR16* Flags;
|
||||||
MENU_STYLE_VALUE Style = Text;
|
|
||||||
|
MENU_STYLE_FUNC Style = &REFIT_MENU_SCREEN::TextMenuStyle;
|
||||||
|
|
||||||
INTN EntryIndex = 0;
|
INTN EntryIndex = 0;
|
||||||
INTN SubEntryIndex = -1; //value -1 means old position to remember
|
INTN SubEntryIndex = -1; //value -1 means old position to remember
|
||||||
INTN NextEntryIndex = -1;
|
INTN NextEntryIndex = -1;
|
||||||
@ -5488,7 +5468,7 @@ VOID OptionsMenu(OUT REFIT_ABSTRACT_MENU_ENTRY **ChosenEntry, IN CHAR8 *LastCho
|
|||||||
GlobalConfig.Proportional = FALSE; //temporary disable proportional
|
GlobalConfig.Proportional = FALSE; //temporary disable proportional
|
||||||
|
|
||||||
if (AllowGraphicsMode) {
|
if (AllowGraphicsMode) {
|
||||||
Style = Options;
|
Style = &REFIT_MENU_SCREEN::GraphicsMenuStyle;
|
||||||
}
|
}
|
||||||
|
|
||||||
// remember, if you extended this menu then change procedures
|
// remember, if you extended this menu then change procedures
|
||||||
@ -5539,7 +5519,8 @@ VOID OptionsMenu(OUT REFIT_ABSTRACT_MENU_ENTRY **ChosenEntry, IN CHAR8 *LastCho
|
|||||||
if ((*ChosenEntry)->SubScreen != NULL) {
|
if ((*ChosenEntry)->SubScreen != NULL) {
|
||||||
SubMenuExit = 0;
|
SubMenuExit = 0;
|
||||||
while (!SubMenuExit) {
|
while (!SubMenuExit) {
|
||||||
SubMenuExit = (*ChosenEntry)->SubScreen.RunGenericMenu(Style, &SubEntryIndex, &TmpChosenEntry);
|
|
||||||
|
SubMenuExit = (*ChosenEntry)->SubScreen->RunGenericMenu(Style, &SubEntryIndex, &TmpChosenEntry);
|
||||||
if (SubMenuExit == MENU_EXIT_ESCAPE || TmpChosenEntry->getREFIT_MENU_ITEM_RETURN() ){
|
if (SubMenuExit == MENU_EXIT_ESCAPE || TmpChosenEntry->getREFIT_MENU_ITEM_RETURN() ){
|
||||||
ApplyInputs();
|
ApplyInputs();
|
||||||
ModifyTitles(*ChosenEntry);
|
ModifyTitles(*ChosenEntry);
|
||||||
@ -5549,7 +5530,8 @@ VOID OptionsMenu(OUT REFIT_ABSTRACT_MENU_ENTRY **ChosenEntry, IN CHAR8 *LastCho
|
|||||||
if (TmpChosenEntry->SubScreen != NULL) {
|
if (TmpChosenEntry->SubScreen != NULL) {
|
||||||
NextMenuExit = 0;
|
NextMenuExit = 0;
|
||||||
while (!NextMenuExit) {
|
while (!NextMenuExit) {
|
||||||
NextMenuExit = TmpChosenEntry->SubScreen.RunGenericMenu(Style, &NextEntryIndex, &NextChosenEntry);
|
|
||||||
|
NextMenuExit = TmpChosenEntry->SubScreen->RunGenericMenu(Style, &NextEntryIndex, &NextChosenEntry);
|
||||||
if (NextMenuExit == MENU_EXIT_ESCAPE || NextChosenEntry->getREFIT_MENU_ITEM_RETURN() ){
|
if (NextMenuExit == MENU_EXIT_ESCAPE || NextChosenEntry->getREFIT_MENU_ITEM_RETURN() ){
|
||||||
ApplyInputs();
|
ApplyInputs();
|
||||||
ModifyTitles(TmpChosenEntry);
|
ModifyTitles(TmpChosenEntry);
|
||||||
@ -5638,8 +5620,10 @@ VOID DecodeOptions(REFIT_MENU_ITEM_ABSTRACT_ENTRY_LOADER *Entry)
|
|||||||
|
|
||||||
UINTN REFIT_MENU_SCREEN::RunMainMenu(IN INTN DefaultSelection, OUT REFIT_ABSTRACT_MENU_ENTRY **ChosenEntry)
|
UINTN REFIT_MENU_SCREEN::RunMainMenu(IN INTN DefaultSelection, OUT REFIT_ABSTRACT_MENU_ENTRY **ChosenEntry)
|
||||||
{
|
{
|
||||||
MENU_STYLE_VALUE Style = Text;
|
|
||||||
MENU_STYLE_VALUE MainStyle = Text;
|
MENU_STYLE_FUNC Style = &REFIT_MENU_SCREEN::TextMenuStyle;
|
||||||
|
MENU_STYLE_FUNC MainStyle = &REFIT_MENU_SCREEN::TextMenuStyle;
|
||||||
|
|
||||||
REFIT_ABSTRACT_MENU_ENTRY *TempChosenEntry = 0;
|
REFIT_ABSTRACT_MENU_ENTRY *TempChosenEntry = 0;
|
||||||
REFIT_ABSTRACT_MENU_ENTRY *MainChosenEntry = 0;
|
REFIT_ABSTRACT_MENU_ENTRY *MainChosenEntry = 0;
|
||||||
REFIT_ABSTRACT_MENU_ENTRY *NextChosenEntry = NULL;
|
REFIT_ABSTRACT_MENU_ENTRY *NextChosenEntry = NULL;
|
||||||
@ -5648,11 +5632,11 @@ UINTN REFIT_MENU_SCREEN::RunMainMenu(IN INTN DefaultSelection, OUT REFIT_ABSTRAC
|
|||||||
INTN SubMenuIndex;
|
INTN SubMenuIndex;
|
||||||
|
|
||||||
if (AllowGraphicsMode) {
|
if (AllowGraphicsMode) {
|
||||||
Style = Options;
|
Style = &REFIT_MENU_SCREEN::GraphicsMenuStyle;
|
||||||
if (GlobalConfig.VerticalLayout) {
|
if (GlobalConfig.VerticalLayout) {
|
||||||
MainStyle = Vertical;
|
MainStyle = &REFIT_MENU_SCREEN::MainMenuVerticalStyle;
|
||||||
} else {
|
} else {
|
||||||
MainStyle = Refit;
|
MainStyle = &REFIT_MENU_SCREEN::MainMenuStyle;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user