Loading...
Searching...
No Matches
view_dispatcher.h
Go to the documentation of this file.
1
16#pragma once
17
18#include "view.h"
19#include "gui.h"
20#include "scene_manager.h"
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
32
33typedef struct ViewDispatcher ViewDispatcher;
34
36typedef bool (*ViewDispatcherCustomEventCallback)(void* context, uint32_t event);
37
39typedef bool (*ViewDispatcherNavigationEventCallback)(void* context);
40
42typedef void (*ViewDispatcherTickEventCallback)(void* context);
43
49
58
66void view_dispatcher_free(ViewDispatcher* view_dispatcher);
67
76FURI_DEPRECATED void view_dispatcher_enable_queue(ViewDispatcher* view_dispatcher);
77
83void view_dispatcher_send_custom_event(ViewDispatcher* view_dispatcher, uint32_t event);
84
93 ViewDispatcher* view_dispatcher,
95
104 ViewDispatcher* view_dispatcher,
106
118 ViewDispatcher* view_dispatcher,
120 uint32_t tick_period);
121
127void view_dispatcher_set_event_callback_context(ViewDispatcher* view_dispatcher, void* context);
128
142
150void view_dispatcher_run(ViewDispatcher* view_dispatcher);
151
156void view_dispatcher_stop(ViewDispatcher* view_dispatcher);
157
164void view_dispatcher_add_view(ViewDispatcher* view_dispatcher, uint32_t view_id, View* view);
165
171void view_dispatcher_remove_view(ViewDispatcher* view_dispatcher, uint32_t view_id);
172
180void view_dispatcher_switch_to_view(ViewDispatcher* view_dispatcher, uint32_t view_id);
181
186void view_dispatcher_send_to_front(ViewDispatcher* view_dispatcher);
187
192void view_dispatcher_send_to_back(ViewDispatcher* view_dispatcher);
193
201 ViewDispatcher* view_dispatcher,
202 Gui* gui,
203 ViewDispatcherType type);
204
205#ifdef __cplusplus
206}
207#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:143
void view_dispatcher_set_custom_event_callback(ViewDispatcher *view_dispatcher, ViewDispatcherCustomEventCallback callback)
Set custom event handler.
Definition view_dispatcher.c:82
ViewDispatcher * view_dispatcher_alloc_ex(FuriEventLoop *loop)
Allocate ViewDispatcher instance with an externally owned event loop.
Definition view_dispatcher.c:13
void view_dispatcher_send_to_front(ViewDispatcher *view_dispatcher)
Send ViewPort of this ViewDispatcher instance to front.
Definition view_dispatcher.c:206
void view_dispatcher_send_to_back(ViewDispatcher *view_dispatcher)
Send ViewPort of this ViewDispatcher instance to back.
Definition view_dispatcher.c:212
ViewDispatcherType
ViewDispatcher view_port placement.
Definition view_dispatcher.h:27
@ ViewDispatcherTypeWindow
Window layer: with status bar
Definition view_dispatcher.h:29
@ ViewDispatcherTypeFullscreen
Fullscreen layer: without status bar.
Definition view_dispatcher.h:30
@ ViewDispatcherTypeDesktop
Desktop layer: fullscreen with status bar on top of it.
Definition view_dispatcher.h:28
bool(* ViewDispatcherNavigationEventCallback)(void *context)
Prototype for navigation event callback.
Definition view_dispatcher.h:39
bool(* ViewDispatcherCustomEventCallback)(void *context, uint32_t event)
Prototype for custom event callback.
Definition view_dispatcher.h:36
ViewDispatcher * view_dispatcher_alloc(void)
Allocate ViewDispatcher instance.
Definition view_dispatcher.c:7
void view_dispatcher_set_event_callback_context(ViewDispatcher *view_dispatcher, void *context)
Set event callback context.
Definition view_dispatcher.c:99
void view_dispatcher_free(ViewDispatcher *view_dispatcher)
Free ViewDispatcher instance.
Definition view_dispatcher.c:48
void view_dispatcher_switch_to_view(ViewDispatcher *view_dispatcher, uint32_t view_id)
Switch to View.
Definition view_dispatcher.c:194
FURI_DEPRECATED void view_dispatcher_enable_queue(ViewDispatcher *view_dispatcher)
Enable queue support.
Definition view_dispatcher.c:71
void(* ViewDispatcherTickEventCallback)(void *context)
Prototype for tick event callback.
Definition view_dispatcher.h:42
void view_dispatcher_send_custom_event(ViewDispatcher *view_dispatcher, uint32_t event)
Send custom event.
Definition view_dispatcher.c:327
void view_dispatcher_set_tick_event_callback(ViewDispatcher *view_dispatcher, ViewDispatcherTickEventCallback callback, uint32_t tick_period)
Set tick event handler.
Definition view_dispatcher.c:89
void view_dispatcher_stop(ViewDispatcher *view_dispatcher)
Stop ViewDispatcher.
Definition view_dispatcher.c:138
FuriEventLoop * view_dispatcher_get_event_loop(ViewDispatcher *view_dispatcher)
Get event_loop instance.
Definition view_dispatcher.c:104
void view_dispatcher_attach_to_gui(ViewDispatcher *view_dispatcher, Gui *gui, ViewDispatcherType type)
Attach ViewDispatcher to GUI.
Definition view_dispatcher.c:218
void view_dispatcher_run(ViewDispatcher *view_dispatcher)
Run ViewDispatcher.
Definition view_dispatcher.c:110
void view_dispatcher_set_navigation_event_callback(ViewDispatcher *view_dispatcher, ViewDispatcherNavigationEventCallback callback)
Set navigation event handler.
Definition view_dispatcher.c:75
void view_dispatcher_remove_view(ViewDispatcher *view_dispatcher, uint32_t view_id)
Remove view from ViewDispatcher.
Definition view_dispatcher.c:164