elementray - +2 APIs

elm_object_item_disabled_set/get 



SVN revision: 65324
This commit is contained in:
ChunEon Park 2011-11-17 01:58:03 +00:00
parent 085e500875
commit 63d9164a36
4 changed files with 103 additions and 13 deletions

View File

@ -1120,6 +1120,16 @@ extern "C" {
#define elm_object_content_unset(obj) elm_object_content_part_unset((obj), NULL)
/**
* Set the text to read out when in accessibility mode
*
* @param obj The object which is to be described
* @param txt The text that describes the widget to people with poor or no vision
*
* @ingroup General
*/
EAPI void elm_object_access_info_set(Evas_Object *obj, const char *txt);
/**
* Get the widget object's handle which contains a given item
*
@ -1206,16 +1216,6 @@ extern "C" {
#define elm_object_item_text_get(it) elm_object_item_text_part_get((it), NULL)
/**
* Set the text to read out when in accessibility mode
*
* @param obj The object which is to be described
* @param txt The text that describes the widget to people with poor or no vision
*
* @ingroup General
*/
EAPI void elm_object_access_info_set(Evas_Object *obj, const char *txt);
/**
* Set the text to read out when in accessibility mode
*
@ -1228,7 +1228,7 @@ extern "C" {
/**
* Get the data associated with an object item
* @param it The object item
* @param it The Elementary object item
* @return The data associated with @p it
*
* @ingroup General
@ -1237,7 +1237,7 @@ extern "C" {
/**
* Set the data associated with an object item
* @param it The object item
* @param it The Elementary object item
* @param data The data to be associated with @p it
*
* @ingroup General
@ -1256,7 +1256,40 @@ extern "C" {
* @param source The signal's source.
* @ingroup General
*/
EAPI void elm_object_item_signal_emit(Elm_Object_Item *it, const char *emission, const char *source) EINA_ARG_NONNULL(1);
EAPI void elm_object_item_signal_emit(Elm_Object_Item *it, const char *emission, const char *source) EINA_ARG_NONNULL(1);
/**
* Set the disabled state of an widget item.
*
* @param obj The Elementary object item
* @param disabled The state to put in in: @c EINA_TRUE for
* disabled, @c EINA_FALSE for enabled
*
* Elementary object item can be @b disabled, in which state they won't
* receive input and, in general, will be themed differently from
* their normal state, usually greyed out. Useful for contexts
* where you don't want your users to interact with some of the
* parts of you interface.
*
* This sets the state for the widget item, either disabling it or
* enabling it back.
*
* @ingroup Styles
*/
EAPI void elm_object_item_disabled_set(Elm_Object_Item *it, Eina_Bool disabled) EINA_ARG_NONNULL(1);
/**
* Get the disabled state of an widget item.
*
* @param obj The Elementary object
* @return @c EINA_TRUE, if the widget item is disabled, @c EINA_FALSE
* if it's enabled (or on errors)
*
* This gets the state of the widget, which might be enabled or disabled.
*
* @ingroup Styles
*/
EAPI Eina_Bool elm_object_item_disabled_get(const Elm_Object_Item *it) EINA_ARG_NONNULL(1);
/**
* @}

View File

@ -2046,3 +2046,14 @@ elm_object_item_signal_emit(Elm_Object_Item *it, const char *emission, const cha
{
_elm_widget_item_signal_emit((Elm_Widget_Item *) it, emission, source);
}
EAPI void elm_object_item_disabled_set(Elm_Object_Item *it, Eina_Bool disabled)
{
_elm_widget_item_disabled_set((Elm_Widget_Item *) it, disabled);
}
EAPI Eina_Bool elm_object_item_disabled_get(const Elm_Object_Item *it)
{
return _elm_widget_item_disabled_get((Elm_Widget_Item *) it);
}

View File

@ -2889,6 +2889,31 @@ _elm_widget_item_data_get(const Elm_Widget_Item *item)
return (void *)item->data;
}
EAPI void
_elm_widget_item_disabled_set(Elm_Widget_Item *item, Eina_Bool disabled)
{
ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
if (item->disabled == disabled) return;
item->disabled = !!disabled;
if (item->disable_func) item->disable_func(item);
}
EAPI Eina_Bool
_elm_widget_item_disabled_get(const Elm_Widget_Item *item)
{
ELM_WIDGET_ITEM_CHECK_OR_RETURN(item, EINA_FALSE);
return item->disabled;
}
EAPI void
_elm_widget_item_disable_set_hook_set(Elm_Widget_Item *item,
Elm_Widget_On_Disable_Set_Cb func)
{
ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
item->disable_func = func;
}
typedef struct _Elm_Widget_Item_Tooltip Elm_Widget_Item_Tooltip;
struct _Elm_Widget_Item_Tooltip

View File

@ -201,6 +201,8 @@ typedef const char *(*Elm_Widget_On_Text_Get_Cb)(const void *data, const char *p
typedef Evas_Object *(*Elm_Widget_On_Content_Get_Cb)(const void *data, const char *part);
typedef Evas_Object *(*Elm_Widget_On_Content_Unset_Cb)(const void *data, const char *part);
typedef void (*Elm_Widget_On_Signal_Emit_Cb)(void *data, const char *emission, const char *source);
typedef void (*Elm_Widget_On_Disable_Set_Cb)(void *data);
#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
@ -260,8 +262,10 @@ struct _Elm_Widget_Item
Elm_Widget_On_Text_Set_Cb on_text_set_func;
Elm_Widget_On_Text_Get_Cb on_text_get_func;
Elm_Widget_On_Signal_Emit_Cb on_signal_emit_func;
Elm_Widget_On_Disable_Set_Cb disable_func;
Elm_Access_Info *access;
const char *access_info;
Eina_Bool disabled: 1;
/* widget variations should have data from here and on */
/* @todo: TODO check if this is enough for 1.0 release, maybe add padding! */
};
@ -457,6 +461,9 @@ EAPI void _elm_widget_item_text_set_hook_set(Elm_Widget_Item *item,
EAPI void _elm_widget_item_text_get_hook_set(Elm_Widget_Item *item, Elm_Widget_On_Text_Get_Cb func);
EAPI void _elm_widget_item_signal_emit_hook_set(Elm_Widget_Item *it, Elm_Widget_On_Signal_Emit_Cb func);
EAPI void _elm_widget_item_access_info_set(Elm_Widget_Item *item, const char *txt);
EAPI void _elm_widget_item_disabled_set(Elm_Widget_Item *item, Eina_Bool disabled);
EAPI Eina_Bool _elm_widget_item_disabled_get(const Elm_Widget_Item *item);
EAPI void _elm_widget_item_disable_set_hook_set(Elm_Widget_Item *item, Elm_Widget_On_Disable_Set_Cb func);
/* debug function. don't use it unless you are tracking parenting issues */
EAPI void elm_widget_tree_dump(const Evas_Object *top);
@ -624,7 +631,21 @@ EAPI void elm_widget_tree_dot_dump(const Evas_Object *top, FILE *out
*/
#define elm_widget_item_signal_emit_hook_set(item, func) \
_elm_widget_item_signal_emit_hook_set((Elm_Widget_Item *)item, (Elm_Widget_On_Signal_Emit_Cb)func)
/**
* Convenience function to query disable get hook.
* @see _elm_widget_item_disabled_get()
*/
#define elm_widget_item_disabled_get(item) \
_elm_widget_item_disabled_get((Elm_Widget_Item *)item)
EAPI Eina_Bool _elm_widget_item_disabled_get(const Elm_Widget_Item *item);
/**
* Convenience function to query disable set hook.
* @see _elm_widget_item_disable_set_hook_set()
*/
#define elm_widget_item_disable_set_hook_set(item, func) \
_elm_widget_item_disable_set_hook_set((Elm_Widget_Item *) item, (Elm_Widget_On_Disable_Set_Cb)func)
#define ELM_WIDGET_ITEM_CHECK_OR_RETURN(item, ...) \
do { \