Mercurial > molko
comparison src/libmlk-ui/ui/button.h @ 320:8f9937403749
misc: improve loading of data
author | David Demelier <markand@malikania.fr> |
---|---|
date | Fri, 01 Oct 2021 20:30:00 +0200 |
parents | libmlk-ui/ui/button.h@d01e83210ca2 |
children | 19782ea1cf4a |
comparison
equal
deleted
inserted
replaced
319:b843eef4cc35 | 320:8f9937403749 |
---|---|
1 /* | |
2 * button.h -- GUI button | |
3 * | |
4 * Copyright (c) 2020-2021 David Demelier <markand@malikania.fr> | |
5 * | |
6 * Permission to use, copy, modify, and/or distribute this software for any | |
7 * purpose with or without fee is hereby granted, provided that the above | |
8 * copyright notice and this permission notice appear in all copies. | |
9 * | |
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | |
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
17 */ | |
18 | |
19 #ifndef MOLKO_UI_BUTTON_H | |
20 #define MOLKO_UI_BUTTON_H | |
21 | |
22 #include <core/core.h> | |
23 | |
24 union event; | |
25 | |
26 struct action; | |
27 struct theme; | |
28 | |
29 enum button_state { | |
30 BUTTON_STATE_NONE, | |
31 BUTTON_STATE_PRESSED, | |
32 BUTTON_STATE_ACTIVATED | |
33 }; | |
34 | |
35 struct button { | |
36 int x; | |
37 int y; | |
38 unsigned int w; | |
39 unsigned int h; | |
40 const char *text; | |
41 enum button_state state; | |
42 const struct theme *theme; | |
43 }; | |
44 | |
45 CORE_BEGIN_DECLS | |
46 | |
47 void | |
48 button_handle(struct button *, const union event *); | |
49 | |
50 void | |
51 button_reset(struct button *); | |
52 | |
53 void | |
54 button_draw_default(const struct theme *, const struct button *); | |
55 | |
56 void | |
57 button_draw(const struct button *); | |
58 | |
59 void | |
60 button_action(struct button *, struct action *); | |
61 | |
62 CORE_END_DECLS | |
63 | |
64 #endif /* !MOLKO_UI_BUTTON_H */ |