5 #include "../eunit_tests.h"
7 EAPI Eo_Op SIMPLE_BASE_ID = 0;
9 #define MY_CLASS SIMPLE_CLASS
12 _a_set(Eo *obj EINA_UNUSED, void *class_data, va_list *list)
14 Simple_Public_Data *pd = class_data;
16 a = va_arg(*list, int);
17 printf("%s %d\n", eo_class_name_get(MY_CLASS), a);
22 _a_print(const Eo *obj EINA_UNUSED, const void *class_data, va_list *list)
24 const Simple_Public_Data *pd = class_data;
26 printf("Print %s %d\n", eo_class_name_get(MY_CLASS), pd->a);
30 _class_print(const Eo_Class *klass, va_list *list)
33 printf("Print %s-%s\n", eo_class_name_get(klass), eo_class_name_get(MY_CLASS));
34 fail_if(eo_class_do_super(klass, simple_class_print()));
35 fail_if(eo_class_do_super(klass, simple_class_print2()));
39 _class_print2(const Eo_Class *klass, va_list *list)
42 printf("Print %s-%s\n", eo_class_name_get(klass), eo_class_name_get(MY_CLASS));
46 _class_constructor(Eo_Class *klass)
48 const Eo_Op_Func_Description func_desc[] = {
49 EO_OP_FUNC(SIMPLE_ID(SIMPLE_SUB_ID_A_SET), _a_set),
50 EO_OP_FUNC_CONST(SIMPLE_ID(SIMPLE_SUB_ID_A_PRINT), _a_print),
51 EO_OP_FUNC_CLASS(SIMPLE_ID(SIMPLE_SUB_ID_CLASS_PRINT), _class_print),
52 EO_OP_FUNC_CLASS(SIMPLE_ID(SIMPLE_SUB_ID_CLASS_PRINT2), _class_print2),
56 eo_class_funcs_set(klass, func_desc);
59 static const Eo_Op_Description op_desc[] = {
60 EO_OP_DESCRIPTION(SIMPLE_SUB_ID_A_SET, "Set property A"),
61 EO_OP_DESCRIPTION_CONST(SIMPLE_SUB_ID_A_PRINT, "Print property A"),
62 EO_OP_DESCRIPTION_CLASS(SIMPLE_SUB_ID_CLASS_PRINT, "Print class name."),
63 EO_OP_DESCRIPTION_CLASS(SIMPLE_SUB_ID_CLASS_PRINT2, "Print2 class name."),
64 EO_OP_DESCRIPTION_SENTINEL
67 static const Eo_Class_Description class_desc = {
69 EO_CLASS_TYPE_REGULAR,
70 EO_CLASS_DESCRIPTION_OPS(&SIMPLE_BASE_ID, op_desc, SIMPLE_SUB_ID_LAST),
72 sizeof(Simple_Public_Data),
79 EO_DEFINE_CLASS(simple_class_get, &class_desc, EO_BASE_CLASS, NULL);