elementary: Efl.Ui.Image_Factory bind property also during widget creation.
authorCedric BAIL <cedric.bail@free.fr>
Fri, 23 Aug 2019 21:48:14 +0000 (14:48 -0700)
committerJongmin Lee <jm105.lee@samsung.com>
Tue, 24 Sep 2019 21:47:13 +0000 (06:47 +0900)
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 <mail@marcel-hollerbach.de>
Reviewed-by: SangHyeon Jade Lee <sh10233.lee@samsung.com>
Differential Revision: https://phab.enlightenment.org/D9950

src/lib/elementary/efl_ui_image_factory.c
src/lib/elementary/efl_ui_image_factory.eo

index 4d0c139..0010570 100644 (file)
@@ -35,34 +35,22 @@ _efl_ui_image_factory_efl_object_destructor(Eo *obj EINA_UNUSED, Efl_Ui_Image_Fa
    efl_destructor(efl_super(obj, MY_CLASS));
 }
 
-static Eina_Value
-_efl_ui_image_factory_bind(Eo *obj EINA_UNUSED, void *data, const Eina_Value value)
+EOLIAN static void
+_efl_ui_image_factory_efl_ui_factory_building(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Factory_Data *pd, Efl_Gfx_Entity *ui_view)
 {
-   Efl_Ui_Image_Factory_Data *pd = data;
-   Efl_Gfx_Entity *entity;
-   int len, i;
-
-   EINA_VALUE_ARRAY_FOREACH(&value, len, i, entity)
-     efl_ui_property_bind(entity, "filename", pd->property);
+   efl_ui_property_bind(ui_view, "filename", pd->property);
 
-   return value;
+   efl_ui_factory_building(efl_super(obj, EFL_UI_IMAGE_FACTORY_CLASS), ui_view);
 }
 
 EOLIAN static Eina_Future *
 _efl_ui_image_factory_efl_ui_factory_create(Eo *obj, Efl_Ui_Image_Factory_Data *pd,
                                             Eina_Iterator *models, Efl_Gfx_Entity *parent)
 {
-   Eina_Future *f;
-
    if (!parent) return efl_loop_future_rejected(obj, EFL_FACTORY_ERROR_NOT_SUPPORTED);
    if (!pd->property) return efl_loop_future_rejected(obj, EFL_FACTORY_ERROR_NOT_SUPPORTED);
 
-   f = efl_ui_factory_create(efl_super(obj, EFL_UI_IMAGE_FACTORY_CLASS), models, parent);
-
-   return efl_future_then(obj, f,
-                          .success_type = EINA_VALUE_TYPE_ARRAY,
-                          .success = _efl_ui_image_factory_bind,
-                          .data = pd);
+   return efl_ui_factory_create(efl_super(obj, EFL_UI_IMAGE_FACTORY_CLASS), models, parent);
 }
 
 EOLIAN static Eina_Error
index 5ebcc1c..57acc7e 100644 (file)
@@ -5,6 +5,7 @@ class @beta Efl.Ui.Image_Factory extends Efl.Ui.Caching_Factory
       Efl.Object.constructor;
       Efl.Object.destructor;
       Efl.Ui.Factory.create;
+      Efl.Ui.Factory.building;
       Efl.Ui.Property_Bind.property_bind;
    }
 }