2 * ion/mod_tiling/split.h
4 * Copyright (c) Tuomo Valkonen 1999-2009.
6 * See the included file LICENSE for details.
9 #ifndef ION_MOD_TILING_SPLIT_H
10 #define ION_MOD_TILING_SPLIT_H
12 #include <ioncore/common.h>
13 #include <ioncore/window.h>
14 #include <ioncore/reginfo.h>
15 #include <ioncore/attach.h>
16 #include <ioncore/rectangle.h>
17 #include <libextl/extl.h>
21 INTRCLASS(WSplitInner
);
22 INTRCLASS(WSplitSplit
);
23 INTRCLASS(WSplitRegion
);
55 int unused_w
, unused_h
;
59 DECLCLASS(WSplitInner
){
64 DECLCLASS(WSplitSplit
){
72 DECLCLASS(WSplitRegion
){
92 typedef bool WSplitFilter(WSplit
*split
);
93 typedef void WSplitFn(WSplit
*split
);
98 extern int split_size(WSplit
*split
, int dir
);
99 extern int split_pos(WSplit
*split
, int dir
);
100 extern int split_other_size(WSplit
*split
, int dir
);
101 extern int split_other_pos(WSplit
*split
, int dir
);
103 extern WSplitRegion
*splittree_node_of(WRegion
*reg
);
104 extern bool splittree_set_node_of(WRegion
*reg
, WSplitRegion
*split
);
106 extern WPrimn
primn_invert(WPrimn primn
);
107 extern WPrimn
primn_none2any(WPrimn primn
);
111 extern bool split_init(WSplit
*split
, const WRectangle
*geom
);
112 extern bool splitinner_init(WSplitInner
*split
, const WRectangle
*geom
);
113 extern bool splitsplit_init(WSplitSplit
*split
, const WRectangle
*geom
,
115 extern bool splitregion_init(WSplitRegion
*split
, const WRectangle
*geom
,
117 extern bool splitst_init(WSplitST
*split
, const WRectangle
*geom
,
121 extern WSplitSplit
*create_splitsplit(const WRectangle
*geom
, int dir
);
122 extern WSplitRegion
*create_splitregion(const WRectangle
*geom
, WRegion
*reg
);
123 extern WSplitST
*create_splitst(const WRectangle
*geom
, WRegion
*reg
);
126 extern void split_deinit(WSplit
*split
);
127 extern void splitsplit_deinit(WSplitSplit
*split
);
128 extern void splitinner_deinit(WSplitInner
*split
);
129 extern void splitregion_deinit(WSplitRegion
*split
);
130 extern void splitst_deinit(WSplitST
*split
);
134 DYNFUN
void split_update_bounds(WSplit
*node
, bool recursive
);
135 extern void splitsplit_update_geom_from_children(WSplitSplit
*node
);
136 DYNFUN
void split_do_resize(WSplit
*node
, const WRectangle
*ng
,
137 WPrimn hprimn
, WPrimn vprimn
, bool transpose
);
138 extern void splitsplit_do_resize(WSplitSplit
*node
, const WRectangle
*ng
,
139 WPrimn hprimn
, WPrimn vprimn
, bool transpose
);
140 extern void split_resize(WSplit
*node
, const WRectangle
*ng
,
141 WPrimn hprimn
, WPrimn vprimn
);
142 DYNFUN
void split_do_maxhelper(WSplit
*node
, int dir
, int action
);
143 DYNFUN
bool split_do_restore(WSplit
*node
, int dir
);
144 DYNFUN
bool split_do_verify(WSplit
*node
, int dir
);
145 extern bool split_maximize(WSplit
*node
, int dir
, int action
);
146 DYNFUN
void splitinner_do_rqsize(WSplitInner
*p
, WSplit
*node
,
147 RootwardAmount
*ha
, RootwardAmount
*va
,
148 WRectangle
*rg
, bool tryonly
);
149 extern ExtlTab
split_rqgeom(WSplit
*node
, ExtlTab g
);
153 extern void splittree_rqgeom(WSplit
*node
, int flags
,
154 const WRectangle
*geom
, WRectangle
*geomret
);
157 DYNFUN
void splitinner_replace(WSplitInner
*node
, WSplit
*child
, WSplit
*what
);
158 extern WSplitRegion
*splittree_split(WSplit
*node
, int dir
,
159 WPrimn primn
, int minsize
,
160 WRegionSimpleCreateFn
*fn
,
163 extern void splittree_changeroot(WSplit
*root
, WSplit
*node
);
167 DYNFUN
void splitinner_remove(WSplitInner
*node
, WSplit
*child
,
169 extern void splittree_remove(WSplit
*node
, bool reclaim_space
);
173 extern WSplit
*split_find_root(WSplit
*split
);
174 DYNFUN WSplit
*split_current_todir(WSplit
*node
,
175 WPrimn hprimn
, WPrimn vprimn
,
176 WSplitFilter
*filter
);
177 DYNFUN WSplit
*splitinner_nextto(WSplitInner
*node
, WSplit
*child
,
178 WPrimn hprimn
, WPrimn vprimn
,
179 WSplitFilter
*filter
);
180 DYNFUN WSplit
*splitinner_current(WSplitInner
*node
);
181 DYNFUN
void splitinner_mark_current(WSplitInner
*split
, WSplit
*child
);
182 DYNFUN
void splitinner_forall(WSplitInner
*node
, WSplitFn
*fn
);
183 extern WSplit
*split_nextto(WSplit
*node
,
184 WPrimn hprimn
, WPrimn vprimn
,
185 WSplitFilter
*filter
);
187 /* X window handling */
189 void split_restack(WSplit
*split
, Window win
, int mode
);
190 void split_stacking(WSplit
*split
, Window
*bottom_ret
, Window
*top_ret
);
191 void split_map(WSplit
*split
);
192 void split_unmap(WSplit
*split
);
193 void split_reparent(WSplit
*split
, WWindow
*wwin
);
195 /* Transpose, flip, rotate */
197 extern void split_transpose(WSplit
*split
);
198 extern bool split_transpose_to(WSplit
*split
, const WRectangle
*geom
);
200 extern void splitsplit_flip_default(WSplitSplit
*split
);
201 DYNFUN
void splitsplit_flip(WSplitSplit
*split
);
203 extern bool split_rotate_to(WSplit
*node
, const WRectangle
*geom
,
208 extern bool split_get_config(WSplit
*node
, ExtlTab
*ret
);
209 extern ExtlTab
split_base_config(WSplit
*node
);
213 extern void splittree_begin_resize();
214 extern void splittree_end_resize();
215 extern void splittree_scan_stdisp_rootward(WSplit
*node
);
217 extern void split_do_rqgeom_(WSplit
*node
, const WRectangle
*ng
,
218 bool hany
, bool vany
, WRectangle
*rg
,
222 #endif /* ION_MOD_TILING_SPLIT_H */