mirror of
https://github.com/awesomeWM/awesome
synced 2024-11-16 07:47:22 +01:00
luaa: rename and change hooks_property macro()
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
2920ed71d7
commit
f4e77bcab9
5 changed files with 22 additions and 22 deletions
30
client.c
30
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));
|
||||
|
|
2
ewmh.c
2
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");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
4
luaa.h
4
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); \
|
||||
} \
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue