diff options
author | Daniel Zaoui <daniel.zaoui@samsung.com> | 2014-03-10 11:55:22 +0200 |
---|---|---|
committer | Daniel Zaoui <daniel.zaoui@samsung.com> | 2014-03-11 07:37:47 +0200 |
commit | 44f9da675caa22bcb2e14fb24cecdf228b5b34da (patch) | |
tree | 4cb0279080ca590f716edce0a7b82c9e4f387cd3 | |
parent | 9e364d6f4b1718e07efa0b4105c96259ef4826b9 (diff) |
Eolian: Integration of Evas Smart
Diffstat (limited to '')
-rw-r--r-- | src/Makefile_Evas.am | 14 | ||||
-rw-r--r-- | src/lib/evas/Evas_Eo.h | 6 | ||||
-rw-r--r-- | src/lib/evas/canvas/common_interfaces.c | 28 | ||||
-rw-r--r-- | src/lib/evas/canvas/evas_object_smart.c | 474 | ||||
-rw-r--r-- | src/lib/evas/canvas/evas_signal_interface.eo | 8 | ||||
-rw-r--r-- | src/lib/evas/canvas/evas_smart.eo | 354 |
6 files changed, 501 insertions, 383 deletions
diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am index 05f6f4026c..8f07399e0b 100644 --- a/src/Makefile_Evas.am +++ b/src/Makefile_Evas.am | |||
@@ -13,7 +13,11 @@ BUILT_SOURCES += \ | |||
13 | lib/evas/canvas/evas_textblock.eo.c \ | 13 | lib/evas/canvas/evas_textblock.eo.c \ |
14 | lib/evas/canvas/evas_textblock.eo.h \ | 14 | lib/evas/canvas/evas_textblock.eo.h \ |
15 | lib/evas/canvas/evas_textgrid.eo.c \ | 15 | lib/evas/canvas/evas_textgrid.eo.c \ |
16 | lib/evas/canvas/evas_textgrid.eo.h | 16 | lib/evas/canvas/evas_textgrid.eo.h \ |
17 | lib/evas/canvas/evas_signal_interface.eo.c \ | ||
18 | lib/evas/canvas/evas_signal_interface.eo.h \ | ||
19 | lib/evas/canvas/evas_smart.eo.c \ | ||
20 | lib/evas/canvas/evas_smart.eo.h | ||
17 | 21 | ||
18 | EXTRA_DIST += \ | 22 | EXTRA_DIST += \ |
19 | lib/evas/canvas/evas_object.eo \ | 23 | lib/evas/canvas/evas_object.eo \ |
@@ -22,7 +26,9 @@ EXTRA_DIST += \ | |||
22 | lib/evas/canvas/evas_rectangle.eo \ | 26 | lib/evas/canvas/evas_rectangle.eo \ |
23 | lib/evas/canvas/evas_text.eo \ | 27 | lib/evas/canvas/evas_text.eo \ |
24 | lib/evas/canvas/evas_textblock.eo \ | 28 | lib/evas/canvas/evas_textblock.eo \ |
25 | lib/evas/canvas/evas_textgrid.eo | 29 | lib/evas/canvas/evas_textgrid.eo \ |
30 | lib/evas/canvas/evas_signal_interface.eo \ | ||
31 | lib/evas/canvas/evas_smart.eo | ||
26 | 32 | ||
27 | lib_LTLIBRARIES += lib/evas/libevas.la | 33 | lib_LTLIBRARIES += lib/evas/libevas.la |
28 | noinst_LTLIBRARIES = | 34 | noinst_LTLIBRARIES = |
@@ -43,7 +49,9 @@ nodist_installed_evascanvasheaders_DATA = \ | |||
43 | lib/evas/canvas/evas_rectangle.eo.h \ | 49 | lib/evas/canvas/evas_rectangle.eo.h \ |
44 | lib/evas/canvas/evas_text.eo.h \ | 50 | lib/evas/canvas/evas_text.eo.h \ |
45 | lib/evas/canvas/evas_textblock.eo.h \ | 51 | lib/evas/canvas/evas_textblock.eo.h \ |
46 | lib/evas/canvas/evas_textgrid.eo.h | 52 | lib/evas/canvas/evas_textgrid.eo.h \ |
53 | lib/evas/canvas/evas_signal_interface.eo.h \ | ||
54 | lib/evas/canvas/evas_smart.eo.h | ||
47 | 55 | ||
48 | noinst_HEADERS = \ | 56 | noinst_HEADERS = \ |
49 | lib/evas/include/evas_inline.x \ | 57 | lib/evas/include/evas_inline.x \ |
diff --git a/src/lib/evas/Evas_Eo.h b/src/lib/evas/Evas_Eo.h index 8d9589e7ae..6c26ff76ed 100644 --- a/src/lib/evas/Evas_Eo.h +++ b/src/lib/evas/Evas_Eo.h | |||
@@ -2,6 +2,8 @@ | |||
2 | # error You shall not include this header directly | 2 | # error You shall not include this header directly |
3 | #endif | 3 | #endif |
4 | 4 | ||
5 | #include "canvas/evas_signal_interface.eo.h" | ||
6 | |||
5 | EAPI extern const Eo_Event_Description _EVAS_OBJECT_EVENT_MOUSE_IN; | 7 | EAPI extern const Eo_Event_Description _EVAS_OBJECT_EVENT_MOUSE_IN; |
6 | EAPI extern const Eo_Event_Description _EVAS_OBJECT_EVENT_MOUSE_OUT; | 8 | EAPI extern const Eo_Event_Description _EVAS_OBJECT_EVENT_MOUSE_OUT; |
7 | EAPI extern const Eo_Event_Description _EVAS_OBJECT_EVENT_MOUSE_DOWN; | 9 | EAPI extern const Eo_Event_Description _EVAS_OBJECT_EVENT_MOUSE_DOWN; |
@@ -3044,6 +3046,9 @@ enum | |||
3044 | * | 3046 | * |
3045 | * @{ | 3047 | * @{ |
3046 | */ | 3048 | */ |
3049 | #include "canvas/evas_smart.eo.h" | ||
3050 | |||
3051 | #if 0 | ||
3047 | #define EVAS_OBJ_SMART_CLASS evas_object_smart_class_get() | 3052 | #define EVAS_OBJ_SMART_CLASS evas_object_smart_class_get() |
3048 | 3053 | ||
3049 | const Eo_Class *evas_object_smart_class_get(void) EINA_CONST; | 3054 | const Eo_Class *evas_object_smart_class_get(void) EINA_CONST; |
@@ -3400,6 +3405,7 @@ enum | |||
3400 | */ | 3405 | */ |
3401 | #define evas_obj_smart_clip_unset() EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_CLIP_UNSET) | 3406 | #define evas_obj_smart_clip_unset() EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_CLIP_UNSET) |
3402 | 3407 | ||
3408 | #endif | ||
3403 | /** | 3409 | /** |
3404 | * @} | 3410 | * @} |
3405 | */ | 3411 | */ |
diff --git a/src/lib/evas/canvas/common_interfaces.c b/src/lib/evas/canvas/common_interfaces.c index 44d3798dea..bfd530c9bf 100644 --- a/src/lib/evas/canvas/common_interfaces.c +++ b/src/lib/evas/canvas/common_interfaces.c | |||
@@ -173,7 +173,7 @@ _signal_interface_del(void *data) | |||
173 | } | 173 | } |
174 | 174 | ||
175 | static void | 175 | static void |
176 | _signal_interface_constructor(Eo_Class *klass EINA_UNUSED) | 176 | _evas_signal_interface_class_constructor(Eo_Class *klass EINA_UNUSED) |
177 | { | 177 | { |
178 | signals_hash_table = eina_hash_string_superfast_new(_signal_interface_del); | 178 | signals_hash_table = eina_hash_string_superfast_new(_signal_interface_del); |
179 | ADD_INTERFACE_SIGNALS(_clickable_events_desc); | 179 | ADD_INTERFACE_SIGNALS(_clickable_events_desc); |
@@ -186,24 +186,11 @@ _signal_interface_constructor(Eo_Class *klass EINA_UNUSED) | |||
186 | #undef ADD_SIGNAL | 186 | #undef ADD_SIGNAL |
187 | 187 | ||
188 | static void | 188 | static void |
189 | _signal_interface_destructor(Eo_Class *klass EINA_UNUSED) | 189 | _evas_signal_interface_class_destructor(Eo_Class *klass EINA_UNUSED) |
190 | { | 190 | { |
191 | eina_hash_free(signals_hash_table); | 191 | eina_hash_free(signals_hash_table); |
192 | } | 192 | } |
193 | 193 | ||
194 | static const Eo_Class_Description signal_interface_desc = { | ||
195 | EO_VERSION, | ||
196 | "Evas_Signal_Interface", | ||
197 | EO_CLASS_TYPE_INTERFACE, | ||
198 | EO_CLASS_DESCRIPTION_OPS(NULL, NULL, 0), | ||
199 | NULL, | ||
200 | 0, | ||
201 | _signal_interface_constructor, | ||
202 | _signal_interface_destructor | ||
203 | }; | ||
204 | |||
205 | EO_DEFINE_CLASS(evas_smart_signal_interface_get, &signal_interface_desc, NULL, NULL); | ||
206 | |||
207 | static const Eo_Class_Description clickable_interface_desc = { | 194 | static const Eo_Class_Description clickable_interface_desc = { |
208 | EO_VERSION, | 195 | EO_VERSION, |
209 | "Evas_Clickable_Interface", | 196 | "Evas_Clickable_Interface", |
@@ -215,7 +202,7 @@ static const Eo_Class_Description clickable_interface_desc = { | |||
215 | NULL | 202 | NULL |
216 | }; | 203 | }; |
217 | 204 | ||
218 | EO_DEFINE_CLASS(evas_smart_clickable_interface_get, &clickable_interface_desc, EVAS_SMART_SIGNAL_INTERFACE, NULL); | 205 | EO_DEFINE_CLASS(evas_smart_clickable_interface_get, &clickable_interface_desc, EVAS_SIGNAL_INTERFACE_CLASS, NULL); |
219 | 206 | ||
220 | static const Eo_Class_Description scrollable_interface_desc = { | 207 | static const Eo_Class_Description scrollable_interface_desc = { |
221 | EO_VERSION, | 208 | EO_VERSION, |
@@ -228,7 +215,7 @@ static const Eo_Class_Description scrollable_interface_desc = { | |||
228 | NULL | 215 | NULL |
229 | }; | 216 | }; |
230 | 217 | ||
231 | EO_DEFINE_CLASS(evas_smart_scrollable_interface_get, &scrollable_interface_desc, EVAS_SMART_SIGNAL_INTERFACE, NULL); | 218 | EO_DEFINE_CLASS(evas_smart_scrollable_interface_get, &scrollable_interface_desc, EVAS_SIGNAL_INTERFACE_CLASS, NULL); |
232 | 219 | ||
233 | static const Eo_Class_Description zoomable_interface_desc = { | 220 | static const Eo_Class_Description zoomable_interface_desc = { |
234 | EO_VERSION, | 221 | EO_VERSION, |
@@ -241,7 +228,7 @@ static const Eo_Class_Description zoomable_interface_desc = { | |||
241 | NULL | 228 | NULL |
242 | }; | 229 | }; |
243 | 230 | ||
244 | EO_DEFINE_CLASS(evas_smart_zoomable_interface_get, &zoomable_interface_desc, EVAS_SMART_SIGNAL_INTERFACE, NULL); | 231 | EO_DEFINE_CLASS(evas_smart_zoomable_interface_get, &zoomable_interface_desc, EVAS_SIGNAL_INTERFACE_CLASS, NULL); |
245 | 232 | ||
246 | static const Eo_Class_Description selectable_interface_desc = { | 233 | static const Eo_Class_Description selectable_interface_desc = { |
247 | EO_VERSION, | 234 | EO_VERSION, |
@@ -254,7 +241,7 @@ static const Eo_Class_Description selectable_interface_desc = { | |||
254 | NULL | 241 | NULL |
255 | }; | 242 | }; |
256 | 243 | ||
257 | EO_DEFINE_CLASS(evas_smart_selectable_interface_get, &selectable_interface_desc, EVAS_SMART_SIGNAL_INTERFACE, NULL); | 244 | EO_DEFINE_CLASS(evas_smart_selectable_interface_get, &selectable_interface_desc, EVAS_SIGNAL_INTERFACE_CLASS, NULL); |
258 | 245 | ||
259 | static const Eo_Class_Description draggable_interface_desc = { | 246 | static const Eo_Class_Description draggable_interface_desc = { |
260 | EO_VERSION, | 247 | EO_VERSION, |
@@ -267,5 +254,6 @@ static const Eo_Class_Description draggable_interface_desc = { | |||
267 | NULL | 254 | NULL |
268 | }; | 255 | }; |
269 | 256 | ||
270 | EO_DEFINE_CLASS(evas_smart_draggable_interface_get, &draggable_interface_desc, EVAS_SMART_SIGNAL_INTERFACE, NULL); | 257 | EO_DEFINE_CLASS(evas_smart_draggable_interface_get, &draggable_interface_desc, EVAS_SIGNAL_INTERFACE_CLASS, NULL); |
271 | 258 | ||
259 | #include "canvas/evas_signal_interface.eo.c" | ||
diff --git a/src/lib/evas/canvas/evas_object_smart.c b/src/lib/evas/canvas/evas_object_smart.c index 119702aa87..0301056e33 100644 --- a/src/lib/evas/canvas/evas_object_smart.c +++ b/src/lib/evas/canvas/evas_object_smart.c | |||
@@ -3,8 +3,6 @@ | |||
3 | 3 | ||
4 | #include "Eo.h" | 4 | #include "Eo.h" |
5 | 5 | ||
6 | EAPI Eo_Op EVAS_OBJ_SMART_BASE_ID = EO_NOOP; | ||
7 | |||
8 | #define MY_CLASS EVAS_OBJ_SMART_CLASS | 6 | #define MY_CLASS EVAS_OBJ_SMART_CLASS |
9 | 7 | ||
10 | #define MY_CLASS_NAME "Evas_Smart" | 8 | #define MY_CLASS_NAME "Evas_Smart" |
@@ -14,9 +12,9 @@ extern Eina_Hash* signals_hash_table; | |||
14 | 12 | ||
15 | static Eina_Hash *_evas_smart_class_names_hash_table = NULL; | 13 | static Eina_Hash *_evas_smart_class_names_hash_table = NULL; |
16 | 14 | ||
17 | typedef struct _Evas_Object_Smart Evas_Object_Smart; | 15 | typedef struct _Evas_Smart_Data Evas_Smart_Data; |
18 | 16 | ||
19 | struct _Evas_Object_Smart | 17 | struct _Evas_Smart_Data |
20 | { | 18 | { |
21 | struct { | 19 | struct { |
22 | Evas_Coord_Rectangle bounding_box; | 20 | Evas_Coord_Rectangle bounding_box; |
@@ -116,20 +114,9 @@ static const Evas_Object_Func object_func = | |||
116 | 114 | ||
117 | 115 | ||
118 | /* public funcs */ | 116 | /* public funcs */ |
119 | EAPI void | 117 | EOLIAN static void |
120 | evas_object_smart_data_set(Evas_Object *eo_obj, void *data) | 118 | _evas_smart_data_set(Eo *eo_obj EINA_UNUSED, Evas_Smart_Data *o, void *data) |
121 | { | ||
122 | MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ); | ||
123 | return; | ||
124 | MAGIC_CHECK_END(); | ||
125 | eo_do(eo_obj, evas_obj_smart_data_set(data)); | ||
126 | } | ||
127 | |||
128 | static void | ||
129 | _smart_data_set(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list) | ||
130 | { | 119 | { |
131 | void *data = va_arg(*list, void *); | ||
132 | Evas_Object_Smart *o = _pd; | ||
133 | if (o->data) eo_data_unref(eo_obj, o->data); | 120 | if (o->data) eo_data_unref(eo_obj, o->data); |
134 | o->data = data; | 121 | o->data = data; |
135 | eo_data_ref(eo_obj, NULL); | 122 | eo_data_ref(eo_obj, NULL); |
@@ -146,12 +133,10 @@ evas_object_smart_data_get(const Evas_Object *eo_obj) | |||
146 | return data; | 133 | return data; |
147 | } | 134 | } |
148 | 135 | ||
149 | static void | 136 | EOLIAN static void* |
150 | _smart_data_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list) | 137 | _evas_smart_evas_object_smart_data_get(Eo *eo_obj EINA_UNUSED, Evas_Smart_Data *o) |
151 | { | 138 | { |
152 | const Evas_Object_Smart *o = _pd; | 139 | return o->data; |
153 | void **data = va_arg(*list, void **); | ||
154 | *data = o->data; | ||
155 | } | 140 | } |
156 | 141 | ||
157 | EAPI const void * | 142 | EAPI const void * |
@@ -191,7 +176,7 @@ evas_object_smart_interface_data_get(const Evas_Object *eo_obj, | |||
191 | const Evas_Smart_Interface *iface) | 176 | const Evas_Smart_Interface *iface) |
192 | { | 177 | { |
193 | unsigned int i; | 178 | unsigned int i; |
194 | Evas_Object_Smart *obj; | 179 | Evas_Smart_Data *obj; |
195 | Evas_Smart *s; | 180 | Evas_Smart *s; |
196 | 181 | ||
197 | MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ); | 182 | MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ); |
@@ -214,23 +199,11 @@ evas_object_smart_interface_data_get(const Evas_Object *eo_obj, | |||
214 | return NULL; | 199 | return NULL; |
215 | } | 200 | } |
216 | 201 | ||
217 | EAPI Evas_Smart * | 202 | EOLIAN static Evas_Smart* |
218 | evas_object_smart_smart_get(const Evas_Object *eo_obj) | 203 | _evas_smart_smart_get(Eo *eo_obj EINA_UNUSED, Evas_Smart_Data *o EINA_UNUSED) |
219 | { | ||
220 | MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ); | ||
221 | return NULL; | ||
222 | MAGIC_CHECK_END(); | ||
223 | Evas_Smart *smart = NULL; | ||
224 | eo_do((Eo *)eo_obj, evas_obj_smart_smart_get(&smart)); | ||
225 | return smart; | ||
226 | } | ||
227 | |||
228 | static void | ||
229 | _smart_smart_get(Eo *eo_obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list) | ||
230 | { | 204 | { |
231 | Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS); | 205 | Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS); |
232 | Evas_Smart **smart = va_arg(*list, Evas_Smart **); | 206 | return obj->smart.smart; |
233 | if (smart) *smart = obj->smart.smart; | ||
234 | } | 207 | } |
235 | 208 | ||
236 | EAPI void | 209 | EAPI void |
@@ -242,14 +215,12 @@ evas_object_smart_member_add(Evas_Object *eo_obj, Evas_Object *smart_obj) | |||
242 | eo_do(smart_obj, evas_obj_smart_member_add(eo_obj)); | 215 | eo_do(smart_obj, evas_obj_smart_member_add(eo_obj)); |
243 | } | 216 | } |
244 | 217 | ||
245 | static void | 218 | EOLIAN static void |
246 | _smart_member_add(Eo *smart_obj, void *_pd, va_list *list) | 219 | _evas_smart_member_add(Eo *smart_obj, Evas_Smart_Data *o, Evas_Object *eo_obj) |
247 | { | 220 | { |
248 | Evas_Object *eo_obj = va_arg(*list, Evas_Object *); | ||
249 | 221 | ||
250 | Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS); | 222 | Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS); |
251 | Evas_Object_Protected_Data *smart = eo_data_scope_get(smart_obj, EVAS_OBJ_CLASS); | 223 | Evas_Object_Protected_Data *smart = eo_data_scope_get(smart_obj, EVAS_OBJ_CLASS); |
252 | Evas_Object_Smart *o = _pd; | ||
253 | 224 | ||
254 | if (obj->delete_me) | 225 | if (obj->delete_me) |
255 | { | 226 | { |
@@ -318,10 +289,9 @@ evas_object_smart_member_del(Evas_Object *eo_obj) | |||
318 | eo_do(smart_obj, evas_obj_smart_member_del(eo_obj)); | 289 | eo_do(smart_obj, evas_obj_smart_member_del(eo_obj)); |
319 | } | 290 | } |
320 | 291 | ||
321 | static void | 292 | EOLIAN static void |
322 | _smart_member_del(Eo *smart_obj, void *_pd EINA_UNUSED, va_list *list) | 293 | _evas_smart_member_del(Eo *smart_obj, Evas_Smart_Data *_pd EINA_UNUSED, Evas_Object *eo_obj) |
323 | { | 294 | { |
324 | Evas_Object *eo_obj = va_arg(*list, Evas_Object *); | ||
325 | Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS); | 295 | Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS); |
326 | 296 | ||
327 | if (!obj->smart.parent) return; | 297 | if (!obj->smart.parent) return; |
@@ -330,7 +300,7 @@ _smart_member_del(Eo *smart_obj, void *_pd EINA_UNUSED, va_list *list) | |||
330 | if (smart->smart.smart && smart->smart.smart->smart_class->member_del) | 300 | if (smart->smart.smart && smart->smart.smart->smart_class->member_del) |
331 | smart->smart.smart->smart_class->member_del(smart_obj, eo_obj); | 301 | smart->smart.smart->smart_class->member_del(smart_obj, eo_obj); |
332 | 302 | ||
333 | Evas_Object_Smart *o = eo_data_scope_get(smart_obj, MY_CLASS); | 303 | Evas_Smart_Data *o = eo_data_scope_get(smart_obj, MY_CLASS); |
334 | o->contained = eina_inlist_remove(o->contained, EINA_INLIST_GET(obj)); | 304 | o->contained = eina_inlist_remove(o->contained, EINA_INLIST_GET(obj)); |
335 | eo_data_unref(eo_obj, obj); | 305 | eo_data_unref(eo_obj, obj); |
336 | o->member_count--; | 306 | o->member_count--; |
@@ -372,39 +342,34 @@ evas_object_smart_type_check(const Evas_Object *eo_obj, const char *type) | |||
372 | return type_check; | 342 | return type_check; |
373 | } | 343 | } |
374 | 344 | ||
375 | static void | 345 | EOLIAN static Eina_Bool |
376 | _smart_type_check(Eo *eo_obj, void *_pd EINA_UNUSED, va_list *list) | 346 | _evas_smart_evas_object_smart_type_check(Eo *eo_obj, Evas_Smart_Data *o EINA_UNUSED, const char *type) |
377 | { | 347 | { |
378 | const char *type = va_arg(*list, const char *); | ||
379 | Eina_Bool *type_check = va_arg(*list, Eina_Bool *); | ||
380 | *type_check = EINA_FALSE; | ||
381 | |||
382 | const Evas_Smart_Class *sc; | 348 | const Evas_Smart_Class *sc; |
383 | Eo_Class *klass; | 349 | Eo_Class *klass; |
350 | Eina_Bool type_check = EINA_FALSE; | ||
384 | 351 | ||
385 | Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS); | 352 | Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS); |
386 | if (!obj) return; | 353 | if (!obj) return EINA_FALSE; |
387 | 354 | ||
388 | klass = eina_hash_find(_evas_smart_class_names_hash_table, type); | 355 | klass = eina_hash_find(_evas_smart_class_names_hash_table, type); |
389 | if (klass) *type_check = eo_isa(eo_obj, klass); | 356 | if (klass) type_check = eo_isa(eo_obj, klass); |
390 | 357 | ||
391 | /* Backward compatibility - walk over smart classes and compare type */ | 358 | /* Backward compatibility - walk over smart classes and compare type */ |
392 | if (EINA_FALSE == *type_check) | 359 | if (EINA_FALSE == type_check) |
393 | { | 360 | { |
394 | if (obj->smart.smart) | 361 | if (obj->smart.smart) |
395 | { | 362 | { |
396 | sc = obj->smart.smart->smart_class; | 363 | sc = obj->smart.smart->smart_class; |
397 | while (sc) | 364 | while (sc) |
398 | { | 365 | { |
399 | if (!strcmp(sc->name, type)) | 366 | if (!strcmp(sc->name, type)) return EINA_TRUE; |
400 | { | ||
401 | *type_check = EINA_TRUE; | ||
402 | return; | ||
403 | } | ||
404 | sc = sc->parent; | 367 | sc = sc->parent; |
405 | } | 368 | } |
406 | } | 369 | } |
407 | } | 370 | } |
371 | |||
372 | return type_check; | ||
408 | } | 373 | } |
409 | 374 | ||
410 | EAPI Eina_Bool | 375 | EAPI Eina_Bool |
@@ -418,38 +383,34 @@ evas_object_smart_type_check_ptr(const Evas_Object *eo_obj, const char *type) | |||
418 | return type_check_ptr; | 383 | return type_check_ptr; |
419 | } | 384 | } |
420 | 385 | ||
421 | static void | 386 | EOLIAN static Eina_Bool |
422 | _smart_type_check_ptr(Eo *eo_obj, void *_pd EINA_UNUSED, va_list *list) | 387 | _evas_smart_evas_object_smart_type_check_ptr(Eo *eo_obj, Evas_Smart_Data *o EINA_UNUSED, const char* type) |
423 | { | 388 | { |
424 | Eo_Class *klass; | 389 | Eo_Class *klass; |
425 | const Evas_Smart_Class *sc; | 390 | const Evas_Smart_Class *sc; |
426 | const char* type = va_arg(*list, const char *); | 391 | Eina_Bool type_check = EINA_FALSE; |
427 | Eina_Bool *type_check = va_arg(*list, Eina_Bool *); | ||
428 | *type_check = EINA_FALSE; | ||
429 | 392 | ||
430 | Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS); | 393 | Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS); |
431 | if (!obj) return; | 394 | if (!obj) return EINA_FALSE; |
432 | 395 | ||
433 | klass = eina_hash_find(_evas_smart_class_names_hash_table, type); | 396 | klass = eina_hash_find(_evas_smart_class_names_hash_table, type); |
434 | if (klass) *type_check = eo_isa(eo_obj, klass); | 397 | if (klass) type_check = eo_isa(eo_obj, klass); |
435 | 398 | ||
436 | /* Backward compatibility - walk over smart classes and compare type */ | 399 | /* Backward compatibility - walk over smart classes and compare type */ |
437 | if (EINA_FALSE == *type_check) | 400 | if (EINA_FALSE == type_check) |
438 | { | 401 | { |
439 | if (obj->smart.smart) | 402 | if (obj->smart.smart) |
440 | { | 403 | { |
441 | sc = obj->smart.smart->smart_class; | 404 | sc = obj->smart.smart->smart_class; |
442 | while (sc) | 405 | while (sc) |
443 | { | 406 | { |
444 | if (sc->name == type) | 407 | if (sc->name == type) return EINA_TRUE; |
445 | { | ||
446 | if (type_check) *type_check = EINA_TRUE; | ||
447 | return; | ||
448 | } | ||
449 | sc = sc->parent; | 408 | sc = sc->parent; |
450 | } | 409 | } |
451 | } | 410 | } |
452 | } | 411 | } |
412 | |||
413 | return type_check; | ||
453 | } | 414 | } |
454 | 415 | ||
455 | EAPI void | 416 | EAPI void |
@@ -487,35 +448,15 @@ _evas_object_smart_iterator_free(Evas_Object_Smart_Iterator *it) | |||
487 | } | 448 | } |
488 | 449 | ||
489 | // Should we have an eo_children_iterator_new API and just inherit from it ? | 450 | // Should we have an eo_children_iterator_new API and just inherit from it ? |
490 | EAPI Eina_Iterator * | 451 | EOLIAN static Eina_Iterator* |
491 | evas_object_smart_iterator_new(const Evas_Object *o) | 452 | _evas_smart_iterator_new(Eo *o, Evas_Smart_Data *priv) |
492 | { | 453 | { |
493 | Eina_Iterator *ret = NULL; | ||
494 | eo_do((Eo *)o, evas_obj_smart_iterator_new(&ret)); | ||
495 | return ret; | ||
496 | } | ||
497 | |||
498 | static void | ||
499 | _iterator_new(Eo *o, void *_pd, va_list *list) | ||
500 | { | ||
501 | Eina_Iterator **ret = va_arg(*list, Eina_Iterator **); | ||
502 | |||
503 | Evas_Object_Smart_Iterator *it; | 454 | Evas_Object_Smart_Iterator *it; |
504 | 455 | ||
505 | const Evas_Object_Smart *priv = _pd; | 456 | if (!priv->contained) return NULL; |
506 | |||
507 | if (!priv->contained) | ||
508 | { | ||
509 | *ret = NULL; | ||
510 | return ; | ||
511 | } | ||
512 | 457 | ||
513 | it = calloc(1, sizeof(Evas_Object_Smart_Iterator)); | 458 | it = calloc(1, sizeof(Evas_Object_Smart_Iterator)); |
514 | if (!it) | 459 | if (!it) return NULL; |
515 | { | ||
516 | *ret = NULL; | ||
517 | return ; | ||
518 | } | ||
519 | 460 | ||
520 | EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR); | 461 | EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR); |
521 | it->parent = eo_ref(o); | 462 | it->parent = eo_ref(o); |
@@ -525,26 +466,12 @@ _iterator_new(Eo *o, void *_pd, va_list *list) | |||
525 | it->iterator.get_container = FUNC_ITERATOR_GET_CONTAINER(_evas_object_smart_iterator_get_container); | 466 | it->iterator.get_container = FUNC_ITERATOR_GET_CONTAINER(_evas_object_smart_iterator_get_container); |
526 | it->iterator.free = FUNC_ITERATOR_FREE(_evas_object_smart_iterator_free); | 467 | it->iterator.free = FUNC_ITERATOR_FREE(_evas_object_smart_iterator_free); |
527 | 468 | ||
528 | *ret = &it->iterator; | 469 | return &it->iterator; |
529 | } | 470 | } |
530 | 471 | ||
531 | EAPI Eina_List * | 472 | EOLIAN static Eina_List* |
532 | evas_object_smart_members_get(const Evas_Object *eo_obj) | 473 | _evas_smart_members_get(Eo *eo_obj EINA_UNUSED, Evas_Smart_Data *o) |
533 | { | 474 | { |
534 | MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ); | ||
535 | return NULL; | ||
536 | MAGIC_CHECK_END(); | ||
537 | if (!eo_isa(eo_obj, MY_CLASS)) return NULL; | ||
538 | Eina_List *list = NULL; | ||
539 | eo_do((Eo *)eo_obj, evas_obj_smart_members_get(&list)); | ||
540 | return list; | ||
541 | } | ||
542 | |||
543 | static void | ||
544 | _smart_members_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list) | ||
545 | { | ||
546 | Eina_List **members_list = va_arg(*list, Eina_List **); | ||
547 | const Evas_Object_Smart *o = _pd; | ||
548 | Eina_List *members; | 475 | Eina_List *members; |
549 | 476 | ||
550 | Eina_Inlist *member; | 477 | Eina_Inlist *member; |
@@ -553,7 +480,7 @@ _smart_members_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list) | |||
553 | for (member = o->contained; member; member = member->next) | 480 | for (member = o->contained; member; member = member->next) |
554 | members = eina_list_append(members, ((Evas_Object_Protected_Data *)member)->object); | 481 | members = eina_list_append(members, ((Evas_Object_Protected_Data *)member)->object); |
555 | 482 | ||
556 | *members_list = members; | 483 | return members; |
557 | } | 484 | } |
558 | 485 | ||
559 | const Eina_Inlist * | 486 | const Eina_Inlist * |
@@ -563,14 +490,14 @@ evas_object_smart_members_get_direct(const Evas_Object *eo_obj) | |||
563 | return NULL; | 490 | return NULL; |
564 | MAGIC_CHECK_END(); | 491 | MAGIC_CHECK_END(); |
565 | if (!eo_isa(eo_obj, MY_CLASS)) return NULL; | 492 | if (!eo_isa(eo_obj, MY_CLASS)) return NULL; |
566 | Evas_Object_Smart *o = eo_data_scope_get(eo_obj, MY_CLASS); | 493 | Evas_Smart_Data *o = eo_data_scope_get(eo_obj, MY_CLASS); |
567 | return o->contained; | 494 | return o->contained; |
568 | } | 495 | } |
569 | 496 | ||
570 | void | 497 | void |
571 | _evas_object_smart_members_all_del(Evas_Object *eo_obj) | 498 | _evas_object_smart_members_all_del(Evas_Object *eo_obj) |
572 | { | 499 | { |
573 | Evas_Object_Smart *o = eo_data_scope_get(eo_obj, MY_CLASS); | 500 | Evas_Smart_Data *o = eo_data_scope_get(eo_obj, MY_CLASS); |
574 | Evas_Object_Protected_Data *memobj; | 501 | Evas_Object_Protected_Data *memobj; |
575 | Eina_Inlist *itrn; | 502 | Eina_Inlist *itrn; |
576 | EINA_INLIST_FOREACH_SAFE(o->contained, itrn, memobj) | 503 | EINA_INLIST_FOREACH_SAFE(o->contained, itrn, memobj) |
@@ -583,7 +510,7 @@ static void | |||
583 | _evas_smart_class_ifaces_private_data_alloc(Evas_Object *eo_obj, | 510 | _evas_smart_class_ifaces_private_data_alloc(Evas_Object *eo_obj, |
584 | Evas_Smart *s) | 511 | Evas_Smart *s) |
585 | { | 512 | { |
586 | Evas_Object_Smart *obj; | 513 | Evas_Smart_Data *obj; |
587 | const Evas_Smart_Class *sc; | 514 | const Evas_Smart_Class *sc; |
588 | unsigned char *ptr; | 515 | unsigned char *ptr; |
589 | unsigned int i, total_priv_sz = 0; | 516 | unsigned int i, total_priv_sz = 0; |
@@ -659,11 +586,11 @@ evas_object_smart_add(Evas *eo_e, Evas_Smart *s) | |||
659 | return eo_obj; | 586 | return eo_obj; |
660 | } | 587 | } |
661 | 588 | ||
662 | static void | 589 | EOLIAN static void |
663 | _constructor(Eo *eo_obj, void *class_data, va_list *list EINA_UNUSED) | 590 | _evas_smart_constructor(Eo *eo_obj, Evas_Smart_Data *class_data EINA_UNUSED) |
664 | { | 591 | { |
665 | Evas_Object_Protected_Data *obj; | 592 | Evas_Object_Protected_Data *obj; |
666 | Evas_Object_Smart *smart; | 593 | Evas_Smart_Data *smart; |
667 | Eo *parent; | 594 | Eo *parent; |
668 | 595 | ||
669 | smart = class_data; | 596 | smart = class_data; |
@@ -680,8 +607,8 @@ _constructor(Eo *eo_obj, void *class_data, va_list *list EINA_UNUSED) | |||
680 | evas_obj_smart_add()); | 607 | evas_obj_smart_add()); |
681 | } | 608 | } |
682 | 609 | ||
683 | static void | 610 | EOLIAN static void |
684 | _smart_add(Eo *eo_obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED) | 611 | _evas_smart_add(Eo *eo_obj, Evas_Smart_Data *o EINA_UNUSED) |
685 | { | 612 | { |
686 | // If this function is reached, so we do nothing except trying to call | 613 | // If this function is reached, so we do nothing except trying to call |
687 | // the function of the legacy smart class. | 614 | // the function of the legacy smart class. |
@@ -690,16 +617,14 @@ _smart_add(Eo *eo_obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED) | |||
690 | if (s && s->smart_class->add) s->smart_class->add(eo_obj); | 617 | if (s && s->smart_class->add) s->smart_class->add(eo_obj); |
691 | } | 618 | } |
692 | 619 | ||
693 | static void | 620 | EOLIAN static void |
694 | _smart_del(Eo *eo_obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED) | 621 | _evas_smart_del(Eo *eo_obj EINA_UNUSED, Evas_Smart_Data *o EINA_UNUSED) |
695 | { | 622 | { |
696 | } | 623 | } |
697 | 624 | ||
698 | static void | 625 | EOLIAN static void |
699 | _smart_resize(Eo *eo_obj, void *_pd EINA_UNUSED, va_list *list) | 626 | _evas_smart_resize(Eo *eo_obj, Evas_Smart_Data *o EINA_UNUSED, Evas_Coord w, Evas_Coord h) |
700 | { | 627 | { |
701 | Evas_Coord w = va_arg(*list, Evas_Coord); | ||
702 | Evas_Coord h = va_arg(*list, Evas_Coord); | ||
703 | // If this function is reached, so we do nothing except trying to call | 628 | // If this function is reached, so we do nothing except trying to call |
704 | // the function of the legacy smart class. | 629 | // the function of the legacy smart class. |
705 | Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS); | 630 | Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS); |
@@ -707,11 +632,9 @@ _smart_resize(Eo *eo_obj, void *_pd EINA_UNUSED, va_list *list) | |||
707 | if (s && s->smart_class->resize) s->smart_class->resize(eo_obj, w, h); | 632 | if (s && s->smart_class->resize) s->smart_class->resize(eo_obj, w, h); |
708 | } | 633 | } |
709 | 634 | ||
710 | static void | 635 | EOLIAN static void |
711 | _smart_move(Eo *eo_obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED) | 636 | _evas_smart_move(Eo *eo_obj, Evas_Smart_Data *o EINA_UNUSED, Evas_Coord x, Evas_Coord y) |
712 | { | 637 | { |
713 | Evas_Coord x = va_arg(*list, Evas_Coord); | ||
714 | Evas_Coord y = va_arg(*list, Evas_Coord); | ||
715 | // If this function is reached, so we do nothing except trying to call | 638 | // If this function is reached, so we do nothing except trying to call |
716 | // the function of the legacy smart class. | 639 | // the function of the legacy smart class. |
717 | Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS); | 640 | Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS); |
@@ -719,8 +642,8 @@ _smart_move(Eo *eo_obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED) | |||
719 | if (s && s->smart_class->move) s->smart_class->move(eo_obj, x, y); | 642 | if (s && s->smart_class->move) s->smart_class->move(eo_obj, x, y); |
720 | } | 643 | } |
721 | 644 | ||
722 | static void | 645 | EOLIAN static void |
723 | _smart_show(Eo *eo_obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED) | 646 | _evas_smart_show(Eo *eo_obj, Evas_Smart_Data *o EINA_UNUSED) |
724 | { | 647 | { |
725 | // If this function is reached, so we do nothing except trying to call | 648 | // If this function is reached, so we do nothing except trying to call |
726 | // the function of the legacy smart class. | 649 | // the function of the legacy smart class. |
@@ -729,8 +652,8 @@ _smart_show(Eo *eo_obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED) | |||
729 | if (s && s->smart_class->show) s->smart_class->show(eo_obj); | 652 | if (s && s->smart_class->show) s->smart_class->show(eo_obj); |
730 | } | 653 | } |
731 | 654 | ||
732 | static void | 655 | EOLIAN static void |
733 | _smart_hide(Eo *eo_obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED) | 656 | _evas_smart_hide(Eo *eo_obj, Evas_Smart_Data *o EINA_UNUSED) |
734 | { | 657 | { |
735 | // If this function is reached, so we do nothing except trying to call | 658 | // If this function is reached, so we do nothing except trying to call |
736 | // the function of the legacy smart class. | 659 | // the function of the legacy smart class. |
@@ -739,13 +662,9 @@ _smart_hide(Eo *eo_obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED) | |||
739 | if (s && s->smart_class->hide) s->smart_class->hide(eo_obj); | 662 | if (s && s->smart_class->hide) s->smart_class->hide(eo_obj); |
740 | } | 663 | } |
741 | 664 | ||
742 | static void | 665 | EOLIAN static void |
743 | _smart_color_set(Eo *eo_obj, void *_pd EINA_UNUSED, va_list *list) | 666 | _evas_smart_color_set(Eo *eo_obj, Evas_Smart_Data *o EINA_UNUSED, int r, int g, int b, int a) |
744 | { | 667 | { |
745 | int r = va_arg(*list, int); | ||
746 | int g = va_arg(*list, int); | ||
747 | int b = va_arg(*list, int); | ||
748 | int a = va_arg(*list, int); | ||
749 | // If this function is reached, so we do nothing except trying to call | 668 | // If this function is reached, so we do nothing except trying to call |
750 | // the function of the legacy smart class. | 669 | // the function of the legacy smart class. |
751 | Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS); | 670 | Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS); |
@@ -753,10 +672,9 @@ _smart_color_set(Eo *eo_obj, void *_pd EINA_UNUSED, va_list *list) | |||
753 | if (s && s->smart_class->color_set) s->smart_class->color_set(eo_obj, r, g, b, a); | 672 | if (s && s->smart_class->color_set) s->smart_class->color_set(eo_obj, r, g, b, a); |
754 | } | 673 | } |
755 | 674 | ||
756 | static void | 675 | EOLIAN static void |
757 | _smart_clip_set(Eo *eo_obj, void *_pd EINA_UNUSED, va_list *list) | 676 | _evas_smart_clip_set(Eo *eo_obj, Evas_Smart_Data *o EINA_UNUSED, Evas_Object *clip) |
758 | { | 677 | { |
759 | Evas_Object *clip = va_arg(*list, Evas_Object *); | ||
760 | // If this function is reached, so we do nothing except trying to call | 678 | // If this function is reached, so we do nothing except trying to call |
761 | // the function of the legacy smart class. | 679 | // the function of the legacy smart class. |
762 | Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS); | 680 | Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS); |
@@ -764,8 +682,8 @@ _smart_clip_set(Eo *eo_obj, void *_pd EINA_UNUSED, va_list *list) | |||
764 | if (s && s->smart_class->clip_set) s->smart_class->clip_set(eo_obj, clip); | 682 | if (s && s->smart_class->clip_set) s->smart_class->clip_set(eo_obj, clip); |
765 | } | 683 | } |
766 | 684 | ||
767 | static void | 685 | EOLIAN static void |
768 | _smart_clip_unset(Eo *eo_obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED) | 686 | _evas_smart_clip_unset(Eo *eo_obj, Evas_Smart_Data *o EINA_UNUSED) |
769 | { | 687 | { |
770 | // If this function is reached, so we do nothing except trying to call | 688 | // If this function is reached, so we do nothing except trying to call |
771 | // the function of the legacy smart class. | 689 | // the function of the legacy smart class. |
@@ -775,9 +693,8 @@ _smart_clip_unset(Eo *eo_obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED) | |||
775 | } | 693 | } |
776 | 694 | ||
777 | static void | 695 | static void |
778 | _smart_attach(Eo *eo_obj, void *_pd EINA_UNUSED, va_list *list) | 696 | _evas_smart_attach(Eo *eo_obj, Evas_Smart_Data *_pd EINA_UNUSED, Evas_Smart *s) |
779 | { | 697 | { |
780 | Evas_Smart *s = va_arg(*list, Evas_Smart *); | ||
781 | MAGIC_CHECK(s, Evas_Smart, MAGIC_SMART); | 698 | MAGIC_CHECK(s, Evas_Smart, MAGIC_SMART); |
782 | return; | 699 | return; |
783 | MAGIC_CHECK_END(); | 700 | MAGIC_CHECK_END(); |
@@ -818,7 +735,7 @@ evas_object_smart_callback_add(Evas_Object *eo_obj, const char *event, Evas_Smar | |||
818 | EAPI void | 735 | EAPI void |
819 | evas_object_smart_callback_priority_add(Evas_Object *eo_obj, const char *event, Evas_Callback_Priority priority, Evas_Smart_Cb func, const void *data) | 736 | evas_object_smart_callback_priority_add(Evas_Object *eo_obj, const char *event, Evas_Callback_Priority priority, Evas_Smart_Cb func, const void *data) |
820 | { | 737 | { |
821 | Evas_Object_Smart *o; | 738 | Evas_Smart_Data *o; |
822 | 739 | ||
823 | MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ); | 740 | MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ); |
824 | return; | 741 | return; |
@@ -852,7 +769,7 @@ evas_object_smart_callback_priority_add(Evas_Object *eo_obj, const char *event, | |||
852 | EAPI void * | 769 | EAPI void * |
853 | evas_object_smart_callback_del(Evas_Object *eo_obj, const char *event, Evas_Smart_Cb func) | 770 | evas_object_smart_callback_del(Evas_Object *eo_obj, const char *event, Evas_Smart_Cb func) |
854 | { | 771 | { |
855 | Evas_Object_Smart *o; | 772 | Evas_Smart_Data *o; |
856 | _eo_evas_smart_cb_info *info; | 773 | _eo_evas_smart_cb_info *info; |
857 | 774 | ||
858 | MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ); | 775 | MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ); |
@@ -884,7 +801,7 @@ evas_object_smart_callback_del(Evas_Object *eo_obj, const char *event, Evas_Smar | |||
884 | EAPI void * | 801 | EAPI void * |
885 | evas_object_smart_callback_del_full(Evas_Object *eo_obj, const char *event, Evas_Smart_Cb func, const void *data) | 802 | evas_object_smart_callback_del_full(Evas_Object *eo_obj, const char *event, Evas_Smart_Cb func, const void *data) |
886 | { | 803 | { |
887 | Evas_Object_Smart *o; | 804 | Evas_Smart_Data *o; |
888 | _eo_evas_smart_cb_info *info; | 805 | _eo_evas_smart_cb_info *info; |
889 | 806 | ||
890 | MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ); | 807 | MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ); |
@@ -927,67 +844,35 @@ evas_object_smart_callback_call(Evas_Object *eo_obj, const char *event, void *ev | |||
927 | eo_do(eo_obj, eo_event_callback_call(event_desc->eo_desc, event_info, NULL)); | 844 | eo_do(eo_obj, eo_event_callback_call(event_desc->eo_desc, event_info, NULL)); |
928 | } | 845 | } |
929 | 846 | ||
930 | EAPI Eina_Bool | 847 | EOLIAN static Eina_Bool |
931 | evas_object_smart_callbacks_descriptions_set(Evas_Object *eo_obj, const Evas_Smart_Cb_Description *descriptions) | 848 | _evas_smart_callbacks_descriptions_set(Eo *eo_obj EINA_UNUSED, Evas_Smart_Data *o, const Evas_Smart_Cb_Description *descriptions) |
932 | { | 849 | { |
933 | MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ); | ||
934 | return EINA_FALSE; | ||
935 | MAGIC_CHECK_END(); | ||
936 | Eina_Bool result = EINA_FALSE; | ||
937 | eo_do(eo_obj, evas_obj_smart_callbacks_descriptions_set(descriptions, &result)); | ||
938 | return result; | ||
939 | } | ||
940 | |||
941 | static void | ||
942 | _smart_callbacks_descriptions_set(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list) | ||
943 | { | ||
944 | const Evas_Smart_Cb_Description *descriptions = va_arg(*list, Evas_Smart_Cb_Description *); | ||
945 | Eina_Bool *result = va_arg(*list, Eina_Bool *); | ||
946 | if (result) *result = EINA_TRUE; | ||
947 | |||
948 | const Evas_Smart_Cb_Description *d; | 850 | const Evas_Smart_Cb_Description *d; |
949 | Evas_Object_Smart *o = _pd; | ||
950 | unsigned int i, count = 0; | 851 | unsigned int i, count = 0; |
951 | 852 | ||
952 | if ((!descriptions) || (!descriptions->name)) | 853 | if ((!descriptions) || (!descriptions->name)) |
953 | { | 854 | { |
954 | evas_smart_cb_descriptions_resize(&o->callbacks_descriptions, 0); | 855 | evas_smart_cb_descriptions_resize(&o->callbacks_descriptions, 0); |
955 | return; | 856 | return EINA_TRUE; |
956 | } | 857 | } |
957 | 858 | ||
958 | for (count = 0, d = descriptions; d->name; d++) | 859 | for (count = 0, d = descriptions; d->name; d++) |
959 | count++; | 860 | count++; |
960 | 861 | ||
961 | evas_smart_cb_descriptions_resize(&o->callbacks_descriptions, count); | 862 | evas_smart_cb_descriptions_resize(&o->callbacks_descriptions, count); |
962 | if (count == 0) return; | 863 | if (count == 0) return EINA_TRUE; |
963 | 864 | ||
964 | for (i = 0, d = descriptions; i < count; d++, i++) | 865 | for (i = 0, d = descriptions; i < count; d++, i++) |
965 | o->callbacks_descriptions.array[i] = d; | 866 | o->callbacks_descriptions.array[i] = d; |
966 | 867 | ||
967 | evas_smart_cb_descriptions_fix(&o->callbacks_descriptions); | 868 | evas_smart_cb_descriptions_fix(&o->callbacks_descriptions); |
968 | } | ||
969 | 869 | ||
970 | EAPI void | 870 | return EINA_TRUE; |
971 | evas_object_smart_callbacks_descriptions_get(const Evas_Object *eo_obj, const Evas_Smart_Cb_Description ***class_descriptions, unsigned int *class_count, const Evas_Smart_Cb_Description ***instance_descriptions, unsigned int *instance_count) | ||
972 | { | ||
973 | MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ); | ||
974 | if (class_descriptions) *class_descriptions = NULL; | ||
975 | if (class_count) *class_count = 0; | ||
976 | if (instance_descriptions) *instance_descriptions = NULL; | ||
977 | if (instance_count) *instance_count = 0; | ||
978 | return; | ||
979 | MAGIC_CHECK_END(); | ||
980 | eo_do((Eo *)eo_obj, evas_obj_smart_callbacks_descriptions_get(class_descriptions, class_count, instance_descriptions, instance_count)); | ||
981 | } | 871 | } |
982 | 872 | ||
983 | static void | 873 | EOLIAN static void |
984 | _smart_callbacks_descriptions_get(Eo *eo_obj, void *_pd, va_list *list) | 874 | _evas_smart_callbacks_descriptions_get(Eo *eo_obj, Evas_Smart_Data *o, const Evas_Smart_Cb_Description ***class_descriptions, unsigned int *class_count, const Evas_Smart_Cb_Description ***instance_descriptions, unsigned int *instance_count) |
985 | { | 875 | { |
986 | const Evas_Smart_Cb_Description ***class_descriptions = va_arg(*list, const Evas_Smart_Cb_Description ***); | ||
987 | unsigned int *class_count = va_arg(*list, unsigned int *); | ||
988 | const Evas_Smart_Cb_Description ***instance_descriptions = va_arg(*list, const Evas_Smart_Cb_Description ***); | ||
989 | unsigned int *instance_count = va_arg(*list, unsigned int *); | ||
990 | const Evas_Object_Smart *o = _pd; | ||
991 | if (class_descriptions) *class_descriptions = NULL; | 876 | if (class_descriptions) *class_descriptions = NULL; |
992 | if (class_count) *class_count = 0; | 877 | if (class_count) *class_count = 0; |
993 | 878 | ||
@@ -1003,23 +888,9 @@ _smart_callbacks_descriptions_get(Eo *eo_obj, void *_pd, va_list *list) | |||
1003 | *instance_count = o->callbacks_descriptions.size; | 888 | *instance_count = o->callbacks_descriptions.size; |
1004 | } | 889 | } |
1005 | 890 | ||
1006 | EAPI void | 891 | EOLIAN static void |
1007 | evas_object_smart_callback_description_find(const Evas_Object *eo_obj, const char *name, const Evas_Smart_Cb_Description **class_description, const Evas_Smart_Cb_Description **instance_description) | 892 | _evas_smart_callback_description_find(Eo *eo_obj, Evas_Smart_Data *o, const char *name, const Evas_Smart_Cb_Description **class_description, const Evas_Smart_Cb_Description **instance_description) |
1008 | { | ||
1009 | MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ); | ||
1010 | if (class_description) *class_description = NULL; | ||
1011 | if (instance_description) *instance_description = NULL; | ||
1012 | return; | ||
1013 | MAGIC_CHECK_END(); | ||
1014 | eo_do((Eo *)eo_obj, evas_obj_smart_callback_description_find(name, class_description, instance_description)); | ||
1015 | } | ||
1016 | |||
1017 | static void | ||
1018 | _smart_callback_description_find(Eo *eo_obj, void *_pd, va_list *list) | ||
1019 | { | 893 | { |
1020 | const char *name = va_arg(*list, const char *); | ||
1021 | const Evas_Smart_Cb_Description **class_description = va_arg(*list, const Evas_Smart_Cb_Description **); | ||
1022 | const Evas_Smart_Cb_Description **instance_description = va_arg(*list, const Evas_Smart_Cb_Description **); | ||
1023 | 894 | ||
1024 | if (!name) | 895 | if (!name) |
1025 | { | 896 | { |
@@ -1029,7 +900,6 @@ _smart_callback_description_find(Eo *eo_obj, void *_pd, va_list *list) | |||
1029 | } | 900 | } |
1030 | 901 | ||
1031 | Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS); | 902 | Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS); |
1032 | const Evas_Object_Smart *o = _pd; | ||
1033 | if (class_description) | 903 | if (class_description) |
1034 | *class_description = evas_smart_cb_description_find | 904 | *class_description = evas_smart_cb_description_find |
1035 | (&obj->smart.smart->callbacks, name); | 905 | (&obj->smart.smart->callbacks, name); |
@@ -1039,20 +909,9 @@ _smart_callback_description_find(Eo *eo_obj, void *_pd, va_list *list) | |||
1039 | (&o->callbacks_descriptions, name); | 909 | (&o->callbacks_descriptions, name); |
1040 | } | 910 | } |
1041 | 911 | ||
1042 | EAPI void | 912 | EOLIAN static void |
1043 | evas_object_smart_need_recalculate_set(Evas_Object *eo_obj, Eina_Bool value) | 913 | _evas_smart_need_recalculate_set(Eo *eo_obj, Evas_Smart_Data *o, Eina_Bool value) |
1044 | { | ||
1045 | MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ); | ||
1046 | return; | ||
1047 | MAGIC_CHECK_END(); | ||
1048 | eo_do(eo_obj, evas_obj_smart_need_recalculate_set(value)); | ||
1049 | } | ||
1050 | |||
1051 | static void | ||
1052 | _smart_need_recalculate_set(Eo *eo_obj, void *_pd, va_list *list) | ||
1053 | { | 914 | { |
1054 | Eina_Bool value = va_arg(*list, int); | ||
1055 | Evas_Object_Smart *o = _pd; | ||
1056 | Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS); | 915 | Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS); |
1057 | 916 | ||
1058 | // XXX: do i need this? | 917 | // XXX: do i need this? |
@@ -1079,39 +938,16 @@ _smart_need_recalculate_set(Eo *eo_obj, void *_pd, va_list *list) | |||
1079 | o->need_recalculate = value; | 938 | o->need_recalculate = value; |
1080 | } | 939 | } |
1081 | 940 | ||
1082 | EAPI Eina_Bool | 941 | EOLIAN static Eina_Bool |
1083 | evas_object_smart_need_recalculate_get(const Evas_Object *eo_obj) | 942 | _evas_smart_need_recalculate_get(Eo *eo_obj EINA_UNUSED, Evas_Smart_Data *o) |
1084 | { | ||
1085 | MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ); | ||
1086 | return EINA_FALSE; | ||
1087 | MAGIC_CHECK_END(); | ||
1088 | Eina_Bool need_recalculate = EINA_FALSE; | ||
1089 | eo_do((Eo *)eo_obj, evas_obj_smart_need_recalculate_get(&need_recalculate)); | ||
1090 | return need_recalculate; | ||
1091 | } | ||
1092 | |||
1093 | static void | ||
1094 | _smart_need_recalculate_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list) | ||
1095 | { | 943 | { |
1096 | Eina_Bool *need_recalculate = va_arg(*list, Eina_Bool *); | 944 | return o->need_recalculate; |
1097 | const Evas_Object_Smart *o = _pd; | ||
1098 | if (need_recalculate) *need_recalculate = o->need_recalculate; | ||
1099 | } | 945 | } |
1100 | 946 | ||
1101 | EAPI void | 947 | EOLIAN static void |
1102 | evas_object_smart_calculate(Evas_Object *eo_obj) | 948 | _evas_smart_calculate(Eo *eo_obj, Evas_Smart_Data *o) |
1103 | { | ||
1104 | MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ); | ||
1105 | return; | ||
1106 | MAGIC_CHECK_END(); | ||
1107 | eo_do(eo_obj, evas_obj_smart_calculate()); | ||
1108 | } | ||
1109 | |||
1110 | static void | ||
1111 | _smart_calculate(Eo *eo_obj, void *_pd, va_list *list EINA_UNUSED) | ||
1112 | { | 949 | { |
1113 | Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS); | 950 | Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS); |
1114 | Evas_Object_Smart *o = _pd; | ||
1115 | 951 | ||
1116 | if (!obj->smart.smart || !obj->smart.smart->smart_class->calculate) | 952 | if (!obj->smart.smart || !obj->smart.smart->smart_class->calculate) |
1117 | return; | 953 | return; |
@@ -1127,7 +963,7 @@ evas_smart_objects_calculate(Evas *eo_e) | |||
1127 | } | 963 | } |
1128 | 964 | ||
1129 | void | 965 | void |
1130 | _canvas_smart_objects_calculate(Eo *eo_e, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED) | 966 | _canvas_smart_objects_calculate(Eo *eo_e, void *o EINA_UNUSED, va_list *list EINA_UNUSED) |
1131 | { | 967 | { |
1132 | evas_call_smarts_calculate(eo_e); | 968 | evas_call_smarts_calculate(eo_e); |
1133 | } | 969 | } |
@@ -1159,7 +995,7 @@ _canvas_smart_objects_calculate_count_get(Eo *eo_e EINA_UNUSED, void *_pd, va_li | |||
1159 | void | 995 | void |
1160 | evas_call_smarts_calculate(Evas *eo_e) | 996 | evas_call_smarts_calculate(Evas *eo_e) |
1161 | { | 997 | { |
1162 | Evas_Object_Smart *o; | 998 | Evas_Smart_Data *o; |
1163 | Eina_Clist *elem; | 999 | Eina_Clist *elem; |
1164 | Evas_Public_Data *e = eo_data_scope_get(eo_e, EVAS_CLASS); | 1000 | Evas_Public_Data *e = eo_data_scope_get(eo_e, EVAS_CLASS); |
1165 | 1001 | ||
@@ -1171,7 +1007,7 @@ evas_call_smarts_calculate(Evas *eo_e) | |||
1171 | Evas_Object_Protected_Data *obj; | 1007 | Evas_Object_Protected_Data *obj; |
1172 | 1008 | ||
1173 | /* move the item to the processed list */ | 1009 | /* move the item to the processed list */ |
1174 | o = EINA_CLIST_ENTRY(elem, Evas_Object_Smart, calc_entry); | 1010 | o = EINA_CLIST_ENTRY(elem, Evas_Smart_Data, calc_entry); |
1175 | eina_clist_remove(&o->calc_entry); | 1011 | eina_clist_remove(&o->calc_entry); |
1176 | obj = eo_data_scope_get(o->object, EVAS_OBJ_CLASS); | 1012 | obj = eo_data_scope_get(o->object, EVAS_OBJ_CLASS); |
1177 | 1013 | ||
@@ -1190,7 +1026,7 @@ evas_call_smarts_calculate(Evas *eo_e) | |||
1190 | 1026 | ||
1191 | while (NULL != (elem = eina_clist_head(&e->calc_done))) | 1027 | while (NULL != (elem = eina_clist_head(&e->calc_done))) |
1192 | { | 1028 | { |
1193 | o = EINA_CLIST_ENTRY(elem, Evas_Object_Smart, calc_entry); | 1029 | o = EINA_CLIST_ENTRY(elem, Evas_Smart_Data, calc_entry); |
1194 | o->recalculate_cycle = 0; | 1030 | o->recalculate_cycle = 0; |
1195 | eina_clist_remove(&o->calc_entry); | 1031 | eina_clist_remove(&o->calc_entry); |
1196 | } | 1032 | } |
@@ -1201,17 +1037,8 @@ evas_call_smarts_calculate(Evas *eo_e) | |||
1201 | evas_event_thaw_eval(eo_e); | 1037 | evas_event_thaw_eval(eo_e); |
1202 | } | 1038 | } |
1203 | 1039 | ||
1204 | EAPI void | 1040 | EOLIAN static void |
1205 | evas_object_smart_changed(Evas_Object *eo_obj) | 1041 | _evas_smart_changed(Eo *eo_obj, Evas_Smart_Data *o EINA_UNUSED) |
1206 | { | ||
1207 | MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ); | ||
1208 | return; | ||
1209 | MAGIC_CHECK_END(); | ||
1210 | eo_do(eo_obj, evas_obj_smart_changed()); | ||
1211 | } | ||
1212 | |||
1213 | static void | ||
1214 | _smart_changed(Eo *eo_obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED) | ||
1215 | { | 1042 | { |
1216 | Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS); | 1043 | Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS); |
1217 | evas_object_change(eo_obj, obj); | 1044 | evas_object_change(eo_obj, obj); |
@@ -1248,7 +1075,7 @@ void | |||
1248 | evas_object_smart_del(Evas_Object *eo_obj) | 1075 | evas_object_smart_del(Evas_Object *eo_obj) |
1249 | { | 1076 | { |
1250 | Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS); | 1077 | Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS); |
1251 | Evas_Object_Smart *sobj; | 1078 | Evas_Smart_Data *sobj; |
1252 | Evas_Smart *s; | 1079 | Evas_Smart *s; |
1253 | unsigned int i; | 1080 | unsigned int i; |
1254 | 1081 | ||
@@ -1281,7 +1108,7 @@ evas_object_smart_del(Evas_Object *eo_obj) | |||
1281 | void | 1108 | void |
1282 | evas_object_update_bounding_box(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj) | 1109 | evas_object_update_bounding_box(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj) |
1283 | { | 1110 | { |
1284 | Evas_Object_Smart *s = NULL; | 1111 | Evas_Smart_Data *s = NULL; |
1285 | Eina_Bool propagate = EINA_FALSE; | 1112 | Eina_Bool propagate = EINA_FALSE; |
1286 | Eina_Bool computeminmax = EINA_FALSE; | 1113 | Eina_Bool computeminmax = EINA_FALSE; |
1287 | Evas_Coord x, y, w, h; | 1114 | Evas_Coord x, y, w, h; |
@@ -1324,7 +1151,7 @@ evas_object_update_bounding_box(Evas_Object *eo_obj, Evas_Object_Protected_Data | |||
1324 | * That's why we initialiaze min and max search to geometry of the parent object. | 1151 | * That's why we initialiaze min and max search to geometry of the parent object. |
1325 | */ | 1152 | */ |
1326 | Evas_Object_Protected_Data *smart_obj = eo_data_scope_get(obj->smart.parent, EVAS_OBJ_CLASS); | 1153 | Evas_Object_Protected_Data *smart_obj = eo_data_scope_get(obj->smart.parent, EVAS_OBJ_CLASS); |
1327 | Evas_Object_Smart *smart_parent = eo_data_scope_get(obj->smart.parent, MY_CLASS); | 1154 | Evas_Smart_Data *smart_parent = eo_data_scope_get(obj->smart.parent, MY_CLASS); |
1328 | if (!smart_parent || !smart_obj) return; | 1155 | if (!smart_parent || !smart_obj) return; |
1329 | 1156 | ||
1330 | if (smart_obj->cur->valid_bounding_box) | 1157 | if (smart_obj->cur->valid_bounding_box) |
@@ -1418,7 +1245,7 @@ evas_object_smart_bounding_box_get(Evas_Object *eo_obj, | |||
1418 | Evas_Coord_Rectangle *cur_bounding_box, | 1245 | Evas_Coord_Rectangle *cur_bounding_box, |
1419 | Evas_Coord_Rectangle *prev_bounding_box) | 1246 | Evas_Coord_Rectangle *prev_bounding_box) |
1420 | { | 1247 | { |
1421 | Evas_Object_Smart *s = eo_data_scope_get(eo_obj, MY_CLASS); | 1248 | Evas_Smart_Data *s = eo_data_scope_get(eo_obj, MY_CLASS); |
1422 | 1249 | ||
1423 | if (cur_bounding_box) memcpy(cur_bounding_box, | 1250 | if (cur_bounding_box) memcpy(cur_bounding_box, |
1424 | &s->cur.bounding_box, | 1251 | &s->cur.bounding_box, |
@@ -1438,7 +1265,7 @@ evas_object_smart_cleanup(Evas_Object *eo_obj) | |||
1438 | 1265 | ||
1439 | if (obj->is_smart) | 1266 | if (obj->is_smart) |
1440 | { | 1267 | { |
1441 | Evas_Object_Smart *o = eo_data_scope_get(eo_obj, MY_CLASS); | 1268 | Evas_Smart_Data *o = eo_data_scope_get(eo_obj, MY_CLASS); |
1442 | if (o->calc_entry.next) | 1269 | if (o->calc_entry.next) |
1443 | eina_clist_remove(&o->calc_entry); | 1270 | eina_clist_remove(&o->calc_entry); |
1444 | 1271 | ||
@@ -1486,7 +1313,7 @@ evas_object_smart_member_cache_invalidate(Evas_Object *eo_obj, | |||
1486 | obj->parent_cache.src_invisible_valid = EINA_FALSE; | 1313 | obj->parent_cache.src_invisible_valid = EINA_FALSE; |
1487 | 1314 | ||
1488 | if (!obj->is_smart) return; | 1315 | if (!obj->is_smart) return; |
1489 | Evas_Object_Smart *o = eo_data_scope_get(eo_obj, MY_CLASS); | 1316 | Evas_Smart_Data *o = eo_data_scope_get(eo_obj, MY_CLASS); |
1490 | EINA_INLIST_FOREACH(o->contained, member) | 1317 | EINA_INLIST_FOREACH(o->contained, member) |
1491 | { | 1318 | { |
1492 | Evas_Object *eo_member = member->object; | 1319 | Evas_Object *eo_member = member->object; |
@@ -1499,7 +1326,7 @@ evas_object_smart_member_cache_invalidate(Evas_Object *eo_obj, | |||
1499 | void | 1326 | void |
1500 | evas_object_smart_member_raise(Evas_Object *eo_member) | 1327 | evas_object_smart_member_raise(Evas_Object *eo_member) |
1501 | { | 1328 | { |
1502 | Evas_Object_Smart *o; | 1329 | Evas_Smart_Data *o; |
1503 | Evas_Object_Protected_Data *member = eo_data_scope_get(eo_member, EVAS_OBJ_CLASS); | 1330 | Evas_Object_Protected_Data *member = eo_data_scope_get(eo_member, EVAS_OBJ_CLASS); |
1504 | o = eo_data_scope_get(member->smart.parent, MY_CLASS); | 1331 | o = eo_data_scope_get(member->smart.parent, MY_CLASS); |
1505 | o->contained = eina_inlist_demote(o->contained, EINA_INLIST_GET(member)); | 1332 | o->contained = eina_inlist_demote(o->contained, EINA_INLIST_GET(member)); |
@@ -1508,7 +1335,7 @@ evas_object_smart_member_raise(Evas_Object *eo_member) | |||
1508 | void | 1335 | void |
1509 | evas_object_smart_member_lower(Evas_Object *eo_member) | 1336 | evas_object_smart_member_lower(Evas_Object *eo_member) |
1510 | { | 1337 | { |
1511 | Evas_Object_Smart *o; | 1338 | Evas_Smart_Data *o; |
1512 | Evas_Object_Protected_Data *member = eo_data_scope_get(eo_member, EVAS_OBJ_CLASS); | 1339 | Evas_Object_Protected_Data *member = eo_data_scope_get(eo_member, EVAS_OBJ_CLASS); |
1513 | o = eo_data_scope_get(member->smart.parent, MY_CLASS); | 1340 | o = eo_data_scope_get(member->smart.parent, MY_CLASS); |
1514 | o->contained = eina_inlist_promote(o->contained, EINA_INLIST_GET(member)); | 1341 | o->contained = eina_inlist_promote(o->contained, EINA_INLIST_GET(member)); |
@@ -1517,7 +1344,7 @@ evas_object_smart_member_lower(Evas_Object *eo_member) | |||
1517 | void | 1344 | void |
1518 | evas_object_smart_member_stack_above(Evas_Object *eo_member, Evas_Object *eo_other) | 1345 | evas_object_smart_member_stack_above(Evas_Object *eo_member, Evas_Object *eo_other) |
1519 | { | 1346 | { |
1520 | Evas_Object_Smart *o; | 1347 | Evas_Smart_Data *o; |
1521 | Evas_Object_Protected_Data *member = eo_data_scope_get(eo_member, EVAS_OBJ_CLASS); | 1348 | Evas_Object_Protected_Data *member = eo_data_scope_get(eo_member, EVAS_OBJ_CLASS); |
1522 | Evas_Object_Protected_Data *other = eo_data_scope_get(eo_other, EVAS_OBJ_CLASS); | 1349 | Evas_Object_Protected_Data *other = eo_data_scope_get(eo_other, EVAS_OBJ_CLASS); |
1523 | o = eo_data_scope_get(member->smart.parent, MY_CLASS); | 1350 | o = eo_data_scope_get(member->smart.parent, MY_CLASS); |
@@ -1528,7 +1355,7 @@ evas_object_smart_member_stack_above(Evas_Object *eo_member, Evas_Object *eo_oth | |||
1528 | void | 1355 | void |
1529 | evas_object_smart_member_stack_below(Evas_Object *eo_member, Evas_Object *eo_other) | 1356 | evas_object_smart_member_stack_below(Evas_Object *eo_member, Evas_Object *eo_other) |
1530 | { | 1357 | { |
1531 | Evas_Object_Smart *o; | 1358 | Evas_Smart_Data *o; |
1532 | Evas_Object_Protected_Data *member = eo_data_scope_get(eo_member, EVAS_OBJ_CLASS); | 1359 | Evas_Object_Protected_Data *member = eo_data_scope_get(eo_member, EVAS_OBJ_CLASS); |
1533 | Evas_Object_Protected_Data *other = eo_data_scope_get(eo_other, EVAS_OBJ_CLASS); | 1360 | Evas_Object_Protected_Data *other = eo_data_scope_get(eo_other, EVAS_OBJ_CLASS); |
1534 | o = eo_data_scope_get(member->smart.parent, MY_CLASS); | 1361 | o = eo_data_scope_get(member->smart.parent, MY_CLASS); |
@@ -1543,7 +1370,7 @@ evas_object_smart_need_bounding_box_update(Evas_Object *eo_obj) | |||
1543 | return; | 1370 | return; |
1544 | MAGIC_CHECK_END(); | 1371 | MAGIC_CHECK_END(); |
1545 | Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS); | 1372 | Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS); |
1546 | Evas_Object_Smart *o = eo_data_scope_get(eo_obj, MY_CLASS); | 1373 | Evas_Smart_Data *o = eo_data_scope_get(eo_obj, MY_CLASS); |
1547 | 1374 | ||
1548 | if (o->update_boundingbox_needed) return; | 1375 | if (o->update_boundingbox_needed) return; |
1549 | o->update_boundingbox_needed = EINA_TRUE; | 1376 | o->update_boundingbox_needed = EINA_TRUE; |
@@ -1554,7 +1381,7 @@ evas_object_smart_need_bounding_box_update(Evas_Object *eo_obj) | |||
1554 | void | 1381 | void |
1555 | evas_object_smart_bounding_box_update(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj) | 1382 | evas_object_smart_bounding_box_update(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj) |
1556 | { | 1383 | { |
1557 | Evas_Object_Smart *os; | 1384 | Evas_Smart_Data *os; |
1558 | Eina_Inlist *list; | 1385 | Eina_Inlist *list; |
1559 | Evas_Object_Protected_Data *o; | 1386 | Evas_Object_Protected_Data *o; |
1560 | Evas_Coord minx; | 1387 | Evas_Coord minx; |
@@ -1587,7 +1414,7 @@ evas_object_smart_bounding_box_update(Evas_Object *eo_obj, Evas_Object_Protected | |||
1587 | 1414 | ||
1588 | if (o->is_smart) | 1415 | if (o->is_smart) |
1589 | { | 1416 | { |
1590 | Evas_Object_Smart *s = eo_data_scope_get(o->object, MY_CLASS); | 1417 | Evas_Smart_Data *s = eo_data_scope_get(o->object, MY_CLASS); |
1591 | 1418 | ||
1592 | evas_object_smart_bounding_box_update(o->object, o); | 1419 | evas_object_smart_bounding_box_update(o->object, o); |
1593 | 1420 | ||
@@ -1660,7 +1487,7 @@ evas_object_smart_render_pre(Evas_Object *eo_obj, | |||
1660 | { | 1487 | { |
1661 | #if 0 | 1488 | #if 0 |
1662 | // REDO to handle smart move | 1489 | // REDO to handle smart move |
1663 | Evas_Object_Smart *o; | 1490 | Evas_Smart_Data *o; |
1664 | 1491 | ||
1665 | fprintf(stderr, ""); | 1492 | fprintf(stderr, ""); |
1666 | o = type_private_data; | 1493 | o = type_private_data; |
@@ -1739,116 +1566,43 @@ evas_object_smart_render_pre(Evas_Object *eo_obj, | |||
1739 | static void | 1566 | static void |
1740 | evas_object_smart_render_post(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj EINA_UNUSED, void *type_private_data) | 1567 | evas_object_smart_render_post(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj EINA_UNUSED, void *type_private_data) |
1741 | { | 1568 | { |
1742 | Evas_Object_Smart *o = type_private_data; | 1569 | Evas_Smart_Data *o = type_private_data; |
1743 | evas_object_cur_prev(eo_obj); | 1570 | evas_object_cur_prev(eo_obj); |
1744 | o->prev = o->cur; | 1571 | o->prev = o->cur; |
1745 | } | 1572 | } |
1746 | 1573 | ||
1747 | static unsigned int evas_object_smart_id_get(Evas_Object *eo_obj) | 1574 | static unsigned int evas_object_smart_id_get(Evas_Object *eo_obj) |
1748 | { | 1575 | { |
1749 | Evas_Object_Smart *o = eo_data_scope_get(eo_obj, MY_CLASS); | 1576 | Evas_Smart_Data *o = eo_data_scope_get(eo_obj, MY_CLASS); |
1750 | if (!o) return 0; | 1577 | if (!o) return 0; |
1751 | return MAGIC_OBJ_SMART; | 1578 | return MAGIC_OBJ_SMART; |
1752 | } | 1579 | } |
1753 | 1580 | ||
1754 | static unsigned int evas_object_smart_visual_id_get(Evas_Object *eo_obj) | 1581 | static unsigned int evas_object_smart_visual_id_get(Evas_Object *eo_obj) |
1755 | { | 1582 | { |
1756 | Evas_Object_Smart *o = eo_data_scope_get(eo_obj, MY_CLASS); | 1583 | Evas_Smart_Data *o = eo_data_scope_get(eo_obj, MY_CLASS); |
1757 | if (!o) return 0; | 1584 | if (!o) return 0; |
1758 | return MAGIC_OBJ_CONTAINER; | 1585 | return MAGIC_OBJ_CONTAINER; |
1759 | } | 1586 | } |
1760 | 1587 | ||
1761 | static void *evas_object_smart_engine_data_get(Evas_Object *eo_obj) | 1588 | static void *evas_object_smart_engine_data_get(Evas_Object *eo_obj) |
1762 | { | 1589 | { |
1763 | Evas_Object_Smart *o = eo_data_scope_get(eo_obj, MY_CLASS); | 1590 | Evas_Smart_Data *o = eo_data_scope_get(eo_obj, MY_CLASS); |
1764 | if (!o) return NULL; | 1591 | if (!o) return NULL; |
1765 | return o->engine_data; | 1592 | return o->engine_data; |
1766 | } | 1593 | } |
1767 | 1594 | ||
1768 | static void | 1595 | static void |
1769 | _class_constructor(Eo_Class *klass) | 1596 | _evas_smart_class_constructor(Eo_Class *klass EINA_UNUSED) |
1770 | { | 1597 | { |
1771 | const Eo_Op_Func_Description func_desc[] = { | ||
1772 | EO_OP_FUNC(EO_BASE_ID(EO_BASE_SUB_ID_CONSTRUCTOR), _constructor), | ||
1773 | EO_OP_FUNC(EVAS_OBJ_ID(EVAS_OBJ_SUB_ID_SMART_TYPE_CHECK), _smart_type_check), | ||
1774 | EO_OP_FUNC(EVAS_OBJ_ID(EVAS_OBJ_SUB_ID_SMART_TYPE_CHECK_PTR), _smart_type_check_ptr), | ||
1775 | EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DATA_SET), _smart_data_set), | ||
1776 | EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_SMART_GET), _smart_smart_get), | ||
1777 | EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_MEMBER_ADD), _smart_member_add), | ||
1778 | EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_MEMBER_DEL), _smart_member_del), | ||
1779 | EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_MEMBERS_GET), _smart_members_get), | ||
1780 | EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_ITERATOR_NEW), _iterator_new), | ||
1781 | EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_CALLBACKS_DESCRIPTIONS_SET), _smart_callbacks_descriptions_set), | ||
1782 | EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_CALLBACKS_DESCRIPTIONS_GET), _smart_callbacks_descriptions_get), | ||
1783 | EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_CALLBACK_DESCRIPTION_FIND), _smart_callback_description_find), | ||
1784 | EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_NEED_RECALCULATE_SET), _smart_need_recalculate_set), | ||
1785 | EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_NEED_RECALCULATE_GET), _smart_need_recalculate_get), | ||
1786 | EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_CALCULATE), _smart_calculate), | ||
1787 | EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_CHANGED), _smart_changed), | ||
1788 | EO_OP_FUNC(EVAS_OBJ_ID(EVAS_OBJ_SUB_ID_SMART_DATA_GET), _smart_data_get), | ||
1789 | EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_ATTACH), _smart_attach), | ||
1790 | EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_ADD), _smart_add), | ||
1791 | EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _smart_del), | ||
1792 | EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_RESIZE), _smart_resize), | ||
1793 | EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_MOVE), _smart_move), | ||
1794 | EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_SHOW), _smart_show), | ||
1795 | EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_HIDE), _smart_hide), | ||
1796 | EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_COLOR_SET), _smart_color_set), | ||
1797 | EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_CLIP_SET), _smart_clip_set), | ||
1798 | EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_CLIP_UNSET), _smart_clip_unset), | ||
1799 | EO_OP_FUNC_SENTINEL | ||
1800 | }; | ||
1801 | |||
1802 | eo_class_funcs_set(klass, func_desc); | ||
1803 | |||
1804 | _evas_smart_class_names_hash_table = eina_hash_string_small_new(NULL); | 1598 | _evas_smart_class_names_hash_table = eina_hash_string_small_new(NULL); |
1805 | |||
1806 | evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); | 1599 | evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); |
1807 | } | 1600 | } |
1808 | 1601 | ||
1809 | static void | 1602 | static void |
1810 | _class_destructor(Eo_Class *klass EINA_UNUSED) | 1603 | _evas_smart_class_destructor(Eo_Class *klass EINA_UNUSED) |
1811 | { | 1604 | { |
1812 | eina_hash_free(_evas_smart_class_names_hash_table); | 1605 | eina_hash_free(_evas_smart_class_names_hash_table); |
1813 | } | 1606 | } |
1814 | 1607 | ||
1815 | static const Eo_Op_Description op_desc[] = { | 1608 | #include "canvas/evas_smart.eo.c" |
1816 | EO_OP_DESCRIPTION(EVAS_OBJ_SMART_SUB_ID_DATA_SET, "Store a pointer to user data for a given smart object."), | ||
1817 | EO_OP_DESCRIPTION(EVAS_OBJ_SMART_SUB_ID_SMART_GET, "Get the #Evas_Smart from which obj smart object was created."), | ||
1818 | EO_OP_DESCRIPTION(EVAS_OBJ_SMART_SUB_ID_MEMBER_ADD, "Set an Evas object as a member of a given smart object."), | ||
1819 | EO_OP_DESCRIPTION(EVAS_OBJ_SMART_SUB_ID_MEMBER_DEL, "Removes a member object from a given smart object."), | ||
1820 | EO_OP_DESCRIPTION(EVAS_OBJ_SMART_SUB_ID_MEMBERS_GET, "Retrieves the list of the member objects of a given Evas smart"), | ||
1821 | EO_OP_DESCRIPTION(EVAS_OBJ_SMART_SUB_ID_ITERATOR_NEW, "Retrieves an iterator of the member object of a given Evas smart"), | ||
1822 | EO_OP_DESCRIPTION(EVAS_OBJ_SMART_SUB_ID_CALLBACKS_DESCRIPTIONS_SET, "Set an smart object instance's smart callbacks descriptions."), | ||
1823 | EO_OP_DESCRIPTION(EVAS_OBJ_SMART_SUB_ID_CALLBACKS_DESCRIPTIONS_GET, "Retrieve an smart object's know smart callback descriptions (both"), | ||
1824 | EO_OP_DESCRIPTION(EVAS_OBJ_SMART_SUB_ID_CALLBACK_DESCRIPTION_FIND, "Find callback description for callback called name."), | ||
1825 | EO_OP_DESCRIPTION(EVAS_OBJ_SMART_SUB_ID_NEED_RECALCULATE_SET, "Set or unset the flag signalling that a given smart object needs to"), | ||
1826 | EO_OP_DESCRIPTION(EVAS_OBJ_SMART_SUB_ID_NEED_RECALCULATE_GET, "Get the value of the flag signalling that a given smart object needs to"), | ||
1827 | EO_OP_DESCRIPTION(EVAS_OBJ_SMART_SUB_ID_CALCULATE, "Call the calculate() smart function immediately on a given smart"), | ||
1828 | EO_OP_DESCRIPTION(EVAS_OBJ_SMART_SUB_ID_CHANGED, "Mark smart object as changed, dirty."), | ||
1829 | EO_OP_DESCRIPTION(EVAS_OBJ_SMART_SUB_ID_ATTACH, "Attach an object to a canvas."), | ||
1830 | EO_OP_DESCRIPTION(EVAS_OBJ_SMART_SUB_ID_ADD, "Add an object to a canvas."), | ||
1831 | EO_OP_DESCRIPTION(EVAS_OBJ_SMART_SUB_ID_DEL, "Remove an object from a canvas."), | ||
1832 | EO_OP_DESCRIPTION(EVAS_OBJ_SMART_SUB_ID_RESIZE, "Resize an object on a canvas."), | ||
1833 | EO_OP_DESCRIPTION(EVAS_OBJ_SMART_SUB_ID_MOVE, "Move an object on a canvas."), | ||
1834 | EO_OP_DESCRIPTION(EVAS_OBJ_SMART_SUB_ID_SHOW, "Show an object on a canvas."), | ||
1835 | EO_OP_DESCRIPTION(EVAS_OBJ_SMART_SUB_ID_HIDE, "Hide an object on a canvas."), | ||
1836 | EO_OP_DESCRIPTION(EVAS_OBJ_SMART_SUB_ID_COLOR_SET, "Set color of an object on a canvas."), | ||
1837 | EO_OP_DESCRIPTION(EVAS_OBJ_SMART_SUB_ID_CLIP_SET, "Set a clipper of an object on a canvas."), | ||
1838 | EO_OP_DESCRIPTION(EVAS_OBJ_SMART_SUB_ID_CLIP_UNSET, "Unset a clipper of an object on a canvas."), | ||
1839 | EO_OP_DESCRIPTION_SENTINEL | ||
1840 | }; | ||
1841 | |||
1842 | static const Eo_Class_Description class_desc = { | ||
1843 | EO_VERSION, | ||
1844 | MY_CLASS_NAME, | ||
1845 | EO_CLASS_TYPE_REGULAR, | ||
1846 | EO_CLASS_DESCRIPTION_OPS(&EVAS_OBJ_SMART_BASE_ID, op_desc, EVAS_OBJ_SMART_SUB_ID_LAST), | ||
1847 | NULL, | ||
1848 | sizeof(Evas_Object_Smart), | ||
1849 | _class_constructor, | ||
1850 | _class_destructor | ||
1851 | }; | ||
1852 | |||
1853 | EO_DEFINE_CLASS(evas_object_smart_class_get, &class_desc, EVAS_OBJ_CLASS, EVAS_SMART_SIGNAL_INTERFACE, NULL); | ||
1854 | |||
diff --git a/src/lib/evas/canvas/evas_signal_interface.eo b/src/lib/evas/canvas/evas_signal_interface.eo new file mode 100644 index 0000000000..f15ea3a588 --- /dev/null +++ b/src/lib/evas/canvas/evas_signal_interface.eo | |||
@@ -0,0 +1,8 @@ | |||
1 | interface Evas_Signal_Interface () | ||
2 | { | ||
3 | data: null; | ||
4 | implements { | ||
5 | class::constructor; | ||
6 | class::destructor; | ||
7 | } | ||
8 | } | ||
diff --git a/src/lib/evas/canvas/evas_smart.eo b/src/lib/evas/canvas/evas_smart.eo new file mode 100644 index 0000000000..39f3c21e52 --- /dev/null +++ b/src/lib/evas/canvas/evas_smart.eo | |||
@@ -0,0 +1,354 @@ | |||
1 | class Evas_Smart (Evas_Object, Evas_Signal_Interface) | ||
2 | { | ||
3 | legacy_prefix: evas_object_smart; | ||
4 | eo_prefix: evas_obj_smart; | ||
5 | properties { | ||
6 | need_recalculate { | ||
7 | set { | ||
8 | /*@ | ||
9 | Set or unset the flag signalling that a given smart object needs to | ||
10 | get recalculated. | ||
11 | |||
12 | If this flag is set, then the @c calculate() smart function of @p | ||
13 | obj will be called, if one is provided, during rendering phase of | ||
14 | Evas (see evas_render()), after which this flag will be | ||
15 | automatically unset. | ||
16 | |||
17 | If that smart function is not provided for the given object, this | ||
18 | flag will be left unchanged. | ||
19 | |||
20 | @note just setting this flag will not make the canvas' whole scene | ||
21 | dirty, by itself, and evas_render() will have no effect. To | ||
22 | force that, use evas_object_smart_changed(), that will also | ||
23 | call this function automatically, with @c EINA_TRUE as parameter. | ||
24 | |||
25 | @see evas_object_smart_need_recalculate_get() | ||
26 | @see evas_object_smart_calculate() | ||
27 | @see evas_smart_objects_calculate() | ||
28 | |||
29 | @ingroup Evas_Smart_Object_Group */ | ||
30 | } | ||
31 | get { | ||
32 | /*@ | ||
33 | Get the value of the flag signalling that a given smart object needs to | ||
34 | get recalculated. | ||
35 | |||
36 | @return if flag is set or not. | ||
37 | |||
38 | @note this flag will be unset during the rendering phase, when the | ||
39 | @c calculate() smart function is called, if one is provided. | ||
40 | If it's not provided, then the flag will be left unchanged | ||
41 | after the rendering phase. | ||
42 | |||
43 | @see evas_object_smart_need_recalculate_set(), for more details | ||
44 | |||
45 | @ingroup Evas_Smart_Object_Group */ | ||
46 | } | ||
47 | values { | ||
48 | Eina_Bool value; /*@ whether one wants to set (@c EINA_TRUE) or to unset | ||
49 | (@c EINA_FALSE) the flag. */ | ||
50 | } | ||
51 | } | ||
52 | clip { | ||
53 | set { | ||
54 | /*@ No description supplied by the EAPI. */ | ||
55 | } | ||
56 | values { | ||
57 | Evas_Object *clip; | ||
58 | } | ||
59 | } | ||
60 | color { | ||
61 | set { | ||
62 | /*@ No description supplied by the EAPI. */ | ||
63 | } | ||
64 | values { | ||
65 | int r; | ||
66 | int g; | ||
67 | int b; | ||
68 | int a; | ||
69 | } | ||
70 | } | ||
71 | data { | ||
72 | set { | ||
73 | /*@ | ||
74 | Store a pointer to user data for a given smart object. | ||
75 | |||
76 | This data is stored @b independently of the one set by | ||
77 | evas_object_data_set(), naturally. | ||
78 | |||
79 | @see evas_object_smart_data_get() | ||
80 | |||
81 | @ingroup Evas_Smart_Object_Group */ | ||
82 | } | ||
83 | values { | ||
84 | void *data; /*@ A pointer to user data */ | ||
85 | } | ||
86 | } | ||
87 | members { | ||
88 | get { | ||
89 | /*@ | ||
90 | Retrieves the list of the member objects of a given Evas smart | ||
91 | object | ||
92 | |||
93 | @return Returns the list of the member objects of @p obj. | ||
94 | |||
95 | The returned list should be freed with @c eina_list_free() when you | ||
96 | no longer need it. | ||
97 | |||
98 | @since 1.7 This function will return @c NULL when a non-smart object is passed. | ||
99 | |||
100 | @see evas_object_smart_member_add() | ||
101 | @see evas_object_smart_member_del() | ||
102 | @see evas_object_smart_iterator_new() */ | ||
103 | return Eina_List * @warn_unused; | ||
104 | } | ||
105 | } | ||
106 | smart { | ||
107 | get { | ||
108 | /*@ | ||
109 | Get the #Evas_Smart from which @p obj smart object was created. | ||
110 | |||
111 | @return the #Evas_Smart handle or @c NULL, on errors | ||
112 | |||
113 | @ingroup Evas_Smart_Object_Group */ | ||
114 | return Evas_Smart * @warn_unused; | ||
115 | } | ||
116 | } | ||
117 | } | ||
118 | methods { | ||
119 | show { | ||
120 | /*@ No description supplied by the EAPI. */ | ||
121 | } | ||
122 | move { | ||
123 | /*@ No description supplied by the EAPI. */ | ||
124 | params { | ||
125 | @in Evas_Coord x; | ||
126 | @in Evas_Coord y; | ||
127 | } | ||
128 | } | ||
129 | callbacks_descriptions_set { | ||
130 | /*@ | ||
131 | Set an smart object @b instance's smart callbacks descriptions. | ||
132 | |||
133 | @return @c EINA_TRUE on success, @c EINA_FALSE on failure. | ||
134 | |||
135 | These descriptions are hints to be used by introspection and are | ||
136 | not enforced in any way. | ||
137 | |||
138 | It will not be checked if instance callbacks descriptions have the | ||
139 | same name as respective possibly registered in the smart object | ||
140 | @b class. Both are kept in different arrays and users of | ||
141 | evas_object_smart_callbacks_descriptions_get() should handle this | ||
142 | case as they wish. | ||
143 | |||
144 | @note Becase @p descriptions must be @c NULL terminated, and | ||
145 | because a @c NULL name makes little sense, too, | ||
146 | Evas_Smart_Cb_Description::name must @b not be @c NULL. | ||
147 | |||
148 | @note While instance callbacks descriptions are possible, they are | ||
149 | @b not recommended. Use @b class callbacks descriptions | ||
150 | instead as they make you smart object user's life simpler and | ||
151 | will use less memory, as descriptions and arrays will be | ||
152 | shared among all instances. | ||
153 | |||
154 | @ingroup Evas_Smart_Object_Group */ | ||
155 | |||
156 | return Eina_Bool; | ||
157 | params { | ||
158 | @in const Evas_Smart_Cb_Description *descriptions; /*@ @c NULL terminated array with | ||
159 | #Evas_Smart_Cb_Description descriptions. Array elements won't be | ||
160 | modified at run time, but references to them and their contents | ||
161 | will be made, so this array should be kept alive during the whole | ||
162 | object's lifetime. */ | ||
163 | } | ||
164 | } | ||
165 | callbacks_descriptions_get { | ||
166 | /*@ | ||
167 | Retrieve an smart object's know smart callback descriptions (both | ||
168 | instance and class ones). | ||
169 | |||
170 | This call searches for registered callback descriptions for both | ||
171 | instance and class of the given smart object. These arrays will be | ||
172 | sorted by Evas_Smart_Cb_Description::name and also @c NULL | ||
173 | terminated, so both @a class_count and @a instance_count can be | ||
174 | ignored, if the caller wishes so. The terminator @c NULL is not | ||
175 | counted in these values. | ||
176 | |||
177 | @note If just class descriptions are of interest, try | ||
178 | evas_smart_callbacks_descriptions_get() instead. | ||
179 | |||
180 | @note Use @c NULL pointers on the descriptions/counters you're not | ||
181 | interested in: they'll be ignored by the function. | ||
182 | |||
183 | @see evas_smart_callbacks_descriptions_get() | ||
184 | |||
185 | @ingroup Evas_Smart_Object_Group */ | ||
186 | |||
187 | const; | ||
188 | params { | ||
189 | @out const Evas_Smart_Cb_Description **class_descriptions; /*@ Where to store class callbacks | ||
190 | descriptions array, if any is known. If no descriptions are | ||
191 | known, @c NULL is returned */ | ||
192 | @out unsigned int class_count; /*@ Returns how many class callbacks descriptions | ||
193 | are known. */ | ||
194 | @out const Evas_Smart_Cb_Description **instance_descriptions; /*@ Where to store instance callbacks | ||
195 | descriptions array, if any is known. If no descriptions are | ||
196 | known, @c NULL is returned. */ | ||
197 | @out unsigned int instance_count; /*@ Returns how many instance callbacks | ||
198 | descriptions are known. */ | ||
199 | } | ||
200 | } | ||
201 | iterator_new { | ||
202 | /*@ | ||
203 | Retrieves an iterator of the member objects of a given Evas smart | ||
204 | object | ||
205 | |||
206 | @return Returns the iterator of the member objects of @p obj. | ||
207 | |||
208 | @since 1.8 | ||
209 | |||
210 | @see evas_object_smart_member_add() | ||
211 | @see evas_object_smart_member_del() | ||
212 | @see evas_object_smart_members_get() */ | ||
213 | |||
214 | const; | ||
215 | return Eina_Iterator * @warn_unused; | ||
216 | } | ||
217 | callback_description_find { | ||
218 | /*@ | ||
219 | Find callback description for callback called @a name. | ||
220 | |||
221 | or @c NULL if not found. If parameter is @c NULL, no search | ||
222 | will be done on instance descriptions. | ||
223 | @return reference to description if found, @c NULL if not found. */ | ||
224 | |||
225 | const; | ||
226 | params { | ||
227 | @in const char *name @nonull; /*@ name of desired callback, must @b not be @c NULL. The | ||
228 | search have a special case for @a name being the same | ||
229 | pointer as registered with Evas_Smart_Cb_Description, one | ||
230 | can use it to avoid excessive use of strcmp(). */ | ||
231 | @out const Evas_Smart_Cb_Description *class_description; /*@ pointer to return class description or | ||
232 | @c NULL if not found. If parameter is @c NULL, no search will | ||
233 | be done on class descriptions. */ | ||
234 | @out const Evas_Smart_Cb_Description *instance_description; /*@ pointer to return instance description */ | ||
235 | } | ||
236 | } | ||
237 | hide { | ||
238 | /*@ No description supplied by the EAPI. */ | ||
239 | } | ||
240 | calculate { | ||
241 | /*@ | ||
242 | Call the @b calculate() smart function immediately on a given smart | ||
243 | object. | ||
244 | |||
245 | This will force immediate calculations (see #Evas_Smart_Class) | ||
246 | needed for renderization of this object and, besides, unset the | ||
247 | flag on it telling it needs recalculation for the next rendering | ||
248 | phase. | ||
249 | |||
250 | @see evas_object_smart_need_recalculate_set() | ||
251 | |||
252 | @ingroup Evas_Smart_Object_Group */ | ||
253 | |||
254 | } | ||
255 | add { | ||
256 | /*@ | ||
257 | Instantiates a new smart object described by @p s. | ||
258 | |||
259 | @return a new #Evas_Object handle | ||
260 | |||
261 | This is the function one should use when defining the public | ||
262 | function @b adding an instance of the new smart object to a given | ||
263 | canvas. It will take care of setting all of its internals to work | ||
264 | as they should, if the user set things properly, as seem on the | ||
265 | #EVAS_SMART_SUBCLASS_NEW, for example. | ||
266 | |||
267 | @ingroup Evas_Smart_Object_Group */ | ||
268 | legacy null; | ||
269 | } | ||
270 | member_add { | ||
271 | /*@ | ||
272 | Set an Evas object as a member of a given smart object. | ||
273 | |||
274 | Members will automatically be stacked and layered together with the | ||
275 | smart object. The various stacking functions will operate on | ||
276 | members relative to the other members instead of the entire canvas, | ||
277 | since they now live on an exclusive layer (see | ||
278 | evas_object_stack_above(), for more details). | ||
279 | |||
280 | Any @p smart_obj object's specific implementation of the @c | ||
281 | member_add() smart function will take place too, naturally. | ||
282 | |||
283 | @see evas_object_smart_member_del() | ||
284 | @see evas_object_smart_members_get() | ||
285 | |||
286 | @ingroup Evas_Smart_Object_Group */ | ||
287 | |||
288 | params { | ||
289 | @in Evas_Object *sub_obj @nonull; /*@ The member object */ | ||
290 | } | ||
291 | legacy null; | ||
292 | } | ||
293 | resize { | ||
294 | /*@ No description supplied by the EAPI. */ | ||
295 | params { | ||
296 | @in Evas_Coord w; | ||
297 | @in Evas_Coord h; | ||
298 | } | ||
299 | } | ||
300 | clip_unset { | ||
301 | /*@ No description supplied by the EAPI. */ | ||
302 | } | ||
303 | changed { | ||
304 | /*@ | ||
305 | Mark smart object as changed, dirty. | ||
306 | |||
307 | This will flag the given object as needing recalculation, | ||
308 | forcefully. As an effect, on the next rendering cycle its @b | ||
309 | calculate() (see #Evas_Smart_Class) smart function will be called. | ||
310 | |||
311 | @see evas_object_smart_need_recalculate_set(). | ||
312 | @see evas_object_smart_calculate(). | ||
313 | |||
314 | @ingroup Evas_Smart_Object_Group */ | ||
315 | |||
316 | } | ||
317 | member_del { | ||
318 | /*@ | ||
319 | Removes a member object from a given smart object. | ||
320 | |||
321 | This removes a member object from a smart object, if it was added | ||
322 | to any. The object will still be on the canvas, but no longer | ||
323 | associated with whichever smart object it was associated with. | ||
324 | |||
325 | @see evas_object_smart_member_add() for more details | ||
326 | @see evas_object_smart_members_get() */ | ||
327 | |||
328 | params { | ||
329 | @in Evas_Object *sub_obj; /*@ the member object | ||
330 | @ingroup Evas_Smart_Object_Group */ | ||
331 | } | ||
332 | legacy null; | ||
333 | } | ||
334 | del { | ||
335 | /*@ Deletes a smart object. */ | ||
336 | legacy null; | ||
337 | } | ||
338 | attach { | ||
339 | /*@ Attach a given smart data to a given smart object. */ | ||
340 | params { | ||
341 | @in Evas_Smart *s; | ||
342 | } | ||
343 | legacy null; | ||
344 | } | ||
345 | } | ||
346 | implements { | ||
347 | class::constructor; | ||
348 | class::destructor; | ||
349 | Eo_Base::constructor; | ||
350 | Evas_Object::smart_type_check_ptr; | ||
351 | Evas_Object::smart_type_check; | ||
352 | Evas_Object::smart_data::get; | ||
353 | } | ||
354 | } | ||