summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2019-02-12 16:47:31 -0800
committerCedric BAIL <cedric.bail@free.fr>2019-03-08 14:31:04 -0800
commit98e5a71974553dced24c6858d61d183ecc5b5b29 (patch)
treea8a98d176080789d7041f403ad31d42ac65396a9
parent4e1c26d04714acf60f8b29d0c65ba09a9b94f727 (diff)
efl: add an event for the View to know if someone did bound a property.
Reviewed-by: Vitor Sousa da Silva <vitorsousa@expertisesolutions.com.br> Differential Revision: https://phab.enlightenment.org/D7945
-rw-r--r--src/lib/elementary/efl_ui_image.c7
-rw-r--r--src/lib/elementary/efl_ui_layout.c5
-rw-r--r--src/lib/elementary/efl_ui_layout_factory.c12
-rw-r--r--src/lib/elementary/efl_ui_widget.c1
-rw-r--r--src/lib/elementary/efl_ui_widget_factory.c5
-rw-r--r--src/lib/elementary/elm_main.c2
-rw-r--r--src/lib/elementary/elm_priv.h2
7 files changed, 26 insertions, 8 deletions
diff --git a/src/lib/elementary/efl_ui_image.c b/src/lib/elementary/efl_ui_image.c
index 4e75b29f9b..56be05583e 100644
--- a/src/lib/elementary/efl_ui_image.c
+++ b/src/lib/elementary/efl_ui_image.c
@@ -1953,6 +1953,8 @@ _efl_ui_image_efl_ui_view_model_set(Eo *obj, Efl_Ui_Image_Data *pd, Efl_Model *m
1953EOLIAN static Eina_Error 1953EOLIAN static Eina_Error
1954_efl_ui_image_efl_ui_property_bind_property_bind(Eo *obj, Efl_Ui_Image_Data *pd, const char *key, const char *property) 1954_efl_ui_image_efl_ui_property_bind_property_bind(Eo *obj, Efl_Ui_Image_Data *pd, const char *key, const char *property)
1955{ 1955{
1956 Eina_Stringshare *sk;
1957
1956 if (strcmp(key, "filename") == 0) 1958 if (strcmp(key, "filename") == 0)
1957 { 1959 {
1958 pd->property.icon = EINA_FALSE; 1960 pd->property.icon = EINA_FALSE;
@@ -1974,6 +1976,11 @@ _efl_ui_image_efl_ui_property_bind_property_bind(Eo *obj, Efl_Ui_Image_Data *pd,
1974 } 1976 }
1975 1977
1976 _update_viewmodel(obj, pd); 1978 _update_viewmodel(obj, pd);
1979
1980 sk = eina_stringshare_add(key);
1981 efl_event_callback_call(obj, EFL_UI_PROPERTY_BIND_EVENT_PROPERTY_BOUND, (void*) sk);
1982 eina_stringshare_del(sk);
1983
1977 return 0; 1984 return 0;
1978} 1985}
1979 1986
diff --git a/src/lib/elementary/efl_ui_layout.c b/src/lib/elementary/efl_ui_layout.c
index cdb945e203..f6f725eb9c 100644
--- a/src/lib/elementary/efl_ui_layout.c
+++ b/src/lib/elementary/efl_ui_layout.c
@@ -2275,6 +2275,7 @@ _efl_ui_layout_base_efl_ui_property_bind_property_bind(Eo *obj, Efl_Ui_Layout_Da
2275{ 2275{
2276 EINA_SAFETY_ON_NULL_RETURN_VAL(key, EFL_PROPERTY_ERROR_INVALID_KEY); 2276 EINA_SAFETY_ON_NULL_RETURN_VAL(key, EFL_PROPERTY_ERROR_INVALID_KEY);
2277 Eina_Stringshare *sprop; 2277 Eina_Stringshare *sprop;
2278 Eina_Stringshare *sk;
2278 Eina_Hash *hash = NULL; 2279 Eina_Hash *hash = NULL;
2279 char *data = NULL; 2280 char *data = NULL;
2280 Efl_Model *model; 2281 Efl_Model *model;
@@ -2323,6 +2324,10 @@ _efl_ui_layout_base_efl_ui_property_bind_property_bind(Eo *obj, Efl_Ui_Layout_Da
2323 _efl_ui_layout_view_model_property_update(pd, data, sprop); 2324 _efl_ui_layout_view_model_property_update(pd, data, sprop);
2324 } 2325 }
2325 2326
2327 sk = eina_stringshare_add(key);
2328 efl_event_callback_call(obj, EFL_UI_PROPERTY_BIND_EVENT_PROPERTY_BOUND, (void*) sk);
2329 eina_stringshare_del(sk);
2330
2326 if (!sprop) 2331 if (!sprop)
2327 free(data); 2332 free(data);
2328 2333
diff --git a/src/lib/elementary/efl_ui_layout_factory.c b/src/lib/elementary/efl_ui_layout_factory.c
index 3c93116711..709a31fc85 100644
--- a/src/lib/elementary/efl_ui_layout_factory.c
+++ b/src/lib/elementary/efl_ui_layout_factory.c
@@ -133,18 +133,16 @@ _efl_ui_layout_factory_efl_ui_property_bind_property_bind(Eo *obj EINA_UNUSED, E
133 if (property == NULL) 133 if (property == NULL)
134 { 134 {
135 eina_hash_del(pd->bind.properties, ss_key, NULL); 135 eina_hash_del(pd->bind.properties, ss_key, NULL);
136 eina_stringshare_del(ss_key); 136 goto end;
137 return 0;
138 } 137 }
139 138
140 ss_prop = eina_stringshare_add(property); 139 ss_prop = eina_stringshare_add(property);
141 ss_old = eina_hash_set(pd->bind.properties, ss_key, ss_prop); 140 ss_old = eina_hash_set(pd->bind.properties, ss_key, ss_prop);
142 if (ss_old) 141 if (ss_old) eina_stringshare_del(ss_old);
143 {
144 eina_stringshare_del(ss_old);
145 eina_stringshare_del(ss_key);
146 }
147 142
143 end:
144 efl_event_callback_call(obj, EFL_UI_PROPERTY_BIND_EVENT_PROPERTY_BOUND, (void*) ss_key);
145 eina_stringshare_del(ss_key);
148 return 0; 146 return 0;
149} 147}
150 148
diff --git a/src/lib/elementary/efl_ui_widget.c b/src/lib/elementary/efl_ui_widget.c
index 2c49d0fecf..86c2db8e97 100644
--- a/src/lib/elementary/efl_ui_widget.c
+++ b/src/lib/elementary/efl_ui_widget.c
@@ -6069,6 +6069,7 @@ _efl_ui_widget_efl_ui_property_bind_property_bind(Eo *obj, Efl_Ui_Widget_Data *p
6069 6069
6070 _efl_ui_property_bind_get(pd, prop); 6070 _efl_ui_property_bind_get(pd, prop);
6071 6071
6072 efl_event_callback_call(obj, EFL_UI_PROPERTY_BIND_EVENT_PROPERTY_BOUND, (void*) prop->key);
6072 6073
6073 return 0; 6074 return 0;
6074} 6075}
diff --git a/src/lib/elementary/efl_ui_widget_factory.c b/src/lib/elementary/efl_ui_widget_factory.c
index 1059cefb4e..a04bdcbb23 100644
--- a/src/lib/elementary/efl_ui_widget_factory.c
+++ b/src/lib/elementary/efl_ui_widget_factory.c
@@ -115,13 +115,16 @@ _efl_ui_widget_factory_efl_ui_factory_release(Eo *obj EINA_UNUSED,
115 efl_del(ui_view); 115 efl_del(ui_view);
116} 116}
117 117
118Eina_Stringshare *_property_style_ss = NULL;
119
118static Eina_Error 120static Eina_Error
119_efl_ui_widget_factory_efl_ui_property_bind_property_bind(Eo *obj, Efl_Ui_Widget_Factory_Data *pd, 121_efl_ui_widget_factory_efl_ui_property_bind_property_bind(Eo *obj, Efl_Ui_Widget_Factory_Data *pd,
120 const char *target, const char *property) 122 const char *target, const char *property)
121{ 123{
122 if (!strcmp(target, "style")) 124 if (_property_style_ss == target || !strcmp(target, _property_style_ss))
123 { 125 {
124 eina_stringshare_replace(&pd->style, property); 126 eina_stringshare_replace(&pd->style, property);
127 efl_event_callback_call(obj, EFL_UI_PROPERTY_BIND_EVENT_PROPERTY_BOUND, (void*) _property_style_ss);
125 return 0; 128 return 0;
126 } 129 }
127 130
diff --git a/src/lib/elementary/elm_main.c b/src/lib/elementary/elm_main.c
index ce403942ad..50aa58c3a8 100644
--- a/src/lib/elementary/elm_main.c
+++ b/src/lib/elementary/elm_main.c
@@ -809,6 +809,7 @@ elm_quicklaunch_init(int argc EINA_UNUSED,
809 } 809 }
810 if (!_elm_data_dir) _elm_data_dir = eina_stringshare_add("/"); 810 if (!_elm_data_dir) _elm_data_dir = eina_stringshare_add("/");
811 if (!_elm_lib_dir) _elm_lib_dir = eina_stringshare_add("/"); 811 if (!_elm_lib_dir) _elm_lib_dir = eina_stringshare_add("/");
812 if (!_property_style_ss) _property_style_ss = eina_stringshare_add("style");
812 813
813 eina_log_timing(_elm_log_dom, EINA_LOG_STATE_STOP, EINA_LOG_STATE_INIT); 814 eina_log_timing(_elm_log_dom, EINA_LOG_STATE_STOP, EINA_LOG_STATE_INIT);
814 815
@@ -925,6 +926,7 @@ elm_quicklaunch_shutdown(void)
925 pfx = NULL; 926 pfx = NULL;
926 ELM_SAFE_FREE(_elm_data_dir, eina_stringshare_del); 927 ELM_SAFE_FREE(_elm_data_dir, eina_stringshare_del);
927 ELM_SAFE_FREE(_elm_lib_dir, eina_stringshare_del); 928 ELM_SAFE_FREE(_elm_lib_dir, eina_stringshare_del);
929 ELM_SAFE_FREE(_property_style_ss, eina_stringshare_del);
928 ELM_SAFE_FREE(_elm_appname, free); 930 ELM_SAFE_FREE(_elm_appname, free);
929 931
930 ELM_SAFE_FREE(_elm_exit_handler, ecore_event_handler_del); 932 ELM_SAFE_FREE(_elm_exit_handler, ecore_event_handler_del);
diff --git a/src/lib/elementary/elm_priv.h b/src/lib/elementary/elm_priv.h
index 2131bd8edf..cf9b553c12 100644
--- a/src/lib/elementary/elm_priv.h
+++ b/src/lib/elementary/elm_priv.h
@@ -899,6 +899,8 @@ extern const char SIG_WIDGET_ACCESS_CHANGED[];
899extern const char SIG_LAYOUT_FOCUSED[]; 899extern const char SIG_LAYOUT_FOCUSED[];
900extern const char SIG_LAYOUT_UNFOCUSED[]; 900extern const char SIG_LAYOUT_UNFOCUSED[];
901 901
902extern Eina_Stringshare *_property_style_ss;
903
902extern Eina_Bool _config_profile_lock; 904extern Eina_Bool _config_profile_lock;
903 905
904# ifdef HAVE_ELEMENTARY_WL2 906# ifdef HAVE_ELEMENTARY_WL2