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-05-01 00:40:14 -07:00
|
|
|
EAPI Eo_Op MIXIN_BASE_ID = 0;
|
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
|
2012-06-26 20:58:45 -07:00
|
|
|
_add_and_print_set(Eo *obj, void *class_data EINA_UNUSED, va_list *list)
|
2012-04-05 08:31:15 -07:00
|
|
|
{
|
|
|
|
int a, b, x;
|
2012-06-26 20:58:45 -07:00
|
|
|
eo_do(obj, simple_a_get(&a), simple_b_get(&b));
|
2012-04-05 08:31:15 -07:00
|
|
|
x = va_arg(*list, const int);
|
|
|
|
printf("%s %d\n", __func__, a + b + x);
|
|
|
|
}
|
|
|
|
|
|
|
|
extern int my_init_count;
|
|
|
|
|
|
|
|
static void
|
2012-06-10 07:04:53 -07:00
|
|
|
_constructor(Eo *obj, void *class_data EINA_UNUSED, va_list *list EINA_UNUSED)
|
2012-04-05 08:31:15 -07:00
|
|
|
{
|
2013-03-18 08:33:54 -07:00
|
|
|
eo_do_super(obj, MY_CLASS, eo_constructor());
|
2012-04-05 08:31:15 -07:00
|
|
|
|
|
|
|
my_init_count++;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-06-10 07:04:53 -07:00
|
|
|
_destructor(Eo *obj, void *class_data EINA_UNUSED, va_list *list EINA_UNUSED)
|
2012-04-05 08:31:15 -07:00
|
|
|
{
|
2013-03-18 08:33:54 -07:00
|
|
|
eo_do_super(obj, MY_CLASS, eo_destructor());
|
2012-04-05 08:31:15 -07:00
|
|
|
|
|
|
|
my_init_count--;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2013-09-27 08:26:25 -07:00
|
|
|
_class_constructor(Eo_Class *klass)
|
2012-04-05 08:31:15 -07:00
|
|
|
{
|
2012-05-01 00:40:14 -07:00
|
|
|
const Eo_Op_Func_Description func_desc[] = {
|
2012-06-10 07:04:53 -07:00
|
|
|
EO_OP_FUNC(EO_BASE_ID(EO_BASE_SUB_ID_CONSTRUCTOR), _constructor),
|
|
|
|
EO_OP_FUNC(EO_BASE_ID(EO_BASE_SUB_ID_DESTRUCTOR), _destructor),
|
2012-06-26 20:58:45 -07:00
|
|
|
EO_OP_FUNC(MIXIN_ID(MIXIN_SUB_ID_ADD_AND_SET), _add_and_print_set),
|
2012-05-01 00:40:14 -07:00
|
|
|
EO_OP_FUNC_SENTINEL
|
2012-04-05 08:31:15 -07:00
|
|
|
};
|
|
|
|
|
2012-05-01 00:40:14 -07:00
|
|
|
eo_class_funcs_set(klass, func_desc);
|
2012-04-05 08:31:15 -07:00
|
|
|
}
|
|
|
|
|
2012-05-01 00:40:14 -07:00
|
|
|
static const Eo_Op_Description op_desc[] = {
|
2012-06-26 20:58:45 -07:00
|
|
|
EO_OP_DESCRIPTION(MIXIN_SUB_ID_ADD_AND_SET, "Add A + B + param and print it"),
|
2012-05-01 00:40:14 -07:00
|
|
|
EO_OP_DESCRIPTION_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 = {
|
2012-07-09 02:09:46 -07:00
|
|
|
EO_VERSION,
|
2012-04-23 01:09:54 -07:00
|
|
|
"Mixin",
|
2012-05-01 00:40:14 -07:00
|
|
|
EO_CLASS_TYPE_MIXIN,
|
|
|
|
EO_CLASS_DESCRIPTION_OPS(&MIXIN_BASE_ID, op_desc, MIXIN_SUB_ID_LAST),
|
2012-04-23 01:09:54 -07:00
|
|
|
NULL,
|
|
|
|
0,
|
|
|
|
_class_constructor,
|
|
|
|
NULL
|
|
|
|
};
|
2012-04-05 08:31:15 -07:00
|
|
|
|
2012-05-01 00:40:14 -07:00
|
|
|
EO_DEFINE_CLASS(mixin_class_get, &class_desc, NULL, NULL);
|
2012-04-05 08:31:15 -07:00
|
|
|
|