4 * Copyright (c) Tuomo Valkonen 1999-2009.
6 * See the included file LICENSE for details.
9 #ifndef ION_IONCORE_MANAGE_H
10 #define ION_IONCORE_MANAGE_H
12 #include <libextl/extl.h>
15 INTRSTRUCT(WManageParams
);
17 #include "clientwin.h"
19 #include "rectangle.h"
24 #define MANAGEPARAMS_INIT \
25 {FALSE, FALSE, FALSE, FALSE, FALSE, ForgetGravity, {0, 0, 0, 0}, NULL}
30 MANAGE_PRIORITY_NORMAL
,
31 MANAGE_PRIORITY_GROUP
,
34 MANAGE_PRIORITY_NOREDIR
37 #define MANAGE_PRIORITY_OK(PRIORITY, OUR) \
38 ((PRIORITY) <= (OUR) || (PRIORITY)==MANAGE_PRIORITY_NOREDIR)
40 #define MANAGE_PRIORITY_SUB(PRIORITY, OUR) \
41 ((PRIORITY)==MANAGE_PRIORITY_NOREDIR \
42 ? MANAGE_PRIORITY_NO \
43 : (PRIORITY) < (OUR) ? (OUR) : (PRIORITY))
45 #define MANAGE_PRIORITY_SUBX(PRIORITY, OUR) \
46 ((PRIORITY)==MANAGE_PRIORITY_NOREDIR || (OUR) < (PRIORITY) \
47 ? MANAGE_PRIORITY_NO \
48 : MANAGE_PRIORITY_NONE)
51 DECLSTRUCT(WManageParams
){
63 typedef WRegion
*WRegionIterator(void *st
);
66 extern ExtlTab
manageparams_to_table(const WManageParams
*mp
);
69 extern WScreen
*clientwin_find_suitable_screen(WClientWin
*cwin
,
70 const WManageParams
*param
);
74 extern bool clientwin_do_manage_default(WClientWin
*cwin
,
75 const WManageParams
*param
);
77 extern bool region_manage_clientwin(WRegion
*reg
, WClientWin
*cwin
,
78 const WManageParams
*par
, int redir
);
80 DYNFUN WPHolder
*region_prepare_manage(WRegion
*reg
, const WClientWin
*cwin
,
81 const WManageParams
*par
, int redir
);
83 extern WPHolder
*region_prepare_manage_default(WRegion
*reg
,
84 const WClientWin
*cwin
,
85 const WManageParams
*par
,
89 extern WPHolder
*region_prepare_manage_transient(WRegion
*reg
,
90 const WClientWin
*cwin
,
91 const WManageParams
*param
,
94 extern WPHolder
*region_prepare_manage_transient_default(WRegion
*reg
,
95 const WClientWin
*cwin
,
96 const WManageParams
*param
,
101 #define REGION_RESCUE_PHFLAGS_OK 0x01
102 #define REGION_RESCUE_NODEEP 0x02
104 INTRSTRUCT(WRescueInfo
);
106 extern WPHolder
*rescueinfo_pholder(WRescueInfo
*info
);
108 /* if ph is given, it is used, otherwise one is looked for when needed */
109 extern bool region_rescue(WRegion
*reg
, WPHolder
*ph
, int flags
);
110 extern bool region_rescue_needed(WRegion
*reg
);
111 extern bool region_rescue_clientwins(WRegion
*reg
, WRescueInfo
*info
);
112 extern bool region_rescue_child_clientwins(WRegion
*reg
, WRescueInfo
*info
);
113 extern bool region_rescue_some_clientwins(WRegion
*reg
, WRescueInfo
*info
,
114 WRegionIterator
*iter
, void *st
);
115 extern bool region_do_rescue_this(WRegion
*tosave
, WRescueInfo
*info
, int ph_flags
);
118 #endif /* ION_IONCORE_MANAGE_H */