elementary: implement destructor in atspi mixin

Summary:
Make atspi mixin inherit from Efl.Interface class and add Efl.Object
as it extensions class to gain acccess to destructor function.

This allow to better share code between implementations and avoid possible
mistakes during accessibilityt implementations.

Reviewers: cedric, jpeg, raster, kimcinoo

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4393

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
This commit is contained in:
Lukasz Stanislawski 2016-11-14 11:10:57 -08:00 committed by Cedric BAIL
parent 883d41f006
commit 93b509d664
3 changed files with 15 additions and 10 deletions

View File

@ -598,4 +598,15 @@ _elm_interface_atspi_accessible_type_set(Eo *obj, Elm_Interface_Atspi_Accessible
pd->type = val;
}
EOLIAN void
_elm_interface_atspi_accessible_efl_object_destructor(Eo *obj, Elm_Interface_Atspi_Accessible_Data *pd)
{
eina_stringshare_del(pd->name);
eina_stringshare_del(pd->description);
eina_stringshare_del(pd->translation_domain);
elm_atspi_relation_set_free(pd->relations);
efl_destructor(efl_super(obj, ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN));
}
#include "elm_interface_atspi_accessible.eo.c"

View File

@ -235,7 +235,7 @@ struct Elm.Atspi.Relation
type Elm.Atspi.Relation_Set: list<ptr(Elm.Atspi.Relation)>; [[Elementary AT-SPI relation set type]]
mixin Elm.Interface.Atspi_Accessible ()
mixin Elm.Interface.Atspi_Accessible (Efl.Interface, Efl.Object)
{
[[AT-SPI accessible mixin]]
eo_prefix: elm_interface_atspi_accessible;
@ -432,6 +432,9 @@ mixin Elm.Interface.Atspi_Accessible ()
}
}
}
implements {
Efl.Object.destructor;
}
events {
property,changed: string; [[Called when roperty has changed]]
children,changed: Elm.Atspi.Event.Children_Changed.Data; [[Called when children have changed]]

View File

@ -4595,11 +4595,6 @@ _elm_widget_item_efl_object_destructor(Eo *eo_item, Elm_Widget_Item_Data *item)
}
eina_hash_free(item->labels);
elm_interface_atspi_accessible_description_set(eo_item, NULL);
elm_interface_atspi_accessible_name_set(eo_item, NULL);
elm_interface_atspi_accessible_translation_domain_set(eo_item, NULL);
elm_interface_atspi_accessible_relationships_clear(eo_item);
elm_interface_atspi_accessible_removed(eo_item);
EINA_MAGIC_SET(item, EINA_MAGIC_NONE);
@ -5853,10 +5848,6 @@ EOLIAN static void
_elm_widget_efl_object_destructor(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSED)
{
sd->on_destroy = EINA_TRUE;
elm_interface_atspi_accessible_description_set(obj, NULL);
elm_interface_atspi_accessible_name_set(obj, NULL);
elm_interface_atspi_accessible_translation_domain_set(obj, NULL);
elm_interface_atspi_accessible_relationships_clear(obj);
efl_destructor(efl_super(obj, ELM_WIDGET_CLASS));
sd->on_destroy = EINA_FALSE;