mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-12-24 03:33: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>
78 lines
1.7 KiB
C
78 lines
1.7 KiB
C
/**
|
|
* @file submenu.h
|
|
* GUI: SubMenu view module API
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <gui/view.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/** Submenu anonymous structure */
|
|
typedef struct Submenu Submenu;
|
|
typedef void (*SubmenuItemCallback)(void* context, uint32_t index);
|
|
|
|
/** Allocate and initialize submenu
|
|
*
|
|
* This submenu is used to select one option
|
|
*
|
|
* @return Submenu instance
|
|
*/
|
|
Submenu* submenu_alloc();
|
|
|
|
/** Deinitialize and free submenu
|
|
*
|
|
* @param submenu Submenu instance
|
|
*/
|
|
void submenu_free(Submenu* submenu);
|
|
|
|
/** Get submenu view
|
|
*
|
|
* @param submenu Submenu instance
|
|
*
|
|
* @return View instance that can be used for embedding
|
|
*/
|
|
View* submenu_get_view(Submenu* submenu);
|
|
|
|
/** Add item to submenu
|
|
*
|
|
* @param submenu Submenu instance
|
|
* @param label menu item label
|
|
* @param index menu item index, used for callback, may be
|
|
* the same with other items
|
|
* @param callback menu item callback
|
|
* @param callback_context menu item callback context
|
|
*/
|
|
void submenu_add_item(
|
|
Submenu* submenu,
|
|
const char* label,
|
|
uint32_t index,
|
|
SubmenuItemCallback callback,
|
|
void* callback_context);
|
|
|
|
/** Remove all items from submenu
|
|
*
|
|
* @param submenu Submenu instance
|
|
*/
|
|
void submenu_reset(Submenu* submenu);
|
|
|
|
/** Set submenu item selector
|
|
*
|
|
* @param submenu Submenu instance
|
|
* @param index The index
|
|
*/
|
|
void submenu_set_selected_item(Submenu* submenu, uint32_t index);
|
|
|
|
/** Set optional header for submenu
|
|
*
|
|
* @param submenu Submenu instance
|
|
* @param header header to set
|
|
*/
|
|
void submenu_set_header(Submenu* submenu, const char* header);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|