@effect
Action to be performed by the program. Valid actions are: STATE_SET,
ACTION_STOP, SIGNAL_EMIT, DRAG_VAL_SET, DRAG_VAL_STEP, DRAG_VAL_PAGE,
- FOCUS_SET, PARAM_COPY
+ FOCUS_SET, PARAM_COPY, PARAM_SET
Only one action can be specified per program. Examples:\n
action: STATE_SET "statename" 0.5;\n
action: ACTION_STOP;\n
action: FOCUS_SET;\n
action: FOCUS_OBJECT;\n
action: PARAM_COPY "src_part" "src_param" "dst_part" "dst_param";\n
+ action: PARAM_SET "part" "param" "value";\n
@endproperty
*/
static void
"FOCUS_SET", EDJE_ACTION_TYPE_FOCUS_SET,
"FOCUS_OBJECT", EDJE_ACTION_TYPE_FOCUS_OBJECT,
"PARAM_COPY", EDJE_ACTION_TYPE_PARAM_COPY,
+ "PARAM_SET", EDJE_ACTION_TYPE_PARAM_SET,
NULL);
if (ep->action == EDJE_ACTION_TYPE_STATE_SET)
{
free(src_part);
free(dst_part);
}
+ else if (ep->action == EDJE_ACTION_TYPE_PARAM_SET)
+ {
+ char *part;
+
+ part = parse_str(1);
+ ep->state = parse_str(2);
+ ep->state2 = parse_str(3);
+
+ data_queue_part_lookup(pc, part, &(ep->param.dst));
+ free(part);
+ }
switch (ep->action)
{
case EDJE_ACTION_TYPE_PARAM_COPY:
check_arg_count(5);
break;
+ case EDJE_ACTION_TYPE_PARAM_SET:
+ check_arg_count(4);
+ break;
default:
check_arg_count(3);
}
static void _edje_emit_cb(Edje *ed, const char *sig, const char *src);
static void _edje_param_copy(Edje_Real_Part *src_part, const char *src_param, Edje_Real_Part *dst_part, const char *dst_param);
+static void _edje_param_set(Edje_Real_Part *part, const char *param, const char *value);
int _edje_anim_count = 0;
Ecore_Animator *_edje_timer = NULL;
// _edje_emit(ed, "program,stop", pr->name);
if (_edje_block_break(ed)) goto break_prog;
}
+ else if (pr->action == EDJE_ACTION_TYPE_PARAM_SET)
+ {
+ Edje_Real_Part *part;
+
+// _edje_emit(ed, "program,start", pr->name);
+ if (_edje_block_break(ed)) goto break_prog;
+
+ part = ed->table_parts[pr->param.dst % ed->table_parts_size];
+ _edje_param_set(part, 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;
+ }
else
{
// _edje_emit(ed, "program,start", pr->name);
free(free_ptr);
}
+static void
+_edje_param_set(Edje_Real_Part *part, const char *param, const char *value)
+{
+ Edje_External_Param val;
+ const Edje_External_Param_Info *info;
+
+ if ((!part) || (!param) || (!value))
+ return;
+
+ if (part->part->type == EDJE_PART_TYPE_EXTERNAL)
+ info = _edje_external_param_info_get(part->swallowed_object, param);
+ else
+ info = _edje_native_param_info_get(part, param);
+
+ if (!info)
+ {
+ ERR("cannot copy, invalid destination parameter '%s' of part '%s'",
+ param, part->part->name);
+ return;
+ }
+
+ val.name = "(temp)";
+ val.type = EDJE_EXTERNAL_PARAM_TYPE_STRING;
+ val.s = value;
+
+ if (!_edje_param_convert(&val, info))
+ {
+ ERR("cannot convert parameter type STRING to requested type %s",
+ edje_external_param_type_str(info->type));
+ return;
+ }
+
+ if (!_edje_param_validate(&val, info))
+ {
+ ERR("incorrect parameter value failed validation for type %s",
+ edje_external_param_type_str(info->type));
+ return;
+ }
+
+ if (part->part->type == EDJE_PART_TYPE_EXTERNAL)
+ {
+ val.name = param;
+ if (!_edje_external_param_set(part->swallowed_object, &val))
+ {
+ ERR("failed to set parameter '%s' (%s) of part '%s'",
+ param, edje_external_param_type_str(info->type),
+ part->part->name);
+ return;
+ }
+ }
+ else
+ {
+ if (!_edje_param_native_set(part, param, &val))
+ {
+ ERR("failed to set parameter '%s' (%s) of part '%s'",
+ param, edje_external_param_type_str(info->type),
+ part->part->name);
+ return;
+ }
+ }
+}
+
/**
*
* @}