Flipper Zero Firmware
Loading...
Searching...
No Matches
view_dispatcher_i.h
Go to the documentation of this file.
1
6#pragma once
7
8#include <m-dict.h>
9
10#include "view_dispatcher.h"
11#include "view_i.h"
12#include "gui_i.h"
13
14DICT_DEF2(ViewDict, uint32_t, M_DEFAULT_OPLIST, View*, M_PTR_OPLIST) // NOLINT
15
17 FuriEventLoop* event_loop;
18 FuriMessageQueue* input_queue;
19 FuriMessageQueue* event_queue;
20
21 Gui* gui;
22 ViewPort* view_port;
23 ViewDict_t views;
24
25 View* current_view;
26
27 View* ongoing_input_view;
28 uint8_t ongoing_input;
29
30 ViewDispatcherCustomEventCallback custom_event_callback;
31 ViewDispatcherNavigationEventCallback navigation_event_callback;
32 ViewDispatcherTickEventCallback tick_event_callback;
33 uint32_t tick_period;
34 void* event_context;
35};
36
38void view_dispatcher_draw_callback(Canvas* canvas, void* context);
39
41void view_dispatcher_input_callback(InputEvent* event, void* context);
42
44void view_dispatcher_handle_input(ViewDispatcher* view_dispatcher, InputEvent* event);
45
47void view_dispatcher_handle_tick_event(void* context);
48
50void view_dispatcher_handle_custom_event(ViewDispatcher* view_dispatcher, uint32_t event);
51
53void view_dispatcher_set_current_view(ViewDispatcher* view_dispatcher, View* view);
54
56void view_dispatcher_update(View* view, void* context);
57
60
GUI: main API internals.
Canvas structure.
Definition canvas_i.h:40
Definition event_loop_i.h:78
Definition message_queue.c:14
Gui structure.
Definition gui_i.h:47
Input Event, dispatches with FuriPubSub.
Definition input.h:31
Definition view_dispatcher_i.h:16
Definition view_i.h:16
Definition view_port_i.h:11
GUI: ViewDispatcher API.
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
void(* ViewDispatcherTickEventCallback)(void *context)
Prototype for tick event callback.
Definition view_dispatcher.h:34
void view_dispatcher_input_callback(InputEvent *event, void *context)
ViewPort Input Callback.
Definition view_dispatcher.c:243
bool view_dispatcher_run_input_callback(FuriMessageQueue *queue, void *context)
ViewDispatcher run event loop input callback.
Definition view_dispatcher.c:396
void view_dispatcher_handle_tick_event(void *context)
Tick handler.
Definition view_dispatcher.c:311
void view_dispatcher_handle_input(ViewDispatcher *view_dispatcher, InputEvent *event)
Input handler.
Definition view_dispatcher.c:254
void view_dispatcher_handle_custom_event(ViewDispatcher *view_dispatcher, uint32_t event)
Custom event handler.
Definition view_dispatcher.c:318
void view_dispatcher_draw_callback(Canvas *canvas, void *context)
ViewPort Draw Callback.
Definition view_dispatcher.c:236
bool view_dispatcher_run_event_callback(FuriMessageQueue *queue, void *context)
ViewDispatcher run event loop event callback.
Definition view_dispatcher.c:384
void view_dispatcher_update(View *view, void *context)
ViewDispatcher update event.
Definition view_dispatcher.c:373
void view_dispatcher_set_current_view(ViewDispatcher *view_dispatcher, View *view)
Set current view, dispatches view enter and exit.
Definition view_dispatcher.c:345
GUI: internal View API.