From 7c8f8a92eaecc8ecc7f01c12e959da849f3905ee Mon Sep 17 00:00:00 2001 From: Will Eccles Date: Thu, 14 Oct 2021 14:34:22 -0400 Subject: [PATCH] output: add redraw function --- kiwmi/luak/kiwmi_output.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/kiwmi/luak/kiwmi_output.c b/kiwmi/luak/kiwmi_output.c index 8cd69ac..9bf3820 100644 --- a/kiwmi/luak/kiwmi_output.c +++ b/kiwmi/luak/kiwmi_output.c @@ -98,6 +98,23 @@ l_kiwmi_output_pos(lua_State *L) return 2; } +static int +l_kiwmi_output_redraw(lua_State *L) +{ + struct kiwmi_object *obj = + *(struct kiwmi_object **)luaL_checkudata(L, 1, "kiwmi_output"); + + if (!obj->valid) { + return luaL_error(L, "kiwmi_output no longer valid"); + } + + struct kiwmi_output *output = obj->object; + + output_damage(output); + + return 0; +} + static int l_kiwmi_output_size(lua_State *L) { @@ -151,6 +168,7 @@ static const luaL_Reg kiwmi_output_methods[] = { {"name", l_kiwmi_output_name}, {"on", luaK_callback_register_dispatch}, {"pos", l_kiwmi_output_pos}, + {"redraw", l_kiwmi_output_redraw}, {"size", l_kiwmi_output_size}, {"usable_area", l_kiwmi_output_usable_area}, {NULL, NULL},