diff options
| author | Akshay Nair <phenax5@gmail.com> | 2025-04-12 15:42:51 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2025-04-12 15:43:50 +0530 |
| commit | 39b3e8d1e2581a47dff1f09450383df0466dac94 (patch) | |
| tree | b1c24c659f9bdcb48275ad234c1de0047a991114 /src/LuaRuntime.cpp | |
| parent | 80496879c86af00b74f82271282cca3efd99d0b3 (diff) | |
| download | null-browser-39b3e8d1e2581a47dff1f09450383df0466dac94.tar.gz null-browser-39b3e8d1e2581a47dff1f09450383df0466dac94.zip | |
Switch to using __internals for all api
Diffstat (limited to 'src/LuaRuntime.cpp')
| -rw-r--r-- | src/LuaRuntime.cpp | 55 |
1 files changed, 12 insertions, 43 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) } |
