mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-26 05:54:46 -07:00
C++ apps: templated scene controller (#517)
* C++ apps: templated scene controller * templated app: fix type names * templated app: text store component * Applications: add "Templated Scene" application * templated app: refractoring * Gui module byte input: fix docs * templated app: new byte input scene * templated app: dialog ex view module * templated app: popup view module * templated app: dialog-ex view module, fix docs * templated app: text input view module * Gui module text input: fix docs * Furi: duplicated include * templated app: record holder (controller) class * templated app: view modules can now be accessed via cast * templated app: remove unused includes * templated app: fix return code
This commit is contained in:
47
applications/scened-app-example/scened-app.h
Normal file
47
applications/scened-app-example/scened-app.h
Normal file
@@ -0,0 +1,47 @@
|
||||
#pragma once
|
||||
#include <furi.h>
|
||||
#include <api-hal.h>
|
||||
|
||||
#include <generic-scene.hpp>
|
||||
#include <scene-controller.hpp>
|
||||
#include <view-controller.hpp>
|
||||
#include <record-controller.hpp>
|
||||
#include <text-store.h>
|
||||
|
||||
#include <view-modules/submenu-vm.h>
|
||||
#include <view-modules/byte-input-vm.h>
|
||||
|
||||
#include <notification/notification-messages.h>
|
||||
|
||||
class ScenedApp {
|
||||
public:
|
||||
enum class EventType : uint8_t {
|
||||
GENERIC_EVENT_ENUM_VALUES,
|
||||
MenuSelected,
|
||||
ByteEditResult,
|
||||
};
|
||||
|
||||
enum class SceneType : uint8_t {
|
||||
GENERIC_SCENE_ENUM_VALUES,
|
||||
ByteInputScene,
|
||||
};
|
||||
|
||||
class Event {
|
||||
public:
|
||||
union {
|
||||
int32_t menu_index;
|
||||
} payload;
|
||||
|
||||
EventType type;
|
||||
};
|
||||
|
||||
SceneController<GenericScene<ScenedApp>, ScenedApp> scene_controller;
|
||||
TextStore text_store;
|
||||
ViewController<ScenedApp, SubmenuVM, ByteInputVM> view_controller;
|
||||
RecordController<NotificationApp> notification;
|
||||
|
||||
~ScenedApp();
|
||||
ScenedApp();
|
||||
|
||||
void run();
|
||||
};
|
||||
Reference in New Issue
Block a user