template for theme class

Signed-off-by: Sergey Isakov <isakov-sl@bk.ru>
This commit is contained in:
Sergey Isakov 2020-03-12 12:47:59 +03:00
parent 8d75c1909e
commit 2e1ad593df
4 changed files with 86 additions and 7 deletions

View File

@ -0,0 +1,5 @@
/*
* a class to keep definitions for all theme settings
*/
class XTheme;

73
rEFIt_UEFI/libeg/XTheme.h Normal file
View File

@ -0,0 +1,73 @@
#if !defined(__XTHEME_H__)
#define __XTHEME_H__
#include "../cpp_foundation/XToolsCommon.h"
#include "../cpp_foundation/XObjArray.h"
#include "../cpp_foundation/XStringW.h"
#include "libeg.h"
#include "XImage.h"
class Icon
{
public:
CONST CHAR8 Name; //for example "os_moja", "vol_internal"
XImage Image;
};
class XTheme
{
public:
XObjArray<Icon> Icons;
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;
INTN IconFormat;
BOOLEAN Proportional;
BOOLEAN ShowOptimus;
BOOLEAN DarkEmbedded;
BOOLEAN TypeSVG;
INTN Codepage;
INTN CodepageSize;
float Scale;
float CentreShift;
protected:
//internal layout variables instead of globals in menu.cpp
};
#endif

View File

@ -142,6 +142,14 @@ extern "C" {
/* types */
typedef enum {
imNone,
imScale,
imCrop,
imTile
} SCALING;
typedef enum {
FONT_ALFA,
FONT_GRAY,

View File

@ -402,13 +402,6 @@ extern INTN ScrollbarYMovement;
#define HDBADGES_SHOW (1<<1)
#define HDBADGES_INLINE (1<<2)
typedef enum {
imNone,
imScale,
imCrop,
imTile
} SCALING;
typedef struct {
INTN Timeout;