2 * ion/mod_tiling/tiling.h
4 * Copyright (c) Tuomo Valkonen 1999-2009.
6 * See the included file LICENSE for details.
9 #ifndef ION_MOD_TILING_TILING_H
10 #define ION_MOD_TILING_TILING_H
12 #include <libtu/ptrlist.h>
13 #include <libextl/extl.h>
14 #include <ioncore/common.h>
15 #include <ioncore/region.h>
16 #include <ioncore/screen.h>
17 #include <ioncore/rectangle.h>
18 #include <ioncore/pholder.h>
19 #include <ioncore/navi.h>
20 #include <ioncore/manage.h>
29 PtrList
*managed_list
;
30 WRegionSimpleCreateFn
*create_frame_fn
;
36 extern bool tiling_init(WTiling
*ws
, WWindow
*parent
, const WFitParams
*fp
,
37 WRegionSimpleCreateFn
*create_frame_fn
, bool ci
);
38 extern WTiling
*create_tiling(WWindow
*parent
, const WFitParams
*fp
,
39 WRegionSimpleCreateFn
*create_frame_fn
, bool ci
);
40 extern WTiling
*create_tiling_simple(WWindow
*parent
, const WFitParams
*fp
);
41 extern void tiling_deinit(WTiling
*ws
);
43 extern bool tiling_do_attach_initial(WTiling
*tiling
, WRegion
*reg
);
45 extern ExtlTab
tiling_resize_tree(WTiling
*ws
, WSplit
*node
, ExtlTab g
);
47 extern WRegion
*tiling_current(WTiling
*ws
);
48 extern WRegion
*tiling_nextto(WTiling
*ws
, WRegion
*reg
, const char *str
, bool any
);
49 extern WRegion
*tiling_farthest(WTiling
*ws
, const char *str
, bool any
);
50 extern WRegion
*tiling_region_at(WTiling
*ws
, int x
, int y
);
52 extern WFrame
*tiling_split_top(WTiling
*ws
, const char *dirstr
);
53 extern WFrame
*tiling_split_at(WTiling
*ws
, WFrame
*frame
,
54 const char *dirstr
, bool attach_current
);
55 extern void tiling_unsplit_at(WTiling
*ws
, WRegion
*reg
);
57 extern WSplitSplit
*tiling_set_floating(WTiling
*ws
, WSplitSplit
*split
,
60 extern WSplit
*tiling_split_tree(WTiling
*ws
);
61 extern WSplit
*tiling_split_of(WTiling
*ws
, WRegion
*reg
);
63 extern void tiling_do_managed_remove(WTiling
*ws
, WRegion
*reg
);
65 DYNFUN
bool tiling_managed_add(WTiling
*ws
, WRegion
*reg
);
66 extern bool tiling_managed_add_default(WTiling
*ws
, WRegion
*reg
);
68 extern WRegion
*tiling_do_navi_next(WTiling
*ws
, WRegion
*reg
,
69 WRegionNavi nh
, bool nowrap
,
71 extern WRegion
*tiling_do_navi_first(WTiling
*ws
, WRegionNavi nh
,
73 extern WRegion
*tiling_navi_next(WTiling
*ws
, WRegion
*reg
,
74 WRegionNavi nh
, WRegionNaviData
*data
);
75 extern WRegion
*tiling_navi_first(WTiling
*ws
, WRegionNavi nh
,
76 WRegionNaviData
*data
);
78 /* Inherited dynfun implementations */
80 extern bool tiling_fitrep(WTiling
*ws
, WWindow
*par
, const WFitParams
*fp
);
81 extern void tiling_map(WTiling
*ws
);
82 extern void tiling_unmap(WTiling
*ws
);
83 extern ExtlTab
tiling_get_configuration(WTiling
*ws
);
84 extern void tiling_managed_rqgeom(WTiling
*ws
, WRegion
*reg
,
85 const WRQGeomParams
*rq
,
87 extern void tiling_managed_remove(WTiling
*ws
, WRegion
*reg
);
88 extern bool tiling_rescue_clientwins(WTiling
*ws
, WRescueInfo
*ph
);
89 extern WPHolder
*tiling_get_rescue_pholder_for(WTiling
*ws
, WRegion
*mgd
);
90 extern void tiling_do_set_focus(WTiling
*ws
, bool warp
);
91 extern bool tiling_managed_prepare_focus(WTiling
*ws
, WRegion
*reg
,
92 int flags
, WPrepareFocusResult
*res
);
93 extern void tiling_manage_stdisp(WTiling
*ws
, WRegion
*stdisp
,
94 const WMPlexSTDispInfo
*di
);
95 extern void tiling_unmanage_stdisp(WTiling
*ws
, bool permanent
, bool nofocus
);
97 extern void tiling_fallback_focus(WTiling
*ws
, bool warp
);
101 /* Stupid C can't handle recursive 'WSplitLoadFn *fn' here, so we have
102 * to use the void pointer.
104 typedef WSplit
*WSplitLoadFn(WTiling
*ws
, const WRectangle
*geom
, ExtlTab tab
);
106 extern WRegion
*tiling_load(WWindow
*par
, const WFitParams
*fp
, ExtlTab tab
);
108 DYNFUN WSplit
*tiling_load_node(WTiling
*ws
, const WRectangle
*geom
, ExtlTab tab
);
109 extern WSplit
*tiling_load_node_default(WTiling
*ws
, const WRectangle
*geom
, ExtlTab tab
);
111 extern WSplit
*load_splitregion(WTiling
*ws
, const WRectangle
*geom
, ExtlTab tab
);
112 extern WSplit
*load_splitsplit(WTiling
*ws
, const WRectangle
*geom
, ExtlTab tab
);
113 extern WSplit
*load_splitst(WTiling
*ws
, const WRectangle
*geom
, ExtlTab tab
);
117 typedef PtrListIterTmp WTilingIterTmp
;
119 #define FOR_ALL_MANAGED_BY_TILING(VAR, WS, TMP) \
120 FOR_ALL_ON_PTRLIST(WRegion*, VAR, (WS)->managed_list, TMP)
122 #define FOR_ALL_MANAGED_BY_TILING_UNSAFE(VAR, WS) \
123 FOR_ALL_ON_PTRLIST_UNSAFE(WRegion*, VAR, (WS)->managed_list)
127 #define TILING_STDISP_OF(WS) \
128 ((WS)->stdispnode!=NULL ? (WS)->stdispnode->regnode.reg : NULL)
131 #endif /* ION_MOD_TILING_TILING_H */