finalized: bool;
}
}
+ @property loop {
+ [[The owning loop object.
+
+ Objects that have anything to do with I/O, time based events
+ or anything async should have an owining loop. They will ask
+ their parent for the owning loop and iterate until the
+ toplevel/root object. The root object should be a loop object
+ which will return itself. Some objects may shortcut this
+ and be fixed to live in only a single loop. Either way all
+ you need to do is get the loop for an object and use that
+ for I/O, timing etc. needs.
+ ]]
+ get {
+ }
+ values {
+ obj: Eo.Base *; [[ XXX: this should be Efl.Loop *; ]]
+ }
+ }
constructor {
[[Call the object's constructor.
return obj->finalized;
}
+// XXX: this should be Efl_Loop *;
+EOLIAN static Eo_Base *
+_eo_base_loop_get(Eo *obj EINA_UNUSED, Eo_Base_Data *pd)
+{
+ if (!pd->parent) return eo_loop_get(pd->parent);
+ return NULL;
+}
+
/* Children accessor */
typedef struct _Eo_Children_Iterator Eo_Children_Iterator;
struct _Eo_Children_Iterator
}
END_TEST
+START_TEST(eo_loop)
+{
+ eo_init();
+ Eo *obj = eo_add(SIMPLE_CLASS, NULL);
+ Eo *obj2 = eo_add(SIMPLE_CLASS, NULL);
+ Eo *objtmp;
+
+ eo_parent_set(obj2, obj);
+ objtmp = eo_loop_get(obj2);
+ fail_if(NULL != objtmp);
+
+ eo_del(obj);
+
+ eo_shutdown();
+}
+END_TEST
+
void eo_test_general(TCase *tc)
{
tcase_add_test(tc, eo_simple);
tcase_add_test(tc, eo_del_intercept);
tcase_add_test(tc, eo_name);
tcase_add_test(tc, eo_comment);
+ tcase_add_test(tc, eo_loop);
}