mirror of
https://github.com/vicliu624/trail-mate.git
synced 2026-07-16 16:49:12 +00:00
35 lines
849 B
C++
35 lines
849 B
C++
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include <stddef.h>
|
|
|
|
#include "lvgl.h"
|
|
|
|
namespace ui
|
|
{
|
|
namespace menu_runtime
|
|
{
|
|
|
|
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;
|
|
};
|
|
|
|
void init(lv_obj_t* screen_root, lv_obj_t* main_screen, lv_obj_t* menu_panel, const Hooks& hooks);
|
|
void showWatchFace();
|
|
void onWakeFromSleep();
|
|
|
|
} // namespace menu_runtime
|
|
} // namespace ui
|