efl_canvas_animation: rename Animation_XXX to XXX_Animation
Summary:
In animation classes, "Animation" is not used as a namespace but it is
used as a prefix in the class names.
e.g. Efl.Canvas.Animation_Alpha
However, those classes are basically animation classes with different
features. Therefore, "Animation" should be used as a postfix in the
class names.
e.g. Efl.Canvas.Animation_Alpha -> Efl.Canvas.Alpha_Animation
However, for the easier usage of C APIs, c_prefix of animation classes
are remained to be "efl_animation_xxx".
Reviewers: segfaultxavi, bu5hm4n, zmike, Hermet, jsuya
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D11108
2020-01-19 19:53:09 -08:00
|
|
|
#include "efl_canvas_rotate_animation_private.h"
|
2017-08-24 19:10:58 -07:00
|
|
|
|
efl_canvas_animation: rename Animation_XXX to XXX_Animation
Summary:
In animation classes, "Animation" is not used as a namespace but it is
used as a prefix in the class names.
e.g. Efl.Canvas.Animation_Alpha
However, those classes are basically animation classes with different
features. Therefore, "Animation" should be used as a postfix in the
class names.
e.g. Efl.Canvas.Animation_Alpha -> Efl.Canvas.Alpha_Animation
However, for the easier usage of C APIs, c_prefix of animation classes
are remained to be "efl_animation_xxx".
Reviewers: segfaultxavi, bu5hm4n, zmike, Hermet, jsuya
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D11108
2020-01-19 19:53:09 -08:00
|
|
|
#define MY_CLASS EFL_CANVAS_ROTATE_ANIMATION_CLASS
|
2018-01-16 03:31:15 -08:00
|
|
|
|
2017-08-24 19:10:58 -07:00
|
|
|
EOLIAN static void
|
efl_canvas_animation: rename Animation_XXX to XXX_Animation
Summary:
In animation classes, "Animation" is not used as a namespace but it is
used as a prefix in the class names.
e.g. Efl.Canvas.Animation_Alpha
However, those classes are basically animation classes with different
features. Therefore, "Animation" should be used as a postfix in the
class names.
e.g. Efl.Canvas.Animation_Alpha -> Efl.Canvas.Alpha_Animation
However, for the easier usage of C APIs, c_prefix of animation classes
are remained to be "efl_animation_xxx".
Reviewers: segfaultxavi, bu5hm4n, zmike, Hermet, jsuya
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D11108
2020-01-19 19:53:09 -08:00
|
|
|
_efl_canvas_rotate_animation_rotate_set(Eo *eo_obj EINA_UNUSED,
|
|
|
|
Efl_Canvas_Rotate_Animation_Data *pd,
|
2017-08-24 19:10:58 -07:00
|
|
|
double from_degree,
|
|
|
|
double to_degree,
|
|
|
|
Efl_Canvas_Object *pivot,
|
2019-10-30 07:29:59 -07:00
|
|
|
Eina_Vector2 center_point)
|
2017-08-24 19:10:58 -07:00
|
|
|
{
|
|
|
|
pd->from.degree = from_degree;
|
|
|
|
pd->to.degree = to_degree;
|
|
|
|
|
2018-01-16 03:31:15 -08:00
|
|
|
//TODO: check whether ref for pivot should be added.
|
2017-08-24 19:10:58 -07:00
|
|
|
pd->rel_pivot.obj = pivot;
|
2019-10-30 07:29:59 -07:00
|
|
|
pd->rel_pivot.pos = center_point;
|
2017-08-24 19:10:58 -07:00
|
|
|
pd->use_rel_pivot = EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
efl_canvas_animation: rename Animation_XXX to XXX_Animation
Summary:
In animation classes, "Animation" is not used as a namespace but it is
used as a prefix in the class names.
e.g. Efl.Canvas.Animation_Alpha
However, those classes are basically animation classes with different
features. Therefore, "Animation" should be used as a postfix in the
class names.
e.g. Efl.Canvas.Animation_Alpha -> Efl.Canvas.Alpha_Animation
However, for the easier usage of C APIs, c_prefix of animation classes
are remained to be "efl_animation_xxx".
Reviewers: segfaultxavi, bu5hm4n, zmike, Hermet, jsuya
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D11108
2020-01-19 19:53:09 -08:00
|
|
|
_efl_canvas_rotate_animation_rotate_get(const Eo *eo_obj EINA_UNUSED,
|
|
|
|
Efl_Canvas_Rotate_Animation_Data *pd,
|
2017-08-24 19:10:58 -07:00
|
|
|
double *from_degree,
|
|
|
|
double *to_degree,
|
|
|
|
Efl_Canvas_Object **pivot,
|
2019-10-30 07:29:59 -07:00
|
|
|
Eina_Vector2 *center_point)
|
2017-08-24 19:10:58 -07:00
|
|
|
{
|
|
|
|
if (!pd->use_rel_pivot)
|
|
|
|
{
|
2018-01-16 03:31:15 -08:00
|
|
|
ERR("Animation is done in absolute value.");
|
|
|
|
return;
|
2017-08-24 19:10:58 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
if (from_degree)
|
|
|
|
*from_degree = pd->from.degree;
|
|
|
|
|
|
|
|
if (to_degree)
|
|
|
|
*to_degree = pd->to.degree;
|
|
|
|
|
|
|
|
if (pivot)
|
|
|
|
*pivot = pd->rel_pivot.obj;
|
|
|
|
|
2019-10-30 07:29:59 -07:00
|
|
|
if (center_point)
|
|
|
|
*center_point = pd->rel_pivot.pos;
|
2017-08-24 19:10:58 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
efl_canvas_animation: rename Animation_XXX to XXX_Animation
Summary:
In animation classes, "Animation" is not used as a namespace but it is
used as a prefix in the class names.
e.g. Efl.Canvas.Animation_Alpha
However, those classes are basically animation classes with different
features. Therefore, "Animation" should be used as a postfix in the
class names.
e.g. Efl.Canvas.Animation_Alpha -> Efl.Canvas.Alpha_Animation
However, for the easier usage of C APIs, c_prefix of animation classes
are remained to be "efl_animation_xxx".
Reviewers: segfaultxavi, bu5hm4n, zmike, Hermet, jsuya
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D11108
2020-01-19 19:53:09 -08:00
|
|
|
_efl_canvas_rotate_animation_rotate_absolute_set(Eo *eo_obj EINA_UNUSED,
|
|
|
|
Efl_Canvas_Rotate_Animation_Data *pd,
|
2017-08-24 19:10:58 -07:00
|
|
|
double from_degree,
|
|
|
|
double to_degree,
|
2019-10-30 07:29:59 -07:00
|
|
|
Eina_Position2D abs)
|
2017-08-24 19:10:58 -07:00
|
|
|
{
|
|
|
|
pd->from.degree = from_degree;
|
|
|
|
pd->to.degree = to_degree;
|
|
|
|
|
2019-10-30 07:29:59 -07:00
|
|
|
pd->abs_pivot = abs;
|
2017-08-24 19:10:58 -07:00
|
|
|
pd->use_rel_pivot = EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
efl_canvas_animation: rename Animation_XXX to XXX_Animation
Summary:
In animation classes, "Animation" is not used as a namespace but it is
used as a prefix in the class names.
e.g. Efl.Canvas.Animation_Alpha
However, those classes are basically animation classes with different
features. Therefore, "Animation" should be used as a postfix in the
class names.
e.g. Efl.Canvas.Animation_Alpha -> Efl.Canvas.Alpha_Animation
However, for the easier usage of C APIs, c_prefix of animation classes
are remained to be "efl_animation_xxx".
Reviewers: segfaultxavi, bu5hm4n, zmike, Hermet, jsuya
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D11108
2020-01-19 19:53:09 -08:00
|
|
|
_efl_canvas_rotate_animation_rotate_absolute_get(const Eo *eo_obj EINA_UNUSED,
|
|
|
|
Efl_Canvas_Rotate_Animation_Data *pd,
|
2017-08-24 19:10:58 -07:00
|
|
|
double *from_degree,
|
|
|
|
double *to_degree,
|
2019-10-30 07:29:59 -07:00
|
|
|
Eina_Position2D *abs)
|
2017-08-24 19:10:58 -07:00
|
|
|
{
|
|
|
|
if (pd->use_rel_pivot)
|
|
|
|
{
|
2018-01-16 03:31:15 -08:00
|
|
|
ERR("Animation is done in relative value.");
|
|
|
|
return;
|
2017-08-24 19:10:58 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
if (from_degree)
|
|
|
|
*from_degree = pd->from.degree;
|
|
|
|
|
|
|
|
if (to_degree)
|
|
|
|
*to_degree = pd->to.degree;
|
|
|
|
|
2019-10-30 07:29:59 -07:00
|
|
|
if (abs)
|
|
|
|
*abs = pd->abs_pivot;
|
2017-08-24 19:10:58 -07:00
|
|
|
}
|
|
|
|
|
2018-01-16 03:31:15 -08:00
|
|
|
EOLIAN static double
|
efl_canvas_animation: rename Animation_XXX to XXX_Animation
Summary:
In animation classes, "Animation" is not used as a namespace but it is
used as a prefix in the class names.
e.g. Efl.Canvas.Animation_Alpha
However, those classes are basically animation classes with different
features. Therefore, "Animation" should be used as a postfix in the
class names.
e.g. Efl.Canvas.Animation_Alpha -> Efl.Canvas.Alpha_Animation
However, for the easier usage of C APIs, c_prefix of animation classes
are remained to be "efl_animation_xxx".
Reviewers: segfaultxavi, bu5hm4n, zmike, Hermet, jsuya
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D11108
2020-01-19 19:53:09 -08:00
|
|
|
_efl_canvas_rotate_animation_efl_canvas_animation_animation_apply(Eo *eo_obj,
|
|
|
|
Efl_Canvas_Rotate_Animation_Data *pd,
|
2018-01-16 03:31:15 -08:00
|
|
|
double progress,
|
|
|
|
Efl_Canvas_Object *target)
|
2017-08-24 19:26:09 -07:00
|
|
|
{
|
2018-01-16 03:31:15 -08:00
|
|
|
double new_degree;
|
2017-09-04 19:33:58 -07:00
|
|
|
|
2018-01-16 03:31:15 -08:00
|
|
|
progress = efl_animation_apply(efl_super(eo_obj, MY_CLASS), progress, target);
|
|
|
|
if (!target) return progress;
|
2017-08-30 04:20:15 -07:00
|
|
|
|
2018-01-16 03:31:15 -08:00
|
|
|
new_degree = GET_STATUS(pd->from.degree, pd->to.degree, progress);
|
2017-09-12 22:59:22 -07:00
|
|
|
|
2017-08-24 19:26:09 -07:00
|
|
|
if (pd->use_rel_pivot)
|
|
|
|
{
|
2019-02-20 12:32:41 -08:00
|
|
|
efl_gfx_mapping_rotate(target,
|
2019-06-04 02:52:14 -07:00
|
|
|
new_degree,
|
|
|
|
(pd->rel_pivot.obj) ? pd->rel_pivot.obj : target,
|
2019-10-30 07:29:59 -07:00
|
|
|
pd->rel_pivot.pos.x, pd->rel_pivot.pos.y);
|
2017-08-24 19:26:09 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-02-20 12:32:41 -08:00
|
|
|
efl_gfx_mapping_rotate_absolute(target,
|
2019-06-04 02:52:14 -07:00
|
|
|
new_degree,
|
2019-10-30 07:29:59 -07:00
|
|
|
pd->abs_pivot.x, pd->abs_pivot.y);
|
2017-08-24 19:26:09 -07:00
|
|
|
}
|
|
|
|
|
2018-01-16 03:31:15 -08:00
|
|
|
return progress;
|
2017-08-24 19:26:09 -07:00
|
|
|
}
|
|
|
|
|
2017-08-24 19:10:58 -07:00
|
|
|
EOLIAN static Efl_Object *
|
efl_canvas_animation: rename Animation_XXX to XXX_Animation
Summary:
In animation classes, "Animation" is not used as a namespace but it is
used as a prefix in the class names.
e.g. Efl.Canvas.Animation_Alpha
However, those classes are basically animation classes with different
features. Therefore, "Animation" should be used as a postfix in the
class names.
e.g. Efl.Canvas.Animation_Alpha -> Efl.Canvas.Alpha_Animation
However, for the easier usage of C APIs, c_prefix of animation classes
are remained to be "efl_animation_xxx".
Reviewers: segfaultxavi, bu5hm4n, zmike, Hermet, jsuya
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D11108
2020-01-19 19:53:09 -08:00
|
|
|
_efl_canvas_rotate_animation_efl_object_constructor(Eo *eo_obj,
|
|
|
|
Efl_Canvas_Rotate_Animation_Data *pd)
|
2017-08-24 19:10:58 -07:00
|
|
|
{
|
|
|
|
eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS));
|
|
|
|
|
|
|
|
pd->from.degree = 0.0;
|
|
|
|
pd->to.degree = 0.0;
|
|
|
|
|
|
|
|
pd->rel_pivot.obj = NULL;
|
2019-10-30 07:29:59 -07:00
|
|
|
pd->rel_pivot.pos.x = 0.5;
|
|
|
|
pd->rel_pivot.pos.y = 0.5;
|
2017-08-24 19:10:58 -07:00
|
|
|
|
2019-10-30 07:29:59 -07:00
|
|
|
pd->abs_pivot.x = 0;
|
|
|
|
pd->abs_pivot.y = 0;
|
2017-08-24 19:10:58 -07:00
|
|
|
|
|
|
|
pd->use_rel_pivot = EINA_TRUE;
|
|
|
|
|
|
|
|
return eo_obj;
|
|
|
|
}
|
|
|
|
|
efl_canvas_animation: rename Animation_XXX to XXX_Animation
Summary:
In animation classes, "Animation" is not used as a namespace but it is
used as a prefix in the class names.
e.g. Efl.Canvas.Animation_Alpha
However, those classes are basically animation classes with different
features. Therefore, "Animation" should be used as a postfix in the
class names.
e.g. Efl.Canvas.Animation_Alpha -> Efl.Canvas.Alpha_Animation
However, for the easier usage of C APIs, c_prefix of animation classes
are remained to be "efl_animation_xxx".
Reviewers: segfaultxavi, bu5hm4n, zmike, Hermet, jsuya
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D11108
2020-01-19 19:53:09 -08:00
|
|
|
#include "efl_canvas_rotate_animation.eo.c"
|