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);
//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);
//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);
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;
}
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)
{
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;
}
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)
{
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
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
{
{
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;
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 {
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.]]
}
}
}
#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;