diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c index b19bfb3db7..5cfa3ec5bc 100644 --- a/src/lib/edje/edje_calc.c +++ b/src/lib/edje/edje_calc.c @@ -495,22 +495,12 @@ _edje_real_part_image_set(Edje *ed, Edje_Real_Part *ep, FLOAT_T pos) } static void -_edje_real_part_rel_to_apply(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part_State *state) +_edje_real_part_rel_to_apply(Edje *ed EINA_UNUSED, + Edje_Real_Part *ep, + Edje_Real_Part_State *state) { - state->rel1_to_x = state->rel1_to_y = NULL; - state->rel2_to_x = state->rel2_to_y = NULL; - if (state->description) { - if (state->description->rel1.id_x >= 0) - state->rel1_to_x = ed->table_parts[state->description->rel1.id_x % ed->table_parts_size]; - if (state->description->rel1.id_y >= 0) - state->rel1_to_y = ed->table_parts[state->description->rel1.id_y % ed->table_parts_size]; - if (state->description->rel2.id_x >= 0) - state->rel2_to_x = ed->table_parts[state->description->rel2.id_x % ed->table_parts_size]; - if (state->description->rel2.id_y >= 0) - state->rel2_to_y = ed->table_parts[state->description->rel2.id_y % ed->table_parts_size]; - if (ep->part->type == EDJE_PART_TYPE_EXTERNAL) { Edje_Part_Description_External *external; @@ -2735,6 +2725,11 @@ _edje_physics_body_add(Edje *edje, Edje_Real_Part *rp, EPhysics_World *world) } #endif +#define Rel1X 0 +#define Rel1Y 1 +#define Rel2X 2 +#define Rel2Y 3 + void _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *state) { @@ -2755,6 +2750,8 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta Edje_Real_Part *center[2] = { NULL, NULL }; Edje_Real_Part *light[2] = { NULL, NULL }; Edje_Real_Part *persp[2] = { NULL, NULL }; + Edje_Real_Part *rp1[4] = { NULL, NULL, NULL, NULL }; + Edje_Real_Part *rp2[4] = { NULL, NULL, NULL, NULL }; Edje_Calc_Params *p1, *pf; Edje_Part_Description_Common *chosen_desc; Edje_Real_Part *confine_to = NULL; @@ -2835,36 +2832,40 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta if (flags & FLAG_X) { ep->calculating |= flags & FLAG_X; - if (ep->param1.rel1_to_x) + if (ep->param1.description->rel1.id_x >= 0) { - _edje_part_recalc(ed, ep->param1.rel1_to_x, FLAG_X, NULL); + rp1[Rel1X] = ed->table_parts[ep->param1.description->rel1.id_x]; + _edje_part_recalc(ed, rp1[Rel1X], FLAG_X, NULL); #ifdef EDJE_CALC_CACHE - state1 = ep->param1.rel1_to_x->state; + state1 = rp1[Rel1X]->state; #endif } - if (ep->param1.rel2_to_x) + if (ep->param1.description->rel2.id_x >= 0) { - _edje_part_recalc(ed, ep->param1.rel2_to_x, FLAG_X, NULL); + rp1[Rel2X] = ed->table_parts[ep->param1.description->rel2.id_x]; + _edje_part_recalc(ed, rp1[Rel2X], FLAG_X, NULL); #ifdef EDJE_CALC_CACHE - if (state1 < ep->param1.rel2_to_x->state) - state1 = ep->param1.rel2_to_x->state; + if (state1 < rp1[Rel2X]->state) + state1 = rp1[Rel2X]->state; #endif } if (ep->param2) { - if (ep->param2->rel1_to_x) + if (ep->param2->description->rel1.id_x >= 0) { - _edje_part_recalc(ed, ep->param2->rel1_to_x, FLAG_X, NULL); + rp2[Rel1X] = ed->table_parts[ep->param2->description->rel1.id_x]; + _edje_part_recalc(ed, rp2[Rel1X], FLAG_X, NULL); #ifdef EDJE_CALC_CACHE - state2 = ep->param2->rel1_to_x->state; + state2 = rp2[Rel1X]->state; #endif } - if (ep->param2->rel2_to_x) + if (ep->param2->description->rel2.id_x >= 0) { - _edje_part_recalc(ed, ep->param2->rel2_to_x, FLAG_X, NULL); + rp2[Rel2X] = ed->table_parts[ep->param2->description->rel2.id_x]; + _edje_part_recalc(ed, rp2[Rel2X], FLAG_X, NULL); #ifdef EDJE_CALC_CACHE - if (state2 < ep->param2->rel2_to_x->state) - state2 = ep->param2->rel2_to_x->state; + if (state2 < rp2[Rel2X]->state) + state2 = rp2[Rel2X]->state; #endif } } @@ -2872,38 +2873,42 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta if (flags & FLAG_Y) { ep->calculating |= flags & FLAG_Y; - if (ep->param1.rel1_to_y) + if (ep->param1.description->rel1.id_y >= 0) { - _edje_part_recalc(ed, ep->param1.rel1_to_y, FLAG_Y, NULL); + rp1[Rel1Y] = ed->table_parts[ep->param1.description->rel1.id_y]; + _edje_part_recalc(ed, rp1[Rel1Y], FLAG_Y, NULL); #ifdef EDJE_CALC_CACHE - if (state1 < ep->param1.rel1_to_y->state) - state1 = ep->param1.rel1_to_y->state; + if (state1 < rp1[Rel1Y]->state) + state1 = rp1[Rel1Y]->state; #endif } - if (ep->param1.rel2_to_y) + if (ep->param1.description->rel2.id_y >= 0) { - _edje_part_recalc(ed, ep->param1.rel2_to_y, FLAG_Y, NULL); + rp1[Rel2Y] = ed->table_parts[ep->param1.description->rel2.id_y]; + _edje_part_recalc(ed, rp1[Rel2Y], FLAG_Y, NULL); #ifdef EDJE_CALC_CACHE - if (state1 < ep->param1.rel2_to_y->state) - state1 = ep->param1.rel2_to_y->state; + if (state1 < rp1[Rel2Y]->state) + state1 = rp1[Rel2Y]->state; #endif } if (ep->param2) { - if (ep->param2->rel1_to_y) + if (ep->param2->description->rel1.id_y >= 0) { - _edje_part_recalc(ed, ep->param2->rel1_to_y, FLAG_Y, NULL); + rp2[Rel1Y] = ed->table_parts[ep->param2->description->rel1.id_y]; + _edje_part_recalc(ed, rp2[Rel1Y], FLAG_Y, NULL); #ifdef EDJE_CALC_CACHE - if (state2 < ep->param2->rel1_to_y->state) - state2 = ep->param2->rel1_to_y->state; + if (state2 < rp2[Rel1Y]->state) + state2 = rp2[Rel1Y]->state; #endif } - if (ep->param2->rel2_to_y) + if (ep->param2->description->rel2.id_y >= 0) { - _edje_part_recalc(ed, ep->param2->rel2_to_y, FLAG_Y, NULL); + rp2[Rel2Y] = ed->table_parts[ep->param2->description->rel2.id_y]; + _edje_part_recalc(ed, rp2[Rel2Y], FLAG_Y, NULL); #ifdef EDJE_CALC_CACHE - if (state2 < ep->param2->rel2_to_y->state) - state2 = ep->param2->rel2_to_y->state; + if (state2 < rp2[Rel2Y]->state) + state2 = rp2[Rel2Y]->state; #endif } } @@ -2997,7 +3002,7 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta #endif { _edje_part_recalc_single(ed, ep, ep->param1.description, chosen_desc, center[0], light[0], persp[0], - ep->param1.rel1_to_x, ep->param1.rel1_to_y, ep->param1.rel2_to_x, ep->param1.rel2_to_y, + rp1[Rel1X], rp1[Rel1Y], rp1[Rel2X], rp1[Rel2Y], confine_to, p1, pos); #ifdef EDJE_CALC_CACHE @@ -3063,10 +3068,10 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta _edje_part_recalc_single(ed, ep, ep->param2->description, chosen_desc, center[1], light[1], persp[1], - ep->param2->rel1_to_x, - ep->param2->rel1_to_y, - ep->param2->rel2_to_x, - ep->param2->rel2_to_y, + rp2[Rel1X], + rp2[Rel1Y], + rp2[Rel2X], + rp2[Rel2Y], confine_to, p2, pos); #ifdef EDJE_CALC_CACHE diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c index a1c7e4dc8a..d306689546 100644 --- a/src/lib/edje/edje_edit.c +++ b/src/lib/edje/edje_edit.c @@ -2205,27 +2205,6 @@ edje_edit_part_del(Evas_Object *obj, const char* part) if (real->typedata.text->source == rp) real->typedata.text->source = NULL; if (real->typedata.text->text_source == rp) real->typedata.text->text_source = NULL; - if (real->param1.rel1_to_x == rp) real->param1.rel1_to_x = NULL; - if (real->param1.rel1_to_y == rp) real->param1.rel1_to_y = NULL; - if (real->param1.rel2_to_x == rp) real->param1.rel2_to_x = NULL; - if (real->param1.rel2_to_y == rp) real->param1.rel2_to_y = NULL; - - if (real->param2) - { - if (real->param2->rel1_to_x == rp) real->param2->rel1_to_x = NULL; - if (real->param2->rel1_to_y == rp) real->param2->rel1_to_y = NULL; - if (real->param2->rel2_to_x == rp) real->param2->rel2_to_x = NULL; - if (real->param2->rel2_to_y == rp) real->param2->rel2_to_y = NULL; - } - - if (real->custom) - { - if (real->custom->rel1_to_x == rp) real->custom->rel1_to_x = NULL; - if (real->custom->rel1_to_y == rp) real->custom->rel1_to_y = NULL; - if (real->custom->rel2_to_x == rp) real->custom->rel2_to_x = NULL; - if (real->custom->rel2_to_y == rp) real->custom->rel2_to_y = NULL; - } - if (real->part->clip_to_id == rp->part->id) { evas_object_clip_set(real->object, ed->base->clipper); diff --git a/src/lib/edje/edje_embryo.c b/src/lib/edje/edje_embryo.c index 8282b9a4ea..24b9a3a93c 100644 --- a/src/lib/edje/edje_embryo.c +++ b/src/lib/edje/edje_embryo.c @@ -1950,11 +1950,6 @@ _edje_embryo_fn_set_state_val(Embryo_Program *ep, Embryo_Cell *params) GETINT(rp->custom->description->rel1.id_x, params[3]); GETINT(rp->custom->description->rel1.id_y, params[4]); - if (rp->param1.description->rel1.id_x >= 0) - rp->param1.rel1_to_x = ed->table_parts[rp->param1.description->rel1.id_x % ed->table_parts_size]; - if (rp->param1.description->rel1.id_y >= 0) - rp->param1.rel1_to_y = ed->table_parts[rp->param1.description->rel1.id_y % ed->table_parts_size]; - break; case EDJE_STATE_PARAM_REL1_OFFSET: CHKPARAM(4); @@ -1976,11 +1971,6 @@ _edje_embryo_fn_set_state_val(Embryo_Program *ep, Embryo_Cell *params) GETINT(rp->custom->description->rel2.id_x, params[3]); GETINT(rp->custom->description->rel2.id_y, params[4]); - if (rp->param1.description->rel2.id_x >= 0) - rp->param1.rel2_to_x = ed->table_parts[rp->param1.description->rel2.id_x % ed->table_parts_size]; - if (rp->param1.description->rel2.id_y >= 0) - rp->param1.rel2_to_y = ed->table_parts[rp->param1.description->rel2.id_y % ed->table_parts_size]; - break; case EDJE_STATE_PARAM_REL2_OFFSET: CHKPARAM(4); diff --git a/src/lib/edje/edje_load.c b/src/lib/edje/edje_load.c index ed0d00fba7..809afeda73 100644 --- a/src/lib/edje/edje_load.c +++ b/src/lib/edje/edje_load.c @@ -662,13 +662,13 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g be able to remove this when all theme are correctly rewritten. */ { if (rp->param1.description->rel1.id_x >= 0) - rp->param1.rel1_to_x = ed->table_parts[rp->param1.description->rel1.id_x % ed->table_parts_size]; + rp->param1.description->rel1.id_x %= ed->table_parts_size; if (rp->param1.description->rel1.id_y >= 0) - rp->param1.rel1_to_y = ed->table_parts[rp->param1.description->rel1.id_y % ed->table_parts_size]; + rp->param1.description->rel1.id_y %= ed->table_parts_size; if (rp->param1.description->rel2.id_x >= 0) - rp->param1.rel2_to_x = ed->table_parts[rp->param1.description->rel2.id_x % ed->table_parts_size]; + rp->param1.description->rel2.id_x %= ed->table_parts_size; if (rp->param1.description->rel2.id_y >= 0) - rp->param1.rel2_to_y = ed->table_parts[rp->param1.description->rel2.id_y % ed->table_parts_size]; + rp->param1.description->rel2.id_y %= ed->table_parts_size; } if (rp->part->clip_to_id >= 0) { diff --git a/src/lib/edje/edje_private.h b/src/lib/edje/edje_private.h index e16e25eeb0..978be0799a 100644 --- a/src/lib/edje/edje_private.h +++ b/src/lib/edje/edje_private.h @@ -1442,10 +1442,6 @@ struct _Edje_Real_Part_State { Edje_Part_Description_Common *description; // 4 Edje_Part_Description_Common *description_rtl; // 4 - Edje_Real_Part *rel1_to_x; // 4 - Edje_Real_Part *rel1_to_y; // 4 - Edje_Real_Part *rel2_to_x; // 4 - Edje_Real_Part *rel2_to_y; // 4 #ifdef EDJE_CALC_CACHE int state; // 4 Edje_Calc_Params p; // 271