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
This commit is contained in:
Cedric BAIL 2012-02-14 14:07:39 +00:00
parent 5d4f7667cb
commit 70c734ebdd
6 changed files with 39 additions and 3 deletions

View File

@ -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.

View File

@ -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.

View File

@ -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

View File

@ -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)

View File

@ -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;
};

View File

@ -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;