2017-09-12 01:49:40 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include <config.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "Ecore.h"
|
|
|
|
#include "ecore_private.h"
|
|
|
|
|
2018-11-23 04:26:00 -08:00
|
|
|
#define MY_CLASS EFL_DIVISOR_INTERPOLATOR_CLASS
|
2017-09-12 01:49:40 -07:00
|
|
|
|
2018-11-23 04:26:00 -08:00
|
|
|
typedef struct _Efl_Divisor_Interpolator_Data Efl_Divisor_Interpolator_Data;
|
2017-09-12 01:49:40 -07:00
|
|
|
|
2018-11-23 04:26:00 -08:00
|
|
|
struct _Efl_Divisor_Interpolator_Data
|
2017-09-12 01:49:40 -07:00
|
|
|
{
|
2019-11-05 11:26:14 -08:00
|
|
|
double divisor;
|
|
|
|
int power;
|
2017-09-12 01:49:40 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
EOLIAN static double
|
2018-11-23 04:26:00 -08:00
|
|
|
_efl_divisor_interpolator_efl_interpolator_interpolate(Eo *eo_obj EINA_UNUSED,
|
|
|
|
Efl_Divisor_Interpolator_Data *pd EINA_UNUSED,
|
2017-09-12 01:49:40 -07:00
|
|
|
double progress)
|
|
|
|
{
|
|
|
|
if ((progress < 0.0) || (progress > 1.0))
|
|
|
|
return progress;
|
|
|
|
|
|
|
|
return ecore_animator_pos_map(progress, ECORE_POS_MAP_DIVISOR_INTERP,
|
2019-11-05 11:26:14 -08:00
|
|
|
pd->divisor, (double)pd->power);
|
2017-09-12 01:49:40 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
2019-11-05 11:26:14 -08:00
|
|
|
_efl_divisor_interpolator_divisor_set(Eo *eo_obj EINA_UNUSED,
|
2018-11-23 04:26:00 -08:00
|
|
|
Efl_Divisor_Interpolator_Data *pd,
|
2019-11-05 11:26:14 -08:00
|
|
|
double divisor)
|
2017-09-12 01:49:40 -07:00
|
|
|
{
|
2019-11-05 11:26:14 -08:00
|
|
|
pd->divisor = divisor;
|
2017-09-12 01:49:40 -07:00
|
|
|
}
|
|
|
|
|
2019-11-05 11:26:14 -08:00
|
|
|
EOLIAN static double
|
|
|
|
_efl_divisor_interpolator_divisor_get(const Eo *eo_obj EINA_UNUSED,
|
|
|
|
Efl_Divisor_Interpolator_Data *pd)
|
|
|
|
{
|
|
|
|
return pd->divisor;
|
|
|
|
}
|
2017-09-12 01:49:40 -07:00
|
|
|
EOLIAN static void
|
2019-11-05 11:26:14 -08:00
|
|
|
_efl_divisor_interpolator_power_set(Eo *eo_obj EINA_UNUSED,
|
|
|
|
Efl_Divisor_Interpolator_Data *pd,
|
|
|
|
int power)
|
2017-09-12 01:49:40 -07:00
|
|
|
{
|
2019-11-05 11:26:14 -08:00
|
|
|
pd->power = power;
|
|
|
|
}
|
2017-09-12 01:49:40 -07:00
|
|
|
|
2019-11-05 11:26:14 -08:00
|
|
|
EOLIAN static int
|
|
|
|
_efl_divisor_interpolator_power_get(const Eo *eo_obj EINA_UNUSED,
|
|
|
|
Efl_Divisor_Interpolator_Data *pd)
|
|
|
|
{
|
|
|
|
return pd->power;
|
2017-09-12 01:49:40 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Efl_Object *
|
2018-11-23 04:26:00 -08:00
|
|
|
_efl_divisor_interpolator_efl_object_constructor(Eo *eo_obj,
|
|
|
|
Efl_Divisor_Interpolator_Data *pd)
|
2017-09-12 01:49:40 -07:00
|
|
|
{
|
|
|
|
eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS));
|
|
|
|
|
2019-11-05 11:26:14 -08:00
|
|
|
pd->divisor = 1.0;
|
|
|
|
pd->power = 1;
|
2017-09-12 01:49:40 -07:00
|
|
|
|
|
|
|
return eo_obj;
|
|
|
|
}
|
|
|
|
|
2018-11-23 04:26:00 -08:00
|
|
|
#include "efl_divisor_interpolator.eo.c"
|