43 lines
1.1 KiB
C++
43 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include "IDisplayDriver.h"
|
|
|
|
#include <Arduino.h>
|
|
|
|
class DisplayDriverGFX : public IDisplayDriver {
|
|
public:
|
|
// ── IDisplayDriver ──
|
|
void begin() override;
|
|
void setBacklight(bool on) override;
|
|
void render(const ScreenState& state) override;
|
|
|
|
TouchEvent readTouch() override;
|
|
HoldState updateHold(unsigned long holdMs) override;
|
|
void updateHint(int x, int y, bool active) override;
|
|
|
|
int width() override;
|
|
int height() override;
|
|
|
|
// Dashboard tile mapping
|
|
int dashboardTouch(int x, int y);
|
|
|
|
// ── Internal ──
|
|
static DisplayDriverGFX& instance();
|
|
|
|
private:
|
|
// Helper rendering functions
|
|
void drawBoot(const ScreenState& state);
|
|
void drawAlert(const ScreenState& state);
|
|
void drawDashboard(const ScreenState& state);
|
|
|
|
// Touch handling
|
|
TouchEvent _lastTouch = { false, false, 0, 0, -1, -1 };
|
|
unsigned long _pressStartMs = 0;
|
|
bool _isHolding = false;
|
|
|
|
// Screen tracking
|
|
ScreenID _lastScreen = ScreenID::BOOT;
|
|
BootStage _lastBootStage = BootStage::SPLASH;
|
|
bool _needsRedraw = true;
|
|
};
|