summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaehyun Cho <jae_hyun.cho@samsung.com>2017-09-12 17:49:40 +0900
committerJaehyun Cho <jae_hyun.cho@samsung.com>2017-09-18 20:49:36 +0900
commitbe0b5edf79b65abaa9ec58ee4414f2064436dc80 (patch)
tree9dc960f624ab66b23138eb62ba1eba88596d0a58
parentcf58e61e4d1468d0171e42635a4054d4b25db56d (diff)
downloadefl-be0b5edf79b65abaa9ec58ee4414f2064436dc80.tar.gz
ecore: Add Efl.Interpolator class
Efl.Interpolator class is to interpolate a value. Efl.Interpolator class has the following interpolation function classes as its subclasses. Efl.Interpolator.Linear Efl.Interpolator.Accelerate Efl.Interpolator.Decelerate Efl.Interpolator.Sinusoidal Efl.Interpolator.Divisor Efl.Interpolator.Bounce Efl.Interpolator.Spring Efl.Interpolator.Cubic_Bezier
-rw-r--r--src/Makefile_Ecore.am20
-rw-r--r--src/lib/ecore/CMakeLists.txt9
-rw-r--r--src/lib/ecore/Ecore_Eo.h10
-rw-r--r--src/lib/ecore/efl_interpolator.c24
-rw-r--r--src/lib/ecore/efl_interpolator.eo14
-rw-r--r--src/lib/ecore/efl_interpolator_accelerate.c55
-rw-r--r--src/lib/ecore/efl_interpolator_accelerate.eo23
-rw-r--r--src/lib/ecore/efl_interpolator_bounce.c62
-rw-r--r--src/lib/ecore/efl_interpolator_bounce.eo21
-rw-r--r--src/lib/ecore/efl_interpolator_cubic_bezier.c74
-rw-r--r--src/lib/ecore/efl_interpolator_cubic_bezier.eo23
-rw-r--r--src/lib/ecore/efl_interpolator_decelerate.c55
-rw-r--r--src/lib/ecore/efl_interpolator_decelerate.eo23
-rw-r--r--src/lib/ecore/efl_interpolator_divisor.c62
-rw-r--r--src/lib/ecore/efl_interpolator_divisor.eo21
-rw-r--r--src/lib/ecore/efl_interpolator_linear.c27
-rw-r--r--src/lib/ecore/efl_interpolator_linear.eo8
-rw-r--r--src/lib/ecore/efl_interpolator_sinusoidal.c55
-rw-r--r--src/lib/ecore/efl_interpolator_sinusoidal.eo23
-rw-r--r--src/lib/ecore/efl_interpolator_spring.c62
-rw-r--r--src/lib/ecore/efl_interpolator_spring.eo21
21 files changed, 691 insertions, 1 deletions
diff --git a/src/Makefile_Ecore.am b/src/Makefile_Ecore.am
index 47db250567..1a06496ac6 100644
--- a/src/Makefile_Ecore.am
+++ b/src/Makefile_Ecore.am
@@ -19,7 +19,16 @@ ecore_eolian_files_public = \
lib/ecore/efl_io_stderr.eo \
lib/ecore/efl_io_file.eo \
lib/ecore/efl_io_copier.eo \
- lib/ecore/efl_io_buffered_stream.eo
+ lib/ecore/efl_io_buffered_stream.eo \
+ lib/ecore/efl_interpolator.eo \
+ lib/ecore/efl_interpolator_linear.eo \
+ lib/ecore/efl_interpolator_accelerate.eo \
+ lib/ecore/efl_interpolator_decelerate.eo \
+ lib/ecore/efl_interpolator_sinusoidal.eo \
+ lib/ecore/efl_interpolator_divisor.eo \
+ lib/ecore/efl_interpolator_bounce.eo \
+ lib/ecore/efl_interpolator_spring.eo \
+ lib/ecore/efl_interpolator_cubic_bezier.eo
ecore_eolian_files = \
@@ -95,6 +104,15 @@ lib/ecore/efl_model_composite_boolean.c \
lib/ecore/efl_model_composite_selection.c \
lib/ecore/efl_model_accessor_view.c \
lib/ecore/efl_model_accessor_view_private.h \
+lib/ecore/efl_interpolator.c \
+lib/ecore/efl_interpolator_linear.c \
+lib/ecore/efl_interpolator_accelerate.c \
+lib/ecore/efl_interpolator_decelerate.c \
+lib/ecore/efl_interpolator_sinusoidal.c \
+lib/ecore/efl_interpolator_divisor.c \
+lib/ecore/efl_interpolator_bounce.c \
+lib/ecore/efl_interpolator_spring.c \
+lib/ecore/efl_interpolator_cubic_bezier.c \
lib/ecore/ecore_pipe.c \
lib/ecore/ecore_poller.c \
lib/ecore/ecore_time.c \
diff --git a/src/lib/ecore/CMakeLists.txt b/src/lib/ecore/CMakeLists.txt
index 0425ce9833..01a05a8aa8 100644
--- a/src/lib/ecore/CMakeLists.txt
+++ b/src/lib/ecore/CMakeLists.txt
@@ -38,6 +38,15 @@ set(PUBLIC_EO_FILES
efl_loop_timer.eo
efl_loop_user.eo
efl_promise.eo
+ efl_interpolator.eo
+ efl_interpolator_linear.eo
+ efl_interpolator_accelerate.eo
+ efl_interpolator_decelerate.eo
+ efl_interpolator_sinusoidal.eo
+ efl_interpolator_divisor.eo
+ efl_interpolator_bounce.eo
+ efl_interpolator_spring.eo
+ efl_interpolator_cubic_bezier.eo
)
set(PUBLIC_HEADERS
diff --git a/src/lib/ecore/Ecore_Eo.h b/src/lib/ecore/Ecore_Eo.h
index aadd2ba136..4adfa59ef1 100644
--- a/src/lib/ecore/Ecore_Eo.h
+++ b/src/lib/ecore/Ecore_Eo.h
@@ -44,6 +44,16 @@ extern "C" {
#include "efl_promise.eo.h"
+#include "efl_interpolator.eo.h"
+#include "efl_interpolator_linear.eo.h"
+#include "efl_interpolator_accelerate.eo.h"
+#include "efl_interpolator_decelerate.eo.h"
+#include "efl_interpolator_sinusoidal.eo.h"
+#include "efl_interpolator_divisor.eo.h"
+#include "efl_interpolator_bounce.eo.h"
+#include "efl_interpolator_spring.eo.h"
+#include "efl_interpolator_cubic_bezier.eo.h"
+
/* We ue the factory pattern here, so you shouldn't call eo_add directly. */
EAPI Eo *ecore_main_loop_get(void);
diff --git a/src/lib/ecore/efl_interpolator.c b/src/lib/ecore/efl_interpolator.c
new file mode 100644
index 0000000000..573d5c5cf9
--- /dev/null
+++ b/src/lib/ecore/efl_interpolator.c
@@ -0,0 +1,24 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "Ecore.h"
+#include "ecore_private.h"
+
+#define MY_CLASS EFL_INTERPOLATOR_CLASS
+
+typedef struct _Efl_Interpolator_Data Efl_Interpolator_Data;
+
+struct _Efl_Interpolator_Data
+{
+};
+
+EOLIAN static double
+_efl_interpolator_interpolate(Eo *eo_obj EINA_UNUSED,
+ Efl_Interpolator_Data *pd EINA_UNUSED,
+ double progress)
+{
+ return progress;
+}
+
+#include "efl_interpolator.eo.c"
diff --git a/src/lib/ecore/efl_interpolator.eo b/src/lib/ecore/efl_interpolator.eo
new file mode 100644
index 0000000000..f24c601300
--- /dev/null
+++ b/src/lib/ecore/efl_interpolator.eo
@@ -0,0 +1,14 @@
+class Efl.Interpolator (Efl.Object)
+{
+ [[Efl interpolator class]]
+ data: Efl_Interpolator_Data;
+ methods {
+ interpolate {
+ [[Interpolate the given value.]]
+ return: double; [[Output value calculated by interpolating the input value.]]
+ params {
+ @in progress: double; [[Input value mapped from 0.0 to 1.0.]]
+ }
+ }
+ }
+}
diff --git a/src/lib/ecore/efl_interpolator_accelerate.c b/src/lib/ecore/efl_interpolator_accelerate.c
new file mode 100644
index 0000000000..fe26a5ab09
--- /dev/null
+++ b/src/lib/ecore/efl_interpolator_accelerate.c
@@ -0,0 +1,55 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "Ecore.h"
+#include "ecore_private.h"
+
+#define MY_CLASS EFL_INTERPOLATOR_ACCELERATE_CLASS
+
+typedef struct _Efl_Interpolator_Accelerate_Data Efl_Interpolator_Accelerate_Data;
+
+struct _Efl_Interpolator_Accelerate_Data
+{
+ double factor;
+};
+
+EOLIAN static double
+_efl_interpolator_accelerate_efl_interpolator_interpolate(Eo *eo_obj EINA_UNUSED,
+ Efl_Interpolator_Accelerate_Data *pd EINA_UNUSED,
+ double progress)
+{
+ if ((progress < 0.0) || (progress > 1.0))
+ return progress;
+
+ return ecore_animator_pos_map(progress, ECORE_POS_MAP_ACCELERATE_FACTOR,
+ pd->factor, 0);
+}
+
+EOLIAN static void
+_efl_interpolator_accelerate_factor_set(Eo *eo_obj EINA_UNUSED,
+ Efl_Interpolator_Accelerate_Data *pd,
+ double factor)
+{
+ pd->factor = factor;
+}
+
+EOLIAN static double
+_efl_interpolator_accelerate_factor_get(Eo *eo_obj EINA_UNUSED,
+ Efl_Interpolator_Accelerate_Data *pd EINA_UNUSED)
+{
+ return pd->factor;
+}
+
+EOLIAN static Efl_Object *
+_efl_interpolator_accelerate_efl_object_constructor(Eo *eo_obj,
+ Efl_Interpolator_Accelerate_Data *pd)
+{
+ eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS));
+
+ pd->factor = 1.0;
+
+ return eo_obj;
+}
+
+#include "efl_interpolator_accelerate.eo.c"
diff --git a/src/lib/ecore/efl_interpolator_accelerate.eo b/src/lib/ecore/efl_interpolator_accelerate.eo
new file mode 100644
index 0000000000..a83869eda7
--- /dev/null
+++ b/src/lib/ecore/efl_interpolator_accelerate.eo
@@ -0,0 +1,23 @@
+class Efl.Interpolator.Accelerate (Efl.Interpolator)
+{
+ [[Efl accelerate interpolator class
+
+ output = 1 - sin(Pi / 2 + input * Pi / 2);
+ ]]
+ data: Efl_Interpolator_Accelerate_Data;
+ methods {
+ @property factor {
+ set {
+ }
+ get {
+ }
+ values {
+ factor: double; [[Factor of the interpolation function.]]
+ }
+ }
+ }
+ implements {
+ Efl.Object.constructor;
+ Efl.Interpolator.interpolate;
+ }
+}
diff --git a/src/lib/ecore/efl_interpolator_bounce.c b/src/lib/ecore/efl_interpolator_bounce.c
new file mode 100644
index 0000000000..ac0cf227ae
--- /dev/null
+++ b/src/lib/ecore/efl_interpolator_bounce.c
@@ -0,0 +1,62 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "Ecore.h"
+#include "ecore_private.h"
+
+#define MY_CLASS EFL_INTERPOLATOR_BOUNCE_CLASS
+
+typedef struct _Efl_Interpolator_Bounce_Data Efl_Interpolator_Bounce_Data;
+
+struct _Efl_Interpolator_Bounce_Data
+{
+ double factor[2];
+};
+
+EOLIAN static double
+_efl_interpolator_bounce_efl_interpolator_interpolate(Eo *eo_obj EINA_UNUSED,
+ Efl_Interpolator_Bounce_Data *pd EINA_UNUSED,
+ double progress)
+{
+ if ((progress < 0.0) || (progress > 1.0))
+ return progress;
+
+ return ecore_animator_pos_map(progress, ECORE_POS_MAP_BOUNCE,
+ pd->factor[0], pd->factor[1]);
+}
+
+EOLIAN static void
+_efl_interpolator_bounce_factors_set(Eo *eo_obj EINA_UNUSED,
+ Efl_Interpolator_Bounce_Data *pd,
+ double factor1, double factor2)
+{
+ pd->factor[0] = factor1;
+ pd->factor[1] = factor2;
+}
+
+EOLIAN static void
+_efl_interpolator_bounce_factors_get(Eo *eo_obj EINA_UNUSED,
+ Efl_Interpolator_Bounce_Data *pd,
+ double *factor1, double *factor2)
+{
+ if (factor1)
+ *factor1 = pd->factor[0];
+
+ if (factor2)
+ *factor2 = pd->factor[1];
+}
+
+EOLIAN static Efl_Object *
+_efl_interpolator_bounce_efl_object_constructor(Eo *eo_obj,
+ Efl_Interpolator_Bounce_Data *pd)
+{
+ eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS));
+
+ pd->factor[0] = 1.0;
+ pd->factor[1] = 1.0;
+
+ return eo_obj;
+}
+
+#include "efl_interpolator_bounce.eo.c"
diff --git a/src/lib/ecore/efl_interpolator_bounce.eo b/src/lib/ecore/efl_interpolator_bounce.eo
new file mode 100644
index 0000000000..f3d9ae152b
--- /dev/null
+++ b/src/lib/ecore/efl_interpolator_bounce.eo
@@ -0,0 +1,21 @@
+class Efl.Interpolator.Bounce (Efl.Interpolator)
+{
+ [[Efl bounce interpolator class]]
+ data: Efl_Interpolator_Bounce_Data;
+ methods {
+ @property factors {
+ set {
+ }
+ get {
+ }
+ values {
+ factor1: double; [[First factor of the interpolation function.]]
+ factor2: double; [[Second factor of the interpolation function.]]
+ }
+ }
+ }
+ implements {
+ Efl.Object.constructor;
+ Efl.Interpolator.interpolate;
+ }
+}
diff --git a/src/lib/ecore/efl_interpolator_cubic_bezier.c b/src/lib/ecore/efl_interpolator_cubic_bezier.c
new file mode 100644
index 0000000000..a673c673ab
--- /dev/null
+++ b/src/lib/ecore/efl_interpolator_cubic_bezier.c
@@ -0,0 +1,74 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "Ecore.h"
+#include "ecore_private.h"
+
+#define MY_CLASS EFL_INTERPOLATOR_CUBIC_BEZIER_CLASS
+
+typedef struct _Efl_Interpolator_Cubic_Bezier_Data Efl_Interpolator_Cubic_Bezier_Data;
+
+struct _Efl_Interpolator_Cubic_Bezier_Data
+{
+ double factor[4];
+};
+
+EOLIAN static double
+_efl_interpolator_cubic_bezier_efl_interpolator_interpolate(Eo *eo_obj EINA_UNUSED,
+ Efl_Interpolator_Cubic_Bezier_Data *pd EINA_UNUSED,
+ double progress)
+{
+ if ((progress < 0.0) || (progress > 1.0))
+ return progress;
+
+ return ecore_animator_pos_map_n(progress, ECORE_POS_MAP_CUBIC_BEZIER, 4,
+ pd->factor);
+}
+
+EOLIAN static void
+_efl_interpolator_cubic_bezier_factors_set(Eo *eo_obj EINA_UNUSED,
+ Efl_Interpolator_Cubic_Bezier_Data *pd,
+ double factor1, double factor2,
+ double factor3, double factor4)
+{
+ pd->factor[0] = factor1;
+ pd->factor[1] = factor2;
+ pd->factor[2] = factor3;
+ pd->factor[3] = factor4;
+}
+
+EOLIAN static void
+_efl_interpolator_cubic_bezier_factors_get(Eo *eo_obj EINA_UNUSED,
+ Efl_Interpolator_Cubic_Bezier_Data *pd,
+ double *factor1, double *factor2,
+ double *factor3, double *factor4)
+{
+ if (factor1)
+ *factor1 = pd->factor[0];
+
+ if (factor2)
+ *factor2 = pd->factor[1];
+
+ if (factor3)
+ *factor3 = pd->factor[2];
+
+ if (factor4)
+ *factor4 = pd->factor[3];
+}
+
+EOLIAN static Efl_Object *
+_efl_interpolator_cubic_bezier_efl_object_constructor(Eo *eo_obj,
+ Efl_Interpolator_Cubic_Bezier_Data *pd)
+{
+ eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS));
+
+ pd->factor[0] = 1.0;
+ pd->factor[1] = 1.0;
+ pd->factor[2] = 1.0;
+ pd->factor[3] = 1.0;
+
+ return eo_obj;
+}
+
+#include "efl_interpolator_cubic_bezier.eo.c"
diff --git a/src/lib/ecore/efl_interpolator_cubic_bezier.eo b/src/lib/ecore/efl_interpolator_cubic_bezier.eo
new file mode 100644
index 0000000000..4f1459046b
--- /dev/null
+++ b/src/lib/ecore/efl_interpolator_cubic_bezier.eo
@@ -0,0 +1,23 @@
+class Efl.Interpolator.Cubic_Bezier (Efl.Interpolator)
+{
+ [[Efl cubic_bezier interpolator class]]
+ data: Efl_Interpolator_Cubic_Bezier_Data;
+ methods {
+ @property factors {
+ set {
+ }
+ get {
+ }
+ values {
+ factor1: double; [[First factor of the interpolation function.]]
+ factor2: double; [[Second factor of the interpolation function.]]
+ factor3: double; [[Third factor of the interpolation function.]]
+ factor4: double; [[Fourth factor of the interpolation function.]]
+ }
+ }
+ }
+ implements {
+ Efl.Object.constructor;
+ Efl.Interpolator.interpolate;
+ }
+}
diff --git a/src/lib/ecore/efl_interpolator_decelerate.c b/src/lib/ecore/efl_interpolator_decelerate.c
new file mode 100644
index 0000000000..888ce65e54
--- /dev/null
+++ b/src/lib/ecore/efl_interpolator_decelerate.c
@@ -0,0 +1,55 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "Ecore.h"
+#include "ecore_private.h"
+
+#define MY_CLASS EFL_INTERPOLATOR_DECELERATE_CLASS
+
+typedef struct _Efl_Interpolator_Decelerate_Data Efl_Interpolator_Decelerate_Data;
+
+struct _Efl_Interpolator_Decelerate_Data
+{
+ double factor;
+};
+
+EOLIAN static double
+_efl_interpolator_decelerate_efl_interpolator_interpolate(Eo *eo_obj EINA_UNUSED,
+ Efl_Interpolator_Decelerate_Data *pd EINA_UNUSED,
+ double progress)
+{
+ if ((progress < 0.0) || (progress > 1.0))
+ return progress;
+
+ return ecore_animator_pos_map(progress, ECORE_POS_MAP_DECELERATE_FACTOR,
+ pd->factor, 0);
+}
+
+EOLIAN static void
+_efl_interpolator_decelerate_factor_set(Eo *eo_obj EINA_UNUSED,
+ Efl_Interpolator_Decelerate_Data *pd,
+ double factor)
+{
+ pd->factor = factor;
+}
+
+EOLIAN static double
+_efl_interpolator_decelerate_factor_get(Eo *eo_obj EINA_UNUSED,
+ Efl_Interpolator_Decelerate_Data *pd EINA_UNUSED)
+{
+ return pd->factor;
+}
+
+EOLIAN static Efl_Object *
+_efl_interpolator_decelerate_efl_object_constructor(Eo *eo_obj,
+ Efl_Interpolator_Decelerate_Data *pd)
+{
+ eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS));
+
+ pd->factor = 1.0;
+
+ return eo_obj;
+}
+
+#include "efl_interpolator_decelerate.eo.c"
diff --git a/src/lib/ecore/efl_interpolator_decelerate.eo b/src/lib/ecore/efl_interpolator_decelerate.eo
new file mode 100644
index 0000000000..9682c42084
--- /dev/null
+++ b/src/lib/ecore/efl_interpolator_decelerate.eo
@@ -0,0 +1,23 @@
+class Efl.Interpolator.Decelerate (Efl.Interpolator)
+{
+ [[Efl decelerate interpolator class
+
+ output = sin(input * Pi / 2);
+ ]]
+ data: Efl_Interpolator_Decelerate_Data;
+ methods {
+ @property factor {
+ set {
+ }
+ get {
+ }
+ values {
+ factor: double; [[Factor of the interpolation function.]]
+ }
+ }
+ }
+ implements {
+ Efl.Object.constructor;
+ Efl.Interpolator.interpolate;
+ }
+}
diff --git a/src/lib/ecore/efl_interpolator_divisor.c b/src/lib/ecore/efl_interpolator_divisor.c
new file mode 100644
index 0000000000..e30d052038
--- /dev/null
+++ b/src/lib/ecore/efl_interpolator_divisor.c
@@ -0,0 +1,62 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "Ecore.h"
+#include "ecore_private.h"
+
+#define MY_CLASS EFL_INTERPOLATOR_DIVISOR_CLASS
+
+typedef struct _Efl_Interpolator_Divisor_Data Efl_Interpolator_Divisor_Data;
+
+struct _Efl_Interpolator_Divisor_Data
+{
+ double factor[2];
+};
+
+EOLIAN static double
+_efl_interpolator_divisor_efl_interpolator_interpolate(Eo *eo_obj EINA_UNUSED,
+ Efl_Interpolator_Divisor_Data *pd EINA_UNUSED,
+ double progress)
+{
+ if ((progress < 0.0) || (progress > 1.0))
+ return progress;
+
+ return ecore_animator_pos_map(progress, ECORE_POS_MAP_DIVISOR_INTERP,
+ pd->factor[0], pd->factor[1]);
+}
+
+EOLIAN static void
+_efl_interpolator_divisor_factors_set(Eo *eo_obj EINA_UNUSED,
+ Efl_Interpolator_Divisor_Data *pd,
+ double factor1, double factor2)
+{
+ pd->factor[0] = factor1;
+ pd->factor[1] = factor2;
+}
+
+EOLIAN static void
+_efl_interpolator_divisor_factors_get(Eo *eo_obj EINA_UNUSED,
+ Efl_Interpolator_Divisor_Data *pd,
+ double *factor1, double *factor2)
+{
+ if (factor1)
+ *factor1 = pd->factor[0];
+
+ if (factor2)
+ *factor2 = pd->factor[1];
+}
+
+EOLIAN static Efl_Object *
+_efl_interpolator_divisor_efl_object_constructor(Eo *eo_obj,
+ Efl_Interpolator_Divisor_Data *pd)
+{
+ eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS));
+
+ pd->factor[0] = 1.0;
+ pd->factor[1] = 1.0;
+
+ return eo_obj;
+}
+
+#include "efl_interpolator_divisor.eo.c"
diff --git a/src/lib/ecore/efl_interpolator_divisor.eo b/src/lib/ecore/efl_interpolator_divisor.eo
new file mode 100644
index 0000000000..4733f99e75
--- /dev/null
+++ b/src/lib/ecore/efl_interpolator_divisor.eo
@@ -0,0 +1,21 @@
+class Efl.Interpolator.Divisor (Efl.Interpolator)
+{
+ [[Efl divisor interpolator class]]
+ data: Efl_Interpolator_Divisor_Data;
+ methods {
+ @property factors {
+ set {
+ }
+ get {
+ }
+ values {
+ factor1: double; [[First factor of the interpolation function.]]
+ factor2: double; [[Second factor of the interpolation function.]]
+ }
+ }
+ }
+ implements {
+ Efl.Object.constructor;
+ Efl.Interpolator.interpolate;
+ }
+}
diff --git a/src/lib/ecore/efl_interpolator_linear.c b/src/lib/ecore/efl_interpolator_linear.c
new file mode 100644
index 0000000000..3180e965ce
--- /dev/null
+++ b/src/lib/ecore/efl_interpolator_linear.c
@@ -0,0 +1,27 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "Ecore.h"
+#include "ecore_private.h"
+
+#define MY_CLASS EFL_INTERPOLATOR_LINEAR_CLASS
+
+typedef struct _Efl_Interpolator_Linear_Data Efl_Interpolator_Linear_Data;
+
+struct _Efl_Interpolator_Linear_Data
+{
+};
+
+EOLIAN static double
+_efl_interpolator_linear_efl_interpolator_interpolate(Eo *eo_obj EINA_UNUSED,
+ Efl_Interpolator_Linear_Data *pd EINA_UNUSED,
+ double progress)
+{
+ if ((progress < 0.0) || (progress > 1.0))
+ return progress;
+
+ return ecore_animator_pos_map(progress, ECORE_POS_MAP_LINEAR, 0, 0);
+}
+
+#include "efl_interpolator_linear.eo.c"
diff --git a/src/lib/ecore/efl_interpolator_linear.eo b/src/lib/ecore/efl_interpolator_linear.eo
new file mode 100644
index 0000000000..f3eb81ef81
--- /dev/null
+++ b/src/lib/ecore/efl_interpolator_linear.eo
@@ -0,0 +1,8 @@
+class Efl.Interpolator.Linear (Efl.Interpolator)
+{
+ [[Efl linear interpolator class]]
+ data: Efl_Interpolator_Linear_Data;
+ implements {
+ Efl.Interpolator.interpolate;
+ }
+}
diff --git a/src/lib/ecore/efl_interpolator_sinusoidal.c b/src/lib/ecore/efl_interpolator_sinusoidal.c
new file mode 100644
index 0000000000..2de91ed2ad
--- /dev/null
+++ b/src/lib/ecore/efl_interpolator_sinusoidal.c
@@ -0,0 +1,55 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "Ecore.h"
+#include "ecore_private.h"
+
+#define MY_CLASS EFL_INTERPOLATOR_SINUSOIDAL_CLASS
+
+typedef struct _Efl_Interpolator_Sinusoidal_Data Efl_Interpolator_Sinusoidal_Data;
+
+struct _Efl_Interpolator_Sinusoidal_Data
+{
+ double factor;
+};
+
+EOLIAN static double
+_efl_interpolator_sinusoidal_efl_interpolator_interpolate(Eo *eo_obj EINA_UNUSED,
+ Efl_Interpolator_Sinusoidal_Data *pd EINA_UNUSED,
+ double progress)
+{
+ if ((progress < 0.0) || (progress > 1.0))
+ return progress;
+
+ return ecore_animator_pos_map(progress, ECORE_POS_MAP_SINUSOIDAL_FACTOR,
+ pd->factor, 0);
+}
+
+EOLIAN static void
+_efl_interpolator_sinusoidal_factor_set(Eo *eo_obj EINA_UNUSED,
+ Efl_Interpolator_Sinusoidal_Data *pd,
+ double factor)
+{
+ pd->factor = factor;
+}
+
+EOLIAN static double
+_efl_interpolator_sinusoidal_factor_get(Eo *eo_obj EINA_UNUSED,
+ Efl_Interpolator_Sinusoidal_Data *pd EINA_UNUSED)
+{
+ return pd->factor;
+}
+
+EOLIAN static Efl_Object *
+_efl_interpolator_sinusoidal_efl_object_constructor(Eo *eo_obj,
+ Efl_Interpolator_Sinusoidal_Data *pd)
+{
+ eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS));
+
+ pd->factor = 1.0;
+
+ return eo_obj;
+}
+
+#include "efl_interpolator_sinusoidal.eo.c"
diff --git a/src/lib/ecore/efl_interpolator_sinusoidal.eo b/src/lib/ecore/efl_interpolator_sinusoidal.eo
new file mode 100644
index 0000000000..9ac25c7c16
--- /dev/null
+++ b/src/lib/ecore/efl_interpolator_sinusoidal.eo
@@ -0,0 +1,23 @@
+class Efl.Interpolator.Sinusoidal (Efl.Interpolator)
+{
+ [[Efl sinusoidal interpolator class
+
+ output = (1 - cos(input * Pi)) / 2;
+ ]]
+ data: Efl_Interpolator_Sinusoidal_Data;
+ methods {
+ @property factor {
+ set {
+ }
+ get {
+ }
+ values {
+ factor: double; [[Factor of the interpolation function.]]
+ }
+ }
+ }
+ implements {
+ Efl.Object.constructor;
+ Efl.Interpolator.interpolate;
+ }
+}
diff --git a/src/lib/ecore/efl_interpolator_spring.c b/src/lib/ecore/efl_interpolator_spring.c
new file mode 100644
index 0000000000..adfc107375
--- /dev/null
+++ b/src/lib/ecore/efl_interpolator_spring.c
@@ -0,0 +1,62 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "Ecore.h"
+#include "ecore_private.h"
+
+#define MY_CLASS EFL_INTERPOLATOR_SPRING_CLASS
+
+typedef struct _Efl_Interpolator_Spring_Data Efl_Interpolator_Spring_Data;
+
+struct _Efl_Interpolator_Spring_Data
+{
+ double factor[2];
+};
+
+EOLIAN static double
+_efl_interpolator_spring_efl_interpolator_interpolate(Eo *obj EINA_UNUSED,
+ Efl_Interpolator_Spring_Data *pd EINA_UNUSED,
+ double progress)
+{
+ if ((progress < 0.0) || (progress > 1.0))
+ return progress;
+
+ return ecore_animator_pos_map(progress, ECORE_POS_MAP_SPRING,
+ pd->factor[0], pd->factor[1]);
+}
+
+EOLIAN static void
+_efl_interpolator_spring_factors_set(Eo *eo_obj EINA_UNUSED,
+ Efl_Interpolator_Spring_Data *pd,
+ double factor1, double factor2)
+{
+ pd->factor[0] = factor1;
+ pd->factor[1] = factor2;
+}
+
+EOLIAN static void
+_efl_interpolator_spring_factors_get(Eo *eo_obj EINA_UNUSED,
+ Efl_Interpolator_Spring_Data *pd,
+ double *factor1, double *factor2)
+{
+ if (factor1)
+ *factor1 = pd->factor[0];
+
+ if (factor2)
+ *factor2 = pd->factor[1];
+}
+
+EOLIAN static Efl_Object *
+_efl_interpolator_spring_efl_object_constructor(Eo *eo_obj,
+ Efl_Interpolator_Spring_Data *pd)
+{
+ eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS));
+
+ pd->factor[0] = 1.0;
+ pd->factor[1] = 1.0;
+
+ return eo_obj;
+}
+
+#include "efl_interpolator_spring.eo.c"
diff --git a/src/lib/ecore/efl_interpolator_spring.eo b/src/lib/ecore/efl_interpolator_spring.eo
new file mode 100644
index 0000000000..ffcbe9e3f7
--- /dev/null
+++ b/src/lib/ecore/efl_interpolator_spring.eo
@@ -0,0 +1,21 @@
+class Efl.Interpolator.Spring (Efl.Interpolator)
+{
+ [[Efl spring interpolator class]]
+ data: Efl_Interpolator_Spring_Data;
+ methods {
+ @property factors {
+ set {
+ }
+ get {
+ }
+ values {
+ factor1: double; [[First factor of the interpolation function.]]
+ factor2: double; [[Second factor of the interpolation function.]]
+ }
+ }
+ }
+ implements {
+ Efl.Object.constructor;
+ Efl.Interpolator.interpolate;
+ }
+}