Flipper Zero Firmware
Loading...
Searching...
No Matches
view_dispatcher.h
Go to the documentation of this file.
1
8#pragma once
9
10#include "view.h"
11#include "gui.h"
12#include "scene_manager.h"
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
24
25typedef struct ViewDispatcher ViewDispatcher;
26
28typedef bool (*ViewDispatcherCustomEventCallback)(void* context, uint32_t event);
29
31typedef bool (*ViewDispatcherNavigationEventCallback)(void* context);
32
34typedef void (*ViewDispatcherTickEventCallback)(void* context);
35
41
46void view_dispatcher_free(ViewDispatcher* view_dispatcher);
47
55void view_dispatcher_enable_queue(ViewDispatcher* view_dispatcher);
56
62void view_dispatcher_send_custom_event(ViewDispatcher* view_dispatcher, uint32_t event);
63
72 ViewDispatcher* view_dispatcher,
74
83 ViewDispatcher* view_dispatcher,
85
93 ViewDispatcher* view_dispatcher,
95 uint32_t tick_period);
96
102void view_dispatcher_set_event_callback_context(ViewDispatcher* view_dispatcher, void* context);
103
117
124void view_dispatcher_run(ViewDispatcher* view_dispatcher);
125
132void view_dispatcher_stop(ViewDispatcher* view_dispatcher);
133
140void view_dispatcher_add_view(ViewDispatcher* view_dispatcher, uint32_t view_id, View* view);
141
147void view_dispatcher_remove_view(ViewDispatcher* view_dispatcher, uint32_t view_id);
148
156void view_dispatcher_switch_to_view(ViewDispatcher* view_dispatcher, uint32_t view_id);
157
162void view_dispatcher_send_to_front(ViewDispatcher* view_dispatcher);
163
168void view_dispatcher_send_to_back(ViewDispatcher* view_dispatcher);
169
177 ViewDispatcher* view_dispatcher,
178 Gui* gui,
179 ViewDispatcherType type);
180
181#ifdef __cplusplus
182}
183#endif
GUI: main API.
GUI: SceneManager API.
Definition event_loop_i.h:78
Gui structure.
Definition gui_i.h:47
Definition view_dispatcher_i.h:16
Definition view_i.h:16
GUI: View API.
void view_dispatcher_add_view(ViewDispatcher *view_dispatcher, uint32_t view_id, View *view)
Add view to ViewDispatcher.
Definition view_dispatcher.c:141
void view_dispatcher_set_custom_event_callback(ViewDispatcher *view_dispatcher, ViewDispatcherCustomEventCallback callback)
Set custom event handler.
Definition view_dispatcher.c:79
void view_dispatcher_send_to_front(ViewDispatcher *view_dispatcher)
Send ViewPort of this ViewDispatcher instance to front.
Definition view_dispatcher.c:204
void view_dispatcher_send_to_back(ViewDispatcher *view_dispatcher)
Send ViewPort of this ViewDispatcher instance to back.
Definition view_dispatcher.c:210
ViewDispatcherType
ViewDispatcher view_port placement.
Definition view_dispatcher.h:19
@ ViewDispatcherTypeWindow
Window layer: with status bar
Definition view_dispatcher.h:21
@ ViewDispatcherTypeFullscreen
Fullscreen layer: without status bar.
Definition view_dispatcher.h:22
@ ViewDispatcherTypeDesktop
Desktop layer: fullscreen with status bar on top of it.
Definition view_dispatcher.h:20
bool(* ViewDispatcherNavigationEventCallback)(void *context)
Prototype for navigation event callback.
Definition view_dispatcher.h:31
bool(* ViewDispatcherCustomEventCallback)(void *context, uint32_t event)
Prototype for custom event callback.
Definition view_dispatcher.h:28
ViewDispatcher * view_dispatcher_alloc(void)
Allocate ViewDispatcher instance.
Definition view_dispatcher.c:5
void view_dispatcher_set_event_callback_context(ViewDispatcher *view_dispatcher, void *context)
Set event callback context.
Definition view_dispatcher.c:95
void view_dispatcher_free(ViewDispatcher *view_dispatcher)
Free ViewDispatcher instance.
Definition view_dispatcher.c:20
void view_dispatcher_switch_to_view(ViewDispatcher *view_dispatcher, uint32_t view_id)
Switch to View.
Definition view_dispatcher.c:192
void view_dispatcher_enable_queue(ViewDispatcher *view_dispatcher)
Enable queue support.
Definition view_dispatcher.c:49
void(* ViewDispatcherTickEventCallback)(void *context)
Prototype for tick event callback.
Definition view_dispatcher.h:34
void view_dispatcher_send_custom_event(ViewDispatcher *view_dispatcher, uint32_t event)
Send custom event.
Definition view_dispatcher.c:329
void view_dispatcher_set_tick_event_callback(ViewDispatcher *view_dispatcher, ViewDispatcherTickEventCallback callback, uint32_t tick_period)
Set tick event handler.
Definition view_dispatcher.c:86
void view_dispatcher_stop(ViewDispatcher *view_dispatcher)
Stop ViewDispatcher.
Definition view_dispatcher.c:135
FuriEventLoop * view_dispatcher_get_event_loop(ViewDispatcher *view_dispatcher)
Get event_loop instance.
Definition view_dispatcher.c:100
void view_dispatcher_attach_to_gui(ViewDispatcher *view_dispatcher, Gui *gui, ViewDispatcherType type)
Attach ViewDispatcher to GUI.
Definition view_dispatcher.c:216
void view_dispatcher_run(ViewDispatcher *view_dispatcher)
Run ViewDispatcher.
Definition view_dispatcher.c:107
void view_dispatcher_set_navigation_event_callback(ViewDispatcher *view_dispatcher, ViewDispatcherNavigationEventCallback callback)
Set navigation event handler.
Definition view_dispatcher.c:72
void view_dispatcher_remove_view(ViewDispatcher *view_dispatcher, uint32_t view_id)
Remove view from ViewDispatcher.
Definition view_dispatcher.c:162