Eo: Removed "type" property from event/op descriptions.
[profile/ivi/eobj.git] / examples / access / inherit.c
1 #include "Eo.h"
2 #include "simple.h"
3 #include "simple_protected.h"
4
5 #include "inherit.h"
6
7 #include "config.h"
8
9 EAPI Eo_Op INHERIT_BASE_ID = 0;
10
11 #define MY_CLASS INHERIT_CLASS
12
13 static void
14 _prot_print(const Eo *obj, const void *class_data EINA_UNUSED, va_list *list)
15 {
16    Simple_Protected_Data *pd = eo_data_get(obj, SIMPLE_CLASS);
17    (void) list;
18    printf("%s %d\n", __func__, pd->protected_x1);
19 }
20
21 static void
22 _class_constructor(Eo_Class *klass)
23 {
24    const Eo_Op_Func_Description func_desc[] = {
25         EO_OP_FUNC_CONST(INHERIT_ID(INHERIT_SUB_ID_PROT_PRINT), _prot_print),
26         EO_OP_FUNC_SENTINEL
27    };
28
29    eo_class_funcs_set(klass, func_desc);
30 }
31
32 static const Eo_Op_Description op_desc[] = {
33      EO_OP_DESCRIPTION_CONST(INHERIT_SUB_ID_PROT_PRINT, "Print protected var x1."),
34      EO_OP_DESCRIPTION_SENTINEL
35 };
36
37 static const Eo_Class_Description class_desc = {
38      "Inherit",
39      EO_CLASS_TYPE_REGULAR,
40      EO_CLASS_DESCRIPTION_OPS(&INHERIT_BASE_ID, op_desc, INHERIT_SUB_ID_LAST),
41      NULL,
42      0,
43      NULL,
44      NULL,
45      _class_constructor,
46      NULL
47 };
48
49 EO_DEFINE_CLASS(inherit_class_get, &class_desc, SIMPLE_CLASS, NULL)