X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=ioncore%2Fsaveload.c;h=81dd1dba239897356e9692245f0911b1da042299;hb=bab1a29cb81b48fe5f1f79349db31363e52143c1;hp=b179ccf9ca3926e5334f5090e990f368408d53b1;hpb=de22e45179cb3bafa490294d31d47f361047a30a;p=ion3.git diff --git a/ioncore/saveload.c b/ioncore/saveload.c index b179ccf..81dd1db 100644 --- a/ioncore/saveload.c +++ b/ioncore/saveload.c @@ -1,12 +1,9 @@ /* * ion/ioncore/saveload.c * - * Copyright (c) Tuomo Valkonen 1999-2007. + * Copyright (c) Tuomo Valkonen 1999-2009. * - * 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 - * the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. + * See the included file LICENSE for details. */ #include @@ -38,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) @@ -56,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; @@ -83,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; @@ -103,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); @@ -124,8 +118,6 @@ WRegion *create_region_load(WWindow *par, const WFitParams *fp, } } - ph_cb=NULL; - return reg; }