From f2975f6fd18a64ff52a505eded7f164d7b45da11 Mon Sep 17 00:00:00 2001 From: Guo Rui Date: Thu, 16 Jul 2009 23:01:39 +0800 Subject: [PATCH] Add display.top_canvas & bottom_canvas interface. --- src/lua.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/lua.c b/src/lua.c index 3aa7d0b..81197c9 100644 --- a/src/lua.c +++ b/src/lua.c @@ -768,8 +768,34 @@ display_get_canvases(lua_State *L) return 1; } +static int +display_top_canvas(lua_State *L) +{ + struct display *d; + d = check_display(L, 1); + push_canvas(L, &d->d_cvlist); + + return 1; +} + +static int +display_bot_canvas(lua_State *L) +{ + struct display *d; + struct canvas *c; + d = check_display(L, 1); + + for (c = d->d_cvlist; c->c_next; c = c->c_next) + ; + push_canvas(L, &c); + + return 1; +} + static const luaL_reg display_methods[] = { {"get_canvases", display_get_canvases}, + {"top_canvas", display_top_canvas}, + {"bottom_canvas", display_bot_canvas}, {0, 0} }; -- 2.11.4.GIT