| 97 | } |
| 98 | |
| 99 | void CodeGenerator::printWidgetDeclaration(WidgetContainer* _container, std::ofstream& _stream) |
| 100 | { |
| 101 | if (!_container->getName().empty() && _container->getName() != "_Main") |
| 102 | { |
| 103 | MyGUI::LanguageManager& lm = MyGUI::LanguageManager::getInstance(); |
| 104 | lm.addUserTag("Widget_Name", _container->getName()); |
| 105 | lm.addUserTag("Widget_Type", _container->getType()); |
| 106 | for (auto& templateString : mTemplateStrings) |
| 107 | { |
| 108 | lm.addUserTag(templateString.first, lm.replaceTags(templateString.second)); |
| 109 | } |
| 110 | std::string declaration = lm.getTag("Widget_Declaration"); |
| 111 | while (declaration.find("\\n") != std::string::npos) |
| 112 | declaration.replace(declaration.find("\\n"), 2, "\n"); |
| 113 | _stream << declaration; |
| 114 | } |
| 115 | |
| 116 | for (const auto& childContainer : _container->childContainers) |
| 117 | { |
| 118 | printWidgetDeclaration(childContainer, _stream); |
| 119 | } |
| 120 | } |
| 121 | |
| 122 | void CodeGenerator::notifyGeneratePressed(MyGUI::Widget* _sender) |
| 123 | { |
nothing calls this directly
no test coverage detected