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:
|
2015-07-17 17:37:16 +02:00
|
|
|
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;
|
2014-10-03 15:54:23 +02:00
|
|
|
bool logoPathSet;
|
2014-10-18 10:05:32 +02:00
|
|
|
cRect osdSize;
|
|
|
|
string osdSkin;
|
|
|
|
string osdTheme;
|
2014-10-18 10:28:38 +02:00
|
|
|
string fontFix;
|
|
|
|
string fontOsd;
|
|
|
|
string fontSml;
|
2014-11-22 12:19:13 +01:00
|
|
|
string osdLanguage;
|
2015-01-20 09:29:16 +01:00
|
|
|
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;
|
2015-01-20 09:29:16 +01:00
|
|
|
map < string, cSkinSetup* > skinSetups;
|
|
|
|
map < string, cSkinSetup* >::iterator setupIt;
|
2015-01-20 14:26:28 +01:00
|
|
|
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();
|
2015-07-17 17:37:16 +02:00
|
|
|
void SetVersion(string version) {this->version = version; };
|
2014-09-27 09:25:14 +02:00
|
|
|
bool SetupParse(const char *Name, const char *Value);
|
2014-10-03 15:54:23 +02:00
|
|
|
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);
|
2014-10-03 15:54:23 +02:00
|
|
|
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);
|
2014-10-03 15:54:23 +02:00
|
|
|
void ReadSkins(void);
|
2015-01-19 09:23:15 +01:00
|
|
|
void ReadSkinSetup(string skin);
|
2014-10-03 15:54:23 +02:00
|
|
|
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);
|
2015-06-04 16:29:25 +02:00
|
|
|
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);
|
2015-01-20 09:29:16 +01:00
|
|
|
void ClearSkinSetups(void);
|
2015-01-20 14:26:28 +01:00
|
|
|
void DebugSkinSetups(void);
|
|
|
|
void DebugSkinSetupParameters(void);
|
2015-01-19 10:50:22 +01:00
|
|
|
cSkinSetup* GetSkinSetup(string &skin);
|
2015-01-31 11:46:06 +01:00
|
|
|
cSkinSetup* GetNextSkinSetup(void);
|
|
|
|
cSkinSetupMenu* GetSkinSetupMenu(string &skin, string &menu);
|
2015-01-20 09:29:16 +01:00
|
|
|
void InitSetupIterator(void) { setupIt = skinSetups.begin(); };
|
|
|
|
void TranslateSetup(void);
|
2015-01-20 14:26:28 +01:00
|
|
|
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); };
|
2015-07-17 17:37:16 +02:00
|
|
|
bool CheckVersion(string name, string &neededVersion);
|
2015-05-30 16:43:59 +02:00
|
|
|
bool SkinInstalled(string name);
|
2015-01-20 09:29:16 +01:00
|
|
|
void SetGlobals(cGlobals *globals) { tmplGlobals = globals; };
|
|
|
|
void UpdateGlobals(void);
|
2014-09-27 09:25:14 +02:00
|
|
|
void CheckDecimalPoint(void);
|
2014-10-18 10:05:32 +02:00
|
|
|
void SetSkin(void);
|
|
|
|
bool SkinChanged(void);
|
|
|
|
void SetOSDSize(void);
|
|
|
|
bool OsdSizeChanged(void);
|
2014-10-18 10:28:38 +02:00
|
|
|
void SetOSDFonts(void);
|
|
|
|
bool OsdFontsChanged(void);
|
2015-01-21 18:33:19 +01:00
|
|
|
void SetOsdLanguage(void) { osdLanguage = Setup.OSDLanguage; };
|
2014-11-22 12:19:13 +01:00
|
|
|
bool OsdLanguageChanged(void);
|
2014-10-26 11:09:09 +01:00
|
|
|
cString GetSkinRessourcePath(void);
|
2014-09-27 09:25:14 +02:00
|
|
|
cString skinPath;
|
2015-05-22 13:34:23 +02:00
|
|
|
cString installerSkinPath;
|
2014-10-03 15:54:23 +02:00
|
|
|
cString logoPath;
|
2014-09-27 09:25:14 +02:00
|
|
|
cString epgImagePath;
|
2015-05-30 16:43:59 +02:00
|
|
|
string vdrThemesPath;
|
2015-01-20 09:29:16 +01:00
|
|
|
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;
|
2014-10-11 10:39:41 +02:00
|
|
|
int rerunAmount;
|
|
|
|
int rerunDistance;
|
|
|
|
int rerunMaxChannel;
|
2016-01-26 18:32:38 +01:00
|
|
|
int numCustomTokens;
|
2015-01-31 11:46:06 +01:00
|
|
|
//TemplateReload on Setup Close
|
|
|
|
bool setupCloseDoReload;
|
2014-09-27 09:25:14 +02:00
|
|
|
};
|
2014-10-18 09:11:11 +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;
|
2014-10-03 15:54:23 +02:00
|
|
|
cFontManager *fontManager = NULL;
|
|
|
|
cImageCache *imgCache = NULL;
|
2014-10-18 16:50:33 +02:00
|
|
|
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;
|
2014-10-18 16:50:33 +02:00
|
|
|
extern cRecordingsFolderInfo recFolderInfo;
|
2014-09-27 09:25:14 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif //__DESIGNER_CONFIG_H
|