![]() |
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 | |
Functions | |
N_ENUM_DECLARE (N_ENUM_N_GUI_TOKEN, __N_GUI_TOKEN) | |
Network codes declaration. | |
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
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
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 | horziontal 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
Data Fields | ||
---|---|---|
size_t | type | type of token |
char | value[N_GUI_MAX_TOKEN_SIZE] | token content |
struct N_GUI_TOKENIZER |
structure of a N_GUI_DIALOG 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
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 | ( | _ | ) |
#define N_GUI_MAX_TOKEN_SIZE 1024 |
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().
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().
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 189 of file n_gui.c.
References __n_assert, _nstr, file_to_nstr(), free_nstr, Malloc, n_gui_init_tokenizer(), n_gui_next_token(), and N_GUI_TOKEN::type.
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().
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::type, and N_GUI_TOKEN::value.
Referenced by n_gui_load_dialog(), and n_gui_next_token().
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().
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::type, and N_GUI_TOKEN::value.