From 30503d5006f429bfdb4ce5e65f6249cae30dd263 Mon Sep 17 00:00:00 2001 From: Jaehyun Cho Date: Fri, 23 Nov 2018 21:26:00 +0900 Subject: [PATCH] efl_interpolator: rename subclasses of Efl.Interpolator Subclasses of Efl.Interpolator are renamed intuitively from backward order to forward order. --- src/Makefile_Ecore.am | 32 ++++++------- src/bin/elementary/test_efl_anim_interpolator.c | 26 +++++----- src/lib/ecore/CMakeLists.txt | 16 +++---- src/lib/ecore/Ecore_Eo.h | 16 +++---- src/lib/ecore/efl_accelerate_interpolator.c | 55 ++++++++++++++++++++++ ...ccelerate.eo => efl_accelerate_interpolator.eo} | 4 +- ...rpolator_bounce.c => efl_bounce_interpolator.c} | 24 +++++----- ...olator_bounce.eo => efl_bounce_interpolator.eo} | 4 +- ...ic_bezier.c => efl_cubic_bezier_interpolator.c} | 24 +++++----- ..._bezier.eo => efl_cubic_bezier_interpolator.eo} | 4 +- src/lib/ecore/efl_decelerate_interpolator.c | 55 ++++++++++++++++++++++ ...ecelerate.eo => efl_decelerate_interpolator.eo} | 4 +- ...olator_divisor.c => efl_divisor_interpolator.c} | 24 +++++----- ...ator_divisor.eo => efl_divisor_interpolator.eo} | 4 +- src/lib/ecore/efl_interpolator_accelerate.c | 55 ---------------------- src/lib/ecore/efl_interpolator_decelerate.c | 55 ---------------------- src/lib/ecore/efl_interpolator_linear.c | 27 ----------- src/lib/ecore/efl_interpolator_linear.eo | 8 ---- src/lib/ecore/efl_interpolator_sinusoidal.c | 55 ---------------------- src/lib/ecore/efl_linear_interpolator.c | 27 +++++++++++ src/lib/ecore/efl_linear_interpolator.eo | 8 ++++ src/lib/ecore/efl_sinusoidal_interpolator.c | 55 ++++++++++++++++++++++ ...inusoidal.eo => efl_sinusoidal_interpolator.eo} | 4 +- ...rpolator_spring.c => efl_spring_interpolator.c} | 24 +++++----- ...olator_spring.eo => efl_spring_interpolator.eo} | 4 +- src/lib/ecore/meson.build | 32 ++++++------- 26 files changed, 323 insertions(+), 323 deletions(-) create mode 100644 src/lib/ecore/efl_accelerate_interpolator.c rename src/lib/ecore/{efl_interpolator_accelerate.eo => efl_accelerate_interpolator.eo} (79%) rename src/lib/ecore/{efl_interpolator_bounce.c => efl_bounce_interpolator.c} (55%) rename src/lib/ecore/{efl_interpolator_bounce.eo => efl_bounce_interpolator.eo} (81%) rename src/lib/ecore/{efl_interpolator_cubic_bezier.c => efl_cubic_bezier_interpolator.c} (63%) rename src/lib/ecore/{efl_interpolator_cubic_bezier.eo => efl_cubic_bezier_interpolator.eo} (84%) create mode 100644 src/lib/ecore/efl_decelerate_interpolator.c rename src/lib/ecore/{efl_interpolator_decelerate.eo => efl_decelerate_interpolator.eo} (79%) rename src/lib/ecore/{efl_interpolator_divisor.c => efl_divisor_interpolator.c} (55%) rename src/lib/ecore/{efl_interpolator_divisor.eo => efl_divisor_interpolator.eo} (81%) delete mode 100644 src/lib/ecore/efl_interpolator_accelerate.c delete mode 100644 src/lib/ecore/efl_interpolator_decelerate.c delete mode 100644 src/lib/ecore/efl_interpolator_linear.c delete mode 100644 src/lib/ecore/efl_interpolator_linear.eo delete mode 100644 src/lib/ecore/efl_interpolator_sinusoidal.c create mode 100644 src/lib/ecore/efl_linear_interpolator.c create mode 100644 src/lib/ecore/efl_linear_interpolator.eo create mode 100644 src/lib/ecore/efl_sinusoidal_interpolator.c rename src/lib/ecore/{efl_interpolator_sinusoidal.eo => efl_sinusoidal_interpolator.eo} (79%) rename src/lib/ecore/{efl_interpolator_spring.c => efl_spring_interpolator.c} (55%) rename src/lib/ecore/{efl_interpolator_spring.eo => efl_spring_interpolator.eo} (81%) diff --git a/src/Makefile_Ecore.am b/src/Makefile_Ecore.am index e9d6f5f..3f855a5 100644 --- a/src/Makefile_Ecore.am +++ b/src/Makefile_Ecore.am @@ -33,14 +33,14 @@ ecore_eolian_files_public = \ lib/ecore/efl_io_file.eo \ lib/ecore/efl_io_copier.eo \ lib/ecore/efl_io_buffered_stream.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 \ + lib/ecore/efl_linear_interpolator.eo \ + lib/ecore/efl_accelerate_interpolator.eo \ + lib/ecore/efl_decelerate_interpolator.eo \ + lib/ecore/efl_sinusoidal_interpolator.eo \ + lib/ecore/efl_divisor_interpolator.eo \ + lib/ecore/efl_bounce_interpolator.eo \ + lib/ecore/efl_spring_interpolator.eo \ + lib/ecore/efl_cubic_bezier_interpolator.eo \ lib/ecore/efl_model_item.eo \ lib/ecore/efl_model_container.eo \ lib/ecore/efl_model_container_item.eo \ @@ -126,14 +126,14 @@ 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_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/efl_linear_interpolator.c \ +lib/ecore/efl_accelerate_interpolator.c \ +lib/ecore/efl_decelerate_interpolator.c \ +lib/ecore/efl_sinusoidal_interpolator.c \ +lib/ecore/efl_divisor_interpolator.c \ +lib/ecore/efl_bounce_interpolator.c \ +lib/ecore/efl_spring_interpolator.c \ +lib/ecore/efl_cubic_bezier_interpolator.c \ lib/ecore/efl_task.c \ lib/ecore/efl_exe.c \ lib/ecore/efl_thread.c \ diff --git a/src/bin/elementary/test_efl_anim_interpolator.c b/src/bin/elementary/test_efl_anim_interpolator.c index 66e9004..2eb30f6 100644 --- a/src/bin/elementary/test_efl_anim_interpolator.c +++ b/src/bin/elementary/test_efl_anim_interpolator.c @@ -28,37 +28,37 @@ _interpolator_create(int index, Evas_Object *win) if (index == 0) { - interp = efl_add(EFL_INTERPOLATOR_LINEAR_CLASS, win); + interp = efl_add(EFL_LINEAR_INTERPOLATOR_CLASS, win); } else if (index == 1) { - interp = efl_add(EFL_INTERPOLATOR_SINUSOIDAL_CLASS, win); - efl_interpolator_sinusoidal_factor_set(interp, 1.0); + interp = efl_add(EFL_SINUSOIDAL_INTERPOLATOR_CLASS, win); + efl_sinusoidal_interpolator_factor_set(interp, 1.0); } else if (index == 2) { - interp = efl_add(EFL_INTERPOLATOR_DECELERATE_CLASS, win); - efl_interpolator_decelerate_factor_set(interp, 1.0); + interp = efl_add(EFL_DECELERATE_INTERPOLATOR_CLASS, win); + efl_decelerate_interpolator_factor_set(interp, 1.0); } else if (index == 3) { - interp = efl_add(EFL_INTERPOLATOR_ACCELERATE_CLASS, win); - efl_interpolator_accelerate_factor_set(interp, 1.0); + interp = efl_add(EFL_ACCELERATE_INTERPOLATOR_CLASS, win); + efl_accelerate_interpolator_factor_set(interp, 1.0); } else if (index == 4) { - interp = efl_add(EFL_INTERPOLATOR_DIVISOR_CLASS, win); - efl_interpolator_divisor_factors_set(interp, 1.0, 1.0); + interp = efl_add(EFL_DIVISOR_INTERPOLATOR_CLASS, win); + efl_divisor_interpolator_factors_set(interp, 1.0, 1.0); } else if (index == 5) { - interp = efl_add(EFL_INTERPOLATOR_BOUNCE_CLASS, win); - efl_interpolator_bounce_factors_set(interp, 1.0, 1.0); + interp = efl_add(EFL_BOUNCE_INTERPOLATOR_CLASS, win); + efl_bounce_interpolator_factors_set(interp, 1.0, 1.0); } else if (index == 6) { - interp = efl_add(EFL_INTERPOLATOR_SPRING_CLASS, win); - efl_interpolator_spring_factors_set(interp, 1.0, 1.0); + interp = efl_add(EFL_SPRING_INTERPOLATOR_CLASS, win); + efl_spring_interpolator_factors_set(interp, 1.0, 1.0); } return interp; diff --git a/src/lib/ecore/CMakeLists.txt b/src/lib/ecore/CMakeLists.txt index c52c5f4..1c2a6ac 100644 --- a/src/lib/ecore/CMakeLists.txt +++ b/src/lib/ecore/CMakeLists.txt @@ -38,14 +38,14 @@ set(PUBLIC_EO_FILES efl_loop_timer.eo efl_loop_user.eo efl_promise.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 + efl_linear_interpolator.eo + efl_accelerate_interpolator.eo + efl_decelerate_interpolator.eo + efl_sinusoidal_interpolator.eo + efl_divisor_interpolator.eo + efl_bounce_interpolator.eo + efl_spring_interpolator.eo + efl_cubic_bezier_interpolator.eo ) set(PUBLIC_HEADERS diff --git a/src/lib/ecore/Ecore_Eo.h b/src/lib/ecore/Ecore_Eo.h index 9550c2e..3310ee7 100644 --- a/src/lib/ecore/Ecore_Eo.h +++ b/src/lib/ecore/Ecore_Eo.h @@ -82,14 +82,14 @@ EAPI Eina_Promise *efl_loop_promise_new(const Eo *obj, Eina_Promise_Cancel_Cb ca #include "efl_loop_fd.eo.h" #include "efl_loop_handler.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" +#include "efl_linear_interpolator.eo.h" +#include "efl_accelerate_interpolator.eo.h" +#include "efl_decelerate_interpolator.eo.h" +#include "efl_sinusoidal_interpolator.eo.h" +#include "efl_divisor_interpolator.eo.h" +#include "efl_bounce_interpolator.eo.h" +#include "efl_spring_interpolator.eo.h" +#include "efl_cubic_bezier_interpolator.eo.h" /* We ue the factory pattern here, so you shouldn't call eo_add directly. */ EAPI Eo *efl_main_loop_get(void); diff --git a/src/lib/ecore/efl_accelerate_interpolator.c b/src/lib/ecore/efl_accelerate_interpolator.c new file mode 100644 index 0000000..917c032 --- /dev/null +++ b/src/lib/ecore/efl_accelerate_interpolator.c @@ -0,0 +1,55 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "Ecore.h" +#include "ecore_private.h" + +#define MY_CLASS EFL_ACCELERATE_INTERPOLATOR_CLASS + +typedef struct _Efl_Accelerate_Interpolator_Data Efl_Accelerate_Interpolator_Data; + +struct _Efl_Accelerate_Interpolator_Data +{ + double factor; +}; + +EOLIAN static double +_efl_accelerate_interpolator_efl_interpolator_interpolate(Eo *eo_obj EINA_UNUSED, + Efl_Accelerate_Interpolator_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_accelerate_interpolator_factor_set(Eo *eo_obj EINA_UNUSED, + Efl_Accelerate_Interpolator_Data *pd, + double factor) +{ + pd->factor = factor; +} + +EOLIAN static double +_efl_accelerate_interpolator_factor_get(const Eo *eo_obj EINA_UNUSED, + Efl_Accelerate_Interpolator_Data *pd EINA_UNUSED) +{ + return pd->factor; +} + +EOLIAN static Efl_Object * +_efl_accelerate_interpolator_efl_object_constructor(Eo *eo_obj, + Efl_Accelerate_Interpolator_Data *pd) +{ + eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS)); + + pd->factor = 1.0; + + return eo_obj; +} + +#include "efl_accelerate_interpolator.eo.c" diff --git a/src/lib/ecore/efl_interpolator_accelerate.eo b/src/lib/ecore/efl_accelerate_interpolator.eo similarity index 79% rename from src/lib/ecore/efl_interpolator_accelerate.eo rename to src/lib/ecore/efl_accelerate_interpolator.eo index 3f2ef94..3c94735 100644 --- a/src/lib/ecore/efl_interpolator_accelerate.eo +++ b/src/lib/ecore/efl_accelerate_interpolator.eo @@ -1,10 +1,10 @@ -class Efl.Interpolator_Accelerate (Efl.Object, Efl.Interpolator) +class Efl.Accelerate_Interpolator (Efl.Object, Efl.Interpolator) { [[Efl accelerate interpolator class output = 1 - sin(Pi / 2 + input * Pi / 2); ]] - data: Efl_Interpolator_Accelerate_Data; + data: Efl_Accelerate_Interpolator_Data; methods { @property factor { [[Factor property]] diff --git a/src/lib/ecore/efl_interpolator_bounce.c b/src/lib/ecore/efl_bounce_interpolator.c similarity index 55% rename from src/lib/ecore/efl_interpolator_bounce.c rename to src/lib/ecore/efl_bounce_interpolator.c index e6dd96d..7565019 100644 --- a/src/lib/ecore/efl_interpolator_bounce.c +++ b/src/lib/ecore/efl_bounce_interpolator.c @@ -5,18 +5,18 @@ #include "Ecore.h" #include "ecore_private.h" -#define MY_CLASS EFL_INTERPOLATOR_BOUNCE_CLASS +#define MY_CLASS EFL_BOUNCE_INTERPOLATOR_CLASS -typedef struct _Efl_Interpolator_Bounce_Data Efl_Interpolator_Bounce_Data; +typedef struct _Efl_Bounce_Interpolator_Data Efl_Bounce_Interpolator_Data; -struct _Efl_Interpolator_Bounce_Data +struct _Efl_Bounce_Interpolator_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, +_efl_bounce_interpolator_efl_interpolator_interpolate(Eo *eo_obj EINA_UNUSED, + Efl_Bounce_Interpolator_Data *pd EINA_UNUSED, double progress) { if ((progress < 0.0) || (progress > 1.0)) @@ -27,8 +27,8 @@ _efl_interpolator_bounce_efl_interpolator_interpolate(Eo *eo_obj EINA_UNUSED, } EOLIAN static void -_efl_interpolator_bounce_factors_set(Eo *eo_obj EINA_UNUSED, - Efl_Interpolator_Bounce_Data *pd, +_efl_bounce_interpolator_factors_set(Eo *eo_obj EINA_UNUSED, + Efl_Bounce_Interpolator_Data *pd, double factor1, double factor2) { pd->factor[0] = factor1; @@ -36,8 +36,8 @@ _efl_interpolator_bounce_factors_set(Eo *eo_obj EINA_UNUSED, } EOLIAN static void -_efl_interpolator_bounce_factors_get(const Eo *eo_obj EINA_UNUSED, - Efl_Interpolator_Bounce_Data *pd, +_efl_bounce_interpolator_factors_get(const Eo *eo_obj EINA_UNUSED, + Efl_Bounce_Interpolator_Data *pd, double *factor1, double *factor2) { if (factor1) @@ -48,8 +48,8 @@ _efl_interpolator_bounce_factors_get(const Eo *eo_obj EINA_UNUSED, } EOLIAN static Efl_Object * -_efl_interpolator_bounce_efl_object_constructor(Eo *eo_obj, - Efl_Interpolator_Bounce_Data *pd) +_efl_bounce_interpolator_efl_object_constructor(Eo *eo_obj, + Efl_Bounce_Interpolator_Data *pd) { eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS)); @@ -59,4 +59,4 @@ _efl_interpolator_bounce_efl_object_constructor(Eo *eo_obj, return eo_obj; } -#include "efl_interpolator_bounce.eo.c" +#include "efl_bounce_interpolator.eo.c" diff --git a/src/lib/ecore/efl_interpolator_bounce.eo b/src/lib/ecore/efl_bounce_interpolator.eo similarity index 81% rename from src/lib/ecore/efl_interpolator_bounce.eo rename to src/lib/ecore/efl_bounce_interpolator.eo index cd77b8b..eaa5512 100644 --- a/src/lib/ecore/efl_interpolator_bounce.eo +++ b/src/lib/ecore/efl_bounce_interpolator.eo @@ -1,7 +1,7 @@ -class Efl.Interpolator_Bounce (Efl.Object, Efl.Interpolator) +class Efl.Bounce_Interpolator (Efl.Object, Efl.Interpolator) { [[Efl bounce interpolator class]] - data: Efl_Interpolator_Bounce_Data; + data: Efl_Bounce_Interpolator_Data; methods { @property factors { [[Factors property]] diff --git a/src/lib/ecore/efl_interpolator_cubic_bezier.c b/src/lib/ecore/efl_cubic_bezier_interpolator.c similarity index 63% rename from src/lib/ecore/efl_interpolator_cubic_bezier.c rename to src/lib/ecore/efl_cubic_bezier_interpolator.c index f78322c..8b9b376 100644 --- a/src/lib/ecore/efl_interpolator_cubic_bezier.c +++ b/src/lib/ecore/efl_cubic_bezier_interpolator.c @@ -5,18 +5,18 @@ #include "Ecore.h" #include "ecore_private.h" -#define MY_CLASS EFL_INTERPOLATOR_CUBIC_BEZIER_CLASS +#define MY_CLASS EFL_CUBIC_BEZIER_INTERPOLATOR_CLASS -typedef struct _Efl_Interpolator_Cubic_Bezier_Data Efl_Interpolator_Cubic_Bezier_Data; +typedef struct _Efl_Cubic_Bezier_Interpolator_Data Efl_Cubic_Bezier_Interpolator_Data; -struct _Efl_Interpolator_Cubic_Bezier_Data +struct _Efl_Cubic_Bezier_Interpolator_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, +_efl_cubic_bezier_interpolator_efl_interpolator_interpolate(Eo *eo_obj EINA_UNUSED, + Efl_Cubic_Bezier_Interpolator_Data *pd EINA_UNUSED, double progress) { if ((progress < 0.0) || (progress > 1.0)) @@ -27,8 +27,8 @@ _efl_interpolator_cubic_bezier_efl_interpolator_interpolate(Eo *eo_obj EINA_UNUS } EOLIAN static void -_efl_interpolator_cubic_bezier_factors_set(Eo *eo_obj EINA_UNUSED, - Efl_Interpolator_Cubic_Bezier_Data *pd, +_efl_cubic_bezier_interpolator_factors_set(Eo *eo_obj EINA_UNUSED, + Efl_Cubic_Bezier_Interpolator_Data *pd, double factor1, double factor2, double factor3, double factor4) { @@ -39,8 +39,8 @@ _efl_interpolator_cubic_bezier_factors_set(Eo *eo_obj EINA_UNUSED, } EOLIAN static void -_efl_interpolator_cubic_bezier_factors_get(const Eo *eo_obj EINA_UNUSED, - Efl_Interpolator_Cubic_Bezier_Data *pd, +_efl_cubic_bezier_interpolator_factors_get(const Eo *eo_obj EINA_UNUSED, + Efl_Cubic_Bezier_Interpolator_Data *pd, double *factor1, double *factor2, double *factor3, double *factor4) { @@ -58,8 +58,8 @@ _efl_interpolator_cubic_bezier_factors_get(const Eo *eo_obj EINA_UNUSED, } EOLIAN static Efl_Object * -_efl_interpolator_cubic_bezier_efl_object_constructor(Eo *eo_obj, - Efl_Interpolator_Cubic_Bezier_Data *pd) +_efl_cubic_bezier_interpolator_efl_object_constructor(Eo *eo_obj, + Efl_Cubic_Bezier_Interpolator_Data *pd) { eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS)); @@ -71,4 +71,4 @@ _efl_interpolator_cubic_bezier_efl_object_constructor(Eo *eo_obj, return eo_obj; } -#include "efl_interpolator_cubic_bezier.eo.c" +#include "efl_cubic_bezier_interpolator.eo.c" diff --git a/src/lib/ecore/efl_interpolator_cubic_bezier.eo b/src/lib/ecore/efl_cubic_bezier_interpolator.eo similarity index 84% rename from src/lib/ecore/efl_interpolator_cubic_bezier.eo rename to src/lib/ecore/efl_cubic_bezier_interpolator.eo index 4e3906d..9d910f4 100644 --- a/src/lib/ecore/efl_interpolator_cubic_bezier.eo +++ b/src/lib/ecore/efl_cubic_bezier_interpolator.eo @@ -1,7 +1,7 @@ -class Efl.Interpolator_Cubic_Bezier (Efl.Object, Efl.Interpolator) +class Efl.Cubic_Bezier_Interpolator (Efl.Object, Efl.Interpolator) { [[Efl cubic_bezier interpolator class]] - data: Efl_Interpolator_Cubic_Bezier_Data; + data: Efl_Cubic_Bezier_Interpolator_Data; methods { @property factors { [[Factors property]] diff --git a/src/lib/ecore/efl_decelerate_interpolator.c b/src/lib/ecore/efl_decelerate_interpolator.c new file mode 100644 index 0000000..575ac22 --- /dev/null +++ b/src/lib/ecore/efl_decelerate_interpolator.c @@ -0,0 +1,55 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "Ecore.h" +#include "ecore_private.h" + +#define MY_CLASS EFL_DECELERATE_INTERPOLATOR_CLASS + +typedef struct _Efl_Decelerate_Interpolator_Data Efl_Decelerate_Interpolator_Data; + +struct _Efl_Decelerate_Interpolator_Data +{ + double factor; +}; + +EOLIAN static double +_efl_decelerate_interpolator_efl_interpolator_interpolate(Eo *eo_obj EINA_UNUSED, + Efl_Decelerate_Interpolator_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_decelerate_interpolator_factor_set(Eo *eo_obj EINA_UNUSED, + Efl_Decelerate_Interpolator_Data *pd, + double factor) +{ + pd->factor = factor; +} + +EOLIAN static double +_efl_decelerate_interpolator_factor_get(const Eo *eo_obj EINA_UNUSED, + Efl_Decelerate_Interpolator_Data *pd EINA_UNUSED) +{ + return pd->factor; +} + +EOLIAN static Efl_Object * +_efl_decelerate_interpolator_efl_object_constructor(Eo *eo_obj, + Efl_Decelerate_Interpolator_Data *pd) +{ + eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS)); + + pd->factor = 1.0; + + return eo_obj; +} + +#include "efl_decelerate_interpolator.eo.c" diff --git a/src/lib/ecore/efl_interpolator_decelerate.eo b/src/lib/ecore/efl_decelerate_interpolator.eo similarity index 79% rename from src/lib/ecore/efl_interpolator_decelerate.eo rename to src/lib/ecore/efl_decelerate_interpolator.eo index 25a4d05..1662cff 100644 --- a/src/lib/ecore/efl_interpolator_decelerate.eo +++ b/src/lib/ecore/efl_decelerate_interpolator.eo @@ -1,10 +1,10 @@ -class Efl.Interpolator_Decelerate (Efl.Object, Efl.Interpolator) +class Efl.Decelerate_Interpolator (Efl.Object, Efl.Interpolator) { [[Efl decelerate interpolator class output = sin(input * Pi / 2); ]] - data: Efl_Interpolator_Decelerate_Data; + data: Efl_Decelerate_Interpolator_Data; methods { @property factor { [[Factor property]] diff --git a/src/lib/ecore/efl_interpolator_divisor.c b/src/lib/ecore/efl_divisor_interpolator.c similarity index 55% rename from src/lib/ecore/efl_interpolator_divisor.c rename to src/lib/ecore/efl_divisor_interpolator.c index 2fcd00f..3cbc12b 100644 --- a/src/lib/ecore/efl_interpolator_divisor.c +++ b/src/lib/ecore/efl_divisor_interpolator.c @@ -5,18 +5,18 @@ #include "Ecore.h" #include "ecore_private.h" -#define MY_CLASS EFL_INTERPOLATOR_DIVISOR_CLASS +#define MY_CLASS EFL_DIVISOR_INTERPOLATOR_CLASS -typedef struct _Efl_Interpolator_Divisor_Data Efl_Interpolator_Divisor_Data; +typedef struct _Efl_Divisor_Interpolator_Data Efl_Divisor_Interpolator_Data; -struct _Efl_Interpolator_Divisor_Data +struct _Efl_Divisor_Interpolator_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, +_efl_divisor_interpolator_efl_interpolator_interpolate(Eo *eo_obj EINA_UNUSED, + Efl_Divisor_Interpolator_Data *pd EINA_UNUSED, double progress) { if ((progress < 0.0) || (progress > 1.0)) @@ -27,8 +27,8 @@ _efl_interpolator_divisor_efl_interpolator_interpolate(Eo *eo_obj EINA_UNUSED, } EOLIAN static void -_efl_interpolator_divisor_factors_set(Eo *eo_obj EINA_UNUSED, - Efl_Interpolator_Divisor_Data *pd, +_efl_divisor_interpolator_factors_set(Eo *eo_obj EINA_UNUSED, + Efl_Divisor_Interpolator_Data *pd, double factor1, double factor2) { pd->factor[0] = factor1; @@ -36,8 +36,8 @@ _efl_interpolator_divisor_factors_set(Eo *eo_obj EINA_UNUSED, } EOLIAN static void -_efl_interpolator_divisor_factors_get(const Eo *eo_obj EINA_UNUSED, - Efl_Interpolator_Divisor_Data *pd, +_efl_divisor_interpolator_factors_get(const Eo *eo_obj EINA_UNUSED, + Efl_Divisor_Interpolator_Data *pd, double *factor1, double *factor2) { if (factor1) @@ -48,8 +48,8 @@ _efl_interpolator_divisor_factors_get(const Eo *eo_obj EINA_UNUSED, } EOLIAN static Efl_Object * -_efl_interpolator_divisor_efl_object_constructor(Eo *eo_obj, - Efl_Interpolator_Divisor_Data *pd) +_efl_divisor_interpolator_efl_object_constructor(Eo *eo_obj, + Efl_Divisor_Interpolator_Data *pd) { eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS)); @@ -59,4 +59,4 @@ _efl_interpolator_divisor_efl_object_constructor(Eo *eo_obj, return eo_obj; } -#include "efl_interpolator_divisor.eo.c" +#include "efl_divisor_interpolator.eo.c" diff --git a/src/lib/ecore/efl_interpolator_divisor.eo b/src/lib/ecore/efl_divisor_interpolator.eo similarity index 81% rename from src/lib/ecore/efl_interpolator_divisor.eo rename to src/lib/ecore/efl_divisor_interpolator.eo index d9a1cef..487f8f2 100644 --- a/src/lib/ecore/efl_interpolator_divisor.eo +++ b/src/lib/ecore/efl_divisor_interpolator.eo @@ -1,7 +1,7 @@ -class Efl.Interpolator_Divisor (Efl.Object, Efl.Interpolator) +class Efl.Divisor_Interpolator (Efl.Object, Efl.Interpolator) { [[Efl divisor interpolator class]] - data: Efl_Interpolator_Divisor_Data; + data: Efl_Divisor_Interpolator_Data; methods { @property factors { [[Factors property]] diff --git a/src/lib/ecore/efl_interpolator_accelerate.c b/src/lib/ecore/efl_interpolator_accelerate.c deleted file mode 100644 index 386e599..0000000 --- a/src/lib/ecore/efl_interpolator_accelerate.c +++ /dev/null @@ -1,55 +0,0 @@ -#ifdef HAVE_CONFIG_H -# include -#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(const 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_decelerate.c b/src/lib/ecore/efl_interpolator_decelerate.c deleted file mode 100644 index adb6e03..0000000 --- a/src/lib/ecore/efl_interpolator_decelerate.c +++ /dev/null @@ -1,55 +0,0 @@ -#ifdef HAVE_CONFIG_H -# include -#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(const 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_linear.c b/src/lib/ecore/efl_interpolator_linear.c deleted file mode 100644 index 3180e96..0000000 --- a/src/lib/ecore/efl_interpolator_linear.c +++ /dev/null @@ -1,27 +0,0 @@ -#ifdef HAVE_CONFIG_H -# include -#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 deleted file mode 100644 index b61c7d1..0000000 --- a/src/lib/ecore/efl_interpolator_linear.eo +++ /dev/null @@ -1,8 +0,0 @@ -class Efl.Interpolator_Linear (Efl.Object, 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 deleted file mode 100644 index 53625b7..0000000 --- a/src/lib/ecore/efl_interpolator_sinusoidal.c +++ /dev/null @@ -1,55 +0,0 @@ -#ifdef HAVE_CONFIG_H -# include -#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(const 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_linear_interpolator.c b/src/lib/ecore/efl_linear_interpolator.c new file mode 100644 index 0000000..8dc4c85 --- /dev/null +++ b/src/lib/ecore/efl_linear_interpolator.c @@ -0,0 +1,27 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "Ecore.h" +#include "ecore_private.h" + +#define MY_CLASS EFL_LINEAR_INTERPOLATOR_CLASS + +typedef struct _Efl_Linear_Interpolator_Data Efl_Linear_Interpolator_Data; + +struct _Efl_Linear_Interpolator_Data +{ +}; + +EOLIAN static double +_efl_linear_interpolator_efl_interpolator_interpolate(Eo *eo_obj EINA_UNUSED, + Efl_Linear_Interpolator_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_linear_interpolator.eo.c" diff --git a/src/lib/ecore/efl_linear_interpolator.eo b/src/lib/ecore/efl_linear_interpolator.eo new file mode 100644 index 0000000..8872616 --- /dev/null +++ b/src/lib/ecore/efl_linear_interpolator.eo @@ -0,0 +1,8 @@ +class Efl.Linear_Interpolator (Efl.Object, Efl.Interpolator) +{ + [[Efl linear interpolator class]] + data: Efl_Linear_Interpolator_Data; + implements { + Efl.Interpolator.interpolate; + } +} diff --git a/src/lib/ecore/efl_sinusoidal_interpolator.c b/src/lib/ecore/efl_sinusoidal_interpolator.c new file mode 100644 index 0000000..d36a776 --- /dev/null +++ b/src/lib/ecore/efl_sinusoidal_interpolator.c @@ -0,0 +1,55 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "Ecore.h" +#include "ecore_private.h" + +#define MY_CLASS EFL_SINUSOIDAL_INTERPOLATOR_CLASS + +typedef struct _Efl_Sinusoidal_Interpolator_Data Efl_Sinusoidal_Interpolator_Data; + +struct _Efl_Sinusoidal_Interpolator_Data +{ + double factor; +}; + +EOLIAN static double +_efl_sinusoidal_interpolator_efl_interpolator_interpolate(Eo *eo_obj EINA_UNUSED, + Efl_Sinusoidal_Interpolator_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_sinusoidal_interpolator_factor_set(Eo *eo_obj EINA_UNUSED, + Efl_Sinusoidal_Interpolator_Data *pd, + double factor) +{ + pd->factor = factor; +} + +EOLIAN static double +_efl_sinusoidal_interpolator_factor_get(const Eo *eo_obj EINA_UNUSED, + Efl_Sinusoidal_Interpolator_Data *pd EINA_UNUSED) +{ + return pd->factor; +} + +EOLIAN static Efl_Object * +_efl_sinusoidal_interpolator_efl_object_constructor(Eo *eo_obj, + Efl_Sinusoidal_Interpolator_Data *pd) +{ + eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS)); + + pd->factor = 1.0; + + return eo_obj; +} + +#include "efl_sinusoidal_interpolator.eo.c" diff --git a/src/lib/ecore/efl_interpolator_sinusoidal.eo b/src/lib/ecore/efl_sinusoidal_interpolator.eo similarity index 79% rename from src/lib/ecore/efl_interpolator_sinusoidal.eo rename to src/lib/ecore/efl_sinusoidal_interpolator.eo index 3971852..d602b96 100644 --- a/src/lib/ecore/efl_interpolator_sinusoidal.eo +++ b/src/lib/ecore/efl_sinusoidal_interpolator.eo @@ -1,10 +1,10 @@ -class Efl.Interpolator_Sinusoidal (Efl.Object, Efl.Interpolator) +class Efl.Sinusoidal_Interpolator (Efl.Object, Efl.Interpolator) { [[Efl sinusoidal interpolator class output = (1 - cos(input * Pi)) / 2; ]] - data: Efl_Interpolator_Sinusoidal_Data; + data: Efl_Sinusoidal_Interpolator_Data; methods { @property factor { [[Factor property]] diff --git a/src/lib/ecore/efl_interpolator_spring.c b/src/lib/ecore/efl_spring_interpolator.c similarity index 55% rename from src/lib/ecore/efl_interpolator_spring.c rename to src/lib/ecore/efl_spring_interpolator.c index ca2de9a..183e54c 100644 --- a/src/lib/ecore/efl_interpolator_spring.c +++ b/src/lib/ecore/efl_spring_interpolator.c @@ -5,18 +5,18 @@ #include "Ecore.h" #include "ecore_private.h" -#define MY_CLASS EFL_INTERPOLATOR_SPRING_CLASS +#define MY_CLASS EFL_SPRING_INTERPOLATOR_CLASS -typedef struct _Efl_Interpolator_Spring_Data Efl_Interpolator_Spring_Data; +typedef struct _Efl_Spring_Interpolator_Data Efl_Spring_Interpolator_Data; -struct _Efl_Interpolator_Spring_Data +struct _Efl_Spring_Interpolator_Data { double factor[2]; }; EOLIAN static double -_efl_interpolator_spring_efl_interpolator_interpolate(Eo *obj EINA_UNUSED, - Efl_Interpolator_Spring_Data *pd EINA_UNUSED, +_efl_spring_interpolator_efl_interpolator_interpolate(Eo *obj EINA_UNUSED, + Efl_Spring_Interpolator_Data *pd EINA_UNUSED, double progress) { if ((progress < 0.0) || (progress > 1.0)) @@ -27,8 +27,8 @@ _efl_interpolator_spring_efl_interpolator_interpolate(Eo *obj EINA_UNUSED, } EOLIAN static void -_efl_interpolator_spring_factors_set(Eo *eo_obj EINA_UNUSED, - Efl_Interpolator_Spring_Data *pd, +_efl_spring_interpolator_factors_set(Eo *eo_obj EINA_UNUSED, + Efl_Spring_Interpolator_Data *pd, double factor1, double factor2) { pd->factor[0] = factor1; @@ -36,8 +36,8 @@ _efl_interpolator_spring_factors_set(Eo *eo_obj EINA_UNUSED, } EOLIAN static void -_efl_interpolator_spring_factors_get(const Eo *eo_obj EINA_UNUSED, - Efl_Interpolator_Spring_Data *pd, +_efl_spring_interpolator_factors_get(const Eo *eo_obj EINA_UNUSED, + Efl_Spring_Interpolator_Data *pd, double *factor1, double *factor2) { if (factor1) @@ -48,8 +48,8 @@ _efl_interpolator_spring_factors_get(const Eo *eo_obj EINA_UNUSED, } EOLIAN static Efl_Object * -_efl_interpolator_spring_efl_object_constructor(Eo *eo_obj, - Efl_Interpolator_Spring_Data *pd) +_efl_spring_interpolator_efl_object_constructor(Eo *eo_obj, + Efl_Spring_Interpolator_Data *pd) { eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS)); @@ -59,4 +59,4 @@ _efl_interpolator_spring_efl_object_constructor(Eo *eo_obj, return eo_obj; } -#include "efl_interpolator_spring.eo.c" +#include "efl_spring_interpolator.eo.c" diff --git a/src/lib/ecore/efl_interpolator_spring.eo b/src/lib/ecore/efl_spring_interpolator.eo similarity index 81% rename from src/lib/ecore/efl_interpolator_spring.eo rename to src/lib/ecore/efl_spring_interpolator.eo index ef3eee0..2169816 100644 --- a/src/lib/ecore/efl_interpolator_spring.eo +++ b/src/lib/ecore/efl_spring_interpolator.eo @@ -1,7 +1,7 @@ -class Efl.Interpolator_Spring (Efl.Object, Efl.Interpolator) +class Efl.Spring_Interpolator (Efl.Object, Efl.Interpolator) { [[Efl spring interpolator class]] - data: Efl_Interpolator_Spring_Data; + data: Efl_Spring_Interpolator_Data; methods { @property factors { [[Factors property]] diff --git a/src/lib/ecore/meson.build b/src/lib/ecore/meson.build index 993437f..60525ee 100644 --- a/src/lib/ecore/meson.build +++ b/src/lib/ecore/meson.build @@ -57,14 +57,14 @@ pub_eo_files = [ 'efl_io_file.eo', 'efl_io_copier.eo', 'efl_io_buffered_stream.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', + 'efl_linear_interpolator.eo', + 'efl_accelerate_interpolator.eo', + 'efl_decelerate_interpolator.eo', + 'efl_sinusoidal_interpolator.eo', + 'efl_divisor_interpolator.eo', + 'efl_bounce_interpolator.eo', + 'efl_spring_interpolator.eo', + 'efl_cubic_bezier_interpolator.eo', 'efl_loop_message_future_handler.eo', 'efl_loop_message_future.eo', 'efl_model_item.eo', @@ -153,14 +153,14 @@ ecore_src = [ 'efl_model_composite_selection.c', 'efl_model_accessor_view.c', 'efl_model_accessor_view_private.h', - 'efl_interpolator_linear.c', - 'efl_interpolator_accelerate.c', - 'efl_interpolator_decelerate.c', - 'efl_interpolator_sinusoidal.c', - 'efl_interpolator_divisor.c', - 'efl_interpolator_bounce.c', - 'efl_interpolator_spring.c', - 'efl_interpolator_cubic_bezier.c', + 'efl_linear_interpolator.c', + 'efl_accelerate_interpolator.c', + 'efl_decelerate_interpolator.c', + 'efl_sinusoidal_interpolator.c', + 'efl_divisor_interpolator.c', + 'efl_bounce_interpolator.c', + 'efl_spring_interpolator.c', + 'efl_cubic_bezier_interpolator.c', 'ecore_main_timechanges.c', 'ecore_pipe.c', 'ecore_poller.c', -- 2.7.4