summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/efl_canvas_animation_translate.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/evas/canvas/efl_canvas_animation_translate.c')
-rw-r--r--src/lib/evas/canvas/efl_canvas_animation_translate.c75
1 files changed, 24 insertions, 51 deletions
diff --git a/src/lib/evas/canvas/efl_canvas_animation_translate.c b/src/lib/evas/canvas/efl_canvas_animation_translate.c
index 39a052c..1a98daa 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
11EOLIAN static void 11EOLIAN static void
12_efl_canvas_animation_translate_translate_set(Eo *eo_obj EINA_UNUSED, 12_efl_canvas_animation_translate_translate_set(Eo *eo_obj EINA_UNUSED,
13 Efl_Canvas_Animation_Translate_Data *pd, 13 Efl_Canvas_Animation_Translate_Data *pd,
14 Evas_Coord from_x, 14 Eina_Position2D from,
15 Evas_Coord from_y, 15 Eina_Position2D to)
16 Evas_Coord to_x,
17 Evas_Coord to_y)
18{ 16{
19 pd->from.move_x = from_x; 17 pd->from = from;
20 pd->from.move_y = from_y;
21 18
22 pd->to.move_x = to_x; 19 pd->to = to;
23 pd->to.move_y = to_y;
24 20
25 pd->use_rel_move = EINA_TRUE; 21 pd->use_rel_move = EINA_TRUE;
26} 22}
@@ -28,10 +24,8 @@ _efl_canvas_animation_translate_translate_set(Eo *eo_obj EINA_UNUSED,
28EOLIAN static void 24EOLIAN static void
29_efl_canvas_animation_translate_translate_get(const Eo *eo_obj EINA_UNUSED, 25_efl_canvas_animation_translate_translate_get(const Eo *eo_obj EINA_UNUSED,
30 Efl_Canvas_Animation_Translate_Data *pd, 26 Efl_Canvas_Animation_Translate_Data *pd,
31 Evas_Coord *from_x, 27 Eina_Position2D *from,
32 Evas_Coord *from_y, 28 Eina_Position2D *to)
33 Evas_Coord *to_x,
34 Evas_Coord *to_y)
35{ 29{
36 if (!pd->use_rel_move) 30 if (!pd->use_rel_move)
37 { 31 {
@@ -39,30 +33,22 @@ _efl_canvas_animation_translate_translate_get(const Eo *eo_obj EINA_UNUSED,
39 return; 33 return;
40 } 34 }
41 35
42 if (from_x) 36 if (from)
43 *from_x = pd->from.move_x; 37 *from = pd->from;
44 if (from_y)
45 *from_y = pd->from.move_y;
46 38
47 if (to_x) 39 if (to)
48 *to_x = pd->to.move_x; 40 *to = pd->to;
49 if (to_y)
50 *to_y = pd->to.move_y;
51} 41}
52 42
53EOLIAN static void 43EOLIAN static void
54_efl_canvas_animation_translate_translate_absolute_set(Eo *eo_obj EINA_UNUSED, 44_efl_canvas_animation_translate_translate_absolute_set(Eo *eo_obj EINA_UNUSED,
55 Efl_Canvas_Animation_Translate_Data *pd, 45 Efl_Canvas_Animation_Translate_Data *pd,
56 Evas_Coord from_x, 46 Eina_Position2D from,
57 Evas_Coord from_y, 47 Eina_Position2D to)
58 Evas_Coord to_x,
59 Evas_Coord to_y)
60{ 48{
61 pd->from.x = from_x; 49 pd->from = from;
62 pd->from.y = from_y;
63 50
64 pd->to.x = to_x; 51 pd->to = to;
65 pd->to.y = to_y;
66 52
67 pd->use_rel_move = EINA_FALSE; 53 pd->use_rel_move = EINA_FALSE;
68} 54}
@@ -70,10 +56,8 @@ _efl_canvas_animation_translate_translate_absolute_set(Eo *eo_obj EINA_UNUSED,
70EOLIAN static void 56EOLIAN static void
71_efl_canvas_animation_translate_translate_absolute_get(const Eo *eo_obj EINA_UNUSED, 57_efl_canvas_animation_translate_translate_absolute_get(const Eo *eo_obj EINA_UNUSED,
72 Efl_Canvas_Animation_Translate_Data *pd, 58 Efl_Canvas_Animation_Translate_Data *pd,
73 Evas_Coord *from_x, 59 Eina_Position2D *from,
74 Evas_Coord *from_y, 60 Eina_Position2D *to)
75 Evas_Coord *to_x,
76 Evas_Coord *to_y)
77{ 61{
78 if (pd->use_rel_move) 62 if (pd->use_rel_move)
79 { 63 {
@@ -81,15 +65,11 @@ _efl_canvas_animation_translate_translate_absolute_get(const Eo *eo_obj EINA_UNU
81 return; 65 return;
82 } 66 }
83 67
84 if (from_x) 68 if (from)
85 *from_x = pd->from.x; 69 *from = pd->from;
86 if (from_y)
87 *from_y = pd->from.y;
88 70
89 if (to_x) 71 if (to)
90 *to_x = pd->to.x; 72 *to = pd->to;
91 if (to_y)
92 *to_y = pd->to.y;
93} 73}
94 74
95EOLIAN static double 75EOLIAN static double
@@ -106,8 +86,8 @@ _efl_canvas_animation_translate_efl_canvas_animation_animation_apply(Eo *eo_obj,
106 86
107 if (pd->use_rel_move) 87 if (pd->use_rel_move)
108 { 88 {
109 new.x = GET_STATUS(pd->from.move_x, pd->to.move_x, progress); 89 new.x = GET_STATUS(pd->from.x, pd->to.x, progress);
110 new.y = GET_STATUS(pd->from.move_y, pd->to.move_y, progress); 90 new.y = GET_STATUS(pd->from.y, pd->to.y, progress);
111 } 91 }
112 else 92 else
113 { 93 {
@@ -127,15 +107,8 @@ _efl_canvas_animation_translate_efl_object_constructor(Eo *eo_obj,
127{ 107{
128 eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS)); 108 eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS));
129 109
130 pd->from.move_x = 0; 110 pd->from = EINA_POSITION2D(0,0);
131 pd->from.move_y = 0; 111 pd->to = EINA_POSITION2D(0,0);
132 pd->from.x = 0;
133 pd->from.y = 0;
134
135 pd->to.move_x = 0;
136 pd->to.move_y = 0;
137 pd->to.x = 0;
138 pd->to.y = 0;
139 112
140 pd->use_rel_move = EINA_TRUE; 113 pd->use_rel_move = EINA_TRUE;
141 114