forked from enlightenment/efl
edje: cleanup and more accurate evaluation of CURRENT.
SVN revision: 65642
This commit is contained in:
parent
41fe1bcc43
commit
7473d15aea
|
@ -1,10 +1,5 @@
|
||||||
#include "edje_private.h"
|
#include "edje_private.h"
|
||||||
|
|
||||||
#define FLAG_NONE 0
|
|
||||||
#define FLAG_X 0x01
|
|
||||||
#define FLAG_Y 0x02
|
|
||||||
#define FLAG_XY (FLAG_X | FLAG_Y)
|
|
||||||
|
|
||||||
static void _edje_part_make_rtl(Edje_Part_Description_Common *desc);
|
static void _edje_part_make_rtl(Edje_Part_Description_Common *desc);
|
||||||
static Edje_Part_Description_Common *_edje_get_description_by_orientation(Edje *ed, Edje_Part_Description_Common *src, Edje_Part_Description_Common **dst, unsigned char type);
|
static Edje_Part_Description_Common *_edje_get_description_by_orientation(Edje *ed, Edje_Part_Description_Common *src, Edje_Part_Description_Common **dst, unsigned char type);
|
||||||
|
|
||||||
|
@ -14,7 +9,6 @@ static void _edje_part_recalc_single(Edje *ed, Edje_Real_Part *ep,
|
||||||
Edje_Real_Part *rel1_to_x, Edje_Real_Part *rel1_to_y,
|
Edje_Real_Part *rel1_to_x, Edje_Real_Part *rel1_to_y,
|
||||||
Edje_Real_Part *rel2_to_x, Edje_Real_Part *rel2_to_y,
|
Edje_Real_Part *rel2_to_x, Edje_Real_Part *rel2_to_y,
|
||||||
Edje_Real_Part *confine_to, Edje_Calc_Params *params);
|
Edje_Real_Part *confine_to, Edje_Calc_Params *params);
|
||||||
static void _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags);
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_edje_part_pos_set(Edje *ed, Edje_Real_Part *ep, int mode, FLOAT_T pos, FLOAT_T v1, FLOAT_T v2)
|
_edje_part_pos_set(Edje *ed, Edje_Real_Part *ep, int mode, FLOAT_T pos, FLOAT_T v1, FLOAT_T v2)
|
||||||
|
@ -459,7 +453,7 @@ _edje_recalc_do(Edje *ed)
|
||||||
|
|
||||||
ep = ed->table_parts[i];
|
ep = ed->table_parts[i];
|
||||||
if (ep->calculated != FLAG_XY)
|
if (ep->calculated != FLAG_XY)
|
||||||
_edje_part_recalc(ed, ep, (~ep->calculated) & FLAG_XY);
|
_edje_part_recalc(ed, ep, (~ep->calculated) & FLAG_XY, NULL);
|
||||||
}
|
}
|
||||||
if (!ed->calc_only) ed->recalc = 0;
|
if (!ed->calc_only) ed->recalc = 0;
|
||||||
#ifdef EDJE_CALC_CACHE
|
#ifdef EDJE_CALC_CACHE
|
||||||
|
@ -471,7 +465,7 @@ _edje_recalc_do(Edje *ed)
|
||||||
void
|
void
|
||||||
_edje_part_recalc_1(Edje *ed, Edje_Real_Part *ep)
|
_edje_part_recalc_1(Edje *ed, Edje_Real_Part *ep)
|
||||||
{
|
{
|
||||||
_edje_part_recalc(ed, ep, FLAG_XY);
|
_edje_part_recalc(ed, ep, FLAG_XY, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -2122,7 +2116,7 @@ _edje_real_part_state_get(Edje *ed, Edje_Real_Part *ep, int flags, int id, int *
|
||||||
result = ed->table_parts[id % ed->table_parts_size];
|
result = ed->table_parts[id % ed->table_parts_size];
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
if (!result->calculated) _edje_part_recalc(ed, result, flags);
|
if (!result->calculated) _edje_part_recalc(ed, result, flags, NULL);
|
||||||
#ifdef EDJE_CALC_CACHE
|
#ifdef EDJE_CALC_CACHE
|
||||||
if (state) *state = result->state;
|
if (state) *state = result->state;
|
||||||
#else
|
#else
|
||||||
|
@ -2133,8 +2127,8 @@ _edje_real_part_state_get(Edje *ed, Edje_Real_Part *ep, int flags, int id, int *
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
void
|
||||||
_edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags)
|
_edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *state)
|
||||||
{
|
{
|
||||||
#ifdef EDJE_CALC_CACHE
|
#ifdef EDJE_CALC_CACHE
|
||||||
Eina_Bool proxy_invalidate = EINA_FALSE;
|
Eina_Bool proxy_invalidate = EINA_FALSE;
|
||||||
|
@ -2166,7 +2160,7 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((ep->calculated & FLAG_XY) == FLAG_XY)
|
if ((ep->calculated & FLAG_XY) == FLAG_XY && !state)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -2200,7 +2194,7 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#ifdef EDJE_CALC_CACHE
|
#ifdef EDJE_CALC_CACHE
|
||||||
if (ep->state == ed->state)
|
if (ep->state == ed->state && !state)
|
||||||
return ;
|
return ;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -2209,14 +2203,14 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags)
|
||||||
ep->calculating |= flags & FLAG_X;
|
ep->calculating |= flags & FLAG_X;
|
||||||
if (ep->param1.rel1_to_x)
|
if (ep->param1.rel1_to_x)
|
||||||
{
|
{
|
||||||
_edje_part_recalc(ed, ep->param1.rel1_to_x, FLAG_X);
|
_edje_part_recalc(ed, ep->param1.rel1_to_x, FLAG_X, NULL);
|
||||||
#ifdef EDJE_CALC_CACHE
|
#ifdef EDJE_CALC_CACHE
|
||||||
state1 = ep->param1.rel1_to_x->state;
|
state1 = ep->param1.rel1_to_x->state;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if (ep->param1.rel2_to_x)
|
if (ep->param1.rel2_to_x)
|
||||||
{
|
{
|
||||||
_edje_part_recalc(ed, ep->param1.rel2_to_x, FLAG_X);
|
_edje_part_recalc(ed, ep->param1.rel2_to_x, FLAG_X, NULL);
|
||||||
#ifdef EDJE_CALC_CACHE
|
#ifdef EDJE_CALC_CACHE
|
||||||
if (state1 < ep->param1.rel2_to_x->state)
|
if (state1 < ep->param1.rel2_to_x->state)
|
||||||
state1 = ep->param1.rel2_to_x->state;
|
state1 = ep->param1.rel2_to_x->state;
|
||||||
|
@ -2226,14 +2220,14 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags)
|
||||||
{
|
{
|
||||||
if (ep->param2->rel1_to_x)
|
if (ep->param2->rel1_to_x)
|
||||||
{
|
{
|
||||||
_edje_part_recalc(ed, ep->param2->rel1_to_x, FLAG_X);
|
_edje_part_recalc(ed, ep->param2->rel1_to_x, FLAG_X, NULL);
|
||||||
#ifdef EDJE_CALC_CACHE
|
#ifdef EDJE_CALC_CACHE
|
||||||
state2 = ep->param2->rel1_to_x->state;
|
state2 = ep->param2->rel1_to_x->state;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if (ep->param2->rel2_to_x)
|
if (ep->param2->rel2_to_x)
|
||||||
{
|
{
|
||||||
_edje_part_recalc(ed, ep->param2->rel2_to_x, FLAG_X);
|
_edje_part_recalc(ed, ep->param2->rel2_to_x, FLAG_X, NULL);
|
||||||
#ifdef EDJE_CALC_CACHE
|
#ifdef EDJE_CALC_CACHE
|
||||||
if (state2 < ep->param2->rel2_to_x->state)
|
if (state2 < ep->param2->rel2_to_x->state)
|
||||||
state2 = ep->param2->rel2_to_x->state;
|
state2 = ep->param2->rel2_to_x->state;
|
||||||
|
@ -2246,7 +2240,7 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags)
|
||||||
ep->calculating |= flags & FLAG_Y;
|
ep->calculating |= flags & FLAG_Y;
|
||||||
if (ep->param1.rel1_to_y)
|
if (ep->param1.rel1_to_y)
|
||||||
{
|
{
|
||||||
_edje_part_recalc(ed, ep->param1.rel1_to_y, FLAG_Y);
|
_edje_part_recalc(ed, ep->param1.rel1_to_y, FLAG_Y, NULL);
|
||||||
#ifdef EDJE_CALC_CACHE
|
#ifdef EDJE_CALC_CACHE
|
||||||
if (state1 < ep->param1.rel1_to_y->state)
|
if (state1 < ep->param1.rel1_to_y->state)
|
||||||
state1 = ep->param1.rel1_to_y->state;
|
state1 = ep->param1.rel1_to_y->state;
|
||||||
|
@ -2254,7 +2248,7 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags)
|
||||||
}
|
}
|
||||||
if (ep->param1.rel2_to_y)
|
if (ep->param1.rel2_to_y)
|
||||||
{
|
{
|
||||||
_edje_part_recalc(ed, ep->param1.rel2_to_y, FLAG_Y);
|
_edje_part_recalc(ed, ep->param1.rel2_to_y, FLAG_Y, NULL);
|
||||||
#ifdef EDJE_CALC_CACHE
|
#ifdef EDJE_CALC_CACHE
|
||||||
if (state1 < ep->param1.rel2_to_y->state)
|
if (state1 < ep->param1.rel2_to_y->state)
|
||||||
state1 = ep->param1.rel2_to_y->state;
|
state1 = ep->param1.rel2_to_y->state;
|
||||||
|
@ -2264,7 +2258,7 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags)
|
||||||
{
|
{
|
||||||
if (ep->param2->rel1_to_y)
|
if (ep->param2->rel1_to_y)
|
||||||
{
|
{
|
||||||
_edje_part_recalc(ed, ep->param2->rel1_to_y, FLAG_Y);
|
_edje_part_recalc(ed, ep->param2->rel1_to_y, FLAG_Y, NULL);
|
||||||
#ifdef EDJE_CALC_CACHE
|
#ifdef EDJE_CALC_CACHE
|
||||||
if (state2 < ep->param2->rel1_to_y->state)
|
if (state2 < ep->param2->rel1_to_y->state)
|
||||||
state2 = ep->param2->rel1_to_y->state;
|
state2 = ep->param2->rel1_to_y->state;
|
||||||
|
@ -2272,7 +2266,7 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags)
|
||||||
}
|
}
|
||||||
if (ep->param2->rel2_to_y)
|
if (ep->param2->rel2_to_y)
|
||||||
{
|
{
|
||||||
_edje_part_recalc(ed, ep->param2->rel2_to_y, FLAG_Y);
|
_edje_part_recalc(ed, ep->param2->rel2_to_y, FLAG_Y, NULL);
|
||||||
#ifdef EDJE_CALC_CACHE
|
#ifdef EDJE_CALC_CACHE
|
||||||
if (state2 < ep->param2->rel2_to_y->state)
|
if (state2 < ep->param2->rel2_to_y->state)
|
||||||
state2 = ep->param2->rel2_to_y->state;
|
state2 = ep->param2->rel2_to_y->state;
|
||||||
|
@ -2283,7 +2277,7 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags)
|
||||||
if (ep->drag && ep->drag->confine_to)
|
if (ep->drag && ep->drag->confine_to)
|
||||||
{
|
{
|
||||||
confine_to = ep->drag->confine_to;
|
confine_to = ep->drag->confine_to;
|
||||||
_edje_part_recalc(ed, confine_to, flags);
|
_edje_part_recalc(ed, confine_to, flags, NULL);
|
||||||
#ifdef EDJE_CALC_CACHE
|
#ifdef EDJE_CALC_CACHE
|
||||||
statec = confine_to->state;
|
statec = confine_to->state;
|
||||||
#endif
|
#endif
|
||||||
|
@ -2354,6 +2348,7 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags)
|
||||||
statel1 >= ep->param1.state ||
|
statel1 >= ep->param1.state ||
|
||||||
statep1 >= ep->param1.state ||
|
statep1 >= ep->param1.state ||
|
||||||
proxy_invalidate ||
|
proxy_invalidate ||
|
||||||
|
state ||
|
||||||
((ep->part->type == EDJE_PART_TYPE_TEXT || ep->part->type == EDJE_PART_TYPE_TEXTBLOCK) && ed->text_part_change))
|
((ep->part->type == EDJE_PART_TYPE_TEXT || ep->part->type == EDJE_PART_TYPE_TEXTBLOCK) && ed->text_part_change))
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
@ -2374,23 +2369,16 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags)
|
||||||
|
|
||||||
if (ep->current)
|
if (ep->current)
|
||||||
{
|
{
|
||||||
p1->x = ep->current->x - ed->x;
|
/* FIXME: except for text, we don't need in that case to recalc p1 at all*/
|
||||||
p1->y = ep->current->y - ed->y;
|
memcpy(p1, ep->current, sizeof (Edje_Calc_Params));
|
||||||
p1->w = ep->current->w;
|
p1->x += ed->x;
|
||||||
p1->h = ep->current->h;
|
p1->y += ed->y;
|
||||||
p1->color.r = ep->current->color.r;
|
p1->map.center.x += ed->x;
|
||||||
p1->color.g = ep->current->color.g;
|
p1->map.center.y += ed->y;
|
||||||
p1->color.b = ep->current->color.b;
|
p1->map.light.x += ed->x;
|
||||||
p1->color.a = ep->current->color.a;
|
p1->map.light.y += ed->y;
|
||||||
p1->type.text.size = ep->current->type.text.size;
|
p1->map.persp.x += ed->x;
|
||||||
p1->type.text.color2.r = ep->current->type.text.color2.r;
|
p1->map.persp.y += ed->y;
|
||||||
p1->type.text.color2.g = ep->current->type.text.color2.g;
|
|
||||||
p1->type.text.color2.b = ep->current->type.text.color2.b;
|
|
||||||
p1->type.text.color2.a = ep->current->type.text.color2.a;
|
|
||||||
p1->type.text.color3.r = ep->current->type.text.color3.r;
|
|
||||||
p1->type.text.color3.g = ep->current->type.text.color3.g;
|
|
||||||
p1->type.text.color3.b = ep->current->type.text.color3.b;
|
|
||||||
p1->type.text.color3.a = ep->current->type.text.color3.a;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
p3 = &lp3;
|
p3 = &lp3;
|
||||||
|
@ -2408,6 +2396,7 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags)
|
||||||
statel2 >= ep->param2->state ||
|
statel2 >= ep->param2->state ||
|
||||||
statep2 >= ep->param2->state ||
|
statep2 >= ep->param2->state ||
|
||||||
proxy_invalidate ||
|
proxy_invalidate ||
|
||||||
|
state ||
|
||||||
((ep->part->type == EDJE_PART_TYPE_TEXT || ep->part->type == EDJE_PART_TYPE_TEXTBLOCK) && ed->text_part_change))
|
((ep->part->type == EDJE_PART_TYPE_TEXT || ep->part->type == EDJE_PART_TYPE_TEXTBLOCK) && ed->text_part_change))
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
@ -2603,6 +2592,11 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (state)
|
||||||
|
{
|
||||||
|
memcpy(state, pf, sizeof (Edje_Calc_Params));
|
||||||
|
}
|
||||||
|
|
||||||
ep->req = pf->req;
|
ep->req = pf->req;
|
||||||
|
|
||||||
if (ep->drag && ep->drag->need_reset)
|
if (ep->drag && ep->drag->need_reset)
|
||||||
|
|
|
@ -410,6 +410,12 @@ typedef struct _Edje_Text_Insert_Filter_Callback Edje_Text_Insert_Filter_Callbac
|
||||||
#define EDJE_PART_PATH_SEPARATOR_STRING ":"
|
#define EDJE_PART_PATH_SEPARATOR_STRING ":"
|
||||||
#define EDJE_PART_PATH_SEPARATOR_INDEXL '['
|
#define EDJE_PART_PATH_SEPARATOR_INDEXL '['
|
||||||
#define EDJE_PART_PATH_SEPARATOR_INDEXR ']'
|
#define EDJE_PART_PATH_SEPARATOR_INDEXR ']'
|
||||||
|
|
||||||
|
#define FLAG_NONE 0
|
||||||
|
#define FLAG_X 0x01
|
||||||
|
#define FLAG_Y 0x02
|
||||||
|
#define FLAG_XY (FLAG_X | FLAG_Y)
|
||||||
|
|
||||||
/*----------*/
|
/*----------*/
|
||||||
|
|
||||||
struct _Edje_File
|
struct _Edje_File
|
||||||
|
@ -1998,6 +2004,8 @@ void _edje_multisense_shutdown(void);
|
||||||
Eina_Bool _edje_multisense_internal_sound_sample_play(Edje *ed, const char *sample_name, const double speed);
|
Eina_Bool _edje_multisense_internal_sound_sample_play(Edje *ed, const char *sample_name, const double speed);
|
||||||
Eina_Bool _edje_multisense_internal_sound_tone_play(Edje *ed, const char *tone_name, const double duration);
|
Eina_Bool _edje_multisense_internal_sound_tone_play(Edje *ed, const char *tone_name, const double duration);
|
||||||
|
|
||||||
|
void _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *state);
|
||||||
|
|
||||||
#ifdef HAVE_LIBREMIX
|
#ifdef HAVE_LIBREMIX
|
||||||
#include <remix/remix.h>
|
#include <remix/remix.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -505,29 +505,27 @@ _edje_program_run(Edje *ed, Edje_Program *pr, Eina_Bool force, const char *ssig,
|
||||||
{
|
{
|
||||||
if ((rp->object) && (pr->tween.mode & EDJE_TWEEN_MODE_OPT_FROM_CURRENT))
|
if ((rp->object) && (pr->tween.mode & EDJE_TWEEN_MODE_OPT_FROM_CURRENT))
|
||||||
{
|
{
|
||||||
rp->current = calloc(1, sizeof(Edje_Calc_Params));
|
Edje_Calc_Params *tmp;
|
||||||
evas_object_geometry_get(rp->object, &(rp->current->x),
|
|
||||||
&(rp->current->y),
|
tmp = calloc(1, sizeof(Edje_Calc_Params));
|
||||||
&(rp->current->w),
|
if (!tmp) goto low_mem_current;
|
||||||
&(rp->current->h));
|
_edje_part_recalc(ed, rp, FLAG_XY, tmp);
|
||||||
evas_object_color_get(rp->object, (int *)&(rp->current->color.r),
|
|
||||||
(int *)&(rp->current->color.g),
|
if (rp->current) free(rp->current);
|
||||||
(int *)&(rp->current->color.b),
|
rp->current = tmp;
|
||||||
(int *)&(rp->current->color.a));
|
|
||||||
evas_object_text_font_get(rp->object, NULL, &(rp->current->type.text.size));
|
rp->current->x -= ed->x;
|
||||||
evas_object_text_outline_color_get(rp->object,
|
rp->current->y -= ed->y;
|
||||||
(int *)&(rp->current->type.text.color2.r),
|
rp->current->map.center.x -= ed->x;
|
||||||
(int *)&(rp->current->type.text.color2.g),
|
rp->current->map.center.y -= ed->y;
|
||||||
(int *)&(rp->current->type.text.color2.b),
|
rp->current->map.light.x -= ed->x;
|
||||||
(int *)&(rp->current->type.text.color2.a));
|
rp->current->map.light.y -= ed->y;
|
||||||
evas_object_text_shadow_color_get(rp->object,
|
rp->current->map.persp.x -= ed->x;
|
||||||
(int *)&(rp->current->type.text.color3.r),
|
rp->current->map.persp.y -= ed->y;
|
||||||
(int *)&(rp->current->type.text.color3.g),
|
|
||||||
(int *)&(rp->current->type.text.color3.b),
|
|
||||||
(int *)&(rp->current->type.text.color3.a));
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
low_mem_current:
|
||||||
if (rp->current) free(rp->current);
|
if (rp->current) free(rp->current);
|
||||||
rp->current = NULL;
|
rp->current = NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue