aboutsummaryrefslogtreecommitdiff
path: root/src/LuaRuntimeApi.hpp
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2025-08-08 10:15:28 +0530
committerAkshay Nair <phenax5@gmail.com>2025-08-08 10:15:28 +0530
commit5e3f233c239de63e8ac3549a32b0e6343b32fc7a (patch)
treeb0e0eedf47632c5765bdd554a5fdd7a11e6838a5 /src/LuaRuntimeApi.hpp
parent4ecfe688a016232656b383f82da4d6e2ba75a328 (diff)
downloadnull-browser-5e3f233c239de63e8ac3549a32b0e6343b32fc7a.tar.gz
null-browser-5e3f233c239de63e8ac3549a32b0e6343b32fc7a.zip
Add decorations.*.set_size api
Diffstat (limited to 'src/LuaRuntimeApi.hpp')
-rw-r--r--src/LuaRuntimeApi.hpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/LuaRuntimeApi.hpp b/src/LuaRuntimeApi.hpp
index d6a78d5..239276e 100644
--- a/src/LuaRuntimeApi.hpp
+++ b/src/LuaRuntimeApi.hpp
@@ -339,6 +339,18 @@ int lua_api_decorations_set_enabled(lua_State *state) {
return 1;
}
+int lua_api_decorations_set_size(lua_State *state) {
+ auto type = (DecorationType)lua_tointeger(state, 1);
+ uint16_t size = lua_tointeger(state, 2);
+ qDebug() << "::api" << type << size;
+ std::optional<WindowId> win_id =
+ lua_isnoneornil(state, 3) ? std::nullopt : std::make_optional(lua_tointeger(state, 3));
+ auto &runtime = LuaRuntime::instance();
+ emit runtime.decoration_set_size(type, size, win_id);
+ lua_pushnil(state);
+ return 1;
+}
+
int lua_api_decorations_get_enabled(lua_State *state) {
auto type = (DecorationType)lua_tointeger(state, 1);
WindowId win_id = lua_isnoneornil(state, 2) ? lua_tointeger(state, 2) : 0;
@@ -429,6 +441,7 @@ static luaL_Reg internals_api[] = {
luaL_Reg{"search_next", &lua_api_search_next},
luaL_Reg{"decorations_set_enabled", &lua_api_decorations_set_enabled},
luaL_Reg{"decorations_get_enabled", &lua_api_decorations_get_enabled},
+ luaL_Reg{"decorations_set_size", &lua_api_decorations_set_size},
luaL_Reg{"decorations_get_view", &lua_api_decorations_get_view},
luaL_Reg{"schedule", &lua_api_schedule_fn},
luaL_Reg{nullptr, nullptr},