diff --git a/rEFIt_UEFI/entry_scan/common.cpp b/rEFIt_UEFI/entry_scan/common.cpp index acd243e47..8e5a052de 100644 --- a/rEFIt_UEFI/entry_scan/common.cpp +++ b/rEFIt_UEFI/entry_scan/common.cpp @@ -55,8 +55,6 @@ #define DBG(...) DebugLog(DEBUG_COMMON_MENU, __VA_ARGS__) #endif -extern CONST CHAR8* IconsNames[]; - const XIcon& ScanVolumeDefaultIcon(REFIT_VOLUME *Volume, IN UINT8 OSType, const EFI_DEVICE_PATH_PROTOCOL *DevicePath) { @@ -115,7 +113,7 @@ const XIcon& ScanVolumeDefaultIcon(REFIT_VOLUME *Volume, IN UINT8 OSType, const // 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 if (IconX->Image.isEmpty()) { - DBG("asked Icon %s not found, took internal\n", IconsNames[IconNum]); + DBG("asked Icon %s not found, took internal\n", IconsNames[IconNum].c_str()); IconX = &ThemeX->GetIcon(BUILTIN_ICON_VOL_INTERNAL); //including embedded which is really present } diff --git a/rEFIt_UEFI/libeg/VectorGraphics.cpp b/rEFIt_UEFI/libeg/VectorGraphics.cpp index 9548f16a1..42b9c8b26 100644 --- a/rEFIt_UEFI/libeg/VectorGraphics.cpp +++ b/rEFIt_UEFI/libeg/VectorGraphics.cpp @@ -38,8 +38,8 @@ #include "XTheme.h" -extern const CHAR8* IconsNames[]; -extern const INTN IconsNamesSize; +//extern const LString8 IconsNames[]; -> Include XIcon.h instead if duplicating declaration. +//extern const INTN IconsNamesSize; #define NSVG_RGB(r, g, b) (((unsigned int)b) | ((unsigned int)g << 8) | ((unsigned int)r << 16)) @@ -254,7 +254,7 @@ if ( nsvg__nbDanglingPtr() > 0 ) { // --- Make other OSes for (INTN i = ICON_OTHER_OS; i < IconsNamesSize; ++i) { - if (AsciiStrLen(IconsNames[i]) == 0) break; + if ( IconsNames[i].isEmpty() ) break; XIcon* NewIcon = new XIcon(i, false); //initialize without embedded Status = ParseSVGXIcon(SVGParser, i, NewIcon->Name, &NewIcon->Image); // DBG("parse %s i=%lld status %s\n", NewIcon->Name.c_str(), i, efiStrError(Status)); diff --git a/rEFIt_UEFI/libeg/XIcon.cpp b/rEFIt_UEFI/libeg/XIcon.cpp index 157230162..fe082ee46 100644 --- a/rEFIt_UEFI/libeg/XIcon.cpp +++ b/rEFIt_UEFI/libeg/XIcon.cpp @@ -25,7 +25,7 @@ extern "C" { #define DBG(...) DebugLog(DEBUG_XICON, __VA_ARGS__) #endif -CONST CHAR8* IconsNames[] = { +CONST LString8 IconsNames[] = { "func_about", "func_options", "func_clover", @@ -105,7 +105,7 @@ ImageNight.FromPNG(ACCESS_EMB_DATA(dark), ACCESS_EMB_SIZE(dark)); \ XIcon::XIcon(INTN Index, XBool TakeEmbedded) : Id(Index), Empty(false) { if (Index >= BUILTIN_ICON_FUNC_ABOUT && Index < IconsNamesSize) { //full table - Name.takeValueFrom(IconsNames[Index]); + Name = IconsNames[Index]; } if (TakeEmbedded) { GetEmbedded(); @@ -195,7 +195,7 @@ void XIcon::GetEmbedded() DEC_BUILTIN_ICON(BUILTIN_CHECKBOX_CHECKED, emb_checkbox_checked) break; case BUILTIN_ICON_SELECTION: - Name.takeValueFrom("selection_indicator"); + Name = "selection_indicator"_XS8; DEC_BUILTIN_ICON(BUILTIN_ICON_SELECTION, emb_selection_indicator) break; default: diff --git a/rEFIt_UEFI/libeg/XIcon.h b/rEFIt_UEFI/libeg/XIcon.h index 68ed8ae29..e9edde09f 100644 --- a/rEFIt_UEFI/libeg/XIcon.h +++ b/rEFIt_UEFI/libeg/XIcon.h @@ -9,7 +9,7 @@ #include "../Platform/BootLog.h" #include "../Platform/Utils.h" -extern CONST CHAR8* IconsNames[]; +extern CONST LString8 IconsNames[]; extern const INTN IconsNamesSize; diff --git a/rEFIt_UEFI/libeg/XImage.cpp b/rEFIt_UEFI/libeg/XImage.cpp index 03090c5cc..6c46facf7 100644 --- a/rEFIt_UEFI/libeg/XImage.cpp +++ b/rEFIt_UEFI/libeg/XImage.cpp @@ -630,7 +630,7 @@ EFI_STATUS XImage::LoadXImage(const EFI_FILE *BaseDir, const wchar_t* LIconName) } //dont call this procedure for SVG theme BaseDir == NULL? //it can be used for other files -EFI_STATUS XImage::LoadXImage(const EFI_FILE *BaseDir, const XStringW& IconName) +EFI_STATUS XImage::LoadXImage(const EFI_FILE *BaseDir, const XString8& IconName) { EFI_STATUS Status = EFI_NOT_FOUND; UINT8 *FileData = NULL; @@ -668,7 +668,7 @@ EFI_STATUS XImage::LoadXImage(const EFI_FILE *BaseDir, const XStringW& IconName) // decode it Status = FromPNG(FileData, FileDataLength); if (EFI_ERROR(Status)) { - DBG("%ls not decoded. Status=%s\n", IconName.wc_str(), efiStrError(Status)); + DBG("%s not decoded. Status=%s\n", IconName.c_str(), efiStrError(Status)); } FreePool(FileData); return Status; diff --git a/rEFIt_UEFI/libeg/XImage.h b/rEFIt_UEFI/libeg/XImage.h index 69886ad4b..29cf218e2 100644 --- a/rEFIt_UEFI/libeg/XImage.h +++ b/rEFIt_UEFI/libeg/XImage.h @@ -97,7 +97,7 @@ public: void DrawOnBack(INTN x, INTN y, const XImage& Plate) const; //I changed the name because LoadImage is too widely used // will be used instead of old egLoadImage - EFI_STATUS LoadXImage(const EFI_FILE *Dir, const XStringW& FileName); //for example LoadImage(ThemeDir, L"icons\\" + Name); + EFI_STATUS LoadXImage(const EFI_FILE *Dir, const XString8& FileName); //for example LoadImage(ThemeDir, L"icons\\" + Name); EFI_STATUS LoadXImage(const EFI_FILE *Dir, const wchar_t* LIconName); EFI_STATUS LoadXImage(const EFI_FILE *Dir, const char* IconName); EFI_STATUS LoadIcns(const EFI_FILE *Dir, IN CONST CHAR16 *FileName, IN UINTN PixelSize); diff --git a/rEFIt_UEFI/libeg/XTheme.cpp b/rEFIt_UEFI/libeg/XTheme.cpp index 3a857f000..45778d168 100644 --- a/rEFIt_UEFI/libeg/XTheme.cpp +++ b/rEFIt_UEFI/libeg/XTheme.cpp @@ -1045,7 +1045,7 @@ void XTheme::ClearScreen() //and restore background and banner default: // already scaled Background = BigBack; -// DBG("back copy equal\n"); + //DBG("Assign Background = BigBack. BigBack.Width=%lld BigBack.Height=%lld\n", BigBack.GetWidth(), BigBack.GetHeight()); break; } } else { @@ -1090,7 +1090,7 @@ void XTheme::FillByDir() //assume ThemeDir is defined by InitTheme() procedure } NewIcon->Native = !EFI_ERROR(Status); if (!EFI_ERROR(Status)) { - NewIcon->ImageNight.LoadXImage(ThemeDir, SWPrintf("%s_night", IconsNames[i])); + NewIcon->ImageNight.LoadXImage(ThemeDir, SWPrintf("%s_night", IconsNames[i].c_str())); } Icons.AddReference(NewIcon, true); if (EFI_ERROR(Status)) { diff --git a/rEFIt_UEFI/libeg/text.cpp b/rEFIt_UEFI/libeg/text.cpp index afe9424a8..dfed85fb4 100644 --- a/rEFIt_UEFI/libeg/text.cpp +++ b/rEFIt_UEFI/libeg/text.cpp @@ -101,7 +101,7 @@ void XTheme::LoadFontImage(IN XBool UseEmbedded, IN INTN Rows, IN INTN Cols) Status = NewImage.FromPNG(ACCESS_EMB_DATA(emb_font_data), ACCESS_EMB_SIZE(emb_font_data)); //always success MsgLog("Using embedded font\n"); } else if (isKorean){ - Status = NewImage.LoadXImage(ThemeDir, L"FontKorean.png"_XSW); + Status = NewImage.LoadXImage(ThemeDir, "FontKorean.png"_XS8); MsgLog("Loading korean font from ThemeDir: %s\n", efiStrError(Status)); if (!EFI_ERROR(Status)) { CharWidth = 22; //standard for korean