summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaehyun Cho <jae_hyun.cho@samsung.com>2017-07-03 18:51:03 +0900
committerJaehyun Cho <jae_hyun.cho@samsung.com>2017-08-18 12:06:01 +0900
commit70d08f0e4e0b9c20d5bb4c7d5294e97f2b1bc18e (patch)
tree16d220e50ca3851205ea3125798735d37cf2833b
parent5f650530d4eb94b71b67f592c6a05694fc6cabc8 (diff)
downloadefl-70d08f0e4e0b9c20d5bb4c7d5294e97f2b1bc18e.tar.gz
efl_animation: Add alpha animation
-rw-r--r--src/Makefile_Evas.am2
-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.c70
-rw-r--r--src/lib/evas/canvas/efl_animation_alpha.eo24
-rw-r--r--src/lib/evas/include/evas_private.h1
6 files changed, 105 insertions, 0 deletions
diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am
index 513ff26bc1..d2c37d7e46 100644
--- a/src/Makefile_Evas.am
+++ b/src/Makefile_Evas.am
@@ -51,6 +51,7 @@ evas_eolian_pub_files = \
lib/evas/canvas/efl_input_focus.eo \
lib/evas/canvas/efl_gfx_map.eo \
lib/evas/canvas/efl_animation.eo \
+ lib/evas/canvas/efl_animation_alpha.eo \
lib/evas/canvas/efl_animation_instance.eo \
$(NULL)
@@ -217,6 +218,7 @@ lib/evas/canvas/efl_input_pointer.c \
lib/evas/canvas/efl_input_hold.c \
lib/evas/canvas/efl_input_focus.c \
lib/evas/canvas/efl_animation.c \
+lib/evas/canvas/efl_animation_alpha.c \
lib/evas/canvas/efl_animation_instance.c \
$(NULL)
diff --git a/src/lib/evas/Evas_Common.h b/src/lib/evas/Evas_Common.h
index fcc279cf73..d4abf1f073 100644
--- a/src/lib/evas/Evas_Common.h
+++ b/src/lib/evas/Evas_Common.h
@@ -3328,6 +3328,13 @@ typedef Eo Efl_Animation;
#endif
+#ifndef _EFL_ANIMATION_ALPHA_EO_CLASS_TYPE
+#define _EFL_ANIMATION_ALPHA_EO_CLASS_TYPE
+
+typedef Eo Efl_Animation_Alpha;
+
+#endif
+
#ifndef _EFL_ANIMATION_INSTANCE_EO_CLASS_TYPE
#define _EFL_ANIMATION_INSTANCE_EO_CLASS_TYPE
diff --git a/src/lib/evas/Evas_Eo.h b/src/lib/evas/Evas_Eo.h
index 4c3a2cbf61..df3ec08074 100644
--- a/src/lib/evas/Evas_Eo.h
+++ b/src/lib/evas/Evas_Eo.h
@@ -67,6 +67,7 @@
#include "canvas/efl_canvas_object.eo.h"
#include "canvas/efl_animation.eo.h"
+#include "canvas/efl_animation_alpha.eo.h"
#include "canvas/efl_animation_instance.eo.h"
#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..dc2663186f
--- /dev/null
+++ b/src/lib/evas/canvas/efl_animation_alpha.c
@@ -0,0 +1,70 @@
+#include "evas_common_private.h"
+#include "evas_private.h"
+
+#define MY_CLASS EFL_ANIMATION_ALPHA_CLASS
+#define MY_CLASS_NAME efl_class_name_get(MY_CLASS)
+
+#define EFL_ANIMATION_ALPHA_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_ALPHA_DATA_GET(o, pd) \
+ Evas_Object_Animation_Alpha_Data *pd = efl_data_scope_get(o, EFL_ANIMATION_ALPHA_CLASS)
+
+typedef struct _Evas_Object_Animation_Alpha_Property
+{
+ double alpha;
+} Evas_Object_Animation_Alpha_Property;
+
+struct _Evas_Object_Animation_Alpha_Data
+{
+ Evas_Object_Animation_Alpha_Property from;
+ Evas_Object_Animation_Alpha_Property to;
+};
+
+EOLIAN static void
+_efl_animation_alpha_alpha_set(Eo *eo_obj, Evas_Object_Animation_Alpha_Data *pd, double from_alpha, double to_alpha)
+{
+ EFL_ANIMATION_ALPHA_CHECK_OR_RETURN(eo_obj);
+
+ pd->from.alpha = from_alpha;
+ pd->to.alpha = to_alpha;
+}
+
+EOLIAN static void
+_efl_animation_alpha_alpha_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Animation_Alpha_Data *pd, double *from_alpha, double *to_alpha)
+{
+ EFL_ANIMATION_ALPHA_CHECK_OR_RETURN(eo_obj);
+
+ if (from_alpha)
+ *from_alpha = pd->from.alpha;
+ if (to_alpha)
+ *to_alpha = pd->to.alpha;
+}
+
+EOLIAN static Efl_Object *
+_efl_animation_alpha_efl_object_constructor(Eo *eo_obj, Evas_Object_Animation_Alpha_Data *pd)
+{
+ eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS));
+
+ pd->from.alpha = 1.0;
+ pd->to.alpha = 1.0;
+
+ return eo_obj;
+}
+
+EOLIAN static void
+_efl_animation_alpha_efl_object_destructor(Eo *eo_obj, Evas_Object_Animation_Alpha_Data *pd EINA_UNUSED)
+{
+ efl_destructor(efl_super(eo_obj, MY_CLASS));
+}
+
+#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..ff59aa5854
--- /dev/null
+++ b/src/lib/evas/canvas/efl_animation_alpha.eo
@@ -0,0 +1,24 @@
+import efl_animation_types;
+
+class Efl.Animation.Alpha (Efl.Animation)
+{
+ [[Efl alpha animation class]]
+ legacy_prefix: evas_object_animation;
+ data: Evas_Object_Animation_Alpha_Data;
+ methods {
+ @property alpha {
+ set {
+ }
+ get {
+ }
+ values {
+ from_alpha: double; [[Alpha value when animation starts]]
+ to_alpha: double; [[Alpha value when animation ends]]
+ }
+ }
+ }
+ implements {
+ Efl.Object.constructor;
+ Efl.Object.destructor;
+ }
+}
diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h
index 29734aa21f..7caac27690 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -108,6 +108,7 @@ typedef struct _Evas_Pointer_Data Evas_Pointer_Data;
typedef struct _Evas_Filter_Command Evas_Filter_Command;
typedef enum _Evas_Filter_Support Evas_Filter_Support;
+typedef struct _Evas_Object_Animation_Alpha_Data Evas_Object_Animation_Alpha_Data;
typedef struct _Evas_Object_Animation_Data Evas_Object_Animation_Data;
typedef struct _Evas_Object_Animation_Instance_Data Evas_Object_Animation_Instance_Data;