comparison libmlk-core/mlk/core/action-stack.h @ 431:8f59201dc76b

core: cleanup hierarchy
author David Demelier <markand@malikania.fr>
date Sat, 15 Oct 2022 20:23:14 +0200
parents src/libmlk-core/core/action-stack.h@e6d7ebad33cc
children 31c1bbc33813
comparison
equal deleted inserted replaced
430:1645433e008d 431:8f59201dc76b
1 /*
2 * action-stack.h -- convenient stack of actions
3 *
4 * Copyright (c) 2020-2022 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 MLK_CORE_ACTION_STACK_H
20 #define MLK_CORE_ACTION_STACK_H
21
22 #include <stddef.h>
23
24 #include "core.h"
25
26 union event;
27
28 struct action_stack {
29 struct action **actions;
30 size_t actionsz;
31 };
32
33 CORE_BEGIN_DECLS
34
35 void
36 action_stack_init(struct action_stack *, struct action **, size_t);
37
38 int
39 action_stack_add(struct action_stack *, struct action *);
40
41 void
42 action_stack_handle(struct action_stack *, const union event *);
43
44 int
45 action_stack_update(struct action_stack *, unsigned int);
46
47 void
48 action_stack_draw(const struct action_stack *);
49
50 int
51 action_stack_completed(const struct action_stack *);
52
53 void
54 action_stack_finish(struct action_stack *);
55
56 CORE_END_DECLS
57
58 #endif /* !MLK_CORE_ACTION_STACK_H */