diff --git a/HISTORY b/HISTORY index f0895a1..4a86e9a 100644 --- a/HISTORY +++ b/HISTORY @@ -405,3 +405,18 @@ Version 0.6.2 Version 0.6.3 +- implemented horizontal menus + For displaying horizontal menus with VDR <= 2.2.x a VDR + patch is required (see /patches/vdr-2.2.0_horizontal_menu.patch + in the plugin source directory). Without this patch the keys + left/right and up/down are not toggled in horizontal menus. + With VDR >= 2.3.1 this patch is not needed anymore. +- added possibility to add conditions to elements +- added possibility to define a viewelement several times with + different conditions +- added "string" skin setup parameter with multiple options +- added "valign" option in . If the box height is set + and the text does not need the complete height, with valign="center" + the text can be placed horizontally centered inside the box borders. +- implemented optional horizontal main-, recordings- and + weatherforecast menu in metrixhd diff --git a/README b/README index ddbb10b..99e5abd 100644 --- a/README +++ b/README @@ -34,8 +34,13 @@ Requirements - libcurl -- for scaling the video picture to fit into the VDR menu window please use - softhddevice plugin revision 87c1c7be (2013-01-01) or newer. +- softhddevice plugin revision ec58e456 (2015-06-13) or newer. With older + versions shifting does not work properly + +- For displaying horizontal menus with VDR <= 2.2.x a VDR patch is required + (see /patches/vdr-2.2.0_horizontal_menu.patch in the plugin source directory) + Without this patch the keys left/right and up/down are not toggled in + horizontal menus. With VDR >= 2.3.1 this patch is not needed anymore. - epgsearch Git since commit ba7c6277 (2013-01-03) to correctly replace the schedules menu with epgsearch diff --git a/displaymenu.c b/displaymenu.c index ea589cb..2e78793 100644 --- a/displaymenu.c +++ b/displaymenu.c @@ -65,6 +65,12 @@ void cSDDisplayMenu::SetMenuSortMode(eMenuSortMode MenuSortMode) { rootView->SetSortMode(MenuSortMode); } +eMenuOrientation cSDDisplayMenu::MenuOrientation(void) { + if (!doOutput) + return moVertical; + return rootView->MenuOrientation(); +} + void cSDDisplayMenu::SetPluginMenu(string name, int menu, int type, bool init) { pluginName = name; pluginMenu = menu; diff --git a/displaymenu.h b/displaymenu.h index 5b697b4..5aee6d1 100644 --- a/displaymenu.h +++ b/displaymenu.h @@ -4,6 +4,15 @@ #include "libtemplate/template.h" #include "views/displaymenurootview.h" +#if defined(APIVERSNUM) && APIVERSNUM < 20301 +#ifndef MENU_ORIENTATION_DEFINED +enum eMenuOrientation { + moVertical = 0, + moHorizontal +}; +#endif +#endif + enum eViewState { vsInit, vsMenuInit, @@ -32,6 +41,7 @@ public: virtual void Clear(void); virtual void SetMenuCategory(eMenuCategory MenuCat); virtual void SetMenuSortMode(eMenuSortMode MenuSortMode); + virtual eMenuOrientation MenuOrientation(void); virtual void SetPluginMenu(string name, int menu, int type, bool init); virtual void SetTitle(const char *Title); virtual void SetButtons(const char *Red, const char *Green = NULL, const char *Yellow = NULL, const char *Blue = NULL); diff --git a/dtd/displayaudiotracks.dtd b/dtd/displayaudiotracks.dtd index b4b0c59..e4abd21 100644 --- a/dtd/displayaudiotracks.dtd +++ b/dtd/displayaudiotracks.dtd @@ -42,7 +42,7 @@ align (left|top|center|bottom|right) #IMPLIED menuitemwidth CDATA #IMPLIED numlistelements CDATA #REQUIRED - orientation (horizontal|vertical) #REQUIRED + orientation CDATA #REQUIRED > diff --git a/dtd/displaymenu.dtd b/dtd/displaymenu.dtd index 0569d42..ecbc374 100644 --- a/dtd/displaymenu.dtd +++ b/dtd/displaymenu.dtd @@ -418,7 +418,8 @@ menuitemwidth CDATA #IMPLIED determinatefont CDATA #IMPLIED numlistelements CDATA #REQUIRED - orientation (horizontal|vertical) #REQUIRED + orientation CDATA #REQUIRED + condition CDATA #IMPLIED > diff --git a/dtd/displaymenuplugin.dtd b/dtd/displaymenuplugin.dtd index 1f9560f..168d047 100644 --- a/dtd/displaymenuplugin.dtd +++ b/dtd/displaymenuplugin.dtd @@ -18,46 +18,55 @@ @@ -75,6 +84,7 @@ diff --git a/libcore/skinsetup.c b/libcore/skinsetup.c index e52ff41..c9ae7bd 100644 --- a/libcore/skinsetup.c +++ b/libcore/skinsetup.c @@ -1,6 +1,7 @@ #include "skinsetup.h" #include "../config.h" #include "../libtemplate/xmlparser.h" +#include "../libcore/helpers.h" // --- cSkinSetupParameter ----------------------------------------------------------- @@ -10,7 +11,17 @@ cSkinSetupParameter::cSkinSetupParameter(void) { displayText = ""; min = 0; max = 1000; - value = 0; + value = 0; + options = NULL; + optionsTranslated = NULL; + numOptions = 0; +} + +cSkinSetupParameter::~cSkinSetupParameter(void) { + if (numOptions > 0 && options && optionsTranslated) { + delete[] options; + delete[] optionsTranslated; + } } void cSkinSetupParameter::Debug(void) { @@ -19,9 +30,16 @@ void cSkinSetupParameter::Debug(void) { sType = "bool"; else if (type == sptInt) sType = "int"; - dsyslog("skindesigner: name \"%s\", type %s, displayText \"%s\", Value %d", name.c_str(), sType.c_str(), displayText.c_str(), value); + else if (type == sptString) + sType = "string"; + dsyslog("skindesigner: name \"%s\", type %s, displayText \"%s\", Value: %d", name.c_str(), sType.c_str(), displayText.c_str(), value); if (type == sptInt) dsyslog("skindesigner: min %d, max %d", min, max); + if (type == sptString && options) { + for (int i=0; i < numOptions; i++) { + dsyslog("skindesigner: option %d: %s, translated: %s", i+1, options[i], optionsTranslated[i]); + } + } } // --- cSkinSetupMenu ----------------------------------------------------------- @@ -88,7 +106,7 @@ void cSkinSetupMenu::InitIterators(void) { subMenuIt = subMenus.begin(); } -void cSkinSetupMenu::SetParameter(eSetupParameterType paramType, string name, string displayText, string min, string max, string value) { +void cSkinSetupMenu::SetParameter(eSetupParameterType paramType, string name, string displayText, string min, string max, string value, string options) { cSkinSetupParameter *param = new cSkinSetupParameter(); param->type = paramType; param->name = name; @@ -100,8 +118,26 @@ void cSkinSetupMenu::SetParameter(eSetupParameterType paramType, string name, st if (max.size() && paramType == sptInt) { param->max = atoi(max.c_str()); } + param->value = atoi(value.c_str()); + if (paramType == sptString) { + splitstring o(options.c_str()); + vector opts = o.split(',', 1); + int numOpts = opts.size(); + if (numOpts > 0) { + param->numOptions = numOpts; + param->options = new const char*[numOpts]; + int i=0; + for (vector::iterator it = opts.begin(); it != opts.end(); it++) { + string option = trim(*it); + char *s = new char[option.size()]; + strcpy(s, option.c_str()); + param->options[i++] = s; + } + } + } + parameters.push_back(param); } @@ -185,7 +221,7 @@ void cSkinSetup::SubMenuDone(void) { } } -void cSkinSetup::SetParameter(string type, string name, string displayText, string min, string max, string value) { +void cSkinSetup::SetParameter(string type, string name, string displayText, string min, string max, string value, string options) { if (!type.size() || !name.size() || !displayText.size() || !value.size()) { esyslog("skindesigner: invalid setup parameter for skin %s", skin.c_str()); return; @@ -195,12 +231,14 @@ void cSkinSetup::SetParameter(string type, string name, string displayText, stri paramType = sptInt; } else if (!type.compare("bool")) { paramType = sptBool; + } else if (!type.compare("string")) { + paramType = sptString; } if (paramType == sptUnknown) { esyslog("skindesigner: invalid setup parameter for skin %s", skin.c_str()); return; } - currentMenu->SetParameter(paramType, name, displayText, min, max, value); + currentMenu->SetParameter(paramType, name, displayText, min, max, value, options); } cSkinSetupParameter *cSkinSetup::GetNextParameter(void) { @@ -221,7 +259,14 @@ void cSkinSetup::AddToGlobals(cGlobals *globals) { rootMenu->InitIterators(); cSkinSetupParameter *param = NULL; while (param = rootMenu->GetNextParameter()) { - globals->AddInt(param->name, param->value); + if (param->type == sptString) { + string value = param->options[param->value]; + globals->AddString(param->name, value); + string intName = "index" + param->name; + globals->AddInt(intName, param->value); + } else { + globals->AddInt(param->name, param->value); + } } } @@ -233,6 +278,23 @@ void cSkinSetup::TranslateSetup(void) { if (Translate(param->displayText, transl)) { param->displayText = transl; } + if (param->type == sptString && param->numOptions > 0) { + param->optionsTranslated = new const char*[param->numOptions]; + for (int i = 0; i < param->numOptions; i++) { + string option = param->options[i]; + string optionTransToken = "{tr(" + option + ")}"; + string optionTranslated = ""; + if (Translate(optionTransToken, optionTranslated)) { + char *s = new char[optionTranslated.size()]; + strcpy(s, optionTranslated.c_str()); + param->optionsTranslated[i] = s; + } else { + char *s = new char[option.size()]; + strcpy(s, option.c_str()); + param->optionsTranslated[i] = s; + } + } + } } rootMenu->InitIterators(); diff --git a/libcore/skinsetup.h b/libcore/skinsetup.h index 29649ed..a664ebc 100644 --- a/libcore/skinsetup.h +++ b/libcore/skinsetup.h @@ -15,6 +15,7 @@ using namespace std; enum eSetupParameterType { sptInt, sptBool, + sptString, sptUnknown }; @@ -24,13 +25,16 @@ class cSkinSetupParameter { private: public: cSkinSetupParameter(void); - virtual ~cSkinSetupParameter(void) {}; + virtual ~cSkinSetupParameter(void); eSetupParameterType type; string name; string displayText; int min; int max; - int value; + int value; + const char* *options; + const char* *optionsTranslated; + int numOptions; void Debug(void); }; @@ -55,7 +59,7 @@ public: void SetParent(cSkinSetupMenu *p) { parent = p; }; cSkinSetupMenu *GetParent(void) { return parent; }; void AddSubMenu(cSkinSetupMenu *sub) { subMenus.push_back(sub); }; - void SetParameter(eSetupParameterType paramType, string name, string displayText, string min, string max, string value); + void SetParameter(eSetupParameterType paramType, string name, string displayText, string min, string max, string value, string options); void InitIterators(void); void InitParameterIterator(void) { paramIt = parameters.begin(); }; cSkinSetupParameter *GetNextParameter(bool deep = true); @@ -82,7 +86,7 @@ public: bool ReadFromXML(void); void SetSubMenu(string name, string displayText); void SubMenuDone(void); - void SetParameter(string type, string name, string displayText, string min, string max, string value); + void SetParameter(string type, string name, string displayText, string min, string max, string value, string options); void InitParameterIterator(void) { rootMenu->InitIterators(); }; cSkinSetupParameter *GetNextParameter(void); cSkinSetupParameter *GetParameter(string name); diff --git a/libtemplate/globals.c b/libtemplate/globals.c index 822b993..3fd0705 100644 --- a/libtemplate/globals.c +++ b/libtemplate/globals.c @@ -149,6 +149,15 @@ void cGlobals::ReplaceStringVars(string &value) { } +bool cGlobals::GetString(string &name, string &value) { + map::iterator hit = stringVars.find(name); + if (hit == stringVars.end()) + return false; + value = hit->second; + return true; +} + + bool cGlobals::AddTranslation(string name, map < string, string > transl) { translations.erase(name); translations.insert(pair >(name, transl)); diff --git a/libtemplate/globals.h b/libtemplate/globals.h index d566fac..12ee917 100644 --- a/libtemplate/globals.h +++ b/libtemplate/globals.h @@ -47,6 +47,7 @@ public: void ReplaceDoubleVars(string &value); void AddString(string &name, string &value); void ReplaceStringVars(string &value); + bool GetString(string &name, string &value); bool AddTranslation(string name, map < string, string > transl); bool Translate(string text, string &translation); void AddCustomInt(string &name, int value); diff --git a/libtemplate/parameter.c b/libtemplate/parameter.c index 21e02e1..d76cb35 100644 --- a/libtemplate/parameter.c +++ b/libtemplate/parameter.c @@ -291,6 +291,14 @@ void cConditionalParameter::Evaluate(map < string, int > *intTokens, map < strin tokenTrue = true; } } + if (!tokenTrue) { + string value = ""; + if (globals->GetString(cond->tokenName, value)) { + if (!value.compare(cond->strCompareValue)) { + tokenTrue = true; + } + } + } } else if (cond->type == ctStringNotEquals) { if (stringTokens) { map < string, string >::iterator hit = stringTokens->find(cond->tokenName); @@ -313,6 +321,14 @@ void cConditionalParameter::Evaluate(map < string, int > *intTokens, map < strin tokenTrue = true; } } + if (!tokenTrue) { + string value = ""; + if (globals->GetString(cond->tokenName, value)) { + if (value.find(cond->strCompareValue) != string::npos) { + tokenTrue = true; + } + } + } } else if (cond->type == ctStringNotContains) { if (stringTokens) { map < string, string >::iterator hit = stringTokens->find(cond->tokenName); @@ -472,6 +488,6 @@ string cConditionalParameter::StripWhitespaces(string value) { void cConditionalParameter::Debug(void) { dsyslog("skindesigner: Condition %s, Type: %s, cond is %s", value.c_str(), (type == cpAnd)?"and combination":((type == cpOr)?"or combination":"single param") , isTrue?"true":"false"); for (vector::iterator it = conditions.begin(); it != conditions.end(); it++) { - dsyslog("skindesigner: cond token %s, type: %d, compareValue %d, negated: %d", it->tokenName.c_str(), it->type, it->compareValue, it->isNegated); + dsyslog("skindesigner: cond token %s, type: %d, compareValue %d, negated: %d, strCompareValue %s", it->tokenName.c_str(), it->type, it->compareValue, it->isNegated, it->strCompareValue.c_str()); } } \ No newline at end of file diff --git a/libtemplate/templateview.c b/libtemplate/templateview.c index fcedee8..78d6fdf 100644 --- a/libtemplate/templateview.c +++ b/libtemplate/templateview.c @@ -14,11 +14,11 @@ cTemplateView::cTemplateView(void) { } cTemplateView::~cTemplateView() { - for (map < eViewElement, cTemplateViewElement* >::iterator it = viewElements.begin(); it != viewElements.end(); it++) { + for (multimap < eViewElement, cTemplateViewElement* >::iterator it = viewElements.begin(); it != viewElements.end(); it++) { delete it->second; } - for (map < eViewList, cTemplateViewList* >::iterator it = viewLists.begin(); it != viewLists.end(); it++) { + for (multimap < eViewList, cTemplateViewList* >::iterator it = viewLists.begin(); it != viewLists.end(); it++) { delete it->second; } @@ -64,11 +64,15 @@ void cTemplateView::SetContainer(int x, int y, int width, int height) { } cTemplateViewElement *cTemplateView::GetViewElement(eViewElement ve) { - map < eViewElement, cTemplateViewElement* >::iterator hit = viewElements.find(ve); - if (hit == viewElements.end()) { - return NULL; + pair::iterator, multimap< eViewElement, cTemplateViewElement* >::iterator> rangeViewElements; + rangeViewElements = viewElements.equal_range(ve); + for (multimap::iterator it = rangeViewElements.first; it!=rangeViewElements.second; ++it) { + cTemplateViewElement *viewElement = it->second; + if (viewElement->Execute()) { + return viewElement; + } } - return hit->second; + return NULL; } void cTemplateView::InitViewElementIterator(void) { @@ -104,10 +108,21 @@ cTemplateViewGrid *cTemplateView::GetNextViewGrid(void) { } cTemplateViewList *cTemplateView::GetViewList(eViewList vl) { - map < eViewList, cTemplateViewList* >::iterator hit = viewLists.find(vl); - if (hit == viewLists.end()) - return NULL; - return hit->second; + if (viewLists.size() == 1) { + multimap < eViewList, cTemplateViewList* >::iterator hit = viewLists.find(vl); + if (hit == viewLists.end()) + return NULL; + return hit->second; + } + pair::iterator, multimap< eViewList, cTemplateViewList* >::iterator> rangeViewLists; + rangeViewLists = viewLists.equal_range(vl); + for (multimap::iterator it = rangeViewLists.first; it!=rangeViewLists.second; ++it) { + cTemplateViewList *viewList = it->second; + if (viewList->Execute()) { + return viewList; + } + } + return NULL; } void cTemplateView::InitViewListIterator(void) { @@ -190,7 +205,7 @@ cRect cTemplateView::GetOsdSize(void) { int cTemplateView::GetNumPixmaps(void) { int numPixmaps = 0; - for (map < eViewElement, cTemplateViewElement* >::iterator it = viewElements.begin(); it != viewElements.end(); it++) { + for (multimap < eViewElement, cTemplateViewElement* >::iterator it = viewElements.begin(); it != viewElements.end(); it++) { cTemplateViewElement *viewElement = it->second; numPixmaps += viewElement->GetNumPixmaps(); } @@ -198,10 +213,9 @@ int cTemplateView::GetNumPixmaps(void) { } int cTemplateView::GetNumPixmapsViewElement(eViewElement ve) { - map < eViewElement, cTemplateViewElement* >::iterator hit = viewElements.find(ve); - if (hit == viewElements.end()) + cTemplateViewElement *viewElement = GetViewElement(ve); + if (!viewElement) return 0; - cTemplateViewElement *viewElement = hit->second; return viewElement->GetNumPixmaps(); } @@ -248,15 +262,14 @@ tColor cTemplateView::DebugGridFontColor(void) { } bool cTemplateView::ExecuteView(eViewElement ve) { - map < eViewElement, cTemplateViewElement* >::iterator hit = viewElements.find(ve); - if (hit == viewElements.end()) + cTemplateViewElement *viewElement = GetViewElement(ve); + if (!viewElement) return false; - cTemplateViewElement *viewElement = hit->second; - return viewElement->Execute(); + return true; } bool cTemplateView::DetachViewElement(eViewElement ve) { - map < eViewElement, cTemplateViewElement* >::iterator hit = viewElements.find(ve); + multimap < eViewElement, cTemplateViewElement* >::iterator hit = viewElements.find(ve); if (hit == viewElements.end()) return false; cTemplateViewElement *viewElement = hit->second; @@ -264,10 +277,9 @@ bool cTemplateView::DetachViewElement(eViewElement ve) { } string cTemplateView::GetViewElementMode(eViewElement ve) { - map < eViewElement, cTemplateViewElement* >::iterator hit = viewElements.find(ve); - if (hit == viewElements.end()) + cTemplateViewElement *viewElement = GetViewElement(ve); + if (!viewElement) return ""; - cTemplateViewElement *viewElement = hit->second; return viewElement->GetMode(); } @@ -563,9 +575,8 @@ void cTemplateView::PreCache(bool isSubview) { int osdWidth = parameters->GetNumericParameter(ptWidth); int osdHeight = parameters->GetNumericParameter(ptHeight); int pixOffset = 0; - //Cache ViewElements - for (map < eViewElement, cTemplateViewElement* >::iterator it = viewElements.begin(); it != viewElements.end(); it++) { + for (multimap < eViewElement, cTemplateViewElement* >::iterator it = viewElements.begin(); it != viewElements.end(); it++) { cTemplateViewElement *viewElement = it->second; viewElement->SetGlobals(globals); if (!isSubview) @@ -588,7 +599,7 @@ void cTemplateView::PreCache(bool isSubview) { } //Cache ViewLists - for (map < eViewList, cTemplateViewList* >::iterator it = viewLists.begin(); it != viewLists.end(); it++) { + for (multimap < eViewList, cTemplateViewList* >::iterator it = viewLists.begin(); it != viewLists.end(); it++) { cTemplateViewList *viewList = it->second; viewList->SetGlobals(globals); //viewlists in subviews need complete container information @@ -632,13 +643,13 @@ void cTemplateView::Debug(void) { parameters->Debug(); - for (map < eViewElement, cTemplateViewElement* >::iterator it = viewElements.begin(); it != viewElements.end(); it++) { + for (multimap < eViewElement, cTemplateViewElement* >::iterator it = viewElements.begin(); it != viewElements.end(); it++) { esyslog("skindesigner: ++++++++ ViewElement: %s", GetViewElementName(it->first).c_str()); cTemplateViewElement *viewElement = it->second; viewElement->Debug(); } - for (map < eViewList, cTemplateViewList* >::iterator it = viewLists.begin(); it != viewLists.end(); it++) { + for (multimap < eViewList, cTemplateViewList* >::iterator it = viewLists.begin(); it != viewLists.end(); it++) { esyslog("skindesigner: ++++++++ ViewList: %s", GetViewListName(it->first).c_str()); cTemplateViewList *viewList = it->second; viewList->Debug(); @@ -787,6 +798,7 @@ void cTemplateView::SetFunctionDefinitions(void) { attributes.insert("width"); attributes.insert("height"); attributes.insert("align"); + attributes.insert("valign"); attributes.insert("maxlines"); attributes.insert("font"); attributes.insert("fontsize"); @@ -1008,7 +1020,7 @@ string cTemplateViewChannel::GetViewElementName(eViewElement ve) { return name; } -void cTemplateViewChannel::AddPixmap(string sViewElement, cTemplatePixmapNode *pix, vector &viewElementattributes) { +void cTemplateViewChannel::AddViewElement(string sViewElement, cTemplateViewElement *viewElement) { eViewElement ve = veUndefined; if (!sViewElement.compare("background")) { @@ -1055,17 +1067,7 @@ void cTemplateViewChannel::AddPixmap(string sViewElement, cTemplatePixmapNode *p return; } - pix->SetGlobals(globals); - - map < eViewElement, cTemplateViewElement* >::iterator hit = viewElements.find(ve); - if (hit == viewElements.end()) { - cTemplateViewElement *viewElement = new cTemplateViewElement(); - viewElement->SetParameters(viewElementattributes); - viewElement->AddPixmap(pix); - viewElements.insert(pair< eViewElement, cTemplateViewElement*>(ve, viewElement)); - } else { - (hit->second)->AddPixmap(pix); - } + viewElements.insert(pair< eViewElement, cTemplateViewElement*>(ve, viewElement)); } /************************************************************************************ @@ -1246,6 +1248,7 @@ cTemplateViewMenu::cTemplateViewMenu(void) { attributes.insert("menuitemwidth"); attributes.insert("determinatefont"); attributes.insert("numlistelements"); + attributes.insert("condition"); funcsAllowed.insert(pair< string, set >("menuitems", attributes)); //definition of allowed parameters for currentitems viewlist @@ -1516,7 +1519,7 @@ void cTemplateViewMenu::AddPluginView(string plugName, int templNo, cTemplateVie } } -void cTemplateViewMenu::AddPixmap(string sViewElement, cTemplatePixmapNode *pix, vector > &viewElementattributes) { +void cTemplateViewMenu::AddViewElement(string sViewElement, cTemplateViewElement *viewElement) { eViewElement ve = veUndefined; if (!sViewElement.compare("background")) { @@ -1568,20 +1571,7 @@ void cTemplateViewMenu::AddPixmap(string sViewElement, cTemplatePixmapNode *pix, return; } - pix->SetGlobals(globals); - - map < eViewElement, cTemplateViewElement* >::iterator hit = viewElements.find(ve); - if (hit == viewElements.end()) { - cTemplateViewElement *viewElement = new cTemplateViewElement(); - viewElement->SetParameters(viewElementattributes); - if (viewElement->DebugTokens()) { - dsyslog("skindesigner: activating token debugging for view element %s", sViewElement.c_str()); - } - viewElement->AddPixmap(pix); - viewElements.insert(pair< eViewElement, cTemplateViewElement*>(ve, viewElement)); - } else { - (hit->second)->AddPixmap(pix); - } + viewElements.insert(pair< eViewElement, cTemplateViewElement*>(ve, viewElement)); } void cTemplateViewMenu::AddViewList(string sViewList, cTemplateViewList *viewList) { @@ -1657,7 +1647,7 @@ string cTemplateViewMessage::GetViewElementName(eViewElement ve) { return name; } -void cTemplateViewMessage::AddPixmap(string sViewElement, cTemplatePixmapNode *pix, vector > &viewElementattributes) { +void cTemplateViewMessage::AddViewElement(string sViewElement, cTemplateViewElement *viewElement) { eViewElement ve = veUndefined; if (!sViewElement.compare("background")) { @@ -1671,17 +1661,7 @@ void cTemplateViewMessage::AddPixmap(string sViewElement, cTemplatePixmapNode *p return; } - pix->SetGlobals(globals); - - map < eViewElement, cTemplateViewElement* >::iterator hit = viewElements.find(ve); - if (hit == viewElements.end()) { - cTemplateViewElement *viewElement = new cTemplateViewElement(); - viewElement->SetParameters(viewElementattributes); - viewElement->AddPixmap(pix); - viewElements.insert(pair< eViewElement, cTemplateViewElement*>(ve, viewElement)); - } else { - (hit->second)->AddPixmap(pix); - } + viewElements.insert(pair< eViewElement, cTemplateViewElement*>(ve, viewElement)); } /************************************************************************************ @@ -1814,7 +1794,7 @@ string cTemplateViewReplay::GetViewElementName(eViewElement ve) { return name; } -void cTemplateViewReplay::AddPixmap(string sViewElement, cTemplatePixmapNode *pix, vector > &viewElementattributes) { +void cTemplateViewReplay::AddViewElement(string sViewElement, cTemplateViewElement *viewElement) { eViewElement ve = veUndefined; if (!sViewElement.compare("background")) { @@ -1864,17 +1844,7 @@ void cTemplateViewReplay::AddPixmap(string sViewElement, cTemplatePixmapNode *pi return; } - pix->SetGlobals(globals); - - map < eViewElement, cTemplateViewElement* >::iterator hit = viewElements.find(ve); - if (hit == viewElements.end()) { - cTemplateViewElement *viewElement = new cTemplateViewElement(); - viewElement->SetParameters(viewElementattributes); - viewElement->AddPixmap(pix); - viewElements.insert(pair< eViewElement, cTemplateViewElement*>(ve, viewElement)); - } else { - (hit->second)->AddPixmap(pix); - } + viewElements.insert(pair< eViewElement, cTemplateViewElement*>(ve, viewElement)); } @@ -1931,7 +1901,7 @@ string cTemplateViewVolume::GetViewElementName(eViewElement ve) { return name; } -void cTemplateViewVolume::AddPixmap(string sViewElement, cTemplatePixmapNode *pix, vector > &viewElementattributes) { +void cTemplateViewVolume::AddViewElement(string sViewElement, cTemplateViewElement *viewElement) { eViewElement ve = veUndefined; if (!sViewElement.compare("background")) { @@ -1945,17 +1915,7 @@ void cTemplateViewVolume::AddPixmap(string sViewElement, cTemplatePixmapNode *pi return; } - pix->SetGlobals(globals); - - map < eViewElement, cTemplateViewElement* >::iterator hit = viewElements.find(ve); - if (hit == viewElements.end()) { - cTemplateViewElement *viewElement = new cTemplateViewElement(); - viewElement->SetParameters(viewElementattributes); - viewElement->AddPixmap(pix); - viewElements.insert(pair< eViewElement, cTemplateViewElement*>(ve, viewElement)); - } else { - (hit->second)->AddPixmap(pix); - } + viewElements.insert(pair< eViewElement, cTemplateViewElement*>(ve, viewElement)); } /************************************************************************************ @@ -2041,7 +2001,7 @@ string cTemplateViewAudioTracks::GetViewListName(eViewList vl) { return name; } -void cTemplateViewAudioTracks::AddPixmap(string sViewElement, cTemplatePixmapNode *pix, vector > &viewElementattributes) { +void cTemplateViewAudioTracks::AddViewElement(string sViewElement, cTemplateViewElement *viewElement) { eViewElement ve = veUndefined; if (!sViewElement.compare("background")) { @@ -2055,17 +2015,7 @@ void cTemplateViewAudioTracks::AddPixmap(string sViewElement, cTemplatePixmapNod return; } - pix->SetGlobals(globals); - - map < eViewElement, cTemplateViewElement* >::iterator hit = viewElements.find(ve); - if (hit == viewElements.end()) { - cTemplateViewElement *viewElement = new cTemplateViewElement(); - viewElement->SetParameters(viewElementattributes); - viewElement->AddPixmap(pix); - viewElements.insert(pair< eViewElement, cTemplateViewElement*>(ve, viewElement)); - } else { - (hit->second)->AddPixmap(pix); - } + viewElements.insert(pair< eViewElement, cTemplateViewElement*>(ve, viewElement)); } void cTemplateViewAudioTracks::AddViewList(string sViewList, cTemplateViewList *viewList) { @@ -2148,18 +2098,12 @@ void cTemplateViewPlugin::AddSubView(string sSubView, cTemplateView *subView) { subViews.insert(pair< eSubView, cTemplateView* >((eSubView)subViewId, subView)); } -void cTemplateViewPlugin::AddPixmap(string sViewElement, cTemplatePixmapNode *pix, vector > &viewElementattributes) { +void cTemplateViewPlugin::AddViewElement(string sViewElement, cTemplateViewElement *viewElement) { eViewElement ve = veUndefined; string viewElementName = ""; int viewElementID = -1; - bool found = false; - for (vector >::iterator it = viewElementattributes.begin(); it != viewElementattributes.end(); it++) { - if (!(it->first).compare("name")) { - viewElementName = it->second; - found = true; - break; - } - } + + bool found = viewElement->GetName(viewElementName); if (found) { viewElementID = config.GetPluginViewElementID(pluginName, viewElementName, viewID); @@ -2178,30 +2122,14 @@ void cTemplateViewPlugin::AddPixmap(string sViewElement, cTemplatePixmapNode *pi viewElementID = pve; } - pix->SetGlobals(globals); - ve = (eViewElement)viewElementID; - map < eViewElement, cTemplateViewElement* >::iterator hit = viewElements.find(ve); - if (hit == viewElements.end()) { - cTemplateViewElement *viewElement = new cTemplateViewElement(); - viewElement->SetParameters(viewElementattributes); - viewElement->AddPixmap(pix); - viewElements.insert(pair< eViewElement, cTemplateViewElement*>(ve, viewElement)); - } else { - (hit->second)->AddPixmap(pix); - } + viewElements.insert(pair< eViewElement, cTemplateViewElement*>(ve, viewElement)); } -void cTemplateViewPlugin::AddPixmapGrid(cTemplatePixmapNode *pix, vector > &gridAttributes) { +void cTemplateViewPlugin::AddGrid(cTemplateViewGrid *viewGrid) { string gridName = ""; - bool found = false; - for (vector >::iterator it = gridAttributes.begin(); it != gridAttributes.end(); it++) { - if (!(it->first).compare("name")) { - gridName = it->second; - found = true; - break; - } - } + bool found = viewGrid->GetName(gridName); + if (!found) { esyslog("skindesigner: no name defined for plugin %s grid", pluginName.c_str()); } @@ -2212,17 +2140,7 @@ void cTemplateViewPlugin::AddPixmapGrid(cTemplatePixmapNode *pix, vectorSetGlobals(globals); - - map < int, cTemplateViewGrid* >::iterator hit = viewGrids.find(gridID); - if (hit == viewGrids.end()) { - cTemplateViewGrid *viewGrid = new cTemplateViewGrid(); - viewGrid->SetParameters(gridAttributes); - viewGrid->AddPixmap(pix); - viewGrids.insert(pair< int, cTemplateViewGrid*>(gridID, viewGrid)); - } else { - (hit->second)->AddPixmap(pix); - } + viewGrids.insert(pair< int, cTemplateViewGrid*>(gridID, viewGrid)); } void cTemplateViewPlugin::AddViewTab(cTemplateViewTab *viewTab) { diff --git a/libtemplate/templateview.h b/libtemplate/templateview.h index 726ce68..1713cdc 100644 --- a/libtemplate/templateview.h +++ b/libtemplate/templateview.h @@ -49,8 +49,8 @@ protected: int containerWidth; int containerHeight; //basic view data structures - map < eViewElement, cTemplateViewElement* > viewElements; - map < eViewList, cTemplateViewList* > viewLists; + multimap < eViewElement, cTemplateViewElement* > viewElements; + multimap < eViewList, cTemplateViewList* > viewLists; map < int, cTemplateViewGrid* > viewGrids; map < eSubView, cTemplateView* > subViews; vector< cTemplateViewTab* > viewTabs; @@ -76,8 +76,8 @@ public: virtual string GetViewListName(eViewList vl) { return ""; }; virtual void AddSubView(string sSubView, cTemplateView *subView) {}; virtual void AddPluginView(string plugName, int templNo, cTemplateView *plugView) {}; - virtual void AddPixmap(string sViewElement, cTemplatePixmapNode *pix, vector &viewElementattributes) {}; - virtual void AddPixmapGrid(cTemplatePixmapNode *pix, vector > &gridAttributes) {}; + virtual void AddViewElement(string sViewElement, cTemplateViewElement *viewElement) {}; + virtual void AddGrid(cTemplateViewGrid *viewGrid) {}; virtual void AddViewList(string sViewList, cTemplateViewList *viewList) {}; virtual void AddViewTab(cTemplateViewTab *viewTab) {}; //Setter Functions @@ -151,7 +151,7 @@ public: cTemplateViewChannel(void); virtual ~cTemplateViewChannel(void); string GetViewElementName(eViewElement ve); - void AddPixmap(string viewElement, cTemplatePixmapNode *pix, vector &viewElementattributes); + void AddViewElement(string sViewElement, cTemplateViewElement *viewElement); }; // --- cTemplateViewMenu ------------------------------------------------------------- @@ -169,7 +169,7 @@ public: string GetViewListName(eViewList vl); void AddSubView(string sSubView, cTemplateView *subView); void AddPluginView(string plugName, int templNo, cTemplateView *plugView); - void AddPixmap(string viewElement, cTemplatePixmapNode *pix, vector > &viewElementattributes); + void AddViewElement(string sViewElement, cTemplateViewElement *viewElement); void AddViewList(string sViewList, cTemplateViewList *viewList); void AddViewTab(cTemplateViewTab *viewTab); }; @@ -183,7 +183,7 @@ public: cTemplateViewMessage(void); virtual ~cTemplateViewMessage(void); string GetViewElementName(eViewElement ve); - void AddPixmap(string viewElement, cTemplatePixmapNode *pix, vector > &viewElementattributes); + void AddViewElement(string sViewElement, cTemplateViewElement *viewElement); }; // --- cTemplateViewReplay ------------------------------------------------------------- @@ -195,7 +195,7 @@ public: cTemplateViewReplay(void); virtual ~cTemplateViewReplay(void); string GetViewElementName(eViewElement ve); - void AddPixmap(string viewElement, cTemplatePixmapNode *pix, vector > &viewElementattributes); + void AddViewElement(string sViewElement, cTemplateViewElement *viewElement); }; // --- cTemplateViewVolume ------------------------------------------------------------- @@ -207,7 +207,7 @@ public: cTemplateViewVolume(void); virtual ~cTemplateViewVolume(void); string GetViewElementName(eViewElement ve); - void AddPixmap(string viewElement, cTemplatePixmapNode *pix, vector > &viewElementattributes); + void AddViewElement(string sViewElement, cTemplateViewElement *viewElement); }; // --- cTemplateViewAudioTracks ------------------------------------------------------------- @@ -221,7 +221,7 @@ public: virtual ~cTemplateViewAudioTracks(void); string GetViewElementName(eViewElement ve); string GetViewListName(eViewList vl); - void AddPixmap(string viewElement, cTemplatePixmapNode *pix, vector > &viewElementattributes); + void AddViewElement(string sViewElement, cTemplateViewElement *viewElement); void AddViewList(string sViewList, cTemplateViewList *viewList); }; @@ -235,8 +235,8 @@ public: cTemplateViewPlugin(string pluginName, int viewID); virtual ~cTemplateViewPlugin(void); void AddSubView(string sSubView, cTemplateView *subView); - void AddPixmap(string viewElement, cTemplatePixmapNode *pix, vector > &viewElementattributes); - void AddPixmapGrid(cTemplatePixmapNode *pix, vector > &gridAttributes); + void AddViewElement(string sViewElement, cTemplateViewElement *viewElement); + void AddGrid(cTemplateViewGrid *viewGrid); void AddViewTab(cTemplateViewTab *viewTab); }; diff --git a/libtemplate/templateviewelement.c b/libtemplate/templateviewelement.c index 0171bdb..56672b8 100644 --- a/libtemplate/templateviewelement.c +++ b/libtemplate/templateviewelement.c @@ -97,6 +97,15 @@ int cTemplateViewElement::GetNumPixmaps(void) { return numPixmaps; }; +bool cTemplateViewElement::GetName(string &name) { + if (!parameters) + return false; + name = parameters->GetParameter(ptName); + if (name.size() > 0) + return true; + return false; +} + void cTemplateViewElement::InitPixmapNodeIterator(void) { pixmapNodeIterator = viewPixmapNodes.begin(); } diff --git a/libtemplate/templateviewelement.h b/libtemplate/templateviewelement.h index 32f2ecc..189e9e5 100644 --- a/libtemplate/templateviewelement.h +++ b/libtemplate/templateviewelement.h @@ -111,6 +111,7 @@ public: void SetPixOffset(int offset) { pixOffset = offset; }; int GetPixOffset(void) { return pixOffset; }; virtual int GetNumPixmaps(void); + bool GetName(string &name); void InitPixmapNodeIterator(void); cTemplatePixmapNode *GetNextPixmapNode(void); void InitPixmapIterator(void); diff --git a/libtemplate/templateviewlist.c b/libtemplate/templateviewlist.c index 1d5dabe..a831d2d 100644 --- a/libtemplate/templateviewlist.c +++ b/libtemplate/templateviewlist.c @@ -25,9 +25,7 @@ void cTemplateViewList::SetGlobals(cGlobals *globals) { bool cTemplateViewList::CalculateListParameters(void) { if (!parameters) return false; - parameters->SetContainer(containerX, containerY, containerWidth, containerHeight); - parameters->SetGlobals(globals); - bool paramsValid = parameters->CalculateParameters(); + bool paramsValid = false; if (!listElement) return false; listElement->SetContainer(parameters->GetNumericParameter(ptX), @@ -67,6 +65,13 @@ bool cTemplateViewList::CalculateListParameters(map < string, int > *intTokens) return paramsValid; } +eOrientation cTemplateViewList::GetOrientation(void) { + if (!parameters) + return orNone; + int orientation = parameters->GetNumericParameter(ptOrientation); + return (eOrientation)orientation; +} + int cTemplateViewList::GetAverageFontWidth(void) { int defaultAverageFontWidth = 20; diff --git a/libtemplate/templateviewlist.h b/libtemplate/templateviewlist.h index 5806745..4cc4ccb 100644 --- a/libtemplate/templateviewlist.h +++ b/libtemplate/templateviewlist.h @@ -36,6 +36,7 @@ public: bool CalculateListParameters(map < string, int > *intTokens); cTemplateViewElement *GetListElement(void) { return listElement; }; cTemplateViewElement *GetListElementCurrent(void) { return currentElement; }; + eOrientation GetOrientation(void); int GetAverageFontWidth(void); cFont *GetTextAreaFont(void); int GetMenuItemWidth(void); diff --git a/libtemplate/xmlparser.c b/libtemplate/xmlparser.c index ce41918..ba5684e 100644 --- a/libtemplate/xmlparser.c +++ b/libtemplate/xmlparser.c @@ -199,12 +199,16 @@ void cXmlParser::ParseViewElement(cTemplateView *subView) { if (!view) return; - const char *viewElement = NodeName(); + const char *viewElementName = NodeName(); vector attributes = ParseAttributes(); ValidateAttributes("viewelement", attributes); if (!LevelDown()) return; + + cTemplateViewElement *viewElement = new cTemplateViewElement(); + viewElement->SetParameters(attributes); + do { if (!CheckNodeName("areacontainer") && !CheckNodeName("area") && !CheckNodeName("areascroll")) { esyslog("skindesigner: invalid tag \"%s\" in viewelement", NodeName()); @@ -216,12 +220,15 @@ void cXmlParser::ParseViewElement(cTemplateView *subView) { } else { pix = ParseAreaContainer(); } - if (subView) - subView->AddPixmap(viewElement, pix, attributes); - else - view->AddPixmap(viewElement, pix, attributes); + pix->SetGlobals(globals); + viewElement->AddPixmap(pix); } while (NextNode()); LevelUp(); + + if (subView) + subView->AddViewElement(viewElementName, viewElement); + else + view->AddViewElement(viewElementName, viewElement); } void cXmlParser::ParseViewList(cTemplateView *subView) { @@ -323,6 +330,10 @@ void cXmlParser::ParseGrid(void) { if (!LevelDown()) return; + + cTemplateViewGrid *viewGrid = new cTemplateViewGrid(); + viewGrid->SetParameters(attributes); + do { if (!CheckNodeName("areacontainer") && !CheckNodeName("area") && !CheckNodeName("areascroll")) { @@ -335,9 +346,12 @@ void cXmlParser::ParseGrid(void) { } else { pix = ParseAreaContainer(); } - view->AddPixmapGrid(pix, attributes); + pix->SetGlobals(globals); + viewGrid->AddPixmap(pix); } while (NextNode()); LevelUp(); + + view->AddGrid(viewGrid); } cTemplatePixmap *cXmlParser::ParseArea(void) { @@ -579,15 +593,17 @@ void cXmlParser::ParseSetupParameter(void) { string attributeMax = "max"; string paramMax = ""; string paramValue = ""; + string attributeOptions = "options"; + string paramOptions=""; GetAttribute(attributeType, paramType); GetAttribute(attributeName, paramName); GetAttribute(attributeDisplayText, paramDisplayText); GetAttribute(attributeMin, paramMin); - GetAttribute(attributeMax, paramMax); + GetAttribute(attributeOptions, paramOptions); GetNodeValue(paramValue); - skinSetup->SetParameter(paramType, paramName, paramDisplayText, paramMin, paramMax, paramValue); + skinSetup->SetParameter(paramType, paramName, paramDisplayText, paramMin, paramMax, paramValue, paramOptions); } void cXmlParser::ValidateAttributes(const char *nodeName, vector &attributes) { diff --git a/patches/vdr-2.2.0_horizontal_menu.patch b/patches/vdr-2.2.0_horizontal_menu.patch new file mode 100644 index 0000000..a7fae81 --- /dev/null +++ b/patches/vdr-2.2.0_horizontal_menu.patch @@ -0,0 +1,79 @@ +Common subdirectories: vdr-2.2.0/PLUGINS and /usr/local/src/vdr-2.2.0/PLUGINS +Common subdirectories: vdr-2.2.0/libsi and /usr/local/src/vdr-2.2.0/libsi +diff -upN '--exclude=Make.config' vdr-2.2.0/osdbase.c /usr/local/src/vdr-2.2.0/osdbase.c +--- vdr-2.2.0/osdbase.c 2015-01-15 11:11:11.000000000 +0100 ++++ /usr/local/src/vdr-2.2.0/osdbase.c 2015-08-06 17:27:18.778646643 +0200 +@@ -87,6 +87,7 @@ cOsdMenu::cOsdMenu(const char *Title, in + title = NULL; + menuCategory = mcUnknown; + menuSortMode = msmUnknown; ++ menuOrientation = moVertical; + SetTitle(Title); + SetCols(c0, c1, c2, c3, c4); + first = 0; +@@ -231,6 +232,7 @@ void cOsdMenu::Display(void) + if (menuCategory != displayMenu->MenuCategory()) + displayMenu->SetMenuCategory(menuCategory); + displayMenu->SetMenuSortMode(menuSortMode); ++ menuOrientation = displayMenu->MenuOrientation(); + displayMenuItems = displayMenu->MaxItems(); + displayMenu->SetTabs(cols[0], cols[1], cols[2], cols[3], cols[4]);//XXX + displayMenu->SetTitle(title); +@@ -541,13 +543,13 @@ eOSState cOsdMenu::ProcessKey(eKeys Key) + case k0: return osUnknown; + case k1...k9: return hasHotkeys ? HotKey(Key) : osUnknown; + case kUp|k_Repeat: +- case kUp: CursorUp(); break; ++ case kUp: if (menuOrientation == moHorizontal) PageUp(); else CursorUp(); break; + case kDown|k_Repeat: +- case kDown: CursorDown(); break; ++ case kDown: if (menuOrientation == moHorizontal) PageDown(); else CursorDown(); break; + case kLeft|k_Repeat: +- case kLeft: PageUp(); break; ++ case kLeft: if (menuOrientation == moHorizontal) CursorUp(); else PageUp(); break; + case kRight|k_Repeat: +- case kRight: PageDown(); break; ++ case kRight: if (menuOrientation == moHorizontal) CursorDown(); else PageDown(); break; + case kBack: return osBack; + case kOk: if (marked >= 0) { + SetStatus(NULL); +diff -upN '--exclude=Make.config' vdr-2.2.0/osdbase.h /usr/local/src/vdr-2.2.0/osdbase.h +--- vdr-2.2.0/osdbase.h 2015-01-15 11:09:18.000000000 +0100 ++++ /usr/local/src/vdr-2.2.0/osdbase.h 2015-07-31 15:23:29.232867174 +0200 +@@ -93,6 +93,7 @@ private: + int first, current, marked; + eMenuCategory menuCategory; + eMenuSortMode menuSortMode; ++ eMenuOrientation menuOrientation; + cOsdMenu *subMenu; + const char *helpRed, *helpGreen, *helpYellow, *helpBlue; + bool helpDisplayed; +Common subdirectories: vdr-2.2.0/po and /usr/local/src/vdr-2.2.0/po +diff -upN '--exclude=Make.config' vdr-2.2.0/skins.h /usr/local/src/vdr-2.2.0/skins.h +--- vdr-2.2.0/skins.h 2015-01-15 11:45:47.000000000 +0100 ++++ /usr/local/src/vdr-2.2.0/skins.h 2015-08-06 17:33:41.500188153 +0200 +@@ -129,6 +129,12 @@ enum eMenuSortMode { + msmProvider + }; + ++#define MENU_ORIENTATION_DEFINED 1 ++enum eMenuOrientation { ++ moVertical = 0, ++ moHorizontal ++ }; ++ + class cSkinDisplayMenu : public cSkinDisplay { + ///< This class implements the general purpose menu display, which is + ///< used throughout the program to display information and let the +@@ -179,6 +185,10 @@ public: + ///< Sets the mode by which the items in this menu are sorted. + ///< This is purely informative and may be used by a skin to display the + ///< current sort mode by means of some text or symbol. ++ virtual eMenuOrientation MenuOrientation(void) { return moVertical; } ++ ///< Asks the skin for the orientation of the displayed menu ++ ///< If menu orientation is set to horizontal, the keys left / right ++ ///< and up / down are just toggled + virtual void Scroll(bool Up, bool Page); + ///< If this menu contains a text area that can be scrolled, this function + ///< will be called to actually scroll the text. Up indicates whether the +Common subdirectories: vdr-2.2.0/symbols and /usr/local/src/vdr-2.2.0/symbols diff --git a/setup.c b/setup.c index e2abab4..f8fae07 100644 --- a/setup.c +++ b/setup.c @@ -471,6 +471,8 @@ void cSkindesignerSkinSetup::Set(void) { Add(new cMenuEditIntItem(param->displayText.c_str(), ¶m->value, param->min, param->max)); } else if (param->type == sptBool) { Add(new cMenuEditBoolItem(param->displayText.c_str(), ¶m->value)); + } else if (param->type == sptString) { + Add(new cMenuEditStraItem(param->displayText.c_str(), ¶m->value, param->numOptions, param->optionsTranslated)); } } diff --git a/skins/metrixhd/setup.xml b/skins/metrixhd/setup.xml index 4ed34b8..ad1d246 100644 --- a/skins/metrixhd/setup.xml +++ b/skins/metrixhd/setup.xml @@ -8,6 +8,9 @@ 0 0 0 + 1 + 1 + 1 @@ -33,5 +36,25 @@ DVB Karten Info beim Umschalten anzeigen Näytä DVB-tiedot kanavanvaihdossa + + Orientation of main menu + Ausrichtung des Hauptmenüs + + + Orientation of recordings menu + Ausrichtung des Aufzeichnugsmenüs + + + Orientation of weatherforecast menu + Ausrichtung des Wettermenüs + + + horizontal menu + horizontales Menü + + + vertical menu + vertikales Menü + diff --git a/skins/metrixhd/xmlfiles/displayaudiotracks.xml b/skins/metrixhd/xmlfiles/displayaudiotracks.xml index 8c5af98..def251b 100644 --- a/skins/metrixhd/xmlfiles/displayaudiotracks.xml +++ b/skins/metrixhd/xmlfiles/displayaudiotracks.xml @@ -2,19 +2,12 @@ - - - +
@@ -22,15 +15,8 @@
- - + - diff --git a/skins/metrixhd/xmlfiles/displaychannel.xml b/skins/metrixhd/xmlfiles/displaychannel.xml index 13b9c07..9817b9d 100644 --- a/skins/metrixhd/xmlfiles/displaychannel.xml +++ b/skins/metrixhd/xmlfiles/displaychannel.xml @@ -13,13 +13,6 @@ - @@ -30,27 +23,7 @@ - + @@ -64,15 +37,6 @@ - @@ -85,15 +49,6 @@ - @@ -111,23 +66,9 @@ - - @@ -141,15 +82,6 @@ - @@ -162,37 +94,15 @@ - - - @@ -211,26 +121,6 @@ - @@ -248,22 +138,6 @@ - @@ -273,17 +147,6 @@ - @@ -297,13 +160,7 @@ - + @@ -315,11 +172,7 @@ - + diff --git a/skins/metrixhd/xmlfiles/displaymenu.xml b/skins/metrixhd/xmlfiles/displaymenu.xml index 1389bef..53b70fb 100644 --- a/skins/metrixhd/xmlfiles/displaymenu.xml +++ b/skins/metrixhd/xmlfiles/displaymenu.xml @@ -13,11 +13,7 @@ ]> - + @@ -28,18 +24,7 @@ - +
@@ -47,17 +32,7 @@
- + @@ -67,13 +42,7 @@ - + @@ -85,12 +54,6 @@ - @@ -99,28 +62,7 @@ - + diff --git a/skins/metrixhd/xmlfiles/displaymenuchannels.xml b/skins/metrixhd/xmlfiles/displaymenuchannels.xml index 3e6f771..5b3a184 100644 --- a/skins/metrixhd/xmlfiles/displaymenuchannels.xml +++ b/skins/metrixhd/xmlfiles/displaymenuchannels.xml @@ -1,25 +1,5 @@ - @@ -37,51 +17,6 @@ - - @@ -108,10 +43,6 @@ - @@ -119,4 +50,4 @@ - \ No newline at end of file + diff --git a/skins/metrixhd/xmlfiles/displaymenudefault.xml b/skins/metrixhd/xmlfiles/displaymenudefault.xml index d3f56c1..de4b49a 100644 --- a/skins/metrixhd/xmlfiles/displaymenudefault.xml +++ b/skins/metrixhd/xmlfiles/displaymenudefault.xml @@ -5,12 +5,7 @@ - +
@@ -18,16 +13,7 @@
- + @@ -38,28 +24,6 @@ - @@ -110,47 +74,8 @@ - + - diff --git a/skins/metrixhd/xmlfiles/displaymenudetailepg.xml b/skins/metrixhd/xmlfiles/displaymenudetailepg.xml index 39bd991..0f5c224 100644 --- a/skins/metrixhd/xmlfiles/displaymenudetailepg.xml +++ b/skins/metrixhd/xmlfiles/displaymenudetailepg.xml @@ -21,28 +21,7 @@ - + @@ -85,38 +64,7 @@ - + @@ -129,10 +77,7 @@ - + @@ -140,137 +85,6 @@ - - - @@ -331,11 +145,6 @@ - @@ -346,4 +155,4 @@ - \ No newline at end of file + diff --git a/skins/metrixhd/xmlfiles/displaymenudetailrecording.xml b/skins/metrixhd/xmlfiles/displaymenudetailrecording.xml index 47f096d..dfcd5ac 100644 --- a/skins/metrixhd/xmlfiles/displaymenudetailrecording.xml +++ b/skins/metrixhd/xmlfiles/displaymenudetailrecording.xml @@ -21,28 +21,7 @@ - + @@ -85,34 +64,7 @@ - + @@ -124,10 +76,7 @@ - + @@ -135,132 +84,7 @@ - - - @@ -308,11 +132,6 @@ - diff --git a/skins/metrixhd/xmlfiles/displaymenudetailtext.xml b/skins/metrixhd/xmlfiles/displaymenudetailtext.xml index 5fd8997..59cda9b 100644 --- a/skins/metrixhd/xmlfiles/displaymenudetailtext.xml +++ b/skins/metrixhd/xmlfiles/displaymenudetailtext.xml @@ -18,28 +18,7 @@ - + @@ -90,10 +69,7 @@ - - \ No newline at end of file + diff --git a/skins/metrixhd/xmlfiles/displaymenumain.xml b/skins/metrixhd/xmlfiles/displaymenumain.xml index 775b435..7bd8e33 100644 --- a/skins/metrixhd/xmlfiles/displaymenumain.xml +++ b/skins/metrixhd/xmlfiles/displaymenumain.xml @@ -1,7 +1,4 @@ - @@ -13,26 +10,13 @@ - +
- + @@ -43,28 +27,6 @@ - @@ -107,20 +69,7 @@ - @@ -167,14 +116,6 @@ - @@ -187,26 +128,6 @@ - @@ -224,23 +145,6 @@ - @@ -259,9 +163,6 @@ - @@ -271,23 +172,10 @@ - - - + @@ -297,12 +185,6 @@ - - @@ -312,8 +194,30 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/skins/metrixhd/xmlfiles/displaymenurecordings.xml b/skins/metrixhd/xmlfiles/displaymenurecordings.xml index 6e8f527..9cef713 100644 --- a/skins/metrixhd/xmlfiles/displaymenurecordings.xml +++ b/skins/metrixhd/xmlfiles/displaymenurecordings.xml @@ -1,39 +1,49 @@ - - + + + + + + + + + + + + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + @@ -55,33 +65,6 @@ - - @@ -96,15 +79,104 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -
\ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/skins/metrixhd/xmlfiles/displaymenuschedules.xml b/skins/metrixhd/xmlfiles/displaymenuschedules.xml index d1f0428..b32ea99 100644 --- a/skins/metrixhd/xmlfiles/displaymenuschedules.xml +++ b/skins/metrixhd/xmlfiles/displaymenuschedules.xml @@ -1,18 +1,4 @@ -
@@ -23,36 +9,6 @@
- @@ -132,42 +88,6 @@ - - @@ -211,10 +131,7 @@ - + @@ -222,4 +139,4 @@ -
\ No newline at end of file + diff --git a/skins/metrixhd/xmlfiles/displaymenusetup.xml b/skins/metrixhd/xmlfiles/displaymenusetup.xml index d2fc400..4e2ae0f 100644 --- a/skins/metrixhd/xmlfiles/displaymenusetup.xml +++ b/skins/metrixhd/xmlfiles/displaymenusetup.xml @@ -1,7 +1,4 @@ - @@ -10,27 +7,14 @@ - +
- + @@ -41,12 +25,6 @@ - @@ -67,14 +45,6 @@ - @@ -84,12 +54,6 @@ - - diff --git a/skins/metrixhd/xmlfiles/displaymenutimers.xml b/skins/metrixhd/xmlfiles/displaymenutimers.xml index 5eb453f..b9be696 100644 --- a/skins/metrixhd/xmlfiles/displaymenutimers.xml +++ b/skins/metrixhd/xmlfiles/displaymenutimers.xml @@ -1,28 +1,5 @@ - @@ -38,34 +15,6 @@ - - @@ -83,10 +32,7 @@ - + @@ -94,4 +40,4 @@ - \ No newline at end of file + diff --git a/skins/metrixhd/xmlfiles/displaymessage.xml b/skins/metrixhd/xmlfiles/displaymessage.xml index 3a398bf..1ab2bd5 100644 --- a/skins/metrixhd/xmlfiles/displaymessage.xml +++ b/skins/metrixhd/xmlfiles/displaymessage.xml @@ -8,13 +8,6 @@ - diff --git a/skins/metrixhd/xmlfiles/displayreplay.xml b/skins/metrixhd/xmlfiles/displayreplay.xml index 6993f9a..d2fa71b 100644 --- a/skins/metrixhd/xmlfiles/displayreplay.xml +++ b/skins/metrixhd/xmlfiles/displayreplay.xml @@ -21,17 +21,6 @@ - @@ -42,22 +31,6 @@ - @@ -67,12 +40,6 @@ - @@ -80,14 +47,6 @@ - @@ -101,20 +60,12 @@ - - @@ -122,20 +73,12 @@ - - + @@ -148,16 +91,6 @@ - @@ -197,18 +130,6 @@ - @@ -253,9 +174,6 @@ - @@ -265,114 +183,6 @@ - @@ -390,13 +200,6 @@ - diff --git a/skins/metrixhd/xmlfiles/displayvolume.xml b/skins/metrixhd/xmlfiles/displayvolume.xml index f33f653..db78bde 100644 --- a/skins/metrixhd/xmlfiles/displayvolume.xml +++ b/skins/metrixhd/xmlfiles/displayvolume.xml @@ -8,12 +8,6 @@ - diff --git a/skins/metrixhd/xmlfiles/plug-setup-skinpreview.xml b/skins/metrixhd/xmlfiles/plug-setup-skinpreview.xml index 32115e3..8642626 100644 --- a/skins/metrixhd/xmlfiles/plug-setup-skinpreview.xml +++ b/skins/metrixhd/xmlfiles/plug-setup-skinpreview.xml @@ -70,22 +70,7 @@
- + diff --git a/skins/metrixhd/xmlfiles/plug-tvguideng-detail.xml b/skins/metrixhd/xmlfiles/plug-tvguideng-detail.xml index ef8403d..e6ab374 100644 --- a/skins/metrixhd/xmlfiles/plug-tvguideng-detail.xml +++ b/skins/metrixhd/xmlfiles/plug-tvguideng-detail.xml @@ -15,10 +15,6 @@ - @@ -27,28 +23,6 @@ - @@ -92,50 +66,10 @@ - - @@ -149,140 +83,6 @@ - - - - - @@ -343,14 +143,6 @@ - diff --git a/skins/metrixhd/xmlfiles/plug-tvguideng-recmenu.xml b/skins/metrixhd/xmlfiles/plug-tvguideng-recmenu.xml index d2f3174..058f1f5 100644 --- a/skins/metrixhd/xmlfiles/plug-tvguideng-recmenu.xml +++ b/skins/metrixhd/xmlfiles/plug-tvguideng-recmenu.xml @@ -2,11 +2,6 @@ - @@ -16,13 +11,6 @@ - @@ -34,21 +22,10 @@ - - @@ -64,20 +41,9 @@ - - - @@ -92,42 +58,21 @@ - - - - @@ -138,32 +83,14 @@ - - - @@ -171,13 +98,6 @@ - @@ -223,27 +143,12 @@ - - @@ -257,25 +162,6 @@ - @@ -300,20 +186,6 @@ - @@ -325,31 +197,10 @@ - - @@ -361,22 +212,6 @@ - @@ -438,11 +273,6 @@ - @@ -453,10 +283,6 @@ - diff --git a/skins/metrixhd/xmlfiles/plug-tvguideng-root.xml b/skins/metrixhd/xmlfiles/plug-tvguideng-root.xml index 3a909f2..442c921 100644 --- a/skins/metrixhd/xmlfiles/plug-tvguideng-root.xml +++ b/skins/metrixhd/xmlfiles/plug-tvguideng-root.xml @@ -27,32 +27,6 @@ - @@ -95,28 +69,6 @@ - @@ -202,21 +154,7 @@ - + @@ -237,10 +175,6 @@ - @@ -254,9 +188,6 @@ - @@ -269,9 +200,6 @@ - @@ -294,12 +222,6 @@ - @@ -314,10 +236,6 @@ - @@ -338,16 +256,6 @@ - @@ -381,9 +289,6 @@ - diff --git a/skins/metrixhd/xmlfiles/plug-weatherforecast-weatherforecast.xml b/skins/metrixhd/xmlfiles/plug-weatherforecast-weatherforecast.xml index e4f4960..08b85ab 100644 --- a/skins/metrixhd/xmlfiles/plug-weatherforecast-weatherforecast.xml +++ b/skins/metrixhd/xmlfiles/plug-weatherforecast-weatherforecast.xml @@ -2,22 +2,26 @@ - - + - - + + + + + + + + + + + +
@@ -38,82 +42,7 @@ - - + @@ -124,8 +53,6 @@ - - @@ -161,4 +88,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/skins/metrixhd/xmlfiles/plug-weatherforecast-weatherforecastdetailcurrent.xml b/skins/metrixhd/xmlfiles/plug-weatherforecast-weatherforecastdetailcurrent.xml index 4932759..365abf7 100644 --- a/skins/metrixhd/xmlfiles/plug-weatherforecast-weatherforecastdetailcurrent.xml +++ b/skins/metrixhd/xmlfiles/plug-weatherforecast-weatherforecastdetailcurrent.xml @@ -26,37 +26,14 @@ - + - + diff --git a/skins/metrixhd/xmlfiles/plug-weatherforecast-weatherforecastdetaildaily.xml b/skins/metrixhd/xmlfiles/plug-weatherforecast-weatherforecastdetaildaily.xml index 10b588c..802fa90 100644 --- a/skins/metrixhd/xmlfiles/plug-weatherforecast-weatherforecastdetaildaily.xml +++ b/skins/metrixhd/xmlfiles/plug-weatherforecast-weatherforecastdetaildaily.xml @@ -26,7 +26,7 @@ - + @@ -34,34 +34,6 @@ - - diff --git a/skins/metrixhd/xmlfiles/plug-weatherforecast-weatherforecastdetailhourly.xml b/skins/metrixhd/xmlfiles/plug-weatherforecast-weatherforecastdetailhourly.xml index c21c62a..86670fa 100644 --- a/skins/metrixhd/xmlfiles/plug-weatherforecast-weatherforecastdetailhourly.xml +++ b/skins/metrixhd/xmlfiles/plug-weatherforecast-weatherforecastdetailhourly.xml @@ -34,32 +34,6 @@ - diff --git a/views/displaymenulistview.c b/views/displaymenulistview.c index 29927b2..b96bdc2 100644 --- a/views/displaymenulistview.c +++ b/views/displaymenulistview.c @@ -81,6 +81,15 @@ int cDisplayMenuListView::GetListWidth(void) { return 1920; } +eMenuOrientation cDisplayMenuListView::MenuOrientation(void) { + if (!tmplList) { + return moVertical; + } + eOrientation orientation = tmplList->GetOrientation(); + if (orientation == orHorizontal) + return moHorizontal; + return moVertical; +} void cDisplayMenuListView::Clear(void) { for (int i=0; iSetSortMode(sortMode); } +eMenuOrientation cDisplayMenuRootView::MenuOrientation(void) { + if (!listView) { + return moVertical; + } + return listView->MenuOrientation(); +} + void cDisplayMenuRootView::CorrectDefaultMenu(void) { if (viewType > svMenuDefault && viewType != svMenuPlugin) { SetMenu(mcUnknown, true); diff --git a/views/displaymenurootview.h b/views/displaymenurootview.h index cec7708..294b6ee 100644 --- a/views/displaymenurootview.h +++ b/views/displaymenurootview.h @@ -55,6 +55,7 @@ public: void SetMenu(eMenuCategory menuCat, bool menuInit); void SetSelectedPluginMainMenu(string name) { selectedPluginMainMenu = name; }; void SetSortMode(eMenuSortMode sortMode); + eMenuOrientation MenuOrientation(void); void SetCurrentRecording(string rec) { currentRecording = rec; }; void CorrectDefaultMenu(void); void SetPluginMenu(string name, int menu, int type); diff --git a/views/displaymenuview.c b/views/displaymenuview.c index 9f732e2..53ab558 100644 --- a/views/displaymenuview.c +++ b/views/displaymenuview.c @@ -221,6 +221,8 @@ void cDisplayMenuView::DrawScrollbar(int numMax, int numDisplayed, int offset) { intTokens.insert(pair("height", barHeight)); intTokens.insert(pair("offset", barOffset)); + intTokens.insert(pair("hasprev", (offset == 0) ? 0 : 1)); + intTokens.insert(pair("hasnext", (offset + numMax == numDisplayed) ? 0 : 1)); ClearViewElement(veScrollbar); DrawViewElement(veScrollbar, &stringTokens, &intTokens); diff --git a/views/view.c b/views/view.c index ad1635c..c2cfea9 100644 --- a/views/view.c +++ b/views/view.c @@ -284,7 +284,6 @@ void cView::DestroyDetachedViewElement(eViewElement ve) { detachedViewElements.erase(hit); } - void cView::ClearAnimations(int cat) { //stop and delete all animated elements from this viewelement if (animations.size() == 0) @@ -746,6 +745,7 @@ void cView::DoDrawTextBox(int num, cTemplateFunction *func, int x0, int y0) { string fontName = func->GetFontName(); int fontSize = func->GetNumericParameter(ptFontSize); int align = func->GetNumericParameter(ptAlign); + int valign = func->GetNumericParameter(ptValign); int maxLines = func->GetNumericParameter(ptMaxLines); tColor clr = func->GetColorParameter(ptColor); tColor clrBack = clrTransparent; @@ -759,6 +759,14 @@ void cView::DoDrawTextBox(int num, cTemplateFunction *func, int x0, int y0) { int fontHeight = fontManager->Height(fontName, fontSize); int lines = wrapper.Lines(); int yLine = y; + + if (height > 0 && valign == alCenter) { + int totalHeight = lines * fontHeight; + if (totalHeight < height) { + yLine += (height - totalHeight) / 2; + } + } + for (int line=0; line < lines; line++) { int xLine = x; if (align == alCenter) { @@ -771,15 +779,16 @@ void cView::DoDrawTextBox(int num, cTemplateFunction *func, int x0, int y0) { cPoint pos(xLine, yLine); if (maxLines > 0 && line == maxLines-1) { string lastLine = wrapper.GetLine(line); - if (lines > maxLines) { + if (lines > maxLines) { lastLine += "..."; } - DrawText(num, pos, lastLine.c_str(), clr, clrBack, fontName, fontSize); + DrawText(num, pos, lastLine.c_str(), clr, clrBack, fontName, fontSize); break; - } else if (height > 0 && yLine - y + 2*fontHeight > height) { + } else if (line != (lines-1) && height > 0 && yLine - y + 2*fontHeight > height) { DrawText(num, pos, "...", clr, clrBack, fontName, fontSize); break; } + esyslog("skindesigner: drawing regular line yLine %d", yLine); DrawText(num, pos, wrapper.GetLine(line), clr, clrBack, fontName, fontSize); yLine += fontHeight; }