40 lines
1.0 KiB
C++
40 lines
1.0 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;
|
|
|
|
// ── 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, 0, 0 };
|
|
unsigned long _pressStartMs = 0;
|
|
bool _isHolding = false;
|
|
|
|
// Screen tracking
|
|
ScreenID _lastScreen = ScreenID::BOOT;
|
|
BootStage _lastBootStage = BootStage::SPLASH;
|
|
bool _needsRedraw = true;
|
|
};
|