aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2025-04-12 15:42:51 +0530
committerAkshay Nair <phenax5@gmail.com>2025-04-12 15:43:50 +0530
commit39b3e8d1e2581a47dff1f09450383df0466dac94 (patch)
treeb1c24c659f9bdcb48275ad234c1de0047a991114 /src
parent80496879c86af00b74f82271282cca3efd99d0b3 (diff)
downloadnull-browser-39b3e8d1e2581a47dff1f09450383df0466dac94.tar.gz
null-browser-39b3e8d1e2581a47dff1f09450383df0466dac94.zip
Switch to using __internals for all api
Diffstat (limited to '')
-rw-r--r--src/LuaRuntime.cpp55
-rw-r--r--src/LuaRuntime.hpp2
2 files changed, 12 insertions, 45 deletions
diff --git a/src/LuaRuntime.cpp b/src/LuaRuntime.cpp
index 07d8193..5646d2b 100644
--- a/src/LuaRuntime.cpp
+++ b/src/LuaRuntime.cpp
@@ -129,54 +129,23 @@ void LuaRuntime::init_web_lib() {
// NOLINTBEGIN(modernize-avoid-c-arrays)
luaL_Reg internals[] = {
- {"register_event", &LuaRuntime::lua_event_register},
- {"set_config", &LuaRuntime::lua_config_set},
- {"get_config", &LuaRuntime::lua_config_get},
+ {"event_add_listener", &LuaRuntime::lua_event_register},
+ {"config_set", &LuaRuntime::lua_config_set},
+ {"config_get", &LuaRuntime::lua_config_get},
+ {"keymap_set", &LuaRuntime::lua_keymap_set},
+ {"view_close", &LuaRuntime::lua_view_close},
+ {"view_create", &LuaRuntime::lua_view_create},
+ {"view_current", &LuaRuntime::lua_view_current},
+ {"view_list", &LuaRuntime::lua_view_list},
+ {"view_select", &LuaRuntime::lua_view_select},
+ {"view_set_url", &LuaRuntime::lua_open_url},
+ {"history_back", &LuaRuntime::lua_history_back},
+ {"history_forward", &LuaRuntime::lua_history_forward},
{nullptr, nullptr},
};
luaL_newlib(state, internals);
lua_setglobal(state, internals_global_name);
- // web
- luaL_Reg web[] = {
- /// @deprecated
- {"open", &LuaRuntime::lua_open_url},
- {nullptr, nullptr},
- };
- luaL_newlib(state, web);
- lua_setglobal(state, web_global_name);
- lua_getglobal(state, web_global_name);
-
- // Keymap api (web.keymap)
- luaL_Reg webkeymap[] = {
- {"set", &LuaRuntime::lua_keymap_set},
- {nullptr, nullptr},
- };
- luaL_newlib(state, webkeymap);
- lua_setfield(state, -2, "keymap");
-
- // View actions (web.view)
- luaL_Reg webviews[] = {
- {"close", &LuaRuntime::lua_view_close},
- {"new", &LuaRuntime::lua_view_create},
- {"current", &LuaRuntime::lua_view_current},
- {"list", &LuaRuntime::lua_view_list},
- {"select", &LuaRuntime::lua_view_select},
- {"set_url", &LuaRuntime::lua_open_url},
- {nullptr, nullptr},
- };
- luaL_newlib(state, webviews);
- lua_setfield(state, -2, "view");
-
- // History navigation
- luaL_Reg webhistory[] = {
- {"back", &LuaRuntime::lua_history_back},
- {"forward", &LuaRuntime::lua_history_forward},
- {nullptr, nullptr},
- };
- luaL_newlib(state, webhistory);
- lua_setfield(state, -2, "history");
-
// NOLINTEND(modernize-avoid-c-arrays)
}
diff --git a/src/LuaRuntime.hpp b/src/LuaRuntime.hpp
index 670c0ae..4978c74 100644
--- a/src/LuaRuntime.hpp
+++ b/src/LuaRuntime.hpp
@@ -3,7 +3,6 @@
#include <QtCore>
#include <functional>
#include <lua.hpp>
-#include <string>
#include "AsyncEventLoop.hpp"
#include "lua.h"
@@ -25,7 +24,6 @@ class LuaRuntime : public QObject {
Q_OBJECT
const char *uv_global_name = "uv";
- const char *web_global_name = "web";
const char *internals_global_name = "__internals";
public: