![]() |
Nilorea Library
C utilities for networking, threading, graphics
|
Data Structures | |
| struct | N_GUI_DIALOG |
| structure of a N_GUI_DIALOG More... | |
| struct | N_GUI_LAYOUT |
| structure of a N_GUI_DIALOG or N_GUI_WIDGET layout More... | |
| struct | N_GUI_TOKEN |
| structure of a N_GUI_TOKENIZER token More... | |
| struct | N_GUI_TOKENIZER |
| structure of a N_GUI_DIALOG tokenizer More... | |
| struct | N_GUI_WIDGET |
| structure of a N_GUI_DIALOG widget More... | |
Macros | |
| #define | N_ENUM_N_GUI_TOKEN(_) |
| N_GUI_CTX codes definition. | |
| #define | N_GUI_MAX_TOKEN_SIZE 1024 |
| maximum size of a single token content | |
Enumerations | |
| enum | __N_GUI_TOKEN { N_GUI_TOKEN_TAG_OPEN = 2 , N_GUI_TOKEN_TAG_CLOSE = 4 , N_GUI_TOKEN_TAG_NAME = 8 , N_GUI_TOKEN_ATTR_NAME = 16 , N_GUI_TOKEN_ATTR_VALUE = 32 , N_GUI_TOKEN_TEXT = 64 , N_GUI_TOKEN_EOF = 128 , ____N_GUI_TOKEN_UNKNOWN_VALUE__ } |
| Network codes declaration. More... | |
Functions | |
| void | n_gui_init_tokenizer (N_GUI_TOKENIZER *tokenizer, const char *input) |
| Initialize tokenizer. | |
| int | n_gui_is_eof (N_GUI_TOKENIZER *tokenizer) |
| | |
| N_GUI_DIALOG * | n_gui_load_dialog (char *html, char *css) |
| Load a html + css file into a N_GUI_DIALOG. | |
| char | n_gui_next_char (N_GUI_TOKENIZER *tokenizer) |
| Get next character from input. | |
| N_GUI_TOKEN | n_gui_next_token (N_GUI_TOKENIZER *tokenizer, bool *inside_open_tag) |
| Read next N_GUI_TOKEN from input. | |
| char | n_gui_peek_char (N_GUI_TOKENIZER *tokenizer) |
| Peek at next character without advancing the position. | |
| void | n_gui_print_token (N_GUI_TOKEN token) |
| Function to print a token (for debugging purposes) | |
| struct N_GUI_DIALOG |
structure of a N_GUI_DIALOG
Collaboration diagram for N_GUI_DIALOG:| Data Fields | ||
|---|---|---|
| HASH_TABLE * | styles | hash table of styles |
| TREE * | tree | tree of widgets |
| struct N_GUI_LAYOUT |
structure of a N_GUI_DIALOG or N_GUI_WIDGET layout
Collaboration diagram for N_GUI_LAYOUT:| Data Fields | ||
|---|---|---|
| ALLEGRO_COLOR | background_color | background color |
| N_STR * | background_image | background image file string |
| N_STR * | font | font file string |
| size_t | font_size | font size |
| size_t | font_style | font style |
| size_t | horizontal_align | horizontal align type |
| size_t | margin_bottom | margin bottom |
| size_t | margin_left | margin left |
| size_t | margin_right | margin right |
| size_t | margin_top | margin top |
| size_t | max_height | maximum height |
| size_t | max_width | maximum width |
| size_t | min_height | minimum height |
| size_t | min_width | minimum width |
| size_t | vertical_align | vertical align type |
| struct N_GUI_TOKEN |
structure of a N_GUI_TOKENIZER token
Collaboration diagram for N_GUI_TOKEN:| Data Fields | ||
|---|---|---|
| size_t | type | type of token |
| char | value[1024] | token content |
| struct N_GUI_TOKENIZER |
structure of a N_GUI_DIALOG tokenizer
Collaboration diagram for N_GUI_TOKENIZER:| Data Fields | ||
|---|---|---|
| const char * | input | pointer to the input text |
| size_t | position | position in the input text |
| struct N_GUI_WIDGET |
structure of a N_GUI_DIALOG widget
Collaboration diagram for N_GUI_WIDGET:| Data Fields | ||
|---|---|---|
| size_t | h | computed height |
| N_GUI_LAYOUT | layout | layout of the widget |
| size_t | type | type of widget |
| size_t | w | computed width |
| size_t | x | computed x position |
| size_t | y | computed y position |
| #define N_ENUM_N_GUI_TOKEN | ( | _ | ) |
N_GUI_CTX codes definition.
| #define N_GUI_MAX_TOKEN_SIZE 1024 |
| enum __N_GUI_TOKEN |
| void n_gui_init_tokenizer | ( | N_GUI_TOKENIZER * | tokenizer, |
| const char * | input | ||
| ) |
Initialize tokenizer.
| tokenizer | the tokenizer to init |
| input | the input on which we want to start with a fresh tokenizer |
Definition at line 24 of file n_gui.c.
References N_GUI_TOKENIZER::input, and N_GUI_TOKENIZER::position.
Referenced by n_gui_load_dialog().
Here is the caller graph for this function:| int n_gui_is_eof | ( | N_GUI_TOKENIZER * | tokenizer | ) |
Check if end of input is reached
| tokenizer | the tokenizer from which we want to test if finished |
Definition at line 52 of file n_gui.c.
References N_GUI_TOKENIZER::input, and N_GUI_TOKENIZER::position.
Referenced by n_gui_next_token().
Here is the caller graph for this function:| N_GUI_DIALOG * n_gui_load_dialog | ( | char * | html, |
| char * | css | ||
| ) |
Load a html + css file into a N_GUI_DIALOG.
| html | path to the html file |
| css | path to the css style file |
Definition at line 203 of file n_gui.c.
References __n_assert, _nstr, file_to_nstr(), free_nstr, Malloc, n_gui_init_tokenizer(), n_gui_next_token(), N_GUI_TOKEN_ATTR_NAME, N_GUI_TOKEN_ATTR_VALUE, N_GUI_TOKEN_EOF, N_GUI_TOKEN_TAG_CLOSE, N_GUI_TOKEN_TAG_NAME, N_GUI_TOKEN_TAG_OPEN, N_GUI_TOKEN_TEXT, and N_GUI_TOKEN::type.
Here is the call graph for this function:| char n_gui_next_char | ( | N_GUI_TOKENIZER * | tokenizer | ) |
Get next character from input.
| tokenizer | the tokenizer to read data from |
Definition at line 34 of file n_gui.c.
References N_GUI_TOKENIZER::input, and N_GUI_TOKENIZER::position.
Referenced by n_gui_next_token().
Here is the caller graph for this function:| N_GUI_TOKEN n_gui_next_token | ( | N_GUI_TOKENIZER * | tokenizer, |
| bool * | inside_open_tag | ||
| ) |
Read next N_GUI_TOKEN from input.
| tokenizer | the tokenizer from which we want the next token from |
| inside_open_tag | pointer to a boolean that will reflect the status of tag detection |
Definition at line 62 of file n_gui.c.
References n_gui_is_eof(), N_GUI_MAX_TOKEN_SIZE, n_gui_next_char(), n_gui_next_token(), n_gui_peek_char(), N_GUI_TOKEN_ATTR_NAME, N_GUI_TOKEN_ATTR_VALUE, N_GUI_TOKEN_EOF, N_GUI_TOKEN_TAG_CLOSE, N_GUI_TOKEN_TAG_NAME, N_GUI_TOKEN_TAG_OPEN, N_GUI_TOKEN_TEXT, N_GUI_TOKEN::type, and N_GUI_TOKEN::value.
Referenced by n_gui_load_dialog(), and n_gui_next_token().
Here is the call graph for this function:
Here is the caller graph for this function:| char n_gui_peek_char | ( | N_GUI_TOKENIZER * | tokenizer | ) |
Peek at next character without advancing the position.
| tokenizer | the tokenizer from which we want to peek data from |
Definition at line 43 of file n_gui.c.
References N_GUI_TOKENIZER::input, and N_GUI_TOKENIZER::position.
Referenced by n_gui_next_token().
Here is the caller graph for this function:| void n_gui_print_token | ( | N_GUI_TOKEN | token | ) |
Function to print a token (for debugging purposes)
| token | the N_GUI_TOKEN token to print |
Definition at line 171 of file n_gui.c.
References N_GUI_TOKEN_ATTR_NAME, N_GUI_TOKEN_ATTR_VALUE, N_GUI_TOKEN_EOF, N_GUI_TOKEN_TAG_CLOSE, N_GUI_TOKEN_TAG_NAME, N_GUI_TOKEN_TAG_OPEN, N_GUI_TOKEN_TEXT, N_GUI_TOKEN::type, and N_GUI_TOKEN::value.