tag: Improve tag property::index support (FS#1229)
[awesome.git] / objects / window.h
blob30e492c3e404825b3053644de46a923b034912ab
1 /*
2 * window.h - window object 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_OBJECTS_WINDOW_H
23 #define AWESOME_OBJECTS_WINDOW_H
25 #include "color.h"
26 #include "common/luaclass.h"
27 #include "objects/button.h"
28 #include "strut.h"
30 /** Windows type */
31 typedef enum
33 WINDOW_TYPE_NORMAL = 0,
34 WINDOW_TYPE_DESKTOP,
35 WINDOW_TYPE_DOCK,
36 WINDOW_TYPE_SPLASH,
37 WINDOW_TYPE_DIALOG,
38 /* The ones below may have TRANSIENT_FOR, but are not plain dialogs.
39 * They were purposefully placed below DIALOG.
41 WINDOW_TYPE_MENU,
42 WINDOW_TYPE_TOOLBAR,
43 WINDOW_TYPE_UTILITY,
44 /* This ones are usually set on override-redirect windows. */
45 WINDOW_TYPE_DROPDOWN_MENU,
46 WINDOW_TYPE_POPUP_MENU,
47 WINDOW_TYPE_TOOLTIP,
48 WINDOW_TYPE_NOTIFICATION,
49 WINDOW_TYPE_COMBO,
50 WINDOW_TYPE_DND
51 } window_type_t;
53 #define WINDOW_OBJECT_HEADER \
54 LUA_OBJECT_HEADER \
55 /** The X window number */ \
56 xcb_window_t window; \
57 /** The frame window, might be XCB_NONE */ \
58 xcb_window_t frame_window; \
59 /** Opacity */ \
60 double opacity; \
61 /** Strut */ \
62 strut_t strut; \
63 /** Button bindings */ \
64 button_array_t buttons; \
65 /** Border color */ \
66 color_t border_color; \
67 /** Border width */ \
68 uint16_t border_width; \
69 /** The window type */ \
70 window_type_t type;
72 /** Window structure */
73 typedef struct
75 WINDOW_OBJECT_HEADER
76 } window_t;
78 lua_class_t window_class;
80 void window_class_setup(lua_State *);
82 void window_set_opacity(lua_State *, int, double);
83 void window_set_border_width(lua_State *, int, int);
84 int luaA_window_get_type(lua_State *, window_t *);
85 int luaA_window_set_type(lua_State *, window_t *);
86 uint32_t window_translate_type(window_type_t);
87 int window_set_xproperty(lua_State *, xcb_window_t, int, int);
88 int window_get_xproperty(lua_State *, xcb_window_t, int);
90 #endif
91 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80