From c8cc776fb1174bd49a451f0dcf77af3e10747585 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 25 Mar 2014 11:12:21 -0400 Subject: [PATCH] edje_cc now supports targets for SIGNAL_EMIT actions this is much more intuitive than somehow knowing you're supposed to add a ':' between part:signal @feature --- src/bin/edje/edje_cc_handlers.c | 5 +++-- src/lib/edje/edje_program.c | 16 +++++++++++++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c index 053a4b7..cef2ad9 100644 --- a/src/bin/edje/edje_cc_handlers.c +++ b/src/bin/edje/edje_cc_handlers.c @@ -10374,6 +10374,7 @@ _program_target_add(char *name) data_queue_program_lookup(pc, name, &(et->id)); break; case EDJE_ACTION_TYPE_STATE_SET: + case EDJE_ACTION_TYPE_SIGNAL_EMIT: case EDJE_ACTION_TYPE_DRAG_VAL_SET: case EDJE_ACTION_TYPE_DRAG_VAL_STEP: case EDJE_ACTION_TYPE_DRAG_VAL_PAGE: @@ -10408,7 +10409,7 @@ _program_target_add(char *name) [target] @effect Program or part on which the specified action acts. Multiple target - keywords may be specified, one per target. SIGNAL_EMITs do not have + keywords may be specified, one per target. SIGNAL_EMITs can have targets. @endproperty */ @@ -10431,7 +10432,7 @@ st_collections_group_programs_program_target(void) @since 1.10 @effect Programs or parts upon which the specified action will act. Multiple target - or targets keywords may be specified. SIGNAL_EMITs do not have + or targets keywords may be specified. SIGNAL_EMITs can have targets. @endproperty */ diff --git a/src/lib/edje/edje_program.c b/src/lib/edje/edje_program.c index aebf424..e4dbd7e 100644 --- a/src/lib/edje/edje_program.c +++ b/src/lib/edje/edje_program.c @@ -628,7 +628,21 @@ low_mem_current: case EDJE_ACTION_TYPE_SIGNAL_EMIT: // _edje_emit(ed, "program,start", pr->name); if (_edje_block_break(ed)) goto break_prog; - _edje_emit(ed, pr->state, pr->state2); + if (pr->targets) + { + EINA_LIST_FOREACH(pr->targets, l, pt) + { + char buf[1024]; + + if (pt->id < 0) continue; + rp = ed->table_parts[pt->id % ed->table_parts_size]; + if (!rp) continue; + snprintf(buf, sizeof(buf), "%s:%s", rp->part->name, pr->state); + _edje_emit(ed, buf, pr->state2); + } + } + else + _edje_emit(ed, pr->state, pr->state2); if (_edje_block_break(ed)) goto break_prog; // _edje_emit(ed, "program,stop", pr->name); if (_edje_block_break(ed)) goto break_prog; -- 2.7.4