43 lines
1.2 KiB
C++
43 lines
1.2 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 tiles - library handles grid math, we just draw
|
|
void drawTileAt(int x, int y, int w, int h, const char* label, uint16_t bgColor) 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;
|
|
};
|