mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-11 06:09:08 -07:00
* Core: event_flag, removing duplicate code * event_loop: add support furi_event_flags * Examples: add missing free in event loop examples * Furi: fix event flag * Sync api symbols * Unit_test: evet_loop_event_flags * Fix multiple waiting list elements handling * Unit_test: add event_loop_event_flag test * FURI: event_loop add restrictions * Fix multiple waiting lists items for good * Improve FuriEventLoop unit tests * Abolish callback return value * Remove return value from callback signature * Use bool level value instead of int32_t * Add unit tests for FuriStreamBuffer * Add unit tests for FuriSemaphore * Speed up test execution * Improve docs * Add a stub for furi os-level primitives * Add more checks for edge cases * Allow event loop notification from ISR * Bump api version Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com> Co-authored-by: Georgii Surkov <georgii.surkov@outlook.com> Co-authored-by: Georgii Surkov <37121527+gsurkov@users.noreply.github.com>
64 lines
1.8 KiB
C
64 lines
1.8 KiB
C
/**
|
|
* @file view_dispatcher_i.h
|
|
* GUI: ViewDispatcher API
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <m-dict.h>
|
|
|
|
#include "view_dispatcher.h"
|
|
#include "view_i.h"
|
|
#include "gui_i.h"
|
|
|
|
DICT_DEF2(ViewDict, uint32_t, M_DEFAULT_OPLIST, View*, M_PTR_OPLIST) // NOLINT
|
|
|
|
struct ViewDispatcher {
|
|
bool is_event_loop_owned;
|
|
FuriEventLoop* event_loop;
|
|
FuriMessageQueue* input_queue;
|
|
FuriMessageQueue* event_queue;
|
|
|
|
Gui* gui;
|
|
ViewPort* view_port;
|
|
ViewDict_t views;
|
|
|
|
View* current_view;
|
|
|
|
View* ongoing_input_view;
|
|
uint8_t ongoing_input;
|
|
|
|
ViewDispatcherCustomEventCallback custom_event_callback;
|
|
ViewDispatcherNavigationEventCallback navigation_event_callback;
|
|
ViewDispatcherTickEventCallback tick_event_callback;
|
|
uint32_t tick_period;
|
|
void* event_context;
|
|
};
|
|
|
|
/** ViewPort Draw Callback */
|
|
void view_dispatcher_draw_callback(Canvas* canvas, void* context);
|
|
|
|
/** ViewPort Input Callback */
|
|
void view_dispatcher_input_callback(InputEvent* event, void* context);
|
|
|
|
/** Input handler */
|
|
void view_dispatcher_handle_input(ViewDispatcher* view_dispatcher, InputEvent* event);
|
|
|
|
/** Tick handler */
|
|
void view_dispatcher_handle_tick_event(void* context);
|
|
|
|
/** Custom event handler */
|
|
void view_dispatcher_handle_custom_event(ViewDispatcher* view_dispatcher, uint32_t event);
|
|
|
|
/** Set current view, dispatches view enter and exit */
|
|
void view_dispatcher_set_current_view(ViewDispatcher* view_dispatcher, View* view);
|
|
|
|
/** ViewDispatcher update event */
|
|
void view_dispatcher_update(View* view, void* context);
|
|
|
|
/** ViewDispatcher run event loop event callback */
|
|
void view_dispatcher_run_event_callback(FuriEventLoopObject* object, void* context);
|
|
|
|
/** ViewDispatcher run event loop input callback */
|
|
void view_dispatcher_run_input_callback(FuriEventLoopObject* object, void* context);
|