From: raster Date: Sat, 22 Jan 2011 02:36:57 +0000 (+0000) Subject: "...PLEASE TEST ASAP AND REPORT TO ME: cedric.bail@free.fr !..." X-Git-Tag: 2.0_alpha~163^2~145 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=abda03c7ea8707cd96122d37148d0861551e1390;p=framework%2Fuifw%2Fedje.git "...PLEASE TEST ASAP AND REPORT TO ME: cedric.bail@free.fr !..." you broke everything in e17 with this - evry apps window bottom half is back now! i'll rever for now and let you re-apply the patch locally and do some testing to find out what you broke with evry in trying to fix this other bug. :) git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/edje@56259 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/lib/edje_private.h b/src/lib/edje_private.h index 4611e04..4612043 100644 --- a/src/lib/edje_private.h +++ b/src/lib/edje_private.h @@ -1493,9 +1493,8 @@ const char * _edje_text_class_font_get(Edje *ed, int *size, char **free_later); -Edje_Real_Part *_edje_real_part_get(const Edje *ed, const char *part); -Edje_Real_Part *_edje_real_part_recursive_get(const Edje *ed, const char *part); -Edje *_edje_recursive_get(Edje *ed, const char *part, Edje_Real_Part **orp); +Edje_Real_Part *_edje_real_part_get(Edje *ed, const char *part); +Edje_Real_Part *_edje_real_part_recursive_get(Edje *ed, const char *part); Edje_Color_Class *_edje_color_class_find(Edje *ed, const char *color_class); void _edje_color_class_member_add(Edje *ed, const char *color_class); void _edje_color_class_member_del(Edje *ed, const char *color_class); diff --git a/src/lib/edje_program.c b/src/lib/edje_program.c index fb6fb43..bb442a7 100644 --- a/src/lib/edje_program.c +++ b/src/lib/edje_program.c @@ -1008,8 +1008,7 @@ _edje_emit(Edje *ed, const char *sig, const char *src) */ if (sep) { - Edje_Real_Part *rp = NULL; - Edje *ed2; + Edje_Real_Part *rp; char *newsig; size_t length; char *part; @@ -1026,20 +1025,24 @@ _edje_emit(Edje *ed, const char *sig, const char *src) *newsig = '\0'; newsig++; - ed2 = _edje_recursive_get(ed, part, &rp); - if (ed2) - { - if (ed2) _edje_emit(ed2, newsig, src); - return; /* stop processing. - * XXX maybe let signal be processed anyway? - * XXX in this case, just comment this line - */ - } - - if (rp) + rp = _edje_real_part_recursive_get(ed, part); + if (rp && rp->part) { switch (rp->part->type) { + case EDJE_PART_TYPE_GROUP: + { + Edje *ed2; + + if (!rp->swallowed_object) break ; + + ed2 = _edje_fetch(rp->swallowed_object); + if (ed2) _edje_emit(ed2, newsig, src); + return; /* stop processing. + * XXX maybe let signal be processed anyway? + * XXX in this case, just comment this line + */ + } case EDJE_PART_TYPE_EXTERNAL: { if (!rp->swallowed_object) break ; @@ -1053,14 +1056,8 @@ _edje_emit(Edje *ed, const char *sig, const char *src) _edje_emit(rp->edje, newsig, src); return; } - default: - fprintf(stderr, "SPANK SPANK SPANK !!!\nYou should never be here !\n"); - break; } } - - *(newsig - 1) = EDJE_PART_PATH_SEPARATOR; - fprintf(stderr, "Not handle: '%s', '%s' !\n", sig, src); } emsg.sig = sig; diff --git a/src/lib/edje_util.c b/src/lib/edje_util.c index 79e5a59..9b8e8ec 100644 --- a/src/lib/edje_util.c +++ b/src/lib/edje_util.c @@ -37,8 +37,7 @@ static Eina_Bool _edje_text_class_list_foreach(const Eina_Hash *hash, const void static void _edje_object_image_preload_cb(void *data, Evas *e, Evas_Object *obj, void *event_info); static void _edje_object_signal_preload_cb(void *data, Evas_Object *obj, const char *emission, const char *source); -Edje_Real_Part *_edje_real_part_recursive_get_helper(const Edje *ed, char **path); -static Edje *_edje_recursive_get_helper(Edje *ed, char **path, Edje_Real_Part **orp); +Edje_Real_Part *_edje_real_part_recursive_get_helper(Edje *ed, char **path); /************************** API Routines **************************/ @@ -4358,7 +4357,7 @@ _edje_real_part_table_clear(Edje_Real_Part *rp, Eina_Bool clear) } Edje_Real_Part * -_edje_real_part_recursive_get(const Edje *ed, const char *part) +_edje_real_part_recursive_get(Edje *ed, const char *part) { Edje_Real_Part *rp; char **path; @@ -4374,23 +4373,6 @@ _edje_real_part_recursive_get(const Edje *ed, const char *part) return rp; } -Edje * -_edje_recursive_get(Edje *ed, const char *part, Edje_Real_Part **orp) -{ - Edje *oed; - char **path; - - path = eina_str_split(part, EDJE_PART_PATH_SEPARATOR_STRING, 0); - if (!path) return NULL; - - //printf("recursive get: %s\n", part); - oed = _edje_recursive_get_helper(ed, path, orp); - - free(*path); - free(path); - return oed; -} - Evas_Object * _edje_children_get(Edje_Real_Part *rp, const char *partid) { @@ -4440,22 +4422,16 @@ _edje_children_get(Edje_Real_Part *rp, const char *partid) } Edje_Real_Part * -_edje_real_part_recursive_get_helper(const Edje *ed, char **path) +_edje_real_part_recursive_get_helper(Edje *ed, char **path) { Edje_Real_Part *rp; Evas_Object *child; const char *alias = NULL; char *idx = NULL; - if (ed->collection && ed->collection->alias) - alias = eina_hash_find(ed->collection->alias, path[0]); - - if (!alias) - alias = path[0]; - //printf(" lookup: %s on %s\n", path[0], ed->parent ? ed->parent : "-"); - if (alias) - idx = strchr(alias, EDJE_PART_PATH_SEPARATOR_INDEXL); + if (path[0]) + idx = strchr(path[0], EDJE_PART_PATH_SEPARATOR_INDEXL); if (idx) { char *end; @@ -4469,16 +4445,18 @@ _edje_real_part_recursive_get_helper(const Edje *ed, char **path) } } - if (alias != path[0]) + if (ed->collection && ed->collection->alias) + alias = eina_hash_find(ed->collection->alias, path[0]); + if (alias) { rp = _edje_real_part_recursive_get(ed, alias); - if (!path[1] && !idx) return rp; + if (!path[1]) return rp; if (!rp) return NULL; } else { rp = _edje_real_part_get(ed, path[0]); - if (!path[1] && !idx) return rp; + if (!path[1]) return rp; if (!rp) return NULL; } @@ -4500,89 +4478,20 @@ _edje_real_part_recursive_get_helper(const Edje *ed, char **path) ed = _edje_fetch(child); if (!ed) return NULL; - return _edje_real_part_recursive_get_helper(ed, path); + if ((rp = _edje_real_part_recursive_get_helper(ed, path))) + return rp; + + return NULL; default: return NULL; } } -/* Private Routines */ -static Edje * -_edje_recursive_get_helper(Edje *ed, char **path, Edje_Real_Part **orp) -{ - Evas_Object *child; - Edje_Real_Part *rp; - const char *alias = NULL; - char *idx = NULL; - - if (ed->collection && ed->collection->alias) - alias = eina_hash_find(ed->collection->alias, path[0]); - - if (!alias) - alias = path[0]; - - //printf(" lookup: %s on %s\n", path[0], ed->parent ? ed->parent : "-"); - if (alias) - idx = strchr(alias, EDJE_PART_PATH_SEPARATOR_INDEXL); - if (idx) - { - char *end; - end = strchr(idx + 1, EDJE_PART_PATH_SEPARATOR_INDEXR); - if (end) - { - *end = '\0'; - *idx = '\0'; - idx++; - } - } - - if (alias != path[0]) - { - rp = _edje_real_part_recursive_get(ed, alias); - if (!rp) return NULL; - if (!path[1] && !idx) return rp->edje; - } - else - { - rp = _edje_real_part_get(ed, path[0]); - if (!rp) return NULL; - if (!path[1] && !idx) return rp->edje; - } - - switch (rp->part->type) - { - case EDJE_PART_TYPE_GROUP: - if (!rp->swallowed_object) return NULL; - ed = _edje_fetch(rp->swallowed_object); - if (!ed) return NULL; - path++; - - if (!path[0]) return ed; - return _edje_recursive_get_helper(ed, path, orp); - case EDJE_PART_TYPE_BOX: - case EDJE_PART_TYPE_TABLE: - case EDJE_PART_TYPE_EXTERNAL: - if (!idx) - { - *orp = rp; - return NULL; - } - path++; - - child = _edje_children_get(rp, idx); - - ed = _edje_fetch(child); - if (!ed) return NULL; - if (!path[0]) return ed; - return _edje_recursive_get_helper(ed, path, orp); - default: - return NULL; - } -} +/* Private Routines */ Edje_Real_Part * -_edje_real_part_get(const Edje *ed, const char *part) +_edje_real_part_get(Edje *ed, const char *part) { unsigned int i;