maug
Quick and dirty C mini-augmentation library.
Loading...
Searching...
No Matches
RetroGUI Controls
Collaboration diagram for RetroGUI Controls:

Data Structures

struct  RETROGUI_CTL_BASE
 Fields common to ALL RETROGUI_CTL types. More...
 
union  RETROGUI_CTL
 

Macros

#define RETROGUI_CTL_TABLE_BASE(f)
 Table defining all control types and their specific fields in RETROGUI_CTL.
 
#define RETROGUI_CTL_TABLE(f)
 
#define retrogui_can_focus_ctl(ctl)
 Determine if a RETROGUI_CTL can hold RETROGUI::focus.
 
#define RETROGUI_CTL_TABLE_FIELDS(idx, c_name, c_fields)
 Creates the corresponding RETROGUI_* structs from RETROGUI_CTL_TABLE that populate union RETROGUI_CTL.
 
#define RETROGUI_CTL_TABLE_TYPES(idx, c_name, c_fields)
 Adds the structs created by RETROGUI_CTL_TABLE_FIELDS to union RETROGUI_CTL.
 

Detailed Description

Macro Definition Documentation

◆ retrogui_can_focus_ctl

#define retrogui_can_focus_ctl ( ctl)
Value:
(RETROGUI_CTL_TYPE_BUTTON == (ctl)->base.type || \
RETROGUI_CTL_TYPE_TEXTBOX == (ctl)->base.type || \
RETROGUI_CTL_TYPE_LISTBOX == (ctl)->base.type)

Determine if a RETROGUI_CTL can hold RETROGUI::focus.

◆ RETROGUI_CTL_TABLE

#define RETROGUI_CTL_TABLE ( f)
Value:
f( 6, TEXTBOX, MAUG_MHANDLE text_h; char* text; size_t text_sz; size_t text_sz_max; size_t text_cur; int16_t blink_frames; )
#define RETROGUI_CTL_TABLE_BASE(f)
Table defining all control types and their specific fields in RETROGUI_CTL.
Definition retrogui.h:343

◆ RETROGUI_CTL_TABLE_BASE

#define RETROGUI_CTL_TABLE_BASE ( f)
Value:
f( 0, NONE, void* none; ) \
f( 1, LISTBOX, struct MDATA_VECTOR list; size_t sel_idx; ) \
f( 2, BUTTON, MAUG_MHANDLE label_h; char* label; size_t label_sz; int16_t push_frames; uint8_t font_flags; ) \
f( 3, LABEL, MAUG_MHANDLE label_h; char* label; size_t label_sz; uint8_t font_flags; ) \
f( 4, IMAGE, retroflat_blit_t image; ssize_t image_cache_id; int16_t instance; retroflat_pxxy_t src_x; retroflat_pxxy_t src_y; ) \
f( 5, FILLBAR, uint8_t flags; uint16_t cur; uint16_t max; )
size_t retroflat_pxxy_t
Type used for surface pixel coordinates.
Definition retroflt.h:870
A vector of uniformly-sized objects, stored contiguously.
Definition mdata.h:93

Table defining all control types and their specific fields in RETROGUI_CTL.

This table takes a macro as an argument, itself with the argumentS:

Parameters
type_idxIndex passed to RETROGUI_CTL_BASE::type.
structName of the struct under the RETROGUI_CTL union.
fieldsSemicolon-separated list of fields for the type struct.

Each such macro defines a new control type.

All entries in this table have corresponding retrogui_redraw_*, retrogui_poll_*, retrogui_init_*, and retrogui_push_* functions which are called internally from retrogui_redraw_ctls(), retrogui_poll_ctls(), retrogui_init_ctl(), and retrogui_push_ctl(), respectively.

◆ RETROGUI_CTL_TABLE_FIELDS

#define RETROGUI_CTL_TABLE_FIELDS ( idx,
c_name,
c_fields )
Value:
struct RETROGUI_CTL_ ## c_name { \
struct RETROGUI_CTL_BASE base; \
c_fields \
};
Fields common to ALL RETROGUI_CTL types.
Definition retrogui.h:377

Creates the corresponding RETROGUI_* structs from RETROGUI_CTL_TABLE that populate union RETROGUI_CTL.

◆ RETROGUI_CTL_TABLE_TYPES

#define RETROGUI_CTL_TABLE_TYPES ( idx,
c_name,
c_fields )
Value:
struct RETROGUI_CTL_ ## c_name c_name;

Adds the structs created by RETROGUI_CTL_TABLE_FIELDS to union RETROGUI_CTL.