CloverBootloader/rEFIt_UEFI/libeg/XIcon.h

46 lines
1.3 KiB
C
Raw Normal View History

#if !defined(__XICON_H__)
#define __XICON_H__
#include "../cpp_foundation/XObjArray.h"
#include "../cpp_foundation/XString.h"
#include "XImage.h"
#include "libeg.h"
#include "nanosvg.h"
#include "../Platform/BootLog.h"
#include "../Platform/Utils.h"
extern CONST CHAR8* IconsNames[];
extern const INTN IconsNamesSize;
class XIcon
{
public:
INTN Id = 0; //for example BUILTIN_ICON_POINTER
XString8 Name = XString8(); //for example "os_moja", "vol_internal"
XImage Image = XImage();
XImage ImageNight = XImage();
XBool Native = false;
protected:
XBool Empty = true;
public:
XIcon() {};
2021-09-28 15:54:31 +02:00
XIcon(INTN Id, XBool Embedded = false);
XBool isEmpty() const { return Image.isEmpty() && ImageNight.isEmpty(); }
void setEmpty() { Id = 0; Name.setEmpty(); Image.setEmpty(); ImageNight.setEmpty(); Native = false; }
2020-10-03 19:02:31 +02:00
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 wchar_t* LIconName);
EFI_STATUS LoadXImage(const EFI_FILE *Dir, const char* IconName);
void GetEmbedded();
// Default are not valid, as usual. We delete them. If needed, proper ones can be created
// Icon(const Icon&) = delete;
const XImage& GetBest(XBool night) const;
};
#endif