luaa: rename and change hooks_property macro()

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2009-05-07 14:11:15 +02:00
parent 2920ed71d7
commit f4e77bcab9
5 changed files with 22 additions and 22 deletions

View File

@ -88,7 +88,7 @@ client_seturgent(client_t *c, bool urgent)
xcb_set_wm_hints(globalconf.connection, c->win, &wmh); 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); screen_client_moveto(c, new_screen, true, false);
/* execute hook */ /* execute hook */
hooks_property(c, "geometry"); hook_property(client, c, "geometry");
return true; return true;
} }
@ -768,7 +768,7 @@ client_setminimized(client_t *c, bool s)
client_need_arrange(c); client_need_arrange(c);
ewmh_client_update_hints(c); ewmh_client_update_hints(c);
/* execute hook */ /* 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; c->issticky = s;
client_need_arrange(c); client_need_arrange(c);
ewmh_client_update_hints(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_need_arrange(c);
client_stack(); client_stack();
ewmh_client_update_hints(c); 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_need_arrange(c);
client_stack(); client_stack();
ewmh_client_update_hints(c); 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_need_arrange(c);
client_stack(); client_stack();
ewmh_client_update_hints(c); 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(); client_stack();
ewmh_client_update_hints(c); ewmh_client_update_hints(c);
/* execute hook */ /* execute hook */
hooks_property(c, "above"); hook_property(client, c, "above");
} }
} }
@ -957,7 +957,7 @@ client_setbelow(client_t *c, bool s)
client_stack(); client_stack();
ewmh_client_update_hints(c); ewmh_client_update_hints(c);
/* execute hook */ /* execute hook */
hooks_property(c, "below"); hook_property(client, c, "below");
} }
} }
@ -974,7 +974,7 @@ client_setmodal(client_t *c, bool s)
client_stack(); client_stack();
ewmh_client_update_hints(c); ewmh_client_update_hints(c);
/* execute hook */ /* 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; c->isontop = s;
client_stack(); client_stack();
/* execute hook */ /* 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. */ /* Changing border size also affects the size of the titlebar. */
titlebar_update_geometry(c); titlebar_update_geometry(c);
hooks_property(c, "border_width"); hook_property(client, c, "border_width");
} }
/** Kill a client. /** Kill a client.
@ -1467,7 +1467,7 @@ luaA_client_struts(lua_State *L)
/* All the wiboxes (may) need to be repositioned. */ /* All the wiboxes (may) need to be repositioned. */
wibox_update_positions(); 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); image_unref(L, c->icon);
c->icon = image_ref(L); c->icon = image_ref(L);
/* execute hook */ /* execute hook */
hooks_property(c, "icon"); hook_property(client, c, "icon");
break; break;
case A_TK_OPACITY: case A_TK_OPACITY:
if(lua_isnil(L, 3)) if(lua_isnil(L, 3))
@ -1540,7 +1540,7 @@ luaA_client_newindex(lua_State *L)
break; break;
case A_TK_SIZE_HINTS_HONOR: case A_TK_SIZE_HINTS_HONOR:
c->size_hints_honor = luaA_checkboolean(L, 3); c->size_hints_honor = luaA_checkboolean(L, 3);
hooks_property(c, "size_hints_honor"); hook_property(client, c, "size_hints_honor");
break; break;
case A_TK_BORDER_WIDTH: case A_TK_BORDER_WIDTH:
client_setborder(c, luaL_checknumber(L, 3)); client_setborder(c, luaL_checknumber(L, 3));

2
ewmh.c
View File

@ -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. */ /* All the wiboxes (may) need to be repositioned. */
wibox_update_positions(); wibox_update_positions();
hooks_property(c, "struts"); hook_property(client, c, "struts");
} }
} }

4
luaa.h
View File

@ -331,11 +331,11 @@ void luaA_table2wtable(lua_State *);
int luaA_next(lua_State *, int); int luaA_next(lua_State *, int);
bool luaA_isloop(lua_State *, int); bool luaA_isloop(lua_State *, int);
#define hooks_property(c, prop) \ #define hook_property(type, obj, prop) \
do { \ do { \
if(globalconf.hooks.property != LUA_REFNIL) \ if(globalconf.hooks.property != LUA_REFNIL) \
{ \ { \
client_push(globalconf.L, c); \ type##_push(globalconf.L, obj); \
lua_pushliteral(globalconf.L, prop); \ lua_pushliteral(globalconf.L, prop); \
luaA_dofunction(globalconf.L, globalconf.hooks.property, 2, 0); \ luaA_dofunction(globalconf.L, globalconf.hooks.property, 2, 0); \
} \ } \

View File

@ -218,7 +218,7 @@ property_update_wm_name(client_t *c)
c->name = name; c->name = name;
/* call hook */ /* call hook */
hooks_property(c, "name"); hook_property(client, c, "name");
} }
/** Update WM_CLASS of a client. /** Update WM_CLASS of a client.
@ -272,7 +272,7 @@ property_update_wm_icon_name(client_t *c)
c->icon_name = name; c->icon_name = name;
/* call hook */ /* call hook */
hooks_property(c, "icon_name"); hook_property(client, c, "icon_name");
} }
static int static int
@ -355,7 +355,7 @@ property_handle_net_wm_icon(void *data,
if(ewmh_window_icon_from_reply(reply)) if(ewmh_window_icon_from_reply(reply))
c->icon = image_ref(globalconf.L); c->icon = image_ref(globalconf.L);
/* execute hook */ /* execute hook */
hooks_property(c, "icon"); hook_property(client, c, "icon");
} }
return 0; return 0;

View File

@ -414,7 +414,7 @@ luaA_titlebar_newindex(lua_State *L, wibox_t *titlebar, awesome_token_t tok)
titlebar_update_geometry(c); titlebar_update_geometry(c);
/* call geometry hook for client because some like to /* call geometry hook for client because some like to
* set titlebar width in that hook, which make sense */ * set titlebar width in that hook, which make sense */
hooks_property(c, "geometry"); hook_property(client, c, "geometry");
} }
} }
break; break;