From 70c734ebdd8973ca67740ba4b060767a68d073e0 Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Tue, 14 Feb 2012 14:07:39 +0000 Subject: [PATCH] edje: add broadcast_signal: bool. This make it possible to completly disable signal broadcasting as this new behaviour broke Edje 1.0 file. It's also now possible to use the same group in different part in the same parent group without any issue. I am tempted to backport this patch to 1.1 branch as it would make it play nicely with file coming from Edje 1.0. Another issue that this patch fix is that I did increment the minor version as we really have add a lot of addition since Edje 1.1 and Edje file build with trunk may not play well anymore on Edje 1.1. SVN revision: 67936 --- legacy/edje/ChangeLog | 4 ++++ legacy/edje/NEWS | 1 + legacy/edje/src/bin/edje_cc_handlers.c | 25 +++++++++++++++++++++++++ legacy/edje/src/lib/edje_cache.c | 6 +++++- legacy/edje/src/lib/edje_private.h | 4 +++- legacy/edje/src/lib/edje_program.c | 2 +- 6 files changed, 39 insertions(+), 3 deletions(-) diff --git a/legacy/edje/ChangeLog b/legacy/edje/ChangeLog index 183956aefd..00d9c78020 100644 --- a/legacy/edje/ChangeLog +++ b/legacy/edje/ChangeLog @@ -344,3 +344,7 @@ * add edje_object_part_text_prediction_allow_set/get. These APIs can be used to set whether prediction feature is allowed or not. + +2012-02-14 Cedric Bail + + * add a way to disable signal broadcasting introduced in edje 1.1. diff --git a/legacy/edje/NEWS b/legacy/edje/NEWS index f4f49b2911..0d0f7fc379 100644 --- a/legacy/edje/NEWS +++ b/legacy/edje/NEWS @@ -11,6 +11,7 @@ Additions: * minmul edc property. * add min: SOURCE and max: SOURCE. * add edje_object_markup_filter_callback_add/del/delfull(). + * add broadcast_signal: bool. Improvements: * speedup load time of Edje file. diff --git a/legacy/edje/src/bin/edje_cc_handlers.c b/legacy/edje/src/bin/edje_cc_handlers.c index 2fdf6604a7..f299114ab0 100644 --- a/legacy/edje/src/bin/edje_cc_handlers.c +++ b/legacy/edje/src/bin/edje_cc_handlers.c @@ -106,6 +106,7 @@ static void st_collections_group_script_only(void); static void st_collections_group_alias(void); static void st_collections_group_min(void); static void st_collections_group_max(void); +static void st_collections_group_broadcast_signal(void); static void st_collections_group_data_item(void); static void st_collections_group_orientation(void); @@ -317,6 +318,7 @@ New_Statement_Handler statement_handlers[] = {"collections.group.alias", st_collections_group_alias}, {"collections.group.min", st_collections_group_min}, {"collections.group.max", st_collections_group_max}, + {"collections.group.broadcast_signal", st_collections_group_broadcast_signal}, {"collections.group.orientation", st_collections_group_orientation}, {"collections.group.data.item", st_collections_group_data_item}, {"collections.group.limits.horizontal", st_collections_group_limits_horizontal}, @@ -2151,6 +2153,7 @@ ob_collections_group(void) pc = mem_alloc(SZ(Edje_Part_Collection)); edje_collections = eina_list_append(edje_collections, pc); pc->id = current_de->id; + pc->broadcast_signal = EINA_TRUE; /* This was the behaviour by default in Edje 1.1 */ cd = mem_alloc(SZ(Code)); codes = eina_list_append(codes, cd); @@ -2571,6 +2574,28 @@ st_collections_group_max(void) pc->prop.max.h = parse_int_range(1, 0, 0x7fffffff); } +/** + @page edcref + @property + broadcast_signal + @parameters + [broadcast] + @effect + Signal got automatically broadcasted to all sub group part. Default to + true since 1.1. + @endproperty +*/ +static void +st_collections_group_broadcast_signal(void) +{ + Edje_Part_Collection *pc; + + check_arg_count(1); + + pc = eina_list_data_get(eina_list_last(edje_collections)); + pc->broadcast_signal = parse_bool(0); +} + /** @page edcref @block diff --git a/legacy/edje/src/lib/edje_cache.c b/legacy/edje/src/lib/edje_cache.c index 0ce6b30242..02d16b539a 100644 --- a/legacy/edje/src/lib/edje_cache.c +++ b/legacy/edje/src/lib/edje_cache.c @@ -76,12 +76,16 @@ _edje_file_coll_open(Edje_File *edf, const char *coll) edc->references = 1; edc->part = ce->entry; - /* For Edje file build with Edje 1.0, people expect text.align to be 0.0 0.0 */ + /* For Edje file build with Edje 1.0 */ if (edf->version <= 3 && edf->minor <= 1) { /* This will preserve previous rendering */ unsigned int i; + /* people expect signal to not be broadcasted */ + edc->broadcast_signal = EINA_FALSE; + + /* people expect text.align to be 0.0 0.0 */ for (i = 0; i < edc->parts_count; ++i) { if (edc->parts[i]->type == EDJE_PART_TYPE_TEXTBLOCK) diff --git a/legacy/edje/src/lib/edje_private.h b/legacy/edje/src/lib/edje_private.h index 30339b146d..d5926e371b 100644 --- a/legacy/edje/src/lib/edje_private.h +++ b/legacy/edje/src/lib/edje_private.h @@ -173,7 +173,7 @@ struct _Edje_Smart_Api /* increment this when you add new feature to edje file format without * breaking backward compatibility. */ -#define EDJE_FILE_MINOR 2 +#define EDJE_FILE_MINOR 3 /* FIXME: * @@ -755,6 +755,8 @@ struct _Edje_Part_Collection unsigned char lua_script_only; + unsigned char broadcast_signal; + unsigned char checked : 1; }; diff --git a/legacy/edje/src/lib/edje_program.c b/legacy/edje/src/lib/edje_program.c index 2c9010e05e..b080eb3df0 100644 --- a/legacy/edje/src/lib/edje_program.c +++ b/legacy/edje/src/lib/edje_program.c @@ -873,7 +873,7 @@ _edje_emit_full(Edje *ed, const char *sig, const char *src, void *data, void (*f { Edje_Message_Signal emsg; const char *sep; - Eina_Bool broadcast = EINA_TRUE; + Eina_Bool broadcast = ed->collection->broadcast_signal; if (ed->delete_me) return;