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 "composite_objects_simple.h"
|
|
|
|
#include "composite_objects_comp.h"
|
2012-04-12 06:52:13 -07:00
|
|
|
|
2012-04-12 05:25:26 -07:00
|
|
|
#include "../eunit_tests.h"
|
2012-04-12 03:48:08 -07:00
|
|
|
|
2012-04-23 01:09:54 -07:00
|
|
|
#define MY_CLASS COMP_CLASS
|
2012-04-12 03:48:08 -07:00
|
|
|
|
2013-11-07 07:28:55 -08:00
|
|
|
static int
|
|
|
|
_a_get(Eo *obj, void *class_data EINA_UNUSED)
|
2012-04-12 03:48:08 -07:00
|
|
|
{
|
2013-12-30 13:16:55 -08:00
|
|
|
int a = 0;
|
2016-08-15 06:44:41 -07:00
|
|
|
a = simple_a_get(efl_super(obj, MY_CLASS));
|
2013-11-07 07:28:55 -08:00
|
|
|
|
|
|
|
return a;
|
2012-04-12 03:48:08 -07:00
|
|
|
}
|
|
|
|
|
2015-05-19 03:41:27 -07:00
|
|
|
static Eo *
|
2013-11-07 07:28:55 -08:00
|
|
|
_constructor(Eo *obj, void *class_data EINA_UNUSED)
|
2012-04-12 03:48:08 -07:00
|
|
|
{
|
2016-08-15 06:44:41 -07:00
|
|
|
obj = efl_constructor(efl_super(obj, MY_CLASS));
|
2012-04-12 03:48:08 -07:00
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
Eo *simple = efl_add(SIMPLE_CLASS, obj);
|
2016-08-10 07:23:04 -07:00
|
|
|
efl_composite_attach(obj, simple);
|
|
|
|
efl_event_callback_forwarder_add(simple, EV_A_CHANGED, obj);
|
2012-04-12 03:48:08 -07:00
|
|
|
|
2016-08-10 07:23:04 -07:00
|
|
|
fail_if(efl_composite_part_is(obj));
|
|
|
|
fail_if(!efl_composite_part_is(simple));
|
2012-04-12 05:25:26 -07:00
|
|
|
|
2016-08-10 07:23:04 -07:00
|
|
|
efl_key_data_set(obj, "simple-obj", simple);
|
2015-05-19 03:41:27 -07:00
|
|
|
|
|
|
|
return obj;
|
2012-04-12 03:48:08 -07:00
|
|
|
}
|
|
|
|
|
2016-09-05 04:31:55 -07:00
|
|
|
static Eina_Bool
|
|
|
|
_class_initializer(Efl_Class *klass)
|
|
|
|
{
|
|
|
|
EFL_OPS_DEFINE(ops,
|
2016-09-08 05:08:08 -07:00
|
|
|
EFL_OBJECT_OP_FUNC(efl_constructor, _constructor),
|
|
|
|
EFL_OBJECT_OP_FUNC(simple_a_get, _a_get),
|
2016-09-05 04:31:55 -07:00
|
|
|
);
|
|
|
|
|
2019-02-06 00:53:25 -08:00
|
|
|
return efl_class_functions_set(klass, &ops, NULL, NULL);
|
2016-09-05 04:31:55 -07:00
|
|
|
}
|
2012-04-12 03:48:08 -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
|
|
|
"Comp",
|
2016-08-15 06:44:41 -07:00
|
|
|
EFL_CLASS_TYPE_REGULAR,
|
2012-04-23 01:09:54 -07:00
|
|
|
0,
|
2016-09-05 04:31:55 -07:00
|
|
|
_class_initializer,
|
2013-11-07 07:28:55 -08:00
|
|
|
NULL,
|
2012-04-23 01:09:54 -07:00
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
EFL_DEFINE_CLASS(comp_class_get, &class_desc, EO_CLASS,
|
2012-04-23 01:09:54 -07:00
|
|
|
SIMPLE_CLASS, NULL);
|
2012-04-12 03:48:08 -07:00
|
|
|
|