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"
|
2014-09-27 09:25:14 +02:00
|
|
|
#include "libcore/fontmanager.h"
|
|
|
|
#include "libcore/imagecache.h"
|
2014-10-18 16:50:33 +02:00
|
|
|
#include "libcore/recfolderinfo.h"
|
2015-01-19 09:23:15 +01:00
|
|
|
#include "libcore/skinsetup.h"
|
2015-05-22 13:34:23 +02:00
|
|
|
#include "libcore/skinrepo.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-02-12 18:50:58 +01:00
|
|
|
map < string, map < int, string > > pluginMenus;
|
|
|
|
map < string, map < int, string > >::iterator plugMenuIt;
|
|
|
|
map < string, map < int, string > > pluginViews;
|
|
|
|
map < string, map < int, string > >::iterator plugViewIt;
|
2015-03-12 17:28:35 +01:00
|
|
|
map < string, multimap< int, pair <int, string> > > pluginSubViews;
|
2015-02-12 18:50:58 +01:00
|
|
|
map < string, map< int, map <int, string> > > pluginViewElements;
|
|
|
|
map < string, map< int, map <int, string> > > pluginViewGrids;
|
2015-05-30 16:43:59 +02:00
|
|
|
vector<cSkinDesigner*> skinRefs;
|
|
|
|
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);
|
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);
|
2015-02-12 18:50:58 +01:00
|
|
|
void AddPluginMenus(string name, map< int, string > menus);
|
2015-03-12 17:28:35 +01:00
|
|
|
void AddPluginViews(string name, map< int, string > views, multimap< int, pair <int, string> > subViews, map< int, map <int, string> > viewElements, map< int, map <int, string> > viewGrids);
|
2015-02-12 18:50:58 +01:00
|
|
|
void InitPluginMenuIterator(void);
|
2014-11-15 09:47:22 +01:00
|
|
|
map <int,string> *GetPluginTemplates(string &name);
|
2015-02-12 18:50:58 +01:00
|
|
|
void InitPluginViewIterator(void);
|
|
|
|
map <int,string> *GetPluginViews(string &name);
|
2015-03-12 17:28:35 +01:00
|
|
|
map <int,string> GetPluginSubViews(string name, int viewID);
|
2015-02-12 18:50:58 +01:00
|
|
|
int GetPluginViewElementID(string pluginName, string viewElementName, int viewID);
|
|
|
|
int GetPluginViewGridID(string pluginName, string viewGridName, int viewID);
|
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
|
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;
|
2014-10-18 09:11:11 +02:00
|
|
|
int blockFlush;
|
2015-05-10 12:55:23 +02:00
|
|
|
int framesPerSecond;
|
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;
|
2014-10-03 15:54:23 +02:00
|
|
|
cFontManager *fontManager = NULL;
|
|
|
|
cImageCache *imgCache = NULL;
|
2014-09-27 09:25:14 +02:00
|
|
|
cTheme Theme;
|
2014-10-18 16:50:33 +02:00
|
|
|
cRecordingsFolderInfo recFolderInfo(Recordings);
|
2014-09-27 09:25:14 +02:00
|
|
|
#else
|
|
|
|
extern cDesignerConfig config;
|
|
|
|
extern cFontManager *fontManager;
|
|
|
|
extern cImageCache *imgCache;
|
|
|
|
extern cTheme Theme;
|
2014-10-18 16:50:33 +02:00
|
|
|
extern cRecordingsFolderInfo recFolderInfo;
|
2014-09-27 09:25:14 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif //__DESIGNER_CONFIG_H
|