const Efl_Event_Description * _efl_gesture_type_get(const Eo *obj);
void efl_gesture_manager_gesture_clean_up(Eo *obj, Eo *target, const Efl_Event_Description *type);
int _direction_get(Evas_Coord xx1, Evas_Coord xx2);
+Eina_Value *_recognizer_config_get(const Eo *obj, const char *name);
typedef struct _Efl_Canvas_Gesture_Manager_Data Efl_Canvas_Gesture_Manager_Data;
typedef struct _Efl_Canvas_Gesture_Recognizer_Data Efl_Canvas_Gesture_Recognizer_Data;
#define MY_CLASS EFL_CANVAS_GESTURE_RECOGNIZER_CLASS
#include "efl_canvas_gesture_recognizer.eo.h"
-EOLIAN static Eina_Value *
-_efl_canvas_gesture_recognizer_config_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Recognizer_Data *pd, const char *name)
+Eina_Value *
+_recognizer_config_get(const Eo *obj, const char *name)
{
- return efl_gesture_manager_config_get(pd->manager, name);
+ Eo *manager = efl_provider_find(obj, EFL_CANVAS_GESTURE_MANAGER_CLASS);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(manager, NULL);
+ return efl_gesture_manager_config_get(manager, name);
}
EOLIAN static void
Gesture recognizers listen to events that occur on a target object
to see if a particular gesture has occurred.
- Recognizer-specific configuration values can be modified through @.config.
+ Recognizer-specific configuration values can be modified through @Efl.Canvas.Gesture_Manager.config,
+ and the recognizer's manager can be found using @Efl.Object.provider_find.
Default configuration values are taken from the system's configuration.
]]
c_prefix: efl_gesture_recognizer;
@in gesture: Efl.Canvas.Gesture; [[The gesture object.]]
}
}
- @property config {
- [[This property holds configuration values for the recognizer.]]
- get {
- }
- keys {
- name: string; [[Property name.]]
- }
- values {
- value: any_value_ref; [[Value of the property.]]
- }
- }
@property continues {
[[This property determines whether a gesture recognizer should continue
to try processing events after returning @Efl.Canvas.Gesture_Recognizer_Result.finish
if (!pd->start_timeout)
{
double time;
- Eina_Value *val = efl_gesture_recognizer_config_get(obj, "glayer_double_tap_timeout");
+ Eina_Value *val = _recognizer_config_get(obj, "glayer_double_tap_timeout");
if (val)
{
vel = sqrt((velx * velx) + (vely * vely));
- tf = efl_gesture_recognizer_config_get(obj, "thumbscroll_friction");
+ tf = _recognizer_config_get(obj, "thumbscroll_friction");
if (tf) eina_value_get(tf, &thumbscroll_friction);
else thumbscroll_friction = THUMBSCROLL_FRICTION;
- tmt = efl_gesture_recognizer_config_get(obj, "thumbscroll_momentum_threshold");
+ tmt = _recognizer_config_get(obj, "thumbscroll_momentum_threshold");
if (tmt) eina_value_get(tmt, &thumbscroll_momentum_threshold);
else thumbscroll_momentum_threshold = THUMBSCROLL_MOMENTUM_THRESHOLD;
Efl_Canvas_Gesture_Recognizer_Data *rd = efl_data_scope_get(obj, EFL_CANVAS_GESTURE_RECOGNIZER_CLASS);
Eina_Bool dead = EINA_FALSE;
- val = efl_gesture_recognizer_config_get(obj, "glayer_continues_enable");
+ val = _recognizer_config_get(obj, "glayer_continues_enable");
if (val) eina_value_get(val, &glayer_continues_enable);
else glayer_continues_enable = 1;
double a = fabs(angle - pd->line_angle);
double d = (tan(DEG2RAD(a))) * pd->line_length;
- val = efl_gesture_recognizer_config_get(obj, "glayer_line_distance_tolerance");
+ val = _recognizer_config_get(obj, "glayer_line_distance_tolerance");
if (val) eina_value_get(val, &line_distance_tolerance);
else line_distance_tolerance = 3.0;
line_distance_tolerance *= pd->finger_size;
- val = efl_gesture_recognizer_config_get(obj, "glayer_line_angular_tolerance");
+ val = _recognizer_config_get(obj, "glayer_line_angular_tolerance");
if (val) eina_value_get(val, &line_angular_tolerance);
else line_angular_tolerance = 20.0;
{
double line_min_length;
- val = efl_gesture_recognizer_config_get(obj, "glayer_line_min_length");
+ val = _recognizer_config_get(obj, "glayer_line_min_length");
if (val) eina_value_get(val, &line_min_length);
else line_min_length = 1.0;
}
unsigned int time_limit_ms;
- val = efl_gesture_recognizer_config_get(obj, "glayer_flick_time_limit_ms");
+ val = _recognizer_config_get(obj, "glayer_flick_time_limit_ms");
if (val) eina_value_get(val, &time_limit_ms);
else time_limit_ms = 120;
if (!pd->start_timeout)
{
double time;
- Eina_Value *val = efl_gesture_recognizer_config_get(obj, "glayer_long_tap_start_timeout");
+ Eina_Value *val = _recognizer_config_get(obj, "glayer_long_tap_start_timeout");
if (val)
{
vel = sqrt((velx * velx) + (vely * vely));
- tf = efl_gesture_recognizer_config_get(obj, "thumbscroll_friction");
+ tf = _recognizer_config_get(obj, "thumbscroll_friction");
if (tf) eina_value_get(tf, &thumbscroll_friction);
else thumbscroll_friction = THUMBSCROLL_FRICTION;
- tmt = efl_gesture_recognizer_config_get(obj, "thumbscroll_momentum_threshold");
+ tmt = _recognizer_config_get(obj, "thumbscroll_momentum_threshold");
if (tmt) eina_value_get(tmt, &thumbscroll_momentum_threshold);
else thumbscroll_momentum_threshold = THUMBSCROLL_MOMENTUM_THRESHOLD;
Efl_Canvas_Gesture_Recognizer_Result result = EFL_GESTURE_RECOGNIZER_RESULT_CANCEL;
Efl_Canvas_Gesture_Momentum_Data *md = efl_data_scope_get(gesture, EFL_CANVAS_GESTURE_MOMENTUM_CLASS);
- val = efl_gesture_recognizer_config_get(obj, "glayer_continues_enable");
+ val = _recognizer_config_get(obj, "glayer_continues_enable");
if (val) eina_value_get(val, &glayer_continues_enable);
else glayer_continues_enable = 1;
if (!pd->start_timeout)
{
double time;
- Eina_Value *val = efl_gesture_recognizer_config_get(obj, "glayer_double_tap_timeout");
+ Eina_Value *val = _recognizer_config_get(obj, "glayer_double_tap_timeout");
if (val)
{
//FIXME: Wheel zoom test first here.
- val = efl_gesture_recognizer_config_get(obj, "glayer_continues_enable");
+ val = _recognizer_config_get(obj, "glayer_continues_enable");
if (val) eina_value_get(val, &glayer_continues_enable);
else glayer_continues_enable = 1;
- val = efl_gesture_recognizer_config_get(obj, "glayer_zoom_finger_enable");
+ val = _recognizer_config_get(obj, "glayer_zoom_finger_enable");
if (val) eina_value_get(val, &zoom_finger_enable);
else zoom_finger_enable = 1;
- val = efl_gesture_recognizer_config_get(obj, "glayer_zoom_finger_factor");
+ val = _recognizer_config_get(obj, "glayer_zoom_finger_factor");
if (val) eina_value_get(val, &pd->zoom_finger_factor);
else pd->zoom_finger_factor = 1.0;
if (!pd->zoom_distance_tolerance && !pd->calc_temp)
{
pd->calc_temp = EINA_TRUE;
- val = efl_gesture_recognizer_config_get(obj, "glayer_zoom_distance_tolerance");
+ val = _recognizer_config_get(obj, "glayer_zoom_distance_tolerance");
if (val) eina_value_get(val, &pd->zoom_distance_tolerance);
else pd->zoom_distance_tolerance = 1.0;