Rename _XS to _XS8

This commit is contained in:
Jief L 2020-04-30 09:22:26 +03:00
parent e170b16516
commit 0c88de9390
15 changed files with 140 additions and 135 deletions

View File

@ -24,7 +24,7 @@
// Functions
//-----------------------------------------------------------------------------
//
//constexpr LString8 operator"" _XS ( const char* s, size_t len)
//constexpr LString8 operator"" _XS8 ( const char* s, size_t len)
//{
//// LString8 returnValue;
//// returnValue.takeValueFromLiteral(s);

View File

@ -31,7 +31,7 @@ class LString8 : public LString<char, XString8>
// no assignement, no destructor
friend constexpr LString8 operator "" _XS ( const char* s, size_t) { return LString8(s); }
friend constexpr LString8 operator "" _XS8 ( const char* s, size_t) { return LString8(s); }
};
class XString8 : public XStringAbstract<char, XString8>
@ -171,7 +171,7 @@ public:
};
constexpr LString8 operator"" _XS ( const char* s, size_t len);
constexpr LString8 operator"" _XS8 ( const char* s, size_t len);
constexpr LString16 operator"" _XS16 ( const char16_t* s, size_t len);
constexpr LString32 operator"" _XS32 ( const char32_t* s, size_t len);
constexpr LStringW operator"" _XSW ( const wchar_t* s, size_t len);

View File

@ -66,7 +66,7 @@ class XStringArray_/* : public XStringArraySuper*/
XStringClass ConcatAll() const
{
return ConcatAll(", "_XS, NullXString, NullXString);
return ConcatAll(", "_XS8, NullXString, NullXString);
}
template<class XStringClass1, enable_if(is___String(XStringClass1))>
@ -265,7 +265,7 @@ extern const XStringWArray NullXStringWArray;
//template<class XStringArrayClass, class XStringClass1, enable_if(!is_char(XStringClass1) && !is_char_ptr(XStringClass1))>
//XStringArrayClass Split(const XStringClass1& S)
//{
// return Split<XStringArrayClass>(S, ", "_XS);
// return Split<XStringArrayClass>(S, ", "_XS8);
//};
@ -348,7 +348,7 @@ XStringArrayClass Split(const XStringClass1& S, const XStringClass2& Separator)
template<class XStringArrayClass, class XStringClass1, enable_if(!is_char(XStringClass1) && !is_char_ptr(XStringClass1))>
XStringArrayClass Split(const XStringClass1& S)
{
return Split<XStringArrayClass>(S, ", "_XS);
return Split<XStringArrayClass>(S, ", "_XS8);
};
#endif

View File

@ -100,7 +100,7 @@ CHAR16 *Old1_RemoveLoadOption(IN CONST CHAR16 *LoadOptions, IN CONST CHAR16 *Loa
// if ( LoadOptions.contains(LoadOption) ) return LoadOptions; //good
// // Otherwise add option
//// return SPrintf("%s %s", LoadOptions.c_str(), LoadOption.c_str()); //LoadOptions + LoadOption
// return LoadOptions + " "_XS + LoadOption; //why not?
// return LoadOptions + " "_XS8 + LoadOption; //why not?
// }
//}
//
@ -112,7 +112,7 @@ CHAR16 *Old1_RemoveLoadOption(IN CONST CHAR16 *LoadOptions, IN CONST CHAR16 *Loa
//
// //DBG("LoadOptions: '%ls', remove LoadOption: '%ls'\n", LoadOptions, LoadOption);
// // If there are no options then nothing to do
// if (LoadOptions.isEmpty()) return ""_XS;
// if (LoadOptions.isEmpty()) return ""_XS8;
// // If there is no option to remove then duplicate original
// if (LoadOption.isEmpty()) return LoadOptions;
// // If not present duplicate original
@ -142,7 +142,7 @@ CHAR16 *Old1_RemoveLoadOption(IN CONST CHAR16 *LoadOptions, IN CONST CHAR16 *Loa
// }
//
// // If it's the whole string return NULL
// if (OptionLength == Length) return ""_XS;
// if (OptionLength == Length) return ""_XS8;
//
// XString NewLoadOptions;
// if (Offset == 0) {
@ -183,49 +183,49 @@ int BootOptions_tests()
LoadOptions = Old1_AddLoadOption(LoadOptions, L"opt2");
LoadOptions = Old1_AddLoadOption(LoadOptions, L"opt3");
if ( XString8().takeValueFrom(LoadOptions) != "opt1 opt2 opt3"_XS ) return 1;
if ( XString8().takeValueFrom(LoadOptions) != "opt1 opt2 opt3"_XS8 ) return 1;
CHAR16* LoadOptions1 = Old1_RemoveLoadOption(LoadOptions, L"opt1");
if ( XString8().takeValueFrom(LoadOptions1) != "opt2 opt3"_XS ) return 2;
if ( XString8().takeValueFrom(LoadOptions1) != "opt2 opt3"_XS8 ) return 2;
CHAR16* LoadOptions2 = Old1_RemoveLoadOption(LoadOptions, L"opt2");
if ( XString8().takeValueFrom(LoadOptions2) != "opt1 opt3"_XS ) return 3;
if ( XString8().takeValueFrom(LoadOptions2) != "opt1 opt3"_XS8 ) return 3;
CHAR16* LoadOptions3 = Old1_RemoveLoadOption(LoadOptions, L"opt3");
if ( XString8().takeValueFrom(LoadOptions3) != "opt1 opt2"_XS ) return 4;
if ( XString8().takeValueFrom(LoadOptions3) != "opt1 opt2"_XS8 ) return 4;
}
// {
// XString LoadOptions;
//
// LoadOptions = AddLoadOption(LoadOptions, "opt1"_XS);
// LoadOptions = AddLoadOption(LoadOptions, "opt2"_XS);
// LoadOptions = AddLoadOption(LoadOptions, "opt3"_XS);
// LoadOptions = AddLoadOption(LoadOptions, "opt1"_XS8);
// LoadOptions = AddLoadOption(LoadOptions, "opt2"_XS8);
// LoadOptions = AddLoadOption(LoadOptions, "opt3"_XS8);
//
// if ( LoadOptions != "opt1 opt2 opt3"_XS ) return 10;
// if ( LoadOptions != "opt1 opt2 opt3"_XS8 ) return 10;
//
// XString LoadOptions1 = RemoveLoadOption(LoadOptions, "opt1"_XS);
// if ( LoadOptions1 != "opt2 opt3"_XS ) return 11;
// XString LoadOptions2 = RemoveLoadOption(LoadOptions, "opt2"_XS);
// if ( LoadOptions2 != "opt1 opt3"_XS ) return 12;
// XString LoadOptions3 = RemoveLoadOption(LoadOptions, "opt3"_XS);
// if ( LoadOptions3 != "opt1 opt2"_XS ) return 13;
// XString LoadOptions1 = RemoveLoadOption(LoadOptions, "opt1"_XS8);
// if ( LoadOptions1 != "opt2 opt3"_XS8 ) return 11;
// XString LoadOptions2 = RemoveLoadOption(LoadOptions, "opt2"_XS8);
// if ( LoadOptions2 != "opt1 opt3"_XS8 ) return 12;
// XString LoadOptions3 = RemoveLoadOption(LoadOptions, "opt3"_XS8);
// if ( LoadOptions3 != "opt1 opt2"_XS8 ) return 13;
// }
{
XStringArray LoadOptions;
LoadOptions.AddID("opt1"_XS);
LoadOptions.AddID("opt2"_XS);
LoadOptions.AddID("opt3"_XS);
LoadOptions.AddID("opt1"_XS8);
LoadOptions.AddID("opt2"_XS8);
LoadOptions.AddID("opt3"_XS8);
if ( LoadOptions.ConcatAll(" "_XS) != "opt1 opt2 opt3"_XS ) return 30;
if ( LoadOptions.ConcatAll(" "_XS8) != "opt1 opt2 opt3"_XS8 ) return 30;
XStringArray LoadOptions1 = LoadOptions;
LoadOptions1.remove("opt1"_XS);
if ( LoadOptions1.ConcatAll(" "_XS) != "opt2 opt3"_XS ) return 31;
LoadOptions1.remove("opt1"_XS8);
if ( LoadOptions1.ConcatAll(" "_XS8) != "opt2 opt3"_XS8 ) return 31;
XStringArray LoadOptions2 = LoadOptions;
LoadOptions2.remove("opt2"_XS);
if ( LoadOptions2.ConcatAll(" "_XS) != "opt1 opt3"_XS ) return 32;
LoadOptions2.remove("opt2"_XS8);
if ( LoadOptions2.ConcatAll(" "_XS8) != "opt1 opt3"_XS8 ) return 32;
XStringArray LoadOptions3 = LoadOptions;
LoadOptions3.remove("opt3"_XS);
if ( LoadOptions3.ConcatAll(" "_XS) != "opt1 opt2"_XS ) return 33;
LoadOptions3.remove("opt3"_XS8);
if ( LoadOptions3.ConcatAll(" "_XS8) != "opt1 opt2"_XS8 ) return 33;
}
return 0;

View File

@ -14,9 +14,9 @@ int XStringArray_tests()
array1.Add(L"1"_XSW);
if ( array1.isEmpty() ) return 2;
if ( array1[0] != "1"_XS ) return 21;
if ( array1[0] != "1"_XS8 ) return 21;
array1.Add(L"2"_XSW);
if ( array1[1] != "2"_XS ) return 21;
if ( array1[1] != "2"_XS8 ) return 21;
if ( !array1.contains(L"2"_XSW) ) return 5;
@ -33,21 +33,21 @@ int XStringArray_tests()
// Split
{
XStringArray array = Split<XStringArray>(" word1 word2 word3 ", " ");
if ( array[0] != "word1"_XS ) return 31;
if ( array[1] != "word2"_XS ) return 32;
if ( array[2] != "word3"_XS ) return 33;
if ( array[0] != "word1"_XS8 ) return 31;
if ( array[1] != "word2"_XS8 ) return 32;
if ( array[2] != "word3"_XS8 ) return 33;
}
{
XStringArray array = Split<XStringArray>("word1, word2, word3", ", ");
if ( array[0] != "word1"_XS ) return 31;
if ( array[1] != "word2"_XS ) return 32;
if ( array[2] != "word3"_XS ) return 33;
if ( array[0] != "word1"_XS8 ) return 31;
if ( array[1] != "word2"_XS8 ) return 32;
if ( array[2] != "word3"_XS8 ) return 33;
}
{
XStringArray array = Split<XStringArray>(" word1 word2 word3 "_XS, " "_XS);
if ( array[0] != "word1"_XS ) return 31;
if ( array[1] != "word2"_XS ) return 32;
if ( array[2] != "word3"_XS ) return 33;
XStringArray array = Split<XStringArray>(" word1 word2 word3 "_XS8, " "_XS8);
if ( array[0] != "word1"_XS8 ) return 31;
if ( array[1] != "word2"_XS8 ) return 32;
if ( array[2] != "word3"_XS8 ) return 33;
}
// Test concat and Split

View File

@ -1510,7 +1510,7 @@ class C
//constexpr LString8 g_xs1 = "foobar";
//constexpr LStringW g_xsw1 = L"foobar";
//XString g_xs2 = "foobar"_XS;
//XString g_xs2 = "foobar"_XS8;
int XString_tests()
{
@ -1518,12 +1518,17 @@ int XString_tests()
// printf("XString16_tests -> Enter\n");
#endif
XString8 xs1 = "Test:"_XS;
XString8 xs1 = "Test:"_XS8;
constexpr const LString8 ls1 = "foo"_XS8;
xs1 = ls1;
xs1 = ls1 + "bar";
XStringW xsw1 = L"world"_XSW;
XString8 xs2 = xs1 + "hel" + 'l' + L'o' + U" the " + xsw1;
XString8 xs2 = xs1 + "hel" + 'l' + L'o' + L" the " + xsw1;
XString8 xs3 = xs1;
LString8 a = "Hello"_XS;
LString8 a = "Hello"_XS8;
XStringW b = L"world"_XSW;
XString8 c = a + "foo"; // + 'o' + L'o' + b + L"bar";
@ -1547,7 +1552,7 @@ XString8 c = a + "foo"; // + 'o' + L'o' + b + L"bar";
//size_t size = sizeof("ꇉ")-1; // this char is 3 bytes long
//size_t size = sizeof("伽")-1; // this char is 3 bytes long
//size_t size = sizeof("楘")-1; // this char is 3 bytes long
//XString str = "ギꇉ伽楘"_XS;
//XString str = "ギꇉ伽楘"_XS8;
//char* s = str.data(42);
//size_t size1 = sizeof("В")-1;

View File

@ -134,7 +134,7 @@ const XImage& ScanVolumeDefaultIcon(REFIT_VOLUME *Volume, IN UINT8 OSType, IN EF
// if ( LoadOptions.contains(LoadOption) ) return LoadOptions; //good
// // Otherwise add option
//// return SPrintf("%s %s", LoadOptions.c_str(), LoadOption.c_str()); //LoadOptions + LoadOption
// return LoadOptions + " "_XS + LoadOption; //why not?
// return LoadOptions + " "_XS8 + LoadOption; //why not?
// }
//}
//
@ -146,7 +146,7 @@ const XImage& ScanVolumeDefaultIcon(REFIT_VOLUME *Volume, IN UINT8 OSType, IN EF
//
// //DBG("LoadOptions: '%ls', remove LoadOption: '%ls'\n", LoadOptions, LoadOption);
// // If there are no options then nothing to do
// if (LoadOptions.isEmpty()) return ""_XS;
// if (LoadOptions.isEmpty()) return ""_XS8;
// // If there is no option to remove then duplicate original
// if (LoadOption.isEmpty()) return LoadOptions;
// // If not present duplicate original
@ -176,7 +176,7 @@ const XImage& ScanVolumeDefaultIcon(REFIT_VOLUME *Volume, IN UINT8 OSType, IN EF
// }
//
// // If it's the whole string return NULL
// if (OptionLength == Length) return ""_XS;
// if (OptionLength == Length) return ""_XS8;
//
// XString NewLoadOptions;
// if (Offset == 0) {

View File

@ -138,7 +138,7 @@ BOOLEAN AddLegacyEntry(IN const XStringW& FullTitle, IN const XStringW& LoaderTi
} else {
Entry->Image = ThemeX.LoadOSIcon(Volume->LegacyOS->IconName);
if (Entry->Image.isEmpty()) {
Entry->Image = ThemeX.GetIcon("os_win"_XS); //we have no legacy.png
Entry->Image = ThemeX.GetIcon("os_win"_XS8); //we have no legacy.png
}
}
@ -161,7 +161,7 @@ BOOLEAN AddLegacyEntry(IN const XStringW& FullTitle, IN const XStringW& LoaderTi
}
Entry->Volume = Volume;
Entry->DevicePathString = Volume->DevicePathString;
// Entry->LoadOptions = (Volume->DiskKind == DISK_KIND_OPTICAL) ? "CD"_XS : ((Volume->DiskKind == DISK_KIND_EXTERNAL) ? "USB"_XS : "HD"_XS);
// Entry->LoadOptions = (Volume->DiskKind == DISK_KIND_OPTICAL) ? "CD"_XS8 : ((Volume->DiskKind == DISK_KIND_EXTERNAL) ? "USB"_XS8 : "HD"_XS8);
Entry->LoadOptions.setEmpty();
Entry->LoadOptions.Add((Volume->DiskKind == DISK_KIND_OPTICAL) ? "CD" : ((Volume->DiskKind == DISK_KIND_EXTERNAL) ? "USB" : "HD"));
// create the submenu

View File

@ -64,7 +64,7 @@ const XStringW MACOSX_LOADER_PATH = L"\\System\\Library\\CoreServices\\boot.efi"
const XStringW LINUX_ISSUE_PATH = L"\\etc\\issue"_XSW;
#define LINUX_BOOT_PATH L"\\boot"
#define LINUX_BOOT_ALT_PATH L"\\boot"
const XString8 LINUX_LOADER_PATH = "vmlinuz"_XS;
const XString8 LINUX_LOADER_PATH = "vmlinuz"_XS8;
const XStringW LINUX_FULL_LOADER_PATH = SWPrintf("%ls\\%s", LINUX_BOOT_PATH, LINUX_LOADER_PATH.c_str());
#define LINUX_LOADER_SEARCH_PATH L"vmlinuz*"
const XStringArray LINUX_DEFAULT_OPTIONS = Split<XStringArray>("ro add_efi_memmap quiet splash vt.handoff=7", " ");
@ -129,7 +129,7 @@ STATIC LINUX_PATH_DATA LinuxEntryData[] = {
// { L"\\EFI\\Manjaro\\grubx64.efi", L"Manjaro EFI boot menu", L"manjaro,linux", "Manjaro" },
// { L"\\EFI\\xubuntu\\grubx64.efi", L"Xubuntu EFI boot menu", L"xubuntu,linux", "Xubuntu" },
// { L"\\EFI\\zorin\\grubx64.efi", L"Zorin EFI boot menu", L"zorin,linux", "Zorin" },
{ L"\\EFI\\goofiboot\\goofibootx64.efi"_XSW, L"Solus EFI boot menu"_XSW, L"solus,linux"_XSW, "Solus"_XS },
{ L"\\EFI\\goofiboot\\goofibootx64.efi"_XSW, L"Solus EFI boot menu"_XSW, L"solus,linux"_XSW, "Solus"_XS8 },
// { L"\\EFI\\centos\\grubx64.efi", L"CentOS EFI boot menu", L"centos,linux", "CentOS" },
// { L"\\EFI\\pclinuxos\\grubx64.efi", L"PCLinuxOS EFI boot menu", L"pclinux,linux", "PCLinux" },
// { L"\\EFI\\neon\\grubx64.efi", L"KDE Neon EFI boot menu", L"neon,linux", "KDE Neon" },
@ -340,12 +340,12 @@ STATIC CONST XStringW& LinuxIconNameFromPath(IN CONST XStringW& Path,
}
STATIC CONST XString8 LinuxInitImagePath[] = {
"initrd%s"_XS,
"initrd.img%s"_XS,
"initrd%s.img"_XS,
"initramfs%s"_XS,
"initramfs.img%s"_XS,
"initramfs%s.img"_XS,
"initrd%s"_XS8,
"initrd.img%s"_XS8,
"initrd%s.img"_XS8,
"initramfs%s"_XS8,
"initramfs.img%s"_XS8,
"initramfs%s.img"_XS8,
};
STATIC CONST UINTN LinuxInitImagePathCount = (sizeof(LinuxInitImagePath) / sizeof(LinuxInitImagePath[0]));
@ -822,7 +822,7 @@ STATIC VOID AddDefaultMenu(IN LOADER_ENTRY *Entry)
if (Guid) {
SubScreen->AddMenuInfoLine_f("UUID: %s", strguid(Guid));
}
SubScreen->AddMenuInfoLine_f("Options: %s", Entry->LoadOptions.ConcatAll(" "_XS).c_str());
SubScreen->AddMenuInfoLine_f("Options: %s", Entry->LoadOptions.ConcatAll(" "_XS8).c_str());
// loader-specific submenu entries
if (Entry->LoaderType == OSTYPE_OSX ||
Entry->LoaderType == OSTYPE_OSX_INSTALLER ||
@ -938,10 +938,10 @@ STATIC VOID AddDefaultMenu(IN LOADER_ENTRY *Entry)
if (SubEntry) {
if (Quiet) {
SubEntry->Title.SWPrintf("%ls verbose", Entry->Title.s());
SubEntry->LoadOptions.removeIC("quiet"_XS);
SubEntry->LoadOptions.removeIC("quiet"_XS8);
} else {
SubEntry->Title.SWPrintf("%ls quiet", Entry->Title.s());
SubEntry->LoadOptions.AddID("quiet"_XS);
SubEntry->LoadOptions.AddID("quiet"_XS8);
}
}
SubScreen->AddMenuEntry(SubEntry, true);
@ -949,10 +949,10 @@ STATIC VOID AddDefaultMenu(IN LOADER_ENTRY *Entry)
if (SubEntry) {
if (WithSplash) {
SubEntry->Title.SWPrintf("%ls without splash", Entry->Title.s());
SubEntry->LoadOptions.removeIC("splash"_XS);
SubEntry->LoadOptions.removeIC("splash"_XS8);
} else {
SubEntry->Title.SWPrintf("%ls with splash", Entry->Title.s());
SubEntry->LoadOptions.AddID("splash"_XS);
SubEntry->LoadOptions.AddID("splash"_XS8);
}
}
SubScreen->AddMenuEntry(SubEntry, true);
@ -961,30 +961,30 @@ STATIC VOID AddDefaultMenu(IN LOADER_ENTRY *Entry)
if (WithSplash) {
if (Quiet) {
SubEntry->Title.SWPrintf("%ls verbose without splash", Entry->Title.s());
SubEntry->LoadOptions.removeIC("splash"_XS);
SubEntry->LoadOptions.removeIC("quiet"_XS);
SubEntry->LoadOptions.removeIC("splash"_XS8);
SubEntry->LoadOptions.removeIC("quiet"_XS8);
} else {
SubEntry->Title.SWPrintf("%ls quiet without splash", Entry->Title.s());
SubEntry->LoadOptions.removeIC("splash"_XS);
SubEntry->LoadOptions.Add("quiet"_XS);
SubEntry->LoadOptions.removeIC("splash"_XS8);
SubEntry->LoadOptions.Add("quiet"_XS8);
}
} else if (Quiet) {
// TempOptions.RemoveIC("quiet"_XS);
// TempOptions.RemoveIC("quiet"_XS8);
SubEntry->Title.SWPrintf("%ls verbose with splash", Entry->Title.s());
SubEntry->LoadOptions.AddID("splash"_XS);
SubEntry->LoadOptions.AddID("splash"_XS8);
// FreePool(TempOptions);
} else {
SubEntry->Title.SWPrintf("%ls quiet with splash", Entry->Title.s());
SubEntry->LoadOptions.AddID("quiet"_XS);
SubEntry->LoadOptions.AddID("splash"_XS);
SubEntry->LoadOptions.AddID("quiet"_XS8);
SubEntry->LoadOptions.AddID("splash"_XS8);
}
}
SubScreen->AddMenuEntry(SubEntry, true);
} else if ((Entry->LoaderType == OSTYPE_WIN) || (Entry->LoaderType == OSTYPE_WINEFI)) {
// by default, skip the built-in selection and boot from hard disk only
Entry->LoadOptions.setEmpty();
Entry->LoadOptions.Add("-s"_XS);
Entry->LoadOptions.Add("-h"_XS);
Entry->LoadOptions.Add("-s"_XS8);
Entry->LoadOptions.Add("-h"_XS8);
// default entry
SubEntry = Entry->getPartiallyDuplicatedEntry();
@ -1003,8 +1003,8 @@ STATIC VOID AddDefaultMenu(IN LOADER_ENTRY *Entry)
if (SubEntry) {
SubEntry->Title.takeValueFrom("Boot Windows from CD-ROM");
Entry->LoadOptions.setEmpty();
Entry->LoadOptions.Add("-s"_XS);
Entry->LoadOptions.Add("-c"_XS);
Entry->LoadOptions.Add("-s"_XS8);
Entry->LoadOptions.Add("-c"_XS8);
SubScreen->AddMenuEntry(SubEntry, true);
}
@ -1013,7 +1013,7 @@ STATIC VOID AddDefaultMenu(IN LOADER_ENTRY *Entry)
SubEntry->Title.SWPrintf("Run %ls in text mode", FileName.wc_str());
SubEntry->Flags = OSFLAG_UNSET(SubEntry->Flags, OSFLAG_USEGRAPHICS);
Entry->LoadOptions.setEmpty();
Entry->LoadOptions.Add("-v"_XS);
Entry->LoadOptions.Add("-v"_XS8);
SubEntry->LoaderType = OSTYPE_OTHER; // Sothor - Why are we using OSTYPE_OTHER here?
SubScreen->AddMenuEntry(SubEntry, true);
}
@ -2039,7 +2039,7 @@ STATIC VOID AddCustomEntry(IN UINTN CustomIndex,
if (Guid) {
SubScreen->AddMenuInfoLine_f("UUID: %s", strguid(Guid));
}
SubScreen->AddMenuInfoLine_f("Options: %s", Entry->LoadOptions.ConcatAll(" "_XS).c_str());
SubScreen->AddMenuInfoLine_f("Options: %s", Entry->LoadOptions.ConcatAll(" "_XS8).c_str());
DBG("Create sub entries\n");
for (CustomSubEntry = Custom->SubEntries; CustomSubEntry; CustomSubEntry = CustomSubEntry->Next) {
if (!CustomSubEntry->Settings) {

View File

@ -2034,7 +2034,7 @@ VOID REFIT_MENU_SCREEN::DrawMainMenuEntry(REFIT_ABSTRACT_MENU_ENTRY *Entry, BOOL
if (MainImage.isEmpty()) {
// DBG(" why MainImage is empty? Report to devs\n");
if (!IsEmbeddedTheme()) {
MainImage = ThemeX.GetIcon("os_mac"_XS);
MainImage = ThemeX.GetIcon("os_mac"_XS8);
}
if (MainImage.isEmpty()) {
MainImage.DummyImage(MainSize);
@ -2663,7 +2663,7 @@ UINTN REFIT_MENU_SCREEN::RunMainMenu(IN INTN DefaultSelection, OUT REFIT_ABSTRAC
}
if (/*MenuExit == MENU_EXIT_ENTER &&*/ MainChosenEntry->getLOADER_ENTRY()) {
if (MainChosenEntry->getLOADER_ENTRY()->LoadOptions.notEmpty()) {
snprintf(gSettings.BootArgs, 255, "%s", MainChosenEntry->getLOADER_ENTRY()->LoadOptions.ConcatAll(" "_XS).c_str());
snprintf(gSettings.BootArgs, 255, "%s", MainChosenEntry->getLOADER_ENTRY()->LoadOptions.ConcatAll(" "_XS8).c_str());
} else {
ZeroMem(&gSettings.BootArgs, 255);
}

View File

@ -45,26 +45,26 @@
//#include "../entry_scan/common.h"
CONST XString8 ArgOptional[NUM_OPT] = {
"arch=i386"_XS, //0
"arch=x86_64"_XS, //1
"-v"_XS, //2
"-f"_XS, //3
"-s"_XS, //4
"-x"_XS, //5
"nv_disable=1"_XS, //6
"slide=0"_XS, //7
"darkwake=0"_XS, //8
"-xcpm"_XS, //9
"-gux_no_idle"_XS, //10
"-gux_nosleep"_XS, //11
"-gux_nomsi"_XS, //12
"-gux_defer_usb2"_XS, //13
"keepsyms=1"_XS, //14
"debug=0x100"_XS, //15
"kextlog=0xffff"_XS, //16
"-alcoff"_XS, //17
"-shikioff"_XS, //18
"nvda_drv=1"_XS //19
"arch=i386"_XS8, //0
"arch=x86_64"_XS8, //1
"-v"_XS8, //2
"-f"_XS8, //3
"-s"_XS8, //4
"-x"_XS8, //5
"nv_disable=1"_XS8, //6
"slide=0"_XS8, //7
"darkwake=0"_XS8, //8
"-xcpm"_XS8, //9
"-gux_no_idle"_XS8, //10
"-gux_nosleep"_XS8, //11
"-gux_nomsi"_XS8, //12
"-gux_defer_usb2"_XS8, //13
"keepsyms=1"_XS8, //14
"debug=0x100"_XS8, //15
"kextlog=0xffff"_XS8, //16
"-alcoff"_XS8, //17
"-shikioff"_XS8, //18
"nvda_drv=1"_XS8 //19
};
CONST CHAR16 *VBIOS_BIN = L"EFI\\CLOVER\\misc\\c0000.bin";

View File

@ -267,20 +267,20 @@ EFI_STATUS XTheme::ParseSVGXTheme(CONST CHAR8* buffer)
}
Status = EFI_NOT_FOUND;
if (!ThemeX.Daylight) {
Status = ParseSVGXIcon(BUILTIN_ICON_BACKGROUND, "Background_night"_XS, &BigBack);
Status = ParseSVGXIcon(BUILTIN_ICON_BACKGROUND, "Background_night"_XS8, &BigBack);
}
if (EFI_ERROR(Status)) {
Status = ParseSVGXIcon(BUILTIN_ICON_BACKGROUND, "Background"_XS, &BigBack);
Status = ParseSVGXIcon(BUILTIN_ICON_BACKGROUND, "Background"_XS8, &BigBack);
}
DBG(" Background parsed [%lld, %lld]\n", BigBack.GetWidth(), BigBack.GetHeight()); //Background parsed [1067, 133]
// --- Make Banner
Banner.setEmpty(); //for the case of theme switch
Status = EFI_NOT_FOUND;
if (!ThemeX.Daylight) {
Status = ParseSVGXIcon(BUILTIN_ICON_BANNER, "Banner_night"_XS, &Banner);
Status = ParseSVGXIcon(BUILTIN_ICON_BANNER, "Banner_night"_XS8, &Banner);
}
if (EFI_ERROR(Status)) {
Status = ParseSVGXIcon(BUILTIN_ICON_BANNER, "Banner"_XS, &Banner);
Status = ParseSVGXIcon(BUILTIN_ICON_BANNER, "Banner"_XS8, &Banner);
}
// DBG("Banner parsed\n");
BanHeight = (int)(Banner.GetHeight() * Scale + 1.f);
@ -296,7 +296,7 @@ EFI_STATUS XTheme::ParseSVGXTheme(CONST CHAR8* buffer)
// DBG("parse %s status %s\n", NewIcon->Name.c_str(), strerror(Status));
NewIcon->Native = !EFI_ERROR(Status);
if (!EFI_ERROR(Status)) {
ParseSVGXIcon(i, NewIcon->Name + "_night"_XS, &NewIcon->ImageNight);
ParseSVGXIcon(i, NewIcon->Name + "_night"_XS8, &NewIcon->ImageNight);
}
// DBG("parse %s status %s\n", NewIcon->Name.c_str(), strerror(Status));
Icons.AddReference(NewIcon, true);
@ -315,16 +315,16 @@ EFI_STATUS XTheme::ParseSVGXTheme(CONST CHAR8* buffer)
// DBG("parse %s i=%lld status %s\n", NewIcon->Name.c_str(), i, strerror(Status));
NewIcon->Native = !EFI_ERROR(Status);
if (!EFI_ERROR(Status)) {
ParseSVGXIcon(i, NewIcon->Name + "_night"_XS, &NewIcon->ImageNight);
ParseSVGXIcon(i, NewIcon->Name + "_night"_XS8, &NewIcon->ImageNight);
}
Icons.AddReference(NewIcon, true);
}
//selection for bootcampstyle
Icon *NewIcon = new Icon(BUILTIN_ICON_SELECTION);
Status = ParseSVGXIcon(BUILTIN_ICON_SELECTION, "selection_indicator"_XS, &NewIcon->Image);
Status = ParseSVGXIcon(BUILTIN_ICON_SELECTION, "selection_indicator"_XS8, &NewIcon->Image);
if (!EFI_ERROR(Status)) {
ParseSVGXIcon(BUILTIN_ICON_SELECTION, "selection_indicator_night"_XS, &NewIcon->ImageNight);
ParseSVGXIcon(BUILTIN_ICON_SELECTION, "selection_indicator_night"_XS8, &NewIcon->ImageNight);
}
Icons.AddReference(NewIcon, true);

View File

@ -399,12 +399,12 @@ const XImage& XTheme::LoadOSIcon(const XString8& Full)
UINTN Size = Full.length();
DBG("IconName=%s comma=%lld size=%lld\n", Full.c_str(), Comma, Size);
if (Comma != MAX_XSIZE) { //Comma
First = "os_"_XS + Full.subString(0, Comma);
First = "os_"_XS8 + Full.subString(0, Comma);
ReturnImage = &GetIcon(First);
DBG(" first=%s\n", First.c_str());
if (!ReturnImage->isEmpty()) return *ReturnImage;
//else search second name
Second = "os_"_XS + Full.subString(Comma + 1, Size - Comma - 1);
Second = "os_"_XS8 + Full.subString(Comma + 1, Size - Comma - 1);
//moreover names can be triple L"chrome,grub,linux"
UINTN SecondComma = Second.indexOf(',');
if (Comma == MAX_XSIZE) {
@ -414,14 +414,14 @@ const XImage& XTheme::LoadOSIcon(const XString8& Full)
First = Second.subString(0, SecondComma);
ReturnImage = &GetIcon(First);
if (!ReturnImage->isEmpty()) return *ReturnImage;
Third = "os_"_XS + Second.subString(SecondComma + 1, Size - SecondComma - 1);
Third = "os_"_XS8 + Second.subString(SecondComma + 1, Size - SecondComma - 1);
ReturnImage = &GetIcon(Third);
if (!ReturnImage->isEmpty()) return *ReturnImage;
}
DBG(" Second=%s\n", Second.c_str());
if (!ReturnImage->isEmpty()) return *ReturnImage;
} else {
ReturnImage = &GetIcon("os_"_XS + Full);
ReturnImage = &GetIcon("os_"_XS8 + Full);
DBG(" Full=%s\n", Full.c_str());
if (!ReturnImage->isEmpty()) return *ReturnImage;
}
@ -733,10 +733,10 @@ void XTheme::InitSelection() //for PNG theme
}
} else {
//SVG theme already parsed all icons
Buttons[0] = GetIcon("radio_button"_XS);
Buttons[1] = GetIcon("radio_button_selected"_XS);
Buttons[2] = GetIcon("checkbox"_XS);
Buttons[3] = GetIcon("checkbox_checked"_XS);
Buttons[0] = GetIcon("radio_button"_XS8);
Buttons[1] = GetIcon("radio_button_selected"_XS8);
Buttons[2] = GetIcon("checkbox"_XS8);
Buttons[3] = GetIcon("checkbox_checked"_XS8);
}
// non-selected background images
@ -852,7 +852,7 @@ void XTheme::InitBar()
if (ScrollbarBackgroundImage.isEmpty()) {
if (TypeSVG) {
//return OSIconsTable[i].image;
ScrollbarBackgroundImage = GetIcon("scrollbar_background"_XS);
ScrollbarBackgroundImage = GetIcon("scrollbar_background"_XS8);
}
if (ScrollbarBackgroundImage.isEmpty()) {
ScrollbarBackgroundImage.FromPNG(ACCESS_EMB_DATA(emb_scroll_bar_fill), ACCESS_EMB_SIZE(emb_scroll_bar_fill));
@ -860,7 +860,7 @@ void XTheme::InitBar()
}
if (ScrollbarImage.isEmpty()) {
if (TypeSVG) {
ScrollbarImage = GetIcon("scrollbar_holder"_XS); //"_night" is already accounting
ScrollbarImage = GetIcon("scrollbar_holder"_XS8); //"_night" is already accounting
}
if (ScrollbarImage.isEmpty()) {
ScrollbarImage.FromPNG(ACCESS_EMB_DATA(emb_scroll_scroll_fill), ACCESS_EMB_SIZE(emb_scroll_scroll_fill));
@ -868,7 +868,7 @@ void XTheme::InitBar()
}
if (ScrollStartImage.isEmpty()) {
if (TypeSVG) {
ScrollStartImage = GetIcon("scrollbar_start"_XS);
ScrollStartImage = GetIcon("scrollbar_start"_XS8);
}
if (ScrollStartImage.isEmpty()) {
ScrollStartImage.FromPNG(ACCESS_EMB_DATA(emb_scroll_scroll_start), ACCESS_EMB_SIZE(emb_scroll_scroll_start));
@ -876,7 +876,7 @@ void XTheme::InitBar()
}
if (ScrollEndImage.isEmpty()) {
if (TypeSVG) {
ScrollEndImage = GetIcon("scrollbar_end"_XS);
ScrollEndImage = GetIcon("scrollbar_end"_XS8);
}
if (ScrollEndImage.isEmpty()) {
ScrollEndImage.FromPNG(ACCESS_EMB_DATA(emb_scroll_scroll_end), ACCESS_EMB_SIZE(emb_scroll_scroll_end));
@ -884,13 +884,13 @@ void XTheme::InitBar()
}
if (UpButtonImage.isEmpty()) {
if (TypeSVG) {
UpButtonImage = GetIcon("scrollbar_up_button"_XS);
UpButtonImage = GetIcon("scrollbar_up_button"_XS8);
}
UpButtonImage.FromPNG(ACCESS_EMB_DATA(emb_scroll_up_button), ACCESS_EMB_SIZE(emb_scroll_up_button));
}
if (DownButtonImage.isEmpty()) {
if (TypeSVG) {
DownButtonImage = GetIcon("scrollbar_down_button"_XS);
DownButtonImage = GetIcon("scrollbar_down_button"_XS8);
}
if (DownButtonImage.isEmpty()) {
DownButtonImage.FromPNG(ACCESS_EMB_DATA(emb_scroll_down_button), ACCESS_EMB_SIZE(emb_scroll_down_button));

View File

@ -447,10 +447,10 @@ XString8 egScreenDescription(VOID)
} else if (UgaDraw != NULL) {
return SPrintf("UGA Draw (EFI 1.10), %lldx%lld", egScreenWidth, egScreenHeight);
} else {
return "Internal Error"_XS;
return "Internal Error"_XS8;
}
} else {
return "Text Console"_XS;
return "Text Console"_XS8;
}
}

View File

@ -229,9 +229,9 @@ static EFI_STATUS StartEFILoadedImage(IN EFI_HANDLE ChildImageHandle,
if (LoadOptionsPrefix != NULL) {
// NOTE: That last space is also added by the EFI shell and seems to be significant
// when passing options to Apple's boot.efi...
loadOptionsW = SWPrintf("%ls %s ", LoadOptionsPrefix, LoadOptions.ConcatAll(" "_XS).wc_str());
loadOptionsW = SWPrintf("%ls %s ", LoadOptionsPrefix, LoadOptions.ConcatAll(" "_XS8).wc_str());
}else{
loadOptionsW = SWPrintf("%s ", LoadOptions.ConcatAll(" "_XS).wc_str()); // Jief : should we add a space ? Wasn't the case before big refactoring. Yes, a space required.
loadOptionsW = SWPrintf("%s ", LoadOptions.ConcatAll(" "_XS8).wc_str()); // Jief : should we add a space ? Wasn't the case before big refactoring. Yes, a space required.
}
// NOTE: We also include the terminating null in the length for safety.
ChildLoadedImage->LoadOptionsSize = (UINT32)loadOptionsW.sizeInBytes() + sizeof(wchar_t);
@ -776,7 +776,7 @@ static VOID StartLoader(IN LOADER_ENTRY *Entry)
// If KPDebug is true boot in verbose mode to see the debug messages
if ((Entry->KernelAndKextPatches != NULL) && Entry->KernelAndKextPatches->KPDebug) {
Entry->LoadOptions.AddID("-v"_XS);
Entry->LoadOptions.AddID("-v"_XS8);
}
DbgHeader("RestSetup macOS");
@ -805,7 +805,7 @@ static VOID StartLoader(IN LOADER_ENTRY *Entry)
!DoHibernateWake &&
!Entry->LoadOptions.containsStartWithIC("slide=") ) {
// Add slide=0 argument for ML+ if not present
Entry->LoadOptions.AddID("slide=0"_XS);
Entry->LoadOptions.AddID("slide=0"_XS8);
}
@ -819,7 +819,7 @@ static VOID StartLoader(IN LOADER_ENTRY *Entry)
(AsciiOSVersionToUint64(Entry->OSVersion) < AsciiOSVersionToUint64("10.12")) &&
(!Entry->LoadOptions.containsIC("-xcpm"))) {
// add "-xcpm" argv if not present on Haswell+ Celeron/Pentium
Entry->LoadOptions.AddID("-xcpm"_XS);
Entry->LoadOptions.AddID("-xcpm"_XS8);
}
// add -xcpm on Ivy Bridge if set KernelXCPM and system version is 10.8.5 - 10.11.x
@ -829,7 +829,7 @@ static VOID StartLoader(IN LOADER_ENTRY *Entry)
(AsciiOSVersionToUint64(Entry->OSVersion) < AsciiOSVersionToUint64("10.12")) &&
(!Entry->LoadOptions.containsIC("-xcpm"))) {
// add "-xcpm" argv if not present on Ivy Bridge
Entry->LoadOptions.AddID("-xcpm"_XS);
Entry->LoadOptions.AddID("-xcpm"_XS8);
}
if (AudioIo) {
@ -2137,7 +2137,7 @@ RefitMain (IN EFI_HANDLE ImageHandle,
DBG(" string %ls, size=%lld, len=%lld sizeof=%ld iStrLen=%lld\n", aaa, StrSize(aaa), StrLen(aaa), sizeof(aaa), iStrLen(bbb, 10));
const CHAR8* ccc = "Выход ";
DBG(" string %s, size=%lld, len=%lld sizeof=%ld iStrLen=%lld\n", ccc, AsciiStrSize(ccc), AsciiStrLen(ccc), sizeof(ccc), iStrLen(ccc, 10));
XString8 ddd = "Выход "_XS;
XString8 ddd = "Выход "_XS8;
// size_t sizex = ddd.allocatedSize();
DBG(" xstring %s, asize=%ld, sizeinbyte=%ld sizeof=%ld lastcharat=%ld\n", ddd.c_str(), ddd.allocatedSize(), ddd.sizeInBytes(), sizeof(ddd),
ddd.indexOf(ddd.lastChar()));