keygrabber: use XStringToKeysym()
[awesome.git] / swindow.h
bloba51969e41694a4904abedbf9ba01e51acd262275
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"
27 /** A simple window. */
28 typedef struct simple_window_t
30 /** The window object. */
31 xcb_window_t window;
32 /** The pixmap copied to the window object. */
33 xcb_pixmap_t pixmap;
34 /** The graphic context. */
35 xcb_gcontext_t gc;
36 /** The window geometry. */
37 area_t geometry;
38 struct
40 /** Internal geometry (matching X11 protocol) */
41 area_t internal;
42 } geometries;
43 /** The window border */
44 struct
46 /** The window border width */
47 uint16_t width;
48 /** The window border color */
49 xcolor_t color;
50 } border;
51 /** Draw context */
52 draw_context_t ctx;
53 /** Orientation */
54 orientation_t orientation;
55 } simple_window_t;
57 void simplewindow_init(simple_window_t *s,
58 int, area_t, uint16_t,
59 orientation_t, const xcolor_t *, const xcolor_t *);
61 void simplewindow_wipe(simple_window_t *);
63 void simplewindow_move(simple_window_t *, int, int);
64 void simplewindow_resize(simple_window_t *, int, int);
65 void simplewindow_moveresize(simple_window_t *, area_t);
66 void simplewindow_refresh_pixmap_partial(simple_window_t *, int16_t, int16_t, uint16_t, uint16_t);
67 void simplewindow_border_width_set(simple_window_t *, uint32_t);
68 void simplewindow_border_color_set(simple_window_t *, const xcolor_t *);
69 void simplewindow_orientation_set(simple_window_t *, orientation_t);
70 void simplewindow_cursor_set(simple_window_t *, xcb_cursor_t);
72 /** Refresh the window content by copying its pixmap data to its window.
73 * \param sw The simple window to refresh.
75 static inline void
76 simplewindow_refresh_pixmap(simple_window_t *sw)
78 simplewindow_refresh_pixmap_partial(sw, 0, 0, sw->geometry.width, sw->geometry.height);
81 #endif
82 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80