From dab1fa0942cffa82c1944170774b659b8bcfb6b2 Mon Sep 17 00:00:00 2001 From: Vicent Marti Date: Fri, 8 Aug 2008 18:30:16 +0000 Subject: Resolution-dependence in XML files. G1X scaler GUI now loads. Added layout for the launcher menu. MILESTONE: All core GUI dialogs/widgets working on G2x/G3x MILESTONE: Completely removed old Evaluator/Parser. Improved layout expanding again. Improved XML parser. Several bugfixes. svn-id: r33704 --- common/xmlparser.cpp | 5 +++-- common/xmlparser.h | 24 ++++++++++-------------- 2 files changed, 13 insertions(+), 16 deletions(-) (limited to 'common') diff --git a/common/xmlparser.cpp b/common/xmlparser.cpp index 526e6e6fb1..b845f7f66f 100644 --- a/common/xmlparser.cpp +++ b/common/xmlparser.cpp @@ -110,9 +110,10 @@ bool XMLParser::parseActiveKey(bool closed) { return parserError("Missing required property '%s' inside key '%s'", i->name.c_str(), key->name.c_str()); } - if (key->layout->anyProps == false && localMap.empty() == false) + if (localMap.empty() == false) return parserError("Unhandled property inside key '%s': '%s'", key->name.c_str(), localMap.begin()->_key.c_str()); - } else if (layout->anyKeys == false) { + + } else { return parserError("Unexpected key in the active scope: '%s'.", key->name.c_str()); } diff --git a/common/xmlparser.h b/common/xmlparser.h index 2f73b5905d..e26ea1eb53 100644 --- a/common/xmlparser.h +++ b/common/xmlparser.h @@ -182,12 +182,12 @@ namespace Common { #define XML_KEY(keyName) {\ lay = new XMLKeyLayout; \ - lay->anyProps = false; \ - lay->anyKeys = false; \ lay->custom = new kLocalParserName::CustomParserCallback; \ ((kLocalParserName::CustomParserCallback*)(lay->custom))->callback = (&kLocalParserName::parserCallback_##keyName); \ layout.top()->children[#keyName] = lay; \ - layout.push(lay); + layout.push(lay); \ + for (Common::List::const_iterator p = globalProps.begin(); p != globalProps.end(); ++p){\ + layout.top()->properties.push_back(*p);} #define XML_KEY_RECURSIVE(keyName) {\ layout.top()->children[#keyName] = layout.top();\ @@ -199,13 +199,13 @@ namespace Common { #define XML_PROP(propName, req) {\ prop.name = #propName; \ prop.required = req; \ - layout.top()->properties.push_back(prop); }\ + layout.top()->properties.push_back(prop); } + +#define XML_GLOBAL_PROP(propName, req) {\ + prop.name = #propName; \ + prop.required = req;\ + globalProps.push_back(prop); } -#define XML_PROP_ANY() {\ - layout.top()->anyProps = true; } - -#define XML_KEY_ANY() {\ - layout.top()->anyKeys = true; } #define CUSTOM_XML_PARSER(parserName) \ protected: \ @@ -217,9 +217,8 @@ namespace Common { Common::Stack layout; \ XMLKeyLayout *lay = 0; \ XMLKeyLayout::XMLKeyProperty prop; \ + Common::List globalProps; \ _XMLkeys = new XMLKeyLayout; \ - _XMLkeys->anyProps = false; \ - _XMLkeys->anyKeys = false; \ layout.push(_XMLkeys); #define PARSER_END() layout.clear(); } @@ -310,14 +309,11 @@ public: }; Common::List properties; - bool anyProps; - bool anyKeys; ChildMap children; ~XMLKeyLayout() { properties.clear(); children.clear(); -// delete custom; } } *_XMLkeys; -- cgit v1.2.3