access: enable access back agian because we released 1.8 and it's time to test/fix accessibility.

I manually created and merged "enable_access" branch for this job.
This commit is contained in:
Daniel Juyung Seo 2013-12-16 16:21:51 +09:00
commit 1cad3a5d34
4 changed files with 65 additions and 75 deletions

View File

@ -450,8 +450,7 @@ my_win_main(const char *autorun, Eina_Bool test_win_only)
evas_object_show(lb);
/* This label will not be read out */
// this is not an exported api! don't use! (no EAPI)
// elm_access_object_unregister(lb);
elm_access_object_unregister(lb);
tg = elm_check_add(win);
elm_object_style_set(tg, "toggle");

View File

@ -231,7 +231,7 @@ test_access2(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_i
int i, j, k;
char buf[PATH_MAX];
Evas_Object *win, *bx, *sc, *ly, *ly2, *ic;
// Evas_Object *ao, *to;
Evas_Object *ao, *to;
win = elm_win_util_standard_add("access", "Access");
elm_win_autodel_set(win, EINA_TRUE);
@ -288,10 +288,9 @@ test_access2(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_i
evas_object_show(ly2);
/* access */
// to = (Evas_Object *)edje_object_part_object_get(elm_layout_edje_get(ly2), "access");
// this is not an exported api don't use (no EAPI)
// ao = elm_access_object_register(to, ly2);
// elm_object_focus_custom_chain_append(ly2, ao, NULL);
to = (Evas_Object *)edje_object_part_object_get(elm_layout_edje_get(ly2), "access");
ao = elm_access_object_register(to, ly2);
elm_object_focus_custom_chain_append(ly2, ao, NULL);
}
}
@ -303,7 +302,7 @@ test_access2(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_i
}
static Eina_Bool
_key_down_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *ei)
_key_down_cb(void *data, int type EINA_UNUSED, void *ei)
{
Elm_Access_Action_Info *a;
Ecore_Event_Key *ev = ei;
@ -316,8 +315,7 @@ _key_down_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *ei)
if (!strcmp(ev->key, "F1"))
{
a->highlight_cycle = EINA_TRUE;
// this is not an exported api don't use (no EAPI)
// elm_access_action(data, ELM_ACCESS_ACTION_HIGHLIGHT_NEXT, a);
elm_access_action(data, ELM_ACCESS_ACTION_HIGHLIGHT_NEXT, a);
}
}
free(a);
@ -325,21 +323,19 @@ _key_down_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *ei)
return ECORE_CALLBACK_PASS_ON;
}
/*
static char *
_access_info_cb(void *data, Evas_Object *obj EINA_UNUSED)
{
if (data) return strdup(data);
return NULL;
}
*/
void
test_access3(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
char buf[PATH_MAX];
Evas_Object *win, *box, *lbl, *ly, *btn;
// Evas_Object *red_ao, *green_ao, *blue_ao, *black_ao, *to;
Evas_Object *red_ao, *green_ao, *blue_ao, *black_ao, *to;
win = elm_win_util_standard_add("access", "Access");
elm_win_autodel_set(win, EINA_TRUE);
@ -377,29 +373,25 @@ test_access3(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_i
elm_object_part_content_set(ly, "center", btn);
// to = (Evas_Object *)edje_object_part_object_get(elm_layout_edje_get(ly), "red");
// this is not an exported api don't use (no EAPI)
// red_ao = elm_access_object_register(to, ly);
// elm_access_info_cb_set(red_ao, ELM_ACCESS_INFO, _access_info_cb, "red");
// elm_access_highlight_next_set(btn, ELM_HIGHLIGHT_DIR_NEXT, red_ao);
to = (Evas_Object *)edje_object_part_object_get(elm_layout_edje_get(ly), "red");
red_ao = elm_access_object_register(to, ly);
elm_access_info_cb_set(red_ao, ELM_ACCESS_INFO, _access_info_cb, "red");
elm_access_highlight_next_set(btn, ELM_HIGHLIGHT_DIR_NEXT, red_ao);
// to = (Evas_Object *)edje_object_part_object_get(elm_layout_edje_get(ly), "green");
// this is not an exported api don't use (no EAPI)
// green_ao = elm_access_object_register(to, ly);
// elm_access_info_cb_set(green_ao, ELM_ACCESS_INFO, _access_info_cb, "green");
// elm_access_highlight_next_set(red_ao, ELM_HIGHLIGHT_DIR_NEXT, green_ao);
to = (Evas_Object *)edje_object_part_object_get(elm_layout_edje_get(ly), "green");
green_ao = elm_access_object_register(to, ly);
elm_access_info_cb_set(green_ao, ELM_ACCESS_INFO, _access_info_cb, "green");
elm_access_highlight_next_set(red_ao, ELM_HIGHLIGHT_DIR_NEXT, green_ao);
// to = (Evas_Object *)edje_object_part_object_get(elm_layout_edje_get(ly), "blue");
// this is not an exported api don't use (no EAPI)
// blue_ao = elm_access_object_register(to, ly);
// elm_access_info_cb_set(blue_ao, ELM_ACCESS_INFO, _access_info_cb, "blue");
// elm_access_highlight_next_set(green_ao, ELM_HIGHLIGHT_DIR_NEXT, blue_ao);
to = (Evas_Object *)edje_object_part_object_get(elm_layout_edje_get(ly), "blue");
blue_ao = elm_access_object_register(to, ly);
elm_access_info_cb_set(blue_ao, ELM_ACCESS_INFO, _access_info_cb, "blue");
elm_access_highlight_next_set(green_ao, ELM_HIGHLIGHT_DIR_NEXT, blue_ao);
// to = (Evas_Object *)edje_object_part_object_get(elm_layout_edje_get(ly), "black");
// this is not an exported api don't use (no EAPI)
// black_ao = elm_access_object_register(to, ly);
// elm_access_info_cb_set(black_ao, ELM_ACCESS_INFO, _access_info_cb, "black");
// elm_access_highlight_next_set(blue_ao, ELM_HIGHLIGHT_DIR_NEXT, black_ao);
to = (Evas_Object *)edje_object_part_object_get(elm_layout_edje_get(ly), "black");
black_ao = elm_access_object_register(to, ly);
elm_access_info_cb_set(black_ao, ELM_ACCESS_INFO, _access_info_cb, "black");
elm_access_highlight_next_set(blue_ao, ELM_HIGHLIGHT_DIR_NEXT, black_ao);
ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, _key_down_cb, win);

View File

@ -1213,44 +1213,44 @@ _constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
evas_obj_type_set(MY_CLASS_NAME_LEGACY));
}
Evas_Object *
EAPI Evas_Object *
elm_access_object_register(Evas_Object *obj, Evas_Object *parent)
{
return _access_object_register(obj, parent);
}
void
EAPI void
elm_access_object_unregister(Evas_Object *obj)
{
_access_object_unregister(obj);
}
Evas_Object *
EAPI Evas_Object *
elm_access_object_get(const Evas_Object *obj)
{
return evas_object_data_get(obj, "_part_access_obj");
}
void
EAPI void
elm_access_info_set(Evas_Object *obj, int type, const char *text)
{
_elm_access_text_set(_elm_access_info_get(obj), type, text);
}
char *
EAPI char *
elm_access_info_get(const Evas_Object *obj, int type)
{
return _elm_access_text_get(_elm_access_info_get(obj), type, obj);
}
void
EAPI void
elm_access_info_cb_set(Evas_Object *obj, int type,
Elm_Access_Info_Cb func, const void *data)
{
_elm_access_callback_set(_elm_access_info_get(obj), type, func, data);
}
void
EAPI void
elm_access_activate_cb_set(Evas_Object *obj,
Elm_Access_Activate_Cb func, void *data)
{
@ -1263,7 +1263,7 @@ elm_access_activate_cb_set(Evas_Object *obj,
ac->activate_data = data;
}
void
EAPI void
elm_access_say(const char *text)
{
if (!text) return;
@ -1271,13 +1271,13 @@ elm_access_say(const char *text)
_elm_access_say(text);
}
void
EAPI void
elm_access_highlight_set(Evas_Object* obj)
{
_elm_access_highlight_set(obj);
}
Eina_Bool
EAPI Eina_Bool
elm_access_action(Evas_Object *obj, const Elm_Access_Action_Type type, Elm_Access_Action_Info *action_info)
{
Evas *evas;
@ -1348,7 +1348,7 @@ elm_access_action(Evas_Object *obj, const Elm_Access_Action_Type type, Elm_Acces
return EINA_TRUE;
}
void
EAPI void
elm_access_action_cb_set(Evas_Object *obj, const Elm_Access_Action_Type type, const Elm_Access_Action_Cb cb, const void *data)
{
Action_Info *a;
@ -1364,7 +1364,6 @@ elm_access_action_cb_set(Evas_Object *obj, const Elm_Access_Action_Type type, co
a->fn[type].cb = cb;
a->fn[type].user_data = (void *)data;
}
EAPI void
elm_access_external_info_set(Evas_Object *obj, const char *text)
{
@ -1381,7 +1380,7 @@ elm_access_external_info_get(const Evas_Object *obj)
return _elm_access_text_get(ac, ELM_ACCESS_CONTEXT_INFO, obj);
}
void
EAPI void
elm_access_highlight_next_set(Evas_Object *obj, Elm_Highlight_Direction dir, Evas_Object *next)
{
EINA_SAFETY_ON_FALSE_RETURN(obj);

View File

@ -27,7 +27,7 @@ enum _Elm_Access_Info_Type
};
/**
* @since 1.9
* @since 1.8
* @typedef Elm_Access_Info_Type
*/
typedef enum _Elm_Access_Info_Type Elm_Access_Info_Type;
@ -57,7 +57,7 @@ enum _Elm_Access_Action_Type
};
/**
* @since 1.9
* @since 1.8
* @typedef Elm_Access_Action_Type
*/
typedef enum _Elm_Access_Action_Type Elm_Access_Action_Type;
@ -76,7 +76,7 @@ struct _Elm_Access_Action_Info
};
/**
* @since 1.9
* @since 1.8
* @typedef Elm_Access_Action_Info
*/
typedef struct _Elm_Access_Action_Info Elm_Access_Action_Info;
@ -89,13 +89,13 @@ enum _Elm_Highlight_Direction
};
/**
* @since 1.9
* @since 1.8
* @typedef Elm_Highlight_Direction
*/
typedef enum _Elm_Highlight_Direction Elm_Highlight_Direction;
/**
* @since 1.9
* @since 1.8
* @typedef Elm_Access_Action_Cb
*
* User callback to make access object do specific action
@ -113,7 +113,7 @@ typedef void (*Elm_Access_Activate_Cb)(void *data, Evas_Object *part_obj, Elm_Ob
/**
* @brief Register evas object as an accessible object.
* @since 1.9
* @since 1.8
*
* @param obj The evas object to register as an accessible object.
* @param parent The elementary object which is used for creating
@ -121,32 +121,32 @@ typedef void (*Elm_Access_Activate_Cb)(void *data, Evas_Object *part_obj, Elm_Ob
*
* @ingroup Access
*/
Evas_Object *elm_access_object_register(Evas_Object *obj, Evas_Object *parent);
EAPI Evas_Object *elm_access_object_register(Evas_Object *obj, Evas_Object *parent);
/**
* @brief Unregister accessible object.
* @since 1.9
* @since 1.8
*
* @param obj The Evas object to unregister accessible object.
*
* @ingroup Access
*/
void elm_access_object_unregister(Evas_Object *obj);
EAPI void elm_access_object_unregister(Evas_Object *obj);
/**
* @brief Get an accessible object of the evas object.
* @since 1.9
* @since 1.8
*
* @param obj The evas object.
* @return Accessible object of the evas object or NULL for any error
*
* @ingroup Access
*/
Evas_Object *elm_access_object_get(const Evas_Object *obj);
EAPI Evas_Object *elm_access_object_get(const Evas_Object *obj);
/**
* @brief Set text to give information for specific type.
* @since 1.9
* @since 1.8
*
* @param obj Accessible object.
* @param type The type of content that will be read
@ -155,11 +155,11 @@ Evas_Object *elm_access_object_get(const Evas_Object *obj);
* @see elm_access_info_cb_set
* @ingroup Access
*/
void elm_access_info_set(Evas_Object *obj, int type, const char *text);
EAPI void elm_access_info_set(Evas_Object *obj, int type, const char *text);
/**
* @brief Set text to give information for specific type.
* @since 1.9
* @since 1.8
*
* @param obj Accessible object.
* @param type The type of content that will be read
@ -167,11 +167,11 @@ void elm_access_info_set(Evas_Object *obj, int type, const char *text);
* @see elm_access_info_cb_set
* @ingroup Access
*/
char *elm_access_info_get(const Evas_Object *obj, int type);
EAPI char *elm_access_info_get(const Evas_Object *obj, int type);
/**
* @brief Set content callback to give information for specific type.
* @since 1.9
* @since 1.8
*
* @param obj Accessible object.
* @param type The type of content that will be read
@ -188,11 +188,11 @@ char *elm_access_info_get(const Evas_Object *obj, int type);
*
* @ingroup Access
*/
void elm_access_info_cb_set(Evas_Object *obj, int type, Elm_Access_Info_Cb func, const void *data);
EAPI void elm_access_info_cb_set(Evas_Object *obj, int type, Elm_Access_Info_Cb func, const void *data);
/**
* @brief Set activate callback to activate highlight object.
* @since 1.9
* @since 1.8
*
* @param obj Accessible object.
* @param func The function to be called when the activate gesture is detected
@ -200,11 +200,11 @@ void elm_access_info_cb_set(Evas_Object *obj, int type, Elm_Access_Info_Cb func,
*
* @ingroup Access
*/
void elm_access_activate_cb_set(Evas_Object *obj, Elm_Access_Activate_Cb func, void *data);
EAPI void elm_access_activate_cb_set(Evas_Object *obj, Elm_Access_Activate_Cb func, void *data);
/**
* @brief Read out text information directly.
* @since 1.9
* @since 1.8
*
* @param text The text information that will be read
*
@ -212,11 +212,11 @@ void elm_access_activate_cb_set(Evas_Object *obj, Elm_Access_Activate_Cb func, v
*
* @ingroup Access
*/
void elm_access_say(const char *text);
EAPI void elm_access_say(const char *text);
/**
* @brief Give the highlight to the object directly.
* @since 1.9
* @since 1.8
*
* @param obj The object that will have the highlight and its information be read.
*
@ -225,11 +225,11 @@ void elm_access_say(const char *text);
* @see elm_access_object_get
* @ingroup Access
*/
void elm_access_highlight_set(Evas_Object* obj);
EAPI void elm_access_highlight_set(Evas_Object* obj);
/**
* @brief Do the accessibility action base on given object.
* @since 1.9
* @since 1.8
*
* @param obj The object that could be an any object. it would be useful to use a container widget.
* @param type The type of accessibility action.
@ -243,11 +243,11 @@ void elm_access_highlight_set(Evas_Object* obj);
*
* @ingroup Access
*/
Eina_Bool elm_access_action(Evas_Object *obj, const Elm_Access_Action_Type type, Elm_Access_Action_Info *action_info);
EAPI Eina_Bool elm_access_action(Evas_Object *obj, const Elm_Access_Action_Type type, Elm_Access_Action_Info *action_info);
/**
* @brief Set a callback function to a given accessibility action type
* @since 1.9
* @since 1.8
*
* @param obj The object to attach a callback to
* @param type The type of accessibility action.
@ -256,11 +256,11 @@ Eina_Bool elm_access_action(Evas_Object *obj, const Elm_Access_Action_Type type,
*
* @ingroup Access
*/
void elm_access_action_cb_set(Evas_Object *obj, const Elm_Access_Action_Type type, const Elm_Access_Action_Cb cb, const void *data);
EAPI void elm_access_action_cb_set(Evas_Object *obj, const Elm_Access_Action_Type type, const Elm_Access_Action_Cb cb, const void *data);
/**
* @brief Set the next access object for highlight.
* @since 1.9
* @since 1.8
*
* @param obj The object is previous access object of next for hilight.
* @param dir Access direction same as Focus direction
@ -273,5 +273,5 @@ void elm_access_action_cb_set(Evas_Object *obj, const Elm_Access_Action_Type typ
*
* @ingroup Access
*/
void
EAPI void
elm_access_highlight_next_set(Evas_Object *obj, Elm_Highlight_Direction dir, Evas_Object *next);