zmike pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=7ad8acc290f078aa9d2bfd32ec15a4e5677ab01f

commit 7ad8acc290f078aa9d2bfd32ec15a4e5677ab01f
Author: Mike Blumenkrantz <zm...@samsung.com>
Date:   Mon Oct 14 09:30:10 2019 -0400

    efl_ui/layout: selectively inhibit theme,changed event
    
    Summary:
    this is called a ton.
    
    ref T8321
    Depends on D10359
    
    Reviewers: cedric
    
    Reviewed By: cedric
    
    Subscribers: cedric, #reviewers, #committers
    
    Tags: #efl
    
    Maniphest Tasks: T8321
    
    Differential Revision: https://phab.enlightenment.org/D10360
---
 src/lib/elementary/efl_ui_layout.c     | 30 +++++++++++++++++++++++++++++-
 src/lib/elementary/elm_widget_layout.h |  1 +
 2 files changed, 30 insertions(+), 1 deletion(-)

diff --git a/src/lib/elementary/efl_ui_layout.c 
b/src/lib/elementary/efl_ui_layout.c
index 5719d23c9f..25a09a1503 100644
--- a/src/lib/elementary/efl_ui_layout.c
+++ b/src/lib/elementary/efl_ui_layout.c
@@ -537,7 +537,10 @@ _efl_ui_layout_theme_internal(Eo *obj, Efl_Ui_Layout_Data 
*sd, Elm_Widget_Smart_
      }
 
    if (ret != EFL_UI_THEME_APPLY_ERROR_GENERIC)
-     efl_event_callback_legacy_call(obj, EFL_UI_LAYOUT_EVENT_THEME_CHANGED, 
NULL);
+     {
+        if (sd->cb_theme_changed)
+          efl_event_callback_legacy_call(obj, 
EFL_UI_LAYOUT_EVENT_THEME_CHANGED, NULL);
+     }
 
    if (!_visuals_refresh(obj, sd))
      ret = EFL_UI_THEME_APPLY_ERROR_GENERIC;
@@ -2955,6 +2958,29 @@ _efl_ui_layout_base_theme_rotation_apply(Eo *obj, 
Efl_Ui_Layout_Data *pd EINA_UN
 
 
 /* Internal EO APIs and hidden overrides */
+EOLIAN static Eina_Bool
+_efl_ui_layout_base_efl_object_event_callback_priority_add(Eo *obj, 
Efl_Ui_Layout_Data *pd, const Efl_Event_Description *desc, 
Efl_Callback_Priority priority, Efl_Event_Cb func, const void *user_data)
+{
+  if (desc == EFL_CANVAS_GROUP_EVENT_MEMBER_ADDED)
+    {
+       pd->cb_theme_changed = EINA_TRUE;
+    }
+
+  return efl_event_callback_priority_add(efl_super(obj, MY_CLASS), desc, 
priority, func, user_data);
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_layout_base_efl_object_event_callback_array_priority_add(Eo *obj, 
Efl_Ui_Layout_Data *pd, const Efl_Callback_Array_Item *array, 
Efl_Callback_Priority priority, const void *user_data)
+{
+   for (int i = 0; array[i].desc; ++i)
+     {
+        if (array[i].desc == EFL_CANVAS_GROUP_EVENT_MEMBER_ADDED)
+          {
+             pd->cb_theme_changed = EINA_TRUE;
+          }
+     }
+   return efl_event_callback_array_priority_add(efl_super(obj, MY_CLASS), 
array, priority, user_data);
+}
 
 EFL_FUNC_BODY_CONST(efl_ui_layout_text_aliases_get, const 
Elm_Layout_Part_Alias_Description *, NULL)
 EFL_FUNC_BODY_CONST(efl_ui_layout_content_aliases_get, const 
Elm_Layout_Part_Alias_Description *, NULL)
@@ -2968,6 +2994,8 @@ EFL_UI_LAYOUT_TEXT_ALIASES_IMPLEMENT(MY_CLASS_PFX)
    ELM_PART_TEXT_DEFAULT_OPS(efl_ui_layout_base), \
    EFL_UI_LAYOUT_CONTENT_ALIASES_OPS(MY_CLASS_PFX), \
    EFL_UI_LAYOUT_TEXT_ALIASES_OPS(MY_CLASS_PFX), \
+   EFL_OBJECT_OP_FUNC(efl_event_callback_priority_add, 
_efl_ui_layout_base_efl_object_event_callback_priority_add), \
+   EFL_OBJECT_OP_FUNC(efl_event_callback_array_priority_add, 
_efl_ui_layout_base_efl_object_event_callback_array_priority_add), \
    EFL_OBJECT_OP_FUNC(efl_dbg_info_get, 
_efl_ui_layout_base_efl_object_dbg_info_get)
 
 
diff --git a/src/lib/elementary/elm_widget_layout.h 
b/src/lib/elementary/elm_widget_layout.h
index 299fdc11a6..19e3b44d27 100644
--- a/src/lib/elementary/elm_widget_layout.h
+++ b/src/lib/elementary/elm_widget_layout.h
@@ -74,6 +74,7 @@ typedef struct _Efl_Ui_Layout_Data
    Eina_Bool             model_bound : 1; /**< Set to true once we are 
watching over a model*/
    Eina_Bool             model_watch : 1; /**< Set to true once we do watch 
for model change*/
    Eina_Bool             calc_subobjs : 1; /**< Set to true if group_calc 
should also handle subobjs during manual calc */
+   Eina_Bool             cb_theme_changed : 1; /**< if theme,changed event 
subscriber has been added */
 } Efl_Ui_Layout_Data;
 
 typedef struct _Elm_Layout_Data

-- 


Reply via email to