strut: import strut_has_value()

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2009-08-28 17:44:51 +02:00
parent a55936d559
commit 0ce77459de
2 changed files with 24 additions and 23 deletions

View File

@ -287,26 +287,5 @@ client_isvisible(client_t *c, screen_t *screen)
return (!c->hidden && !c->minimized && client_maybevisible(c, screen));
}
/** Check if a client has strut information.
* \param c A client.
* \return A boolean value, true if the client has strut information.
*/
static inline bool
client_hasstrut(client_t *c)
{
return (c->strut.left
|| c->strut.right
|| c->strut.top
|| c->strut.bottom
|| c->strut.left_start_y
|| c->strut.left_end_y
|| c->strut.right_start_y
|| c->strut.right_end_y
|| c->strut.top_start_x
|| c->strut.top_end_x
|| c->strut.bottom_start_x
|| c->strut.bottom_end_x);
}
#endif
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80

26
strut.h
View File

@ -19,11 +19,12 @@
*
*/
#ifndef AWESOME_STRUTS_H
#define AWESOME_STRUTS_H
#ifndef AWESOME_STRUT_H
#define AWESOME_STRUT_H
#include <lua.h>
#include <stdint.h>
#include <stdbool.h>
/* Strut */
typedef struct
@ -35,6 +36,27 @@ typedef struct
uint16_t bottom_start_x, bottom_end_x;
} strut_t;
/** Check if a strut has information.
* \param strut A strut structure.
* \return A boolean value, true if the strut has strut information.
*/
static inline bool
strut_has_value(strut_t *strut)
{
return (strut->left
|| strut->right
|| strut->top
|| strut->bottom
|| strut->left_start_y
|| strut->left_end_y
|| strut->right_start_y
|| strut->right_end_y
|| strut->top_start_x
|| strut->top_end_x
|| strut->bottom_start_x
|| strut->bottom_end_x);
}
int luaA_pushstrut(lua_State *, strut_t);
void luaA_tostrut(lua_State *, int, strut_t *);