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 "mixin_mixin.h"
|
|
|
|
#include "mixin_mixin3.h"
|
|
|
|
#include "mixin_simple.h"
|
2012-04-19 01:52:11 -07:00
|
|
|
|
|
|
|
#include "../eunit_tests.h"
|
|
|
|
|
2012-04-23 01:09:54 -07:00
|
|
|
#define MY_CLASS MIXIN3_CLASS
|
2012-04-19 01:52:11 -07:00
|
|
|
|
2013-11-08 02:48:55 -08:00
|
|
|
static int
|
|
|
|
_ab_sum_get(Eo *obj, void *class_data EINA_UNUSED)
|
2012-04-19 01:52:11 -07:00
|
|
|
{
|
2012-04-24 01:04:14 -07:00
|
|
|
/* This cast is just a hack for the test. */
|
|
|
|
Mixin3_Public_Data *pd = (Mixin3_Public_Data *) class_data;
|
2013-12-30 13:16:55 -08:00
|
|
|
int sum = 0;
|
2016-08-15 06:44:41 -07:00
|
|
|
printf("%s %s\n", efl_class_name_get(MY_CLASS), __func__);
|
|
|
|
sum = mixin_ab_sum_get(efl_super(obj, MY_CLASS));
|
2012-04-19 01:52:11 -07:00
|
|
|
|
2013-11-08 02:48:55 -08:00
|
|
|
++sum;
|
2012-04-19 01:52:25 -07:00
|
|
|
pd->count += 3;
|
2012-04-19 01:52:11 -07:00
|
|
|
|
|
|
|
{
|
2013-12-30 13:16:55 -08:00
|
|
|
int _a = 0, _b = 0;
|
2016-03-01 10:06:28 -08:00
|
|
|
_a = simple_a_get(obj);
|
|
|
|
_b = simple_b_get(obj);
|
2013-11-08 02:48:55 -08:00
|
|
|
fail_if(sum != _a + _b + 2);
|
2012-04-19 01:52:11 -07:00
|
|
|
}
|
2013-11-08 02:48:55 -08:00
|
|
|
|
|
|
|
return sum;
|
2012-04-19 01:52:11 -07:00
|
|
|
}
|
|
|
|
|
2015-05-19 03:41:27 -07:00
|
|
|
static Eo *
|
2012-06-10 07:04:53 -07:00
|
|
|
_constructor(Eo *obj, void *class_data EINA_UNUSED, va_list *list EINA_UNUSED)
|
2012-04-19 01:52:11 -07:00
|
|
|
{
|
2016-08-15 06:44:41 -07:00
|
|
|
return efl_constructor(efl_super(obj, MY_CLASS));
|
2012-04-19 01:52:11 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-06-10 07:04:53 -07:00
|
|
|
_destructor(Eo *obj, void *class_data EINA_UNUSED, va_list *list EINA_UNUSED)
|
2012-04-19 01:52:11 -07:00
|
|
|
{
|
2016-08-15 06:44:41 -07:00
|
|
|
efl_destructor(efl_super(obj, MY_CLASS));
|
2012-04-19 01:52:11 -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(efl_destructor, _destructor),
|
|
|
|
EFL_OBJECT_OP_FUNC(mixin_ab_sum_get, _ab_sum_get),
|
2016-09-05 04:31:55 -07:00
|
|
|
);
|
|
|
|
|
2019-02-10 07:57:00 -08:00
|
|
|
return efl_class_functions_set(klass, &ops, NULL);
|
2016-09-05 04:31:55 -07:00
|
|
|
}
|
2012-04-19 01:52:11 -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
|
|
|
"Mixin3",
|
2016-08-15 06:44:41 -07:00
|
|
|
EFL_CLASS_TYPE_MIXIN,
|
2012-04-23 01:09:54 -07:00
|
|
|
sizeof(Mixin3_Public_Data),
|
2016-09-05 04:31:55 -07:00
|
|
|
_class_initializer,
|
2013-11-08 02:48:55 -08:00
|
|
|
NULL,
|
2012-04-23 01:09:54 -07:00
|
|
|
NULL
|
|
|
|
};
|
2012-04-19 01:52:11 -07:00
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
EFL_DEFINE_CLASS(mixin3_class_get, &class_desc, MIXIN_CLASS, NULL);
|
2012-04-19 01:52:11 -07:00
|
|
|
|