Put functions back in menu.cpp

This commit is contained in:
Jief L 2020-04-04 15:27:02 +03:00
parent 60282f90a6
commit 3cac160b6d
18 changed files with 4272 additions and 3651 deletions

View File

@ -7,6 +7,18 @@
objects = {
/* Begin PBXBuildFile section */
9A09863124389A6A00826276 /* menu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A09863024389A6A00826276 /* menu.cpp */; };
9A09863224389A6A00826276 /* menu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A09863024389A6A00826276 /* menu.cpp */; };
9A09863324389A6A00826276 /* menu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A09863024389A6A00826276 /* menu.cpp */; };
9A09863424389A6A00826276 /* menu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A09863024389A6A00826276 /* menu.cpp */; };
9A0986372438A15400826276 /* shared_with_menu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A0986352438A15400826276 /* shared_with_menu.cpp */; };
9A0986382438A15400826276 /* shared_with_menu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A0986352438A15400826276 /* shared_with_menu.cpp */; };
9A0986392438A15400826276 /* shared_with_menu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A0986352438A15400826276 /* shared_with_menu.cpp */; };
9A09863A2438A15400826276 /* shared_with_menu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A0986352438A15400826276 /* shared_with_menu.cpp */; };
9A09863B2438A15400826276 /* shared_with_menu.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A0986362438A15400826276 /* shared_with_menu.h */; };
9A09863C2438A15400826276 /* shared_with_menu.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A0986362438A15400826276 /* shared_with_menu.h */; };
9A09863D2438A15400826276 /* shared_with_menu.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A0986362438A15400826276 /* shared_with_menu.h */; };
9A09863E2438A15400826276 /* shared_with_menu.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A0986362438A15400826276 /* shared_with_menu.h */; };
9A28CC93241AB33700F3D247 /* XString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A28CC91241AB33700F3D247 /* XString.cpp */; };
9A28CC94241AB33700F3D247 /* XString.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A28CC92241AB33700F3D247 /* XString.h */; };
9A28CC97241AB34800F3D247 /* XString_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A28CC95241AB34800F3D247 /* XString_test.cpp */; };
@ -850,6 +862,9 @@
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
9A09863024389A6A00826276 /* menu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = menu.cpp; sourceTree = "<group>"; };
9A0986352438A15400826276 /* shared_with_menu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = shared_with_menu.cpp; sourceTree = "<group>"; };
9A0986362438A15400826276 /* shared_with_menu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = shared_with_menu.h; sourceTree = "<group>"; };
9A28CC91241AB33700F3D247 /* XString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XString.cpp; sourceTree = "<group>"; };
9A28CC92241AB33700F3D247 /* XString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XString.h; sourceTree = "<group>"; };
9A28CC95241AB34800F3D247 /* XString_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XString_test.cpp; sourceTree = "<group>"; };
@ -1360,6 +1375,8 @@
9AC77F8D24176C04005CDD5C /* menu_items */,
9AC77F9124176C04005CDD5C /* REFIT_MENU_SCREEN.cpp */,
9AC77F9024176C04005CDD5C /* REFIT_MENU_SCREEN.h */,
9A0986352438A15400826276 /* shared_with_menu.cpp */,
9A0986362438A15400826276 /* shared_with_menu.h */,
);
path = gui;
sourceTree = "<group>";
@ -1386,6 +1403,7 @@
9AC77F9824176C04005CDD5C /* list.h */,
9AC77F9E24176C04005CDD5C /* main.cpp */,
9AC77F9C24176C04005CDD5C /* menu.h */,
9A09863024389A6A00826276 /* menu.cpp */,
9AC77F9424176C04005CDD5C /* screen.cpp */,
9AC77F9D24176C04005CDD5C /* screen.h */,
);
@ -1519,6 +1537,7 @@
9AC7800324176C04005CDD5C /* Hibernate.h in Headers */,
9A28CD35241BC0DF00F3D247 /* strlen_test.h in Headers */,
9AC77FBA24176C04005CDD5C /* XArray_tests.h in Headers */,
9A09863B2438A15400826276 /* shared_with_menu.h in Headers */,
9AC77FFF24176C04005CDD5C /* Handle.h in Headers */,
9AC7809724176C04005CDD5C /* XArray.h in Headers */,
9AC7805D24176C04005CDD5C /* MSPCADB.h in Headers */,
@ -1628,6 +1647,7 @@
9ACFE69A24309AF80071CC93 /* Hibernate.h in Headers */,
9ACFE69B24309AF80071CC93 /* strlen_test.h in Headers */,
9ACFE69C24309AF80071CC93 /* XArray_tests.h in Headers */,
9A09863E2438A15400826276 /* shared_with_menu.h in Headers */,
9ACFE69D24309AF80071CC93 /* Handle.h in Headers */,
9ACFE69E24309AF80071CC93 /* XArray.h in Headers */,
9ACFE69F24309AF80071CC93 /* MSPCADB.h in Headers */,
@ -1687,6 +1707,7 @@
9AF4159F242CD75C00D2644C /* Events.h in Headers */,
9AF415A0242CD75C00D2644C /* printlib-test-cpp_conf.h in Headers */,
9AF415A1242CD75C00D2644C /* XStringWArray.h in Headers */,
9A09863C2438A15400826276 /* shared_with_menu.h in Headers */,
9AF415A2242CD75C00D2644C /* XUINTN.h in Headers */,
9AF415A3242CD75C00D2644C /* strcmp_test.h in Headers */,
9AF415A4242CD75C00D2644C /* boot.h in Headers */,
@ -1794,6 +1815,7 @@
9AF4167C242CDA5800D2644C /* Events.h in Headers */,
9AF4167D242CDA5800D2644C /* printlib-test-cpp_conf.h in Headers */,
9AF4167E242CDA5800D2644C /* XStringWArray.h in Headers */,
9A09863D2438A15400826276 /* shared_with_menu.h in Headers */,
9AF4167F242CDA5800D2644C /* XUINTN.h in Headers */,
9AF41680242CDA5800D2644C /* strcmp_test.h in Headers */,
9AF41681242CDA5800D2644C /* boot.h in Headers */,
@ -2110,12 +2132,14 @@
9AC7807524176C04005CDD5C /* REFIT_MENU_SCREEN.cpp in Sources */,
9AC7801F24176C04005CDD5C /* LegacyBiosThunk.cpp in Sources */,
9A57C25B24192D710029A39F /* XUINTN_test.cpp in Sources */,
9A09863124389A6A00826276 /* menu.cpp in Sources */,
9AC7802024176C04005CDD5C /* string.cpp in Sources */,
9AC7809124176C04005CDD5C /* XStringW.cpp in Sources */,
9AC7806924176C04005CDD5C /* lockedgraphics.cpp in Sources */,
9A28CC97241AB34800F3D247 /* XString_test.cpp in Sources */,
9AC7803724176C04005CDD5C /* device_inject.cpp in Sources */,
9AC7804224176C04005CDD5C /* Settings.cpp in Sources */,
9A0986372438A15400826276 /* shared_with_menu.cpp in Sources */,
9AC7805F24176C04005CDD5C /* legacy.cpp in Sources */,
9AC7800924176C04005CDD5C /* AcpiPatcher.cpp in Sources */,
9AC7800D24176C04005CDD5C /* BdsConnect.cpp in Sources */,
@ -2226,12 +2250,14 @@
9ACFE6ED24309AF80071CC93 /* LegacyBoot.cpp in Sources */,
9ACFE6EE24309AF80071CC93 /* REFIT_MENU_SCREEN.cpp in Sources */,
9ACFE6EF24309AF80071CC93 /* LegacyBiosThunk.cpp in Sources */,
9A09863424389A6A00826276 /* menu.cpp in Sources */,
9ACFE6F024309AF80071CC93 /* XUINTN_test.cpp in Sources */,
9ACFE6F124309AF80071CC93 /* string.cpp in Sources */,
9ACFE6F224309AF80071CC93 /* XStringW.cpp in Sources */,
9ACFE6F324309AF80071CC93 /* lockedgraphics.cpp in Sources */,
9ACFE6F424309AF80071CC93 /* XString_test.cpp in Sources */,
9ACFE6F524309AF80071CC93 /* device_inject.cpp in Sources */,
9A09863A2438A15400826276 /* shared_with_menu.cpp in Sources */,
9ACFE6F624309AF80071CC93 /* Settings.cpp in Sources */,
9ACFE6F724309AF80071CC93 /* legacy.cpp in Sources */,
9ACFE6F824309AF80071CC93 /* AcpiPatcher.cpp in Sources */,
@ -2342,12 +2368,14 @@
9AF41624242CD75C00D2644C /* REFIT_MENU_SCREEN.cpp in Sources */,
9AF41625242CD75C00D2644C /* LegacyBiosThunk.cpp in Sources */,
9AF41626242CD75C00D2644C /* XUINTN_test.cpp in Sources */,
9A09863224389A6A00826276 /* menu.cpp in Sources */,
9AF41627242CD75C00D2644C /* string.cpp in Sources */,
9AF41628242CD75C00D2644C /* XStringW.cpp in Sources */,
9AF41629242CD75C00D2644C /* lockedgraphics.cpp in Sources */,
9AF4162A242CD75C00D2644C /* XString_test.cpp in Sources */,
9AF4162B242CD75C00D2644C /* device_inject.cpp in Sources */,
9AF4162C242CD75C00D2644C /* Settings.cpp in Sources */,
9A0986382438A15400826276 /* shared_with_menu.cpp in Sources */,
9AF4162D242CD75C00D2644C /* legacy.cpp in Sources */,
9AF4162E242CD75C00D2644C /* AcpiPatcher.cpp in Sources */,
9AF4162F242CD75C00D2644C /* BdsConnect.cpp in Sources */,
@ -2458,12 +2486,14 @@
9AF41701242CDA5800D2644C /* REFIT_MENU_SCREEN.cpp in Sources */,
9AF41702242CDA5800D2644C /* LegacyBiosThunk.cpp in Sources */,
9AF41703242CDA5800D2644C /* XUINTN_test.cpp in Sources */,
9A09863324389A6A00826276 /* menu.cpp in Sources */,
9AF41704242CDA5800D2644C /* string.cpp in Sources */,
9AF41705242CDA5800D2644C /* XStringW.cpp in Sources */,
9AF41706242CDA5800D2644C /* lockedgraphics.cpp in Sources */,
9AF41707242CDA5800D2644C /* XString_test.cpp in Sources */,
9AF41708242CDA5800D2644C /* device_inject.cpp in Sources */,
9AF41709242CDA5800D2644C /* Settings.cpp in Sources */,
9A0986392438A15400826276 /* shared_with_menu.cpp in Sources */,
9AF4170A242CDA5800D2644C /* legacy.cpp in Sources */,
9AF4170B242CDA5800D2644C /* AcpiPatcher.cpp in Sources */,
9AF4170C242CDA5800D2644C /* BdsConnect.cpp in Sources */,

View File

@ -1710,8 +1710,8 @@ extern CHAR8 *gDeviceProperties;
extern UINT32 cPropSize;
extern UINT8 *cProperties;
extern CHAR8 *cDeviceProperties;
extern INPUT_ITEM *InputItems;
extern BOOLEAN SavePreBootLog;
//extern INPUT_ITEM *InputItems;
//extern BOOLEAN SavePreBootLog;
extern CHAR8 *BootOSName;
//extern EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
extern UINT64 machineSignature;
@ -1737,11 +1737,11 @@ extern UINT32 devices_number;
//mouse
//extern ACTION gAction;
//extern UINTN gItemID;
extern INTN OldChosenTheme;
extern INTN OldChosenConfig;
extern INTN OldChosenDsdt;
extern UINTN OldChosenAudio;
extern UINT8 DefaultAudioVolume;
//extern INTN OldChosenTheme;
//extern INTN OldChosenConfig;
//extern INTN OldChosenDsdt;
//extern UINTN OldChosenAudio;
//extern UINT8 DefaultAudioVolume;
//CHAR8* orgBiosDsdt;
extern UINT64 BiosDsdt;

View File

@ -32,6 +32,15 @@
//EFI_GUID gRandomUUID = {0x0A0B0C0D, 0x0000, 0x1010, {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07}};
INTN OldChosenTheme;
INTN OldChosenConfig;
INTN OldChosenDsdt;
UINTN OldChosenAudio;
BOOLEAN SavePreBootLog;
UINT8 DefaultAudioVolume;
INTN LayoutBannerOffset = 64;
INTN LayoutTextOffset = 0;
INTN LayoutButtonOffset = 0;
ACPI_PATCHED_AML *ACPIPatchedAML;
SIDELOAD_KEXT *InjectKextList = NULL;
@ -106,11 +115,14 @@ extern MEM_STRUCTURE gRAM;
extern BOOLEAN NeedPMfix;
#if !USE_XTHEME
extern INTN ScrollWidth;
extern INTN ScrollButtonsHeight;
extern INTN ScrollBarDecorationsHeight;
extern INTN ScrollScrollDecorationsHeight;
INTN ScrollButtonsHeight = 20;
//extern INTN ScrollButtonsHeight;
INTN ScrollBarDecorationsHeight = 5;
//extern INTN ScrollBarDecorationsHeight;
INTN ScrollScrollDecorationsHeight = 7;
//extern INTN ScrollScrollDecorationsHeight;
#endif
extern EFI_AUDIO_IO_PROTOCOL *AudioIo;
//extern INTN OldChosenAudio;
/*
typedef struct {

View File

@ -1,3 +1,30 @@
#ifndef __SETTINGS_H__
#define __SETTINGS_H__
extern UINTN AudioNum;
extern HDA_OUTPUTS AudioList[20];
extern CONST CHAR16* ThemesList[100]; //no more then 100 themes?
extern CHAR16* ConfigsList[20];
extern CHAR16* DsdtsList[20];
extern UINTN DsdtsNum;
extern UINTN ThemesNum;
extern UINTN ConfigsNum;
extern INTN ScrollButtonsHeight;
extern INTN ScrollBarDecorationsHeight;
extern INTN ScrollScrollDecorationsHeight;
extern INTN LayoutBannerOffset;
extern INTN LayoutButtonOffset;
extern INTN LayoutTextOffset;
// this should go in a globals, not in settings
extern INTN OldChosenTheme;
extern INTN OldChosenConfig;
extern INTN OldChosenDsdt;
extern UINTN OldChosenAudio;
extern BOOLEAN SavePreBootLog;
extern UINT8 DefaultAudioVolume;
EFI_STATUS
SetFSInjection (
@ -19,3 +46,8 @@ CHAR8
*GetOSVersion (
IN LOADER_ENTRY *Entry
);
#endif

View File

@ -30,6 +30,8 @@
#include "Platform.h"
#include "Settings.h"
extern BOOLEAN DayLight;
extern UINTN AudioNum;
extern HDA_OUTPUTS AudioList[20];

View File

@ -0,0 +1,15 @@
/*
* StartupSound.h
*
* Created on: 4 Apr 2020
* Author: jief
*/
#ifndef PLATFORM_STARTUPSOUND_H_
#define PLATFORM_STARTUPSOUND_H_
extern EFI_AUDIO_IO_PROTOCOL *AudioIo;
#endif /* PLATFORM_STARTUPSOUND_H_ */

View File

@ -1,6 +1,9 @@
#ifndef __REFIT_STRING_H__
#define __REFIT_STRING_H__
extern CHAR8 NonDetected[]; //longer string
/**
Convert a Null-terminated ASCII string representing version number (separate by dots)
to a UINT64 value.

File diff suppressed because it is too large Load Diff

View File

@ -227,6 +227,7 @@ public:
#if USE_XTHEME
VOID DrawMainMenuEntry(REFIT_ABSTRACT_MENU_ENTRY *Entry, BOOLEAN selected, INTN XPos, INTN YPos);
VOID DrawMainMenuLabel(IN CONST XStringW& Text, IN INTN XPos, IN INTN YPos);
INTN DrawTextXY(IN CONST XStringW& Text, IN INTN XPos, IN INTN YPos, IN UINT8 XAlign);
void EraseTextXY();
@ -243,6 +244,7 @@ public:
//Style functions
virtual VOID MainMenuStyle(IN UINTN Function, IN CONST CHAR16 *ParamText);
virtual VOID MainMenuVerticalStyle(IN UINTN Function, IN CONST CHAR16 *ParamText);
virtual VOID GraphicsMenuStyle(IN UINTN Function, IN CONST CHAR16 *ParamText);

View File

@ -0,0 +1,129 @@
/*
* refit/menu.c
* Menu functions
*
* Copyright (c) 2006 Christoph Pfisterer
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of Christoph Pfisterer nor the names of the
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
*
*
* THIS will most likely disappear soon !
*/
#include "../Platform/Platform.h"
#include "../refit/lib.h"
#include "menu_items/menu_items.h"
CONST CHAR16* ArgOptional[NUM_OPT] = {
L"arch=i386", //0
L"arch=x86_64", //1
L"-v ", //2
L"-f ", //3
L"-s ", //4
L"-x ", //5
L"nv_disable=1", //6
L"slide=0", //7
L"darkwake=0", //8
L"-xcpm", //9
L"-gux_no_idle", //10
L"-gux_nosleep", //11
L"-gux_nomsi", //12
L"-gux_defer_usb2", //13
L"keepsyms=1", //14
L"debug=0x100", //15
L"kextlog=0xffff", //16
L"-alcoff", //17
L"-shikioff", //18
L"nvda_drv=1" //19
};
CONST CHAR16 *VBIOS_BIN = L"EFI\\CLOVER\\misc\\c0000.bin";
INPUT_ITEM *InputItems = NULL;
INTN TextStyle; //why global? It will be class SCREEN member
UINT32 EncodeOptions(CONST CHAR16 *Options)
{
UINT32 OptionsBits = 0;
INTN Index;
if (!Options) {
return 0;
}
for (Index = 0; Index < NUM_OPT; Index++) {
if (StrStr(Options, ArgOptional[Index])) {
OptionsBits |= (1 << Index);
if (Index == 1) {
OptionsBits &= ~1;
}
}
}
return OptionsBits;
}
VOID DecodeOptions(REFIT_MENU_ITEM_BOOTNUM *Entry)
{
//set checked option
INTN Index;
if (!Entry) {
return;
}
for (Index = 0; Index < INX_NVWEBON; Index++) { //not including INX_NVWEBON
if (gSettings.OptionsBits & (1 << Index)) {
Entry->LoadOptions = AddLoadOption(Entry->LoadOptions, ArgOptional[Index]);
}
}
//remove unchecked options
for (Index = 0; Index < INX_NVWEBON; Index++) { //not including INX_NVWEBON
if ((gSettings.OptionsBits & (1 << Index)) == 0) {
Entry->LoadOptions = RemoveLoadOption(Entry->LoadOptions, ArgOptional[Index]);
}
}
if (Entry->getLOADER_ENTRY()) {
LOADER_ENTRY* loaderEntry = Entry->getLOADER_ENTRY();
// Only for non-legacy entries, as LEGACY_ENTRY doesn't have OSVersion
if (gSettings.OptionsBits & OPT_NVWEBON) {
if (AsciiOSVersionToUint64(loaderEntry->OSVersion) >= AsciiOSVersionToUint64("10.12")) {
gSettings.NvidiaWeb = TRUE;
} else {
Entry->LoadOptions = AddLoadOption(loaderEntry->LoadOptions, ArgOptional[INX_NVWEBON]);
}
}
if ((gSettings.OptionsBits & OPT_NVWEBON) == 0) {
if (AsciiOSVersionToUint64(loaderEntry->OSVersion) >= AsciiOSVersionToUint64("10.12")) {
gSettings.NvidiaWeb = FALSE;
} else {
Entry->LoadOptions = RemoveLoadOption(loaderEntry->LoadOptions, ArgOptional[INX_NVWEBON]);
}
}
}
}

View File

@ -0,0 +1,27 @@
/*
* shared_with_menu.h
*
* Created on: 4 Apr 2020
* Author: jief
*
* THIS will most likely disappear soon !
*/
#ifndef GUI_SHARED_WITH_MENU_H_
#define GUI_SHARED_WITH_MENU_H_
// clovy - set row height based on text size
#define RowHeightFromTextHeight (1.35f)
extern INTN TextStyle; //why global? It will be class SCREEN member
extern CONST CHAR16 *VBIOS_BIN;
extern INPUT_ITEM *InputItems;
VOID DecodeOptions(REFIT_MENU_ITEM_BOOTNUM *Entry);
UINT32 EncodeOptions(CONST CHAR16 *Options);
#endif /* GUI_SHARED_WITH_MENU_H_ */

View File

@ -28,26 +28,26 @@ extern "C" {
#if !USE_XTHEME
//these are XTHEME members
extern INTN ScrollWidth;
extern INTN ScrollButtonsHeight;
extern INTN ScrollBarDecorationsHeight;
extern INTN ScrollScrollDecorationsHeight;
//extern INTN ScrollWidth;
//extern INTN ScrollButtonsHeight;
//extern INTN ScrollBarDecorationsHeight;
//extern INTN ScrollScrollDecorationsHeight;
//These are SCREEN members
extern EG_RECT UpButton;
extern EG_RECT DownButton;
extern EG_RECT BarStart;
extern EG_RECT BarEnd;
extern EG_RECT ScrollbarBackground;
extern EG_RECT Scrollbar;
extern EG_RECT ScrollStart;
extern EG_RECT ScrollEnd;
extern EG_RECT ScrollTotal;
extern EG_RECT ScrollbarOldPointerPlace;
extern EG_RECT ScrollbarNewPointerPlace;
//extern EG_RECT UpButton;
//extern EG_RECT DownButton;
//extern EG_RECT BarStart;
//extern EG_RECT BarEnd;
//extern EG_RECT ScrollbarBackground;
//extern EG_RECT Scrollbar;
//extern EG_RECT ScrollStart;
//extern EG_RECT ScrollEnd;
//extern EG_RECT ScrollTotal;
//extern EG_RECT ScrollbarOldPointerPlace;
//extern EG_RECT ScrollbarNewPointerPlace;
#endif
//dynamic variables
extern INTN ScrollbarYMovement;
extern BOOLEAN IsDragging;
//extern INTN ScrollbarYMovement;
//extern BOOLEAN IsDragging;
CONST CHAR8* IconsNames[] = {
"func_about",

View File

@ -41,6 +41,7 @@
refit/icns.cpp
refit/lib.cpp
refit/lib.h
refit/menu.cpp
refit/menu.h
refit/screen.cpp
refit/screen.h
@ -70,6 +71,8 @@
gui/menu_items/menu_globals.h
gui/REFIT_MENU_SCREEN.cpp
gui/REFIT_MENU_SCREEN.h
gui/shared_with_menu.cpp
gui/shared_with_menu.h
libeg/egemb_icons.cpp
libeg/egemb_icons_dark.cpp
libeg/egemb_font.cpp

View File

@ -222,20 +222,20 @@ typedef struct _pointers {
//extern BOOLEAN ScrollEnabled;
#if !USE_XTHEME
extern EG_RECT UpButton;
extern EG_RECT DownButton;
extern EG_RECT BarStart;
extern EG_RECT BarEnd;
extern EG_RECT ScrollbarBackground;
extern EG_RECT Scrollbar;
extern EG_RECT ScrollStart;
extern EG_RECT ScrollEnd;
extern EG_RECT ScrollTotal;
extern EG_RECT ScrollbarOldPointerPlace;
extern EG_RECT ScrollbarNewPointerPlace;
//extern EG_RECT UpButton;
//extern EG_RECT DownButton;
//extern EG_RECT BarStart;
//extern EG_RECT BarEnd;
//extern EG_RECT ScrollbarBackground;
//extern EG_RECT Scrollbar;
//extern EG_RECT ScrollStart;
//extern EG_RECT ScrollEnd;
//extern EG_RECT ScrollTotal;
//extern EG_RECT ScrollbarOldPointerPlace;
//extern EG_RECT ScrollbarNewPointerPlace;
#endif
extern INTN ScrollbarYMovement;
extern BOOLEAN IsDragging;
//extern INTN ScrollbarYMovement;
//extern BOOLEAN IsDragging;
#define SCREEN_UNKNOWN 0
#define SCREEN_MAIN 1
@ -416,7 +416,7 @@ extern EFI_FILE *OEMDir;
extern CHAR16 *OEMPath;
extern EFI_FILE *OemThemeDir;
extern BOOLEAN MainAnime;
//extern BOOLEAN MainAnime;
extern GUI_ANIME *GuiAnime;
extern REFIT_VOLUME *SelfVolume;
@ -485,7 +485,7 @@ CHAR16 * egFindExtension(IN CHAR16 *FileName);
INTN FindMem(IN CONST VOID *Buffer, IN UINTN BufferLength, IN CONST VOID *SearchString, IN UINTN SearchStringLength);
CHAR16 *FileDevicePathToStr(IN EFI_DEVICE_PATH_PROTOCOL *DevPath);
//CHAR16 *FileDevicePathToStr(IN EFI_DEVICE_PATH_PROTOCOL *DevPath);
CHAR16 *FileDevicePathFileToStr(IN EFI_DEVICE_PATH_PROTOCOL *DevPath);
//UINTN FileDevicePathNameLen(IN CONST FILEPATH_DEVICE_PATH *FilePath);
@ -533,11 +533,11 @@ extern const EFI_GRAPHICS_OUTPUT_BLT_PIXEL BlackPixel;
#else
extern INTN LayoutBannerOffset;
extern INTN LayoutButtonOffset;
extern INTN LayoutTextOffset;
extern INTN LayoutAnimMoveForMenuX;
extern INTN LayoutMainMenuHeight;
//extern INTN LayoutBannerOffset;
//extern INTN LayoutButtonOffset;
//extern INTN LayoutTextOffset;
//extern INTN LayoutAnimMoveForMenuX;
//extern INTN LayoutMainMenuHeight;
#endif
extern UINTN ConWidth;
extern UINTN ConHeight;

View File

@ -2715,7 +2715,7 @@ RefitMain (IN EFI_HANDLE ImageHandle,
}
GlobalConfig.FastBoot = FALSE; //Hmm... will never be here
}
MainAnime = MainMenu.GetAnime();
BOOLEAN MainAnime = MainMenu.GetAnime();
// DBG("MainAnime=%d\n", MainAnime);
AfterTool = FALSE;
gEvent = 0; //clear to cancel loop

3654
rEFIt_UEFI/refit/menu.cpp Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,8 @@
#ifndef __MENU_H__
#define __MENU_H__
#include "../cpp_foundation/XStringW.h"
#include "../gui/menu_items/menu_items.h"
//VOID AddMenuInfoLine(IN REFIT_MENU_SCREEN *Screen, IN CONST CHAR16 *InfoLine);
//VOID AddMenuInfo(IN REFIT_MENU_SCREEN *SubScreen, IN CONST CHAR16 *Line);
@ -7,6 +12,41 @@
//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);
extern EG_IMAGE* ScrollbarImage;
extern EG_IMAGE* UpButtonImage;
extern EG_IMAGE* DownButtonImage;
extern EG_IMAGE* ScrollbarBackgroundImage;
extern EG_IMAGE* BarStartImage;
extern EG_IMAGE* BarEndImage;
extern EG_IMAGE* ScrollStartImage;
extern EG_IMAGE* ScrollEndImage;
extern EG_RECT UpButton;
extern EG_RECT DownButton;
extern EG_RECT BarStart;
extern EG_RECT BarEnd;
extern EG_RECT ScrollbarBackground;
extern EG_RECT Scrollbar;
extern EG_RECT ScrollStart;
extern EG_RECT ScrollEnd;
extern EG_RECT ScrollTotal;
extern EG_RECT ScrollbarOldPointerPlace;
extern EG_RECT ScrollbarNewPointerPlace;
extern INTN LayoutAnimMoveForMenuX;
extern INTN LayoutMainMenuHeight;
extern INTN ScrollWidth;
VOID InitBar(VOID);
VOID FillRectAreaOfScreen(IN INTN XPos, IN INTN YPos, IN INTN Width, IN INTN Height, IN EG_PIXEL *Color, IN UINT8 XAlign);
VOID InitSelection(VOID);
VOID DrawTextCorner(UINTN TextC, UINT8 Align);
VOID OptionsMenu(OUT REFIT_ABSTRACT_MENU_ENTRY **ChosenEntry);
VOID FreeScrollBar(VOID);
#if USE_XTHEME
@ -16,8 +56,14 @@ VOID DrawMenuText(IN const XStringW& Text, IN INTN SelectedWidth, IN INTN XPos,
#else
INTN DrawTextXY(IN CONST CHAR16 *Text, IN INTN XPos, IN INTN YPos, IN UINT8 XAlign);
VOID DrawMenuText(IN CONST CHAR16 *Text, IN INTN SelectedWidth, IN INTN XPos, IN INTN YPos, IN INTN Cursor);
VOID DrawMainMenuEntry(REFIT_ABSTRACT_MENU_ENTRY *Entry, BOOLEAN selected, INTN XPos, INTN YPos);
#endif
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
#endif

View File

@ -39,6 +39,7 @@
#include "../libeg/libegint.h" // included Platform.h
#include "../libeg/XTheme.h"
#include "../Platform/BasicIO.h"
#include "menu.h"
#ifndef DEBUG_ALL
#define DEBUG_SCR 1