]> git.decadent.org.uk Git - ion3.git/blob - mod_tiling/tiling.h
[svn-inject] Installing original source of ion3
[ion3.git] / mod_tiling / tiling.h
1 /*
2  * ion/mod_tiling/tiling.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_MOD_TILING_TILING_H
13 #define ION_MOD_TILING_TILING_H
14
15 #include <libtu/ptrlist.h>
16 #include <libextl/extl.h>
17 #include <ioncore/common.h>
18 #include <ioncore/region.h>
19 #include <ioncore/screen.h>
20 #include <ioncore/rectangle.h>
21 #include <ioncore/pholder.h>
22 #include <ioncore/navi.h>
23 #include "split.h"
24
25
26 INTRCLASS(WTiling);
27 DECLCLASS(WTiling){
28     WRegion reg;
29     WSplit *split_tree;
30     WSplitST *stdispnode;
31     PtrList *managed_list;
32     WRegionSimpleCreateFn *create_frame_fn;
33     Window dummywin;
34 };
35
36
37 extern bool tiling_init(WTiling *ws, WWindow *parent, const WFitParams *fp,
38                        WRegionSimpleCreateFn *create_frame_fn, bool ci);
39 extern WTiling *create_tiling(WWindow *parent, const WFitParams *fp, 
40                             WRegionSimpleCreateFn *create_frame_fn, bool ci);
41 extern WTiling *create_tiling_simple(WWindow *parent, const WFitParams *fp);
42 extern void tiling_deinit(WTiling *ws);
43
44 extern ExtlTab tiling_resize_tree(WTiling *ws, WSplit *node, ExtlTab g);
45
46 extern WRegion *tiling_current(WTiling *ws);
47 extern WRegion *tiling_nextto(WTiling *ws, WRegion *reg, const char *str, bool any);
48 extern WRegion *tiling_farthest(WTiling *ws, const char *str, bool any);
49 extern WRegion *tiling_region_at(WTiling *ws, int x, int y);
50
51 extern WFrame *tiling_split_top(WTiling *ws, const char *dirstr);
52 extern WFrame *tiling_split_at(WTiling *ws, WFrame *frame, 
53                               const char *dirstr, bool attach_current);
54 extern bool tiling_unsplit_at(WTiling *ws, WFrame *frame);
55
56 extern WSplitSplit *tiling_set_floating(WTiling *ws, WSplitSplit *split, 
57                                        int sp);
58
59 extern WSplit *tiling_split_tree(WTiling *ws);
60 extern WSplit *tiling_split_of(WTiling *ws, WRegion *reg);
61
62 extern void tiling_do_managed_remove(WTiling *ws, WRegion *reg);
63
64 DYNFUN bool tiling_managed_add(WTiling *ws, WRegion *reg);
65 extern bool tiling_managed_add_default(WTiling *ws, WRegion *reg);
66
67 extern WRegion *tiling_do_navi_next(WTiling *ws, WRegion *reg, 
68                                     WRegionNavi nh, bool nowrap,
69                                     bool any);
70 extern WRegion *tiling_do_navi_first(WTiling *ws, WRegionNavi nh, 
71                                      bool any);
72 extern WRegion *tiling_navi_next(WTiling *ws, WRegion *reg, 
73                                  WRegionNavi nh, WRegionNaviData *data);
74 extern WRegion *tiling_navi_first(WTiling *ws, WRegionNavi nh,
75                                   WRegionNaviData *data);
76
77 /* Inherited dynfun implementations */
78
79 extern bool tiling_fitrep(WTiling *ws, WWindow *par, const WFitParams *fp);
80 extern void tiling_map(WTiling *ws);
81 extern void tiling_unmap(WTiling *ws);
82 extern ExtlTab tiling_get_configuration(WTiling *ws);
83 extern void tiling_managed_rqgeom(WTiling *ws, WRegion *reg,
84                                   const WRQGeomParams *rq,
85                                   WRectangle *geomret);
86 extern void tiling_managed_remove(WTiling *ws, WRegion *reg);
87 extern void tiling_managed_activated(WTiling *ws, WRegion *reg);
88 extern bool tiling_rescue_clientwins(WTiling *ws, WPHolder *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 bool tiling_managed_may_destroy(WTiling *ws, WRegion *reg);
94 extern void tiling_manage_stdisp(WTiling *ws, WRegion *stdisp, 
95                                 const WMPlexSTDispInfo *di);
96 extern void tiling_unmanage_stdisp(WTiling *ws, bool permanent, bool nofocus);
97
98 extern void tiling_fallback_focus(WTiling *ws, bool warp);
99
100 /* Loading */
101
102 /* Stupid C can't handle recursive 'WSplitLoadFn *fn' here, so we have
103  * to use the void pointer.
104  */
105 typedef WSplit *WSplitLoadFn(WTiling *ws, const WRectangle *geom, ExtlTab tab);
106
107 extern WRegion *tiling_load(WWindow *par, const WFitParams *fp, ExtlTab tab);
108
109 DYNFUN WSplit *tiling_load_node(WTiling *ws, const WRectangle *geom, ExtlTab tab);
110 extern WSplit *tiling_load_node_default(WTiling *ws, const WRectangle *geom, ExtlTab tab);
111
112 extern WSplit *load_splitregion(WTiling *ws, const WRectangle *geom, ExtlTab tab);
113 extern WSplit *load_splitsplit(WTiling *ws, const WRectangle *geom, ExtlTab tab);
114 extern WSplit *load_splitst(WTiling *ws, const WRectangle *geom, ExtlTab tab);
115
116 /* Iteration */
117
118 typedef PtrListIterTmp WTilingIterTmp;
119
120 #define FOR_ALL_MANAGED_BY_TILING(VAR, WS, TMP) \
121     FOR_ALL_ON_PTRLIST(WRegion*, VAR, (WS)->managed_list, TMP)
122     
123 #define FOR_ALL_MANAGED_BY_TILING_UNSAFE(VAR, WS) \
124     FOR_ALL_ON_PTRLIST_UNSAFE(WRegion*, VAR, (WS)->managed_list)
125
126
127 #endif /* ION_MOD_TILING_TILING_H */