Loading...
Searching...
No Matches
menu.h
Go to the documentation of this file.
1
6#pragma once
7
8#include <gui/view.h>
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
15typedef struct Menu Menu;
16
18typedef void (*MenuItemCallback)(void* context, uint32_t index);
19
24Menu* menu_alloc(void);
25
30void menu_free(Menu* menu);
31
38View* menu_get_view(Menu* menu);
39
49void menu_add_item(
50 Menu* menu,
51 const char* label,
52 const Icon* icon,
53 uint32_t index,
54 MenuItemCallback callback,
55 void* context);
56
62void menu_reset(Menu* menu);
63
69void menu_set_selected_item(Menu* menu, uint32_t index);
70
71#ifdef __cplusplus
72}
73#endif
void(* MenuItemCallback)(void *context, uint32_t index)
Menu Item Callback.
Definition menu.h:18
void menu_reset(Menu *menu)
Clean menu.
Definition menu.c:189
Menu * menu_alloc(void)
Menu allocation and initialization.
Definition menu.c:126
void menu_free(Menu *menu)
Free menu.
Definition menu.c:148
View * menu_get_view(Menu *menu)
Get Menu view.
Definition menu.c:158
void menu_add_item(Menu *menu, const char *label, const Icon *icon, uint32_t index, MenuItemCallback callback, void *context)
Add item to menu.
Definition menu.c:163
void menu_set_selected_item(Menu *menu, uint32_t index)
Set current menu item.
Definition menu.c:207
Definition icon_i.h:9
Definition menu.c:8
Definition view_i.h:16
GUI: View API.