From a3a72bf147c9abaa54969bcb0024a3b6592d1c0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Sat, 21 May 2016 13:01:42 +0200 Subject: vis-lua: add window.{width, height} read only properties --- vis-lua.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'vis-lua.c') diff --git a/vis-lua.c b/vis-lua.c index ee474e1..b65796e 100644 --- a/vis-lua.c +++ b/vis-lua.c @@ -603,6 +603,16 @@ static int window_index(lua_State *L) { return 1; } + if (strcmp(key, "width") == 0) { + lua_pushunsigned(L, vis_window_width_get(win)); + return 1; + } + + if (strcmp(key, "height") == 0) { + lua_pushunsigned(L, vis_window_height_get(win)); + return 1; + } + if (strcmp(key, "file") == 0) { obj_ref_new(L, win->file, "vis.file"); return 1; -- cgit v1.2.3