summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2016-04-22 14:58:49 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-04-26 11:36:23 +0900
commite2176ed6a3b52c015dd503df592ee24fd5ddf955 (patch)
tree48e518e9e6227c1d90f7f547b77928bd43825f90
parent32b622f08d27a278bf15ab34b9a1b66cd4d54e09 (diff)
Edje: Replace edje_box_part with a fake eo proxy
This is basically an implementation of eo_part() but only for Edje Box APIs. Legacy API is implemented on top of the EO API.
-rw-r--r--src/Makefile_Edje.am18
-rw-r--r--src/Makefile_Elementary.am2
-rw-r--r--src/lib/edje/Edje_Legacy.h141
-rw-r--r--src/lib/edje/edje_containers.c304
-rw-r--r--src/lib/edje/edje_load.c1
-rw-r--r--src/lib/edje/edje_object.eo123
-rw-r--r--src/lib/edje/edje_private.h14
-rw-r--r--src/lib/edje/edje_util.c78
-rw-r--r--src/lib/edje/efl_canvas_layout_internal_box.eo38
-rw-r--r--src/lib/evas/canvas/evas_box.eo6
-rw-r--r--src/lib/evas/canvas/evas_object_box.c7
-rw-r--r--src/tests/edje/edje_test_edje.c69
12 files changed, 652 insertions, 149 deletions
diff --git a/src/Makefile_Edje.am b/src/Makefile_Edje.am
index c9187fadec..f2bb7927f6 100644
--- a/src/Makefile_Edje.am
+++ b/src/Makefile_Edje.am
@@ -8,23 +8,34 @@ edje_eolian_files = \
8edje_eolian_type_files = \ 8edje_eolian_type_files = \
9 lib/edje/edje_types.eot 9 lib/edje/edje_types.eot
10 10
11edje_eolian_priv_files = \
12 lib/edje/efl_canvas_layout_internal_box.eo
13
11edje_eolian_c = $(edje_eolian_files:%.eo=%.eo.c) 14edje_eolian_c = $(edje_eolian_files:%.eo=%.eo.c)
12edje_eolian_h = $(edje_eolian_files:%.eo=%.eo.h) \ 15edje_eolian_h = $(edje_eolian_files:%.eo=%.eo.h) \
13 $(edje_eolian_files:%.eo=%.eo.legacy.h) \ 16 $(edje_eolian_files:%.eo=%.eo.legacy.h) \
14 $(edje_eolian_type_files:%.eot=%.eot.h) 17 $(edje_eolian_type_files:%.eot=%.eot.h)
15 18
19edje_eolian_priv_c = $(edje_eolian_priv_files:%.eo=%.eo.c)
20edje_eolian_priv_h = $(edje_eolian_priv_files:%.eo=%.eo.h)
21
16BUILT_SOURCES += \ 22BUILT_SOURCES += \
17 $(edje_eolian_c) \ 23 $(edje_eolian_c) \
18 $(edje_eolian_h) 24 $(edje_eolian_h) \
25 $(edje_eolian_priv_c) \
26 $(edje_eolian_priv_h)
19 27
20edjeeolianfilesdir = $(datadir)/eolian/include/edje-@VMAJ@ 28edjeeolianfilesdir = $(datadir)/eolian/include/edje-@VMAJ@
21edjeeolianfiles_DATA = \ 29edjeeolianfiles_DATA = \
22 $(edje_eolian_files) \ 30 $(edje_eolian_files) \
23 $(edje_eolian_type_files) 31 $(edje_eolian_type_files)
24 32
33noinst_DATA += $(edje_eolian_priv_c) $(edje_eolian_priv_h)
34
25EXTRA_DIST += lib/edje/Makefile.am \ 35EXTRA_DIST += lib/edje/Makefile.am \
26 lib/edje/Makefile.in \ 36 lib/edje/Makefile.in \
27 ${edjeeolianfiles_DATA} 37 ${edjeeolianfiles_DATA} \
38 $(edje_eolian_priv_files
28 39
29lib_LTLIBRARIES += lib/edje/libedje.la 40lib_LTLIBRARIES += lib/edje/libedje.la
30 41
@@ -78,7 +89,8 @@ lib/edje/edje_text.c \
78lib/edje/edje_textblock_styles.c \ 89lib/edje/edje_textblock_styles.c \
79lib/edje/edje_util.c \ 90lib/edje/edje_util.c \
80lib/edje/edje_var.c \ 91lib/edje/edje_var.c \
81lib/edje/edje_signal.c 92lib/edje/edje_signal.c \
93lib/edje/edje_containers.c
82 94
83lib_edje_libedje_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl $(EDJE_COMMON_CPPFLAGS) 95lib_edje_libedje_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl $(EDJE_COMMON_CPPFLAGS)
84lib_edje_libedje_la_LIBADD = @EDJE_LIBS@ 96lib_edje_libedje_la_LIBADD = @EDJE_LIBS@
diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am
index 9755c88f05..231b0f76d0 100644
--- a/src/Makefile_Elementary.am
+++ b/src/Makefile_Elementary.am
@@ -149,7 +149,7 @@ BUILT_SOURCES += \
149elementaryeolianfilesdir = $(datadir)/eolian/include/elementary-@VMAJ@ 149elementaryeolianfilesdir = $(datadir)/eolian/include/elementary-@VMAJ@
150elementaryeolianfiles_DATA = $(elm_public_eolian_files) $(elm_eolian_type_files) 150elementaryeolianfiles_DATA = $(elm_public_eolian_files) $(elm_eolian_type_files)
151 151
152noinst_DATA = $(elm_legacy_eolian_eo_h) 152noinst_DATA += $(elm_legacy_eolian_eo_h)
153 153
154EXTRA_DIST += ${elementaryeolianfiles_DATA} $(elm_legacy_eolian_files) 154EXTRA_DIST += ${elementaryeolianfiles_DATA} $(elm_legacy_eolian_files)
155 155
diff --git a/src/lib/edje/Edje_Legacy.h b/src/lib/edje/Edje_Legacy.h
index 9e6adf5efd..0e5916a1fa 100644
--- a/src/lib/edje/Edje_Legacy.h
+++ b/src/lib/edje/Edje_Legacy.h
@@ -300,6 +300,147 @@ EAPI void edje_object_part_unswallow(Edje_Object *obj, Evas_Object *obj_swallow)
300 */ 300 */
301EAPI Eina_List *edje_object_access_part_list_get(const Edje_Object *obj); 301EAPI Eina_List *edje_object_access_part_list_get(const Edje_Object *obj);
302 302
303/**
304 * @brief Appends an object to the box.
305 *
306 * Appends child to the box indicated by part.
307 *
308 * See also @ref edje_object_part_box_prepend(),
309 * @ref edje_object_part_box_insert_before(),
310 * @ref edje_object_part_box_insert_after() and
311 * @ref edje_object_part_box_insert_at()
312 *
313 * @param[in] child The object to append
314 *
315 * @return @c true: Successfully added. @c false: An error occurred.
316 *
317 * @ingroup Edje_Object
318 */
319EAPI Eina_Bool edje_object_part_box_append(Edje_Object *obj, const char *part, Evas_Object *child);
320
321/**
322 * @brief Prepends an object to the box.
323 *
324 * Prepends child to the box indicated by part.
325 *
326 * See also @ref edje_object_part_box_append(),
327 * @ref edje_object_part_box_insert_before(),
328 * @ref edje_object_part_box_insert_after and
329 * @ref edje_object_part_box_insert_at()
330 *
331 * @param[in] child The object to prepend
332 *
333 * @return @c true: Successfully added. @c false: An error occurred.
334 *
335 * @ingroup Edje_Object
336 */
337EAPI Eina_Bool edje_object_part_box_prepend(Edje_Object *obj, const char *part, Evas_Object *child);
338
339/**
340 * @brief Adds an object to the box.
341 *
342 * Inserts child in the box given by part, in the position marked by reference.
343 *
344 * See also @ref edje_object_part_box_append(),
345 * @ref edje_object_part_box_prepend(),
346 * @ref edje_object_part_box_insert_after() and
347 * @ref edje_object_part_box_insert_at()
348 *
349 * @param[in] child The object to insert
350 * @param[in] reference The object to be used as reference
351 *
352 * @return @c true: Successfully added. @c false: An error occurred.
353 *
354 * @ingroup Edje_Object
355 */
356EAPI Eina_Bool edje_object_part_box_insert_before(Edje_Object *obj, const char *part, Evas_Object *child, const Evas_Object *reference);
357
358/**
359 * @brief Adds an object to the box.
360 *
361 * Inserts child in the box given by part, in the position marked by reference.
362 *
363 * See also @ref edje_object_part_box_append(),
364 * @ref edje_object_part_box_prepend(),
365 * @ref edje_object_part_box_insert_before() and
366 * @ref edje_object_part_box_insert_at()
367 *
368 * @param[in] child The object to insert
369 * @param[in] reference The object to be used as reference
370 *
371 * @return @c true: Successfully added. @c false: An error occurred.
372 *
373 * @ingroup Edje_Object
374 */
375EAPI Eina_Bool edje_object_part_box_insert_after(Edje_Object *obj, const char *part, Evas_Object *child, const Evas_Object *reference);
376
377/**
378 * @brief Inserts an object to the box.
379 *
380 * Adds child to the box indicated by part, in the position given by pos.
381 *
382 * See also @ref edje_object_part_box_append(),
383 * @ref edje_object_part_box_prepend(),
384 * @ref edje_object_part_box_insert_before() and
385 * @ref edje_object_part_box_insert_after()
386 *
387 * @param[in] child The object to insert
388 * @param[in] pos The position where to insert child
389 *
390 * @return @c true: Successfully added. @c false: An error occurred.
391 *
392 * @ingroup Edje_Object
393 */
394EAPI Eina_Bool edje_object_part_box_insert_at(Edje_Object *obj, const char *part, Evas_Object *child, unsigned int pos);
395
396/**
397 * @brief Removes an object from the box.
398 *
399 * Removes from the box indicated by part, the object in the position pos.
400 *
401 * See also @ref edje_object_part_box_remove() and
402 * @ref edje_object_part_box_remove_all()
403 *
404 * @param[in] pos The position index of the object (starts counting from 0)
405 *
406 * @return Pointer to the object removed, or @c null.
407 *
408 * @ingroup Edje_Object
409 */
410EAPI Evas_Object *edje_object_part_box_remove_at(Edje_Object *obj, const char *part, unsigned int pos);
411
412/**
413 * @brief Removes an object from the box.
414 *
415 * Removes child from the box indicated by part.
416 *
417 * See also @ref edje_object_part_box_remove_at() and
418 * @ref edje_object_part_box_remove_all()
419 *
420 * @param[in] child The object to remove
421 *
422 * @return Pointer to the object removed, or @c null.
423 *
424 * @ingroup Edje_Object
425 */
426EAPI Evas_Object *edje_object_part_box_remove(Edje_Object *obj, const char *part, Evas_Object *child);
427
428/**
429 * @brief Removes all elements from the box.
430 *
431 * Removes all the external objects from the box indicated by part. Elements
432 * created from the theme will not be removed.
433 *
434 * See also @ref edje_object_part_box_remove() and
435 * @ref edje_object_part_box_remove_at()
436 *
437 * @param[in] clear Delete objects on removal
438 *
439 * @return 1: Successfully cleared. 0: An error occurred.
440 *
441 * @ingroup Edje_Object
442 */
443EAPI Eina_Bool edje_object_part_box_remove_all(Edje_Object *obj, const char *part, Eina_Bool clear);
303 444
304#include "edje_object.eo.legacy.h" 445#include "edje_object.eo.legacy.h"
305#include "edje_edit.eo.legacy.h" 446#include "edje_edit.eo.legacy.h"
diff --git a/src/lib/edje/edje_containers.c b/src/lib/edje/edje_containers.c
new file mode 100644
index 0000000000..e25509d2d2
--- /dev/null
+++ b/src/lib/edje/edje_containers.c
@@ -0,0 +1,304 @@
1#include "edje_private.h"
2
3#define EFL_CANVAS_LAYOUT_INTERNAL_BOX_PROTECTED
4
5#include "efl_canvas_layout_internal_box.eo.h"
6#include "../evas/canvas/evas_box.eo.h"
7#include "../evas/canvas/evas_line.eo.h"
8#include "../evas/canvas/evas_text.eo.h"
9
10#define BOX_CLASS EFL_CANVAS_LAYOUT_INTERNAL_BOX_CLASS
11
12typedef struct _Edje_Box_Data Edje_Box_Data;
13typedef struct _Box_Item_Iterator Box_Item_Iterator;
14
15struct _Edje_Box_Data
16{
17 Edje *ed;
18 Edje_Real_Part *rp;
19 const char *part;
20};
21
22struct _Box_Item_Iterator
23{
24 Eina_Iterator iterator;
25 Eina_List *list;
26 Eina_Iterator *real_iterator;
27 Eo *object;
28};
29
30static Eina_Bool
31_del_cb(void *data, const Eo_Event *event EINA_UNUSED)
32{
33 Edje_Real_Part *rp = data;
34 rp->typedata.container->eo_proxy = NULL;
35 return EO_CALLBACK_CONTINUE;
36}
37
38Eo *
39_edje_box_internal_proxy_get(Edje_Object *obj, Edje *ed, Edje_Real_Part *rp)
40{
41 Efl_Canvas_Layout_Internal_Box *eo = rp->typedata.container->eo_proxy;
42
43 if (eo) return eo;
44
45 eo = eo_add(BOX_CLASS, obj, efl_canvas_layout_internal_box_real_part_set(eo_self, ed, rp, rp->part->name));
46 eo_event_callback_add(eo, EO_BASE_EVENT_DEL, _del_cb, rp);
47
48 rp->typedata.container->eo_proxy = eo;
49 return eo;
50}
51
52EOLIAN static void
53_efl_canvas_layout_internal_box_real_part_set(Eo *obj EINA_UNUSED, Edje_Box_Data *pd, void *ed, void *rp, const char *part)
54{
55 pd->ed = ed;
56 pd->rp = rp;
57 pd->part = part;
58}
59
60EOLIAN static Eo_Base *
61_efl_canvas_layout_internal_box_eo_base_finalize(Eo *obj, Edje_Box_Data *pd)
62{
63 EINA_SAFETY_ON_FALSE_RETURN_VAL(pd->rp && pd->ed && pd->part, NULL);
64 return eo_finalize(eo_super(obj, BOX_CLASS));
65}
66
67/* Legacy features */
68
69EOLIAN static void
70_efl_canvas_layout_internal_box_efl_pack_pack_clear(Eo *obj EINA_UNUSED, Edje_Box_Data *pd)
71{
72 _edje_part_box_remove_all(pd->ed, pd->part, EINA_TRUE);
73}
74
75EOLIAN static void
76_efl_canvas_layout_internal_box_efl_pack_unpack_all(Eo *obj EINA_UNUSED, Edje_Box_Data *pd)
77{
78 _edje_part_box_remove_all(pd->ed, pd->part, EINA_FALSE);
79}
80
81EOLIAN static Eina_Bool
82_efl_canvas_layout_internal_box_efl_pack_unpack(Eo *obj EINA_UNUSED, Edje_Box_Data *pd, Efl_Gfx_Base *subobj)
83{
84 Evas_Object *removed;
85 removed = _edje_part_box_remove(pd->ed, pd->part, subobj);
86 return (removed == subobj);
87}
88
89EOLIAN static void
90_efl_canvas_layout_internal_box_efl_pack_pack(Eo *obj EINA_UNUSED, Edje_Box_Data *pd, Efl_Gfx_Base *subobj)
91{
92 _edje_part_box_append(pd->ed, pd->part, subobj);
93}
94
95EOLIAN static void
96_efl_canvas_layout_internal_box_efl_pack_linear_pack_begin(Eo *obj EINA_UNUSED, Edje_Box_Data *pd, Efl_Gfx_Base *subobj)
97{
98 _edje_part_box_prepend(pd->ed, pd->part, subobj);
99}
100
101EOLIAN static void
102_efl_canvas_layout_internal_box_efl_pack_linear_pack_end(Eo *obj EINA_UNUSED, Edje_Box_Data *pd, Efl_Gfx_Base *subobj)
103{
104 _edje_part_box_append(pd->ed, pd->part, subobj);
105}
106
107EOLIAN static Eina_Bool
108_efl_canvas_layout_internal_box_efl_pack_linear_pack_before(Eo *obj EINA_UNUSED, Edje_Box_Data *pd, Efl_Gfx_Base *subobj, const Efl_Gfx_Base *existing)
109{
110 return _edje_part_box_insert_before(pd->ed, pd->part, subobj, existing);
111}
112
113EOLIAN static Eina_Bool
114_efl_canvas_layout_internal_box_efl_pack_linear_pack_after(Eo *obj EINA_UNUSED, Edje_Box_Data *pd, Efl_Gfx_Base *subobj, const Efl_Gfx_Base *existing)
115{
116 return _edje_part_box_insert_after(pd->ed, pd->part, subobj, existing);
117}
118
119EOLIAN static void
120_efl_canvas_layout_internal_box_efl_pack_linear_pack_insert(Eo *obj, Edje_Box_Data *pd, Efl_Gfx_Base *subobj, int index)
121{
122 int cnt = efl_content_count(obj);
123 if ((index >= 0) && (index < cnt))
124 _edje_part_box_insert_at(pd->ed, pd->part, subobj, index);
125 else
126 _edje_part_box_append(pd->ed, pd->part, subobj);
127}
128
129EOLIAN static Efl_Gfx_Base *
130_efl_canvas_layout_internal_box_efl_pack_linear_content_at_remove(Eo *obj EINA_UNUSED, Edje_Box_Data *pd, int index)
131{
132 if (index < 0) index += efl_content_count(obj);
133 return _edje_part_box_remove_at(pd->ed, pd->part, index);
134}
135
136/* New APIs with Eo */
137
138EOLIAN static Efl_Gfx_Base *
139_efl_canvas_layout_internal_box_efl_pack_linear_content_at_get(Eo *obj EINA_UNUSED, Edje_Box_Data *pd, int index)
140{
141 if (index < 0) index += efl_content_count(obj);
142 return _edje_part_box_content_at(pd->ed, pd->part, index);
143}
144
145EOLIAN static Eina_Bool
146_efl_canvas_layout_internal_box_efl_container_content_remove(Eo *obj, Edje_Box_Data *pd EINA_UNUSED, Efl_Gfx_Base *subobj)
147{
148 return efl_pack_unpack(obj, subobj);
149}
150
151EOLIAN static int
152_efl_canvas_layout_internal_box_efl_pack_linear_content_index_get(Eo *obj EINA_UNUSED, Edje_Box_Data *pd, Efl_Gfx_Base * subobj)
153{
154 Evas_Object_Box_Option *opt;
155 Evas_Object_Box_Data *priv;
156 Eina_List *l;
157 int k = 0;
158
159 priv = eo_data_scope_get(pd->rp->object, EVAS_BOX_CLASS);
160 if (!priv) return -1;
161 EINA_LIST_FOREACH(priv->children, l, opt)
162 {
163 if (opt->obj == subobj)
164 return k;
165 k++;
166 }
167 return -1;
168}
169
170/* this iterator is the same as efl_ui_box */
171static Eina_Bool
172_box_item_iterator_next(Box_Item_Iterator *it, void **data)
173{
174 Efl_Gfx_Base *sub;
175
176 if (!eina_iterator_next(it->real_iterator, (void **) &sub))
177 return EINA_FALSE;
178
179 if (data) *data = sub;
180 return EINA_TRUE;
181}
182
183static Eo *
184_box_item_iterator_get_container(Box_Item_Iterator *it)
185{
186 return it->object;
187}
188
189static void
190_box_item_iterator_free(Box_Item_Iterator *it)
191{
192 eina_iterator_free(it->real_iterator);
193 eina_list_free(it->list);
194 eo_unref(it->object);
195 free(it);
196}
197
198EOLIAN static Eina_Iterator *
199_efl_canvas_layout_internal_box_efl_container_content_iterate(Eo *obj, Edje_Box_Data *pd)
200{
201 Box_Item_Iterator *it;
202
203 if (!pd->rp->typedata.container) return NULL;
204
205 it = calloc(1, sizeof(*it));
206 if (!it) return NULL;
207
208 EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR);
209
210 it->list = evas_object_box_children_get(pd->rp->object);
211 it->real_iterator = eina_list_iterator_new(it->list);
212 it->iterator.version = EINA_ITERATOR_VERSION;
213 it->iterator.next = FUNC_ITERATOR_NEXT(_box_item_iterator_next);
214 it->iterator.get_container = FUNC_ITERATOR_GET_CONTAINER(_box_item_iterator_get_container);
215 it->iterator.free = FUNC_ITERATOR_FREE(_box_item_iterator_free);
216 it->object = eo_ref(obj);
217
218 return &it->iterator;
219}
220
221EOLIAN static int
222_efl_canvas_layout_internal_box_efl_container_content_count(Eo *obj EINA_UNUSED, Edje_Box_Data *pd)
223{
224 if (!pd->rp->typedata.container) return 0;
225 return evas_obj_box_count(pd->rp->object);
226}
227
228/* Legacy API implementation */
229
230#define PART_BOX_GET(obj, part, ...) ({ \
231 Eo *__box = efl_content_get(obj, part); \
232 if (!__box || !eo_isa(__box, EFL_CANVAS_LAYOUT_INTERNAL_BOX_CLASS)) \
233 { \
234 ERR("No such box part '%s' in layout %p", part, obj); \
235 return __VA_ARGS__; \
236 } \
237 __box; })
238
239EAPI Eina_Bool
240edje_object_part_box_append(Edje_Object *obj, const char *part, Evas_Object *child)
241{
242 Eo *box = PART_BOX_GET(obj, part, EINA_FALSE);
243 efl_pack_end(box, child);
244 return EINA_TRUE;
245}
246
247EAPI Eina_Bool
248edje_object_part_box_prepend(Edje_Object *obj, const char *part, Evas_Object *child)
249{
250 Eo *box = PART_BOX_GET(obj, part, EINA_FALSE);
251 efl_pack_begin(box, child);
252 return EINA_TRUE;
253}
254
255EAPI Eina_Bool
256edje_object_part_box_insert_before(Edje_Object *obj, const char *part, Evas_Object *child, const Evas_Object *reference)
257{
258 Eo *box = PART_BOX_GET(obj, part, EINA_FALSE);
259 return efl_pack_before(box, child, reference);
260}
261
262EAPI Eina_Bool
263edje_object_part_box_insert_after(Edje_Object *obj, const char *part, Evas_Object *child, const Evas_Object *reference)
264{
265 Eo *box = PART_BOX_GET(obj, part, EINA_FALSE);
266 return efl_pack_after(box, child, reference);
267}
268
269EAPI Eina_Bool
270edje_object_part_box_insert_at(Edje_Object *obj, const char *part, Evas_Object *child, unsigned int pos)
271{
272 Eo *box = PART_BOX_GET(obj, part, EINA_FALSE);
273 efl_pack_insert(box, child, pos);
274 return EINA_TRUE;
275}
276
277EAPI Evas_Object *
278edje_object_part_box_remove_at(Edje_Object *obj, const char *part, unsigned int pos)
279{
280 Eo *box = PART_BOX_GET(obj, part, NULL);
281 return efl_pack_content_at_remove(box, pos);
282}
283
284EAPI Evas_Object *
285edje_object_part_box_remove(Edje_Object *obj, const char *part, Evas_Object *child)
286{
287 Eo *box = PART_BOX_GET(obj, part, NULL);
288 if (efl_pack_unpack(box, child))
289 return child;
290 return NULL;
291}
292
293EAPI Eina_Bool
294edje_object_part_box_remove_all(Edje_Object *obj, const char *part, Eina_Bool clear)
295{
296 Eo *box = PART_BOX_GET(obj, part, EINA_FALSE);
297 if (clear)
298 efl_pack_clear(box);
299 else
300 efl_pack_unpack_all(box);
301 return EINA_TRUE;
302}
303
304#include "efl_canvas_layout_internal_box.eo.c"
diff --git a/src/lib/edje/edje_load.c b/src/lib/edje/edje_load.c
index 16bc5ee935..1aff5c995f 100644
--- a/src/lib/edje/edje_load.c
+++ b/src/lib/edje/edje_load.c
@@ -1582,6 +1582,7 @@ _edje_file_del(Edje *ed)
1582 _edje_box_layout_free_data(rp->typedata.container->anim); 1582 _edje_box_layout_free_data(rp->typedata.container->anim);
1583 rp->typedata.container->anim = NULL; 1583 rp->typedata.container->anim = NULL;
1584 } 1584 }
1585 eo_del(rp->typedata.container->eo_proxy);
1585 free(rp->typedata.container); 1586 free(rp->typedata.container);
1586 } 1587 }
1587 else if ((rp->type == EDJE_RP_TYPE_TEXT) && 1588 else if ((rp->type == EDJE_RP_TYPE_TEXT) &&
diff --git a/src/lib/edje/edje_object.eo b/src/lib/edje/edje_object.eo
index a214e5db48..7930cd94bd 100644
--- a/src/lib/edje/edje_object.eo
+++ b/src/lib/edje/edje_object.eo
@@ -730,20 +730,6 @@ class Edje.Object (Evas.Smart_Clipped, Efl.File, Efl.Container)
730 @in text: const(char)*; [[The text string]] 730 @in text: const(char)*; [[The text string]]
731 } 731 }
732 } 732 }
733 part_box_remove_at {
734 [[Removes an object from the box.
735
736 Removes from the box indicated by part, the object in the position
737 pos.
738
739 See also @.part_box_remove() and @.part_box_remove_all()]]
740
741 return: Evas.Object *; [[Pointer to the object removed, or $null.]]
742 params {
743 @in part: const(char)*; [[The part name]]
744 @in pos: uint; [[The position index of the object (starts counting from 0)]]
745 }
746 }
747 part_text_cursor_copy { 733 part_text_cursor_copy {
748 [[Copy the cursor to another cursor.]] 734 [[Copy the cursor to another cursor.]]
749 735
@@ -1021,23 +1007,6 @@ class Edje.Object (Evas.Smart_Clipped, Efl.File, Efl.Container)
1021 @in part: const(char)*; [[The part name]] 1007 @in part: const(char)*; [[The part name]]
1022 } 1008 }
1023 } 1009 }
1024 part_box_insert_at {
1025 [[Inserts an object to the box.
1026
1027 Adds child to the box indicated by part, in the position given by
1028 pos.
1029
1030 See also @.part_box_append(), @.part_box_prepend(),
1031 @.part_box_insert_before() and @.part_box_insert_after()]]
1032
1033 return: bool; [[$true: Successfully added.
1034 $false: An error occurred.]]
1035 params {
1036 @in part: const(char)*; [[The part name]]
1037 @in child: Evas.Object *; [[The object to insert]]
1038 @in pos: uint; [[The position where to insert child]]
1039 }
1040 }
1041 part_text_anchor_geometry_get @const { 1010 part_text_anchor_geometry_get @const {
1042 [[Return a list of Evas_Textblock_Rectangle anchor rectangles. 1011 [[Return a list of Evas_Textblock_Rectangle anchor rectangles.
1043 1012
@@ -1090,21 +1059,6 @@ class Edje.Object (Evas.Smart_Clipped, Efl.File, Efl.Container)
1090 @out dy: double; [[The dy page increment pointer]] 1059 @out dy: double; [[The dy page increment pointer]]
1091 } 1060 }
1092 } 1061 }
1093 part_box_prepend {
1094 [[Prepends an object to the box.
1095
1096 Prepends child to the box indicated by part.
1097
1098 See also @.part_box_append(), @.part_box_insert_before(),
1099 @.part_box_insert_after and @.part_box_insert_at()]]
1100
1101 return: bool; [[$true: Successfully added.
1102 $false: An error occurred.]]
1103 params {
1104 @in part: const(char)*; [[The part name]]
1105 @in child: Evas.Object *; [[The object to prepend]]
1106 }
1107 }
1108 signal_emit { 1062 signal_emit {
1109 [[Send/emit an Edje signal to a given Edje object 1063 [[Send/emit an Edje signal to a given Edje object
1110 1064
@@ -1502,19 +1456,6 @@ class Edje.Object (Evas.Smart_Clipped, Efl.File, Efl.Container)
1502 be processed only at idle time.]] 1456 be processed only at idle time.]]
1503 1457
1504 } 1458 }
1505 part_box_remove {
1506 [[Removes an object from the box.
1507
1508 Removes child from the box indicated by part.
1509
1510 See also @.part_box_remove_at() and @.part_box_remove_all()]]
1511
1512 return: Evas.Object *; [[Pointer to the object removed, or $null.]]
1513 params {
1514 @in part: const(char)*; [[The part name]]
1515 @in child: Evas.Object *; [[The object to remove]]
1516 }
1517 }
1518 thaw { 1459 thaw {
1519 [[Thaws the Edje object. 1460 [[Thaws the Edje object.
1520 1461
@@ -1570,40 +1511,6 @@ class Edje.Object (Evas.Smart_Clipped, Efl.File, Efl.Container)
1570 @in row: uint; [[The row of the child to get]] 1511 @in row: uint; [[The row of the child to get]]
1571 } 1512 }
1572 } 1513 }
1573 part_box_insert_before {
1574 [[Adds an object to the box.
1575
1576 Inserts child in the box given by part, in the position marked by
1577 reference.
1578
1579 See also @.part_box_append(), @.part_box_prepend(),
1580 @.part_box_insert_after() and @.part_box_insert_at()]]
1581
1582 return: bool; [[$true: Successfully added.
1583 $false: An error occurred.]]
1584 params {
1585 @in part: const(char)*; [[The part name]]
1586 @in child: Evas.Object *; [[The object to insert]]
1587 @in reference: const(Evas.Object)*; [[The object to be used as reference]]
1588 }
1589 }
1590 part_box_insert_after {
1591 [[Adds an object to the box.
1592
1593 Inserts child in the box given by part, in the position marked by
1594 reference.
1595
1596 See also @.part_box_append(), @.part_box_prepend(),
1597 @.part_box_insert_before() and @.part_box_insert_at()]]
1598
1599 return: bool; [[$true: Successfully added.
1600 $false: An error occurred.]]
1601 params {
1602 @in part: const(char)*; [[The part name]]
1603 @in child: Evas.Object *; [[The object to insert]]
1604 @in reference: const(Evas.Object)*; [[The object to be used as reference]]
1605 }
1606 }
1607 part_external_param_set { 1514 part_external_param_set {
1608 [[Set the parameter for the external part. 1515 [[Set the parameter for the external part.
1609 1516
@@ -1675,21 +1582,6 @@ class Edje.Object (Evas.Smart_Clipped, Efl.File, Efl.Container)
1675 required height]] 1582 required height]]
1676 } 1583 }
1677 } 1584 }
1678 part_box_append {
1679 [[Appends an object to the box.
1680
1681 Appends child to the box indicated by part.
1682
1683 See also @.part_box_prepend(), @.part_box_insert_before(),
1684 @.part_box_insert_after() and @.part_box_insert_at()]]
1685
1686 return: bool; [[$true: Successfully added.
1687 $false: An error occurred.]]
1688 params {
1689 @in part: const(char)*; [[The part name]]
1690 @in child: Evas.Object *; [[The object to append]]
1691 }
1692 }
1693 size_min_restricted_calc { 1585 size_min_restricted_calc {
1694 [[Calculate the minimum required size for a given Edje object. 1586 [[Calculate the minimum required size for a given Edje object.
1695 1587
@@ -1718,21 +1610,6 @@ class Edje.Object (Evas.Smart_Clipped, Efl.File, Efl.Container)
1718 height to be less than this value]] 1610 height to be less than this value]]
1719 } 1611 }
1720 } 1612 }
1721 part_box_remove_all {
1722 [[Removes all elements from the box.
1723
1724 Removes all the external objects from the box indicated by part.
1725 Elements created from the theme will not be removed.
1726
1727 See also @.part_box_remove() and @.part_box_remove_at()]]
1728
1729 return: bool; [[1: Successfully cleared.
1730 0: An error occurred.]]
1731 params {
1732 @in part: const(char)*; [[The part name]]
1733 @in clear: bool; [[Delete objects on removal]]
1734 }
1735 }
1736 part_drag_page { 1613 part_drag_page {
1737 [[Pages x,y steps. 1614 [[Pages x,y steps.
1738 1615
diff --git a/src/lib/edje/edje_private.h b/src/lib/edje/edje_private.h
index eeafeaf449..1e0f420bfc 100644
--- a/src/lib/edje/edje_private.h
+++ b/src/lib/edje/edje_private.h
@@ -1898,6 +1898,7 @@ struct _Edje_Real_Part_Container
1898{ 1898{
1899 Eina_List *items; // 4 //FIXME: only if table/box 1899 Eina_List *items; // 4 //FIXME: only if table/box
1900 Edje_Part_Box_Animation *anim; // 4 //FIXME: Used only if box 1900 Edje_Part_Box_Animation *anim; // 4 //FIXME: Used only if box
1901 Eo *eo_proxy;
1901}; 1902};
1902 1903
1903struct _Edje_Real_Part_Swallow 1904struct _Edje_Real_Part_Swallow
@@ -2430,6 +2431,7 @@ Eina_Bool _edje_real_part_box_prepend(Edje *ed, Edje_Real_Part *rp, Evas
2430Eina_Bool _edje_real_part_box_insert_before(Edje *ed, Edje_Real_Part *rp, Evas_Object *child_obj, const Evas_Object *ref); 2431Eina_Bool _edje_real_part_box_insert_before(Edje *ed, Edje_Real_Part *rp, Evas_Object *child_obj, const Evas_Object *ref);
2431Eina_Bool _edje_real_part_box_insert_after(Edje *ed, Edje_Real_Part *rp, Evas_Object *child_obj, const Evas_Object *ref); 2432Eina_Bool _edje_real_part_box_insert_after(Edje *ed, Edje_Real_Part *rp, Evas_Object *child_obj, const Evas_Object *ref);
2432Eina_Bool _edje_real_part_box_insert_at(Edje *ed, Edje_Real_Part *rp, Evas_Object *child_obj, unsigned int pos); 2433Eina_Bool _edje_real_part_box_insert_at(Edje *ed, Edje_Real_Part *rp, Evas_Object *child_obj, unsigned int pos);
2434Evas_Object *_edje_real_part_box_content_at(Edje *ed, Edje_Real_Part *rp, unsigned int pos);
2433Evas_Object *_edje_real_part_box_remove(Edje *ed, Edje_Real_Part *rp, Evas_Object *child_obj); 2435Evas_Object *_edje_real_part_box_remove(Edje *ed, Edje_Real_Part *rp, Evas_Object *child_obj);
2434Evas_Object *_edje_real_part_box_remove_at(Edje *ed, Edje_Real_Part *rp, unsigned int pos); 2436Evas_Object *_edje_real_part_box_remove_at(Edje *ed, Edje_Real_Part *rp, unsigned int pos);
2435Eina_Bool _edje_real_part_box_remove_all(Edje *ed, Edje_Real_Part *rp, Eina_Bool clear); 2437Eina_Bool _edje_real_part_box_remove_all(Edje *ed, Edje_Real_Part *rp, Eina_Bool clear);
@@ -2939,6 +2941,18 @@ void _edje_part_ignore_flags_set(Edje *ed, Edje_Real_Part *rp, Evas_Event_Flags
2939Evas_Event_Flags _edje_part_mask_flags_get(Edje *ed, Edje_Real_Part *rp); 2941Evas_Event_Flags _edje_part_mask_flags_get(Edje *ed, Edje_Real_Part *rp);
2940void _edje_part_mask_flags_set(Edje *ed, Edje_Real_Part *rp, Evas_Event_Flags mask_flags); 2942void _edje_part_mask_flags_set(Edje *ed, Edje_Real_Part *rp, Evas_Event_Flags mask_flags);
2941 2943
2944/* part containers */
2945Eo *_edje_box_internal_proxy_get(Edje_Object *obj, Edje *ed, Edje_Real_Part *rp);
2946Eina_Bool _edje_part_box_append(Edje *ed, const char *part, Evas_Object *child);
2947Eina_Bool _edje_part_box_prepend(Edje *ed, const char *part, Evas_Object *child);
2948Eina_Bool _edje_part_box_insert_before(Edje *ed, const char *part, Evas_Object *child, const Evas_Object *reference);
2949Eina_Bool _edje_part_box_insert_after(Edje *ed, const char *part, Evas_Object *child, const Evas_Object *reference);
2950Eina_Bool _edje_part_box_insert_at(Edje *ed, const char *part, Evas_Object *child, unsigned int pos);
2951Evas_Object *_edje_part_box_content_at(Edje *ed, const char *part, unsigned int pos);
2952Evas_Object *_edje_part_box_remove(Edje *ed, const char *part, Evas_Object *child);
2953Evas_Object *_edje_part_box_remove_at(Edje *ed, const char *part, unsigned int pos);
2954Eina_Bool _edje_part_box_remove_all(Edje *ed, const char *part, Eina_Bool clear);
2955
2942#ifdef HAVE_LIBREMIX 2956#ifdef HAVE_LIBREMIX
2943#include <remix/remix.h> 2957#include <remix/remix.h>
2944#endif 2958#endif
diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c
index 8f7899f022..223c0b1131 100644
--- a/src/lib/edje/edje_util.c
+++ b/src/lib/edje/edje_util.c
@@ -3875,7 +3875,7 @@ _edje_object_efl_container_content_remove(Eo *obj EINA_UNUSED, Edje *ed, Evas_Ob
3875} 3875}
3876 3876
3877EOLIAN Efl_Gfx_Base * 3877EOLIAN Efl_Gfx_Base *
3878_edje_object_efl_container_content_get(Eo *obj EINA_UNUSED, Edje *ed, const char *part) 3878_edje_object_efl_container_content_get(Eo *obj, Edje *ed, const char *part)
3879{ 3879{
3880 Edje_Real_Part *rp; 3880 Edje_Real_Part *rp;
3881 3881
@@ -3886,10 +3886,20 @@ _edje_object_efl_container_content_get(Eo *obj EINA_UNUSED, Edje *ed, const char
3886 3886
3887 rp = _edje_real_part_recursive_get(&ed, part); 3887 rp = _edje_real_part_recursive_get(&ed, part);
3888 if (!rp) return NULL; 3888 if (!rp) return NULL;
3889 if ((rp->type != EDJE_RP_TYPE_SWALLOW) ||
3890 (!rp->typedata.swallow)) return NULL;
3891 3889
3892 return rp->typedata.swallow->swallowed_object; 3890 switch (rp->type)
3891 {
3892 case EDJE_RP_TYPE_SWALLOW:
3893 if (!rp->typedata.swallow) return NULL;
3894 return rp->typedata.swallow->swallowed_object;
3895 case EDJE_RP_TYPE_CONTAINER:
3896 return _edje_box_internal_proxy_get(obj, ed, rp);
3897 case EDJE_RP_TYPE_TEXT:
3898 WRN("not implemented yet");
3899 return NULL;
3900 default:
3901 return NULL;
3902 }
3893} 3903}
3894 3904
3895/* new in eo */ 3905/* new in eo */
@@ -4713,8 +4723,8 @@ _edje_box_shutdown(void)
4713 _edje_box_layout_registry = NULL; 4723 _edje_box_layout_registry = NULL;
4714} 4724}
4715 4725
4716EOLIAN Eina_Bool 4726Eina_Bool
4717_edje_object_part_box_append(Eo *obj EINA_UNUSED, Edje *ed, const char *part, Evas_Object *child) 4727_edje_part_box_append(Edje *ed, const char *part, Evas_Object *child)
4718{ 4728{
4719 Eina_Bool ret; 4729 Eina_Bool ret;
4720 Edje_Real_Part *rp; 4730 Edje_Real_Part *rp;
@@ -4742,8 +4752,8 @@ _edje_object_part_box_append(Eo *obj EINA_UNUSED, Edje *ed, const char *part, Ev
4742 return ret; 4752 return ret;
4743} 4753}
4744 4754
4745EOLIAN Eina_Bool 4755Eina_Bool
4746_edje_object_part_box_prepend(Eo *obj EINA_UNUSED, Edje *ed, const char *part, Evas_Object *child) 4756_edje_part_box_prepend(Edje *ed, const char *part, Evas_Object *child)
4747{ 4757{
4748 Eina_Bool ret; 4758 Eina_Bool ret;
4749 Edje_Real_Part *rp; 4759 Edje_Real_Part *rp;
@@ -4770,8 +4780,8 @@ _edje_object_part_box_prepend(Eo *obj EINA_UNUSED, Edje *ed, const char *part, E
4770 return ret; 4780 return ret;
4771} 4781}
4772 4782
4773EOLIAN Eina_Bool 4783Eina_Bool
4774_edje_object_part_box_insert_before(Eo *obj EINA_UNUSED, Edje *ed, const char *part, Evas_Object *child, const Evas_Object *reference) 4784_edje_part_box_insert_before(Edje *ed, const char *part, Evas_Object *child, const Evas_Object *reference)
4775{ 4785{
4776 Eina_Bool ret; 4786 Eina_Bool ret;
4777 Edje_Real_Part *rp; 4787 Edje_Real_Part *rp;
@@ -4798,8 +4808,8 @@ _edje_object_part_box_insert_before(Eo *obj EINA_UNUSED, Edje *ed, const char *p
4798 return ret; 4808 return ret;
4799} 4809}
4800 4810
4801EOLIAN Eina_Bool 4811Eina_Bool
4802_edje_object_part_box_insert_after(Eo *obj EINA_UNUSED, Edje *ed, const char *part, Evas_Object *child, const Evas_Object *reference) 4812_edje_part_box_insert_after(Edje *ed, const char *part, Evas_Object *child, const Evas_Object *reference)
4803{ 4813{
4804 Eina_Bool ret; 4814 Eina_Bool ret;
4805 Edje_Real_Part *rp; 4815 Edje_Real_Part *rp;
@@ -4826,8 +4836,8 @@ _edje_object_part_box_insert_after(Eo *obj EINA_UNUSED, Edje *ed, const char *pa
4826 return ret; 4836 return ret;
4827} 4837}
4828 4838
4829EOLIAN Eina_Bool 4839Eina_Bool
4830_edje_object_part_box_insert_at(Eo *obj EINA_UNUSED, Edje *ed, const char *part, Evas_Object *child, unsigned int pos) 4840_edje_part_box_insert_at(Edje *ed, const char *part, Evas_Object *child, unsigned int pos)
4831{ 4841{
4832 Eina_Bool ret; 4842 Eina_Bool ret;
4833 Edje_Real_Part *rp; 4843 Edje_Real_Part *rp;
@@ -4854,8 +4864,8 @@ _edje_object_part_box_insert_at(Eo *obj EINA_UNUSED, Edje *ed, const char *part,
4854 return ret; 4864 return ret;
4855} 4865}
4856 4866
4857EOLIAN Evas_Object * 4867Evas_Object *
4858_edje_object_part_box_remove(Eo *obj EINA_UNUSED, Edje *ed, const char *part, Evas_Object *child) 4868_edje_part_box_remove(Edje *ed, const char *part, Evas_Object *child)
4859{ 4869{
4860 Edje_Real_Part *rp; 4870 Edje_Real_Part *rp;
4861 Evas_Object *r; 4871 Evas_Object *r;
@@ -4883,8 +4893,8 @@ _edje_object_part_box_remove(Eo *obj EINA_UNUSED, Edje *ed, const char *part, Ev
4883 return r; 4893 return r;
4884} 4894}
4885 4895
4886EOLIAN Evas_Object * 4896Evas_Object *
4887_edje_object_part_box_remove_at(Eo *obj EINA_UNUSED, Edje *ed, const char *part, unsigned int pos) 4897_edje_part_box_remove_at(Edje *ed, const char *part, unsigned int pos)
4888{ 4898{
4889 Edje_Real_Part *rp; 4899 Edje_Real_Part *rp;
4890 Evas_Object *r; 4900 Evas_Object *r;
@@ -4912,8 +4922,24 @@ _edje_object_part_box_remove_at(Eo *obj EINA_UNUSED, Edje *ed, const char *part,
4912 return r; 4922 return r;
4913} 4923}
4914 4924
4915EOLIAN Eina_Bool 4925Evas_Object *
4916_edje_object_part_box_remove_all(Eo *obj EINA_UNUSED, Edje *ed, const char *part, Eina_Bool clear) 4926_edje_part_box_content_at(Edje *ed, const char *part, unsigned int pos)
4927{
4928 Edje_Real_Part *rp;
4929 Evas_Object *r;
4930
4931 if ((!ed) || (!part)) return NULL;
4932
4933 rp = _edje_real_part_recursive_get(&ed, part);
4934 if (!rp) return NULL;
4935 if (rp->part->type != EDJE_PART_TYPE_BOX) return NULL;
4936
4937 r = _edje_real_part_box_content_at(ed, rp, pos);
4938 return r;
4939}
4940
4941Eina_Bool
4942_edje_part_box_remove_all(Edje *ed, const char *part, Eina_Bool clear)
4917{ 4943{
4918 Eina_Bool ret; 4944 Eina_Bool ret;
4919 Edje_Real_Part *rp; 4945 Edje_Real_Part *rp;
@@ -5190,6 +5216,18 @@ _edje_real_part_box_insert_at(Edje *ed, Edje_Real_Part *rp, Evas_Object *child_o
5190} 5216}
5191 5217
5192Evas_Object * 5218Evas_Object *
5219_edje_real_part_box_content_at(Edje *ed EINA_UNUSED, Edje_Real_Part *rp, unsigned int pos)
5220{
5221 Evas_Object_Box_Option *opt;
5222 Evas_Object_Box_Data *priv;
5223
5224 priv = eo_data_scope_get(rp->object, EVAS_BOX_CLASS);
5225 opt = eina_list_nth(priv->children, pos);
5226 if (!opt) return NULL;
5227 return opt->obj;
5228}
5229
5230Evas_Object *
5193_edje_real_part_box_remove(Edje *ed, Edje_Real_Part *rp, Evas_Object *child_obj) 5231_edje_real_part_box_remove(Edje *ed, Edje_Real_Part *rp, Evas_Object *child_obj)
5194{ 5232{
5195 if (evas_object_data_get(child_obj, "\377 edje.box_item")) return NULL; 5233 if (evas_object_data_get(child_obj, "\377 edje.box_item")) return NULL;
diff --git a/src/lib/edje/efl_canvas_layout_internal_box.eo b/src/lib/edje/efl_canvas_layout_internal_box.eo
new file mode 100644
index 0000000000..a8443d3b5e
--- /dev/null
+++ b/src/lib/edje/efl_canvas_layout_internal_box.eo
@@ -0,0 +1,38 @@
1class Efl.Canvas.Layout_Internal.Box (Eo.Base, Efl.Pack_Linear)
2{
3 [[Represents a Box created as part of a layout.
4
5 Can not be deleted, this is only a representation of an internal object
6 of an EFL layout.
7 ]]
8 legacy_prefix: null;
9 data: Edje_Box_Data;
10 methods {
11 @property real_part @protected {
12 set {}
13 values {
14 ed: void*;
15 rp: void*;
16 part: const(char)*;
17 }
18 }
19 }
20 implements {
21 Eo.Base.finalize;
22 Efl.Container.content_iterate;
23 Efl.Container.content_count;
24 Efl.Container.content_remove;
25 Efl.Pack.pack_clear;
26 Efl.Pack.unpack_all;
27 Efl.Pack.unpack;
28 Efl.Pack.pack;
29 Efl.Pack_Linear.pack_begin;
30 Efl.Pack_Linear.pack_end;
31 Efl.Pack_Linear.pack_before;
32 Efl.Pack_Linear.pack_after;
33 Efl.Pack_Linear.pack_insert;
34 Efl.Pack_Linear.content_at.get;
35 Efl.Pack_Linear.content_at_remove;
36 Efl.Pack_Linear.content_index.get;
37 }
38}
diff --git a/src/lib/evas/canvas/evas_box.eo b/src/lib/evas/canvas/evas_box.eo
index 3f3069e21c..16dcc6cf9a 100644
--- a/src/lib/evas/canvas/evas_box.eo
+++ b/src/lib/evas/canvas/evas_box.eo
@@ -646,7 +646,11 @@ class Evas.Box (Evas.Smart_Clipped)
646 priv: Evas_Object_Box_Data *; 646 priv: Evas_Object_Box_Data *;
647 data: void *; 647 data: void *;
648 } 648 }
649 649 }
650 count {
651 [[Returns the number of items in the box.]]
652 legacy: null;
653 return: int;
650 } 654 }
651 } 655 }
652 implements { 656 implements {
diff --git a/src/lib/evas/canvas/evas_object_box.c b/src/lib/evas/canvas/evas_object_box.c
index 55e7ca5943..38216a719d 100644
--- a/src/lib/evas/canvas/evas_object_box.c
+++ b/src/lib/evas/canvas/evas_object_box.c
@@ -1900,6 +1900,13 @@ evas_object_box_children_get(const Evas_Object *o)
1900 return new_list; 1900 return new_list;
1901} 1901}
1902 1902
1903EOLIAN static int
1904_evas_box_count(Eo *o, Evas_Object_Box_Data *_pd EINA_UNUSED)
1905{
1906 EVAS_OBJECT_BOX_DATA_GET_OR_RETURN_VAL(o, priv, 0);
1907 return eina_list_count(priv->children);
1908}
1909
1903EOLIAN static const char* 1910EOLIAN static const char*
1904_evas_box_option_property_name_get(const Eo *o EINA_UNUSED, Evas_Object_Box_Data *_pd EINA_UNUSED, int property EINA_UNUSED) 1911_evas_box_option_property_name_get(const Eo *o EINA_UNUSED, Evas_Object_Box_Data *_pd EINA_UNUSED, int property EINA_UNUSED)
1905{ 1912{
diff --git a/src/tests/edje/edje_test_edje.c b/src/tests/edje/edje_test_edje.c
index 3bd890e3fb..1ac5971da3 100644
--- a/src/tests/edje/edje_test_edje.c
+++ b/src/tests/edje/edje_test_edje.c
@@ -494,10 +494,76 @@ START_TEST(edje_test_box)
494} 494}
495END_TEST 495END_TEST
496 496
497START_TEST(edje_test_box_eoapi)
498{
499 Evas *evas;
500 Evas_Object *obj, *sobj, *sobjs[5];
501 Eina_Iterator *it;
502 Eo *box;
503 int i;
504
505 evas = EDJE_TEST_INIT_EVAS();
506
507 obj = edje_object_add(evas);
508 fail_unless(edje_object_file_set(obj, test_layout_get("test_box.edj"), "test_group"));
509
510 for (i = 0; i < 5; i++)
511 {
512 sobjs[i] = evas_object_rectangle_add(evas);
513 fail_if(!sobjs[i]);
514 }
515
516 /* same test case as legacy api above */
517 box = efl_content_get(obj, "box");
518 fail_if(!box);
519
520 efl_pack_end(box, sobjs[3]);
521 efl_pack_begin(box, sobjs[1]);
522 efl_pack_before(box, sobjs[0], sobjs[1]);
523 efl_pack_after(box, sobjs[4], sobjs[3]);
524 efl_pack_insert(box, sobjs[2], 2);
525 fail_if(efl_content_count(box) != 5);
526
527 it = efl_content_iterate(box);
528 i = 0;
529 EINA_ITERATOR_FOREACH(it, sobj)
530 fail_if(sobj != sobjs[i++]);
531 fail_if(i != 5);
532 eina_iterator_free(it);
533
534 /* clear up and test a bit more */
535 efl_pack_unpack_all(box);
536 fail_if(efl_content_count(box) != 0);
537
538 efl_pack(box, sobjs[1]);
539 efl_pack_insert(box, sobjs[0], 0);
540 efl_pack_insert(box, sobjs[2], -1);
541 it = efl_content_iterate(box);
542 i = 0;
543 EINA_ITERATOR_FOREACH(it, sobj)
544 fail_if(sobj != sobjs[i++]);
545 fail_if(i != 3);
546 eina_iterator_free(it);
547
548 fail_if(!efl_content_remove(box, sobjs[0]));
549 fail_if(efl_content_count(box) != 2);
550 fail_if(!efl_pack_content_at_remove(box, 1));
551 fail_if(efl_content_count(box) != 1);
552 fail_if(efl_pack_content_index_get(box, sobjs[1]) != 0);
553
554 efl_pack_clear(box);
555 fail_if(efl_content_count(box) != 0);
556
557 eo_del(box);
558
559 EDJE_TEST_FREE_EVAS();
560}
561END_TEST
562
497void edje_test_edje(TCase *tc) 563void edje_test_edje(TCase *tc)
498{ 564{
499 tcase_add_test(tc, edje_test_edje_init); 565 tcase_add_test(tc, edje_test_edje_init);
500 tcase_add_test(tc,edje_test_load_simple_layout); 566 tcase_add_test(tc, edje_test_load_simple_layout);
501 tcase_add_test(tc, edje_test_edje_load); 567 tcase_add_test(tc, edje_test_edje_load);
502 tcase_add_test(tc, edje_test_simple_layout_geometry); 568 tcase_add_test(tc, edje_test_simple_layout_geometry);
503 tcase_add_test(tc, edje_test_complex_layout); 569 tcase_add_test(tc, edje_test_complex_layout);
@@ -511,4 +577,5 @@ void edje_test_edje(TCase *tc)
511 tcase_add_test(tc, edje_test_swallows_eoapi); 577 tcase_add_test(tc, edje_test_swallows_eoapi);
512 tcase_add_test(tc, edje_test_access); 578 tcase_add_test(tc, edje_test_access);
513 tcase_add_test(tc, edje_test_box); 579 tcase_add_test(tc, edje_test_box);
580 tcase_add_test(tc, edje_test_box_eoapi);
514} 581}