static void st_collections_group_parts_part_description_params_string(void);
static void st_collections_group_programs_program_signal(void);
static void st_collections_group_programs_program_source(void);
-static void st_collections_group_programs_program_filter_state(void);
+static void st_collections_group_programs_program_filter(void);
static void st_collections_group_programs_program_in(void);
static void st_collections_group_programs_program_action(void);
static void st_collections_group_programs_program_transition(void);
{"collections.group.parts.program.name", st_collections_group_programs_program_name}, /* dup */
{"collections.group.parts.program.signal", st_collections_group_programs_program_signal}, /* dup */
{"collections.group.parts.program.source", st_collections_group_programs_program_source}, /* dup */
- {"collections.group.parts.program.filter_state", st_collections_group_programs_program_filter_state}, /* dup */
+ {"collections.group.parts.program.filter", st_collections_group_programs_program_filter}, /* dup */
{"collections.group.parts.program.in", st_collections_group_programs_program_in}, /* dup */
{"collections.group.parts.program.action", st_collections_group_programs_program_action}, /* dup */
{"collections.group.parts.program.transition", st_collections_group_programs_program_transition}, /* dup */
{"collections.group.program.name", st_collections_group_programs_program_name}, /* dup */
{"collections.group.program.signal", st_collections_group_programs_program_signal}, /* dup */
{"collections.group.program.source", st_collections_group_programs_program_source}, /* dup */
- {"collections.group.program.filter_state", st_collections_group_programs_program_filter_state}, /* dup */
+ {"collections.group.program.filter", st_collections_group_programs_program_filter}, /* dup */
{"collections.group.program.in", st_collections_group_programs_program_in}, /* dup */
{"collections.group.program.action", st_collections_group_programs_program_action}, /* dup */
{"collections.group.program.transition", st_collections_group_programs_program_transition}, /* dup */
{"collections.group.programs.program.name", st_collections_group_programs_program_name},
{"collections.group.programs.program.signal", st_collections_group_programs_program_signal},
{"collections.group.programs.program.source", st_collections_group_programs_program_source},
- {"collections.group.programs.program.filter_state", st_collections_group_programs_program_filter_state}, /* dup */
+ {"collections.group.programs.program.filter", st_collections_group_programs_program_filter}, /* dup */
{"collections.group.programs.program.in", st_collections_group_programs_program_in},
{"collections.group.programs.program.action", st_collections_group_programs_program_action},
{"collections.group.programs.program.transition", st_collections_group_programs_program_transition},
name: "programname";
signal: "signalname";
source: "partname";
- filter_state: "statename";
+ filter: "partname" "statename";
in: 0.3 0.0;
action: STATE_SET "statename" state_value;
transition: LINEAR 0.5;
/**
@page edcref
@property
- filter_state
+ filter
@parameters
- [filter_state name]
+ [filter part state]
@effect
- State of the source part that should accept signal. Only one source state
- keyword per program may be used. ex:state: "default"; (Signals from
- a part currently in state named "default" are accepted).
+ The part [part] should be in state [state] for the signal to be accepted. Only one source state
+ keyword per program may be used. ex:state: "button" "default"; (Signals are accepted
+ if part button is currently in state named "default").
@endproperty
*/
static void
-st_collections_group_programs_program_filter_state(void)
+st_collections_group_programs_program_filter(void)
{
Edje_Part_Collection *pc;
Edje_Program *ep;
- check_arg_count(1);
+ check_min_arg_count(1);
pc = eina_list_data_get(eina_list_last(edje_collections));
ep = eina_list_data_get(eina_list_last(pc->programs));
- ep->filter_state = parse_str(0);
+ if(is_param(1)) {
+ ep->filter.part = parse_str(0);
+ ep->filter.state = parse_str(1);
+ } else {
+ ep->filter.state = parse_str(0);
+ }
}
/**
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_program, Edje_Program, "name", name, EET_T_STRING);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_program, Edje_Program, "signal", signal, EET_T_STRING);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_program, Edje_Program, "source", source, EET_T_STRING);
- EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_program, Edje_Program, "filter_state", filter_state, EET_T_STRING);
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_program, Edje_Program, "filter_part", filter.part, EET_T_STRING);
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_program, Edje_Program, "filter_state", filter.state, EET_T_STRING);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_program, Edje_Program, "in.from", in.from, EET_T_DOUBLE);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_program, Edje_Program, "in.range", in.range, EET_T_DOUBLE);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_program, Edje_Program, "action", action, EET_T_INT);
epr->name = eina_stringshare_add(name);
epr->signal = NULL;
epr->source = NULL;
- epr->filter_state = NULL;
+ epr->filter.part = NULL;
+ epr->filter.state = NULL;
epr->in.from = 0.0;
epr->in.range = 0.0;
epr->action = 0;
_edje_if_string_free(ed, epr->name);
_edje_if_string_free(ed, epr->signal);
_edje_if_string_free(ed, epr->source);
- _edje_if_string_free(ed, epr->filter_state);
+ _edje_if_string_free(ed, epr->filter.part);
+ _edje_if_string_free(ed, epr->filter.state);
_edje_if_string_free(ed, epr->state);
_edje_if_string_free(ed, epr->state2);
}
EAPI const char *
+edje_edit_program_filter_part_get(Evas_Object *obj, const char *prog)
+{
+ GET_EPR_OR_RETURN(NULL);
+
+ if (!epr->filter.part) return NULL;
+ return eina_stringshare_add(epr->filter.part);
+}
+
+EAPI Eina_Bool
+edje_edit_program_filter_part_set(Evas_Object *obj, const char *prog, const char *filter_part)
+{
+ GET_ED_OR_RETURN(0);
+ GET_EPR_OR_RETURN(0);
+
+ if (!filter_part) return 0;
+
+ _edje_if_string_free(ed, epr->filter.part);
+ epr->filter.part = eina_stringshare_add(filter_part);
+
+ return 1;
+}
+
+EAPI const char *
edje_edit_program_filter_state_get(Evas_Object *obj, const char *prog)
{
GET_EPR_OR_RETURN(NULL);
- if (!epr->filter_state) return NULL;
- //printf("GET SOURCE for program: %s [%s]\n", prog, epr->source_state);
- return eina_stringshare_add(epr->filter_state);
+ if (!epr->filter.state) return NULL;
+ return eina_stringshare_add(epr->filter.state);
}
EAPI Eina_Bool
if (!filter_state) return 0;
- //printf("SET SOURCE for program: %s [%s]\n", prog, source);
-
- _edje_if_string_free(ed, epr->filter_state);
- epr->filter_state = eina_stringshare_add(filter_state);
+ _edje_if_string_free(ed, epr->filter.state);
+ epr->filter.state = eina_stringshare_add(filter_state);
return 1;
}
if (pr->name) eina_stringshare_del(pr->name);
if (pr->signal) eina_stringshare_del(pr->signal);
if (pr->source) eina_stringshare_del(pr->source);
- if (pr->filter_state) eina_stringshare_del(pr->filter_state);
+ if (pr->filter.part) eina_stringshare_del(pr->filter.part);
+ if (pr->filter.state) eina_stringshare_del(pr->filter.state);
if (pr->state) eina_stringshare_del(pr->state);
if (pr->state2) eina_stringshare_del(pr->state2);
}
const char *signal; /* if signal emission name matches the glob here... */
const char *source; /* if part that emitted this (name) matches this glob */
- const char *filter_state; /* if part state that emitted this (name) matches this */
+
+ struct {
+ const char *part;
+ const char *state; /* if state is not set, we will try with source */
+ } filter; /* the part filter.part should be in state filter.state for signal to be accepted */
struct {
double from;
data->matched++;
#endif
- if (pr->filter_state)
- {
- rp = _edje_real_part_get(data->ed, data->source);
- if (rp)
- exec = (rp->chosen_description->state.name == pr->filter_state);
- }
+ if (pr->filter.state)
+ {
+ rp = _edje_real_part_get(data->ed, pr->filter.part ? pr->filter.part : data->source);
+ if (rp)
+ exec = (rp->chosen_description->state.name == pr->filter.state);
+ }
if (exec)
_edje_program_run(data->ed, pr, 0, data->signal, data->source);
-
+
if (_edje_block_break(data->ed))
{
#ifdef EDJE_PROGRAM_CACHE