mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-09 13:01:49 +00:00
xml: image element
This commit is contained in:
parent
2de5f5c646
commit
de6a6dd771
11 changed files with 101 additions and 71 deletions
|
|
@ -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();
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue