summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-05-26 10:52:57 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-05-29 10:49:17 +0900
commit42403cd3df85101daedf69f4d782d21855bd50e0 (patch)
tree3b71be53612ecf17648e6d32dd801edce672d880
parent7c3e732f8c567cbc0905711b5f10aa465a5b6170 (diff)
edje: Refactor a bit internal parts for edje objects (EO)
1. Make internal part "real_part_set" an internal function (EO) 2. Use a common class rather than an interface: - Cost: 1 extra call to efl_data_scope_get() as we don't have the data inside the EO function call implementation. - Gain: Ability to implement common code, such as part_geometry_get
-rw-r--r--src/lib/edje/edje_part.c7
-rw-r--r--src/lib/edje/edje_part_box.c57
-rw-r--r--src/lib/edje/edje_part_helper.h30
-rw-r--r--src/lib/edje/edje_part_swallow.c18
-rw-r--r--src/lib/edje/edje_part_table.c48
-rw-r--r--src/lib/edje/efl_canvas_layout_internal.eo18
-rw-r--r--src/lib/edje/efl_canvas_layout_internal_box.eo5
-rw-r--r--src/lib/edje/efl_canvas_layout_internal_swallow.eo5
-rw-r--r--src/lib/edje/efl_canvas_layout_internal_table.eo5
9 files changed, 117 insertions, 76 deletions
diff --git a/src/lib/edje/edje_part.c b/src/lib/edje/edje_part.c
index 12da019aa7..ab8b532f67 100644
--- a/src/lib/edje/edje_part.c
+++ b/src/lib/edje/edje_part.c
@@ -13,4 +13,11 @@ _edje_internal_proxy_shutdown(void)
13 _swallow_shutdown(); 13 _swallow_shutdown();
14} 14}
15 15
16/* Internal EO API */
17
18EOAPI EFL_VOID_FUNC_BODYV(_efl_canvas_layout_internal_real_part_set, EFL_FUNC_CALL(ed, rp, part), void *ed, void *rp, const char *part)
19
20#define EFL_CANVAS_LAYOUT_INTERNAL_EXTRA_OPS \
21 EFL_OBJECT_OP_FUNC(_efl_canvas_layout_internal_real_part_set, NULL)
22
16#include "efl_canvas_layout_internal.eo.c" 23#include "efl_canvas_layout_internal.eo.c"
diff --git a/src/lib/edje/edje_part_box.c b/src/lib/edje/edje_part_box.c
index c05a1a74f8..701971d144 100644
--- a/src/lib/edje/edje_part_box.c
+++ b/src/lib/edje/edje_part_box.c
@@ -1,13 +1,11 @@
1#include "edje_private.h" 1#include "edje_private.h"
2#include "edje_part_helper.h" 2#include "edje_part_helper.h"
3
4#define EFL_CANVAS_LAYOUT_INTERNAL_BOX_PROTECTED
5#include "efl_canvas_layout_internal_box.eo.h" 3#include "efl_canvas_layout_internal_box.eo.h"
6#define MY_CLASS EFL_CANVAS_LAYOUT_INTERNAL_BOX_CLASS 4#define MY_CLASS EFL_CANVAS_LAYOUT_INTERNAL_BOX_CLASS
7 5
8#include "../evas/canvas/evas_box.eo.h" 6#include "../evas/canvas/evas_box.eo.h"
9 7
10PROXY_IMPLEMENTATION(box, BOX, Edje_Box_Data) 8PROXY_IMPLEMENTATION(box, BOX)
11#undef PROXY_IMPLEMENTATION 9#undef PROXY_IMPLEMENTATION
12 10
13typedef struct _Part_Item_Iterator Part_Item_Iterator; 11typedef struct _Part_Item_Iterator Part_Item_Iterator;
@@ -15,58 +13,67 @@ typedef struct _Part_Item_Iterator Part_Item_Iterator;
15/* Legacy features */ 13/* Legacy features */
16 14
17EOLIAN static Eina_Bool 15EOLIAN static Eina_Bool
18_efl_canvas_layout_internal_box_efl_pack_pack_clear(Eo *obj, Edje_Box_Data *pd) 16_efl_canvas_layout_internal_box_efl_pack_pack_clear(Eo *obj, void *_pd EINA_UNUSED)
19{ 17{
18 PROXY_DATA_GET(obj, pd);
20 RETURN_VAL(_edje_part_box_remove_all(pd->ed, pd->part, EINA_TRUE)); 19 RETURN_VAL(_edje_part_box_remove_all(pd->ed, pd->part, EINA_TRUE));
21} 20}
22 21
23EOLIAN static Eina_Bool 22EOLIAN static Eina_Bool
24_efl_canvas_layout_internal_box_efl_pack_unpack_all(Eo *obj, Edje_Box_Data *pd) 23_efl_canvas_layout_internal_box_efl_pack_unpack_all(Eo *obj, void *_pd EINA_UNUSED)
25{ 24{
25 PROXY_DATA_GET(obj, pd);
26 RETURN_VAL(_edje_part_box_remove_all(pd->ed, pd->part, EINA_FALSE)); 26 RETURN_VAL(_edje_part_box_remove_all(pd->ed, pd->part, EINA_FALSE));
27} 27}
28 28
29EOLIAN static Eina_Bool 29EOLIAN static Eina_Bool
30_efl_canvas_layout_internal_box_efl_pack_unpack(Eo *obj, Edje_Box_Data *pd, Efl_Gfx *subobj) 30_efl_canvas_layout_internal_box_efl_pack_unpack(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx *subobj)
31{ 31{
32 Evas_Object *removed; 32 Evas_Object *removed;
33 PROXY_DATA_GET(obj, pd);
33 removed = _edje_part_box_remove(pd->ed, pd->part, subobj); 34 removed = _edje_part_box_remove(pd->ed, pd->part, subobj);
34 RETURN_VAL((removed == subobj)); 35 RETURN_VAL((removed == subobj));
35} 36}
36 37
37EOLIAN static Eina_Bool 38EOLIAN static Eina_Bool
38_efl_canvas_layout_internal_box_efl_pack_pack(Eo *obj, Edje_Box_Data *pd, Efl_Gfx *subobj) 39_efl_canvas_layout_internal_box_efl_pack_pack(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx *subobj)
39{ 40{
41 PROXY_DATA_GET(obj, pd);
40 RETURN_VAL(_edje_part_box_append(pd->ed, pd->part, subobj)); 42 RETURN_VAL(_edje_part_box_append(pd->ed, pd->part, subobj));
41} 43}
42 44
43EOLIAN static Eina_Bool 45EOLIAN static Eina_Bool
44_efl_canvas_layout_internal_box_efl_pack_linear_pack_begin(Eo *obj, Edje_Box_Data *pd, Efl_Gfx *subobj) 46_efl_canvas_layout_internal_box_efl_pack_linear_pack_begin(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx *subobj)
45{ 47{
48 PROXY_DATA_GET(obj, pd);
46 RETURN_VAL(_edje_part_box_prepend(pd->ed, pd->part, subobj)); 49 RETURN_VAL(_edje_part_box_prepend(pd->ed, pd->part, subobj));
47} 50}
48 51
49EOLIAN static Eina_Bool 52EOLIAN static Eina_Bool
50_efl_canvas_layout_internal_box_efl_pack_linear_pack_end(Eo *obj, Edje_Box_Data *pd, Efl_Gfx *subobj) 53_efl_canvas_layout_internal_box_efl_pack_linear_pack_end(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx *subobj)
51{ 54{
55 PROXY_DATA_GET(obj, pd);
52 RETURN_VAL(_edje_part_box_append(pd->ed, pd->part, subobj)); 56 RETURN_VAL(_edje_part_box_append(pd->ed, pd->part, subobj));
53} 57}
54 58
55EOLIAN static Eina_Bool 59EOLIAN static Eina_Bool
56_efl_canvas_layout_internal_box_efl_pack_linear_pack_before(Eo *obj, Edje_Box_Data *pd, Efl_Gfx *subobj, const Efl_Gfx *existing) 60_efl_canvas_layout_internal_box_efl_pack_linear_pack_before(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx *subobj, const Efl_Gfx *existing)
57{ 61{
62 PROXY_DATA_GET(obj, pd);
58 RETURN_VAL(_edje_part_box_insert_before(pd->ed, pd->part, subobj, existing)); 63 RETURN_VAL(_edje_part_box_insert_before(pd->ed, pd->part, subobj, existing));
59} 64}
60 65
61EOLIAN static Eina_Bool 66EOLIAN static Eina_Bool
62_efl_canvas_layout_internal_box_efl_pack_linear_pack_after(Eo *obj, Edje_Box_Data *pd, Efl_Gfx *subobj, const Efl_Gfx *existing) 67_efl_canvas_layout_internal_box_efl_pack_linear_pack_after(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx *subobj, const Efl_Gfx *existing)
63{ 68{
69 PROXY_DATA_GET(obj, pd);
64 RETURN_VAL(_edje_part_box_insert_after(pd->ed, pd->part, subobj, existing)); 70 RETURN_VAL(_edje_part_box_insert_after(pd->ed, pd->part, subobj, existing));
65} 71}
66 72
67EOLIAN static Eina_Bool 73EOLIAN static Eina_Bool
68_efl_canvas_layout_internal_box_efl_pack_linear_pack_at(Eo *obj, Edje_Box_Data *pd, Efl_Gfx *subobj, int index) 74_efl_canvas_layout_internal_box_efl_pack_linear_pack_at(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx *subobj, int index)
69{ 75{
76 PROXY_DATA_GET(obj, pd);
70 int cnt = PROXY_CALL(efl_content_count(obj)); 77 int cnt = PROXY_CALL(efl_content_count(obj));
71 if ((index < 0) && ((-index) <= (cnt + 1))) 78 if ((index < 0) && ((-index) <= (cnt + 1)))
72 index = cnt + index + 1; 79 index = cnt + index + 1;
@@ -77,8 +84,9 @@ _efl_canvas_layout_internal_box_efl_pack_linear_pack_at(Eo *obj, Edje_Box_Data *
77} 84}
78 85
79EOLIAN static Efl_Gfx * 86EOLIAN static Efl_Gfx *
80_efl_canvas_layout_internal_box_efl_pack_linear_pack_unpack_at(Eo *obj, Edje_Box_Data *pd, int index) 87_efl_canvas_layout_internal_box_efl_pack_linear_pack_unpack_at(Eo *obj, void *_pd EINA_UNUSED, int index)
81{ 88{
89 PROXY_DATA_GET(obj, pd);
82 if (index < 0) index += PROXY_CALL(efl_content_count(obj)); 90 if (index < 0) index += PROXY_CALL(efl_content_count(obj));
83 RETURN_VAL(_edje_part_box_remove_at(pd->ed, pd->part, index)); 91 RETURN_VAL(_edje_part_box_remove_at(pd->ed, pd->part, index));
84} 92}
@@ -86,26 +94,29 @@ _efl_canvas_layout_internal_box_efl_pack_linear_pack_unpack_at(Eo *obj, Edje_Box
86/* New APIs with Eo */ 94/* New APIs with Eo */
87 95
88EOLIAN static Efl_Gfx * 96EOLIAN static Efl_Gfx *
89_efl_canvas_layout_internal_box_efl_pack_linear_pack_content_get(Eo *obj, Edje_Box_Data *pd, int index) 97_efl_canvas_layout_internal_box_efl_pack_linear_pack_content_get(Eo *obj, void *_pd EINA_UNUSED, int index)
90{ 98{
99 PROXY_DATA_GET(obj, pd);
91 if (index < 0) index += PROXY_CALL(efl_content_count(obj)); 100 if (index < 0) index += PROXY_CALL(efl_content_count(obj));
92 RETURN_VAL(_edje_part_box_content_at(pd->ed, pd->part, index)); 101 RETURN_VAL(_edje_part_box_content_at(pd->ed, pd->part, index));
93} 102}
94 103
95EOLIAN static Eina_Bool 104EOLIAN static Eina_Bool
96_efl_canvas_layout_internal_box_efl_container_content_remove(Eo *obj, Edje_Box_Data *pd EINA_UNUSED, Efl_Gfx *subobj) 105_efl_canvas_layout_internal_box_efl_container_content_remove(Eo *obj, void *_pd EINA_UNUSED EINA_UNUSED, Efl_Gfx *subobj)
97{ 106{
107 PROXY_DATA_GET(obj, pd);
98 RETURN_VAL(PROXY_CALL(efl_pack_unpack(obj, subobj))); 108 RETURN_VAL(PROXY_CALL(efl_pack_unpack(obj, subobj)));
99} 109}
100 110
101EOLIAN static int 111EOLIAN static int
102_efl_canvas_layout_internal_box_efl_pack_linear_pack_index_get(Eo *obj, Edje_Box_Data *pd, const Efl_Gfx * subobj) 112_efl_canvas_layout_internal_box_efl_pack_linear_pack_index_get(Eo *obj, void *_pd EINA_UNUSED, const Efl_Gfx * subobj)
103{ 113{
104 Evas_Object_Box_Option *opt; 114 Evas_Object_Box_Option *opt;
105 Evas_Object_Box_Data *priv; 115 Evas_Object_Box_Data *priv;
106 Eina_List *l; 116 Eina_List *l;
107 int k = 0; 117 int k = 0;
108 118
119 PROXY_DATA_GET(obj, pd);
109 priv = efl_data_scope_get(pd->rp->object, EVAS_BOX_CLASS); 120 priv = efl_data_scope_get(pd->rp->object, EVAS_BOX_CLASS);
110 if (!priv) RETURN_VAL(-1); 121 if (!priv) RETURN_VAL(-1);
111 EINA_LIST_FOREACH(priv->children, l, opt) 122 EINA_LIST_FOREACH(priv->children, l, opt)
@@ -166,10 +177,11 @@ _part_item_iterator_create(Eo *obj, Eina_Iterator *real_iterator)
166} 177}
167 178
168EOLIAN static Eina_Iterator * 179EOLIAN static Eina_Iterator *
169_efl_canvas_layout_internal_box_efl_container_content_iterate(Eo *obj, Edje_Box_Data *pd) 180_efl_canvas_layout_internal_box_efl_container_content_iterate(Eo *obj, void *_pd EINA_UNUSED)
170{ 181{
171 Eina_Iterator *it; 182 Eina_Iterator *it;
172 183
184 PROXY_DATA_GET(obj, pd);
173 if (!pd->rp->typedata.container) RETURN_VAL(NULL); 185 if (!pd->rp->typedata.container) RETURN_VAL(NULL);
174 it = evas_object_box_iterator_new(pd->rp->object); 186 it = evas_object_box_iterator_new(pd->rp->object);
175 187
@@ -177,14 +189,16 @@ _efl_canvas_layout_internal_box_efl_container_content_iterate(Eo *obj, Edje_Box_
177} 189}
178 190
179EOLIAN static int 191EOLIAN static int
180_efl_canvas_layout_internal_box_efl_container_content_count(Eo *obj, Edje_Box_Data *pd) 192_efl_canvas_layout_internal_box_efl_container_content_count(Eo *obj, void *_pd EINA_UNUSED)
181{ 193{
194 PROXY_DATA_GET(obj, pd);
182 RETURN_VAL(evas_obj_box_count(pd->rp->object)); 195 RETURN_VAL(evas_obj_box_count(pd->rp->object));
183} 196}
184 197
185EOLIAN static Efl_Orient 198EOLIAN static Efl_Orient
186_efl_canvas_layout_internal_box_efl_orientation_orientation_get(Eo *obj, Edje_Box_Data *pd) 199_efl_canvas_layout_internal_box_efl_orientation_orientation_get(Eo *obj, void *_pd EINA_UNUSED)
187{ 200{
201 PROXY_DATA_GET(obj, pd);
188 const Edje_Part_Description_Box *desc = 202 const Edje_Part_Description_Box *desc =
189 (Edje_Part_Description_Box *) pd->rp->chosen_description; 203 (Edje_Part_Description_Box *) pd->rp->chosen_description;
190 204
@@ -200,4 +214,9 @@ _efl_canvas_layout_internal_box_efl_orientation_orientation_get(Eo *obj, Edje_Bo
200 RETURN_VAL(EFL_ORIENT_NONE); 214 RETURN_VAL(EFL_ORIENT_NONE);
201} 215}
202 216
217/* Internal EO API */
218
219#define EFL_CANVAS_LAYOUT_INTERNAL_BOX_EXTRA_OPS \
220 EFL_OBJECT_OP_FUNC(_efl_canvas_layout_internal_real_part_set, _efl_canvas_layout_internal_box_efl_canvas_layout_internal_real_part_set)
221
203#include "efl_canvas_layout_internal_box.eo.c" 222#include "efl_canvas_layout_internal_box.eo.c"
diff --git a/src/lib/edje/edje_part_helper.h b/src/lib/edje/edje_part_helper.h
index c3f5f2bf5a..385dcec12d 100644
--- a/src/lib/edje/edje_part_helper.h
+++ b/src/lib/edje/edje_part_helper.h
@@ -1,8 +1,11 @@
1#include "edje_private.h" 1#include "edje_private.h"
2#define EFL_CANVAS_LAYOUT_INTERNAL_PROTECTED
3#include "efl_canvas_layout_internal.eo.h" 2#include "efl_canvas_layout_internal.eo.h"
4 3
5struct _Edje_Part_Data 4EOAPI void _efl_canvas_layout_internal_real_part_set(Eo *obj, void *ed, void *rp, const char *part);
5
6typedef struct _Efl_Canvas_Layout_Internal_Data Efl_Canvas_Layout_Internal_Data;
7
8struct _Efl_Canvas_Layout_Internal_Data
6{ 9{
7 Edje *ed; 10 Edje *ed;
8 Edje_Real_Part *rp; 11 Edje_Real_Part *rp;
@@ -10,8 +13,6 @@ struct _Edje_Part_Data
10 unsigned char temp; 13 unsigned char temp;
11}; 14};
12 15
13typedef struct _Edje_Part_Data Edje_Part_Data;
14
15struct _Part_Item_Iterator 16struct _Part_Item_Iterator
16{ 17{
17 Eina_Iterator iterator; 18 Eina_Iterator iterator;
@@ -40,9 +41,10 @@ struct _Part_Item_Iterator
40void \ 41void \
41_ ## type ## _shutdown(void); \ 42_ ## type ## _shutdown(void); \
42 43
43#define PROXY_IMPLEMENTATION(type, TYPE, datatype) \ 44#define PROXY_DATA_GET(obj, pd) \
44typedef struct _Edje_Part_Data datatype; \ 45 Efl_Canvas_Layout_Internal_Data *pd = efl_data_scope_get(obj, EFL_CANVAS_LAYOUT_INTERNAL_CLASS)
45\ 46
47#define PROXY_IMPLEMENTATION(type, TYPE) \
46static Eo * _ ## type ## _proxy = NULL; \ 48static Eo * _ ## type ## _proxy = NULL; \
47\ 49\
48static void \ 50static void \
@@ -72,10 +74,10 @@ _ ## type ## _shutdown(void) \
72Eo * \ 74Eo * \
73_edje_ ## type ## _internal_proxy_get(Edje_Object *obj EINA_UNUSED, Edje *ed, Edje_Real_Part *rp) \ 75_edje_ ## type ## _internal_proxy_get(Edje_Object *obj EINA_UNUSED, Edje *ed, Edje_Real_Part *rp) \
74{ \ 76{ \
75 Edje_Part_Data *pd; \ 77 Efl_Canvas_Layout_Internal_Data *pd; \
76 Eo *proxy; \ 78 Eo *proxy; \
77 \ 79 \
78 pd = efl_data_scope_get(_ ## type ## _proxy, MY_CLASS); \ 80 pd = efl_data_scope_get(_ ## type ## _proxy, EFL_CANVAS_LAYOUT_INTERNAL_CLASS); \
79 if (!pd) \ 81 if (!pd) \
80 { \ 82 { \
81 if (_ ## type ## _proxy) \ 83 if (_ ## type ## _proxy) \
@@ -84,7 +86,7 @@ _edje_ ## type ## _internal_proxy_get(Edje_Object *obj EINA_UNUSED, Edje *ed, Ed
84 _ ## type ## _proxy = NULL; \ 86 _ ## type ## _proxy = NULL; \
85 } \ 87 } \
86 return efl_add(MY_CLASS, ed->obj, \ 88 return efl_add(MY_CLASS, ed->obj, \
87 _edje_real_part_set(efl_added, ed, rp, rp->part->name)); \ 89 _efl_canvas_layout_internal_real_part_set(efl_added, ed, rp, rp->part->name)); \
88 } \ 90 } \
89 \ 91 \
90 if (EINA_UNLIKELY(pd->temp)) \ 92 if (EINA_UNLIKELY(pd->temp)) \
@@ -97,13 +99,14 @@ _edje_ ## type ## _internal_proxy_get(Edje_Object *obj EINA_UNUSED, Edje *ed, Ed
97 } \ 99 } \
98 proxy = _ ## type ## _proxy; \ 100 proxy = _ ## type ## _proxy; \
99 _ ## type ## _proxy = NULL; \ 101 _ ## type ## _proxy = NULL; \
100 _edje_real_part_set(proxy, ed, rp, rp->part->name); \ 102 _efl_canvas_layout_internal_real_part_set(proxy, ed, rp, rp->part->name); \
101 return proxy; \ 103 return proxy; \
102} \ 104} \
103\ 105\
104EOLIAN static void \ 106EOLIAN static void \
105_efl_canvas_layout_internal_ ## type ## _efl_canvas_layout_internal_real_part_set(Eo *obj, datatype *pd, void *ed, void *rp, const char *part) \ 107_efl_canvas_layout_internal_ ## type ## _efl_canvas_layout_internal_real_part_set(Eo *obj, void *_pd EINA_UNUSED, void *ed, void *rp, const char *part) \
106{ \ 108{ \
109 PROXY_DATA_GET(obj, pd); \
107 pd->ed = ed; \ 110 pd->ed = ed; \
108 pd->rp = rp; \ 111 pd->rp = rp; \
109 pd->part = part; \ 112 pd->part = part; \
@@ -113,8 +116,9 @@ _efl_canvas_layout_internal_ ## type ## _efl_canvas_layout_internal_real_part_se
113} \ 116} \
114\ 117\
115EOLIAN static Efl_Object * \ 118EOLIAN static Efl_Object * \
116_efl_canvas_layout_internal_ ## type ## _efl_object_finalize(Eo *obj, datatype *pd) \ 119_efl_canvas_layout_internal_ ## type ## _efl_object_finalize(Eo *obj, void *_pd EINA_UNUSED) \
117{ \ 120{ \
121 PROXY_DATA_GET(obj, pd); \
118 EINA_SAFETY_ON_FALSE_RETURN_VAL(pd->rp && pd->ed && pd->part, NULL); \ 122 EINA_SAFETY_ON_FALSE_RETURN_VAL(pd->rp && pd->ed && pd->part, NULL); \
119 return efl_finalize(efl_super(obj, MY_CLASS)); \ 123 return efl_finalize(efl_super(obj, MY_CLASS)); \
120} 124}
diff --git a/src/lib/edje/edje_part_swallow.c b/src/lib/edje/edje_part_swallow.c
index f29a4982da..7eab4bc31e 100644
--- a/src/lib/edje/edje_part_swallow.c
+++ b/src/lib/edje/edje_part_swallow.c
@@ -1,33 +1,39 @@
1#include "edje_private.h" 1#include "edje_private.h"
2#include "edje_part_helper.h" 2#include "edje_part_helper.h"
3
4#define EFL_CANVAS_LAYOUT_INTERNAL_SWALLOW_PROTECTED
5#include "efl_canvas_layout_internal_swallow.eo.h" 3#include "efl_canvas_layout_internal_swallow.eo.h"
6#define MY_CLASS EFL_CANVAS_LAYOUT_INTERNAL_SWALLOW_CLASS 4#define MY_CLASS EFL_CANVAS_LAYOUT_INTERNAL_SWALLOW_CLASS
7 5
8PROXY_IMPLEMENTATION(swallow, SWALLOW, Edje_Swallow_Data) 6PROXY_IMPLEMENTATION(swallow, SWALLOW)
9#undef PROXY_IMPLEMENTATION 7#undef PROXY_IMPLEMENTATION
10 8
11/* Swallow parts */ 9/* Swallow parts */
12EOLIAN static Efl_Gfx * 10EOLIAN static Efl_Gfx *
13_efl_canvas_layout_internal_swallow_efl_container_content_get(Eo *obj, Edje_Swallow_Data *pd) 11_efl_canvas_layout_internal_swallow_efl_container_content_get(Eo *obj, void *_pd EINA_UNUSED)
14{ 12{
13 PROXY_DATA_GET(obj, pd);
15 RETURN_VAL(_edje_efl_container_content_get(pd->ed, pd->part)); 14 RETURN_VAL(_edje_efl_container_content_get(pd->ed, pd->part));
16} 15}
17 16
18EOLIAN static Eina_Bool 17EOLIAN static Eina_Bool
19_efl_canvas_layout_internal_swallow_efl_container_content_set(Eo *obj, Edje_Swallow_Data *pd, Efl_Gfx *content) 18_efl_canvas_layout_internal_swallow_efl_container_content_set(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx *content)
20{ 19{
20 PROXY_DATA_GET(obj, pd);
21 RETURN_VAL(_edje_efl_container_content_set(pd->ed, pd->part, content)); 21 RETURN_VAL(_edje_efl_container_content_set(pd->ed, pd->part, content));
22} 22}
23 23
24EOLIAN static Efl_Gfx * 24EOLIAN static Efl_Gfx *
25_efl_canvas_layout_internal_swallow_efl_container_content_unset(Eo *obj, Edje_Swallow_Data *pd) 25_efl_canvas_layout_internal_swallow_efl_container_content_unset(Eo *obj, void *_pd EINA_UNUSED)
26{ 26{
27 PROXY_DATA_GET(obj, pd);
27 Efl_Gfx *content = _edje_efl_container_content_get(pd->ed, pd->part); 28 Efl_Gfx *content = _edje_efl_container_content_get(pd->ed, pd->part);
28 if (!content) RETURN_VAL(NULL); 29 if (!content) RETURN_VAL(NULL);
29 PROXY_CALL(efl_content_remove(obj, content)); 30 PROXY_CALL(efl_content_remove(obj, content));
30 RETURN_VAL(content); 31 RETURN_VAL(content);
31} 32}
32 33
34/* Internal EO APIs */
35
36#define EFL_CANVAS_LAYOUT_INTERNAL_SWALLOW_EXTRA_OPS \
37 EFL_OBJECT_OP_FUNC(_efl_canvas_layout_internal_real_part_set, _efl_canvas_layout_internal_swallow_efl_canvas_layout_internal_real_part_set),
38
33#include "efl_canvas_layout_internal_swallow.eo.c" 39#include "efl_canvas_layout_internal_swallow.eo.c"
diff --git a/src/lib/edje/edje_part_table.c b/src/lib/edje/edje_part_table.c
index adb60bb1b9..2abd03fdec 100644
--- a/src/lib/edje/edje_part_table.c
+++ b/src/lib/edje/edje_part_table.c
@@ -1,13 +1,11 @@
1#include "edje_private.h" 1#include "edje_private.h"
2#include "edje_part_helper.h" 2#include "edje_part_helper.h"
3
4#define EFL_CANVAS_LAYOUT_INTERNAL_TABLE_PROTECTED
5#include "efl_canvas_layout_internal_table.eo.h" 3#include "efl_canvas_layout_internal_table.eo.h"
6#define MY_CLASS EFL_CANVAS_LAYOUT_INTERNAL_TABLE_CLASS 4#define MY_CLASS EFL_CANVAS_LAYOUT_INTERNAL_TABLE_CLASS
7 5
8#include "../evas/canvas/evas_table.eo.h" 6#include "../evas/canvas/evas_table.eo.h"
9 7
10PROXY_IMPLEMENTATION(table, TABLE, Edje_Table_Data) 8PROXY_IMPLEMENTATION(table, TABLE)
11#undef PROXY_IMPLEMENTATION 9#undef PROXY_IMPLEMENTATION
12 10
13typedef struct _Part_Item_Iterator Part_Item_Iterator; 11typedef struct _Part_Item_Iterator Part_Item_Iterator;
@@ -61,10 +59,11 @@ _part_item_iterator_create(Eo *obj, Eina_Iterator *real_iterator)
61} 59}
62 60
63EOLIAN static Eina_Iterator * 61EOLIAN static Eina_Iterator *
64_efl_canvas_layout_internal_table_efl_container_content_iterate(Eo *obj, Edje_Table_Data *pd) 62_efl_canvas_layout_internal_table_efl_container_content_iterate(Eo *obj, void *_pd EINA_UNUSED)
65{ 63{
66 Eina_Iterator *it; 64 Eina_Iterator *it;
67 65
66 PROXY_DATA_GET(obj, pd);
68 if (!pd->rp->typedata.container) RETURN_VAL(NULL); 67 if (!pd->rp->typedata.container) RETURN_VAL(NULL);
69 it = evas_object_table_iterator_new(pd->rp->object); 68 it = evas_object_table_iterator_new(pd->rp->object);
70 69
@@ -72,65 +71,75 @@ _efl_canvas_layout_internal_table_efl_container_content_iterate(Eo *obj, Edje_Ta
72} 71}
73 72
74EOLIAN static int 73EOLIAN static int
75_efl_canvas_layout_internal_table_efl_container_content_count(Eo *obj, Edje_Table_Data *pd) 74_efl_canvas_layout_internal_table_efl_container_content_count(Eo *obj, void *_pd EINA_UNUSED)
76{ 75{
76 PROXY_DATA_GET(obj, pd);
77 RETURN_VAL(evas_obj_table_count(pd->rp->object)); 77 RETURN_VAL(evas_obj_table_count(pd->rp->object));
78} 78}
79 79
80EOLIAN static Eina_Bool 80EOLIAN static Eina_Bool
81_efl_canvas_layout_internal_table_efl_container_content_remove(Eo *obj, Edje_Table_Data *pd EINA_UNUSED, Efl_Gfx *content) 81_efl_canvas_layout_internal_table_efl_container_content_remove(Eo *obj, void *_pd EINA_UNUSED EINA_UNUSED, Efl_Gfx *content)
82{ 82{
83 PROXY_DATA_GET(obj, pd);
83 RETURN_VAL(PROXY_CALL(efl_pack_unpack(obj, content))); 84 RETURN_VAL(PROXY_CALL(efl_pack_unpack(obj, content)));
84} 85}
85 86
86EOLIAN static Eina_Bool 87EOLIAN static Eina_Bool
87_efl_canvas_layout_internal_table_efl_pack_pack_clear(Eo *obj, Edje_Table_Data *pd) 88_efl_canvas_layout_internal_table_efl_pack_pack_clear(Eo *obj, void *_pd EINA_UNUSED)
88{ 89{
90 PROXY_DATA_GET(obj, pd);
89 RETURN_VAL(_edje_part_table_clear(pd->ed, pd->part, EINA_TRUE)); 91 RETURN_VAL(_edje_part_table_clear(pd->ed, pd->part, EINA_TRUE));
90} 92}
91 93
92EOLIAN static Eina_Bool 94EOLIAN static Eina_Bool
93_efl_canvas_layout_internal_table_efl_pack_unpack_all(Eo *obj, Edje_Table_Data *pd) 95_efl_canvas_layout_internal_table_efl_pack_unpack_all(Eo *obj, void *_pd EINA_UNUSED)
94{ 96{
97 PROXY_DATA_GET(obj, pd);
95 RETURN_VAL(_edje_part_table_clear(pd->ed, pd->part, EINA_FALSE)); 98 RETURN_VAL(_edje_part_table_clear(pd->ed, pd->part, EINA_FALSE));
96} 99}
97 100
98EOLIAN static Eina_Bool 101EOLIAN static Eina_Bool
99_efl_canvas_layout_internal_table_efl_pack_unpack(Eo *obj EINA_UNUSED, Edje_Table_Data *pd, Efl_Gfx *subobj) 102_efl_canvas_layout_internal_table_efl_pack_unpack(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, Efl_Gfx *subobj)
100{ 103{
104 PROXY_DATA_GET(obj, pd);
101 RETURN_VAL(_edje_part_table_unpack(pd->ed, pd->part, subobj)); 105 RETURN_VAL(_edje_part_table_unpack(pd->ed, pd->part, subobj));
102} 106}
103 107
104EOLIAN static Eina_Bool 108EOLIAN static Eina_Bool
105_efl_canvas_layout_internal_table_efl_pack_grid_pack_grid(Eo *obj, Edje_Table_Data *pd, Efl_Gfx *subobj, int col, int row, int colspan, int rowspan) 109_efl_canvas_layout_internal_table_efl_pack_grid_pack_grid(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx *subobj, int col, int row, int colspan, int rowspan)
106{ 110{
111 PROXY_DATA_GET(obj, pd);
107 RETURN_VAL(_edje_part_table_pack(pd->ed, pd->part, subobj, col, row, colspan, rowspan)); 112 RETURN_VAL(_edje_part_table_pack(pd->ed, pd->part, subobj, col, row, colspan, rowspan));
108} 113}
109 114
110EOLIAN static Efl_Gfx * 115EOLIAN static Efl_Gfx *
111_efl_canvas_layout_internal_table_efl_pack_grid_grid_content_get(Eo *obj, Edje_Table_Data *pd, int col, int row) 116_efl_canvas_layout_internal_table_efl_pack_grid_grid_content_get(Eo *obj, void *_pd EINA_UNUSED, int col, int row)
112{ 117{
118 PROXY_DATA_GET(obj, pd);
113 RETURN_VAL(_edje_part_table_child_get(pd->ed, pd->part, col, row)); 119 RETURN_VAL(_edje_part_table_child_get(pd->ed, pd->part, col, row));
114} 120}
115 121
116EOLIAN static void 122EOLIAN static void
117_efl_canvas_layout_internal_table_efl_pack_grid_grid_size_get(Eo *obj, Edje_Table_Data *pd, int *cols, int *rows) 123_efl_canvas_layout_internal_table_efl_pack_grid_grid_size_get(Eo *obj, void *_pd EINA_UNUSED, int *cols, int *rows)
118{ 124{
125 PROXY_DATA_GET(obj, pd);
119 _edje_part_table_col_row_size_get(pd->ed, pd->part, cols, rows); 126 _edje_part_table_col_row_size_get(pd->ed, pd->part, cols, rows);
120 RETURN_VOID; 127 RETURN_VOID;
121} 128}
122 129
123EOLIAN static int 130EOLIAN static int
124_efl_canvas_layout_internal_table_efl_pack_grid_grid_columns_get(Eo *obj, Edje_Table_Data *pd) 131_efl_canvas_layout_internal_table_efl_pack_grid_grid_columns_get(Eo *obj, void *_pd EINA_UNUSED)
125{ 132{
133 PROXY_DATA_GET(obj, pd);
126 int cols = 0, rows = 0; 134 int cols = 0, rows = 0;
127 _edje_part_table_col_row_size_get(pd->ed, pd->part, &cols, &rows); 135 _edje_part_table_col_row_size_get(pd->ed, pd->part, &cols, &rows);
128 RETURN_VAL(cols); 136 RETURN_VAL(cols);
129} 137}
130 138
131EOLIAN static int 139EOLIAN static int
132_efl_canvas_layout_internal_table_efl_pack_grid_grid_rows_get(Eo *obj, Edje_Table_Data *pd) 140_efl_canvas_layout_internal_table_efl_pack_grid_grid_rows_get(Eo *obj, void *_pd EINA_UNUSED)
133{ 141{
142 PROXY_DATA_GET(obj, pd);
134 int cols = 0, rows = 0; 143 int cols = 0, rows = 0;
135 _edje_part_table_col_row_size_get(pd->ed, pd->part, &cols, &rows); 144 _edje_part_table_col_row_size_get(pd->ed, pd->part, &cols, &rows);
136 RETURN_VAL(rows); 145 RETURN_VAL(rows);
@@ -167,7 +176,7 @@ _table_item_iterator_free(Part_Item_Iterator *it)
167} 176}
168 177
169EOLIAN static Eina_Iterator * 178EOLIAN static Eina_Iterator *
170_efl_canvas_layout_internal_table_efl_pack_grid_grid_contents_get(Eo *obj, Edje_Table_Data *pd, int col, int row, Eina_Bool below) 179_efl_canvas_layout_internal_table_efl_pack_grid_grid_contents_get(Eo *obj, void *_pd EINA_UNUSED, int col, int row, Eina_Bool below)
171{ 180{
172 Evas_Object *sobj; 181 Evas_Object *sobj;
173 Eina_Iterator *it; 182 Eina_Iterator *it;
@@ -177,6 +186,7 @@ _efl_canvas_layout_internal_table_efl_pack_grid_grid_contents_get(Eo *obj, Edje_
177 186
178 /* FIXME: terrible performance because there is no proper evas table api */ 187 /* FIXME: terrible performance because there is no proper evas table api */
179 188
189 PROXY_DATA_GET(obj, pd);
180 it = evas_object_table_iterator_new(pd->rp->object); 190 it = evas_object_table_iterator_new(pd->rp->object);
181 EINA_ITERATOR_FOREACH(it, sobj) 191 EINA_ITERATOR_FOREACH(it, sobj)
182 { 192 {
@@ -209,11 +219,12 @@ _efl_canvas_layout_internal_table_efl_pack_grid_grid_contents_get(Eo *obj, Edje_
209} 219}
210 220
211EOLIAN static Eina_Bool 221EOLIAN static Eina_Bool
212_efl_canvas_layout_internal_table_efl_pack_grid_grid_position_get(Eo *obj, Edje_Table_Data *pd, Efl_Gfx * subobj, int *col, int *row, int *colspan, int *rowspan) 222_efl_canvas_layout_internal_table_efl_pack_grid_grid_position_get(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx * subobj, int *col, int *row, int *colspan, int *rowspan)
213{ 223{
214 unsigned short c, r, cs, rs; 224 unsigned short c, r, cs, rs;
215 Eina_Bool ret; 225 Eina_Bool ret;
216 226
227 PROXY_DATA_GET(obj, pd);
217 ret = evas_object_table_pack_get(pd->rp->object, subobj, &c, &r, &cs, &rs); 228 ret = evas_object_table_pack_get(pd->rp->object, subobj, &c, &r, &cs, &rs);
218 if (col) *col = c; 229 if (col) *col = c;
219 if (row) *row = r; 230 if (row) *row = r;
@@ -341,4 +352,9 @@ edje_object_part_table_clear(Edje_Object *obj, const char *part, Eina_Bool clear
341 return efl_pack_unpack_all(table); 352 return efl_pack_unpack_all(table);
342} 353}
343 354
355/* Internal EO APIs */
356
357#define EFL_CANVAS_LAYOUT_INTERNAL_TABLE_EXTRA_OPS \
358 EFL_OBJECT_OP_FUNC(_efl_canvas_layout_internal_real_part_set, _efl_canvas_layout_internal_table_efl_canvas_layout_internal_real_part_set),
359
344#include "efl_canvas_layout_internal_table.eo.c" 360#include "efl_canvas_layout_internal_table.eo.c"
diff --git a/src/lib/edje/efl_canvas_layout_internal.eo b/src/lib/edje/efl_canvas_layout_internal.eo
index 13b8968b12..67e09278a0 100644
--- a/src/lib/edje/efl_canvas_layout_internal.eo
+++ b/src/lib/edje/efl_canvas_layout_internal.eo
@@ -1,16 +1,8 @@
1interface Efl.Canvas.Layout_Internal () 1class Efl.Canvas.Layout_Internal (Efl.Object, Efl.Gfx)
2{ 2{
3 [[Internal APIs used by Edje part objects.]] 3 [[Common class for part proxy objects for $Efl.Canvas.Layout.]]
4 eo_prefix: _edje; 4 implements {
5 methods { 5 //Efl.Gfx.Size.geometry { get; }
6 @property real_part @protected { 6 //Efl.Gfx.Size.size { get; }
7 [[Real part property]]
8 set {}
9 values {
10 ed: void_ptr; [[Edje object]]
11 rp: void_ptr; [[Real part object]]
12 part: string; [[Real part name]]
13 }
14 }
15 } 7 }
16} 8}
diff --git a/src/lib/edje/efl_canvas_layout_internal_box.eo b/src/lib/edje/efl_canvas_layout_internal_box.eo
index 79526ec229..1db1f5522a 100644
--- a/src/lib/edje/efl_canvas_layout_internal_box.eo
+++ b/src/lib/edje/efl_canvas_layout_internal_box.eo
@@ -1,4 +1,4 @@
1class Efl.Canvas.Layout_Internal.Box (Efl.Object, Efl.Canvas.Layout_Internal, Efl.Pack.Linear, 1class Efl.Canvas.Layout_Internal.Box (Efl.Canvas.Layout_Internal, Efl.Pack.Linear,
2 Efl.Orientation) 2 Efl.Orientation)
3{ 3{
4 [[Represents a Box created as part of a layout. 4 [[Represents a Box created as part of a layout.
@@ -6,10 +6,9 @@ class Efl.Canvas.Layout_Internal.Box (Efl.Object, Efl.Canvas.Layout_Internal, Ef
6 Its lifetime is limited to one function call only, unless an extra 6 Its lifetime is limited to one function call only, unless an extra
7 reference is explicitely held. 7 reference is explicitely held.
8 ]] 8 ]]
9 data: Edje_Box_Data; 9 data: null;
10 implements { 10 implements {
11 Efl.Object.finalize; 11 Efl.Object.finalize;
12 Efl.Canvas.Layout_Internal.real_part { set; }
13 Efl.Container.content_iterate; 12 Efl.Container.content_iterate;
14 Efl.Container.content_count; 13 Efl.Container.content_count;
15 Efl.Container.content_remove; 14 Efl.Container.content_remove;
diff --git a/src/lib/edje/efl_canvas_layout_internal_swallow.eo b/src/lib/edje/efl_canvas_layout_internal_swallow.eo
index 7695ead971..d3e19b3e26 100644
--- a/src/lib/edje/efl_canvas_layout_internal_swallow.eo
+++ b/src/lib/edje/efl_canvas_layout_internal_swallow.eo
@@ -1,14 +1,13 @@
1class Efl.Canvas.Layout_Internal.Swallow (Efl.Object, Efl.Canvas.Layout_Internal, Efl.Container) 1class Efl.Canvas.Layout_Internal.Swallow (Efl.Canvas.Layout_Internal, Efl.Container)
2{ 2{
3 [[Represents a SWALLOW part of an Edje object. 3 [[Represents a SWALLOW part of an Edje object.
4 4
5 Its lifetime is limited to one function call only, unless an extra 5 Its lifetime is limited to one function call only, unless an extra
6 reference is explicitely held. 6 reference is explicitely held.
7 ]] 7 ]]
8 data: Edje_Swallow_Data; 8 data: null;
9 implements { 9 implements {
10 Efl.Object.finalize; 10 Efl.Object.finalize;
11 Efl.Canvas.Layout_Internal.real_part { set; }
12 Efl.Container.content { get; set; } 11 Efl.Container.content { get; set; }
13 Efl.Container.content_unset; 12 Efl.Container.content_unset;
14 } 13 }
diff --git a/src/lib/edje/efl_canvas_layout_internal_table.eo b/src/lib/edje/efl_canvas_layout_internal_table.eo
index fef2a25334..53258c0298 100644
--- a/src/lib/edje/efl_canvas_layout_internal_table.eo
+++ b/src/lib/edje/efl_canvas_layout_internal_table.eo
@@ -1,14 +1,13 @@
1class Efl.Canvas.Layout_Internal.Table (Efl.Object, Efl.Canvas.Layout_Internal, Efl.Pack.Grid) 1class Efl.Canvas.Layout_Internal.Table (Efl.Canvas.Layout_Internal, Efl.Pack.Grid)
2{ 2{
3 [[Represents a Table created as part of a layout. 3 [[Represents a Table created as part of a layout.
4 4
5 Can not be deleted, this is only a representation of an internal object 5 Can not be deleted, this is only a representation of an internal object
6 of an EFL layout. 6 of an EFL layout.
7 ]] 7 ]]
8 data: Edje_Table_Data; 8 data: null;
9 implements { 9 implements {
10 Efl.Object.finalize; 10 Efl.Object.finalize;
11 Efl.Canvas.Layout_Internal.real_part { set; }
12 Efl.Container.content_iterate; 11 Efl.Container.content_iterate;
13 Efl.Container.content_count; 12 Efl.Container.content_count;
14 Efl.Container.content_remove; 13 Efl.Container.content_remove;