2014-05-27 00:23:13 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "elementary_config.h"
|
|
|
|
#endif
|
|
|
|
|
2017-09-11 23:48:39 -07:00
|
|
|
#define EFL_ACCESS_IMAGE_PROTECTED
|
2014-10-17 08:56:11 -07:00
|
|
|
|
2014-05-27 00:23:13 -07:00
|
|
|
#include <Elementary.h>
|
|
|
|
#include "elm_widget.h"
|
|
|
|
#include "elm_priv.h"
|
|
|
|
|
2016-06-20 07:31:31 -07:00
|
|
|
static void
|
2016-08-30 05:34:10 -07:00
|
|
|
_free_desc_cb(void *data, const Efl_Event *event EINA_UNUSED)
|
2014-05-27 00:23:13 -07:00
|
|
|
{
|
|
|
|
eina_stringshare_del(data);
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static const char*
|
2017-09-11 23:48:39 -07:00
|
|
|
_efl_access_image_description_get(Eo *obj, void *sd EINA_UNUSED)
|
2014-05-27 00:23:13 -07:00
|
|
|
{
|
|
|
|
const char *descr = NULL;
|
|
|
|
|
2016-08-10 07:23:04 -07:00
|
|
|
descr = efl_key_data_get(obj, "atspi_image_description");
|
2014-05-27 00:23:13 -07:00
|
|
|
return descr;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
2017-09-11 23:48:39 -07:00
|
|
|
_efl_access_image_description_set(Eo *obj, void *sd EINA_UNUSED, const char *description)
|
2014-05-27 00:23:13 -07:00
|
|
|
{
|
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);
|
2016-08-10 07:23:04 -07:00
|
|
|
char *old_descr = efl_key_data_get(obj, key);
|
2016-03-04 17:20:34 -08:00
|
|
|
if (old_descr)
|
2015-05-28 09:47:49 -07:00
|
|
|
{
|
|
|
|
eina_stringshare_del(old_descr);
|
2016-08-10 07:23:04 -07:00
|
|
|
efl_event_callback_del(obj, EFL_EVENT_DEL, _free_desc_cb, old_descr);
|
2015-05-28 09:47:49 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
if (descr)
|
|
|
|
{
|
2016-08-10 07:23:04 -07:00
|
|
|
efl_key_data_set(obj, key, descr);
|
|
|
|
efl_event_callback_add(obj, EFL_EVENT_DEL, _free_desc_cb, descr);
|
2015-05-28 09:47:49 -07:00
|
|
|
}
|
2014-05-27 00:23:13 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static const char*
|
2017-09-11 23:48:39 -07:00
|
|
|
_efl_access_image_locale_get(Eo *obj EINA_UNUSED, void *sd EINA_UNUSED)
|
2014-05-27 00:23:13 -07:00
|
|
|
{
|
|
|
|
// by default assume that descriptions are given in language of current
|
|
|
|
// locale.
|
|
|
|
return getenv("LANG");
|
|
|
|
}
|
|
|
|
|
2017-09-11 23:48:39 -07:00
|
|
|
#include "efl_access_image.eo.c"
|