window

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);
  • destroy refuses with gui_err_in_use while any live control still resolves to it, so unset it everywhere first, or let gui_shutdown do the ordering
  • a colour is straight argb 0xAARRGGBB, exactly what the theme file writes
  • _family is utf8 n COPIED, unlike every other string in here, so it does not have to outlive the call. _size is px n _weight is 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

enumshapecount
gui_col_tgui_col_<field>, e.g. gui_col_accentgui_col_count
gui_num_tgui_num_<field>, e.g. gui_num_radiusgui_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

On this page