yaze 0.2.0
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::app::gui::zeml Namespace Reference

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< TokenTokenize (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.
 

Detailed Description

Zelda Editor Markup Language Functions.

Enumeration Type Documentation

◆ TokenType

Enumerator
Identifier 
String 
OpenBrace 
CloseBrace 
Comma 
EndOfStream 

Definition at line 28 of file zeml.h.

◆ WidgetType

Enumerator
Window 
Button 
Slider 
Text 
Table 
TableSetupColumn 
TableHeadersRow 
TableNextColumn 
CollapsingHeader 
Columns 
Checkbox 
Selectable 
Function 
BeginChild 
BeginMenuBar 
BeginMenu 
BeginTabBar 
BeginTabItem 
MenuItem 
Separator 
HexInputByte 
HexInputWord 
Canvas 
Definition 

Definition at line 48 of file zeml.h.

◆ ActionType

Enumerator
Click 
Change 
Run 

Definition at line 108 of file zeml.h.

Function Documentation

◆ Tokenize()

std::vector< Token > yaze::app::gui::zeml::Tokenize ( const std::string & input)

Tokenize a zeml string.

Definition at line 23 of file zeml.cc.

References CloseBrace, Comma, EndOfStream, Identifier, OpenBrace, and String.

Referenced by Parse().

◆ MapType()

WidgetType yaze::app::gui::zeml::MapType ( const std::string & type)

◆ 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 )

◆ ParseFlags()

void yaze::app::gui::zeml::ParseFlags ( const WidgetType & type,
const std::string & flags,
WidgetAttributes & attributes )

◆ ParseAttributes()

◆ Parse()

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 361 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().

Here is the call graph for this function:

◆ Render()

◆ ExecuteActions()

void yaze::app::gui::zeml::ExecuteActions ( const std::vector< Action > & actions,
ActionType type )

Execute actions for a node.

Definition at line 560 of file zeml.cc.

Referenced by Render().

◆ Bind()

void yaze::app::gui::zeml::Bind ( Node * node,
std::function< void()> callback )

Bind a callback to a node.

Definition at line 568 of file zeml.cc.

References yaze::app::gui::zeml::Node::actions, and Click.

Referenced by yaze::app::editor::OverworldEditor::InitializeZeml().

◆ BindAction()

void yaze::app::gui::zeml::BindAction ( Node * node,
ActionType type,
std::function< void()> callback )

Bind an action to a node.

Definition at line 575 of file zeml.cc.

References yaze::app::gui::zeml::Node::actions.

◆ BindSelectable()

void yaze::app::gui::zeml::BindSelectable ( Node * node,
bool * selected,
std::function< void()> callback )

◆ LoadFile()

std::string yaze::app::gui::zeml::LoadFile ( const std::string & filename)

Definition at line 591 of file zeml.cc.

References yaze::app::core::GetBundleResourcePath().

Referenced by yaze::app::editor::OverworldEditor::InitializeZeml().

Here is the call graph for this function:

◆ ParseDefinitions()

void yaze::app::gui::zeml::ParseDefinitions ( const std::vector< Token > & tokens,
size_t & index,
std::map< std::string, Node > & definitions )

Parse a zeml definition.