lib/evas/canvas/efl_animation_alpha.eo \
lib/evas/canvas/efl_animation_rotate.eo \
lib/evas/canvas/efl_animation_scale.eo \
+ lib/evas/canvas/efl_animation_translate.eo \
lib/evas/canvas/efl_animation_object.eo \
lib/evas/canvas/efl_animation_object_alpha.eo \
lib/evas/canvas/efl_animation_object_rotate.eo \
lib/evas/canvas/efl_animation_alpha_private.h \
lib/evas/canvas/efl_animation_rotate_private.h \
lib/evas/canvas/efl_animation_scale_private.h \
+lib/evas/canvas/efl_animation_translate_private.h \
lib/evas/canvas/efl_animation_object_private.h \
lib/evas/canvas/efl_animation_object_alpha_private.h \
lib/evas/canvas/efl_animation_object_rotate_private.h \
lib/evas/canvas/efl_animation_alpha.c \
lib/evas/canvas/efl_animation_rotate.c \
lib/evas/canvas/efl_animation_scale.c \
+lib/evas/canvas/efl_animation_translate.c \
lib/evas/canvas/efl_animation_object.c \
lib/evas/canvas/efl_animation_object_alpha.c \
lib/evas/canvas/efl_animation_object_rotate.c \
#endif
+#ifndef _EFL_ANIMATION_TRANSLATE_EO_CLASS_TYPE
+#define _EFL_ANIMATION_TRANSLATE_EO_CLASS_TYPE
+
+typedef Eo Efl_Animation_Translate;
+
+#endif
+
#ifndef _EFL_ANIMATION_OBJECT_EO_CLASS_TYPE
#define _EFL_ANIMATION_OBJECT_EO_CLASS_TYPE
#include "canvas/efl_animation_alpha.eo.h"
#include "canvas/efl_animation_rotate.eo.h"
#include "canvas/efl_animation_scale.eo.h"
+#include "canvas/efl_animation_translate.eo.h"
#include "canvas/efl_animation_object.eo.h"
#include "canvas/efl_animation_object_alpha.eo.h"
#include "canvas/efl_animation_object_rotate.eo.h"
--- /dev/null
+#include "efl_animation_translate_private.h"
+
+EOLIAN static void
+_efl_animation_translate_translate_set(Eo *eo_obj,
+ Efl_Animation_Translate_Data *pd,
+ Evas_Coord from_x,
+ Evas_Coord from_y,
+ Evas_Coord to_x,
+ Evas_Coord to_y)
+{
+ EFL_ANIMATION_TRANSLATE_CHECK_OR_RETURN(eo_obj);
+
+ pd->from.move_x = from_x;
+ pd->from.move_y = from_y;
+
+ pd->to.move_x = to_x;
+ pd->to.move_y = to_y;
+
+ //Update absolute coordinate based on relative move
+ Evas_Coord x = 0;
+ Evas_Coord y = 0;
+
+ Efl_Canvas_Object *target = efl_animation_target_get(eo_obj);
+ if (target)
+ evas_object_geometry_get(target, &x, &y, NULL, NULL);
+
+ pd->from.x = pd->from.move_x + x;
+ pd->from.y = pd->from.move_y + y;
+
+ pd->to.x = pd->to.move_x + x;
+ pd->to.y = pd->to.move_y + y;
+
+ pd->use_rel_move = EINA_TRUE;
+}
+
+EOLIAN static void
+_efl_animation_translate_translate_get(Eo *eo_obj,
+ Efl_Animation_Translate_Data *pd,
+ Evas_Coord *from_x,
+ Evas_Coord *from_y,
+ Evas_Coord *to_x,
+ Evas_Coord *to_y)
+{
+ EFL_ANIMATION_TRANSLATE_CHECK_OR_RETURN(eo_obj);
+
+ //Update relative move based on absolute coordinate
+ if (!pd->use_rel_move)
+ {
+ Evas_Coord x = 0;
+ Evas_Coord y = 0;
+
+ Efl_Canvas_Object *target = efl_animation_target_get(eo_obj);
+ if (target)
+ evas_object_geometry_get(target, &x, &y, NULL, NULL);
+
+ pd->from.move_x = pd->from.x - x;
+ pd->from.move_y = pd->from.y - y;
+
+ pd->to.move_x = pd->to.x - x;
+ pd->to.move_y = pd->to.y - y;
+ }
+
+ if (from_x)
+ *from_x = pd->from.move_x;
+ if (from_y)
+ *from_y = pd->from.move_y;
+
+ if (to_x)
+ *to_x = pd->to.move_x;
+ if (to_y)
+ *to_y = pd->to.move_y;
+}
+
+EOLIAN static void
+_efl_animation_translate_translate_absolute_set(Eo *eo_obj,
+ Efl_Animation_Translate_Data *pd,
+ Evas_Coord from_x,
+ Evas_Coord from_y,
+ Evas_Coord to_x,
+ Evas_Coord to_y)
+{
+ EFL_ANIMATION_TRANSLATE_CHECK_OR_RETURN(eo_obj);
+
+ pd->from.x = from_x;
+ pd->from.y = from_y;
+
+ pd->to.x = to_x;
+ pd->to.y = to_y;
+
+ //Update relative move based on absolute coordinate
+ Evas_Coord x = 0;
+ Evas_Coord y = 0;
+
+ Efl_Canvas_Object *target = efl_animation_target_get(eo_obj);
+ if (target)
+ evas_object_geometry_get(target, &x, &y, NULL, NULL);
+
+ pd->from.move_x = pd->from.x - x;
+ pd->from.move_y = pd->from.y - y;
+
+ pd->to.move_x = pd->to.x - x;
+ pd->to.move_y = pd->to.y - y;
+
+ pd->use_rel_move = EINA_FALSE;
+}
+
+EOLIAN static void
+_efl_animation_translate_translate_absolute_get(Eo *eo_obj,
+ Efl_Animation_Translate_Data *pd,
+ Evas_Coord *from_x,
+ Evas_Coord *from_y,
+ Evas_Coord *to_x,
+ Evas_Coord *to_y)
+{
+ EFL_ANIMATION_TRANSLATE_CHECK_OR_RETURN(eo_obj);
+
+ //Update absolute coordinate based on relative move
+ if (pd->use_rel_move)
+ {
+ Evas_Coord x = 0;
+ Evas_Coord y = 0;
+
+ Efl_Canvas_Object *target = efl_animation_target_get(eo_obj);
+ if (target)
+ evas_object_geometry_get(target, &x, &y, NULL, NULL);
+
+ pd->from.x = pd->from.move_x + x;
+ pd->from.y = pd->from.move_y + y;
+
+ pd->to.x = pd->to.move_x + x;
+ pd->to.y = pd->to.move_y + y;
+ }
+
+ if (from_x)
+ *from_x = pd->from.x;
+ if (from_y)
+ *from_y = pd->from.y;
+
+ if (to_x)
+ *to_x = pd->to.x;
+ if (to_y)
+ *to_y = pd->to.y;
+}
+
+EOLIAN static Efl_Object *
+_efl_animation_translate_efl_object_constructor(Eo *eo_obj,
+ Efl_Animation_Translate_Data *pd)
+{
+ 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->use_rel_move = EINA_TRUE;
+
+ return eo_obj;
+}
+
+#include "efl_animation_translate.eo.c"
--- /dev/null
+import efl_animation_types;
+
+class Efl.Animation.Translate (Efl.Animation)
+{
+ [[Efl translate animation class]]
+ data: Efl_Animation_Translate_Data;
+ methods {
+ @property translate {
+ set {
+ }
+ 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]]
+ }
+ }
+ @property translate_absolute {
+ set {
+ }
+ 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]]
+ }
+ }
+ }
+ implements {
+ Efl.Object.constructor;
+ }
+}
--- /dev/null
+#define EFL_ANIMATION_PROTECTED
+
+#include "evas_common_private.h"
+
+#define MY_CLASS EFL_ANIMATION_TRANSLATE_CLASS
+#define MY_CLASS_NAME efl_class_name_get(MY_CLASS)
+
+#define EFL_ANIMATION_TRANSLATE_CHECK_OR_RETURN(anim, ...) \
+ do { \
+ if (!anim) { \
+ CRI("Efl_Animation " # anim " is NULL!"); \
+ return __VA_ARGS__; \
+ } \
+ if (efl_animation_is_deleted(anim)) { \
+ ERR("Efl_Animation " # anim " has already been deleted!"); \
+ return __VA_ARGS__; \
+ } \
+ } while (0)
+
+#define EFL_ANIMATION_TRANSLATE_DATA_GET(o, pd) \
+ Efl_Animation_Translate_Data *pd = efl_data_scope_get(o, EFL_ANIMATION_TRANSLATE_CLASS)
+
+typedef struct _Efl_Animation_Translate_Property
+{
+ Evas_Coord move_x, move_y;
+ Evas_Coord x, y;
+} Efl_Animation_Translate_Property;
+
+typedef struct _Efl_Animation_Translate_Data
+{
+ Efl_Animation_Translate_Property from;
+ Efl_Animation_Translate_Property to;
+
+ Eina_Bool use_rel_move;
+} Efl_Animation_Translate_Data;