vdr-plugin-skindesigner/config.h

119 lines
4.0 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>
#include "libcore/fontmanager.h"
#include "libcore/imagecache.h"
#include "libcore/recfolderinfo.h"
2015-01-19 09:23:15 +01:00
#include "libcore/skinsetup.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:
2014-11-15 09:47:22 +01:00
cString CheckSlashAtEnd(string path);
2014-09-27 09:25:14 +02:00
bool epgImagePathSet;
bool skinPathSet;
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;
map < string, cSkinSetup* > skinSetups;
map < string, cSkinSetup* >::iterator setupIt;
vector < pair <string, int> > skinSetupParameters;
2014-09-27 09:25:14 +02:00
public:
cDesignerConfig();
~cDesignerConfig();
bool SetupParse(const char *Name, const char *Value);
void SetPathes(void);
2014-09-27 09:25:14 +02:00
void SetSkinPath(cString path);
void SetLogoPath(cString path);
2014-09-27 09:25:14 +02:00
void SetEpgImagePath(cString path);
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);
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);
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;
cString logoPath;
2014-09-27 09:25:14 +02:00
cString epgImagePath;
vector<string> skins;
vector<string>::iterator skinIterator;
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;
//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