diff options
| author | cooljqln <cooljqln@noreply.codeberg.org> | 2024-05-03 04:48:17 +0000 |
|---|---|---|
| committer | cooljqln <cooljqln@noreply.codeberg.org> | 2024-05-03 04:48:17 +0000 |
| commit | 3ceb8025ee4330c177101ed30ec17dfb0002f41e (patch) | |
| tree | 58350210f15df7d00d967cac6f30eeceeb031a3c /src/lua/include/bridge.hpp | |
| parent | 964da15a0b84f8e5f00e8abac2f7dfda0bf60488 (diff) | |
| parent | 9fafd797a5504f458b5fcae4a1d28a68da936315 (diff) | |
| download | tangara-fw-3ceb8025ee4330c177101ed30ec17dfb0002f41e.tar.gz | |
Merge pull request 'Break dependency cycles with our components by merging co-dependent components together' (#68) from jqln/component-merge into main
Reviewed-on: https://codeberg.org/cool-tech-zone/tangara-fw/pulls/68
Diffstat (limited to 'src/lua/include/bridge.hpp')
| -rw-r--r-- | src/lua/include/bridge.hpp | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/src/lua/include/bridge.hpp b/src/lua/include/bridge.hpp deleted file mode 100644 index 64f14e0e..00000000 --- a/src/lua/include/bridge.hpp +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2023 jacqueline <me@jacqueline.id.au> - * - * SPDX-License-Identifier: GPL-3.0-only - */ - -#pragma once - -#include <memory> -#include <string> - -#include "lua.hpp" -#include "lvgl.h" -#include "property.hpp" -#include "service_locator.hpp" - -namespace lua { - -/* - * Responsible for adding C/C++ module bindings to Lua threads. This class - * keeps no thread-specific internal state, and instead uses the LUA_REGISTRY - * table of its host threads to store data. - */ -class Bridge { - public: - /* - * Utility for retrieving the Bridge from a Lua thread in which the Bridge's - * bindings have been installed. Use by Lua's C callbacks to access the rest - * of the system. - */ - static auto Get(lua_State* state) -> Bridge*; - - Bridge(system_fsm::ServiceLocator& s); - - system_fsm::ServiceLocator& services() { return services_; } - - auto installBaseModules(lua_State* L) -> void; - auto installLvgl(lua_State* L) -> void; - auto installPropertyModule( - lua_State* L, - const std::string&, - std::vector< - std::pair<std::string, std::variant<LuaFunction, Property*>>>&) - -> void; - - Bridge(const Bridge&) = delete; - Bridge& operator=(const Bridge&) = delete; - - private: - system_fsm::ServiceLocator& services_; - PropertyBindings bindings_; -}; - -} // namespace lua |
