2014-05-27 00:23:13 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "elementary_config.h"
|
|
|
|
#endif
|
|
|
|
|
2014-10-17 08:56:11 -07:00
|
|
|
#define ELM_INTERFACE_ATSPI_IMAGE_PROTECTED
|
|
|
|
|
2014-05-27 00:23:13 -07:00
|
|
|
#include <Elementary.h>
|
|
|
|
#include "elm_widget.h"
|
|
|
|
#include "elm_priv.h"
|
|
|
|
|
2015-05-28 09:47:49 -07:00
|
|
|
static Eina_Bool
|
|
|
|
_free_desc_cb(void *data, Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
|
2014-05-27 00:23:13 -07:00
|
|
|
{
|
|
|
|
eina_stringshare_del(data);
|
2015-05-28 09:47:49 -07:00
|
|
|
|
|
|
|
return EINA_TRUE;
|
2014-05-27 00:23:13 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static const char*
|
|
|
|
_elm_interface_atspi_image_description_get(Eo *obj, void *sd EINA_UNUSED)
|
|
|
|
{
|
|
|
|
const char *descr = NULL;
|
|
|
|
|
|
|
|
eo_do(obj, descr = eo_key_data_get("atspi_image_description"));
|
|
|
|
return descr;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
|
|
|
_elm_interface_atspi_image_description_set(Eo *obj, void *sd EINA_UNUSED, const char *description)
|
|
|
|
{
|
2015-05-28 09:47:49 -07:00
|
|
|
const char *key = "atspi_image_description";
|
2014-05-27 00:23:13 -07:00
|
|
|
const char *descr = eina_stringshare_add(description);
|
2015-05-28 09:47:49 -07:00
|
|
|
char *old_descr;
|
|
|
|
if (eo_do_ret(obj, old_descr, eo_key_data_get(key)))
|
|
|
|
{
|
|
|
|
eina_stringshare_del(old_descr);
|
|
|
|
eo_do(obj, eo_event_callback_del(EO_BASE_EVENT_DEL, _free_desc_cb, old_descr));
|
|
|
|
}
|
|
|
|
|
|
|
|
if (descr)
|
|
|
|
{
|
|
|
|
eo_do(obj, eo_key_data_set(key, descr),
|
|
|
|
eo_event_callback_add(EO_BASE_EVENT_DEL, _free_desc_cb, descr));
|
|
|
|
}
|
2014-05-27 00:23:13 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static const char*
|
|
|
|
_elm_interface_atspi_image_locale_get(Eo *obj EINA_UNUSED, void *sd EINA_UNUSED)
|
|
|
|
{
|
|
|
|
// by default assume that descriptions are given in language of current
|
|
|
|
// locale.
|
|
|
|
return getenv("LANG");
|
|
|
|
}
|
|
|
|
|
|
|
|
#include "elm_interface_atspi_image.eo.c"
|