38 lines
961 B
C++
38 lines
961 B
C++
#pragma once
|
|
|
|
#include <Arduino.h>
|
|
#include "IDisplayDriver.h"
|
|
|
|
class DisplayDriverGFX : public IDisplayDriver {
|
|
public:
|
|
// ── IDisplayDriver ──
|
|
void begin() override;
|
|
void setBacklight(bool on) override;
|
|
void render(const ScreenState& state) override;
|
|
|
|
TouchEvent readTouch() override;
|
|
int dashboardTouch(int x, int y) override;
|
|
HoldState updateHold(unsigned long holdMs) override;
|
|
void updateHint(int x, int y) override;
|
|
|
|
int width() override;
|
|
int height() override;
|
|
|
|
// ── Internal ──
|
|
static DisplayDriverGFX& instance();
|
|
|
|
private:
|
|
// Helper rendering functions
|
|
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;
|
|
bool _needsRedraw = true;
|
|
};
|