2012-04-10 02:12:46 -07:00
|
|
|
#include "Eobj.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-04-05 08:31:15 -07:00
|
|
|
EAPI Eobj_Op MIXIN_BASE_ID = 0;
|
|
|
|
|
2012-04-23 01:09:54 -07:00
|
|
|
#define MY_CLASS MIXIN_CLASS
|
2012-04-05 08:31:15 -07:00
|
|
|
|
|
|
|
static void
|
2012-04-24 01:04:14 -07:00
|
|
|
_add_and_print_set(const Eobj *obj, const void *class_data EINA_UNUSED, va_list *list)
|
2012-04-05 08:31:15 -07:00
|
|
|
{
|
|
|
|
int a, b, x;
|
2012-04-24 01:56:49 -07:00
|
|
|
eobj_query(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-04-19 04:30:17 -07:00
|
|
|
_constructor(Eobj *obj, void *class_data EINA_UNUSED)
|
2012-04-05 08:31:15 -07:00
|
|
|
{
|
|
|
|
eobj_constructor_super(obj);
|
|
|
|
|
|
|
|
my_init_count++;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-04-19 04:30:17 -07:00
|
|
|
_destructor(Eobj *obj, void *class_data EINA_UNUSED)
|
2012-04-05 08:31:15 -07:00
|
|
|
{
|
|
|
|
eobj_destructor_super(obj);
|
|
|
|
|
|
|
|
my_init_count--;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_class_constructor(Eobj_Class *klass)
|
|
|
|
{
|
|
|
|
const Eobj_Op_Func_Description func_desc[] = {
|
2012-04-24 01:04:14 -07:00
|
|
|
EOBJ_OP_FUNC_CONST(MIXIN_ID(MIXIN_SUB_ID_ADD_AND_SET), _add_and_print_set),
|
2012-04-16 05:36:34 -07:00
|
|
|
EOBJ_OP_FUNC_SENTINEL
|
2012-04-05 08:31:15 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
eobj_class_funcs_set(klass, func_desc);
|
|
|
|
}
|
|
|
|
|
2012-04-23 01:09:54 -07:00
|
|
|
static const Eobj_Op_Description op_desc[] = {
|
2012-04-24 01:04:14 -07:00
|
|
|
EOBJ_OP_DESCRIPTION_CONST(MIXIN_SUB_ID_ADD_AND_SET, "i", "Add A + B + param and print it"),
|
2012-04-23 01:09:54 -07:00
|
|
|
EOBJ_OP_DESCRIPTION_SENTINEL
|
|
|
|
};
|
2012-04-05 08:31:15 -07:00
|
|
|
|
2012-04-23 01:09:54 -07:00
|
|
|
static const Eobj_Class_Description class_desc = {
|
|
|
|
"Mixin",
|
|
|
|
EOBJ_CLASS_TYPE_MIXIN,
|
|
|
|
EOBJ_CLASS_DESCRIPTION_OPS(&MIXIN_BASE_ID, op_desc, MIXIN_SUB_ID_LAST),
|
|
|
|
NULL,
|
|
|
|
0,
|
|
|
|
_constructor,
|
|
|
|
_destructor,
|
|
|
|
_class_constructor,
|
|
|
|
NULL
|
|
|
|
};
|
2012-04-05 08:31:15 -07:00
|
|
|
|
2012-04-23 01:09:54 -07:00
|
|
|
EOBJ_DEFINE_CLASS(mixin_class_get, &class_desc, NULL, NULL);
|
2012-04-05 08:31:15 -07:00
|
|
|
|