summaryrefslogtreecommitdiff
path: root/src/lua/stubs/backstack.lua
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2023-11-20 14:43:20 +1100
committerjacqueline <me@jacqueline.id.au>2023-11-20 14:43:20 +1100
commiteffac1917a615660bf76b35b3605ac2d3eeabd2f (patch)
treee078b24b8405203fb36a6f83a7235b05f4bf32a0 /src/lua/stubs/backstack.lua
parentb7f37f6426c78132d338b032962209bd93771039 (diff)
downloadtangara-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/lua/stubs/backstack.lua')
-rw-r--r--src/lua/stubs/backstack.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/lua/stubs/backstack.lua b/src/lua/stubs/backstack.lua
new file mode 100644
index 00000000..d4807d37
--- /dev/null
+++ b/src/lua/stubs/backstack.lua
@@ -0,0 +1,13 @@
+--- Module for adding and removing screens from the system's backstack.
+-- @module backstack
+
+local backstack = {}
+
+--- Pushes a new screen onto the backstack.
+-- @tparam function constructor Called to create the UI for the new screen. A new default root object and group will be set before calling this function. The function provided should return a table holding any bindings used by this screen; the returned value is retained so long as this screen is present in the backstack.
+function backstack.push(constructor) end
+
+--- Removes the currently active screen, and instead shows the screen underneath it on the backstack. Does nothing if this is the only existing screen.
+function backstack.pop() end
+
+return backstack