summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bin/elementary/test_efl_anim_interpolator.c2
-rw-r--r--src/bin/elementary/test_efl_anim_translate.c8
-rw-r--r--src/lib/evas/canvas/efl_canvas_animation_translate.c75
-rw-r--r--src/lib/evas/canvas/efl_canvas_animation_translate.eo12
-rw-r--r--src/lib/evas/canvas/efl_canvas_animation_translate_private.h10
5 files changed, 35 insertions, 72 deletions
diff --git a/src/bin/elementary/test_efl_anim_interpolator.c b/src/bin/elementary/test_efl_anim_interpolator.c
index be177d7ed4..9a6522f6d7 100644
--- a/src/bin/elementary/test_efl_anim_interpolator.c
+++ b/src/bin/elementary/test_efl_anim_interpolator.c
@@ -199,7 +199,7 @@ test_efl_anim_interpolator(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
Efl_Canvas_Animation *anim =
efl_add(EFL_CANVAS_ANIMATION_TRANSLATE_CLASS, win);
- efl_animation_translate_set(anim, 0, 0, (WIN_W - BTN_W), 0);
+ efl_animation_translate_set(anim, EINA_POSITION2D(0, 0), EINA_POSITION2D((WIN_W - BTN_W), 0));
efl_animation_duration_set(anim, 2.0);
efl_animation_final_state_keep_set(anim, EINA_FALSE);
diff --git a/src/bin/elementary/test_efl_anim_translate.c b/src/bin/elementary/test_efl_anim_translate.c
index 9f30cc3b63..5bbf1b22e7 100644
--- a/src/bin/elementary/test_efl_anim_translate.c
+++ b/src/bin/elementary/test_efl_anim_translate.c
@@ -84,13 +84,13 @@ test_efl_anim_translate(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, vo
//Translate Animation to right bottom relatively
Efl_Canvas_Animation *translate_rb_anim = efl_add(EFL_CANVAS_ANIMATION_TRANSLATE_CLASS, win);
- efl_animation_translate_set(translate_rb_anim, 0, 0, 100, 100);
+ efl_animation_translate_set(translate_rb_anim, EINA_POSITION2D(0, 0), EINA_POSITION2D(100, 100));
efl_animation_duration_set(translate_rb_anim, 1.0);
efl_animation_final_state_keep_set(translate_rb_anim, EINA_TRUE);
//Translate Animation to left top relatively
Efl_Canvas_Animation *translate_lt_anim = efl_add(EFL_CANVAS_ANIMATION_TRANSLATE_CLASS, win);
- efl_animation_translate_set(translate_lt_anim, 100, 100, 0, 0);
+ efl_animation_translate_set(translate_lt_anim, EINA_POSITION2D(100, 100), EINA_POSITION2D(0, 0));
efl_animation_duration_set(translate_lt_anim, 1.0);
efl_animation_final_state_keep_set(translate_lt_anim, EINA_TRUE);
@@ -150,13 +150,13 @@ test_efl_anim_translate_absolute(void *data EINA_UNUSED, Evas_Object *obj EINA_U
//Translate Animation to right bottom absolutely
Efl_Canvas_Animation *translate_rb_anim = efl_add(EFL_CANVAS_ANIMATION_TRANSLATE_CLASS, win);
- efl_animation_translate_absolute_set(translate_rb_anim, 0, 0, 100, 100);
+ efl_animation_translate_absolute_set(translate_rb_anim, EINA_POSITION2D(0, 0), EINA_POSITION2D(100, 100));
efl_animation_duration_set(translate_rb_anim, 1.0);
efl_animation_final_state_keep_set(translate_rb_anim, EINA_TRUE);
//Translate Animation to left top absolutely
Efl_Canvas_Animation *translate_lt_anim = efl_add(EFL_CANVAS_ANIMATION_TRANSLATE_CLASS, win);
- efl_animation_translate_absolute_set(translate_lt_anim, 100, 100, 0, 0);
+ efl_animation_translate_absolute_set(translate_lt_anim, EINA_POSITION2D(100, 100), EINA_POSITION2D(0, 0));
efl_animation_duration_set(translate_lt_anim, 1.0);
efl_animation_final_state_keep_set(translate_lt_anim, EINA_TRUE);
diff --git a/src/lib/evas/canvas/efl_canvas_animation_translate.c b/src/lib/evas/canvas/efl_canvas_animation_translate.c
index 39a052cf26..1a98daa60d 100644
--- a/src/lib/evas/canvas/efl_canvas_animation_translate.c
+++ b/src/lib/evas/canvas/efl_canvas_animation_translate.c
@@ -11,16 +11,12 @@ typedef struct __Translate_Property_Double
EOLIAN static void
_efl_canvas_animation_translate_translate_set(Eo *eo_obj EINA_UNUSED,
Efl_Canvas_Animation_Translate_Data *pd,
- Evas_Coord from_x,
- Evas_Coord from_y,
- Evas_Coord to_x,
- Evas_Coord to_y)
+ Eina_Position2D from,
+ Eina_Position2D to)
{
- pd->from.move_x = from_x;
- pd->from.move_y = from_y;
+ pd->from = from;
- pd->to.move_x = to_x;
- pd->to.move_y = to_y;
+ pd->to = to;
pd->use_rel_move = EINA_TRUE;
}
@@ -28,10 +24,8 @@ _efl_canvas_animation_translate_translate_set(Eo *eo_obj EINA_UNUSED,
EOLIAN static void
_efl_canvas_animation_translate_translate_get(const Eo *eo_obj EINA_UNUSED,
Efl_Canvas_Animation_Translate_Data *pd,
- Evas_Coord *from_x,
- Evas_Coord *from_y,
- Evas_Coord *to_x,
- Evas_Coord *to_y)
+ Eina_Position2D *from,
+ Eina_Position2D *to)
{
if (!pd->use_rel_move)
{
@@ -39,30 +33,22 @@ _efl_canvas_animation_translate_translate_get(const Eo *eo_obj EINA_UNUSED,
return;
}
- if (from_x)
- *from_x = pd->from.move_x;
- if (from_y)
- *from_y = pd->from.move_y;
+ if (from)
+ *from = pd->from;
- if (to_x)
- *to_x = pd->to.move_x;
- if (to_y)
- *to_y = pd->to.move_y;
+ if (to)
+ *to = pd->to;
}
EOLIAN static void
_efl_canvas_animation_translate_translate_absolute_set(Eo *eo_obj EINA_UNUSED,
Efl_Canvas_Animation_Translate_Data *pd,
- Evas_Coord from_x,
- Evas_Coord from_y,
- Evas_Coord to_x,
- Evas_Coord to_y)
+ Eina_Position2D from,
+ Eina_Position2D to)
{
- pd->from.x = from_x;
- pd->from.y = from_y;
+ pd->from = from;
- pd->to.x = to_x;
- pd->to.y = to_y;
+ pd->to = to;
pd->use_rel_move = EINA_FALSE;
}
@@ -70,10 +56,8 @@ _efl_canvas_animation_translate_translate_absolute_set(Eo *eo_obj EINA_UNUSED,
EOLIAN static void
_efl_canvas_animation_translate_translate_absolute_get(const Eo *eo_obj EINA_UNUSED,
Efl_Canvas_Animation_Translate_Data *pd,
- Evas_Coord *from_x,
- Evas_Coord *from_y,
- Evas_Coord *to_x,
- Evas_Coord *to_y)
+ Eina_Position2D *from,
+ Eina_Position2D *to)
{
if (pd->use_rel_move)
{
@@ -81,15 +65,11 @@ _efl_canvas_animation_translate_translate_absolute_get(const Eo *eo_obj EINA_UNU
return;
}
- if (from_x)
- *from_x = pd->from.x;
- if (from_y)
- *from_y = pd->from.y;
+ if (from)
+ *from = pd->from;
- if (to_x)
- *to_x = pd->to.x;
- if (to_y)
- *to_y = pd->to.y;
+ if (to)
+ *to = pd->to;
}
EOLIAN static double
@@ -106,8 +86,8 @@ _efl_canvas_animation_translate_efl_canvas_animation_animation_apply(Eo *eo_obj,
if (pd->use_rel_move)
{
- new.x = GET_STATUS(pd->from.move_x, pd->to.move_x, progress);
- new.y = GET_STATUS(pd->from.move_y, pd->to.move_y, progress);
+ new.x = GET_STATUS(pd->from.x, pd->to.x, progress);
+ new.y = GET_STATUS(pd->from.y, pd->to.y, progress);
}
else
{
@@ -127,15 +107,8 @@ _efl_canvas_animation_translate_efl_object_constructor(Eo *eo_obj,
{
eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS));
- pd->from.move_x = 0;
- pd->from.move_y = 0;
- pd->from.x = 0;
- pd->from.y = 0;
-
- pd->to.move_x = 0;
- pd->to.move_y = 0;
- pd->to.x = 0;
- pd->to.y = 0;
+ pd->from = EINA_POSITION2D(0,0);
+ pd->to = EINA_POSITION2D(0,0);
pd->use_rel_move = EINA_TRUE;
diff --git a/src/lib/evas/canvas/efl_canvas_animation_translate.eo b/src/lib/evas/canvas/efl_canvas_animation_translate.eo
index 3d74cbd0cd..e4b2678679 100644
--- a/src/lib/evas/canvas/efl_canvas_animation_translate.eo
+++ b/src/lib/evas/canvas/efl_canvas_animation_translate.eo
@@ -11,10 +11,8 @@ class @beta Efl.Canvas.Animation_Translate extends Efl.Canvas.Animation
get {
}
values {
- from_x: int; [[Distance moved along x axis when animation starts]]
- from_y: int; [[Distance moved along y axis when animation starts]]
- to_x: int; [[Distance moved along x axis when animation ends]]
- to_y: int; [[Distance moved along y axis when animation ends]]
+ from : Eina.Position2D; [[Position moved when animation starts.]]
+ to : Eina.Position2D; [[Position moved when animation ends.]]
}
}
@property translate_absolute {
@@ -24,10 +22,8 @@ class @beta Efl.Canvas.Animation_Translate extends Efl.Canvas.Animation
get {
}
values {
- from_x: int; [[X coordinate when animation starts]]
- from_y: int; [[Y coordinate when animation starts]]
- to_x: int; [[X coordinate when animation ends]]
- to_y: int; [[Y coordinate when animation ends]]
+ from : Eina.Position2D; [[The position where the animation starts.]]
+ to : Eina.Position2D; [[The position where the animation stops.]]
}
}
}
diff --git a/src/lib/evas/canvas/efl_canvas_animation_translate_private.h b/src/lib/evas/canvas/efl_canvas_animation_translate_private.h
index 17c4b6d432..47665a5984 100644
--- a/src/lib/evas/canvas/efl_canvas_animation_translate_private.h
+++ b/src/lib/evas/canvas/efl_canvas_animation_translate_private.h
@@ -7,16 +7,10 @@
#define EFL_ANIMATION_TRANSLATE_DATA_GET(o, pd) \
Efl_Canvas_Animation_Translate_Data *pd = efl_data_scope_get(o, EFL_CANVAS_ANIMATION_TRANSLATE_CLASS)
-typedef struct _Efl_Canvas_Animation_Translate_Property
-{
- Evas_Coord move_x, move_y;
- Evas_Coord x, y;
-} Efl_Canvas_Animation_Translate_Property;
-
typedef struct _Efl_Canvas_Animation_Translate_Data
{
- Efl_Canvas_Animation_Translate_Property from;
- Efl_Canvas_Animation_Translate_Property to;
+ Eina_Position2D from;
+ Eina_Position2D to;
Eina_Bool use_rel_move;
} Efl_Canvas_Animation_Translate_Data;