awesomerc: use awful.util.getdir rather than env
[awesome.git] / swindow.h
blobca558cd6834d35462cbfb933a6f4ce31ed06ab2e
1 /*
2 * swindow.h - simple window handling functions header
4 * Copyright © 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_SWINDOW_H
23 #define AWESOME_SWINDOW_H
25 #include "draw.h"
26 #include "common/util.h"
28 /** A simple window. */
29 typedef struct simple_window_t
31 /** The window object. */
32 xcb_window_t window;
33 /** The pixmap copied to the window object. */
34 xcb_pixmap_t pixmap;
35 /** The graphic context. */
36 xcb_gcontext_t gc;
37 /** The window geometry. */
38 area_t geometry;
39 /** The window border */
40 struct
42 /** The window border width */
43 uint16_t width;
44 /** The window border color */
45 xcolor_t color;
46 } border;
47 /** Draw context */
48 draw_context_t ctx;
49 /** Orientation */
50 orientation_t orientation;
51 } simple_window_t;
53 void simplewindow_init(simple_window_t *s,
54 int, area_t, uint16_t,
55 orientation_t, const xcolor_t *, const xcolor_t *);
57 void simplewindow_wipe(simple_window_t *);
59 void simplewindow_move(simple_window_t *, int, int);
60 void simplewindow_resize(simple_window_t *, int, int);
61 void simplewindow_moveresize(simple_window_t *, area_t);
62 void simplewindow_refresh_pixmap_partial(simple_window_t *, int16_t, int16_t, uint16_t, uint16_t);
63 void simplewindow_border_width_set(simple_window_t *, uint32_t);
64 void simplewindow_border_color_set(simple_window_t *, const xcolor_t *);
65 void simplewindow_orientation_set(simple_window_t *, orientation_t);
67 /** Refresh the window content by copying its pixmap data to its window.
68 * \param sw The simple window to refresh.
70 static inline void
71 simplewindow_refresh_pixmap(simple_window_t *sw)
73 simplewindow_refresh_pixmap_partial(sw, 0, 0, sw->geometry.width, sw->geometry.height);
76 #endif
77 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80