]> git.decadent.org.uk Git - ion3.git/blob - ioncore/manage.h
45ddf6a6179ec9b894761fb5c43b44cf59ddf0d6
[ion3.git] / ioncore / manage.h
1 /*
2  * ion/ioncore/manage.h
3  *
4  * Copyright (c) Tuomo Valkonen 1999-2007. 
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_MANAGE_H
13 #define ION_IONCORE_MANAGE_H
14
15 #include <libextl/extl.h>
16 #include "common.h"
17
18 INTRSTRUCT(WManageParams);
19
20 #include "clientwin.h"
21 #include "attach.h"
22 #include "rectangle.h"
23 #include "extlconv.h"
24 #include "pholder.h"
25
26
27 #define MANAGEPARAMS_INIT                                                \
28   {FALSE, FALSE, FALSE, FALSE, FALSE, ForgetGravity, {0, 0, 0, 0}, NULL}
29
30 enum{
31     MANAGE_REDIR_PREFER_YES,
32     MANAGE_REDIR_PREFER_NO,
33     MANAGE_REDIR_STRICT_YES,
34     MANAGE_REDIR_STRICT_NO
35 };
36
37 DECLSTRUCT(WManageParams){
38     bool switchto;
39     bool jumpto;
40     bool userpos;
41     bool dockapp;
42     bool maprq;
43     int gravity;
44     WRectangle geom;
45     WClientWin *tfor;
46 };
47
48
49 typedef WRegion *WRegionIterator(void *st);
50
51
52 extern ExtlTab manageparams_to_table(const WManageParams *mp);
53
54
55 extern WScreen *clientwin_find_suitable_screen(WClientWin *cwin,
56                                                const WManageParams *param);
57
58 /* Manage */
59
60 extern bool clientwin_do_manage_default(WClientWin *cwin,
61                                         const WManageParams *param);
62
63 extern bool region_manage_clientwin(WRegion *reg, WClientWin *cwin,
64                                     const WManageParams *par, int redir);
65
66 DYNFUN WPHolder *region_prepare_manage(WRegion *reg, const WClientWin *cwin,
67                                        const WManageParams *par, int redir);
68
69 extern WPHolder *region_prepare_manage_default(WRegion *reg, 
70                                                const WClientWin *cwin,
71                                                const WManageParams *par, 
72                                                int redir);
73
74
75 extern WPHolder *region_prepare_manage_transient(WRegion *reg, 
76                                                  const WClientWin *cwin,
77                                                  const WManageParams *param,
78                                                  int unused);
79
80 extern WPHolder *region_prepare_manage_transient_default(WRegion *reg, 
81                                                          const WClientWin *cwin,
82                                                          const WManageParams *param,
83                                                          int unused);
84
85 /* Rescue */
86
87 INTRSTRUCT(WRescueInfo);
88
89 /* if ph is given, it is used, otherwise one is looked for when needed */
90 extern bool region_rescue(WRegion *reg, WPHolder *ph);
91 extern bool region_rescue_needed(WRegion *reg);
92 extern bool region_rescue_clientwins(WRegion *reg, WRescueInfo *info);
93 extern bool region_rescue_child_clientwins(WRegion *reg, WRescueInfo *info);
94 extern bool region_rescue_some_clientwins(WRegion *reg, WRescueInfo *info,
95                                           WRegionIterator *iter, void *st);
96
97
98 #endif /* ION_IONCORE_MANAGE_H */