2012-05-01 00:40:14 -07:00
|
|
|
#include "Eo.h"
|
2012-04-05 08:31:15 -07:00
|
|
|
#include "mixin.h"
|
2012-04-17 08:22:27 -07:00
|
|
|
#include "mixin2.h"
|
2012-04-19 01:52:11 -07:00
|
|
|
#include "mixin3.h"
|
2012-04-05 08:31:15 -07:00
|
|
|
#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 SIMPLE_BASE_ID = 0;
|
2012-04-05 08:31:15 -07:00
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
int a;
|
|
|
|
int b;
|
|
|
|
} Private_Data;
|
|
|
|
|
2012-04-23 01:09:54 -07:00
|
|
|
#define MY_CLASS SIMPLE_CLASS
|
2012-04-05 08:31:15 -07:00
|
|
|
|
|
|
|
#define _GET_SET_FUNC(name) \
|
|
|
|
static void \
|
2012-05-01 00:40:14 -07:00
|
|
|
_##name##_get(const Eo *obj EINA_UNUSED, const void *class_data, va_list *list) \
|
2012-04-05 08:31:15 -07:00
|
|
|
{ \
|
2012-04-24 01:04:14 -07:00
|
|
|
const Private_Data *pd = class_data; \
|
2012-04-05 08:31:15 -07:00
|
|
|
int *name; \
|
|
|
|
name = va_arg(*list, int *); \
|
|
|
|
*name = pd->name; \
|
|
|
|
printf("%s %d\n", __func__, pd->name); \
|
|
|
|
} \
|
|
|
|
static void \
|
2012-05-01 00:40:14 -07:00
|
|
|
_##name##_set(Eo *obj EINA_UNUSED, void *class_data, va_list *list) \
|
2012-04-05 08:31:15 -07:00
|
|
|
{ \
|
2012-04-12 06:52:13 -07:00
|
|
|
Private_Data *pd = class_data; \
|
2012-04-05 08:31:15 -07:00
|
|
|
int name; \
|
|
|
|
name = va_arg(*list, int); \
|
|
|
|
pd->name = name; \
|
|
|
|
printf("%s %d\n", __func__, pd->name); \
|
|
|
|
}
|
|
|
|
|
|
|
|
_GET_SET_FUNC(a)
|
|
|
|
_GET_SET_FUNC(b)
|
|
|
|
|
|
|
|
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(SIMPLE_ID(SIMPLE_SUB_ID_A_SET), _a_set),
|
|
|
|
EO_OP_FUNC_CONST(SIMPLE_ID(SIMPLE_SUB_ID_A_GET), _a_get),
|
|
|
|
EO_OP_FUNC(SIMPLE_ID(SIMPLE_SUB_ID_B_SET), _b_set),
|
|
|
|
EO_OP_FUNC_CONST(SIMPLE_ID(SIMPLE_SUB_ID_B_GET), _b_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(SIMPLE_SUB_ID_A_SET, "i", "Set property A"),
|
|
|
|
EO_OP_DESCRIPTION_CONST(SIMPLE_SUB_ID_A_GET, "i", "Get property A"),
|
|
|
|
EO_OP_DESCRIPTION(SIMPLE_SUB_ID_B_SET, "i", "Set property B"),
|
|
|
|
EO_OP_DESCRIPTION_CONST(SIMPLE_SUB_ID_B_GET, "i", "Get property 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
|
|
|
"Simple",
|
2012-05-01 00:40:14 -07:00
|
|
|
EO_CLASS_TYPE_REGULAR,
|
|
|
|
EO_CLASS_DESCRIPTION_OPS(&SIMPLE_BASE_ID, op_desc, SIMPLE_SUB_ID_LAST),
|
2012-04-23 01:09:54 -07:00
|
|
|
NULL,
|
|
|
|
sizeof(Private_Data),
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
_class_constructor,
|
|
|
|
NULL
|
|
|
|
};
|
2012-04-05 08:31:15 -07:00
|
|
|
|
2012-05-01 00:40:14 -07:00
|
|
|
EO_DEFINE_CLASS(simple_class_get, &class_desc, EO_BASE_CLASS, MIXIN3_CLASS, MIXIN2_CLASS, NULL);
|