From 7ecce446add3c161a893bf52c9b44ede59370c6f Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Thu, 4 Jun 2009 11:02:21 +0200 Subject: [PATCH] luaobject: generate Lua API function for add, remove and emit signal Signed-off-by: Julien Danjou --- common/luaobject.c | 21 +++++++++++++++++++++ common/luaobject.h | 4 ++++ 2 files changed, 25 insertions(+) diff --git a/common/luaobject.c b/common/luaobject.c index 60eec028..03c6f1eb 100644 --- a/common/luaobject.c +++ b/common/luaobject.c @@ -198,4 +198,25 @@ luaA_object_emit_signal(lua_State *L, int oud, lua_pop(L, nargs); } +int +luaA_object_add_signal_simple(lua_State *L) +{ + luaA_object_add_signal(L, 1, luaL_checkstring(L, 2), 3); + return 0; +} + +int +luaA_object_remove_signal_simple(lua_State *L) +{ + luaA_object_remove_signal(L, 1, luaL_checkstring(L, 2), 3); + return 0; +} + +int +luaA_object_emit_signal_simple(lua_State *L) +{ + luaA_object_emit_signal(L, 1, luaL_checkstring(L, 2), lua_gettop(L) - 2); + return 0; +} + // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80 diff --git a/common/luaobject.h b/common/luaobject.h index ccf45d23..94693454 100644 --- a/common/luaobject.h +++ b/common/luaobject.h @@ -145,6 +145,10 @@ void luaA_object_add_signal(lua_State *, int, const char *, int); void luaA_object_remove_signal(lua_State *, int, const char *, int); void luaA_object_emit_signal(lua_State *, int, const char *, int); +int luaA_object_add_signal_simple(lua_State *); +int luaA_object_remove_signal_simple(lua_State *); +int luaA_object_emit_signal_simple(lua_State *); + #define LUA_OBJECT_HEADER \ signal_array_t signals;