* edje: Add Fixed Point Math support to Edje.
You can try it by passing --enable-fixed-point to the configure. It will produce an ABI/API compatible Edje library that use internally Eina_F32p32 instead of double. It will load Eina_F32p32 instead of double from eet file (thanks to eet ability to convert them on the fly), so edje file are compatible between fixed point and floating point version. This patch touch almost all internal calc of Edje, I did test it with elementary_test, enlightenment and all my test apps, but it could certainly break some of your preferred Edje file. If you see any unexpected behaviour please report them to me as soon as possible. Note: For devs, I put few macros in edje_private.h that should now be used when doing calc in Edje, please use them so that Fixed Point doesn't break in the futur. SVN revision: 44323
This commit is contained in:
parent
63d651b7ad
commit
b32c9a3eae
|
@ -126,6 +126,22 @@ if test "x${want_edje_calc_cache}" = "xyes" ; then
|
|||
AC_DEFINE(EDJE_CALC_CACHE, 1, [Cache result of edje_part_recalc - this uses up extra ram with the gain of reducing CPU usage when edje object are not resized])
|
||||
fi
|
||||
|
||||
# Enable Fixed Point use
|
||||
want_fixed_point="no"
|
||||
|
||||
AC_ARG_ENABLE([fixed-point],
|
||||
[AC_HELP_STRING(
|
||||
[--enable-fixed-point],
|
||||
[reduce use of FPU by using Fixed Point provided by Eina and Eet, [[default=disabled]]]
|
||||
)],
|
||||
[want_fixed_point=$enableval]
|
||||
)
|
||||
AM_CONDITIONAL(BUILD_EDJE_FP, test "x${want_fixed_point}" = "xyes")
|
||||
|
||||
if test "x${want_fixed_point}" = "xyes" ; then
|
||||
AC_DEFINE(BUILD_EDJE_FP, 1, [Use Fixed Point instead of FPU])
|
||||
fi
|
||||
|
||||
install_vim="yes"
|
||||
AC_ARG_WITH([vim],
|
||||
[AC_HELP_STRING([--with-vim=DIR], [Location of Vim data files [[autodetect]]])],
|
||||
|
@ -337,6 +353,7 @@ echo " Amalgamation.........: ${do_amalgamation}"
|
|||
echo " Ecore IMF............: $have_ecore_imf"
|
||||
echo " EDJE_PROGRAM_CACHE...: $want_edje_program_cache"
|
||||
echo " EDJE_CALC_CACHE......: $want_edje_calc_cache"
|
||||
echo " Fixed point..........: $want_fixed_point"
|
||||
echo
|
||||
echo " Build binaries.......: $have_edje_cc"
|
||||
echo
|
||||
|
|
|
@ -18,28 +18,40 @@ static void _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags);
|
|||
void
|
||||
_edje_part_pos_set(Edje *ed, Edje_Real_Part *ep, int mode, double pos)
|
||||
{
|
||||
double npos;
|
||||
FLOAT_T fp_pos;
|
||||
FLOAT_T npos;
|
||||
|
||||
pos = CLAMP(pos, 0.0, 1.0);
|
||||
|
||||
npos = 0.0;
|
||||
fp_pos = FROM_DOUBLE(pos);
|
||||
|
||||
npos = ZERO;
|
||||
/* take linear pos along timescale and use interpolation method */
|
||||
switch (mode)
|
||||
{
|
||||
case EDJE_TWEEN_MODE_SINUSOIDAL:
|
||||
npos = (1.0 - cos(pos * PI)) / 2.0;
|
||||
break;
|
||||
/* npos = (1.0 - cos(pos * PI)) / 2.0; */
|
||||
npos = DIV2(SUB(FROM_INT(1),
|
||||
COS(MUL(fp_pos,
|
||||
PI))));
|
||||
break;
|
||||
case EDJE_TWEEN_MODE_ACCELERATE:
|
||||
npos = 1.0 - sin((PI / 2.0) + (pos * PI / 2.0));
|
||||
break;
|
||||
/* npos = 1.0 - sin((PI / 2.0) + (pos * PI / 2.0)); */
|
||||
npos = SUB(FROM_INT(1),
|
||||
SIN(ADD(DIV2(PI),
|
||||
MUL(fp_pos,
|
||||
DIV2(PI)))));
|
||||
break;
|
||||
case EDJE_TWEEN_MODE_DECELERATE:
|
||||
npos = sin(pos * PI / 2.0);
|
||||
/* npos = sin(pos * PI / 2.0); */
|
||||
npos = SIN(MUL(fp_pos,
|
||||
DIV2(PI)));
|
||||
break;
|
||||
case EDJE_TWEEN_MODE_LINEAR:
|
||||
npos = pos;
|
||||
break;
|
||||
npos = fp_pos;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
break;
|
||||
}
|
||||
if (npos == ep->description_pos) return;
|
||||
|
||||
|
@ -231,13 +243,13 @@ _edje_recalc_do(Edje *ed)
|
|||
}
|
||||
|
||||
int
|
||||
_edje_part_dragable_calc(Edje *ed, Edje_Real_Part *ep, double *x, double *y)
|
||||
_edje_part_dragable_calc(Edje *ed, Edje_Real_Part *ep, FLOAT_T *x, FLOAT_T *y)
|
||||
{
|
||||
if (ep->drag)
|
||||
{
|
||||
if (ep->drag->confine_to)
|
||||
{
|
||||
double dx, dy, dw, dh;
|
||||
FLOAT_T dx, dy, dw, dh;
|
||||
int ret = 0;
|
||||
|
||||
if ((ep->part->dragable.x != 0) &&
|
||||
|
@ -245,15 +257,15 @@ _edje_part_dragable_calc(Edje *ed, Edje_Real_Part *ep, double *x, double *y)
|
|||
else if (ep->part->dragable.x != 0) ret = 1;
|
||||
else if (ep->part->dragable.y != 0) ret = 2;
|
||||
|
||||
dx = ep->x - ep->drag->confine_to->x;
|
||||
dw = ep->drag->confine_to->w - ep->w;
|
||||
if (dw != 0.0) dx /= dw;
|
||||
else dx = 0.0;
|
||||
dx = SUB(ep->x, ep->drag->confine_to->x);
|
||||
dw = SUB(ep->drag->confine_to->w, ep->w);
|
||||
if (dw != ZERO) dx = DIV(dx, dw);
|
||||
else dx = ZERO;
|
||||
|
||||
dy = ep->y - ep->drag->confine_to->y;
|
||||
dh = ep->drag->confine_to->h - ep->h;
|
||||
if (dh != 0) dy /= dh;
|
||||
else dy = 0.0;
|
||||
dy = SUB(ep->y, ep->drag->confine_to->y);
|
||||
dh = SUB(ep->drag->confine_to->h, ep->h);
|
||||
if (dh != ZERO) dy = DIV(dy, dh);
|
||||
else dy = ZERO;
|
||||
|
||||
if (x) *x = dx;
|
||||
if (y) *y = dy;
|
||||
|
@ -262,19 +274,19 @@ _edje_part_dragable_calc(Edje *ed, Edje_Real_Part *ep, double *x, double *y)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (x) *x = (double)(ep->drag->tmp.x + ep->drag->x);
|
||||
if (y) *y = (double)(ep->drag->tmp.y + ep->drag->y);
|
||||
if (x) *x = ADD(FROM_INT(ep->drag->tmp.x), ep->drag->x);
|
||||
if (y) *y = ADD(FROM_INT(ep->drag->tmp.y), ep->drag->y);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (x) *x = 0.0;
|
||||
if (y) *y = 0.0;
|
||||
if (x) *x = ZERO;
|
||||
if (y) *y = ZERO;
|
||||
return 0;
|
||||
ed = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
_edje_dragable_pos_set(Edje *ed, Edje_Real_Part *ep, double x, double y)
|
||||
_edje_dragable_pos_set(Edje *ed, Edje_Real_Part *ep, FLOAT_T x, FLOAT_T y)
|
||||
{
|
||||
/* check whether this part is dragable at all */
|
||||
if (!ep->drag) return ;
|
||||
|
@ -319,37 +331,51 @@ _edje_part_recalc_single_rel(Edje *ed,
|
|||
{
|
||||
if (flags & FLAG_X)
|
||||
{
|
||||
FLOAT_T x, w;
|
||||
|
||||
if (rel1_to_x)
|
||||
params->x = desc->rel1.offset_x +
|
||||
rel1_to_x->x + (desc->rel1.relative_x * rel1_to_x->w);
|
||||
x = ADD(FROM_INT(desc->rel1.offset_x + rel1_to_x->x),
|
||||
SCALE(desc->rel1.relative_x, rel1_to_x->w));
|
||||
else
|
||||
params->x = desc->rel1.offset_x +
|
||||
(desc->rel1.relative_x * ed->w);
|
||||
x = ADD(FROM_INT(desc->rel1.offset_x),
|
||||
SCALE(desc->rel1.relative_x, ed->w));
|
||||
params->x = TO_INT(x);
|
||||
|
||||
if (rel2_to_x)
|
||||
params->w = desc->rel2.offset_x +
|
||||
rel2_to_x->x + (desc->rel2.relative_x * rel2_to_x->w) -
|
||||
params->x + 1;
|
||||
w = ADD(SUB(ADD(FROM_INT(desc->rel2.offset_x + rel2_to_x->x),
|
||||
SCALE(desc->rel2.relative_x, rel2_to_x->w)),
|
||||
x),
|
||||
FROM_INT(1));
|
||||
else
|
||||
params->w = desc->rel2.offset_x +
|
||||
(desc->rel2.relative_x * ed->w) -
|
||||
params->x + 1;
|
||||
w = ADD(SUB(ADD(FROM_INT(desc->rel2.offset_x),
|
||||
SCALE(desc->rel2.relative_x, ed->w)),
|
||||
x),
|
||||
FROM_INT(1));
|
||||
params->w = TO_INT(w);
|
||||
}
|
||||
if (flags & FLAG_Y)
|
||||
{
|
||||
FLOAT_T y, h;
|
||||
|
||||
if (rel1_to_y)
|
||||
params->y = desc->rel1.offset_y +
|
||||
rel1_to_y->y + (desc->rel1.relative_y * rel1_to_y->h);
|
||||
y = ADD(FROM_INT(desc->rel1.offset_y + rel1_to_y->y),
|
||||
SCALE(desc->rel1.relative_y, rel1_to_y->h));
|
||||
else
|
||||
params->y = desc->rel1.offset_y +
|
||||
(desc->rel1.relative_y * ed->h);
|
||||
y = ADD(FROM_INT(desc->rel1.offset_y),
|
||||
SCALE(desc->rel1.relative_y, ed->h));
|
||||
params->y = TO_INT(y);
|
||||
|
||||
if (rel2_to_y)
|
||||
params->h = desc->rel2.offset_y +
|
||||
rel2_to_y->y + (desc->rel2.relative_y * rel2_to_y->h) -
|
||||
params->y + 1;
|
||||
h = ADD(SUB(ADD(FROM_INT(desc->rel2.offset_y + rel2_to_y->y),
|
||||
SCALE(desc->rel2.relative_y, rel2_to_y->h)),
|
||||
y),
|
||||
FROM_INT(1));
|
||||
else
|
||||
params->h = desc->rel2.offset_y +
|
||||
(desc->rel2.relative_y * ed->h) -
|
||||
params->y + 1;
|
||||
h = ADD(SUB(ADD(FROM_INT(desc->rel2.offset_y),
|
||||
SCALE(desc->rel2.relative_y, ed->h)),
|
||||
y),
|
||||
FROM_INT(1));
|
||||
params->h = TO_INT(h);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -361,25 +387,25 @@ _edje_part_recalc_single_aspect(Edje_Real_Part *ep,
|
|||
int *maxw, int *maxh)
|
||||
{
|
||||
int apref = -10;
|
||||
double aspect, amax, amin;
|
||||
double new_w = 0, new_h = 0, want_x, want_y, want_w, want_h;
|
||||
FLOAT_T aspect, amax, amin;
|
||||
FLOAT_T new_w = ZERO, new_h = ZERO, want_x, want_y, want_w, want_h;
|
||||
|
||||
if (params->h <= 0) aspect = 999999.0;
|
||||
else aspect = (double)params->w / (double)params->h;
|
||||
if (params->h <= ZERO) aspect = FROM_INT(999999);
|
||||
else aspect = DIV(FROM_INT(params->w), FROM_INT(params->h));
|
||||
amax = desc->aspect.max;
|
||||
amin = desc->aspect.min;
|
||||
if ((ep->swallow_params.aspect.w > 0) &&
|
||||
(ep->swallow_params.aspect.h > 0))
|
||||
amin = amax =
|
||||
(double)ep->swallow_params.aspect.w /
|
||||
(double)ep->swallow_params.aspect.h;
|
||||
want_x = params->x;
|
||||
want_w = new_w = params->w;
|
||||
DIV(FROM_INT(ep->swallow_params.aspect.w),
|
||||
FROM_INT(ep->swallow_params.aspect.h));
|
||||
want_x = FROM_INT(params->x);
|
||||
want_w = new_w = FROM_INT(params->w);
|
||||
|
||||
want_y = params->y;
|
||||
want_h = new_h = params->h;
|
||||
want_y = FROM_INT(params->y);
|
||||
want_h = new_h = FROM_INT(params->h);
|
||||
|
||||
if ((amin > 0.0) && (amax > 0.0))
|
||||
if ((amin > ZERO) && (amax > ZERO))
|
||||
{
|
||||
apref = desc->aspect.prefer;
|
||||
if (ep->swallow_params.aspect.mode > EDJE_ASPECT_CONTROL_NONE)
|
||||
|
@ -407,93 +433,97 @@ _edje_part_recalc_single_aspect(Edje_Real_Part *ep,
|
|||
case EDJE_ASPECT_PREFER_NONE:
|
||||
/* keep both dimensions in check */
|
||||
/* adjust for min aspect (width / height) */
|
||||
if ((amin > 0.0) && (aspect < amin))
|
||||
if ((amin > ZERO) && (aspect < amin))
|
||||
{
|
||||
new_h = (params->w / amin);
|
||||
new_w = (params->h * amin);
|
||||
new_h = DIV(FROM_INT(params->w), amin);
|
||||
new_w = SCALE(amin, params->h);
|
||||
}
|
||||
/* adjust for max aspect (width / height) */
|
||||
if ((amax > 0.0) && (aspect > amax))
|
||||
if ((amax > ZERO) && (aspect > amax))
|
||||
{
|
||||
new_h = (params->w / amax);
|
||||
new_w = (params->h * amax);
|
||||
new_h = DIV(FROM_INT(params->w), amax);
|
||||
new_w = SCALE(amax, params->h);
|
||||
}
|
||||
if ((amax > 0.0) && (new_w < params->w))
|
||||
if ((amax > ZERO) && (new_w < FROM_INT(params->w)))
|
||||
{
|
||||
new_w = params->w;
|
||||
new_h = params->w / amax;
|
||||
new_w = FROM_INT(params->w);
|
||||
new_h = DIV(FROM_INT(params->w), amax);
|
||||
}
|
||||
if ((amax > 0.0) && (new_h < params->h))
|
||||
if ((amax > ZERO) && (new_h < FROM_INT(params->h)))
|
||||
{
|
||||
new_w = params->h * amax;
|
||||
new_h = params->h;
|
||||
new_w = SCALE(amax, params->h);
|
||||
new_h = FROM_INT(params->h);
|
||||
}
|
||||
break;
|
||||
/* prefer vertical size as determiner */
|
||||
case EDJE_ASPECT_PREFER_VERTICAL:
|
||||
/* keep both dimensions in check */
|
||||
/* adjust for max aspect (width / height) */
|
||||
if ((amax > 0.0) && (aspect > amax))
|
||||
new_w = (params->h * amax);
|
||||
if ((amax > ZERO) && (aspect > amax))
|
||||
new_w = SCALE(amax, params->h);
|
||||
/* adjust for min aspect (width / height) */
|
||||
if ((amin > 0.0) && (aspect < amin))
|
||||
new_w = (params->h * amin);
|
||||
if ((amin > ZERO) && (aspect < amin))
|
||||
new_w = SCALE(amin, params->h);
|
||||
break;
|
||||
/* prefer horizontal size as determiner */
|
||||
case EDJE_ASPECT_PREFER_HORIZONTAL:
|
||||
/* keep both dimensions in check */
|
||||
/* adjust for max aspect (width / height) */
|
||||
if ((amax > 0.0) && (aspect > amax))
|
||||
new_h = (params->w / amax);
|
||||
if ((amax > ZERO) && (aspect > amax))
|
||||
new_h = DIV(FROM_INT(params->w), amax);
|
||||
/* adjust for min aspect (width / height) */
|
||||
if ((amin > 0.0) && (aspect < amin))
|
||||
new_h = (params->w / amin);
|
||||
if ((amin > ZERO) && (aspect < amin))
|
||||
new_h = DIV(FROM_INT(params->w), amin);
|
||||
break;
|
||||
case EDJE_ASPECT_PREFER_BOTH:
|
||||
/* keep both dimensions in check */
|
||||
/* adjust for max aspect (width / height) */
|
||||
if ((amax > 0.0) && (aspect > amax))
|
||||
if ((amax > ZERO) && (aspect > amax))
|
||||
{
|
||||
new_w = (params->h * amax);
|
||||
new_h = (params->w / amax);
|
||||
new_w = SCALE(amax, params->h);
|
||||
new_h = DIV(FROM_INT(params->w), amax);
|
||||
}
|
||||
/* adjust for min aspect (width / height) */
|
||||
if ((amin > 0.0) && (aspect < amin))
|
||||
if ((amin > ZERO) && (aspect < amin))
|
||||
{
|
||||
new_w = (params->h * amin);
|
||||
new_h = (params->w / amin);
|
||||
new_w = SCALE(amin, params->h);
|
||||
new_h = DIV(FROM_INT(params->w), amin);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (!((amin > 0.0) && (amax > 0.0) && (apref == EDJE_ASPECT_PREFER_NONE)))
|
||||
if (!((amin > ZERO) && (amax > ZERO) && (apref == EDJE_ASPECT_PREFER_NONE)))
|
||||
{
|
||||
if ((*maxw >= 0) && (new_w > *maxw)) new_w = *maxw;
|
||||
if (new_w < *minw) new_w = *minw;
|
||||
if ((*maxw >= 0) && (new_w > FROM_INT(*maxw)))
|
||||
new_w = FROM_INT(*maxw);
|
||||
if (new_w < FROM_INT(*minw))
|
||||
new_w = FROM_INT(*minw);
|
||||
|
||||
if ((*maxh >= 0) && (new_h > *maxh)) new_h = *maxh;
|
||||
if (new_h < *minh) new_h = *minh;
|
||||
if ((FROM_INT(*maxh) >= 0) && (new_h > FROM_INT(*maxh)))
|
||||
new_h = FROM_INT(*maxh);
|
||||
if (new_h < FROM_INT(*minh))
|
||||
new_h = FROM_INT(*minh);
|
||||
}
|
||||
|
||||
/* do real adjustment */
|
||||
if (apref == EDJE_ASPECT_PREFER_BOTH)
|
||||
{
|
||||
if (amin == 0.0) amin = amax;
|
||||
if (amin != 0.0)
|
||||
if (amin == ZERO) amin = amax;
|
||||
if (amin != ZERO)
|
||||
{
|
||||
/* fix h and vary w */
|
||||
if (new_w > params->w)
|
||||
if (new_w > FROM_INT(params->w))
|
||||
{
|
||||
// params->w = new_w;
|
||||
// EXCEEDS BOUNDS in W
|
||||
new_h = (params->w / amin);
|
||||
new_w = params->w;
|
||||
if (new_h > params->h)
|
||||
new_h = DIV(FROM_INT(params->w), amin);
|
||||
new_w = FROM_INT(params->w);
|
||||
if (new_h > FROM_INT(params->h))
|
||||
{
|
||||
new_h = params->h;
|
||||
new_w = (params->h * amin);
|
||||
new_h = FROM_INT(params->h);
|
||||
new_w = SCALE(amin, params->h);
|
||||
}
|
||||
}
|
||||
/* fix w and vary h */
|
||||
|
@ -501,47 +531,51 @@ _edje_part_recalc_single_aspect(Edje_Real_Part *ep,
|
|||
{
|
||||
// params->h = new_h;
|
||||
// EXCEEDS BOUNDS in H
|
||||
new_h = params->h;
|
||||
new_w = (params->h * amin);
|
||||
if (new_w > params->w)
|
||||
new_h = FROM_INT(params->h);
|
||||
new_w = SCALE(amin, params->h);
|
||||
if (new_w > FROM_INT(params->w))
|
||||
{
|
||||
new_h = (params->w / amin);
|
||||
new_w = params->w;
|
||||
new_h = DIV(FROM_INT(params->w), amin);
|
||||
new_w = FROM_INT(params->w);
|
||||
}
|
||||
}
|
||||
params->w = new_w;
|
||||
params->h = new_h;
|
||||
params->w = TO_INT(new_w);
|
||||
params->h = TO_INT(new_h);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (apref != EDJE_ASPECT_PREFER_BOTH)
|
||||
{
|
||||
if ((amin > 0.0) && (amax > 0.0) && (apref == EDJE_ASPECT_PREFER_NONE))
|
||||
if ((amin > 0.0) && (amax > ZERO) && (apref == EDJE_ASPECT_PREFER_NONE))
|
||||
{
|
||||
params->w = new_w;
|
||||
params->h = new_h;
|
||||
params->w = TO_INT(new_w);
|
||||
params->h = TO_INT(new_h);
|
||||
}
|
||||
else if ((params->h - new_h) > (params->w - new_w))
|
||||
else if ((FROM_INT(params->h) - new_h) > (FROM_INT(params->w) - new_w))
|
||||
{
|
||||
if (params->h < new_h)
|
||||
params->h = new_h;
|
||||
else if (params->h > new_h)
|
||||
params->h = new_h;
|
||||
if (params->h < TO_INT(new_h))
|
||||
params->h = TO_INT(new_h);
|
||||
else if (params->h > TO_INT(new_h))
|
||||
params->h = TO_INT(new_h);
|
||||
if (apref == EDJE_ASPECT_PREFER_VERTICAL)
|
||||
params->w = new_w;
|
||||
params->w = TO_INT(new_w);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (params->w < new_w)
|
||||
params->w = new_w;
|
||||
else if (params->w > new_w)
|
||||
params->w = new_w;
|
||||
if (params->w < TO_INT(new_w))
|
||||
params->w = TO_INT(new_w);
|
||||
else if (params->w > TO_INT(new_w))
|
||||
params->w = TO_INT(new_w);
|
||||
if (apref == EDJE_ASPECT_PREFER_HORIZONTAL)
|
||||
params->h = new_h;
|
||||
params->h = TO_INT(new_h);
|
||||
}
|
||||
}
|
||||
params->x = want_x + ((want_w - params->w) * desc->align.x);
|
||||
params->y = want_y + ((want_h - params->h) * desc->align.y);
|
||||
params->x = TO_INT(ADD(want_x,
|
||||
MUL(SUB(want_w, FROM_INT(params->w)),
|
||||
desc->align.x)));
|
||||
params->y = TO_INT(ADD(want_y,
|
||||
MUL(SUB(want_h, FROM_INT(params->h)),
|
||||
desc->align.y)));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -560,7 +594,7 @@ _edje_part_recalc_single_step(Edje_Part_Description *desc,
|
|||
new_w = desc->step.x * steps;
|
||||
if (params->w > new_w)
|
||||
{
|
||||
params->x += ((params->w - new_w) * desc->align.x);
|
||||
params->x += TO_INT(SCALE(desc->align.x, (params->w - new_w)));
|
||||
params->w = new_w;
|
||||
}
|
||||
}
|
||||
|
@ -576,7 +610,7 @@ _edje_part_recalc_single_step(Edje_Part_Description *desc,
|
|||
new_h = desc->step.y * steps;
|
||||
if (params->h > new_h)
|
||||
{
|
||||
params->y += ((params->h - new_h) * desc->align.y);
|
||||
params->y += TO_INT(SCALE(desc->align.y, (params->h - new_h)));
|
||||
params->h = new_h;
|
||||
}
|
||||
}
|
||||
|
@ -584,7 +618,7 @@ _edje_part_recalc_single_step(Edje_Part_Description *desc,
|
|||
}
|
||||
|
||||
static void
|
||||
_edje_part_recalc_single_textblock(double sc,
|
||||
_edje_part_recalc_single_textblock(FLOAT_T sc,
|
||||
Edje *ed,
|
||||
Edje_Real_Part *ep,
|
||||
Edje_Part_Description *chosen_desc,
|
||||
|
@ -633,7 +667,7 @@ _edje_part_recalc_single_textblock(double sc,
|
|||
}
|
||||
|
||||
if (ep->part->scale)
|
||||
evas_object_scale_set(ep->object, sc);
|
||||
evas_object_scale_set(ep->object, TO_DOUBLE(sc));
|
||||
|
||||
if (stl)
|
||||
{
|
||||
|
@ -707,7 +741,7 @@ _edje_part_recalc_single_textblock(double sc,
|
|||
}
|
||||
|
||||
static void
|
||||
_edje_part_recalc_single_text(double sc,
|
||||
_edje_part_recalc_single_text(FLOAT_T sc,
|
||||
Edje *ed,
|
||||
Edje_Real_Part *ep,
|
||||
Edje_Part_Description *desc,
|
||||
|
@ -787,7 +821,7 @@ _edje_part_recalc_single_text(double sc,
|
|||
}
|
||||
}
|
||||
if (ep->part->scale)
|
||||
evas_object_scale_set(ep->object, sc);
|
||||
evas_object_scale_set(ep->object, TO_DOUBLE(sc));
|
||||
if (inlined_font) evas_object_text_font_source_set(ep->object, ed->path);
|
||||
else evas_object_text_font_source_set(ep->object, NULL);
|
||||
|
||||
|
@ -885,7 +919,7 @@ _edje_part_recalc_single_min(Edje_Part_Description *desc,
|
|||
{
|
||||
if (params->w < minw)
|
||||
{
|
||||
params->x += ((params->w - minw) * desc->align.x);
|
||||
params->x += TO_INT(SCALE(desc->align.x, (params->w - minw)));
|
||||
params->w = minw;
|
||||
}
|
||||
}
|
||||
|
@ -896,7 +930,7 @@ _edje_part_recalc_single_min(Edje_Part_Description *desc,
|
|||
{
|
||||
if (params->h < minh)
|
||||
{
|
||||
params->y += ((params->h - minh) * desc->align.y);
|
||||
params->y += TO_INT(SCALE(desc->align.y, (params->h - minh)));
|
||||
params->h = minh;
|
||||
}
|
||||
}
|
||||
|
@ -915,8 +949,7 @@ _edje_part_recalc_single_max(Edje_Part_Description *desc,
|
|||
{
|
||||
if (params->w > maxw)
|
||||
{
|
||||
params->x = params->x +
|
||||
((params->w - maxw) * desc->align.x);
|
||||
params->x += TO_INT(SCALE(desc->align.x, (params->w - maxw)));
|
||||
params->w = maxw;
|
||||
}
|
||||
}
|
||||
|
@ -927,8 +960,7 @@ _edje_part_recalc_single_max(Edje_Part_Description *desc,
|
|||
{
|
||||
if (params->h > maxh)
|
||||
{
|
||||
params->y = params->y +
|
||||
((params->h - maxh) * desc->align.y);
|
||||
params->y += TO_INT(SCALE(desc->align.y, (params->h - maxh)));
|
||||
params->h = maxh;
|
||||
}
|
||||
}
|
||||
|
@ -948,19 +980,19 @@ _edje_part_recalc_single_drag(Edje_Real_Part *ep,
|
|||
{
|
||||
int offset;
|
||||
int step;
|
||||
double v;
|
||||
FLOAT_T v;
|
||||
|
||||
/* complex dragable params */
|
||||
if (flags & FLAG_X)
|
||||
{
|
||||
v = ep->drag->size.x * confine_to->w;
|
||||
v = SCALE(ep->drag->size.x, confine_to->w);
|
||||
|
||||
if ((minw > 0) && (v < minw)) params->w = minw;
|
||||
else if ((maxw >= 0) && (v > maxw)) params->w = maxw;
|
||||
else params->w = v;
|
||||
if ((minw > 0) && (TO_INT(v) < minw)) params->w = minw;
|
||||
else if ((maxw >= 0) && (TO_INT(v) > maxw)) params->w = maxw;
|
||||
else params->w = TO_INT(v);
|
||||
|
||||
offset = (ep->drag->x * (confine_to->w - params->w)) +
|
||||
ep->drag->tmp.x;
|
||||
offset = TO_INT(SCALE(ep->drag->x, (confine_to->w - params->w)))
|
||||
+ ep->drag->tmp.x;
|
||||
if (ep->part->dragable.step_x > 0)
|
||||
{
|
||||
params->x = confine_to->x +
|
||||
|
@ -978,14 +1010,14 @@ _edje_part_recalc_single_drag(Edje_Real_Part *ep,
|
|||
}
|
||||
if (flags & FLAG_Y)
|
||||
{
|
||||
v = ep->drag->size.y * confine_to->h;
|
||||
v = SCALE(ep->drag->size.y, confine_to->h);
|
||||
|
||||
if ((minh > 0) && (v < minh)) params->h = minh;
|
||||
else if ((maxh >= 0) && (v > maxh)) params->h = maxh;
|
||||
else params->h = v;
|
||||
if ((minh > 0) && (TO_INT(v) < minh)) params->h = minh;
|
||||
else if ((maxh >= 0) && (TO_INT(v) > maxh)) params->h = maxh;
|
||||
else params->h = TO_INT(v);
|
||||
|
||||
offset = (ep->drag->y * (confine_to->h - params->h)) +
|
||||
ep->drag->tmp.y;
|
||||
offset = TO_INT(SCALE(ep->drag->y, (confine_to->h - params->h)))
|
||||
+ ep->drag->tmp.y;
|
||||
if (ep->part->dragable.step_y > 0)
|
||||
{
|
||||
params->y = confine_to->y +
|
||||
|
@ -1010,7 +1042,7 @@ _edje_part_recalc_single_drag(Edje_Real_Part *ep,
|
|||
}
|
||||
if ((params->x + params->w) > (confine_to->x + confine_to->w))
|
||||
{
|
||||
params->x = confine_to->x + (confine_to->w - params->w);
|
||||
params->x = confine_to->x + confine_to->w - params->w;
|
||||
}
|
||||
}
|
||||
if (flags & FLAG_Y)
|
||||
|
@ -1021,7 +1053,7 @@ _edje_part_recalc_single_drag(Edje_Real_Part *ep,
|
|||
}
|
||||
if ((params->y + params->h) > (confine_to->y + confine_to->h))
|
||||
{
|
||||
params->y = confine_to->y + (confine_to->h - params->h);
|
||||
params->y = confine_to->y + confine_to->h - params->h;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1030,13 +1062,13 @@ _edje_part_recalc_single_drag(Edje_Real_Part *ep,
|
|||
/* simple dragable params */
|
||||
if (flags & FLAG_X)
|
||||
{
|
||||
params->x += ep->drag->x + ep->drag->tmp.x;
|
||||
params->x += TO_INT(ep->drag->x) + ep->drag->tmp.x;
|
||||
params->req_drag.x = params->x;
|
||||
params->req_drag.w = params->w;
|
||||
}
|
||||
if (flags & FLAG_Y)
|
||||
{
|
||||
params->y += ep->drag->y + ep->drag->tmp.y;
|
||||
params->y += TO_INT(ep->drag->y) + ep->drag->tmp.y;
|
||||
params->req_drag.y = params->y;
|
||||
params->req_drag.h = params->h;
|
||||
}
|
||||
|
@ -1053,20 +1085,24 @@ _edje_part_recalc_single_fill(Edje_Real_Part *ep,
|
|||
{
|
||||
int x2, y2;
|
||||
int dx, dy;
|
||||
double m;
|
||||
int angle;
|
||||
|
||||
params->type.common.fill.x = desc->gradient.rel1.offset_x + (params->w * desc->gradient.rel1.relative_x);
|
||||
params->type.common.fill.y = desc->gradient.rel1.offset_y + (params->h * desc->gradient.rel1.relative_y);
|
||||
params->type.common.fill.x = desc->gradient.rel1.offset_x
|
||||
+ TO_INT(SCALE(desc->gradient.rel1.relative_x, params->w));
|
||||
params->type.common.fill.y = desc->gradient.rel1.offset_y
|
||||
+ TO_INT((SCALE(desc->gradient.rel1.relative_y, params->h)));
|
||||
|
||||
x2 = desc->gradient.rel2.offset_x + (params->w * desc->gradient.rel2.relative_x);
|
||||
y2 = desc->gradient.rel2.offset_y + (params->h * desc->gradient.rel2.relative_y);
|
||||
x2 = desc->gradient.rel2.offset_x
|
||||
+ TO_INT(SCALE(desc->gradient.rel2.relative_x, params->w));
|
||||
|
||||
y2 = desc->gradient.rel2.offset_y
|
||||
+ TO_INT(SCALE(desc->gradient.rel2.relative_y, params->h));
|
||||
|
||||
params->type.common.fill.w = 1; /* doesn't matter for linear grads */
|
||||
|
||||
dy = y2 - params->type.common.fill.y;
|
||||
dx = x2 - params->type.common.fill.x;
|
||||
params->type.common.fill.h = sqrt(dx * dx + dy * dy);
|
||||
params->type.common.fill.h = TO_INT(SQRT(FROM_INT(dx * dx + dy * dy)));
|
||||
|
||||
params->type.common.fill.spread = desc->fill.spread;
|
||||
|
||||
|
@ -1086,6 +1122,7 @@ _edje_part_recalc_single_fill(Edje_Real_Part *ep,
|
|||
}
|
||||
else
|
||||
{
|
||||
double m; /* FIXME: atan isn't available atm in eina fp implementation */
|
||||
m = (double)dx / (double)dy;
|
||||
angle = atan(m) * 180 / M_PI;
|
||||
if (dy < 0)
|
||||
|
@ -1107,19 +1144,24 @@ _edje_part_recalc_single_fill(Edje_Real_Part *ep,
|
|||
else
|
||||
fw = params->w;
|
||||
|
||||
params->type.common.fill.x = desc->fill.pos_abs_x + (fw * desc->fill.pos_rel_x);
|
||||
params->type.common.fill.w = desc->fill.abs_x + (fw * desc->fill.rel_x);
|
||||
params->type.common.fill.x = desc->fill.pos_abs_x
|
||||
+ TO_INT(SCALE(desc->fill.pos_rel_x, fw));
|
||||
params->type.common.fill.w = desc->fill.abs_x
|
||||
+ TO_INT(SCALE(desc->fill.rel_x, fw));
|
||||
}
|
||||
if (flags & FLAG_Y)
|
||||
{
|
||||
int fh;
|
||||
|
||||
if (desc->fill.type == EDJE_FILL_TYPE_TILE)
|
||||
evas_object_image_size_get(ep->object, NULL, &fh);
|
||||
else
|
||||
fh = params->h;
|
||||
|
||||
params->type.common.fill.y = desc->fill.pos_abs_y + (fh * desc->fill.pos_rel_y);
|
||||
params->type.common.fill.h = desc->fill.abs_y + (fh * desc->fill.rel_y);
|
||||
params->type.common.fill.y = desc->fill.pos_abs_y
|
||||
+ TO_INT(SCALE(desc->fill.pos_rel_y, fh));
|
||||
params->type.common.fill.h = desc->fill.abs_y
|
||||
+ TO_INT(SCALE(desc->fill.rel_y, fh));
|
||||
}
|
||||
params->type.common.fill.angle = desc->fill.angle;
|
||||
params->type.common.fill.spread = desc->fill.spread;
|
||||
|
@ -1128,7 +1170,7 @@ _edje_part_recalc_single_fill(Edje_Real_Part *ep,
|
|||
}
|
||||
|
||||
static void
|
||||
_edje_part_recalc_single_min_max(double sc,
|
||||
_edje_part_recalc_single_min_max(FLOAT_T sc,
|
||||
Edje_Real_Part *ep,
|
||||
Edje_Part_Description *desc,
|
||||
int *minw, int *minh,
|
||||
|
@ -1138,7 +1180,7 @@ _edje_part_recalc_single_min_max(double sc,
|
|||
// if (flags & FLAG_X)
|
||||
{
|
||||
*minw = desc->min.w;
|
||||
if (ep->part->scale) *minw = (int)(((double)*minw) * sc);
|
||||
if (ep->part->scale) *minw = TO_INT(SCALE(sc, *minw));
|
||||
if (ep->swallow_params.min.w > desc->min.w)
|
||||
*minw = ep->swallow_params.min.w;
|
||||
|
||||
|
@ -1149,7 +1191,7 @@ _edje_part_recalc_single_min_max(double sc,
|
|||
*maxw = desc->max.w;
|
||||
if (*maxw > 0)
|
||||
{
|
||||
if (ep->part->scale) *maxw = (int)(((double)*maxw) * sc);
|
||||
if (ep->part->scale) *maxw = TO_INT(SCALE(sc, *maxw));
|
||||
if (*maxw < 1) *maxw = 1;
|
||||
}
|
||||
}
|
||||
|
@ -1162,7 +1204,7 @@ _edje_part_recalc_single_min_max(double sc,
|
|||
*maxw = desc->max.w;
|
||||
if (*maxw > 0)
|
||||
{
|
||||
if (ep->part->scale) *maxw = (int)(((double)*maxw) * sc);
|
||||
if (ep->part->scale) *maxw = TO_INT(SCALE(sc, *maxw));
|
||||
if (*maxw < 1) *maxw = 1;
|
||||
}
|
||||
if (ep->swallow_params.max.w < *maxw)
|
||||
|
@ -1177,7 +1219,7 @@ _edje_part_recalc_single_min_max(double sc,
|
|||
// if (flags & FLAG_Y)
|
||||
{
|
||||
*minh = desc->min.h;
|
||||
if (ep->part->scale) *minh = (int)(((double)*minh) * sc);
|
||||
if (ep->part->scale) *minh = TO_INT(SCALE(sc, *minh));
|
||||
if (ep->swallow_params.min.h > desc->min.h)
|
||||
*minh = ep->swallow_params.min.h;
|
||||
|
||||
|
@ -1188,7 +1230,7 @@ _edje_part_recalc_single_min_max(double sc,
|
|||
*maxh = desc->max.h;
|
||||
if (*maxh > 0)
|
||||
{
|
||||
if (ep->part->scale) *maxh = (int)(((double)*maxh) * sc);
|
||||
if (ep->part->scale) *maxh = TO_INT(SCALE(sc, *maxh));
|
||||
if (*maxh < 1) *maxh = 1;
|
||||
}
|
||||
}
|
||||
|
@ -1201,7 +1243,7 @@ _edje_part_recalc_single_min_max(double sc,
|
|||
*maxh = desc->max.h;
|
||||
if (*maxh > 0)
|
||||
{
|
||||
if (ep->part->scale) *maxh = (int)(((double)*maxh) * sc);
|
||||
if (ep->part->scale) *maxh = TO_INT(SCALE(sc, *maxh));
|
||||
if (*maxh < 1) *maxh = 1;
|
||||
}
|
||||
if (ep->swallow_params.max.h < *maxh)
|
||||
|
@ -1230,7 +1272,7 @@ _edje_part_recalc_single(Edje *ed,
|
|||
{
|
||||
Edje_Color_Class *cc = NULL;
|
||||
int minw = 0, minh = 0, maxw = 0, maxh = 0;
|
||||
double sc;
|
||||
FLOAT_T sc;
|
||||
|
||||
flags = FLAG_XY;
|
||||
|
||||
|
@ -1241,7 +1283,7 @@ _edje_part_recalc_single(Edje *ed,
|
|||
/* relative coords of top left & bottom right */
|
||||
_edje_part_recalc_single_rel(ed, ep, desc, rel1_to_x, rel1_to_y, rel2_to_x, rel2_to_y, params, flags);
|
||||
|
||||
/* aspect */
|
||||
/* aspect */
|
||||
if (((flags | ep->calculated) & FLAG_XY) == FLAG_XY)
|
||||
_edje_part_recalc_single_aspect(ep, desc, params, &minw, &minh, &maxw, &maxh);
|
||||
|
||||
|
@ -1448,7 +1490,7 @@ _edje_table_recalc_apply(Edje *ed __UNUSED__, Edje_Real_Part *ep, Edje_Calc_Para
|
|||
}
|
||||
|
||||
static void
|
||||
_edje_image_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edje_Part_Description *chosen_desc, double pos)
|
||||
_edje_image_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edje_Part_Description *chosen_desc, FLOAT_T pos)
|
||||
{
|
||||
int image_id;
|
||||
int image_count, image_num;
|
||||
|
@ -1483,7 +1525,8 @@ _edje_image_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edj
|
|||
image_count = 2;
|
||||
if (ep->param2)
|
||||
image_count += eina_list_count(ep->param2->description->image.tween_list);
|
||||
image_num = (pos * ((double)image_count - 0.5));
|
||||
image_num = TO_INT(MUL(pos, SUB(FROM_INT(image_count),
|
||||
FROM_DOUBLE(0.5))));
|
||||
if (image_num > (image_count - 1))
|
||||
image_num = image_count - 1;
|
||||
if (image_num == 0)
|
||||
|
@ -1565,7 +1608,7 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags)
|
|||
Edje_Calc_Params *p1, *pf;
|
||||
Edje_Part_Description *chosen_desc;
|
||||
Edje_Real_Part *confine_to = NULL;
|
||||
double pos = 0.0;
|
||||
FLOAT_T pos = ZERO;
|
||||
Edje_Calc_Params lp3;
|
||||
|
||||
if ((ep->calculated & FLAG_XY) == FLAG_XY)
|
||||
|
@ -1723,12 +1766,13 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags)
|
|||
confine_to,
|
||||
p1,
|
||||
flags);
|
||||
|
||||
#ifdef EDJE_CALC_CACHE
|
||||
ep->param1.state = ed->state;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
if (ep->param2 && ep->description_pos != 0.0)
|
||||
if (ep->param2 && ep->description_pos != ZERO)
|
||||
{
|
||||
int beginning_pos, part_type;
|
||||
Edje_Calc_Params *p2, *p3;
|
||||
|
@ -1758,27 +1802,39 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags)
|
|||
}
|
||||
|
||||
pos = ep->description_pos;
|
||||
beginning_pos = (pos < 0.5);
|
||||
beginning_pos = (pos < FROM_DOUBLE(0.5));
|
||||
part_type = ep->part->type;
|
||||
|
||||
/* visible is special */
|
||||
if ((p1->visible) && (!p2->visible))
|
||||
p3->visible = (pos != 1.0);
|
||||
p3->visible = (pos != FROM_INT(1));
|
||||
else if ((!p1->visible) && (p2->visible))
|
||||
p3->visible = (pos != 0.0);
|
||||
p3->visible = (pos != ZERO);
|
||||
else
|
||||
p3->visible = p1->visible;
|
||||
|
||||
p3->smooth = (beginning_pos) ? p1->smooth : p2->smooth;
|
||||
|
||||
/* FIXME: do x and y separately base on flag */
|
||||
#define INTP(_x1, _x2, _p) (((_x1) == (_x2)) ? (_x1) : ((_x1) + (((_x2) - (_x1)) * (_p))))
|
||||
p3->x = INTP(p1->x, p2->x, pos);
|
||||
#define FINTP(_x1, _x2, _p) \
|
||||
(((_x1) == (_x2)) \
|
||||
? FROM_INT((_x1)) \
|
||||
: ADD(FROM_INT(_x1), \
|
||||
SCALE((_p), (_x2) - (_x1))))
|
||||
|
||||
#define FFP(_x1, _x2, _p) \
|
||||
(((_x1) == (_x2)) \
|
||||
? (_x1) \
|
||||
: ADD(_x1, MUL(_p, SUB(_x2, _x1))));
|
||||
|
||||
#define INTP(_x1, _x2, _p) TO_INT(FINTP(_x1, _x2, _p))
|
||||
|
||||
p3->x = INTP(p1->x, p2->x, pos);
|
||||
p3->y = INTP(p1->y, p2->y, pos);
|
||||
p3->w = INTP(p1->w, p2->w, pos);
|
||||
p3->h = INTP(p1->h, p2->h, pos);
|
||||
|
||||
p3->req.x = INTP(p1->req.x, p2->req.x, pos);
|
||||
p3->req.x = INTP(p1->req.x, p2->req.x, pos);
|
||||
p3->req.y = INTP(p1->req.y, p2->req.y, pos);
|
||||
p3->req.w = INTP(p1->req.w, p2->req.w, pos);
|
||||
p3->req.h = INTP(p1->req.h, p2->req.h, pos);
|
||||
|
@ -1792,7 +1848,7 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags)
|
|||
{
|
||||
p3->req_drag.y = INTP(p1->req_drag.y, p2->req_drag.y, pos);
|
||||
p3->req_drag.h = INTP(p1->req_drag.h, p2->req_drag.h, pos);
|
||||
}
|
||||
}
|
||||
|
||||
p3->color.r = INTP(p1->color.r, p2->color.r, pos);
|
||||
p3->color.g = INTP(p1->color.g, p2->color.g, pos);
|
||||
|
@ -1834,9 +1890,9 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags)
|
|||
p3->type.text.color3.b = INTP(p1->type.text.color3.b, p2->type.text.color3.b, pos);
|
||||
p3->type.text.color3.a = INTP(p1->type.text.color3.a, p2->type.text.color3.a, pos);
|
||||
|
||||
p3->type.text.align.x = INTP(p1->type.text.align.x, p2->type.text.align.x, pos);
|
||||
p3->type.text.align.y = INTP(p1->type.text.align.y, p2->type.text.align.y, pos);
|
||||
p3->type.text.elipsis = INTP(p1->type.text.elipsis, p2->type.text.elipsis, pos);
|
||||
p3->type.text.align.x = FFP(p1->type.text.align.x, p2->type.text.align.x, pos);
|
||||
p3->type.text.align.y = FFP(p1->type.text.align.y, p2->type.text.align.y, pos);
|
||||
p3->type.text.elipsis = TO_DOUBLE(FINTP(p1->type.text.elipsis, p2->type.text.elipsis, pos));
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1851,10 +1907,10 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags)
|
|||
|
||||
if (ep->drag && ep->drag->need_reset)
|
||||
{
|
||||
double dx, dy;
|
||||
FLOAT_T dx, dy;
|
||||
|
||||
dx = 0;
|
||||
dy = 0;
|
||||
dx = ZERO;
|
||||
dy = ZERO;
|
||||
_edje_part_dragable_calc(ed, ep, &dx, &dy);
|
||||
ep->drag->x = dx;
|
||||
ep->drag->y = dy;
|
||||
|
|
|
@ -129,7 +129,7 @@ _edje_mouse_down_cb(void *data, Evas * e, Evas_Object * obj, void *event_info)
|
|||
*/
|
||||
rp = events;
|
||||
{
|
||||
double dx = 0.0, dy = 0.0;
|
||||
FLOAT_T dx = ZERO, dy = ZERO;
|
||||
int dir;
|
||||
|
||||
dir = _edje_part_dragable_calc(ed, rp, &dx, &dy);
|
||||
|
@ -300,7 +300,7 @@ _edje_mouse_move_cb(void *data, Evas * e, Evas_Object * obj, void *event_info)
|
|||
|
||||
if (rp->drag->down.count > 0)
|
||||
{
|
||||
double dx, dy;
|
||||
FLOAT_T dx, dy;
|
||||
int dir;
|
||||
|
||||
dir = _edje_part_dragable_calc(ed, rp, &dx, &dy);
|
||||
|
|
|
@ -246,8 +246,8 @@ _edje_edd_init(void)
|
|||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "state.name", state.name, EET_T_STRING);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "state.value", state.value, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "visible", visible, EET_T_CHAR);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "align.x", align.x, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "align.y", align.y, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "align.x", align.x, EDJE_T_FLOAT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "align.y", align.y, EDJE_T_FLOAT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "fixed.w", fixed.w, EET_T_UCHAR);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "fixed.h", fixed.h, EET_T_UCHAR);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "min.w", min.w, EET_T_INT);
|
||||
|
@ -256,17 +256,17 @@ _edje_edd_init(void)
|
|||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "max.h", max.h, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "step.x", step.x, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "step.y", step.y, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "aspect.min", aspect.min, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "aspect.max", aspect.max, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "aspect.min", aspect.min, EDJE_T_FLOAT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "aspect.max", aspect.max, EDJE_T_FLOAT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "aspect.prefer", aspect.prefer, EET_T_CHAR);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "rel1.relative_x", rel1.relative_x, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "rel1.relative_y", rel1.relative_y, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "rel1.relative_x", rel1.relative_x, EDJE_T_FLOAT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "rel1.relative_y", rel1.relative_y, EDJE_T_FLOAT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "rel1.offset_x", rel1.offset_x, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "rel1.offset_y", rel1.offset_y, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "rel1.id_x", rel1.id_x, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "rel1.id_y", rel1.id_y, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "rel2.relative_x", rel2.relative_x, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "rel2.relative_y", rel2.relative_y, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "rel2.relative_x", rel2.relative_x, EDJE_T_FLOAT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "rel2.relative_y", rel2.relative_y, EDJE_T_FLOAT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "rel2.offset_x", rel2.offset_x, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "rel2.offset_y", rel2.offset_y, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "rel2.id_x", rel2.id_x, EET_T_INT);
|
||||
|
@ -280,13 +280,13 @@ _edje_edd_init(void)
|
|||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "border.b", border.b, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "border.no_fill", border.no_fill, EET_T_UCHAR);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "fill.smooth", fill.smooth, EET_T_CHAR);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "fill.pos_rel_x", fill.pos_rel_x, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "fill.pos_rel_x", fill.pos_rel_x, EDJE_T_FLOAT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "fill.pos_abs_x", fill.pos_abs_x, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "fill.rel_x", fill.rel_x, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "fill.rel_x", fill.rel_x, EDJE_T_FLOAT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "fill.abs_x", fill.abs_x, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "fill.pos_rel_y", fill.pos_rel_y, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "fill.pos_rel_y", fill.pos_rel_y, EDJE_T_FLOAT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "fill.pos_abs_y", fill.pos_abs_y, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "fill.rel_y", fill.rel_y, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "fill.rel_y", fill.rel_y, EDJE_T_FLOAT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "fill.abs_y", fill.abs_y, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "fill.angle", fill.angle, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "fill.spread", fill.spread, EET_T_INT);
|
||||
|
@ -316,33 +316,33 @@ _edje_edd_init(void)
|
|||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "text.min_y", text.min_y, EET_T_UCHAR);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "text.max_x", text.max_x, EET_T_UCHAR);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "text.max_y", text.max_y, EET_T_UCHAR);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "text.align.x", text.align.x, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "text.align.y", text.align.y, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "text.align.x", text.align.x, EDJE_T_FLOAT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "text.align.y", text.align.y, EDJE_T_FLOAT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "text.id_source", text.id_source, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "text.id_text_source", text.id_text_source, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "text.elipsis", text.elipsis, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "gradient.id", gradient.id, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "gradient.type", gradient.type, EET_T_STRING);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "gradient.use_rel", gradient.use_rel, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "gradient.rel1.relative_x", gradient.rel1.relative_x, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "gradient.rel1.relative_y", gradient.rel1.relative_y, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "gradient.rel1.relative_x", gradient.rel1.relative_x, EDJE_T_FLOAT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "gradient.rel1.relative_y", gradient.rel1.relative_y, EDJE_T_FLOAT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "gradient.rel1.offset_x", gradient.rel1.offset_x, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "gradient.rel1.offset_y", gradient.rel1.offset_y, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "gradient.rel2.relative_x", gradient.rel2.relative_x, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "gradient.rel2.relative_y", gradient.rel2.relative_y, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "gradient.rel2.relative_x", gradient.rel2.relative_x, EDJE_T_FLOAT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "gradient.rel2.relative_y", gradient.rel2.relative_y, EDJE_T_FLOAT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "gradient.rel2.offset_x", gradient.rel2.offset_x, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "gradient.rel2.offset_y", gradient.rel2.offset_y, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "box.layout", box.layout, EET_T_STRING);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "box.alt_layout", box.alt_layout, EET_T_STRING);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "box.align.x", box.align.x, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "box.align.y", box.align.y, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "box.align.x", box.align.x, EDJE_T_FLOAT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "box.align.y", box.align.y, EDJE_T_FLOAT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "box.padding.x", box.padding.x, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "box.padding.y", box.padding.y, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "box.min.h", box.min.h, EET_T_UCHAR);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "box.min.v", box.min.v, EET_T_UCHAR);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "table.homogeneous", table.homogeneous, EET_T_UCHAR);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "table.align.x", table.align.x, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "table.align.y", table.align.y, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "table.align.x", table.align.x, EDJE_T_FLOAT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "table.align.y", table.align.y, EDJE_T_FLOAT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "table.padding.x", table.padding.x, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "table.padding.y", table.padding.y, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_part_description, Edje_Part_Description, "external_params", external_params, _edje_edd_edje_external_param);
|
||||
|
@ -363,10 +363,10 @@ _edje_edd_init(void)
|
|||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_pack_element, Edje_Pack_Element, "padding.r", padding.r, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_pack_element, Edje_Pack_Element, "padding.t", padding.t, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_pack_element, Edje_Pack_Element, "padding.b", padding.b, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_pack_element, Edje_Pack_Element, "align.x", align.x, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_pack_element, Edje_Pack_Element, "align.y", align.y, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_pack_element, Edje_Pack_Element, "weight.x", weight.x, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_pack_element, Edje_Pack_Element, "weight.y", weight.y, EET_T_DOUBLE);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_pack_element, Edje_Pack_Element, "align.x", align.x, EDJE_T_FLOAT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_pack_element, Edje_Pack_Element, "align.y", align.y, EDJE_T_FLOAT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_pack_element, Edje_Pack_Element, "weight.x", weight.x, EDJE_T_FLOAT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_pack_element, Edje_Pack_Element, "weight.y", weight.y, EDJE_T_FLOAT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_pack_element, Edje_Pack_Element, "aspect.w", aspect.w, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_pack_element, Edje_Pack_Element, "aspect.h", aspect.h, EET_T_INT);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_pack_element, Edje_Pack_Element, "aspect.mode", aspect.mode, EET_T_UCHAR);
|
||||
|
|
|
@ -2663,7 +2663,7 @@ edje_edit_state_rel1_relative_x_get(Evas_Object *obj, const char *part, const ch
|
|||
{
|
||||
GET_PD_OR_RETURN(0);
|
||||
//printf("Get rel1 rel of part: %s state: %s [%f]\n", part, state, pd->rel1.relative_x);
|
||||
return pd->rel1.relative_x;
|
||||
return TO_DOUBLE(pd->rel1.relative_x);
|
||||
}
|
||||
|
||||
EAPI double
|
||||
|
@ -2671,7 +2671,7 @@ edje_edit_state_rel1_relative_y_get(Evas_Object *obj, const char *part, const ch
|
|||
{
|
||||
GET_PD_OR_RETURN(0);
|
||||
//printf("Get rel1 rel of part: %s state: %s\n", part, state);
|
||||
return pd->rel1.relative_y;
|
||||
return TO_DOUBLE(pd->rel1.relative_y);
|
||||
}
|
||||
|
||||
EAPI double
|
||||
|
@ -2679,7 +2679,7 @@ edje_edit_state_rel2_relative_x_get(Evas_Object *obj, const char *part, const ch
|
|||
{
|
||||
GET_PD_OR_RETURN(0);
|
||||
//printf("Get rel2 rel of part: %s state: %s\n", part, state);
|
||||
return pd->rel2.relative_x;
|
||||
return TO_DOUBLE(pd->rel2.relative_x);
|
||||
}
|
||||
|
||||
EAPI double
|
||||
|
@ -2687,7 +2687,7 @@ edje_edit_state_rel2_relative_y_get(Evas_Object *obj, const char *part, const ch
|
|||
{
|
||||
GET_PD_OR_RETURN(0);
|
||||
//printf("Get rel2 rel of part: %s state: %s\n", part, state);
|
||||
return pd->rel2.relative_y;
|
||||
return TO_DOUBLE(pd->rel2.relative_y);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
|
@ -2696,7 +2696,7 @@ edje_edit_state_rel1_relative_x_set(Evas_Object *obj, const char *part, const ch
|
|||
GET_PD_OR_RETURN();
|
||||
//printf("Set rel1x of part: %s state: %s to: %f\n", part, state, x);
|
||||
//TODO check boudaries
|
||||
pd->rel1.relative_x = x;
|
||||
pd->rel1.relative_x = FROM_DOUBLE(x);
|
||||
edje_object_calc_force(obj);
|
||||
}
|
||||
|
||||
|
@ -2706,7 +2706,7 @@ edje_edit_state_rel1_relative_y_set(Evas_Object *obj, const char *part, const ch
|
|||
GET_PD_OR_RETURN();
|
||||
//printf("Set rel1y of part: %s state: %s to: %f\n", part, state, y);
|
||||
//TODO check boudaries
|
||||
pd->rel1.relative_y = y;
|
||||
pd->rel1.relative_y = FROM_DOUBLE(y);
|
||||
edje_object_calc_force(obj);
|
||||
}
|
||||
|
||||
|
@ -2716,7 +2716,7 @@ edje_edit_state_rel2_relative_x_set(Evas_Object *obj, const char *part, const ch
|
|||
GET_PD_OR_RETURN();
|
||||
//printf("Set rel2x of part: %s state: %s to: %f\n", part, state, x);
|
||||
//TODO check boudaries
|
||||
pd->rel2.relative_x = x;
|
||||
pd->rel2.relative_x = FROM_DOUBLE(x);
|
||||
edje_object_calc_force(obj);
|
||||
}
|
||||
|
||||
|
@ -2727,7 +2727,7 @@ edje_edit_state_rel2_relative_y_set(Evas_Object *obj, const char *part, const ch
|
|||
//printf("Set rel2y of part: %s state: %s to: %f\n", part, state, y);
|
||||
pd = _edje_part_description_find_byname(ed, part, state);
|
||||
//TODO check boudaries
|
||||
pd->rel2.relative_y = y;
|
||||
pd->rel2.relative_y = FROM_DOUBLE(y);
|
||||
edje_object_calc_force(obj);
|
||||
}
|
||||
|
||||
|
@ -2770,7 +2770,7 @@ edje_edit_state_rel1_offset_x_set(Evas_Object *obj, const char *part, const char
|
|||
GET_PD_OR_RETURN();
|
||||
//printf("Set rel1x offset of part: %s state: %s to: %f\n", part, state, x);
|
||||
//TODO check boudaries
|
||||
pd->rel1.offset_x = x;
|
||||
pd->rel1.offset_x = TO_INT(FROM_DOUBLE(x));
|
||||
edje_object_calc_force(obj);
|
||||
}
|
||||
|
||||
|
@ -2780,7 +2780,7 @@ edje_edit_state_rel1_offset_y_set(Evas_Object *obj, const char *part, const char
|
|||
GET_PD_OR_RETURN();
|
||||
//printf("Set rel1y offset of part: %s state: %s to: %f\n", part, state, y);
|
||||
//TODO check boudaries
|
||||
pd->rel1.offset_y = y;
|
||||
pd->rel1.offset_y = TO_INT(FROM_DOUBLE(y));
|
||||
edje_object_calc_force(obj);
|
||||
}
|
||||
|
||||
|
@ -2790,7 +2790,7 @@ edje_edit_state_rel2_offset_x_set(Evas_Object *obj, const char *part, const char
|
|||
GET_PD_OR_RETURN();
|
||||
//printf("Set rel2x offset of part: %s state: %s to: %f\n", part, state, x);
|
||||
//TODO check boudaries
|
||||
pd->rel2.offset_x = x;
|
||||
pd->rel2.offset_x = TO_INT(FROM_DOUBLE(x));
|
||||
edje_object_calc_force(obj);
|
||||
}
|
||||
|
||||
|
@ -2800,7 +2800,7 @@ edje_edit_state_rel2_offset_y_set(Evas_Object *obj, const char *part, const char
|
|||
GET_PD_OR_RETURN();
|
||||
//printf("Set rel2y offset of part: %s state: %s to: %f\n", part, state, y);
|
||||
//TODO check boudaries
|
||||
pd->rel2.offset_y = y;
|
||||
pd->rel2.offset_y = TO_INT(FROM_DOUBLE(y));
|
||||
edje_object_calc_force(obj);
|
||||
}
|
||||
|
||||
|
@ -3066,7 +3066,7 @@ edje_edit_state_align_x_get(Evas_Object *obj, const char *part, const char *stat
|
|||
|
||||
//printf("GET ALIGN_X of state '%s' [%f]\n", state, pd->align.x);
|
||||
|
||||
return pd->align.x;
|
||||
return TO_DOUBLE(pd->align.x);
|
||||
}
|
||||
|
||||
EAPI double
|
||||
|
@ -3076,7 +3076,7 @@ edje_edit_state_align_y_get(Evas_Object *obj, const char *part, const char *stat
|
|||
|
||||
//printf("GET ALIGN_Y of state '%s' [%f]\n", state, pd->align.y);
|
||||
|
||||
return pd->align.y;
|
||||
return TO_DOUBLE(pd->align.y);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
|
@ -3084,7 +3084,7 @@ edje_edit_state_align_x_set(Evas_Object *obj, const char *part, const char *stat
|
|||
{
|
||||
GET_PD_OR_RETURN();
|
||||
//printf("SET ALIGN_X of state '%s' [to: %f]\n", state, align);
|
||||
pd->align.x = align;
|
||||
pd->align.x = FROM_DOUBLE(align);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
|
@ -3093,7 +3093,7 @@ edje_edit_state_align_y_set(Evas_Object *obj, const char *part, const char *stat
|
|||
GET_PD_OR_RETURN();
|
||||
|
||||
//printf("SET ALIGN_Y of state '%s' [to: %f]\n", state, align);
|
||||
pd->align.y = align;
|
||||
pd->align.y = FROM_DOUBLE(align);
|
||||
}
|
||||
|
||||
//min & max
|
||||
|
@ -3176,7 +3176,7 @@ edje_edit_state_aspect_min_get(Evas_Object *obj, const char *part, const char *s
|
|||
GET_PD_OR_RETURN(0);
|
||||
|
||||
//printf("GET ASPECT_MIN of state '%s' [%f]\n", state, pd->aspect.min);
|
||||
return pd->aspect.min;
|
||||
return TO_DOUBLE(pd->aspect.min);
|
||||
}
|
||||
|
||||
EAPI double
|
||||
|
@ -3185,7 +3185,7 @@ edje_edit_state_aspect_max_get(Evas_Object *obj, const char *part, const char *s
|
|||
GET_PD_OR_RETURN(0);
|
||||
|
||||
//printf("GET ASPECT_MAX of state '%s' [%f]\n", state, pd->aspect.max);
|
||||
return pd->aspect.max;
|
||||
return TO_DOUBLE(pd->aspect.max);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
|
@ -3194,7 +3194,7 @@ edje_edit_state_aspect_min_set(Evas_Object *obj, const char *part, const char *s
|
|||
GET_PD_OR_RETURN();
|
||||
|
||||
//printf("SET ASPECT_MIN of state '%s' [to: %f]\n", state, aspect);
|
||||
pd->aspect.min = aspect;
|
||||
pd->aspect.min = FROM_DOUBLE(aspect);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
|
@ -3203,7 +3203,7 @@ edje_edit_state_aspect_max_set(Evas_Object *obj, const char *part, const char *s
|
|||
GET_PD_OR_RETURN();
|
||||
|
||||
//printf("SET ASPECT_MAX of state '%s' [to: %f]\n", state, aspect);
|
||||
pd->aspect.max = aspect;
|
||||
pd->aspect.max = FROM_DOUBLE(aspect);
|
||||
}
|
||||
|
||||
EAPI unsigned char
|
||||
|
@ -3230,7 +3230,7 @@ edje_edit_state_fill_origin_relative_x_get(Evas_Object *obj, const char *part, c
|
|||
{
|
||||
GET_PD_OR_RETURN(0);
|
||||
//printf("Get state fill origin of part: %s state: %s\n", part, state);
|
||||
return pd->fill.pos_rel_x;
|
||||
return TO_DOUBLE(pd->fill.pos_rel_x);
|
||||
}
|
||||
|
||||
EAPI double
|
||||
|
@ -3238,7 +3238,7 @@ edje_edit_state_fill_origin_relative_y_get(Evas_Object *obj, const char *part, c
|
|||
{
|
||||
GET_PD_OR_RETURN(0);
|
||||
//printf("Get state fill origin of part: %s state: %s\n", part, state);
|
||||
return pd->fill.pos_rel_y;
|
||||
return TO_DOUBLE(pd->fill.pos_rel_y);
|
||||
}
|
||||
|
||||
EAPI int
|
||||
|
@ -3263,7 +3263,7 @@ edje_edit_state_fill_origin_relative_x_set(Evas_Object *obj, const char *part, c
|
|||
{
|
||||
GET_PD_OR_RETURN();
|
||||
//printf("Set state fill origin of part: %s state: %s to: %f\n", part, state, x);
|
||||
pd->fill.pos_rel_x = x;
|
||||
pd->fill.pos_rel_x = FROM_DOUBLE(x);
|
||||
edje_object_calc_force(obj);
|
||||
}
|
||||
|
||||
|
@ -3272,7 +3272,7 @@ edje_edit_state_fill_origin_relative_y_set(Evas_Object *obj, const char *part, c
|
|||
{
|
||||
GET_PD_OR_RETURN();
|
||||
//printf("Set state fill origin of part: %s state: %s to: %f\n", part, state, y);
|
||||
pd->fill.pos_rel_y = y;
|
||||
pd->fill.pos_rel_y = FROM_DOUBLE(y);
|
||||
edje_object_calc_force(obj);
|
||||
}
|
||||
|
||||
|
@ -3281,7 +3281,7 @@ edje_edit_state_fill_origin_offset_x_set(Evas_Object *obj, const char *part, con
|
|||
{
|
||||
GET_PD_OR_RETURN();
|
||||
//printf("Set state fill origin offset x of part: %s state: %s to: %f\n", part, state, x);
|
||||
pd->fill.pos_abs_x = x;
|
||||
pd->fill.pos_abs_x = FROM_DOUBLE(x);
|
||||
edje_object_calc_force(obj);
|
||||
}
|
||||
|
||||
|
@ -3290,7 +3290,7 @@ edje_edit_state_fill_origin_offset_y_set(Evas_Object *obj, const char *part, con
|
|||
{
|
||||
GET_PD_OR_RETURN();
|
||||
//printf("Set state fill origin offset y of part: %s state: %s to: %f\n", part, state, y);
|
||||
pd->fill.pos_abs_y = y;
|
||||
pd->fill.pos_abs_y = FROM_DOUBLE(y);
|
||||
edje_object_calc_force(obj);
|
||||
}
|
||||
|
||||
|
@ -3299,7 +3299,7 @@ edje_edit_state_fill_size_relative_x_get(Evas_Object *obj, const char *part, con
|
|||
{
|
||||
GET_PD_OR_RETURN(0.0);
|
||||
//printf("Get state fill size of part: %s state: %s\n", part, state);
|
||||
return pd->fill.rel_x;
|
||||
return TO_DOUBLE(pd->fill.rel_x);
|
||||
}
|
||||
|
||||
EAPI double
|
||||
|
@ -3307,7 +3307,7 @@ edje_edit_state_fill_size_relative_y_get(Evas_Object *obj, const char *part, con
|
|||
{
|
||||
GET_PD_OR_RETURN(0.0);
|
||||
//printf("Get state fill size of part: %s state: %s\n", part, state);
|
||||
return pd->fill.rel_y;
|
||||
return TO_DOUBLE(pd->fill.rel_y);
|
||||
}
|
||||
|
||||
EAPI int
|
||||
|
@ -3331,7 +3331,7 @@ edje_edit_state_fill_size_relative_x_set(Evas_Object *obj, const char *part, con
|
|||
{
|
||||
GET_PD_OR_RETURN();
|
||||
//printf("Set state fill size of part: %s state: %s to: %f\n", part, state, x);
|
||||
pd->fill.rel_x = x;
|
||||
pd->fill.rel_x = FROM_DOUBLE(x);
|
||||
edje_object_calc_force(obj);
|
||||
}
|
||||
|
||||
|
@ -3340,7 +3340,7 @@ edje_edit_state_fill_size_relative_y_set(Evas_Object *obj, const char *part, con
|
|||
{
|
||||
GET_PD_OR_RETURN();
|
||||
//printf("Set state fill size of part: %s state: %s to: %f\n", part, state, y);
|
||||
pd->fill.rel_y = y;
|
||||
pd->fill.rel_y = FROM_DOUBLE(y);
|
||||
edje_object_calc_force(obj);
|
||||
}
|
||||
|
||||
|
@ -3349,7 +3349,7 @@ edje_edit_state_fill_size_offset_x_set(Evas_Object *obj, const char *part, const
|
|||
{
|
||||
GET_PD_OR_RETURN();
|
||||
//printf("Set state fill size offset x of part: %s state: %s to: %f\n", part, state, x);
|
||||
pd->fill.abs_x = x;
|
||||
pd->fill.abs_x = FROM_DOUBLE(x);
|
||||
edje_object_calc_force(obj);
|
||||
}
|
||||
|
||||
|
@ -3358,7 +3358,7 @@ edje_edit_state_fill_size_offset_y_set(Evas_Object *obj, const char *part, const
|
|||
{
|
||||
GET_PD_OR_RETURN();
|
||||
//printf("Set state fill size offset y of part: %s state: %s to: %f\n", part, state, y);
|
||||
pd->fill.abs_y = y;
|
||||
pd->fill.abs_y = FROM_DOUBLE(y);
|
||||
edje_object_calc_force(obj);
|
||||
}
|
||||
|
||||
|
@ -3638,7 +3638,7 @@ edje_edit_state_text_align_x_get(Evas_Object *obj, const char *part, const char
|
|||
GET_PD_OR_RETURN(0);
|
||||
|
||||
//printf("GET TEXT_ALIGN_X of state: %s [%f]\n", state, pd->text.align.x);
|
||||
return pd->text.align.x;
|
||||
return TO_DOUBLE(pd->text.align.x);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
|
@ -3648,7 +3648,7 @@ edje_edit_state_text_align_x_set(Evas_Object *obj, const char *part, const char
|
|||
|
||||
//printf("SET TEXT_ALIGN_X of state: %s [%f]\n", state, align);
|
||||
|
||||
pd->text.align.x = align;
|
||||
pd->text.align.x = FROM_DOUBLE(align);
|
||||
edje_object_calc_force(obj);
|
||||
}
|
||||
|
||||
|
@ -3658,7 +3658,7 @@ edje_edit_state_text_align_y_get(Evas_Object *obj, const char *part, const char
|
|||
GET_PD_OR_RETURN(0.0);
|
||||
|
||||
//printf("GET TEXT_ALIGN_Y of state: %s [%f]\n", state, pd->text.align.x);
|
||||
return pd->text.align.y;
|
||||
return TO_DOUBLE(pd->text.align.y);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
|
@ -3668,7 +3668,7 @@ edje_edit_state_text_align_y_set(Evas_Object *obj, const char *part, const char
|
|||
|
||||
//printf("SET TEXT_ALIGN_Y of state: %s [%f]\n", state, align);
|
||||
|
||||
pd->text.align.y = align;
|
||||
pd->text.align.y = FROM_DOUBLE(align);
|
||||
edje_object_calc_force(obj);
|
||||
}
|
||||
|
||||
|
@ -4544,7 +4544,7 @@ edje_edit_state_gradient_rel1_relative_x_get(Evas_Object *obj, const char *part,
|
|||
GET_PD_OR_RETURN(0);
|
||||
//printf("GET GRADIENT REL1 RELX for part: %s state: %s [%f]\n", part, state, pd->gradient.rel1.relative_x);
|
||||
|
||||
return pd->gradient.rel1.relative_x;
|
||||
return TO_DOUBLE(pd->gradient.rel1.relative_x);
|
||||
}
|
||||
|
||||
EAPI double
|
||||
|
@ -4553,7 +4553,7 @@ edje_edit_state_gradient_rel1_relative_y_get(Evas_Object *obj, const char *part,
|
|||
GET_PD_OR_RETURN(0);
|
||||
//printf("GET GRADIENT REL1 RELY for part: %s state: %s [%f]\n", part, state, pd->gradient.rel1.relative_y);
|
||||
|
||||
return pd->gradient.rel1.relative_y;
|
||||
return TO_DOUBLE(pd->gradient.rel1.relative_y);
|
||||
}
|
||||
|
||||
EAPI double
|
||||
|
@ -4562,7 +4562,7 @@ edje_edit_state_gradient_rel2_relative_x_get(Evas_Object *obj, const char *part,
|
|||
GET_PD_OR_RETURN(0);
|
||||
//printf("GET GRADIENT REL2 RELX for part: %s state: %s [%f]\n", part, state, pd->gradient.rel2.relative_x);
|
||||
|
||||
return pd->gradient.rel2.relative_x;
|
||||
return TO_DOUBLE(pd->gradient.rel2.relative_x);
|
||||
}
|
||||
|
||||
EAPI double
|
||||
|
@ -4571,7 +4571,7 @@ edje_edit_state_gradient_rel2_relative_y_get(Evas_Object *obj, const char *part,
|
|||
GET_PD_OR_RETURN(0);
|
||||
//printf("GET GRADIENT REL2 RELY for part: %s state: %s [%f]\n", part, state, pd->gradient.rel2.relative_y);
|
||||
|
||||
return pd->gradient.rel2.relative_y;
|
||||
return TO_DOUBLE(pd->gradient.rel2.relative_y);
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
|
@ -4580,7 +4580,7 @@ edje_edit_state_gradient_rel1_relative_x_set(Evas_Object *obj, const char *part,
|
|||
GET_PD_OR_RETURN(0);
|
||||
//printf("SET GRADIENT REL1 RELX for part: %s state: %s [TO %f]\n", part, state, val);
|
||||
|
||||
pd->gradient.rel1.relative_x = val;
|
||||
pd->gradient.rel1.relative_x = FROM_DOUBLE(val);
|
||||
edje_object_calc_force(obj);
|
||||
return 1;
|
||||
}
|
||||
|
@ -4591,7 +4591,7 @@ edje_edit_state_gradient_rel1_relative_y_set(Evas_Object *obj, const char *part,
|
|||
GET_PD_OR_RETURN(0);
|
||||
//printf("SET GRADIENT REL1 RELY for part: %s state: %s [TO %f]\n", part, state, val);
|
||||
|
||||
pd->gradient.rel1.relative_y = val;
|
||||
pd->gradient.rel1.relative_y = FROM_DOUBLE(val);
|
||||
edje_object_calc_force(obj);
|
||||
return 1;
|
||||
}
|
||||
|
@ -4602,7 +4602,7 @@ edje_edit_state_gradient_rel2_relative_x_set(Evas_Object *obj, const char *part,
|
|||
GET_PD_OR_RETURN(0);
|
||||
//printf("SET GRADIENT REL2 RELX for part: %s state: %s [TO %f]\n", part, state, val);
|
||||
|
||||
pd->gradient.rel2.relative_x = val;
|
||||
pd->gradient.rel2.relative_x = FROM_DOUBLE(val);
|
||||
edje_object_calc_force(obj);
|
||||
return 1;
|
||||
}
|
||||
|
@ -4613,7 +4613,7 @@ edje_edit_state_gradient_rel2_relative_y_set(Evas_Object *obj, const char *part,
|
|||
GET_PD_OR_RETURN(0);
|
||||
//printf("SET GRADIENT REL2 RELY for part: %s state: %s [TO %f]\n", part, state, val);
|
||||
|
||||
pd->gradient.rel2.relative_y = val;
|
||||
pd->gradient.rel2.relative_y = FROM_DOUBLE(val);
|
||||
edje_object_calc_force(obj);
|
||||
return 1;
|
||||
}
|
||||
|
@ -5578,7 +5578,7 @@ _edje_generate_source_of_state(Evas_Object *obj, const char *part, const char *s
|
|||
fprintf(f, I5"visible: 0;\n");
|
||||
|
||||
if (pd->align.x != 0.5 || pd->align.y != 0.5)
|
||||
fprintf(f, I5"align: %g %g;\n", pd->align.x, pd->align.y);
|
||||
fprintf(f, I5"align: %g %g;\n", TO_DOUBLE(pd->align.x), TO_DOUBLE(pd->align.y));
|
||||
|
||||
//TODO Support fixed
|
||||
|
||||
|
@ -5590,7 +5590,7 @@ _edje_generate_source_of_state(Evas_Object *obj, const char *part, const char *s
|
|||
//TODO Support step
|
||||
|
||||
if (pd->aspect.min || pd->aspect.max)
|
||||
fprintf(f, I5"aspect: %g %g;\n", pd->aspect.min, pd->aspect.max);
|
||||
fprintf(f, I5"aspect: %g %g;\n", TO_DOUBLE(pd->aspect.min), TO_DOUBLE(pd->aspect.max));
|
||||
if (pd->aspect.prefer)
|
||||
fprintf(f, I5"aspect_preference: %s;\n", prefers[pd->aspect.prefer]);
|
||||
|
||||
|
@ -5616,7 +5616,7 @@ _edje_generate_source_of_state(Evas_Object *obj, const char *part, const char *s
|
|||
{
|
||||
fprintf(f, I5"rel1 {\n");
|
||||
if (pd->rel1.relative_x || pd->rel1.relative_y)
|
||||
fprintf(f, I6"relative: %g %g;\n", pd->rel1.relative_x, pd->rel1.relative_y);
|
||||
fprintf(f, I6"relative: %g %g;\n", TO_DOUBLE(pd->rel1.relative_x), TO_DOUBLE(pd->rel1.relative_y));
|
||||
if (pd->rel1.offset_x || pd->rel1.offset_y)
|
||||
fprintf(f, I6"offset: %d %d;\n", pd->rel1.offset_x, pd->rel1.offset_y);
|
||||
if (pd->rel1.id_x != -1 && pd->rel1.id_x == pd->rel1.id_y)
|
||||
|
@ -5637,8 +5637,8 @@ _edje_generate_source_of_state(Evas_Object *obj, const char *part, const char *s
|
|||
pd->rel2.id_x != -1 || pd->rel2.id_y != -1)
|
||||
{
|
||||
fprintf(f, I5"rel2 {\n");
|
||||
if (pd->rel2.relative_x != 1.0 || pd->rel2.relative_y != 1.0)
|
||||
fprintf(f, I6"relative: %g %g;\n", pd->rel2.relative_x, pd->rel2.relative_y);
|
||||
if (TO_DOUBLE(pd->rel2.relative_x) != 1.0 || TO_DOUBLE(pd->rel2.relative_y) != 1.0)
|
||||
fprintf(f, I6"relative: %g %g;\n", TO_DOUBLE(pd->rel2.relative_x), TO_DOUBLE(pd->rel2.relative_y));
|
||||
if (pd->rel2.offset_x != -1 || pd->rel2.offset_y != -1)
|
||||
fprintf(f, I6"offset: %d %d;\n", pd->rel2.offset_x, pd->rel2.offset_y);
|
||||
if (pd->rel2.id_x != -1 && pd->rel2.id_x == pd->rel2.id_y)
|
||||
|
@ -5695,18 +5695,18 @@ _edje_generate_source_of_state(Evas_Object *obj, const char *part, const char *s
|
|||
{
|
||||
fprintf(f, I6"origin {\n");
|
||||
if (pd->fill.pos_rel_x || pd->fill.pos_rel_y)
|
||||
fprintf(f, I7"relative: %g %g;\n", pd->fill.pos_rel_x, pd->fill.pos_rel_y);
|
||||
fprintf(f, I7"relative: %g %g;\n", TO_DOUBLE(pd->fill.pos_rel_x), TO_DOUBLE(pd->fill.pos_rel_y));
|
||||
if (pd->fill.pos_abs_x || pd->fill.pos_abs_y)
|
||||
fprintf(f, I7"offset: %d %d;\n", pd->fill.pos_abs_x, pd->fill.pos_abs_y);
|
||||
fprintf(f, I6"}\n");
|
||||
}
|
||||
|
||||
if (pd->fill.rel_x != 1.0 || pd->fill.rel_y != 1.0 ||
|
||||
if (TO_DOUBLE(pd->fill.rel_x) != 1.0 || TO_DOUBLE(pd->fill.rel_y) != 1.0 ||
|
||||
pd->fill.abs_x || pd->fill.abs_y)
|
||||
{
|
||||
fprintf(f, I6"size {\n");
|
||||
if (pd->fill.rel_x != 1.0 || pd->fill.rel_y != 1.0)
|
||||
fprintf(f, I7"relative: %g %g;\n", pd->fill.rel_x, pd->fill.rel_y);
|
||||
fprintf(f, I7"relative: %g %g;\n", TO_DOUBLE(pd->fill.rel_x), TO_DOUBLE(pd->fill.rel_y));
|
||||
if (pd->fill.abs_x || pd->fill.abs_y)
|
||||
fprintf(f, I7"offset: %d %d;\n", pd->fill.abs_x, pd->fill.abs_y);
|
||||
fprintf(f, I6"}\n");
|
||||
|
@ -5728,8 +5728,8 @@ _edje_generate_source_of_state(Evas_Object *obj, const char *part, const char *s
|
|||
if (pd->text.fit_x || pd->text.fit_y)
|
||||
fprintf(f, I6"fit: %d %d;\n", pd->text.fit_x, pd->text.fit_y);
|
||||
//TODO Support min & max
|
||||
if (pd->text.align.x != 0.5 || pd->text.align.y != 0.5)
|
||||
fprintf(f, I6"align: %g %g;\n", pd->text.align.x, pd->text.align.y);
|
||||
if (TO_DOUBLE(pd->text.align.x) != 0.5 || TO_DOUBLE(pd->text.align.y) != 0.5)
|
||||
fprintf(f, I6"align: %g %g;\n", TO_DOUBLE(pd->text.align.x), TO_DOUBLE(pd->text.align.y));
|
||||
//TODO Support source
|
||||
//TODO Support text_source
|
||||
if (pd->text.elipsis)
|
||||
|
|
|
@ -1659,12 +1659,19 @@ _edje_embryo_fn_set_state_val(Embryo_Program *ep, Embryo_Cell *params)
|
|||
|
||||
break;
|
||||
case EDJE_STATE_PARAM_ASPECT:
|
||||
CHKPARAM(4);
|
||||
{
|
||||
double tmp;
|
||||
|
||||
GETFLOAT(rp->custom->description->aspect.min, params[3]);
|
||||
GETFLOAT(rp->custom->description->aspect.max, params[4]);
|
||||
CHKPARAM(4);
|
||||
|
||||
break;
|
||||
GETFLOAT(tmp, params[3]);
|
||||
rp->custom->description->aspect.min = FROM_DOUBLE(tmp);
|
||||
|
||||
GETFLOAT(tmp, params[4]);
|
||||
rp->custom->description->aspect.max = FROM_DOUBLE(tmp);
|
||||
|
||||
break;
|
||||
}
|
||||
case EDJE_STATE_PARAM_ASPECT_PREF:
|
||||
CHKPARAM(3);
|
||||
|
||||
|
@ -1952,8 +1959,8 @@ _edje_embryo_fn_get_state_val(Embryo_Program *ep, Embryo_Cell *params)
|
|||
case EDJE_STATE_PARAM_ASPECT:
|
||||
CHKPARAM(4);
|
||||
|
||||
SETFLOAT(rp->custom->description->aspect.min, params[3]);
|
||||
SETFLOAT(rp->custom->description->aspect.max, params[4]);
|
||||
SETFLOAT(TO_DOUBLE(rp->custom->description->aspect.min), params[3]);
|
||||
SETFLOAT(TO_DOUBLE(rp->custom->description->aspect.max), params[4]);
|
||||
|
||||
break;
|
||||
case EDJE_STATE_PARAM_ASPECT_PREF:
|
||||
|
|
|
@ -1334,7 +1334,7 @@ _edje_part_mouse_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS
|
|||
(rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_EXPLICIT))
|
||||
{
|
||||
Eina_List *first, *last;
|
||||
double sc;
|
||||
FLOAT_T sc;
|
||||
|
||||
first = en->sel;
|
||||
last = eina_list_last(en->sel);
|
||||
|
@ -1354,8 +1354,8 @@ _edje_part_mouse_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS
|
|||
d = (r2->y + (r2->h / 2)) - en->cy;
|
||||
d2 += d * d;
|
||||
sc = rp->edje->scale;
|
||||
if (sc == 0.0) sc = _edje_scale;
|
||||
d = (Evas_Coord)(20.0 * sc); // FIXME: maxing number!
|
||||
if (sc == ZERO) sc = _edje_scale;
|
||||
d = (Evas_Coord)MUL(FROM_INT(20), sc); // FIXME: maxing number!
|
||||
d = d * d;
|
||||
if (d1 < d2)
|
||||
{
|
||||
|
|
|
@ -382,8 +382,8 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
|
|||
return 0;
|
||||
}
|
||||
|
||||
rp->drag->step.x = ep->dragable.step_x;
|
||||
rp->drag->step.y = ep->dragable.step_y;
|
||||
rp->drag->step.x = FROM_INT(ep->dragable.step_x);
|
||||
rp->drag->step.y = FROM_INT(ep->dragable.step_y);
|
||||
}
|
||||
|
||||
rp->edje = ed;
|
||||
|
@ -565,8 +565,8 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
|
|||
if (_edje_block_break(ed)) break;
|
||||
if (rp->drag)
|
||||
{
|
||||
if (rp->part->dragable.x < 0) rp->drag->val.x = 1.0;
|
||||
if (rp->part->dragable.y < 0) rp->drag->val.x = 1.0;
|
||||
if (rp->part->dragable.x < 0) rp->drag->val.x = FROM_DOUBLE(1.0);
|
||||
if (rp->part->dragable.y < 0) rp->drag->val.x = FROM_DOUBLE(1.0);
|
||||
_edje_dragable_pos_set(ed, rp, rp->drag->val.x, rp->drag->val.y);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2562,9 +2562,9 @@ _edje_lua_description_get_aspect(lua_State *L)
|
|||
_edje_lua_checkudata(L, 1, &mDescription);
|
||||
if (!obj->rp->custom) return 0;
|
||||
lua_createtable(L, 2, 0);
|
||||
lua_pushnumber(L, obj->rp->custom->description->aspect.min);
|
||||
lua_pushnumber(L, TO_DOUBLE(obj->rp->custom->description->aspect.min));
|
||||
lua_rawseti(L, -2, 1);
|
||||
lua_pushnumber(L, obj->rp->custom->description->aspect.max);
|
||||
lua_pushnumber(L, TO_DOUBLE(obj->rp->custom->description->aspect.max));
|
||||
lua_rawseti(L, -2, 1);
|
||||
return 1;
|
||||
}
|
||||
|
@ -3046,8 +3046,8 @@ _edje_lua_description_set_aspect(lua_State *L)
|
|||
if (!obj->rp->custom) return 0;
|
||||
lua_rawgeti(L, 2, 1);
|
||||
lua_rawgeti(L, 2, 2);
|
||||
obj->rp->custom->description->aspect.min = luaL_checknumber(L, -2);
|
||||
obj->rp->custom->description->aspect.max = luaL_checknumber(L, -1);
|
||||
obj->rp->custom->description->aspect.min = FROM_DOUBLE(luaL_checknumber(L, -2));
|
||||
obj->rp->custom->description->aspect.max = FROM_DOUBLE(luaL_checknumber(L, -1));
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
|
|
@ -93,6 +93,8 @@ edje_init(void)
|
|||
goto shutdown_embryo;
|
||||
}
|
||||
|
||||
_edje_scale = FROM_DOUBLE(1.0);
|
||||
|
||||
_edje_edd_init();
|
||||
_edje_text_init();
|
||||
_edje_box_init();
|
||||
|
|
|
@ -45,6 +45,49 @@
|
|||
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef BUILD_EDJE_FP
|
||||
|
||||
#define FLOAT_T Eina_F32p32
|
||||
#define EDJE_T_FLOAT EET_T_F32P32
|
||||
#define MUL(a, b) eina_f32p32_mul(a, b)
|
||||
#define SCALE(a, b) eina_f32p32_scale(a, b)
|
||||
#define DIV(a, b) eina_f32p32_div(a, b)
|
||||
#define DIV2(a) ((a) >> 1)
|
||||
#define ADD(a, b) eina_f32p32_add(a, b)
|
||||
#define SUB(a, b) eina_f32p32_sub(a, b)
|
||||
#define SQRT(a) eina_f32p32_sqrt(a)
|
||||
#define TO_DOUBLE(a) eina_f32p32_double_to(a)
|
||||
#define FROM_DOUBLE(a) eina_f32p32_double_from(a)
|
||||
#define FROM_INT(a) eina_f32p32_int_from(a)
|
||||
#define TO_INT(a) eina_f32p32_int_to(a)
|
||||
#define ZERO 0
|
||||
#define COS(a) eina_f32p32_cos(a)
|
||||
#define SIN(a) eina_f32p32_sin(a)
|
||||
#define PI EINA_F32P32_PI
|
||||
|
||||
#else
|
||||
|
||||
#define FLOAT_T double
|
||||
#define EDJE_T_FLOAT EET_T_DOUBLE
|
||||
#define MUL(a, b) ((a) * (b))
|
||||
#define SCALE(a, b) ((a) * (double)(b))
|
||||
#define DIV(a, b) ((a) / (b))
|
||||
#define DIV2(a) ((a) / 2.0)
|
||||
#define ADD(a, b) ((a) + (b))
|
||||
#define SUB(a, b) ((a) - (b))
|
||||
#define SQRT(a) sqrt(a)
|
||||
#define TO_DOUBLE(a) (double)(a)
|
||||
#define FROM_DOUBLE(a) (a)
|
||||
#define FROM_INT(a) (double)(a)
|
||||
#define TO_INT(a) (int)(a)
|
||||
#define ZERO 0.0
|
||||
#define COS(a) cos(a)
|
||||
#define SIN(a) sin(a)
|
||||
#define PI 3.14159265358979323846
|
||||
|
||||
#endif
|
||||
|
||||
/* increment this when the EET data descriptors have changed and old
|
||||
* EETs cannot be loaded/used correctly anymore.
|
||||
*/
|
||||
|
@ -65,7 +108,7 @@
|
|||
|
||||
struct _Edje_Position_Scale
|
||||
{
|
||||
double x, y;
|
||||
FLOAT_T x, y;
|
||||
};
|
||||
|
||||
struct _Edje_Position
|
||||
|
@ -90,7 +133,7 @@ struct _Edje_Color
|
|||
|
||||
struct _Edje_Aspect_Prefer
|
||||
{
|
||||
double min, max;
|
||||
FLOAT_T min, max;
|
||||
enum {
|
||||
EDJE_ASPECT_PREFER_NONE,
|
||||
EDJE_ASPECT_PREFER_VERTICAL,
|
||||
|
@ -139,8 +182,6 @@ typedef struct _Edje_Part_Description Edje_Part_Description;
|
|||
typedef struct _Edje_Spectrum_Color Edje_Spectrum_Color;
|
||||
typedef struct _Edje_Patterns Edje_Patterns;
|
||||
|
||||
#define PI 3.14159265358979323846
|
||||
|
||||
#define EDJE_INF_MAX_W 100000
|
||||
#define EDJE_INF_MAX_H 100000
|
||||
|
||||
|
@ -495,8 +536,8 @@ struct _Edje_Part_Description
|
|||
Edje_Aspect_Prefer aspect;
|
||||
|
||||
struct {
|
||||
double relative_x;
|
||||
double relative_y;
|
||||
FLOAT_T relative_x;
|
||||
FLOAT_T relative_y;
|
||||
int offset_x;
|
||||
int offset_y;
|
||||
int id_x; /* -1 = whole part collection, or part ID */
|
||||
|
@ -515,8 +556,8 @@ struct _Edje_Part_Description
|
|||
int id; /* the spectrum id to use */
|
||||
int use_rel; /* 1 - use rel1,rel2; 0 - use fill */
|
||||
struct {
|
||||
double relative_x;
|
||||
double relative_y;
|
||||
FLOAT_T relative_x;
|
||||
FLOAT_T relative_y;
|
||||
int offset_x;
|
||||
int offset_y;
|
||||
} rel1, rel2; /* linear gradient fill options */
|
||||
|
@ -528,10 +569,10 @@ struct _Edje_Part_Description
|
|||
} border;
|
||||
|
||||
struct {
|
||||
double pos_rel_x; /* fill offset x relative to area */
|
||||
double rel_x; /* relative size compared to area */
|
||||
double pos_rel_y; /* fill offset y relative to area */
|
||||
double rel_y; /* relative size compared to area */
|
||||
FLOAT_T pos_rel_x; /* fill offset x relative to area */
|
||||
FLOAT_T rel_x; /* relative size compared to area */
|
||||
FLOAT_T pos_rel_y; /* fill offset y relative to area */
|
||||
FLOAT_T rel_y; /* relative size compared to area */
|
||||
int pos_abs_x; /* fill offset x added to fill offset */
|
||||
int abs_x; /* size of fill added to relative fill */
|
||||
int pos_abs_y; /* fill offset y added to fill offset */
|
||||
|
@ -689,7 +730,7 @@ struct _Edje
|
|||
int block;
|
||||
int load_error;
|
||||
int freeze;
|
||||
double scale;
|
||||
FLOAT_T scale;
|
||||
|
||||
struct {
|
||||
void (*func) (void *data, Evas_Object *obj, const char *part);
|
||||
|
@ -779,7 +820,7 @@ struct _Edje_Real_Part_State
|
|||
|
||||
struct _Edje_Real_Part_Drag
|
||||
{
|
||||
double x, y; // 16
|
||||
FLOAT_T x, y; // 16
|
||||
Edje_Position_Scale val, size, step, page; // 64
|
||||
struct {
|
||||
unsigned int count; // 4
|
||||
|
@ -828,7 +869,7 @@ struct _Edje_Real_Part
|
|||
const char *in_str; // 4 text only
|
||||
const char *out_str; // 4 text only
|
||||
int out_size; // 4 text only
|
||||
double align_x, align_y; // 16 text only
|
||||
FLOAT_T align_x, align_y; // 16 text only
|
||||
double elipsis; // 8 text only
|
||||
int fit_x, fit_y; // 8 text only
|
||||
} cache; // 64
|
||||
|
@ -836,7 +877,7 @@ struct _Edje_Real_Part
|
|||
// if part type is TEXT move common members textblock +
|
||||
// text to front and have smaller struct for textblock
|
||||
|
||||
double description_pos; // 8
|
||||
FLOAT_T description_pos; // 8
|
||||
Edje_Part_Description *chosen_description; // 4
|
||||
Edje_Real_Part_State param1; // 20
|
||||
// WITH EDJE_CALC_CACHE: 140
|
||||
|
@ -1095,7 +1136,7 @@ extern Eina_List *_edje_animators;
|
|||
extern Eina_List *_edje_edjes;
|
||||
|
||||
extern char *_edje_fontset_append;
|
||||
extern double _edje_scale;
|
||||
extern FLOAT_T _edje_scale;
|
||||
extern int _edje_freeze_val;
|
||||
extern int _edje_freeze_calc_count;
|
||||
|
||||
|
@ -1107,8 +1148,8 @@ Edje_Part_Description *_edje_part_description_find(Edje *ed, Edje_Real_Part *rp,
|
|||
void _edje_part_description_apply(Edje *ed, Edje_Real_Part *ep, const char *d1, double v1, const char *d2, double v2);
|
||||
void _edje_recalc(Edje *ed);
|
||||
void _edje_recalc_do(Edje *ed);
|
||||
int _edje_part_dragable_calc(Edje *ed, Edje_Real_Part *ep, double *x, double *y);
|
||||
void _edje_dragable_pos_set(Edje *ed, Edje_Real_Part *ep, double x, double y);
|
||||
int _edje_part_dragable_calc(Edje *ed, Edje_Real_Part *ep, FLOAT_T *x, FLOAT_T *y);
|
||||
void _edje_dragable_pos_set(Edje *ed, Edje_Real_Part *ep, FLOAT_T x, FLOAT_T y);
|
||||
|
||||
void _edje_mouse_in_cb(void *data, Evas * e, Evas_Object * obj, void *event_info);
|
||||
void _edje_mouse_out_cb(void *data, Evas * e, Evas_Object * obj, void *event_info);
|
||||
|
|
|
@ -114,15 +114,15 @@ _edje_text_fit_x(Edje *ed, Edje_Real_Part *ep,
|
|||
char *buf;
|
||||
int c1 = -1, c2 = -1, loop = 0, extra;
|
||||
size_t orig_len;
|
||||
double sc;
|
||||
FLOAT_T sc;
|
||||
|
||||
sc = ed->scale;
|
||||
if (sc == 0.0) sc = _edje_scale;
|
||||
if (sc == ZERO) sc = _edje_scale;
|
||||
|
||||
*free_text = 0;
|
||||
if (sw <= 1) return "";
|
||||
|
||||
if (ep->part->scale) evas_object_scale_set(ep->object, sc);
|
||||
if (ep->part->scale) evas_object_scale_set(ep->object, TO_DOUBLE(sc));
|
||||
evas_object_text_font_set(ep->object, font, size);
|
||||
evas_object_text_text_set(ep->object, text);
|
||||
|
||||
|
@ -302,7 +302,7 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
|
|||
Evas_Coord tw, th;
|
||||
Evas_Coord sw, sh;
|
||||
int inlined_font = 0, free_text = 0;
|
||||
double sc;
|
||||
FLOAT_T sc;
|
||||
|
||||
sc = ed->scale;
|
||||
if (sc == 0.0) sc = _edje_scale;
|
||||
|
@ -389,7 +389,7 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
|
|||
if (inlined_font) evas_object_text_font_source_set(ep->object, ed->path);
|
||||
else evas_object_text_font_source_set(ep->object, NULL);
|
||||
|
||||
if (ep->part->scale) evas_object_scale_set(ep->object, sc);
|
||||
if (ep->part->scale) evas_object_scale_set(ep->object, TO_DOUBLE(sc));
|
||||
evas_object_text_font_set(ep->object, font, size);
|
||||
evas_object_text_text_set(ep->object, text);
|
||||
part_get_geometry(ep, &tw, &th);
|
||||
|
@ -406,7 +406,7 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
|
|||
if (inlined_font) evas_object_text_font_source_set(ep->object, ed->path);
|
||||
else evas_object_text_font_source_set(ep->object, NULL);
|
||||
|
||||
if (ep->part->scale) evas_object_scale_set(ep->object, sc);
|
||||
if (ep->part->scale) evas_object_scale_set(ep->object, TO_DOUBLE(sc));
|
||||
evas_object_text_font_set(ep->object, font, size);
|
||||
part_get_geometry(ep, &tw, &th);
|
||||
if ((size > 0) && (tw == 0)) break;
|
||||
|
@ -425,7 +425,7 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
|
|||
if (inlined_font) evas_object_text_font_source_set(ep->object, ed->path);
|
||||
else evas_object_text_font_source_set(ep->object, NULL);
|
||||
|
||||
if (ep->part->scale) evas_object_scale_set(ep->object, sc);
|
||||
if (ep->part->scale) evas_object_scale_set(ep->object, TO_DOUBLE(sc));
|
||||
evas_object_text_font_set(ep->object, font, size);
|
||||
part_get_geometry(ep, &tw, &th);
|
||||
if ((size > 0) && (tw == 0)) break;
|
||||
|
@ -443,7 +443,7 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
|
|||
if (inlined_font) evas_object_text_font_source_set(ep->object, ed->path);
|
||||
else evas_object_text_font_source_set(ep->object, NULL);
|
||||
|
||||
if (ep->part->scale) evas_object_scale_set(ep->object, sc);
|
||||
if (ep->part->scale) evas_object_scale_set(ep->object, TO_DOUBLE(sc));
|
||||
evas_object_text_font_set(ep->object, font, size);
|
||||
evas_object_text_text_set(ep->object, text);
|
||||
part_get_geometry(ep, &tw, &th);
|
||||
|
@ -464,7 +464,7 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
|
|||
if (inlined_font) evas_object_text_font_source_set(ep->object, ed->path);
|
||||
else evas_object_text_font_source_set(ep->object, NULL);
|
||||
|
||||
if (ep->part->scale) evas_object_scale_set(ep->object, sc);
|
||||
if (ep->part->scale) evas_object_scale_set(ep->object, TO_DOUBLE(sc));
|
||||
evas_object_text_font_set(ep->object, font, size);
|
||||
part_get_geometry(ep, &tw, &th);
|
||||
if ((size > 0) && (th == 0)) break;
|
||||
|
@ -475,7 +475,7 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
|
|||
{
|
||||
int current;
|
||||
|
||||
if (ep->part->scale) evas_object_scale_set(ep->object, sc);
|
||||
if (ep->part->scale) evas_object_scale_set(ep->object, TO_DOUBLE(sc));
|
||||
evas_object_text_font_set(ep->object, font, 10);
|
||||
part_get_geometry(ep, &tw, &th);
|
||||
|
||||
|
@ -500,7 +500,7 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
|
|||
{
|
||||
current = (top + bottom) / 2;
|
||||
|
||||
if (ep->part->scale) evas_object_scale_set(ep->object, sc);
|
||||
if (ep->part->scale) evas_object_scale_set(ep->object, TO_DOUBLE(sc));
|
||||
evas_object_text_font_set(ep->object, font, current);
|
||||
part_get_geometry(ep, &tw, &th);
|
||||
|
||||
|
@ -514,7 +514,7 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
|
|||
{
|
||||
current++;
|
||||
|
||||
if (ep->part->scale) evas_object_scale_set(ep->object, sc);
|
||||
if (ep->part->scale) evas_object_scale_set(ep->object, TO_DOUBLE(sc));
|
||||
evas_object_text_font_set(ep->object, font, current);
|
||||
part_get_geometry(ep, &tw, &th);
|
||||
} while (th <= sh);
|
||||
|
@ -546,12 +546,12 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
|
|||
if (inlined_font) evas_object_text_font_source_set(ep->object, ed->path);
|
||||
else evas_object_text_font_source_set(ep->object, NULL);
|
||||
|
||||
if (ep->part->scale) evas_object_scale_set(ep->object, sc);
|
||||
if (ep->part->scale) evas_object_scale_set(ep->object, TO_DOUBLE(sc));
|
||||
evas_object_text_font_set(ep->object, font, size);
|
||||
evas_object_text_text_set(ep->object, text);
|
||||
part_get_geometry(ep, &tw, &th);
|
||||
ep->text.offset.x = ((sw - tw) * params->type.text.align.x);
|
||||
ep->text.offset.y = ((sh - th) * params->type.text.align.y);
|
||||
ep->text.offset.x = TO_INT(SCALE(params->type.text.align.x, (sw - tw)));
|
||||
ep->text.offset.y = TO_INT(SCALE(params->type.text.align.y, (sh - th)));
|
||||
|
||||
evas_object_move(ep->object,
|
||||
ed->x + params->x + ep->text.offset.x,
|
||||
|
|
|
@ -27,7 +27,7 @@ static Eina_Hash *_edje_text_class_member_hash = NULL;
|
|||
static Eina_Rbtree *_edje_box_layout_registry = NULL;
|
||||
|
||||
char *_edje_fontset_append = NULL;
|
||||
double _edje_scale = 1.0;
|
||||
FLOAT_T _edje_scale = ZERO;
|
||||
int _edje_freeze_val = 0;
|
||||
int _edje_freeze_calc_count = 0;
|
||||
|
||||
|
@ -194,8 +194,8 @@ edje_scale_set(double scale)
|
|||
Eina_List *l;
|
||||
Evas_Object *data;
|
||||
|
||||
if (_edje_scale == scale) return;
|
||||
_edje_scale = scale;
|
||||
if (_edje_scale == FROM_DOUBLE(scale)) return;
|
||||
_edje_scale = FROM_DOUBLE(scale);
|
||||
EINA_LIST_FOREACH(_edje_edjes, l, data)
|
||||
edje_object_calc_force(data);
|
||||
}
|
||||
|
@ -214,7 +214,7 @@ edje_scale_set(double scale)
|
|||
EAPI double
|
||||
edje_scale_get(void)
|
||||
{
|
||||
return _edje_scale;
|
||||
return TO_DOUBLE(_edje_scale);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -241,7 +241,7 @@ edje_object_scale_set(Evas_Object *obj, double scale)
|
|||
ed = _edje_fetch(obj);
|
||||
if (!ed) return;
|
||||
if (ed->scale == scale) return;
|
||||
ed->scale = scale;
|
||||
ed->scale = FROM_DOUBLE(scale);
|
||||
edje_object_calc_force(obj);
|
||||
}
|
||||
|
||||
|
@ -263,7 +263,7 @@ edje_object_scale_get(const Evas_Object *obj)
|
|||
|
||||
ed = _edje_fetch(obj);
|
||||
if (!ed) return 0.0;
|
||||
return ed->scale;
|
||||
return TO_DOUBLE(ed->scale);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2847,13 +2847,13 @@ edje_object_part_drag_value_set(Evas_Object *obj, const char *part, double dx, d
|
|||
}
|
||||
if (rp->part->dragable.x < 0) dx = 1.0 - dx;
|
||||
if (rp->part->dragable.y < 0) dy = 1.0 - dy;
|
||||
if ((rp->drag->val.x == dx) && (rp->drag->val.y == dy)) return;
|
||||
rp->drag->val.x = dx;
|
||||
rp->drag->val.y = dy;
|
||||
if ((rp->drag->val.x == FROM_DOUBLE(dx)) && (rp->drag->val.y == FROM_DOUBLE(dy))) return;
|
||||
rp->drag->val.x = FROM_DOUBLE(dx);
|
||||
rp->drag->val.y = FROM_DOUBLE(dy);
|
||||
#ifdef EDJE_CALC_CACHE
|
||||
rp->invalidate = 1;
|
||||
#endif
|
||||
_edje_dragable_pos_set(rp->edje, rp, dx, dy);
|
||||
_edje_dragable_pos_set(rp->edje, rp, rp->drag->val.x, rp->drag->val.y);
|
||||
_edje_emit(rp->edje, "drag,set", rp->part->name);
|
||||
}
|
||||
|
||||
|
@ -2893,8 +2893,8 @@ edje_object_part_drag_value_get(const Evas_Object *obj, const char *part, double
|
|||
if (dy) *dy = 0;
|
||||
return;
|
||||
}
|
||||
ddx = rp->drag->val.x;
|
||||
ddy = rp->drag->val.y;
|
||||
ddx = TO_DOUBLE(rp->drag->val.x);
|
||||
ddy = TO_DOUBLE(rp->drag->val.y);
|
||||
if (rp->part->dragable.x < 0) ddx = 1.0 - ddx;
|
||||
if (rp->part->dragable.y < 0) ddy = 1.0 - ddy;
|
||||
if (dx) *dx = ddx;
|
||||
|
@ -2926,9 +2926,9 @@ edje_object_part_drag_size_set(Evas_Object *obj, const char *part, double dw, do
|
|||
else if (dw > 1.0) dw = 1.0;
|
||||
if (dh < 0.0) dh = 0.0;
|
||||
else if (dh > 1.0) dh = 1.0;
|
||||
if ((rp->drag->size.x == dw) && (rp->drag->size.y == dh)) return;
|
||||
rp->drag->size.x = dw;
|
||||
rp->drag->size.y = dh;
|
||||
if ((rp->drag->size.x == FROM_DOUBLE(dw)) && (rp->drag->size.y == FROM_DOUBLE(dh))) return;
|
||||
rp->drag->size.x = FROM_DOUBLE(dw);
|
||||
rp->drag->size.y = FROM_DOUBLE(dh);
|
||||
rp->edje->dirty = 1;
|
||||
#ifdef EDJE_CALC_CACHE
|
||||
rp->invalidate = 1;
|
||||
|
@ -2970,8 +2970,8 @@ edje_object_part_drag_size_get(const Evas_Object *obj, const char *part, double
|
|||
if (dh) *dh = 0;
|
||||
return;
|
||||
}
|
||||
if (dw) *dw = rp->drag->size.x;
|
||||
if (dh) *dh = rp->drag->size.y;
|
||||
if (dw) *dw = TO_DOUBLE(rp->drag->size.x);
|
||||
if (dh) *dh = TO_DOUBLE(rp->drag->size.y);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2999,8 +2999,8 @@ edje_object_part_drag_step_set(Evas_Object *obj, const char *part, double dx, do
|
|||
else if (dx > 1.0) dx = 1.0;
|
||||
if (dy < 0.0) dy = 0.0;
|
||||
else if (dy > 1.0) dy = 1.0;
|
||||
rp->drag->step.x = dx;
|
||||
rp->drag->step.y = dy;
|
||||
rp->drag->step.x = FROM_DOUBLE(dx);
|
||||
rp->drag->step.y = FROM_DOUBLE(dy);
|
||||
#ifdef EDJE_CALC_CACHE
|
||||
rp->invalidate = 1;
|
||||
#endif
|
||||
|
@ -3040,8 +3040,8 @@ edje_object_part_drag_step_get(const Evas_Object *obj, const char *part, double
|
|||
if (dy) *dy = 0;
|
||||
return;
|
||||
}
|
||||
if (dx) *dx = rp->drag->step.x;
|
||||
if (dy) *dy = rp->drag->step.y;
|
||||
if (dx) *dx = TO_DOUBLE(rp->drag->step.x);
|
||||
if (dy) *dy = TO_DOUBLE(rp->drag->step.y);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3069,8 +3069,8 @@ edje_object_part_drag_page_set(Evas_Object *obj, const char *part, double dx, do
|
|||
else if (dx > 1.0) dx = 1.0;
|
||||
if (dy < 0.0) dy = 0.0;
|
||||
else if (dy > 1.0) dy = 1.0;
|
||||
rp->drag->page.x = dx;
|
||||
rp->drag->page.y = dy;
|
||||
rp->drag->page.x = FROM_DOUBLE(dx);
|
||||
rp->drag->page.y = FROM_DOUBLE(dy);
|
||||
#ifdef EDJE_CALC_CACHE
|
||||
rp->invalidate = 1;
|
||||
#endif
|
||||
|
@ -3110,8 +3110,8 @@ edje_object_part_drag_page_get(const Evas_Object *obj, const char *part, double
|
|||
if (dy) *dy = 0;
|
||||
return;
|
||||
}
|
||||
if (dx) *dx = rp->drag->page.x;
|
||||
if (dy) *dy = rp->drag->page.y;
|
||||
if (dx) *dx = TO_DOUBLE(rp->drag->page.x);
|
||||
if (dy) *dy = TO_DOUBLE(rp->drag->page.y);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3130,7 +3130,7 @@ edje_object_part_drag_step(Evas_Object *obj, const char *part, double dx, double
|
|||
{
|
||||
Edje *ed;
|
||||
Edje_Real_Part *rp;
|
||||
double px, py;
|
||||
FLOAT_T px, py;
|
||||
|
||||
ed = _edje_fetch(obj);
|
||||
if ((!ed) || (!part)) return;
|
||||
|
@ -3140,10 +3140,12 @@ edje_object_part_drag_step(Evas_Object *obj, const char *part, double dx, double
|
|||
if (rp->drag->down.count > 0) return;
|
||||
px = rp->drag->val.x;
|
||||
py = rp->drag->val.y;
|
||||
rp->drag->val.x += dx * rp->drag->step.x * rp->part->dragable.x;
|
||||
rp->drag->val.y += dy * rp->drag->step.y * rp->part->dragable.y;
|
||||
rp->drag->val.x = CLAMP (rp->drag->val.x, 0.0, 1.0);
|
||||
rp->drag->val.y = CLAMP (rp->drag->val.y, 0.0, 1.0);
|
||||
rp->drag->val.x = ADD(px, MUL(FROM_DOUBLE(dx),
|
||||
MUL(rp->drag->step.x, rp->part->dragable.x)));
|
||||
rp->drag->val.y = ADD(py, MUL(FROM_DOUBLE(dy),
|
||||
MUL(rp->drag->step.y, rp->part->dragable.y)));
|
||||
rp->drag->val.x = CLAMP (rp->drag->val.x, ZERO, FROM_DOUBLE(1.0));
|
||||
rp->drag->val.y = CLAMP (rp->drag->val.y, ZERO, FROM_DOUBLE(1.0));
|
||||
if ((px == rp->drag->val.x) && (py == rp->drag->val.y)) return;
|
||||
#ifdef EDJE_CALC_CACHE
|
||||
rp->invalidate = 1;
|
||||
|
@ -3168,7 +3170,7 @@ edje_object_part_drag_page(Evas_Object *obj, const char *part, double dx, double
|
|||
{
|
||||
Edje *ed;
|
||||
Edje_Real_Part *rp;
|
||||
double px, py;
|
||||
FLOAT_T px, py;
|
||||
|
||||
ed = _edje_fetch(obj);
|
||||
if ((!ed) || (!part)) return;
|
||||
|
@ -3178,10 +3180,10 @@ edje_object_part_drag_page(Evas_Object *obj, const char *part, double dx, double
|
|||
if (rp->drag->down.count > 0) return;
|
||||
px = rp->drag->val.x;
|
||||
py = rp->drag->val.y;
|
||||
rp->drag->val.x += dx * rp->drag->page.x * rp->part->dragable.x;
|
||||
rp->drag->val.y += dy * rp->drag->page.y * rp->part->dragable.y;
|
||||
rp->drag->val.x = CLAMP (rp->drag->val.x, 0.0, 1.0);
|
||||
rp->drag->val.y = CLAMP (rp->drag->val.y, 0.0, 1.0);
|
||||
rp->drag->val.x = ADD(px, MUL(FROM_DOUBLE(dx), MUL(rp->drag->page.x, rp->part->dragable.x)));
|
||||
rp->drag->val.y = ADD(py, MUL(FROM_DOUBLE(dy), MUL(rp->drag->page.y, rp->part->dragable.y)));
|
||||
rp->drag->val.x = CLAMP (rp->drag->val.x, ZERO, FROM_DOUBLE(1.0));
|
||||
rp->drag->val.y = CLAMP (rp->drag->val.y, ZERO, FROM_DOUBLE(1.0));
|
||||
if ((px == rp->drag->val.x) && (py == rp->drag->val.y)) return;
|
||||
#ifdef EDJE_CALC_CACHE
|
||||
rp->invalidate = 1;
|
||||
|
|
Loading…
Reference in New Issue