summaryrefslogtreecommitdiff
path: root/src/lib/evas
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2020-01-30 11:46:59 -0500
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2020-02-14 09:20:30 +0100
commit151ec0748a5398ccdf6a802c913b2ed3876238a0 (patch)
treec680bdb964513f212bb7032bdfc71cbcdef6cb1b /src/lib/evas
parent23678b3695c4e0976afb3949dff19c85878e213b (diff)
efl/config: merge all gesture manager config code into efl.config
this is all just duplicated code, so we can deduplicate it with minimal effort to clean up the api Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D11251
Diffstat (limited to 'src/lib/evas')
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_manager.c15
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_manager.eo3
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_recognizer.c2
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_recognizer.eo4
4 files changed, 17 insertions, 7 deletions
diff --git a/src/lib/evas/gesture/efl_canvas_gesture_manager.c b/src/lib/evas/gesture/efl_canvas_gesture_manager.c
index 6399227dc5..9bed44dd97 100644
--- a/src/lib/evas/gesture/efl_canvas_gesture_manager.c
+++ b/src/lib/evas/gesture/efl_canvas_gesture_manager.c
@@ -97,6 +97,15 @@ _update_finger_sizes(Efl_Canvas_Gesture_Manager_Data *pd, int finger_size)
97 zd->finger_size = finger_size; 97 zd->finger_size = finger_size;
98} 98}
99 99
100static void
101_gesture_manager_config_changed(void *data, const Efl_Event *ev)
102{
103 Efl_Canvas_Gesture_Manager_Data *pd = data;
104
105 if ((!ev->info) || eina_streq(ev->info, "glayer_tap_finger_size"))
106 _update_finger_sizes(pd, efl_config_int_get(ev->object, "glayer_tap_finger_size"));
107}
108
100EOLIAN static Efl_Object * 109EOLIAN static Efl_Object *
101_efl_canvas_gesture_manager_efl_object_constructor(Eo *obj, Efl_Canvas_Gesture_Manager_Data *pd) 110_efl_canvas_gesture_manager_efl_object_constructor(Eo *obj, Efl_Canvas_Gesture_Manager_Data *pd)
102{ 111{
@@ -112,6 +121,7 @@ _efl_canvas_gesture_manager_efl_object_constructor(Eo *obj, Efl_Canvas_Gesture_M
112 /* this needs to always be present */ 121 /* this needs to always be present */
113 config = efl_provider_find(efl_main_loop_get(), EFL_CONFIG_INTERFACE); 122 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); 123 efl_config_int_set(config, "glayer_tap_finger_size", EFL_GESTURE_RECOGNIZER_TYPE_TAP_FINGER_SIZE);
124 efl_event_callback_add(config, EFL_CONFIG_EVENT_CONFIG_CHANGED, _gesture_manager_config_changed, pd);
115 125
116 //Register all types of recognizers at very first time. 126 //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)); 127 efl_gesture_manager_recognizer_register(obj, efl_add(EFL_CANVAS_GESTURE_RECOGNIZER_TAP_CLASS, obj));
@@ -127,10 +137,13 @@ _efl_canvas_gesture_manager_efl_object_constructor(Eo *obj, Efl_Canvas_Gesture_M
127} 137}
128 138
129EOLIAN static void 139EOLIAN static void
130_efl_canvas_gesture_manager_efl_object_destructor(Eo *obj, Efl_Canvas_Gesture_Manager_Data *pd EINA_UNUSED) 140_efl_canvas_gesture_manager_efl_object_destructor(Eo *obj, Efl_Canvas_Gesture_Manager_Data *pd)
131{ 141{
132 Efl_Canvas_Gesture_Recognizer *recognizer; 142 Efl_Canvas_Gesture_Recognizer *recognizer;
133 void *ptr; 143 void *ptr;
144 Eo *config = efl_provider_find(efl_main_loop_get(), EFL_CONFIG_INTERFACE);
145 if (config)
146 efl_event_callback_del(config, EFL_CONFIG_EVENT_CONFIG_CHANGED, _gesture_manager_config_changed, pd);
134 147
135 eina_hash_free(pd->m_recognizers); 148 eina_hash_free(pd->m_recognizers);
136 EINA_LIST_FREE(pd->custom_recognizers, recognizer) 149 EINA_LIST_FREE(pd->custom_recognizers, recognizer)
diff --git a/src/lib/evas/gesture/efl_canvas_gesture_manager.eo b/src/lib/evas/gesture/efl_canvas_gesture_manager.eo
index 04e08f2d50..2dad839a3d 100644
--- a/src/lib/evas/gesture/efl_canvas_gesture_manager.eo
+++ b/src/lib/evas/gesture/efl_canvas_gesture_manager.eo
@@ -30,9 +30,6 @@ class @beta Efl.Canvas.Gesture_Manager extends Efl.Object
30 } 30 }
31 } 31 }
32 } 32 }
33 events {
34 config,changed: string; [[Called when a config value has been changed for the manager object. Passed string is the name of the value.]]
35 }
36 implements { 33 implements {
37 Efl.Object.constructor; 34 Efl.Object.constructor;
38 Efl.Object.destructor; 35 Efl.Object.destructor;
diff --git a/src/lib/evas/gesture/efl_canvas_gesture_recognizer.c b/src/lib/evas/gesture/efl_canvas_gesture_recognizer.c
index 995217ca85..8369295596 100644
--- a/src/lib/evas/gesture/efl_canvas_gesture_recognizer.c
+++ b/src/lib/evas/gesture/efl_canvas_gesture_recognizer.c
@@ -7,7 +7,7 @@
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 *config = efl_provider_find(efl_main_loop_get(), EFL_CONFIG_INTERFACE); 10 Eo *config = efl_provider_find(obj, EFL_CONFIG_INTERFACE);
11 EINA_SAFETY_ON_NULL_RETURN_VAL(config, NULL); 11 EINA_SAFETY_ON_NULL_RETURN_VAL(config, NULL);
12 return efl_config_get(config, name); 12 return efl_config_get(config, name);
13} 13}
diff --git a/src/lib/evas/gesture/efl_canvas_gesture_recognizer.eo b/src/lib/evas/gesture/efl_canvas_gesture_recognizer.eo
index 17fb52a590..4f5ee45043 100644
--- a/src/lib/evas/gesture/efl_canvas_gesture_recognizer.eo
+++ b/src/lib/evas/gesture/efl_canvas_gesture_recognizer.eo
@@ -7,8 +7,8 @@ abstract @beta Efl.Canvas.Gesture_Recognizer extends Efl.Object
7 Gesture recognizers listen to events that occur on a target object 7 Gesture recognizers listen to events that occur on a target object
8 to see if a particular gesture has occurred. 8 to see if a particular gesture has occurred.
9 9
10 Recognizer-specific configuration values can be modified through @Efl.Canvas.Gesture_Manager.config, 10 Recognizer-specific configuration values can be modified through @Efl.Config.config,
11 and the recognizer's manager can be found using @Efl.Object.provider_find. 11 and the global config object can be found using @Efl.Object.provider_find.
12 Default configuration values are taken from the system's configuration. 12 Default configuration values are taken from the system's configuration.
13 ]] 13 ]]
14 c_prefix: efl_gesture_recognizer; 14 c_prefix: efl_gesture_recognizer;