theme
a theme, its tokens, and what a control reads off it
the WHY is not on this page. how the abi got this shape lives in how the abi is designed, and what a wrapped call MEANS is answered by the c++ header underneath it
the theme
one bundle of tokens, dark by default n every field free to move after
int32_t gui_theme_create(gui_theme_t** _out);
int32_t gui_theme_destroy(gui_theme_t* _theme);
int32_t gui_theme_set_colour(gui_theme_t* _theme, int32_t _token, uint32_t _argb);
int32_t gui_theme_colour(gui_theme_t* _theme, int32_t _token, uint32_t* _out);
int32_t gui_theme_set_number(gui_theme_t* _theme, int32_t _token, float _value);
int32_t gui_theme_number(gui_theme_t* _theme, int32_t _token, float* _out);
int32_t gui_theme_set_font(gui_theme_t* _theme, const char* _family, float _size, int32_t _weight);destroyrefuses withgui_err_in_usewhile any live control still resolves to it, so unset it everywhere first, or letgui_shutdowndo the ordering- a colour is straight argb
0xAARRGGBB, exactly what the theme file writes _familyis utf8 n COPIED, unlike every other string in here, so it does not have to outlive the call._sizeis px n_weightis 100 to 900 where 600 is semibold- a token out of range is
gui_err_arg
the tokens
the enums come off x macro lists in the header n the tables in the dll come off the same lists, so
the two cannot drift. the names are the theme_t field names verbatim, which is what makes a lookup
mechanical
| enum | shape | count |
|---|---|---|
gui_col_t | gui_col_<field>, e.g. gui_col_accent | gui_col_count |
gui_num_t | gui_num_<field>, e.g. gui_num_radius | gui_num_count |
gui_num_t is floats first then the four int ms ones, gui_num_anim_hover, anim_move, anim_pop
n anim_fill. those four are int32_t on the theme, so they round on the way in, the getter still
hands them back as a float
use GUI_THEME_COLOURS, GUI_THEME_FLOATS n GUI_THEME_INTS from the header if you want to generate
the list on your side rather than type it