mirror of
https://github.com/CloverHackyColor/CloverBootloader.git
synced 2024-12-18 15:27:48 +01:00
ace46a5646
Signed-off-by: SergeySlice <sergey.slice@gmail.com>
131 lines
3.3 KiB
C++
131 lines
3.3 KiB
C++
#if !defined(__XTHEME_H__)
|
|
#define __XTHEME_H__
|
|
|
|
#include "../cpp_foundation/XToolsCommon.h"
|
|
#include "../cpp_foundation/XObjArray.h"
|
|
#include "../cpp_foundation/XString.h"
|
|
#include "libeg.h"
|
|
//#include "nanosvg.h"
|
|
#include "XImage.h"
|
|
|
|
|
|
#define INDICATOR_SIZE (52)
|
|
|
|
class Icon
|
|
{
|
|
public:
|
|
INTN Id; //for example BUILTIN_ICON_POINTER
|
|
XStringW Name; //for example "os_moja", "vol_internal"
|
|
XImage Image;
|
|
XImage ImageNight;
|
|
|
|
Icon(INTN Id);
|
|
Icon(INTN Index, BOOLEAN Embedded);
|
|
~Icon();
|
|
|
|
};
|
|
|
|
class XTheme
|
|
{
|
|
public:
|
|
XObjArray<Icon> Icons;
|
|
EFI_FILE *ThemeDir;
|
|
|
|
// UINTN DisableFlags;
|
|
UINTN HideBadges;
|
|
UINTN HideUIFlags;
|
|
// BOOLEAN TextOnly;
|
|
FONT_TYPE Font;
|
|
INTN CharWidth;
|
|
UINTN SelectionColor;
|
|
XStringW FontFileName;
|
|
XStringW Theme;
|
|
XStringW BannerFileName;
|
|
XStringW SelectionSmallFileName;
|
|
XStringW SelectionBigFileName;
|
|
XStringW SelectionIndicatorName;
|
|
XStringW DefaultSelection;
|
|
XStringW BackgroundName;
|
|
SCALING BackgroundScale;
|
|
INTN BackgroundSharp;
|
|
BOOLEAN BackgroundDark;
|
|
// BOOLEAN CustomIcons;
|
|
BOOLEAN SelectionOnTop;
|
|
BOOLEAN BootCampStyle;
|
|
INTN BadgeOffsetX;
|
|
INTN BadgeOffsetY;
|
|
INTN BadgeScale;
|
|
INTN ThemeDesignWidth;
|
|
INTN ThemeDesignHeight;
|
|
INTN BannerPosX;
|
|
INTN BannerPosY;
|
|
INTN BannerEdgeHorizontal;
|
|
INTN BannerEdgeVertical;
|
|
INTN BannerNudgeX;
|
|
INTN BannerNudgeY;
|
|
BOOLEAN VerticalLayout;
|
|
BOOLEAN NonSelectedGrey;
|
|
INTN MainEntriesSize;
|
|
INTN TileXSpace;
|
|
INTN TileYSpace;
|
|
// INTN IconFormat;
|
|
BOOLEAN Proportional;
|
|
// BOOLEAN ShowOptimus;
|
|
BOOLEAN DarkEmbedded;
|
|
BOOLEAN TypeSVG;
|
|
INTN Codepage;
|
|
INTN CodepageSize;
|
|
float Scale;
|
|
float CentreShift;
|
|
INTN row0TileSize;
|
|
INTN row1TileSize;
|
|
UINTN BanHeight;
|
|
INTN LayoutHeight; //it was 376 before
|
|
INTN LayoutBannerOffset;
|
|
INTN LayoutButtonOffset;
|
|
INTN LayoutTextOffset;
|
|
INTN LayoutAnimMoveForMenuX;
|
|
|
|
BOOLEAN Daylight;
|
|
|
|
XImage Background; //Background and Banner will not be in array as they live own life
|
|
XImage BigBack; //it size is not equal to screen size will be scaled or cropped
|
|
XImage Banner; //same as logo in the array, make a link?
|
|
XImage SelectionImages[6];
|
|
XImage Buttons[4];
|
|
XImage ScrollbarBackgroundImage;
|
|
XImage BarStartImage;
|
|
XImage BarEndImage;
|
|
XImage ScrollbarImage;
|
|
XImage ScrollStartImage;
|
|
XImage ScrollEndImage;
|
|
XImage UpButtonImage;
|
|
XImage DownButtonImage;
|
|
|
|
//fill the theme
|
|
XImage& GetIcon(const XStringW& Name); //get by name
|
|
XImage& GetIcon(const char* Name);
|
|
XImage& GetIcon(INTN Id); //get by id
|
|
|
|
void AddIcon(Icon& NewIcon); //return EFI_STATUS?
|
|
void FillByEmbedded();
|
|
void FillByDir();
|
|
EFI_STATUS GetThemeTagSettings (void* DictPointer);
|
|
void parseTheme(void* p, const char** dict); //in nano project
|
|
|
|
//screen operations
|
|
void ClearScreen();
|
|
void FillRectAreaOfScreen(IN INTN XPos, IN INTN YPos, IN INTN Width, IN INTN Height);
|
|
void InitSelection();
|
|
void InitBar();
|
|
|
|
void Init();
|
|
XTheme(); //default constructor
|
|
~XTheme();
|
|
|
|
protected:
|
|
//internal layout variables instead of globals in menu.cpp
|
|
|
|
};
|
|
#endif
|