kimcinoo pushed a commit to branch master.
commit 1912a6639849995171ae2dfde8af38ca28197d2a
Author: Shinwoo Kim <[email protected]>
Date: Wed Apr 17 17:22:13 2013 +0900
[access] read at once
---
src/lib/elm_access.c | 32 ++++++++++++++++++++++++++------
src/lib/elm_access.h | 24 +++++++++++++++++-------
2 files changed, 43 insertions(+), 13 deletions(-)
diff --git a/src/lib/elm_access.c b/src/lib/elm_access.c
index a672bee..06d9ca1 100644
--- a/src/lib/elm_access.c
+++ b/src/lib/elm_access.c
@@ -137,17 +137,37 @@ _access_highlight_object_get(Evas_Object *obj)
static void
_access_highlight_read(Elm_Access_Info *ac, Evas_Object *obj)
{
+ int type;
+ char *txt = NULL;
+ Eina_Strbuf *strbuf;
+
+ strbuf = eina_strbuf_new();
+
if (_elm_config->access_mode != ELM_ACCESS_MODE_OFF)
{
if (ac->on_highlight) ac->on_highlight(ac->on_highlight_data);
_elm_access_object_hilight(obj);
- _elm_access_read(ac, ELM_ACCESS_CANCEL, obj);
- _elm_access_read(ac, ELM_ACCESS_TYPE, obj);
- _elm_access_read(ac, ELM_ACCESS_INFO, obj);
- _elm_access_read(ac, ELM_ACCESS_STATE, obj);
- _elm_access_read(ac, ELM_ACCESS_CONTEXT_INFO, obj);
- _elm_access_read(ac, ELM_ACCESS_DONE, obj);
+
+ for (type = ELM_ACCESS_INFO_FIRST + 1; type < ELM_ACCESS_INFO_LAST;
type++)
+ {
+ txt = _elm_access_text_get(ac, type, obj);
+ if (txt && (strlen(txt) > 0))
+ {
+ if (eina_strbuf_length_get(strbuf) > 0)
+ eina_strbuf_append_printf(strbuf, ", %s", txt);
+ else
+ eina_strbuf_append(strbuf, txt);
+
+ free(txt);
+ }
+ }
}
+
+ txt = eina_strbuf_string_steal(strbuf);
+ eina_strbuf_free(strbuf);
+
+ _elm_access_say(txt);
+ free(txt);
}
static Eina_Bool
diff --git a/src/lib/elm_access.h b/src/lib/elm_access.h
index 9414492..20ce6cd 100644
--- a/src/lib/elm_access.h
+++ b/src/lib/elm_access.h
@@ -10,13 +10,23 @@
const Eo_Class *elm_obj_access_class_get(void) EINA_CONST;
-#define ELM_ACCESS_TYPE 0 /* when reading out widget or item
- * this is read first */
-#define ELM_ACCESS_INFO 1 /* next read is info - this is
- * normally label */
-#define ELM_ACCESS_STATE 2 /* if there is a state (eg checkbox)
- * then read state out */
-#define ELM_ACCESS_CONTEXT_INFO 3 /* to give contextual information */
+enum _Elm_Access_Info_Type
+{
+ ELM_ACCESS_INFO_FIRST = -1,
+ ELM_ACCESS_INFO, /* next read is info - this is
+ * normally label */
+ ELM_ACCESS_TYPE, /* when reading out widget or item
+ * this is read first */
+ ELM_ACCESS_STATE, /* if there is a state (eg checkbox)
+ * then read state out */
+ ELM_ACCESS_CONTEXT_INFO, /* to give contextual information */
+ ELM_ACCESS_INFO_LAST
+};
+
+/**
+ * @typedef Elm_Access_Info_Type
+ */
+typedef enum _Elm_Access_Info_Type Elm_Access_Info_Type;
typedef char *(*Elm_Access_Info_Cb)(void *data, Evas_Object *obj);
typedef void (*Elm_Access_Activate_Cb)(void *data, Evas_Object *part_obj,
Elm_Object_Item *item);
--
------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter