mirror of
https://github.com/vicliu624/trail-mate.git
synced 2026-11-11 14:47:39 +00:00
Compose the CM0 fullscreen application and standard Debian package, align the Cardputer Zero shell, and share protocol, configuration, audio and storage services with embedded targets through existing platform seams. Add the paginated on-device TMAP creator using Center's published producer, private workspace recovery and direct keyboard shortcuts. Preserve unfinished management work behind its existing opt-in capability. Include native, ARM and shared-core regression fixtures, integration records, packaging helpers and dependency/license updates. Keep local build trees, device credentials, produced packages and validation logs outside version control. Validation before integration: ESP stack hygiene, Reticulum scope guard, staged whitespace checks and GitNexus scope audit. Prior device/build evidence and remaining hardware/package boundaries are recorded in the acceptance documents.
49 lines
1.2 KiB
C++
49 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include <stddef.h>
|
|
|
|
#include "lvgl.h"
|
|
|
|
namespace ui
|
|
{
|
|
namespace menu_runtime
|
|
{
|
|
|
|
enum class Scene : uint8_t
|
|
{
|
|
Menu = 0,
|
|
App,
|
|
WatchFace,
|
|
Sleeping,
|
|
};
|
|
|
|
struct Hooks
|
|
{
|
|
struct WatchFaceHooks
|
|
{
|
|
void (*create)(lv_obj_t* parent) = nullptr;
|
|
void (*set_time)(int hour, int minute, int month, int day, const char* weekday, int battery_percent) = nullptr;
|
|
void (*set_node_id)(uint32_t node_id) = nullptr;
|
|
void (*show)(bool show) = nullptr;
|
|
bool (*is_ready)() = nullptr;
|
|
void (*set_unlock_cb)(void (*cb)(void)) = nullptr;
|
|
} watch_face{};
|
|
|
|
bool (*format_time)(char* out, size_t out_len) = nullptr;
|
|
void (*show_main_menu)() = nullptr;
|
|
// Compositions with cached asynchronous status may request faster refresh.
|
|
uint32_t status_refresh_interval_ms = 60000;
|
|
};
|
|
|
|
void init(lv_obj_t* screen_root, lv_obj_t* main_screen, lv_obj_t* menu_panel, const Hooks& hooks);
|
|
void showWatchFace();
|
|
void setMenuActive(bool active);
|
|
bool handleWalkieKey(char key, int state);
|
|
bool handleShortcutKey(char key, int state);
|
|
void setScene(Scene scene);
|
|
Scene currentScene();
|
|
|
|
} // namespace menu_runtime
|
|
} // namespace ui
|