diff options
Diffstat (limited to 'src/gui/inc')
| -rw-r--r-- | src/gui/inc/gui/button.h | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/src/gui/inc/gui/button.h b/src/gui/inc/gui/button.h index acfc6c1..b712e29 100644 --- a/src/gui/inc/gui/button.h +++ b/src/gui/inc/gui/button.h @@ -15,8 +15,27 @@ extern "C" struct gui_button { struct gui_common common; - struct gui_label label; - short w; + + enum gui_button_type + { + GUI_BUTTON_TYPE_1, + GUI_BUTTON_TYPE_SPRITE + } type; + + union + { + struct + { + short w; + struct gui_label label; + } type1; + + struct + { + const struct sprite *s; + } sprite; + } u; + void *arg; void (*on_pressed)(void *); }; @@ -24,7 +43,7 @@ struct gui_button UTIL_STATIC_ASSERT(!offsetof(struct gui_button, common), "unexpected offset for struct gui_button"); -void gui_button_init(struct gui_button *b); +void gui_button_init(struct gui_button *b, enum gui_button_type t); enum { |
