gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
path: root/window-refs.c
diff options
context:
space:
mode:
Diffstat (limited to 'window-refs.c')
-rw-r--r--window-refs.c 19
1 files changed, 18 insertions, 1 deletions
diff --git a/window-refs.c b/window-refs.c
index 4cbfa1d3..0d1c40cb 100644
--- a/window-refs.c
+++ b/window-refs.c
@@ -3,6 +3,7 @@
#include <lauxlib.h>
#include "window-refs.h"
+#include "canvas-window.h"
static char const * const window_ref_table_name = "GSL.windows";
@@ -30,10 +31,26 @@ window_ref_add(lua_State *L, int index)
}
void
-window_ref_remove(lua_State *L, int id)
+window_ref_remove (lua_State *L, int id)
{
lua_getfield (L, LUA_REGISTRYINDEX, window_ref_table_name);
lua_pushnil (L);
lua_rawseti (L, -2, id);
lua_pop (L, 1);
}
+
+void
+window_ref_close_all (lua_State *L)
+{
+ lua_getfield (L, LUA_REGISTRYINDEX, window_ref_table_name);
+
+ lua_pushnil (L); /* first key */
+ while (lua_next(L, -2) != 0)
+ {
+ lua_pushcfunction (L, canvas_window_close);
+ lua_insert (L, -2);
+ lua_call (L, 1, 0);
+ }
+
+ lua_pop (L, 1);
+}
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月18日 15:02:31 +0000

AltStyle によって変換されたページ (->オリジナル) /