From 6ce037b8a34c9fa1d47f824721537b02f137177f Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Wed, 30 Dec 2009 15:51:41 +0000 Subject: [PATCH] * edje: Fix embryo with fixed point and table align. SVN revision: 44794 --- legacy/edje/src/lib/edje_calc.c | 2 +- legacy/edje/src/lib/edje_embryo.c | 69 +++++++++++++----------------- legacy/edje/src/lib/edje_private.h | 20 ++++++++- 3 files changed, 50 insertions(+), 41 deletions(-) diff --git a/legacy/edje/src/lib/edje_calc.c b/legacy/edje/src/lib/edje_calc.c index 0ce433ccf4..29f6c75d45 100644 --- a/legacy/edje/src/lib/edje_calc.c +++ b/legacy/edje/src/lib/edje_calc.c @@ -1480,7 +1480,7 @@ static void _edje_table_recalc_apply(Edje *ed __UNUSED__, Edje_Real_Part *ep, Edje_Calc_Params *p3 __UNUSED__, Edje_Part_Description *chosen_desc) { evas_object_table_homogeneous_set(ep->object, chosen_desc->table.homogeneous); - evas_object_table_align_set(ep->object, chosen_desc->table.align.x, chosen_desc->table.align.y); + evas_object_table_align_set(ep->object, TO_DOUBLE(chosen_desc->table.align.x), TO_DOUBLE(chosen_desc->table.align.y)); evas_object_table_padding_set(ep->object, chosen_desc->table.padding.x, chosen_desc->table.padding.y); if (evas_object_smart_need_recalculate_get(ep->object)) { diff --git a/legacy/edje/src/lib/edje_embryo.c b/legacy/edje/src/lib/edje_embryo.c index c561740191..854e0cae1a 100644 --- a/legacy/edje/src/lib/edje_embryo.c +++ b/legacy/edje/src/lib/edje_embryo.c @@ -1633,8 +1633,8 @@ _edje_embryo_fn_set_state_val(Embryo_Program *ep, Embryo_Cell *params) case EDJE_STATE_PARAM_ALIGNMENT: CHKPARAM(4); - GETFLOAT(rp->custom->description->align.x, params[3]); - GETFLOAT(rp->custom->description->align.y, params[4]); + GETFLOAT_T(rp->custom->description->align.x, params[3]); + GETFLOAT_T(rp->custom->description->align.y, params[4]); break; case EDJE_STATE_PARAM_MIN: @@ -1659,21 +1659,12 @@ _edje_embryo_fn_set_state_val(Embryo_Program *ep, Embryo_Cell *params) break; case EDJE_STATE_PARAM_ASPECT: - { - double tmp; + CHKPARAM(4); - CHKPARAM(4); + GETFLOAT_T(rp->custom->description->aspect.min, params[3]); + GETFLOAT_T(rp->custom->description->aspect.max, params[4]); - tmp = TO_DOUBLE(rp->custom->description->aspect.min); - GETFLOAT(tmp, params[3]); - rp->custom->description->aspect.min = FROM_DOUBLE(tmp); - - tmp = TO_DOUBLE(rp->custom->description->aspect.max); - GETFLOAT(tmp, params[4]); - rp->custom->description->aspect.max = FROM_DOUBLE(tmp); - - break; - } + break; case EDJE_STATE_PARAM_ASPECT_PREF: CHKPARAM(3); @@ -1717,8 +1708,8 @@ _edje_embryo_fn_set_state_val(Embryo_Program *ep, Embryo_Cell *params) case EDJE_STATE_PARAM_REL1: CHKPARAM(4); - GETFLOAT(rp->custom->description->rel1.relative_x, params[3]); - GETFLOAT(rp->custom->description->rel1.relative_y, params[4]); + GETFLOAT_T(rp->custom->description->rel1.relative_x, params[3]); + GETFLOAT_T(rp->custom->description->rel1.relative_y, params[4]); break; case EDJE_STATE_PARAM_REL1_TO: @@ -1743,8 +1734,8 @@ _edje_embryo_fn_set_state_val(Embryo_Program *ep, Embryo_Cell *params) case EDJE_STATE_PARAM_REL2: CHKPARAM(4); - GETFLOAT(rp->custom->description->rel2.relative_x, params[3]); - GETFLOAT(rp->custom->description->rel2.relative_y, params[4]); + GETFLOAT_T(rp->custom->description->rel2.relative_x, params[3]); + GETFLOAT_T(rp->custom->description->rel2.relative_y, params[4]); break; case EDJE_STATE_PARAM_REL2_TO: @@ -1794,8 +1785,8 @@ _edje_embryo_fn_set_state_val(Embryo_Program *ep, Embryo_Cell *params) if ( (rp->part->type != EDJE_PART_TYPE_IMAGE) ) return 0; CHKPARAM(6); - GETFLOAT(rp->custom->description->fill.pos_rel_x, params[3]); - GETFLOAT(rp->custom->description->fill.pos_rel_y, params[4]); + GETFLOAT_T(rp->custom->description->fill.pos_rel_x, params[3]); + GETFLOAT_T(rp->custom->description->fill.pos_rel_y, params[4]); GETINT(rp->custom->description->fill.pos_abs_x, params[5]); GETINT(rp->custom->description->fill.pos_abs_y, params[6]); @@ -1804,8 +1795,8 @@ _edje_embryo_fn_set_state_val(Embryo_Program *ep, Embryo_Cell *params) if ( (rp->part->type != EDJE_PART_TYPE_IMAGE) ) return 0; CHKPARAM(6); - GETFLOAT(rp->custom->description->fill.rel_x, params[3]); - GETFLOAT(rp->custom->description->fill.rel_y, params[4]); + GETFLOAT_T(rp->custom->description->fill.rel_x, params[3]); + GETFLOAT_T(rp->custom->description->fill.rel_y, params[4]); GETINT(rp->custom->description->fill.abs_x, params[5]); GETINT(rp->custom->description->fill.abs_y, params[6]); @@ -1885,8 +1876,8 @@ _edje_embryo_fn_set_state_val(Embryo_Program *ep, Embryo_Cell *params) if ((rp->part->type != EDJE_PART_TYPE_TEXT)) return 0; CHKPARAM(4); - GETFLOAT(rp->custom->description->text.align.x, params[3]); - GETFLOAT(rp->custom->description->text.align.y, params[4]); + GETFLOAT_T(rp->custom->description->text.align.x, params[3]); + GETFLOAT_T(rp->custom->description->text.align.y, params[4]); break; case EDJE_STATE_PARAM_VISIBLE: @@ -1933,8 +1924,8 @@ _edje_embryo_fn_get_state_val(Embryo_Program *ep, Embryo_Cell *params) case EDJE_STATE_PARAM_ALIGNMENT: CHKPARAM(4); - SETFLOAT(rp->custom->description->align.x, params[3]); - SETFLOAT(rp->custom->description->align.y, params[4]); + SETFLOAT_T(rp->custom->description->align.x, params[3]); + SETFLOAT_T(rp->custom->description->align.y, params[4]); break; case EDJE_STATE_PARAM_MIN: @@ -1961,8 +1952,8 @@ _edje_embryo_fn_get_state_val(Embryo_Program *ep, Embryo_Cell *params) case EDJE_STATE_PARAM_ASPECT: CHKPARAM(4); - SETFLOAT(TO_DOUBLE(rp->custom->description->aspect.min), params[3]); - SETFLOAT(TO_DOUBLE(rp->custom->description->aspect.max), params[4]); + SETFLOAT_T(rp->custom->description->aspect.min, params[3]); + SETFLOAT_T(rp->custom->description->aspect.max, params[4]); break; case EDJE_STATE_PARAM_ASPECT_PREF: @@ -2008,8 +1999,8 @@ _edje_embryo_fn_get_state_val(Embryo_Program *ep, Embryo_Cell *params) case EDJE_STATE_PARAM_REL1: CHKPARAM(4); - SETFLOAT(rp->custom->description->rel1.relative_x, params[3]); - SETFLOAT(rp->custom->description->rel1.relative_y, params[4]); + SETFLOAT_T(rp->custom->description->rel1.relative_x, params[3]); + SETFLOAT_T(rp->custom->description->rel1.relative_y, params[4]); break; case EDJE_STATE_PARAM_REL1_TO: @@ -2029,8 +2020,8 @@ _edje_embryo_fn_get_state_val(Embryo_Program *ep, Embryo_Cell *params) case EDJE_STATE_PARAM_REL2: CHKPARAM(4); - SETFLOAT(rp->custom->description->rel2.relative_x, params[3]); - SETFLOAT(rp->custom->description->rel2.relative_y, params[4]); + SETFLOAT_T(rp->custom->description->rel2.relative_x, params[3]); + SETFLOAT_T(rp->custom->description->rel2.relative_y, params[4]); break; case EDJE_STATE_PARAM_REL2_TO: @@ -2075,8 +2066,8 @@ _edje_embryo_fn_get_state_val(Embryo_Program *ep, Embryo_Cell *params) if ( (rp->part->type != EDJE_PART_TYPE_IMAGE) ) return 0; CHKPARAM(6); - SETFLOAT(rp->custom->description->fill.pos_rel_x, params[3]); - SETFLOAT(rp->custom->description->fill.pos_rel_y, params[4]); + SETFLOAT_T(rp->custom->description->fill.pos_rel_x, params[3]); + SETFLOAT_T(rp->custom->description->fill.pos_rel_y, params[4]); SETINT(rp->custom->description->fill.pos_abs_x, params[5]); SETINT(rp->custom->description->fill.pos_abs_y, params[6]); @@ -2085,8 +2076,8 @@ _edje_embryo_fn_get_state_val(Embryo_Program *ep, Embryo_Cell *params) if ( (rp->part->type != EDJE_PART_TYPE_IMAGE) ) return 0; CHKPARAM(6); - SETFLOAT(rp->custom->description->fill.rel_x, params[3]); - SETFLOAT(rp->custom->description->fill.rel_y, params[4]); + SETFLOAT_T(rp->custom->description->fill.rel_x, params[3]); + SETFLOAT_T(rp->custom->description->fill.rel_y, params[4]); SETINT(rp->custom->description->fill.abs_x, params[5]); SETINT(rp->custom->description->fill.abs_y, params[6]); @@ -2166,8 +2157,8 @@ _edje_embryo_fn_get_state_val(Embryo_Program *ep, Embryo_Cell *params) if ((rp->part->type != EDJE_PART_TYPE_TEXT)) return 0; CHKPARAM(4); - SETFLOAT(rp->custom->description->text.align.x, params[3]); - SETFLOAT(rp->custom->description->text.align.y, params[4]); + SETFLOAT_T(rp->custom->description->text.align.x, params[3]); + SETFLOAT_T(rp->custom->description->text.align.y, params[4]); break; case EDJE_STATE_PARAM_VISIBLE: diff --git a/legacy/edje/src/lib/edje_private.h b/legacy/edje/src/lib/edje_private.h index 06bc7b2ccb..3273b9d4e1 100644 --- a/legacy/edje/src/lib/edje_private.h +++ b/legacy/edje/src/lib/edje_private.h @@ -1358,7 +1358,17 @@ void _edje_embryo_globals_init(Edje *ed); float *___cptr; \ if ((___cptr = (float *)embryo_data_address_get(ep, (par)))) { \ val = *___cptr; } } -#define GETINT(val, par) { \ + +#define GETFLOAT_T(val, par) \ + { \ + float *___cptr; \ + if ((___cptr = (float *)embryo_data_address_get(ep, (par)))) \ + { \ + val = FROM_DOUBLE(*___cptr); \ + } \ + } + +#define GETINT(val, par) { \ int *___cptr; \ if ((___cptr = (int *)embryo_data_address_get(ep, (par)))) { \ val = *___cptr; } } @@ -1382,6 +1392,14 @@ void _edje_embryo_globals_init(Edje *ed); float *___cptr; \ if ((___cptr = (float *)embryo_data_address_get(ep, (par)))) { \ *___cptr = (float)val; } } +#define SETFLOAT_T(val, par) \ + { \ + float *___cptr; \ + if ((___cptr = (float *)embryo_data_address_get(ep, (par)))) \ + { \ + *___cptr = (float) TO_DOUBLE(val); \ + } \ + } #define SETINT(val, par) { \ int *___cptr; \ if ((___cptr = (int *)embryo_data_address_get(ep, (par)))) { \