Zelda Editor Markup Language Functions. More...
Classes | |
struct | Action |
struct | Node |
Node for a zeml tree. More... | |
struct | Token |
struct | WidgetAttributes |
Attributes for a widget. More... | |
Enumerations | |
enum class | TokenType { Identifier , String , OpenBrace , CloseBrace , Comma , EndOfStream } |
enum class | WidgetType { Window , Button , Slider , Text , Table , TableSetupColumn , TableHeadersRow , TableNextColumn , CollapsingHeader , Columns , Checkbox , Selectable , Function , BeginChild , BeginMenuBar , BeginMenu , BeginTabBar , BeginTabItem , MenuItem , Separator , HexInputByte , HexInputWord , Canvas , Definition } |
enum class | ActionType { Click , Change , Run } |
Functions | |
std::vector< Token > | Tokenize (const std::string &input) |
Tokenize a zeml string. | |
WidgetType | MapType (const std::string &type) |
Map a string to a widget type. | |
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. | |
void | ParseFlags (const WidgetType &type, const std::string &flags, WidgetAttributes &attributes) |
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 | Render (Node &node) |
Render a zeml tree. | |
void | ExecuteActions (const std::vector< Action > &actions, ActionType type) |
Execute actions for a node. | |
void | Bind (Node *node, std::function< void()> callback) |
Bind a callback to a node. | |
void | BindAction (Node *node, ActionType type, std::function< void()> callback) |
Bind an action to a node. | |
void | BindSelectable (Node *node, bool *selected, std::function< void()> callback) |
Bind a selectable node. | |
std::string | LoadFile (const std::string &filename) |
void | ParseDefinitions (const std::vector< Token > &tokens, size_t &index, std::map< std::string, Node > &definitions) |
Parse a zeml definition. | |
Zelda Editor Markup Language Functions.
|
strong |
|
strong |
|
strong |
std::vector< Token > yaze::app::gui::zeml::Tokenize | ( | const std::string & | input | ) |
Tokenize a zeml string.
Definition at line 22 of file zeml.cc.
References CloseBrace, Comma, EndOfStream, Identifier, OpenBrace, and String.
Referenced by Parse().
WidgetType yaze::app::gui::zeml::MapType | ( | const std::string & | type | ) |
Map a string to a widget type.
Definition at line 57 of file zeml.cc.
References BeginChild, BeginMenu, BeginMenuBar, BeginTabBar, BeginTabItem, Button, Canvas, Checkbox, CollapsingHeader, Columns, Definition, Function, HexInputByte, HexInputWord, MenuItem, Selectable, Separator, Slider, Table, TableHeadersRow, TableNextColumn, TableSetupColumn, Text, and Window.
Referenced by ParseNode().
Node yaze::app::gui::zeml::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.
Definition at line 87 of file zeml.cc.
References yaze::app::gui::zeml::Node::attributes, yaze::app::gui::zeml::Node::children, CloseBrace, Comma, Definition, EndOfStream, Identifier, MapType(), OpenBrace, ParseAttributes(), ParseNode(), yaze::app::gui::zeml::Node::type, yaze::app::gui::zeml::Token::type, and yaze::app::gui::zeml::Token::value.
Referenced by Parse(), and ParseNode().
void yaze::app::gui::zeml::ParseFlags | ( | const WidgetType & | type, |
const std::string & | flags, | ||
WidgetAttributes & | attributes ) |
Definition at line 135 of file zeml.cc.
References BeginChild, CollapsingHeader, yaze::app::gui::zeml::WidgetAttributes::flags, Table, and TableSetupColumn.
Referenced by ParseAttributes().
WidgetAttributes yaze::app::gui::zeml::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.
Definition at line 305 of file zeml.cc.
References CloseBrace, yaze::app::gui::zeml::WidgetAttributes::count, yaze::app::gui::zeml::WidgetAttributes::data, yaze::app::gui::zeml::WidgetAttributes::id, Identifier, yaze::app::gui::zeml::WidgetAttributes::max, yaze::app::gui::zeml::WidgetAttributes::min, ParseFlags(), yaze::app::gui::zeml::WidgetAttributes::size, String, yaze::app::gui::zeml::WidgetAttributes::text, yaze::app::gui::zeml::WidgetAttributes::title, yaze::app::gui::zeml::Token::value, yaze::app::gui::zeml::WidgetAttributes::value, and yaze::app::gui::zeml::WidgetAttributes::width.
Referenced by ParseNode().
Node yaze::app::gui::zeml::Parse | ( | const std::string & | yazon_input, |
const std::map< std::string, void * > & | data_bindings ) |
Parse a zeml string.
Definition at line 360 of file zeml.cc.
References ParseNode(), and Tokenize().
Referenced by yaze::app::emu::Emulator::Emulator(), yaze::app::editor::OverworldEditor::InitializeZeml(), and yaze::app::emu::Emulator::RenderNavBar().
void yaze::app::gui::zeml::Render | ( | Node & | node | ) |
Render a zeml tree.
Definition at line 381 of file zeml.cc.
References yaze::app::gui::zeml::Node::actions, yaze::app::gui::zeml::Node::attributes, BeginChild, BeginMenu, BeginMenuBar, BeginTabBar, BeginTabItem, Button, Canvas, Change, Checkbox, yaze::app::gui::zeml::Node::children, Click, CollapsingHeader, Columns, yaze::app::gui::zeml::WidgetAttributes::count, yaze::app::gui::zeml::WidgetAttributes::data, yaze::app::gui::Canvas::DrawBackground(), yaze::app::gui::Canvas::DrawContextMenu(), yaze::app::gui::Canvas::DrawGrid(), yaze::app::gui::Canvas::DrawOverlay(), ExecuteActions(), yaze::app::gui::zeml::WidgetAttributes::flags, Function, HexInputByte, HexInputWord, yaze::app::gui::zeml::WidgetAttributes::id, yaze::app::gui::InputHexByte(), yaze::app::gui::InputHexWord(), MenuItem, Render(), Selectable, yaze::app::gui::zeml::WidgetAttributes::selected, Separator, yaze::app::gui::zeml::WidgetAttributes::size, Table, TableHeadersRow, TableNextColumn, TableSetupColumn, Text, yaze::app::gui::zeml::WidgetAttributes::text, yaze::app::gui::zeml::WidgetAttributes::title, yaze::app::gui::zeml::Node::type, and Window.
Referenced by Render(), yaze::app::emu::Emulator::RenderNavBar(), yaze::app::emu::Emulator::Run(), and yaze::app::editor::OverworldEditor::Update().
void yaze::app::gui::zeml::ExecuteActions | ( | const std::vector< Action > & | actions, |
ActionType | type ) |
void yaze::app::gui::zeml::Bind | ( | Node * | node, |
std::function< void()> | callback ) |
Bind a callback to a node.
Definition at line 567 of file zeml.cc.
References yaze::app::gui::zeml::Node::actions, and Click.
Referenced by yaze::app::editor::OverworldEditor::InitializeZeml().
void yaze::app::gui::zeml::BindAction | ( | Node * | node, |
ActionType | type, | ||
std::function< void()> | callback ) |
Bind an action to a node.
Definition at line 574 of file zeml.cc.
References yaze::app::gui::zeml::Node::actions.
void yaze::app::gui::zeml::BindSelectable | ( | Node * | node, |
bool * | selected, | ||
std::function< void()> | callback ) |
Bind a selectable node.
Definition at line 581 of file zeml.cc.
References yaze::app::gui::zeml::Node::actions, yaze::app::gui::zeml::Node::attributes, Click, and yaze::app::gui::zeml::WidgetAttributes::selected.
std::string yaze::app::gui::zeml::LoadFile | ( | const std::string & | filename | ) |
Definition at line 590 of file zeml.cc.
References yaze::app::core::GetBundleResourcePath().
Referenced by yaze::app::editor::OverworldEditor::InitializeZeml().