2 #include "YACSGuiLoader.hxx"
7 #include "YacsTrace.hxx"
10 using namespace YACS::HMI;
11 using namespace YACS::ENGINE;
13 static presentationtype_parser presentation_parser;
15 YACSGuiLoader::YACSGuiLoader()
18 presentation_parser.collector_ = this;
19 _defaultParsersMap.insert(make_pair("presentation", &presentation_parser));
24 YACSGuiLoader::~YACSGuiLoader()
28 YACS::ENGINE::Proc* YACSGuiLoader::load(const char *filename)
31 YACS::YACSLoader::load(filename);
34 std::map<YACS::ENGINE::Node*, PrsData> YACSGuiLoader::getPrsData(YACS::ENGINE::Proc* proc)
38 if (_defaultParsersMap.empty()) return _prsMap;
40 for (map<string, PrsData>::iterator it = _inputMap.begin(); it != _inputMap.end(); ++it)
43 string name = (*it).first;
45 if (name != "__ROOT__")
46 node = proc->getChildByName(name);
50 _prsMap[node] = (*it).second;
55 void YACSGuiLoader::process(std::string theElement, bool theNewLink)
57 if(theElement == "presentation")
59 if ( _defaultParsersMap["presentation"] )
61 presentationtype_parser* aP = (presentationtype_parser*)_defaultParsersMap["presentation"];
62 _inputMap[aP->name_] = PrsData(aP->x_, aP->y_, aP->width_, aP->height_);
63 DEBTRACE(aP->name_ << " " << aP->x_ << " " << aP->y_ << " " << aP->width_ << " " << aP->height_);