]> git.decadent.org.uk Git - ion3.git/blob - ioncore/focus.h
[svn-inject] Installing original source of ion3
[ion3.git] / ioncore / focus.h
1 /*
2  * ion/ioncore/focus.h
3  *
4  * Copyright (c) Tuomo Valkonen 1999-2006. 
5  *
6  * Ion is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation; either version 2.1 of the License, or
9  * (at your option) any later version.
10  */
11
12 #ifndef ION_IONCORE_FOCUS_H
13 #define ION_IONCORE_FOCUS_H
14
15 #include <libmainloop/hooks.h>
16 #include "common.h"
17 #include "window.h"
18 #include "region.h"
19
20 DYNFUN void region_do_set_focus(WRegion *reg, bool warp);
21
22 /* Delayed (until return to main loop) warp/focus */
23 extern void region_warp(WRegion *reg);
24 extern void region_set_focus(WRegion *reg);
25 extern void region_maybewarp(WRegion *reg, bool warp);
26
27 /* Immediate warp/focus */
28 extern void region_do_warp(WRegion *reg);
29 extern bool region_do_warp_default(WRegion *reg);
30
31 extern void region_finalise_focusing(WRegion* reg, Window win, bool warp);
32
33 /* Awaiting focus state */
34 extern void region_set_await_focus(WRegion *reg);
35 extern bool ioncore_await_focus();
36
37 /* Event handling */
38 extern void region_got_focus(WRegion *reg);
39 extern void region_lost_focus(WRegion *reg);
40
41 /* May reg transfer focus to its children? */
42 extern bool region_may_control_focus(WRegion *reg);
43
44 /* Does reg have focus? */
45 extern bool region_is_active(WRegion *reg);
46
47 /* Focus history */
48 extern void region_focuslist_remove(WRegion *reg);
49 extern void region_focuslist_push(WRegion *reg);
50 extern void region_focuslist_move_after(WRegion *reg, WRegion *after);
51 extern void region_focuslist_deinit(WRegion *reg);
52
53 extern WRegion *ioncore_goto_previous();
54
55 /* Handlers to these shook should take WRegion* as parameter. */
56 extern WHook *region_do_warp_alt;
57 extern WHook *region_activated_hook;
58 extern WHook *region_inactivated_hook;
59
60 /* Misc. */
61 extern bool region_skip_focus(WRegion *reg);
62 WRegion *ioncore_current();
63
64 #endif /* ION_IONCORE_FOCUS_H */