3 #include "simple_protected.h"
5 EAPI Eo_Op SIMPLE_BASE_ID = 0;
9 Simple_Protected_Data protected;
13 EAPI const Eo_Event_Description _EV_A_CHANGED =
14 EO_EVENT_DESCRIPTION("a,changed", "i", "Called when a has changed.");
16 #define MY_CLASS SIMPLE_CLASS
19 _a_set(Eo *obj, void *class_data, va_list *list)
21 Private_Data *pd = class_data;
23 a = va_arg(*list, int);
25 printf("%s %d\n", __func__, pd->a);
27 pd->protected.protected_x1 = a + 1;
28 pd->protected.public.public_x2 = a + 2;
30 eo_do(obj, eo_event_callback_call(EV_A_CHANGED, &pd->a, NULL));
34 _class_constructor(Eo_Class *klass)
36 const Eo_Op_Func_Description func_desc[] = {
37 EO_OP_FUNC(SIMPLE_ID(SIMPLE_SUB_ID_A_SET), _a_set),
41 eo_class_funcs_set(klass, func_desc);
44 static const Eo_Op_Description op_desc[] = {
45 EO_OP_DESCRIPTION(SIMPLE_SUB_ID_A_SET, "i", "Set property A"),
46 EO_OP_DESCRIPTION_SENTINEL
49 static const Eo_Event_Description *event_desc[] = {
54 static const Eo_Class_Description class_desc = {
56 EO_CLASS_TYPE_REGULAR,
57 EO_CLASS_DESCRIPTION_OPS(&SIMPLE_BASE_ID, op_desc, SIMPLE_SUB_ID_LAST),
66 EO_DEFINE_CLASS(simple_class_get, &class_desc, EO_BASE_CLASS, NULL)