#pragma once #include "shape.h" #include "util.h" #include "shader.h" #include "font.h" #include "asset.h" #include "rtt.h" #include "bezier.h" #include "canvas.h" #include "event.h" #include #include class LayoutManager { std::map> m_layouts; std::string m_path; struct stat m_file_info { 0 }; public: bool m_loaded = false; std::function on_loaded; bool load(const char* path); bool reload(); class Node* operator[](uint16_t id) { auto i = m_layouts.find(id); return i == m_layouts.end() ? nullptr : i->second.get(); } class Node* get(uint16_t id) { auto i = m_layouts.find(id); return i == m_layouts.end() ? nullptr : i->second.get(); } void restore_context(); void clear_context(); //Node& operator[](const char* ids) { return m_layouts[const_hash(ids)]; } };