summaryrefslogtreecommitdiff
path: root/src/tests/eo/suite/eo_test_class_simple.c
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2015-04-17 14:31:19 +0100
committerTom Hacohen <tom@stosb.com>2015-05-06 17:56:05 +0100
commit6cb22bae35a8e621e0857fc2738657ff068478f8 (patch)
treeb6a9d95a7907803517ab3883fd51546464e3facc /src/tests/eo/suite/eo_test_class_simple.c
parent875bc1514604dca87f19270694bcede4b2434dc2 (diff)
Eo: Add eo_do_part.
This is a convenience macro to be used by the common pattern of getting a part and then immediately calling functions on it. For example, without this macro, you'd have to write code like: Eo *part; eo_do(obj, part = efl_part_name_get("partname")); eo_do(part, a_set(7)); while using the helper function trims it to: eo_do_part(obj, efl_part_name_get("partname"), a_set(7)); @feature
Diffstat (limited to 'src/tests/eo/suite/eo_test_class_simple.c')
-rw-r--r--src/tests/eo/suite/eo_test_class_simple.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/tests/eo/suite/eo_test_class_simple.c b/src/tests/eo/suite/eo_test_class_simple.c
index cbefee7d1d..4bc3904acb 100644
--- a/src/tests/eo/suite/eo_test_class_simple.c
+++ b/src/tests/eo/suite/eo_test_class_simple.c
@@ -45,6 +45,15 @@ _class_hi_print(Eo_Class *klass, void *data EINA_UNUSED)
45 return EINA_TRUE; 45 return EINA_TRUE;
46} 46}
47 47
48EO_FUNC_BODYV(simple_part_get, Eo *, NULL, EO_FUNC_CALL(name), const char *name);
49
50static Eo *
51_part_get(Eo *obj, void *class_data EINA_UNUSED, const char *name EINA_UNUSED)
52{
53 /* A normal part get will do something saner, we just create objects. */
54 return eo_add(SIMPLE_CLASS, obj);
55}
56
48EO_VOID_FUNC_BODYV(simple_recursive, EO_FUNC_CALL(n), int n); 57EO_VOID_FUNC_BODYV(simple_recursive, EO_FUNC_CALL(n), int n);
49 58
50static void 59static void
@@ -83,6 +92,7 @@ static Eo_Op_Description op_descs[] = {
83 EO_OP_FUNC(simple_a_print, _a_print, "Print property a"), 92 EO_OP_FUNC(simple_a_print, _a_print, "Print property a"),
84 EO_OP_CLASS_FUNC(simple_class_hi_print, _class_hi_print, "Print property a"), 93 EO_OP_CLASS_FUNC(simple_class_hi_print, _class_hi_print, "Print property a"),
85 EO_OP_FUNC(simple_recursive, _recursive, "Recursive function"), 94 EO_OP_FUNC(simple_recursive, _recursive, "Recursive function"),
95 EO_OP_FUNC(simple_part_get, _part_get, "Part getter"),
86 EO_OP_FUNC(simple_pure_virtual, NULL, "Pure Virtual function"), 96 EO_OP_FUNC(simple_pure_virtual, NULL, "Pure Virtual function"),
87 EO_OP_SENTINEL 97 EO_OP_SENTINEL
88}; 98};