From 45795ccfcc96db1d9ccd5ddf93a58bcb853ff3dd Mon Sep 17 00:00:00 2001 From: jief Date: Mon, 6 Nov 2023 21:53:57 +0100 Subject: [PATCH] Make ThemeX a pointer. --- .../CloverX64.xcodeproj/project.pbxproj | 176 +++++++++++++-- .../xcschemes/CloverX64 SecureBoot.xcscheme | 2 +- .../xcshareddata/xcschemes/CloverX64.xcscheme | 67 ++++++ rEFIt_UEFI/Platform/Settings.cpp | 12 +- rEFIt_UEFI/entry_scan/bootscreen.cpp | 2 +- rEFIt_UEFI/entry_scan/common.cpp | 4 +- rEFIt_UEFI/entry_scan/legacy.cpp | 18 +- rEFIt_UEFI/entry_scan/loader.cpp | 26 +-- rEFIt_UEFI/entry_scan/securemenu.cpp | 6 +- rEFIt_UEFI/entry_scan/tool.cpp | 14 +- rEFIt_UEFI/gui/REFIT_MAINMENU_SCREEN.cpp | 210 +++++++++--------- rEFIt_UEFI/gui/REFIT_MAINMENU_SCREEN.h | 2 +- rEFIt_UEFI/gui/REFIT_MENU_SCREEN.cpp | 196 ++++++++-------- rEFIt_UEFI/gui/menu_items/menu_items.h | 2 +- rEFIt_UEFI/libeg/VectorGraphics.cpp | 8 +- rEFIt_UEFI/libeg/XPointer.cpp | 2 +- rEFIt_UEFI/libeg/XTheme.cpp | 86 +++---- rEFIt_UEFI/libeg/XTheme.h | 2 +- rEFIt_UEFI/libeg/nanosvg.cpp | 16 +- rEFIt_UEFI/libeg/text.cpp | 6 +- rEFIt_UEFI/refit/lib.cpp | 8 +- rEFIt_UEFI/refit/main.cpp | 24 +- rEFIt_UEFI/refit/menu.cpp | 24 +- rEFIt_UEFI/refit/screen.cpp | 10 +- 24 files changed, 566 insertions(+), 357 deletions(-) create mode 100644 Xcode/CloverX64/CloverX64.xcodeproj/xcshareddata/xcschemes/CloverX64.xcscheme diff --git a/Xcode/CloverX64/CloverX64.xcodeproj/project.pbxproj b/Xcode/CloverX64/CloverX64.xcodeproj/project.pbxproj index 8d4e30b04..1bb2a56e5 100644 --- a/Xcode/CloverX64/CloverX64.xcodeproj/project.pbxproj +++ b/Xcode/CloverX64/CloverX64.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 50; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -963,9 +963,6 @@ 9A878C7526186898000B9362 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A8788C826186897000B9362 /* main.cpp */; }; 9A878C7626186898000B9362 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A8788C826186897000B9362 /* main.cpp */; }; 9A878C7726186898000B9362 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A8788C826186897000B9362 /* main.cpp */; }; - 9A878C7B26186898000B9362 /* unicode_conversions.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A8788CC26186897000B9362 /* unicode_conversions.h */; }; - 9A878C7C26186898000B9362 /* unicode_conversions.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A8788CC26186897000B9362 /* unicode_conversions.h */; }; - 9A878C7D26186898000B9362 /* unicode_conversions.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A8788CC26186897000B9362 /* unicode_conversions.h */; }; 9A878C7E26186898000B9362 /* XStringArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A8788CD26186897000B9362 /* XStringArray.cpp */; }; 9A878C7F26186898000B9362 /* XStringArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A8788CD26186897000B9362 /* XStringArray.cpp */; }; 9A878C8026186898000B9362 /* XStringArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A8788CD26186897000B9362 /* XStringArray.cpp */; }; @@ -990,9 +987,6 @@ 9A878C9326186898000B9362 /* XStringAbstract.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A8788D426186897000B9362 /* XStringAbstract.h */; }; 9A878C9426186898000B9362 /* XStringAbstract.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A8788D426186897000B9362 /* XStringAbstract.h */; }; 9A878C9526186898000B9362 /* XStringAbstract.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A8788D426186897000B9362 /* XStringAbstract.h */; }; - 9A878C9626186898000B9362 /* unicode_conversions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A8788D526186897000B9362 /* unicode_conversions.cpp */; }; - 9A878C9726186898000B9362 /* unicode_conversions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A8788D526186897000B9362 /* unicode_conversions.cpp */; }; - 9A878C9826186898000B9362 /* unicode_conversions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A8788D526186897000B9362 /* unicode_conversions.cpp */; }; 9A878C9926186898000B9362 /* XRBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A8788D626186897000B9362 /* XRBuffer.cpp */; }; 9A878C9A26186898000B9362 /* XRBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A8788D626186897000B9362 /* XRBuffer.cpp */; }; 9A878C9B26186898000B9362 /* XRBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A8788D626186897000B9362 /* XRBuffer.cpp */; }; @@ -1013,9 +1007,48 @@ 9A878CAA26186898000B9362 /* XObjArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A8788DB26186897000B9362 /* XObjArray.h */; }; 9A87920326188002000B9362 /* Platform.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A87920126188002000B9362 /* Platform.h */; }; 9A87920426188002000B9362 /* XToolsConf.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A87920226188002000B9362 /* XToolsConf.h */; }; + 9AA992C02996B53C0022C200 /* guid_tests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AA992BF2996B53C0022C200 /* guid_tests.cpp */; }; + 9AA992C12996B53C0022C200 /* guid_tests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AA992BF2996B53C0022C200 /* guid_tests.cpp */; }; + 9AA992C22996B53C0022C200 /* guid_tests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AA992BF2996B53C0022C200 /* guid_tests.cpp */; }; + 9AA992C42996B55C0022C200 /* guid_tests.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AA992C32996B55C0022C200 /* guid_tests.h */; }; + 9AA992C52996B55C0022C200 /* guid_tests.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AA992C32996B55C0022C200 /* guid_tests.h */; }; + 9AA992C62996B55C0022C200 /* guid_tests.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AA992C32996B55C0022C200 /* guid_tests.h */; }; 9ACBC043264484A5001EB94B /* config-test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A8787C926186896000B9362 /* config-test.cpp */; }; 9ACBC044264484A6001EB94B /* config-test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A8787C926186896000B9362 /* config-test.cpp */; }; 9ACBC045264484A6001EB94B /* config-test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A8787C926186896000B9362 /* config-test.cpp */; }; + 9ACD7A2B299302870095F00A /* unicode_conversions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9ACD7A24299302860095F00A /* unicode_conversions.cpp */; }; + 9ACD7A2C299302870095F00A /* unicode_conversions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9ACD7A24299302860095F00A /* unicode_conversions.cpp */; }; + 9ACD7A2D299302870095F00A /* unicode_conversions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9ACD7A24299302860095F00A /* unicode_conversions.cpp */; }; + 9ACD7A31299302870095F00A /* unicode_conversions.h in Headers */ = {isa = PBXBuildFile; fileRef = 9ACD7A26299302860095F00A /* unicode_conversions.h */; }; + 9ACD7A32299302870095F00A /* unicode_conversions.h in Headers */ = {isa = PBXBuildFile; fileRef = 9ACD7A26299302860095F00A /* unicode_conversions.h */; }; + 9ACD7A33299302870095F00A /* unicode_conversions.h in Headers */ = {isa = PBXBuildFile; fileRef = 9ACD7A26299302860095F00A /* unicode_conversions.h */; }; + 9ACD7AAF299303A70095F00A /* FirmwareVolume.c in Sources */ = {isa = PBXBuildFile; fileRef = 9ACD7A56299303710095F00A /* FirmwareVolume.c */; }; + 9ACD7AB0299303A80095F00A /* FirmwareVolume.c in Sources */ = {isa = PBXBuildFile; fileRef = 9ACD7A56299303710095F00A /* FirmwareVolume.c */; }; + 9ACD7AB1299303A80095F00A /* FirmwareVolume.c in Sources */ = {isa = PBXBuildFile; fileRef = 9ACD7A56299303710095F00A /* FirmwareVolume.c */; }; + 9ACD7AB2299303AB0095F00A /* AppleKeyAggregator.h in Headers */ = {isa = PBXBuildFile; fileRef = 9ACD7A99299303710095F00A /* AppleKeyAggregator.h */; }; + 9ACD7AB3299303AC0095F00A /* AppleKeyAggregator.h in Headers */ = {isa = PBXBuildFile; fileRef = 9ACD7A99299303710095F00A /* AppleKeyAggregator.h */; }; + 9ACD7AB4299303AC0095F00A /* AppleKeyAggregator.h in Headers */ = {isa = PBXBuildFile; fileRef = 9ACD7A99299303710095F00A /* AppleKeyAggregator.h */; }; + 9ACD7AB5299303AF0095F00A /* SMCHelper.c in Sources */ = {isa = PBXBuildFile; fileRef = 9ACD7AAE299303710095F00A /* SMCHelper.c */; }; + 9ACD7AB6299303B00095F00A /* SMCHelper.c in Sources */ = {isa = PBXBuildFile; fileRef = 9ACD7AAE299303710095F00A /* SMCHelper.c */; }; + 9ACD7AB7299303B00095F00A /* SMCHelper.c in Sources */ = {isa = PBXBuildFile; fileRef = 9ACD7AAE299303710095F00A /* SMCHelper.c */; }; + 9ACD7AB8299304070095F00A /* AppleKeyAggregator.c in Sources */ = {isa = PBXBuildFile; fileRef = 9ACD7A9B299303710095F00A /* AppleKeyAggregator.c */; }; + 9ACD7AB9299304070095F00A /* AppleKeyAggregator.c in Sources */ = {isa = PBXBuildFile; fileRef = 9ACD7A9B299303710095F00A /* AppleKeyAggregator.c */; }; + 9ACD7ABA299304080095F00A /* AppleKeyAggregator.c in Sources */ = {isa = PBXBuildFile; fileRef = 9ACD7A9B299303710095F00A /* AppleKeyAggregator.c */; }; + 9ACD7AC2299304690095F00A /* load_bmp.c in Sources */ = {isa = PBXBuildFile; fileRef = 9ACD7ABC299304680095F00A /* load_bmp.c */; }; + 9ACD7AC3299304690095F00A /* load_bmp.c in Sources */ = {isa = PBXBuildFile; fileRef = 9ACD7ABC299304680095F00A /* load_bmp.c */; }; + 9ACD7AC4299304690095F00A /* load_bmp.c in Sources */ = {isa = PBXBuildFile; fileRef = 9ACD7ABC299304680095F00A /* load_bmp.c */; }; + 9ACD7AC5299304690095F00A /* AppleImageCodec.c in Sources */ = {isa = PBXBuildFile; fileRef = 9ACD7ABD299304680095F00A /* AppleImageCodec.c */; }; + 9ACD7AC6299304690095F00A /* AppleImageCodec.c in Sources */ = {isa = PBXBuildFile; fileRef = 9ACD7ABD299304680095F00A /* AppleImageCodec.c */; }; + 9ACD7AC7299304690095F00A /* AppleImageCodec.c in Sources */ = {isa = PBXBuildFile; fileRef = 9ACD7ABD299304680095F00A /* AppleImageCodec.c */; }; + 9ACD7AC8299304690095F00A /* picopng.h in Headers */ = {isa = PBXBuildFile; fileRef = 9ACD7ABE299304680095F00A /* picopng.h */; }; + 9ACD7AC9299304690095F00A /* picopng.h in Headers */ = {isa = PBXBuildFile; fileRef = 9ACD7ABE299304680095F00A /* picopng.h */; }; + 9ACD7ACA299304690095F00A /* picopng.h in Headers */ = {isa = PBXBuildFile; fileRef = 9ACD7ABE299304680095F00A /* picopng.h */; }; + 9ACD7ACB299304690095F00A /* load_icns.c in Sources */ = {isa = PBXBuildFile; fileRef = 9ACD7ABF299304680095F00A /* load_icns.c */; }; + 9ACD7ACC299304690095F00A /* load_icns.c in Sources */ = {isa = PBXBuildFile; fileRef = 9ACD7ABF299304680095F00A /* load_icns.c */; }; + 9ACD7ACD299304690095F00A /* load_icns.c in Sources */ = {isa = PBXBuildFile; fileRef = 9ACD7ABF299304680095F00A /* load_icns.c */; }; + 9ACD7ACE299304690095F00A /* picopng.c in Sources */ = {isa = PBXBuildFile; fileRef = 9ACD7AC1299304680095F00A /* picopng.c */; }; + 9ACD7ACF299304690095F00A /* picopng.c in Sources */ = {isa = PBXBuildFile; fileRef = 9ACD7AC1299304680095F00A /* picopng.c */; }; + 9ACD7AD0299304690095F00A /* picopng.c in Sources */ = {isa = PBXBuildFile; fileRef = 9ACD7AC1299304680095F00A /* picopng.c */; }; 9AF1EFEB2634217800F7C2C0 /* SettingsUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AF1EFE92634217800F7C2C0 /* SettingsUtils.h */; }; 9AF1EFEC2634217800F7C2C0 /* SettingsUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AF1EFEA2634217800F7C2C0 /* SettingsUtils.cpp */; }; 9AF4D937263004E200487D15 /* XmlLiteCompositeTypes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AF4D92B263004E100487D15 /* XmlLiteCompositeTypes.cpp */; }; @@ -1389,7 +1422,6 @@ 9A8788C626186897000B9362 /* menu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = menu.h; sourceTree = ""; }; 9A8788C726186897000B9362 /* screen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = screen.h; sourceTree = ""; }; 9A8788C826186897000B9362 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; - 9A8788CC26186897000B9362 /* unicode_conversions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = unicode_conversions.h; sourceTree = ""; }; 9A8788CD26186897000B9362 /* XStringArray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XStringArray.cpp; sourceTree = ""; }; 9A8788CE26186897000B9362 /* XRBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XRBuffer.h; sourceTree = ""; }; 9A8788CF26186897000B9362 /* XStringArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XStringArray.h; sourceTree = ""; }; @@ -1398,7 +1430,6 @@ 9A8788D226186897000B9362 /* XBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XBuffer.h; sourceTree = ""; }; 9A8788D326186897000B9362 /* shared_ptr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = shared_ptr.h; sourceTree = ""; }; 9A8788D426186897000B9362 /* XStringAbstract.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XStringAbstract.h; sourceTree = ""; }; - 9A8788D526186897000B9362 /* unicode_conversions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = unicode_conversions.cpp; sourceTree = ""; }; 9A8788D626186897000B9362 /* XRBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XRBuffer.cpp; sourceTree = ""; }; 9A8788D726186897000B9362 /* XString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XString.cpp; sourceTree = ""; }; 9A8788D826186897000B9362 /* XBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XBuffer.cpp; sourceTree = ""; }; @@ -1407,7 +1438,20 @@ 9A8788DB26186897000B9362 /* XObjArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XObjArray.h; sourceTree = ""; }; 9A87920126188002000B9362 /* Platform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Platform.h; sourceTree = ""; }; 9A87920226188002000B9362 /* XToolsConf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XToolsConf.h; sourceTree = ""; }; + 9AA992BF2996B53C0022C200 /* guid_tests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = guid_tests.cpp; sourceTree = ""; }; + 9AA992C32996B55C0022C200 /* guid_tests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = guid_tests.h; sourceTree = ""; }; 9AC77EC424176BF2005CDD5C /* libCloverX64.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libCloverX64.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 9ACD7A24299302860095F00A /* unicode_conversions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = unicode_conversions.cpp; sourceTree = ""; }; + 9ACD7A26299302860095F00A /* unicode_conversions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = unicode_conversions.h; sourceTree = ""; }; + 9ACD7A56299303710095F00A /* FirmwareVolume.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = FirmwareVolume.c; sourceTree = ""; }; + 9ACD7A99299303710095F00A /* AppleKeyAggregator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppleKeyAggregator.h; sourceTree = ""; }; + 9ACD7A9B299303710095F00A /* AppleKeyAggregator.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = AppleKeyAggregator.c; sourceTree = ""; }; + 9ACD7AAE299303710095F00A /* SMCHelper.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = SMCHelper.c; sourceTree = ""; }; + 9ACD7ABC299304680095F00A /* load_bmp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = load_bmp.c; sourceTree = ""; }; + 9ACD7ABD299304680095F00A /* AppleImageCodec.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = AppleImageCodec.c; sourceTree = ""; }; + 9ACD7ABE299304680095F00A /* picopng.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = picopng.h; sourceTree = ""; }; + 9ACD7ABF299304680095F00A /* load_icns.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = load_icns.c; sourceTree = ""; }; + 9ACD7AC1299304680095F00A /* picopng.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = picopng.c; sourceTree = ""; }; 9AF1EFE92634217800F7C2C0 /* SettingsUtils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SettingsUtils.h; sourceTree = ""; }; 9AF1EFEA2634217800F7C2C0 /* SettingsUtils.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = SettingsUtils.cpp; sourceTree = ""; }; 9AF4165E242CD75C00D2644C /* libCloverX64 DEBUG_ALL=1.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libCloverX64 DEBUG_ALL=1.a"; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -1599,6 +1643,8 @@ 9A8787B126186896000B9362 /* find_replace_mask_OC_tests.h */, 9A8787AA26186896000B9362 /* global_test.cpp */, 9A8787B426186896000B9362 /* global_test.h */, + 9AA992BF2996B53C0022C200 /* guid_tests.cpp */, + 9AA992C32996B55C0022C200 /* guid_tests.h */, 9A8787AF26186896000B9362 /* LoadOptions_test.cpp */, 9A8787CB26186896000B9362 /* LoadOptions_test.h */, 9A8787BB26186896000B9362 /* MacOsVersion_test.cpp */, @@ -1935,10 +1981,10 @@ 9A8788CB26186897000B9362 /* cpp_foundation */ = { isa = PBXGroup; children = ( + 9ACD7A24299302860095F00A /* unicode_conversions.cpp */, + 9ACD7A26299302860095F00A /* unicode_conversions.h */, 9A8788D126186897000B9362 /* shared_ptr.cpp */, 9A8788D326186897000B9362 /* shared_ptr.h */, - 9A8788D526186897000B9362 /* unicode_conversions.cpp */, - 9A8788CC26186897000B9362 /* unicode_conversions.h */, 9A8788DA26186897000B9362 /* XArray.h */, 9A8788D826186897000B9362 /* XBuffer.cpp */, 9A8788D226186897000B9362 /* XBuffer.h */, @@ -1960,6 +2006,7 @@ isa = PBXGroup; children = ( 9A63C6CA24EBEF78000EB836 /* Version.h */, + 9ACD7A40299303700095F00A /* Protocols */, 9AC77EBF24176B1B005CDD5C /* Clover */, 9AC77EC524176BF2005CDD5C /* Products */, ); @@ -1984,6 +2031,55 @@ name = Products; sourceTree = ""; }; + 9ACD7A40299303700095F00A /* Protocols */ = { + isa = PBXGroup; + children = ( + 9ACD7A55299303710095F00A /* FirmwareVolume */, + 9ACD7A98299303710095F00A /* AppleKeyAggregator */, + 9ACD7AAC299303710095F00A /* SMCHelper */, + 9ACD7ABB299304680095F00A /* AppleImageCodec */, + ); + name = Protocols; + path = ../../Protocols; + sourceTree = ""; + }; + 9ACD7A55299303710095F00A /* FirmwareVolume */ = { + isa = PBXGroup; + children = ( + 9ACD7A56299303710095F00A /* FirmwareVolume.c */, + ); + path = FirmwareVolume; + sourceTree = ""; + }; + 9ACD7A98299303710095F00A /* AppleKeyAggregator */ = { + isa = PBXGroup; + children = ( + 9ACD7A99299303710095F00A /* AppleKeyAggregator.h */, + 9ACD7A9B299303710095F00A /* AppleKeyAggregator.c */, + ); + path = AppleKeyAggregator; + sourceTree = ""; + }; + 9ACD7AAC299303710095F00A /* SMCHelper */ = { + isa = PBXGroup; + children = ( + 9ACD7AAE299303710095F00A /* SMCHelper.c */, + ); + path = SMCHelper; + sourceTree = ""; + }; + 9ACD7ABB299304680095F00A /* AppleImageCodec */ = { + isa = PBXGroup; + children = ( + 9ACD7ABC299304680095F00A /* load_bmp.c */, + 9ACD7ABD299304680095F00A /* AppleImageCodec.c */, + 9ACD7ABE299304680095F00A /* picopng.h */, + 9ACD7ABF299304680095F00A /* load_icns.c */, + 9ACD7AC1299304680095F00A /* picopng.c */, + ); + path = AppleImageCodec; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -2014,11 +2110,13 @@ 9A2754D3263802230095D456 /* Config_RtVariables.h in Headers */, 9A878A4D26186897000B9362 /* MacOsVersion.h in Headers */, 9A87890F26186897000B9362 /* posix_additions.h in Headers */, + 9ACD7AB2299303AB0095F00A /* AppleKeyAggregator.h in Headers */, 9A87892426186897000B9362 /* globals_dtor.h in Headers */, 9A878BB826186898000B9362 /* XImage.h in Headers */, 9A8789CF26186897000B9362 /* Handle.h in Headers */, 9A8788FA26186897000B9362 /* wchar.h in Headers */, 9A87896626186897000B9362 /* global_test.h in Headers */, + 9AA992C42996B55C0022C200 /* guid_tests.h in Headers */, 9AF4D94F263004E200487D15 /* XmlLiteDictTypes.h in Headers */, 9A878A7A26186897000B9362 /* kernel_patcher.h in Headers */, 9A8788FD26186897000B9362 /* posix.h in Headers */, @@ -2078,6 +2176,7 @@ 9A878B5826186897000B9362 /* spd.h in Headers */, 9A878ABF26186897000B9362 /* nvidia.h in Headers */, 9AF4D958263004E200487D15 /* XmlLiteCompositeTypes.h in Headers */, + 9ACD7A31299302870095F00A /* unicode_conversions.h in Headers */, 9A878BAC26186898000B9362 /* XCinema.h in Headers */, 9A878ADA26186897000B9362 /* DataHubCpu.h in Headers */, 9A2754AF263802230095D456 /* Config_Devices_Arbitrary.h in Headers */, @@ -2093,7 +2192,6 @@ 9A87896926186897000B9362 /* find_replace_mask_Clover_tests.h in Headers */, 9A8789E426186897000B9362 /* Languages.h in Headers */, 9A878B3126186897000B9362 /* ati_reg.h in Headers */, - 9A878C7B26186898000B9362 /* unicode_conversions.h in Headers */, 9A8789BD26186897000B9362 /* undefinable.h in Headers */, 9A87895D26186897000B9362 /* find_replace_mask_OC_tests.h in Headers */, 9A878BA026186898000B9362 /* EfiFileLib.h in Headers */, @@ -2183,6 +2281,7 @@ 9A878B3726186897000B9362 /* smbios.h in Headers */, 9A878A4426186897000B9362 /* Console.h in Headers */, 9A878B1F26186897000B9362 /* LegacyBiosThunk.h in Headers */, + 9ACD7AC8299304690095F00A /* picopng.h in Headers */, 9A8789C026186897000B9362 /* Devices.h in Headers */, 9A8789C926186897000B9362 /* BootTypes.h in Headers */, 9A7D2E922636B4F300187064 /* CloverVersion.h in Headers */, @@ -2238,6 +2337,7 @@ 9A8789BE26186897000B9362 /* undefinable.h in Headers */, 9AF4D950263004E200487D15 /* XmlLiteDictTypes.h in Headers */, 9A2754C5263802230095D456 /* Config_BootGraphics.h in Headers */, + 9AA992C52996B55C0022C200 /* guid_tests.h in Headers */, 9A8789F426186897000B9362 /* gma.h in Headers */, 9A878A8126186897000B9362 /* card_vlist.h in Headers */, 9AF4D959263004E200487D15 /* XmlLiteCompositeTypes.h in Headers */, @@ -2266,6 +2366,7 @@ 9A8789CD26186897000B9362 /* OSFlags.h in Headers */, 9A878A9626186897000B9362 /* Injectors.h in Headers */, 9A878A0026186897000B9362 /* base64.h in Headers */, + 9ACD7AB3299303AC0095F00A /* AppleKeyAggregator.h in Headers */, 9A87894F26186897000B9362 /* XBuffer_tests.h in Headers */, 9A878BA126186898000B9362 /* EfiFileLib.h in Headers */, 9A275468263801930095D456 /* ConfigManager.h in Headers */, @@ -2282,6 +2383,7 @@ 9A878A7B26186897000B9362 /* kernel_patcher.h in Headers */, 9A878A9026186897000B9362 /* KextList.h in Headers */, 9A878BCB26186898000B9362 /* image.h in Headers */, + 9ACD7AC9299304690095F00A /* picopng.h in Headers */, 9A87897926186897000B9362 /* strcasecmp_test.h in Headers */, 9A87890726186897000B9362 /* stdio.h in Headers */, 9A27545F263801930095D456 /* SelfOem.h in Headers */, @@ -2298,11 +2400,11 @@ 9A2754A7263802230095D456 /* Config_ACPI.h in Headers */, 9A878A6326186897000B9362 /* memvendors.h in Headers */, 9A87894026186897000B9362 /* XToolsCommon_test.h in Headers */, + 9ACD7A32299302870095F00A /* unicode_conversions.h in Headers */, 9A878ACC26186897000B9362 /* BootOptions.h in Headers */, 9AF4D93E263004E200487D15 /* XmlLiteSimpleTypes.h in Headers */, 9A87890A26186897000B9362 /* stdarg.h in Headers */, 9A878A9326186897000B9362 /* Nvram.h in Headers */, - 9A878C7C26186898000B9362 /* unicode_conversions.h in Headers */, 9A8789D026186897000B9362 /* Handle.h in Headers */, 9A878B7726186898000B9362 /* libegint.h in Headers */, 9A878C5826186898000B9362 /* REFIT_MAINMENU_SCREEN.h in Headers */, @@ -2442,6 +2544,7 @@ 9A8789BF26186897000B9362 /* undefinable.h in Headers */, 9AF4D951263004E200487D15 /* XmlLiteDictTypes.h in Headers */, 9A2754C6263802230095D456 /* Config_BootGraphics.h in Headers */, + 9AA992C62996B55C0022C200 /* guid_tests.h in Headers */, 9A8789F526186897000B9362 /* gma.h in Headers */, 9A878A8226186897000B9362 /* card_vlist.h in Headers */, 9AF4D95A263004E200487D15 /* XmlLiteCompositeTypes.h in Headers */, @@ -2470,6 +2573,7 @@ 9A8789CE26186897000B9362 /* OSFlags.h in Headers */, 9A878A9726186897000B9362 /* Injectors.h in Headers */, 9A878A0126186897000B9362 /* base64.h in Headers */, + 9ACD7AB4299303AC0095F00A /* AppleKeyAggregator.h in Headers */, 9A87895026186897000B9362 /* XBuffer_tests.h in Headers */, 9A878BA226186898000B9362 /* EfiFileLib.h in Headers */, 9A275469263801930095D456 /* ConfigManager.h in Headers */, @@ -2486,6 +2590,7 @@ 9A878A7C26186897000B9362 /* kernel_patcher.h in Headers */, 9A878A9126186897000B9362 /* KextList.h in Headers */, 9A878BCC26186898000B9362 /* image.h in Headers */, + 9ACD7ACA299304690095F00A /* picopng.h in Headers */, 9A87897A26186897000B9362 /* strcasecmp_test.h in Headers */, 9A87890826186897000B9362 /* stdio.h in Headers */, 9A275460263801930095D456 /* SelfOem.h in Headers */, @@ -2502,11 +2607,11 @@ 9A2754A8263802230095D456 /* Config_ACPI.h in Headers */, 9A878A6426186897000B9362 /* memvendors.h in Headers */, 9A87894126186897000B9362 /* XToolsCommon_test.h in Headers */, + 9ACD7A33299302870095F00A /* unicode_conversions.h in Headers */, 9A878ACD26186897000B9362 /* BootOptions.h in Headers */, 9AF4D93F263004E200487D15 /* XmlLiteSimpleTypes.h in Headers */, 9A87890B26186897000B9362 /* stdarg.h in Headers */, 9A878A9426186897000B9362 /* Nvram.h in Headers */, - 9A878C7D26186898000B9362 /* unicode_conversions.h in Headers */, 9A8789D126186897000B9362 /* Handle.h in Headers */, 9A878B7826186898000B9362 /* libegint.h in Headers */, 9A878C5926186898000B9362 /* REFIT_MAINMENU_SCREEN.h in Headers */, @@ -2669,7 +2774,7 @@ 9AC77EB924176B08005CDD5C /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1120; + LastUpgradeCheck = 1410; TargetAttributes = { 9AC77EC324176BF2005CDD5C = { CreatedOnToolsVersion = 10.1; @@ -2699,6 +2804,7 @@ /* Begin PBXShellScriptBuildPhase section */ 9AC7809B2417D58C005CDD5C /* ShellScript */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -2761,6 +2867,7 @@ 9A2754E826396F2B0095D456 /* SmbiosFillPatchingValues.cpp in Sources */, 9A878A5C26186897000B9362 /* kext_patcher.cpp in Sources */, 9A87895726186897000B9362 /* LoadOptions_test.cpp in Sources */, + 9ACD7AC2299304690095F00A /* load_bmp.c in Sources */, 9A878A1A26186897000B9362 /* plist.cpp in Sources */, 9A8789F926186897000B9362 /* TagFloat.cpp in Sources */, 9A87893326186897000B9362 /* globals_ctor.cpp in Sources */, @@ -2788,6 +2895,7 @@ 9A878A5626186897000B9362 /* HdaCodecDump.cpp in Sources */, 9A878C9F26186898000B9362 /* XBuffer.cpp in Sources */, 9A878AFB26186897000B9362 /* platformdata.cpp in Sources */, + 9AA992C02996B53C0022C200 /* guid_tests.cpp in Sources */, 9AF4D94C263004E200487D15 /* XmlLiteArrayTypes.cpp in Sources */, 9A878B2B26186897000B9362 /* Events.cpp in Sources */, 9A878A8326186897000B9362 /* AmlGenerator.cpp in Sources */, @@ -2809,6 +2917,7 @@ 9A878B7026186897000B9362 /* BmLib.cpp in Sources */, 9A878C4226186898000B9362 /* securehash.cpp in Sources */, 9A878B6A26186897000B9362 /* Settings.cpp in Sources */, + 9ACD7ACB299304690095F00A /* load_icns.c in Sources */, 9A878B6D26186897000B9362 /* egemb_icons_dark.cpp in Sources */, 9A878B2226186897000B9362 /* VersionString.cpp in Sources */, 9A878B0426186897000B9362 /* MemoryOperation.c in Sources */, @@ -2831,7 +2940,6 @@ 9A878B5526186897000B9362 /* FixBiosDsdt.cpp in Sources */, 9A878A0526186897000B9362 /* base64.cpp in Sources */, 9A8789B426186897000B9362 /* strlen_test.cpp in Sources */, - 9A878C9626186898000B9362 /* unicode_conversions.cpp in Sources */, 9A878A8926186897000B9362 /* BdsConnect.cpp in Sources */, 9A87899926186897000B9362 /* XObjArray_tests.cpp in Sources */, 9A87898A26186897000B9362 /* find_replace_mask_Clover_tests.cpp in Sources */, @@ -2849,9 +2957,11 @@ 9A878BCD26186898000B9362 /* XImage.cpp in Sources */, 9A87895426186897000B9362 /* XBuffer_tests.cpp in Sources */, 9A878BA926186898000B9362 /* nanosvgrast.cpp in Sources */, + 9ACD7A2B299302870095F00A /* unicode_conversions.cpp in Sources */, 9AF4D955263004E200487D15 /* XmlLiteDictTypes.cpp in Sources */, 9AF4D937263004E200487D15 /* XmlLiteCompositeTypes.cpp in Sources */, 9A878AE026186897000B9362 /* BootOptions.cpp in Sources */, + 9ACD7AB8299304070095F00A /* AppleKeyAggregator.c in Sources */, 9A878AE926186897000B9362 /* gma.cpp in Sources */, 9A878C7E26186898000B9362 /* XStringArray.cpp in Sources */, 9A87899F26186897000B9362 /* strncmp_test.cpp in Sources */, @@ -2862,11 +2972,13 @@ 9A878B9426186898000B9362 /* XTheme.cpp in Sources */, 9A87899326186897000B9362 /* all_tests.cpp in Sources */, 9A27549A263802230095D456 /* Config_Quirks.cpp in Sources */, + 9ACD7AC5299304690095F00A /* AppleImageCodec.c in Sources */, 9A878A6E26186897000B9362 /* Utils.cpp in Sources */, 9A878C1526186898000B9362 /* securemenu.cpp in Sources */, 9A878C9926186898000B9362 /* XRBuffer.cpp in Sources */, 9A2755482639DF1B0095D456 /* xml_lite-test.cpp in Sources */, 9AF1EFEC2634217800F7C2C0 /* SettingsUtils.cpp in Sources */, + 9ACD7AB5299303AF0095F00A /* SMCHelper.c in Sources */, 9A2754C7263802230095D456 /* ConfigPlistAbstract.cpp in Sources */, 9A8789AE26186897000B9362 /* XToolsCommon_test.cpp in Sources */, 9A878A0B26186897000B9362 /* TagData.cpp in Sources */, @@ -2885,6 +2997,7 @@ 9A878C2A26186898000B9362 /* lockedgraphics.cpp in Sources */, 9A878C0926186898000B9362 /* secureboot.cpp in Sources */, 9A878B1C26186897000B9362 /* sound.cpp in Sources */, + 9ACD7ACE299304690095F00A /* picopng.c in Sources */, 9A878B6126186897000B9362 /* usbfix.cpp in Sources */, 9A878B4C26186897000B9362 /* guid.cpp in Sources */, 9A7D2E932636B4F300187064 /* CloverVersion.cpp in Sources */, @@ -2894,6 +3007,7 @@ 9A878AF226186897000B9362 /* hda.cpp in Sources */, 9A878AE626186897000B9362 /* kernel_patcher.cpp in Sources */, 9A87897E26186897000B9362 /* strcmp_test.cpp in Sources */, + 9ACD7AAF299303A70095F00A /* FirmwareVolume.c in Sources */, 9A878A0E26186897000B9362 /* TagDict.cpp in Sources */, 9A878B9D26186898000B9362 /* egemb_font.cpp in Sources */, 9A878B9726186898000B9362 /* scroll_images.cpp in Sources */, @@ -2917,6 +3031,7 @@ buildActionMask = 2147483647; files = ( 9A878C7626186898000B9362 /* main.cpp in Sources */, + 9ACD7AC3299304690095F00A /* load_bmp.c in Sources */, 9A878A2126186897000B9362 /* TagInt64.cpp in Sources */, 9A878B4A26186897000B9362 /* KERNEL_AND_KEXT_PATCHES.cpp in Sources */, 9A878A5D26186897000B9362 /* kext_patcher.cpp in Sources */, @@ -2931,6 +3046,7 @@ 9A87897626186897000B9362 /* plist_tests.cpp in Sources */, 9A27546B263801930095D456 /* Self.cpp in Sources */, 9AF4D971263014C600487D15 /* Volume.cpp in Sources */, + 9ACD7A2C299302870095F00A /* unicode_conversions.cpp in Sources */, 9A878A5126186897000B9362 /* LegacyBoot.cpp in Sources */, 9A878C6A26186898000B9362 /* lib.cpp in Sources */, 9A878AF626186897000B9362 /* spd.cpp in Sources */, @@ -2949,18 +3065,22 @@ 9A878AFC26186897000B9362 /* platformdata.cpp in Sources */, 9AF4D94D263004E200487D15 /* XmlLiteArrayTypes.cpp in Sources */, 9A878B2C26186897000B9362 /* Events.cpp in Sources */, + 9ACD7AB0299303A80095F00A /* FirmwareVolume.c in Sources */, 9A878A8426186897000B9362 /* AmlGenerator.cpp in Sources */, 9A878ADE26186897000B9362 /* MacOsVersion.cpp in Sources */, 9A878C6126186898000B9362 /* icns.cpp in Sources */, 9A878C4F26186898000B9362 /* menu_items.cpp in Sources */, 9A878BB326186898000B9362 /* load_icns.cpp in Sources */, 9A2754C8263802230095D456 /* ConfigPlistAbstract.cpp in Sources */, + 9ACD7ACF299304690095F00A /* picopng.c in Sources */, 9A8789BB26186897000B9362 /* find_replace_mask_OC_tests.cpp in Sources */, + 9AA992C12996B53C0022C200 /* guid_tests.cpp in Sources */, 9A8788EC26186897000B9362 /* stdio.cpp in Sources */, 9A878C6426186898000B9362 /* screen.cpp in Sources */, 9A87899D26186897000B9362 /* XArray_tests.cpp in Sources */, 9A275465263801930095D456 /* ConfigManager.cpp in Sources */, 9A878A1526186897000B9362 /* TagDate.cpp in Sources */, + 9ACD7ACC299304690095F00A /* load_icns.c in Sources */, 9A87891F26186897000B9362 /* BootLog.cpp in Sources */, 9AF4D944263004E200487D15 /* XmlLiteSimpleTypes.cpp in Sources */, 9A878B8926186898000B9362 /* text.cpp in Sources */, @@ -2972,6 +3092,7 @@ 9A878B2326186897000B9362 /* VersionString.cpp in Sources */, 9A878B0526186897000B9362 /* MemoryOperation.c in Sources */, 9A878A2426186897000B9362 /* xml.cpp in Sources */, + 9ACD7AB9299304070095F00A /* AppleKeyAggregator.c in Sources */, 9A878ABA26186897000B9362 /* kext_inject.cpp in Sources */, 9A8788EF26186897000B9362 /* abort.cpp in Sources */, 9A878BA426186898000B9362 /* nanosvg.cpp in Sources */, @@ -2986,10 +3107,10 @@ 9A878C3426186898000B9362 /* bootscreen.cpp in Sources */, 9A2755492639DF1B0095D456 /* xml_lite-test.cpp in Sources */, 9A878C0726186898000B9362 /* legacy.cpp in Sources */, + 9ACD7AC6299304690095F00A /* AppleImageCodec.c in Sources */, 9A878B5626186897000B9362 /* FixBiosDsdt.cpp in Sources */, 9A878A0626186897000B9362 /* base64.cpp in Sources */, 9A8789B526186897000B9362 /* strlen_test.cpp in Sources */, - 9A878C9726186898000B9362 /* unicode_conversions.cpp in Sources */, 9A878A8A26186897000B9362 /* BdsConnect.cpp in Sources */, 9A87899A26186897000B9362 /* XObjArray_tests.cpp in Sources */, 9A87898B26186897000B9362 /* find_replace_mask_Clover_tests.cpp in Sources */, @@ -3015,6 +3136,7 @@ 9ACBC044264484A6001EB94B /* config-test.cpp in Sources */, 9A2754E926396F2B0095D456 /* SmbiosFillPatchingValues.cpp in Sources */, 9A878C7F26186898000B9362 /* XStringArray.cpp in Sources */, + 9ACD7AB6299303B00095F00A /* SMCHelper.c in Sources */, 9A8789A026186897000B9362 /* strncmp_test.cpp in Sources */, 9A878BBC26186898000B9362 /* XIcon.cpp in Sources */, 9A8788E926186897000B9362 /* posix_additions.cpp in Sources */, @@ -3075,6 +3197,7 @@ buildActionMask = 2147483647; files = ( 9A878C7726186898000B9362 /* main.cpp in Sources */, + 9ACD7AC4299304690095F00A /* load_bmp.c in Sources */, 9A878A2226186897000B9362 /* TagInt64.cpp in Sources */, 9A878B4B26186897000B9362 /* KERNEL_AND_KEXT_PATCHES.cpp in Sources */, 9A878A5E26186897000B9362 /* kext_patcher.cpp in Sources */, @@ -3089,6 +3212,7 @@ 9A87897726186897000B9362 /* plist_tests.cpp in Sources */, 9A27546C263801930095D456 /* Self.cpp in Sources */, 9AF4D972263014C600487D15 /* Volume.cpp in Sources */, + 9ACD7A2D299302870095F00A /* unicode_conversions.cpp in Sources */, 9A878A5226186897000B9362 /* LegacyBoot.cpp in Sources */, 9A878C6B26186898000B9362 /* lib.cpp in Sources */, 9A878AF726186897000B9362 /* spd.cpp in Sources */, @@ -3107,18 +3231,22 @@ 9A878AFD26186897000B9362 /* platformdata.cpp in Sources */, 9AF4D94E263004E200487D15 /* XmlLiteArrayTypes.cpp in Sources */, 9A878B2D26186897000B9362 /* Events.cpp in Sources */, + 9ACD7AB1299303A80095F00A /* FirmwareVolume.c in Sources */, 9A878A8526186897000B9362 /* AmlGenerator.cpp in Sources */, 9A878ADF26186897000B9362 /* MacOsVersion.cpp in Sources */, 9A878C6226186898000B9362 /* icns.cpp in Sources */, 9A878C5026186898000B9362 /* menu_items.cpp in Sources */, 9A878BB426186898000B9362 /* load_icns.cpp in Sources */, 9A2754C9263802230095D456 /* ConfigPlistAbstract.cpp in Sources */, + 9ACD7AD0299304690095F00A /* picopng.c in Sources */, 9A8789BC26186897000B9362 /* find_replace_mask_OC_tests.cpp in Sources */, + 9AA992C22996B53C0022C200 /* guid_tests.cpp in Sources */, 9A8788ED26186897000B9362 /* stdio.cpp in Sources */, 9A878C6526186898000B9362 /* screen.cpp in Sources */, 9A87899E26186897000B9362 /* XArray_tests.cpp in Sources */, 9A275466263801930095D456 /* ConfigManager.cpp in Sources */, 9A878A1626186897000B9362 /* TagDate.cpp in Sources */, + 9ACD7ACD299304690095F00A /* load_icns.c in Sources */, 9A87892026186897000B9362 /* BootLog.cpp in Sources */, 9AF4D945263004E200487D15 /* XmlLiteSimpleTypes.cpp in Sources */, 9A878B8A26186898000B9362 /* text.cpp in Sources */, @@ -3130,6 +3258,7 @@ 9A878B2426186897000B9362 /* VersionString.cpp in Sources */, 9A878B0626186897000B9362 /* MemoryOperation.c in Sources */, 9A878A2526186897000B9362 /* xml.cpp in Sources */, + 9ACD7ABA299304080095F00A /* AppleKeyAggregator.c in Sources */, 9A878ABB26186897000B9362 /* kext_inject.cpp in Sources */, 9A8788F026186897000B9362 /* abort.cpp in Sources */, 9A878BA526186898000B9362 /* nanosvg.cpp in Sources */, @@ -3144,10 +3273,10 @@ 9A878C3526186898000B9362 /* bootscreen.cpp in Sources */, 9A27554A2639DF1C0095D456 /* xml_lite-test.cpp in Sources */, 9A878C0826186898000B9362 /* legacy.cpp in Sources */, + 9ACD7AC7299304690095F00A /* AppleImageCodec.c in Sources */, 9A878B5726186897000B9362 /* FixBiosDsdt.cpp in Sources */, 9A878A0726186897000B9362 /* base64.cpp in Sources */, 9A8789B626186897000B9362 /* strlen_test.cpp in Sources */, - 9A878C9826186898000B9362 /* unicode_conversions.cpp in Sources */, 9A878A8B26186897000B9362 /* BdsConnect.cpp in Sources */, 9A87899B26186897000B9362 /* XObjArray_tests.cpp in Sources */, 9A87898C26186897000B9362 /* find_replace_mask_Clover_tests.cpp in Sources */, @@ -3173,6 +3302,7 @@ 9ACBC045264484A6001EB94B /* config-test.cpp in Sources */, 9A2754EA26396F2B0095D456 /* SmbiosFillPatchingValues.cpp in Sources */, 9A878C8026186898000B9362 /* XStringArray.cpp in Sources */, + 9ACD7AB7299303B00095F00A /* SMCHelper.c in Sources */, 9A8789A126186897000B9362 /* strncmp_test.cpp in Sources */, 9A878BBD26186898000B9362 /* XIcon.cpp in Sources */, 9A8788EA26186897000B9362 /* posix_additions.cpp in Sources */, @@ -3248,11 +3378,13 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + DEAD_CODE_STRIPPING = YES; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_ENABLE_CPP_EXCEPTIONS = NO; @@ -3364,11 +3496,13 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + DEAD_CODE_STRIPPING = YES; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_ENABLE_CPP_EXCEPTIONS = NO; @@ -3481,6 +3615,7 @@ CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = NO; ENABLE_TESTABILITY = YES; @@ -3542,6 +3677,7 @@ CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = NO; @@ -3596,6 +3732,7 @@ CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = NO; ENABLE_TESTABILITY = YES; @@ -3657,6 +3794,7 @@ CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = NO; @@ -3709,6 +3847,7 @@ CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = NO; ENABLE_TESTABILITY = YES; @@ -3769,6 +3908,7 @@ CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = NO; diff --git a/Xcode/CloverX64/CloverX64.xcodeproj/xcshareddata/xcschemes/CloverX64 SecureBoot.xcscheme b/Xcode/CloverX64/CloverX64.xcodeproj/xcshareddata/xcschemes/CloverX64 SecureBoot.xcscheme index 090c7639d..1a330b390 100644 --- a/Xcode/CloverX64/CloverX64.xcodeproj/xcshareddata/xcschemes/CloverX64 SecureBoot.xcscheme +++ b/Xcode/CloverX64/CloverX64.xcodeproj/xcshareddata/xcschemes/CloverX64 SecureBoot.xcscheme @@ -1,6 +1,6 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/rEFIt_UEFI/Platform/Settings.cpp b/rEFIt_UEFI/Platform/Settings.cpp index 5a601cf90..b911e05a4 100755 --- a/rEFIt_UEFI/Platform/Settings.cpp +++ b/rEFIt_UEFI/Platform/Settings.cpp @@ -411,19 +411,19 @@ void afterGetUserSettings(SETTINGS_DATA& settingsData) for ( size_t idx = 0 ; idx < settingsData.GUI.CustomLegacySettings.size() ; ++idx ) { const CUSTOM_LEGACY_ENTRY_SETTINGS& CustomLegacySettings = settingsData.GUI.CustomLegacySettings[idx]; - CUSTOM_LEGACY_ENTRY* entry = new CUSTOM_LEGACY_ENTRY(CustomLegacySettings, ThemeX.getThemeDir()); + CUSTOM_LEGACY_ENTRY* entry = new CUSTOM_LEGACY_ENTRY(CustomLegacySettings, ThemeX->getThemeDir()); GlobalConfig.CustomLegacyEntries.AddReference(entry, true); } for ( size_t idx = 0 ; idx < settingsData.GUI.CustomToolSettings.size() ; ++idx ) { const CUSTOM_TOOL_ENTRY_SETTINGS& CustomToolSettings = settingsData.GUI.CustomToolSettings[idx]; - CUSTOM_TOOL_ENTRY* entry = new CUSTOM_TOOL_ENTRY(CustomToolSettings, ThemeX.getThemeDir()); + CUSTOM_TOOL_ENTRY* entry = new CUSTOM_TOOL_ENTRY(CustomToolSettings, ThemeX->getThemeDir()); GlobalConfig.CustomToolsEntries.AddReference(entry, true); } if ( settingsData.GUI.Theme.notEmpty() ) { - ThemeX.Theme.takeValueFrom(settingsData.GUI.Theme); + ThemeX->Theme.takeValueFrom(settingsData.GUI.Theme); DBG("Default theme: %ls\n", settingsData.GUI.Theme.wc_str()); OldChosenTheme = 0xFFFF; //default for embedded @@ -442,12 +442,12 @@ void afterGetUserSettings(SETTINGS_DATA& settingsData) INT32 NowHour = Now.Hour + settingsData.GUI.Timezone; if (NowHour < 0 ) NowHour += 24; if (NowHour >= 24 ) NowHour -= 24; - ThemeX.Daylight = (NowHour > 8) && (NowHour < 20); + ThemeX->Daylight = (NowHour > 8) && (NowHour < 20); } else { - ThemeX.Daylight = true; + ThemeX->Daylight = true; } - ThemeX.DarkEmbedded = settingsData.GUI.getDarkEmbedded(ThemeX.Daylight); + ThemeX->DarkEmbedded = settingsData.GUI.getDarkEmbedded(ThemeX->Daylight); if ( settingsData.GUI.languageCode == english ) { GlobalConfig.Codepage = 0xC0; diff --git a/rEFIt_UEFI/entry_scan/bootscreen.cpp b/rEFIt_UEFI/entry_scan/bootscreen.cpp index 7cb1e69ae..ff5daff16 100644 --- a/rEFIt_UEFI/entry_scan/bootscreen.cpp +++ b/rEFIt_UEFI/entry_scan/bootscreen.cpp @@ -761,7 +761,7 @@ EFI_STATUS InitBootScreen(IN LOADER_ENTRY *Entry) case CUSTOM_BOOT_THEME: // TODO: Custom boot theme DBG("Custom boot is using theme logo\n"); - ThemeX.ClearScreen(); + ThemeX->ClearScreen(); return EFI_SUCCESS; case CUSTOM_BOOT_USER: diff --git a/rEFIt_UEFI/entry_scan/common.cpp b/rEFIt_UEFI/entry_scan/common.cpp index f6ff12043..acd243e47 100644 --- a/rEFIt_UEFI/entry_scan/common.cpp +++ b/rEFIt_UEFI/entry_scan/common.cpp @@ -113,10 +113,10 @@ const XIcon& ScanVolumeDefaultIcon(REFIT_VOLUME *Volume, IN UINT8 OSType, const break; } // DBG("asked IconNum = %llu Volume->DiskKind=%d OSType=%d\n", IconNum, Volume->DiskKind, OSType); - IconX = &ThemeX.GetIcon(IconNum); //asked IconNum = BUILTIN_ICON_VOL_INTERNAL_HFS, got day icon + IconX = &ThemeX->GetIcon(IconNum); //asked IconNum = BUILTIN_ICON_VOL_INTERNAL_HFS, got day icon if (IconX->Image.isEmpty()) { DBG("asked Icon %s not found, took internal\n", IconsNames[IconNum]); - IconX = &ThemeX.GetIcon(BUILTIN_ICON_VOL_INTERNAL); //including embedded which is really present + IconX = &ThemeX->GetIcon(BUILTIN_ICON_VOL_INTERNAL); //including embedded which is really present } return *IconX; diff --git a/rEFIt_UEFI/entry_scan/legacy.cpp b/rEFIt_UEFI/entry_scan/legacy.cpp index 58e03565a..15119a932 100755 --- a/rEFIt_UEFI/entry_scan/legacy.cpp +++ b/rEFIt_UEFI/entry_scan/legacy.cpp @@ -114,7 +114,7 @@ DBG(" Volume->LegacyOS->Name=%ls\n", Volume->LegacyOS->Name.wc_str()); if ( FullTitle.notEmpty() ) { Entry->Title = FullTitle; } else { - if (ThemeX.BootCampStyle) { + if (ThemeX->BootCampStyle) { Entry->Title = LTitle; } else { Entry->Title.SWPrintf("Boot %ls from %ls", LoaderTitle.wc_str(), VolDesc.wc_str()); @@ -128,9 +128,9 @@ DBG(" Volume->LegacyOS->Name=%ls\n", Volume->LegacyOS->Name.wc_str()); if ( Image && !Image->isEmpty() ) { Entry->Image = *Image; } else { - Entry->Image = ThemeX.LoadOSIcon(Volume->LegacyOS->IconName); + Entry->Image = ThemeX->LoadOSIcon(Volume->LegacyOS->IconName); if (Entry->Image.Image.isEmpty()) { - Entry->Image = ThemeX.GetIcon("os_win"_XS8); //we have no legacy.png + Entry->Image = ThemeX->GetIcon("os_win"_XS8); //we have no legacy.png } } @@ -144,11 +144,11 @@ DBG(" Volume->LegacyOS->Name=%ls\n", Volume->LegacyOS->Name.wc_str()); Entry->AtClick = ActionSelect; Entry->AtDoubleClick = ActionEnter; Entry->AtRightClick = ActionDetails; - if (ThemeX.HideBadges & HDBADGES_SHOW) { - if (ThemeX.HideBadges & HDBADGES_SWAP) { //will be scaled later - Entry->BadgeImage.Image = XImage(Entry->DriveImage.Image, 0); //ThemeX.BadgeScale/16.f); //0 accepted + if (ThemeX->HideBadges & HDBADGES_SHOW) { + if (ThemeX->HideBadges & HDBADGES_SWAP) { //will be scaled later + Entry->BadgeImage.Image = XImage(Entry->DriveImage.Image, 0); //ThemeX->BadgeScale/16.f); //0 accepted } else { - Entry->BadgeImage.Image = XImage(Entry->Image.Image, 0); //ThemeX.BadgeScale/16.f); + Entry->BadgeImage.Image = XImage(Entry->Image.Image, 0); //ThemeX->BadgeScale/16.f); } } Entry->Volume = Volume; @@ -374,13 +374,13 @@ void AddCustomLegacy(void) // Change to custom image if needed MainIcon = Custom.Image; if (MainIcon.Image.isEmpty()) { - MainIcon.Image.LoadXImage(&ThemeX.getThemeDir(), Custom.settings.ImagePath); + MainIcon.Image.LoadXImage(&ThemeX->getThemeDir(), Custom.settings.ImagePath); } // Change to custom drive image if needed DriveIcon = Custom.DriveImage; if (DriveIcon.Image.isEmpty()) { - DriveIcon.Image.LoadXImage(&ThemeX.getThemeDir(), Custom.settings.DriveImagePath); + DriveIcon.Image.LoadXImage(&ThemeX->getThemeDir(), Custom.settings.DriveImagePath); } // Create a legacy entry for this volume DBG("\n"); diff --git a/rEFIt_UEFI/entry_scan/loader.cpp b/rEFIt_UEFI/entry_scan/loader.cpp index b88a331d5..75088c8c9 100644 --- a/rEFIt_UEFI/entry_scan/loader.cpp +++ b/rEFIt_UEFI/entry_scan/loader.cpp @@ -1133,7 +1133,7 @@ if ( Entry->APFSTargetUUID.Data1 == 0x99999999 ) { } } - XBool BootCampStyle = ThemeX.BootCampStyle; + XBool BootCampStyle = ThemeX->BootCampStyle; if ( Entry->Title.isEmpty() && Entry->DisplayedVolName.isEmpty() ) { XStringW BasenameXW = XStringW(Basename(Volume->DevicePathString.wc_str())); @@ -1186,7 +1186,7 @@ if ( Entry->APFSTargetUUID.Data1 == 0x99999999 ) { } else if (Image) { Entry->Image = *Image; //copy image from temporary storage } else { - Entry->Image = ThemeX.LoadOSIcon(OSIconName); + Entry->Image = ThemeX->LoadOSIcon(OSIconName); } // DBG("Load DriveImage\n"); // Load DriveImage @@ -1196,9 +1196,9 @@ if ( Entry->APFSTargetUUID.Data1 == 0x99999999 ) { } else { Entry->DriveImage = ScanVolumeDefaultIcon(Volume, Entry->LoaderType, Volume->DevicePath); } -// DBG("HideBadges=%llu Volume=%ls ", ThemeX.HideBadges, Volume->VolName); - if (ThemeX.HideBadges & HDBADGES_SHOW) { - if (ThemeX.HideBadges & HDBADGES_SWAP) { +// DBG("HideBadges=%llu Volume=%ls ", ThemeX->HideBadges, Volume->VolName); + if (ThemeX->HideBadges & HDBADGES_SHOW) { + if (ThemeX->HideBadges & HDBADGES_SWAP) { Entry->BadgeImage.Image = XImage(Entry->DriveImage.Image, 0); DBG("%sShow badge as Drive.\n", indent); } else { @@ -1485,10 +1485,10 @@ STATIC void LinuxScan(REFIT_VOLUME *Volume, UINT8 KernelScan, UINT8 Type, XStrin LoaderTitle.upperAscii(); LoaderTitle += OSName.subString(1, OSName.length()) + L" Linux"_XSW; // Very few linux icons exist in IconNames, but these few may be preloaded, so check that first - XIcon ImageX = ThemeX.GetIcon(L"os_"_XSW + OSName); //will the image be destroyed or rewritten by next image after the cycle end? + XIcon ImageX = ThemeX->GetIcon(L"os_"_XSW + OSName); //will the image be destroyed or rewritten by next image after the cycle end? if (ImageX.isEmpty()) { // no preloaded icon, try to load from dir - ImageX.LoadXImage(&ThemeX.getThemeDir(), L"os_"_XSW + OSName); + ImageX.LoadXImage(&ThemeX->getThemeDir(), L"os_"_XSW + OSName); } if (CustomPath) { *CustomPath = File; @@ -1509,9 +1509,9 @@ STATIC void LinuxScan(REFIT_VOLUME *Volume, UINT8 KernelScan, UINT8 Type, XStrin if (FileExists(Volume->RootDir, LinuxEntryData[Index].Path)) { XStringW OSIconName = XStringW().takeValueFrom(LinuxEntryData[Index].Icon); OSIconName = OSIconName.subString(0, OSIconName.indexOf(',')); - XIcon ImageX = ThemeX.GetIcon(L"os_"_XSW + OSIconName); + XIcon ImageX = ThemeX->GetIcon(L"os_"_XSW + OSIconName); if (ImageX.isEmpty()) { - ImageX.LoadXImage(&ThemeX.getThemeDir(), L"os_"_XSW + OSIconName); + ImageX.LoadXImage(&ThemeX->getThemeDir(), L"os_"_XSW + OSIconName); } if (CustomPath) { *CustomPath = LinuxEntryData[Index].Path; @@ -1930,7 +1930,7 @@ void ScanLoader(void) if (aFound && (aFound == aIndex)) { XIcon ImageX; XStringW IconXSW = XStringW().takeValueFrom(AndroidEntryData[Index].Icon); - ImageX.LoadXImage(&ThemeX.getThemeDir(), (L"os_"_XSW + IconXSW.subString(0, IconXSW.indexOf(','))).wc_str()); + ImageX.LoadXImage(&ThemeX->getThemeDir(), (L"os_"_XSW + IconXSW.subString(0, IconXSW.indexOf(','))).wc_str()); AddLoaderEntry(AndroidEntryData[Index].Path, NullXString8Array, L""_XSW, XStringW().takeValueFrom(AndroidEntryData[Index].Title), Volume, (ImageX.isEmpty() ? NULL : &ImageX), OSTYPE_LIN, OSFLAG_NODEFAULTARGS); } @@ -2475,9 +2475,9 @@ STATIC void AddCustomEntry(IN UINTN CustomIndex, // Change to custom image if needed if (Image.isEmpty() && Custom.settings.dgetImagePath().notEmpty()) { - Image.LoadXImage(&ThemeX.getThemeDir(), Custom.settings.dgetImagePath()); + Image.LoadXImage(&ThemeX->getThemeDir(), Custom.settings.dgetImagePath()); if (Image.isEmpty()) { - Image.LoadXImage(&ThemeX.getThemeDir(), L"os_"_XSW + Custom.settings.dgetImagePath()); + Image.LoadXImage(&ThemeX->getThemeDir(), L"os_"_XSW + Custom.settings.dgetImagePath()); if (Image.isEmpty()) { Image.LoadXImage(&self.getCloverDir(), Custom.settings.dgetImagePath()); if (Image.isEmpty()) { @@ -2492,7 +2492,7 @@ STATIC void AddCustomEntry(IN UINTN CustomIndex, // Change to custom drive image if needed if (DriveImage.isEmpty() && Custom.settings.dgetDriveImagePath().notEmpty()) { - DriveImage.LoadXImage(&ThemeX.getThemeDir(), Custom.settings.dgetDriveImagePath()); + DriveImage.LoadXImage(&ThemeX->getThemeDir(), Custom.settings.dgetDriveImagePath()); if (DriveImage.isEmpty()) { DriveImage.LoadXImage(&self.getCloverDir(), Custom.settings.dgetImagePath()); if (DriveImage.isEmpty()) { diff --git a/rEFIt_UEFI/entry_scan/securemenu.cpp b/rEFIt_UEFI/entry_scan/securemenu.cpp index f353de8de..5d68968b1 100644 --- a/rEFIt_UEFI/entry_scan/securemenu.cpp +++ b/rEFIt_UEFI/entry_scan/securemenu.cpp @@ -82,13 +82,13 @@ void AddSecureBootTool(void) // Entry = new REFIT_MENU_ENTRY_SECURE_BOOT; // Entry->Title.SWPrintf("Clover Secure Boot Configuration"); //// Entry->Tag = TAG_SECURE_BOOT_CONFIG; -// Entry->Image = ThemeX.GetIcon(BUILTIN_ICON_FUNC_SECURE_BOOT_CONFIG); +// Entry->Image = ThemeX->GetIcon(BUILTIN_ICON_FUNC_SECURE_BOOT_CONFIG); // // } else { // Entry = new REFIT_MENU_ENTRY_SECURE_BOOT_CONFIG; // Entry->Title.SWPrintf("Enable Clover Secure Boot"); //// Entry->Tag = TAG_SECURE_BOOT; -// Entry->Image = ThemeX.GetIcon(BUILTIN_ICON_FUNC_SECURE_BOOT); +// Entry->Image = ThemeX->GetIcon(BUILTIN_ICON_FUNC_SECURE_BOOT); // } //----- not done yet ---------- @@ -137,7 +137,7 @@ UINTN QuerySecureBootUser(IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath) if (gThemeNeedInit) { UINTN Size = 0; InitTheme((CHAR8*)GetNvramVariable(L"Clover.Theme", gEfiAppleBootGuid, NULL, &Size)); - ThemeX.ClearScreen(); + ThemeX->ClearScreen(); gThemeNeedInit = false; } gGuiIsReady = true; diff --git a/rEFIt_UEFI/entry_scan/tool.cpp b/rEFIt_UEFI/entry_scan/tool.cpp index 1e606f959..3ec31312a 100755 --- a/rEFIt_UEFI/entry_scan/tool.cpp +++ b/rEFIt_UEFI/entry_scan/tool.cpp @@ -129,7 +129,7 @@ STATIC void AddCloverEntry(IN CONST XStringW& LoaderPath, IN CONST CHAR16 *Loade // Entry->Tag = TAG_CLOVER; Entry->Row = 1; Entry->ShortcutLetter = 'C'; - Entry->Image = ThemeX.GetIcon(BUILTIN_ICON_FUNC_CLOVER); + Entry->Image = ThemeX->GetIcon(BUILTIN_ICON_FUNC_CLOVER); Entry->Volume = Volume; Entry->LoaderPath = LoaderPath; Entry->VolName = Volume->VolName; @@ -195,13 +195,13 @@ void ScanTool(void) UINTN VolumeIndex; REFIT_VOLUME *Volume; void *Interface; - if (ThemeX.HideUIFlags & HIDEUI_FLAG_TOOLS) + if (ThemeX->HideUIFlags & HIDEUI_FLAG_TOOLS) return; // DBG("Scanning for tools...\n"); - if (!(ThemeX.HideUIFlags & HIDEUI_FLAG_SHELL)) { - if (!AddToolEntry(SWPrintf("%ls\\tools\\Shell64U.efi", self.getCloverDirFullPath().wc_str()), NULL, L"UEFI Shell 64", SelfVolume, ThemeX.GetIcon(BUILTIN_ICON_TOOL_SHELL), 'S', NullXString8Array)) { - AddToolEntry(SWPrintf("%ls\\tools\\Shell64.efi", self.getCloverDirFullPath().wc_str()), NULL, L"EFI Shell 64", SelfVolume, ThemeX.GetIcon(BUILTIN_ICON_TOOL_SHELL), 'S', NullXString8Array); + if (!(ThemeX->HideUIFlags & HIDEUI_FLAG_SHELL)) { + if (!AddToolEntry(SWPrintf("%ls\\tools\\Shell64U.efi", self.getCloverDirFullPath().wc_str()), NULL, L"UEFI Shell 64", SelfVolume, ThemeX->GetIcon(BUILTIN_ICON_TOOL_SHELL), 'S', NullXString8Array)) { + AddToolEntry(SWPrintf("%ls\\tools\\Shell64.efi", self.getCloverDirFullPath().wc_str()), NULL, L"EFI Shell 64", SelfVolume, ThemeX->GetIcon(BUILTIN_ICON_TOOL_SHELL), 'S', NullXString8Array); } } @@ -304,11 +304,11 @@ void AddCustomTool(void) // Change to custom image if needed Image = Custom.Image; if (Image.isEmpty() && Custom.settings.ImagePath.notEmpty()) { - Image.LoadXImage(&ThemeX.getThemeDir(), Custom.settings.ImagePath); + Image.LoadXImage(&ThemeX->getThemeDir(), Custom.settings.ImagePath); } DBG("match!\n"); if (Image.isEmpty()) { - AddToolEntry(Custom.settings.Path, Custom.settings.FullTitle.wc_str(), Custom.settings.Title.wc_str(), Volume, ThemeX.GetIcon(BUILTIN_ICON_TOOL_SHELL), Custom.settings.Hotkey, Custom.getLoadOptions()); + AddToolEntry(Custom.settings.Path, Custom.settings.FullTitle.wc_str(), Custom.settings.Title.wc_str(), Volume, ThemeX->GetIcon(BUILTIN_ICON_TOOL_SHELL), Custom.settings.Hotkey, Custom.getLoadOptions()); } else { // Create a legacy entry for this volume AddToolEntry(Custom.settings.Path, Custom.settings.FullTitle.wc_str(), Custom.settings.Title.wc_str(), Volume, Image, Custom.settings.Hotkey, Custom.getLoadOptions()); diff --git a/rEFIt_UEFI/gui/REFIT_MAINMENU_SCREEN.cpp b/rEFIt_UEFI/gui/REFIT_MAINMENU_SCREEN.cpp index 0e3b96aa0..bc55407d7 100644 --- a/rEFIt_UEFI/gui/REFIT_MAINMENU_SCREEN.cpp +++ b/rEFIt_UEFI/gui/REFIT_MAINMENU_SCREEN.cpp @@ -94,32 +94,32 @@ REFIT_MAINMENU_SCREEN::REFIT_MAINMENU_SCREEN(UINTN ID, XStringW TTitle, XStringW void REFIT_MAINMENU_SCREEN::DrawMainMenuLabel(IN CONST XStringW& Text, IN INTN XPos, IN INTN YPos) { INTN TextWidth = 0; - INTN BadgeDim = (INTN)(BADGE_DIMENSION * ThemeX.Scale); + INTN BadgeDim = (INTN)(BADGE_DIMENSION * ThemeX->Scale); - ThemeX.MeasureText(Text, &TextWidth, NULL); + ThemeX->MeasureText(Text, &TextWidth, NULL); //Clear old text - ThemeX.FillRectAreaOfScreen(OldX, OldY, OldTextWidth, OldTextHeight); + ThemeX->FillRectAreaOfScreen(OldX, OldY, OldTextWidth, OldTextHeight); - if (!(ThemeX.BootCampStyle) - && (ThemeX.HideBadges & HDBADGES_INLINE) && (!OldRow) + if (!(ThemeX->BootCampStyle) + && (ThemeX->HideBadges & HDBADGES_INLINE) && (!OldRow) && (OldTextWidth) && (OldTextWidth != TextWidth) ) { //Clear badge - ThemeX.FillRectAreaOfScreen((OldX - (OldTextWidth >> 1) - (BadgeDim + 16)), - (OldY - ((BadgeDim - ThemeX.TextHeight) >> 1)), 128, 128); + ThemeX->FillRectAreaOfScreen((OldX - (OldTextWidth >> 1) - (BadgeDim + 16)), + (OldY - ((BadgeDim - ThemeX->TextHeight) >> 1)), 128, 128); } DrawTextXY(Text, XPos, YPos, X_IS_CENTER); //show inline badge - if (!(ThemeX.BootCampStyle) && - (ThemeX.HideBadges & HDBADGES_INLINE) && + if (!(ThemeX->BootCampStyle) && + (ThemeX->HideBadges & HDBADGES_INLINE) && (Entries[ScrollState.CurrentSelection].Row == 0)) { // Display Inline Badge: small icon before the text XImage Back(BadgeDim, BadgeDim); INTN X = XPos - (TextWidth >> 1) - (BadgeDim + 16); - INTN Y = YPos - ((BadgeDim - ThemeX.TextHeight) >> 1); - Back.CopyRect(ThemeX.Background, X, Y); + INTN Y = YPos - ((BadgeDim - ThemeX->TextHeight) >> 1); + Back.CopyRect(ThemeX->Background, X, Y); XBool free = false; XImage *CurrSel = Entries[ScrollState.CurrentSelection].Image.GetBest(!Daylight, &free); Back.Compose(0, 0, *CurrSel, false, BadgeDim/128.f); @@ -161,8 +161,8 @@ void REFIT_MENU_SCREEN::DrawTextCorner(UINTN TextC, UINT8 Align) if ( // HIDEUI_ALL - included - ((TextC == TEXT_CORNER_REVISION) && ((ThemeX.HideUIFlags & HIDEUI_FLAG_REVISION) != 0)) || - ((TextC == TEXT_CORNER_HELP) && ((ThemeX.HideUIFlags & HIDEUI_FLAG_HELP) != 0)) || + ((TextC == TEXT_CORNER_REVISION) && ((ThemeX->HideUIFlags & HIDEUI_FLAG_REVISION) != 0)) || + ((TextC == TEXT_CORNER_HELP) && ((ThemeX->HideUIFlags & HIDEUI_FLAG_HELP) != 0)) || ((TextC == TEXT_CORNER_OPTIMUS) && (gSettings.GUI.ShowOptimus == false)) ) { return; @@ -195,10 +195,10 @@ void REFIT_MENU_SCREEN::DrawTextCorner(UINTN TextC, UINT8 Align) switch (Align) { case X_IS_LEFT: - Xpos = (INTN)(ThemeX.TextHeight * 0.75f); + Xpos = (INTN)(ThemeX->TextHeight * 0.75f); break; case X_IS_RIGHT: - Xpos = UGAWidth - (INTN)(ThemeX.TextHeight * 0.75f);//2 + Xpos = UGAWidth - (INTN)(ThemeX->TextHeight * 0.75f);//2 break; case X_IS_CENTER: Xpos = UGAWidth >> 1; @@ -209,18 +209,18 @@ void REFIT_MENU_SCREEN::DrawTextCorner(UINTN TextC, UINT8 Align) } // DBG("draw text %ls at (%d, %d)\n", Text, Xpos, UGAHeight - 5 - TextHeight), // clovy DrawTextXY(Text, Xpos, UGAHeight - 5 - TextHeight, Align); - DrawTextXY(Text, Xpos, UGAHeight - (INTN)(ThemeX.TextHeight * 1.5f), Align); + DrawTextXY(Text, Xpos, UGAHeight - (INTN)(ThemeX->TextHeight * 1.5f), Align); } void REFIT_MAINMENU_SCREEN::DrawMainMenuEntry(REFIT_ABSTRACT_MENU_ENTRY *Entry, XBool selected, INTN XPos, INTN YPos) { - INTN MainSize = ThemeX.MainEntriesSize; + INTN MainSize = ThemeX->MainEntriesSize; // XImage MainImage(MainSize, MainSize); // XImage* BadgeImage; XIcon MainIcon; //it can be changed here XIcon* BadgeIcon = NULL; - if (Entry->Row == 0 && Entry->getDriveImage() && !(ThemeX.HideBadges & HDBADGES_SWAP)) { + if (Entry->Row == 0 && Entry->getDriveImage() && !(ThemeX->HideBadges & HDBADGES_SWAP)) { MainIcon = *Entry->getDriveImage(); } else { MainIcon = Entry->Image; // XIcon* @@ -228,8 +228,8 @@ void REFIT_MAINMENU_SCREEN::DrawMainMenuEntry(REFIT_ABSTRACT_MENU_ENTRY *Entry, //this should be inited by the Theme if (MainIcon.isEmpty()) { // DBG(" why MainImage is empty? Report to devs\n"); - if (!ThemeX.IsEmbeddedTheme()) { - MainIcon = ThemeX.GetIcon("os_mac"_XS8); + if (!ThemeX->IsEmbeddedTheme()) { + MainIcon = ThemeX->GetIcon("os_mac"_XS8); } if (MainIcon.Image.isEmpty()) { MainIcon.Image.DummyImage(MainSize); @@ -237,32 +237,32 @@ void REFIT_MAINMENU_SCREEN::DrawMainMenuEntry(REFIT_ABSTRACT_MENU_ENTRY *Entry, } } -// const XImage& MainImage = (!ThemeX.Daylight && !MainIcon.ImageNight.isEmpty())? MainIcon.ImageNight : MainIcon.Image; +// const XImage& MainImage = (!ThemeX->Daylight && !MainIcon.ImageNight.isEmpty())? MainIcon.ImageNight : MainIcon.Image; XBool free = false; XImage *MainImage = MainIcon.GetBest(!Daylight, &free); - INTN CompWidth = (Entry->Row == 0) ? ThemeX.row0TileSize : ThemeX.row1TileSize; + INTN CompWidth = (Entry->Row == 0) ? ThemeX->row0TileSize : ThemeX->row1TileSize; INTN CompHeight = CompWidth; // float fScale; -// if (ThemeX.TypeSVG) { +// if (ThemeX->TypeSVG) { // fScale = (selected ? 1.f : -1.f); // } else { -// fScale = ((Entry->Row == 0) ? (ThemeX.MainEntriesSize/128.f * (selected ? 1.f : -1.f)): 1.f) ; +// fScale = ((Entry->Row == 0) ? (ThemeX->MainEntriesSize/128.f * (selected ? 1.f : -1.f)): 1.f) ; // } if (Entry->Row == 0) { BadgeIcon = Entry->getBadgeImage(); } - const XImage& TopImage = ThemeX.SelectionImages[((Entry->Row == 0) ? 0 : 2) + (selected ? 0 : 1)]; + const XImage& TopImage = ThemeX->SelectionImages[((Entry->Row == 0) ? 0 : 2) + (selected ? 0 : 1)]; // DBG(" SelectionWidth=%lld\n", TopImage.GetWidth()); if (TopImage.GetWidth() > CompWidth) { CompWidth = TopImage.GetWidth(); CompHeight = CompWidth; } XImage Back(CompWidth, CompHeight); - Back.CopyRect(ThemeX.Background, XPos, YPos); + Back.CopyRect(ThemeX->Background, XPos, YPos); INTN OffsetX = (CompWidth - MainImage->GetWidth()) / 2; OffsetX = (OffsetX > 0) ? OffsetX: 0; @@ -276,8 +276,8 @@ void REFIT_MAINMENU_SCREEN::DrawMainMenuEntry(REFIT_ABSTRACT_MENU_ENTRY *Entry, // DBG(" Comp=[%lld,%lld], offset=[%lld,%lld]\n", CompWidth, CompHeight, OffsetX, OffsetY); - float composeScale = (ThemeX.NonSelectedGrey && !selected)? -1.f: 1.f; - if(ThemeX.SelectionOnTop) { + float composeScale = (ThemeX->NonSelectedGrey && !selected)? -1.f: 1.f; + if(ThemeX->SelectionOnTop) { //place main image in centre. It may be OS or Drive Back.Compose(OffsetX, OffsetY, *MainImage, false, composeScale); } else { @@ -294,9 +294,9 @@ void REFIT_MAINMENU_SCREEN::DrawMainMenuEntry(REFIT_ABSTRACT_MENU_ENTRY *Entry, delete MainImage; } // place the badge image - float fBadgeScale = ThemeX.BadgeScale/16.f; + float fBadgeScale = ThemeX->BadgeScale/16.f; if ((Entry->Row == 0) && BadgeIcon && !BadgeIcon->isEmpty()) { -// const XImage& BadgeImage = (!ThemeX.Daylight && !BadgeIcon->ImageNight.isEmpty()) ? &BadgeIcon->ImageNight : BadgeImage = &BadgeIcon->Image; +// const XImage& BadgeImage = (!ThemeX->Daylight && !BadgeIcon->ImageNight.isEmpty()) ? &BadgeIcon->ImageNight : BadgeImage = &BadgeIcon->Image; free = false; XImage* BadgeImage = BadgeIcon->GetBest(!Daylight, &free); INTN BadgeWidth = (INTN)(BadgeImage->GetWidth() * fBadgeScale); @@ -305,15 +305,15 @@ void REFIT_MAINMENU_SCREEN::DrawMainMenuEntry(REFIT_ABSTRACT_MENU_ENTRY *Entry, if ((BadgeWidth + 8) < CompWidth && (BadgeHeight + 8) < CompHeight) { // Check for user badge x offset from theme.plist - if (ThemeX.BadgeOffsetX != 0xFFFF) { - OffsetX += ThemeX.BadgeOffsetX; + if (ThemeX->BadgeOffsetX != 0xFFFF) { + OffsetX += ThemeX->BadgeOffsetX; } else { // Set default position OffsetX += CompWidth - 8 - BadgeWidth; } // Check for user badge y offset from theme.plist - if (ThemeX.BadgeOffsetY != 0xFFFF) { - OffsetY += ThemeX.BadgeOffsetY; + if (ThemeX->BadgeOffsetY != 0xFFFF) { + OffsetY += ThemeX->BadgeOffsetY; } else { // Set default position OffsetY += CompHeight - 8 - BadgeHeight; @@ -324,7 +324,7 @@ void REFIT_MAINMENU_SCREEN::DrawMainMenuEntry(REFIT_ABSTRACT_MENU_ENTRY *Entry, } } - if(ThemeX.SelectionOnTop) { + if(ThemeX->SelectionOnTop) { Back.Compose(OffsetTX, OffsetTY, TopImage, false); //selection at the top } Back.DrawWithoutCompose(XPos, YPos); @@ -332,16 +332,16 @@ void REFIT_MAINMENU_SCREEN::DrawMainMenuEntry(REFIT_ABSTRACT_MENU_ENTRY *Entry, // draw BCS indicator // Needy: if Labels (Titles) are hidden there is no point to draw the indicator - if (ThemeX.BootCampStyle && !(ThemeX.HideUIFlags & HIDEUI_FLAG_LABEL)) { + if (ThemeX->BootCampStyle && !(ThemeX->HideUIFlags & HIDEUI_FLAG_LABEL)) { // indicator is for row 0, main entries, only if (Entry->Row == 0) { - const XImage& SelImage = ThemeX.SelectionImages[4 + (selected ? 0 : 1)]; - XPos = XPos + (ThemeX.row0TileSize / 2) - (INTN)(INDICATOR_SIZE * 0.5f * ThemeX.Scale); - YPos = row0PosY + ThemeX.row0TileSize + ThemeX.TextHeight + (INTN)((BCSMargin * 2) * ThemeX.Scale); - CompWidth = (INTN)(INDICATOR_SIZE * ThemeX.Scale); - CompHeight = (INTN)(INDICATOR_SIZE * ThemeX.Scale); + const XImage& SelImage = ThemeX->SelectionImages[4 + (selected ? 0 : 1)]; + XPos = XPos + (ThemeX->row0TileSize / 2) - (INTN)(INDICATOR_SIZE * 0.5f * ThemeX->Scale); + YPos = row0PosY + ThemeX->row0TileSize + ThemeX->TextHeight + (INTN)((BCSMargin * 2) * ThemeX->Scale); + CompWidth = (INTN)(INDICATOR_SIZE * ThemeX->Scale); + CompHeight = (INTN)(INDICATOR_SIZE * ThemeX->Scale); Back = XImage(CompWidth, CompHeight); - Back.CopyRect(ThemeX.Background, XPos, YPos); + Back.CopyRect(ThemeX->Background, XPos, YPos); Back.Compose(0, 0, SelImage, false); Back.DrawWithoutCompose(XPos, YPos); } @@ -359,10 +359,10 @@ void REFIT_MAINMENU_SCREEN::MainMenuStyle(IN UINTN Function, IN CONST CHAR16 *Pa // INTN i = 0; INTN MessageHeight = 0; // clovy - if (ThemeX.TypeSVG && textFace[1].valid) { - MessageHeight = (INTN)(textFace[1].size * RowHeightFromTextHeight * ThemeX.Scale); + if (ThemeX->TypeSVG && textFace[1].valid) { + MessageHeight = (INTN)(textFace[1].size * RowHeightFromTextHeight * ThemeX->Scale); } else { - MessageHeight = (INTN)(ThemeX.TextHeight * RowHeightFromTextHeight * ThemeX.Scale); + MessageHeight = (INTN)(ThemeX->TextHeight * RowHeightFromTextHeight * ThemeX->Scale); } switch (Function) { @@ -373,11 +373,11 @@ void REFIT_MAINMENU_SCREEN::MainMenuStyle(IN UINTN Function, IN CONST CHAR16 *Pa SwitchToGraphicsAndClear(); //BltClearScreen(false); - EntriesGap = (int)(ThemeX.TileXSpace * ThemeX.Scale); - EntriesWidth = ThemeX.row0TileSize; - EntriesHeight = ThemeX.MainEntriesSize + (int)(16.f * ThemeX.Scale); + EntriesGap = (int)(ThemeX->TileXSpace * ThemeX->Scale); + EntriesWidth = ThemeX->row0TileSize; + EntriesHeight = ThemeX->MainEntriesSize + (int)(16.f * ThemeX->Scale); - MaxItemOnScreen = (UGAWidth - (int)((ROW0_SCROLLSIZE * 2)* ThemeX.Scale)) / (EntriesWidth + EntriesGap); //8 + MaxItemOnScreen = (UGAWidth - (int)((ROW0_SCROLLSIZE * 2)* ThemeX->Scale)) / (EntriesWidth + EntriesGap); //8 CountItems(); InitScroll(row0Count, Entries.size(), MaxItemOnScreen, 0); @@ -387,31 +387,31 @@ void REFIT_MAINMENU_SCREEN::MainMenuStyle(IN UINTN Function, IN CONST CHAR16 *Pa row0PosX = UGAWidth - row0PosX; row0PosX = row0PosX >> 1; - row0PosY = (int)(((float)UGAHeight - ThemeX.LayoutHeight * ThemeX.Scale) * 0.5f + - ThemeX.LayoutBannerOffset * ThemeX.Scale); + row0PosY = (int)(((float)UGAHeight - ThemeX->LayoutHeight * ThemeX->Scale) * 0.5f + + ThemeX->LayoutBannerOffset * ThemeX->Scale); - row1PosX = (UGAWidth + 8 - (ThemeX.row1TileSize + (INTN)(8.0f * ThemeX.Scale)) * row1Count) >> 1; + row1PosX = (UGAWidth + 8 - (ThemeX->row1TileSize + (INTN)(8.0f * ThemeX->Scale)) * row1Count) >> 1; - if (ThemeX.BootCampStyle && !(ThemeX.HideUIFlags & HIDEUI_FLAG_LABEL)) { - row1PosY = row0PosY + ThemeX.row0TileSize + (INTN)((BCSMargin * 2) * ThemeX.Scale) + ThemeX.TextHeight + - (INTN)(INDICATOR_SIZE * ThemeX.Scale) + - (INTN)((ThemeX.LayoutButtonOffset + ThemeX.TileYSpace) * ThemeX.Scale); + if (ThemeX->BootCampStyle && !(ThemeX->HideUIFlags & HIDEUI_FLAG_LABEL)) { + row1PosY = row0PosY + ThemeX->row0TileSize + (INTN)((BCSMargin * 2) * ThemeX->Scale) + ThemeX->TextHeight + + (INTN)(INDICATOR_SIZE * ThemeX->Scale) + + (INTN)((ThemeX->LayoutButtonOffset + ThemeX->TileYSpace) * ThemeX->Scale); } else { row1PosY = row0PosY + EntriesHeight + - (INTN)((ThemeX.TileYSpace + ThemeX.LayoutButtonOffset) * ThemeX.Scale); + (INTN)((ThemeX->TileYSpace + ThemeX->LayoutButtonOffset) * ThemeX->Scale); } if (row1Count > 0) { - textPosY = row1PosY + MAX(ThemeX.row1TileSize, MessageHeight) + (INTN)((ThemeX.TileYSpace + ThemeX.LayoutTextOffset) * ThemeX.Scale); + textPosY = row1PosY + MAX(ThemeX->row1TileSize, MessageHeight) + (INTN)((ThemeX->TileYSpace + ThemeX->LayoutTextOffset) * ThemeX->Scale); } else { textPosY = row1PosY; } - if (ThemeX.BootCampStyle) { - textPosY = row0PosY + ThemeX.row0TileSize + (INTN)((TEXT_YMARGIN + BCSMargin) * ThemeX.Scale); + if (ThemeX->BootCampStyle) { + textPosY = row0PosY + ThemeX->row0TileSize + (INTN)((TEXT_YMARGIN + BCSMargin) * ThemeX->Scale); } - FunctextPosY = row1PosY + ThemeX.row1TileSize + (INTN)((ThemeX.TileYSpace + ThemeX.LayoutTextOffset) * ThemeX.Scale); + FunctextPosY = row1PosY + ThemeX->row1TileSize + (INTN)((ThemeX->TileYSpace + ThemeX->LayoutTextOffset) * ThemeX->Scale); if (!itemPosX) { itemPosX = (__typeof__(itemPosX))AllocatePool(sizeof(UINT64) * Entries.size()); @@ -426,17 +426,17 @@ void REFIT_MAINMENU_SCREEN::MainMenuStyle(IN UINTN Function, IN CONST CHAR16 *Pa row0PosXRunning += EntriesWidth + EntriesGap; } else { itemPosX[i] = row1PosXRunning; - row1PosXRunning += ThemeX.row1TileSize + (INTN)(TILE1_XSPACING * ThemeX.Scale); + row1PosXRunning += ThemeX->row1TileSize + (INTN)(TILE1_XSPACING * ThemeX->Scale); //DBG("next item in row1 at x=%d\n", row1PosXRunning); } } // initial painting - // ThemeX.InitSelection(); //not needed to do here + // ThemeX->InitSelection(); //not needed to do here // Update FilmPlace only if not set by InitAnime if (FilmC->FilmPlace.Width == 0 || FilmC->FilmPlace.Height == 0) { // CopyMem(&FilmPlace, &BannerPlace, sizeof(BannerPlace)); - FilmC->FilmPlace = ThemeX.BannerPlace; + FilmC->FilmPlace = ThemeX->BannerPlace; } //DBG("main menu inited\n"); @@ -457,11 +457,11 @@ void REFIT_MAINMENU_SCREEN::MainMenuStyle(IN UINTN Function, IN CONST CHAR16 *Pa itemPosX[i - ScrollState.FirstVisible], row0PosY); // draw static text for the boot options, BootCampStyle - if (ThemeX.BootCampStyle && !(ThemeX.HideUIFlags & HIDEUI_FLAG_LABEL)) { - INTN textPosX = itemPosX[i - ScrollState.FirstVisible] + (ThemeX.row0TileSize / 2); + if (ThemeX->BootCampStyle && !(ThemeX->HideUIFlags & HIDEUI_FLAG_LABEL)) { + INTN textPosX = itemPosX[i - ScrollState.FirstVisible] + (ThemeX->row0TileSize / 2); // clear the screen - ThemeX.FillRectAreaOfScreen(textPosX, textPosY, EntriesWidth + ThemeX.TileXSpace, + ThemeX->FillRectAreaOfScreen(textPosX, textPosY, EntriesWidth + ThemeX->TileXSpace, MessageHeight); DrawBCSText(Entries[i].Title.wc_str(), textPosX, textPosY, X_IS_CENTER); } @@ -473,18 +473,18 @@ void REFIT_MAINMENU_SCREEN::MainMenuStyle(IN UINTN Function, IN CONST CHAR16 *Pa } // clear the text from the second row, required by the BootCampStyle - if ((ThemeX.BootCampStyle) && (Entries[ScrollState.LastSelection].Row == 1) - && (Entries[ScrollState.CurrentSelection].Row == 0) && !(ThemeX.HideUIFlags & HIDEUI_FLAG_LABEL)) { - ThemeX.FillRectAreaOfScreen((UGAWidth >> 1), FunctextPosY, + if ((ThemeX->BootCampStyle) && (Entries[ScrollState.LastSelection].Row == 1) + && (Entries[ScrollState.CurrentSelection].Row == 0) && !(ThemeX->HideUIFlags & HIDEUI_FLAG_LABEL)) { + ThemeX->FillRectAreaOfScreen((UGAWidth >> 1), FunctextPosY, OldTextWidth, MessageHeight); } if ((Entries[ScrollState.LastSelection].Row == 0) && (Entries[ScrollState.CurrentSelection].Row == 1) - && ThemeX.BootCampStyle && !(ThemeX.HideUIFlags & HIDEUI_FLAG_LABEL)) { + && ThemeX->BootCampStyle && !(ThemeX->HideUIFlags & HIDEUI_FLAG_LABEL)) { DrawMainMenuLabel(Entries[ScrollState.CurrentSelection].Title, (UGAWidth >> 1), FunctextPosY); } - if (!(ThemeX.BootCampStyle) && !(ThemeX.HideUIFlags & HIDEUI_FLAG_LABEL)) { + if (!(ThemeX->BootCampStyle) && !(ThemeX->HideUIFlags & HIDEUI_FLAG_LABEL)) { DrawMainMenuLabel(Entries[ScrollState.CurrentSelection].Title, (UGAWidth >> 1), textPosY); } @@ -519,12 +519,12 @@ void REFIT_MAINMENU_SCREEN::MainMenuStyle(IN UINTN Function, IN CONST CHAR16 *Pa itemPosX[ScrollState.CurrentSelection], row1PosY); } - if ((ThemeX.BootCampStyle) && (!(ThemeX.HideUIFlags & HIDEUI_FLAG_LABEL)) + if ((ThemeX->BootCampStyle) && (!(ThemeX->HideUIFlags & HIDEUI_FLAG_LABEL)) && Entries[ScrollState.CurrentSelection].Row == 1) { DrawMainMenuLabel(Entries[ScrollState.CurrentSelection].Title, (UGAWidth >> 1), FunctextPosY); } - if ((!(ThemeX.BootCampStyle)) && (!(ThemeX.HideUIFlags & HIDEUI_FLAG_LABEL))) { + if ((!(ThemeX->BootCampStyle)) && (!(ThemeX->HideUIFlags & HIDEUI_FLAG_LABEL))) { DrawMainMenuLabel(Entries[ScrollState.CurrentSelection].Title, (UGAWidth >> 1), textPosY); } @@ -539,10 +539,10 @@ void REFIT_MAINMENU_SCREEN::MainMenuStyle(IN UINTN Function, IN CONST CHAR16 *Pa break; case MENU_FUNCTION_PAINT_TIMEOUT: - INTN hi = MessageHeight * ((ThemeX.HideBadges & HDBADGES_INLINE)?3:1); + INTN hi = MessageHeight * ((ThemeX->HideBadges & HDBADGES_INLINE)?3:1); HidePointer(); - if (!(ThemeX.HideUIFlags & HIDEUI_FLAG_LABEL)){ - ThemeX.FillRectAreaOfScreen((UGAWidth >> 1), FunctextPosY + hi, + if (!(ThemeX->HideUIFlags & HIDEUI_FLAG_LABEL)){ + ThemeX->FillRectAreaOfScreen((UGAWidth >> 1), FunctextPosY + hi, OldTimeoutTextWidth, MessageHeight); XStringW TextX; TextX.takeValueFrom(ParamText); @@ -576,28 +576,28 @@ void REFIT_MAINMENU_SCREEN::MainMenuVerticalStyle(IN UINTN Function, IN CONST CH SwitchToGraphicsAndClear(); //BltClearScreen(false); //adjustable by theme.plist? - EntriesPosY = (int)(LAYOUT_Y_EDGE * ThemeX.Scale); - EntriesGap = (int)(ThemeX.TileYSpace * ThemeX.Scale); - EntriesWidth = ThemeX.MainEntriesSize + (int)(16 * ThemeX.Scale); - EntriesHeight = ThemeX.MainEntriesSize + (int)(16 * ThemeX.Scale); + EntriesPosY = (int)(LAYOUT_Y_EDGE * ThemeX->Scale); + EntriesGap = (int)(ThemeX->TileYSpace * ThemeX->Scale); + EntriesWidth = ThemeX->MainEntriesSize + (int)(16 * ThemeX->Scale); + EntriesHeight = ThemeX->MainEntriesSize + (int)(16 * ThemeX->Scale); // - INTN VisibleHeight = (UGAHeight - EntriesPosY - (int)(LAYOUT_Y_EDGE * ThemeX.Scale) + EntriesGap) / (EntriesHeight + EntriesGap); - EntriesPosX = UGAWidth - EntriesWidth - (int)((BAR_WIDTH + LAYOUT_X_EDGE) * ThemeX.Scale); + INTN VisibleHeight = (UGAHeight - EntriesPosY - (int)(LAYOUT_Y_EDGE * ThemeX->Scale) + EntriesGap) / (EntriesHeight + EntriesGap); + EntriesPosX = UGAWidth - EntriesWidth - (int)((BAR_WIDTH + LAYOUT_X_EDGE) * ThemeX->Scale); INTN MessageHeight = 20; - if (ThemeX.TypeSVG && textFace[1].valid) { - MessageHeight = (INTN)(textFace[1].size * RowHeightFromTextHeight * ThemeX.Scale); + if (ThemeX->TypeSVG && textFace[1].valid) { + MessageHeight = (INTN)(textFace[1].size * RowHeightFromTextHeight * ThemeX->Scale); } else { - MessageHeight = (INTN)(ThemeX.TextHeight * RowHeightFromTextHeight * ThemeX.Scale); + MessageHeight = (INTN)(ThemeX->TextHeight * RowHeightFromTextHeight * ThemeX->Scale); } - TimeoutPosY = UGAHeight - (int)(LAYOUT_Y_EDGE * ThemeX.Scale) - MessageHeight * 2; //optimus + timeout texts + TimeoutPosY = UGAHeight - (int)(LAYOUT_Y_EDGE * ThemeX->Scale) - MessageHeight * 2; //optimus + timeout texts CountItems(); InitScroll(row0Count, Entries.size(), VisibleHeight, 0); row0PosX = EntriesPosX; row0PosY = EntriesPosY; - row1PosX = (UGAWidth + EntriesGap - (ThemeX.row1TileSize + (int)(TILE1_XSPACING * ThemeX.Scale)) * row1Count) >> 1; - textPosY = TimeoutPosY - (int)(ThemeX.TileYSpace * ThemeX.Scale) - MessageHeight; //message text - row1PosY = textPosY - ThemeX.row1TileSize - (int)(ThemeX.TileYSpace * ThemeX.Scale) - ThemeX.LayoutTextOffset; + row1PosX = (UGAWidth + EntriesGap - (ThemeX->row1TileSize + (int)(TILE1_XSPACING * ThemeX->Scale)) * row1Count) >> 1; + textPosY = TimeoutPosY - (int)(ThemeX->TileYSpace * ThemeX->Scale) - MessageHeight; //message text + row1PosY = textPosY - ThemeX->row1TileSize - (int)(ThemeX->TileYSpace * ThemeX->Scale) - ThemeX->LayoutTextOffset; if (!itemPosX) { itemPosX = (__typeof__(itemPosX))AllocatePool(sizeof(UINT64) * Entries.size()); itemPosY = (__typeof__(itemPosY))AllocatePool(sizeof(UINT64) * Entries.size()); @@ -614,17 +614,17 @@ void REFIT_MAINMENU_SCREEN::MainMenuVerticalStyle(IN UINTN Function, IN CONST CH } else { itemPosX[i] = row1PosXRunning; itemPosY[i] = row1PosY; - row1PosXRunning += ThemeX.row1TileSize + (int)(ThemeX.TileXSpace * ThemeX.Scale); + row1PosXRunning += ThemeX->row1TileSize + (int)(ThemeX->TileXSpace * ThemeX->Scale); // DBG("next item in row1 at x=%d\n", row1PosXRunning); } } // Update FilmPlace only if not set by InitAnime if (FilmC->FilmPlace.Width == 0 || FilmC->FilmPlace.Height == 0) { - FilmC->FilmPlace = ThemeX.BannerPlace; + FilmC->FilmPlace = ThemeX->BannerPlace; } - ThemeX.InitBar(); //not sure + ThemeX->InitBar(); //not sure break; } case MENU_FUNCTION_CLEANUP: @@ -636,8 +636,8 @@ void REFIT_MAINMENU_SCREEN::MainMenuVerticalStyle(IN UINTN Function, IN CONST CH break; case MENU_FUNCTION_PAINT_ALL: - SetBar(EntriesPosX + EntriesWidth + (int)(10 * ThemeX.Scale), - EntriesPosY, UGAHeight - (int)(LAYOUT_Y_EDGE * ThemeX.Scale), &ScrollState); + SetBar(EntriesPosX + EntriesWidth + (int)(10 * ThemeX->Scale), + EntriesPosY, UGAHeight - (int)(LAYOUT_Y_EDGE * ThemeX->Scale), &ScrollState); for (INTN i = 0; i <= ScrollState.MaxIndex; i++) { if (Entries[i].Row == 0) { if ((i >= ScrollState.FirstVisible) && (i <= ScrollState.LastVisible)) { @@ -649,7 +649,7 @@ void REFIT_MAINMENU_SCREEN::MainMenuVerticalStyle(IN UINTN Function, IN CONST CH itemPosX[i], itemPosY[i]); } } - if (!(ThemeX.HideUIFlags & HIDEUI_FLAG_LABEL)){ + if (!(ThemeX->HideUIFlags & HIDEUI_FLAG_LABEL)){ DrawMainMenuLabel(Entries[ScrollState.CurrentSelection].Title, (UGAWidth >> 1), textPosY); } @@ -681,7 +681,7 @@ void REFIT_MAINMENU_SCREEN::MainMenuVerticalStyle(IN UINTN Function, IN CONST CH itemPosX[ScrollState.CurrentSelection], itemPosY[ScrollState.CurrentSelection]); } - if (!(ThemeX.HideUIFlags & HIDEUI_FLAG_LABEL)) { + if (!(ThemeX->HideUIFlags & HIDEUI_FLAG_LABEL)) { DrawMainMenuLabel(Entries[ScrollState.CurrentSelection].Title, (UGAWidth >> 1), textPosY); } @@ -694,16 +694,16 @@ void REFIT_MAINMENU_SCREEN::MainMenuVerticalStyle(IN UINTN Function, IN CONST CH case MENU_FUNCTION_PAINT_TIMEOUT: INTN MessageHeight = 20; - if (ThemeX.TypeSVG && textFace[1].valid) { - MessageHeight = (INTN)(textFace[1].size * RowHeightFromTextHeight * ThemeX.Scale); + if (ThemeX->TypeSVG && textFace[1].valid) { + MessageHeight = (INTN)(textFace[1].size * RowHeightFromTextHeight * ThemeX->Scale); } else { - MessageHeight = (INTN)(ThemeX.TextHeight * RowHeightFromTextHeight * ThemeX.Scale); + MessageHeight = (INTN)(ThemeX->TextHeight * RowHeightFromTextHeight * ThemeX->Scale); } - INTN hi = MessageHeight * ((ThemeX.HideBadges & HDBADGES_INLINE)?3:1); + INTN hi = MessageHeight * ((ThemeX->HideBadges & HDBADGES_INLINE)?3:1); HidePointer(); - if (!(ThemeX.HideUIFlags & HIDEUI_FLAG_LABEL)) { - ThemeX.FillRectAreaOfScreen((UGAWidth >> 1), textPosY + hi, - OldTimeoutTextWidth, ThemeX.TextHeight); + if (!(ThemeX->HideUIFlags & HIDEUI_FLAG_LABEL)) { + ThemeX->FillRectAreaOfScreen((UGAWidth >> 1), textPosY + hi, + OldTimeoutTextWidth, ThemeX->TextHeight); XStringW TextX; TextX.takeValueFrom(ParamText); OldTimeoutTextWidth = DrawTextXY(TextX, (UGAWidth >> 1), textPosY + hi, X_IS_CENTER); @@ -738,7 +738,7 @@ UINTN REFIT_MAINMENU_SCREEN::RunMainMenu(IN INTN DefaultSelection, OUT REFIT_ABS // if (AllowGraphicsMode) { //// Style = &REFIT_MENU_SCREEN::GraphicsMenuStyle; -// if (ThemeX.VerticalLayout) { +// if (ThemeX->VerticalLayout) { // m_MainStyle = &REFIT_MAINMENU_SCREEN::MainMenuVerticalStyle; // } else { // m_MainStyle = &REFIT_MAINMENU_SCREEN::MainMenuStyle; diff --git a/rEFIt_UEFI/gui/REFIT_MAINMENU_SCREEN.h b/rEFIt_UEFI/gui/REFIT_MAINMENU_SCREEN.h index ef2aab2d5..9576564bf 100644 --- a/rEFIt_UEFI/gui/REFIT_MAINMENU_SCREEN.h +++ b/rEFIt_UEFI/gui/REFIT_MAINMENU_SCREEN.h @@ -71,7 +71,7 @@ public: virtual void MainMenuVerticalStyle(IN UINTN Function, IN CONST CHAR16 *ParamText); // cannot remove from here because the use of pointer to member function virtual void MenuStyle(IN UINTN Function, IN CONST CHAR16 *ParamText) { if (AllowGraphicsMode) { - if (ThemeX.VerticalLayout) { + if (ThemeX->VerticalLayout) { MainMenuVerticalStyle(Function, ParamText); } else { MainMenuStyle(Function, ParamText); diff --git a/rEFIt_UEFI/gui/REFIT_MENU_SCREEN.cpp b/rEFIt_UEFI/gui/REFIT_MENU_SCREEN.cpp index 68b6fa544..89f0c1594 100644 --- a/rEFIt_UEFI/gui/REFIT_MENU_SCREEN.cpp +++ b/rEFIt_UEFI/gui/REFIT_MENU_SCREEN.cpp @@ -180,23 +180,23 @@ void REFIT_MENU_SCREEN::InitScroll(IN INTN ItemCount, IN UINTN MaxCount, ScrollState.LastVisible = ScrollState.FirstVisible + ScrollState.MaxVisible; //scroll bar geometry - if (!ThemeX.TypeSVG) { - UpButton.Width = ThemeX.ScrollWidth; // 16 - UpButton.Height = ThemeX.ScrollButtonsHeight; // 20 + if (!ThemeX->TypeSVG) { + UpButton.Width = ThemeX->ScrollWidth; // 16 + UpButton.Height = ThemeX->ScrollButtonsHeight; // 20 DownButton.Width = UpButton.Width; - DownButton.Height = ThemeX.ScrollButtonsHeight; - BarStart.Height = ThemeX.ScrollBarDecorationsHeight; // 5 - BarEnd.Height = ThemeX.ScrollBarDecorationsHeight; - ScrollStart.Height = ThemeX.ScrollScrollDecorationsHeight; // 7 - ScrollEnd.Height = ThemeX.ScrollScrollDecorationsHeight; + DownButton.Height = ThemeX->ScrollButtonsHeight; + BarStart.Height = ThemeX->ScrollBarDecorationsHeight; // 5 + BarEnd.Height = ThemeX->ScrollBarDecorationsHeight; + ScrollStart.Height = ThemeX->ScrollScrollDecorationsHeight; // 7 + ScrollEnd.Height = ThemeX->ScrollScrollDecorationsHeight; } else { - UpButton.Width = ThemeX.ScrollWidth; // 16 + UpButton.Width = ThemeX->ScrollWidth; // 16 UpButton.Height = 0; // 20 DownButton.Width = UpButton.Width; DownButton.Height = 0; - BarStart.Height = ThemeX.ScrollBarDecorationsHeight; // 5 - BarEnd.Height = ThemeX.ScrollBarDecorationsHeight; + BarStart.Height = ThemeX->ScrollBarDecorationsHeight; // 5 + BarEnd.Height = ThemeX->ScrollBarDecorationsHeight; ScrollStart.Height = 0; // 7 ScrollEnd.Height = 0; } @@ -215,7 +215,7 @@ void REFIT_MENU_SCREEN::UpdateScroll(IN UINTN Movement) ScrollbarOldPointerPlace.XPos = ScrollbarNewPointerPlace.XPos; ScrollbarOldPointerPlace.YPos = ScrollbarNewPointerPlace.YPos; Lines = ScrollbarYMovement * ScrollState.MaxIndex / ScrollbarBackground.Height; - ScrollbarYMovement = ScrollbarYMovement - Lines * (ScrollState.MaxVisible * ThemeX.TextHeight - 16 - 1) / ScrollState.MaxIndex; + ScrollbarYMovement = ScrollbarYMovement - Lines * (ScrollState.MaxVisible * ThemeX->TextHeight - 16 - 1) / ScrollState.MaxIndex; if (Lines < 0) { Lines = -Lines; ScrollMovement = SCROLL_SCROLL_UP; @@ -486,8 +486,8 @@ UINTN REFIT_MENU_SCREEN::InputDialog() */ UINTN LineSize = 38; // make sure that LineSize is not too big - UINTN MaxPossibleLineSize = (MenuWidth - selectedEntry.Place.Width) / (INTN)(ThemeX.CharWidth * ThemeX.Scale) - 1; - if (!ThemeX.TypeSVG && !ThemeX.Proportional && LineSize > MaxPossibleLineSize) { + UINTN MaxPossibleLineSize = (MenuWidth - selectedEntry.Place.Width) / (INTN)(ThemeX->CharWidth * ThemeX->Scale) - 1; + if (!ThemeX->TypeSVG && !ThemeX->Proportional && LineSize > MaxPossibleLineSize) { LineSize = MaxPossibleLineSize; } @@ -704,7 +704,7 @@ UINTN REFIT_MENU_SCREEN::RunGenericMenu(IN OUT INTN *DefaultEntryIndex, OUT REFI } else { TextStyle = 2; } - if (ThemeX.TypeSVG) { + if (ThemeX->TypeSVG) { if (!textFace[TextStyle].valid) { if (textFace[0].valid) { TextStyle = 0; @@ -714,13 +714,13 @@ UINTN REFIT_MENU_SCREEN::RunGenericMenu(IN OUT INTN *DefaultEntryIndex, OUT REFI TextStyle = 1; } else { DBG("no valid text style\n"); - textFace[TextStyle].size = ThemeX.TextHeight - 4; + textFace[TextStyle].size = ThemeX->TextHeight - 4; } } if (textFace[TextStyle].valid) { // TextHeight = (int)((textFace[TextStyle].size + 4) * GlobalConfig.Scale); //clovy - row height / text size factor - ThemeX.TextHeight = (int)((textFace[TextStyle].size * RowHeightFromTextHeight) * ThemeX.Scale); + ThemeX->TextHeight = (int)((textFace[TextStyle].size * RowHeightFromTextHeight) * ThemeX->Scale); } } @@ -1327,23 +1327,23 @@ INTN REFIT_MENU_SCREEN::DrawTextXY(IN const XStringW& Text, IN INTN XPos, IN INT * as well we not know yet the font using but egRenderText calculate later real width * so make a place to be large enoungh */ - ThemeX.MeasureText(Text, &TextWidth, NULL); //NULL means we already know Height + ThemeX->MeasureText(Text, &TextWidth, NULL); //NULL means we already know Height // DBG("drawXY=%ls width=%lld\n", Text.wc_str(), TextWidth); if (XAlign == X_IS_LEFT) { TextWidth = UGAWidth - XPos - 1; XText = XPos; } - if (!isBootScreen && ThemeX.TypeSVG) { - TextWidth += ThemeX.TextHeight * 2; //give more place for buffer + if (!isBootScreen && ThemeX->TypeSVG) { + TextWidth += ThemeX->TextHeight * 2; //give more place for buffer if (!textFace[TextXYStyle].valid) { DBG("no vaid text face for message!\n"); - Height = ThemeX.TextHeight; + Height = ThemeX->TextHeight; } else { - Height = (int)(textFace[TextXYStyle].size * RowHeightFromTextHeight * ThemeX.Scale); + Height = (int)(textFace[TextXYStyle].size * RowHeightFromTextHeight * ThemeX->Scale); } } else { - Height = ThemeX.TextHeight; + Height = ThemeX->TextHeight; } OldTextHeight = Height; @@ -1352,7 +1352,7 @@ INTN REFIT_MENU_SCREEN::DrawTextXY(IN const XStringW& Text, IN INTN XPos, IN INT // TextBufferXY.Fill(MenuBackgroundPixel); // render the text - INTN TextWidth2 = ThemeX.RenderText(Text, &TextBufferXY, 0, 0, 0xFFFF, TextXYStyle); + INTN TextWidth2 = ThemeX->RenderText(Text, &TextBufferXY, 0, 0, 0xFFFF, TextXYStyle); // there is real text width but we already have an array with Width = TextWidth // // TextBufferXY.EnsureImageSize(TextWidth2, Height); //assume color = MenuBackgroundPixel @@ -1376,7 +1376,7 @@ INTN REFIT_MENU_SCREEN::DrawTextXY(IN const XStringW& Text, IN INTN XPos, IN INT // DBG("pos=%d width=%d xtext=%d Height=%d Y=%d\n", XPos, TextWidth, XText, Height, YPos); // TextBufferXY.Draw(XText, YPos, 0, false); // TextBufferXY.DrawWithoutCompose(XText, YPos); - TextBufferXY.DrawOnBack(XText, YPos, ThemeX.Background); + TextBufferXY.DrawOnBack(XText, YPos, ThemeX->Background); return TextWidth2; } @@ -1399,8 +1399,8 @@ void REFIT_MENU_SCREEN::DrawBCSText(IN CONST CHAR16 *Text, IN INTN XPos, IN INTN UINTN MaxTextLen = 13; // some optimization - if (ThemeX.TileXSpace >= 25) { - MaxTextLen = ThemeX.TileXSpace / 5 + 9; + if (ThemeX->TileXSpace >= 25) { + MaxTextLen = ThemeX->TileXSpace / 5 + 9; } XStringW BCSTextX; @@ -1416,8 +1416,8 @@ void REFIT_MENU_SCREEN::DrawBCSText(IN CONST CHAR16 *Text, IN INTN XPos, IN INTN void REFIT_MENU_SCREEN::DrawMenuText(IN const XStringW& Text, IN INTN SelectedWidth, IN INTN XPos, IN INTN YPos, IN UINTN Cursor, IN INTN MaxWidth) { INTN Width = (MaxWidth > 0 && (XPos + MaxWidth <= UGAWidth)) ? MaxWidth : UGAWidth - XPos; - XImage TextBufferX(Width, ThemeX.TextHeight); - XImage SelectionBar(Width, ThemeX.TextHeight); + XImage TextBufferX(Width, ThemeX->TextHeight); + XImage SelectionBar(Width, ThemeX->TextHeight); /* if (Cursor == 0xFFFF) { //InfoLine = 0xFFFF @@ -1431,21 +1431,21 @@ void REFIT_MENU_SCREEN::DrawMenuText(IN const XStringW& Text, IN INTN SelectedWi // fill selection bar background EG_RECT TextRect; TextRect.Width = SelectedWidth; - TextRect.Height = ThemeX.TextHeight; + TextRect.Height = ThemeX->TextHeight; TextBufferX.FillArea(SelectionBackgroundPixel, TextRect); // SelectionBar.Fill(SelectionBackgroundPixel); } - SelectionBar.CopyRect(ThemeX.Background, XPos, YPos); + SelectionBar.CopyRect(ThemeX->Background, XPos, YPos); // SelectionBar.DrawWithoutCompose(XPos, YPos); -// TextBufferX.Compose(0, 0, ThemeX.Background, true); +// TextBufferX.Compose(0, 0, ThemeX->Background, true); // render the text - if (ThemeX.TypeSVG) { + if (ThemeX->TypeSVG) { //clovy - text vertically centred on Height - ThemeX.RenderText(Text, &TextBufferX, 0, - (INTN)((ThemeX.TextHeight - (textFace[TextStyle].size * ThemeX.Scale)) / 2), + ThemeX->RenderText(Text, &TextBufferX, 0, + (INTN)((ThemeX->TextHeight - (textFace[TextStyle].size * ThemeX->Scale)) / 2), Cursor, TextStyle); } else { - ThemeX.RenderText(Text, &TextBufferX, TEXT_XMARGIN, TEXT_YMARGIN, Cursor, TextStyle); + ThemeX->RenderText(Text, &TextBufferX, TEXT_XMARGIN, TEXT_YMARGIN, Cursor, TextStyle); } SelectionBar.Compose(0, 0, TextBufferX, false); // TextBufferX.DrawWithoutCompose(XPos, YPos); @@ -1510,24 +1510,24 @@ void REFIT_MENU_SCREEN::ScrollingBar() XImage Total(ScrollTotal.Width, ScrollTotal.Height); // Total.Fill(&MenuBackgroundPixel); - Total.CopyRect(ThemeX.Background, ScrollTotal.XPos, ScrollTotal.YPos); - if (!ThemeX.ScrollbarBackgroundImage.isEmpty()) { - for (INTN i = 0; i < ScrollbarBackground.Height; i+=ThemeX.ScrollbarBackgroundImage.GetHeight()) { - Total.Compose(ScrollbarBackground.XPos - ScrollTotal.XPos, ScrollbarBackground.YPos + i - ScrollTotal.YPos, ThemeX.ScrollbarBackgroundImage, false); + Total.CopyRect(ThemeX->Background, ScrollTotal.XPos, ScrollTotal.YPos); + if (!ThemeX->ScrollbarBackgroundImage.isEmpty()) { + for (INTN i = 0; i < ScrollbarBackground.Height; i+=ThemeX->ScrollbarBackgroundImage.GetHeight()) { + Total.Compose(ScrollbarBackground.XPos - ScrollTotal.XPos, ScrollbarBackground.YPos + i - ScrollTotal.YPos, ThemeX->ScrollbarBackgroundImage, false); } } - Total.Compose(BarStart.XPos - ScrollTotal.XPos, BarStart.YPos - ScrollTotal.YPos, ThemeX.BarStartImage, false); - Total.Compose(BarEnd.XPos - ScrollTotal.XPos, BarEnd.YPos - ScrollTotal.YPos, ThemeX.BarEndImage, false); - if (!ThemeX.ScrollbarImage.isEmpty()) { - for (INTN i = 0; i < Scrollbar.Height; i+=ThemeX.ScrollbarImage.GetHeight()) { - Total.Compose(Scrollbar.XPos - ScrollTotal.XPos, Scrollbar.YPos + i - ScrollTotal.YPos, ThemeX.ScrollbarImage, false); + Total.Compose(BarStart.XPos - ScrollTotal.XPos, BarStart.YPos - ScrollTotal.YPos, ThemeX->BarStartImage, false); + Total.Compose(BarEnd.XPos - ScrollTotal.XPos, BarEnd.YPos - ScrollTotal.YPos, ThemeX->BarEndImage, false); + if (!ThemeX->ScrollbarImage.isEmpty()) { + for (INTN i = 0; i < Scrollbar.Height; i+=ThemeX->ScrollbarImage.GetHeight()) { + Total.Compose(Scrollbar.XPos - ScrollTotal.XPos, Scrollbar.YPos + i - ScrollTotal.YPos, ThemeX->ScrollbarImage, false); } } - Total.Compose(UpButton.XPos - ScrollTotal.XPos, UpButton.YPos - ScrollTotal.YPos, ThemeX.UpButtonImage, false); - Total.Compose(DownButton.XPos - ScrollTotal.XPos, DownButton.YPos - ScrollTotal.YPos, ThemeX.DownButtonImage, false); - Total.Compose(ScrollStart.XPos - ScrollTotal.XPos, ScrollStart.YPos - ScrollTotal.YPos, ThemeX.ScrollStartImage, false); - Total.Compose(ScrollEnd.XPos - ScrollTotal.XPos, ScrollEnd.YPos - ScrollTotal.YPos, ThemeX.ScrollEndImage, false); - Total.Draw(ScrollTotal.XPos, ScrollTotal.YPos, ThemeX.ScrollWidth / 16.f); //ScrollWidth can be set in theme.plist but usually=16 + Total.Compose(UpButton.XPos - ScrollTotal.XPos, UpButton.YPos - ScrollTotal.YPos, ThemeX->UpButtonImage, false); + Total.Compose(DownButton.XPos - ScrollTotal.XPos, DownButton.YPos - ScrollTotal.YPos, ThemeX->DownButtonImage, false); + Total.Compose(ScrollStart.XPos - ScrollTotal.XPos, ScrollStart.YPos - ScrollTotal.YPos, ThemeX->ScrollStartImage, false); + Total.Compose(ScrollEnd.XPos - ScrollTotal.XPos, ScrollEnd.YPos - ScrollTotal.YPos, ThemeX->ScrollEndImage, false); + Total.Draw(ScrollTotal.XPos, ScrollTotal.YPos, ThemeX->ScrollWidth / 16.f); //ScrollWidth can be set in theme.plist but usually=16 } /** * Graphical menu. @@ -1543,7 +1543,7 @@ void REFIT_MENU_SCREEN::GraphicsMenuStyle(IN UINTN Function, IN CONST CHAR16 *Pa INTN PlaceCentre1 = 0; UINTN OldChosenItem = ~(UINTN)0; INTN TitleLen = 0; - INTN ScaledWidth = (INTN)(ThemeX.CharWidth * ThemeX.Scale); + INTN ScaledWidth = (INTN)(ThemeX->CharWidth * ThemeX->Scale); // clovy INTN ctrlX, ctrlY, ctrlTextX; @@ -1558,9 +1558,9 @@ void REFIT_MENU_SCREEN::GraphicsMenuStyle(IN UINTN Function, IN CONST CHAR16 *Pa InitAnime(); SwitchToGraphicsAndClear(); - EntriesPosY = ((UGAHeight - (int)(LAYOUT_TOTAL_HEIGHT * ThemeX.Scale)) >> 1) + (int)(ThemeX.LayoutBannerOffset * ThemeX.Scale) + (ThemeX.TextHeight << 1); + EntriesPosY = ((UGAHeight - (int)(LAYOUT_TOTAL_HEIGHT * ThemeX->Scale)) >> 1) + (int)(ThemeX->LayoutBannerOffset * ThemeX->Scale) + (ThemeX->TextHeight << 1); - VisibleHeight = ((UGAHeight - EntriesPosY) / ThemeX.TextHeight) - InfoLines.size() - 2; + VisibleHeight = ((UGAHeight - EntriesPosY) / ThemeX->TextHeight) - InfoLines.size() - 2; //DBG("MENU_FUNCTION_INIT 1 EntriesPosY=%d VisibleHeight=%d\n", EntriesPosY, VisibleHeight); if ( Entries[0].getREFIT_INPUT_DIALOG() ) { REFIT_INPUT_DIALOG& entry = (REFIT_INPUT_DIALOG&)Entries[0]; @@ -1581,32 +1581,32 @@ void REFIT_MENU_SCREEN::GraphicsMenuStyle(IN UINTN Function, IN CONST CHAR16 *Pa InitScroll(Entries.size(), Entries.size(), VisibleHeight, Chosen); // determine width of the menu - not working //MenuWidth = 80; // minimum - MenuWidth = (int)(LAYOUT_TEXT_WIDTH * ThemeX.Scale); //500 + MenuWidth = (int)(LAYOUT_TEXT_WIDTH * ThemeX->Scale); //500 if (!TitleImage.isEmpty()) { - if (MenuWidth > (INTN)(UGAWidth - (int)(TITLEICON_SPACING * ThemeX.Scale) - TitleImage.Image.GetWidth())) { - MenuWidth = UGAWidth - (int)(TITLEICON_SPACING * ThemeX.Scale) - TitleImage.Image.GetWidth() - 2; + if (MenuWidth > (INTN)(UGAWidth - (int)(TITLEICON_SPACING * ThemeX->Scale) - TitleImage.Image.GetWidth())) { + MenuWidth = UGAWidth - (int)(TITLEICON_SPACING * ThemeX->Scale) - TitleImage.Image.GetWidth() - 2; } - EntriesPosX = (UGAWidth - (TitleImage.Image.GetWidth() + (int)(TITLEICON_SPACING * ThemeX.Scale) + MenuWidth)) >> 1; + EntriesPosX = (UGAWidth - (TitleImage.Image.GetWidth() + (int)(TITLEICON_SPACING * ThemeX->Scale) + MenuWidth)) >> 1; // DBG("UGAWIdth=%lld TitleImage.Image=%lld MenuWidth=%lld\n", UGAWidth, // TitleImage.Image.GetWidth(), MenuWidth); MenuWidth += TitleImage.Image.GetWidth(); } else { EntriesPosX = (UGAWidth - MenuWidth) >> 1; } - TimeoutPosY = EntriesPosY + (Entries.size() + 1) * ThemeX.TextHeight; + TimeoutPosY = EntriesPosY + (Entries.size() + 1) * ThemeX->TextHeight; // set maximum allowed text length for menu content (this is applicable only for non-svg and non-proportional) MenuMaxTextLen = (UINTN)(MenuWidth / ScaledWidth); // initial painting - ThemeX.MeasureText(Title, &ItemWidth, NULL); - if (!(ThemeX.HideUIFlags & HIDEUI_FLAG_MENU_TITLE)) { - DrawTextXY(Title, (UGAWidth >> 1), EntriesPosY - ThemeX.TextHeight * 2, X_IS_CENTER); + ThemeX->MeasureText(Title, &ItemWidth, NULL); + if (!(ThemeX->HideUIFlags & HIDEUI_FLAG_MENU_TITLE)) { + DrawTextXY(Title, (UGAWidth >> 1), EntriesPosY - ThemeX->TextHeight * 2, X_IS_CENTER); } if (!TitleImage.isEmpty()) { - INTN FilmXPos = (INTN)(EntriesPosX - (TitleImage.Image.GetWidth() + (int)(TITLEICON_SPACING * ThemeX.Scale))); + INTN FilmXPos = (INTN)(EntriesPosX - (TitleImage.Image.GetWidth() + (int)(TITLEICON_SPACING * ThemeX->Scale))); INTN FilmYPos = (INTN)EntriesPosY; XBool free; XImage *tImage = TitleImage.GetBest(!Daylight, &free); @@ -1627,11 +1627,11 @@ void REFIT_MENU_SCREEN::GraphicsMenuStyle(IN UINTN Function, IN CONST CHAR16 *Pa if (InfoLines.size() > 0) { for (UINTN i = 0; i < InfoLines.size(); i++) { DrawMenuText(InfoLines[i], 0, EntriesPosX, EntriesPosY, 0xFFFF, 0); - EntriesPosY += ThemeX.TextHeight; + EntriesPosY += ThemeX->TextHeight; } - EntriesPosY += ThemeX.TextHeight; // also add a blank line + EntriesPosY += ThemeX->TextHeight; // also add a blank line } - ThemeX.InitBar(); + ThemeX->InitBar(); break; } @@ -1643,8 +1643,8 @@ void REFIT_MENU_SCREEN::GraphicsMenuStyle(IN UINTN Function, IN CONST CHAR16 *Pa { // DBG("PAINT_ALL: EntriesPosY=%lld MaxVisible=%lld\n", EntriesPosY, ScrollState.MaxVisible); // DBG("DownButton.Height=%lld TextHeight=%lld MenuWidth=%lld\n", DownButton.Height, TextHeight, MenuWidth); - t2 = EntriesPosY + (ScrollState.MaxVisible + 1) * ThemeX.TextHeight - DownButton.Height; - t1 = EntriesPosX + ThemeX.TextHeight + MenuWidth + (INTN)((TEXT_XMARGIN + 16) * ThemeX.Scale); + t2 = EntriesPosY + (ScrollState.MaxVisible + 1) * ThemeX->TextHeight - DownButton.Height; + t1 = EntriesPosX + ThemeX->TextHeight + MenuWidth + (INTN)((TEXT_XMARGIN + 16) * ThemeX->Scale); // DBG("PAINT_ALL: X=%lld Y=%lld\n", t1, t2); SetBar(t1, EntriesPosY, t2, &ScrollState); //823 302 554 /* @@ -1659,19 +1659,19 @@ void REFIT_MENU_SCREEN::GraphicsMenuStyle(IN UINTN Function, IN CONST CHAR16 *Pa for (INTN i = ScrollState.FirstVisible, j = 0; i <= ScrollState.LastVisible; i++, j++) { REFIT_ABSTRACT_MENU_ENTRY *Entry = &Entries[i]; ResultString = Entry->Title; //create a copy to modify later - if (!ThemeX.TypeSVG && !ThemeX.Proportional && ResultString.length() > MenuMaxTextLen) { + if (!ThemeX->TypeSVG && !ThemeX->Proportional && ResultString.length() > MenuMaxTextLen) { ResultString = ResultString.subString(0,MenuMaxTextLen-3) + L".."_XSW; } TitleLen = ResultString.length(); Entry->Place.XPos = EntriesPosX; - Entry->Place.YPos = EntriesPosY + j * ThemeX.TextHeight; + Entry->Place.YPos = EntriesPosY + j * ThemeX->TextHeight; Entry->Place.Width = TitleLen * ScaledWidth; - Entry->Place.Height = (UINTN)ThemeX.TextHeight; - PlaceCentre = (INTN)((ThemeX.TextHeight - (INTN)(ThemeX.Buttons[2].GetHeight())) * ThemeX.Scale / 2); - PlaceCentre1 = (INTN)((ThemeX.TextHeight - (INTN)(ThemeX.Buttons[0].GetHeight())) * ThemeX.Scale / 2); + Entry->Place.Height = (UINTN)ThemeX->TextHeight; + PlaceCentre = (INTN)((ThemeX->TextHeight - (INTN)(ThemeX->Buttons[2].GetHeight())) * ThemeX->Scale / 2); + PlaceCentre1 = (INTN)((ThemeX->TextHeight - (INTN)(ThemeX->Buttons[0].GetHeight())) * ThemeX->Scale / 2); // clovy - ctrlX = (ThemeX.TypeSVG) ? EntriesPosX : EntriesPosX + (INTN)(TEXT_XMARGIN * ThemeX.Scale); - ctrlTextX = ctrlX + ThemeX.Buttons[0].GetWidth() + (INTN)(TEXT_XMARGIN * ThemeX.Scale / 2); + ctrlX = (ThemeX->TypeSVG) ? EntriesPosX : EntriesPosX + (INTN)(TEXT_XMARGIN * ThemeX->Scale); + ctrlTextX = ctrlX + ThemeX->Buttons[0].GetWidth() + (INTN)(TEXT_XMARGIN * ThemeX->Scale / 2); ctrlY = Entry->Place.YPos + PlaceCentre; if ( Entry->getREFIT_INPUT_DIALOG() ) { @@ -1680,25 +1680,25 @@ void REFIT_MENU_SCREEN::GraphicsMenuStyle(IN UINTN Function, IN CONST CHAR16 *Pa //possible artefacts DrawMenuText(ResultString, (i == ScrollState.CurrentSelection) ? (MenuWidth) : 0, ctrlTextX, Entry->Place.YPos, 0xFFFF, MenuWidth); - ThemeX.FillRectAreaOfScreen((ctrlTextX + ctrlX) >> 1, Entry->Place.YPos, ctrlTextX - ctrlX, ThemeX.TextHeight); //clean head - ThemeX.Buttons[(inputDialogEntry->Item->BValue)?3:2].DrawOnBack(ctrlX, ctrlY, ThemeX.Background); + ThemeX->FillRectAreaOfScreen((ctrlTextX + ctrlX) >> 1, Entry->Place.YPos, ctrlTextX - ctrlX, ThemeX->TextHeight); //clean head + ThemeX->Buttons[(inputDialogEntry->Item->BValue)?3:2].DrawOnBack(ctrlX, ctrlY, ThemeX->Background); } else { // text input ResultString += inputDialogEntry->Item->SValue + L" "_XSW; // set cursor to beginning if it is outside of screen - if (!ThemeX.TypeSVG && !ThemeX.Proportional && (TitleLen + (INTN)Entry->Row) * ScaledWidth > MenuWidth) { + if (!ThemeX->TypeSVG && !ThemeX->Proportional && (TitleLen + (INTN)Entry->Row) * ScaledWidth > MenuWidth) { Entry->Row = 0; } // Slice - suppose to use Row as Cursor in text DrawMenuText(ResultString, (i == ScrollState.CurrentSelection) ? MenuWidth : 0, EntriesPosX, Entry->Place.YPos, TitleLen + Entry->Row, MenuWidth); - ThemeX.FillRectAreaOfScreen(MenuWidth + ((ctrlTextX + EntriesPosX) >> 1), Entry->Place.YPos, ctrlTextX - EntriesPosX, ThemeX.TextHeight); //clean tail + ThemeX->FillRectAreaOfScreen(MenuWidth + ((ctrlTextX + EntriesPosX) >> 1), Entry->Place.YPos, ctrlTextX - EntriesPosX, ThemeX->TextHeight); //clean tail } } else if (Entry->getREFIT_MENU_CHECKBIT()) { DrawMenuText(ResultString, (i == ScrollState.CurrentSelection) ? (MenuWidth) : 0, ctrlTextX, Entry->Place.YPos, 0xFFFF, MenuWidth); - ThemeX.FillRectAreaOfScreen((ctrlTextX + ctrlX) >> 1, Entry->Place.YPos, ctrlTextX - ctrlX, ThemeX.TextHeight); //clean head - ThemeX.Buttons[(((REFIT_INPUT_DIALOG*)(Entry))->Item->IValue & Entry->Row)?3:2].DrawOnBack(ctrlX, ctrlY, ThemeX.Background); + ThemeX->FillRectAreaOfScreen((ctrlTextX + ctrlX) >> 1, Entry->Place.YPos, ctrlTextX - ctrlX, ThemeX->TextHeight); //clean head + ThemeX->Buttons[(((REFIT_INPUT_DIALOG*)(Entry))->Item->IValue & Entry->Row)?3:2].DrawOnBack(ctrlX, ctrlY, ThemeX->Background); } else if (Entry->getREFIT_MENU_SWITCH()) { if (Entry->getREFIT_MENU_SWITCH()->Item->IValue == 3) { //OldChosenItem = OldChosenTheme; @@ -1715,13 +1715,13 @@ void REFIT_MENU_SCREEN::GraphicsMenuStyle(IN UINTN Function, IN CONST CHAR16 *Pa DrawMenuText(ResultString, (i == ScrollState.CurrentSelection) ? MenuWidth : 0, // clovy EntriesPosX + (TextHeight + (INTN)(TEXT_XMARGIN * GlobalConfig.Scale)), ctrlTextX, Entry->Place.YPos, 0xFFFF, MenuWidth); - ThemeX.FillRectAreaOfScreen((ctrlTextX + ctrlX) >> 1, Entry->Place.YPos, ctrlTextX - ctrlX, ThemeX.TextHeight); //clean head - ThemeX.Buttons[(Entry->Row == OldChosenItem)?1:0].DrawOnBack(ctrlX, ctrlY, ThemeX.Background); + ThemeX->FillRectAreaOfScreen((ctrlTextX + ctrlX) >> 1, Entry->Place.YPos, ctrlTextX - ctrlX, ThemeX->TextHeight); //clean head + ThemeX->Buttons[(Entry->Row == OldChosenItem)?1:0].DrawOnBack(ctrlX, ctrlY, ThemeX->Background); } else { //DBG("paint entry %d title=%ls\n", i, Entries[i]->Title); DrawMenuText(ResultString, (i == ScrollState.CurrentSelection) ? MenuWidth : 0, EntriesPosX, Entry->Place.YPos, 0xFFFF, MenuWidth); - ThemeX.FillRectAreaOfScreen(MenuWidth + ((ctrlTextX + EntriesPosX) >> 1), Entry->Place.YPos, ctrlTextX - EntriesPosX, ThemeX.TextHeight); //clean tail + ThemeX->FillRectAreaOfScreen(MenuWidth + ((ctrlTextX + EntriesPosX) >> 1), Entry->Place.YPos, ctrlTextX - EntriesPosX, ThemeX->TextHeight); //clean tail } } @@ -1736,19 +1736,19 @@ void REFIT_MENU_SCREEN::GraphicsMenuStyle(IN UINTN Function, IN CONST CHAR16 *Pa // last selection ResultString = EntryL->Title; - if (!ThemeX.TypeSVG && !ThemeX.Proportional && ResultString.length() > MenuMaxTextLen) { + if (!ThemeX->TypeSVG && !ThemeX->Proportional && ResultString.length() > MenuMaxTextLen) { ResultString = ResultString.subString(0,MenuMaxTextLen-3) + L".."_XSW; } TitleLen = ResultString.length(); //clovy//PlaceCentre = (TextHeight - (INTN)(Buttons[2]->Height * GlobalConfig.Scale)) / 2; //clovy//PlaceCentre = (PlaceCentre>0)?PlaceCentre:0; //clovy//PlaceCentre1 = (TextHeight - (INTN)(Buttons[0]->Height * GlobalConfig.Scale)) / 2; - PlaceCentre = (INTN)((ThemeX.TextHeight - (INTN)(ThemeX.Buttons[2].GetHeight())) * ThemeX.Scale / 2); - PlaceCentre1 = (INTN)((ThemeX.TextHeight - (INTN)(ThemeX.Buttons[0].GetHeight())) * ThemeX.Scale / 2); + PlaceCentre = (INTN)((ThemeX->TextHeight - (INTN)(ThemeX->Buttons[2].GetHeight())) * ThemeX->Scale / 2); + PlaceCentre1 = (INTN)((ThemeX->TextHeight - (INTN)(ThemeX->Buttons[0].GetHeight())) * ThemeX->Scale / 2); // clovy - ctrlX = (ThemeX.TypeSVG) ? EntriesPosX : EntriesPosX + (INTN)(TEXT_XMARGIN * ThemeX.Scale); - ctrlTextX = ctrlX + ThemeX.Buttons[0].GetWidth() + (INTN)(TEXT_XMARGIN * ThemeX.Scale / 2); + ctrlX = (ThemeX->TypeSVG) ? EntriesPosX : EntriesPosX + (INTN)(TEXT_XMARGIN * ThemeX->Scale); + ctrlTextX = ctrlX + ThemeX->Buttons[0].GetWidth() + (INTN)(TEXT_XMARGIN * ThemeX->Scale / 2); // redraw selection cursor // 1. blackosx swapped this around so drawing of selection comes before drawing scrollbar. @@ -1759,12 +1759,12 @@ void REFIT_MENU_SCREEN::GraphicsMenuStyle(IN UINTN Function, IN CONST CHAR16 *Pa //clovy DrawMenuText(ResultString, 0, ctrlTextX, EntryL->Place.YPos, 0xFFFF, MenuWidth); - ThemeX.Buttons[(inputDialogEntry->Item->BValue)?3:2].DrawOnBack(ctrlX, EntryL->Place.YPos + PlaceCentre, ThemeX.Background); + ThemeX->Buttons[(inputDialogEntry->Item->BValue)?3:2].DrawOnBack(ctrlX, EntryL->Place.YPos + PlaceCentre, ThemeX->Background); } else { ResultString += (inputDialogEntry->Item->SValue.wc_str() + inputDialogEntry->Item->LineShift) + L" "_XSW; DrawMenuText(ResultString, 0, EntriesPosX, EntryL->Place.YPos, TitleLen + EntryL->Row, MenuWidth); - ThemeX.FillRectAreaOfScreen(MenuWidth + ((ctrlTextX + EntriesPosX) >> 1), EntryL->Place.YPos, ctrlTextX - EntriesPosX, ThemeX.TextHeight); //clean tail + ThemeX->FillRectAreaOfScreen(MenuWidth + ((ctrlTextX + EntriesPosX) >> 1), EntryL->Place.YPos, ctrlTextX - EntriesPosX, ThemeX->TextHeight); //clean tail } } else if (EntryL->getREFIT_MENU_SWITCH()) { //radio buttons 0,1 if (EntryL->getREFIT_MENU_SWITCH()->Item->IValue == 3) { @@ -1781,21 +1781,21 @@ void REFIT_MENU_SCREEN::GraphicsMenuStyle(IN UINTN Function, IN CONST CHAR16 *Pa // clovy DrawMenuText(ResultString, 0, ctrlTextX, EntryL->Place.YPos, 0xFFFF, MenuWidth); - ThemeX.Buttons[(EntryL->Row == OldChosenItem)?1:0].DrawOnBack(ctrlX, EntryL->Place.YPos + PlaceCentre1, ThemeX.Background); + ThemeX->Buttons[(EntryL->Row == OldChosenItem)?1:0].DrawOnBack(ctrlX, EntryL->Place.YPos + PlaceCentre1, ThemeX->Background); } else if (EntryL->getREFIT_MENU_CHECKBIT()) { // clovy DrawMenuText(ResultString, 0, ctrlTextX, EntryL->Place.YPos, 0xFFFF, MenuWidth); - ThemeX.Buttons[(EntryL->getREFIT_MENU_CHECKBIT()->Item->IValue & EntryL->Row) ?3:2].DrawOnBack(ctrlX, EntryL->Place.YPos + PlaceCentre, ThemeX.Background); + ThemeX->Buttons[(EntryL->getREFIT_MENU_CHECKBIT()->Item->IValue & EntryL->Row) ?3:2].DrawOnBack(ctrlX, EntryL->Place.YPos + PlaceCentre, ThemeX->Background); } else { DrawMenuText(ResultString, 0, EntriesPosX, EntryL->Place.YPos, 0xFFFF, MenuWidth); - ThemeX.FillRectAreaOfScreen(MenuWidth + ((ctrlTextX + EntriesPosX) >> 1), EntryL->Place.YPos, ctrlTextX - EntriesPosX, ThemeX.TextHeight); //clean tail + ThemeX->FillRectAreaOfScreen(MenuWidth + ((ctrlTextX + EntriesPosX) >> 1), EntryL->Place.YPos, ctrlTextX - EntriesPosX, ThemeX->TextHeight); //clean tail } // current selection ResultString = EntryC->Title; - if (!ThemeX.TypeSVG && !ThemeX.Proportional && ResultString.length() > MenuMaxTextLen) { + if (!ThemeX->TypeSVG && !ThemeX->Proportional && ResultString.length() > MenuMaxTextLen) { ResultString = ResultString.subString(0,MenuMaxTextLen-3) + L".."_XSW; } TitleLen = ResultString.length(); @@ -1818,7 +1818,7 @@ void REFIT_MENU_SCREEN::GraphicsMenuStyle(IN UINTN Function, IN CONST CHAR16 *Pa if (inputDialogEntry->Item->ItemType == BoolValue) { //checkbox DrawMenuText(ResultString, MenuWidth, ctrlTextX, EntryC->Place.YPos, 0xFFFF, MenuWidth); - ThemeX.Buttons[(inputDialogEntry->Item->BValue)?3:2].DrawOnBack(ctrlX, EntryC->Place.YPos + PlaceCentre, ThemeX.Background); + ThemeX->Buttons[(inputDialogEntry->Item->BValue)?3:2].DrawOnBack(ctrlX, EntryC->Place.YPos + PlaceCentre, ThemeX->Background); } else { ResultString += (inputDialogEntry->Item->SValue.wc_str() + inputDialogEntry->Item->LineShift) + L" "_XSW; DrawMenuText(ResultString, MenuWidth, @@ -1827,11 +1827,11 @@ void REFIT_MENU_SCREEN::GraphicsMenuStyle(IN UINTN Function, IN CONST CHAR16 *Pa } else if (EntryC->getREFIT_MENU_SWITCH()) { //radio DrawMenuText(ResultString, MenuWidth, ctrlTextX, EntryC->Place.YPos, 0xFFFF, MenuWidth); - ThemeX.Buttons[(EntryC->Row == OldChosenItem)?1:0].DrawOnBack(ctrlX, EntryC->Place.YPos + PlaceCentre1, ThemeX.Background); + ThemeX->Buttons[(EntryC->Row == OldChosenItem)?1:0].DrawOnBack(ctrlX, EntryC->Place.YPos + PlaceCentre1, ThemeX->Background); } else if (EntryC->getREFIT_MENU_CHECKBIT()) { DrawMenuText(ResultString, MenuWidth, ctrlTextX, EntryC->Place.YPos, 0xFFFF, MenuWidth); - ThemeX.Buttons[(EntryC->getREFIT_MENU_CHECKBIT()->Item->IValue & EntryC->Row)?3:2].DrawOnBack(ctrlX, EntryC->Place.YPos + PlaceCentre, ThemeX.Background); + ThemeX->Buttons[(EntryC->getREFIT_MENU_CHECKBIT()->Item->IValue & EntryC->Row)?3:2].DrawOnBack(ctrlX, EntryC->Place.YPos + PlaceCentre, ThemeX->Background); } else { DrawMenuText(ResultString, MenuWidth, EntriesPosX, EntryC->Place.YPos, 0xFFFF, MenuWidth); @@ -2052,7 +2052,7 @@ void REFIT_MENU_SCREEN::UpdateFilm() XImage Frame = FilmC->GetImage(); //take current image if (!Frame.isEmpty()) { - Frame.DrawOnBack(FilmC->FilmPlace.XPos, FilmC->FilmPlace.YPos, ThemeX.Background); + Frame.DrawOnBack(FilmC->FilmPlace.XPos, FilmC->FilmPlace.YPos, ThemeX->Background); } FilmC->Advance(); //next frame no matter if previous was not found if (FilmC->Finished()) { //first loop finished diff --git a/rEFIt_UEFI/gui/menu_items/menu_items.h b/rEFIt_UEFI/gui/menu_items/menu_items.h index aa285a09b..80837e7d6 100644 --- a/rEFIt_UEFI/gui/menu_items/menu_items.h +++ b/rEFIt_UEFI/gui/menu_items/menu_items.h @@ -355,7 +355,7 @@ class REFIT_ABSTRACT_MENU_ENTRY EFI_GUID APFSTargetUUID; XStringW DisplayedVolName; - XStringW OSName; + XStringW OSName = XStringW(); EFI_DEVICE_PATH *DevicePath; UINT16 Flags; UINT8 LoaderType; diff --git a/rEFIt_UEFI/libeg/VectorGraphics.cpp b/rEFIt_UEFI/libeg/VectorGraphics.cpp index 90b1b4833..03b4a4c0c 100755 --- a/rEFIt_UEFI/libeg/VectorGraphics.cpp +++ b/rEFIt_UEFI/libeg/VectorGraphics.cpp @@ -247,7 +247,7 @@ EFI_STATUS XTheme::ParseSVGXTheme(CONST CHAR8* buffer) BigBack.setEmpty(); } Status = EFI_NOT_FOUND; - if (!ThemeX.Daylight) { + if (!ThemeX->Daylight) { Status = ParseSVGXIcon(BUILTIN_ICON_BACKGROUND, "Background_night"_XS8, &BigBack, NULL); //we should have a place for SVG background } if (EFI_ERROR(Status)) { @@ -257,7 +257,7 @@ EFI_STATUS XTheme::ParseSVGXTheme(CONST CHAR8* buffer) // --- Make Banner Banner.setEmpty(); //for the case of theme switch Status = EFI_NOT_FOUND; - if (!ThemeX.Daylight) { + if (!ThemeX->Daylight) { Status = ParseSVGXIcon(BUILTIN_ICON_BANNER, "Banner_night"_XS8, &Banner, NULL); } if (EFI_ERROR(Status)) { @@ -393,7 +393,7 @@ EFI_STATUS XTheme::ParseSVGXTheme(CONST CHAR8* buffer) NewFilm->RunOnce = IsPropertyTrue(Dict2); NewFilm->GetFrames(ThemeX); //used properties: ID, Path, NumFrames - ThemeX.Cinema.AddFilm(NewFilm); + ThemeX->Cinema.AddFilm(NewFilm); // delete NewFilm; //looks like already deleted } } @@ -454,7 +454,7 @@ INTN renderSVGtext(XImage* TextBufferXY_ptr, INTN posX, INTN posY, INTN textType } NSVGfont* fontSVG = textFace[textType].font; UINT32 color = textFace[textType].color; - INTN Height = (INTN)(textFace[textType].size * ThemeX.Scale); + INTN Height = (INTN)(textFace[textType].size * ThemeX->Scale); float Scale, sy; float x, y; if (!fontSVG) { diff --git a/rEFIt_UEFI/libeg/XPointer.cpp b/rEFIt_UEFI/libeg/XPointer.cpp index d85439f31..a65a940e7 100644 --- a/rEFIt_UEFI/libeg/XPointer.cpp +++ b/rEFIt_UEFI/libeg/XPointer.cpp @@ -77,7 +77,7 @@ EFI_STATUS XPointer::MouseBirth() PointerImage = nullptr; } // Now update image because of other theme has other image - PointerImage = new XImage(*ThemeX.GetIconP(BUILTIN_ICON_POINTER)->GetBest(night)); + PointerImage = new XImage(*ThemeX->GetIconP(BUILTIN_ICON_POINTER)->GetBest(night)); oldImage.setSizeInPixels(PointerImage->GetWidth(), PointerImage->GetHeight()); LastClickTime = 0; diff --git a/rEFIt_UEFI/libeg/XTheme.cpp b/rEFIt_UEFI/libeg/XTheme.cpp index c4ac98612..51a0d0d45 100644 --- a/rEFIt_UEFI/libeg/XTheme.cpp +++ b/rEFIt_UEFI/libeg/XTheme.cpp @@ -31,7 +31,7 @@ extern "C" { #define DBG(...) DebugLog(DEBUG_XTHEME, __VA_ARGS__) #endif -XTheme ThemeX; +XTheme* ThemeX = NULL; EFI_STATUS @@ -46,7 +46,7 @@ InitTheme(const CHAR8* ChosenTheme) gRT->GetTime(&Now, NULL); DbgHeader("InitXTheme"); - ThemeX.Init(); + ThemeX->Init(); //initialize Daylight when we know timezone if (gSettings.GUI.Timezone != 0xFF) { // 0xFF:default=timezone not set @@ -54,11 +54,11 @@ InitTheme(const CHAR8* ChosenTheme) // DBG("now is %d, zone is %d\n", Now.Hour, gSettings.GUI.Timezone); if (NowHour < 0 ) NowHour += 24; if (NowHour >= 24 ) NowHour -= 24; - ThemeX.Daylight = (NowHour > 8) && (NowHour < 20); + ThemeX->Daylight = (NowHour > 8) && (NowHour < 20); } else { - ThemeX.Daylight = true; // when timezone is not set + ThemeX->Daylight = true; // when timezone is not set } - if (ThemeX.Daylight) { + if (ThemeX->Daylight) { DBG("use Daylight theme\n"); } else { DBG("use night theme\n"); @@ -91,12 +91,12 @@ InitTheme(const CHAR8* ChosenTheme) mainParser = NULL; } */ - ThemeX.FontImage.setEmpty(); + ThemeX->FontImage.setEmpty(); Rnd = (ThemeNameArray.size() != 0) ? Now.Second % ThemeNameArray.size() : 0; // DBG("...done\n"); - ThemeX.GetThemeTagSettings(NULL); + ThemeX->GetThemeTagSettings(NULL); if (ThemeNameArray.size() > 0 && (gSettings.GUI.Theme.isEmpty() || StriCmp(gSettings.GUI.Theme.wc_str(), L"embedded") != 0)) { @@ -110,10 +110,10 @@ InitTheme(const CHAR8* ChosenTheme) } if (TestTheme.notEmpty()) { - ThemeDict = ThemeX.LoadTheme(TestTheme); + ThemeDict = ThemeX->LoadTheme(TestTheme); if (ThemeDict != NULL) { DBG("special theme %ls found and %ls parsed\n", TestTheme.wc_str(), CONFIG_THEME_FILENAME); -// ThemeX.Theme.takeValueFrom(TestTheme); +// ThemeX->Theme.takeValueFrom(TestTheme); gSettings.GUI.Theme = TestTheme; } else { // special theme not loaded @@ -128,16 +128,16 @@ InitTheme(const CHAR8* ChosenTheme) goto finish; } if (AsciiStrCmp(ChosenTheme, "random") == 0) { - ThemeDict = ThemeX.LoadTheme(XStringW(ThemeNameArray[Rnd])); + ThemeDict = ThemeX->LoadTheme(XStringW(ThemeNameArray[Rnd])); goto finish; } TestTheme.takeValueFrom(ChosenTheme); if (TestTheme.notEmpty()) { - ThemeDict = ThemeX.LoadTheme (TestTheme); + ThemeDict = ThemeX->LoadTheme (TestTheme); if (ThemeDict != NULL) { DBG("theme %s defined in NVRAM found and %ls parsed\n", ChosenTheme, CONFIG_THEME_FILENAME); -// ThemeX.Theme.takeValueFrom(TestTheme); +// ThemeX->Theme.takeValueFrom(TestTheme); gSettings.GUI.Theme = TestTheme; } else { // theme from nvram not loaded if (gSettings.GUI.Theme.notEmpty()) { @@ -155,12 +155,12 @@ InitTheme(const CHAR8* ChosenTheme) if (ThemeDict == NULL) { if (gSettings.GUI.Theme.isEmpty()) { DBG("no default theme, get random theme %ls\n", ThemeNameArray[Rnd].wc_str()); - ThemeDict = ThemeX.LoadTheme(XStringW(ThemeNameArray[Rnd])); + ThemeDict = ThemeX->LoadTheme(XStringW(ThemeNameArray[Rnd])); } else { if (StriCmp(gSettings.GUI.Theme.wc_str(), L"random") == 0) { - ThemeDict = ThemeX.LoadTheme(XStringW(ThemeNameArray[Rnd])); + ThemeDict = ThemeX->LoadTheme(XStringW(ThemeNameArray[Rnd])); } else { - ThemeDict = ThemeX.LoadTheme(gSettings.GUI.Theme); + ThemeDict = ThemeX->LoadTheme(gSettings.GUI.Theme); if (ThemeDict == NULL) { DBG("GlobalConfig: %ls not found, get embedded theme\n", gSettings.GUI.Theme.wc_str()); } else { @@ -174,55 +174,55 @@ InitTheme(const CHAR8* ChosenTheme) finish: if (!ThemeDict) { // No theme could be loaded, use embedded DBG(" using embedded theme\n"); - if (ThemeX.DarkEmbedded) { // when using embedded, set Daylight according to darkembedded - ThemeX.Daylight = false; + if (ThemeX->DarkEmbedded) { // when using embedded, set Daylight according to darkembedded + ThemeX->Daylight = false; } else { - ThemeX.Daylight = true; + ThemeX->Daylight = true; } - ThemeX.FillByEmbedded(); + ThemeX->FillByEmbedded(); OldChosenTheme = 0xFFFF; - ThemeX.closeThemeDir(); -// if (ThemeX.ThemeDir != NULL) { -// ThemeX.ThemeDir->Close(ThemeX.ThemeDir); -// ThemeX.ThemeDir = NULL; + ThemeX->closeThemeDir(); +// if (ThemeX->ThemeDir != NULL) { +// ThemeX->ThemeDir->Close(ThemeX->ThemeDir); +// ThemeX->ThemeDir = NULL; // } - // ThemeX.GetThemeTagSettings(NULL); already done + // ThemeX->GetThemeTagSettings(NULL); already done //fill some fields - //ThemeX.Font = FONT_ALFA; //to be inverted later. At start we have FONT_GRAY - ThemeX.embedded = true; - Status = StartupSoundPlay(&ThemeX.getThemeDir(), NULL); + //ThemeX->Font = FONT_ALFA; //to be inverted later. At start we have FONT_GRAY + ThemeX->embedded = true; + Status = StartupSoundPlay(&ThemeX->getThemeDir(), NULL); } else { // theme loaded successfully - ThemeX.embedded = false; - ThemeX.Theme.takeValueFrom(gSettings.GUI.Theme); //XStringW from CHAR16*) + ThemeX->embedded = false; + ThemeX->Theme.takeValueFrom(gSettings.GUI.Theme); //XStringW from CHAR16*) // read theme settings - if (!ThemeX.TypeSVG) { + if (!ThemeX->TypeSVG) { const TagDict* DictPointer = ThemeDict->dictPropertyForKey("Theme"); if (DictPointer != NULL) { - Status = ThemeX.GetThemeTagSettings(DictPointer); + Status = ThemeX->GetThemeTagSettings(DictPointer); if (EFI_ERROR(Status)) { DBG("Config theme error: %s\n", efiStrError(Status)); } else { - ThemeX.FillByDir(); + ThemeX->FillByDir(); } } } ThemeDict->FreeTag(); - if (!ThemeX.Daylight) { - Status = StartupSoundPlay(&ThemeX.getThemeDir(), L"sound_night.wav"); + if (!ThemeX->Daylight) { + Status = StartupSoundPlay(&ThemeX->getThemeDir(), L"sound_night.wav"); if (EFI_ERROR(Status)) { - Status = StartupSoundPlay(&ThemeX.getThemeDir(), L"sound.wav"); + Status = StartupSoundPlay(&ThemeX->getThemeDir(), L"sound.wav"); } } else { - Status = StartupSoundPlay(&ThemeX.getThemeDir(), L"sound.wav"); + Status = StartupSoundPlay(&ThemeX->getThemeDir(), L"sound.wav"); } } for (i = 0; i < ThemeNameArray.size(); i++) { - if ( ThemeX.Theme.isEqualIC(ThemeNameArray[i]) ) { + if ( ThemeX->Theme.isEqualIC(ThemeNameArray[i]) ) { OldChosenTheme = i; break; } @@ -230,11 +230,11 @@ finish: if (ChosenTheme != NULL) { FreePool(ChosenTheme); } - if (!ThemeX.TypeSVG) { - ThemeX.PrepareFont(); + if (!ThemeX->TypeSVG) { + ThemeX->PrepareFont(); } - //ThemeX.ClearScreen(); + //ThemeX->ClearScreen(); return Status; } @@ -513,7 +513,7 @@ XTheme::GetThemeTagSettings(const TagDict* DictPointer) BadgeOffsetY = GetPropertyAsInteger(Prop, BadgeOffsetY); Prop = Dict->propertyForKey("Scale"); - ThemeX.BadgeScale = GetPropertyAsInteger(Prop, BadgeScale); + ThemeX->BadgeScale = GetPropertyAsInteger(Prop, BadgeScale); } Dict = DictPointer->dictPropertyForKey("Origination"); @@ -734,8 +734,8 @@ XTheme::GetThemeTagSettings(const TagDict* DictPointer) Prop = Dict3->propertyForKey("Once"); NewFilm->RunOnce = IsPropertyNotNullAndTrue(Prop); - NewFilm->GetFrames(ThemeX); //used properties: ID, Path, NumFrames - ThemeX.Cinema.AddFilm(NewFilm); + NewFilm->GetFrames(*ThemeX); //used properties: ID, Path, NumFrames + ThemeX->Cinema.AddFilm(NewFilm); // delete NewFilm; //looks like already deleted } } diff --git a/rEFIt_UEFI/libeg/XTheme.h b/rEFIt_UEFI/libeg/XTheme.h index 9f7206621..3a70e523b 100644 --- a/rEFIt_UEFI/libeg/XTheme.h +++ b/rEFIt_UEFI/libeg/XTheme.h @@ -200,7 +200,7 @@ protected: }; -extern XTheme ThemeX; +extern XTheme* ThemeX; #endif diff --git a/rEFIt_UEFI/libeg/nanosvg.cpp b/rEFIt_UEFI/libeg/nanosvg.cpp index ad212d06a..34983e072 100755 --- a/rEFIt_UEFI/libeg/nanosvg.cpp +++ b/rEFIt_UEFI/libeg/nanosvg.cpp @@ -2994,7 +2994,7 @@ static void nsvg__parseText(NSVGparser* p, char** dict) // DBG("required font %s not found, try to load external\n", text->fontFace->fontFamily); XStringW FontFileName = XStringW().takeValueFrom(text->fontFace->fontFamily) + L".svg"_XSW; // DBG(" file name =%ls\n", FontFileName.wc_str()); - Status = egLoadFile(&ThemeX.getThemeDir(), FontFileName.wc_str(), &FileData, &FileDataLength); + Status = egLoadFile(&ThemeX->getThemeDir(), FontFileName.wc_str(), &FileData, &FileDataLength); // DBG(" font %s loaded status=%lld, %s\n", text->fontFace->fontFamily, Status, efiStrError(Status)); if (!EFI_ERROR(Status)) { p1 = nsvgParse((CHAR8*)FileData, 72, 1.0f); //later we will free parser p1 @@ -3032,8 +3032,8 @@ static void nsvg__parseText(NSVGparser* p, char** dict) // DBG("set message->font=%s color=%X size=%f as in MessageRow\n", fontSVG->fontFamily, text->fontColor, text->fontSize); } break; - } else if (!ThemeX.Daylight && strcmp(group->id, "MessageRow_night") == 0) { - //replace ThemeX.Daylight settings + } else if (!ThemeX->Daylight && strcmp(group->id, "MessageRow_night") == 0) { + //replace ThemeX->Daylight settings p->font = fontSVG; p->fontSize = text->fontSize; p->fontColor = text->fontColor; @@ -3052,7 +3052,7 @@ static void nsvg__parseText(NSVGparser* p, char** dict) // DBG("set menu->font=%s color=%X size=%f as in MenuRows\n", fontSVG->fontFamily, text->fontColor, text->fontSize); } break; - } else if (!ThemeX.Daylight && strcmp(group->id, "MenuRows_night") == 0) { + } else if (!ThemeX->Daylight && strcmp(group->id, "MenuRows_night") == 0) { textFace[2].font = fontSVG; textFace[2].size = (INTN)text->fontSize; textFace[2].color = text->fontColor; @@ -3067,7 +3067,7 @@ static void nsvg__parseText(NSVGparser* p, char** dict) // DBG("set help->font=%s color=%X size=%f as in HelpRows\n", fontSVG->fontFamily, text->fontColor, text->fontSize); } break; - } else if (!ThemeX.Daylight && strstr(group->id, "HelpRows_night") != NULL) { + } else if (!ThemeX->Daylight && strstr(group->id, "HelpRows_night") != NULL) { textFace[0].font = fontSVG; textFace[0].size = (INTN)text->fontSize; textFace[0].color = text->fontColor; @@ -3640,12 +3640,12 @@ void XTheme::parseTheme(void* parser, char** dict) BadgeScale = getIntegerDict(dict[i + 1]); } else if (strcmp(dict[i], "SelectionColor") == 0) { Color = getIntegerDict(dict[i + 1]); - if (ThemeX.Daylight) { + if (ThemeX->Daylight) { SelectionColor = Color; } } else if (strcmp(dict[i], "SelectionColor_night") == 0) { found = true; - if (!ThemeX.Daylight) { + if (!ThemeX->Daylight) { SelectionColor = getIntegerDict(dict[i + 1]); } } else if (strcmp(dict[i], "VerticalLayout") == 0) { @@ -4012,7 +4012,7 @@ static void nsvg__startElement(void* ud, const char* el, char** dict) p->patternFlag = 1; } else if (strcmp(el, "clover:theme") == 0) { - ThemeX.parseTheme((void*)p, dict); + ThemeX->parseTheme((void*)p, dict); } else { strncpy(p->unknown, el, 63); diff --git a/rEFIt_UEFI/libeg/text.cpp b/rEFIt_UEFI/libeg/text.cpp index 3d90c59d7..cc68db246 100644 --- a/rEFIt_UEFI/libeg/text.cpp +++ b/rEFIt_UEFI/libeg/text.cpp @@ -121,7 +121,7 @@ void XTheme::LoadFontImage(IN XBool UseEmbedded, IN INTN Rows, IN INTN Cols) if (EFI_ERROR(Status)) { //then take from common font folder -// fontFilePath = SWPrintf(L"%s\\%s", commonFontDir, isKorean ? L"FontKorean.png" : ThemeX.FontFileName.data()); +// fontFilePath = SWPrintf(L"%s\\%s", commonFontDir, isKorean ? L"FontKorean.png" : ThemeX->FontFileName.data()); fontFilePath = commonFontDir + FontFileName; Status = NewImage.LoadXImage(&self.getCloverDir(), fontFilePath); //else use embedded even if it is not embedded @@ -162,8 +162,8 @@ void XTheme::LoadFontImage(IN XBool UseEmbedded, IN INTN Rows, IN INTN Cols) (PixelPtr->Red == FirstPixel.Red) ) { PixelPtr->Reserved = 0; //if a pixel has same color as first pixel then it will be transparent - //} else if (ThemeX.DarkEmbedded) { - } else if (ThemeX.embedded && !ThemeX.Daylight) { + //} else if (ThemeX->DarkEmbedded) { + } else if (ThemeX->embedded && !ThemeX->Daylight) { *PixelPtr = SemiWhitePixel; //special case to change a text to semi white, not blue pixels } FontPtr[Ypos + x] = *PixelPtr++; //not (x, YPos) !!! diff --git a/rEFIt_UEFI/refit/lib.cpp b/rEFIt_UEFI/refit/lib.cpp index d6eede3bf..4ced09a96 100644 --- a/rEFIt_UEFI/refit/lib.cpp +++ b/rEFIt_UEFI/refit/lib.cpp @@ -173,7 +173,7 @@ void UninitRefitLib(void) { // called before running external programs to close open file handles - ThemeX.closeThemeDir(); + ThemeX->closeThemeDir(); selfOem.closeHandle(); self.closeHandle(); @@ -190,7 +190,7 @@ EFI_STATUS ReinitRefitLib(void) selfOem.reInitialize(); ReinitVolumes(); - ThemeX.openThemeDir(); + ThemeX->openThemeDir(); return EFI_SUCCESS; } @@ -1144,7 +1144,7 @@ void ReinitVolumes(void) EFI_STATUS Status; REFIT_VOLUME *Volume; UINTN VolumeIndex; - UINTN VolumesFound = 0; + //UINTN VolumesFound = 0; // Jief not sure what this is, see my comment at the end of this function const EFI_DEVICE_PATH *RemainingDevicePath; EFI_HANDLE DeviceHandle, WholeDiskHandle; @@ -1155,7 +1155,7 @@ void ReinitVolumes(void) } DBG("Volume %llu at reinit found:\n", VolumeIndex); DBG("Volume->DevicePath=%ls\n", FileDevicePathToXStringW(Volume->DevicePath).wc_str()); - VolumesFound++; + //olumesFound++; if (Volume->DevicePath != NULL) { // get the handle for that path RemainingDevicePath = Volume->DevicePath; diff --git a/rEFIt_UEFI/refit/main.cpp b/rEFIt_UEFI/refit/main.cpp index cefd22741..1edf5cb09 100644 --- a/rEFIt_UEFI/refit/main.cpp +++ b/rEFIt_UEFI/refit/main.cpp @@ -1684,7 +1684,7 @@ void LEGACY_ENTRY::StartLegacy() egClearScreen(&MenuBackgroundPixel); BeginExternalScreen(true/*, L"Booting Legacy OS"*/); XImage BootLogoX; - BootLogoX.LoadXImage(&ThemeX.getThemeDir(), Volume->LegacyOS->IconName); + BootLogoX.LoadXImage(&ThemeX->getThemeDir(), Volume->LegacyOS->IconName); BootLogoX.Draw((UGAWidth - BootLogoX.GetWidth()) >> 1, (UGAHeight - BootLogoX.GetHeight()) >> 1); @@ -2823,7 +2823,7 @@ RefitMain (IN EFI_HANDLE ImageHandle, // SmbiosList.setEmpty(); // SmbiosList.AddReference(new XStringW(L"auto"_XSW), true); } -// ThemeX.FillByEmbedded(); //init XTheme before EarlyUserSettings +// ThemeX->FillByEmbedded(); //init XTheme before EarlyUserSettings { void *Value = NULL; UINTN Size = 0; @@ -2889,6 +2889,8 @@ RefitMain (IN EFI_HANDLE ImageHandle, return Status; } + ThemeX = new XTheme(); + // DBG("DBG: messages\n"); if (!gSettings.Boot.NoEarlyProgress && !GlobalConfig.isFastBoot() && gSettings.Boot.Timeout>0) { XStringW Message = SWPrintf(" Welcome to Clover %ls ", gFirmwareRevision); @@ -2981,10 +2983,10 @@ RefitMain (IN EFI_HANDLE ImageHandle, HelpMenu.Entries.setEmpty(); } DBG("theme inited\n"); - if (ThemeX.embedded) { + if (ThemeX->embedded) { DBG("Chosen embedded theme\n"); } else { - DBG("Chosen theme %ls\n", ThemeX.Theme.wc_str()); + DBG("Chosen theme %ls\n", ThemeX->Theme.wc_str()); } //now it is a time to set RtVariables @@ -3023,7 +3025,7 @@ RefitMain (IN EFI_HANDLE ImageHandle, } // fixed other menu entries - if (!(ThemeX.HideUIFlags & HIDEUI_FLAG_TOOLS)) { + if (!(ThemeX->HideUIFlags & HIDEUI_FLAG_TOOLS)) { AddCustomTool(); if (!gSettings.GUI.Scan.DisableToolScan) { ScanTool(); @@ -3034,27 +3036,27 @@ RefitMain (IN EFI_HANDLE ImageHandle, } } - MenuEntryOptions.Image = ThemeX.GetIcon(BUILTIN_ICON_FUNC_OPTIONS); + MenuEntryOptions.Image = ThemeX->GetIcon(BUILTIN_ICON_FUNC_OPTIONS); // DBG("Options: IconID=%lld name=%s empty=%s\n", MenuEntryOptions.Image.Id, MenuEntryOptions.Image.Name.c_str(), if (gSettings.Boot.DisableCloverHotkeys) MenuEntryOptions.ShortcutLetter = 0x00; MainMenu.AddMenuEntry(&MenuEntryOptions, false); - MenuEntryAbout.Image = ThemeX.GetIcon((INTN)BUILTIN_ICON_FUNC_ABOUT); + MenuEntryAbout.Image = ThemeX->GetIcon((INTN)BUILTIN_ICON_FUNC_ABOUT); // DBG("About: IconID=%lld name=%s empty=%s\n", MenuEntryAbout.Image.Id, MenuEntryAbout.Image.Name.c_str(), if (gSettings.Boot.DisableCloverHotkeys) MenuEntryAbout.ShortcutLetter = 0x00; MainMenu.AddMenuEntry(&MenuEntryAbout, false); - if (!(ThemeX.HideUIFlags & HIDEUI_FLAG_FUNCS) || MainMenu.Entries.size() == 0) { + if (!(ThemeX->HideUIFlags & HIDEUI_FLAG_FUNCS) || MainMenu.Entries.size() == 0) { if (gSettings.Boot.DisableCloverHotkeys) MenuEntryReset.ShortcutLetter = 0x00; - MenuEntryReset.Image = ThemeX.GetIcon(BUILTIN_ICON_FUNC_RESET); + MenuEntryReset.Image = ThemeX->GetIcon(BUILTIN_ICON_FUNC_RESET); MainMenu.AddMenuEntry(&MenuEntryReset, false); if (gSettings.Boot.DisableCloverHotkeys) MenuEntryShutdown.ShortcutLetter = 0x00; - MenuEntryShutdown.Image = ThemeX.GetIcon(BUILTIN_ICON_FUNC_EXIT); + MenuEntryShutdown.Image = ThemeX->GetIcon(BUILTIN_ICON_FUNC_EXIT); MainMenu.AddMenuEntry(&MenuEntryShutdown, false); } @@ -3096,7 +3098,7 @@ RefitMain (IN EFI_HANDLE ImageHandle, MainMenu.GetAnime(); if (GlobalConfig.gThemeChanged) { GlobalConfig.gThemeChanged = false; - ThemeX.ClearScreen(); + ThemeX->ClearScreen(); } MenuExit = MainMenu.RunMainMenu(DefaultIndex, &ChosenEntry); } diff --git a/rEFIt_UEFI/refit/menu.cpp b/rEFIt_UEFI/refit/menu.cpp index 69dff3527..8191acc9a 100644 --- a/rEFIt_UEFI/refit/menu.cpp +++ b/rEFIt_UEFI/refit/menu.cpp @@ -1122,9 +1122,9 @@ void ApplyInputs(void) void AboutRefit(void) { if (AboutMenu.Entries.size() == 0) { - AboutMenu.Daylight = ThemeX.Daylight; - if (!(ThemeX.HideUIFlags & HIDEUI_FLAG_MENU_TITLE_IMAGE)) { - AboutMenu.TitleImage = ThemeX.GetIcon(BUILTIN_ICON_FUNC_ABOUT); + AboutMenu.Daylight = ThemeX->Daylight; + if (!(ThemeX->HideUIFlags & HIDEUI_FLAG_MENU_TITLE_IMAGE)) { + AboutMenu.TitleImage = ThemeX->GetIcon(BUILTIN_ICON_FUNC_ABOUT); } if ( "unknown"_XS8 != LString8(gRevisionStr) ) AboutMenu.AddMenuInfo_f("%s", gRevisionStr); @@ -1172,9 +1172,9 @@ void AboutRefit(void) void HelpRefit(void) { if (HelpMenu.Entries.size() == 0) { - HelpMenu.Daylight = ThemeX.Daylight; - if (!(ThemeX.HideUIFlags & HIDEUI_FLAG_MENU_TITLE_IMAGE)) { - HelpMenu.TitleImage = ThemeX.GetIcon(BUILTIN_ICON_FUNC_HELP); + HelpMenu.Daylight = ThemeX->Daylight; + if (!(ThemeX->HideUIFlags & HIDEUI_FLAG_MENU_TITLE_IMAGE)) { + HelpMenu.TitleImage = ThemeX->GetIcon(BUILTIN_ICON_FUNC_HELP); } switch (gSettings.GUI.languageCode) { @@ -2517,8 +2517,8 @@ void OptionsMenu(OUT REFIT_ABSTRACT_MENU_ENTRY **ChosenEntry) INTN SubEntryIndex = -1; //value -1 means old position to remember INTN NextEntryIndex = -1; - XBool OldFontStyle = ThemeX.Proportional; - ThemeX.Proportional = false; //temporary disable proportional + XBool OldFontStyle = ThemeX->Proportional; + ThemeX->Proportional = false; //temporary disable proportional // remember, if you extended this menu then change procedures @@ -2526,9 +2526,9 @@ void OptionsMenu(OUT REFIT_ABSTRACT_MENU_ENTRY **ChosenEntry) gThemeOptionsChanged = false; if (OptionMenu.Entries.size() == 0) { - OptionMenu.Daylight = ThemeX.Daylight; - if (!(ThemeX.HideUIFlags & HIDEUI_FLAG_MENU_TITLE_IMAGE)) { - OptionMenu.TitleImage = ThemeX.GetIcon(BUILTIN_ICON_FUNC_OPTIONS); + OptionMenu.Daylight = ThemeX->Daylight; + if (!(ThemeX->HideUIFlags & HIDEUI_FLAG_MENU_TITLE_IMAGE)) { + OptionMenu.TitleImage = ThemeX->GetIcon(BUILTIN_ICON_FUNC_OPTIONS); } gThemeOptionsChanged = true; OptionMenu.ID = SCREEN_OPTIONS; @@ -2599,7 +2599,7 @@ void OptionsMenu(OUT REFIT_ABSTRACT_MENU_ENTRY **ChosenEntry) } // if MENU_EXIT_ENTER } //exit: - ThemeX.Proportional = OldFontStyle; + ThemeX->Proportional = OldFontStyle; ApplyInputs(); } diff --git a/rEFIt_UEFI/refit/screen.cpp b/rEFIt_UEFI/refit/screen.cpp index 1b937552d..cea9db02e 100644 --- a/rEFIt_UEFI/refit/screen.cpp +++ b/rEFIt_UEFI/refit/screen.cpp @@ -291,7 +291,7 @@ StatusToString ( void SwitchToGraphicsAndClear(void) //called from MENU_FUNCTION_INIT { SwitchToGraphics(); - ThemeX.Background.DrawWithoutCompose(0,0,0,0); + ThemeX->Background.DrawWithoutCompose(0,0,0,0); } /* @@ -377,7 +377,7 @@ INTN HybridRepositioning(INTN Edge, INTN Value, INTN ImageDimension, INTN Screen void REFIT_MENU_SCREEN::GetAnime() { - FilmC = ThemeX.Cinema.GetFilm(ID); + FilmC = ThemeX->Cinema.GetFilm(ID); // DBG("ScreenID=%lld Film found=%d\n", ID, (FilmC != nullptr)?1:0); if (FilmC != nullptr) { FilmC->AnimeRun = true; @@ -411,8 +411,8 @@ void REFIT_MENU_SCREEN::InitAnime() // Check if screen size being used is different from theme origination size. // If yes, then recalculate the animation placement % value. // This is necessary because screen can be a different size, but anim is not scaled. - FilmC->FilmPlace.XPos = HybridRepositioning(FilmC->ScreenEdgeHorizontal, FilmC->FilmX, CWidth, UGAWidth, ThemeX.ThemeDesignWidth ); - FilmC->FilmPlace.YPos = HybridRepositioning(FilmC->ScreenEdgeVertical, FilmC->FilmY, CHeight, UGAHeight, ThemeX.ThemeDesignHeight); + FilmC->FilmPlace.XPos = HybridRepositioning(FilmC->ScreenEdgeHorizontal, FilmC->FilmX, CWidth, UGAWidth, ThemeX->ThemeDesignWidth ); + FilmC->FilmPlace.YPos = HybridRepositioning(FilmC->ScreenEdgeVertical, FilmC->FilmY, CHeight, UGAHeight, ThemeX->ThemeDesignHeight); // Does the user want to fine tune the placement? FilmC->FilmPlace.XPos = CalculateNudgePosition(FilmC->FilmPlace.XPos, FilmC->NudgeX, CWidth, UGAWidth); @@ -424,7 +424,7 @@ void REFIT_MENU_SCREEN::InitAnime() } else { // We are here if there is no anime, or if we use oldstyle placement values // For both these cases, FilmPlace will be set after banner/menutitle positions are known - FilmC->FilmPlace = ThemeX.BannerPlace; + FilmC->FilmPlace = ThemeX->BannerPlace; if (CWidth > 0 && CHeight > 0) { // Retained for legacy themes without new anim placement options. FilmC->FilmPlace.XPos = ((INTN)FilmC->FilmPlace.XPos * 2 > CWidth - (INTN)FilmC->FilmPlace.Width ) ? (UINTN)((INTN)FilmC->FilmPlace.XPos + ((INTN)FilmC->FilmPlace.Width - CWidth ) / 2) : 0;