edje - clean up the code

SVN revision: 75240
This commit is contained in:
ChunEon Park 2012-08-14 07:59:06 +00:00
parent 4d56b9f19d
commit 91bdc844fc
1 changed files with 1284 additions and 1273 deletions

View File

@ -286,7 +286,8 @@ _edje_part_description_find(Edje *ed, Edje_Real_Part *rp, const char *name,
if (!strcmp(name, "default"))
{
ret = _edje_get_description_by_orientation(ed, ep->default_desc,
&ep->default_desc_rtl, ep->type);
&ep->default_desc_rtl,
ep->type);
min_dst = ABS(ep->default_desc->state.value - val);
}
@ -295,7 +296,8 @@ _edje_part_description_find(Edje *ed, Edje_Real_Part *rp, const char *name,
{
d = ep->other.desc[i];
if (d->state.name && (d->state.name == name || !strcmp(d->state.name, name)))
if (d->state.name && (d->state.name == name ||
!strcmp(d->state.name, name)))
{
double dst;
@ -542,18 +544,21 @@ _edje_part_description_apply(Edje *ed, Edje_Real_Part *ep, const char *d1, doubl
{
if (!ep->param2)
{
ep->param2 = eina_mempool_malloc(_edje_real_part_state_mp, sizeof (Edje_Real_Part_State));
memset(ep->param2, 0, sizeof (Edje_Real_Part_State));
ep->param2 = eina_mempool_malloc(_edje_real_part_state_mp,
sizeof(Edje_Real_Part_State));
memset(ep->param2, 0, sizeof(Edje_Real_Part_State));
}
else if (ep->part->type == EDJE_PART_TYPE_EXTERNAL)
_edje_external_parsed_params_free(ep->swallowed_object, ep->param2->external_params);
_edje_external_parsed_params_free(ep->swallowed_object,
ep->param2->external_params);
ep->param2->external_params = NULL;
}
else
if (ep->param2)
{
if (ep->part->type == EDJE_PART_TYPE_EXTERNAL)
_edje_external_parsed_params_free(ep->swallowed_object, ep->param2->external_params);
_edje_external_parsed_params_free(ep->swallowed_object,
ep->param2->external_params);
if (ep->param2)
free(ep->param2->set);
eina_mempool_free(_edje_real_part_state_mp, ep->param2);
@ -1008,7 +1013,8 @@ _edje_part_recalc_single_aspect(Edje *ed,
break;
}
if (!((amin > ZERO) && (amax > ZERO) && (apref == EDJE_ASPECT_PREFER_NONE)))
if (!((amin > ZERO) && (amax > ZERO) &&
(apref == EDJE_ASPECT_PREFER_NONE)))
{
if ((*maxw >= 0) && (new_w > FROM_INT(*maxw)))
new_w = FROM_INT(*maxw);
@ -1209,11 +1215,13 @@ _edje_part_recalc_single_textblock(FLOAT_T sc,
if (!chosen_desc->text.min_x)
{
evas_object_resize(ep->object, params->w, params->h);
evas_object_textblock_size_formatted_get(ep->object, &tw, &th);
evas_object_textblock_size_formatted_get(ep->object, &tw,
&th);
}
else
evas_object_textblock_size_native_get(ep->object, &tw, &th);
evas_object_textblock_style_insets_get(ep->object, &ins_l, &ins_r, &ins_t, &ins_b);
evas_object_textblock_style_insets_get(ep->object, &ins_l,
&ins_r, &ins_t, &ins_b);
mw = ins_l + tw + ins_r;
mh = ins_t + th + ins_b;
if (chosen_desc->text.min_x)
@ -1238,7 +1246,8 @@ _edje_part_recalc_single_textblock(FLOAT_T sc,
}
else
evas_object_textblock_size_native_get(ep->object, &tw, &th);
evas_object_textblock_style_insets_get(ep->object, &ins_l, &ins_r, &ins_t, &ins_b);
evas_object_textblock_style_insets_get(ep->object, &ins_l, &ins_r,
&ins_t, &ins_b);
mw = ins_l + tw + ins_r;
mh = ins_t + th + ins_b;
if (chosen_desc->text.max_x)
@ -1265,7 +1274,8 @@ _edje_part_recalc_single_textblock(FLOAT_T sc,
{
s = (s * params->w) / (double)tw;
evas_object_scale_set(ep->object, s);
evas_object_textblock_size_formatted_get(ep->object, &tw, &th);
evas_object_textblock_size_formatted_get(ep->object,
&tw, &th);
}
}
if (chosen_desc->text.fit_y)
@ -1274,7 +1284,8 @@ _edje_part_recalc_single_textblock(FLOAT_T sc,
{
s = (s * params->h) / (double)th;
evas_object_scale_set(ep->object, s);
evas_object_textblock_size_formatted_get(ep->object, &tw, &th);
evas_object_textblock_size_formatted_get(ep->object,
&tw, &th);
}
}
}
@ -2519,8 +2530,8 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta
statec = confine_to->state;
#endif
}
// if (ep->text.source) _edje_part_recalc(ed, ep->text.source, flags);
// if (ep->text.text_source) _edje_part_recalc(ed, ep->text.text_source, flags);
// if (ep->text.source) _edje_part_recalc(ed, ep->text.source, flags);
// if (ep->text.text_source) _edje_part_recalc(ed, ep->text.text_source, flags);
/* actually calculate now */
chosen_desc = ep->chosen_description;
@ -2948,15 +2959,15 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta
if (ep->swallowed_object)
{
//// the below really is wrong - swallow color shouldn't affect swallowed object
//// color - the edje color as a WHOLE should though - and that should be
//// done via the clipper anyway. this created bugs when objects had their
//// colro set and were swallowed - then had their color changed.
// evas_object_color_set(ep->swallowed_object,
// (pf->color.r * pf->color.a) / 255,
// (pf->color.g * pf->color.a) / 255,
// (pf->color.b * pf->color.a) / 255,
// pf->color.a);
//// the below really is wrong - swallow color shouldn't affect swallowed object
//// color - the edje color as a WHOLE should though - and that should be
//// done via the clipper anyway. this created bugs when objects had their
//// colro set and were swallowed - then had their color changed.
// evas_object_color_set(ep->swallowed_object,
// (pf->color.r * pf->color.a) / 255,
// (pf->color.g * pf->color.a) / 255,
// (pf->color.b * pf->color.a) / 255,
// pf->color.a);
if (pf->visible)
{
evas_object_move(ep->swallowed_object, ed->x + pf->x, ed->y + pf->y);