]> git.decadent.org.uk Git - ion3.git/blobdiff - ioncore/attach.c
[svn-upgrade] Integrating new upstream version, ion3 (20070203)
[ion3.git] / ioncore / attach.c
index 23004cb143bbdaf284780ad5735c72439456208a..4eeb64e65dc184cc6303c5a7127e1b4a0ff0a05b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * ion/ioncore/attach.c
  *
- * Copyright (c) Tuomo Valkonen 1999-2006
+ * Copyright (c) Tuomo Valkonen 1999-2007
  *
  * Ion is free software; you can redistribute it and/or modify it under
  * the terms of the GNU Lesser General Public License as published by
@@ -35,7 +35,7 @@ static WRegion *doit_new(WRegion *mgr,
     
     if(reg==NULL)
         return NULL;
-    
+        
     if(!cont(mgr, reg, cont_param)){
         destroy_obj((Obj*)reg);
         return NULL;
@@ -90,21 +90,31 @@ static WRegion *wrap_load(WWindow *par, const WFitParams *fp,
 }
 
 
+WRegion *ioncore_newly_created=NULL;
+
+
 static WRegion *doit_load(WRegion *mgr,
                           WWindow *par, const WFitParams *fp,
                           WRegionDoAttachFn *cont, void *cont_param,
                           ExtlTab tab)
 {
-    WRegion *reg;
+    WRegion *reg=NULL;
     
     if(extl_table_gets_o(tab, "reg", (Obj**)&reg)){
         if(!OBJ_IS(reg, WRegion))
             return FALSE;
+    }/*else if(extl_table_is_bool_set(tab, "reg_use_new")){
+        reg=ioncore_newly_created;
+        if(reg==NULL)
+            return NULL;
+    }*/
+    
+    if(reg!=NULL){
         return doit_reparent(mgr, par, fp, cont, cont_param, reg);
+    }else{
+        return doit_new(mgr, par, fp, cont, cont_param,
+                        (WRegionCreateFn*)wrap_load, &tab);
     }
-    
-    return doit_new(mgr, par, fp, cont, cont_param,
-                    (WRegionCreateFn*)wrap_load, &tab);
 }
 
 WRegion *region_attach_helper(WRegion *mgr,