diff options
| author | jacqueline <me@jacqueline.id.au> | 2023-11-20 14:43:20 +1100 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2023-11-20 14:43:20 +1100 |
| commit | effac1917a615660bf76b35b3605ac2d3eeabd2f (patch) | |
| tree | e078b24b8405203fb36a6f83a7235b05f4bf32a0 /src/ui/include | |
| parent | b7f37f6426c78132d338b032962209bd93771039 (diff) | |
| download | tangara-fw-effac1917a615660bf76b35b3605ac2d3eeabd2f.tar.gz | |
Use C functions for the backstack, instead of a lua module
Working with the default group and root kinda sucks if you have to do it
from lua!
Diffstat (limited to 'src/ui/include')
| -rw-r--r-- | src/ui/include/screen_lua.hpp | 9 | ||||
| -rw-r--r-- | src/ui/include/ui_fsm.hpp | 3 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/ui/include/screen_lua.hpp b/src/ui/include/screen_lua.hpp index df83ea8b..ee9f6813 100644 --- a/src/ui/include/screen_lua.hpp +++ b/src/ui/include/screen_lua.hpp @@ -15,7 +15,14 @@ namespace screens { class Lua : public Screen { public: - explicit Lua(lua_State* l); + Lua(); + ~Lua(); + + auto SetObjRef(lua_State*) -> void; + + private: + lua_State* s_; + std::optional<int> obj_ref_; }; } // namespace screens diff --git a/src/ui/include/ui_fsm.hpp b/src/ui/include/ui_fsm.hpp index 39fae4b0..d3ea7eac 100644 --- a/src/ui/include/ui_fsm.hpp +++ b/src/ui/include/ui_fsm.hpp @@ -135,6 +135,9 @@ class Lua : public UiState { using UiState::react; private: + auto PushLuaScreen(lua_State*) -> int; + auto PopLuaScreen(lua_State*) -> int; + std::shared_ptr<lua::Property> battery_pct_; std::shared_ptr<lua::Property> battery_mv_; std::shared_ptr<lua::Property> battery_charging_; |
