Flipper Zero Firmware
Loading...
Searching...
No Matches
view_holder.h File Reference

GUI: ViewHolder API. More...

#include <gui/view.h>
#include <gui/gui.h>

Go to the source code of this file.

Typedefs

typedef struct ViewHolder ViewHolder
 
typedef void(* FreeCallback) (void *free_context)
 Free callback type.
 
typedef void(* BackCallback) (void *back_context)
 Back callback type.
 

Functions

ViewHolderview_holder_alloc (void)
 Allocate ViewHolder.
 
void view_holder_free (ViewHolder *view_holder)
 Free ViewHolder and call Free callback.
 
void view_holder_set_view (ViewHolder *view_holder, View *view)
 Set view for ViewHolder.
 
void view_holder_set_free_callback (ViewHolder *view_holder, FreeCallback free_callback, void *free_context)
 Set Free callback.
 
void * view_holder_get_free_context (ViewHolder *view_holder)
 Free callback context getter.
 
void view_holder_set_back_callback (ViewHolder *view_holder, BackCallback back_callback, void *back_context)
 
void view_holder_attach_to_gui (ViewHolder *view_holder, Gui *gui)
 Attach ViewHolder to GUI.
 
void view_holder_start (ViewHolder *view_holder)
 Enable view processing.
 
void view_holder_stop (ViewHolder *view_holder)
 Disable view processing.
 
void view_holder_update (View *view, void *context)
 View Update Handler.
 

Detailed Description

GUI: ViewHolder API.

Warning
View added to a ViewHolder MUST NOT be in a ViewStack at the same time.

Typedef Documentation

◆ BackCallback

typedef void(* BackCallback) (void *back_context)

Back callback type.

Warning
comes from GUI thread

Function Documentation

◆ view_holder_alloc()

ViewHolder * view_holder_alloc ( void )

Allocate ViewHolder.

Returns
pointer to ViewHolder instance

◆ view_holder_attach_to_gui()

void view_holder_attach_to_gui ( ViewHolder * view_holder,
Gui * gui )

Attach ViewHolder to GUI.

Parameters
view_holderViewHolder instance
guiGUI instance to attach to

◆ view_holder_free()

void view_holder_free ( ViewHolder * view_holder)

Free ViewHolder and call Free callback.

Parameters
view_holderpointer to ViewHolder

◆ view_holder_get_free_context()

void * view_holder_get_free_context ( ViewHolder * view_holder)

Free callback context getter.

Useful if your Free callback is a module destructor, so you can get an instance of the module using this method.

Parameters
view_holderViewHolder instance
Returns
void* free callback context

◆ view_holder_set_free_callback()

void view_holder_set_free_callback ( ViewHolder * view_holder,
FreeCallback free_callback,
void * free_context )

Set Free callback.

Parameters
view_holderViewHolder instance
free_callbackcallback pointer
free_contextcallback context

◆ view_holder_set_view()

void view_holder_set_view ( ViewHolder * view_holder,
View * view )

Set view for ViewHolder.

Parameters
view_holderViewHolder instance
viewView instance

◆ view_holder_start()

void view_holder_start ( ViewHolder * view_holder)

Enable view processing.

Parameters
view_holder

◆ view_holder_stop()

void view_holder_stop ( ViewHolder * view_holder)

Disable view processing.

Parameters
view_holder

◆ view_holder_update()

void view_holder_update ( View * view,
void * context )

View Update Handler.

Parameters
viewView Instance
contextViewHolder instance