bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=3c0b496ad34289b9e09a1d357bea31fb0069544a
commit 3c0b496ad34289b9e09a1d357bea31fb0069544a Author: Cedric BAIL <cedric.b...@free.fr> Date: Fri Aug 23 14:51:54 2019 -0700 elementary: Efl.Ui.Layout_Factory bind property during widget creation. In the same vain as previous patch this will initialize more of the widget during its creation and reduce unecessary recalc. Reviewed-by: Marcel Hollerbach <m...@marcel-hollerbach.de> Reviewed-by: SangHyeon Jade Lee <sh10233....@samsung.com> Differential Revision: https://phab.enlightenment.org/D9951 --- src/lib/elementary/efl_ui_layout_factory.c | 37 ++++------------------------- src/lib/elementary/efl_ui_layout_factory.eo | 1 - 2 files changed, 5 insertions(+), 33 deletions(-) diff --git a/src/lib/elementary/efl_ui_layout_factory.c b/src/lib/elementary/efl_ui_layout_factory.c index 58c8235b9e..ed9d975d40 100644 --- a/src/lib/elementary/efl_ui_layout_factory.c +++ b/src/lib/elementary/efl_ui_layout_factory.c @@ -70,46 +70,19 @@ _efl_ui_layout_factory_efl_object_destructor(Eo *obj, Efl_Ui_Layout_Factory_Data efl_destructor(efl_super(obj, MY_CLASS)); } -static Eina_Value -_efl_ui_layout_factory_bind(Eo *obj EINA_UNUSED, void *data, const Eina_Value value) -{ - Efl_Ui_Layout_Factory_Data *pd = data; - Efl_Gfx_Entity *layout; - int len, i; - - EINA_VALUE_ARRAY_FOREACH(&value, len, i, layout) - { - eina_hash_foreach(pd->bind.properties, _property_bind, layout); - eina_hash_foreach(pd->bind.factories, _factory_bind, layout); - - evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, 0); - evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL); - } - - return value; -} - static void _efl_ui_layout_factory_efl_ui_factory_building(const Eo *obj, Efl_Ui_Layout_Factory_Data *pd, Efl_Gfx_Entity *ui_view) { if (pd->klass || pd->group || pd->style) efl_ui_layout_theme_set(ui_view, pd->klass, pd->group, pd->style); - efl_ui_factory_building(efl_super(obj, EFL_UI_LAYOUT_FACTORY_CLASS), ui_view); -} - -EOLIAN static Eina_Future * -_efl_ui_layout_factory_efl_ui_factory_create(Eo *obj, Efl_Ui_Layout_Factory_Data *pd, - Eina_Iterator *models, Efl_Gfx_Entity *parent) -{ - Eina_Future *f; + eina_hash_foreach(pd->bind.properties, _property_bind, ui_view); + eina_hash_foreach(pd->bind.factories, _factory_bind, ui_view); - f = efl_ui_factory_create(efl_super(obj, EFL_UI_LAYOUT_FACTORY_CLASS), models, parent); + efl_gfx_hint_weight_set(ui_view, EFL_GFX_HINT_EXPAND, 0); + efl_gfx_hint_fill_set(ui_view, EINA_TRUE, EINA_TRUE); - return efl_future_then(obj, f, - .success_type = EINA_VALUE_TYPE_ARRAY, - .success = _efl_ui_layout_factory_bind, - .data = pd); + efl_ui_factory_building(efl_super(obj, EFL_UI_LAYOUT_FACTORY_CLASS), ui_view); } EOLIAN static void diff --git a/src/lib/elementary/efl_ui_layout_factory.eo b/src/lib/elementary/efl_ui_layout_factory.eo index d6d473e655..0d35d21706 100644 --- a/src/lib/elementary/efl_ui_layout_factory.eo +++ b/src/lib/elementary/efl_ui_layout_factory.eo @@ -15,7 +15,6 @@ class @beta Efl.Ui.Layout_Factory extends Efl.Ui.Caching_Factory implements { Efl.Object.constructor; Efl.Object.destructor; - Efl.Ui.Factory.create; Efl.Ui.Factory.building; Efl.Ui.Property_Bind.property_bind; Efl.Ui.Factory_Bind.factory_bind; --