2020-03-12 10:47:59 +01:00
|
|
|
#if !defined(__XTHEME_H__)
|
2020-03-13 14:34:36 +01:00
|
|
|
#define __XTHEME_H__
|
|
|
|
|
2020-03-12 10:47:59 +01:00
|
|
|
#include "../cpp_foundation/XToolsCommon.h"
|
|
|
|
#include "../cpp_foundation/XObjArray.h"
|
2020-03-16 12:15:25 +01:00
|
|
|
#include "../cpp_foundation/XString.h"
|
2020-03-13 14:34:36 +01:00
|
|
|
#include "libeg.h"
|
|
|
|
#include "XImage.h"
|
|
|
|
|
2020-03-18 07:39:11 +01:00
|
|
|
#define INDICATOR_SIZE (52)
|
|
|
|
|
2020-03-13 14:34:36 +01:00
|
|
|
class Icon
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
INTN Id; //for example BUILTIN_ICON_POINTER
|
2020-03-18 07:39:11 +01:00
|
|
|
XStringW Name; //for example "os_moja", "vol_internal"
|
2020-03-13 14:34:36 +01:00
|
|
|
XImage Image;
|
2020-03-18 07:39:11 +01:00
|
|
|
XImage ImageNight;
|
2020-03-13 14:34:36 +01:00
|
|
|
|
2020-03-16 12:15:25 +01:00
|
|
|
Icon(INTN Id);
|
2020-03-21 12:43:45 +01:00
|
|
|
Icon(INTN Index, BOOLEAN Embedded);
|
2020-03-13 14:34:36 +01:00
|
|
|
~Icon();
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
class XTheme
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
XObjArray<Icon> Icons;
|
2020-03-17 20:43:58 +01:00
|
|
|
EFI_FILE *ThemeDir;
|
2020-03-13 14:34:36 +01:00
|
|
|
|
2020-03-12 10:47:59 +01:00
|
|
|
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;
|
|
|
|
UINTN 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;
|
2020-03-12 15:00:36 +01:00
|
|
|
// INTN IconFormat;
|
2020-03-12 10:47:59 +01:00
|
|
|
BOOLEAN Proportional;
|
|
|
|
BOOLEAN ShowOptimus;
|
|
|
|
BOOLEAN DarkEmbedded;
|
|
|
|
BOOLEAN TypeSVG;
|
|
|
|
INTN Codepage;
|
|
|
|
INTN CodepageSize;
|
|
|
|
float Scale;
|
2020-03-13 14:34:36 +01:00
|
|
|
float CentreShift;
|
2020-03-20 18:48:19 +01:00
|
|
|
INTN row0TileSize;
|
|
|
|
INTN row1TileSize;
|
|
|
|
UINTN BanHeight;
|
|
|
|
INTN LayoutHeight; //it was 376 before
|
|
|
|
BOOLEAN Daylight;
|
2020-03-13 14:34:36 +01:00
|
|
|
|
|
|
|
XImage Background; //Background and Banner will not be in array as they live own life
|
2020-03-17 05:25:38 +01:00
|
|
|
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?
|
2020-03-20 18:48:19 +01:00
|
|
|
XImage SelectionImages[6];
|
2020-03-23 15:51:20 +01:00
|
|
|
XImage Buttons[4];
|
2020-03-20 18:48:19 +01:00
|
|
|
XImage ScrollbarBackgroundImage;
|
|
|
|
XImage BarStartImage;
|
|
|
|
XImage BarEndImage;
|
|
|
|
XImage ScrollbarImage;
|
|
|
|
XImage ScrollStartImage;
|
|
|
|
XImage ScrollEndImage;
|
|
|
|
XImage UpButtonImage;
|
|
|
|
XImage DownButtonImage;
|
2020-03-13 14:34:36 +01:00
|
|
|
|
2020-03-17 05:25:38 +01:00
|
|
|
//fill the theme
|
2020-03-21 12:43:45 +01:00
|
|
|
XImage& GetIcon(const XStringW& Name); //get by name
|
2020-03-18 15:11:56 +01:00
|
|
|
XImage& GetIcon(const char* Name);
|
2020-03-18 10:07:34 +01:00
|
|
|
XImage& GetIcon(INTN Id); //get by id
|
2020-03-13 14:34:36 +01:00
|
|
|
|
|
|
|
void AddIcon(Icon& NewIcon); //return EFI_STATUS?
|
2020-03-16 12:15:25 +01:00
|
|
|
void FillByEmbedded();
|
2020-03-21 12:43:45 +01:00
|
|
|
void FillByDir();
|
2020-03-17 05:25:38 +01:00
|
|
|
|
|
|
|
//screen operations
|
|
|
|
void ClearScreen();
|
2020-03-17 20:43:58 +01:00
|
|
|
void FillRectAreaOfScreen(IN INTN XPos, IN INTN YPos, IN INTN Width, IN INTN Height);
|
|
|
|
void InitSelection();
|
2020-03-20 18:48:19 +01:00
|
|
|
void InitBar();
|
2020-03-16 12:15:25 +01:00
|
|
|
|
2020-03-20 18:48:19 +01:00
|
|
|
void Init();
|
|
|
|
XTheme(); //default constructor
|
2020-03-13 14:34:36 +01:00
|
|
|
~XTheme();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
//internal layout variables instead of globals in menu.cpp
|
|
|
|
|
|
|
|
};
|
2020-03-16 20:47:02 +01:00
|
|
|
#endif
|