GameApi 28
Library used by GameApi Builder tool
Loading...
Searching...
No Matches
Parser.cc File Reference
#include <string>
#include <sstream>
#include <iostream>
#include <vector>
#include <chrono>
#include <cstring>
#include <fstream>
#include <algorithm>
#include "stb_image.h"
Include dependency graph for Parser.cc:

Classes

struct  GameApi::Env
struct  GameApi::EveryApi
class  Point
struct  BufferRef
class  Splitter
class  QMLData
struct  FrameLoopEvent
class  SourceBitmap
class  FrameBuffer
struct  DrawLoopEnv
class  FrameBufferLoop
struct  PVec
class  QMLLoop
class  QMLRoot
class  QMLLoader
class  PrintQMLData
class  QMLCreateNode
class  UnknownElement
class  UnknownWithChildren
class  LowFrameBuffer
class  RefWrapper
class  ApplicationWindow
class  Rectangle2
class  AbstractButton
class  Image
struct  Rect
class  StackView
struct  DBItem

Namespaces

namespace  GameApi

Macros

#define STB_IMAGE_IMPLEMENTATION
#define HAS_FILESYSTEM
#define USE_VGA
#define Depth_2bit
#define tp_screen_width   640
#define tp_screen_height   480

Enumerations

enum  FrameBufferFormat {
  F_Mono1 , F_Mono8 , F_RGB565 , F_RGB888 ,
  F_RGBA8888
}
enum  DrawBufferFormat { D_Mono1 , D_RGBA8888 }

Functions

int get_screen_width ()
int get_screen_height ()
std::string to_string (int val)
BufferRef LoadImageFromString (std::vector< unsigned char > buffer, bool &success)
std::string replace_path_separators (std::string s)
std::vector< unsigned char > load_file (std::string qml_relative_path, bool bin)
BufferRef decode_image_file (std::vector< unsigned char > vec)
BufferRef scale_bitmap (BufferRef orig, int new_x, int new_y)
std::string strip_spaces (std::string s)
void ClearDepthBuffer (float *arr, int width, int height)
std::vector< std::string > split_from_char (std::string s, char c)
std::string focus_to_braces (std::string s)
std::string remove_comment (std::string s)
std::pair< std::string, std::string > split_attr (std::string attr, bool &success)
int int_expr_parser (QMLLoop *loop, const PVec &vec, std::string value)
int constants (std::string id)
bool is_import (std::string line)
bool is_component (std::string line)
bool is_component_end (std::string line)
int find_ch (std::string s, char ch)
bool is_attribute (std::string line)
bool is_property (std::string line)
bool is_pragma (std::string line)
bool is_comment_start (std::string line)
bool is_comment_end (std::string line)
void BufferRefToSourceBitmap (BufferRef &ref, SourceBitmap &target, DrawBufferFormat fmt)
QMLLoop * create_qml_element (QMLLoop *parent, QMLData *root, QMLData *dt)
void recursive_prepare (QMLData *mod)
void splitter_iter2 (void *arg)
int main ()
Rect remove_rect_from_rect (Rect orig, Rect cut, bool &success)
Rect to_rect (int x, int y, int width, int height)
Rect to_rect (std::pair< int, int > tl, std::pair< int, int > sz)
std::ostream & operator<< (std::ostream &o, Rect r)
Rect anchors_fill_parent (QMLLoop *current, bool &res_success)
std::string parse_import (std::string line)
void global_db (QMLLoop *loop, PVec vec, std::vector< QMLLoop * > child)
QMLLoop * find_by_id (QMLLoop *context, std::string id, std::string key="id", int depth=0)
bool is_number (std::string s)

Variables

std::string qml_path
std::string gameapi_homepageurl
Splitter * splitter_current = 0
std::vector< DBItem > g_db

Macro Definition Documentation

◆ Depth_2bit

#define Depth_2bit

◆ HAS_FILESYSTEM

#define HAS_FILESYSTEM

◆ STB_IMAGE_IMPLEMENTATION

#define STB_IMAGE_IMPLEMENTATION

◆ tp_screen_height

#define tp_screen_height   480

◆ tp_screen_width

#define tp_screen_width   640

◆ USE_VGA

#define USE_VGA

Enumeration Type Documentation

◆ DrawBufferFormat

Enumerator
D_Mono1 
D_RGBA8888 

◆ FrameBufferFormat

Enumerator
F_Mono1 
F_Mono8 
F_RGB565 
F_RGB888 
F_RGBA8888 

Function Documentation

◆ anchors_fill_parent()

Rect anchors_fill_parent ( QMLLoop * current,
bool & res_success )
Here is the caller graph for this function:

◆ BufferRefToSourceBitmap()

void BufferRefToSourceBitmap ( BufferRef & ref,
SourceBitmap & target,
DrawBufferFormat fmt )

◆ ClearDepthBuffer()

void ClearDepthBuffer ( float * arr,
int width,
int height )

◆ constants()

int constants ( std::string id)
Here is the caller graph for this function:

◆ create_qml_element()

QMLLoop * create_qml_element ( QMLLoop * parent,
QMLData * root,
QMLData * dt )

◆ decode_image_file()

BufferRef decode_image_file ( std::vector< unsigned char > vec)
Here is the caller graph for this function:

◆ find_by_id()

QMLLoop * find_by_id ( QMLLoop * context,
std::string id,
std::string key = "id",
int depth = 0 )
Here is the caller graph for this function:

◆ find_ch()

int find_ch ( std::string s,
char ch )
Here is the caller graph for this function:

◆ focus_to_braces()

std::string focus_to_braces ( std::string s)
Here is the caller graph for this function:

◆ get_screen_height()

int get_screen_height ( )
Here is the caller graph for this function:

◆ get_screen_width()

int get_screen_width ( )
Here is the caller graph for this function:

◆ global_db()

void global_db ( QMLLoop * loop,
PVec vec,
std::vector< QMLLoop * > child )

◆ int_expr_parser()

int int_expr_parser ( QMLLoop * loop,
const PVec & vec,
std::string value )
Here is the caller graph for this function:

◆ is_attribute()

bool is_attribute ( std::string line)
Here is the caller graph for this function:

◆ is_comment_end()

bool is_comment_end ( std::string line)
Here is the caller graph for this function:

◆ is_comment_start()

bool is_comment_start ( std::string line)
Here is the caller graph for this function:

◆ is_component()

bool is_component ( std::string line)
Here is the caller graph for this function:

◆ is_component_end()

bool is_component_end ( std::string line)
Here is the caller graph for this function:

◆ is_import()

bool is_import ( std::string line)
Here is the caller graph for this function:

◆ is_number()

bool is_number ( std::string s)
Here is the caller graph for this function:

◆ is_pragma()

bool is_pragma ( std::string line)
Here is the caller graph for this function:

◆ is_property()

bool is_property ( std::string line)
Here is the caller graph for this function:

◆ load_file()

std::vector< unsigned char > load_file ( std::string qml_relative_path,
bool bin )
Here is the caller graph for this function:

◆ LoadImageFromString()

BufferRef LoadImageFromString ( std::vector< unsigned char > buffer,
bool & success )
Here is the caller graph for this function:

◆ main()

int main ( )

◆ operator<<()

std::ostream & operator<< ( std::ostream & o,
Rect r )

◆ parse_import()

std::string parse_import ( std::string line)
Here is the caller graph for this function:

◆ recursive_prepare()

void recursive_prepare ( QMLData * mod)

◆ remove_comment()

std::string remove_comment ( std::string s)
Here is the caller graph for this function:

◆ remove_rect_from_rect()

Rect remove_rect_from_rect ( Rect orig,
Rect cut,
bool & success )
Here is the caller graph for this function:

◆ replace_path_separators()

std::string replace_path_separators ( std::string s)
Here is the caller graph for this function:

◆ scale_bitmap()

BufferRef scale_bitmap ( BufferRef orig,
int new_x,
int new_y )
Here is the caller graph for this function:

◆ split_attr()

std::pair< std::string, std::string > split_attr ( std::string attr,
bool & success )
Here is the caller graph for this function:

◆ split_from_char()

std::vector< std::string > split_from_char ( std::string s,
char c )
Here is the caller graph for this function:

◆ splitter_iter2()

void splitter_iter2 ( void * arg)
Here is the caller graph for this function:

◆ strip_spaces()

std::string strip_spaces ( std::string s)
Here is the caller graph for this function:

◆ to_rect() [1/2]

Rect to_rect ( int x,
int y,
int width,
int height )
Here is the caller graph for this function:

◆ to_rect() [2/2]

Rect to_rect ( std::pair< int, int > tl,
std::pair< int, int > sz )

◆ to_string()

std::string to_string ( int val)
Here is the caller graph for this function:

Variable Documentation

◆ g_db

std::vector<DBItem> g_db

◆ gameapi_homepageurl

std::string gameapi_homepageurl
extern

◆ qml_path

std::string qml_path

◆ splitter_current

Splitter* splitter_current = 0