]> Pileus Git - wmpus/blob - wm.h
Support graceful shutdown
[wmpus] / wm.h
1 /*
2  * Copyright (c) 2011, Andy Spencer <andy753421@gmail.com>
3  *
4  * Permission to use, copy, modify, and/or distribute this software for any
5  * purpose with or without fee is hereby granted, provided that the above
6  * copyright notice and this permission notice appear in all copies.
7  *
8  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14  */
15
16 /* Window manager interface:
17  *
18  * The window manager receives input events from the system
19  * and responds by using the system to arrange the windows
20  * according to it's layout.
21  *
22  * The window provided to these function is generally the
23  * window with the keyboard or mouse focus. */
24
25 /* Refresh the window layout */
26 void wm_update(void);
27
28 /* Called for each watched key press.
29  * This is currently used for some other events such
30  * as focus-in and focus-out as well. */
31 int wm_handle_key(win_t *win, Key_t key, mod_t mod, ptr_t ptr);
32
33 /* Called for each mouse movement */
34 int wm_handle_ptr(win_t *win, ptr_t ptr);
35
36 /* Begin managing a window, called for each new window */
37 void wm_insert(win_t *win);
38
39 /* Stop managing a window and free data */
40 void wm_remove(win_t *win);
41
42 /* First call, sets up key bindings, etc */
43 void wm_init(win_t *root);