forked from enlightenment/efl
efl/gesture: remove 'config' property from recognizers
this is a manager functionality, and recognizers are always child objects of managers ref T8503 Reviewed-by: woochan lee <wc0917.lee@samsung.com> Differential Revision: https://phab.enlightenment.org/D11176
This commit is contained in:
parent
159b73c0d8
commit
7444007fe7
|
@ -14,6 +14,7 @@
|
|||
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;
|
||||
|
|
|
@ -4,10 +4,12 @@
|
|||
#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
|
||||
|
|
|
@ -7,7 +7,8 @@ abstract @beta Efl.Canvas.Gesture_Recognizer extends Efl.Object
|
|||
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;
|
||||
|
@ -40,17 +41,6 @@ abstract @beta Efl.Canvas.Gesture_Recognizer extends Efl.Object
|
|||
@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
|
||||
|
|
|
@ -58,7 +58,7 @@ _efl_canvas_gesture_recognizer_double_tap_efl_canvas_gesture_recognizer_recogniz
|
|||
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)
|
||||
{
|
||||
|
|
|
@ -51,11 +51,11 @@ _momentum_set(Eo *obj,
|
|||
|
||||
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;
|
||||
|
||||
|
@ -195,7 +195,7 @@ _efl_canvas_gesture_recognizer_flick_efl_canvas_gesture_recognizer_recognize(Eo
|
|||
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;
|
||||
|
||||
|
@ -266,13 +266,13 @@ _efl_canvas_gesture_recognizer_flick_efl_canvas_gesture_recognizer_recognize(Eo
|
|||
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;
|
||||
|
||||
|
@ -299,7 +299,7 @@ _efl_canvas_gesture_recognizer_flick_efl_canvas_gesture_recognizer_recognize(Eo
|
|||
{
|
||||
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;
|
||||
|
||||
|
@ -330,7 +330,7 @@ _efl_canvas_gesture_recognizer_flick_efl_canvas_gesture_recognizer_recognize(Eo
|
|||
}
|
||||
|
||||
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;
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ _efl_canvas_gesture_recognizer_long_tap_efl_canvas_gesture_recognizer_recognize(
|
|||
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)
|
||||
{
|
||||
|
|
|
@ -36,11 +36,11 @@ _momentum_set(Eo *obj,
|
|||
|
||||
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;
|
||||
|
||||
|
@ -69,7 +69,7 @@ _efl_canvas_gesture_recognizer_momentum_efl_canvas_gesture_recognizer_recognize(
|
|||
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;
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ _efl_canvas_gesture_recognizer_triple_tap_efl_canvas_gesture_recognizer_recogniz
|
|||
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)
|
||||
{
|
||||
|
|
|
@ -150,15 +150,15 @@ _efl_canvas_gesture_recognizer_zoom_efl_canvas_gesture_recognizer_recognize(Eo *
|
|||
|
||||
//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;
|
||||
|
||||
|
@ -167,7 +167,7 @@ _efl_canvas_gesture_recognizer_zoom_efl_canvas_gesture_recognizer_recognize(Eo *
|
|||
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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue