]> git.decadent.org.uk Git - ion3.git/blob - ioncore/attach.h
Imported Upstream version 20090110
[ion3.git] / ioncore / attach.h
1 /*
2  * ion/ioncore/attach.h
3  *
4  * Copyright (c) Tuomo Valkonen 1999-2009. 
5  *
6  * See the included file LICENSE for details.
7  */
8
9 #ifndef ION_IONCORE_ATTACH_H
10 #define ION_IONCORE_ATTACH_H
11
12 #include "region.h"
13 #include "reginfo.h"
14 #include "window.h"
15
16
17 typedef WRegion *WRegionCreateFn(WWindow *parent, 
18                                  const WFitParams *fp, 
19                                  void *param);
20
21 typedef WRegion *WRegionAttachFn(WRegion *reg, 
22                                  void *param, 
23                                  WRegionAttachData *data);
24
25
26 typedef enum{
27     REGION_ATTACH_REPARENT,
28     REGION_ATTACH_NEW,
29     REGION_ATTACH_LOAD
30 } WRegionAttachType;
31
32
33 DECLSTRUCT(WRegionAttachData){
34     WRegionAttachType type;
35     union{
36         WRegion *reg;
37         struct{
38             WRegionCreateFn *fn;
39             void *param;
40         } n;
41         ExtlTab tab;
42     } u;
43 };
44
45
46 typedef bool WRegionDoAttachFn(WRegion *reg, WRegion *sub, void *param);
47 typedef bool WRegionDoAttachFnSimple(WRegion *reg, WRegion *sub);
48
49 extern WRegion *region_attach_helper(WRegion *mgr,
50                                      WWindow *par, const WFitParams *fp,
51                                      WRegionDoAttachFn *fn, void *fn_param,
52                                      const WRegionAttachData *data);
53
54 extern WRegion *region_attach_load_helper(WRegion *mgr,
55                                           WWindow *par, const WFitParams *fp,
56                                           WRegionDoAttachFn *fn, void *fn_param,
57                                           ExtlTab tab, WPHolder **sm_ph);
58
59 extern bool region_ancestor_check(WRegion *dst, WRegion *reg);
60
61 extern void region_postdetach_dispose(WRegion *reg, WRegion *disposeroot);
62
63
64 #endif /* ION_IONCORE_ATTACH_H */