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
This commit is contained in:
Mike Blumenkrantz 2019-10-14 09:30:10 -04:00
parent 8c6b26af01
commit 7ad8acc290
2 changed files with 30 additions and 1 deletions

View File

@ -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)

View File

@ -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