X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=ioncore%2Fsaveload.c;h=71ddb9dca422f18579c15291a5df9ce934c02509;hb=df57861c962a50bfbf57f276d288395fe0c6a4b6;hp=db8a12f47b55dcb9e9ee043690836ec042aaa750;hpb=ae4260bb64817c11f9a7140324cd3e3ba113e297;p=ion3.git diff --git a/ioncore/saveload.c b/ioncore/saveload.c index db8a12f..71ddb9d 100644 --- a/ioncore/saveload.c +++ b/ioncore/saveload.c @@ -1,7 +1,7 @@ /* * ion/ioncore/saveload.c * - * Copyright (c) Tuomo Valkonen 1999-2007. + * Copyright (c) Tuomo Valkonen 1999-2008. * * See the included file LICENSE for details. */ @@ -35,8 +35,6 @@ static bool layout_load_error=FALSE; static SMAddCallback *add_cb; static SMCfgCallback *cfg_cb; -static SMPHolderCallback *ph_cb; -static bool clientwin_was_missing=FALSE; void ioncore_set_sm_callbacks(SMAddCallback *add, SMCfgCallback *cfg) @@ -53,26 +51,29 @@ void ioncore_get_sm_callbacks(SMAddCallback **add, SMCfgCallback **cfg) } -void ioncore_set_sm_pholder_callback(SMPHolderCallback *phcb) -{ - ph_cb=phcb; -} +/*}}}*/ -void ioncore_clientwin_load_missing() -{ - clientwin_was_missing=TRUE; -} +/*{{{ Load support functions */ -/*}}}*/ +static WPHolder **current_ph_p=NULL; -/*{{{ Load support functions */ +WPHolder *ioncore_get_load_pholder() +{ + if(current_ph_p==NULL){ + return NULL; + }else{ + WPHolder *ph=*current_ph_p; + *current_ph_p=NULL; + return ph; + } +} WRegion *create_region_load(WWindow *par, const WFitParams *fp, - ExtlTab tab) + ExtlTab tab, WPHolder **sm_ph_p) { char *objclass=NULL, *name=NULL; WRegionLoadCreateFn* fn=NULL; @@ -80,6 +81,7 @@ WRegion *create_region_load(WWindow *par, const WFitParams *fp, WRegion *reg=NULL; bool grouped=FALSE; char *grouped_name=NULL; + WPHolder **old_ph_p; if(!extl_table_gets_s(tab, "type", &objclass)) return NULL; @@ -100,19 +102,14 @@ WRegion *create_region_load(WWindow *par, const WFitParams *fp, free(objclass); - clientwin_was_missing=FALSE; + old_ph_p=current_ph_p; + current_ph_p=sm_ph_p; reg=fn(par, fp, tab); - if(reg==NULL){ - if(clientwin_was_missing && add_cb!=NULL && ph_cb!=NULL){ - WPHolder *ph=ph_cb(); - if(ph!=NULL){ - if(!add_cb(ph, tab)) - destroy_obj((Obj*)ph); - } - } - }else{ + current_ph_p=old_ph_p; + + if(reg!=NULL){ if(!OBJ_IS(reg, WClientWin)){ if(extl_table_gets_s(tab, "name", &name)){ region_set_name(reg, name); @@ -121,8 +118,6 @@ WRegion *create_region_load(WWindow *par, const WFitParams *fp, } } - ph_cb=NULL; - return reg; }