diff options
Diffstat (limited to 'src/tests/efl_mono/dummy_constructible_object.c')
-rw-r--r-- | src/tests/efl_mono/dummy_constructible_object.c | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/src/tests/efl_mono/dummy_constructible_object.c b/src/tests/efl_mono/dummy_constructible_object.c new file mode 100644 index 0000000000..96842709ba --- /dev/null +++ b/src/tests/efl_mono/dummy_constructible_object.c @@ -0,0 +1,70 @@ +#include "libefl_mono_native_test.h" + +typedef struct _Dummy_Constructible_Object_Data +{ + Eo *internal_obj; + int native_construction_count; + int default_construction_count; + int special_construction_count; +} Dummy_Constructible_Object_Data; + + +EOLIAN static Eo * +_dummy_constructible_object_efl_object_constructor(Eo *obj, Dummy_Constructible_Object_Data *pd) +{ + ++(pd->native_construction_count); + return efl_constructor(efl_super(obj, DUMMY_CONSTRUCTIBLE_OBJECT_CLASS)); +} + +EOLIAN static void +_dummy_constructible_object_efl_object_destructor(Eo *obj, Dummy_Constructible_Object_Data *pd) +{ + if (pd->internal_obj) + efl_unref(pd->internal_obj); + efl_destructor(efl_super(obj, DUMMY_CONSTRUCTIBLE_OBJECT_CLASS)); +} + +EOLIAN static Efl_Object * +_dummy_constructible_object_construct_type_and_store(Eo *obj EINA_UNUSED, Dummy_Constructible_Object_Data *pd, const Efl_Class *klass) +{ + pd->internal_obj = efl_add_ref(klass, NULL); + return pd->internal_obj; +} + +EOLIAN static void +_dummy_constructible_object_increment_default_construction_count(Eo *obj EINA_UNUSED, Dummy_Constructible_Object_Data *pd) +{ + ++(pd->default_construction_count); +} + +EOLIAN static void +_dummy_constructible_object_increment_special_construction_count(Eo *obj EINA_UNUSED, Dummy_Constructible_Object_Data *pd) +{ + ++(pd->special_construction_count); +} + +EOLIAN static int +_dummy_constructible_object_native_construction_count_get(const Eo *obj EINA_UNUSED, Dummy_Constructible_Object_Data *pd) +{ + return pd->native_construction_count; +} + +EOLIAN static int +_dummy_constructible_object_default_construction_count_get(const Eo *obj EINA_UNUSED, Dummy_Constructible_Object_Data *pd) +{ + return pd->default_construction_count; +} + +EOLIAN static int +_dummy_constructible_object_special_construction_count_get(const Eo *obj EINA_UNUSED, Dummy_Constructible_Object_Data *pd) +{ + return pd->special_construction_count; +} + +EOLIAN static Efl_Object * +_dummy_constructible_object_internal_object_get(const Eo *obj EINA_UNUSED, Dummy_Constructible_Object_Data *pd) +{ + return pd->internal_obj; +} + +#include "dummy_constructible_object.eo.c" |