X-Git-Url: https://git.decadent.org.uk/gitweb/?p=ion3.git;a=blobdiff_plain;f=ioncore%2Fattach.c;h=4eeb64e65dc184cc6303c5a7127e1b4a0ff0a05b;hp=23004cb143bbdaf284780ad5735c72439456208a;hb=803afbc1cd633f6c025bcd9537e9b7e9aedadd0d;hpb=8366314611bf30a0f31d25bf5f5023186fa87692 diff --git a/ioncore/attach.c b/ioncore/attach.c index 23004cb..4eeb64e 100644 --- a/ioncore/attach.c +++ b/ioncore/attach.c @@ -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**)®)){ 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,