summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2019-08-23 14:48:14 -0700
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-09-24 09:18:45 +0200
commitaf3f1b070f1ef4480694fe4ab954b83fdae43f09 (patch)
treedc947c208fd845458f4d4a21275206efb3cc29f1
parent23c24b36a12079a85bfd88ea8874f3156bdc04c2 (diff)
elementary: Efl.Ui.Image_Factory bind property also 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 <mail@marcel-hollerbach.de> Reviewed-by: SangHyeon Jade Lee <sh10233.lee@samsung.com> Differential Revision: https://phab.enlightenment.org/D9950
-rw-r--r--src/lib/elementary/efl_ui_image_factory.c22
-rw-r--r--src/lib/elementary/efl_ui_image_factory.eo1
2 files changed, 6 insertions, 17 deletions
diff --git a/src/lib/elementary/efl_ui_image_factory.c b/src/lib/elementary/efl_ui_image_factory.c
index 4d0c139..0010570 100644
--- a/src/lib/elementary/efl_ui_image_factory.c
+++ b/src/lib/elementary/efl_ui_image_factory.c
@@ -35,34 +35,22 @@ _efl_ui_image_factory_efl_object_destructor(Eo *obj EINA_UNUSED, Efl_Ui_Image_Fa
35 efl_destructor(efl_super(obj, MY_CLASS)); 35 efl_destructor(efl_super(obj, MY_CLASS));
36} 36}
37 37
38static Eina_Value 38EOLIAN static void
39_efl_ui_image_factory_bind(Eo *obj EINA_UNUSED, void *data, const Eina_Value value) 39_efl_ui_image_factory_efl_ui_factory_building(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Factory_Data *pd, Efl_Gfx_Entity *ui_view)
40{ 40{
41 Efl_Ui_Image_Factory_Data *pd = data; 41 efl_ui_property_bind(ui_view, "filename", pd->property);
42 Efl_Gfx_Entity *entity;
43 int len, i;
44
45 EINA_VALUE_ARRAY_FOREACH(&value, len, i, entity)
46 efl_ui_property_bind(entity, "filename", pd->property);
47 42
48 return value; 43 efl_ui_factory_building(efl_super(obj, EFL_UI_IMAGE_FACTORY_CLASS), ui_view);
49} 44}
50 45
51EOLIAN static Eina_Future * 46EOLIAN static Eina_Future *
52_efl_ui_image_factory_efl_ui_factory_create(Eo *obj, Efl_Ui_Image_Factory_Data *pd, 47_efl_ui_image_factory_efl_ui_factory_create(Eo *obj, Efl_Ui_Image_Factory_Data *pd,
53 Eina_Iterator *models, Efl_Gfx_Entity *parent) 48 Eina_Iterator *models, Efl_Gfx_Entity *parent)
54{ 49{
55 Eina_Future *f;
56
57 if (!parent) return efl_loop_future_rejected(obj, EFL_FACTORY_ERROR_NOT_SUPPORTED); 50 if (!parent) return efl_loop_future_rejected(obj, EFL_FACTORY_ERROR_NOT_SUPPORTED);
58 if (!pd->property) return efl_loop_future_rejected(obj, EFL_FACTORY_ERROR_NOT_SUPPORTED); 51 if (!pd->property) return efl_loop_future_rejected(obj, EFL_FACTORY_ERROR_NOT_SUPPORTED);
59 52
60 f = efl_ui_factory_create(efl_super(obj, EFL_UI_IMAGE_FACTORY_CLASS), models, parent); 53 return efl_ui_factory_create(efl_super(obj, EFL_UI_IMAGE_FACTORY_CLASS), models, parent);
61
62 return efl_future_then(obj, f,
63 .success_type = EINA_VALUE_TYPE_ARRAY,
64 .success = _efl_ui_image_factory_bind,
65 .data = pd);
66} 54}
67 55
68EOLIAN static Eina_Error 56EOLIAN static Eina_Error
diff --git a/src/lib/elementary/efl_ui_image_factory.eo b/src/lib/elementary/efl_ui_image_factory.eo
index 5ebcc1c..57acc7e 100644
--- a/src/lib/elementary/efl_ui_image_factory.eo
+++ b/src/lib/elementary/efl_ui_image_factory.eo
@@ -5,6 +5,7 @@ class @beta Efl.Ui.Image_Factory extends Efl.Ui.Caching_Factory
5 Efl.Object.constructor; 5 Efl.Object.constructor;
6 Efl.Object.destructor; 6 Efl.Object.destructor;
7 Efl.Ui.Factory.create; 7 Efl.Ui.Factory.create;
8 Efl.Ui.Factory.building;
8 Efl.Ui.Property_Bind.property_bind; 9 Efl.Ui.Property_Bind.property_bind;
9 } 10 }
10} 11}