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