File: tiling.h

package info (click to toggle)
notion 4.0.2%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 4,676 kB
  • sloc: ansic: 47,508; sh: 2,096; makefile: 603; perl: 270
file content (132 lines) | stat: -rw-r--r-- 5,032 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
/*
 * ion/mod_tiling/tiling.h
 *
 * Copyright (c) Tuomo Valkonen 1999-2007.
 *
 * See the included file LICENSE for details.
 */

#ifndef ION_MOD_TILING_TILING_H
#define ION_MOD_TILING_TILING_H

#include <libtu/ptrlist.h>
#include <libextl/extl.h>
#include <ioncore/common.h>
#include <ioncore/region.h>
#include <ioncore/screen.h>
#include <ioncore/rectangle.h>
#include <ioncore/pholder.h>
#include <ioncore/navi.h>
#include <ioncore/manage.h>
#include "split.h"


INTRCLASS(WTiling);
DECLCLASS(WTiling){
    WRegion reg;
    WSplit *split_tree;
    WSplitST *stdispnode;
    PtrList *managed_list;
    WRegionSimpleCreateFn *create_frame_fn;
    Window dummywin;
    bool batchop;
};


extern bool tiling_init(WTiling *ws, WWindow *parent, const WFitParams *fp,
                       WRegionSimpleCreateFn *create_frame_fn, bool ci);
extern WTiling *create_tiling(WWindow *parent, const WFitParams *fp,
                            WRegionSimpleCreateFn *create_frame_fn, bool ci);
extern WTiling *create_tiling_simple(WWindow *parent, const WFitParams *fp);
extern void tiling_deinit(WTiling *ws);

extern bool tiling_do_attach_initial(WTiling *tiling, WRegion *reg);

extern ExtlTab tiling_resize_tree(WTiling *ws, WSplit *node, ExtlTab g);

extern WRegion *tiling_current(WTiling *ws);
extern WRegion *tiling_nextto(WTiling *ws, WRegion *reg, const char *str, bool any);
extern WRegion *tiling_farthest(WTiling *ws, const char *str, bool any);
extern WRegion *tiling_region_at(WTiling *ws, int x, int y);

extern WFrame *tiling_split_top(WTiling *ws, const char *dirstr);
extern WFrame *tiling_split_at(WTiling *ws, WFrame *frame,
                              const char *dirstr, bool attach_current);
extern void tiling_unsplit_at(WTiling *ws, WRegion *reg);

extern WSplitSplit *tiling_set_floating(WTiling *ws, WSplitSplit *split,
                                       int sp);

extern WSplit *tiling_split_tree(WTiling *ws);
extern WSplit *tiling_split_of(WTiling *ws, WRegion *reg);

extern void tiling_do_managed_remove(WTiling *ws, WRegion *reg);

DYNFUN bool tiling_managed_add(WTiling *ws, WRegion *reg);
extern bool tiling_managed_add_default(WTiling *ws, WRegion *reg);

extern WRegion *tiling_do_navi_next(WTiling *ws, WRegion *reg,
                                    WRegionNavi nh, bool nowrap,
                                    bool any);
extern WRegion *tiling_do_navi_first(WTiling *ws, WRegionNavi nh,
                                     bool any);
extern WRegion *tiling_navi_next(WTiling *ws, WRegion *reg,
                                 WRegionNavi nh, WRegionNaviData *data);
extern WRegion *tiling_navi_first(WTiling *ws, WRegionNavi nh,
                                  WRegionNaviData *data);

/* Inherited dynfun implementations */

extern bool tiling_fitrep(WTiling *ws, WWindow *par, const WFitParams *fp);
extern void tiling_map(WTiling *ws);
extern void tiling_unmap(WTiling *ws);
extern ExtlTab tiling_get_configuration(WTiling *ws);
extern void tiling_managed_rqgeom(WTiling *ws, WRegion *reg,
                                  const WRQGeomParams *rq,
                                  WRectangle *geomret);
extern void tiling_managed_remove(WTiling *ws, WRegion *reg);
extern void tiling_managed_activated(WTiling *ws, WRegion *reg);
extern bool tiling_rescue_clientwins(WTiling *ws, WRescueInfo *ph);
extern WPHolder *tiling_get_rescue_pholder_for(WTiling *ws, WRegion *mgd);
extern void tiling_do_set_focus(WTiling *ws, bool warp);
extern bool tiling_managed_prepare_focus(WTiling *ws, WRegion *reg,
                                        int flags, WPrepareFocusResult *res);
extern void tiling_manage_stdisp(WTiling *ws, WRegion *stdisp,
                                const WMPlexSTDispInfo *di);
extern void tiling_unmanage_stdisp(WTiling *ws, bool permanent, bool nofocus);

extern void tiling_fallback_focus(WTiling *ws, bool warp);

/* Loading */

/* Stupid C can't handle recursive 'WSplitLoadFn *fn' here, so we have
 * to use the void pointer.
 */
typedef WSplit *WSplitLoadFn(WTiling *ws, const WRectangle *geom, ExtlTab tab);

extern WRegion *tiling_load(WWindow *par, const WFitParams *fp, ExtlTab tab);

DYNFUN WSplit *tiling_load_node(WTiling *ws, const WRectangle *geom, ExtlTab tab);
extern WSplit *tiling_load_node_default(WTiling *ws, const WRectangle *geom, ExtlTab tab);

extern WSplit *load_splitregion(WTiling *ws, const WRectangle *geom, ExtlTab tab);
extern WSplit *load_splitsplit(WTiling *ws, const WRectangle *geom, ExtlTab tab);
extern WSplit *load_splitst(WTiling *ws, const WRectangle *geom, ExtlTab tab);

/* Iteration */

typedef PtrListIterTmp WTilingIterTmp;

#define FOR_ALL_MANAGED_BY_TILING(VAR, WS, TMP) \
    FOR_ALL_ON_PTRLIST(WRegion*, VAR, (WS)->managed_list, TMP)

#define FOR_ALL_MANAGED_BY_TILING_UNSAFE(VAR, WS) \
    FOR_ALL_ON_PTRLIST_UNSAFE(WRegion*, VAR, (WS)->managed_list)

/* Misc. */

#define TILING_STDISP_OF(WS) \
     ((WS)->stdispnode!=NULL ? (WS)->stdispnode->regnode.reg : NULL)


#endif /* ION_MOD_TILING_TILING_H */