reworked context state handling
This commit is contained in:
parent
5eb4437ac4
commit
7528ed007e
4 changed files with 28 additions and 30 deletions
|
|
@ -36,15 +36,16 @@ enum kubo_context_state {
|
|||
KUBO_CONTEXT_WALL_SELECT,
|
||||
};
|
||||
|
||||
static const char *kubo_context_labels[] = {"Normal", "Command", "Wall New",
|
||||
"Wall Select"};
|
||||
|
||||
static const Color kubo_context_colors[] = {BLACK, RED, GREEN, BLUE};
|
||||
struct kubo_context_state_data {
|
||||
enum kubo_context_state id;
|
||||
char *label;
|
||||
Color color;
|
||||
};
|
||||
|
||||
struct kubo_context {
|
||||
bool exit_pending;
|
||||
struct kubo_wall_arr walls;
|
||||
enum kubo_context_state state;
|
||||
struct kubo_context_state_data state;
|
||||
|
||||
// KUBO_CONTEXT_COMMAND
|
||||
struct kubo_char_arr command;
|
||||
|
|
@ -58,8 +59,6 @@ void kubo_context_cleanup(struct kubo_context *context);
|
|||
|
||||
void kubo_context_set_state(struct kubo_context *context,
|
||||
enum kubo_context_state state);
|
||||
const char *kubo_context_get_label(enum kubo_context_state state);
|
||||
Color kubo_context_get_color(enum kubo_context_state state);
|
||||
|
||||
void kubo_context_accept_cmd(struct kubo_context *context);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue