4 * Copyright (c) Tuomo Valkonen 1999-2009.
6 * See the included file LICENSE for details.
9 #ifndef ION_IONCORE_GROUP_H
10 #define ION_IONCORE_GROUP_H
12 #include <libextl/extl.h>
13 #include <ioncore/common.h>
14 #include <ioncore/region.h>
15 #include <ioncore/screen.h>
16 #include <ioncore/manage.h>
17 #include <ioncore/rectangle.h>
18 #include <ioncore/pholder.h>
19 #include <ioncore/stacking.h>
22 INTRSTRUCT(WGroupAttachParams
);
24 typedef WRegionSimpleCreateFn WGroupMkFrameFn
;
27 DECLSTRUCT(WGroupAttachParams
){
46 #define GROUPATTACHPARAMS_INIT \
47 {0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0}, 0, 0, NULL}
52 WStacking
*managed_list
;
53 WStacking
*managed_stdisp
;
54 WStacking
*current_managed
;
61 extern bool group_init(WGroup
*grp
, WWindow
*parent
, const WFitParams
*fp
);
62 extern WGroup
*create_group(WWindow
*parent
, const WFitParams
*fp
);
63 extern void group_deinit(WGroup
*grp
);
65 extern WRegion
*group_load(WWindow
*par
, const WFitParams
*fp
,
67 extern void group_do_load(WGroup
*ws
, ExtlTab tab
);
69 extern WRegion
* group_current(WGroup
*group
);
71 DYNFUN WStacking
*group_do_add_managed(WGroup
*ws
, WRegion
*reg
,
72 int level
, WSizePolicy szplcy
);
73 extern WStacking
*group_do_add_managed_default(WGroup
*ws
, WRegion
*reg
,
74 int level
, WSizePolicy szplcy
);
76 extern void groupattachparams_get(WGroupAttachParams
*par
, ExtlTab tab
,
79 extern WRegion
*group_do_attach(WGroup
*ws
,
80 WGroupAttachParams
*param
,
81 WRegionAttachData
*data
);
82 extern bool group_do_attach_final(WGroup
*ws
,
84 const WGroupAttachParams
*param
);
86 extern WRegion
*group_attach(WGroup
*ws
, WRegion
*reg
, ExtlTab param
);
87 extern WRegion
*group_attach_new(WGroup
*ws
, ExtlTab param
);
89 extern void group_manage_stdisp(WGroup
*ws
, WRegion
*stdisp
,
90 const WMPlexSTDispInfo
*di
);
92 extern void group_managed_remove(WGroup
*ws
, WRegion
*reg
);
94 extern void group_managed_notify(WGroup
*ws
, WRegion
*reg
, WRegionNotify how
);
96 extern WRegion
*group_bottom(WGroup
*ws
);
97 extern bool group_set_bottom(WGroup
*ws
, WRegion
*reg
);
98 DYNFUN
void group_bottom_set(WGroup
*grp
);
100 extern bool group_rescue_clientwins(WGroup
*ws
, WRescueInfo
*info
);
102 extern bool group_rqclose(WGroup
*ws
);
103 extern bool group_rqclose_relocate(WGroup
*ws
);
105 extern bool group_managed_rqorder(WGroup
*grp
, WRegion
*sub
,
108 extern WStacking
*group_find_stacking(WGroup
*ws
, WRegion
*r
);
109 extern WStacking
*group_find_to_focus(WGroup
*ws
, WStacking
*to_try
);
111 extern WRegion
*region_groupleader_of(WRegion
*reg
);
112 /*extern WRegion *region_group_of(WRegion *reg);*/
114 extern ExtlTab
group_get_configuration(WGroup
*ws
);
117 typedef WStackingFilter WGroupIterFilter
;
118 typedef WStackingIterTmp WGroupIterTmp
;
120 extern void group_iter_init(WGroupIterTmp
*tmp
, WGroup
*ws
);
121 extern WRegion
*group_iter(WGroupIterTmp
*tmp
);
122 extern WStacking
*group_iter_nodes(WGroupIterTmp
*tmp
);
124 extern WStacking
*group_get_stacking(WGroup
*ws
);
125 extern WStacking
**group_get_stackingp(WGroup
*ws
);
127 #define FOR_ALL_MANAGED_BY_GROUP(WS, VAR, TMP) \
128 for(group_iter_init(&(TMP), WS), \
129 VAR=group_iter(&(TMP)); \
131 VAR=group_iter(&(TMP)))
133 #define FOR_ALL_NODES_IN_GROUP(WS, VAR, TMP) \
134 for(group_iter_init(&(TMP), WS), \
135 VAR=group_iter_nodes(&(TMP)); \
137 VAR=group_iter_nodes(&(TMP)))
139 extern WGroupIterTmp group_iter_default_tmp
;
142 #endif /* ION_IONCORE_GROUP_H */