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