]> Pileus Git - wmpus/blob - wm.h
Fix closing focused window
[wmpus] / wm.h
1 /*
2  * Copyright (c) 2011-2012, 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 /* Called for each watched event */
26 int wm_handle_event(win_t *win, event_t ev, mod_t mod, ptr_t ptr);
27
28 /* Called for each mouse movement */
29 int wm_handle_ptr(win_t *win, ptr_t ptr);
30
31 /* Called when a window changes states */
32 int wm_handle_state(win_t *win, state_t prev, state_t next);
33
34 /* Begin managing a window, called for each new window */
35 void wm_insert(win_t *win);
36
37 /* Stop managing a window and free data */
38 void wm_remove(win_t *win);
39
40 /* First call, sets up key bindings, etc */
41 void wm_init(win_t *root);
42
43 /* First call, sets up key bindings, etc */
44 void wm_free(win_t *root);