checking setup conditions for viewelements

This commit is contained in:
louis 2015-03-13 18:00:39 +01:00
parent b84af82ef5
commit 229b1274a5
21 changed files with 129 additions and 53 deletions

View File

@ -208,3 +208,4 @@ Version 0.2.2
Version 0.3.0 Version 0.3.0
- checking setup conditions for viewelements

View File

@ -18,11 +18,13 @@
<!ELEMENT background (area|areascroll)*> <!ELEMENT background (area|areascroll)*>
<!ATTLIST background <!ATTLIST background
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT header (area|areascroll)*> <!ELEMENT header (area|areascroll)*>
<!ATTLIST header <!ATTLIST header
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT menuitems (listelement)> <!ELEMENT menuitems (listelement)>

View File

@ -21,91 +21,109 @@
<!ELEMENT background (area)*> <!ELEMENT background (area)*>
<!ATTLIST background <!ATTLIST background
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT channelinfo (area|areascroll)*> <!ELEMENT channelinfo (area|areascroll)*>
<!ATTLIST channelinfo <!ATTLIST channelinfo
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT epginfo (area|areascroll)*> <!ELEMENT epginfo (area|areascroll)*>
<!ATTLIST epginfo <!ATTLIST epginfo
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT progressbar (area|areascroll)*> <!ELEMENT progressbar (area|areascroll)*>
<!ATTLIST progressbar <!ATTLIST progressbar
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT progressbarback (area)*> <!ELEMENT progressbarback (area)*>
<!ATTLIST progressbarback <!ATTLIST progressbarback
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT statusinfo (area|areascroll)*> <!ELEMENT statusinfo (area|areascroll)*>
<!ATTLIST statusinfo <!ATTLIST statusinfo
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT audioinfo (area|areascroll)*> <!ELEMENT audioinfo (area|areascroll)*>
<!ATTLIST audioinfo <!ATTLIST audioinfo
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT screenresolution (area|areascroll)*> <!ELEMENT screenresolution (area|areascroll)*>
<!ATTLIST screenresolution <!ATTLIST screenresolution
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT channelgroup (area|areascroll)*> <!ELEMENT channelgroup (area|areascroll)*>
<!ATTLIST channelgroup <!ATTLIST channelgroup
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT signalquality (area|areascroll)*> <!ELEMENT signalquality (area|areascroll)*>
<!ATTLIST signalquality <!ATTLIST signalquality
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT signalqualityback (area|areascroll)*> <!ELEMENT signalqualityback (area|areascroll)*>
<!ATTLIST signalqualityback <!ATTLIST signalqualityback
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT devices (area|areascroll)*> <!ELEMENT devices (area|areascroll)*>
<!ATTLIST devices <!ATTLIST devices
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT currentweather (area|areascroll)*> <!ELEMENT currentweather (area|areascroll)*>
<!ATTLIST currentweather <!ATTLIST currentweather
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT scrapercontent (area|areascroll)*> <!ELEMENT scrapercontent (area|areascroll)*>
<!ATTLIST scrapercontent <!ATTLIST scrapercontent
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT datetime (area|areascroll)*> <!ELEMENT datetime (area|areascroll)*>
<!ATTLIST datetime <!ATTLIST datetime
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT time (area|areascroll)*> <!ELEMENT time (area|areascroll)*>
<!ATTLIST time <!ATTLIST time
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT message (area|areascroll)*> <!ELEMENT message (area|areascroll)*>
<!ATTLIST message <!ATTLIST message
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT customtokens (area|areascroll)*> <!ELEMENT customtokens (area|areascroll)*>
<!ATTLIST customtokens <!ATTLIST customtokens
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
%functions; %functions;

View File

@ -18,86 +18,103 @@
<!ELEMENT background (area)*> <!ELEMENT background (area)*>
<!ATTLIST background <!ATTLIST background
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT header (area|areascroll)*> <!ELEMENT header (area|areascroll)*>
<!ATTLIST header <!ATTLIST header
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT datetime (area|areascroll)*> <!ELEMENT datetime (area|areascroll)*>
<!ATTLIST datetime <!ATTLIST datetime
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT time (area|areascroll)*> <!ELEMENT time (area|areascroll)*>
<!ATTLIST time <!ATTLIST time
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT message (area|areascroll)*> <!ELEMENT message (area|areascroll)*>
<!ATTLIST message <!ATTLIST message
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT colorbuttons (area|areascroll)*> <!ELEMENT colorbuttons (area|areascroll)*>
<!ATTLIST colorbuttons <!ATTLIST colorbuttons
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT timers (area|areascroll)*> <!ELEMENT timers (area|areascroll)*>
<!ATTLIST timers <!ATTLIST timers
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT discusage (area|areascroll)*> <!ELEMENT discusage (area|areascroll)*>
<!ATTLIST discusage <!ATTLIST discusage
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT devices (area|areascroll)*> <!ELEMENT devices (area|areascroll)*>
<!ATTLIST devices <!ATTLIST devices
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT systemload (area|areascroll)*> <!ELEMENT systemload (area|areascroll)*>
<!ATTLIST systemload <!ATTLIST systemload
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT temperatures (area|areascroll)*> <!ELEMENT temperatures (area|areascroll)*>
<!ATTLIST temperatures <!ATTLIST temperatures
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT currentschedule (area|areascroll)*> <!ELEMENT currentschedule (area|areascroll)*>
<!ATTLIST currentschedule <!ATTLIST currentschedule
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT currentweather (area|areascroll)*> <!ELEMENT currentweather (area|areascroll)*>
<!ATTLIST currentweather <!ATTLIST currentweather
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT customtokens (area|areascroll)*> <!ELEMENT customtokens (area|areascroll)*>
<!ATTLIST customtokens <!ATTLIST customtokens
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT scrollbar (area|areascroll)*> <!ELEMENT scrollbar (area|areascroll)*>
<!ATTLIST scrollbar <!ATTLIST scrollbar
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT detailheader (area|areascroll)*> <!ELEMENT detailheader (area|areascroll)*>
<!ATTLIST detailheader <!ATTLIST detailheader
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT tablabels (area|areascroll)*> <!ELEMENT tablabels (area|areascroll)*>
<!ATTLIST tablabels <!ATTLIST tablabels
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT menudefault (background | header | datetime | time | colorbuttons | scrollbar | menuitems)*> <!ELEMENT menudefault (background | header | datetime | time | colorbuttons | scrollbar | menuitems)*>

View File

@ -32,66 +32,79 @@
<!ELEMENT datetime (area|areascroll)*> <!ELEMENT datetime (area|areascroll)*>
<!ATTLIST datetime <!ATTLIST datetime
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT time (area|areascroll)*> <!ELEMENT time (area|areascroll)*>
<!ATTLIST time <!ATTLIST time
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT scrapercontent (area|areascroll)*> <!ELEMENT scrapercontent (area|areascroll)*>
<!ATTLIST scrapercontent <!ATTLIST scrapercontent
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT rectitle (area|areascroll)*> <!ELEMENT rectitle (area|areascroll)*>
<!ATTLIST rectitle <!ATTLIST rectitle
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT recinfo (area|areascroll)*> <!ELEMENT recinfo (area|areascroll)*>
<!ATTLIST recinfo <!ATTLIST recinfo
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT currenttime (area|areascroll)*> <!ELEMENT currenttime (area|areascroll)*>
<!ATTLIST currenttime <!ATTLIST currenttime
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT totaltime (area|areascroll)*> <!ELEMENT totaltime (area|areascroll)*>
<!ATTLIST totaltime <!ATTLIST totaltime
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT progressbar (area|areascroll)*> <!ELEMENT progressbar (area|areascroll)*>
<!ATTLIST progressbar <!ATTLIST progressbar
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT cutmarks (area|areascroll)*> <!ELEMENT cutmarks (area|areascroll)*>
<!ATTLIST cutmarks <!ATTLIST cutmarks
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT controlicons (area|areascroll)*> <!ELEMENT controlicons (area|areascroll)*>
<!ATTLIST controlicons <!ATTLIST controlicons
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT controliconsmodeonly (area|areascroll)*> <!ELEMENT controliconsmodeonly (area|areascroll)*>
<!ATTLIST controliconsmodeonly <!ATTLIST controliconsmodeonly
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT jump (area|areascroll)*> <!ELEMENT jump (area|areascroll)*>
<!ATTLIST jump <!ATTLIST jump
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT message (area|areascroll)*> <!ELEMENT message (area|areascroll)*>
<!ATTLIST message <!ATTLIST message
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT onpause (area|areascroll)*> <!ELEMENT onpause (area|areascroll)*>
@ -99,6 +112,7 @@
debug CDATA #IMPLIED debug CDATA #IMPLIED
delay CDATA #REQUIRED delay CDATA #REQUIRED
fadetime CDATA #IMPLIED fadetime CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT onpausemodeonly (area|areascroll)*> <!ELEMENT onpausemodeonly (area|areascroll)*>
@ -106,11 +120,13 @@
debug CDATA #IMPLIED debug CDATA #IMPLIED
delay CDATA #REQUIRED delay CDATA #REQUIRED
fadetime CDATA #IMPLIED fadetime CDATA #IMPLIED
condition CDATA #IMPLIED
> >
<!ELEMENT customtokens (area|areascroll)*> <!ELEMENT customtokens (area|areascroll)*>
<!ATTLIST customtokens <!ATTLIST customtokens
debug CDATA #IMPLIED debug CDATA #IMPLIED
condition CDATA #IMPLIED
> >
%functions; %functions;

View File

@ -194,6 +194,14 @@ int cTemplateView::GetNumPixmapsViewElement(eViewElement ve) {
return viewElement->GetNumPixmaps(); return viewElement->GetNumPixmaps();
} }
bool cTemplateView::ExecuteView(eViewElement ve) {
map < eViewElement, cTemplateViewElement* >::iterator hit = viewElements.find(ve);
if (hit == viewElements.end())
return false;
cTemplateViewElement *viewElement = hit->second;
return viewElement->Execute();
}
int cTemplateView::GetNumListViewMenuItems(void) { int cTemplateView::GetNumListViewMenuItems(void) {
int numElements = 0; int numElements = 0;
cTemplateViewList *menuList = GetViewList(vlMenuItem); cTemplateViewList *menuList = GetViewList(vlMenuItem);
@ -552,6 +560,7 @@ void cTemplateView::SetFunctionDefinitions(void) {
attributes.insert("delay"); attributes.insert("delay");
attributes.insert("fadetime"); attributes.insert("fadetime");
attributes.insert("name"); attributes.insert("name");
attributes.insert("condition");
funcsAllowed.insert(pair< string, set<string> >(name, attributes)); funcsAllowed.insert(pair< string, set<string> >(name, attributes));
name = "area"; name = "area";

View File

@ -109,6 +109,7 @@ public:
cRect GetOsdSize(void); cRect GetOsdSize(void);
int GetNumPixmaps(void); int GetNumPixmaps(void);
int GetNumPixmapsViewElement(eViewElement ve); int GetNumPixmapsViewElement(eViewElement ve);
bool ExecuteView(eViewElement ve);
int GetNumListViewMenuItems(void); int GetNumListViewMenuItems(void);
bool GetScalingWindow(cRect &scalingWindow); bool GetScalingWindow(cRect &scalingWindow);
map<string,string> GetCustomStringTokens(void) { return globals->GetCustomStringTokens(); }; map<string,string> GetCustomStringTokens(void) { return globals->GetCustomStringTokens(); };

View File

@ -46,7 +46,7 @@ bool cTemplateViewElement::CalculateParameters(void) {
parameters->SetContainer(containerX, containerY, containerWidth, containerHeight); parameters->SetContainer(containerX, containerY, containerWidth, containerHeight);
parameters->SetGlobals(globals); parameters->SetGlobals(globals);
paramsValid = parameters->CalculateParameters(); paramsValid = parameters->CalculateParameters();
parameters->ParseParameters();
return paramsValid; return paramsValid;
} }
@ -118,6 +118,13 @@ cTemplateFunction *cTemplateViewElement::GetFunction(string name) {
return NULL; return NULL;
} }
bool cTemplateViewElement::Execute(void) {
if (!parameters)
return true;
return parameters->DoExecute();
}
bool cTemplateViewElement::DebugTokens(void) { bool cTemplateViewElement::DebugTokens(void) {
if (!parameters) if (!parameters)
return false; return false;

View File

@ -105,6 +105,7 @@ public:
void InitIterator(void); void InitIterator(void);
cTemplatePixmap *GetNextPixmap(void); cTemplatePixmap *GetNextPixmap(void);
cTemplateFunction *GetFunction(string name); cTemplateFunction *GetFunction(string name);
bool Execute(void);
bool DebugTokens(void); bool DebugTokens(void);
virtual void Debug(void); virtual void Debug(void);
}; };

View File

@ -191,7 +191,7 @@ bool cXmlParser::ParseView(void) {
} else if (view->ValidViewElement((const char*)node->name)) { } else if (view->ValidViewElement((const char*)node->name)) {
xmlAttrPtr attr = node->properties; xmlAttrPtr attr = node->properties;
vector<pair<string, string> > attribs; vector<pair<string, string> > attribs;
ParseAttributes(attr, node, attribs); ParseAttributes(attr, node, attribs, true);
ParseViewElement(node->name, node->xmlChildrenNode, attribs); ParseViewElement(node->name, node->xmlChildrenNode, attribs);
} else if (view->ValidViewList((const char*)node->name)) { } else if (view->ValidViewList((const char*)node->name)) {
ParseViewList(node); ParseViewList(node);
@ -682,7 +682,7 @@ bool cXmlParser::ParseSubView(xmlNodePtr node) {
if (subView->ValidViewElement((const char*)childNode->name)) { if (subView->ValidViewElement((const char*)childNode->name)) {
xmlAttrPtr attr = childNode->properties; xmlAttrPtr attr = childNode->properties;
vector<pair<string, string> > attribs; vector<pair<string, string> > attribs;
ParseAttributes(attr, childNode, attribs); ParseAttributes(attr, childNode, attribs, true);
ParseViewElement(childNode->name, childNode->xmlChildrenNode, attribs, subView); ParseViewElement(childNode->name, childNode->xmlChildrenNode, attribs, subView);
} else if (subView->ValidViewList((const char*)childNode->name)) { } else if (subView->ValidViewList((const char*)childNode->name)) {
ParseViewList(childNode, subView); ParseViewList(childNode, subView);
@ -954,7 +954,7 @@ void cXmlParser::ParseLoopFunctionCalls(xmlNodePtr node, cTemplateLoopFunction *
} }
} }
bool cXmlParser::ParseAttributes(xmlAttrPtr attr, xmlNodePtr node, vector<pair<string, string> > &attribs) { bool cXmlParser::ParseAttributes(xmlAttrPtr attr, xmlNodePtr node, vector<pair<string, string> > &attribs, bool isViewElement) {
if (attr == NULL) { if (attr == NULL) {
return false; return false;
} }
@ -965,15 +965,16 @@ bool cXmlParser::ParseAttributes(xmlAttrPtr attr, xmlNodePtr node, vector<pair<s
while (NULL != attr) { while (NULL != attr) {
string name = (const char*)attr->name; string name = (const char*)attr->name;
/*
if (!name.compare("debug")) { if (!name.compare("debug")) {
attribs.push_back(pair<string, string>((const char*)attr->name, "true")); attribs.push_back(pair<string, string>((const char*)attr->name, "true"));
attr = attr->next; attr = attr->next;
continue; continue;
} }
*/
xmlChar *value = NULL; xmlChar *value = NULL;
value = xmlGetProp(node, attr->name); value = xmlGetProp(node, attr->name);
if (!view->ValidAttribute((const char*)node->name, (const char*)attr->name)) { if (!view->ValidAttribute(isViewElement ? "viewelement" : (const char*)node->name, (const char*)attr->name)) {
esyslog("skindesigner: unknown attribute %s in %s", (const char*)attr->name, (const char*)node->name); esyslog("skindesigner: unknown attribute %s in %s", (const char*)attr->name, (const char*)node->name);
attr = attr->next; attr = attr->next;
if (value) if (value)

View File

@ -47,7 +47,7 @@ private:
void ParseGrid(xmlNodePtr node, vector<pair<string, string> > &attributes); void ParseGrid(xmlNodePtr node, vector<pair<string, string> > &attributes);
void ParseFunctionCalls(xmlNodePtr node, cTemplatePixmap *pix); void ParseFunctionCalls(xmlNodePtr node, cTemplatePixmap *pix);
void ParseLoopFunctionCalls(xmlNodePtr node, cTemplateLoopFunction *loopFunc); void ParseLoopFunctionCalls(xmlNodePtr node, cTemplateLoopFunction *loopFunc);
bool ParseAttributes(xmlAttrPtr attr, xmlNodePtr node, vector<pair<string, string> > &attribs); bool ParseAttributes(xmlAttrPtr attr, xmlNodePtr node, vector<pair<string, string> > &attribs, bool isViewElement = false);
public: public:
cXmlParser(void); cXmlParser(void);
virtual ~cXmlParser(void); virtual ~cXmlParser(void);

View File

@ -184,8 +184,8 @@
{devices[channelid]} ID of the currently tuned channel {devices[channelid]} ID of the currently tuned channel
{devices[source]} source of the currently tuned channel {devices[source]} source of the currently tuned channel
--> -->
<devices> <devices condition="{showdevices}">
<area condition="{showdevices}" x="56%" y="94%" width="28%" height="6%" layer="2"> <area x="56%" y="94%" width="28%" height="6%" layer="2">
<loop name="devices" x="0" y="0" orientation="horizontal" columnwidth="{areawidth}/{numdevices}" rowheight="{areaheight}"> <loop name="devices" x="0" y="0" orientation="horizontal" columnwidth="{areawidth}/{numdevices}" rowheight="{areaheight}">
<drawtext x="0" y="0" font="{regular}" fontsize="40%" color="{clrWhite}" text="{devices[num]}: {devices[type]}" /> <drawtext x="0" y="0" font="{regular}" fontsize="40%" color="{clrWhite}" text="{devices[num]}: {devices[type]}" />
<drawtext condition="{devices[hascam]}" align="right" y="0" font="{regular}" fontsize="40%" color="{clrWhite}" text="(CAM {devices[cam]})" /> <drawtext condition="{devices[hascam]}" align="right" y="0" font="{regular}" fontsize="40%" color="{clrWhite}" text="(CAM {devices[cam]})" />

View File

@ -32,7 +32,7 @@ bool cDisplayAudiotracksView::createOsd(void) {
} }
void cDisplayAudiotracksView::DrawBackground(void) { void cDisplayAudiotracksView::DrawBackground(void) {
if (!ViewElementImplemented(veBackground)) { if (!ExecuteViewElement(veBackground)) {
return; return;
} }
@ -45,7 +45,7 @@ void cDisplayAudiotracksView::DrawBackground(void) {
} }
void cDisplayAudiotracksView::DrawHeader(const char *title, int audioChannel) { void cDisplayAudiotracksView::DrawHeader(const char *title, int audioChannel) {
if (!ViewElementImplemented(veHeader)) { if (!ExecuteViewElement(veHeader)) {
return; return;
} }

View File

@ -60,7 +60,7 @@ void cDisplayChannelView::ClearChannel(void) {
} }
void cDisplayChannelView::DrawDate(void) { void cDisplayChannelView::DrawDate(void) {
if (!ViewElementImplemented(veDateTime)) { if (!ExecuteViewElement(veDateTime)) {
return; return;
} }
@ -76,7 +76,7 @@ void cDisplayChannelView::DrawDate(void) {
} }
void cDisplayChannelView::DrawTime(void) { void cDisplayChannelView::DrawTime(void) {
if (!ViewElementImplemented(veTime)) { if (!ExecuteViewElement(veTime)) {
return; return;
} }
@ -91,7 +91,7 @@ void cDisplayChannelView::DrawTime(void) {
} }
void cDisplayChannelView::DrawProgressBar(cString &start, cString &stop, int Current, int Total) { void cDisplayChannelView::DrawProgressBar(cString &start, cString &stop, int Current, int Total) {
if (!ViewElementImplemented(veProgressBar)) { if (!ExecuteViewElement(veProgressBar)) {
return; return;
} }
@ -182,7 +182,7 @@ void cDisplayChannelView::ClearEPGInfo(void) {
} }
void cDisplayChannelView::DrawStatusIcons(const cChannel *Channel) { void cDisplayChannelView::DrawStatusIcons(const cChannel *Channel) {
if (!ViewElementImplemented(veStatusInfo)) { if (!ExecuteViewElement(veStatusInfo)) {
return; return;
} }
@ -217,7 +217,7 @@ void cDisplayChannelView::ClearStatusIcons(void) {
} }
void cDisplayChannelView::DrawAudioInfo(void) { void cDisplayChannelView::DrawAudioInfo(void) {
if (!ViewElementImplemented(veAudioInfo)) { if (!ExecuteViewElement(veAudioInfo)) {
return; return;
} }
@ -261,7 +261,7 @@ void cDisplayChannelView::ClearAudioInfo(void) {
} }
void cDisplayChannelView::DrawScreenResolution(void) { void cDisplayChannelView::DrawScreenResolution(void) {
if (!ViewElementImplemented(veScreenResolution)) { if (!ExecuteViewElement(veScreenResolution)) {
return; return;
} }
@ -311,7 +311,7 @@ void cDisplayChannelView::DrawScraperContent(const cEvent *event) {
return; return;
} }
if (!ViewElementImplemented(veScraperContent)) { if (!ExecuteViewElement(veScraperContent)) {
return; return;
} }
@ -390,7 +390,7 @@ void cDisplayChannelView::ClearScraperContent(void) {
} }
void cDisplayChannelView::DrawSignal(void) { void cDisplayChannelView::DrawSignal(void) {
if (!ViewElementImplemented(veSignalQuality)) { if (!ExecuteViewElement(veSignalQuality)) {
return; return;
} }
time_t Now = time(NULL); time_t Now = time(NULL);
@ -426,7 +426,7 @@ void cDisplayChannelView::DrawSignal(void) {
} }
void cDisplayChannelView::DrawSignalBackground(void) { void cDisplayChannelView::DrawSignalBackground(void) {
if (!ViewElementImplemented(veSignalQualityBack)) { if (!ExecuteViewElement(veSignalQualityBack)) {
return; return;
} }
DrawViewElement(veSignalQualityBack); DrawViewElement(veSignalQualityBack);
@ -442,7 +442,7 @@ void cDisplayChannelView::ClearSignalBackground(void) {
} }
void cDisplayChannelView::DrawDevices(bool initial) { void cDisplayChannelView::DrawDevices(bool initial) {
if (!ViewElementImplemented(veDevices)) { if (!ExecuteViewElement(veDevices)) {
return; return;
} }
map < string, string > stringTokens; map < string, string > stringTokens;
@ -465,7 +465,7 @@ void cDisplayChannelView::ClearDevices(void) {
} }
void cDisplayChannelView::DrawChannelGroups(const cChannel *Channel, cString ChannelName) { void cDisplayChannelView::DrawChannelGroups(const cChannel *Channel, cString ChannelName) {
if (!ViewElementImplemented(veChannelGroup)) { if (!ExecuteViewElement(veChannelGroup)) {
return; return;
} }
@ -530,7 +530,7 @@ void cDisplayChannelView::DisplayMessage(eMessageType Type, const char *Text) {
} }
void cDisplayChannelView::DrawCustomTokens(void) { void cDisplayChannelView::DrawCustomTokens(void) {
if (!ViewElementImplemented(veCustomTokens)) { if (!ExecuteViewElement(veCustomTokens)) {
return; return;
} }
if (!tmplView) if (!tmplView)
@ -541,7 +541,7 @@ void cDisplayChannelView::DrawCustomTokens(void) {
} }
void cDisplayChannelView::DrawCurrentWeather(void) { void cDisplayChannelView::DrawCurrentWeather(void) {
if (!ViewElementImplemented(veCurrentWeather)) { if (!ExecuteViewElement(veCurrentWeather)) {
return; return;
} }
map < string, string > stringTokens; map < string, string > stringTokens;

View File

@ -805,7 +805,7 @@ void cDisplayMenuDetailView::DrawScrollbar(void) {
} }
void cDisplayMenuDetailView::DrawTabLabels(void) { void cDisplayMenuDetailView::DrawTabLabels(void) {
if (!ViewElementImplemented(veTabLabels)) { if (!ExecuteViewElement(veTabLabels)) {
return; return;
} }
map < string, string > labelStringTokens; map < string, string > labelStringTokens;

View File

@ -475,7 +475,7 @@ void cDisplayMenuRootView::DrawBackground(void) {
DrawViewElement(veBackground, &stringTokens, &intTokens); DrawViewElement(veBackground, &stringTokens, &intTokens);
} }
void cDisplayMenuRootView::DrawHeader(void) { void cDisplayMenuRootView::DrawHeader(void) {
if (!ViewElementImplemented(veHeader)) { if (!ExecuteViewElement(veHeader)) {
return; return;
} }
@ -514,7 +514,7 @@ void cDisplayMenuRootView::DrawHeader(void) {
} }
void cDisplayMenuRootView::DrawDateTime(void) { void cDisplayMenuRootView::DrawDateTime(void) {
if (!ViewElementImplemented(veDateTime)) { if (!ExecuteViewElement(veDateTime)) {
return; return;
} }
@ -530,7 +530,7 @@ void cDisplayMenuRootView::DrawDateTime(void) {
} }
bool cDisplayMenuRootView::DrawTime(void) { bool cDisplayMenuRootView::DrawTime(void) {
if (!ViewElementImplemented(veTime)) { if (!ExecuteViewElement(veTime)) {
return false; return false;
} }
@ -548,7 +548,7 @@ bool cDisplayMenuRootView::DrawTime(void) {
void cDisplayMenuRootView::DrawColorButtons(void) { void cDisplayMenuRootView::DrawColorButtons(void) {
if (!ViewElementImplemented(veButtons)) { if (!ExecuteViewElement(veButtons)) {
return; return;
} }

View File

@ -24,7 +24,7 @@ cDisplayMenuView::~cDisplayMenuView() {
} }
bool cDisplayMenuView::DrawBackground(void) { bool cDisplayMenuView::DrawBackground(void) {
if (!ViewElementImplemented(veBackground)) { if (!ExecuteViewElement(veBackground)) {
return false; return false;
} }
map < string, string > stringTokens; map < string, string > stringTokens;
@ -35,7 +35,7 @@ bool cDisplayMenuView::DrawBackground(void) {
} }
bool cDisplayMenuView::DrawHeader(void) { bool cDisplayMenuView::DrawHeader(void) {
if (!ViewElementImplemented(veHeader)) { if (!ExecuteViewElement(veHeader)) {
return false; return false;
} }
@ -73,7 +73,7 @@ bool cDisplayMenuView::DrawHeader(void) {
} }
bool cDisplayMenuView::DrawDateTime(void) { bool cDisplayMenuView::DrawDateTime(void) {
if (!ViewElementImplemented(veDateTime)) { if (!ExecuteViewElement(veDateTime)) {
return false; return false;
} }
@ -90,7 +90,7 @@ bool cDisplayMenuView::DrawDateTime(void) {
} }
bool cDisplayMenuView::DrawTime(void) { bool cDisplayMenuView::DrawTime(void) {
if (!ViewElementImplemented(veTime)) { if (!ExecuteViewElement(veTime)) {
return false; return false;
} }
@ -108,7 +108,7 @@ bool cDisplayMenuView::DrawTime(void) {
} }
bool cDisplayMenuView::DrawColorButtons(void) { bool cDisplayMenuView::DrawColorButtons(void) {
if (!ViewElementImplemented(veButtons)) { if (!ExecuteViewElement(veButtons)) {
return false; return false;
} }
map < string, string > stringTokens; map < string, string > stringTokens;
@ -158,7 +158,7 @@ bool cDisplayMenuView::DrawColorButtons(void) {
} }
bool cDisplayMenuView::DrawMessage(eMessageType type, const char *text) { bool cDisplayMenuView::DrawMessage(eMessageType type, const char *text) {
if (!ViewElementImplemented(veMessage)) { if (!ExecuteViewElement(veMessage)) {
return false; return false;
} }
if (!text) { if (!text) {
@ -180,7 +180,7 @@ bool cDisplayMenuView::DrawMessage(eMessageType type, const char *text) {
} }
void cDisplayMenuView::DrawScrollbar(int numMax, int numDisplayed, int offset) { void cDisplayMenuView::DrawScrollbar(int numMax, int numDisplayed, int offset) {
if (!ViewElementImplemented(veScrollbar)) { if (!ExecuteViewElement(veScrollbar)) {
return; return;
} }
map < string, string > stringTokens; map < string, string > stringTokens;
@ -204,7 +204,7 @@ void cDisplayMenuView::DrawScrollbar(int numMax, int numDisplayed, int offset) {
} }
bool cDisplayMenuView::BackgroundImplemented(void) { bool cDisplayMenuView::BackgroundImplemented(void) {
if (!ViewElementImplemented(veBackground)) { if (!ExecuteViewElement(veBackground)) {
return false; return false;
} }
return true; return true;
@ -250,7 +250,7 @@ bool cDisplayMenuMainView::DrawDynamicViewElements(void) {
} }
void cDisplayMenuMainView::DrawTimers(void) { void cDisplayMenuMainView::DrawTimers(void) {
if (!ViewElementImplemented(veTimers)) { if (!ExecuteViewElement(veTimers)) {
return; return;
} }
@ -344,7 +344,7 @@ void cDisplayMenuMainView::DrawTimers(void) {
} }
void cDisplayMenuMainView::DrawDiscUsage(void) { void cDisplayMenuMainView::DrawDiscUsage(void) {
if (!ViewElementImplemented(veDiscUsage)) { if (!ExecuteViewElement(veDiscUsage)) {
return; return;
} }
@ -369,7 +369,7 @@ void cDisplayMenuMainView::DrawDiscUsage(void) {
} }
bool cDisplayMenuMainView::DrawLoad(void) { bool cDisplayMenuMainView::DrawLoad(void) {
if (!ViewElementImplemented(veSystemLoad)) { if (!ExecuteViewElement(veSystemLoad)) {
return false; return false;
} }
@ -416,7 +416,7 @@ bool cDisplayMenuMainView::DrawLoad(void) {
} }
void cDisplayMenuMainView::DrawTemperatures(void) { void cDisplayMenuMainView::DrawTemperatures(void) {
if (!ViewElementImplemented(veTemperatures)) { if (!ExecuteViewElement(veTemperatures)) {
return; return;
} }
cString execCommand = cString::sprintf("cd \"%s/\"; \"%s/temperatures\"", SCRIPTFOLDER, SCRIPTFOLDER); cString execCommand = cString::sprintf("cd \"%s/\"; \"%s/temperatures\"", SCRIPTFOLDER, SCRIPTFOLDER);
@ -464,7 +464,7 @@ void cDisplayMenuMainView::DrawTemperatures(void) {
} }
bool cDisplayMenuMainView::DrawDevices(void) { bool cDisplayMenuMainView::DrawDevices(void) {
if (!ViewElementImplemented(veDevices)) { if (!ExecuteViewElement(veDevices)) {
return false; return false;
} }
@ -485,7 +485,7 @@ bool cDisplayMenuMainView::DrawDevices(void) {
} }
void cDisplayMenuMainView::DrawCurrentSchedule(void) { void cDisplayMenuMainView::DrawCurrentSchedule(void) {
if (!ViewElementImplemented(veCurrentSchedule)) { if (!ExecuteViewElement(veCurrentSchedule)) {
return; return;
} }
@ -582,7 +582,7 @@ void cDisplayMenuMainView::DrawCurrentSchedule(void) {
} }
void cDisplayMenuMainView::DrawCurrentWeather(void) { void cDisplayMenuMainView::DrawCurrentWeather(void) {
if (!ViewElementImplemented(veCurrentWeather)) { if (!ExecuteViewElement(veCurrentWeather)) {
return; return;
} }
map < string, string > stringTokens; map < string, string > stringTokens;
@ -597,7 +597,7 @@ void cDisplayMenuMainView::DrawCurrentWeather(void) {
} }
void cDisplayMenuMainView::DrawCustomTokens(void) { void cDisplayMenuMainView::DrawCustomTokens(void) {
if (!ViewElementImplemented(veCustomTokens)) { if (!ExecuteViewElement(veCustomTokens)) {
return; return;
} }
if (!tmplView) if (!tmplView)
@ -623,7 +623,7 @@ cDisplayMenuSchedulesView::~cDisplayMenuSchedulesView() {
} }
bool cDisplayMenuSchedulesView::DrawHeader(void) { bool cDisplayMenuSchedulesView::DrawHeader(void) {
if (!ViewElementImplemented(veHeader)) { if (!ExecuteViewElement(veHeader)) {
return false; return false;
} }

View File

@ -227,7 +227,7 @@ void cDisplayPluginView::DrawScrollbar(void) {
} }
void cDisplayPluginView::DrawTabLabels(void) { void cDisplayPluginView::DrawTabLabels(void) {
if (!ViewElementImplemented((eViewElement)pveTablabels)) { if (!ExecuteViewElement((eViewElement)pveTablabels)) {
return; return;
} }
map < string, string > labelStringTokens; map < string, string > labelStringTokens;

View File

@ -43,7 +43,7 @@ void cDisplayReplayView::DrawBackground(bool modeOnly) {
} }
void cDisplayReplayView::DrawDate(void) { void cDisplayReplayView::DrawDate(void) {
if (!ViewElementImplemented(veDateTime)) { if (!ExecuteViewElement(veDateTime)) {
return; return;
} }
@ -59,7 +59,7 @@ void cDisplayReplayView::DrawDate(void) {
} }
void cDisplayReplayView::DrawTime(void) { void cDisplayReplayView::DrawTime(void) {
if (!ViewElementImplemented(veTime)) { if (!ExecuteViewElement(veTime)) {
return; return;
} }
@ -137,7 +137,7 @@ void cDisplayReplayView::DrawScraperContent(const cRecording *recording) {
if (!recording) if (!recording)
return; return;
if (!ViewElementImplemented(veScraperContent)) { if (!ExecuteViewElement(veScraperContent)) {
return; return;
} }
@ -399,7 +399,7 @@ void cDisplayReplayView::DelayOnPause(void) {
} }
void cDisplayReplayView::DrawCustomTokens(void) { void cDisplayReplayView::DrawCustomTokens(void) {
if (!ViewElementImplemented(veCustomTokens)) { if (!ExecuteViewElement(veCustomTokens)) {
return; return;
} }
if (!tmplView) if (!tmplView)

View File

@ -205,7 +205,10 @@ void cView::ActivateScrolling(void) {
} }
} }
bool cView::ViewElementImplemented(eViewElement ve) { bool cView::ExecuteViewElement(eViewElement ve) {
bool doExecute = tmplView->ExecuteView(ve);
if (!doExecute)
return false;
return tmplView->GetNumPixmapsViewElement(ve); return tmplView->GetNumPixmapsViewElement(ve);
} }

View File

@ -42,7 +42,7 @@ protected:
void DrawViewElement(eViewElement ve, map <string,string> *stringTokens = NULL, map <string,int> *intTokens = NULL, map < string, vector< map< string, string > > > *loopTokens = NULL); void DrawViewElement(eViewElement ve, map <string,string> *stringTokens = NULL, map <string,int> *intTokens = NULL, map < string, vector< map< string, string > > > *loopTokens = NULL);
void ClearViewElement(eViewElement ve); void ClearViewElement(eViewElement ve);
void DestroyViewElement(eViewElement ve); void DestroyViewElement(eViewElement ve);
bool ViewElementImplemented(eViewElement ve); bool ExecuteViewElement(eViewElement ve);
bool ViewElementScrolls(eViewElement ve); bool ViewElementScrolls(eViewElement ve);
void CreateViewPixmap(int num, cTemplatePixmap *pix, cRect *size = NULL); void CreateViewPixmap(int num, cTemplatePixmap *pix, cRect *size = NULL);
void CreateScrollingPixmap(int num, cTemplatePixmap *pix, cSize &drawportSize); void CreateScrollingPixmap(int num, cTemplatePixmap *pix, cSize &drawportSize);