maug
Quick and dirty C mini-augmentation library.
Loading...
Searching...
No Matches
Retro HyperText Rendering API

Files

file  retrohtr.h
 

Data Structures

struct  RETROHTR_RENDER_NODE
 
struct  RETROHTR_RENDER_TREE
 

Macros

#define RETROHTR_TREE_FLAG_GUI_ACTIVE   1
 
#define RETROHTR_NODE_FLAG_DIRTY   2
 
#define RETROHTR_RENDER_NODES_INIT_SZ   10
 
#define RETROHTR_TRACE_LVL   0
 
#define RETROHTR_EDGE_UNKNOWN   0
 
#define RETROHTR_EDGE_LEFT   1
 
#define RETROHTR_EDGE_TOP   2
 
#define RETROHTR_EDGE_INSIDE   4
 
#define retrohtr_node(tree, idx)
 
#define retrohtr_node_parent(tree, idx)
 
#define retrohtr_tree_lock(tree)
 
#define retrohtr_tree_unlock(tree)
 
#define retrohtr_tree_is_locked(tree)
 
#define retrohtr_node_screen_x(tree, node_idx)
 
#define retrohtr_node_screen_y(tree, node_idx)
 

Functions

MERROR_RETVAL retrohtr_tree_create (struct MHTML_PARSER *parser, struct RETROHTR_RENDER_TREE *tree, size_t x, size_t y, size_t w, size_t h, ssize_t tag_idx, ssize_t node_idx, size_t d)
 
MERROR_RETVAL retrohtr_apply_styles (struct MHTML_PARSER *parser, struct RETROHTR_RENDER_TREE *tree, struct MCSS_STYLE *parent_style, struct MCSS_STYLE *effect_style, ssize_t tag_idx)
 Create a style node that is a composite of a parent style and the styles applicable to the classes/IDs of a tag and its immediate styles.
 
MERROR_RETVAL retrohtr_tree_size (struct MHTML_PARSER *parser, struct RETROHTR_RENDER_TREE *tree, struct MCSS_STYLE *prev_sibling_style, struct MCSS_STYLE *parent_style, ssize_t node_idx, size_t d)
 
MERROR_RETVAL retrohtr_tree_pos (struct MHTML_PARSER *parser, struct RETROHTR_RENDER_TREE *tree, struct MCSS_STYLE *prev_sibling_style, struct MCSS_STYLE *parent_style, ssize_t node_idx, size_t d)
 
MERROR_RETVAL retrohtr_tree_draw (struct MHTML_PARSER *parser, struct RETROHTR_RENDER_TREE *tree, ssize_t node_idx, size_t d)
 
retrogui_idc_t retrohtr_tree_poll_ctls (struct RETROHTR_RENDER_TREE *tree, RETROFLAT_IN_KEY *input, struct RETROFLAT_INPUT *input_evt)
 
MERROR_RETVAL retrohtr_tree_dump (struct RETROHTR_RENDER_TREE *tree, struct MHTML_PARSER *parser, ssize_t iter, size_t d)
 
void retrohtr_tree_free (struct RETROHTR_RENDER_TREE *tree)
 
MERROR_RETVAL retrohtr_tree_init (struct RETROHTR_RENDER_TREE *tree)
 

Variables

uint8_t RETROHTR_RENDER_NODE::flags
 
ssize_t RETROHTR_RENDER_NODE::x
 
ssize_t RETROHTR_RENDER_NODE::y
 
size_t RETROHTR_RENDER_NODE::w
 
size_t RETROHTR_RENDER_NODE::h
 
size_t RETROHTR_RENDER_NODE::m_l
 
size_t RETROHTR_RENDER_NODE::m_r
 
size_t RETROHTR_RENDER_NODE::m_t
 
size_t RETROHTR_RENDER_NODE::m_b
 
uint8_t RETROHTR_RENDER_NODE::pos
 
uint8_t RETROHTR_RENDER_NODE::pos_flags
 
uint8_t RETROHTR_RENDER_NODE::edge
 
RETROFLAT_COLOR RETROHTR_RENDER_NODE::bg
 
RETROFLAT_COLOR RETROHTR_RENDER_NODE::fg
 
MAUG_MHANDLE RETROHTR_RENDER_NODE::font_h
 
ssize_t RETROHTR_RENDER_NODE::tag
 
ssize_t RETROHTR_RENDER_NODE::parent
 Index of container's render node in RETROHTR_RENDER_TREE.
 
ssize_t RETROHTR_RENDER_NODE::first_child
 Index of first child's render node in RETROHTR_RENDER_TREE.
 
ssize_t RETROHTR_RENDER_NODE::next_sibling
 Index of next sibling's render node in RETROHTR_RENDER_TREE.
 
struct RETROFLAT_BITMAP RETROHTR_RENDER_NODE::bitmap
 
uint8_t RETROHTR_RENDER_TREE::flags
 
MAUG_MHANDLE RETROHTR_RENDER_TREE::nodes_h
 
struct RETROHTR_RENDER_NODERETROHTR_RENDER_TREE::nodes
 Locked pointer to nodes when locked with retrohtr_tree_lock().
 
size_t RETROHTR_RENDER_TREE::nodes_sz
 Current active number of nodes in RETROHTR_RENDER_NODE::nodes_h.
 
size_t RETROHTR_RENDER_TREE::nodes_sz_max
 Current alloc'd number of nodes in RETROHTR_RENDER_NODE::nodes_h.
 
struct RETROGUI RETROHTR_RENDER_TREE::gui
 

Detailed Description

Macro Definition Documentation

◆ retrohtr_node

#define retrohtr_node ( tree,
idx )
Value:
(0 <= (ssize_t)idx ? &((tree)->nodes[idx]) : NULL)

◆ retrohtr_node_parent

#define retrohtr_node_parent ( tree,
idx )
Value:
(0 <= idx && 0 <= (tree)->nodes[idx].parent ? \
&((tree)->nodes[(tree)->nodes[idx].parent]) : NULL)

◆ retrohtr_node_screen_x

#define retrohtr_node_screen_x ( tree,
node_idx )
Value:
((tree)->nodes[node_idx].x)

◆ retrohtr_node_screen_y

#define retrohtr_node_screen_y ( tree,
node_idx )
Value:
((tree)->nodes[node_idx].y)

◆ retrohtr_tree_is_locked

#define retrohtr_tree_is_locked ( tree)
Value:
(NULL != (tree)->nodes)

◆ retrohtr_tree_lock

#define retrohtr_tree_lock ( tree)
Value:
if( NULL == (tree)->nodes ) { \
maug_mlock( (tree)->nodes_h, (tree)->nodes ); \
maug_cleanup_if_null_alloc( struct RETROHTR_RENDER_NODE*, (tree)->nodes ); \
}
Definition retrohtr.h:28

◆ retrohtr_tree_unlock

#define retrohtr_tree_unlock ( tree)
Value:
if( NULL != (tree)->nodes ) { \
maug_munlock( (tree)->nodes_h, (tree)->nodes ); \
}

Function Documentation

◆ retrohtr_apply_styles()

MERROR_RETVAL retrohtr_apply_styles ( struct MHTML_PARSER * parser,
struct RETROHTR_RENDER_TREE * tree,
struct MCSS_STYLE * parent_style,
struct MCSS_STYLE * effect_style,
ssize_t tag_idx )

Create a style node that is a composite of a parent style and the styles applicable to the classes/IDs of a tag and its immediate styles.

Parameters
tag_idxIndex of a tag in the parser tree to derive styles from.
parent_styleLocked pointer to an MCSS_STYLE for the parent node to build on.
effect_styleLocked pointer to an MCSS_STYLE to clear and replace with the combined style information from the parent and indexed tag.