forked from enlightenment/efl
[access] export elm_access_activate_cb_set(); and add related documentation.
SVN revision: 82052
This commit is contained in:
parent
f4e8c92f0d
commit
88dac18cf7
|
@ -28,7 +28,8 @@ _elm_access_smart_activate(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
|
||||||
if (!ac) return;
|
if (!ac) return;
|
||||||
|
|
||||||
if (ac->activate)
|
if (ac->activate)
|
||||||
ac->activate(ac->activate_data, ac->part_object, ac->widget_item);
|
ac->activate(ac->activate_data, ac->part_object,
|
||||||
|
(Elm_Object_Item *)ac->widget_item);
|
||||||
|
|
||||||
if (ret) *ret = EINA_TRUE;
|
if (ret) *ret = EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
@ -308,11 +309,23 @@ EAPI void
|
||||||
_elm_access_highlight_object_activate(Evas_Object *obj, Elm_Activate act)
|
_elm_access_highlight_object_activate(Evas_Object *obj, Elm_Activate act)
|
||||||
{
|
{
|
||||||
Evas_Object *highlight;
|
Evas_Object *highlight;
|
||||||
|
Elm_Access_Info *ac;
|
||||||
|
|
||||||
highlight = _access_highlight_object_get(obj);
|
highlight = _access_highlight_object_get(obj);
|
||||||
if (!highlight) return;
|
if (!highlight) return;
|
||||||
|
|
||||||
elm_widget_activate(highlight, act);
|
if (elm_widget_is(highlight))
|
||||||
|
{
|
||||||
|
elm_widget_activate(highlight, act);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ac = evas_object_data_get(highlight, "_elm_access");
|
||||||
|
if (!ac) return;
|
||||||
|
|
||||||
|
if (ac->activate)
|
||||||
|
ac->activate(ac->activate_data, highlight,
|
||||||
|
(Elm_Object_Item *)ac->widget_item);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
|
@ -800,14 +813,6 @@ elm_access_text_get(Evas_Object *obj, int type)
|
||||||
return _elm_access_text_get(_elm_access_object_get(obj), type, obj);
|
return _elm_access_text_get(_elm_access_object_get(obj), type, obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
|
||||||
elm_access_cb_set(Evas_Object *obj, int type,
|
|
||||||
Elm_Access_Content_Cb func, const void *data)
|
|
||||||
{
|
|
||||||
_elm_access_callback_set(_elm_access_object_get(obj), type, func, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
elm_access_object_register(Evas_Object *parent, Evas_Object *target)
|
elm_access_object_register(Evas_Object *parent, Evas_Object *target)
|
||||||
{
|
{
|
||||||
|
@ -851,6 +856,26 @@ elm_access_object_unregister(Evas_Object *obj)
|
||||||
evas_object_data_del(obj, "_elm_access_parent");
|
evas_object_data_del(obj, "_elm_access_parent");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
elm_access_content_cb_set(Evas_Object *obj, int type,
|
||||||
|
Elm_Access_Content_Cb func, const void *data)
|
||||||
|
{
|
||||||
|
_elm_access_callback_set(_elm_access_object_get(obj), type, func, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
elm_access_activate_cb_set(Evas_Object *obj,
|
||||||
|
Elm_Access_Activate_Cb func, void *data)
|
||||||
|
{
|
||||||
|
Elm_Access_Info *ac;
|
||||||
|
|
||||||
|
ac = _elm_access_object_get(obj);
|
||||||
|
if (!ac) return;
|
||||||
|
|
||||||
|
ac->activate = func;
|
||||||
|
ac->activate_data = data;
|
||||||
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
elm_access_external_info_set(Evas_Object *obj, const char *text)
|
elm_access_external_info_set(Evas_Object *obj, const char *text)
|
||||||
{
|
{
|
||||||
|
|
|
@ -19,13 +19,14 @@ const Eo_Class *elm_obj_access_class_get(void) EINA_CONST;
|
||||||
#define ELM_ACCESS_CONTEXT_INFO 3 /* to give contextual information */
|
#define ELM_ACCESS_CONTEXT_INFO 3 /* to give contextual information */
|
||||||
|
|
||||||
typedef char *(*Elm_Access_Content_Cb)(void *data, Evas_Object *obj);
|
typedef char *(*Elm_Access_Content_Cb)(void *data, Evas_Object *obj);
|
||||||
|
typedef void (*Elm_Access_Activate_Cb)(void *data, Evas_Object *part_obj, Elm_Object_Item *item);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Register evas object as an accessible object.
|
* @brief Register evas object as an accessible object.
|
||||||
* @since 1.8
|
* @since 1.8
|
||||||
*
|
*
|
||||||
* @param parent accessibility parent object. this should be one of widget.
|
* @param parent Accessibility parent object. this should be one of widget.
|
||||||
* @param target evas object to register as an accessible object.
|
* @param target Evas object to register as an accessible object.
|
||||||
*
|
*
|
||||||
* @ingroup Access
|
* @ingroup Access
|
||||||
*/
|
*/
|
||||||
|
@ -35,7 +36,7 @@ EAPI void elm_access_object_register(Evas_Object *parent, Evas_Object *target);
|
||||||
* @brief Unregister accessible object.
|
* @brief Unregister accessible object.
|
||||||
* @since 1.8
|
* @since 1.8
|
||||||
*
|
*
|
||||||
* @param obj accessible object.
|
* @param obj Accessible object.
|
||||||
*
|
*
|
||||||
* @ingroup Access
|
* @ingroup Access
|
||||||
*/
|
*/
|
||||||
|
@ -45,10 +46,11 @@ EAPI void elm_access_object_unregister(Evas_Object *target);
|
||||||
* @brief Set text to give information for specific type.
|
* @brief Set text to give information for specific type.
|
||||||
* @since 1.8
|
* @since 1.8
|
||||||
*
|
*
|
||||||
* @param obj accessible object.
|
* @param obj Accessible object.
|
||||||
* @param type
|
* @param type The type of content that will be read
|
||||||
* @param text
|
* @param text The text information that will be read
|
||||||
|
*
|
||||||
|
* @see elm_access_content_cb_set
|
||||||
* @ingroup Access
|
* @ingroup Access
|
||||||
*/
|
*/
|
||||||
EAPI void elm_access_text_set(Evas_Object *obj, int type, const char *text);
|
EAPI void elm_access_text_set(Evas_Object *obj, int type, const char *text);
|
||||||
|
@ -57,25 +59,46 @@ EAPI void elm_access_text_set(Evas_Object *obj, int type, const char *text);
|
||||||
* @brief Set text to give information for specific type.
|
* @brief Set text to give information for specific type.
|
||||||
* @since 1.8
|
* @since 1.8
|
||||||
*
|
*
|
||||||
* @param obj accessible object.
|
* @param obj Accessible object.
|
||||||
* @param type
|
* @param type The type of content that will be read
|
||||||
|
*
|
||||||
|
* @see elm_access_content_cb_set
|
||||||
* @ingroup Access
|
* @ingroup Access
|
||||||
*/
|
*/
|
||||||
EAPI char * elm_access_text_get(Evas_Object *obj, int type);
|
EAPI char * elm_access_text_get(Evas_Object *obj, int type);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Set callback to give information for specific type.
|
* @brief Set content callback to give information for specific type.
|
||||||
* @since 1.8
|
* @since 1.8
|
||||||
*
|
*
|
||||||
* @param obj accessible object.
|
* @param obj Accessible object.
|
||||||
* @param type
|
* @param type The type of content that will be read
|
||||||
* @param func
|
* @param func The function to be called when the content is read
|
||||||
* @param data
|
* @param data The data pointer to be passed to @p func
|
||||||
|
*
|
||||||
|
* The type would be one of ELM_ACCESS_TYPE, ELM_ACCESS_INFO,
|
||||||
|
* ELM_ACCESS_STATE, ELM_ACCESS_CONTEXT_INFO.
|
||||||
|
*
|
||||||
|
* In the case of button widget, the content of ELM_ACCESS_TYPE would be
|
||||||
|
* "button". The label of button such as "ok", "cancel" is for ELM_ACCESS_INFO.
|
||||||
|
* If the button is disabled, content of ELM_ACCESS_STATE would be "disabled".
|
||||||
|
* And if there is contextual information, ELM_ACCESS_CONTEXT_INFO is used.
|
||||||
*
|
*
|
||||||
* @ingroup Access
|
* @ingroup Access
|
||||||
*/
|
*/
|
||||||
EAPI void elm_access_cb_set(Evas_Object *obj, int type, Elm_Access_Content_Cb func, const void *data);
|
EAPI void elm_access_content_cb_set(Evas_Object *obj, int type, Elm_Access_Content_Cb func, const void *data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Set activate callback to activate highlight object.
|
||||||
|
* @since 1.8
|
||||||
|
*
|
||||||
|
* @param obj Accessible object.
|
||||||
|
* @param func The function to be called when the activate gesture is detected
|
||||||
|
* @param data The data pointer to be passed to @p func
|
||||||
|
*
|
||||||
|
* @ingroup Access
|
||||||
|
*/
|
||||||
|
EAPI void elm_access_activate_cb_set(Evas_Object *obj, Elm_Access_Activate_Cb func, void *data);
|
||||||
|
|
||||||
//TODO: remvoe below - use elm_access_text_set(); or elm_access_cb_set();
|
//TODO: remvoe below - use elm_access_text_set(); or elm_access_cb_set();
|
||||||
EINA_DEPRECATED EAPI void elm_access_external_info_set(Evas_Object *obj, const char *text);
|
EINA_DEPRECATED EAPI void elm_access_external_info_set(Evas_Object *obj, const char *text);
|
||||||
|
|
|
@ -176,7 +176,7 @@ _on_clock_val_change_stop(void *data,
|
||||||
static void
|
static void
|
||||||
_access_activate_cb(void *data,
|
_access_activate_cb(void *data,
|
||||||
Evas_Object *part_obj,
|
Evas_Object *part_obj,
|
||||||
Elm_Widget_Item *item __UNUSED__)
|
Elm_Object_Item *item __UNUSED__)
|
||||||
{
|
{
|
||||||
Evas_Object *digit, *inc_btn;
|
Evas_Object *digit, *inc_btn;
|
||||||
ELM_CLOCK_DATA_GET(data, sd);
|
ELM_CLOCK_DATA_GET(data, sd);
|
||||||
|
|
|
@ -113,7 +113,7 @@ static void _item_mouse_callbacks_add(Elm_Gen_Item *, Evas_Object *);
|
||||||
static void _item_mouse_callbacks_del(Elm_Gen_Item *, Evas_Object *);
|
static void _item_mouse_callbacks_del(Elm_Gen_Item *, Evas_Object *);
|
||||||
static void _access_activate_cb(void *data __UNUSED__,
|
static void _access_activate_cb(void *data __UNUSED__,
|
||||||
Evas_Object *part_obj __UNUSED__,
|
Evas_Object *part_obj __UNUSED__,
|
||||||
Elm_Widget_Item *item);
|
Elm_Object_Item *item);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_elm_genlist_pan_smart_pos_set(Eo *obj, void *_pd, va_list *list)
|
_elm_genlist_pan_smart_pos_set(Eo *obj, void *_pd, va_list *list)
|
||||||
|
@ -3793,7 +3793,7 @@ _item_move_after(Elm_Gen_Item *it,
|
||||||
static void
|
static void
|
||||||
_access_activate_cb(void *data __UNUSED__,
|
_access_activate_cb(void *data __UNUSED__,
|
||||||
Evas_Object *part_obj __UNUSED__,
|
Evas_Object *part_obj __UNUSED__,
|
||||||
Elm_Widget_Item *item)
|
Elm_Object_Item *item)
|
||||||
{
|
{
|
||||||
Elm_Genlist_Smart_Data *sd;
|
Elm_Genlist_Smart_Data *sd;
|
||||||
Elm_Gen_Item *it;
|
Elm_Gen_Item *it;
|
||||||
|
|
|
@ -1390,7 +1390,7 @@ _access_on_highlight_cb(void *data)
|
||||||
static void
|
static void
|
||||||
_access_activate_cb(void *data __UNUSED__,
|
_access_activate_cb(void *data __UNUSED__,
|
||||||
Evas_Object *part_obj __UNUSED__,
|
Evas_Object *part_obj __UNUSED__,
|
||||||
Elm_Widget_Item *item)
|
Elm_Object_Item *item)
|
||||||
{
|
{
|
||||||
Elm_List_Item *it;
|
Elm_List_Item *it;
|
||||||
Evas_Object *obj;
|
Evas_Object *obj;
|
||||||
|
|
|
@ -520,7 +520,7 @@ _access_state_cb(void *data, Evas_Object *obj __UNUSED__)
|
||||||
static void
|
static void
|
||||||
_access_activate_cb(void *data,
|
_access_activate_cb(void *data,
|
||||||
Evas_Object *part_obj,
|
Evas_Object *part_obj,
|
||||||
Elm_Widget_Item *item __UNUSED__)
|
Elm_Object_Item *item __UNUSED__)
|
||||||
{
|
{
|
||||||
char *text;
|
char *text;
|
||||||
Eina_Strbuf *buf;
|
Eina_Strbuf *buf;
|
||||||
|
|
|
@ -1690,7 +1690,7 @@ _item_del_pre_hook(Elm_Object_Item *it)
|
||||||
static void
|
static void
|
||||||
_access_activate_cb(void *data __UNUSED__,
|
_access_activate_cb(void *data __UNUSED__,
|
||||||
Evas_Object *part_obj __UNUSED__,
|
Evas_Object *part_obj __UNUSED__,
|
||||||
Elm_Widget_Item *item)
|
Elm_Object_Item *item)
|
||||||
{
|
{
|
||||||
Elm_Toolbar_Item *it;
|
Elm_Toolbar_Item *it;
|
||||||
it = (Elm_Toolbar_Item *)item;
|
it = (Elm_Toolbar_Item *)item;
|
||||||
|
|
|
@ -460,7 +460,6 @@ typedef Eina_Bool (*Elm_Widget_Del_Pre_Cb)(void *data);
|
||||||
#define ELM_ACCESS_CANCEL -2 /* stop reading immediately */
|
#define ELM_ACCESS_CANCEL -2 /* stop reading immediately */
|
||||||
|
|
||||||
typedef void (*Elm_Access_On_Highlight_Cb)(void *data);
|
typedef void (*Elm_Access_On_Highlight_Cb)(void *data);
|
||||||
typedef void (*Elm_Access_Activate_Cb)(void *data, Evas_Object *part_obj, Elm_Widget_Item *item);
|
|
||||||
|
|
||||||
struct _Elm_Access_Item
|
struct _Elm_Access_Item
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue