summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJaehyun Cho <jae_hyun.cho@samsung.com>2017-08-25 10:14:51 +0900
committerJaehyun Cho <jae_hyun.cho@samsung.com>2017-10-12 21:03:49 +0900
commit31ed27f00226cc2a292d9bbbdf5c0e20ce81816c (patch)
tree73d14a88b7cf6e984d8cc089fe0aba5e0bcf51ad /src
parentb4d4e2a2cc4f673fc08554b659846b72f8833285 (diff)
efl_animation: Add alpha animation
Diffstat (limited to 'src')
-rw-r--r--src/Makefile_Evas.am3
-rw-r--r--src/lib/evas/Evas_Common.h7
-rw-r--r--src/lib/evas/Evas_Eo.h1
-rw-r--r--src/lib/evas/canvas/efl_animation_alpha.c41
-rw-r--r--src/lib/evas/canvas/efl_animation_alpha.eo22
-rw-r--r--src/lib/evas/canvas/efl_animation_alpha_private.h32
6 files changed, 106 insertions, 0 deletions
diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am
index d136f3875e..c938821afe 100644
--- a/src/Makefile_Evas.am
+++ b/src/Makefile_Evas.am
@@ -45,6 +45,7 @@ evas_eolian_pub_files = \
45 lib/evas/canvas/efl_input_focus.eo \ 45 lib/evas/canvas/efl_input_focus.eo \
46 lib/evas/canvas/efl_gfx_map.eo \ 46 lib/evas/canvas/efl_gfx_map.eo \
47 lib/evas/canvas/efl_animation.eo \ 47 lib/evas/canvas/efl_animation.eo \
48 lib/evas/canvas/efl_animation_alpha.eo \
48 lib/evas/canvas/efl_animation_object.eo \ 49 lib/evas/canvas/efl_animation_object.eo \
49 $(NULL) 50 $(NULL)
50 51
@@ -125,6 +126,7 @@ lib/evas/canvas/evas_polygon_private.h \
125lib/evas/canvas/efl_canvas_surface.h \ 126lib/evas/canvas/efl_canvas_surface.h \
126lib/evas/common3d/primitives/primitive_common.h \ 127lib/evas/common3d/primitives/primitive_common.h \
127lib/evas/canvas/efl_animation_private.h \ 128lib/evas/canvas/efl_animation_private.h \
129lib/evas/canvas/efl_animation_alpha_private.h \
128lib/evas/canvas/efl_animation_object_private.h 130lib/evas/canvas/efl_animation_object_private.h
129 131
130# Linebreak 132# Linebreak
@@ -212,6 +214,7 @@ lib/evas/canvas/efl_input_pointer.c \
212lib/evas/canvas/efl_input_hold.c \ 214lib/evas/canvas/efl_input_hold.c \
213lib/evas/canvas/efl_input_focus.c \ 215lib/evas/canvas/efl_input_focus.c \
214lib/evas/canvas/efl_animation.c \ 216lib/evas/canvas/efl_animation.c \
217lib/evas/canvas/efl_animation_alpha.c \
215lib/evas/canvas/efl_animation_object.c \ 218lib/evas/canvas/efl_animation_object.c \
216$(NULL) 219$(NULL)
217 220
diff --git a/src/lib/evas/Evas_Common.h b/src/lib/evas/Evas_Common.h
index eb346ae734..e45bef86ed 100644
--- a/src/lib/evas/Evas_Common.h
+++ b/src/lib/evas/Evas_Common.h
@@ -3337,6 +3337,13 @@ typedef Eo Efl_Animation;
3337 3337
3338#endif 3338#endif
3339 3339
3340#ifndef _EFL_ANIMATION_ALPHA_EO_CLASS_TYPE
3341#define _EFL_ANIMATION_ALPHA_EO_CLASS_TYPE
3342
3343typedef Eo Efl_Animation_Alpha;
3344
3345#endif
3346
3340#ifndef _EFL_ANIMATION_OBJECT_EO_CLASS_TYPE 3347#ifndef _EFL_ANIMATION_OBJECT_EO_CLASS_TYPE
3341#define _EFL_ANIMATION_OBJECT_EO_CLASS_TYPE 3348#define _EFL_ANIMATION_OBJECT_EO_CLASS_TYPE
3342 3349
diff --git a/src/lib/evas/Evas_Eo.h b/src/lib/evas/Evas_Eo.h
index b7b376b8a8..2c233974c4 100644
--- a/src/lib/evas/Evas_Eo.h
+++ b/src/lib/evas/Evas_Eo.h
@@ -56,6 +56,7 @@
56#include "canvas/efl_canvas_object.eo.h" 56#include "canvas/efl_canvas_object.eo.h"
57 57
58#include "canvas/efl_animation.eo.h" 58#include "canvas/efl_animation.eo.h"
59#include "canvas/efl_animation_alpha.eo.h"
59#include "canvas/efl_animation_object.eo.h" 60#include "canvas/efl_animation_object.eo.h"
60 61
61#endif /* EFL_EO_API_SUPPORT */ 62#endif /* EFL_EO_API_SUPPORT */
diff --git a/src/lib/evas/canvas/efl_animation_alpha.c b/src/lib/evas/canvas/efl_animation_alpha.c
new file mode 100644
index 0000000000..7bbcac16e7
--- /dev/null
+++ b/src/lib/evas/canvas/efl_animation_alpha.c
@@ -0,0 +1,41 @@
1#include "efl_animation_alpha_private.h"
2
3EOLIAN static void
4_efl_animation_alpha_alpha_set(Eo *eo_obj,
5 Efl_Animation_Alpha_Data *pd,
6 double from_alpha,
7 double to_alpha)
8{
9 EFL_ANIMATION_ALPHA_CHECK_OR_RETURN(eo_obj);
10
11 pd->from.alpha = from_alpha;
12 pd->to.alpha = to_alpha;
13}
14
15EOLIAN static void
16_efl_animation_alpha_alpha_get(Eo *eo_obj EINA_UNUSED,
17 Efl_Animation_Alpha_Data *pd,
18 double *from_alpha,
19 double *to_alpha)
20{
21 EFL_ANIMATION_ALPHA_CHECK_OR_RETURN(eo_obj);
22
23 if (from_alpha)
24 *from_alpha = pd->from.alpha;
25 if (to_alpha)
26 *to_alpha = pd->to.alpha;
27}
28
29EOLIAN static Efl_Object *
30_efl_animation_alpha_efl_object_constructor(Eo *eo_obj,
31 Efl_Animation_Alpha_Data *pd)
32{
33 eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS));
34
35 pd->from.alpha = 1.0;
36 pd->to.alpha = 1.0;
37
38 return eo_obj;
39}
40
41#include "efl_animation_alpha.eo.c"
diff --git a/src/lib/evas/canvas/efl_animation_alpha.eo b/src/lib/evas/canvas/efl_animation_alpha.eo
new file mode 100644
index 0000000000..a037a9a92b
--- /dev/null
+++ b/src/lib/evas/canvas/efl_animation_alpha.eo
@@ -0,0 +1,22 @@
1import efl_animation_types;
2
3class Efl.Animation.Alpha (Efl.Animation)
4{
5 [[Efl alpha animation class]]
6 data: Efl_Animation_Alpha_Data;
7 methods {
8 @property alpha {
9 set {
10 }
11 get {
12 }
13 values {
14 from_alpha: double; [[Alpha value when animation starts]]
15 to_alpha: double; [[Alpha value when animation ends]]
16 }
17 }
18 }
19 implements {
20 Efl.Object.constructor;
21 }
22}
diff --git a/src/lib/evas/canvas/efl_animation_alpha_private.h b/src/lib/evas/canvas/efl_animation_alpha_private.h
new file mode 100644
index 0000000000..58e429eb07
--- /dev/null
+++ b/src/lib/evas/canvas/efl_animation_alpha_private.h
@@ -0,0 +1,32 @@
1#define EFL_ANIMATION_PROTECTED
2
3#include "evas_common_private.h"
4
5#define MY_CLASS EFL_ANIMATION_ALPHA_CLASS
6#define MY_CLASS_NAME efl_class_name_get(MY_CLASS)
7
8#define EFL_ANIMATION_ALPHA_CHECK_OR_RETURN(anim, ...) \
9 do { \
10 if (!anim) { \
11 CRI("Efl_Animation " # anim " is NULL!"); \
12 return __VA_ARGS__; \
13 } \
14 if (efl_animation_is_deleted(anim)) { \
15 ERR("Efl_Animation " # anim " has already been deleted!"); \
16 return __VA_ARGS__; \
17 } \
18 } while (0)
19
20#define EFL_ANIMATION_ALPHA_DATA_GET(o, pd) \
21 Efl_Animation_Alpha_Data *pd = efl_data_scope_get(o, EFL_ANIMATION_ALPHA_CLASS)
22
23typedef struct _Efl_Animation_Alpha_Property
24{
25 double alpha;
26} Efl_Animation_Alpha_Property;
27
28typedef struct _Efl_Animation_Alpha_Data
29{
30 Efl_Animation_Alpha_Property from;
31 Efl_Animation_Alpha_Property to;
32} Efl_Animation_Alpha_Data;