change codename
[awesome.git] / widget.h
blobc4198b0d8abe4d27270db309fce634be7044200f
1 /*
2 * widget.h - widget managing header
4 * Copyright © 2007-2008 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_WIDGET_H
23 #define AWESOME_WIDGET_H
25 #include "mouse.h"
27 struct widget_node_t
29 /** The widget */
30 widget_t *widget;
31 /** The geometry where the widget was drawn */
32 area_t geometry;
35 void widget_delete(widget_t **);
37 DO_RCNT(widget_t, widget, widget_delete)
39 int widget_calculate_offset(int, int, int, int);
40 widget_t *widget_getbycoords(position_t, widget_node_array_t *, int, int, int16_t *, int16_t *);
41 void widget_render(wibox_t *);
43 int luaA_widget_userdata_new(lua_State *, widget_t *);
44 void luaA_table2widgets(lua_State *, widget_node_array_t *);
46 void widget_invalidate_bywidget(widget_t *);
47 void widget_invalidate_bytype(int, widget_constructor_t *);
49 widget_constructor_t widget_textbox;
50 widget_constructor_t widget_progressbar;
51 widget_constructor_t widget_graph;
52 widget_constructor_t widget_systray;
53 widget_constructor_t widget_imagebox;
55 /** Delete a widget node structure.
56 * \param node The node to destroy.
58 static inline void
59 widget_node_delete(widget_node_t *node)
61 widget_unref(&node->widget);
64 ARRAY_FUNCS(widget_node_t, widget_node, widget_node_delete)
66 #endif
68 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80