From c5c75bf960d8217850280018bd4e8b9cacd54c28 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Tue, 10 Jun 2008 19:17:12 +0200 Subject: [PATCH] [client] Add ishidden() method Signed-off-by: Julien Danjou --- client.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/client.c b/client.c index 0f4941f46..7e7cb7ed5 100644 --- a/client.c +++ b/client.c @@ -1261,6 +1261,22 @@ luaA_client_unhide(lua_State *L) return 0; } +/** Guess if a client has been hidden. + * \param L The Lua VM state. + * + * \luastack + * + * \lreturn A boolean, true if the client has been hidden with hide(), false + * otherwise. + */ +static int +luaA_client_ishidden(lua_State *L) +{ + client_t **c = luaA_checkudata(L, 1, "client"); + lua_pushboolean(L, (*c)->ishidden); + return 1; +} + int luaA_client_userdata_new(client_t *c) { @@ -1305,6 +1321,7 @@ const struct luaL_reg awesome_client_meta[] = { "unmanage", luaA_client_unmanage }, { "hide", luaA_client_hide }, { "unhide", luaA_client_unhide }, + { "ishidden", luaA_client_ishidden }, { "__eq", luaA_client_eq }, { "__tostring", luaA_client_tostring }, { NULL, NULL }