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

GUI: ViewStack API. More...

#include <stdbool.h>
#include "view.h"

Go to the source code of this file.

Typedefs

typedef struct ViewStack ViewStack
 ViewStack, anonymous type.
 

Functions

ViewStackview_stack_alloc (void)
 Allocate and init ViewStack.
 
void view_stack_free (ViewStack *view_stack)
 Free ViewStack instance.
 
Viewview_stack_get_view (ViewStack *view_stack)
 Get View of ViewStack.
 
void view_stack_add_view (ViewStack *view_stack, View *view)
 Add View to ViewStack.
 
void view_stack_remove_view (ViewStack *view_stack, View *view)
 Remove any View in ViewStack.
 

Detailed Description

GUI: ViewStack API.

ViewStack accumulates several Views in one stack. Draw callbacks are called sequenctially starting from first added. Input callbacks are called in reverse order. Consumed input is not passed on underlying layers.

Warning
Views added to a ViewStack MUST NOT be in a ViewDispatcher or a ViewHolder at the same time.

Function Documentation

◆ view_stack_add_view()

void view_stack_add_view ( ViewStack * view_stack,
View * view )

Add View to ViewStack.

Adds View on top of ViewStack.

Parameters
view_stackinstance
viewview to add

◆ view_stack_alloc()

ViewStack * view_stack_alloc ( void )

Allocate and init ViewStack.

Returns
ViewStack instance

◆ view_stack_free()

void view_stack_free ( ViewStack * view_stack)

Free ViewStack instance.

Parameters
view_stackinstance

◆ view_stack_get_view()

View * view_stack_get_view ( ViewStack * view_stack)

Get View of ViewStack.

Should this View to any view manager such as ViewDispatcher or ViewHolder.

Parameters
view_stackinstance

◆ view_stack_remove_view()

void view_stack_remove_view ( ViewStack * view_stack,
View * view )

Remove any View in ViewStack.

If no View to remove found - ignore.

Parameters
view_stackinstance
viewview to remove