diff options
author | louis <louis.braun@gmx.de> | 2015-02-12 18:50:58 +0100 |
---|---|---|
committer | louis <louis.braun@gmx.de> | 2015-02-12 18:50:58 +0100 |
commit | 4d7700aecedf475038d57e10f45ab2dd4bcf806f (patch) | |
tree | 2fefc56fe77c8f4137187515a5f2b57d78425fea /libtemplate/xmlparser.c | |
parent | 00ac852820a09f676157a7b487acf51f4fe95ff4 (diff) | |
download | vdr-plugin-skindesigner-4d7700aecedf475038d57e10f45ab2dd4bcf806f.tar.gz vdr-plugin-skindesigner-4d7700aecedf475038d57e10f45ab2dd4bcf806f.tar.bz2 |
plugin interface
Diffstat (limited to 'libtemplate/xmlparser.c')
-rw-r--r-- | libtemplate/xmlparser.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/libtemplate/xmlparser.c b/libtemplate/xmlparser.c index 0162780..e086ba4 100644 --- a/libtemplate/xmlparser.c +++ b/libtemplate/xmlparser.c @@ -195,6 +195,11 @@ bool cXmlParser::ParseView(void) { ParseViewElement(node->name, node->xmlChildrenNode, attribs); } else if (view->ValidViewList((const char*)node->name)) { ParseViewList(node); + } else if (view->ValidViewGrid((const char*)node->name)) { + xmlAttrPtr attr = node->properties; + vector<pair<string, string> > attribs; + ParseAttributes(attr, node, attribs); + ParseGrid(node->xmlChildrenNode, attribs); } else { return false; } @@ -844,6 +849,42 @@ void cXmlParser::ParseViewTab(xmlNodePtr parentNode, cTemplateView *subView) { subView->AddViewTab(viewTab); } +void cXmlParser::ParseGrid(xmlNodePtr node, vector<pair<string, string> > &attributes) { + if (!node) + return; + + if (!view) + return; + + while (node != NULL) { + + if (node->type != XML_ELEMENT_NODE) { + node = node->next; + continue; + } + + if (xmlStrcmp(node->name, (const xmlChar *) "area") && xmlStrcmp(node->name, (const xmlChar *) "areascroll")) { + esyslog("skindesigner: invalid tag \"%s\"", node->name); + node = node->next; + continue; + } + + xmlAttrPtr attr = node->properties; + vector<pair<string, string> > attribs; + ParseAttributes(attr, node, attribs); + + cTemplatePixmap *pix = new cTemplatePixmap(); + if (!xmlStrcmp(node->name, (const xmlChar *) "areascroll")) { + pix->SetScrolling(); + } + pix->SetParameters(attribs); + ParseFunctionCalls(node->xmlChildrenNode, pix); + view->AddPixmapGrid(pix, attributes); + + node = node->next; + } +} + void cXmlParser::ParseFunctionCalls(xmlNodePtr node, cTemplatePixmap *pix) { if (!node) return; |