change codename
[awesome.git] / swindow.h
blob91762004faf7876aa79cdb2ff17191051381ac56
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 struct
41 /** Internal geometry (matching X11 protocol) */
42 area_t internal;
43 } geometries;
44 /** The window border */
45 struct
47 /** The window border width */
48 uint16_t width;
49 /** The window border color */
50 xcolor_t color;
51 } border;
52 /** Draw context */
53 draw_context_t ctx;
54 /** Orientation */
55 orientation_t orientation;
56 } simple_window_t;
58 void simplewindow_init(simple_window_t *s,
59 int, area_t, uint16_t,
60 orientation_t, const xcolor_t *, const xcolor_t *);
62 void simplewindow_wipe(simple_window_t *);
64 void simplewindow_move(simple_window_t *, int, int);
65 void simplewindow_resize(simple_window_t *, int, int);
66 void simplewindow_moveresize(simple_window_t *, area_t);
67 void simplewindow_refresh_pixmap_partial(simple_window_t *, int16_t, int16_t, uint16_t, uint16_t);
68 void simplewindow_border_width_set(simple_window_t *, uint32_t);
69 void simplewindow_border_color_set(simple_window_t *, const xcolor_t *);
70 void simplewindow_orientation_set(simple_window_t *, orientation_t);
71 void simplewindow_cursor_set(simple_window_t *, xcb_cursor_t);
73 /** Refresh the window content by copying its pixmap data to its window.
74 * \param sw The simple window to refresh.
76 static inline void
77 simplewindow_refresh_pixmap(simple_window_t *sw)
79 simplewindow_refresh_pixmap_partial(sw, 0, 0, sw->geometry.width, sw->geometry.height);
82 #endif
83 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80