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 "access_simple.h"
|
|
|
|
#include "access_simple_protected.h"
|
2012-04-05 08:31:15 -07:00
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
Simple_Protected_Data protected;
|
|
|
|
int a;
|
|
|
|
} Private_Data;
|
|
|
|
|
2016-08-10 07:23:04 -07:00
|
|
|
EAPI const Efl_Event_Description _EV_A_CHANGED =
|
|
|
|
EFL_EVENT_DESCRIPTION("a,changed");
|
2012-04-05 08:31:15 -07:00
|
|
|
|
2012-04-23 01:09:54 -07:00
|
|
|
#define MY_CLASS SIMPLE_CLASS
|
2012-04-05 08:31:15 -07:00
|
|
|
|
|
|
|
static void
|
2013-07-30 08:08:25 -07:00
|
|
|
_a_set(Eo *obj, void *class_data, int a)
|
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
|
|
|
pd->a = a;
|
|
|
|
printf("%s %d\n", __func__, pd->a);
|
|
|
|
|
|
|
|
pd->protected.protected_x1 = a + 1;
|
|
|
|
pd->protected.public.public_x2 = a + 2;
|
|
|
|
|
2016-08-22 15:40:39 -07:00
|
|
|
efl_event_callback_legacy_call(obj, EV_A_CHANGED, &pd->a);
|
2012-04-05 08:31:15 -07:00
|
|
|
}
|
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
EAPI EFL_VOID_FUNC_BODYV(simple_a_set, EFL_FUNC_CALL(a), int a);
|
2012-04-05 08:31:15 -07:00
|
|
|
|
2016-09-01 06:34:55 -07:00
|
|
|
static Eina_Bool
|
|
|
|
_class_initializer(Efl_Class *klass)
|
|
|
|
{
|
|
|
|
EFL_OPS_DEFINE(ops,
|
|
|
|
EFL_OBJECT_OP_FUNC(simple_a_set, _a_set),
|
|
|
|
);
|
|
|
|
|
2019-02-10 07:57:00 -08:00
|
|
|
return efl_class_functions_set(klass, &ops, NULL);
|
2016-09-01 06:34:55 -07:00
|
|
|
}
|
2012-04-05 08:31:15 -07:00
|
|
|
|
2016-08-10 07:23:04 -07:00
|
|
|
static const Efl_Class_Description class_desc = {
|
2014-04-02 01:46:34 -07:00
|
|
|
EO_VERSION,
|
2012-04-23 01:09:54 -07:00
|
|
|
"Simple",
|
2016-08-15 06:44:41 -07:00
|
|
|
EFL_CLASS_TYPE_REGULAR,
|
2012-04-23 01:09:54 -07:00
|
|
|
sizeof(Private_Data),
|
2016-09-05 04:31:55 -07:00
|
|
|
_class_initializer,
|
2013-07-30 08:08:25 -07:00
|
|
|
NULL,
|
2012-04-23 01:09:54 -07:00
|
|
|
NULL
|
|
|
|
};
|
2012-04-05 08:31:15 -07:00
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
EFL_DEFINE_CLASS(simple_class_get, &class_desc, EO_CLASS, NULL)
|
2012-04-05 08:31:15 -07:00
|
|
|
|