2012-05-01 00:40:14 -07:00
|
|
|
#include "Eo.h"
|
2012-04-05 08:31:15 -07:00
|
|
|
#include "mixin.h"
|
|
|
|
#include "simple.h"
|
|
|
|
|
2012-04-12 06:52:13 -07:00
|
|
|
#include "config.h"
|
|
|
|
|
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-05-01 00:40:14 -07:00
|
|
|
_ab_sum_get(const Eo *obj, const void *class_data EINA_UNUSED, va_list *list)
|
2012-04-05 08:31:15 -07:00
|
|
|
{
|
2012-04-19 01:52:11 -07:00
|
|
|
int a, b;
|
2012-05-01 00:40:14 -07:00
|
|
|
eo_query(obj, simple_a_get(&a), simple_b_get(&b));
|
2012-04-19 01:52:11 -07:00
|
|
|
int *sum = va_arg(*list, int *);
|
|
|
|
if (sum)
|
|
|
|
*sum = a + b;
|
2012-05-01 00:40:14 -07:00
|
|
|
printf("%s %s\n", eo_class_name_get(MY_CLASS), __func__);
|
2012-04-05 08:31:15 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-05-01 00:40:14 -07:00
|
|
|
_constructor(Eo *obj, void *class_data EINA_UNUSED)
|
2012-04-05 08:31:15 -07:00
|
|
|
{
|
2012-05-01 00:40:14 -07:00
|
|
|
eo_constructor_super(obj);
|
2012-04-05 08:31:15 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-05-01 00:40:14 -07:00
|
|
|
_destructor(Eo *obj, void *class_data EINA_UNUSED)
|
2012-04-05 08:31:15 -07:00
|
|
|
{
|
2012-05-01 00:40:14 -07:00
|
|
|
eo_destructor_super(obj);
|
2012-04-05 08:31:15 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-05-01 00:40:14 -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[] = {
|
|
|
|
EO_OP_FUNC_CONST(MIXIN_ID(MIXIN_SUB_ID_AB_SUM_GET), _ab_sum_get),
|
|
|
|
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[] = {
|
|
|
|
EO_OP_DESCRIPTION_CONST(MIXIN_SUB_ID_AB_SUM_GET, "i", "Get the sum of a and b."),
|
|
|
|
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-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,
|
|
|
|
_constructor,
|
|
|
|
_destructor,
|
|
|
|
_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
|
|
|
|