Enlightenment CVS committal Author : rephorm Project : e17 Module : libs/edje
Dir : e17/libs/edje/src/lib Modified Files: edje_load.c Log Message: if you set a file on an edje object that already has swallows, they will now be tracked and re-swallowed =================================================================== RCS file: /cvs/e/e17/libs/edje/src/lib/edje_load.c,v retrieving revision 1.96 retrieving revision 1.97 diff -u -3 -r1.96 -r1.97 --- edje_load.c 6 Mar 2007 12:03:34 -0000 1.96 +++ edje_load.c 16 Mar 2007 21:37:57 -0000 1.97 @@ -11,6 +11,8 @@ static int _edje_collection_free_prog_cache_matches_free_cb(Evas_Hash *hash, const char *key, void *data, void *fdata); #endif +static Evas_List *_edje_swallows_collect(Edje *ed); + /************************** API Routines **************************/ /* FIXDOC: Verify/expand doc */ @@ -28,6 +30,7 @@ { Edje *ed; int n; + Evas_List *old_swallows; ed = _edje_fetch(obj); if (!ed) return 0; @@ -36,7 +39,9 @@ if (((ed->path) && (!strcmp(file, ed->path))) && (ed->part) && (!strcmp(part, ed->part))) return 1; - + + old_swallows = _edje_swallows_collect(ed); + _edje_file_del(ed); if (ed->path) evas_stringshare_del(ed->path); @@ -263,6 +268,25 @@ if ((evas_object_clipees_get(ed->clipper)) && (evas_object_visible_get(obj))) evas_object_show(ed->clipper); + + /* reswallow any swallows that existed before setting the file */ + if (old_swallows) + { + while (old_swallows) + { + const char *name; + Evas_Object *swallow; + + name = old_swallows->data; + old_swallows = evas_list_remove_list(old_swallows, old_swallows); + + swallow = old_swallows->data; + old_swallows = evas_list_remove_list(old_swallows, old_swallows); + + edje_object_part_swallow(obj, name, swallow); + evas_stringshare_del(name); + } + } _edje_recalc(ed); _edje_thaw(ed); @@ -455,6 +479,25 @@ ed->file = NULL; } } +} + +static Evas_List * +_edje_swallows_collect(Edje *ed) +{ + Evas_List *swallows = NULL; + Evas_List *l; + if (!ed->file || !ed->parts) return NULL; + + for (l = ed->parts; l; l = l->next) + { + Edje_Real_Part *rp; + + rp = l->data; + if (!rp->swallowed_object) continue; + swallows = evas_list_append(swallows, evas_stringshare_add(rp->part->name)); + swallows = evas_list_append(swallows, rp->swallowed_object); + } + return swallows; } void ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs