2012-09-07 14:56:44 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include <config.h>
|
|
|
|
#endif
|
|
|
|
|
2012-05-01 00:40:14 -07:00
|
|
|
#include "Eo.h"
|
2012-09-25 23:56:52 -07:00
|
|
|
#include "constructors_mixin.h"
|
|
|
|
#include "constructors_simple.h"
|
2012-04-05 08:31:15 -07:00
|
|
|
|
2012-04-23 01:09:54 -07:00
|
|
|
#define MY_CLASS MIXIN_CLASS
|
2012-04-05 08:31:15 -07:00
|
|
|
|
|
|
|
static void
|
2013-11-07 08:06:51 -08:00
|
|
|
_add_and_print_set(Eo *obj, void *class_data EINA_UNUSED, int x)
|
2012-04-05 08:31:15 -07:00
|
|
|
{
|
2013-11-07 08:06:51 -08:00
|
|
|
int a, b;
|
|
|
|
eo2_do(obj, a = simple_a_get(), b = simple_b_get());
|
2012-04-05 08:31:15 -07:00
|
|
|
printf("%s %d\n", __func__, a + b + x);
|
|
|
|
}
|
|
|
|
|
|
|
|
extern int my_init_count;
|
|
|
|
|
|
|
|
static void
|
2013-11-07 08:06:51 -08:00
|
|
|
_constructor(Eo *obj, void *class_data EINA_UNUSED)
|
2012-04-05 08:31:15 -07:00
|
|
|
{
|
2013-11-07 08:06:51 -08:00
|
|
|
eo2_do_super(obj, MY_CLASS, eo2_constructor());
|
2012-04-05 08:31:15 -07:00
|
|
|
|
|
|
|
my_init_count++;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2013-11-07 08:06:51 -08:00
|
|
|
_destructor(Eo *obj, void *class_data EINA_UNUSED)
|
2012-04-05 08:31:15 -07:00
|
|
|
{
|
2013-11-07 08:06:51 -08:00
|
|
|
eo2_do_super(obj, MY_CLASS, eo2_destructor());
|
2012-04-05 08:31:15 -07:00
|
|
|
|
|
|
|
my_init_count--;
|
|
|
|
}
|
|
|
|
|
2013-11-07 08:06:51 -08:00
|
|
|
EAPI EO2_VOID_FUNC_BODYV(mixin_add_and_print, EO2_FUNC_CALL(x), int x);
|
2012-04-05 08:31:15 -07:00
|
|
|
|
2013-11-07 08:06:51 -08:00
|
|
|
static Eo2_Op_Description op_descs[] = {
|
2013-11-11 05:27:36 -08:00
|
|
|
EO2_OP_FUNC(mixin_add_and_print, _add_and_print_set, "Add A + B + param and print it"),
|
|
|
|
EO2_OP_FUNC_OVERRIDE(eo2_constructor, _constructor),
|
|
|
|
EO2_OP_FUNC_OVERRIDE(eo2_destructor, _destructor),
|
2013-11-07 08:06:51 -08:00
|
|
|
EO2_OP_SENTINEL
|
2012-04-23 01:09:54 -07:00
|
|
|
};
|
2012-04-05 08:31:15 -07:00
|
|
|
|
2012-05-01 00:40:14 -07:00
|
|
|
static const Eo_Class_Description class_desc = {
|
2013-11-07 08:06:51 -08:00
|
|
|
EO2_VERSION,
|
2012-04-23 01:09:54 -07:00
|
|
|
"Mixin",
|
2012-05-01 00:40:14 -07:00
|
|
|
EO_CLASS_TYPE_MIXIN,
|
2013-11-07 08:06:51 -08:00
|
|
|
EO2_CLASS_DESCRIPTION_OPS(op_descs),
|
2012-04-23 01:09:54 -07:00
|
|
|
NULL,
|
|
|
|
0,
|
2013-11-07 08:06:51 -08:00
|
|
|
NULL,
|
2012-04-23 01:09:54 -07:00
|
|
|
NULL
|
|
|
|
};
|
2012-04-05 08:31:15 -07:00
|
|
|
|
2013-11-07 08:06:51 -08:00
|
|
|
EO_DEFINE_CLASS(mixin_class_get, &class_desc, NULL, EO2_BASE_CLASS, NULL);
|
2012-04-05 08:31:15 -07:00
|
|
|
|