BSB Developer Docs
Loading...
Searching...
No Matches
anim_menu.h File Reference

A widget that shows an advanced animated menu. More...

#include "anim_player.h"
#include <furi.h>

Go to the source code of this file.

Typedefs

typedef struct AnimMenu AnimMenu
 AnimMenu opaque structure.
 
typedef void(* AnimMenuCallback) (uint32_t index, void *context)
 AnimMenu item callback function type.
 

Functions

AnimMenu * anim_menu_alloc (Widget *parent)
 Create a new AnimMenu instance.
 
void anim_menu_free (AnimMenu *instance)
 Delete a AnimMenu instance.
 
Widget * anim_menu_get_base (AnimMenu *instance)
 Get a pointer to the base class instance.
 
AnimPlayer * anim_menu_get_anim_player (AnimMenu *instance)
 Get a pointer to the underlying AnimPlayer instance.
 
bool anim_menu_set_source (AnimMenu *instance, const char *file_path, size_t options)
 Set the animation file for the AnimMenu instance.
 
void anim_menu_set_callback (AnimMenu *instance, AnimMenuCallback callback, void *context)
 Set a function to be called when an item has been clicked.
 

Detailed Description

A widget that shows an advanced animated menu.

See assets/animations/README.md for .anim file requirements

Typedef Documentation

◆ AnimMenuCallback

typedef void(* AnimMenuCallback) (uint32_t index, void *context)

AnimMenu item callback function type.

Parameters
[in]indexindex of the clicked item
[in,out]contextpointer to a user-specific object

Function Documentation

◆ anim_menu_alloc()

AnimMenu * anim_menu_alloc ( Widget * parent)

Create a new AnimMenu instance.

Parameters
[in,out]parentpointer to the parent Widget instance
Returns
pointer to the newly created AnimMenu instance

◆ anim_menu_free()

void anim_menu_free ( AnimMenu * instance)

Delete a AnimMenu instance.

Parameters
[in,out]instancepointer to the AnimMenu instance to be deleted

◆ anim_menu_get_anim_player()

AnimPlayer * anim_menu_get_anim_player ( AnimMenu * instance)

Get a pointer to the underlying AnimPlayer instance.

The return value can be used in all AnimPlayer methods.

Parameters
[in,out]instancepointer to the AnimMenu instance to be queried
Returns
pointer to the AnimPlayer instance

◆ anim_menu_get_base()

Widget * anim_menu_get_base ( AnimMenu * instance)

Get a pointer to the base class instance.

The return value can be used in all Widget methods.

Parameters
[in,out]instancepointer to the AnimMenu instance to be queried
Returns
pointer to the base class instance

◆ anim_menu_set_callback()

void anim_menu_set_callback ( AnimMenu * instance,
AnimMenuCallback callback,
void * context )

Set a function to be called when an item has been clicked.

Parameters
[in,out]instancepointer to the AnimMenu instance to be modified
[in]callbackpointer to the function to be called when the item is clicked
[in,out]contextpointer to a user-specific object, will be passed to callback

◆ anim_menu_set_source()

bool anim_menu_set_source ( AnimMenu * instance,
const char * file_path,
size_t options )

Set the animation file for the AnimMenu instance.

Parameters
[in,out]instancepointer to the AnimMenu instance to be modified
[in]file_pathzero-terminated string containing the full path to animation file
[in]optionsnumber of menu options
Returns
true if the source was successfully set, false otherwise