From dea2b6303a41f4a2600f7ae8d659c9f21ab697ba Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Wed, 29 Jul 2009 15:22:33 +0200 Subject: [PATCH] luaobject: import signals meta methods in objects Signed-off-by: Julien Danjou Conflicts: --- button.c | 1 + client.c | 1 + common/luaobject.h | 5 +++++ image.c | 1 + key.c | 1 + tag.c | 1 + wibox.c | 1 + widget.c | 1 + 8 files changed, 12 insertions(+) diff --git a/button.c b/button.c index e06b8895b..0b3988279 100644 --- a/button.c +++ b/button.c @@ -149,6 +149,7 @@ const struct luaL_reg awesome_button_methods[] = }; const struct luaL_reg awesome_button_meta[] = { + LUA_OBJECT_META { "__index", luaA_button_index }, { "__newindex", luaA_button_newindex }, { "__gc", luaA_object_gc }, diff --git a/client.c b/client.c index a16a89358..55f717a97 100644 --- a/client.c +++ b/client.c @@ -1963,6 +1963,7 @@ const struct luaL_reg awesome_client_methods[] = }; const struct luaL_reg awesome_client_meta[] = { + LUA_OBJECT_META { "isvisible", luaA_client_isvisible }, { "geometry", luaA_client_geometry }, { "struts", luaA_client_struts }, diff --git a/common/luaobject.h b/common/luaobject.h index 94693454d..e2cdc0d00 100644 --- a/common/luaobject.h +++ b/common/luaobject.h @@ -214,6 +214,11 @@ luaA_object_gc(lua_State *L) return 0; } +#define LUA_OBJECT_META \ + { "add_signal", luaA_object_add_signal_simple }, \ + { "remove_signal", luaA_object_remove_signal_simple }, \ + { "emit_signal", luaA_object_emit_signal_simple }, + #endif // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80 diff --git a/image.c b/image.c index 66bd9dc2b..a4fb713e7 100644 --- a/image.c +++ b/image.c @@ -776,6 +776,7 @@ const struct luaL_reg awesome_image_methods[] = }; const struct luaL_reg awesome_image_meta[] = { + LUA_OBJECT_META { "__index", luaA_image_index }, { "rotate", luaA_image_rotate }, { "orientate", luaA_image_orientate }, diff --git a/key.c b/key.c index ef2d9ecb7..a4f073690 100644 --- a/key.c +++ b/key.c @@ -1151,6 +1151,7 @@ const struct luaL_reg awesome_key_methods[] = }; const struct luaL_reg awesome_key_meta[] = { + LUA_OBJECT_META { "__tostring", luaA_key_tostring }, { "__index", luaA_key_index }, { "__newindex", luaA_key_newindex }, diff --git a/tag.c b/tag.c index 9a4bd2d94..e24b0c0e7 100644 --- a/tag.c +++ b/tag.c @@ -410,6 +410,7 @@ const struct luaL_reg awesome_tag_methods[] = }; const struct luaL_reg awesome_tag_meta[] = { + LUA_OBJECT_META { "clients", luaA_tag_clients }, { "__index", luaA_tag_index }, { "__newindex", luaA_tag_newindex }, diff --git a/wibox.c b/wibox.c index 734ab3cbd..c7afd6a24 100644 --- a/wibox.c +++ b/wibox.c @@ -1206,6 +1206,7 @@ const struct luaL_reg awesome_wibox_methods[] = }; const struct luaL_reg awesome_wibox_meta[] = { + LUA_OBJECT_META { "geometry", luaA_wibox_geometry }, { "__index", luaA_wibox_index }, { "__newindex", luaA_wibox_newindex }, diff --git a/widget.c b/widget.c index e5b8e8908..0ba651048 100644 --- a/widget.c +++ b/widget.c @@ -557,6 +557,7 @@ const struct luaL_reg awesome_widget_methods[] = }; const struct luaL_reg awesome_widget_meta[] = { + LUA_OBJECT_META { "extents", luaA_widget_extents }, { "__index", luaA_widget_index }, { "__newindex", luaA_widget_newindex },