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
28 /** A simple window. */
29 typedef struct simple_window_t
31 /** The window object. */
33 /** The pixmap copied to the window object. */
35 /** The graphic context. */
37 /** The window geometry. */
41 /** Internal geometry (matching X11 protocol) */
44 /** The window border */
47 /** The window border width */
49 /** The window border color */
55 orientation_t orientation
;
60 void simplewindow_init(simple_window_t
*s
,
61 int, area_t
, uint16_t, const xcolor_t
*,
62 orientation_t
, const xcolor_t
*, const xcolor_t
*);
64 void simplewindow_wipe(simple_window_t
*);
66 void simplewindow_move(simple_window_t
*, int, int);
67 void simplewindow_resize(simple_window_t
*, int, int);
68 void simplewindow_moveresize(simple_window_t
*, area_t
);
69 void simplewindow_refresh_pixmap_partial(simple_window_t
*, int16_t, int16_t, uint16_t, uint16_t);
70 void simplewindow_border_width_set(simple_window_t
*, uint32_t);
71 void simplewindow_border_color_set(simple_window_t
*, const xcolor_t
*);
72 void simplewindow_orientation_set(simple_window_t
*, orientation_t
);
73 void simplewindow_cursor_set(simple_window_t
*, xcb_cursor_t
);
75 /** Refresh the window content by copying its pixmap data to its window.
76 * \param sw The simple window to refresh.
79 simplewindow_refresh_pixmap(simple_window_t
*sw
)
81 simplewindow_refresh_pixmap_partial(sw
, 0, 0, sw
->geometry
.width
, sw
->geometry
.height
);
84 /** Set a simplewindow's opacity.
85 * \param opacity A value between 0 and 1 which describes the opacity.
88 simplewindow_opacity_set(simple_window_t
*sw
, double opacity
)
90 sw
->opacity
= opacity
;
91 if(sw
->window
!= XCB_NONE
)
92 window_opacity_set(sw
->window
, opacity
);
95 /** Get a simplewindow's opacity.
96 * \return The opacity as a value between 0 and 1, or -1 if unset.
99 simplewindow_opacity_get(simple_window_t
*sw
)
105 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80