vdr-plugin-skindesigner/config.h

148 lines
5.3 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"
2014-09-27 09:25:14 +02:00
#include "libcore/fontmanager.h"
#include "libcore/imagecache.h"
#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:
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-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;
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);
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);
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;
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
2014-09-27 09:25:14 +02:00
int numLogosPerSizeInitial;
int limitLogoCache;
int numLogosMax;
int debugImageLoading;
int rerunAmount;
int rerunDistance;
int rerunMaxChannel;
int blockFlush;
2015-05-10 12:55:23 +02:00
int framesPerSecond;
//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;
cFontManager *fontManager = NULL;
cImageCache *imgCache = NULL;
2014-09-27 09:25:14 +02:00
cTheme Theme;
cRecordingsFolderInfo recFolderInfo(Recordings);
2014-09-27 09:25:14 +02:00
#else
extern cDesignerConfig config;
extern cFontManager *fontManager;
extern cImageCache *imgCache;
extern cTheme Theme;
extern cRecordingsFolderInfo recFolderInfo;
2014-09-27 09:25:14 +02:00
#endif
#endif //__DESIGNER_CONFIG_H