Mercurial > molko
diff libmlk-ui/mlk/ui/ui.h @ 507:d49a05e7a5b5
ui: separate delegate/style
Now UI elements do have different styling properties:
- _delegate: functions used to update, draw or perform specific actions on the
UI element.
- _style: basic properties that the delegate should support if possible.
author | David Demelier <markand@malikania.fr> |
---|---|
date | Thu, 02 Mar 2023 21:36:43 +0100 |
parents | 6100c643dba0 |
children | 6e8f6640e05b |
line wrap: on
line diff
--- a/libmlk-ui/mlk/ui/ui.h Thu Mar 02 08:54:00 2023 +0100 +++ b/libmlk-ui/mlk/ui/ui.h Thu Mar 02 21:36:43 2023 +0100 @@ -23,6 +23,16 @@ MLK_CORE_BEGIN_DECLS +/* TODO: make this a global variable to allow modification of default theme. */ +/* https://lospec.com/palette-list/duel */ +#define MLK_UI_COLOR_TEXT 0x222323ff +#define MLK_UI_COLOR_SELECTED 0x55b67dff +#define MLK_UI_COLOR_BG 0xf5f7faff +#define MLK_UI_COLOR_BORDER 0xcdd2daff +#define MLK_UI_COLOR_DEBUG 0xe45c5fff + +enum mlk_align; + struct mlk_font; enum mlk_ui_font { @@ -35,6 +45,17 @@ int mlk_ui_init(void); +/* TODO: probably better somewhere else? */ +void +mlk_ui_draw_text(enum mlk_align align, + struct mlk_font *font, + unsigned long color, + const char *text, + int x, + int y, + unsigned int w, + unsigned int h); + void mlk_ui_finish(void);