summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/efl/Efl.h17
-rw-r--r--src/lib/efl/interfaces/efl_interfaces_main.c8
-rw-r--r--src/lib/efl/interfaces/efl_ui_factory.eo5
-rw-r--r--src/lib/efl/interfaces/efl_ui_view_factory.eo16
-rw-r--r--src/lib/efl/interfaces/meson.build1
5 files changed, 27 insertions, 20 deletions
diff --git a/src/lib/efl/Efl.h b/src/lib/efl/Efl.h
index e1cfe4156e..403750ac93 100644
--- a/src/lib/efl/Efl.h
+++ b/src/lib/efl/Efl.h
@@ -146,6 +146,7 @@ typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command;
146#include "interfaces/efl_ui_view.eo.h" 146#include "interfaces/efl_ui_view.eo.h"
147#include "interfaces/efl_ui_property_bind.eo.h" 147#include "interfaces/efl_ui_property_bind.eo.h"
148#include "interfaces/efl_ui_factory.eo.h" 148#include "interfaces/efl_ui_factory.eo.h"
149#include "interfaces/efl_ui_view_factory.eo.h"
149#include "interfaces/efl_ui_factory_bind.eo.h" 150#include "interfaces/efl_ui_factory_bind.eo.h"
150#include "interfaces/efl_model_provider.eo.h" 151#include "interfaces/efl_model_provider.eo.h"
151#include "interfaces/efl_cached_item.eo.h" 152#include "interfaces/efl_cached_item.eo.h"
@@ -203,22 +204,6 @@ EAPI void efl_observable_tuple_free(Efl_Observable_Tuple *tuple);
203 */ 204 */
204EAPI Efl_Object *efl_part(const Eo *obj, const char *name); 205EAPI Efl_Object *efl_part(const Eo *obj, const char *name);
205 206
206/**
207 * @brief This triggers the create method of a factory and trigger the item created event.
208 *
209 * @param[in] factory The factory that will provide the item
210 * @param[in] model The model to use to fetch information from
211 * @param[in] parent The parent of the newly created item
212 * @return A future that will resolve with the newly created item.
213 *
214 * @since 1.23
215 * @note This exists as we always want to trigger the event once all the logic
216 * of every factory in the chain has done what it planned to do. Basically we
217 * want the inverse of inheritance call like efl_super. So we do setup the future
218 * in this way.
219 */
220EAPI Eina_Future *efl_ui_view_factory_create_with_event(Efl_Ui_Factory *factory, Eina_Iterator *models, Efl_Gfx_Entity *parent);
221
222#else 207#else
223 208
224#ifndef EFL_NOLEGACY_API_SUPPORT 209#ifndef EFL_NOLEGACY_API_SUPPORT
diff --git a/src/lib/efl/interfaces/efl_interfaces_main.c b/src/lib/efl/interfaces/efl_interfaces_main.c
index 4e85ab6bbc..b73900e55e 100644
--- a/src/lib/efl/interfaces/efl_interfaces_main.c
+++ b/src/lib/efl/interfaces/efl_interfaces_main.c
@@ -67,8 +67,8 @@
67#include "interfaces/efl_ui_range_interactive.eo.c" 67#include "interfaces/efl_ui_range_interactive.eo.c"
68#include "interfaces/efl_ui_autorepeat.eo.c" 68#include "interfaces/efl_ui_autorepeat.eo.c"
69#include "interfaces/efl_ui_view.eo.c" 69#include "interfaces/efl_ui_view.eo.c"
70#include "interfaces/efl_ui_property_bind.eo.c"
71#include "interfaces/efl_ui_factory.eo.c" 70#include "interfaces/efl_ui_factory.eo.c"
71#include "interfaces/efl_ui_property_bind.eo.c"
72#include "interfaces/efl_ui_factory_bind.eo.c" 72#include "interfaces/efl_ui_factory_bind.eo.c"
73 73
74#include "interfaces/efl_ui_draggable.eo.c" 74#include "interfaces/efl_ui_draggable.eo.c"
@@ -131,10 +131,12 @@ _efl_ui_view_factory_item_created(Eo *factory, void *data EINA_UNUSED, const Ein
131 return v; 131 return v;
132} 132}
133 133
134EAPI Eina_Future * 134static Eina_Future *
135efl_ui_view_factory_create_with_event(Efl_Ui_Factory *factory, Eina_Iterator *models, Efl_Gfx_Entity *parent) 135_efl_ui_view_factory_create_with_event(Efl_Ui_Factory *factory, Eina_Iterator *models, Efl_Gfx_Entity *parent)
136{ 136{
137 return efl_future_then(factory, efl_ui_factory_create(factory, models, parent), 137 return efl_future_then(factory, efl_ui_factory_create(factory, models, parent),
138 .success_type = EINA_VALUE_TYPE_ARRAY, 138 .success_type = EINA_VALUE_TYPE_ARRAY,
139 .success = _efl_ui_view_factory_item_created); 139 .success = _efl_ui_view_factory_item_created);
140} 140}
141
142#include "efl_ui_view_factory.eo.c"
diff --git a/src/lib/efl/interfaces/efl_ui_factory.eo b/src/lib/efl/interfaces/efl_ui_factory.eo
index 9b98ece447..b238bec679 100644
--- a/src/lib/efl/interfaces/efl_ui_factory.eo
+++ b/src/lib/efl/interfaces/efl_ui_factory.eo
@@ -9,7 +9,10 @@ interface @beta Efl.Ui.Factory extends Efl.Ui.Property_Bind, Efl.Ui.Factory_Bind
9 [[Efl UI factory interface]] 9 [[Efl UI factory interface]]
10 methods { 10 methods {
11 create { 11 create {
12 [[Create a UI object from the necessary properties in the specified model.]] 12 [[Create a UI object from the necessary properties in the specified model.
13
14
15 Note: This is the function you need to implement for a custom factory, but if you want to use a factory, you should rely on @Efl.Ui.View_Factory.create_with_event.]]
13 params { 16 params {
14 models: iterator<Efl.Model>; [[Efl iterator providing the model to be associated to the new item. It should remain valid until the end of the function call.]] 17 models: iterator<Efl.Model>; [[Efl iterator providing the model to be associated to the new item. It should remain valid until the end of the function call.]]
15 parent: Efl.Gfx.Entity; [[Efl canvas]] 18 parent: Efl.Gfx.Entity; [[Efl canvas]]
diff --git a/src/lib/efl/interfaces/efl_ui_view_factory.eo b/src/lib/efl/interfaces/efl_ui_view_factory.eo
new file mode 100644
index 0000000000..a8a860c7ba
--- /dev/null
+++ b/src/lib/efl/interfaces/efl_ui_view_factory.eo
@@ -0,0 +1,16 @@
1class @beta Efl.Ui.View_Factory
2{
3 [[This class provide a utility function that class that wish to use @Efl.Ui.Factory.create should use.]]
4 data: null;
5 methods {
6 create_with_event @static {
7 [[Create a UI object from the necessary properties in the specified model and generate the created event on the factory when the object is done building. This function must be use by all @Efl.Ui.View that need to create object. They should not use @Efl.Ui.Factory.create directly.]]
8 params {
9 factory: Efl.Ui.Factory; [[The factory to use for requesting the new object from and generating the created event onto.]]
10 models: iterator<Efl.Model>; [[Efl iterator providing the model to be associated to the new item. It should remain valid until the end of the function call.]]
11 parent: Efl.Gfx.Entity; [[Efl canvas]]
12 }
13 return: future<Efl.Gfx.Entity>; [[Created UI object]]
14 }
15 }
16}
diff --git a/src/lib/efl/interfaces/meson.build b/src/lib/efl/interfaces/meson.build
index 992915c69e..58d90ebbe3 100644
--- a/src/lib/efl/interfaces/meson.build
+++ b/src/lib/efl/interfaces/meson.build
@@ -83,6 +83,7 @@ pub_eo_files = [
83 'efl_ui_view.eo', 83 'efl_ui_view.eo',
84 'efl_ui_property_bind.eo', 84 'efl_ui_property_bind.eo',
85 'efl_ui_factory.eo', 85 'efl_ui_factory.eo',
86 'efl_ui_view_factory.eo',
86 'efl_ui_factory_bind.eo', 87 'efl_ui_factory_bind.eo',
87 'efl_screen.eo', 88 'efl_screen.eo',
88 'efl_io_closer.eo', 89 'efl_io_closer.eo',