refactor(api)!: one namespace per feature, screen split out
Namespaces were shared across features: `settings` was written by core, the
panel and touch, and `input` by touch and buttons. That made "does this
firmware implement the whole feature?" a question no pointer could answer.
Each namespace now belongs to exactly one feature or to core, so a feature is
a provider pointer and the compiler validates completeness:
gui, node -> screen, tree, under the screen feature
settings -> screen (rotation, theme), sys (timezone),
touch (calibration)
input -> touch, buttons
Runtime::open() no longer requires a GuiProvider; a firmware without one runs
with no screen/tree globals and reports sys.hasFeature("screen") false.
Rotation is one value again: GuiProvider::setRotation applies and persists, so
an app rotating the panel transiently puts the old value back itself.
This commit is contained in:
@@ -25,15 +25,14 @@ constexpr const char* MAIN_PATH = "/.lua/main.lua";
|
||||
// registered.
|
||||
struct Providers {
|
||||
LogProvider* log = nullptr;
|
||||
SettingsProvider* settings = nullptr;
|
||||
SysProvider* sys = nullptr;
|
||||
FsProvider* fs = nullptr;
|
||||
GuiProvider* gui = nullptr;
|
||||
HttpProvider* http = nullptr;
|
||||
TimerProvider* timer = nullptr;
|
||||
WifiProvider* wifi = nullptr;
|
||||
BleProvider* ble = nullptr;
|
||||
|
||||
GuiProvider* gui = nullptr;
|
||||
TouchProvider* touch = nullptr;
|
||||
ButtonsProvider* buttons = nullptr;
|
||||
};
|
||||
@@ -82,7 +81,6 @@ public:
|
||||
bool applyPendingNavigation();
|
||||
|
||||
LogProvider& log() const { return *providers_.log; }
|
||||
SettingsProvider& settings() const { return *providers_.settings; }
|
||||
SysProvider& sys() const { return *providers_.sys; }
|
||||
FsProvider& fs() const { return *providers_.fs; }
|
||||
GuiProvider& gui() const { return *providers_.gui; }
|
||||
|
||||
Reference in New Issue
Block a user