2020-08-11 14:43:53 +02:00
|
|
|
#if !defined(__XICON_H__)
|
|
|
|
#define __XICON_H__
|
|
|
|
|
|
|
|
#include "../cpp_foundation/XObjArray.h"
|
|
|
|
#include "../cpp_foundation/XString.h"
|
2021-02-06 18:16:46 +01:00
|
|
|
#include "XImage.h"
|
2020-08-11 14:43:53 +02:00
|
|
|
#include "libeg.h"
|
2023-11-08 14:35:22 +01:00
|
|
|
#include "nanosvg.h"
|
|
|
|
#include "../Platform/BootLog.h"
|
|
|
|
#include "../Platform/Utils.h"
|
2020-08-11 14:43:53 +02:00
|
|
|
|
|
|
|
extern CONST CHAR8* IconsNames[];
|
|
|
|
extern const INTN IconsNamesSize;
|
|
|
|
|
2023-11-08 14:35:22 +01:00
|
|
|
|
2020-08-11 14:43:53 +02:00
|
|
|
class XIcon
|
|
|
|
{
|
|
|
|
public:
|
2023-11-08 14:35:22 +01:00
|
|
|
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;
|
2020-08-11 14:43:53 +02:00
|
|
|
protected:
|
2023-11-08 14:35:22 +01:00
|
|
|
XBool Empty = true;
|
2020-08-11 14:43:53 +02:00
|
|
|
public:
|
2023-11-08 14:35:22 +01:00
|
|
|
XIcon() {};
|
2021-09-28 15:54:31 +02:00
|
|
|
XIcon(INTN Id, XBool Embedded = false);
|
2020-08-11 14:43:53 +02:00
|
|
|
|
|
|
|
|
2023-11-08 14:35:22 +01:00
|
|
|
XBool isEmpty() const { return Image.isEmpty() && ImageNight.isEmpty(); }
|
|
|
|
void setEmpty() { Id = 0; Name.setEmpty(); Image.setEmpty(); ImageNight.setEmpty(); Native = false; }
|
2020-08-11 14:43:53 +02:00
|
|
|
|
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);
|
2021-02-06 18:16:46 +01:00
|
|
|
void GetEmbedded();
|
2020-08-11 14:43:53 +02:00
|
|
|
|
|
|
|
// Default are not valid, as usual. We delete them. If needed, proper ones can be created
|
|
|
|
// Icon(const Icon&) = delete;
|
2023-11-07 17:40:28 +01:00
|
|
|
const XImage& GetBest(XBool night) const;
|
2020-08-11 14:43:53 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|