maug
Quick and dirty C mini-augmentation library.
Loading...
Searching...
No Matches
retrogui.h File Reference

Go to the source code of this file.

Data Structures

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

Macros

#define RETROGUI_TRACE_LVL   0
 
#define RETROGUI_KEY_ACTIVATE   RETROFLAT_KEY_SPACE
 Overrideable constant defining the keyboard key (RETROFLAT_KEY_*) that will activate the RETROGUI_CTL currently referenced by RETROGUI::focus.
 
#define RETROGUI_KEY_NEXT   RETROFLAT_KEY_DOWN
 Overrideable constant defining the keyboard key (RETROFLAT_KEY_*) that will select the next activateable RETROGUI_CTL currently referenced by RETROGUI::focus.
 
#define RETROGUI_KEY_PREV   RETROFLAT_KEY_UP
 Overrideable constant defining the keyboard key (RETROFLAT_KEY_*) that will select the previous activateable RETROGUI_CTL currently referenced by RETROGUI::focus.
 
#define RETROGUI_PAD_ACTIVATE   RETROFLAT_PAD_A
 Overrideable constant defining the gamepad button (RETROFLAT_PAD_*) that will activate the RETROGUI_CTL currently referenced by RETROGUI::focus.
 
#define RETROGUI_PAD_NEXT   RETROFLAT_PAD_DOWN
 Overrideable constant defining the gamepad button (RETROFLAT_PAD_*) that will select the next activateable RETROGUI_CTL currently referenced by RETROGUI::focus.
 
#define RETROGUI_PAD_PREV   RETROFLAT_PAD_UP
 Overrideable constant defining the gamepad button (RETROFLAT_PAD_*) that will select the previous activateable RETROGUI_CTL currently referenced by RETROGUI::focus.
 
#define RETROGUI_CTL_TEXT_SZ_MAX   128
 
#define RETROGUI_CTL_SZ_MAX_INIT   20
 
#define RETROGUI_PADDING   5
 Overrideable constant defining the padding for text inside of controls in pixels.
 
#define RETROGUI_BTN_LBL_SZ_MAX   64
 
#define RETROGUI_BTN_LBL_PADDED_X   8
 
#define RETROGUI_BTN_LBL_PADDED_Y   8
 
#define RETROGUI_CTL_TEXT_BLINK_FRAMES   15
 
#define RETROGUI_FILLBAR_FLAG_SHOWNUM   0x02
 
#define _retrogui_copy_str(field, src_str, dest_ctl, str_tmp, str_sz)
 
#define RETROGUI_IDC_NONE   0
 
#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_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.
 
#define retrogui_focus_next(gui)
 
#define retrogui_focus_prev(gui)
 
#define RETROGUI_CTL_TABLE_CONSTS(idx, c_name, c_fields)
 

Typedefs

typedef int16_t retrogui_idc_t
 Unique identifying constant number for controls.
 
typedef void(* retrogui_xy_cb) (retroflat_pxxy_t *x, retroflat_pxxy_t *y, void *data)
 

Functions

MERROR_RETVAL retrogui_push_listbox_item (struct RETROGUI *gui, retrogui_idc_t idc, const char *item, size_t item_sz)
 
retrogui_idc_t retrogui_poll_ctls (struct RETROGUI *gui, RETROFLAT_IN_KEY *p_input, struct RETROFLAT_INPUT *input_evt)
 Poll for the last clicked control and maintain listboxes and menus.
 
MERROR_RETVAL retrogui_redraw_ctls (struct RETROGUI *gui)
 
MERROR_RETVAL retrogui_sz_ctl (struct RETROGUI *gui, retrogui_idc_t idc, retroflat_pxxy_t *p_w, retroflat_pxxy_t *p_h, retroflat_pxxy_t max_w, retroflat_pxxy_t max_h)
 
MERROR_RETVAL retrogui_pos_ctl (struct RETROGUI *gui, retrogui_idc_t idc, retroflat_pxxy_t x, retroflat_pxxy_t y, retroflat_pxxy_t w, retroflat_pxxy_t h)
 
MERROR_RETVAL retrogui_push_ctl (struct RETROGUI *gui, union RETROGUI_CTL *ctl)
 
MERROR_RETVAL retrogui_set_font (struct RETROGUI *gui, const char *font_path)
 Load the RetroFont API for the given RETROGUI to draw its controls with. Use RetroGXCache API if available.
 
MERROR_RETVAL retrogui_get_ctl_text (struct RETROGUI *gui, retrogui_idc_t idc, char *buffer, size_t buffer_sz)
 
ssize_t retrogui_get_ctl_sel_idx (struct RETROGUI *gui, retrogui_idc_t idc)
 
MERROR_RETVAL retrogui_set_ctl_text (struct RETROGUI *gui, retrogui_idc_t idc, size_t buffer_sz, const char *fmt,...)
 
MERROR_RETVAL retrogui_set_ctl_image (struct RETROGUI *gui, retrogui_idc_t idc, const char *path, uint8_t flags)
 Set the image displayed by an IMAGE-type RETROGUI_CTL.
 
MERROR_RETVAL retrogui_set_ctl_level (struct RETROGUI *gui, retrogui_idc_t idc, uint16_t level, uint16_t max, uint8_t flags)
 Set the current progress level displayed by a FILLBAR-type RETROGUI_CTL.
 
MERROR_RETVAL retrogui_init_ctl (union RETROGUI_CTL *ctl, uint8_t type, size_t idc)