Flipper Zero Firmware
Loading...
Searching...
No Matches
button_menu.h
Go to the documentation of this file.
1
6
#pragma once
7
8
#include <stdint.h>
9
#include <
gui/view.h
>
10
11
#ifdef __cplusplus
12
extern
"C"
{
13
#endif
14
16
typedef
struct
ButtonMenu
ButtonMenu
;
17
19
typedef
struct
ButtonMenuItem
ButtonMenuItem
;
20
22
typedef
void (*
ButtonMenuItemCallback
)(
void
* context, int32_t index,
InputType
type);
23
25
typedef
enum
{
26
ButtonMenuItemTypeCommon,
27
ButtonMenuItemTypeControl,
28
}
ButtonMenuItemType
;
29
36
View
*
button_menu_get_view
(
ButtonMenu
* button_menu);
37
42
void
button_menu_reset
(
ButtonMenu
* button_menu);
43
58
ButtonMenuItem
*
button_menu_add_item
(
59
ButtonMenu
* button_menu,
60
const
char
* label,
61
int32_t index,
62
ButtonMenuItemCallback
callback,
63
ButtonMenuItemType
type,
64
void
* callback_context);
65
70
ButtonMenu
*
button_menu_alloc
(
void
);
71
76
void
button_menu_free
(
ButtonMenu
* button_menu);
77
83
void
button_menu_set_header
(
ButtonMenu
* button_menu,
const
char
* header);
84
90
void
button_menu_set_selected_item
(
ButtonMenu
* button_menu, uint32_t index);
91
92
#ifdef __cplusplus
93
}
94
#endif
button_menu_add_item
ButtonMenuItem * button_menu_add_item(ButtonMenu *button_menu, const char *label, int32_t index, ButtonMenuItemCallback callback, ButtonMenuItemType type, void *callback_context)
Add item to button menu instance.
Definition
button_menu.c:327
ButtonMenuItemCallback
void(* ButtonMenuItemCallback)(void *context, int32_t index, InputType type)
Callback for any button menu actions.
Definition
button_menu.h:22
button_menu_free
void button_menu_free(ButtonMenu *button_menu)
Free ButtonMenu element.
Definition
button_menu.c:377
button_menu_set_selected_item
void button_menu_set_selected_item(ButtonMenu *button_menu, uint32_t index)
Set selected item.
Definition
button_menu.c:389
button_menu_alloc
ButtonMenu * button_menu_alloc(void)
Allocate and initialize new instance of ButtonMenu model.
Definition
button_menu.c:354
button_menu_reset
void button_menu_reset(ButtonMenu *button_menu)
Clean button menu.
Definition
button_menu.c:307
button_menu_get_view
View * button_menu_get_view(ButtonMenu *button_menu)
Get button menu view.
Definition
button_menu.c:302
ButtonMenuItemType
ButtonMenuItemType
Type of button.
Definition
button_menu.h:25
button_menu_set_header
void button_menu_set_header(ButtonMenu *button_menu, const char *header)
Set ButtonMenu header on top of canvas.
Definition
button_menu.c:321
InputType
InputType
Input Types Some of them are physical events and some logical.
Definition
input.h:21
ButtonMenu
Definition
button_menu.c:29
ButtonMenuItem
Definition
button_menu.c:19
View
Definition
view_i.h:16
view.h
GUI: View API.
applications
services
gui
modules
button_menu.h
Generated by
1.12.0