summaryrefslogtreecommitdiff
path: root/src/lib/evas
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2020-01-30 10:46:24 -0500
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2020-02-14 09:20:24 +0100
commit7da4ab3633e6ddb4cdd4a562485512bd874667b9 (patch)
treec4787de9f739dbcd5194895442a0a889a2f1390a /src/lib/evas
parent94a29d05dea1e9c35b9f595119dd6f73d79fdb5b (diff)
efl/gesture: remove manager config
we can just use efl.config here instead of duplicating it Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D11248
Diffstat (limited to 'src/lib/evas')
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_manager.c29
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_manager.eo13
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_recognizer.c6
3 files changed, 6 insertions, 42 deletions
diff --git a/src/lib/evas/gesture/efl_canvas_gesture_manager.c b/src/lib/evas/gesture/efl_canvas_gesture_manager.c
index 38dfbe667b..6399227dc5 100644
--- a/src/lib/evas/gesture/efl_canvas_gesture_manager.c
+++ b/src/lib/evas/gesture/efl_canvas_gesture_manager.c
@@ -27,7 +27,6 @@ typedef struct _Efl_Canvas_Gesture_Manager_Data
27 //Lazy deletion of gestures 27 //Lazy deletion of gestures
28 Eina_Array *m_gestures_to_delete; 28 Eina_Array *m_gestures_to_delete;
29 //Kepps config values for gesture recognize 29 //Kepps config values for gesture recognize
30 Eina_Hash *m_config;
31 Eina_Bool processing : 1; 30 Eina_Bool processing : 1;
32} Efl_Canvas_Gesture_Manager_Data; 31} Efl_Canvas_Gesture_Manager_Data;
33 32
@@ -101,6 +100,7 @@ _update_finger_sizes(Efl_Canvas_Gesture_Manager_Data *pd, int finger_size)
101EOLIAN static Efl_Object * 100EOLIAN static Efl_Object *
102_efl_canvas_gesture_manager_efl_object_constructor(Eo *obj, Efl_Canvas_Gesture_Manager_Data *pd) 101_efl_canvas_gesture_manager_efl_object_constructor(Eo *obj, Efl_Canvas_Gesture_Manager_Data *pd)
103{ 102{
103 Eo *config;
104 obj = efl_constructor(efl_super(obj, MY_CLASS)); 104 obj = efl_constructor(efl_super(obj, MY_CLASS));
105 105
106 pd->m_recognizers = eina_hash_pointer_new(EINA_FREE_CB(_hash_unref_cb)); 106 pd->m_recognizers = eina_hash_pointer_new(EINA_FREE_CB(_hash_unref_cb));
@@ -109,9 +109,9 @@ _efl_canvas_gesture_manager_efl_object_constructor(Eo *obj, Efl_Canvas_Gesture_M
109 pd->m_object_gestures = NULL; 109 pd->m_object_gestures = NULL;
110 pd->m_gestures_to_delete = eina_array_new(1);; 110 pd->m_gestures_to_delete = eina_array_new(1);;
111 111
112 pd->m_config = eina_hash_string_superfast_new(EINA_FREE_CB(eina_value_free));
113 /* this needs to always be present */ 112 /* this needs to always be present */
114 eina_hash_add(pd->m_config, "glayer_tap_finger_size", eina_value_int_new(EFL_GESTURE_RECOGNIZER_TYPE_TAP_FINGER_SIZE)); 113 config = efl_provider_find(efl_main_loop_get(), EFL_CONFIG_INTERFACE);
114 efl_config_int_set(config, "glayer_tap_finger_size", EFL_GESTURE_RECOGNIZER_TYPE_TAP_FINGER_SIZE);
115 115
116 //Register all types of recognizers at very first time. 116 //Register all types of recognizers at very first time.
117 efl_gesture_manager_recognizer_register(obj, efl_add(EFL_CANVAS_GESTURE_RECOGNIZER_TAP_CLASS, obj)); 117 efl_gesture_manager_recognizer_register(obj, efl_add(EFL_CANVAS_GESTURE_RECOGNIZER_TAP_CLASS, obj));
@@ -126,35 +126,12 @@ _efl_canvas_gesture_manager_efl_object_constructor(Eo *obj, Efl_Canvas_Gesture_M
126 return obj; 126 return obj;
127} 127}
128 128
129EOLIAN static Eina_Value *
130_efl_canvas_gesture_manager_config_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Manager_Data *pd, const char *name)
131{
132 return eina_hash_find(pd->m_config, name);
133}
134
135EOLIAN static void
136_efl_canvas_gesture_manager_config_set(Eo *obj, Efl_Canvas_Gesture_Manager_Data *pd, const char *name, Eina_Value *value)
137{
138 Eina_Value *v;
139 int finger_size;
140
141 EINA_SAFETY_ON_NULL_RETURN(name);
142 v = eina_value_new(eina_value_type_get(value));
143 eina_value_copy(value, v);
144 eina_hash_add(pd->m_config, name, v);
145 efl_event_callback_call(obj, EFL_GESTURE_MANAGER_EVENT_CONFIG_CHANGED, (void*)name);
146 if (!eina_streq(name, "glayer_tap_finger_size")) return;
147 eina_value_get(value, &finger_size);
148 _update_finger_sizes(pd, finger_size);
149}
150
151EOLIAN static void 129EOLIAN static void
152_efl_canvas_gesture_manager_efl_object_destructor(Eo *obj, Efl_Canvas_Gesture_Manager_Data *pd EINA_UNUSED) 130_efl_canvas_gesture_manager_efl_object_destructor(Eo *obj, Efl_Canvas_Gesture_Manager_Data *pd EINA_UNUSED)
153{ 131{
154 Efl_Canvas_Gesture_Recognizer *recognizer; 132 Efl_Canvas_Gesture_Recognizer *recognizer;
155 void *ptr; 133 void *ptr;
156 134
157 eina_hash_free(pd->m_config);
158 eina_hash_free(pd->m_recognizers); 135 eina_hash_free(pd->m_recognizers);
159 EINA_LIST_FREE(pd->custom_recognizers, recognizer) 136 EINA_LIST_FREE(pd->custom_recognizers, recognizer)
160 efl_unref(recognizer); 137 efl_unref(recognizer);
diff --git a/src/lib/evas/gesture/efl_canvas_gesture_manager.eo b/src/lib/evas/gesture/efl_canvas_gesture_manager.eo
index eaf27300ba..04e08f2d50 100644
--- a/src/lib/evas/gesture/efl_canvas_gesture_manager.eo
+++ b/src/lib/evas/gesture/efl_canvas_gesture_manager.eo
@@ -22,19 +22,6 @@ class @beta Efl.Canvas.Gesture_Manager extends Efl.Object
22 @in recognizer: Efl.Canvas.Gesture_Recognizer; [[The gesture recognizer object.]] 22 @in recognizer: Efl.Canvas.Gesture_Recognizer; [[The gesture recognizer object.]]
23 } 23 }
24 } 24 }
25 @property config {
26 [[This property holds configuration values for the recognizer.]]
27 set {
28 }
29 get {
30 }
31 keys {
32 name: string; [[Property name.]]
33 }
34 values {
35 value: any_value_ref; [[Value of the property.]]
36 }
37 }
38 recognizer_cleanup { 25 recognizer_cleanup {
39 [[Perform cleanup for a gesture which ends after a delay.]] 26 [[Perform cleanup for a gesture which ends after a delay.]]
40 params { 27 params {
diff --git a/src/lib/evas/gesture/efl_canvas_gesture_recognizer.c b/src/lib/evas/gesture/efl_canvas_gesture_recognizer.c
index ee67006879..995217ca85 100644
--- a/src/lib/evas/gesture/efl_canvas_gesture_recognizer.c
+++ b/src/lib/evas/gesture/efl_canvas_gesture_recognizer.c
@@ -7,9 +7,9 @@
7Eina_Value * 7Eina_Value *
8_recognizer_config_get(const Eo *obj, const char *name) 8_recognizer_config_get(const Eo *obj, const char *name)
9{ 9{
10 Eo *manager = efl_provider_find(obj, EFL_CANVAS_GESTURE_MANAGER_CLASS); 10 Eo *config = efl_provider_find(efl_main_loop_get(), EFL_CONFIG_INTERFACE);
11 EINA_SAFETY_ON_NULL_RETURN_VAL(manager, NULL); 11 EINA_SAFETY_ON_NULL_RETURN_VAL(config, NULL);
12 return efl_gesture_manager_config_get(manager, name); 12 return efl_config_get(config, name);
13} 13}
14 14
15EOLIAN static void 15EOLIAN static void