1#ifndef YAZE_APP_GUI_ZEML_H
2#define YAZE_APP_GUI_ZEML_H
4#include "imgui/imgui.h"
97 ImVec2
size = ImVec2(0, 0);
99 std::shared_ptr<void>
flags =
nullptr;
119std::vector<Token>
Tokenize(
const std::string& input);
139 if (found !=
nullptr) {
150void Bind(Node* node, std::function<
void()> callback);
160void BindSelectable(Node* node,
bool* selected, std::function<
void()> callback);
171 std::map<std::string, Node>& definitions);
180 const std::vector<Token>& tokens,
size_t& index,
const WidgetType& type,
181 const std::map<std::string, void*>& data_bindings = {});
186Node
ParseNode(
const std::vector<Token>& tokens,
size_t& index,
187 const std::map<std::string, void*>& data_bindings = {},
188 const std::map<std::string, Node>& definitions = {});
193Node
Parse(
const std::string& yazon_input,
194 const std::map<std::string, void*>& data_bindings = {});
206std::string
LoadFile(
const std::string& filename);
WidgetAttributes ParseAttributes(const std::vector< Token > &tokens, size_t &index, const WidgetType &type, const std::map< std::string, void * > &data_bindings)
ParseNode attributes for a widget.
Node Parse(const std::string &yazon_input, const std::map< std::string, void * > &data_bindings)
Parse a zeml string.
void BindAction(Node *node, ActionType type, std::function< void()> callback)
Bind an action to a node.
void ExecuteActions(const std::vector< Action > &actions, ActionType type)
Execute actions for a node.
void ParseDefinitions(const std::vector< Token > &tokens, size_t &index, std::map< std::string, Node > &definitions)
Parse a zeml definition.
void Bind(Node *node, std::function< void()> callback)
Bind a callback to a node.
void BindSelectable(Node *node, bool *selected, std::function< void()> callback)
Bind a selectable node.
void Render(Node &node)
Render a zeml tree.
Node ParseNode(const std::vector< Token > &tokens, size_t &index, const std::map< std::string, void * > &data_bindings, const std::map< std::string, Node > &definitions)
Parse a zeml node.
std::string LoadFile(const std::string &filename)
WidgetType MapType(const std::string &type)
Map a string to a widget type.
void ParseFlags(const WidgetType &type, const std::string &flags, WidgetAttributes &attributes)
std::vector< Token > Tokenize(const std::string &input)
Tokenize a zeml string.
std::function< void()> callback
Node * GetNode(const std::string &searchId)
std::vector< Action > actions
std::vector< Node > children
WidgetAttributes attributes