This commit is contained in:
Dylan Smith
2026-01-12 16:25:36 -05:00
parent 73005fc56b
commit 6cdbe8cb11
8 changed files with 128 additions and 26 deletions

View File

@@ -4,13 +4,16 @@
#include "stdint.h"
#include "stdbool.h"
typedef void (*menu_callback_t)(void *args);
typedef struct
{
uint8_t *title;
bool enabled; // not enabled = grayed out, unselectable
void *highlighted_callback_function;
void *selected_callback_function;
bool enabled; // not enabled = grayed out, unhighlightable
menu_callback_t highlighted_callback_function;
void *highlighted_callback_function_args;
menu_callback_t selected_callback_function;
void *selected_callback_function_args;
} graphical_menu_entry_t;
@@ -18,8 +21,12 @@ typedef struct _graphical_menu_t graphical_menu_t;
struct _graphical_menu_t {
graphical_menu_t *parent_menu;
uint8_t num_entries;
uint8_t highlighted_idx;
graphical_menu_entry_t *entries;
};
void draw_menu(const graphical_menu_t *const menu);
void select_menu_entry(const graphical_menu_t *const menu);
uint8_t get_selected_menu_entry_idx(void);
void set_selected_menu_entry_idx(const graphical_menu_t *const menu, uint8_t idx);
#endif