summaryrefslogtreecommitdiff
path: root/src/examples/eo/isa/eo_isa_mixin.c
blob: ce45601a9570082c02667af39027e05249eae93a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

#include "Eo.h"
#include "eo_isa_mixin.h"
#include "eo_isa_simple.h"

#define MY_CLASS MIXIN_CLASS

static int
_a_square_get(Eo *obj, void *class_data EINA_UNUSED)
{
   int a;

   eo_do(obj, a = simple_a_get());
   printf("%s %s\n", eo_class_name_get(MY_CLASS), __func__);
   return a * a;
}

EAPI EO_FUNC_BODY(mixin_a_square_get, int, 0);

static Eo_Op_Description op_desc[] = {
     EO_OP_FUNC(mixin_a_square_get, _a_square_get),
};

static const Eo_Class_Description class_desc = {
     EO_VERSION,
     "Mixin",
     EO_CLASS_TYPE_MIXIN,
     EO_CLASS_DESCRIPTION_OPS(op_desc),
     NULL,
     0,
     NULL,
     NULL
};

EO_DEFINE_CLASS(mixin_class_get, &class_desc, NULL, NULL)