From f4e77bcab92ea816745b45613d78138a11c2558f Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Thu, 7 May 2009 14:11:15 +0200 Subject: [PATCH] luaa: rename and change hooks_property macro() Signed-off-by: Julien Danjou --- client.c | 30 +++++++++++++++--------------- ewmh.c | 2 +- luaa.h | 4 ++-- property.c | 6 +++--- titlebar.c | 2 +- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/client.c b/client.c index 5385de49..fa0fdfa8 100644 --- a/client.c +++ b/client.c @@ -88,7 +88,7 @@ client_seturgent(client_t *c, bool urgent) xcb_set_wm_hints(globalconf.connection, c->win, &wmh); - hooks_property(c, "urgent"); + hook_property(client, c, "urgent"); } } @@ -746,7 +746,7 @@ client_resize(client_t *c, area_t geometry, bool hints) screen_client_moveto(c, new_screen, true, false); /* execute hook */ - hooks_property(c, "geometry"); + hook_property(client, c, "geometry"); return true; } @@ -768,7 +768,7 @@ client_setminimized(client_t *c, bool s) client_need_arrange(c); ewmh_client_update_hints(c); /* execute hook */ - hooks_property(c, "minimized"); + hook_property(client, c, "minimized"); } } @@ -785,7 +785,7 @@ client_setsticky(client_t *c, bool s) c->issticky = s; client_need_arrange(c); ewmh_client_update_hints(c); - hooks_property(c, "sticky"); + hook_property(client, c, "sticky"); } } @@ -829,7 +829,7 @@ client_setfullscreen(client_t *c, bool s) client_need_arrange(c); client_stack(); ewmh_client_update_hints(c); - hooks_property(c, "fullscreen"); + hook_property(client, c, "fullscreen"); } } @@ -869,7 +869,7 @@ client_setmaxhoriz(client_t *c, bool s) client_need_arrange(c); client_stack(); ewmh_client_update_hints(c); - hooks_property(c, "maximized_horizontal"); + hook_property(client, c, "maximized_horizontal"); } } @@ -909,7 +909,7 @@ client_setmaxvert(client_t *c, bool s) client_need_arrange(c); client_stack(); ewmh_client_update_hints(c); - hooks_property(c, "maximized_vertical"); + hook_property(client, c, "maximized_vertical"); } } @@ -933,7 +933,7 @@ client_setabove(client_t *c, bool s) client_stack(); ewmh_client_update_hints(c); /* execute hook */ - hooks_property(c, "above"); + hook_property(client, c, "above"); } } @@ -957,7 +957,7 @@ client_setbelow(client_t *c, bool s) client_stack(); ewmh_client_update_hints(c); /* execute hook */ - hooks_property(c, "below"); + hook_property(client, c, "below"); } } @@ -974,7 +974,7 @@ client_setmodal(client_t *c, bool s) client_stack(); ewmh_client_update_hints(c); /* execute hook */ - hooks_property(c, "modal"); + hook_property(client, c, "modal"); } } @@ -997,7 +997,7 @@ client_setontop(client_t *c, bool s) c->isontop = s; client_stack(); /* execute hook */ - hooks_property(c, "ontop"); + hook_property(client, c, "ontop"); } } @@ -1211,7 +1211,7 @@ client_setborder(client_t *c, int width) /* Changing border size also affects the size of the titlebar. */ titlebar_update_geometry(c); - hooks_property(c, "border_width"); + hook_property(client, c, "border_width"); } /** Kill a client. @@ -1467,7 +1467,7 @@ luaA_client_struts(lua_State *L) /* All the wiboxes (may) need to be repositioned. */ wibox_update_positions(); - hooks_property(c, "struts"); + hook_property(client, c, "struts"); } } @@ -1523,7 +1523,7 @@ luaA_client_newindex(lua_State *L) image_unref(L, c->icon); c->icon = image_ref(L); /* execute hook */ - hooks_property(c, "icon"); + hook_property(client, c, "icon"); break; case A_TK_OPACITY: if(lua_isnil(L, 3)) @@ -1540,7 +1540,7 @@ luaA_client_newindex(lua_State *L) break; case A_TK_SIZE_HINTS_HONOR: c->size_hints_honor = luaA_checkboolean(L, 3); - hooks_property(c, "size_hints_honor"); + hook_property(client, c, "size_hints_honor"); break; case A_TK_BORDER_WIDTH: client_setborder(c, luaL_checknumber(L, 3)); diff --git a/ewmh.c b/ewmh.c index acadee52..2d6ce176 100644 --- a/ewmh.c +++ b/ewmh.c @@ -639,7 +639,7 @@ ewmh_process_client_strut(client_t *c, xcb_get_property_reply_t *strut_r) /* All the wiboxes (may) need to be repositioned. */ wibox_update_positions(); - hooks_property(c, "struts"); + hook_property(client, c, "struts"); } } diff --git a/luaa.h b/luaa.h index aa367d21..c6085eb7 100644 --- a/luaa.h +++ b/luaa.h @@ -331,11 +331,11 @@ void luaA_table2wtable(lua_State *); int luaA_next(lua_State *, int); bool luaA_isloop(lua_State *, int); -#define hooks_property(c, prop) \ +#define hook_property(type, obj, prop) \ do { \ if(globalconf.hooks.property != LUA_REFNIL) \ { \ - client_push(globalconf.L, c); \ + type##_push(globalconf.L, obj); \ lua_pushliteral(globalconf.L, prop); \ luaA_dofunction(globalconf.L, globalconf.hooks.property, 2, 0); \ } \ diff --git a/property.c b/property.c index 7b0812f4..12853ab6 100644 --- a/property.c +++ b/property.c @@ -218,7 +218,7 @@ property_update_wm_name(client_t *c) c->name = name; /* call hook */ - hooks_property(c, "name"); + hook_property(client, c, "name"); } /** Update WM_CLASS of a client. @@ -272,7 +272,7 @@ property_update_wm_icon_name(client_t *c) c->icon_name = name; /* call hook */ - hooks_property(c, "icon_name"); + hook_property(client, c, "icon_name"); } static int @@ -355,7 +355,7 @@ property_handle_net_wm_icon(void *data, if(ewmh_window_icon_from_reply(reply)) c->icon = image_ref(globalconf.L); /* execute hook */ - hooks_property(c, "icon"); + hook_property(client, c, "icon"); } return 0; diff --git a/titlebar.c b/titlebar.c index 1d6482e1..1f21f3d5 100644 --- a/titlebar.c +++ b/titlebar.c @@ -414,7 +414,7 @@ luaA_titlebar_newindex(lua_State *L, wibox_t *titlebar, awesome_token_t tok) titlebar_update_geometry(c); /* call geometry hook for client because some like to * set titlebar width in that hook, which make sense */ - hooks_property(c, "geometry"); + hook_property(client, c, "geometry"); } } break;