forked from enlightenment/efl
Edje calc: Simplify code readability with eo_do
This removes an absolutely crazy use of eo_do where all calls to the efl_gfx_filter functions where factorized in an unreadable manner. Hopefully eo_do will disappear soon.
This commit is contained in:
parent
77db872754
commit
07a8d6a5da
|
@ -2588,7 +2588,6 @@ _edje_part_recalc_single_filter(Edje *ed,
|
|||
prev_sources = NULL;
|
||||
}
|
||||
|
||||
eo_do(obj,
|
||||
/* pass extra data items */
|
||||
if (filter->data)
|
||||
{
|
||||
|
@ -2600,7 +2599,7 @@ _edje_part_recalc_single_filter(Edje *ed,
|
|||
continue;
|
||||
if (!data->value)
|
||||
{
|
||||
efl_gfx_filter_data_set(data->name, NULL, EINA_FALSE);
|
||||
eo_do(obj, efl_gfx_filter_data_set(data->name, NULL, EINA_FALSE));
|
||||
}
|
||||
else if (!strncmp(data->value, "color_class('", sizeof("color_class('") - 1))
|
||||
{
|
||||
|
@ -2630,7 +2629,7 @@ _edje_part_recalc_single_filter(Edje *ed,
|
|||
(int) cc->r2, (int) cc->g2, (int) cc->b2, (int) cc->a2,
|
||||
(int) cc->r3, (int) cc->g3, (int) cc->b3, (int) cc->a3);
|
||||
buffer[len - 1] = 0;
|
||||
efl_gfx_filter_data_set(data->name, buffer, EINA_TRUE);
|
||||
eo_do(obj, efl_gfx_filter_data_set(data->name, buffer, EINA_TRUE));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2647,10 +2646,10 @@ _edje_part_recalc_single_filter(Edje *ed,
|
|||
}
|
||||
}
|
||||
else
|
||||
efl_gfx_filter_data_set(data->name, data->value, EINA_FALSE);
|
||||
eo_do(obj, efl_gfx_filter_data_set(data->name, data->value, EINA_FALSE));
|
||||
}
|
||||
}
|
||||
efl_gfx_filter_program_set(code, filter->name);
|
||||
eo_do(obj, efl_gfx_filter_program_set(code, filter->name));
|
||||
if (prev_sources != filter_sources)
|
||||
{
|
||||
/* remove sources that are not there anymore
|
||||
|
@ -2670,12 +2669,12 @@ _edje_part_recalc_single_filter(Edje *ed,
|
|||
{
|
||||
part = strchr(src1, ':');
|
||||
if (!part)
|
||||
efl_gfx_filter_source_set(src1, NULL);
|
||||
eo_do(obj, efl_gfx_filter_source_set(src1, NULL));
|
||||
else
|
||||
{
|
||||
char *name = strdup(src1);
|
||||
name[part - src1] = 0;
|
||||
efl_gfx_filter_source_set(name, NULL);
|
||||
eo_do(obj, efl_gfx_filter_source_set(name, NULL));
|
||||
free(name);
|
||||
}
|
||||
}
|
||||
|
@ -2694,23 +2693,22 @@ _edje_part_recalc_single_filter(Edje *ed,
|
|||
else
|
||||
part = src1;
|
||||
rp = _edje_real_part_get(ed, part);
|
||||
efl_gfx_filter_source_set(name ? name : part, rp ? rp->object : NULL);
|
||||
eo_do(obj, efl_gfx_filter_source_set(name ? name : part, rp ? rp->object : NULL));
|
||||
free(name);
|
||||
}
|
||||
}
|
||||
/* pass edje state for transitions */
|
||||
if (ep->param2)
|
||||
{
|
||||
efl_gfx_filter_state_set(chosen_desc->state.name, chosen_desc->state.value,
|
||||
eo_do(obj, efl_gfx_filter_state_set(chosen_desc->state.name, chosen_desc->state.value,
|
||||
ep->param2->description->state.name, ep->param2->description->state.value,
|
||||
pos);
|
||||
pos));
|
||||
}
|
||||
else
|
||||
{
|
||||
efl_gfx_filter_state_set(chosen_desc->state.name, chosen_desc->state.value,
|
||||
NULL, 0.0, pos);
|
||||
eo_do(obj, efl_gfx_filter_state_set(chosen_desc->state.name, chosen_desc->state.value,
|
||||
NULL, 0.0, pos));
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in New Issue