summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-09-03 14:48:58 +0200
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-09-03 15:02:39 +0200
commitec733e4c256afad400f88b6479c28ca7ec780af0 (patch)
tree34178c4f5c5c25681d6d06c61b05f3d700bfb81f
parent6f14ec7d7047c488626878e9311dba7af87920df (diff)
downloadefl-ec733e4c256afad400f88b6479c28ca7ec780af0.tar.gz
efl_ui_factory: split into constructing and building
constructing is called during construction time, building is called after finalize. This is usefull for theme related properties that can only be set after the theme is applied, which happens during finalize.
-rw-r--r--src/lib/efl/interfaces/efl_ui_factory.eo10
-rw-r--r--src/lib/elementary/efl_ui_caching_factory.c3
-rw-r--r--src/lib/elementary/efl_ui_layout_factory.c8
-rw-r--r--src/lib/elementary/efl_ui_layout_factory.eo1
-rw-r--r--src/lib/elementary/efl_ui_widget_factory.c10
-rw-r--r--src/lib/elementary/efl_ui_widget_factory.eo1
6 files changed, 30 insertions, 3 deletions
diff --git a/src/lib/efl/interfaces/efl_ui_factory.eo b/src/lib/efl/interfaces/efl_ui_factory.eo
index ff0cd1076d..90e71bf161 100644
--- a/src/lib/efl/interfaces/efl_ui_factory.eo
+++ b/src/lib/efl/interfaces/efl_ui_factory.eo
@@ -26,7 +26,15 @@ interface @beta Efl.Ui.Factory extends Efl.Ui.Property_Bind, Efl.Ui.Factory_Bind
}
}
building @const {
- [[This function is called during the creation of an UI object between the @Efl.Object.constructor and @Efl.Object.finalize call.
+ [[This function is called after the creation of an UI object.
+
+ Note: if the @Efl.Ui.Factory does keep a cache of object, this won't be called when object are pulled out of the cache.]]
+ params {
+ ui_view: Efl.Gfx.Entity; [[The UI object being created.]]
+ }
+ }
+ constructing @const {
+ [[This function is called during the construction of an UI object between the @Efl.Object.constructor and @Efl.Object.finalize call.
Note: if the @Efl.Ui.Factory does keep a cache of object, this won't be called when object are pulled out of the cache.]]
params {
diff --git a/src/lib/elementary/efl_ui_caching_factory.c b/src/lib/elementary/efl_ui_caching_factory.c
index 33a44a013d..9a45c3a22d 100644
--- a/src/lib/elementary/efl_ui_caching_factory.c
+++ b/src/lib/elementary/efl_ui_caching_factory.c
@@ -246,8 +246,9 @@ _efl_ui_caching_factory_efl_ui_factory_create(Eo *obj,
EINA_ITERATOR_FOREACH(models, model)
{
w = efl_add(pd->klass, parent,
- efl_ui_factory_building(obj, efl_added),
+ efl_ui_factory_constructing(obj, efl_added),
efl_ui_view_model_set(efl_added, model));
+ efl_ui_factory_building(obj, w);
eina_value_array_append(&gr->done, w);
}
diff --git a/src/lib/elementary/efl_ui_layout_factory.c b/src/lib/elementary/efl_ui_layout_factory.c
index 3a0a66d9b2..25ca1b45f8 100644
--- a/src/lib/elementary/efl_ui_layout_factory.c
+++ b/src/lib/elementary/efl_ui_layout_factory.c
@@ -70,6 +70,14 @@ _efl_ui_layout_factory_efl_object_destructor(Eo *obj, Efl_Ui_Layout_Factory_Data
efl_destructor(efl_super(obj, MY_CLASS));
}
+
+EOLIAN static void
+_efl_ui_layout_factory_efl_ui_factory_constructing(const Eo *obj EINA_UNUSED, Efl_Ui_Layout_Factory_Data *pd EINA_UNUSED, Efl_Gfx_Entity *ui_view EINA_UNUSED)
+{
+ /* NOP */
+}
+
+
static void
_efl_ui_layout_factory_efl_ui_factory_building(const Eo *obj, Efl_Ui_Layout_Factory_Data *pd, Efl_Gfx_Entity *ui_view)
{
diff --git a/src/lib/elementary/efl_ui_layout_factory.eo b/src/lib/elementary/efl_ui_layout_factory.eo
index 0d35d21706..038a33725b 100644
--- a/src/lib/elementary/efl_ui_layout_factory.eo
+++ b/src/lib/elementary/efl_ui_layout_factory.eo
@@ -16,6 +16,7 @@ class @beta Efl.Ui.Layout_Factory extends Efl.Ui.Caching_Factory
Efl.Object.constructor;
Efl.Object.destructor;
Efl.Ui.Factory.building;
+ Efl.Ui.Factory.constructing;
Efl.Ui.Property_Bind.property_bind;
Efl.Ui.Factory_Bind.factory_bind;
}
diff --git a/src/lib/elementary/efl_ui_widget_factory.c b/src/lib/elementary/efl_ui_widget_factory.c
index b4b4d7a54c..aed2ceb6a6 100644
--- a/src/lib/elementary/efl_ui_widget_factory.c
+++ b/src/lib/elementary/efl_ui_widget_factory.c
@@ -69,6 +69,13 @@ _efl_ui_widget_factory_item_class_get(const Eo *obj EINA_UNUSED,
}
static void
+_efl_ui_widget_factory_efl_ui_factory_constructing(const Eo *obj EINA_UNUSED, Efl_Ui_Widget_Factory_Data *pd EINA_UNUSED, Efl_Gfx_Entity *ui_view EINA_UNUSED)
+{
+ /* NOP */
+}
+
+
+static void
_efl_ui_widget_factory_efl_ui_factory_building(const Eo *factory EINA_UNUSED, Efl_Ui_Widget_Factory_Data *pd, Efl_Gfx_Entity *ui_view)
{
const Efl_Model *model;
@@ -131,7 +138,8 @@ _efl_ui_widget_create(const Efl_Ui_Factory *factory,
w = efl_add(klass, parent,
efl_ui_view_model_set(efl_added, model),
- efl_ui_factory_building(factory, efl_added));
+ efl_ui_factory_constructing(factory, efl_added));
+ efl_ui_factory_building(factory, w);
return w;
}
diff --git a/src/lib/elementary/efl_ui_widget_factory.eo b/src/lib/elementary/efl_ui_widget_factory.eo
index fdf537c1a7..c1d039f4b9 100644
--- a/src/lib/elementary/efl_ui_widget_factory.eo
+++ b/src/lib/elementary/efl_ui_widget_factory.eo
@@ -21,6 +21,7 @@ class @beta Efl.Ui.Widget_Factory extends Efl.Loop_Consumer implements Efl.Ui.Fa
Efl.Ui.Factory.create;
Efl.Ui.Factory.release;
Efl.Ui.Factory.building;
+ Efl.Ui.Factory.constructing;
Efl.Ui.Property_Bind.property_bind;
Efl.Part.part_get;
}