wibox: get rid of simple window
[awesome.git] / wibox.h
blobad17e7947a3ac6a647d20736f7c6a98005448433
1 /*
2 * wibox.h - wibox functions header
4 * Copyright © 2007-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_WIBOX_H
23 #define AWESOME_WIBOX_H
25 #include "widget.h"
27 /** Wibox types */
28 typedef enum
30 WIBOX_TYPE_NORMAL = 0,
31 WIBOX_TYPE_TITLEBAR
32 } wibox_type_t;
34 /** Wibox type */
35 struct wibox_t
37 LUA_OBJECT_HEADER
38 /** Ontop */
39 bool ontop;
40 /** Visible */
41 bool isvisible;
42 /** Position */
43 position_t position;
44 /** Wibox type */
45 wibox_type_t type;
46 /** Alignment */
47 alignment_t align;
48 /** Screen */
49 screen_t *screen;
50 /** Widget list */
51 widget_node_array_t widgets;
52 void *widgets_table;
53 /** Widget the mouse is over */
54 widget_t *mouse_over;
55 /** Mouse over event handler */
56 void *mouse_enter, *mouse_leave;
57 /** Need update */
58 bool need_update;
59 /** Need shape update */
60 bool need_shape_update;
61 /** Cursor */
62 char *cursor;
63 /** Background image */
64 image_t *bg_image;
65 /* Banned? used for titlebars */
66 bool isbanned;
67 /** Button bindings */
68 void *buttons;
69 /** The window object. */
70 xcb_window_t window;
71 /** The pixmap copied to the window object. */
72 xcb_pixmap_t pixmap;
73 /** The graphic context. */
74 xcb_gcontext_t gc;
75 /** The window geometry. */
76 area_t geometry;
77 struct
79 /** Internal geometry (matching X11 protocol) */
80 area_t internal;
81 } geometries;
82 /** The window border */
83 struct
85 /** The window border width */
86 uint16_t width;
87 /** The window border color */
88 xcolor_t color;
89 } border;
90 /** Draw context */
91 draw_context_t ctx;
92 /** Orientation */
93 orientation_t orientation;
94 /** Opacity */
95 double opacity;
96 /** The window's shape */
97 struct
99 /** The window's content */
100 image_t *clip;
101 /** The window's content and border */
102 image_t *bounding;
103 } shape;
106 void wibox_unref_simplified(wibox_t **);
108 ARRAY_FUNCS(wibox_t *, wibox, wibox_unref_simplified)
110 void wibox_refresh(void);
112 void luaA_wibox_invalidate_byitem(lua_State *, const void *);
114 wibox_t * wibox_getbywin(xcb_window_t);
116 void wibox_moveresize(wibox_t *, area_t);
117 void wibox_refresh_pixmap_partial(wibox_t *, int16_t, int16_t, uint16_t, uint16_t);
118 void wibox_init(wibox_t *, int);
119 void wibox_wipe(wibox_t *);
120 void wibox_border_width_set(wibox_t *, uint32_t);
121 void wibox_border_color_set(wibox_t *, const xcolor_t *);
122 void wibox_orientation_set(wibox_t *, orientation_t);
124 LUA_OBJECT_FUNCS(wibox_t, wibox, "wibox")
126 #endif
127 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80