Merge branch 'fix-ldoc-set-spacing' of git://github.com/actionless/awesome
[awesome.git] / property.h
blob588fb0009f1b6ce1aa860947250ba53e0f97b374
1 /*
2 * property.h - property handlers header
4 * Copyright © 2008-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_PROPERTY_H
23 #define AWESOME_PROPERTY_H
25 #include "objects/client.h"
27 #define PROPERTY(funcname) \
28 xcb_get_property_cookie_t property_get_##funcname(client_t *c); \
29 void property_update_##funcname(client_t *c, xcb_get_property_cookie_t cookie)
31 PROPERTY(wm_name);
32 PROPERTY(net_wm_name);
33 PROPERTY(wm_icon_name);
34 PROPERTY(net_wm_icon_name);
35 PROPERTY(wm_client_machine);
36 PROPERTY(wm_window_role);
37 PROPERTY(wm_transient_for);
38 PROPERTY(wm_client_leader);
39 PROPERTY(wm_normal_hints);
40 PROPERTY(wm_hints);
41 PROPERTY(wm_class);
42 PROPERTY(wm_protocols);
43 PROPERTY(net_wm_pid);
44 PROPERTY(net_wm_icon);
46 #undef PROPERTY
48 void property_handle_propertynotify(xcb_property_notify_event_t *ev);
49 int luaA_register_xproperty(lua_State *L);
50 int luaA_set_xproperty(lua_State *L);
51 int luaA_get_xproperty(lua_State *L);
53 struct xproperty {
54 xcb_atom_t atom;
55 const char *name;
56 enum {
57 /* UTF8_STRING */
58 PROP_STRING,
59 /* CARDINAL */
60 PROP_NUMBER,
61 /* CARDINAL with values 0 and 1 (or "0 and != 0") */
62 PROP_BOOLEAN
63 } type;
66 static inline int
67 xproperty_cmp(const void *a, const void *b)
69 const xproperty_t *x = a, *y = b;
70 return x->atom - y->atom;
73 BARRAY_FUNCS(xproperty_t, xproperty, DO_NOTHING, xproperty_cmp)
75 #endif
76 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80