comparison libmlk-ui/mlk/ui/button.h @ 488:441c37e7474f

ui: button -> mlk_button
author David Demelier <markand@malikania.fr>
date Tue, 28 Feb 2023 13:12:05 +0100
parents 5729efd23286
children 2af25db99273
comparison
equal deleted inserted replaced
487:f2d3c5a97884 488:441c37e7474f
23 23
24 union mlk_event; 24 union mlk_event;
25 25
26 struct theme; 26 struct theme;
27 27
28 enum button_state { 28 enum mlk_button_state {
29 BUTTON_STATE_NONE, 29 MLK_BUTTON_STATE_NONE,
30 BUTTON_STATE_PRESSED, 30 MLK_BUTTON_STATE_PRESSED,
31 BUTTON_STATE_ACTIVATED 31 MLK_BUTTON_STATE_ACTIVATED
32 }; 32 };
33 33
34 struct button { 34 struct mlk_button {
35 int x; 35 int x;
36 int y; 36 int y;
37 unsigned int w; 37 unsigned int w;
38 unsigned int h; 38 unsigned int h;
39 const char *text; 39 const char *text;
40 enum button_state state; 40 enum mlk_button_state state;
41 const struct theme *theme; 41 const struct theme *theme;
42 }; 42 };
43 43
44 MLK_CORE_BEGIN_DECLS 44 MLK_CORE_BEGIN_DECLS
45 45
46 int 46 int
47 button_handle(struct button *, const union mlk_event *); 47 mlk_button_handle(struct mlk_button *, const union mlk_event *);
48 48
49 void 49 void
50 button_reset(struct button *); 50 mlk_button_reset(struct mlk_button *);
51 51
52 void 52 void
53 button_draw_default(const struct theme *, const struct button *); 53 mlk_button_draw_default(const struct theme *, const struct mlk_button *);
54 54
55 void 55 void
56 button_draw(const struct button *); 56 mlk_button_draw(const struct mlk_button *);
57 57
58 MLK_CORE_END_DECLS 58 MLK_CORE_END_DECLS
59 59
60 #endif /* !MLK_UI_BUTTON_H */ 60 #endif /* !MLK_UI_BUTTON_H */