xml: image element

This commit is contained in:
MihailRis
2024-02-12 22:54:09 +03:00
parent 2de5f5c646
commit de6a6dd771
11 changed files with 101 additions and 71 deletions
+11 -3
View File
@@ -2,6 +2,7 @@
#define FRONTEND_GUI_GUI_XML_H_
#include <memory>
#include <unordered_set>
#include <unordered_map>
#include "GUI.h"
@@ -11,6 +12,8 @@ namespace scripting {
class Environment;
}
class AssetsLoader;
namespace gui {
class UiXmlReader;
@@ -18,13 +21,17 @@ namespace gui {
class UiXmlReader {
std::unordered_map<std::string, uinode_reader> readers;
std::unordered_set<std::string> ignored;
std::string filename;
const scripting::Environment& env;
AssetsLoader& assetsLoader;
public:
UiXmlReader(const scripting::Environment& env);
UiXmlReader(const scripting::Environment& env, AssetsLoader& assetsLoader);
void add(const std::string& tag, uinode_reader reader);
bool hasReader(const std::string& tag) const;
void addIgnore(const std::string& tag);
std::shared_ptr<UINode> readUINode(xml::xmlelement element);
@@ -37,8 +44,7 @@ namespace gui {
void readUINode(
UiXmlReader& reader,
xml::xmlelement element,
Container& container,
bool ignoreUnknown=false
Container& container
);
std::shared_ptr<UINode> readXML(
@@ -53,6 +59,8 @@ namespace gui {
const scripting::Environment& getEnvironment() const;
const std::string& getFilename() const;
AssetsLoader& getAssetsLoader();
};
}