vdr-plugin-skindesigner/config.h

136 lines
4.4 KiB
C
Raw Normal View History

2014-09-27 09:25:14 +02:00
#ifndef __DESIGNER_CONFIG_H
#define __DESIGNER_CONFIG_H
#include <string>
#include <vector>
#include <map>
#include <vdr/tools.h>
#include <vdr/skins.h>
#include <vdr/plugin.h>
2015-05-30 16:43:59 +02:00
#include "designer.h"
2016-01-26 18:32:38 +01:00
#include "extensions/pluginmanager.h"
#include "extensions/fontmanager.h"
#include "extensions/imagecache.h"
#include "extensions/recfolderinfo.h"
#include "extensions/skinsetup.h"
#include "extensions/skinrepo.h"
#include "libskindesignerapi/skindesignerapi.h"
2014-09-27 09:25:14 +02:00
2015-01-06 06:07:48 +01:00
#define SCRIPTOUTPUTPATH "/tmp/skindesigner"
2014-09-27 09:25:14 +02:00
class cDesignerConfig {
private:
string version;
2014-11-15 09:47:22 +01:00
cString CheckSlashAtEnd(string path);
2014-09-27 09:25:14 +02:00
bool epgImagePathSet;
bool skinPathSet;
2015-05-22 13:34:23 +02:00
bool installerSkinPathSet;
bool logoPathSet;
cRect osdSize;
string osdSkin;
string osdTheme;
string fontFix;
string fontOsd;
string fontSml;
string osdLanguage;
cGlobals *tmplGlobals;
2015-05-30 16:43:59 +02:00
vector<cSkinDesigner*> skinRefs;
2016-02-14 15:06:30 +01:00
vector<cTheme*> themes;
2015-05-30 16:43:59 +02:00
vector<cSkinDesigner*>::iterator skinRefsIterator;
vector<string> deliveredSkins;
vector<string> installerSkins;
2015-05-03 06:22:35 +02:00
vector<string> skins;
vector<string>::iterator skinIterator;
map < string, cSkinSetup* > skinSetups;
map < string, cSkinSetup* >::iterator setupIt;
vector < pair <string, int> > skinSetupParameters;
2015-05-22 13:34:23 +02:00
cSkinRepos skinRepos;
2015-05-30 16:43:59 +02:00
void ReadSkinFolder(cString &folder, vector<string> *container);
2014-09-27 09:25:14 +02:00
public:
cDesignerConfig();
~cDesignerConfig();
void SetVersion(string version) {this->version = version; };
2014-09-27 09:25:14 +02:00
bool SetupParse(const char *Name, const char *Value);
void SetPathes(void);
2014-09-27 09:25:14 +02:00
void SetSkinPath(cString path);
2015-05-22 13:34:23 +02:00
void SetInstallerSkinPath(cString path);
void SetLogoPath(cString path);
2014-09-27 09:25:14 +02:00
void SetEpgImagePath(cString path);
2015-06-13 10:46:11 +02:00
bool GetThemeColor(string &name, tColor &col);
2016-02-14 15:06:30 +01:00
void StoreTheme(cTheme *theme);
void ReadSkins(void);
2015-01-19 09:23:15 +01:00
void ReadSkinSetup(string skin);
void InitSkinIterator(void) { skinIterator = skins.begin(); };
bool GetSkin(string &skin);
2015-05-30 16:43:59 +02:00
cString GetSkinPath(string skin);
void AddSkin(cSkinDesigner *skin) { skinRefs.push_back(skin); };
void AddNewSkinRef(string skin);
bool SkinActive(string skin);
void DeleteSkin(string skin);
2015-05-30 16:43:59 +02:00
void InitSkinRefsIterator(void) { skinRefsIterator = skinRefs.begin(); };
cSkinDesigner *GetNextSkinRef(void);
void ClearSkinSetups(void);
void DebugSkinSetups(void);
void DebugSkinSetupParameters(void);
2015-01-19 10:50:22 +01:00
cSkinSetup* GetSkinSetup(string &skin);
cSkinSetup* GetNextSkinSetup(void);
cSkinSetupMenu* GetSkinSetupMenu(string &skin, string &menu);
void InitSetupIterator(void) { setupIt = skinSetups.begin(); };
void TranslateSetup(void);
void SetSkinSetupParameters(void);
void UpdateSkinSetupParameter(string name, int value);
2015-05-22 13:34:23 +02:00
void ReadSkinRepos(void);
2015-05-30 16:43:59 +02:00
void InitSkinRepoIterator(void) { skinRepos.InitRepoIterator(); };
cSkinRepo *GetNextSkinRepo(void) { return skinRepos.GetNextRepo(); };
cSkinRepo *GetSkinRepo(string name) { return skinRepos.GetRepo(name); };
bool CheckVersion(string name, string &neededVersion);
2015-05-30 16:43:59 +02:00
bool SkinInstalled(string name);
void SetGlobals(cGlobals *globals) { tmplGlobals = globals; };
void UpdateGlobals(void);
2014-09-27 09:25:14 +02:00
void CheckDecimalPoint(void);
void SetSkin(void);
bool SkinChanged(void);
void SetOSDSize(void);
bool OsdSizeChanged(void);
void SetOSDFonts(void);
bool OsdFontsChanged(void);
2015-01-21 18:33:19 +01:00
void SetOsdLanguage(void) { osdLanguage = Setup.OSDLanguage; };
bool OsdLanguageChanged(void);
cString GetSkinRessourcePath(void);
2014-09-27 09:25:14 +02:00
cString skinPath;
2015-05-22 13:34:23 +02:00
cString installerSkinPath;
cString logoPath;
2014-09-27 09:25:14 +02:00
cString epgImagePath;
2015-05-30 16:43:59 +02:00
string vdrThemesPath;
bool replaceDecPoint;
char decPoint;
//Setup Parameter
2016-01-26 18:32:38 +01:00
int cacheImagesInitial;
2014-09-27 09:25:14 +02:00
int numLogosPerSizeInitial;
int limitLogoCache;
int numLogosMax;
int debugImageLoading;
int rerunAmount;
int rerunDistance;
int rerunMaxChannel;
2016-01-26 18:32:38 +01:00
int numCustomTokens;
//TemplateReload on Setup Close
bool setupCloseDoReload;
2014-09-27 09:25:14 +02:00
};
2014-09-27 09:25:14 +02:00
#ifdef DEFINE_CONFIG
cDesignerConfig config;
2016-01-26 18:32:38 +01:00
cSDPluginManager *plgManager = NULL;
cFontManager *fontManager = NULL;
cImageCache *imgCache = NULL;
cRecordingsFolderInfo recFolderInfo(Recordings);
2014-09-27 09:25:14 +02:00
#else
extern cDesignerConfig config;
2016-01-26 18:32:38 +01:00
extern cSDPluginManager *plgManager;
2014-09-27 09:25:14 +02:00
extern cFontManager *fontManager;
extern cImageCache *imgCache;
extern cRecordingsFolderInfo recFolderInfo;
2014-09-27 09:25:14 +02:00
#endif
#endif //__DESIGNER_CONFIG_H