summaryrefslogtreecommitdiff
path: root/setup.h
blob: 5bf5c1410bb7401a9faa3dc0c342c11f69e8c2f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#ifndef __SKINDESIGNER_SETUP_H
#define __SKINDESIGNER_SETUP_H

#include "config.h"
#include "libskindesignerapi/skindesignerosdbase.h"

enum eItemType {
    itSkinSetup,
    itNoSkinSetup,
    itSkinRepo
};

// --- cInstallManager -----------------------------------------------------------
class cInstallManager {
private:
    uint64_t installationStart;
    int lastInstallDuration;
    int timeout;
    bool installing;
    bool updating;
    cSkinRepo *runningInst;
protected:
    string currentSkin;
    bool StartInstallation(string skin);
    bool StartUpdate(string skin);
    bool Installing(void) { return installing; };
    bool Updating(void) { return updating; };
    bool Finished(void);
    bool SuccessfullyInstalled(void);
    bool SuccessfullyUpdated(void);
    int Duration(void);
    eOSState ProcessInstallationStatus(void);
public:
    cInstallManager(void);
    virtual ~cInstallManager(void);
};

// --- cSkinDesignerSetup -----------------------------------------------------------
class cSkinDesignerSetup : public cMenuSetupPage, cInstallManager {
private:
    int numLogosPerSizeInitial;
    int limitLogoCache;
    int numLogosMax;
    int debugImageLoading;
    int rerunAmount;
    int rerunDistance;
    int rerunMaxChannel;
    int blockFlush;
    int framesPerSecond;
    const char *menuDisplayStyle[2];
    void Setup(void);
    virtual void Store(void);
    virtual eOSState ProcessKey(eKeys Key);
    cOsdItem *InfoItem(const char *label);
    void PluginSetup(void);
    void ImageCacheStatistics(void);
    void SkinSetup(void);
    void InstallSkins(void);
public:
    cSkinDesignerSetup(void);
    virtual ~cSkinDesignerSetup(void);
};

// --- cSkinMenuItem -----------------------------------------------------------

class cSkinMenuItem : public cOsdItem {
private:
    string skinName;
    eItemType type;
public:
    cSkinMenuItem(string skinName, string displayText, eItemType type);
    virtual ~cSkinMenuItem() {};
    string GetSkinName(void) { return skinName; };
    eItemType Type(void) { return type; };
};

// --- cSkinSetupSubMenu -----------------------------------------------------------

class cSkinSetupSubMenu : public cOsdItem {
private:
    string name;
    string displayText;
public:
    cSkinSetupSubMenu(string name, string displayText);
    virtual ~cSkinSetupSubMenu() {};
    string GetName(void) { return name; };
    string GetDisplayText(void) { return displayText; };
};

// --- cSkindesignerSkinSetup -----------------------------------------------------------

class cSkindesignerSkinSetup : public cOsdMenu, cInstallManager {
private:
    string skin;
    string menu;
    vector<string> helpTexts;
    string buttonRed;
    string buttonGreen;
    string buttonYellow;
    bool showRed;
    bool showYellow;
    bool hadHelp;
    void ShowButtons(int current, bool force = false);
protected:
    virtual eOSState ProcessKey(eKeys Key);
    void Set(void);
public:
    cSkindesignerSkinSetup(string skin, string menu, string header);
    virtual ~cSkindesignerSkinSetup();
};

// --- cSkindesignerSkinPreview -----------------------------------------------------------

class cSkindesignerSkinPreview : public skindesignerapi::cSkindesignerOsdMenu, cInstallManager {
protected:
    virtual eOSState ProcessKey(eKeys Key);
    void Set(void);
    string CheckFontInstalled(string fontName);
public:
    cSkindesignerSkinPreview(string skin);
    virtual ~cSkindesignerSkinPreview();
    void Display(void);
};

#endif //__SKINDESIGNER_SETUP_H