Read a textbox' text correctly
[awesome.git] / strut.h
blob8be53154363da9af9f87c7eeb1e5524f2f27ec48
1 /*
2 * strut.h - strut management header
4 * Copyright © 2009 Julien Danjou <julien@danjou.info>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 #ifndef AWESOME_STRUT_H
23 #define AWESOME_STRUT_H
25 #include <lua.h>
26 #include <stdint.h>
27 #include <stdbool.h>
29 /* Strut */
30 typedef struct
32 uint16_t left, right, top, bottom;
33 uint16_t left_start_y, left_end_y;
34 uint16_t right_start_y, right_end_y;
35 uint16_t top_start_x, top_end_x;
36 uint16_t bottom_start_x, bottom_end_x;
37 } strut_t;
39 /** Check if a strut has information.
40 * \param strut A strut structure.
41 * \return A boolean value, true if the strut has strut information.
43 static inline bool
44 strut_has_value(strut_t *strut)
46 return (strut->left
47 || strut->right
48 || strut->top
49 || strut->bottom
50 || strut->left_start_y
51 || strut->left_end_y
52 || strut->right_start_y
53 || strut->right_end_y
54 || strut->top_start_x
55 || strut->top_end_x
56 || strut->bottom_start_x
57 || strut->bottom_end_x);
60 int luaA_pushstrut(lua_State *, strut_t);
61 void luaA_tostrut(lua_State *, int, strut_t *);
63 #endif
64 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80