mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-12-24 19:53:08 +00:00
b9a766d909
* Added support for running applications from SD card (FAPs - Flipper Application Packages) * Added plugin_dist target for fbt to build FAPs * All apps of type FlipperAppType.EXTERNAL and FlipperAppType.PLUGIN are built as FAPs by default * Updated VSCode configuration for new fbt features - re-deploy stock configuration to use them * Added debugging support for FAPs with fbt debug & VSCode * Added public firmware API with automated versioning Co-authored-by: hedger <hedger@users.noreply.github.com> Co-authored-by: SG <who.just.the.doctor@gmail.com> Co-authored-by: あく <alleteam@gmail.com>
73 lines
1.3 KiB
C
73 lines
1.3 KiB
C
/**
|
|
* @file menu.h
|
|
* GUI: Menu view module API
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <gui/view.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/** Menu anonymous structure */
|
|
typedef struct Menu Menu;
|
|
|
|
/** Menu Item Callback */
|
|
typedef void (*MenuItemCallback)(void* context, uint32_t index);
|
|
|
|
/** Menu allocation and initialization
|
|
*
|
|
* @return Menu instance
|
|
*/
|
|
Menu* menu_alloc();
|
|
|
|
/** Free menu
|
|
*
|
|
* @param menu Menu instance
|
|
*/
|
|
void menu_free(Menu* menu);
|
|
|
|
/** Get Menu view
|
|
*
|
|
* @param menu Menu instance
|
|
*
|
|
* @return View instance
|
|
*/
|
|
View* menu_get_view(Menu* menu);
|
|
|
|
/** Add item to menu
|
|
*
|
|
* @param menu Menu instance
|
|
* @param label menu item string label
|
|
* @param icon IconAnimation instance
|
|
* @param index menu item index
|
|
* @param callback MenuItemCallback instance
|
|
* @param context pointer to context
|
|
*/
|
|
void menu_add_item(
|
|
Menu* menu,
|
|
const char* label,
|
|
const Icon* icon,
|
|
uint32_t index,
|
|
MenuItemCallback callback,
|
|
void* context);
|
|
|
|
/** Clean menu
|
|
* @note this function does not free menu instance
|
|
*
|
|
* @param menu Menu instance
|
|
*/
|
|
void menu_reset(Menu* menu);
|
|
|
|
/** Set current menu item
|
|
*
|
|
* @param menu Menu instance
|
|
* @param index The index
|
|
*/
|
|
void menu_set_selected_item(Menu* menu, uint32_t index);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|